/*! For license information please see 903.e25731dc2d5fb7b5c09d.js.LICENSE.txt */
(globalThis.webpackChunk_rio_rio_ui=globalThis.webpackChunk_rio_rio_ui||[]).push([[903],{72168(t,e){!function(){var i={version:"0.4.1",settings:{currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}}},s=Array.prototype.map,n=Array.isArray,a=Object.prototype.toString;function o(t){return!!(""===t||t&&t.charCodeAt&&t.substr)}function r(t){return n?n(t):"[object Array]"===a.call(t)}function l(t){return t&&"[object Object]"===a.call(t)}function h(t,e){var i;for(i in t=t||{},e=e||{})e.hasOwnProperty(i)&&null==t[i]&&(t[i]=e[i]);return t}function c(t,e,i){var n,a,o=[];if(!t)return o;if(s&&t.map===s)return t.map(e,i);for(n=0,a=t.length;n<a;n++)o[n]=e.call(i,t[n],n,t);return o}function d(t,e){return t=Math.round(Math.abs(t)),isNaN(t)?e:t}function u(t){var e=i.settings.currency.format;return"function"==typeof t&&(t=t()),o(t)&&t.match("%v")?{pos:t,neg:t.replace("-","").replace("%v","-%v"),zero:t}:t&&t.pos&&t.pos.match("%v")?t:o(e)?i.settings.currency.format={pos:e,neg:e.replace("%v","-%v"),zero:e}:e}var p=i.unformat=i.parse=function(t,e){if(r(t))return c(t,function(t){return p(t,e)});if("number"==typeof(t=t||0))return t;e=e||i.settings.number.decimal;var s=new RegExp("[^0-9-"+e+"]",["g"]),n=parseFloat((""+t).replace(/\((.*)\)/,"-$1").replace(s,"").replace(e,"."));return isNaN(n)?0:n},g=i.toFixed=function(t,e){e=d(e,i.settings.number.precision);var s=Math.pow(10,e);return(Math.round(i.unformat(t)*s)/s).toFixed(e)},m=i.formatNumber=i.format=function(t,e,s,n){if(r(t))return c(t,function(t){return m(t,e,s,n)});t=p(t);var a=h(l(e)?e:{precision:e,thousand:s,decimal:n},i.settings.number),o=d(a.precision),u=t<0?"-":"",y=parseInt(g(Math.abs(t||0),o),10)+"",f=y.length>3?y.length%3:0;return u+(f?y.substr(0,f)+a.thousand:"")+y.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+a.thousand)+(o?a.decimal+g(Math.abs(t),o).split(".")[1]:"")},y=i.formatMoney=function(t,e,s,n,a,o){if(r(t))return c(t,function(t){return y(t,e,s,n,a,o)});t=p(t);var g=h(l(e)?e:{symbol:e,precision:s,thousand:n,decimal:a,format:o},i.settings.currency),f=u(g.format);return(t>0?f.pos:t<0?f.neg:f.zero).replace("%s",g.symbol).replace("%v",m(Math.abs(t),d(g.precision),g.thousand,g.decimal))};i.formatColumn=function(t,e,s,n,a,g){if(!t)return[];var y=h(l(e)?e:{symbol:e,precision:s,thousand:n,decimal:a,format:g},i.settings.currency),f=u(y.format),x=f.pos.indexOf("%s")<f.pos.indexOf("%v"),b=0,v=c(t,function(t,e){if(r(t))return i.formatColumn(t,y);var s=((t=p(t))>0?f.pos:t<0?f.neg:f.zero).replace("%s",y.symbol).replace("%v",m(Math.abs(t),d(y.precision),y.thousand,y.decimal));return s.length>b&&(b=s.length),s});return c(v,function(t,e){return o(t)&&t.length<b?x?t.replace(y.symbol,y.symbol+new Array(b-t.length+1).join(" ")):new Array(b-t.length+1).join(" ")+t:t})},t.exports&&(e=t.exports=i),e.accounting=i}()},21371(t){"use strict";var e,i=Object.defineProperty,s=Object.defineProperties,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,l=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,d=Reflect.get,u=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),p=Math.pow,g=(t,e,s)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,m=(t,e)=>{for(var i in e||(e={}))h.call(e,i)&&g(t,i,e[i]);if(r)for(var i of r(e))c.call(e,i)&&g(t,i,e[i]);return t},y=(t,e)=>s(t,a(e)),f=(t,e)=>{var i={};for(var s in t)h.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&r)for(var s of r(t))e.indexOf(s)<0&&c.call(t,s)&&(i[s]=t[s]);return i},x=(t,e)=>{for(var s in e)i(t,s,{get:e[s],enumerable:!0})},b=(t,e,s,a)=>{for(var o,r=a>1?void 0:a?n(e,s):e,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(a?o(e,s,r):o(r))||r);return a&&r&&i(e,s,r),r},v=(t,e,i)=>d(l(t),i,e),S=(t,e,i)=>new Promise((s,n)=>{var a=t=>{try{r(i.next(t))}catch(t){n(t)}},o=t=>{try{r(i.throw(t))}catch(t){n(t)}},r=t=>t.done?s(t.value):Promise.resolve(t.value).then(a,o);r((i=i.apply(t,e)).next())}),M=function(t,e){this[0]=t,this[1]=e},k=t=>{var e,i=t[u("asyncIterator")],s=!1,n={};return null==i?(i=t[u("iterator")](),e=t=>n[t]=e=>i[t](e)):(i=i.call(t),e=t=>n[t]=e=>{if(s){if(s=!1,"throw"===t)throw e;return e}return s=!0,{done:!1,value:new M(new Promise(s=>{var n=i[t](e);if(!(n instanceof Object))throw TypeError("Object expected");s(n)}),1)}}),n[u("iterator")]=()=>n,e("next"),"throw"in i?e("throw"):n.throw=t=>{throw t},"return"in i&&e("return"),n},D={};x(D,{AgChart:()=>Im,AgCharts:()=>wm,AgErrorBarSupportedSeriesTypes:()=>w,AgTooltipPositionType:()=>I,Marker:()=>yd,VERSION:()=>Am,_ModuleSupport:()=>Vm,_Scale:()=>_m,_Scene:()=>Tm,_Theme:()=>zm,_Util:()=>jm,__FORCE_MODULE_DETECTION:()=>C,time:()=>L}),t.exports=(e=D,((t,e,s,a)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let s of o(e))h.call(t,s)||void 0===s||i(t,s,{get:()=>e[s],enumerable:!(a=n(e,s))||a.enumerable});return t})(i({},"__esModule",{value:!0}),e));var w=["bar","line","scatter"],I=(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))(I||{}),C=0,L={};x(L,{day:()=>tt,friday:()=>lt,hour:()=>Q,millisecond:()=>F,minute:()=>X,monday:()=>nt,month:()=>dt,saturday:()=>ht,second:()=>$,sunday:()=>st,thursday:()=>rt,tuesday:()=>at,utcDay:()=>ft,utcHour:()=>yt,utcMinute:()=>mt,utcMonth:()=>xt,utcYear:()=>bt,wednesday:()=>ot,year:()=>pt});var A=new Map;function T(t,e){A.has(e)||(A.set(e,!0),t())}function N(t){return t}function*O(...t){for(const e of t)yield*k(e)}function R(t,e=0,i){const{leading:s=!0,trailing:n=!0}=null!=i?i:{};let a,o,r=!1;function l(){n&&o?(a=setTimeout(l,e),t(...o)):r=!1,o=null}return Object.assign(function(...i){r?o=i:(r=!0,a=setTimeout(l,e),s?t(...i):o=i)},{cancel(){clearTimeout(a),r=!1,o=null}})}T.clear=()=>A.clear();var E={log(...t){console.log(...t)},warn(t,...e){console.warn(`AG Charts - ${t}`,...e)},error(t,...e){"object"==typeof t?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)},table(...t){console.table(...t)},warnOnce(t,...e){T(()=>E.warn(t,...e),`Logger.warn: ${t}`)},errorOnce(t,...e){T(()=>E.error(t,...e),`Logger.error: ${t}`)}},P=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,i){var s;const n=null==(s=this._rangeCallback)?void 0:s.call(this,t,e),a=this._encode(i?this.floor(t):this.ceil(t)),o=this._encode(i?this.ceil(e):this.floor(e));if(o<a)return[];const r=[];for(let t=a;t<=o;t++){const e=this._decode(t);r.push(e)}return null==n||n(),r}},B=class extends P{getOffset(t,e){const i="number"==typeof t||t instanceof Date?this._encode(new Date(t)):0;return Math.floor(i)%e}every(t,e){let i,s=0;const n=t;n!==(t=Math.max(1,Math.round(t)))&&E.warnOnce(`interval step of [${n}] rounded to [${t}].`);const{snapTo:a="start"}=null!=e?e:{};if("string"==typeof a){const e=s;i=(i,n)=>{const o="start"===a?i:n;return s=this.getOffset(o,t),()=>s=e}}else"number"==typeof a?s=this.getOffset(new Date(a),t):a instanceof Date&&(s=this.getOffset(a,t));return new P(e=>{const i=this._encode(e);return Math.floor((i-s)/t)},e=>this._decode(e*t+s),i)}},F=new B(function(t){return t.getTime()},function(t){return new Date(t)}),z=F,G=(new Date(0).getFullYear(),1e3),_=6e4,j=36e5,W=864e5,V=6048e5,K=31536e6,Y=(new Date).getTimezoneOffset()*_,$=new B(function(t){return Math.floor((t.getTime()-Y)/G)},function(t){return new Date(Y+t*G)}),H=$,U=(new Date).getTimezoneOffset()*_,X=new B(function(t){return Math.floor((t.getTime()-U)/_)},function(t){return new Date(U+t*_)}),Z=X,q=(new Date).getTimezoneOffset()*_,Q=new B(function(t){return Math.floor((t.getTime()-q)/j)},function(t){return new Date(q+t*j)}),J=Q,tt=new B(function(t){const e=t.getTimezoneOffset()*_;return Math.floor((t.getTime()-e)/W)},function(t){const e=new Date(1970,0,1);return e.setDate(e.getDate()+t),e}),et=tt;function it(t){const e=(7+t-4)%7;return new B(function(t){const i=t.getTimezoneOffset()*_;return Math.floor((t.getTime()-i)/V-e/7)},function(t){const i=new Date(1970,0,1);return i.setDate(i.getDate()+7*t+e),i})}var st=it(0),nt=it(1),at=it(2),ot=it(3),rt=it(4),lt=it(5),ht=it(6),ct=st,dt=new B(function(t){return 12*t.getFullYear()+t.getMonth()},function(t){const e=Math.floor(t/12);return new Date(e,t-12*e,1)}),ut=dt,pt=new B(function(t){return t.getFullYear()},function(t){const e=new Date;return e.setFullYear(t),e.setMonth(0,1),e.setHours(0,0,0,0),e}),gt=pt,mt=new B(function(t){return Math.floor(t.getTime()/_)},function(t){return new Date(t*_)}),yt=new B(function(t){return Math.floor(t.getTime()/j)},function(t){return new Date(t*j)}),ft=new B(function(t){return Math.floor(t.getTime()/W)},function(t){const e=new Date(0);return e.setUTCDate(e.getUTCDate()+t),e.setUTCHours(0,0,0,0),e}),xt=new B(function(t){return 12*t.getUTCFullYear()+t.getUTCMonth()},function(t){const e=Math.floor(t/12),i=t-12*e;return new Date(Date.UTC(e,i,1))}),bt=new B(function(t){return t.getUTCFullYear()},function(t){const e=new Date;return e.setUTCFullYear(t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0),e}),vt={isEnterprise:!1},St=class{constructor(){this.destroyFns=[]}destroy(){for(const t of this.destroyFns)t()}},Mt=new class{constructor(){this.modules=[],this.dependencies=new Set,this.dependents=new Set}register(...t){for(const e of t){this.registerDependencies(e);const t=this.modules.find(t=>e.type===t.type&&e.optionsKey===t.optionsKey&&e.identifier===t.identifier);if(t){if("enterprise"===e.packageType&&"community"===t.packageType){const i=this.modules.indexOf(t);this.modules.splice(i,1,e)}}else this.modules.push(e)}}hasEnterpriseModules(){return this.modules.some(t=>"enterprise"===t.packageType)}*byType(...t){for(const e of this.modules)t.includes(e.type)&&this.dependencies.has(e.optionsKey)&&(yield e);for(const e of this.modules)!t.includes(e.type)||this.dependencies.has(e.optionsKey)||this.dependents.has(e.optionsKey)||(yield e);for(const e of this.modules)t.includes(e.type)&&this.dependents.has(e.optionsKey)&&(yield e)}registerDependencies(t){if(null!=t.dependencies&&0!==t.dependencies.length){if(this.dependencies.has(t.optionsKey))throw new Error(`Module [${t.optionsKey}] can not both be depended upon by any module and have dependencies of [${t.dependencies}].`);for(const e of t.dependencies){if(this.dependents.has(e))throw new Error(`Module [${e}] can not both be depended upon by any module and have dependencies of [${t.optionsKey}].`);this.dependencies.add(e)}this.dependents.add(t.optionsKey)}}},kt=new class{constructor(){this.axesMap=new Map,this.hidden=new Set,this.themeTemplates=new Map}register(t,e){this.axesMap.set(t,e.instanceConstructor),e.themeTemplate&&this.setThemeTemplate(t,e.themeTemplate),e.hidden&&this.hidden.add(t)}create(t,e){const i=this.axesMap.get(t);if(i)return new i(e);throw new Error(`AG Charts - unknown axis type: ${t}`)}has(t){return this.axesMap.has(t)}keys(){return this.axesMap.keys()}publicKeys(){return[...this.keys()].filter(t=>!this.hidden.has(t))}setThemeTemplate(t,e){return this.themeTemplates.set(t,e),this}getThemeTemplate(t){return this.themeTemplates.get(t)}},Dt=Symbol("BREAK"),wt="__decorator_config";function It(t,e){null==Object.getOwnPropertyDescriptor(t,wt)&&Object.defineProperty(t,wt,{value:{}});const i=t[wt],s=e.toString();if(void 0!==i[s])return i[s];const n=new WeakMap;i[s]={setters:[],getters:[],observers:[],valuesMap:n};const a=Object.getOwnPropertyDescriptor(t,e),o=null==a?void 0:a.set,r=null==a?void 0:a.get;return Object.defineProperty(t,e,{set:function(t){const{setters:a,observers:l}=i[s];let h;a.some(t=>t.length>2)&&(h=r?r.call(this):n.get(this));for(const i of a)if((t=i(this,e,t,h))===Dt)return;o?o.call(this,t):n.set(this,t);for(const e of l)e(this,t,h)},get:function(){let t=r?r.call(this):n.get(this);for(const n of i[s].getters)if(t=n(this,e,t),t===Dt)return;return t},enumerable:!0,configurable:!1}),i[s]}function Ct(t,e,i){return(s,n)=>{const a=It(s,n);a.setters.push(t),e&&a.getters.unshift(e),i&&Object.assign(a,i)}}function Lt(t){return void 0!==t&&wt in t}function At(t){const e=new Set;for(;Lt(t);)e.add(null==t?void 0:t[wt]),t=Object.getPrototypeOf(t);return Array.from(e).flatMap(t=>Object.keys(t))}function Tt(t){return At(t).reduce((e,i)=>{var s;return e[i]=null!=(s=t[i])?s:null,e},{})}function Nt(t){return null!=t}function Ot(t){return Array.isArray(t)}function Rt(t){return"boolean"==typeof t}function Et(t){return t instanceof Date}function Pt(t){return Et(t)&&!isNaN(Number(t))}function Bt(t){return t instanceof RegExp}function Ft(t){return"function"==typeof t}function zt(t){return"object"==typeof t&&null!==t&&!Ot(t)}function Gt(t){return Ot(t)||_t(t)}function _t(t){return"object"==typeof t&&null!==t&&t.constructor===Object}function jt(t){return"string"==typeof t}function Wt(t){return"number"==typeof t}function Vt(t){return Wt(t)&&Number.isFinite(t)}function Kt(t){return"undefined"!=typeof window&&t instanceof HTMLElement}function Yt(t,e){return jt(e)&&Object.keys(t).includes(e)}function $t(t,e){return Object.values(t).includes(e)}function Ht(t){return"symbol"==typeof t}function Ut(...t){return Xt(...t.reverse())}function Xt(...t){const e={};for(const i of t){if(!zt(i))continue;const t=Lt(i)?At(i):Object.keys(i);for(const s of t)_t(e[s])&&_t(i[s])?e[s]=Xt(e[s],i[s]):null!=e[s]||(e[s]=i[s])}return e}function Zt(t,...e){return e&&Ot(t)?t.map(t=>Xt(t,...e)):t}function qt(t,e){return Object.entries(t).reduce((i,[s,n])=>(i[s]=e(n,s,t),i),{})}function Qt(t,e){const i=m({},t);for(const t of e)delete i[t];return i}function Jt(t,e){return(Ot(e)?e:e.split(".")).reduce((t,e)=>t[e],t)}var te=new Set(["__proto__","constructor","prototype"]);function ee(t,e,i){const s=Ot(e)?e.slice():e.split("."),n=s.pop();s.some(t=>te.has(t))||(s.reduce((t,e)=>t[e],t)[n]=i)}function ie(t,e,i){if(void 0===i)return e;for(const s of t){const t=i[s];void 0!==t&&(e[s]=t)}return e}var se=class extends Map{get(t){var e;return null!=(e=super.get(t))?e:"unknown"}isCartesian(t){return"cartesian"===this.get(t)}isPolar(t){return"polar"===this.get(t)}isHierarchy(t){return"hierarchy"===this.get(t)}isTopology(t){return"topology"===this.get(t)}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))}},ne=class extends Map{set(t,e){return super.set(t,Xt(e,this.get(t)))}},ae=new se,oe=new se,re=new ne,le=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology"],optionsInnerKey:"image"},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"],optionsInnerKey:"miniChart"},{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:"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:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bullet"},{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-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"}];function he(t){var e;return null==(e=le.find(e=>"series"===e.type&&e.identifier===t))?void 0:e.chartTypes}function ce(t){if(!function(t){return"enterprise"===t.packageType}(t))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const e=le.find(e=>e.type===t.type&&e.optionsKey===t.optionsKey&&e.identifier===t.identifier&&t.chartTypes.every(t=>e.chartTypes.includes(t)));return e&&(null!=e.useCount||(e.useCount=0),e.useCount++),null!=e}function de(t){var e,i,s;return null!=(s=null==(i=null==(e=t.series)?void 0:e[0])?void 0:i.type)?s:"line"}function ue(t){const e=de(t);return null==e||("cartesian"===e?(E.warnOnce(`type '${e}' is deprecated, use a series type instead`),!0):ae.isCartesian(e)||"cartesian"===(null==(i=he(e))?void 0:i.find(t=>"cartesian"===t)));var i}function pe(t){const e=de(t);return null!=e&&("polar"===e?(E.warnOnce(`type '${e}' is deprecated, use a series type instead`),!0):ae.isPolar(e)||"polar"===(null==(i=he(e))?void 0:i.find(t=>"polar"===t)));var i}function ge(t){const e=de(t);return null!=e&&("hierarchy"===e?(E.warnOnce(`type '${e}' is deprecated, use a series type instead`),!0):ae.isHierarchy(e)||"hierarchy"===(null==(i=he(e))?void 0:i.find(t=>"hierarchy"===t)));var i}function me(t){const e=de(t);return null!=e&&("topology"===e?(E.warnOnce(`type '${e}' is deprecated, use a series type instead`),!0):ae.isTopology(e)||"topology"===(null==(i=he(e))?void 0:i.find(t=>"topology"===t)));var i}function ye(t){return null!=t&&kt.has(t)}var fe=class{set(t){const{className:e=this.constructor.name}=this.constructor;if("object"!=typeof t)return E.warn(`unable to set ${e} - expecting a properties object`),this;const i=new Set(Object.keys(t));for(const e of At(this))if(i.has(e)){const s=t[e],n=this;be(n[e])?n[e]=n[e]instanceof xe?n[e].reset(s):n[e].set(s):n[e]=s,i.delete(e)}for(const t of i)E.warn(`unable to set [${t}] in ${e} - property is unknown`);return this}isValid(){return At(this).every(t=>{const{optional:e}=function(t,e){const i=e.toString();for(;Lt(t);){const e=t[wt];if(Object.hasOwn(e,i))return e[i];t=Object.getPrototypeOf(t)}}(this,t),i=e||void 0!==this[t];return i||E.warnOnce(`[${t}] is required.`),i})}toJson(){return At(this).reduce((t,e)=>{const i=this[e];return t[e]=be(i)?i.toJson():i,t},{})}},xe=class t extends Array{constructor(t,...e){super(e.length),Object.defineProperty(this,"itemFactory",{value:t,enumerable:!1,configurable:!1}),this.set(e)}set(t){if(Ot(t)){this.length=t.length;for(let e=0;e<t.length;e++)this[e]=(new this.itemFactory).set(t[e])}return this}reset(e){return new t(this.itemFactory,...e)}toJson(){return this.map(t=>{var e,i;return null!=(i=null==(e=null==t?void 0:t.toJson)?void 0:e.call(t))?i:t})}};function be(t){return t instanceof fe||t instanceof xe}var ve="class-instance";function Se(t,e,i){if(Ot(e)){if(!Ot(t)||t.length!==e.length||e.some((e,i)=>null!=Se(t[i],e)))return e}else{if(_t(e)){if(!_t(t))return e;const s={},n=new Set([...Object.keys(t),...Object.keys(e)]);for(const a of n)if(t[a]!==e[a]&&!(null==i?void 0:i.includes(a)))if(typeof t[a]==typeof e[a]){const i=Se(t[a],e[a]);null!==i&&(s[a]=i)}else s[a]=e[a];return Object.keys(s).length?s:null}if(t!==e)return e}return null}function Me(t,e){return Ot(t)?t.map(t=>Me(t,e)):_t(t)?qt(t,(t,i)=>{var s;return(null==(s=null==e?void 0:e.shallow)?void 0:s.includes(i))?ke(t):Me(t,e)}):ke(t)}function ke(t){return Ot(t)?[...t]:_t(t)?m({},t):Et(t)?new Date(t):Bt(t)?new RegExp(t.source,t.flags):t}function De(t,e,i,...s){var n;if(Ot(t))e(t,...s),t.forEach((t,n)=>{De(t,e,i,...Ie(s,n))});else if(_t(t)){e(t,...s);for(const a of Object.keys(t)){if(null==(n=null==i?void 0:i.skip)?void 0:n.includes(a))continue;const o=t[a];(Ot(o)||_t(o))&&De(o,e,i,...Ie(s,a))}}}function we(t,e,i={}){const{path:s,constructedArrays:n,matcherPath:a=(null==s?void 0:s.replace(/(\[[0-9+]+])/i,"[]")),skip:o=[]}=i;if(null==t)throw new Error(`AG Charts - target is uninitialised: ${null!=s?s:"<root>"}`);if(null==e)return t;if(be(t))return t.set(e);const r=t,l=Ce(t);for(const h in e){if(te.has(h))continue;const c=`${a?a+".":""}${h}`;if(o.includes(c))continue;const d=e[h],u=`${s?s+".":""}${h}`,p=r.constructor,g=r[h];let f;try{const e=Ce(g),s=Ce(d);if(l===ve&&!(h in t)){E.warn(`unable to set [${u}] in ${null==p?void 0:p.name} - property is unknown`);continue}if(null!=e&&null!=s&&s!==e&&(e!==ve||"object"!==s)){E.warn(`unable to set [${u}] in ${null==p?void 0:p.name} - can't apply type of [${s}], allowed types are: [${e}]`);continue}if(be(g))r[h].set(d);else if("array"===s)if(null!=f||(f=null==n?void 0:n.get(g)),null==f)r[h]=d;else{const t=d;r[h]=t.map(t=>we(new f,t,y(m({},i),{path:u,matcherPath:c+"[]"})))}else s===ve?r[h]=d:"object"===s?null!=g?we(g,d,y(m({},i),{path:u,matcherPath:c})):null==f?(r[h]={},we(r[h],d,y(m({},i),{path:u,matcherPath:c}))):r[h]=we(new f,d,y(m({},i),{path:u,matcherPath:c})):r[h]=d}catch(t){E.warn(`unable to set [${u}] in [${null==p?void 0:p.name}]; nested error is: ${t.message}`)}}return t}function Ie(t,e){return t.map(t=>null==t?void 0:t[e])}function Ce(t){return null==t?null:Kt(t)||Et(t)?"primitive":Ot(t)?"array":zt(t)?_t(t)?"object":ve:Ft(t)?"function":"primitive"}var Le=new class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(t,{chartTypes:[e],instanceConstructor:i,defaultAxes:s,themeTemplate:n,enterpriseThemeTemplate:a,paletteFactory:o,solo:r,stackable:l,groupable:h,stackedByDefault:c,swapDefaultAxesCondition:d,hidden:u}){this.setThemeTemplate(t,n,a),this.seriesMap.set(t,{instanceConstructor:i,defaultAxes:s,paletteFactory:o,solo:r,stackable:l,groupable:h,stackedByDefault:c,swapDefaultAxesCondition:d}),ae.set(t,e),u||oe.set(t,e)}create(t,e){var i;const s=null==(i=this.seriesMap.get(t))?void 0:i.instanceConstructor;if(s)return new s(e);throw new Error(`AG Charts - unknown series type: ${t}`)}cloneDefaultAxes(t){var e;const i=null==(e=this.seriesMap.get(t))?void 0:e.defaultAxes;return i?{axes:Me(i)}:null}setThemeTemplate(t,e,i={}){const s=this.themeTemplates.get(t);this.themeTemplates.set(t,{community:Xt(e,null==s?void 0:s.community),enterprise:Xt(i,e,null==s?void 0:s.community)})}getThemeTemplate(t){const e=this.themeTemplates.get(t);return vt.isEnterprise?null==e?void 0:e.enterprise:null==e?void 0:e.community}getPaletteFactory(t){var e;return null==(e=this.seriesMap.get(t))?void 0:e.paletteFactory}isSolo(t){var e,i;return null!=(i=null==(e=this.seriesMap.get(t))?void 0:e.solo)&&i}isGroupable(t){var e,i;return null!=(i=null==(e=this.seriesMap.get(t))?void 0:e.groupable)&&i}isStackable(t){var e,i;return null!=(i=null==(e=this.seriesMap.get(t))?void 0:e.stackable)&&i}isStackedByDefault(t){var e,i;return null!=(i=null==(e=this.seriesMap.get(t))?void 0:e.stackedByDefault)&&i}isDefaultAxisSwapNeeded(t){var e,i,s;let n;for(const a of null!=(e=t.series)?e:[]){const{type:t="line"}=a,e=null==(s=null==(i=this.seriesMap.get(t))?void 0:i.swapDefaultAxesCondition)?void 0:s.call(i,a);if(null!=e){if(null!=n&&n!=e)throw new Error("AG Charts - The provided series have incompatible directions");n=e}}return n}},Ae=new class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(t,{optionsKey:e,instanceConstructor:i,themeTemplate:s}){this.legendMap.set(t,{optionsKey:e,instanceConstructor:i}),this.themeTemplates.set(e,s)}create(t,e){var i;const s=null==(i=this.legendMap.get(t))?void 0:i.instanceConstructor;if(s)return new s(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),{})}},Te=(t=>(t[t.SMALL=12]="SMALL",t[t.MEDIUM=13]="MEDIUM",t[t.LARGE=17]="LARGE",t))(Te||{}),Ne=(t=>(t.NORMAL="normal",t.BOLD="bold",t.BOLDER="bolder",t.LIGHTER="lighter",t))(Ne||{}),Oe=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t))(Oe||{}),Re=(t=>(t.CATEGORY="category",t.ORDINAL_TIME="ordinal-time",t.NUMBER="number",t.TIME="time",t.LOG="log",t))(Re||{}),Ee=(t=>(t.ANGLE_CATEGORY="angle-category",t.ANGLE_NUMBER="angle-number",t.RADIUS_CATEGORY="radius-category",t.RADIUS_NUMBER="radius-number",t))(Ee||{}),Pe=(t=>(t.CIRCLE="circle",t.POLYGON="polygon",t))(Pe||{}),Be={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Fe={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},ze=Symbol("is-dark-theme"),Ge=Symbol("extends-axes-defaults"),_e=Symbol("extends-axes-line-defaults"),je=Symbol("extends-axes-tick-defaults"),We=Symbol("extends-axes-grid-line-defaults"),Ve=Symbol("extends-series-defaults"),Ke=Symbol("extends-cartesian-marker-defaults"),Ye=Symbol("default-font"),$e=Symbol("default-label-colour"),He=Symbol("default-inverted-label-colour"),Ue=Symbol("default-inside-series-label-colour"),Xe=Symbol("default-muted-label-colour"),Ze=Symbol("default-axis-grid-colour"),qe=Symbol("default-axis-line-colour"),Qe=Symbol("default-cross-lines-colour"),Je=Symbol("default-background-colour"),ti=Symbol("default-shadow-colour"),ei=Symbol("default-colours"),ii=Symbol("default-waterfall-series-positive-colors"),si=Symbol("default-waterfall-series-negative-colors"),ni=Symbol("default-waterfall-series-total-colors"),ai=Symbol("default-waterfall-series-connector-line-stroke"),oi=Symbol("default-polar-series-stroke"),ri=Symbol("default-diverging-series-colour-range"),li=Symbol("default-hierarchy-fills"),hi=Symbol("default-hierarchy-strokes"),ci=Symbol("default-annotation-stroke"),di=Symbol("default-annotation-background-fill"),ui=Symbol("default-annotation-handle-fill"),pi="white",gi={fills:Object.values(Be),strokes:Object.values(Fe)},mi={get cartesian(){return{seriesTypes:ae.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:ae.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:ae.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:ae.topologyTypes,commonOptions:[]}}},yi=Object.values(mi).reduce((t,{commonOptions:e})=>t.concat(e),[]),fi=class t{getPalette(){return gi}static getAxisDefaults(t){return Xt(t,{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:"normal",fontSize:13,fontFamily:Ye,color:$e},label:{fontSize:12,fontFamily:Ye,padding:5,color:$e,avoidCollisions:!0},line:{enabled:!0,width:1,color:qe},tick:{enabled:!1,width:1,color:qe},gridLine:{enabled:!0,style:[{stroke:Ze,lineDash:[]}]},crossLines:{enabled:!1,fill:Qe,stroke:Qe,fillOpacity:.1,strokeWidth:1,label:{enabled:!1,fontSize:12,fontFamily:Ye,padding:5,color:$e}}})}static getSeriesDefaults(){return{visible:!0,showInLegend:!0,highlightStyle:{item:{fill:"#ffffff54",stroke:"#0006",strokeWidth:2},series:{dimOpacity:1}},nodeClickRange:"exact",tooltip:{enabled:!0}}}static getCartesianSeriesMarkerDefaults(){return{enabled:!0,shape:"circle",size:7,strokeWidth:1}}static getChartDefaults(){return{background:{visible:!0,fill:Je},padding:{top:20,right:20,bottom:20,left:20},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",fontWeight:"normal",fontSize:17,fontFamily:Ye,color:$e,wrapping:"hyphenate"},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontSize:13,fontFamily:Ye,color:Xe,wrapping:"hyphenate"},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:13,fontFamily:Ye,color:"rgb(140, 140, 140)",wrapping:"hyphenate"},legend:{position:"bottom",spacing:30,listeners:{},item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},toggleSeriesVisible:!0,label:{color:$e,fontSize:12,fontFamily:Ye}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:$e},inactiveStyle:{fill:Xe},highlightStyle:{fill:$e},label:{color:$e}}},tooltip:{enabled:!0,darkTheme:ze,range:"nearest",delay:0},overlays:{loading:{darkTheme:ze},noData:{darkTheme:ze},noVisibleSeries:{darkTheme:ze}},listeners:{}}}constructor(t={}){const{overrides:e,palette:i}=Me(t),s=this.createChartConfigPerChartType(this.getDefaults());e&&this.mergeOverrides(s,e),this.config=Object.freeze(this.templateTheme(s)),this.palette=Xt(i,this.getPalette())}mergeOverrides(t,e){for(const{seriesTypes:i,commonOptions:s}of Object.values(mi)){const n=m({},e.common);for(const t of yi)s.includes(t)||delete n[t];if(n)for(const e of i){const i=e;t[i]=Xt(n,t[i])}}ae.seriesTypes.forEach(i=>{const s=i;e[s]&&(t[s]=Xt(e[s],t[s]))})}createChartConfigPerChartType(t){for(const[e,{seriesTypes:i}]of Object.entries(mi)){const s=re.get(e);for(const e of i)t[e]||(t[e]=Me(s))}return t}getDefaults(){const e=(e,i)=>{var s;const n={},a=m(m(m({axes:{}},Ae.getThemeTemplates()),t.getChartDefaults()),re.get(e));for(const o of i){n[o]=Xt(Le.getThemeTemplate(o),null!=(s=n[o])?s:Me(a));const{axes:i}=n[o];for(const s of kt.keys())i[s]=Xt(i[s],kt.getThemeTemplate(s),"cartesian"===e&&t.cartesianAxisDefault[s])}return n};return Xt(e("cartesian",ae.cartesianTypes),e("polar",ae.polarTypes),e("hierarchy",ae.hierarchyTypes),e("topology",ae.topologyTypes))}templateTheme(t){const e=Me(t),{extensions:i,properties:s}=this.getTemplateParameters();return De(e,t=>{if(t.__extends__){const e=t.__extends__,s=i.get(e);if(null==s)throw new Error(`AG Charts - no template variable provided for: ${e}`);Object.keys(s).forEach(e=>{e in t?zt(t[e])&&(t[e]=Xt(t[e],s[e])):t[e]=s[e]}),delete t.__extends__}if(Ot(t))for(let e=0;e<t.length;e++){const i=t[e];s.has(i)&&(t[e]=s.get(i))}else for(const[e,i]of Object.entries(t))s.has(i)&&(t[e]=s.get(i))}),Me(e)}static getDefaultColors(){return{fills:Be,strokes:Fe}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Be.BLUE,stroke:Fe.BLUE,label:{color:$e}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Be.ORANGE,stroke:Fe.ORANGE,label:{color:$e}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Be.GRAY,stroke:Fe.GRAY,label:{color:$e}}}getTemplateParameters(){const e=new Map;e.set(Ge,t.getAxisDefaults()),e.set(_e,t.getAxisDefaults().line),e.set(je,t.getAxisDefaults().tick),e.set(We,t.getAxisDefaults().gridLine),e.set(Ve,t.getSeriesDefaults()),e.set(Ke,t.getCartesianSeriesMarkerDefaults());const i=new Map;return i.set(ze,!1),i.set(Ye,"Verdana, sans-serif"),i.set($e,"rgb(70, 70, 70)"),i.set(He,"white"),i.set(Xe,"rgb(140, 140, 140)"),i.set(Ze,"rgb(224,234,241)"),i.set(qe,"rgb(195, 195, 195)"),i.set(Qe,"rgb(70, 70, 70)"),i.set(Ue,pi),i.set(Je,pi),i.set(ti,"rgba(0, 0, 0, 0.5)"),i.set(ri,[Be.ORANGE,Be.YELLOW,Be.GREEN]),i.set(li,["#ffffff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"]),i.set(hi,["#ffffff","#c5cbd1","#a4b1bd","#8498a9","#648096"]),i.set(oi,pi),i.set(ei,t.getDefaultColors()),i.set(ii,t.getWaterfallSeriesDefaultPositiveColors()),i.set(si,t.getWaterfallSeriesDefaultNegativeColors()),i.set(ni,t.getWaterfallSeriesDefaultTotalColors()),i.set(ai,t.getWaterfallSeriesDefaultTotalColors().stroke),i.set(ci,Fe.BLUE),i.set(di,Be.BLUE),i.set(ui,pi),{extensions:e,properties:i}}};fi.cartesianAxisDefault={number:fi.getAxisDefaults({line:{enabled:!1}}),log:fi.getAxisDefaults({base:10,line:{enabled:!1}}),category:fi.getAxisDefaults({groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:!1}}),time:fi.getAxisDefaults({gridLine:{enabled:!1}}),"grouped-category":fi.getAxisDefaults()};var xi=fi,bi="#192232",vi={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Si={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},Mi={fills:Object.values(vi),strokes:Object.values(Si)},ki=class t extends xi{static getDefaultColors(){return{fills:vi,strokes:Si}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:vi.BLUE,stroke:Si.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:vi.ORANGE,stroke:Si.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:vi.GRAY,stroke:Si.GRAY,label:{color:"white"}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ze,!0),e.properties.set(ei,t.getDefaultColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(si,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(ai,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(oi,bi),e.properties.set($e,"white"),e.properties.set(Xe,"#7D91A0"),e.properties.set(Ze,"#545A6E"),e.properties.set(Qe,"white"),e.properties.set(ri,[vi.ORANGE,vi.YELLOW,vi.GREEN]),e.properties.set(li,["#192834","#253746","#324859","#3f596c","#4d6a80"]),e.properties.set(hi,["#192834","#3b5164","#496275","#577287","#668399"]),e.properties.set(Je,bi),e.properties.set(Ue,bi),e.properties.set(ci,Si.BLUE),e.properties.set(di,vi.BLUE),e.properties.set(ui,bi),e}getPalette(){return Mi}constructor(t){super(t)}},Di={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},wi={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},Ii={fills:Object.values(Di),strokes:Object.values(wi)},Ci=class t extends ki{static getDefaultColors(){return{fills:Di,strokes:wi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Di.BLUE,stroke:wi.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Di.RED,stroke:wi.RED,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Di.GRAY,stroke:wi.GRAY,label:{color:"white"}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ei,t.getDefaultColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(si,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(ri,[Di.ORANGE,Di.YELLOW,Di.GREEN]),e.properties.set(ai,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(ci,wi.BLUE),e.properties.set(di,Di.BLUE),e}getPalette(){return Ii}},Li={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Ai={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},Ti={fills:Object.values(Li),strokes:Object.values(Ai)},Ni=class t extends xi{static getDefaultColors(){return{fills:Li,strokes:Ai}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Li.BLUE,stroke:Ai.BLUE,label:{color:$e}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Li.RED,stroke:Ai.RED,label:{color:$e}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Li.GRAY,stroke:Ai.GRAY,label:{color:$e}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ei,t.getDefaultColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(si,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(ri,[Li.ORANGE,Li.YELLOW,Li.GREEN]),e.properties.set(ai,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(ci,Ai.BLUE),e.properties.set(di,Li.BLUE),e}getPalette(){return Ti}},Oi={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4"},Ri={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff"},Ei={fills:Object.values(Oi),strokes:Object.values(Ri)},Pi=class t extends ki{static getDefaultColors(){return{fills:Oi,strokes:Ri}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Oi.BLUE,stroke:Ri.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Oi.RED,stroke:Ri.RED,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:"#bbbbbb",stroke:"#eeeeee",label:{color:"white"}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ei,t.getDefaultColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(si,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(ri,[Oi.BLUE,Oi.RED]),e.properties.set(ai,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(ci,Ri.BLUE),e.properties.set(di,Oi.BLUE),e}getPalette(){return Ei}},Bi={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4"},Fi={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb"},zi={fills:Object.values(Bi),strokes:Object.values(Fi)},Gi=class t extends xi{static getDefaultColors(){return{fills:Bi,strokes:Fi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Bi.BLUE,stroke:Fi.BLUE,label:{color:$e}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Bi.RED,stroke:Fi.RED,label:{color:$e}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:"#bbbbbb",stroke:"#888888",label:{color:$e}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ei,t.getDefaultColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(si,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(ri,[Bi.BLUE,Bi.RED]),e.properties.set(ai,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(ci,Fi.BLUE),e.properties.set(di,Bi.BLUE),e}getPalette(){return zi}},_i={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},ji={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},Wi={fills:Object.values(_i),strokes:Object.values(ji)},Vi=class t extends ki{static getDefaultColors(){return{fills:y(m({},_i),{RED:_i.ORANGE}),strokes:y(m({},ji),{RED:ji.ORANGE})}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:_i.BLUE,stroke:ji.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:_i.ORANGE,stroke:ji.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:_i.GRAY,stroke:ji.GRAY,label:{color:"white"}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ei,t.getDefaultColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(si,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(ri,[_i.ORANGE,_i.YELLOW,_i.GREEN]),e.properties.set(ai,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(ci,ji.BLUE),e.properties.set(di,_i.BLUE),e}getPalette(){return Wi}},Ki={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},Yi={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},$i={fills:Object.values(Ki),strokes:Object.values(Yi)},Hi=class t extends xi{static getDefaultColors(){return{fills:y(m({},Ki),{RED:Ki.ORANGE}),strokes:y(m({},Yi),{RED:Yi.ORANGE})}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Ki.BLUE,stroke:Yi.BLUE,label:{color:$e}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Ki.ORANGE,stroke:Yi.ORANGE,label:{color:$e}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Ki.GRAY,stroke:Yi.GRAY,label:{color:$e}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ei,t.getDefaultColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(si,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(ri,[Ki.ORANGE,Ki.YELLOW,Ki.GREEN]),e.properties.set(ai,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(ci,Yi.BLUE),e.properties.set(di,Ki.BLUE),e}getPalette(){return $i}},Ui={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Xi={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#c18aff",YELLOW:"#fff653",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},Zi={fills:Object.values(Ui),strokes:Object.values(Xi)},qi=class t extends ki{static getDefaultColors(){return{fills:Ui,strokes:Xi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Ui.BLUE,stroke:Xi.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Ui.ORANGE,stroke:Xi.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Ui.GRAY,stroke:Xi.GRAY,label:{color:"white"}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ei,t.getDefaultColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(si,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(ri,[Ui.ORANGE,Ui.YELLOW,Ui.GREEN]),e.properties.set(ai,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(ci,Xi.BLUE),e.properties.set(di,Ui.BLUE),e}getPalette(){return Zi}},Qi={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Ji={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},ts={fills:Object.values(Qi),strokes:Object.values(Ji)},es=class t extends xi{static getDefaultColors(){return{fills:Qi,strokes:Ji}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Qi.BLUE,stroke:Ji.BLUE,label:{color:$e}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Qi.ORANGE,stroke:Ji.ORANGE,label:{color:$e}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Qi.GRAY,stroke:Ji.GRAY,label:{color:$e}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ei,t.getDefaultColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(si,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(ri,[Qi.ORANGE,Qi.YELLOW,Qi.GREEN]),e.properties.set(ai,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(ci,Ji.BLUE),e.properties.set(di,Qi.BLUE),e}getPalette(){return ts}},is=()=>new xi,ss=()=>new ki,ns={undefined:is,null:is,"ag-default":is,"ag-sheets":()=>new Hi,"ag-polychroma":()=>new Gi,"ag-vivid":()=>new es,"ag-material":()=>new Ni},as=m(m({},{undefined:ss,null:ss,"ag-default-dark":ss,"ag-sheets-dark":()=>new Vi,"ag-polychroma-dark":()=>new Pi,"ag-vivid-dark":()=>new qi,"ag-material-dark":()=>new Ci}),ns);function os(t){let e=function(t){return void 0===t||"string"==typeof t||t instanceof xi?t:"object"==typeof t?function(t){if(null===t)return;let e=!0;const{baseTheme:i,palette:s,overrides:n}=t;if(void 0!==i&&"string"!=typeof i&&"object"!=typeof i&&(E.warn(`invalid theme.baseTheme type ${typeof i}, expected (string | object).`),e=!1),void 0!==n&&"object"!=typeof n&&(E.warn(`invalid theme.overrides type ${typeof n}, expected object.`),e=!1),"object"==typeof s){if(null!==s){const{fills:t,strokes:i}=s;void 0===t||Array.isArray(t)||(E.warn("theme.overrides.fills must be undefined or an array"),e=!1),void 0===i||Array.isArray(i)||(E.warn("theme.overrides.strokes must be undefined or an array"),e=!1)}}else void 0!==s&&(E.warn(`invalid theme.palette type ${typeof s}, expected object.`),e=!1);return e?t:void 0}(t):void E.warn(`invalid theme value type ${typeof t}, expected object or string.`)}(t);if(e instanceof xi)return e;if(null==e||"string"==typeof e){const t=as[e];return t?t():(E.warnOnce(`the theme [${e}] is invalid, using [ag-default] instead.`),is())}const i=[];let s;for(;"object"==typeof e;)i.push(e.overrides),null!=s||(s=e.palette),e=e.baseTheme;const n={baseTheme:e,overrides:Xt(...i),palette:s};return new((n.baseTheme?os(n.baseTheme):is()).constructor)(n)}function rs(t){if(0===t.length)return;let e=1/0,i=-1/0;for(let s of t)s instanceof Date&&(s=s.getTime()),"number"==typeof s&&(s<e&&(e=s),s>i&&(i=s));const s=[e,i];return s.every(isFinite)?s:void 0}function ls(t,e,i){return hs(t,e,i).extent}function hs(t,e,i){var s;let n=!1;return t.length>2&&(t=null!=(s=rs(t))?s:[NaN,NaN]),isNaN(e)||(n||(n=e>t[0]),t=[e,t[1]]),isNaN(i)||(n||(n=i<t[1]),t=[t[0],i]),t[0]>t[1]&&(t=[]),{extent:t,clipped:n}}function cs(t,e){if(null==t||null==e||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(Array.isArray(t[i])&&Array.isArray(e[i])){if(!cs(t[i],e[i]))return!1}else if(t[i]!==e[i])return!1;return!0}function ds(t){return void 0===t?[]:Array.isArray(t)?t:[t]}function us(t){return Array.from(new Set(t))}function ps(t,e){return t.reduce((t,i)=>{const s=e(i);return null!=t[s]||(t[s]=[]),t[s].push(i),t},{})}function gs(t,e,i=0){if(0===t.length)return[];const s=[];for(let n=0;n<e;n++)s.push(t.at((n+i)%t.length));return s}function ms(t,e){return e.reduce(([e,i],s)=>t(s)?[[...e,s],i]:[e,[...i,s]],[[],[]])}function*ys(t,e){for(const i of t)yield e(i)}function fs(t,e){return!e.some(e=>!function(t,e){return function(t,e){return t.includes(e)}(t,e)}(t,e))}var xs={},bs=new WeakMap;function vs(t){var e;return t?null==(e=xs.document)?void 0:e[t]:xs.document}function Ss(t){var e;return t?null==(e=xs.window)?void 0:e[t]:xs.window}function Ms(t,e,i){const s=vs().createElement(t);return"object"==typeof e&&(i=e,e=void 0),e&&s.classList.add(e),i&&Object.assign(s.style,i),s}function ks(t,e){const{body:i}=vs(),s=Ms("a",{display:"none"});s.href=t,s.download=e,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}function Ds(t,e){var i,s;const n=vs();if(e&&(null==(i=bs.get(n))?void 0:i.has(e)))return;const a=Ms("style");a.innerHTML=t,n.head.insertBefore(a,n.head.querySelector("style")),e&&!bs.has(n)?bs.set(n,new Set([e])):e&&(null==(s=bs.get(n))||s.add(e))}function ws(t){xs.document=t}function Is(t){xs.window=t}"undefined"!=typeof window?xs.window=window:"undefined"!=typeof globalThis&&(xs.window=globalThis.window),"undefined"!=typeof document?xs.document=document:"undefined"!=typeof globalThis&&(xs.document=globalThis.document);var Cs=Date.now(),Ls={create:(...t)=>Object.assign((...e)=>{Ls.check(...t)&&("function"==typeof e[0]&&(e=ds(e[0]())),(()=>{const t=Date.now()-Cs;if(t>2e3){const e=(Math.floor(t/100)/10).toFixed(1);E.log(`**** ${e}s since last log message ****`)}Cs=Date.now()})(),E.log(...e))},{check:()=>Ls.check(...t)}),check:(...t)=>(0===t.length&&t.push(!0),ds(Ss("agChartsDebug")).some(e=>t.includes(e)))},As=new Set(["map-shape-background","map-line-background"]),Ts=class{constructor(t,e){var i,s;const n={shallow:["data"]},a=Me(t,n),o=this.optionsType(a);this.sanityCheckAndCleanup(a),this.userOptions=a,this.activeTheme=os(a.theme),this.defaultAxes=this.getDefaultAxes(a),this.specialOverrides=this.specialOverridesDefaults(m({},e));const r=this.getSeriesThemeConfig(o),{axes:l={},annotations:h={},series:c}=r,d=f(r,["axes","annotations","series"]);this.processedOptions=Me(Xt(this.userOptions,d,this.defaultAxes),n),this.processAxesOptions(this.processedOptions,l),this.processSeriesOptions(this.processedOptions),this.processMiniChartSeriesOptions(this.processedOptions),this.processAnnotationsOptions(this.processedOptions,h),(ue(this.processedOptions)||function(t){const e=de(t);return pe(t)&&"pie"!==e&&"donut"!==e}(this.processedOptions))&&null==(null==(i=this.processedOptions.legend)?void 0:i.enabled)&&(null!=(s=this.processedOptions).legend||(s.legend={}),this.processedOptions.legend.enabled=this.processedOptions.series.length>1),this.enableConfiguredOptions(this.processedOptions),vt.isEnterprise||function(t){var e,i,s,n;const a=[],o=ae.get(de(t));for(const{type:r,chartTypes:l,optionsKey:h,optionsInnerKey:c,identifier:d}of le)if("unknown"===o||l.includes(o))if("root"===r||"legend"===r){const e=t[h];if(null==e)continue;c?e[c]&&(a.push(`${h}.${c}`),delete e[c]):(a.push(h),delete t[h])}else if("axis"===r){if(!("axes"in t)||!(null==(e=t.axes)?void 0:e.some(t=>t.type===d)))continue;a.push(`axis[type=${d}]`),t.axes=t.axes.filter(t=>t.type!==d)}else if("axis-option"===r){if(!("axes"in t)||!(null==(i=t.axes)?void 0:i.some(t=>t[h])))continue;a.push(`axis.${h}`),t.axes.forEach(t=>{t[h]&&delete t[h]})}else if("series"===r){if(!(null==(s=t.series)?void 0:s.some(t=>t.type===d)))continue;a.push(`series[type=${d}]`),t.series=t.series.filter(t=>t.type!==d)}else if("series-option"===r){if(!(null==(n=t.series)?void 0:n.some(t=>t[h])))continue;a.push(`series.${h}`),t.series.forEach(t=>{t[h]&&delete t[h]})}if(a.length){let e="ag-charts-enterprise",i="https://charts.ag-grid.com/javascript/installation/";"integrated"===t.mode&&(e="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",i="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),E.warnOnce([`unable to use these enterprise features as '${e}' has not been loaded:`,"",...a,"",`See: ${i}`].join("\n"))}}(this.processedOptions)}getOptions(){var t;return null!=(t=this.processedOptions)?t:{}}diffOptions(t){return Se(t,this.processedOptions)}getSeriesThemeConfig(t){var e,i;return Me(null!=(i=null==(e=this.activeTheme)?void 0:e.config[t])?i:{})}getDefaultAxes(t){const e=this.optionsType(t),i=Le.cloneDefaultAxes(e);return Le.isDefaultAxisSwapNeeded(t)&&this.swapAxesPosition(i),i}optionsType(t){var e,i,s;return null!=(s=null==(i=null==(e=t.series)?void 0:e[0])?void 0:i.type)?s:"line"}sanityCheckAndCleanup(t){var e;this.deprecationWarnings(t),this.axesTypeIntegrity(t),this.seriesTypeIntegrity(t),this.soloSeriesIntegrity(t),this.removeDisabledOptions(t),this.removeLeftoverSymbols(t),(null==(e=t.series)?void 0:e.some(t=>"bullet"===t.type))&&null!=t.sync&&!1!==t.sync.enabled&&(E.warnOnce("bullet series cannot be synced, disabling synchronization."),delete t.sync)}swapAxesPosition(t){var e;if(ue(t)){const[i,s]=null!=(e=t.axes)?e:[];t.axes=[y(m({},i),{position:s.position}),y(m({},s),{position:i.position})]}}processAxesOptions(t,e){"axes"in t&&(t.axes=t.axes.map(t=>{var i,s,n;const a=Xt(null==(i=e[t.type])?void 0:i[t.position],e[t.type]),{crossLines:o}=a,r=f(a,["crossLines"]);t.crossLines&&(t.crossLines=Zt(t.crossLines,o));const l=null==(s=r.gridLine)?void 0:s.style;(null==(n=t.gridLine)?void 0:n.style)&&(null==l?void 0:l.length)&&(t.gridLine.style=t.gridLine.style.map((t,e)=>null!=t.stroke||null!=t.lineDash?Xt(t,l.at(e%l.length)):t));const h=Xt(t,r),{top:c,right:d,bottom:u,left:p}=h;return f(h,["top","right","bottom","left"])}))}processSeriesOptions(t){const e=this.getDefaultSeriesType(t),i=this.getTooltipPositionDefaults(t),s=Boolean(zt(t.theme)&&t.theme.palette),n={colourIndex:0,userPalette:s},a=t.series.map(t=>{var a;null!=t.type||(t.type=e);const o=null!=(a=this.getSeriesThemeConfig(t.type).series)?a:{},{innerLabels:r}=o,l=f(o,["innerLabels"]),h=As.has(t.type)?{colourIndex:0,userPalette:s}:n,c=this.getSeriesPalette(t.type,h),d=Xt(this.getSeriesGroupingOptions(t),t,i,l,c);return d.innerLabels&&(d.innerLabels=Zt(d.innerLabels,r)),this.activeTheme.templateTheme(d)});t.series=this.setSeriesGroupingOptions(a)}processMiniChartSeriesOptions(t){var e,i;let s=null==(i=null==(e=t.navigator)?void 0:e.miniChart)?void 0:i.series;if(null==s)return;const n={colourIndex:0,userPalette:Boolean(zt(t.theme)&&t.theme.palette)};s=s.map(t=>{var e;null!=t.type||(t.type="line");const i=null!=(e=this.getSeriesThemeConfig(t.type).series)?e:{},{innerLabels:s}=i,a=f(i,["innerLabels"]),o=Xt(this.getSeriesGroupingOptions(t),t,a,this.getSeriesPalette(t.type,n));return this.activeTheme.templateTheme(o)}),t.navigator.miniChart.series=this.setSeriesGroupingOptions(s)}processAnnotationsOptions(t,e){ue(t)}getSeriesPalette(t,e){const i=Le.getPaletteFactory(t),{colourIndex:s,userPalette:n}=e,{fills:a=[],strokes:o=[]}=this.activeTheme.palette;return null==i?void 0:i({userPalette:n,colorsCount:Math.max(a.length,o.length),themeTemplateParameters:this.activeTheme.getTemplateParameters(),takeColors:t=>(e.colourIndex+=t,{fills:gs(a,t,s),strokes:gs(o,t,s)})})}getSeriesGroupingOptions(t){const e=Le.isGroupable(t.type),i=Le.isStackable(t.type),s=Le.isStackedByDefault(t.type);t.grouped&&!e&&E.warnOnce(`unsupported grouping of series type "${t.type}".`),!t.stacked&&!t.stackGroup||i||E.warnOnce(`unsupported stacking of series type "${t.type}".`);let{grouped:n,stacked:a}=t;return null!=a||(a=(s||null!=t.stackGroup)&&!(e&&n)),null!=n||(n=!0),{stacked:i&&a,grouped:e&&n&&!(i&&a)}}setSeriesGroupingOptions(t){const e=this.getSeriesGrouping(t);Ls.create(!0,"opts")("setSeriesGroupingOptions() - series grouping: ",e);const i={},s=e.reduce((t,e)=>{var i;return"default"===e.groupType||(null!=t[i=e.seriesType]||(t[i]=0),t[e.seriesType]+="stack"===e.groupType?1:e.series.length),t},{});return e.flatMap(t=>{var e;switch(null!=i[e=t.seriesType]||(i[e]=0),t.groupType){case"stack":const e=i[t.seriesType]++;return t.series.map((i,n)=>Object.assign(i,{seriesGrouping:{groupIndex:e,groupCount:s[t.seriesType],stackIndex:n,stackCount:t.series.length}}));case"group":return t.series.map(e=>Object.assign(e,{seriesGrouping:{groupIndex:i[t.seriesType]++,groupCount:s[t.seriesType],stackIndex:0,stackCount:0}}))}return t.series}).map(t=>{var e=t,{stacked:i,grouped:s}=e;return f(e,["stacked","grouped"])})}getSeriesGroupId(t){var e;return[t.type,t.xKey,t.stacked?null!=(e=t.stackGroup)?e:"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(t){const e=new Map;return t.reduce((t,i)=>{const s=i.type;if(i.stacked||i.grouped){const n=this.getSeriesGroupId(i);if(!e.has(n)){const a={groupType:i.stacked?"stack":"group",seriesType:s,series:[]};e.set(n,a),t.push(a)}e.get(n).series.push(i)}else t.push({groupType:"default",seriesType:s,series:[i]});return t},[])}getDefaultSeriesType(t){if(ue(t))return"line";if(pe(t))return"pie";if(ge(t))return"treemap";if(me(t))return"map-shape";throw new Error("Invalid chart options type detected.")}getTooltipPositionDefaults(t){var e;const i=null==(e=t.tooltip)?void 0:e.position;if(!_t(i))return;const{type:s,xOffset:n,yOffset:a}=i,o={};return jt(s)&&$t(I,s)&&(o.type=s),Vt(n)&&(o.xOffset=n),Vt(a)&&(o.yOffset=a),{tooltip:{position:o}}}deprecationWarnings(t){Object.entries({yKeys:"yKey",yNames:"yName"}).forEach(([e,i])=>{var s;(null==(s=t.series)?void 0:s.some(t=>null!=t[e]))&&E.warnOnce(`Property [series.${e}] is deprecated, please use [series.${i}] and multiple series instead.`)})}axesTypeIntegrity(t){var e;if("axes"in t){const i=null!=(e=t.axes)?e:[];for(const{type:e}of i)if(!ye(e)){delete t.axes;const i=Array.from(kt.publicKeys()).join(", ");E.warnOnce(`unknown axis type: ${e}; expected one of: ${i}`)}}}seriesTypeIntegrity(t){var e;const i=null!=(e=t.series)?e:[];t.series=i.filter(({type:t})=>{if(null==t||null!=(e=t)&&ae.has(e)||function(t){return le.some(e=>"series"===e.type&&e.identifier===t)}(t))return!0;var e;E.warnOnce(`unknown series type: ${t}; expected one of: ${oe.seriesTypes.join(", ")}`)})}soloSeriesIntegrity(t){const e=t.series;if(e&&e.length>1&&e.some(t=>Le.isSolo(t.type))){const i=this.optionsType(t);if(Le.isSolo(i))E.warn(`series[0] of type '${i}' is incompatible with other series types. Only processing series[0]`),t.series=e.slice(0,1);else{const{solo:i,nonSolo:s}=ps(e,t=>Le.isSolo(t.type)?"solo":"nonSolo"),n=us(i.map(t=>t.type)).join(", ");E.warn(`Unable to mix these series types with the lead series type: ${n}`),t.series=s}}}enableConfiguredOptions(t){De(this.userOptions,(t,e)=>{e&&"enabled"in e&&!e._enabledFromTheme&&null==t.enabled&&(e.enabled=!0)},{skip:["data","theme"]},t),De(t,t=>{null!=t._enabledFromTheme&&delete t._enabledFromTheme},{skip:["data","theme"]})}removeDisabledOptions(t){De(t,t=>{"enabled"in t&&!1===t.enabled&&Object.keys(t).forEach(e=>{"enabled"!==e&&delete t[e]})},{skip:["data","theme"]})}removeLeftoverSymbols(t){De(t,t=>{if(t&&zt(t))for(const[e,i]of Object.entries(t))Ht(i)&&delete t[e]},{skip:["data"]})}specialOverridesDefaults(t){if(null!=t.window?Is(t.window):"undefined"!=typeof window?t.window=window:"undefined"!=typeof globalThis&&(t.window=globalThis.window),null!=t.document?ws(t.document):"undefined"!=typeof document?t.document=document:"undefined"!=typeof globalThis&&(t.document=globalThis.document),null==t.window)throw new Error("AG Charts - unable to resolve global window");if(null==t.document)throw new Error("AG Charts - unable to resolve global document");return t}};function Ns(){return(t,e)=>{const i=[`Property [${t}] is deprecated.`,e].filter(Boolean).join(" ");E.warnOnce(i)}}function Os(t,e){const i=Ns(),s=null==e?void 0:e.default;return Ct((e,n,a)=>(a!==s&&i(n.toString(),t),a))}function Rs(t,e){const i=Ns();return Ct((s,n,a)=>(a!==s[t]&&(i(n.toString(),`Use [${t}] instead.`),ee(s,t,e?e(a):a)),Dt),(e,s)=>(i(s.toString(),`Use [${t}] instead.`),Jt(e,t)))}var Es={};x(Es,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>An,fromToMotion:()=>Tn,staticFromToMotion:()=>Nn});var Ps=new Map;function Bs(){Ps.clear()}function Fs(t){var e;const i=t.constructor,s=Object.hasOwn(i,"className")?i.className:i.name;if(!s)throw new Error(`The ${i} is missing the 'className' property.`);const n=(null!=(e=Ps.get(s))?e:0)+1;return Ps.set(s,n),`${s}-${n}`}var zs="$interpolate",Gs=t=>null!=t[zs];function _s(t,e,i){return Math.min(i,Math.max(t,e))}function js(t,e){const[i,s]=Ws(e);return _s(i,t,s)}function Ws(t){return t.length?[Math.min(...t),Math.max(...t)]:[]}function Vs(t){const[e,i]=Ws(t);return i-e}function Ks(t,e,i=1e-10){return Math.abs(t-e)<i}function Ys(t){return-1===Math.sign(t)||Object.is(t,-0)}function $s(t,e=2){const i=p(10,e);return Math.round(t*i)/i}function Hs(t,e=2){const i=Math.floor(Math.log(Math.abs(t))/Math.LN10);return i>=0||!isFinite(i)?t.toFixed(e):t.toFixed(Math.abs(i)-1+e)}function Us(t,e){return Math.floor(t%e+(t<0?e:0))}function Xs(t,e=10){const[,i=""]=(Math.abs(t)%1).toLocaleString("en-GB",{minimumFractionDigits:0,maximumFractionDigits:e}).split(".");return i.length}function Zs(t,e,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const s of i){const i=s.distanceSquared(t,e);if(0===i)return{nearest:s,distanceSquared:0};i<n.distanceSquared&&(n.nearest=s,n.distanceSquared=i)}return n}function qs(t,e,i,s=1/0){const{x:n,y:a}=i.transformPoint(t,e),o={nearest:void 0,distanceSquared:s};for(const t of i.children){const{nearest:e,distanceSquared:i}=t.nearestSquared(n,a,o.distanceSquared);if(0===i)return{nearest:e,distanceSquared:i};i<o.distanceSquared&&(o.nearest=e,o.distanceSquared=i)}return o}var Qs=class t{constructor(t,e,i,s){this.x=t,this.y=e,this.width=i,this.height=s}clone(){const{x:e,y:i,width:s,height:n}=this;return new t(e,i,s,n)}equals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}containsPoint(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}collidesBBox(t){return this.x<t.x+t.width&&this.x+this.width>t.x&&this.y<t.y+t.height&&this.y+this.height>t.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(t,e){if(this.containsPoint(t,e))return 0;const i=t-_s(this.x,t,this.x+this.width),s=e-_s(this.y,e,this.y+this.height);return i*i+s*s}static nearestBox(t,e,i){return Zs(t,e,i)}clip(t){if(void 0===t)return this;const e=Math.max(this.x,t.x),i=Math.max(this.y,t.y),s=Math.min(this.x+this.width,t.x+t.width),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.y=i,this.width=Math.max(0,s-e),this.height=Math.max(0,n-i),this}shrink(t,e){const i=(t,e)=>{switch(t){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-=2*e;break;case"horizontal":this.x+=e,this.width-=2*e;break;case void 0:this.x+=e,this.width-=2*e,this.y+=e,this.height-=2*e}};return"number"==typeof t?i(e,t):"object"==typeof t&&Object.entries(t).forEach(([t,e])=>i(t,e)),this}grow(t,e){if("number"==typeof t)this.shrink(-t,e);else{const e=m({},t);for(const t in e)e[t]*=-1;this.shrink(e)}return this}combine(t){const{x:e,y:i,width:s,height:n}=this;this.x=Math.min(e,t.x),this.y=Math.min(i,t.y),this.width=Math.max(e+s,t.x+t.width)-this.x,this.height=Math.max(i+n,t.y+t.height)-this.y}static merge(e){let i=1/0,s=1/0,n=-1/0,a=-1/0;for(const t of e)t.x<i&&(i=t.x),t.y<s&&(s=t.y),t.x+t.width>n&&(n=t.x+t.width),t.y+t.height>a&&(a=t.y+t.height);return new t(i,s,n-i,a-s)}[zs](e,i){return new t(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)}};Qs.zero=new Qs(0,0,0,0),Qs.NaN=new Qs(NaN,NaN,NaN,NaN);var Js=Qs,tn=(t=>(t[t.NONE=0]="NONE",t[t.TRIVIAL=1]="TRIVIAL",t[t.MINOR=2]="MINOR",t[t.MAJOR=3]="MAJOR",t))(tn||{}),en=function(){try{return new Function("return true"),!0}catch(t){return!1}}();function sn(t){const{changeCb:e,convertor:i}=null!=t?t:{};return function(s,n){const a=`__${n}`;s[n]||(en&&null==e&&null==i?function(t,e,i,s){const{redraw:n=1,type:a="normal",checkDirtyOnAssignment:o=!1}=null!=s?s:{},r=new Function("value",`\n        const oldValue = this.${i};\n        if (value !== oldValue) {\n            this.${i} = value;\n            ${"normal"===a?`this.markDirty(this, ${n});`:""}\n            ${"transform"===a?`this.markDirtyTransform(${n});`:""}\n            ${"path"===a?`if (!this._dirtyPath) { this._dirtyPath = true; this.markDirty(this, ${n}); }`:""}\n            ${"font"===a?`if (!this._dirtyFont) { this._dirtyFont = true; this.markDirty(this, ${n}); }`:""}\n        }\n        ${o?"if (value != null && value._dirty > 0) { this.markDirty(value, value._dirty); }":""}\n`),l=new Function(`return this.${i};`);Object.defineProperty(t,e,{set:r,get:l,enumerable:!0,configurable:!0})}(s,n,a,t):function(t,e,i,s){const{redraw:n=1,type:a="normal",changeCb:o,convertor:r,checkDirtyOnAssignment:l=!1}=null!=s?s:{};Object.defineProperty(t,e,{set:function(t){const e=this[i];(t=r?r(t):t)!==e&&(this[i]=t,"normal"===a&&this.markDirty(this,n),"transform"===a&&this.markDirtyTransform(n),"path"!==a||this._dirtyPath||(this._dirtyPath=!0,this.markDirty(this,n)),"font"!==a||this._dirtyFont||(this._dirtyFont=!0,this.markDirty(this,n)),null==o||o(this)),l&&null!=t&&t._dirty>0&&this.markDirty(t,t._dirty)},get:function(){return this[i]},enumerable:!0,configurable:!0})}(s,n,a,t))}}var nn=class{constructor(){this._dirty=3}markDirty(t,e=1){this._dirty<e&&(this._dirty=e)}markClean(t){this._dirty=0}isDirty(){return this._dirty>0}},an=class t{get e(){return[...this.elements]}constructor(t=[1,0,0,1,0,0]){this.elements=t}setElements(t){const e=this.elements;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this}get identity(){const t=this.elements;return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]}AxB(t,e,i){const s=t[0]*e[0]+t[2]*e[1],n=t[1]*e[0]+t[3]*e[1],a=t[0]*e[2]+t[2]*e[3],o=t[1]*e[2]+t[3]*e[3],r=t[0]*e[4]+t[2]*e[5]+t[4],l=t[1]*e[4]+t[3]*e[5]+t[5];(i=null!=i?i:t)[0]=s,i[1]=n,i[2]=a,i[3]=o,i[4]=r,i[5]=l}multiplySelf(t){return this.AxB(this.elements,t.elements),this}multiply(e){const i=new Array(6);return this.AxB(this.elements,e.elements,i),new t(i)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const e=this.elements;let i=e[0],s=e[1],n=e[2],a=e[3];const o=e[4],r=e[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,new t([a,-s,-n,i,n*r-a*o,s*o-i*r])}inverseTo(t){const e=this.elements;let i=e[0],s=e[1],n=e[2],a=e[3];const o=e[4],r=e[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,t.setElements([a,-s,-n,i,n*r-a*o,s*o-i*r]),this}invertSelf(){const t=this.elements;let e=t[0],i=t[1],s=t[2],n=t[3];const a=t[4],o=t[5],r=1/(e*n-i*s);return e*=r,i*=r,s*=r,n*=r,t[0]=n,t[1]=-i,t[2]=-s,t[3]=e,t[4]=s*o-n*a,t[5]=i*a-e*o,this}transformPoint(t,e){const i=this.elements;return{x:t*i[0]+e*i[2]+i[4],y:t*i[1]+e*i[3]+i[5]}}transformBBox(t,e){const i=this.elements,s=i[0],n=i[1],a=i[2],o=i[3],r=.5*t.width,l=.5*t.height,h=t.x+r,c=t.y+l,d=Math.abs(r*s)+Math.abs(l*a),u=Math.abs(r*n)+Math.abs(l*o);return e||(e=new Js(0,0,0,0)),e.x=h*s+c*a+i[4]-d,e.y=h*n+c*o+i[5]-u,e.width=d+d,e.height=u+u,e}toContext(t){if(this.identity)return;const e=this.elements;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}static flyweight(e){return t.instance.setElements(e.elements)}static updateTransformMatrix(t,e,i,s,n,a,o){const[r,l]=[0,0],h=e,c=i;let d,u;1===h&&1===c?(d=0,u=0):(d=null==(null==o?void 0:o.scalingCenterX)?r:null==o?void 0:o.scalingCenterX,u=null==(null==o?void 0:o.scalingCenterY)?l:null==o?void 0:o.scalingCenterY);const p=s,g=Math.cos(p),m=Math.sin(p);let y,f;0===p?(y=0,f=0):(y=null==(null==o?void 0:o.rotationCenterX)?r:null==o?void 0:o.rotationCenterX,f=null==(null==o?void 0:o.rotationCenterY)?l:null==o?void 0:o.rotationCenterY);const x=n,b=a,v=d*(1-h)-y,S=u*(1-c)-f;return t.setElements([g*h,m*h,-m*c,g*c,g*v-m*S+y+x,m*v+g*S+f+b]),t}static fromContext(e){const i=e.getTransform();return new t([i.a,i.b,i.c,i.d,i.e,i.f])}};an.instance=new an;var on=an,rn=(t=>(t[t.All=0]="All",t[t.None=1]="None",t))(rn||{}),ln=class t extends nn{constructor({isVirtual:e,tag:i,zIndex:s}={}){super(),this.serialNumber=t._nextSerialNumber++,this.id=Fs(this),this.isContainerNode=!1,this._virtualChildren=[],this._children=[],this.childSet={},this.matrix=new on,this.dirtyTransform=!1,this.scalingX=1,this.scalingY=1,this.scalingCenterX=null,this.scalingCenterY=null,this.rotationCenterX=null,this.rotationCenterY=null,this.rotation=0,this.translationX=0,this.translationY=0,this._childNodeCounts={groups:0,nonGroups:0},this.visible=!0,this.dirtyZIndex=!1,this.zIndex=0,this.zIndexSubOrder=void 0,this.pointerEvents=0,this.isVirtual=null!=e&&e,this.tag=null!=i?i:NaN,this.zIndex=null!=s?s:0}get datum(){var t,e;return null!=(e=this._datum)?e:null==(t=this._parent)?void 0:t.datum}get previousDatum(){return this._previousDatum}set datum(t){this._datum!==t&&(this._previousDatum=this._datum),this._datum=t}_setLayerManager(t){this._layerManager=t,this._debug=null==t?void 0:t.debug;for(const e of this._children)e._setLayerManager(t);for(const e of this._virtualChildren)e._setLayerManager(t)}get layerManager(){return this._layerManager}*ancestors(){let t=this;for(;t=t.parent;)yield t}*traverseUp(){yield this,yield*k(this.ancestors())}get parent(){return this._parent}get children(){return this._virtualChildren.length?this._children.concat(this._virtualChildren.flatMap(t=>t.children)):this._children}get virtualChildren(){return this._virtualChildren}hasVirtualChildren(){return this._virtualChildren.length>0}setProperties(t,e){const i=null!=e?e:Object.keys(t);for(const e of i)this[e]=t[e];return this}append(t){Array.isArray(t)||(t=[t]);for(const e of t){if(e.parent)throw new Error(`${e} already belongs to another parent: ${e.parent}.`);if(e.layerManager)throw new Error(`${e} already belongs to a scene: ${e.layerManager}.`);if(this.childSet[e.id])throw new Error(`Duplicate ${e.constructor.name} node: ${e}`);e.isVirtual?this._virtualChildren.push(e):this._children.push(e),this.childSet[e.id]=!0,e._parent=this,e._setLayerManager(this.layerManager)}this.dirtyZIndex=!0,this.markDirty(this,3)}appendChild(t){return this.append(t),t}removeChild(t){const e=()=>{throw new Error("The node to be removed is not a child of this node.")};if(t.parent!==this&&e(),t.isVirtual){const i=this._virtualChildren.indexOf(t);i<0&&e(),this._virtualChildren.splice(i,1)}else{const i=this._children.indexOf(t);i<0&&e(),this._children.splice(i,1)}return delete this.childSet[t.id],t._parent=void 0,t._setLayerManager(),this.dirtyZIndex=!0,this.markDirty(t,3),t}calculateCumulativeMatrix(){this.computeTransformMatrix();const t=on.flyweight(this.matrix);for(const e of this.ancestors())e.computeTransformMatrix(),t.preMultiplySelf(e.matrix);return t}transformPoint(t,e){return this.calculateCumulativeMatrix().invertSelf().transformPoint(t,e)}inverseTransformPoint(t,e){return this.calculateCumulativeMatrix().transformPoint(t,e)}transformBBox(t){return this.calculateCumulativeMatrix().invertSelf().transformBBox(t)}inverseTransformBBox(t){return this.calculateCumulativeMatrix().transformBBox(t)}markDirtyTransform(){this.dirtyTransform=!0,this.markDirty(this,3)}containsPoint(t,e){return!1}pickNode(t,e){var i;if(!this.visible||1===this.pointerEvents||!this.containsPoint(t,e))return;const{children:s}=this;if(s.length>1e3)for(let n=s.length-1;n>=0;n--){const a=s[n],o=(null==(i=a.computeTransformedBBox())?void 0:i.containsPoint(t,e))?a.pickNode(t,e):void 0;if(o)return o}else if(s.length)for(let i=s.length-1;i>=0;i--){const n=s[i].pickNode(t,e);if(n)return n}else if(!this.isContainerNode)return this}getCachedBBox(){var t;return null!=(t=this.cachedBBox)?t:Js.zero}computeBBox(){}computeTransformedBBox(){const t=this.computeBBox();if(!t)return;this.computeTransformMatrix();const e=on.flyweight(this.matrix);for(const t of this.ancestors())t.computeTransformMatrix(),e.preMultiplySelf(t.matrix);return e.transformBBox(t,t),t}computeTransformMatrix(){if(!this.dirtyTransform)return;const{matrix:t,scalingX:e,scalingY:i,rotation:s,translationX:n,translationY:a,scalingCenterX:o,scalingCenterY:r,rotationCenterX:l,rotationCenterY:h}=this;on.updateTransformMatrix(t,e,i,s,n,a,{scalingCenterX:o,scalingCenterY:r,rotationCenterX:l,rotationCenterY:h}),this.dirtyTransform=!1}preRender(){this._childNodeCounts.groups=0,this._childNodeCounts.nonGroups=1;for(const t of this.children){const e=t.preRender();this._childNodeCounts.groups+=e.groups,this._childNodeCounts.nonGroups+=e.nonGroups}return this._childNodeCounts}render(t){const{stats:e}=t;this._dirty=0,this.cachedBBox=this.computeBBox(),e&&e.nodesRendered++}markDirty(t,e=1,i=e){this._dirty>e||this._dirty===e&&e===i||(this._dirty=e,this.parent?this.parent.markDirty(this,i):this.layerManager&&this.layerManager.markDirty())}get dirty(){return this._dirty}markClean(t){const{force:e=!1,recursive:i=!0}=null!=t?t:{};if(0!==this._dirty||e){if(this._dirty=0,!1!==i)for(const t of this._virtualChildren)t.markClean({force:e});if(!0===i)for(const t of this._children)t.markClean({force:e})}}onVisibleChange(){}get nodeCount(){let t=1,e=this._dirty>=0||this.dirtyTransform?1:0,i=this.visible?1:0;const s=s=>{const{count:n,visibleCount:a,dirtyCount:o}=s.nodeCount;t+=n,i+=a,e+=o};for(const t of this._children)s(t);for(const t of this._virtualChildren)s(t);return{count:t,visibleCount:i,dirtyCount:e}}onZIndexChange(){this.parent&&(this.parent.dirtyZIndex=!0)}};ln._nextSerialNumber=0,b([sn({type:"transform"})],ln.prototype,"scalingX",2),b([sn({type:"transform"})],ln.prototype,"scalingY",2),b([sn({type:"transform"})],ln.prototype,"scalingCenterX",2),b([sn({type:"transform"})],ln.prototype,"scalingCenterY",2),b([sn({type:"transform"})],ln.prototype,"rotationCenterX",2),b([sn({type:"transform"})],ln.prototype,"rotationCenterY",2),b([sn({type:"transform"})],ln.prototype,"rotation",2),b([sn({type:"transform"})],ln.prototype,"translationX",2),b([sn({type:"transform"})],ln.prototype,"translationY",2),b([sn({redraw:3,changeCb:t=>t.onVisibleChange()})],ln.prototype,"visible",2),b([sn({redraw:1,changeCb:t=>t.onZIndexChange()})],ln.prototype,"zIndex",2),b([sn({redraw:1,changeCb:t=>t.onZIndexChange()})],ln.prototype,"zIndexSubOrder",2);var hn=ln,cn=t=>{const e=t<0?-1:1,i=Math.abs(t);return i<=.04045?t/12.92:e*p((i+.055)/1.055,2.4)},dn=t=>{const e=t<0?-1:1,i=Math.abs(t);return i>.0031308?e*(1.055*p(i,1/2.4)-.055):12.92*t},un=class t{constructor(t,e,i,s=1){this.r=_s(0,t||0,1),this.g=_s(0,e||0,1),this.b=_s(0,i||0,1),this.a=_s(0,s||0,1)}static validColorString(e){return e.indexOf("#")>=0?!!t.parseHex(e):e.indexOf("rgb")>=0?!!t.stringToRgba(e):!!t.nameToHex[e.toLowerCase()]}static fromString(e){if(e.indexOf("#")>=0)return t.fromHexString(e);const i=t.nameToHex[e.toLowerCase()];if(i)return t.fromHexString(i);if(e.indexOf("rgb")>=0)return t.fromRgbaString(e);throw new Error(`Invalid color string: '${e}'`)}static tryParseFromString(e){try{return t.fromString(e)}catch(i){return E.warnOnce(`invalid color string: '${e}'.`),t.fromArray([0,0,0])}}static parseHex(t){let e;switch((t=t.replace(/ /g,"").slice(1)).length){case 6:case 8:e=[];for(let i=0;i<t.length;i+=2)e.push(parseInt(`${t[i]}${t[i+1]}`,16));break;case 3:case 4:e=t.split("").map(t=>parseInt(t,16)).map(t=>t+16*t)}if((null==e?void 0:e.length)>=3&&e.every(t=>t>=0))return 3===e.length&&e.push(255),e}static fromHexString(e){const i=t.parseHex(e);if(i){const[e,s,n,a]=i;return new t(e/255,s/255,n/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${e}'`)}static stringToRgba(t){let[e,i]=[NaN,NaN];for(let s=0;s<t.length;s++){const n=t[s];if(e||"("!==n){if(")"===n){i=s;break}}else e=s}const s=e&&i&&t.substring(e+1,i);if(!s)return;const n=s.split(","),a=[];for(let t=0;t<n.length;t++){const e=n[t];let i=parseFloat(e);if(isNaN(i))return;e.indexOf("%")>=0?(i=_s(0,i,100),i/=100):3===t?i=_s(0,i,1):(i=_s(0,i,255),i/=255),a.push(i)}return a}static fromRgbaString(e){const i=t.stringToRgba(e);if(i){if(3===i.length)return new t(i[0],i[1],i[2]);if(4===i.length)return new t(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${e}'`)}static fromArray(e){if(4===e.length)return new t(e[0],e[1],e[2],e[3]);if(3===e.length)return new t(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 a=t.HSBtoRGB(e,i,s);return new t(a[0],a[1],a[2],n)}static fromHSL(e,i,s,n=1){const a=t.HSLtoRGB(e,i,s);return new t(a[0],a[1],a[2],n)}static fromOKLCH(e,i,s,n=1){const a=t.OKLCHtoRGB(e,i,s);return new t(a[0],a[1],a[2],n)}static padHex(t){return 1===t.length?"0"+t:t}toHexString(){let e="#"+t.padHex(Math.round(255*this.r).toString(16))+t.padHex(Math.round(255*this.g).toString(16))+t.padHex(Math.round(255*this.b).toString(16));return this.a<1&&(e+=t.padHex(Math.round(255*this.a).toString(16))),e}toRgbaString(t=3){const e=[Math.round(255*this.r),Math.round(255*this.g),Math.round(255*this.b)],i=Math.pow(10,t);return 1!==this.a?(e.push(Math.round(this.a*i)/i),`rgba(${e.join(", ")})`):`rgb(${e.join(", ")})`}toString(){return 1===this.a?this.toHexString():this.toRgbaString()}toHSB(){return t.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,e,i){const s=cn(t),n=cn(e),a=cn(i),o=Math.cbrt(.4122214708*s+.5363325363*n+.0514459929*a),r=Math.cbrt(.2119034982*s+.6806995451*n+.1073969566*a),l=Math.cbrt(.0883024619*s+.2817188376*n+.6299787005*a),h=.2104542553*o+.793617785*r-.0040720468*l,c=1.9779984951*o-2.428592205*r+.4505937099*l,d=.0259040371*o+.7827717662*r-.808675766*l,u=180*Math.atan2(d,c)/Math.PI;return[h,Math.hypot(c,d),u>=0?u:u+360]}static OKLCHtoRGB(t,e,i){const s=t,n=e*Math.cos(i*Math.PI/180),a=e*Math.sin(i*Math.PI/180),o=p(s+.3963377774*n+.2158037573*a,3),r=p(s-.1055613458*n-.0638541728*a,3),l=p(s-.0894841775*n-1.291485548*a,3),h=-1.2684380046*o+2.6097574011*r-.3413193965*l,c=-.0041960863*o-.7034186147*r+1.707614701*l;return[dn(4.0767416621*o-3.3077115913*r+.2309699292*l),dn(h),dn(c)]}static RGBtoHSL(t,e,i){const s=Math.min(t,e,i),n=Math.max(t,e,i),a=(n+s)/2;let o,r;if(n===s)o=NaN,r=0;else{const l=n-s;r=a>.5?l/(2-n-s):l/(n+s),o=n===t?(e-i)/l+(e<i?6:0):n===e?(i-t)/l+2:(t-e)/l+4,o*=60}return[o,r,a]}static HSLtoRGB(t,e,i){if(0===e)return[i,i,i];const s=i<.5?i*(1+e):i+e-i*e,n=2*i-s;function a(t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+6*(s-n)*t:t<.5?s:t<2/3?n+(s-n)*(2/3-t)*6:n}return[a(t/360+1/3),a(t/360),a(t/360-1/3)]}static RGBtoHSB(t,e,i){const s=Math.min(t,e,i),n=Math.max(t,e,i);let a=NaN;if(s!==n){const o=n-s,r=(n-t)/o,l=(n-e)/o,h=(n-i)/o;a=t===n?h-l:e===n?2+r-h:4+l-r,a/=6,a<0&&(a+=1)}return[360*a,0===n?0:(n-s)/n,n]}static HSBtoRGB(t,e,i){isNaN(t)&&(t=0),t=(t%360+360)%360/360;let s=0,n=0,a=0;if(0===e)s=n=a=i;else{const o=6*(t-Math.floor(t)),r=o-Math.floor(o),l=i*(1-e),h=i*(1-e*r),c=i*(1-e*(1-r));switch(0|o){case 0:s=i,n=c,a=l;break;case 1:s=h,n=i,a=l;break;case 2:s=l,n=i,a=c;break;case 3:s=l,n=h,a=i;break;case 4:s=c,n=l,a=i;break;case 5:s=i,n=l,a=h}}return[s,n,a]}derive(e,i,s,n){const a=t.RGBtoHSB(this.r,this.g,this.b);let o=a[2];0==o&&s>1&&(o=.05);const r=((a[0]+e)%360+360)%360,l=_s(0,a[1]*i,1);o=_s(0,o*s,1);const h=_s(0,this.a*n,1),c=t.HSBtoRGB(r,l,o);return c.push(h),t.fromArray(c)}brighter(){return this.derive(0,1,1/.7,1)}darker(){return this.derive(0,1,.7,1)}static interpolate(e,i){const s=t.tryParseFromString(e),n=t.tryParseFromString(i);return e=>{const i=(t,i)=>t*(1-e)+i*e;return new t(i(s.r,n.r),i(s.g,n.g),i(s.b,n.b),i(s.a,n.a)).toString()}}};un.didDebug=!1,un.nameToHex=Object.freeze({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 pn=un;function gn(t,e){return i=>Number(t)*(1-i)+Number(e)*i}var mn={};x(mn,{easeIn:()=>fn,easeInOut:()=>bn,easeInOutQuad:()=>Mn,easeInQuad:()=>vn,easeOut:()=>xn,easeOutQuad:()=>Sn,inverseEaseOut:()=>kn,linear:()=>yn});var yn=t=>t,fn=t=>1-Math.cos(t*Math.PI/2),xn=t=>Math.sin(t*Math.PI/2),bn=t=>-(Math.cos(t*Math.PI)-1)/2,vn=t=>t*t,Sn=t=>1-p(1-t,2),Mn=t=>t<.5?2*t*t:1-p(-2*t+2,2)/2,kn=t=>2*Math.asin(t)/Math.PI,Dn=["initial","remove","update","add","trailing","end","none"],wn={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:.2,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1.2,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},In=(t=>(t.Loop="loop",t.Reverse="reverse",t))(In||{});function Cn(t){return t.every(t=>t instanceof hn)?{nodes:t,selections:[]}:{nodes:[],selections:t}}var Ln=class{constructor(t){var e,i,s,n,a,o,r;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=null==(e=t.autoplay)||e,this.ease=null!=(i=t.ease)?i:yn,this.phase=t.phase;const l=null!=(s=t.duration)?s:wn[this.phase].animationDuration;this.duration=l*t.defaultDuration,this.delay=(null!=(n=t.delay)?n: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,!0===t.skip&&(null==(a=this.onUpdate)||a.call(this,t.to,!1,this),null==(o=this.onStop)||o.call(this,this),null==(r=this.onComplete)||r.call(this,this),this.isComplete=!0),!1!==t.collapsable&&(this.duration=this.checkCollapse(t,this.duration))}checkCollapse(t,e){return t.from===t.to?0:"object"==typeof t.from&&Se(t.from,t.to)?e:0}play(t=!1){var e,i;this.isPlaying||this.isComplete||(this.isPlaying=!0,null==(e=this.onPlay)||e.call(this,this),this.autoplay&&(this.autoplay=!1,t&&(null==(i=this.onUpdate)||i.call(this,this.from,!0,this))))}pause(){this.isPlaying=!1}stop(){var t;this.isPlaying=!1,this.isComplete||(this.isComplete=!0,null==(t=this.onStop)||t.call(this,this))}update(t){var e,i;if(this.isComplete)return t;!this.isPlaying&&this.autoplay&&this.play(!0);const s=this.elapsed;if(this.elapsed+=t,this.delay>this.elapsed)return 0;const n=this.interpolate(this.isReverse?1-this.delta:this.delta);null==(e=this.onUpdate)||e.call(this,n,!1,this);const a=this.delay+this.duration;return this.elapsed>=a?(this.stop(),this.isComplete=!0,null==(i=this.onComplete)||i.call(this,this),t-(a-s)):0}get delta(){return this.ease(_s(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(t,e){if("object"!=typeof e||Gs(e))return this.interpolateValue(t,e);const i=[];for(const s in e){const n=this.interpolateValue(t[s],e[s]);null!=n&&i.push([s,n])}return t=>{const e={};for(const[s,n]of i)e[s]=n(t);return e}}interpolateValue(t,e){if(void 0!==t&&void 0!==e){if(Gs(t))return i=>t[zs](e,i);try{switch(typeof t){case"number":return gn(t,e);case"string":return function(t,e){if("string"==typeof t)try{t=pn.fromString(t)}catch(e){t=pn.fromArray([0,0,0])}if("string"==typeof e)try{e=pn.fromString(e)}catch(t){e=pn.fromArray([0,0,0])}const i=gn(t.r,e.r),s=gn(t.g,e.g),n=gn(t.b,e.b),a=gn(t.a,e.a);return t=>pn.fromArray([i(t),s(t),n(t),a(t)]).toRgbaString()}(t,e);case"boolean":if(t===e)return()=>t}}catch(t){}throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}},An={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Tn(t,e,i,s,n,a,o){const{fromFn:r,toFn:l,intermediateFn:h}=n,{nodes:c,selections:d}=Cn(s),u=(s,n)=>{var c;let d,u=0,p=0;for(const g of n){const y=s[u]===g,x={last:p>=n.length-1,lastLive:u>=s.length-1,prev:n[p-1],prevFromProps:d,prevLive:s[u-1],next:n[p+1],nextLive:s[u+(y?1:0)]},b=`${t}_${e}_${g.id}`;i.stopByAnimationId(b);let v="unknown";y?a&&o&&(v=On(g,g.datum,a,o)):v="removed";const S=r(g,g.datum,v,x),{phase:M,start:k,finish:D,delay:w,duration:I}=S,C=f(S,["phase","start","finish","delay","duration"]),L=l(g,g.datum,v,x),{phase:A,start:T,finish:N,delay:O,duration:R}=L,E=f(L,["phase","start","finish","delay","duration"]),P=null==D&&null==N;i.animate({id:b,groupId:t,phase:null!=(c=null!=M?M:A)?c:"update",duration:null!=I?I:R,delay:null!=w?w:O,from:C,to:E,ease:xn,collapsable:P,onPlay:()=>{g.setProperties(m(m({},k),T))},onUpdate(t){g.setProperties(t),h&&g.setProperties(h(g,g.datum,v,x))},onStop:()=>{g.setProperties(m(m(m(m(m(m({},k),T),C),E),D),N))}}),y&&u++,p++,d=C}};let p=0;for(const s of d){const n=s.nodes();u(n.filter(t=>!s.isGarbage(t)),n),i.animate({id:`${t}_${e}_selection_${p}`,groupId:t,phase:"end",from:0,to:1,ease:xn,onStop(){s.cleanup()}}),p++}u(c,c)}function Nn(t,e,i,s,n,a,o){const{nodes:r,selections:l}=Cn(s),{start:h,finish:c,phase:d}=o,u=null==c;i.animate({id:`${t}_${e}`,groupId:t,phase:null!=d?d:"update",from:n,to:a,ease:xn,collapsable:u,onPlay:()=>{if(h){for(const t of r)t.setProperties(h);for(const t of l)for(const e of t.nodes())e.setProperties(h)}},onUpdate(t){for(const e of r)e.setProperties(t);for(const e of l)for(const i of e.nodes())i.setProperties(t)},onStop:()=>{for(const t of r)t.setProperties(m(m({},a),c));for(const t of l)for(const e of t.nodes())e.setProperties(m(m({},a),c))}})}function On(t,e,i,s){const n=i(t,e);return s.added.has(n)?"added":s.removed.has(n)?"removed":"updated"}var Rn=2*Math.PI;function En(t){return t%=Rn,(t+=Rn)%Rn}function Pn(t){return t%=Rn,(t+=Rn)!==Rn&&(t%=Rn),t}function Bn(t){return(t%=Rn)<-Math.PI?t+=Rn:t>=Math.PI&&(t-=Rn),t}function Fn(t,e,i){const s=En(t),n=En(e),a=Pn(i);return n<=a?n<=s&&s<=a:n<=s||s<=a}function zn(t){return t/180*Math.PI}function Gn(t){return t/Math.PI*180}function _n(t,e){return t=En(t),(e=En(e))-t+(t>e?2*Math.PI:0)}function jn(t,e,i,s){return{x:t+i*Math.cos(s),y:e+i*Math.sin(s)}}var Wn=(t,e)=>{const i=Symbol(String(e));t[i]=void 0,Object.defineProperty(t,e,{get(){return this[i]},set(t){this[i]!==t&&(this[i]=t,this.invalid=!0)},enumerable:!0,configurable:!1})},Vn=class t{constructor(){this.type="band",this.invalid=!0,this.interval=void 0,this.index=new Map,this.ordinalRange=[],this._domain=[],this.range=[0,1],this._bandwidth=1,this._step=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0,this.round=!1}static is(e){return e instanceof t}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&E.warnOnce("Expected update to not invalidate scale"))}set domain(t){this.invalid=!0;const e=[];this.index=new Map;const i=this.index;t.forEach(t=>{void 0===this.getIndex(t)&&i.set(t,e.push(t)-1)}),this._domain=e}get domain(){return this._domain}ticks(){this.refresh();let{interval:t=1}=this;"number"!=typeof t&&(t=Number(t));const e=Math.abs(Math.round(t));return this._domain.filter((t,i)=>i%e===0)}convert(t){this.refresh();const e=this.getIndex(t);if(void 0===e)return NaN;const i=this.ordinalRange[e];return void 0===i?NaN:i}invert(t){this.refresh();const e=this.ordinalRange.findIndex(e=>e===t);return this.domain[e]}invertNearest(t){var e;this.refresh();let i=-1,s=1/0;const n=this.ordinalRange.findIndex((e,n)=>{if(e===t)return!0;const a=Math.abs(t-e);return a<s&&(s=a,i=n),!1});return null!=(e=this.domain[n])?e:this.domain[i]}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(t){t=_s(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this._paddingInner=_s(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this._paddingOuter=_s(0,t,1)}get paddingOuter(){return this._paddingOuter}update(){const t=this._domain.length;if(0===t)return;const e=this.round,i=this._paddingInner,s=this._paddingOuter,[n,a]=this.range,o=a-n,r=o/Math.max(1,t+2*s-i),l=e?Math.floor(r):r,h=n+(o-l*(t-i))/2,c=e?Math.round(h):h,d=l*(1-i),u=e?Math.round(d):d,p=r*(1-i),g=[];for(let e=0;e<t;e++)g.push(c+l*e);this._bandwidth=u,this._rawBandwidth=p,this._step=l,this.ordinalRange=g}getIndex(t){if(!(t instanceof Date))return this.index.get(t);const e=t.valueOf();let i=0;for(const t of this.index.keys()){if(t instanceof Date&&t.valueOf()===e)return i;i++}}};b([Wn],Vn.prototype,"interval",2),b([Wn],Vn.prototype,"range",2),b([Wn],Vn.prototype,"round",2);var Kn=Vn;function Yn(t,e=[void 0]){return Ct((i,s,n)=>e.includes(n)?Ft(t)?t(n):t:n)}function $n(t,e={}){const{optional:i=!1,property:s}=e;return Ct((n,a,o)=>{var r;const l=y(m({},e),{target:n,property:a});if(i&&void 0===o||t(o,l))return be(n[a])&&!be(o)?(n[a].set(o),n[a]):o;const h=null!=s?s:String(a).replace(/^_*/,""),c=null!=(r=n.constructor.className)?r:n.constructor.name.replace(/Properties$/,"");let d=Wa(o);if(null!=d&&d.length>50){const t=d.length-50;d=d.slice(0,50)+`... (+${t} characters)`}return E.warn(`Property [${h}] of [${c}] cannot be set to [${d}]${t.message?`; expecting ${_a(t,l)}`:""}, ignoring.`),Dt},void 0,{optional:i})}var Hn,Un=(...t)=>{const e=[];return Ga((i,s)=>(e.length=0,t.every(t=>{const n=t(i,s);return n||e.push(_a(t,s)),n})),()=>e.filter(Boolean).join(" AND "))},Xn=(...t)=>Ga((e,i)=>t.some(t=>t(e,i)),e=>t.map(function(t){return e=>_a(e,t)}(e)).filter(Boolean).join(" OR ")),Zn=ja(Ga((t,e)=>be(t)||zt(t)&&be(e.target[e.property]),"a properties object")),qn=ja(Ga(t=>zt(t),"an object")),Qn=Ga(Rt,"a boolean"),Jn=Ga(Ft,"a function"),ta=Ga(jt,"a string"),ea=(Hn=Ga(Vt,"a number"),Object.assign(Hn,{restrict({min:t,max:e}={}){const i=["a number"],s=Wt(t),n=Wt(e);return s&&n?i.push(`between ${t} and ${e} inclusive`):s?i.push(`greater than or equal to ${t}`):n&&i.push(`less than or equal to ${e}`),Ga(i=>Vt(i)&&(!s||i>=t)&&(!n||i<=e),i.join(" "))}})),ia=Ga(t=>Wt(t)&&isNaN(t),"NaN"),sa=ea.restrict({min:0}),na=ea.restrict({min:0,max:1}),aa=ea.restrict({min:-360,max:360}),oa=Xn(ea,ia),ra=function(t){return Object.assign(t,{restrict({length:t,minLength:e}={}){let i="an array";return Wt(e)&&e>0?i="a non-empty array":Wt(t)&&(i=`an array of length ${t}`),Ga(i=>Ot(i)&&(!Wt(t)||i.length===t)&&(!Wt(e)||i.length>=e),i)}})}(Ga(Ot,"an array")),la=(t,e)=>Ga((e,i)=>Ot(e)&&e.every(e=>t(e,i)),t=>{var i;const s=null!=(i=_a(ra,t))?i:"";return e?`${s} of ${e}`:s}),ha=t=>Vt(t)||Pt(t),ca=t=>Ga((e,i)=>!ha(e)||!ha(i.target[t])||e<i.target[t],`to be less than ${t}`),da=t=>Ga((e,i)=>!ha(e)||!ha(i.target[t])||e>i.target[t],`to be greater than ${t}`),ua=Ga(Pt,"Date object"),pa=Xn(ua,sa),ga="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",ma=Ga(t=>jt(t)&&pn.validColorString(t),`color String. ${ga}`),ya=Ga(la(ma),`color strings. ${ga}`),fa=la(Qn,"boolean values"),xa=la(ea,"numbers"),ba=la(ta,"strings"),va=Ga(la(ua),"Date objects"),Sa=Ga(la(Zn),"objects"),Ma=Ba(["butt","round","square"],"a line cap"),ka=Ba(["round","bevel","miter"],"a line join"),Da=Ga(la(sa),"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."),wa=Ba(["top","right","bottom","left"],"a position"),Ia=Ba(["normal","italic","oblique"],"a font style"),Ca=Xn(Ba(["normal","bold","bolder","lighter"],"a font weight"),ea.restrict({min:1,max:1e3})),La=Ba(["never","always","hyphenate","on-space"],"a text wrap strategy"),Aa=Ba(["left","center","right"],"a text align"),Ta=Ba(["top","middle","bottom"],"a vertical align"),Na=Ba(["ellipsis","hide"],"an overflow strategy"),Oa=Ba(["horizontal","vertical"],"a direction"),Ra=Ba(["inside","outside"],"a placement"),Ea=Xn(Ba(["exact","nearest"],"interaction range"),ea),Pa=Ba(["top","bottom","left","right"]);function Ba(t,e="a"){return Ga(e=>t.includes(e),`${e} keyword such as ${function(t){const e=t.map(t=>`'${t}'`);if(1===e.length)return e[0];const i=e.pop();return`${e.join(", ")} or ${i}`}(t)}`)}var Fa=Xn(Un(ea.restrict({min:1}),ca("maxSpacing")),ia),za=Xn(Un(ea.restrict({min:1}),da("minSpacing")),ia);function Ga(t,e){return t.message=e,t}function _a(t,e){return Ft(t.message)?t.message(e):t.message}function ja(t){return Object.assign(t,{restrict:e=>Ga(t=>t instanceof e,i=>{var s;return null!=(s=_a(t,i))?s:`an instance of ${e.name}`})})}function Wa(t){if("number"==typeof t){if(isNaN(t))return"NaN";if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity"}return JSON.stringify(t)}var Va=Ga(t=>Vt(t)&&t>0||t instanceof P,"a non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'"),Ka=class extends fe{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6,this.color=void 0,this.interval=void 0,this.values=void 0}};b([$n(Qn)],Ka.prototype,"enabled",2),b([$n(sa)],Ka.prototype,"width",2),b([$n(sa)],Ka.prototype,"size",2),b([$n(ma,{optional:!0})],Ka.prototype,"color",2),b([$n(Va,{optional:!0})],Ka.prototype,"interval",2),b([$n(ra,{optional:!0})],Ka.prototype,"values",2);var Ya=(t=>(t.X="x",t.Y="y",t))(Ya||{}),$a={constructedArrays:new WeakMap};function Ha(t,e){var i;null==(i=$a.constructedArrays)||i.set(t,e)}var Ua=class t{constructor(e,i){this.invalid=!0,this.nice=!1,this.interval=void 0,this.tickCount=t.defaultTickCount,this.minTickCount=0,this.maxTickCount=1/0,this.niceDomain=[],this.defaultClampMode="raw",this.domain=e,this.range=i}static is(e){return e instanceof t}transform(t){return t}transformInvert(t){return t}calcBandwidth(t=1){const{range:e}=this,i=this.getDomain(),s=Math.abs(e[1]-e[0]),n=Math.abs(i[1]-i[0])/t+1,a=Math.floor(s),o=Math.min(n,a);return s/Math.max(1,o)}getDomain(){return this.nice&&(this.refresh(),this.niceDomain.length)?this.niceDomain:this.domain}convert(t,e){var i;const s=null!=(i=null==e?void 0:e.clampMode)?i:this.defaultClampMode;if(!this.domain||this.domain.length<2)return NaN;this.refresh();const n=this.getDomain().map(t=>this.transform(t)),[a,o]=n,{range:r}=this,[l,h]=r;if(t=this.transform(t),"clamped"===s){const[e,i]=Ws(n.map(Number));if(Number(t)<e)return l;if(Number(t)>i)return h}return a===o?(l+h)/2:t===a?l:t===o?h:l+(Number(t)-Number(a))/(Number(o)-Number(a))*(h-l)}invert(t){this.refresh();const e=this.getDomain().map(t=>this.transform(t)),[i,s]=e,{range:n}=this,[a,o]=n,r=a>o;let l;return t<(r?o:a)?r?s:i:t>(r?a:o)?r?i:s:(l=a===o?this.toDomain((Number(i)+Number(s))/2):this.toDomain(Number(i)+(t-a)/(o-a)*(Number(s)-Number(i))),this.transformInvert(l))}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&E.warnOnce("Expected update to not invalidate scale"))}getPixelRange(){const[t,e]=this.range;return Math.abs(e-t)}};Ua.defaultTickCount=5,Ua.defaultMaxTickCount=6,b([Wn],Ua.prototype,"domain",2),b([Wn],Ua.prototype,"range",2),b([Wn],Ua.prototype,"nice",2),b([Wn],Ua.prototype,"interval",2),b([Wn],Ua.prototype,"tickCount",2),b([Wn],Ua.prototype,"minTickCount",2),b([Wn],Ua.prototype,"maxTickCount",2);var Xa=Ua,Za={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 qa(t,e=new Date(t.getFullYear(),0,1)){const i=t.getTimezoneOffset()-e.getTimezoneOffset(),s=t.getTime()-e.getTime()+6e4*i;return Math.floor(s/864e5)}function Qa(t,e){const i=(e-new Date(t.getFullYear(),0,1).getDay()+7)%7,s=new Date(t.getFullYear(),0,i+1);return s<=t?Math.floor(qa(t,s)/7)+1:0}function Ja(t,e=t.getFullYear()){const i=new Date(e,0,1).getDay(),s=new Date(e,0,(4-i+7)%7-3+1);return s<=t?Math.floor(qa(t,s)/7)+1:Ja(t,e-1)}var to={a:t=>Za.shortDays[t.getDay()],A:t=>Za.days[t.getDay()],b:t=>Za.shortMonths[t.getMonth()],B:t=>Za.months[t.getMonth()],c:"%x, %X",d:(t,e)=>io(t.getDate(),2,null!=e?e:"0"),e:"%_d",f:(t,e)=>io(1e3*t.getMilliseconds(),6,null!=e?e:"0"),H:(t,e)=>io(t.getHours(),2,null!=e?e:"0"),I:(t,e)=>{const i=t.getHours()%12;return 0===i?"12":io(i,2,null!=e?e:"0")},j:(t,e)=>io(qa(t)+1,3,null!=e?e:"0"),m:(t,e)=>io(t.getMonth()+1,2,null!=e?e:"0"),M:(t,e)=>io(t.getMinutes(),2,null!=e?e:"0"),L:(t,e)=>io(t.getMilliseconds(),3,null!=e?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)=>io(t.getSeconds(),2,null!=e?e:"0"),u:t=>{let e=t.getDay();return e<1&&(e+=7),String(e%7)},U:(t,e)=>io(Qa(t,0),2,null!=e?e:"0"),V:(t,e)=>io(Ja(t),2,null!=e?e:"0"),w:(t,e)=>io(t.getDay(),2,null!=e?e:"0"),W:(t,e)=>io(Qa(t,1),2,null!=e?e:"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(t,e)=>io(t.getFullYear()%100,2,null!=e?e:"0"),Y:(t,e)=>io(t.getFullYear(),4,null!=e?e:"0"),Z:t=>function(t){const e=t.getTimezoneOffset(),i=Math.abs(e);return`${e>0?"-":"+"}${io(Math.floor(i/60),2,"0")}${io(Math.floor(i%60),2,"0")}`}(t),"%":()=>"%"},eo={_:" ",0:"0","-":""};function io(t,e,i){const s=String(Math.floor(t));return s.length>=e?s:`${i.repeat(e-s.length)}${s}`}function so(t){const e=[];for(;t.length>0;){let i=t.indexOf("%");if(0!==i){const s=i>0?t.substring(0,i):t;e.push(s)}if(i<0)break;const s=t[i+1],n=eo[s];null!=n&&i++;const a=t[i+1],o=to[a];if("function"==typeof o)e.push([o,n]);else if("string"==typeof o){const t=so(o);e.push([t,n])}else e.push(`${null!=n?n:""}${a}`);t=t.substring(i+2)}return t=>{const i="number"==typeof t?new Date(t):t;return e.map(t=>"string"==typeof t?t:t[0](i,t[1])).join("")}}function no(t){return t instanceof Date?t.getTime():t}function ao(t,e){const i=oo(t,e);return t=>so(i)(t)}function oo(t=[],e=t){let i=8;const s=t=>{t<i&&(i=t)};for(const e of t)s(ro(e));const n=no(e[0]),a=no(e.at(-1)),o=new Date(n).getFullYear(),r=new Date(a).getFullYear();return function(t,e,i){const s=no(i[0]),n=no(i.at(-1)),a=Math.abs(n-s),o=[["hour",216e5,12096e5,3,"%I %p"],["hour",_,216e5,3,"%I:%M"],["second",1e3,216e5,1,":%S"],["ms",0,216e5,0,".%L"],["am/pm",_,216e5,3,"%p"]," ",["day",W,6048e5,4,"%a"],["month",0===a?0:V,314496e5,5,"%b %d"],["month",3024e6,31536e7,6,"%B"]," ",["year",e||8===t?0:K,1/0,8,"%Y"]].filter(e=>{if("string"==typeof e)return!0;const[i,s,n,o]=e;return o>=t&&s<=a&&a<n}).reduce((t,e)=>("string"==typeof e?t.result.push(e):t.used.has(e[0])||(t.result.push(e),t.used.add(e[0])),t),{result:[],used:new Set}).result,r=o.findIndex(t=>"string"!=typeof t),l=o.length-[...o].reverse().findIndex(t=>"string"!=typeof t);return o.slice(r,l).map(t=>"string"==typeof t?t:t[4]).join("").replaceAll(/\s+/g," ").trim()}(i,r-o>0,t)}function ro(t){return H.floor(t)<t?0:Z.floor(t)<t?1:J.floor(t)<t?2:et.floor(t)<t?3:ut.floor(t)<t?ct.floor(t)<t?4:5:gt.floor(t)<t?6:8}var lo=(t,e=[])=>Object.assign(e,{fractionDigits:t});function ho(t,e,i,s,n){if(i<2)return po(t,e,e-t);const a=uo(t,e,i,s,n);return isNaN(a)?lo(0):po(t=Math.ceil(t/a)*a,e=Math.floor(e/a)*a,a)}var co=[1,2,5,10];function uo(t,e,i,s=0,n=1/0){const a=Math.abs(e-t),o=a/i,r=Math.floor(Math.log10(o)),l=Math.pow(10,r),h=co.map(t=>{const e=t*l,o=Math.ceil(a/e);return{multiplier:t,isWithinBounds:o>=s&&o<=n,diffCount:Math.abs(o-i)}}).sort((t,e)=>t.isWithinBounds!==e.isWithinBounds?t.isWithinBounds?-1:1:t.diffCount-e.diffCount)[0].multiplier;return!h||isNaN(h)?NaN:h*l}function po(t,e,i){const s=Math.min(t,e),n=Math.max(t,e),a=Xs(i),o=Math.pow(10,a),r=Math.ceil((n-s)/i),l=lo(a);for(let t=0;t<=r;t++){const e=s+i*t;l.push(Math.round(e*o)/o)}return l}function go({start:t,stop:e,interval:i,count:s,availableRange:n}){return null!=s||(s=(e-t)/("number"==typeof i?i:1)),s>=n&&(E.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0)}var mo=class t extends Xa{constructor(){super([],[0,1]),this.type="time"}toDomain(t){return new Date(t)}static getTickInterval({start:e,stop:i,count:s,minCount:n,maxCount:a,target:o}){let r,l;const h=null!=s?s:Xa.defaultTickCount,c=null!=o?o:Math.abs(i-e)/Math.max(h,1),d=t.getIntervalIndex(c);if(0===d)l=Math.max(uo(e,i,h,n,a),1),r=z;else if(d===t.tickIntervals.length)l=void 0===o?uo(e/K,i/K,h,n,a):1,r=gt;else{const e=c-t.tickIntervals[d-1][2]<t.tickIntervals[d][2]-c?d-1:d;[r,l]=t.tickIntervals[e]}return r.every(l)}static getIntervalIndex(e){let i=0;for(;i<t.tickIntervals.length&&e>t.tickIntervals[i][2];)i++;return i}invert(t){return new Date(super.invert(t))}ticks(){if(!this.domain||this.domain.length<2)return[];this.refresh();const[e,i]=this.getDomain().map(no),s=Math.min(e,i),n=Math.max(e,i),{interval:a,nice:o,tickCount:r,minTickCount:l,maxTickCount:h}=this;if(void 0!==a){const e=this.getPixelRange(),i=t.getTicksForInterval({start:s,stop:n,interval:a,availableRange:e});return null!=i?i:t.getDefaultTicks({start:s,stop:n,tickCount:r,minTickCount:l,maxTickCount:h})}if(o){if(2===r)return this.niceDomain;if(1===r)return this.niceDomain.slice(0,1)}return t.getDefaultTicks({start:s,stop:n,tickCount:r,minTickCount:l,maxTickCount:h})}static getDefaultTicks({start:e,stop:i,tickCount:s,minTickCount:n,maxTickCount:a}){const o=t.getTickInterval({start:e,stop:i,count:s,minCount:n,maxCount:a});return o?o.range(new Date(e),new Date(i)):[]}static getTicksForInterval({start:e,stop:i,interval:s,availableRange:n}){if(!s)return[];if(s instanceof P){const t=s.range(new Date(e),new Date(i));if(go({start:e,stop:i,interval:s,count:t.length,availableRange:n}))return;return t}const a=Math.abs(s);if(go({start:e,stop:i,interval:a,availableRange:n}))return;const o=[...t.tickIntervals];o.reverse();const r=o.find(t=>a%t[2]===0);if(r)return r[0].every(a/(r[2]/r[1])).range(new Date(e),new Date(i));let l=new Date(e);const h=new Date(i),c=[];for(;l<=h;)c.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+a);return c}tickFormat({ticks:t,domain:e,specifier:i}){return null==i?ao(t,e):so(i)}update(){!this.domain||this.domain.length<2||this.nice&&this.updateNiceDomain()}updateNiceDomain(){let[t,e]=this.domain;for(let i=0;i<4;i++){this.updateNiceDomainIteration(t,e);const[i,s]=this.niceDomain;if(no(t)===no(i)&&no(e)===no(s))break;t=i,e=s}}updateNiceDomainIteration(e,i){const s=Math.min(no(e),no(i)),n=Math.max(no(e),no(i)),a=e>i,{interval:o}=this;let r;if(o instanceof P)r=o;else{const e="number"==typeof o?(n-s)/Math.max(o,1):this.tickCount;r=t.getTickInterval({start:s,stop:n,count:e,minCount:this.minTickCount,maxCount:this.maxTickCount})}if(r){const t=r.range(new Date(s),new Date(n),!0),e=a?[...t].reverse():t,i=e[0],o=e.at(-1);this.niceDomain=[i,o]}}};mo.tickIntervals=[[H,1,G],[H,5,5e3],[H,15,15e3],[H,30,3e4],[Z,1,_],[Z,5,3e5],[Z,15,9e5],[Z,30,18e5],[J,1,j],[J,3,108e5],[J,6,216e5],[J,12,432e5],[et,1,W],[et,2,1728e5],[ct,1,V],[ct,2,12096e5],[ct,3,18144e5],[ut,1,2592e6],[ut,2,5184e6],[ut,3,7776e6],[ut,4,10368e6],[ut,6,15552e6],[gt,1,K]];var yo=mo,fo=class t extends Kn{constructor(){super(...arguments),this.type="ordinal-time",this.tickCount=Xa.defaultTickCount,this.minTickCount=0,this.maxTickCount=1/0,this.interval=void 0,this.index=new Map,this._domain=[]}static is(e){return e instanceof t}toDomain(t){return new Date(t)}set domain(t){if(this.invalid=!0,0===t.length)return void(this._domain=[]);const e=this.updateIndex(t);this._domain=e}get domain(){return this._domain}updateIndex(t){this.index=new Map;const{index:e}=this,i=[],s=[],n=t[0]>t.at(-1),a=n?0:1;t.forEach((o,r)=>{const l=t[r+1],h=n?o:this.toDomain(no(o)+1),c=n?this.toDomain(no(l)+1):l,d=n?[c,h]:[h,c];i.push(o),void 0!==l&&void 0===e.get(d)&&(s.push(Math.abs(no(c)-no(h))),e.set(d,r+a))}),s.sort((t,e)=>t-e);const o=s.length,r=Math.floor(o/2);this.medianInterval=o>2&&o%2==0?(s[r-1]+s[r+1])/2:s[r];const l=Math.max(0,yo.getIntervalIndex(this.medianInterval)-1),[h,c]=yo.tickIntervals[l],d=h.every(c),u=n?t.length-1:0,p=t[u],g=[d.floor(t[u]),p];return e.set(g,u),i}ticks(){if(!this.domain)return[];this.refresh();const[t,e]=[no(this.domain[0]),no(this.domain.at(-1))],i=Math.min(t,e),s=Math.max(t,e),n=t>e;let a;void 0!==this.interval&&(a=this.getTicksForInterval({start:i,stop:s,interval:this.interval}));const o=this.domain.length,{maxTickCount:r,tickCount:l}=this;let h,{minTickCount:c}=this;isFinite(r)&&o<=r&&(c=Math.max(1,o),h=this.medianInterval),null!=a||(a=this.getDefaultTicks({start:i,stop:s,tickCount:l,minTickCount:c,maxTickCount:r,isReversed:n,interval:h}));const d=new Set;return a.filter(t=>{const e=this.convert(t);return!isNaN(e)&&!d.has(e)&&(d.add(e),!0)})}getDefaultTicks({start:t,stop:e,tickCount:i,minTickCount:s,maxTickCount:n,isReversed:a,interval:o}){const r=yo.getTickInterval({start:t,stop:e,count:i,minCount:s,maxCount:n,target:o});if(!r)return[];const l=Math.ceil(this.domain.length/n),h=[];for(const[t,e]of this.index.entries()){if(e%l>0)continue;const i=a?r.ceil(t[0]):r.floor(t[1]);h.splice(e,0,i)}return h}getTicksForInterval({start:t,stop:e,interval:i}){var s;const[n,a]=this.range,o=Math.abs(a-n);return null!=(s=yo.getTicksForInterval({start:t,stop:e,interval:i,availableRange:o}))?s:[]}convert(t){if("number"==typeof t&&(t=new Date(t)),!(t instanceof Date))return NaN;let e;this.refresh();for(const[i,s]of this.index.entries())if(t>=i[0]&&t<=i[1]){e=s;break}if(void 0===e)return NaN;const i=this.ordinalRange[e];return void 0===i?NaN:i}tickFormat({ticks:t,domain:e,specifier:i}){return null==i?ao(t,e):so(i)}invert(t){return new Date(super.invert(t))}invertNearest(t){return new Date(super.invertNearest(t))}};b([Wn],fo.prototype,"tickCount",2),b([Wn],fo.prototype,"minTickCount",2),b([Wn],fo.prototype,"maxTickCount",2),b([Wn],fo.prototype,"interval",2);var xo=fo;function bo(t,e){return"number"==typeof t&&"number"==typeof e?t-e:"string"==typeof t&&"string"==typeof e?t.localeCompare(e):null==t&&null==e?0:null==t?-1:null==e?1:String(t).localeCompare(String(e))}function vo(t){return"function"==typeof t?t():t}function So(t,e,i){for(const s in t){const n=i(vo(t[s]),vo(e[s]));if(0!==n)return n}return 0}var Mo=class t extends hn{constructor(t){var e;super({isVirtual:null==t?void 0:t.isVirtual}),this.opts=t,this.opacity=1,this.lastBBox=void 0;const{zIndex:i,zIndexSubOrder:s}=null!=t?t:{};this.isContainerNode=!0,void 0!==i&&(this.zIndex=i),void 0!==s&&(this.zIndexSubOrder=s),this.name=null==(e=this.opts)?void 0:e.name}static is(e){return e instanceof t}onZIndexChange(){var t;super.onZIndexChange(),this.layer&&(null==(t=this._layerManager)||t.moveLayer(this.layer,this.zIndex,this.zIndexSubOrder))}isLayer(){return null!=this.layer}_setLayerManager(t){if(this._layerManager&&this.layer&&(this._layerManager.removeLayer(this.layer),this.layer=void 0),this.layer)throw new Error("AG Charts - unable to deregister scene rendering layer!");super._setLayerManager(t)}initialiseLayer(){var t;this.layer||this._layerManager&&!0===(null==(t=this.opts)?void 0:t.layer)&&(this.layer=this._layerManager.addLayer({name:this.name,zIndex:this.zIndex,zIndexSubOrder:this.zIndexSubOrder,getComputedOpacity:()=>this.getComputedOpacity(),getVisibility:()=>this.getVisibility()}))}getComputedOpacity(){let e=1;for(const i of this.traverseUp())i instanceof t&&(e*=i.opacity);return e}getVisibility(){for(const t of this.traverseUp())if(!t.visible)return!1;return!0}onVisibleChange(){this.layer&&(this.layer.enabled=this.visible)}markDirty(t,e=1){if(this.isVirtual)return void super.markDirty(t,e);let i=e;(e<2||null!=this.layer)&&(i=1),super.markDirty(t,e,i)}containsPoint(t,e){return!0}computeBBox(){return this.computeTransformMatrix(),t.computeBBox(this.children)}computeTransformedBBox(){return this.computeBBox()}preRender(){var t,e;const i=super.preRender();return i.groups+=1,i.nonGroups-=1,!0!==(null==(t=this.opts)?void 0:t.layer)||null!=this.layer||(i.nonGroups>0&&this.initialiseLayer(),(null==(e=this.opts)?void 0:e.nonEmptyChildDerivedZIndex)&&i.nonGroups>0&&this.deriveZIndexFromChildren()),i}deriveZIndexFromChildren(){var t;const e=this.children.filter(t=>t._childNodeCounts.nonGroups>0);this.sortChildren(e);const i=e.at(-1);this.zIndex=null!=(t=null==i?void 0:i.zIndex)?t:-1/0,this.zIndexSubOrder=null==i?void 0:i.zIndexSubOrder}render(t){var e,i;const{opts:{name:s}={},_debug:n}=this,{dirty:a,dirtyZIndex:o,layer:r,children:l,clipRect:h,dirtyTransform:c}=this;let{ctx:d,forceRender:u,clipBBox:p}=t;const{resized:g,stats:f}=t,x=d.getTransform(),b=a>=2||o||g;let v=b,S=!1;for(const t of l)if(v||(v=null==t.layerManager&&t.dirty>=1),S||(S=null!=t.layerManager&&t.dirty>=1),v)break;if(s&&(null==n||n({name:s,group:this,isDirty:b,isChildDirty:v,dirtyTransform:c,renderCtx:t,forceRender:u})),c)u="dirtyTransform";else if(r){const t=this.computeBBox();void 0!==this.lastBBox&&this.lastBBox.equals(t)||(u="dirtyTransform",this.lastBBox=t)}if(!(b||v||S||u))return s&&f&&(null==n||n({name:s,result:"skipping",renderCtx:t,counts:this.nodeCount,group:this})),r&&f&&(f.layersSkipped++,f.nodesSkipped+=this.nodeCount.count),void this.markClean({recursive:!1});const M=this.visible;if(r){if(d=r.context,d.save(),d.setTransform(r.pixelRatio,0,0,r.pixelRatio,0,0),"dirtyTransform"!==u&&(u=v||o),u&&r.clear(),p){const{width:e,height:i,x:a,y:o}=p;null==n||n(()=>({name:s,clipBBox:p,ctxTransform:d.getTransform(),renderCtx:t,group:this})),d.beginPath(),d.rect(a,o,e,i),d.clip()}d.setTransform(x)}else d.globalAlpha*=this.opacity;if(this.computeTransformMatrix(),this.matrix.toContext(d),h){const{x:e,y:i,width:a,height:o}=h;d.save(),null==n||n(()=>({name:s,clipRect:h,ctxTransform:d.getTransform(),renderCtx:t,group:this})),d.beginPath(),d.rect(e,i,a,o),d.clip(),p=this.matrix.transformBBox(h)}const k=this.hasVirtualChildren();o?(this.sortChildren(l),"dirtyTransform"!==u&&(u=!0)):k&&this.sortChildren(l);const D=u!==t.forceRender||p!==t.clipBBox||d!==t.ctx?y(m({},t),{ctx:d,forceRender:u,clipBBox:p}):t;let w=0;for(const t of l)t.visible&&M?u||0!==t.dirty?(d.save(),t.render(D),d.restore()):f&&(w+=t.nodeCount.count):(t.markClean(),f&&(w+=t.nodeCount.count));if(f&&(f.nodesSkipped+=w),super.render(t),h&&d.restore(),k)for(const t of this.virtualChildren)t.markClean({recursive:"virtual"});r&&(f&&f.layersRendered++,d.restore(),u&&r.snapshot(),null==(i=(e=r.context).verifyDepthZero)||i.call(e)),s&&f&&(null==n||n({name:s,result:"rendered",skipped:w,renderCtx:t,counts:this.nodeCount,group:this}))}sortChildren(t){this.dirtyZIndex=!1,t.sort((t,e)=>{var i,s;return So([t.zIndex,...null!=(i=t.zIndexSubOrder)?i:[void 0,void 0],t.serialNumber],[e.zIndex,...null!=(s=e.zIndexSubOrder)?s:[void 0,void 0],e.serialNumber],bo)})}static computeBBox(t){let e=1/0,i=-1/0,s=1/0,n=-1/0;for(const a of t){if(!a.visible)continue;const t=a.computeTransformedBBox();if(!t)continue;const{x:o,y:r,width:l,height:h}=t;o<e&&(e=o),r<s&&(s=r),o+l>i&&(i=o+l),r+h>n&&(n=r+h)}return new Js(e,s,i-e,n-s)}setClipRectInGroupCoordinateSpace(t){this.clipRect=t?this.transformBBox(t):void 0}};Mo.className="Group",b([sn({redraw:3,convertor:t=>_s(0,t,1)})],Mo.prototype,"opacity",2);var ko=Mo,Do=class{constructor(t=[]){this.stops=t}},wo=class extends Do{constructor(t,e=0){super(t),this.angle=e}createGradient(t,e){const{stops:i,angle:s}=this,n=En(zn(s+90)),a=Math.cos(n),o=Math.sin(n),r=e.width,l=e.height,h=e.x+.5*r,c=e.y+.5*l;if(r>0&&l>0){const e=Math.sqrt(l*l+r*r)/2,s=Math.atan2(l,r);let d;d=n<Math.PI/2?n:n<Math.PI?Math.PI-n:n<1.5*Math.PI?n-Math.PI:2*Math.PI-n;const u=e*Math.abs(Math.cos(d-s)),p=t.createLinearGradient(h+a*u,c+o*u,h-a*u,c-o*u);for(const t of i)p.addColorStop(t.offset,t.color);return p}return"black"}},Io=/^linear-gradient\((.*?)deg,\s*(.*?)\s*\)$/i,Co=class t extends hn{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=t.defaultStyles.fill,this.stroke=t.defaultStyles.stroke,this.strokeWidth=t.defaultStyles.strokeWidth,this.lineDash=t.defaultStyles.lineDash,this.lineDashOffset=t.defaultStyles.lineDashOffset,this.lineCap=t.defaultStyles.lineCap,this.lineJoin=t.defaultStyles.lineJoin,this.opacity=t.defaultStyles.opacity,this.fillShadow=t.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:t}=this.constructor;Object.assign(this,t)}onFillChange(){const{fill:t}=this;let e;if((null==t?void 0:t.startsWith("linear-gradient"))&&(e=Io.exec(t))){const t=parseFloat(e[1]),i=[],s=e[2],n=/(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi;let a;for(;a=n.exec(s);)i.push(a[0]);this.gradient=new wo(i.map((t,e)=>({color:t,offset:e/(i.length-1)})),t)}else this.gradient=void 0}align(t,e){var i,s,n;const a=null!=(n=null==(s=null==(i=this.layerManager)?void 0:i.canvas)?void 0:s.pixelRatio)?n:1,o=Math.round(t*a)/a;return null==e?o:0===e?0:e<1?Math.ceil(e*a)/a:Math.round((e+t)*a)/a-o}fillStroke(t,e){this.renderFill(t,e),this.renderStroke(t,e)}renderFill(t,e){if(this.fill){const{globalAlpha:i}=t;this.applyFill(t),this.applyFillAlpha(t),this.applyShadow(t),this.executeFill(t,e),t.globalAlpha=i}t.shadowColor="rgba(0, 0, 0, 0)"}executeFill(t,e){e?t.fill(e):t.fill()}applyFill(t){var e,i;t.fillStyle=null!=(i=null==(e=this.gradient)?void 0:e.createGradient(t,this.computeBBox()))?i:this.fill}applyFillAlpha(t){t.globalAlpha*=this.opacity*this.fillOpacity}applyShadow(t){var e,i;const s=null!=(i=null==(e=this.layerManager)?void 0:e.canvas.pixelRatio)?i:1,n=this.fillShadow;(null==n?void 0:n.enabled)&&(t.shadowColor=n.color,t.shadowOffsetX=n.xOffset*s,t.shadowOffsetY=n.yOffset*s,t.shadowBlur=n.blur*s)}renderStroke(t,e){if(this.stroke&&this.strokeWidth){const{globalAlpha:i}=t;t.strokeStyle=this.stroke,t.globalAlpha*=this.opacity*this.strokeOpacity,t.lineWidth=this.strokeWidth,this.lineDash&&t.setLineDash(this.lineDash),this.lineDashOffset&&(t.lineDashOffset=this.lineDashOffset),this.lineCap&&(t.lineCap=this.lineCap),this.lineJoin&&(t.lineJoin=this.lineJoin),this.executeStroke(t,e),t.globalAlpha=i}}executeStroke(t,e){e?t.stroke(e):t.stroke()}containsPoint(t,e){return this.isPointInPath(t,e)}};Co.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},b([sn({redraw:2})],Co.prototype,"fillOpacity",2),b([sn({redraw:2})],Co.prototype,"strokeOpacity",2),b([sn({redraw:2,changeCb:t=>t.onFillChange()})],Co.prototype,"fill",2),b([sn({redraw:2})],Co.prototype,"stroke",2),b([sn({redraw:2})],Co.prototype,"strokeWidth",2),b([sn({redraw:2})],Co.prototype,"lineDash",2),b([sn({redraw:2})],Co.prototype,"lineDashOffset",2),b([sn({redraw:2})],Co.prototype,"lineCap",2),b([sn({redraw:2})],Co.prototype,"lineJoin",2),b([sn({redraw:2,convertor:t=>_s(0,t,1)})],Co.prototype,"opacity",2),b([sn({redraw:2,checkDirtyOnAssignment:!0})],Co.prototype,"fillShadow",2);var Lo=Co,Ao=class extends Lo{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.isRange=!1,this.restoreOwnStyles()}computeBBox(){return new Js(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(t,e){return!1}render(t){var e;const{ctx:i,forceRender:s,stats:n}=t;if(0===this.dirty&&!s)return void(n&&(n.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(i);let{x1:a,y1:o,x2:r,y2:l}=this;a=this.align(a),o=this.align(o),r=this.align(r),l=this.align(l);const{fill:h,opacity:c,isRange:d}=this;if(d&&h){const{fillOpacity:t}=this;i.fillStyle=h,i.globalAlpha=c*t,i.beginPath(),i.moveTo(a,o),i.lineTo(r,o),i.lineTo(r,l),i.lineTo(a,l),i.closePath(),i.fill()}const{stroke:u,strokeWidth:p,startLine:g,endLine:m}=this;if((g||m)&&u&&p){const{strokeOpacity:t,lineDash:e,lineDashOffset:s,lineCap:n,lineJoin:h}=this;i.strokeStyle=u,i.globalAlpha=c*t,i.lineWidth=p,e&&i.setLineDash(e),s&&(i.lineDashOffset=s),n&&(i.lineCap=n),h&&(i.lineJoin=h),i.beginPath(),g&&(i.moveTo(a,o),i.lineTo(r,o)),m&&(i.moveTo(r,l),i.lineTo(a,l)),i.stroke()}null==(e=this.fillShadow)||e.markClean(),super.render(t)}};Ao.className="Range",Ao.defaultStyles=y(m({},Lo.defaultStyles),{strokeWidth:1}),b([sn({redraw:2})],Ao.prototype,"x1",2),b([sn({redraw:2})],Ao.prototype,"y1",2),b([sn({redraw:2})],Ao.prototype,"x2",2),b([sn({redraw:2})],Ao.prototype,"y2",2),b([sn({redraw:2})],Ao.prototype,"startLine",2),b([sn({redraw:2})],Ao.prototype,"endLine",2),b([sn({redraw:2})],Ao.prototype,"isRange",2);var To=new WeakMap,No=new WeakMap;function Oo(t,e){var i,s,n;const a=JSON.stringify(t,null,0);return To.has(e)||To.set(e,new Map),(null==(i=To.get(e))?void 0:i.has(a))||null==(s=To.get(e))||s.set(a,e(t)),null==(n=To.get(e))?void 0:n.get(a)}function Ro(t){return(e,...i)=>{var s,n,a;const o=JSON.stringify(e,null,0);return No.has(t)||No.set(t,new Map),(null==(s=No.get(t))?void 0:s.has(o))||null==(n=No.get(t))||n.set(o,t(e,...i)),null==(a=No.get(t))?void 0:a.get(o)}}function Eo(t){const{redraw:e=3,changeCb:i}=null!=t?t:{};return sn({redraw:e,type:"font",changeCb:i})}var Po=class t extends Lo{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this._dirtyFont=!0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=t.defaultStyles.textAlign,this.textBaseline=t.defaultStyles.textBaseline}onTextChange(){var t,e;this.lines=null!=(e=null==(t=this.text)?void 0:t.split("\n").map(t=>t.trim()))?e:[]}get font(){return(null==this._font||this._dirtyFont)&&(this._dirtyFont=!1,this._font=zo(this)),this._font}computeBBox(){const{x:e,y:i,lines:s,lineHeight:n,textBaseline:a,textAlign:o}=this,{top:r,left:l,width:h,height:c}=t.getTextSizeMultiline(s,zo(this),a,o,n);return new Js(e-l,i-r,h,c)}getLineHeight(e){var i,s;if(this.lineHeight)return this.lineHeight;const n=t.measureText(e,this.font,this.textBaseline,this.textAlign);return(null!=(i=n.fontBoundingBoxAscent)?i:n.emHeightAscent)+(null!=(s=n.fontBoundingBoxDescent)?s:n.emHeightDescent)}isPointInPath(t,e){const i=this.transformPoint(t,e),s=this.computeBBox();return!!s&&s.containsPoint(i.x,i.y)}render(t){const{ctx:e,forceRender:i,stats:s}=t;if(0===this.dirty&&!i)return void(s&&(s.nodesSkipped+=this.nodeCount.count));if(!this.lines.length||!this.layerManager)return void(s&&(s.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(e);const{fill:n,stroke:a,strokeWidth:o}=this;e.font=this.font,e.textAlign=this.textAlign,e.textBaseline=this.textBaseline;const r=this.layerManager.canvas.pixelRatio||1,{globalAlpha:l}=e;if(n){e.fillStyle=n,e.globalAlpha=l*this.opacity*this.fillOpacity;const{fillShadow:t}=this;(null==t?void 0:t.enabled)&&(e.shadowColor=t.color,e.shadowOffsetX=t.xOffset*r,e.shadowOffsetY=t.yOffset*r,e.shadowBlur=t.blur*r),this.renderLines((t,i,s)=>e.fillText(t,i,s))}if(a&&o){e.strokeStyle=a,e.lineWidth=o,e.globalAlpha=l*this.opacity*this.strokeOpacity;const{lineDash:t,lineDashOffset:i,lineCap:s,lineJoin:n}=this;t&&e.setLineDash(t),i&&(e.lineDashOffset=i),s&&(e.lineCap=s),n&&(e.lineJoin=n),this.renderLines((t,i,s)=>e.strokeText(t,i,s))}super.render(t)}renderLines(e){const{lines:i,x:s,y:n}=this,a=i.map(t=>this.getLineHeight(t)),o=a.reduce((t,e)=>t+e,0);let r=(a[0]-o)*t.getVerticalModifier(this.textBaseline);for(let t=0;t<i.length;t++)e(i[t],s,n+r),r+=a[t]}static wrapLines(e,i,s,n,a,o){const r="hide"!==o,l=new Fo(n),h=e.split(/\r?\n/g);if(0===h.length)return{lines:void 0,truncated:!1};if("never"===a){const{text:e,truncated:s}=t.truncateLine(h[0],i,l,r?"auto":"never");return{lines:null!=e?[e]:void 0,truncated:s}}const c=[];let d=0,u=!1;for(const e of h){const o=t.wrapLine(e,i,s,l,n,a,d,r);if(null==o)return{lines:void 0,truncated:!1};if(c.push(...o.result),d=o.cumulativeHeight,o.truncated){u=!0;break}}return{lines:c,truncated:u}}static wrap(e,i,s,n,a,o="ellipsis"){var r;const{lines:l,truncated:h}=t.wrapLines(e,i,s,n,a,o);return{text:null!=(r=null==l?void 0:l.join("\n").trim())?r:"",truncated:h}}static wrapLine(e,i,s,n,a,o,r,l){if(!(e=e.trim()))return{result:[],truncated:!1,cumulativeHeight:r};const h=n.size(e);if(h.width<=i)return{result:[e],truncated:!1,cumulativeHeight:r+h.height};if(h.height>s||n.width("W")>i)return l?{result:[],truncated:!0,cumulativeHeight:r}:void 0;const c=e.split(/\s+/g),d=t.wrapLineSequentially(c,i,s,n,a,o,r,l);if(null==d)return;r=d.cumulativeHeight;let{lines:u}=d;if(!d.wordsBrokenOrTruncated&&!d.linesTruncated){const e=d.lines.length,s=t.wrapLineBalanced(c,i,n,e);s.length===u.length&&(u=s)}return{result:u.map(t=>t.join(" ")),truncated:d.linesTruncated,cumulativeHeight:r}}static breakWord(e,i,s,n,a){const o=i=>t.punctuationMarks.includes(e[i]),r=n?a.width("-"):0,l=[];let h=0,c=0;for(let t=0;t<e.length;t++){const n=e[t],o=a.width(n);h+o+r>(0===c?i:s)&&(l.push(t),h=0,c++),h+=o}const d=[];let u=0;for(const t of l){let i=e.substring(u,t);n&&i.length>0&&!o(t-1)&&!o(t)&&(i+="-"),d.push(i),u=t}return d.push(e.substring(u)),d}static truncateLine(t,e,i,s){t=t.trimEnd();const n=i.width(t);if(n>e&&"never"===s)return{text:void 0,truncated:!1};if(n<=e&&"force"!==s)return{text:t,truncated:!1};const a=i.width("…");let o=t,r=n;for(;o.length>0&&r+a>e;)o=o.slice(0,-1).trimEnd(),r=i.width(o);return r+a<=e?{text:`${o}…`,truncated:!0}:{text:void 0,truncated:!1}}static wrapLineSequentially(e,i,s,n,a,o,r,l){const{fontSize:h=0,lineHeight:c=h*t.defaultLineHeightRatio}=a,d="always"===o||"hyphenate"===o,u="hyphenate"===o,p=n.width(" ");let g=!1,m=!1;const y=[];let f=[],x=0;const b=()=>({lines:y,linesTruncated:m,wordsBrokenOrTruncated:g,cumulativeHeight:r}),v=()=>{if(!l)return;const e=f.join(" "),{text:s}=t.truncateLine(e,i,n,"force");return null!=s?(f.splice(0,f.length,s),m=!0,b()):void 0},S=()=>{const t=r+c;return!(t>=s||(f=[],x=0,r=t,y.push(f),0))};if(!S())return v();for(let s=0;s<e.length;s++){const a=e[s],o=n.width(a),r=0===f.length?0:p,h=x+r+o;if(h<=i)f.push(a),x=h;else if(o<=i){if(!S())return v();f.push(a),x=o}else{if(g=!0,!d){if(l){if(!S())return v();const{text:o}=t.truncateLine(a,i,n,"force");if(null==o)return;f.push(o),s<e.length-1&&(m=!0);break}return}{const e=i-x-r,s=t.breakWord(a,e,i,u,n);for(let t=0;t<s.length;t++){const e=s[t];if(e&&f.push(e),t===s.length-1)x=n.width(e);else if(!S())return v()}}}}return b()}static wrapLineBalanced(t,e,i,s){const n=t.reduce((t,e)=>t+i.width(e),0),a=i.width(" "),o=(n+a*(t.length-s-2))/s,r=[];let l=[],h=i.width(t[0]),c=!0;for(const s of t){const t=i.width(s);if(c){l=[],l.push(s),h=t,c=!1,r.push(l);continue}const n=h+a+t;n<=o?(l.push(s),h=n):n<=e?(l.push(s),c=!0):(l=[s],h=t,r.push(l))}return r}setFont(t){this.fontFamily=t.fontFamily,this.fontSize=t.fontSize,this.fontStyle=t.fontStyle,this.fontWeight=t.fontWeight}setAlign(t){this.textAlign=t.textAlign,this.textBaseline=t.textBaseline}static getVerticalModifier(t){switch(t){case"top":case"hanging":return 0;case"bottom":case"alphabetic":case"ideographic":return 1;case"middle":return.5}}static get textContext(){if(!this._textContext){const t=Ms("canvas");t.width=0,t.height=0,this._textContext=t.getContext("2d")}return this._textContext}static measureText(t,e,i,s){return this._measureText({text:t,font:e,textBaseline:i,textAlign:s})}static getTextSize(t,e){return this._getTextSize({text:t,font:e})}static getTextSizeMultiline(e,i,s=t.defaultStyles.textBaseline,n=t.defaultStyles.textAlign,a){var o,r;let l=0,h=0,c=0,d=0,u=0;for(const[t,a]of e.entries()){const p=this._measureText({text:a,font:i,textBaseline:s,textAlign:n});h=Math.max(h,p.actualBoundingBoxLeft),c=Math.max(c,p.width),0==t?(l+=p.actualBoundingBoxAscent,d+=p.actualBoundingBoxAscent):u+=null!=(o=p.fontBoundingBoxAscent)?o:p.emHeightAscent,t==e.length-1?d+=p.actualBoundingBoxDescent:u+=null!=(r=p.fontBoundingBoxDescent)?r:p.emHeightDescent}return null!=a&&(u=(e.length-1)*a),d+=u,l+=u*t.getVerticalModifier(s),{top:l,left:h,width:c,height:d}}};Po.className="Text",Po.defaultLineHeightRatio=1.15,Po.defaultStyles=Object.assign({},Lo.defaultStyles,{textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"}),Po.ellipsis="…",Po.punctuationMarks=[".",",","-",":",";","!","?","'",'"',"(",")"],Po._measureText=Ro(({text:t,font:e,textBaseline:i,textAlign:s})=>{const n=Po.textContext;return n.font!==e&&(n.font=e),n.textBaseline!==i&&(n.textBaseline=i),n.textAlign!==s&&(n.textAlign=s),n.measureText(t)}),Po._getTextSize=Ro(({text:t,font:e})=>{const i=Po.textContext;i.font!==e&&(i.font=e);const s=i.measureText(t);return{width:s.width,height:s.actualBoundingBoxAscent+s.actualBoundingBoxDescent}}),b([sn({redraw:3})],Po.prototype,"x",2),b([sn({redraw:3})],Po.prototype,"y",2),b([sn({redraw:3,changeCb:t=>t.onTextChange()})],Po.prototype,"text",2),b([Eo()],Po.prototype,"fontStyle",2),b([Eo()],Po.prototype,"fontWeight",2),b([Eo()],Po.prototype,"fontSize",2),b([Eo()],Po.prototype,"fontFamily",2),b([sn({redraw:3})],Po.prototype,"textAlign",2),b([sn({redraw:3})],Po.prototype,"textBaseline",2),b([sn({redraw:3})],Po.prototype,"lineHeight",2);var Bo=Po,Fo=class{constructor(t){this.font=jt(t)?t:zo(t)}size(t){return t.includes("\n")?Bo.getTextSizeMultiline(t.split("\n").map(t=>t.trim()),this.font):Bo.getTextSize(t,this.font)}width(t){const{width:e}=this.size(t);return e}};function zo(t){const{fontFamily:e,fontSize:i,fontStyle:s,fontWeight:n}=t;return[null!=s?s:"",null!=n?n:"",i+"px",e].join(" ").trim()}var Go=class extends fe{constructor(){super(...arguments),this.enabled=!0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}getFont(){return zo(this)}};function _o(t){const{parallelFlipRotation:e=0,regularFlipRotation:i=0}=t,s=t.rotation?En(zn(t.rotation)):0,n=!s&&e>=0&&e<=Math.PI?-1:1,a=!s&&i>=0&&i<=Math.PI?-1:1;let o=0;return t.parallel?o=n*Math.PI/2:-1===a&&(o=Math.PI),{configuredRotation:s,defaultRotation:o,parallelFlipFlag:n,regularFlipFlag:a}}function jo(t,e,i,s,n){const a=e>0&&e<=Math.PI,o=i>0&&i<=Math.PI;if(t){if(!e&&!i)return"center";if(s*(a||o?-1:1)==-1)return"end"}else if(s*n===-1)return"end";return"start"}function Wo(t,e,i,s,n){const{width:a,height:o}=e,r=new Js(i,s,0,0);n.transformBBox(r,e);const{x:l,y:h}=e;return e.width=a,e.height=o,{point:{x:l,y:h},label:{text:t,width:a,height:o}}}b([$n(Qn)],Go.prototype,"enabled",2),b([$n(ma,{optional:!0})],Go.prototype,"color",2),b([$n(Ia,{optional:!0})],Go.prototype,"fontStyle",2),b([$n(Ca,{optional:!0})],Go.prototype,"fontWeight",2),b([$n(sa)],Go.prototype,"fontSize",2),b([$n(ta)],Go.prototype,"fontFamily",2),b([$n(Jn,{optional:!0})],Go.prototype,"formatter",2);var Vo=(t=>(t[t.SERIES_BACKGROUND_ZINDEX=0]="SERIES_BACKGROUND_ZINDEX",t[t.AXIS_GRID_ZINDEX=1]="AXIS_GRID_ZINDEX",t[t.AXIS_ZINDEX=2]="AXIS_ZINDEX",t[t.SERIES_CROSSLINE_RANGE_ZINDEX=3]="SERIES_CROSSLINE_RANGE_ZINDEX",t[t.SERIES_LAYER_ZINDEX=4]="SERIES_LAYER_ZINDEX",t[t.SERIES_HIGHLIGHT_ZINDEX=5]="SERIES_HIGHLIGHT_ZINDEX",t[t.AXIS_FOREGROUND_ZINDEX=6]="AXIS_FOREGROUND_ZINDEX",t[t.SERIES_CROSSHAIR_ZINDEX=7]="SERIES_CROSSHAIR_ZINDEX",t[t.SERIES_LABEL_ZINDEX=8]="SERIES_LABEL_ZINDEX",t[t.SERIES_CROSSLINE_LINE_ZINDEX=9]="SERIES_CROSSLINE_LINE_ZINDEX",t[t.SERIES_ANNOTATION_ZINDEX=10]="SERIES_ANNOTATION_ZINDEX",t[t.LEGEND_ZINDEX=11]="LEGEND_ZINDEX",t[t.NAVIGATOR_ZINDEX=12]="NAVIGATOR_ZINDEX",t))(Vo||{});function Ko(t){return null!=t&&Object.hasOwn(t,"toString")&&jt(t.toString())}function Yo(t){return null!=t&&Object.hasOwn(t,"valueOf")&&Vt(t.valueOf())}function $o(t){return Vt(t)||Pt(t)||Yo(t)}function Ho(t,e){return null!=t&&(!e||$o(t))}function Uo(t){return Ko(t)&&Object.hasOwn(t,"id")?t.id:t}var Xo=t=>"value"===t?Ga((t,e)=>"line"===e.target.type,t=>"range"===t.target.type?"crossLine type 'range' to have a 'range' property instead of 'value'":"crossLine property 'type' to be 'line'"):Ga((t,e)=>"range"===e.target.type,t=>"line"===t.target.type?"crossLine type 'line' to have a 'value' property instead of 'range'":"crossLine property 'type' to be 'range'"),Zo=(t,e,i,s)=>{const n="line"===t&&void 0!==e,a="range"===t&&void 0!==i;if(!n&&!a)return!0;const[o,r]=null!=i?i:[e,void 0],l=Xa.is(s)||xo.is(s),h=Ho(o,l)&&!isNaN(s.convert(o)),c=Ho(r,l)&&!isNaN(s.convert(r));if(n&&h||a&&h&&c)return!0;const d=["Expecting crossLine"];return a?(h||d.push(`range start ${Wa(o)}`),c||d.push(`${h?"":"and "}range end ${Wa(r)}`)):d.push(`value ${Wa(o)}`),d.push("to match the axis scale domain."),E.warnOnce(d.join(" ")),!1},qo={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},topLeft:{xTranslationDirection:1,yTranslationDirection:-1},topRight:{xTranslationDirection:-1,yTranslationDirection:-1},bottomLeft:{xTranslationDirection:1,yTranslationDirection:1},bottomRight:{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},insideLeft:{xTranslationDirection:1,yTranslationDirection:0},insideRight:{xTranslationDirection:-1,yTranslationDirection:0},insideTop:{xTranslationDirection:0,yTranslationDirection:1},insideBottom:{xTranslationDirection:0,yTranslationDirection:-1},insideTopLeft:{xTranslationDirection:1,yTranslationDirection:1},insideBottomLeft:{xTranslationDirection:1,yTranslationDirection:-1},insideTopRight:{xTranslationDirection:-1,yTranslationDirection:1},insideBottomRight:{xTranslationDirection:-1,yTranslationDirection:-1}},Qo={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},topLeft:{xTranslationDirection:-1,yTranslationDirection:-1},topRight:{xTranslationDirection:-1,yTranslationDirection:1},bottomLeft:{xTranslationDirection:1,yTranslationDirection:-1},bottomRight:{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},insideLeft:{xTranslationDirection:0,yTranslationDirection:1},insideRight:{xTranslationDirection:0,yTranslationDirection:-1},insideTop:{xTranslationDirection:-1,yTranslationDirection:0},insideBottom:{xTranslationDirection:1,yTranslationDirection:0},insideTopLeft:{xTranslationDirection:-1,yTranslationDirection:1},insideBottomLeft:{xTranslationDirection:1,yTranslationDirection:1},insideTopRight:{xTranslationDirection:-1,yTranslationDirection:-1},insideBottomRight:{xTranslationDirection:1,yTranslationDirection:-1}};function Jo({yDirection:t,padding:e=0,position:i="top",bbox:s}){const n=t?qo:Qo,{xTranslationDirection:a,yTranslationDirection:o}=n[i];return{xTranslation:a*(e+(t?s.width:s.height)/2),yTranslation:o*(e+(t?s.height:s.width)/2)}}var tr=({yDirection:t,xEnd:e,yStart:i,yEnd:s})=>t?{x:e/2,y:i}:{x:e,y:isNaN(s)?i:(i+s)/2},er=({yDirection:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t?{x:e,y:isNaN(n)?s:(s+n)/2}:{x:i/2,y:s},ir=({yDirection:t,xEnd:e,yStart:i,yEnd:s})=>t?{x:e,y:isNaN(s)?i:(i+s)/2}:{x:e/2,y:isNaN(s)?i:s},sr=({yDirection:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t?{x:i/2,y:isNaN(n)?s:n}:{x:e,y:isNaN(n)?s:(s+n)/2},nr=({yDirection:t,xStart:e,xEnd:i,yStart:s})=>t?{x:e/2,y:s}:{x:i,y:s},ar=({yDirection:t,xStart:e,yStart:i,yEnd:s})=>t?{x:e,y:isNaN(s)?i:s}:{x:e,y:i},or=({yDirection:t,xEnd:e,yStart:i,yEnd:s})=>t?{x:e,y:i}:{x:e,y:isNaN(s)?i:s},rr=({yDirection:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t?{x:i,y:isNaN(n)?s:n}:{x:e,y:isNaN(n)?s:n},lr={top:{c:tr},bottom:{c:sr},left:{c:er},right:{c:ir},topLeft:{c:nr},topRight:{c:or},bottomLeft:{c:ar},bottomRight:{c:rr},inside:{c:({xEnd:t,yStart:e,yEnd:i})=>({x:t/2,y:isNaN(i)?e:(e+i)/2})},insideLeft:{c:er},insideRight:{c:ir},insideTop:{c:tr},insideBottom:{c:sr},insideTopLeft:{c:nr},insideBottomLeft:{c:ar},insideTopRight:{c:or},insideBottomRight:{c:rr}},hr=Ba(["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","inside","insideLeft","insideRight","insideTop","insideBottom","insideTopLeft","insideBottomLeft","insideTopRight","insideBottomRight"],"crossLine label position"),cr=class{constructor(){this.enabled=void 0,this.text=void 0,this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)",this.position=void 0,this.rotation=void 0,this.parallel=void 0}};b([$n(Qn,{optional:!0})],cr.prototype,"enabled",2),b([$n(ta,{optional:!0})],cr.prototype,"text",2),b([$n(Ia,{optional:!0})],cr.prototype,"fontStyle",2),b([$n(Ca,{optional:!0})],cr.prototype,"fontWeight",2),b([$n(sa)],cr.prototype,"fontSize",2),b([$n(ta)],cr.prototype,"fontFamily",2),b([$n(ea)],cr.prototype,"padding",2),b([$n(ma,{optional:!0})],cr.prototype,"color",2),b([$n(hr,{optional:!0})],cr.prototype,"position",2),b([$n(aa,{optional:!0})],cr.prototype,"rotation",2),b([$n(Qn,{optional:!0})],cr.prototype,"parallel",2);var dr=class t{constructor(){this.id=Fs(this),this.enabled=void 0,this.type=void 0,this.range=void 0,this.value=void 0,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=void 0,this.strokeOpacity=void 0,this.lineDash=void 0,this.label=new cr,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.group=new ko({name:`${this.id}`,layer:!0,zIndex:t.LINE_LAYER_ZINDEX}),this.labelGroup=new ko({name:`${this.id}`,layer:!0,zIndex:t.LABEL_LAYER_ZINDEX}),this.crossLineRange=new Ao,this.crossLineLabel=new Bo,this.labelPoint=void 0,this.data=[],this.startLine=!1,this.endLine=!1,this.isRange=!1;const{group:e,labelGroup:i,crossLineRange:s,crossLineLabel:n}=this;e.append(s),i.append(n),s.pointerEvents=1}update(t){const{enabled:e,data:i,type:s,value:n,range:a,scale:o}=this;if(!(s&&o&&e&&t&&Zo(s,n,a,o)&&0!==i.length))return this.group.visible=!1,void(this.labelGroup.visible=!1);this.group.visible=t,this.labelGroup.visible=t,this.group.zIndex=this.getZIndex(this.isRange),this.updateNodes()}calculateLayout(t,e){if(!t)return;if(!this.createNodeData(e))return;const{sideFlag:i,gridLength:s,data:n}=this,a=[],o=i*s,r=n[0],l=n[1],h=new Js(Math.min(0,o),Math.min(r,l),Math.abs(0-o),Math.abs(r-l));a.push(h);const c=this.computeLabelBBox();return c&&a.push(c),Js.merge(a)}updateNodes(){this.updateRangeNode(),this.label.enabled&&(this.updateLabel(),this.positionLabel())}createNodeData(t){var e,i,s;const{scale:n,gridLength:a,sideFlag:o,direction:r,label:{position:l="top"},clippedRange:h,strokeWidth:c=0}=this;if(this.data=[],!n)return!1;const d=null!=(e=n.bandwidth)?e:0,u=null!=(i=n.step)?i:0,p=(t?-1:1)*(n instanceof Kn?(u-d)/2:0),[g,m]=[0,o*a];let[y,f]=this.getRange();const x=void 0===f&&xo.is(n)?d/2+p:0;let[b,v]=[Number(n.convert(y,{clampMode:"clamped"}))-p+x,n.convert(f,{clampMode:"clamped"})+d+p];b=js(b,h),v=js(v,h),[y,f]=[Number(n.convert(y))+x,n.convert(f)+d];const S=(y===b||f===v||b!==v)&&Math.abs(v-b)>0;if(S&&b>v&&([b,v]=[v,b],[y,f]=[f,y]),y-p>=b&&(y-=p),f+p<=v&&(f+=p),this.isRange=S,this.startLine=c>0&&y>=b&&y<=b+p,this.endLine=c>0&&f>=v-d-p&&f<=v,!S&&!this.startLine&&!this.endLine)return!1;if(this.data=[b,v],this.label.enabled){const t="y"===r,{c:e=tr}=null!=(s=lr[l])?s:{},{x:i,y:n}=e({yDirection:t,xStart:g,xEnd:m,yStart:b,yEnd:v});this.labelPoint={x:i,y:n}}return!0}updateRangeNode(){var t;const{crossLineRange:e,sideFlag:i,gridLength:s,data:n,startLine:a,endLine:o,isRange:r,fill:l,fillOpacity:h,stroke:c,strokeWidth:d,lineDash:u}=this;e.x1=0,e.x2=i*s,e.y1=n[0],e.y2=n[1],e.startLine=a,e.endLine=o,e.isRange=r,e.fill=l,e.fillOpacity=null!=h?h:1,e.stroke=c,e.strokeWidth=null!=d?d:1,e.strokeOpacity=null!=(t=this.strokeOpacity)?t:1,e.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,y:i}={},label:{parallel:s,rotation:n,position:a="top",padding:o=0},direction:r,parallelFlipRotation:l,regularFlipRotation:h}=this;if(void 0===e||void 0===i)return;const{defaultRotation:c,configuredRotation:d}=_o({rotation:n,parallel:s,regularFlipRotation:h,parallelFlipRotation:l});t.rotation=c+d,t.textBaseline="middle",t.textAlign="center";const u=t.computeTransformedBBox();if(!u)return;const p="y"===r,{xTranslation:g,yTranslation:m}=Jo({yDirection:p,padding:o,position:a,bbox:u});t.translationX=e+g,t.translationY=i+m}getZIndex(e=!1){return e?t.RANGE_LAYER_ZINDEX:t.LINE_LAYER_ZINDEX}getRange(){var t;const{value:e,range:i,scale:s}=this,n=Xa.is(s)||xo.is(s),a=null!=(t=null==i?void 0:i[0])?t:e;let o=null==i?void 0:i[1];return n||void 0!==o||(o=a),n&&a===o&&(o=void 0),[a,o]}computeLabelBBox(){const{label:t}=this;if(!t.enabled)return;const e=new Bo;e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text;const{labelPoint:{x:i,y:s}={},label:{parallel:n,rotation:a,position:o="top",padding:r=0},direction:l,parallelFlipRotation:h,regularFlipRotation:c}=this;if(void 0===i||void 0===s)return;const{configuredRotation:d}=_o({rotation:a,parallel:n,regularFlipRotation:c,parallelFlipRotation:h});e.rotation=d,e.textBaseline="middle",e.textAlign="center";const u=e.computeTransformedBBox();if(!u)return;const p="y"===l,{xTranslation:g,yTranslation:m}=Jo({yDirection:p,padding:r,position:o,bbox:u});return e.translationX=i+g,e.translationY=s+m,e.computeTransformedBBox()}calculatePadding(t){var e,i,s,n,a,o,r,l;const{isRange:h,startLine:c,endLine:d,direction:u,label:{padding:p=0,position:g="top"}}=this;if(!h&&!c&&!d)return;const m=this.computeLabelBBox();if(null==(null==m?void 0:m.x)||null==(null==m?void 0:m.y))return;const y=function({yDirection:t,bbox:e,padding:i=0,position:s="top"}){const n={};return s.startsWith("inside")||("top"!==s||t?"bottom"!==s||t?"left"===s&&t?n.left=i+e.width:"right"===s&&t&&(n.right=i+e.width):n.bottom=i+e.height:n.top=i+e.height),n}({yDirection:"y"===u,padding:p,position:g,bbox:m});t.left=Math.max(null!=(e=t.left)?e:0,null!=(i=y.left)?i:0),t.right=Math.max(null!=(s=t.right)?s:0,null!=(n=y.right)?n:0),t.top=Math.max(null!=(a=t.top)?a:0,null!=(o=y.top)?o:0),t.bottom=Math.max(null!=(r=t.bottom)?r:0,null!=(l=y.bottom)?l:0)}};dr.LINE_LAYER_ZINDEX=9,dr.RANGE_LAYER_ZINDEX=3,dr.LABEL_LAYER_ZINDEX=8,dr.className="CrossLine",b([$n(Qn,{optional:!0})],dr.prototype,"enabled",2),b([$n(Ba(["range","line"],"a crossLine type"),{optional:!0})],dr.prototype,"type",2),b([$n(Un(Xo("range"),ra.restrict({length:2})),{optional:!0})],dr.prototype,"range",2),b([$n(Xo("value"),{optional:!0})],dr.prototype,"value",2),b([$n(ma,{optional:!0})],dr.prototype,"fill",2),b([$n(na,{optional:!0})],dr.prototype,"fillOpacity",2),b([$n(ma,{optional:!0})],dr.prototype,"stroke",2),b([$n(ea,{optional:!0})],dr.prototype,"strokeWidth",2),b([$n(na,{optional:!0})],dr.prototype,"strokeOpacity",2),b([$n(Da,{optional:!0})],dr.prototype,"lineDash",2);var ur=dr,pr=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){var e;const i=jt(t)?t:t.optionsKey;null==(e=this.moduleMap.get(i))||e.moduleInstance.destroy(),this.moduleMap.delete(i)}getModule(t){var e;return null==(e=this.moduleMap.get(jt(t)?t:t.optionsKey))?void 0:e.moduleInstance}isEnabled(t){return this.moduleMap.has(jt(t)?t:t.optionsKey)}mapModules(t){return Array.from(this.moduleMap.values(),(e,i)=>t(e.moduleInstance,i))}destroy(){var t;for(const e of this.moduleMap.keys())null==(t=this.moduleMap.get(e))||t.moduleInstance.destroy();this.moduleMap.clear()}},gr={};function mr(t,e){const{nodes:i,selections:s}=Cn(t);for(const t of s){for(const i of t.nodes()){const t=e(i,i.datum);i.setProperties(t)}t.cleanup()}for(const t of i){const i=e(t,t.datum);t.setProperties(i)}}x(gr,{resetMotion:()=>mr});var yr=class{constructor(t,e,i){this.states=e,this.preTransitionCb=i,this.debug=Ls.create(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,"color: green")}transition(t,e){var i,s;const n=this.states[this.state],a=null==n?void 0:n[t];if(!a)return void this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.state}`,"color: grey");let o=this.state;return"string"==typeof a?o=a:"object"==typeof a&&(o=a.target),this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${o}`,"color: green"),null==(i=this.preTransitionCb)||i.call(this,this.state,o),this.state=o,"function"==typeof a?a(e):"object"==typeof a&&(null==(s=a.action)||s.call(a,e)),this.state}},fr=t=>`(${t})`,xr=t=>`${fr(t)}?`,br=t=>xr(`?:${t}`),vr=new RegExp(["^",br(`${xr(".")}${fr("[<>=^]")}`),xr("[+\\-( ]"),xr("[$€£¥₣₹#]"),xr("0"),xr("\\d+"),xr(","),br(`\\.${fr("\\d+")}`),xr("~"),xr("[%a-z]"),"$"].join(""),"i"),Sr=new RegExp(["^",fr(".*?"),`#\\{${fr(".+?")}\\}`,fr(".*?"),"$"].join(""));function Mr(t){let e,i;const s=Sr.exec(t);s&&([,e,t,i]=s);const n=vr.exec(t);if(!n)throw new Error(`The number formatter is invalid: ${t}`);const[,a,o,r,l,h,c,d,u,p,g]=n;return{fill:a,align:o,sign:r,symbol:l,zero:h,width:parseInt(c),comma:d,precision:parseInt(u),trim:Boolean(p),type:g,prefix:e,suffix:i}}function kr(t){const e="string"==typeof t?Mr(t):t,{fill:i,align:s,sign:n="-",symbol:a,zero:o,width:r,comma:l,type:h,prefix:c="",suffix:d="",precision:u}=e;let{trim:p}=e;const g=void 0===u||isNaN(u);let m,y;if(h)if(h in Ir&&h in wr)m=g?wr[h]:Ir[h];else if(h in Ir)m=Ir[h];else{if(!(h in wr))throw new Error(`The number formatter type is invalid: ${h}`);m=wr[h]}else m=Ir.g,p=!0;return y=null==u||g?h?6:12:u,t=>{let e=m(t,y);return p&&(e=e.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")),l&&(e=function(t,e){let i=t.indexOf(".");i<0&&(i=t.length);const s=t.substring(0,i).split(""),n=t.substring(i);for(let t=s.length-3;t>0;t-=3)s.splice(t,0,e);return`${s.join("")}${n}`}(e,l)),e=function(t,e,i=""){if("("===i)return t>=0?e:`(${e})`;return`${t>=0?"+"===i?"+":"":"−"}${e}`}(t,e,n),a&&"#"!==a&&(e=`${a}${e}`),"#"===a&&"x"===h&&(e=`0x${e}`),"s"===h&&(e=`${e}${function(t){return Tr[Cr(t)]}(t)}`),"%"!==h&&"p"!==h||(e=`${e}%`),null==r||isNaN(r)||(e=function(t,e,i=" ",s=">"){let n=t;if(">"!==s&&s){if("<"===s)n=n.padEnd(e,i);else if("^"===s){const t=Math.max(0,e-n.length),s=Math.ceil(t/2),a=Math.floor(t/2);n=n.padStart(s+n.length,i),n=n.padEnd(a+n.length,i)}}else n=n.padStart(e,i);return n}(e,r,null!=i?i:o,s)),e=`${c}${e}${d}`,e}}var Dr=t=>Math.floor(Math.abs(t)),wr={b:t=>Dr(t).toString(2),c:t=>String.fromCharCode(t),d:t=>Math.round(Math.abs(t)).toFixed(0),o:t=>Dr(t).toString(8),x:t=>Dr(t).toString(16),X:t=>wr.x(t).toUpperCase(),n:t=>wr.d(t),"%":t=>`${Dr(100*t).toFixed(0)}`},Ir={e:(t,e)=>Math.abs(t).toExponential(e),E:(t,e)=>Ir.e(t,e).toUpperCase(),f:(t,e)=>Math.abs(t).toFixed(e),F:(t,e)=>Ir.f(t,e).toUpperCase(),g:(t,e)=>{if(0===t)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i));return s>=-4&&s<e?i.toFixed(e-1-s):i.toExponential(e-1)},G:(t,e)=>Ir.g(t,e).toUpperCase(),n:(t,e)=>Ir.g(t,e),p:(t,e)=>Ir.r(100*t,e),r:(t,e)=>{if(0===t)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i))-(e-1);if(s<=0)return i.toFixed(-s);const n=Math.pow(10,s);return(Math.round(i/n)*n).toFixed()},s:(t,e)=>{const i=Cr(t);return Ir.r(t/Math.pow(10,i),e)},"%":(t,e)=>Ir.f(100*t,e)};function Cr(t){return _s(Lr,t?3*Math.floor(Math.log10(Math.abs(t))/3):0,Ar)}var Lr=-24,Ar=24,Tr={[Lr]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"µ",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[Ar]:"Y"};function Nr(t,e){const i=Mr(null!=e?e:",f"),{precision:s}=i;(null==s||isNaN(s))&&("f"===i.type||"%"===i.type?i.precision=Math.max(...t.map(t=>{if("number"!=typeof t||0===t)return 0;const e=Math.floor(Math.log10(Math.abs(t))),s=i.type?6:12,n=t.toExponential(s-1).replace(/\.?0+e/,"e"),a=n.indexOf(".");if(a<0)return e>=0?0:-e;const o=n.indexOf("e")-a;return Math.max(0,o-e-1)})):i.type&&!(i.type in Ir)||(i.precision=Math.max(...t.map(t=>{if("number"!=typeof t)return 0;const e=t.toExponential((i.type?6:12)-1).replace(/\.?0+e/,"e");return e.substring(0,e.indexOf("e")).replace(".","").length}))));const n=kr(i);return t=>n(Number(t))}var Or=class t extends Xa{constructor(){super([1,10],[0,1]),this.type="log",this.base=10,this.baseLog=N,this.basePow=N,this.log=t=>Math.min(...this.domain)>=0?this.baseLog(t):-this.baseLog(-t),this.pow=t=>Math.min(...this.domain)>=0?this.basePow(t):-this.basePow(-t),this.defaultClampMode="clamped"}toDomain(t){return t}transform(t){return Math.min(...this.domain)>=0?Math.log(t):-Math.log(-t)}transformInvert(t){return Math.min(...this.domain)>=0?Math.exp(t):-Math.exp(-t)}refresh(){this.base<=0&&(this.base=0,E.warnOnce("expecting a finite Number greater than to 0")),super.refresh()}update(){!this.domain||this.domain.length<2||(this.baseLog=t.getBaseLogMethod(this.base),this.basePow=t.getBasePowerMethod(this.base),this.nice&&this.updateNiceDomain())}updateNiceDomain(){const[t,e]=this.domain,i=t>e?Math.ceil:Math.floor,s=t>e?Math.floor:Math.ceil,n=this.pow(i(this.log(t))),a=this.pow(s(this.log(e)));this.niceDomain=[n,a]}ticks(){var t;const e=null!=(t=this.tickCount)?t:10;if(!this.domain||this.domain.length<2||e<1)return[];this.refresh();const i=this.base,[s,n]=this.getDomain(),a=Math.min(s,n),o=Math.max(s,n);let r=this.log(a),l=this.log(o);if(this.interval){const t=Math.abs(this.interval),e=Math.abs(l-r);let i=po(r,l,Math.min(e,t));i=lo(i.fractionDigits,i.map(t=>this.pow(t)).filter(t=>t>=a&&t<=o));const s=this.getPixelRange();if(!go({start:a,stop:o,interval:t,count:i.length,availableRange:s}))return i}if(i%1!=0||l-r>=e){let t=ho(r,l,Math.min(l-r,e));return t=lo(t.fractionDigits,t.map(t=>this.pow(t))),t}const h=[],c=a>0;r=Math.floor(r)-1,l=Math.round(l)+1;const d=Vs(this.range)/e;let u=1/0;for(let t=r;t<=l;t++){const e=this.convert(this.pow(t+1));for(let s=1;s<i;s++){const n=c?s:i-s+1,r=this.pow(t)*n,l=this.convert(r),p=Math.abs(u-l),g=Math.abs(l-e);r>=a&&r<=o&&(1===s||p>=d&&g>=d||0===h.length)&&(h.push(r),u=l)}}return h}tickFormat({count:t,ticks:e,specifier:i}){return t!==1/0&&null==e&&this.ticks(),null!=i||(i=10===this.base?".0e":","),jt(i)?kr(i):i}static getBaseLogMethod(t){switch(t){case 10:return Math.log10;case Math.E:return Math.log;case 2:return Math.log2;default:const e=Math.log(t);return t=>Math.log(t)/e}}static getBasePowerMethod(t){switch(t){case 10:return t=>t>=0?p(10,t):1/p(10,-t);case Math.E:return Math.exp;default:return e=>p(t,e)}}};b([Wn],Or.prototype,"base",2);var Rr=Or,Er=class t{constructor(t,e,i=!0){this.parentNode=t,this.autoCleanup=i,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=Ls.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(hn,e)?()=>new e:e}static select(e,i,s=!0){return new t(e,i,s)}static selectAll(t,e){const i=[],s=t=>{e(t)&&i.push(t),t.children.forEach(s)};return s(t),i}static selectByClass(e,i,...s){return t.selectAll(e,t=>t instanceof i||s.some(e=>t instanceof e))}static selectByTag(e,i){return t.selectAll(e,t=>t.tag===i)}createNode(t,e,i){const s=this.nodeFactory(t);return s.datum=t,null==e||e(s),null==i?this._nodes.push(s):this._nodes.splice(i,0,s),this.parentNode.appendChild(s),s}update(t,e,i){if(this.garbageBin.size>0&&this.debug(`Selection - update() called with pending garbage: ${t}`),i){const s=new Map(t.map((t,e)=>[i(t),[t,e]]));for(const[t,e]of this._nodesMap.entries())if(s.has(e)){const[i]=s.get(e);t.datum=i,this.garbageBin.delete(t),s.delete(e)}else this.garbageBin.add(t);for(const[t,[i,n]]of s.entries())this._nodesMap.set(this.createNode(i,e,n),t)}else{const i=Math.max(t.length,this.data.length);for(let s=0;s<i;s++)s>=t.length?this.garbageBin.add(this._nodes[s]):s>=this._nodes.length?this.createNode(t[s],e):(this._nodes[s].datum=t[s],this.garbageBin.delete(this._nodes[s]))}return this.data=t.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return 0===this.garbageBin.size||(this._nodes=this._nodes.filter(t=>!this.garbageBin.has(t)||(this._nodesMap.delete(t),this.garbageBin.delete(t),this.parentNode.removeChild(t),!1))),this}clear(){return this.update([]),this}isGarbage(t){return this.garbageBin.has(t)}hasGarbage(){return this.garbageBin.size>0}each(t){for(const e of this._nodes.entries())t(e[1],e[1].datum,e[0]);return this}*[Symbol.iterator](){for(let t=0;t<this._nodes.length;t++){const e=this._nodes[t],i=this._nodes[t].datum;yield{node:e,datum:i,index:t}}}select(e){return t.selectAll(this.parentNode,e)}selectByClass(e){return t.selectByClass(this.parentNode,e)}selectByTag(e){return t.selectByTag(this.parentNode,e)}nodes(){return this._nodes}};function Pr(t,e,i,s){const n=t-i,a=e-s;return n*n+a*a}function Br(t,e,i,s,n,a,o){if(i===n&&s===a)return Math.min(o,Pr(t,e,i,s));const r=n-i,l=a-s,h=Math.max(0,Math.min(1,((t-i)*r+(e-s)*l)/(r*r+l*l))),c=i+h*r,d=s+h*l;return Math.min(o,Pr(t,e,c,d))}function Fr(t,e,i,s,n,a,o,r,l){if(r&&([o,a]=[a,o]),!Fn(Math.atan2(e-s,t-i),a,o)){const o=i+Math.cos(a)*n,r=s+Math.sin(a)*n,h=i+Math.cos(a)*n,c=s+Math.sin(a)*n;return Math.min(l,Pr(t,e,o,r),Pr(t,e,h,c))}const h=n-Math.sqrt(Pr(t,e,i,s));return Math.min(l,h*h)}var zr=class extends Lo{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(t){this.x1=t,this.x2=t}set y(t){this.y1=t,this.y2=t}computeBBox(){return new Js(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(t,e){if(this.x1===this.x2||this.y1===this.y2){const{x:i,y:s}=this.transformPoint(t,e);return this.computeBBox().grow(this.strokeWidth/2).containsPoint(i,s)}return!1}distanceSquared(t,e){const{x1:i,y1:s,x2:n,y2:a}=this;return Br(t,e,i,s,n,a,1/0)}render(t){var e;const{ctx:i,forceRender:s,stats:n,devicePixelRatio:a}=t;if(0===this.dirty&&!s)return void(n&&(n.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(i);let{x1:o,y1:r,x2:l,y2:h}=this;if(o===l){const{strokeWidth:t}=this,e=Math.round(o*a)/a+Math.trunc(t*a)%2/(2*a);o=e,l=e}else if(r===h){const{strokeWidth:t}=this,e=Math.round(r*a)/a+Math.trunc(t*a)%2/(2*a);r=e,h=e}i.beginPath(),i.moveTo(o,r),i.lineTo(l,h),this.fillStroke(i),null==(e=this.fillShadow)||e.markClean(),super.render(t)}};function Gr(t,e,i,s,n,a){if(0===t.size)return!1;let o=t.x,r=t.y;null!=e&&(o-=(e.x-.5)*t.size,r-=(e.y-.5)*t.size);let l=o;o<i?l=i:o>i+n&&(l=i+n);let h=r;r<s?h=s:r>s+a&&(h=s+a);const c=o-l,d=r-h;return Math.sqrt(c*c+d*d)<=.5*t.size}function _r(t,e,i,s,n){const a=t.x+t.width>e&&t.x<e+s,o=t.y+t.height>i&&t.y<i+n;return a&&o}function jr(t,e,i,s,n){return e+s<t.x+t.width&&e>t.x&&i>t.y&&i+n<t.y+t.height}function Wr(t){return null!=t&&"object"==typeof t.point&&"object"==typeof t.label}zr.className="Line",zr.defaultStyles=Object.assign({},Lo.defaultStyles,{fill:void 0,strokeWidth:1}),b([sn({redraw:3})],zr.prototype,"x1",2),b([sn({redraw:3})],zr.prototype,"y1",2),b([sn({redraw:3})],zr.prototype,"x2",2),b([sn({redraw:3})],zr.prototype,"y2",2);var Vr={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0}};function Kr(t,e){return t.length===e.length&&t.every((t,i)=>{const s=e[i];return Array.isArray(t)&&Array.isArray(s)?Kr(t,s):t===s})}function Yr(t,e){return t.length===e.length&&t.every((t,i)=>Number(t)===Number(e[i]))}function $r(t){const e=Ot(t)?t:t.split(".");if(1===e.length){const[t]=e;return Ct((e,i,s)=>e[t]=s,e=>e[t])}return Ct((t,i,s)=>ee(t,e,s),t=>Jt(t,e))}function Hr(t){return Ct((e,i,s)=>e[t]=s)}function Ur(t,e){return Ct((i,s,n)=>i[t][null!=e?e:s]=n)}function Xr(t){const{newValue:e,oldValue:i,changeValue:s}=t;return Ct((t,n,a,o)=>(a!==o&&(void 0!==o&&(null==i||i.call(t,o)),void 0!==a&&(null==e||e.call(t,a)),null==s||s.call(t,a,o)),a))}function Zr(t){return e=t,(t,i)=>{It(t,i).observers.push(e)};var e}function qr(t,e,i){void 0===i||""===i?null==t||t.removeAttribute(e):null==t||t.setAttribute(e,i.toString())}function Qr(t,e,i,s,n){let{top:a,right:o,bottom:r,left:l,width:h,height:c}=n;return null!=l?null!=h?o=i-l+h:null!=o&&(h=i-l-o):null!=o&&null!=h&&(l=i-o-h),null!=a?null!=c?r=s-a-c:null!=r&&(c=s-r-a):null!=r&&null!=c&&(a=s-r-c),null==h?null==c?(h=t,c=e):h=Math.ceil(t*c/e):null==c&&(c=Math.ceil(e*h/t)),null==l&&(l=null==o?Math.floor((i-h)/2):i-o-h),null==a&&(a=null==r?Math.floor((s-c)/2):s-c-r),{x:l,y:a,width:h,height:c}}var Jr="ag-chart-tooltip",tl="ag-chart-dark-tooltip",el={html:"",ariaLabel:""};function il(t){const e=(t,e,i)=>0===e||"."!==i[e-1]?". ":" ";return t.replace(/<br\s*\/?>/g,e).replace(/<\/p\s+>/g,e).replace(/<\/li\s*\/>/g,e).replace(/<[^>]+>/g,"")}function sl(t,e){var i,s,n;if("string"==typeof t)return{html:t,ariaLabel:t};const{content:a=(null!=(i=null==e?void 0:e.content)?i:""),title:o=(null==e?void 0:e.title),color:r=(null!=(s=null==e?void 0:e.color)?s:"white"),backgroundColor:l=(null!=(n=null==e?void 0:e.backgroundColor)?n:"#888")}=t;return{html:`${o?`<div class="${Jr}-title"\n        style="color: ${r}; background-color: ${l}">${o}</div>`:""}${a?`<div class="${Jr}-content">${a}</div>`:""}`,ariaLabel:il(`${o?`${o}: `:""}${a}`)}}var nl=class extends fe{constructor(){super(...arguments),this.type="pointer",this.xOffset=0,this.yOffset=0}};b([$n(Ba(["pointer","node","top","right","bottom","left","top-left","top-right","bottom-right","bottom-left"],"a position type"))],nl.prototype,"type",2),b([$n(ea)],nl.prototype,"xOffset",2),b([$n(ea)],nl.prototype,"yOffset",2);var al=class extends fe{constructor(){super(),this.enabled=!0,this.delay=0,this.range="nearest",this.wrapping="hyphenate",this.position=new nl,this.darkTheme=!1,this.enableInteraction=!1,this.lastVisibilityChange=Date.now(),this.wrapTypes=["always","hyphenate","on-space","never"],this.showTimeout=0,this._showArrow=!0,this.element=Ms("div",Jr),qr(this.element,"aria-hidden",!0),this.root=vs("body"),this.root.appendChild(this.element)}destroy(){this.element.remove()}isVisible(){return!this.element.classList.contains(Jr+"-hidden")}show(t,e,i,s=!1){var n,a,o,r,l,h,c,d,u;const{element:p}=this;if(null!=i)p.innerHTML=i.html;else if(!p.innerHTML)return void this.toggle(!1);const g=null!=(a=null==(n=e.position)?void 0:n.type)?a:this.position.type,m=null!=(r=null==(o=e.position)?void 0:o.xOffset)?r:0,y=null!=(h=null==(l=e.position)?void 0:l.yOffset)?h:0,f=this.getTooltipBounds({positionType:g,meta:e,yOffset:y,xOffset:m,canvasRect:t}),x=this.getWindowSize(),b=Qr(p.clientWidth,p.clientHeight,t.width,t.height,f);b.x+=t.x,b.y+=t.y;const v=_s(0,b.x,x.width-p.clientWidth-1),S=_s(0,b.y,x.height-p.clientHeight),M=v!==b.x||S!==b.y,k=!("node"!==g&&"pointer"!==g||M||m||y),D=null!=(d=null!=(c=e.showArrow)?c:this.showArrow)?d:k;this.updateShowArrow(D),p.style.transform=`translate(${Math.round(v)}px, ${Math.round(S)}px)`,this.enableInteraction=null!=(u=e.enableInteraction)&&u,this.delay>0&&!s?(this.toggle(!1),this.showTimeout=setTimeout(()=>{this.toggle(!0)},this.delay)):this.toggle(!0)}getWindowSize(){const{innerWidth:t,innerHeight:e}=Ss();return{width:t,height:e}}toggle(t){const{classList:e}=this.element,i=(t,i)=>e.toggle(`${Jr}-${t}`,i),s=this.isVisible();let n=1/0;if(t||clearTimeout(this.showTimeout),s!==t){const t=Date.now();n=t-this.lastVisibilityChange,this.lastVisibilityChange=t}n>5&&i("no-animation",!s&&t&&n>100),i("no-interaction",!this.enableInteraction),i("hidden",!t),i("arrow",this._showArrow),e.toggle(tl,this.darkTheme);for(const t of this.wrapTypes)e.toggle(`${Jr}-wrap-${t}`,t===this.wrapping)}pointerLeftOntoTooltip(t){var e;if(!this.enableInteraction)return!1;const i=null==(e=t.sourceEvent.relatedTarget)?void 0:e.classList,s=Boolean(["","-title","-content"].filter(t=>null==i?void 0:i.contains(`${Jr}${t}`)));return void 0!==i&&s}updateShowArrow(t){this._showArrow=t}getTooltipBounds({positionType:t,meta:e,yOffset:i,xOffset:s,canvasRect:n}){const{clientWidth:a,clientHeight:o}=this.element,r={width:a,height:o};switch(t){case"node":case"pointer":return r.top=e.offsetY+i-o-8,r.left=e.offsetX+s-a/2,r;case"top":return r.top=i,r.left=n.width/2-a/2+s,r;case"right":return r.top=n.height/2-o/2+i,r.left=n.width-a/2+s,r;case"left":return r.top=n.height/2-o/2+i,r.left=s,r;case"bottom":return r.top=n.height-o+i,r.left=n.width/2-a/2+s,r;case"top-left":return r.top=i,r.left=s,r;case"top-right":return r.top=i,r.left=n.width-a+s,r;case"bottom-right":return r.top=n.height-o+i,r.left=n.width-a+s,r;case"bottom-left":return r.top=n.height-o+i,r.left=s,r}}};b([$n(Qn)],al.prototype,"enabled",2),b([$n(Qn,{optional:!0})],al.prototype,"showArrow",2),b([Zr((t,e,i)=>{e&&t.element.classList.add(e),i&&t.element.classList.remove(i)}),$n(ta,{optional:!0})],al.prototype,"class",2),b([$n(sa)],al.prototype,"delay",2),b([$n(Ea)],al.prototype,"range",2),b([$n(La)],al.prototype,"wrapping",2),b([$n(Zn)],al.prototype,"position",2),b([$n(Qn)],al.prototype,"darkTheme",2);var ol=class extends fe{constructor(){super(...arguments),this.id=Fs(this),this.node=new Bo({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.truncated=!1}getOrAddRegion(t,e){return"root"===e?t.regionManager.getRegion("root"):t.regionManager.addRegionFromProperties({name:e,bboxproviders:[this.node],canInteraction:()=>this.enabled&&this.node.visible})}registerInteraction(t,e){const i=this.getOrAddRegion(t,e);return function(...t){return()=>{for(const e of t)e()}}(i.addListener("hover",e=>this.handleMouseMove(t,e)),i.addListener("leave",e=>this.handleMouseLeave(t,e)))}computeTextWrap(t,e){var i,s;const{text:n,wrapping:a}=this,o=Math.min(null!=(i=this.maxWidth)?i:1/0,t),r=null!=(s=this.maxHeight)?s:e;if(!isFinite(o)&&!isFinite(r))return void(this.node.text=n);const{text:l,truncated:h}=Bo.wrap(null!=n?n:"",o,r,this,a);this.node.text=l,this.truncated=h}updateTooltip(t,e){if(void 0!==e&&this.enabled&&this.node.visible&&this.truncated){const{offsetX:i,offsetY:s}=e;return t.tooltipManager.updateTooltip(this.id,{offsetX:i,offsetY:s,lastPointerEvent:e,showArrow:!1},sl({content:this.text})),!0}return!1}handleMouseMove(t,e){this.updateTooltip(t,e)&&e.consume()}handleMouseLeave(t,e){t.tooltipManager.removeTooltip(this.id)}};ol.SMALL_PADDING=10,ol.LARGE_PADDING=20,b([$n(Qn)],ol.prototype,"enabled",2),b([$n(ta,{optional:!0}),Ur("node")],ol.prototype,"text",2),b([$n(Aa,{optional:!0}),Ur("node")],ol.prototype,"textAlign",2),b([$n(Ia,{optional:!0}),Ur("node")],ol.prototype,"fontStyle",2),b([$n(Ca,{optional:!0}),Ur("node")],ol.prototype,"fontWeight",2),b([$n(sa),Ur("node")],ol.prototype,"fontSize",2),b([$n(ta),Ur("node")],ol.prototype,"fontFamily",2),b([$n(ma,{optional:!0}),Ur("node","fill")],ol.prototype,"color",2),b([$n(sa,{optional:!0})],ol.prototype,"spacing",2),b([$n(sa,{optional:!0})],ol.prototype,"lineHeight",2),b([$n(sa,{optional:!0})],ol.prototype,"maxWidth",2),b([$n(sa,{optional:!0})],ol.prototype,"maxHeight",2),b([$n(La)],ol.prototype,"wrapping",2);var rl=["stroke","lineDash"],ll=la(t=>zt(t)&&Object.keys(t).every(t=>rl.includes(t)),"objects with gridline style properties such as 'stroke' or 'lineDash'"),hl=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};b([$n(Qn)],hl.prototype,"enabled",2),b([$n(sa)],hl.prototype,"width",2),b([$n(ll)],hl.prototype,"style",2);var cl=class extends fe{constructor(){super(...arguments),this.enabled=!0,this.autoWrap=!1,this.fontSize=12,this.fontFamily="Verdana, sans-serif",this.padding=5,this.minSpacing=NaN,this.color="rgba(87, 87, 87, 1)",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}};b([$n(Qn)],cl.prototype,"enabled",2),b([$n(Qn,{optional:!0})],cl.prototype,"autoWrap",2),b([$n(sa,{optional:!0})],cl.prototype,"maxWidth",2),b([$n(sa,{optional:!0})],cl.prototype,"maxHeight",2),b([$n(Ia,{optional:!0})],cl.prototype,"fontStyle",2),b([$n(Ca,{optional:!0})],cl.prototype,"fontWeight",2),b([$n(ea.restrict({min:1}))],cl.prototype,"fontSize",2),b([$n(ta)],cl.prototype,"fontFamily",2),b([$n(sa)],cl.prototype,"padding",2),b([$n(oa),Yn(NaN)],cl.prototype,"minSpacing",2),b([$n(ma,{optional:!0})],cl.prototype,"color",2),b([$n(aa,{optional:!0})],cl.prototype,"rotation",2),b([$n(Qn)],cl.prototype,"avoidCollisions",2),b([$n(Qn)],cl.prototype,"mirrored",2),b([$n(Qn)],cl.prototype,"parallel",2),b([$n(Jn,{optional:!0})],cl.prototype,"formatter",2),b([$n(ta,{optional:!0})],cl.prototype,"format",2);var dl=class{constructor(){this.enabled=!0,this.width=1,this.color=void 0}};b([$n(Qn)],dl.prototype,"enabled",2),b([$n(sa)],dl.prototype,"width",2),b([$n(ma,{optional:!0})],dl.prototype,"color",2);var ul=class extends fe{constructor(){super(...arguments),this.enabled=!1,this.spacing=ol.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};function pl(t){const[e,i]=Ws(t.range),s=Math.floor(e),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}b([$n(Qn)],ul.prototype,"enabled",2),b([$n(ta,{optional:!0})],ul.prototype,"text",2),b([$n(sa,{optional:!0})],ul.prototype,"spacing",2),b([$n(Ia,{optional:!0})],ul.prototype,"fontStyle",2),b([$n(Ca,{optional:!0})],ul.prototype,"fontWeight",2),b([$n(sa)],ul.prototype,"fontSize",2),b([$n(ta)],ul.prototype,"fontFamily",2),b([$n(ma,{optional:!0})],ul.prototype,"color",2),b([$n(La)],ul.prototype,"wrapping",2),b([$n(Jn,{optional:!0})],ul.prototype,"formatter",2);var gl=2*Math.PI,ml=gl/2;function yl(t){const e=(e,i)=>{const[s=t.min,n=t.max]=Ws(null!=i?i:[]);return e<s||e>n},i={fromFn(t,i,s){let n=t.y1+t.translationY,a=t.opacity;return("added"===s||e(t.datum.translationY,t.datum.range))&&(n=i.translationY,a=0),{y:0,translationY:n,opacity:a,phase:An[s]}},toFn(t,e,i){const s=e.translationY;let n=1;return"removed"===i&&(n=0),{y:0,translationY:s,opacity:n,finish:{y:s,translationY:0}}},intermediateFn:(t,i,s)=>({visible:!e(t.y)})},s={fromFn(t,i,s){var n;const a=null!=(n=t.previousDatum)?n:i,o=a.x,r=a.y,l=a.rotationCenterX;let h=Math.round(t.translationY),c=a.rotation,d=t.opacity;return"removed"===s||e(a.y,a.range)?c=i.rotation:("added"===s||e(t.datum.y,t.datum.range))&&(h=Math.round(a.translationY),d=0,c=i.rotation),{x:o,y:r,rotationCenterX:l,translationY:h,rotation:c,opacity:d,phase:An[s]}},toFn(t,e,i){var s,n;const a=e.x,o=e.y,r=e.rotationCenterX,l=Math.round(e.translationY);let h=0,c=1;var d,u;return"added"===i?(c=1,h=e.rotation):"removed"===i?(c=0,h=e.rotation):(d=null!=(n=null==(s=t.previousDatum)?void 0:s.rotation)?n:e.rotation,u=e.rotation,h=Math.abs(u-d)<ml?u:d>u?u+gl:u-gl),{x:a,y:o,rotationCenterX:r,translationY:l,rotation:h,opacity:c,finish:{rotation:e.rotation}}}};return{tick:i,line:{fromFn(t,e){var i;return y(m({},null!=(i=t.previousDatum)?i:e),{phase:An.updated})},toFn:(t,e)=>m({},e)},label:s,group:{fromFn(t,e){const{rotation:i,translationX:s,translationY:n}=t;return{rotation:i,translationX:s,translationY:n,phase:An.updated}},toFn(t,e){const{rotation:i,translationX:s,translationY:n}=e;return{rotation:i,translationX:s,translationY:n}}}}}function fl(){return(t,e)=>({rotation:e.rotation,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,translationX:e.translationX,translationY:e.translationY})}function xl(t){const{visible:e,min:i,max:s}=t;return(t,n)=>{const a=n.translationY;return{y:a,translationY:0,opacity:1,visible:e&&a>=i&&a<=s}}}function bl(){return(t,e)=>({x:e.x,y:e.y,translationY:e.translationY,rotation:e.rotation,rotationCenterX:e.rotationCenterX})}function vl(){return(t,e)=>m({},e)}var Sl=class t{constructor(e,i,s){let n;this.moduleCtx=e,this.scale=i,this.id=Fs(this),this.nice=!0,this.reverse=!1,this.keys=[],this.dataDomain={domain:[],clipped:!1},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new ko({name:`${this.id}-axis`,zIndex:2}),this.lineNode=this.axisGroup.appendChild(new zr),this.tickLineGroup=this.axisGroup.appendChild(new ko({name:`${this.id}-Axis-tick-lines`,zIndex:2})),this.tickLabelGroup=this.axisGroup.appendChild(new ko({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.crossLineGroup=new ko({name:`${this.id}-CrossLines`}),this.gridGroup=new ko({name:`${this.id}-Axis-grid`}),this.gridLineGroup=this.gridGroup.appendChild(new ko({name:`${this.id}-gridLines`,zIndex:1})),this.tickLineGroupSelection=Er.select(this.tickLineGroup,zr,!1),this.tickLabelGroupSelection=Er.select(this.tickLabelGroup,Bo,!1),this.gridLineGroupSelection=Er.select(this.gridLineGroup,zr,!1),this.line=new dl,this.tick=this.createTick(),this.gridLine=new hl,this.label=this.createLabel(),this.defaultTickMinSpacing=t.defaultTickMinSpacing,this.translation={x:0,y:0},this.rotation=0,this.layout={label:{fractionDigits:0,padding:this.label.padding,format:this.label.format}},this.destroyFns=[],this.range=[0,1],this.visibleRange=[0,1],this.title=new ul,this._titleCaption=new ol,this.gridLength=0,this.fractionDigits=0,this.gridPadding=0,this.seriesAreaPadding=0,this.tickGenerationResult=void 0,this.maxThickness=1/0,this.moduleMap=new pr,this.refreshScale(),this.destroyFns.push(this._titleCaption.registerInteraction(this.moduleCtx,"root")),this._titleCaption.node.rotation=-Math.PI/2,this.axisGroup.appendChild(this._titleCaption.node),this.destroyFns.push(e.regionManager.getRegion("series").addListener("hover",t=>this.checkAxisHover(t))),this.animationManager=e.animationManager,this.animationState=new yr("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:t=>this.animateReadyUpdate(t),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this._crossLines=[],this.assignCrossLineArrayConstructor(this._crossLines),this.destroyFns.push(e.layoutService.addListener("layout-complete",t=>{null!=n&&null!=Se(t.chart,n)&&this.animationState.transition("resize"),n=m({},t.chart)})),!1!==(null==s?void 0:s.respondsToZoom)&&this.destroyFns.push(e.updateService.addListener("update-complete",t=>{this.minRect=t.minRect}))}get type(){var t;return null!=(t=this.constructor.type)?t:""}set crossLines(t){var e,i;null==(e=this._crossLines)||e.forEach(t=>this.detachCrossLine(t)),t&&this.assignCrossLineArrayConstructor(t),this._crossLines=t,null==(i=this._crossLines)||i.forEach(t=>{this.attachCrossLine(t),this.initCrossLine(t)})}get crossLines(){return this._crossLines}resetAnimation(t){"initial"===t&&this.animationState.transition("reset")}attachCrossLine(t){this.crossLineGroup.appendChild(t.group),this.crossLineGroup.appendChild(t.labelGroup)}detachCrossLine(t){this.crossLineGroup.removeChild(t.group),this.crossLineGroup.removeChild(t.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(t=>t())}refreshScale(){var t;this.range=this.scale.range.slice(),null==(t=this.crossLines)||t.forEach(this.initCrossLine,this)}updateRange(){var t;const{range:e,visibleRange:i,scale:s}=this,n=(e[1]-e[0])/(i[1]-i[0]),a=n*i[0],o=e[0]-a;s.range=[o,o+n],null==(t=this.crossLines)||t.forEach(t=>{t.clippedRange=[e[0],e[1]]})}setCrossLinesVisible(t){this.crossLineGroup.visible=t}attachAxis(t,e){e.appendChild(this.gridGroup),t.appendChild(this.axisGroup),t.appendChild(this.crossLineGroup)}detachAxis(t,e){e.removeChild(this.gridGroup),t.removeChild(this.axisGroup),t.removeChild(this.crossLineGroup)}inRange(t,e=0,i=0){const[s,n]=Ws(this.range);return t+e>=s-i&&t<=n+i}onLabelFormatChange(t,e,i){const{scale:s,fractionDigits:n}=this,a=!(s instanceof Rr)&&n>0?t=>"number"==typeof t?t.toFixed(n):String(t):t=>String(t);if(i&&s&&s.tickFormat)try{this.labelFormatter=s.tickFormat({ticks:t,specifier:i})}catch(t){this.labelFormatter=a,E.warnOnce(`the axis label format string ${i} is invalid. No formatting will be applied`)}else this.labelFormatter=a}setTickInterval(t){var e;this.scale.interval=null!=(e=this.tick.interval)?e:t}setTickCount(t,e,i){const{scale:s}=this,n=Xa.is(s)||xo.is(s);if(t&&n)return"number"==typeof t?(s.tickCount=t,s.minTickCount=null!=e?e:0,void(s.maxTickCount=null!=i?i:1/0)):void(s instanceof yo&&this.setTickInterval(t))}onGridLengthChange(t,e){var i;(e&&!t||!e&&t)&&this.onGridVisibilityChange(),null==(i=this.crossLines)||i.forEach(this.initCrossLine,this)}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}createLabel(){return new cl}checkAxisHover(t){this.interactionEnabled&&this.computeBBox().containsPoint(t.offsetX,t.offsetY)&&this.moduleCtx.chartEventManager.axisHover(this.id,this.direction)}update(t=0,e=!0){if(!this.tickGenerationResult)return;const{rotation:i,parallelFlipRotation:s,regularFlipRotation:n}=this.calculateRotations(),a=this.label.getSideFlag();this.updatePosition();const o=this.getAxisLineCoordinates(),{tickData:r,combinedRotation:l,textBaseline:h,textAlign:c,primaryTickCount:d}=this.tickGenerationResult,u=this.tickLabelGroupSelection.nodes().map(t=>t.datum.tickId);if(this.updateSelections(o,r.ticks,{combinedRotation:l,textAlign:c,textBaseline:h,range:this.scale.range}),!e||this.animationManager.isSkipped())this.resetSelectionNodes();else{const t=this.calculateUpdateDiff(u,r);this.animationState.transition("update",t)}return this.updateAxisLine(),this.updateLabels(),this.updateVisibility(),this.updateGridLines(a),this.updateTickLines(),this.updateTitle({anyTickVisible:r.ticks.length>0}),this.updateCrossLines({rotation:i,parallelFlipRotation:s,regularFlipRotation:n}),this.updateLayoutState(),d}getAxisLineCoordinates(){const[t,e]=Ws(this.range);return{x:0,y1:t,y2:e}}getTickLineCoordinates(t){const e=this.label.getSideFlag()*this.getTickSize(),i=Math.min(0,e);return{x1:i,x2:i+Math.abs(e),y:t.translationY}}getTickLabelProps(t,e){const{label:i}=this,{combinedRotation:s,textBaseline:n,textAlign:a,range:o}=e,r=t.tickLabel,l=i.getSideFlag()*(this.getTickSize()+i.padding+this.seriesAreaPadding),h=""!==r&&null!=r;return{tickId:t.tickId,translationY:t.translationY,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,rotation:s,rotationCenterX:l,text:r,textAlign:a,textBaseline:n,visible:h,x:l,y:0,range:o}}getTickSize(){return this.tick.enabled?this.tick.size:this.createTick().size}setTitleProps(t,e){var i;const{title:s}=this;if(s.enabled){if(t.color=s.color,t.fontFamily=s.fontFamily,t.fontSize=s.fontSize,t.fontStyle=s.fontStyle,t.fontWeight=s.fontWeight,t.enabled=s.enabled,t.wrapping=s.wrapping,s.enabled){const n=t.node,a=(null!=(i=s.spacing)?i:0)+e.spacing,o=this.label.getSideFlag(),r=En(this.rotation),l=-1===o&&r>Math.PI&&r<2*Math.PI?-1:1,h=l*o*Math.PI/2,c=1===l?"bottom":"top",{range:d}=this,u=Math.floor(l*o*(d[0]+d[1])/2),p=-1===o?Math.floor(l*-a):Math.floor(-a),{callbackCache:g}=this.moduleCtx,{formatter:m=t=>t.defaultValue}=s,y=g.call(m,this.getTitleFormatterParams());n.setProperties({rotation:h,text:y,textBaseline:c,visible:!0,x:u,y:p})}}else t.enabled=!1}calculateLayout(t){var e,i;const{rotation:s,parallelFlipRotation:n,regularFlipRotation:a}=this.calculateRotations(),o=this.label.getSideFlag(),r=o*(this.getTickSize()+this.label.padding+this.seriesAreaPadding);this.updateScale(),this.tickGenerationResult=this.generateTicks({primaryTickCount:t,parallelFlipRotation:n,regularFlipRotation:a,labelX:r,sideFlag:o}),this.updateLayoutState();const l=this.tickGenerationResult,{tickData:h,combinedRotation:c,textBaseline:d,textAlign:u}=l,p=f(l,["tickData","combinedRotation","textBaseline","textAlign"]),g=[],{x,y1:b,y2:v}=this.getAxisLineCoordinates(),S=new Js(x+Math.min(o*this.seriesAreaPadding,0),b,this.seriesAreaPadding,v-b);if(g.push(S),this.tick.enabled&&h.ticks.forEach(t=>{const{x1:e,x2:i,y:s}=this.getTickLineCoordinates(t),n=new Js(e,s,i-e,0);g.push(n)}),this.label.enabled){const t=new Bo;h.ticks.forEach(e=>{const i=this.getTickLabelProps(e,{combinedRotation:c,textAlign:u,textBaseline:d,range:this.scale.range});if(!i.visible)return;t.setProperties(y(m({},i),{translationY:Math.round(e.translationY)}));const s=t.computeTransformedBBox();s&&g.push(s)})}if(null==(e=this.title)?void 0:e.enabled){const t=new ol,e=Js.merge(g).width;this.setTitleProps(t,{spacing:e});const i=t.node.computeTransformedBBox();i&&g.push(i)}const M=(t=>{const e=new on,{rotation:i,translationX:s,translationY:n,rotationCenterX:a,rotationCenterY:o}=this.getAxisTransform();return on.updateTransformMatrix(e,1,1,i,s,n,{scalingCenterX:0,scalingCenterY:0,rotationCenterX:a,rotationCenterY:o}),e.transformBBox(t)})(Js.merge(g)),k=this.isAnySeriesActive();return null==(i=this.crossLines)||i.forEach(t=>{var e;t.sideFlag=-o,t.direction=s===-Math.PI/2?"x":"y",t instanceof ur&&(t.label.parallel=null!=(e=t.label.parallel)?e:this.label.parallel),t.parallelFlipRotation=n,t.regularFlipRotation=a,t.calculateLayout(k,this.reverse)}),{primaryTickCount:t=p.primaryTickCount,bbox:M}}updateLayoutState(){this.layout.label={fractionDigits:this.fractionDigits,padding:this.label.padding,format:this.label.format}}setDomain(t){this.dataDomain=this.normaliseDataDomain(t),this.reverse&&this.dataDomain.domain.reverse(),this.scale.domain=this.dataDomain.domain}updateScale(){this.updateRange(),this.calculateDomain(),this.setTickInterval(this.tick.interval);const{scale:t,nice:e}=this;Xa.is(t)&&(t.nice=e,t.update())}calculateRotations(){const t=zn(this.rotation);return{rotation:t,parallelFlipRotation:En(t),regularFlipRotation:En(t-Math.PI/2)}}generateTicks({primaryTickCount:t,parallelFlipRotation:e,regularFlipRotation:i,labelX:s,sideFlag:n}){var a;const{scale:o,tick:r,label:{parallel:l,rotation:h,fontFamily:c,fontSize:d,fontStyle:u,fontWeight:p}}=this,g=void 0!==t,{defaultRotation:f,configuredRotation:x,parallelFlipFlag:b,regularFlipFlag:v}=_o({rotation:h,parallel:l,regularFlipRotation:i,parallelFlipRotation:e}),S=x+f,M=new on,{maxTickCount:k}=this.estimateTickCount({minSpacing:r.minSpacing,maxSpacing:null!=(a=r.maxSpacing)?a:NaN}),D=!Xa.is(o)&&!xo.is(o)||isNaN(k)?10:k;let w=jo(l,x,0,n,v);const I=function(t,e,i,s){return t&&!e?i*s===-1?"hanging":"bottom":"middle"}(l,x,n,b),C={fontFamily:c,fontSize:d,fontStyle:u,fontWeight:p,textBaseline:I,textAlign:w};let L={rawTicks:[],ticks:[],labelCount:0},A=0,T=0,N=!0,O=!1;for(;N&&A<=D&&!O;){T=0,w=jo(l,x,0,n,v);const e=this.getTickStrategies({secondaryAxis:g,index:A});for(const i of e){({tickData:L,index:A,autoRotation:T,terminate:O}=i({index:A,tickData:L,textProps:C,labelOverlap:N,terminate:O,primaryTickCount:t}));const e=0!==x||0!==T,a=S+T;w=jo(l,x,T,n,v),N=!!this.label.avoidCollisions&&this.checkLabelOverlap(a,e,M,L.ticks,s,y(m({},C),{textAlign:w}))}}const R=f+x+T;return!g&&L.rawTicks.length>0&&(t=L.rawTicks.length),{tickData:L,primaryTickCount:t,combinedRotation:R,textBaseline:I,textAlign:w}}getTickStrategies({index:t,secondaryAxis:e}){const{scale:i,label:s,tick:n}=this,a=Xa.is(i)||xo.is(i),o=s.enabled&&s.avoidCollisions,r=!a&&0!==t&&o,l=!0===s.autoRotate&&void 0===s.rotation,h=[];let c;if(c=this.tick.values?3:e?1:r?2:0,h.push(({index:t,tickData:e,primaryTickCount:i,terminate:s})=>this.createTickData(c,t,e,s,i)),!a&&!isNaN(n.minSpacing)){const t=({index:t,tickData:e,primaryTickCount:i,terminate:s})=>this.createTickData(2,t,e,s,i);h.push(t)}if(!o)return h;if(s.autoWrap){const t=({index:t,tickData:e,textProps:i})=>this.wrapLabels(e,t,i);h.push(t)}else if(l){const t=({index:t,tickData:e,labelOverlap:i,terminate:s})=>({index:t,tickData:e,autoRotation:this.getAutoRotation(i),terminate:s});h.push(t)}return h}createTickData(t,e,i,s,n){var a;const{scale:o,tick:r}=this,{maxTickCount:l,minTickCount:h,defaultTickCount:c}=this.estimateTickCount({minSpacing:r.minSpacing,maxSpacing:null!=(a=r.maxSpacing)?a:NaN}),d=Xa.is(o)||xo.is(o),u=!d||isNaN(l)?10:l;let p=d?Math.max(c-e,h):l;const g=void 0===r.interval&&void 0===r.values&&p>h&&(d||2===t);let m=!0;for(;m&&e<=u;){const s=i.rawTicks;p=d?Math.max(c-e,h):l;const{rawTicks:a,ticks:o,labelCount:r}=this.getTicks({tickGenerationType:t,previousTicks:s,tickCount:p,minTickCount:h,maxTickCount:l,primaryTickCount:n});i.rawTicks=a,i.ticks=o,i.labelCount=r,m=!!g&&Yr(a,s),e++}const y=void 0!==r.interval||void 0!==r.values;return s||(s=y),{tickData:i,index:e,autoRotation:0,terminate:s}}checkLabelOverlap(t,e,i,s,n,a){on.updateTransformMatrix(i,1,1,t,0,0);const o=this.createLabelData(s,n,a,i),r=function(t,e){return isNaN(t)?e?0:10:t}(this.label.minSpacing,e);return function(t,e){const i=[];for(let s=0;s<t.length;s++){const n=t[s],{point:{x:a,y:o},label:{text:r}}=n;let{label:{width:l,height:h}}=n;if(l+=null!=e?e:0,h+=null!=e?e:0,i.some(t=>_r(t,a,o,l,h)))return!0;i.push({index:s,text:r,x:a,y:o,width:l,height:h,datum:n})}return!1}(o,r)}createLabelData(t,e,i,s){const n=[],a=new Fo(i);for(const{tickLabel:i,translationY:o}of t){if(""===i||null==i)continue;const{width:t,height:r}=a.size(i),l=Wo(i,new Js(e,o,t,r),e,o,s);n.push(l)}return n}getAutoRotation(t){var e;return t?En(zn(null!=(e=this.label.autoRotateAngle)?e:0)):0}getTicks({tickGenerationType:t,previousTicks:e,tickCount:i,minTickCount:s,maxTickCount:n,primaryTickCount:a}){var o;const{range:r,scale:l,visibleRange:h}=this;let c;switch(t){case 3:if(Xa.is(l)){const[t,e]=Ws(l.getDomain().map(Number));c=this.tick.values.filter(i=>i>=t&&i<=e).sort((t,e)=>t-e)}else c=this.tick.values;break;case 1:c=Xa.is(l)?this.updateSecondaryAxisTicks(a):this.createTicks(i,s,n);break;case 2:c=this.filterTicks(e,i);break;default:c=this.createTicks(i,s,n)}this.fractionDigits=c.fractionDigits>=0?c.fractionDigits:0;const d=(null!=(o=l.bandwidth)?o:0)/2,u=[];let p=0;const g=new Map,m=Math.max(0,Math.floor(h[0]*c.length)),y=Math.min(c.length,Math.ceil(h[1]*c.length)),f=c.slice(m,y);this.onLabelFormatChange(f,c,this.label.format);for(let t=0;t<f.length;t++){const e=f[t],i=l.convert(e)+d;if(r.length>0&&!this.inRange(i,0,.001))continue;const s=this.formatTick(e,m+t);let n=s;if(g.has(n)){const t=g.get(n);g.set(n,t+1),n=`${n}_${t}`}else g.set(n,1);u.push({tick:e,tickId:n,tickLabel:s,translationY:Math.floor(i)}),""!==s&&null!=s&&p++}return{rawTicks:c,ticks:u,labelCount:p}}filterTicks(t,e){var i;const s=isNaN(this.tick.minSpacing)&&isNaN(null!=(i=this.tick.maxSpacing)?i:NaN)?2:Math.ceil(t.length/e);return t.filter((t,e)=>e%s===0)}createTicks(t,e,i){var s,n,a;return this.setTickCount(t,e,i),null!=(a=null==(n=(s=this.scale).ticks)?void 0:n.call(s))?a:[]}estimateTickCount({minSpacing:t,maxSpacing:e}){const{minRect:i,label:{avoidCollisions:s}}=this;if(!s)return{minTickCount:Xa.defaultMaxTickCount,maxTickCount:Xa.defaultMaxTickCount,defaultTickCount:Xa.defaultMaxTickCount};const n=this.calculateRangeWithBleed(),a=Math.max(this.defaultTickMinSpacing,n/Xa.defaultMaxTickCount);let o=!isNaN(e);isNaN(t)&&(t=a),isNaN(e)&&(e=n),t>e&&(t===a?t=e:e=t);let r=1;i&&(r="x"===this.direction?i.width:i.height),o&&(o=r<a);const l=_s(1,Math.floor(n/t),o?Math.min(Math.floor(n/r),100):100),h=Math.min(l,Math.ceil(n/e));return{minTickCount:h,maxTickCount:l,defaultTickCount:_s(h,Xa.defaultTickCount,l)}}updateVisibility(){this.moduleCtx.animationManager.isSkipped()&&this.resetSelectionNodes(),this.tickLineGroup.visible=this.tick.enabled,this.gridLineGroup.visible=this.gridLine.enabled,this.tickLabelGroup.visible=this.label.enabled}updateCrossLines({rotation:t,parallelFlipRotation:e,regularFlipRotation:i}){var s;const n=this.label.getSideFlag(),a=this.isAnySeriesActive();null==(s=this.crossLines)||s.forEach(s=>{var o;s.sideFlag=-n,s.direction=t===-Math.PI/2?"x":"y",s instanceof ur&&(s.label.parallel=null!=(o=s.label.parallel)?o:this.label.parallel),s.parallelFlipRotation=e,s.regularFlipRotation=i,s.update(a)})}updateTickLines(){const{tick:t,label:e}=this,i=e.getSideFlag();this.tickLineGroupSelection.each(e=>{e.strokeWidth=t.width,e.stroke=t.color,e.x1=i*this.getTickSize(),e.x2=0})}calculateAvailableRange(){return Vs(this.range)}calculateRangeWithBleed(){const t=1/Vs(this.visibleRange);return $s(this.calculateAvailableRange()*t,2)}calculateDomain(){const t=this.boundSeries.filter(t=>this.includeInvisibleDomains||t.isEnabled()).flatMap(t=>t.getDomain(this.direction));this.setDomain(t)}getAxisTransform(){return{rotation:zn(this.rotation),rotationCenterX:0,rotationCenterY:0,translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){const{crossLineGroup:t,axisGroup:e,gridGroup:i,translation:s,gridLineGroupSelection:n,gridPadding:a,gridLength:o}=this,{rotation:r}=this.calculateRotations(),l=this.label.getSideFlag(),h=Math.floor(s.x),c=Math.floor(s.y);t.setProperties({rotation:r,translationX:h,translationY:c}),i.setProperties({rotation:r,translationX:h,translationY:c}),e.datum=this.getAxisTransform(),n.each(t=>{t.x1=a,t.x2=-l*o+a})}updateSecondaryAxisTicks(t){throw new Error("AG Charts - unexpected call to updateSecondaryAxisTicks() - check axes configuration.")}updateSelections(t,e,i){this.lineNode.datum=t,this.gridLineGroupSelection.update(this.gridLength?e:[],t=>t.append(new zr),t=>t.tickId),this.tickLineGroupSelection.update(e,t=>t.appendChild(new zr),t=>t.tickId),this.tickLabelGroupSelection.update(e.map(t=>this.getTickLabelProps(t,i)),t=>t.appendChild(new Bo),t=>t.tickId)}updateAxisLine(){const{line:t}=this,e=t.enabled?t.width:0;this.lineNode.setProperties({stroke:t.color,strokeWidth:e})}updateGridLines(t){const{gridLine:{style:e,width:i},gridPadding:s,gridLength:n}=this;0!==n&&0!==e.length&&this.gridLineGroupSelection.each((a,o,r)=>{const{stroke:l,lineDash:h}=e[r%e.length];a.setProperties({x1:s,x2:-t*n+s,fill:void 0,stroke:l,strokeWidth:i,lineDash:h})})}updateLabels(){const{label:t}=this;t.enabled&&this.tickLabelGroupSelection.each((t,e)=>{t.setProperties(e,["fill","fontFamily","fontSize","fontStyle","fontWeight","text","textAlign","textBaseline"])})}wrapLabels(t,e,i){const{parallel:s,maxWidth:n,maxHeight:a}=this.label;let o=this.maxThickness,r=Math.round(this.calculateAvailableRange()/t.labelCount);return s&&([o,r]=[r,o]),t.ticks.forEach(t=>{const{text:e}=Bo.wrap(t.tickLabel,null!=n?n:o,null!=a?a:r,i,"hyphenate");t.tickLabel=e}),{tickData:t,index:e,autoRotation:0,terminate:!0}}updateTitle(t){const{rotation:e,title:i,_titleCaption:s,lineNode:n,tickLineGroup:a,tickLabelGroup:o}=this;if(!i)return void(s.enabled=!1);let r=0;if(i.enabled&&t.anyTickVisible){const t=ko.computeBBox([a,o,n]);r+=(0===e?t.width:t.height)+(this.tickLabelGroup.visible?0:this.seriesAreaPadding)}this.setTitleProps(s,{spacing:r})}formatTick(t,e){return this.datumFormatter(e)(t)}formatDatum(t){return String(t)}datumFormatter(t=0){const{label:e,labelFormatter:i,fractionDigits:s,moduleCtx:{callbackCache:n}}=this;return e.formatter?a=>{var o;return null!=(o=n.call(e.formatter,{value:s>0?a:String(a),index:t,fractionDigits:s,formatter:i}))?o:a}:i?t=>{var e;return null!=(e=n.call(i,t))?e:String(t)}:t=>String(t)}computeBBox(){return this.axisGroup.computeBBox()}initCrossLine(t){t.scale=this.scale,t.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(t=>this.includeInvisibleDomains||t.isEnabled())}clipTickLines(t,e,i,s){this.tickLineGroup.setClipRectInGroupCoordinateSpace(new Js(t,e,i,s))}clipGrid(t,e,i,s){this.gridGroup.setClipRectInGroupCoordinateSpace(new Js(t,e,i,s))}calculatePadding(t,e){const i=.01*Math.abs(this.reverse?e:t);return[i,i]}getTitleFormatterParams(){var t;const e=this.boundSeries.reduce((t,e)=>{const i=e.getKeys(this.direction),s=e.getNames(this.direction);for(let e=0;e<i.length;e++)t.push({key:i[e],name:s[e]});return t},[]);return{direction:this.direction,boundSeries:e,defaultValue:null==(t=this.title)?void 0:t.text}}normaliseDataDomain(t){return{domain:[...t],clipped:!1}}getLayoutState(){return m({rect:this.computeBBox(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale},this.layout)}getModuleMap(){return this.moduleMap}createModuleContext(){return null!=this.axisContext||(this.axisContext=this.createAxisContext()),y(m({},this.moduleCtx),{parent:this.axisContext})}createAxisContext(){return{axisId:this.id,direction:this.direction,continuous:Xa.is(this.scale),keys:()=>this.boundSeries.flatMap(t=>t.getKeys(this.direction)),seriesKeyProperties:()=>this.boundSeries.reduce((t,e)=>(e.getKeyProperties(this.direction).forEach(e=>{t.indexOf(e)<0&&t.push(e)}),t),[]),scaleValueFormatter:t=>{var e,i;return t?null==(i=(e=this.scale).tickFormat)?void 0:i.call(e,{specifier:t}):this.formatDatum},scaleBandwidth:()=>{var t;return null!=(t=this.scale.bandwidth)?t:0},scaleConvert:t=>this.scale.convert(t),scaleInvert:t=>{var e,i;return null==(i=(e=this.scale).invert)?void 0:i.call(e,t)}}}animateReadyUpdate(t){const{animationManager:e}=this.moduleCtx,i=yl(pl(this));Tn(this.id,"axis-group",e,[this.axisGroup],i.group),Tn(this.id,"line",e,[this.lineNode],i.line),Tn(this.id,"line-paths",e,[this.gridLineGroupSelection,this.tickLineGroupSelection],i.tick,(t,e)=>e.tickId,t),Tn(this.id,"tick-labels",e,[this.tickLabelGroupSelection],i.label,(t,e)=>e.tickId,t)}resetSelectionNodes(){const{gridLineGroupSelection:t,tickLineGroupSelection:e,tickLabelGroupSelection:i,lineNode:s}=this,n=pl(this);mr([this.axisGroup],(t,e)=>({rotation:e.rotation,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,translationX:e.translationX,translationY:e.translationY})),mr([t,e],xl(n)),mr([i],(t,e)=>({x:e.x,y:e.y,translationY:e.translationY,rotation:e.rotation,rotationCenterX:e.rotationCenterX})),mr([s],vl())}calculateUpdateDiff(t,e){const i=new Set,s=new Set,n={},a=Math.max(t.length,e.ticks.length);for(let o=0;o<a;o++){const a=e.ticks[o],r=t[o],l=null==a?void 0:a.tickId;n[null!=l?l:r]=a,r!==l&&(s.has(l)?s.delete(l):l&&i.add(l),i.has(r)?i.delete(r):r&&s.add(r))}return{changed:i.size>0||s.size>0,added:i,removed:s}}isReversed(){return this.reverse}};Sl.defaultTickMinSpacing=50,b([$n(Qn)],Sl.prototype,"nice",2),b([$n(Qn)],Sl.prototype,"reverse",2),b([$n(ba)],Sl.prototype,"keys",2),b([$n(Zn,{optional:!0})],Sl.prototype,"title",2),b([Zr((t,e,i)=>t.onGridLengthChange(e,i))],Sl.prototype,"gridLength",2);var Ml=Sl,kl=class extends cl{constructor(){super(...arguments),this.autoRotateAngle=335}};b([$n(Qn,{optional:!0})],kl.prototype,"autoRotate",2),b([$n(aa)],kl.prototype,"autoRotateAngle",2);var Dl=class t extends Ml{constructor(){super(...arguments),this.thickness=0,this.position="left"}static is(e){return e instanceof t}get direction(){return["top","bottom"].includes(this.position)?"x":"y"}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}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}update(t,e){return this.updateDirection(),super.update(t,e)}calculateLayout(t){return this.updateDirection(),super.calculateLayout(t)}createAxisContext(){return y(m({},super.createAxisContext()),{position:this.position})}assignCrossLineArrayConstructor(t){Ha(t,ur)}createLabel(){return new kl}};b([$n(sa)],Dl.prototype,"thickness",2),b([$n(wa)],Dl.prototype,"position",2);var wl=Dl,Il=class extends Ka{constructor(){super(...arguments),this.minSpacing=NaN}};b([$n(Fa),Yn(NaN)],Il.prototype,"minSpacing",2);var Cl=class extends wl{constructor(t,e=new Kn){super(t,e),this._paddingOverrideEnabled=!1,this.groupPaddingInner=.1,this.includeInvisibleDomains=!0}set paddingInner(t){this._paddingOverrideEnabled=!0,this.scale.paddingInner=t}get paddingInner(){return this._paddingOverrideEnabled=!0,this.scale.paddingInner}set paddingOuter(t){this.scale.paddingOuter=t}get paddingOuter(){return this.scale.paddingOuter}createTick(){return new Il}normaliseDataDomain(t){const e=[],i=new Set;for(const s of t){const t=s instanceof Date?s.getTime():s;i.has(t)||(i.add(t),e.push(s))}return{domain:e,clipped:!1}}calculateDomain(){if(!this._paddingOverrideEnabled){const t=this.boundSeries.map(t=>{var e;return null==(e=t.getBandScalePadding)?void 0:e.call(t)}).filter(t=>null!=t);t.length>0&&(this.scale.paddingInner=Math.min(...t.map(t=>t.inner)),this.scale.paddingOuter=Math.max(...t.map(t=>t.outer)))}return super.calculateDomain()}};Cl.className="CategoryAxis",Cl.type="category",b([$n(na)],Cl.prototype,"groupPaddingInner",2);var Ll=class{constructor(t="",e,i=0){this.x=0,this.y=0,this.subtreeLeft=NaN,this.subtreeRight=NaN,this.screenX=0,this.screenY=0,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.label=t,this.parent=e,this.depth=e?e.depth+1:0,this.number=i}getLeftSibling(){return this.number>0&&this.parent?this.parent.children[this.number-1]:void 0}getLeftmostSibling(){return this.number>0&&this.parent?this.parent.children[0]:void 0}nextLeft(){return this.children?this.children[0]:this.thread}nextRight(){return this.children?this.children[this.children.length-1]:this.thread}getSiblings(){return this.parent?this.parent.children.filter((t,e)=>e!==this.number):[]}};function Al(t,e,i){const s=i/(e.number-t.number);e.change-=s,e.shift+=i,t.change+=s,e.prelim+=i,e.mod+=i}function Tl(t,e,i){return e.getSiblings().indexOf(t.ancestor)>=0?t.ancestor:i}function Nl(t,e){const i=t.children;if(i.length){let s=i[0];i.forEach(t=>{Nl(t,e),s=function(t,e,i){const s=t.getLeftSibling();if(s){let n=t,a=t,o=s,r=a.getLeftmostSibling(),l=a.mod,h=n.mod,c=o.mod,d=r.mod;for(;o.nextRight()&&a.nextLeft();){o=o.nextRight(),a=a.nextLeft(),r=r.nextLeft(),n=n.nextRight(),n.ancestor=t;const s=o.prelim+c-(a.prelim+l)+i;s>0&&(Al(Tl(o,t,e),t,s),l+=s,h+=s),c+=o.mod,l+=a.mod,d+=r.mod,h+=n.mod}o.nextRight()&&!n.nextRight()?(n.thread=o.nextRight(),n.mod+=c-h):(a.nextLeft()&&!r.nextLeft()&&(r.thread=a.nextLeft(),r.mod+=l-d),e=t)}return e}(t,s,e)}),function(t){const e=t.children;if(e){let t=0,i=0;for(let s=e.length-1;s>=0;s--){const n=e[s];n.prelim+=t,n.mod+=t,i+=n.change,t+=n.shift+i}}}(t);const n=(i[0].prelim+i.at(-1).prelim)/2,a=t.getLeftSibling();a?(t.prelim=a.prelim+e,t.mod=t.prelim-n):t.prelim=n}else{const i=t.getLeftSibling();t.prelim=i?i.prelim+e:0}}var Ol=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(t,e){const{x:i,y:s}=e(t);i>this.right&&(this.right=i),i<this.left&&(this.left=i),s>this.bottom&&(this.bottom=s),s<this.top&&(this.top=s)}};function Rl(t,e,i){t.x=t.prelim+e,t.y=t.depth,i.update(t),t.children.forEach(s=>Rl(s,e+t.mod,i))}function El(t){const e=t.children;let i=0;e.forEach(t=>{El(t),t.children.length?i+=t.leafCount:i++}),t.leafCount=i,e.length?(t.subtreeLeft=e[0].subtreeLeft,t.subtreeRight=e[t.children.length-1].subtreeRight,t.x=(t.subtreeLeft+t.subtreeRight)/2):(t.subtreeLeft=t.x,t.subtreeRight=t.x)}function Pl(t){const e=new Bl;return Nl(t,1),Rl(t,-t.prelim,e),El(t),e}var Bl=class{constructor(){this.dimensions=new Ol,this.leafCount=0,this.nodes=[],this.leafNodes=[],this.nonLeafNodes=[],this.depth=0}update(t){this.dimensions.update(t,t=>({x:t.x,y:t.y})),t.children.length?this.nonLeafNodes.push(t):(this.leafCount++,this.leafNodes.push(t)),t.depth>this.depth&&(this.depth=t.depth),this.nodes.push(t)}resize(t,e,i=0,s=0,n=!1){const a=this.leafCount-1,o=this.depth,r=this.dimensions;let l=1,h=1;if(t>0&&a){const e=(r.right-r.left)/a;l=t/a/e,n&&(l=-l)}if(e>0&&o){const t=(r.bottom-r.top)/o;h=e/o/t}const c=new Ol;this.nodes.forEach(t=>{t.screenX=t.x*l,t.screenY=t.y*h,c.update(t,t=>({x:t.screenX,y:t.screenY}))});const d=-c.left,u=-c.top;this.nodes.forEach(t=>{t.screenX+=d+i,t.screenY+=u+s})}},Fl=class extends cl{constructor(){super(...arguments),this.grid=!1}};b([$n(Qn)],Fl.prototype,"grid",2);var zl=class extends wl{constructor(t){super(t,new Kn),this.tickScale=new Kn,this.line=new dl,this.label=new Fl,this.labelColor="rgba(87, 87, 87, 1)",this.includeInvisibleDomains=!0;const{tickLineGroup:e,tickLabelGroup:i,gridLineGroup:s,tickScale:n,scale:a}=this;a.paddingOuter=.1,a.paddingInner=2*a.paddingOuter,this.refreshScale(),n.paddingInner=1,n.paddingOuter=0,this.gridLineSelection=Er.select(s,zr),this.axisLineSelection=Er.select(e,zr),this.separatorSelection=Er.select(e,zr),this.labelSelection=Er.select(i,Bo)}updateRange(){const{range:t,visibleRange:e,scale:i}=this,s=(t[1]-t[0])/(e[1]-e[0]),n=s*e[0],a=t[0]-n;this.tickScale.range=i.range=[a,a+s],this.resizeTickTree()}resizeTickTree(){var t;const e=this.scale,i=e.domain.length?[e.convert(e.domain[0]),e.convert(e.domain[e.domain.length-1])]:e.range,s=this.tickTreeLayout,n=this.lineHeight;s&&s.resize(Math.abs(i[1]-i[0]),s.depth*n,(Math.min(i[0],i[1])||0)+(null!=(t=e.bandwidth)?t:0)/2,-s.depth*n,i[1]-i[0]<0)}get lineHeight(){return 1.5*this.label.fontSize}onGridVisibilityChange(){this.gridLineSelection.clear(),this.labelSelection.clear()}createTick(){return new Il}calculateDomain(){var t;const{direction:e}=this;let i=null;const s=this.boundSeries.filter(t=>t.visible).flatMap(t=>{if("y"===e||i)return t.getDomain(e);if(null===i){const s=t.getDomain(e);return i=Wt(s[0]),s}return[]});this.setDomain(null!=(t=rs(s))?t:us(s));const{domain:n}=this.dataDomain;this.tickTreeLayout=Pl(function(t,e=!0){const i=new Ll;let s=0;return e&&t.forEach(t=>s=Math.max(s,t.labels.length)),t.forEach(t=>{if(e)for(;t.labels.length<s;)t.labels.unshift("");!function(t,e){const i=e.labels.slice().reverse(),s=i.length-1;i.forEach((e,i)=>{const n=t.children,a=n.find(t=>t.label===e),o=i!==s;if(a&&o)t=a;else{const i=new Ll(e,t);i.number=n.length,n.push(i),o&&(t=i)}})}(i,t)}),i}(n)),this.tickScale.domain=n.concat(""),this.resizeTickTree()}update(){this.computedLayout&&(this.updatePosition(),this.updateTitleCaption(),this.updateCategoryLabels(),this.updateSeparators(),this.updateAxisLines(),this.updateCategoryGridLines(),this.resetSelectionNodes())}updateTitleCaption(){const{_titleCaption:t}=this;t.node.visible=!1}updateCategoryLabels(){if(!this.computedLayout)return;const{tickLabelLayout:t}=this.computedLayout;this.labelSelection.update(t).each((t,e)=>{t.setProperties(e)})}updateSeparators(){if(!this.computedLayout)return;const{separatorLayout:t}=this.computedLayout,{range:e}=this;this.separatorSelection.update(t).each((t,i)=>{t.x1=i.x1,t.x2=i.x2,t.y1=i.y,t.y2=i.y,t.visible=i.y>=e[0]-1e-7&&i.y<=e[1]+1e-7,t.stroke=this.tick.color,t.fill=void 0,t.strokeWidth=1})}updateAxisLines(){if(!this.computedLayout)return;const{axisLineLayout:t}=this.computedLayout;this.axisLineSelection.update(t).each((t,e)=>{t.setProperties(y(m({},e),{stroke:this.line.color,strokeWidth:this.line.width})),t.x1=e.x,t.x2=e.x,t.y1=e.y1,t.y2=e.y2,t.strokeWidth=this.line.width,t.stroke=this.line.color})}updateCategoryGridLines(){const{gridLength:t,gridLine:e,label:i,range:s,tickScale:n}=this,a=n.ticks(),o=i.getSideFlag(),r=this.gridLineSelection.update(t?a:[]);if(t){const{width:i,style:a}=e,l=a.length;r.each((e,r,h)=>{const c=Math.round(n.convert(r));e.x1=0,e.x2=-o*t,e.y1=c,e.y2=c,e.visible=c>=s[0]&&c<=s[1];const{stroke:d,lineDash:u}=a[h%l];e.stroke=d,e.strokeWidth=i,e.lineDash=u,e.fill=void 0})}}computeLayout(){this.updateDirection(),this.calculateDomain(),this.updateRange();const{scale:t,label:e,label:{parallel:i},moduleCtx:{callbackCache:s},range:n,title:a,title:{formatter:o=t=>t.defaultValue}={}}=this,r=t.range[0],l=t.range[1],h=Math.abs(l-r)/t.domain.length||0,c=Math.ceil(e.fontSize/h),d=zn(this.rotation),u=Math.abs(Math.cos(d))<1e-8,p=e.getSideFlag(),g=this.lineHeight,f=this.tickTreeLayout,x=t.ticks(),b=f?f.nodes:[],v=!!f&&f.depth>1,{defaultRotation:S,configuredRotation:M,parallelFlipFlag:k}=_o({rotation:e.rotation,parallel:i,regularFlipRotation:En(d-Math.PI/2),parallelFlipRotation:En(d)}),D=[],w=new Map;let I=0;const C=new Bo,L=(t,i)=>{var r;if(C.setProperties({fill:e.color,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textAlign:"center",textBaseline:-1===k?"bottom":"hanging",translationX:t.screenY-.25*e.fontSize,translationY:t.screenX}),0===i){if(!((null==a?void 0:a.enabled)&&x.length>0))return!1;const i=s.call(o,this.getTitleFormatterParams());C.setProperties({fill:a.color,fontFamily:a.fontFamily,fontSize:a.fontSize,fontStyle:a.fontStyle,fontWeight:a.fontWeight,text:i,textBaseline:"hanging",translationX:t.screenY-.25*e.fontSize,translationY:t.screenX})}else{if(i%c!==0)return!1;if(!(t.screenX>=n[0]&&t.screenX<=n[1]))return!1;e.formatter?C.text=null!=(r=s.call(e.formatter,{value:String(t.label),index:i}))?r:String(t.label):C.text=String(t.label)}return!0};b.forEach((t,e)=>{if(!L(t,e))return;const i=C.computeTransformedBBox();i&&(w.set(e,i),!t.children.length&&i.width>I&&(I=i.width))});const A=p*e.padding,T=this.label.grid,N=[];b.forEach((t,e)=>{let i=L(t,e);const s=e;C.x=A,C.rotationCenterX=A;const n=!t.children.length;if(n)C.rotation=M,C.textAlign="end",C.textBaseline="middle";else{C.translationX-=I-g+this.label.padding;const e=t.leafCount*h,n=w.get(s);n&&n.width>e?(i=!1,w.delete(s)):C.rotation=u?S:-Math.PI/2}if(t.parent&&v){const e=n?t.screenX-h/2:t.screenX-t.leafCount*h/2;if(n)(t.number!==t.children.length-1||T)&&N.push({y:e,x1:0,x2:-I-2*this.label.padding});else{const i=-I-2*this.label.padding+t.screenY;N.push({y:e,x1:i+g,x2:i})}}let a;if(i){const t=C.computeTransformedBBox();t&&w.set(e,t),a=y(m({},{fill:(o=C).fill,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,rotation:o.rotation,rotationCenterX:o.rotationCenterX,rotationCenterY:o.rotationCenterY,text:o.text,textAlign:o.textAlign,textBaseline:o.textBaseline,translationX:o.translationX,translationY:o.translationY,visible:o.visible,x:o.x,y:o.y}),{visible:i})}else w.delete(e),a={visible:i};var o;D.push(a)});let O=0;N.forEach(t=>O=Math.min(O,t.x2)),N.push({y:Math.max(r,l),x1:0,x2:O});const R=[],E=[];N.forEach(t=>{if(t.y>=n[0]-1e-7&&t.y<=n[1]+1e-7){const{x1:e,x2:i,y:s}=t,n=new Js(Math.min(e,i),s,Math.abs(e-i),0);E.push(n),R.push({x1:e,x2:i,y:s})}});const P=[],B=[],F=f?f.depth+1:1;for(let t=0;t<F;t++){const e=x.length>0&&(0===t||T&&v),i=t>0?-I-2*this.label.padding-(t-1)*g:0,s=new Js(i,Math.min(...n),0,Math.abs(n[1]-n[0]));B.push(s),P.push({x:i,y1:n[0],y2:n[1],visible:e})}return{bbox:(t=>{const e=new on,{rotation:i,translationX:s,translationY:n,rotationCenterX:a,rotationCenterY:o}=this.getAxisTransform();return on.updateTransformMatrix(e,1,1,i,s,n,{scalingCenterX:0,scalingCenterY:0,rotationCenterX:a,rotationCenterY:o}),e.transformBBox(t)})(Js.merge([...w.values(),...E,...B])),tickLabelLayout:D,separatorLayout:R,axisLineLayout:P}}calculateLayout(){const{axisLineLayout:t,separatorLayout:e,tickLabelLayout:i,bbox:s}=this.computeLayout();return this.computedLayout={axisLineLayout:t,separatorLayout:e,tickLabelLayout:i},{bbox:s,primaryTickCount:void 0}}};zl.className="GroupedCategoryAxis",zl.type="grouped-category",b([$n(ma,{optional:!0})],zl.prototype,"labelColor",2);var Gl=class t{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:i,height:s,pixelRatio:n,position:a,insertAsFirstChild:o}=e;this.insertAsFirstChild=null!=o&&o,this.pixelRatio=function(){if("undefined"==typeof navigator)return!1;const t=navigator.userAgent.match(/\(iPhone; CPU iPhone OS (\d+_\d+_\d+) like Mac OS X\)/);if(null==t)return!1;const[e,i]=t[1].split("_").map(Number);return e<16||16===e&&i<6}()?1:null!=n?n:Ss("devicePixelRatio"),this.element=Ms("canvas"),this.element.width=Math.round((null!=i?i:this.width)*this.pixelRatio),this.element.height=Math.round((null!=s?s:this.height)*this.pixelRatio),a&&(this.element.style.position=a),this.context=this.element.getContext("2d"),this.onEnabledChange(),this.resize(null!=i?i:0,null!=s?s:0),t.debugContext(this.context)}static is(e){return e instanceof t}drawImage(t,e=0,i=0){return t.drawImage(this.context.canvas,e,i)}toDataURL(t){return this.element.toDataURL(t)}resize(t,e){if(!(t>0&&e>0))return;const{element:i,context:s,pixelRatio:n}=this;i.width=Math.round(t*n),i.height=Math.round(e*n),s.setTransform(n,0,0,n,0,0),i.style.width=t+"px",i.style.height=e+"px",this.width=t,this.height=e}snapshot(){}clear(){this.context.save(),this.context.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.context.clearRect(0,0,this.width,this.height),this.context.restore()}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}onContainerChange(t,e){var i,s,n,a;t!==e&&(null==(i=this.element.parentNode)||i.removeChild(this.element),this.insertAsFirstChild&&(null==(s=this.container)?void 0:s.firstChild)?null==(n=this.container)||n.insertBefore(this.element,this.container.firstChild):null==(a=this.container)||a.appendChild(this.element))}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"block":"none")}static debugContext(t){if(Ls.check("canvas")){const e=t.save.bind(t),i=t.restore.bind(t);let s=0;Object.assign(t,{save(){e(),s++},restore(){if(0===s)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(0!==s)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}};b([Zr(t=>t.onEnabledChange())],Gl.prototype,"enabled",2),b([Zr((t,e,i)=>t.onContainerChange(e,i))],Gl.prototype,"container",2);var _l=Gl,jl=class t{constructor(t,e){this.canvas=t,this.markDirty=e,this.debug=Ls.create(!0,"scene"),this.layersMap=new Map,this.nextZIndex=0,this.nextLayerId=0}static sortLayers(t,e){var i,s;return So([t.zIndex,...null!=(i=t.zIndexSubOrder)?i:[void 0,void 0],t.id],[e.zIndex,...null!=(s=e.zIndexSubOrder)?s:[void 0,void 0],e.id],bo)}get size(){return this.layersMap.size}forEach(e){Array.from(this.layersMap.values()).sort(t.sortLayers).forEach(e)}resize(t,e){this.canvas.resize(t,e),this.layersMap.forEach(({canvas:i})=>i.resize(t,e))}addLayer(t){const{width:e,height:i,pixelRatio:s}=this.canvas,{zIndex:n=this.nextZIndex++,name:a,zIndexSubOrder:o,getComputedOpacity:r,getVisibility:l}=t,h=new _l({width:e,height:i,pixelRatio:s,position:"absolute"}),c={id:this.nextLayerId++,name:a,canvas:h,zIndex:n,zIndexSubOrder:o,getComputedOpacity:r,getVisibility:l};return n>=this.nextZIndex&&(this.nextZIndex=n+1),this.layersMap.set(h,c),this.debug("Scene.addLayer() - layers",this.layersMap),c.canvas}removeLayer(t){this.layersMap.has(t)&&(this.layersMap.delete(t),t.destroy(),this.markDirty(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}moveLayer(t,e,i){const s=this.layersMap.get(t);s&&(s.zIndex=e,s.zIndexSubOrder=i,this.markDirty(),this.debug("Scene.moveLayer() -  layers",this.layersMap))}clear(){this.layersMap.clear()}};function Wl(t,e,i,s,n={}){if(!Ls.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:a=0,layersSkipped:o=0,nodesRendered:r=0,nodesSkipped:l=0}=null!=s?s:{},h=performance.now(),c=e,{start:d}=c,u=f(c,["start"]),p=Object.entries(u).map(([t,e])=>$l(t,e)).filter(t=>null!=t).join(" + "),g=Object.entries(n).map(([t,e])=>`${t}: ${e}`).join(" ; "),m=Ls.check("scene:stats:verbose"),y=[`${$l("⏱️",d,h)} (${p})`,`${g}`,`Layers: ${m?Yl(a,o):t.size}`,m?`Nodes: ${Yl(r,l)}`:null].filter(jt),x=new Map(y.map(t=>[t,Bo.getTextSize(t,i.font)])),b=Math.max(...Array.from(x.values(),t=>t.width)),v=function(t,e){let i=0;for(const s of t)i+=e(s);return i}(x.values(),t=>t.height);i.save(),i.fillStyle="white",i.fillRect(0,0,b,v),i.fillStyle="black";let S=0;for(const[t,e]of x.entries())S+=e.height,i.fillText(t,2,S);i.restore()}function Vl(t){var e,i;return Ls.check(!0,"scene")?m(m({node:t,name:null!=(e=t instanceof ko?t.name:null)?e:t.id,dirty:tn[t.dirty]},(null==(i=t.parent)?void 0:i.isVirtual)?{virtualParentDirty:tn[t.parent.dirty],virtualParent:t.parent}:{}),t.children.map(t=>Vl(t)).reduce((t,e)=>{let{name:i}=e;const{node:{visible:s,opacity:n,zIndex:a,zIndexSubOrder:o},node:r,virtualParent:l}=e;(!s||n<=0)&&(i=`(${i})`),r instanceof ko&&r.isLayer()&&(i=`*${i}*`);const h=[`${null!=i?i:"<unknown>"}`,`z: ${a}`,o&&`zo: ${o.map(t=>"function"==typeof t?`${t()} (fn)`:t).join(" / ")}`,l&&"(virtual parent)"].filter(t=>!!t).join(" ");let c=h,d=1;for(;null!=t[c]&&d<100;)c=`${h} (${d++})`;return t[c]=e,t},{})):{}}function Kl(t){var e;if(0===t.dirty)return{dirtyTree:{},paths:[]};const i=t.children.map(t=>Kl(t)).filter(t=>t.paths.length>0),s=ko.is(t)&&null!=(e=t.name)?e:t.id,n=i.length?i.flatMap(t=>t.paths).map(t=>`${s}.${t}`):[s];return{dirtyTree:m({name:s,node:t,dirty:tn[t.dirty]},i.map(t=>t.dirtyTree).filter(t=>null!=t.dirty).reduce((t,e)=>{var i;return t[null!=(i=e.name)?i:"<unknown>"]=e,t},{})),paths:n}}function Yl(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function $l(t,e,i){const s=null!=i?i-e:e;return`${t}: ${Math.round(100*s)/100}ms`}var Hl=class{constructor({width:t,height:e,pixelRatio:i,canvasPosition:s}){this.debug=Ls.create(!0,"scene"),this.id=Fs(this),this.root=null,this.isDirty=!1,this.canvas=new _l({width:t,height:e,pixelRatio:i,position:s,insertAsFirstChild:"absolute"===s}),this.layersManager=new jl(this.canvas,()=>{this.isDirty=!0})}get width(){var t,e;return null!=(e=null==(t=this.pendingSize)?void 0:t[0])?e:this.canvas.width}get height(){var t,e;return null!=(e=null==(t=this.pendingSize)?void 0:t[1])?e:this.canvas.height}setContainer(t){return this.canvas.container=t,this}setRoot(t){var e;return this.root===t||(this.isDirty=!0,null==(e=this.root)||e._setLayerManager(),this.root=t,t&&(t.visible=!0,t._setLayerManager(this.layersManager))),this}attachNode(t){var e;return null==(e=this.root)||e.appendChild(t),()=>this.removeChild(t)}appendChild(t){var e;return null==(e=this.root)||e.appendChild(t),this}removeChild(t){var e;return null==(e=this.root)||e.removeChild(t),this}download(t,e){var i;ks(this.canvas.toDataURL(e),null!=(i=null==t?void 0:t.trim())?i:"image")}getDataURL(t){return this.canvas.toDataURL(t)}resize(t,e){return t=Math.round(t),e=Math.round(e),t>0&&e>0&&(t!==this.width||e!==this.height)&&(this.pendingSize=[t,e],this.isDirty=!0,!0)}render(t){return S(this,null,function*(){var e,i;const{debugSplitTimes:s={start:performance.now()},extraDebugStats:n}=null!=t?t:{},{canvas:a,canvas:{context:o}={},root:r,pendingSize:l}=this;if(!o)return;const h=performance.now();if(l&&(this.layersManager.resize(...l),this.pendingSize=void 0),r&&!r.visible)return void(this.isDirty=!1);if(r&&!this.isDirty)return this.debug.check()&&this.debug("Scene.render() - no-op",{redrawType:tn[r.dirty],tree:Vl(r)}),void Wl(this.layersManager,s,o,void 0,n);const c={ctx:o,devicePixelRatio:null!=(e=this.canvas.pixelRatio)?e:1,forceRender:!0,resized:Boolean(l),debugNodes:{}};Ls.check("scene:stats:verbose")&&(c.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0});let d=!1;if((!r||r.dirty>=1)&&(d=!0,a.clear()),r&&Ls.check("scene:dirtyTree")){const{dirtyTree:t,paths:e}=Kl(r);Ls.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:t,paths:e})}if(r&&d&&(this.debug("Scene.render() - before",{redrawType:tn[r.dirty],canvasCleared:d,tree:Vl(r)}),r.visible&&(r.preRender(),o.save(),r.render(c),o.restore())),s["✍️"]=performance.now()-h,this.layersManager.size&&d){const t=performance.now();o.save(),o.resetTransform(),this.layersManager.forEach(t=>{t.canvas.enabled&&t.getVisibility()&&(o.globalAlpha=t.getComputedOpacity(),t.canvas.drawImage(o))}),o.restore(),s["⛙"]=performance.now()-t}null==(i=o.verifyDepthZero)||i.call(o),this.isDirty=!1,Wl(this.layersManager,s,o,c.stats,n),function(t,e){t.save();for(const[i,s]of Object.entries(e)){const e=s.computeTransformedBBox();e?(t.globalAlpha=.8,t.strokeStyle="red",t.lineWidth=1,t.strokeRect(e.x,e.y,e.width,e.height),t.fillStyle="red",t.strokeStyle="white",t.font="16px sans-serif",t.textBaseline="top",t.textAlign="left",t.lineWidth=2,t.strokeText(i,e.x,e.y,e.width),t.fillText(i,e.x,e.y,e.width)):E.log(`Scene.render() - no bbox for debugged node [${i}].`)}t.restore()}(o,c.debugNodes),r&&this.debug.check()&&this.debug("Scene.render() - after",{redrawType:tn[r.dirty],tree:Vl(r),canvasCleared:d})})}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.canvas.container=void 0,this.strip(),this.canvas.destroy(),Object.assign(this,{canvas:void 0})}};function Ul(t){return new Promise(e=>{setTimeout(()=>e(void 0),t)})}Hl.className="Scene";var Xl=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise(e=>{this.acquireQueue.push([t,e]),this.available&&this.dispatchNext().catch(t=>E.errorOnce(t))})}acquireImmediately(t){return S(this,null,function*(){return!!this.available&&(yield this.acquire(t),!0)})}waitForClearAcquireQueue(){return S(this,null,function*(){return this.acquire(()=>S(this,null,function*(){}))})}dispatchNext(){return S(this,null,function*(){var t,e;this.available=!1;let[i,s]=null!=(t=this.acquireQueue.shift())?t:[];for(;i;){try{yield i(),null==s||s()}catch(t){E.error("mutex callback error",t),null==s||s()}[i,s]=null!=(e=this.acquireQueue.shift())?e:[]}this.available=!0})}},Zl=class{constructor(){this.eventListeners=new Map}addEventListener(t,e){if("function"!=typeof e)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){var i;null==(i=this.eventListeners.get(t))||i.delete(e),0===this.eventListeners.size&&this.eventListeners.delete(t)}hasEventListener(t){return this.eventListeners.has(t)}clearEventListeners(){this.eventListeners.clear()}fireEvent(t){var e;null==(e=this.eventListeners.get(t.type))||e.forEach(e=>e(t))}},ql=class extends fe{constructor(t=0,e=t,i=t,s=e){super(),this.top=t,this.right=e,this.bottom=i,this.left=s}clear(){this.top=this.right=this.bottom=this.left=0}};function Ql(t,e){let i,s,n=0,a=!1;const o=()=>a,r=()=>{a=!1,null==s||s(),s=void 0,i=void 0,n>0&&t(l)},l=()=>{const t=n;n=0,a=!0;const i=e({count:t});i?i.then(r,r):r()};return{schedule(e){0!==n||o()||t(l,e),n++},await(){return S(this,null,function*(){if(o())for(null==i&&(i=new Promise(t=>{s=t}));o();)yield i})}}}b([$n(sa)],ql.prototype,"top",2),b([$n(sa)],ql.prototype,"right",2),b([$n(sa)],ql.prototype,"bottom",2),b([$n(sa)],ql.prototype,"left",2);var Jl=class{constructor(){var t;this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([t,e])=>this.observe(t,e)),this.queuedObserveRequests=[]},"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(t=>{for(const{target:e,contentRect:i}of t){const{width:t,height:s}=i;this.checkSize(this.elements.get(e),e,t,s)}}),this.documentReady="complete"===vs("readyState"),this.documentReady||null==(t=Ss())||t.addEventListener("load",this.onLoad))}destroy(){var t,e;null==(t=Ss())||t.removeEventListener("load",this.onLoad),null==(e=this.resizeObserver)||e.disconnect(),this.resizeObserver=null}checkSize(t,e,i,s){var n,a;t&&(i===(null==(n=t.size)?void 0:n.width)&&s===(null==(a=t.size)?void 0:a.height)||(t.size={width:i,height:s},t.cb(t.size,e)))}observe(t,e){var i;this.documentReady?(this.elements.has(t)?this.removeFromQueue(t):null==(i=this.resizeObserver)||i.observe(t),this.elements.set(t,{cb:e})):this.queuedObserveRequests.push([t,e])}unobserve(t){var e;null==(e=this.resizeObserver)||e.unobserve(t),this.elements.delete(t),this.removeFromQueue(t),this.elements.size||this.destroy()}removeFromQueue(t){this.queuedObserveRequests=this.queuedObserveRequests.filter(([e])=>e!==t)}},th=class{constructor(){this.cache=new WeakMap}call(t,...e){let i,s=this.cache.get(t);const n=()=>{try{const n=t(...e);return s&&null!=i&&s.set(i,n),n}catch(t){return void E.warnOnce("User callback errored, ignoring",t)}};try{i=JSON.stringify(e)}catch(t){return n()}return null==s&&(s=new Map,this.cache.set(t,s)),s.has(i)?s.get(i):n()}invalidateCache(){this.cache=new WeakMap}},eh=class{constructor(t){this.annotationRoot=t}attachNode(t){return this.annotationRoot.append(t),()=>{var e;return null==(e=this.annotationRoot)||e.removeChild(t),this}}setAnnotationStyles(t){this.styles=t}getAnnotationTypeStyles(t){var e;return null==(e=this.styles)?void 0:e[t]}},ih=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(e=>e.symbol===t);if(s>=0){i.splice(s,1),0===i.length&&this.registeredListeners.delete(e);break}}}dispatch(t,...e){for(const i of this.getListenersByType(t))try{i.handler(...e)}catch(t){E.errorOnce(t)}}dispatchWrapHandlers(t,e,...i){for(const s of this.getListenersByType(t))try{e(s.handler,...i)}catch(t){E.errorOnce(t)}}getListenersByType(t){var e;return null!=(e=this.registeredListeners.get(t))?e:[]}destroy(){this.registeredListeners.clear()}},sh=class extends ih{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=Ls.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(t){"function"==typeof t&&(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 null!=this.dataSourceCallback}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(t){return R(t=>this.fetch(t),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return R((t,e)=>{this.debug(`DataService - dispatching 'data-load' | ${t}`),this.dispatch("data-load",{type:"data-load",data:e})},t,{leading:!0,trailing:!0})}fetch(t){return S(this,null,function*(){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const e=performance.now(),i=this.requestCounter++;let s;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);try{s=yield this.dataSourceCallback(t),this.debug(`DataService - response | ${performance.now()-e}ms | ${i}`)}catch(t){this.debug(`DataService - request failed | ${i}`),E.errorOnce(`DataService - request failed | [${t}]`)}this.isLoadingInitialData=!1;const n=this.freshRequests.findIndex(t=>t===i);-1===n||this.dispatchOnlyLatest&&n!==this.freshRequests.length-1?this.debug(`DataService - discarding stale request | ${i}`):(this.freshRequests=this.freshRequests.slice(n+1),0===this.freshRequests.length&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(i,s):this.dispatch("data-error"))})}};b([Xr({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],sh.prototype,"dispatchThrottle",2),b([Xr({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],sh.prototype,"requestThrottle",2);var nh=class{constructor(t){this.maxAnimationTime=t,this.debug=Ls.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Dn.map(t=>[t,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){var t;return null!=(t=this.phases.get(Dn[this.currentPhase]))?t:[]}checkOverlappingId(t){null!=t&&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){var e;if(!t.isComplete)return Dn.indexOf(t.phase)<this.currentPhase?(this.debug("Skipping animation due to being for an earlier phase",t.id),void t.stop()):(this.controllers.set(t.id,t),void(null==(e=this.phases.get(t.phase))||e.push(t)))}removeAnimation(t){this.controllers.delete(t.id);const e=this.phases.get(t.phase),i=null==e?void 0:e.indexOf(t);null!=i&&i>=0&&(null==e||e.splice(i,1))}progress(t){if(!this.isReady)return;let e=0===t?.01:t;const i=()=>{const t=Dn[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:t,phaseMeta:wn[t]}};let{phase:s,phaseControllers:n,phaseMeta:a}=i();const o=()=>null==Dn[this.currentPhase],r=()=>{for(({phase:s,phaseControllers:n,phaseMeta:a}=i());!o()&&0===n.length;)this.currentPhase++,({phase:s,phaseControllers:n,phaseMeta:a}=i()),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:e},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${t}ms; phase ${s} with ${null==n?void 0:n.length} of ${l}`);do{const t=e,i=a.skipIfNoEarlierAnimations&&0===this.animationTimeConsumed;let s=0;for(const a of n)i?a.stop():e=Math.min(a.update(t),e),a.isComplete&&(s++,this.removeAnimation(a));this.animationTimeConsumed+=t-e,this.debug(`AnimationBatch - updated ${n.length} controllers; ${s} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),r()}while(e>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(E.warnOnce("Animation batch exceeded max animation time, skipping.",new Map(this.controllers.entries())),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&&!0!==wn[e.phase].skipIfNoEarlierAnimations){t=!1;break}if(!t)for(const[,t]of this.controllers)t.autoplay&&t.play(!0)}skip(t=!0){if(!1===this.skipAnimations&&!0===t){for(const t of this.controllers.values())t.stop();this.controllers.clear()}this.skipAnimations=t}play(){for(const t of this.controllers.values())t.play()}pause(){for(const t of this.controllers.values())t.pause()}stop(){for(const t of this.controllers.values())try{t.stop(),this.removeAnimation(t)}catch(t){E.error("Error during animation stop",t)}this.dispatchStopped()}stopByAnimationId(t){if(null!=t&&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()}},ah=class{constructor(){this.listeners=new ih,this.destroyFns=[]}addListener(t,e){return this.listeners.addListener(t,e)}removeListener(t){this.listeners.removeListener(t)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(t=>t())}};function oh(t){const e=y(m({},t),{consumed:!1,consume(){var i,s;e.consumed=!0,t.sourceEvent instanceof Event?null==(i=t.sourceEvent)||i.preventDefault():null==(s=t.sourceEvent)||s.consume()}});return e}function rh(t,e,i){t.dispatchWrapHandlers(e,(t,e)=>{e.consumed||t(e)},i)}var lh=["click","dblclick","contextmenu","hover","drag-start","drag","drag-end","leave","enter","page-left","wheel"],hh=["blur","focus"],ch=["keydown","keyup"],dh=["pagehide","mousemove","mouseup"],uh=["click","dblclick","contextmenu","mousedown","mouseout","mouseenter","touchstart","touchmove","touchend","touchcancel","wheel","blur","focus","keydown","keyup"],ph=(t=>(t[t.Default=16]="Default",t[t.ZoomDrag=8]="ZoomDrag",t[t.Annotations=4]="Annotations",t[t.ContextMenu=2]="ContextMenu",t[t.Animation=1]="Animation",t[t.All=31]="All",t))(ph||{}),gh=class t extends ah{constructor(t,e){super(),this.keyboardOptions=t,this.debug=Ls.create(!0,"interaction"),this.eventHandler=t=>this.processEvent(t),this.mouseDown=!1,this.touchDown=!1,this.clickHistory=[{offsetX:NaN,offsetY:NaN,type:"mousedown"}],this.dblclickHistory=[{offsetX:NaN,offsetY:NaN,type:"mousedown"},{offsetX:NaN,offsetY:NaN,type:"mouseup"},{offsetX:NaN,offsetY:NaN,type:"mousedown"}],this.stateQueue=17,this.rootElement=vs("body"),this.element=e;for(const t of uh)t.startsWith("touch")?e.addEventListener(t,this.eventHandler,{passive:!0}):"wheel"===t?e.addEventListener(t,this.eventHandler,{passive:!1}):e.addEventListener(t,this.eventHandler);for(const t of dh)Ss().addEventListener(t,this.eventHandler);Ds("\n.ag-chart-wrapper {\n    touch-action: none;\n}\n","interactionManager")}destroy(){super.destroy();for(const t of dh)Ss().removeEventListener(t,this.eventHandler);for(const t of uh)this.element.removeEventListener(t,this.eventHandler)}addListener(t,e,i=16){return super.addListener(t,t=>{this.getState()&i&&e(t)})}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}getState(){return this.stateQueue&-this.stateQueue}processEvent(t){const e=this.decideInteractionEventTypes(t);e.length>0&&this.dispatchEvent(t,e).catch(t=>E.errorOnce(t))}dispatchEvent(t,e){return S(this,null,function*(){if(fs(lh,e))this.dispatchPointerEvent(t,e);else if(fs(hh,e))for(const i of e)rh(this.listeners,i,oh({type:i,sourceEvent:t}));else if(fs(ch,e))for(const i of e)rh(this.listeners,i,oh({type:i,sourceEvent:t}))})}dispatchPointerEvent(t,e){const i=this.calculateCoordinates(t);if(null!=i)for(const s of e)rh(this.listeners,s,this.buildPointerEvent(m({type:s,event:t},i)))}recordDown(t){t instanceof MouseEvent&&(ie(["offsetX","offsetY"],this.clickHistory[0],t),ie(["offsetX","offsetY"],this.dblclickHistory[2],this.dblclickHistory[0]),ie(["offsetX","offsetY"],this.dblclickHistory[0],t)),this.dragStartElement=t.target}recordUp(t){t instanceof MouseEvent&&ie(["offsetX","offsetY"],this.dblclickHistory[1],t),this.dragStartElement=void 0}decideInteractionEventTypes(t){const e="drag-start";switch(t.type){case"blur":case"focus":case"keydown":case"keyup":return this.keyboardOptions.enabled?[t.type]:[];case"click":case"dblclick":case"contextmenu":case"wheel":return[t.type];case"mousedown":return this.isEventOverElement(t)?(this.mouseDown=!0,this.recordDown(t),[e]):[];case"touchstart":return this.isEventOverElement(t)?(this.touchDown=!0,this.recordDown(t),[e]):[];case"touchmove":case"mousemove":return this.mouseDown||this.touchDown||this.isEventOverElement(t)?this.mouseDown||this.touchDown?["drag"]:["hover"]:[];case"mouseup":return this.mouseDown||this.isEventOverElement(t)?(this.mouseDown=!1,this.recordUp(t),["drag-end"]):[];case"touchend":return this.touchDown||this.isEventOverElement(t)?(this.touchDown=!1,this.recordUp(t),["drag-end"]):[];case"mouseout":case"touchcancel":return["leave"];case"mouseenter":const i=t instanceof MouseEvent&&!(1&~t.buttons);return this.mouseDown!==i?(this.mouseDown=i,[i?e:"drag-end"]):["enter"];case"pagehide":return["page-left"]}return[]}isEventOverElement(t){var e,i,s;return t.target===this.element||(null==(e=t.target)?void 0:e.parentElement)===this.element||(null==(s=null==(i=t.target)?void 0:i.parentElement)?void 0:s.parentElement)===this.element}calculateCoordinates(e){var i;if(e instanceof MouseEvent)return this.getMouseEventCoords(e);if("undefined"!=typeof TouchEvent&&e instanceof TouchEvent){const s=null!=(i=e.touches[0])?i:e.changedTouches[0],{clientX:n,clientY:a,pageX:o,pageY:r}=s;return y(m({},t.NULL_COORDS),{clientX:n,clientY:a,pageX:o,pageY:r})}if(e instanceof PageTransitionEvent){if(e.persisted)return;return t.NULL_COORDS}}getMouseEventCoords(t){const{clientX:e,clientY:i,pageX:s,pageY:n}=t;let{offsetX:a,offsetY:o}=t;const r=t=>{let e=0,i=0;for(;t;)e+=t.offsetLeft,i+=t.offsetTop,t=t.offsetParent;return{x:e,y:i}};if(null!=this.dragStartElement&&t.target!==this.dragStartElement){const e=r(this.dragStartElement),i=r(t.target);a-=e.x-i.x,o-=e.y-i.y}return{clientX:e,clientY:i,pageX:s,pageY:n,offsetX:a,offsetY:o}}isWheelEvent(t){return"wheel"===t.type}buildPointerEvent(t){const{type:e,event:i,clientX:s,clientY:n}=t;let{offsetX:a,offsetY:o,pageX:r,pageY:l}=t;if(!Vt(a)||!Vt(o)){const t=this.element.getBoundingClientRect();a=s-t.left,o=n-t.top}if(!Vt(r)||!Vt(l)){const t=this.rootElement.getBoundingClientRect();r=s-t.left,l=n-t.top}let[h,c]=[NaN,NaN];if(this.isWheelEvent(i)){const t=0===i.deltaMode?.01:1;h=i.deltaX*t,c=i.deltaY*t}let d=[];"click"===i.type?d=this.clickHistory:"dblclick"===i.type&&(d=this.dblclickHistory);const u=oh({type:e,offsetX:a,offsetY:o,pageX:r,pageY:l,deltaX:h,deltaY:c,pointerHistory:d,sourceEvent:i});return this.debug("InteractionManager - builtEvent: ",u),u}};gh.NULL_COORDS={clientX:-1/0,clientY:-1/0,pageX:-1/0,pageY:-1/0,offsetX:-1/0,offsetY:-1/0};var mh=gh;function yh(t){return null==t||!isNaN(t)&&t>=0&&t<=2}var fh=class extends ah{constructor(t,e){super(),this.interactionManager=t,this.chartUpdateMutex=e,this.defaultDuration=1e3,this.batch=new nh(1.5*this.defaultDuration),this.debug=Ls.create(!0,"animation"),this.rafAvailable="undefined"!=typeof requestAnimationFrame,this.isPlaying=!1,this.requestId=null,this.skipAnimations=!1}animate(t){var e,i=f(t,[]);const s=this.batch;try{s.checkOverlappingId(i.id)}catch(t){return void this.failsafeOnError(t)}const n=null!=(e=i.id)?e:Math.random().toString(),a=this.isSkipped()||"none"===i.phase;a&&this.debug("AnimationManager - skipping animation");const{delay:o,duration:r}=i;if(!yh(o))throw new Error(`Animation delay of ${o} is unsupported (${n})`);if(!yh(r))throw new Error(`Animation duration of ${r} is unsupported (${n})`);const l=new Ln(y(m({},i),{id:n,skip:a,autoplay:!!this.isPlaying&&i.autoplay,phase:i.phase,defaultDuration:this.defaultDuration}));if(!this.forceTimeJump(l,this.defaultDuration))return this.batch.addAnimation(l),l}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(t){this.failsafeOnError(t)}this.requestAnimation()}}pause(){if(this.isPlaying){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.pause()");try{this.batch.pause()}catch(t){this.failsafeOnError(t)}}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(t){try{this.batch.stopByAnimationId(t)}catch(t){this.failsafeOnError(t)}}stopByAnimationGroupId(t){try{this.batch.stopByAnimationGroupId(t)}catch(t){this.failsafeOnError(t)}}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=requestAnimationFrame(t)}forceTimeJump(t,e){return!1}requestAnimation(){if(!this.rafAvailable)return;if(!this.batch.isActive()||null!==this.requestId)return;let t;const e=i=>S(this,null,function*(){const s=()=>S(this,null,function*(){const e=i-(null!=t?t:i);t=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:e}),this.interactionManager.pushState(1);try{this.batch.progress(e)}catch(t){this.failsafeOnError(t)}this.listeners.dispatch("animation-frame",{type:"animation-frame",deltaMs:e})});this.isSkippingFrames()?yield this.chartUpdateMutex.acquireImmediately(s):yield this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(e):(this.batch.stop(),this.listeners.dispatch("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))});this.listeners.dispatch("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(e)}cancelAnimation(){null!==this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(t,e=!0){E.error("Error during animation, skipping animations",t),e&&this.cancelAnimation()}startBatch(t){this.debug(`AnimationManager - startBatch() with skipAnimations=${t}.`),this.reset(),this.batch.stop(),this.batch.destroy(),this.batch=new nh(1.5*this.defaultDuration),!0===t&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(1),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(t){this.batch.stoppedCbs.add(t)}},xh=class t{constructor(e){this.canvas=e,this.debug=Ls.create(!0,"aria"),this.canvas.appendChild(this.liveElem=t.createAnnouncer())}static createAnnouncer(){const t=vs().createElement("div");return t.classList.add("ag-charts-aria-announcer"),qr(t,"role","status"),qr(t,"aria-live","assertive"),t}destroy(){this.canvas.removeChild(this.liveElem)}announceValue(t){this.debug(`AriaAnnouncementService - announceValue: ${t}`),this.liveElem.textContent=t}},bh=class extends ah{legendItemClick(t,e,i,s){const n={type:"legend-item-click",series:t,itemId:e,enabled:i,legendItemName:s};this.listeners.dispatch("legend-item-click",n)}legendItemDoubleClick(t,e,i,s,n){const a={type:"legend-item-double-click",series:t,itemId:e,enabled:i,legendItemName:n,numVisibleItems:s};this.listeners.dispatch("legend-item-double-click",a)}axisHover(t,e){const i={type:"axis-hover",axisId:t,direction:e};this.listeners.dispatch("axis-hover",i)}},vh=class{constructor(){this.defaultActions=[],this.disabledActions=new Set}copyDefaultActions(){return[...this.defaultActions]}registerDefaultAction(t){t.id&&this.defaultActions.find(({id:e})=>e===t.id)||this.defaultActions.push(t)}enableAction(t){this.disabledActions.delete(t)}disableAction(t){this.disabledActions.add(t)}isDisabled(t){return this.disabledActions.has(t)}},Sh=class extends Map{constructor(t,e){super(),this.defaultValue=t,this.defaultState=e}set(t,e){return this.delete(t),void 0!==e&&super.set(t,e),this}stateId(){var t;return null!=(t=Array.from(this.keys()).pop())?t:this.defaultState}stateValue(){var t;return null!=(t=Array.from(this.values()).pop())?t:this.defaultValue}},Mh=class{constructor(t){this.element=t,this.stateTracker=new Sh("default")}updateCursor(t,e){this.stateTracker.set(t,e),this.element.style.cursor=this.stateTracker.stateValue()}getCursor(){return this.element.style.cursor}};function kh(t,e){return Math.sqrt(function(t,e){const i=t.screenX-e.screenX,s=t.screenY-e.screenY;return i*i+s*s}(t,e))}var Dh=class extends ah{constructor(t){super(),this.touchstart=t=>this.onTouchStart(t),this.touchmove=t=>this.onTouchMove(t),this.touchend=t=>this.onTouchEnd(t),this.touchcancel=t=>this.onTouchCancel(t),this.pinch={finger1:{identifier:NaN,screenX:NaN,screenY:NaN},finger2:{identifier:NaN,screenX:NaN,screenY:NaN},origin:{x:NaN,y:NaN},distance:NaN,status:0},this.element=t,t.addEventListener("touchstart",this.touchstart,{passive:!0}),t.addEventListener("touchmove",this.touchmove,{passive:!0}),t.addEventListener("touchend",this.touchend),t.addEventListener("touchcancel",this.touchcancel)}destroy(){const{element:t}=this;t.removeEventListener("touchstart",this.touchstart),t.removeEventListener("touchmove",this.touchmove),t.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.touchcancel)}findPinchTouches(t){const{touches:e}=t,{finger1:i,finger2:s}=this.pinch;if(0!==this.pinch.status&&2===e.length){if(e[0].identifier===i.identifier&&e[1].identifier===s.identifier)return[e[0],e[1]];if(e[0].identifier===s.identifier&&e[1].identifier===i.identifier)return[e[1],e[0]]}}copyTouchData(t){const e=["identifier","screenX","screenY"];ie(e,this.pinch.finger1,t.touches[0]),ie(e,this.pinch.finger2,t.touches[1]),this.pinch.distance=kh(this.pinch.finger1,this.pinch.finger2)}dispatchPinchEvent(t,e){const{finger1:i,finger2:s,origin:n}=this.pinch,a={type:t,finger1:i,finger2:s,deltaDistance:e,origin:n};this.listeners.dispatch(t,a)}onTouchStart(t){this.stopPinchTracking();const{pinch:e}=this;2===t.touches.length&&(e.status=1,this.copyTouchData(t),e.origin.x=(t.touches[0].clientX+t.touches[1].clientX)/2,e.origin.y=(t.touches[0].clientY+t.touches[1].clientY)/2)}onTouchMove(t){const e=this.findPinchTouches(t);if(void 0!==e){const[i,s]=e,{pinch:n}=this,a=kh(i,s),o=a-n.distance;1===n.status?Math.abs(o)>1&&(n.status=2,this.copyTouchData(t),this.dispatchPinchEvent("pinch-start",0)):2===n.status?(n.distance=a,this.copyTouchData(t),this.dispatchPinchEvent("pinch-move",o)):E.error(`unexpected pinch.status: ${n.status}`)}}onTouchEnd(t){this.stopPinchTracking()}onTouchCancel(t){this.stopPinchTracking()}stopPinchTracking(){const{pinch:t}=this;2===t.status&&this.dispatchPinchEvent("pinch-end",0),this.pinch.status=0}},wh=class extends ah{constructor(){super(...arguments),this.highlightStates=new Sh,this.pickedStates=new Sh}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})}getActiveHighlight(){return this.activeHighlight}updatePicked(t,e){this.pickedStates.set(t,e),this.activePicked=this.pickedStates.stateValue()}getActivePicked(){return this.activePicked}isEqual(t,e){return t===e||(null==t?void 0:t.series)===(null==e?void 0:e.series)&&(null==t?void 0:t.itemId)===(null==e?void 0:e.itemId)&&(null==t?void 0:t.datum)===(null==e?void 0:e.datum)}},Ih=class extends ah{constructor(t){super(),this.hasBrowserFocus=!1,this.isMouseBlurred=!1,this.isClicking=!1,this.destroyFns.push(t.addListener("drag-start",t=>this.onClickStart(t),31),t.addListener("click",t=>this.onClickStop(t),31),t.addListener("drag-end",t=>this.onClickStop(t),31),t.addListener("wheel",t=>this.mouseBlur(t)),t.addListener("hover",t=>this.mouseBlur(t)),t.addListener("drag",t=>this.mouseBlur(t)),t.addListener("blur",t=>this.onBlur(t),31),t.addListener("focus",t=>this.onFocus(t),31),t.addListener("keydown",t=>this.onKeyDown(t),31))}destroy(){super.destroy()}onClickStart(t){this.isClicking=!0,this.mouseBlur(t)}onClickStop(t){this.isClicking=!1,this.mouseBlur(t)}mouseBlur(t){this.hasBrowserFocus&&(this.isMouseBlurred||(this.dispatch("blur",0,t),this.isMouseBlurred=!0))}onBlur(t){this.hasBrowserFocus=!1,this.isMouseBlurred=!1,this.dispatch("blur",0,t)}onFocus(t){this.hasBrowserFocus=!0,this.isClicking?this.isMouseBlurred=!0:(this.dispatch("browserfocus",1,t),this.dispatch("tab",0,t))}onKeyDown(t){if(this.hasBrowserFocus&&!this.isClicking)switch(this.isMouseBlurred=!1,t.sourceEvent.code){case"Tab":return t.sourceEvent.shiftKey?this.dispatch("tab",-1,t):this.dispatch("tab",1,t);case"ArrowDown":return this.dispatch("nav-vert",1,t);case"ArrowUp":return this.dispatch("nav-vert",-1,t);case"ArrowLeft":return this.dispatch("nav-hori",-1,t);case"ArrowRight":return this.dispatch("nav-hori",1,t);case"Space":case"Enter":return this.dispatch("submit",0,t)}}dispatch(t,e,i){const s=oh({type:t,delta:e,sourceEvent:i});rh(this.listeners,t,s)}},Ch={};x(Ch,{block:()=>Lh,css:()=>Nh,elements:()=>Ah,modifiers:()=>Th});var Lh="ag-charts-focus",Ah={wrapper:`${Lh}__wrapper`,indicator:`${Lh}__indicator`},Th={hidden:`${Lh}--hidden`},Nh=`\n.${Lh}.${Ah.wrapper} {\n    position: relative;\n    display: block;\n    pointer-events: none;\n    user-select: none;\n    overflow: hidden;\n    top: 0;\n    left: 0;\n}\n\n.${Lh}.${Ah.indicator} {\n    position: absolute;\n    display: block;\n    pointer-events: none;\n    user-select: none;\n    border: var(--ag-charts-focus-border);\n    box-shadow: var(--ag-charts-focus-border-shadow);\n}\n\n.${Th.hidden} {\n    visibility: hidden;\n}\n`,Oh=["series","legend"],Rh=class extends ih{},Eh=class{constructor(t,e,i,s){this.interactionManager=t,this.keyNavManager=e,this.canvasElement=i,this.currentTabIndex=0,this.isDragging=!1,this.leftCanvas=!1,this.regions=new Map,this.destroyFns=[],this.destroyFns.push(...lh.map(e=>t.addListener(e,this.processPointerEvent.bind(this),31)),this.keyNavManager.addListener("blur",this.onNav.bind(this)),this.keyNavManager.addListener("browserfocus",this.onFocus.bind(this)),this.keyNavManager.addListener("tab",this.onTab.bind(this)),this.keyNavManager.addListener("nav-vert",this.onNav.bind(this)),this.keyNavManager.addListener("nav-hori",this.onNav.bind(this)),this.keyNavManager.addListener("submit",this.onNav.bind(this))),Ds(Nh,Lh),this.focusWrapper=vs().createElement("div"),this.focusIndicator=vs().createElement("div"),this.focusWrapper.appendChild(this.focusIndicator),s.appendChild(this.focusWrapper);const{block:n,elements:a,modifiers:o}=Ch;this.focusWrapper.classList.add(n,a.wrapper),this.focusIndicator.classList.add(n,a.indicator,o.hidden)}destroy(){this.destroyFns.forEach(t=>t()),this.currentRegion=void 0;for(const t of this.regions.values())t.listeners.destroy();this.focusWrapper.remove(),this.regions.clear()}addRegionFromProperties(t){const e={properties:t,listeners:new Rh};return this.regions.set(t.name,e),this.makeObserver(e)}addRegion(t,e,...i){return this.addRegionFromProperties({name:t,bboxproviders:[e,...i],canInteraction:()=>!0})}getRegion(t){return this.makeObserver(this.regions.get(t))}find(t,e){const i=[];for(const[s,n]of this.regions.entries())for(const s of n.properties.bboxproviders){const a=s.getCachedBBox();a.containsPoint(t,e)&&i.push([n,a.width*a.height])}return i.sort((t,e)=>t[1]-e[1]).map(t=>t[0])}makeObserver(t){const{interactionManager:e}=this;return new class{addListener(i,s,n=16){var a;return null!=(a=null==t?void 0:t.listeners.addListener(i,t=>{t.consumed||e.getState()&n&&s(t)}))?a:()=>{}}}}checkPointerHistory(t,e){for(const i of e.pointerHistory){const e=this.pickRegion(i.offsetX,i.offsetY);if(t.properties.name!==(null==e?void 0:e.properties.name))return!1}return!0}dispatch(t,e){null==t||t.listeners.dispatch(e.type,e)}handleDragging(t){const{currentRegion:e}=this;switch(t.type){case"drag-start":this.isDragging=!0,this.leftCanvas=!1;break;case"leave":return this.leftCanvas=!0,this.isDragging;case"enter":return this.leftCanvas=!1,this.isDragging;case"drag":if(this.isDragging)return this.dispatch(e,t),!0;break;case"drag-end":if(this.isDragging)return this.isDragging=!1,this.dispatch(e,t),this.leftCanvas&&this.dispatch(e,y(m({},t),{type:"leave"})),!0}return!1}processPointerEvent(t){if(this.handleDragging(t))return;const{currentRegion:e}=this,i=this.pickRegion(t.offsetX,t.offsetY);void 0!==e&&(null==i?void 0:i.properties.name)!==e.properties.name&&this.dispatch(e,y(m({},t),{type:"leave"})),void 0!==i&&i.properties.name!==(null==e?void 0:e.properties.name)&&this.dispatch(i,y(m({},t),{type:"enter"})),void 0!==i&&this.checkPointerHistory(i,t)&&this.dispatch(i,t),this.currentRegion=i}pickRegion(t,e){const i=this.find(t,e);return i.length>0?i[0]:void 0}getTabRegion(t){if(void 0!==t&&t>=0&&t<Oh.length)return this.regions.get(Oh[t])}dispatchTabStart(t){const{delta:e,sourceEvent:i}=t,s=oh({type:"tab-start",delta:e,sourceEvent:i}),n=this.getTabRegion(this.currentTabIndex);return this.dispatch(n,s),!!s.consumed}getNextInteractableTabIndex(t,e){const i=e<0?-1:1;let s=t;for(;0!==e;){const t=this.getTabRegion(s+i);if(void 0===t)return;t.properties.canInteraction()&&(e-=i),s+=i}return s}validateCurrentTabIndex(){var t;const e=this.getTabRegion(this.currentTabIndex);void 0===e||e.properties.canInteraction()||(this.currentTabIndex=null!=(t=this.getNextInteractableTabIndex(-1,1))?t:0)}onFocus(t){const{delta:e,sourceEvent:i}=t,s=e>0?this.getNextInteractableTabIndex(-1,1):this.getNextInteractableTabIndex(Oh.length,-1);this.currentTabIndex=null!=s?s:0;const n=this.getTabRegion(this.currentTabIndex);n&&this.dispatch(n,oh({type:"tab",delta:e,sourceEvent:i}))}onTab(t){if(this.dispatchTabStart(t))return;this.validateCurrentTabIndex();const e=this.getNextInteractableTabIndex(this.currentTabIndex,t.delta),i=this.getTabRegion(e),s=this.getTabRegion(this.currentTabIndex);if(void 0!==e&&(this.currentTabIndex=e),void 0!==s&&(null==i?void 0:i.properties.name)!==s.properties.name){const{delta:e,sourceEvent:i}=t,n=oh({type:"blur",delta:e,sourceEvent:i});this.dispatch(s,n)}void 0!==i&&i.properties.canInteraction()?this.dispatch(i,t):this.updateFocusIndicatorRect(void 0)}onNav(t){const e=this.getTabRegion(this.currentTabIndex);this.dispatch(e,t)}updateFocusWrapperRect(){this.focusWrapper.style.width=this.canvasElement.style.width,this.focusWrapper.style.height=this.canvasElement.style.height}updateFocusIndicatorRect(t){null!=t?(this.updateFocusWrapperRect(),this.focusIndicator.classList.remove(Th.hidden),this.focusIndicator.style.width=`${t.width}px`,this.focusIndicator.style.height=`${t.height}px`,this.focusIndicator.style.left=`${t.x}px`,this.focusIndicator.style.top=`${t.y}px`):this.focusIndicator.classList.add(Th.hidden)}},Ph=class extends ah{constructor(t){super(),this.element=t}static isGroup(t,e){return e.group===t}pressButton(t,e){this.listeners.dispatch("button-pressed",{type:"button-pressed",group:t,value:e})}toggleGroup(t,e){this.listeners.dispatch("group-toggled",{type:"group-toggled",group:t,visible:e})}toggleButton(t,e,i){this.listeners.dispatch("button-toggled",{type:"button-toggled",group:t,value:e,enabled:i})}proxyGroupOptions(t,e){this.listeners.dispatch("proxy-group-options",{type:"proxy-group-options",group:t,options:e})}},Bh=`\n.${Jr} {\n    transition: transform 0.1s ease;\n    max-width: 100%;\n    position: fixed;\n    left: 0px;\n    top: 0px;\n    z-index: 99999;\n    font: 12px Verdana, sans-serif;\n    color: rgb(70, 70, 70);\n    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);\n}\n\n.${Jr}-wrap-always {\n    overflow-wrap: break-word;\n    word-break: break-word;\n    hyphens: none;\n}\n\n.${Jr}-wrap-hyphenate {\n    overflow-wrap: break-word;\n    word-break: break-word;\n    hyphens: auto;\n}\n\n.${Jr}-wrap-on-space {\n    overflow-wrap: normal;\n    word-break: normal;\n}\n\n.${Jr}-wrap-never {\n    white-space: pre;\n    text-overflow: ellipsis;\n}\n\n.${Jr}-no-interaction {\n    pointer-events: none;\n    user-select: none;\n}\n\n.${Jr}-no-animation {\n    transition: none !important;\n}\n\n.${Jr}-hidden {\n    visibility: hidden;\n}\n\n.${Jr}-title {\n    overflow: hidden;\n    position: relative;\n    padding: 8px 14px;\n    border-top-left-radius: 2px;\n    border-top-right-radius: 2px;\n    color: white;\n    background-color: #888888;\n    z-index: 1;\n    text-overflow: inherit;\n}\n\n.${Jr}-title:only-child {\n    border-bottom-left-radius: 2px;\n    border-bottom-right-radius: 2px;\n}\n\n.${Jr}-content {\n    overflow: hidden;\n    padding: 6px 14px;\n    line-height: 1.7em;\n    background: white;\n    border-bottom-left-radius: 2px;\n    border-bottom-right-radius: 2px;\n    border: 1px solid rgba(0, 0, 0, 0.15);\n    overflow: hidden;\n    text-overflow: inherit;\n}\n\n.${Jr}-arrow::before {\n    content: "";\n\n    position: absolute;\n    top: 100%;\n    left: 50%;\n    transform: translateX(-50%);\n\n    border: 5px solid #d9d9d9;\n\n    border-left-color: transparent;\n    border-right-color: transparent;\n    border-bottom-color: transparent;\n\n    width: 0;\n    height: 0;\n\n    margin: 0 auto;\n}\n\n.${Jr}-arrow::after {\n    content: "";\n\n    position: absolute;\n    top: calc(100% - 1px);\n    left: 50%;\n    transform: translateX(-50%);\n\n    border: 5px solid white;\n\n    border-left-color: transparent;\n    border-right-color: transparent;\n    border-bottom-color: transparent;\n\n    width: 0;\n    height: 0;\n\n    margin: 0 auto;\n}\n\n.ag-chart-wrapper {\n    box-sizing: border-box;\n    overflow: hidden;\n}\n`,Fh=class{constructor(t,e){if(this.canvasElement=t,this.tooltip=e,this.stateTracker=new Sh,this.appliedState=null,"undefined"!=typeof IntersectionObserver){const t=new IntersectionObserver(t=>{for(const e of t)e.target===this.canvasElement&&0===e.intersectionRatio&&this.tooltip.toggle(!1)},{root:this.tooltip.root});t.observe(this.canvasElement),this.observer=t}Ds(Bh,"tooltip")}updateTooltip(t,e,i){var s;this.tooltip.enabled&&(null!=i||(i=null==(s=this.stateTracker.get(t))?void 0:s.content),this.stateTracker.set(t,{content:i,meta:e}),this.applyStates())}removeTooltip(t){this.tooltip.enabled&&(this.stateTracker.delete(t),this.applyStates())}getTooltipMeta(t){var e;return null==(e=this.stateTracker.get(t))?void 0:e.meta}destroy(){var t;null==(t=this.observer)||t.unobserve(this.canvasElement)}applyStates(){var t;const e=this.stateTracker.stateId(),i=e?this.stateTracker.get(e):null;if(null==(null==i?void 0:i.meta)||null==(null==i?void 0:i.content))return this.appliedState=null,void this.tooltip.toggle(!1);const s=this.canvasElement.getBoundingClientRect();if((null==(t=this.appliedState)?void 0:t.content)===(null==i?void 0:i.content)){const t=this.tooltip.isVisible();this.tooltip.show(s,null==i?void 0:i.meta,null,t)}else this.tooltip.show(s,null==i?void 0:i.meta,null==i?void 0:i.content);this.appliedState=i}static makeTooltipMeta(t,e){var i,s,n,a,o,r,l;const{offsetX:h,offsetY:c}=t,{tooltip:d}=e.series.properties,u={offsetX:h,offsetY:c,enableInteraction:null!=(s=null==(i=d.interaction)?void 0:i.enabled)&&s,lastPointerEvent:{type:t.type,offsetX:h,offsetY:c},showArrow:d.showArrow,position:{type:d.position.type,xOffset:d.position.xOffset,yOffset:d.position.yOffset}},p=null!=(l=null!=(a=null==(n=e.yBar)?void 0:n.upperPoint)?a:e.midPoint)?l:null==(r=(o=e.series).datumMidPoint)?void 0:r.call(o,e);if("node"===d.position.type&&p){const{x:t,y:i}=p,s=e.series.contentGroup.inverseTransformPoint(t,i);return y(m({},u),{offsetX:Math.round(s.x),offsetY:Math.round(s.y)})}return u}},zh=class extends ih{constructor(){super(...arguments),this.layoutComplete="layout-complete"}addListener(t,e){if(this.isLayoutStage(t)||this.isLayoutComplete(t))return super.addListener(t,e);throw new Error(`AG Charts - unsupported listener type: ${t}`)}dispatchPerformLayout(t,e){return this.isLayoutStage(t)?this.getListenersByType(t).reduce((t,e)=>{try{return e.handler(t)}catch(e){return E.errorOnce(e),t}},e):e}dispatchLayoutComplete(t){this.dispatch(this.layoutComplete,t)}isLayoutStage(t){return t!==this.layoutComplete}isLayoutComplete(t){return t===this.layoutComplete}},Gh=class{constructor(){this.groups={}}registerSeries({id:t,seriesGrouping:e,visible:i,type:s}){var n;e&&(null!=(n=this.groups)[s]||(n[s]={}),this.groups[s][t]={grouping:e,visible:i})}deregisterSeries({id:t,type:e}){this.groups[e]&&delete this.groups[e][t],this.groups[e]&&0===Object.keys(this.groups[e]).length&&delete this.groups[e]}getVisiblePeerGroupIndex({type:t,seriesGrouping:e,visible:i}){var s;if(!e)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const n=new Set,a=new Set;for(const i of Object.values(null!=(s=this.groups[t])?s:{}))i.visible&&(n.add(i.grouping.groupIndex),i.grouping.groupIndex===e.groupIndex&&a.add(i.grouping.stackIndex));const o=Array.from(n);return o.sort((t,e)=>t-e),{visibleGroupCount:o.length,visibleSameStackCount:a.size,index:o.indexOf(e.groupIndex)}}},_h=(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.TOOLTIP_RECALCULATION=5]="TOOLTIP_RECALCULATION",t[t.SCENE_RENDER=6]="SCENE_RENDER",t[t.NONE=7]="NONE",t))(_h||{}),jh=class extends ih{constructor(t){super(),this.updateCallback=t}update(t=0,e){this.updateCallback(t,e)}dispatchUpdateComplete(t){this.dispatch("update-complete",{type:"update-complete",minRect:null==t?void 0:t.minRect,minVisibleRect:null==t?void 0:t.minVisibleRect})}},Wh=class{constructor(t,e){const{scene:i,syncManager:s,element:n,updateCallback:a,updateMutex:o}=e;this.chartService=t,this.scene=i,this.syncManager=s,this.zoomManager=t.zoomManager,this.annotationManager=new eh(t.annotationRoot),this.ariaAnnouncementService=new xh(i.canvas.element),this.chartEventManager=new bh,this.contextMenuRegistry=new vh,this.cursorManager=new Mh(n),this.highlightManager=new wh,this.interactionManager=new mh(t.keyboard,n),this.keyNavManager=new Ih(this.interactionManager),this.regionManager=new Eh(this.interactionManager,this.keyNavManager,this.scene.canvas.element,n),this.toolbarManager=new Ph(n),this.gestureDetector=new Dh(n),this.layoutService=new zh,this.updateService=new jh(a),this.seriesStateManager=new Gh,this.callbackCache=new th,this.animationManager=new fh(this.interactionManager,o),this.animationManager.skip(),this.animationManager.play(),this.dataService=new sh(this.animationManager),this.tooltipManager=new Fh(this.scene.canvas.element,t.tooltip)}destroy(){this.tooltipManager.destroy(),this.regionManager.destroy(),this.keyNavManager.destroy(),this.interactionManager.destroy(),this.animationManager.stop(),this.animationManager.destroy(),this.ariaAnnouncementService.destroy(),this.chartEventManager.destroy(),this.highlightManager.destroy(),this.callbackCache.invalidateCache(),this.animationManager.reset(),this.syncManager.destroy()}},Vh=class extends fe{constructor(){super(...arguments),this.range="tooltip"}};b([$n(Ba(["tooltip","node"],"a range"))],Vh.prototype,"range",2);var Kh=class t{constructor(){this.domain=new Set}static is(e){return e instanceof t}extend(t){this.domain.add(t)}getDomain(){return Array.from(this.domain)}},Yh=class t{constructor(){this.domain=[1/0,-1/0]}static is(e){return e instanceof t}static extendDomain(t,e=[1/0,-1/0]){for(const i of t)"number"==typeof i&&(e[0]>i&&(e[0]=i),e[1]<i&&(e[1]=i));return e}extend(t){this.domain[0]>t&&(this.domain[0]=t),this.domain[1]<t&&(this.domain[1]=t)}getDomain(){return[...this.domain]}};function $h(t){return t.map(t=>zt(t)?JSON.stringify(t):t).join("-")}function Hh(t){const e=1e4;return Number.isInteger(t)?t:Math.abs(t)>e?Math.trunc(t):Math.round(t*e)/e}function Uh(t,e){var i;const s=function(t){if(null==t)return[];let[e,i]=t.map(Number);return 0===e&&0===i?[0,1]:e===1/0&&i===-1/0?[]:(e===1/0?e=0:i===-1/0&&(i=0),Vt(e)&&Vt(i)?[e,i]:[])}(t);if(0===s.length)return s;let[n,a]=s;if(n===a){const[t,s]=null!=(i=null==e?void 0:e.calculatePadding(n,a))?i:[1,1];n-=t,a+=s}return[n,a]}function Xh(t,e){var i;return null!=(i=null==e?void 0:e.get(t.id))?i:0}var Zh=Symbol("invalid"),qh=class{constructor(t,e="standalone"){this.opts=t,this.mode=e,this.debug=Ls.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let i=!0;for(const e of t.props){if("key"===e.type&&!i)throw new Error("AG Charts - internal config error: keys must come before values.");"value"===e.type&&i&&(i=!1)}const s=({matchGroupIds:t=[]})=>{for(const e of t)if(this.values.every(t=>t.groupId!==e))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${e}).`)};for(const e of t.props)switch(e.type){case"key":this.keys.push(y(m({},e),{index:this.keys.length,missing:new Map}));break;case"value":if(null==e.property)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(e)}`);this.values.push(y(m({},e),{index:this.values.length,missing:new Map}));break;case"aggregate":s(e),this.aggregates.push(y(m({},e),{index:this.aggregates.length}));break;case"group-value-processor":s(e),this.groupProcessors.push(y(m({},e),{index:this.groupProcessors.length}));break;case"property-value-processor":this.propertyProcessors.push(y(m({},e),{index:this.propertyProcessors.length}));break;case"reducer":this.reducers.push(y(m({},e),{index:this.reducers.length}));break;case"processor":this.processors.push(y(m({},e),{index:this.processors.length}))}}resolveProcessedDataDefById(t,e){var i;const s=null==(i=this.scopeCache.get(t.id))?void 0:i.get(e);if(!s)throw new Error(`AG Charts - didn't find property definition for [${e}, ${t.id}]`);return{index:s.index,def:s}}resolveProcessedDataIndexById(t,e){return this.resolveProcessedDataDefById(t,e).index}resolveProcessedDataDefsByIds(t,e){return e.map(e=>[e,this.resolveProcessedDataDefById(t,e)])}resolveProcessedDataDefsValues(t,{keys:e,values:i}){const s={};for(const[n,{index:a,def:o}]of t){const t="key"===o.type?e:i;s[n]=t[a]}return s}getDomain(t,e,i="value",s){var n;const a=this.getDomainsByType(i,s);return null!=(n=null==a?void 0:a[this.resolveProcessedDataIndexById(t,e)])?n:[]}getDomainsByType(t,e){switch(t){case"key":return e.domain.keys;case"value":return e.domain.values;case"aggregate":return e.domain.aggValues;case"group-value-processor":return e.domain.groups;default:return null}}processData(t,e){var i;const{opts:{groupByKeys:s,groupByFn:n},aggregates:a,groupProcessors:o,reducers:r,processors:l,propertyProcessors:h}=this,c=performance.now();if(s&&0===this.keys.length)return;let d=this.extractData(t,e);if(s?d=this.groupData(d):n&&(d=this.groupData(d,n(d))),o.length>0&&this.postProcessGroups(d),a.length>0&&this.aggregateData(d),h.length>0&&this.postProcessProperties(d),r.length>0&&this.reduceData(d),l.length>0&&this.postProcessData(d),t.length>0)for(const e of O(this.keys,this.values))for(const[i,s]of e.missing)if(s>=t.length){const t=null==i?"":` for ${i}`;E.warnOnce(`the key '${e.property}' was not found in any data element${t}.`)}const u=performance.now();d.time=u-c,this.debug.check()&&function(t){var e,i;const s=(t,e)=>{e.length>0&&(E.log(`DataModel.processData() - ${t}`),E.table(e))};E.log("DataModel.processData() - processedData",t),s("Key Domains",t.domain.keys),s("Group Domains",null!=(e=t.domain.groups)?e:[]),s("Value Domains",t.domain.values),s("Aggregate Domains",null!=(i=t.domain.aggValues)?i:[]),"grouped"===t.type?s("Values",t.data.reduce((t,e)=>{var i,s;const n=null!=(i=e.keys)?i:[],a=null!=(s=e.aggValues)?s:[],o=e.keys.map(()=>{}),r=null==a?void 0:a.map(()=>{});return t.push(...e.values.map((t,e)=>[...0===e?n:o,...null!=t?t:[],...0==e?a:r])),t},[])):s("Values",t.data.reduce((t,e)=>{var i;const s=null!=(i=e.aggValues)?i:[];return t.push([...e.keys,...e.values,...s]),t},[]))}(d),this.scopeCache.clear();for(const t of O(this.keys,this.values,this.aggregates))if(t.idsMap)for(const[e,s]of t.idsMap)for(const n of s)if(this.scopeCache.has(e)){if(null==(i=this.scopeCache.get(e))?void 0:i.has(n))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(e).set(n,t)}else this.scopeCache.set(e,new Map([[n,t]]));return d}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=null==t||0===t.length,s="string"==typeof e?e:e.id,n=this.values.findIndex(e=>(null==e.scopes||i&&!e.scopes.length||e.scopes.some(e=>null==t?void 0:t.includes(e)))&&(e.property===s||e.id===s||(e=>{if(e.idsMap)for(const[i,n]of e.idsMap)if((null==t?void 0:t.includes(i))&&n.has(s))return!0;return!1})(e)));if(-1===n)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(e)} in scope(s) ${JSON.stringify(t)}`);return n}extractData(t,e){var i,s,n;const{dataDomain:a,processValue:o,scopes:r,allScopesHaveSameDefs:l}=this.initDataDomainProcessor(),h=new Map(null==e?void 0:e.map(t=>[t.id,t])),{keys:c,values:d}=this,u=new Array(t.length);let p=0,g=0;for(const[e,a]of t.entries()){const t={},y=r.size>0?new Set(r):void 0,f=new Array(c.length);let x,b=0;for(const t of c){if(x=o(t,a,x),x===Zh)break;f&&(f[b++]=x)}if(x===Zh)continue;const v=d.length>0?new Array(d.length):void 0;let S;for(const[c,u]of d.entries()){for(const n of null!=(i=u.scopes)?i:r){const i=h.get(n);if(S=o(u,null!=(s=null==i?void 0:i.data[e])?s:a,S,n),S!==Zh&&v){if(null!=i&&!1!==u.includeProperty){const e=u.includeProperty&&null!=u.id?u.id:u.property;null!=t[n]||(t[n]={}),t[n][e]=S}v[c]=S}}if(S===Zh){if(l)break;for(const t of null!=(n=u.scopes)?n:r)null==y||y.delete(t);if(0===(null==y?void 0:y.size))break}}if(S===Zh&&l)continue;if(0===(null==y?void 0:y.size))continue;const M={datum:m(m({},a),t),keys:f,values:v};!l&&y&&y.size<r.size&&(g++,M.validScopes=new Set(y)),u[p++]=M}u.length=p;const y=t=>{const e=a.get(t),i=e.getDomain();return Yh.is(e)&&i[0]>i[1]?[]:i};return{type:"ungrouped",input:{count:t.length},data:u,domain:{keys:c.map(y),values:d.map(y)},defs:{allScopesHaveSameDefs:l,keys:c,values:d},partialValidDataCount:g,time:0}}groupData(t,e){var i;const s=new Map;for(const n of t.data){const{keys:t,values:a,datum:o,validScopes:r}=n,l=null!=(i=null==e?void 0:e(n))?i:t,h=$h(l);if(s.has(h)){const t=s.get(h);if(t.values.push(a),t.datum.push(o),null!=r&&null!=t.validScopes)for(const e of t.validScopes)r.has(e)||t.validScopes.delete(e)}else s.set(h,{keys:l,values:[a],datum:[o],validScopes:r})}const n=new Array(s.size),a=new Array(s.size);let o=0;for(const{keys:t,values:e,datum:i,validScopes:r}of s.values())0!==(null==r?void 0:r.size)&&(a[o]=t,n[o++]={keys:t,values:e,datum:i,validScopes:r});return y(m({},t),{type:"grouped",data:n,domain:y(m({},t.domain),{groups:a})})}aggregateData(t){var e,i,s,n,a,o;const r="ungrouped"===t.type;t.domain.aggValues=[];for(const[l,h]of this.aggregates.entries()){const c=this.valueGroupIdxLookup(h),d=[1/0,-1/0];for(const u of t.data){if(null!=u.aggValues||(u.aggValues=new Array(this.aggregates.length)),u.validScopes)continue;const t=r?[u.values]:u.values;let p=null!=(i=null==(e=h.groupAggregateFunction)?void 0:e.call(h))?i:[1/0,-1/0];for(const e of t){const t=c.map(t=>e[t]),i=h.aggregateFunction(t,u.keys);i&&(p=null!=(n=null==(s=h.groupAggregateFunction)?void 0:s.call(h,i,p))?n:Yh.extendDomain(i,p))}const g=(null!=(o=null==(a=h.finalFunction)?void 0:a.call(h,p))?o:p).map(t=>Hh(t));u.aggValues[l]=g,Yh.extendDomain(g,d)}t.domain.aggValues.push(d)}}postProcessGroups(t){var e,i;const{groupProcessors:s}=this,n=new Set,a=new Map,o=new Map,r=new Map;for(const t of s){const e=this.valueGroupIdxLookup(t);o.set(t,e),r.set(t,t.adjust());for(const t of e){const e="category"===this.values[t].valueType;n.add(t),a.set(t,e?new Kh:new Yh)}}const l=t=>{var e;for(const i of n)null==(e=a.get(i))||e.extend(t[i])};for(const n of t.data){for(const a of s){if(n.validScopes)continue;const s=null!=(e=o.get(a))?e:[],l=null==(i=r.get(a))?void 0:i();if(l)if("grouped"===t.type)for(const t of n.values)t&&l(t,s);else n.values&&l(n.values,s)}if("grouped"===t.type)for(const t of n.values)l(t);else l(n.values)}for(const[e,i]of a)t.domain.values[e]=i.getDomain()}postProcessProperties(t){for(const{adjust:e,property:i,scopes:s}of this.propertyProcessors)e()(t,this.valueIdxLookup(s,i))}reduceData(t){var e;null!=t.reduced||(t.reduced={});for(const i of this.reducers){const s=i.reducer();let n=i.initialValue;for(const a of t.data)a.validScopes&&!(null==(e=i.scopes)?void 0:e.some(t=>{var e;return null==(e=a.validScopes)?void 0:e.has(t)}))||(n=s(n,a));t.reduced[i.property]=n}}postProcessData(t){null!=t.reduced||(t.reduced={});for(const e of this.processors)t.reduced[e.property]=e.calculate(t)}initDataDomainProcessor(){const{keys:t,values:e}=this,i=new Set;for(const t of e)if(t.scopes)for(const e of t.scopes)i.add(e);const s=new Map,n=new Map;let a=!0;const o=()=>{var n;for(const o of O(t,e))"category"===o.valueType?s.set(o,new Kh):(s.set(o,new Yh),a&&(a=(null!=(n=o.scopes)?n:[]).length===i.size))};o();const r=this.buildAccessors(O(t,e));return{dataDomain:s,processValue:(t,e,i,a)=>{var l,h,c,d,u;let p,g;if(r.has(t.property)){try{g=r.get(t.property)(e)}catch(t){}p=null!=g}else p=t.property in e,g=p?e[t.property]:t.missingValue;if(null!=t.forceValue&&(g=p&&Ys(g)?-1*t.forceValue:t.forceValue,p=!0),!p&&!("missingValue"in t)){const e=null!=(l=t.missing.get(a))?l:0;t.missing.set(a,e+1)}if(s.has(t)||o(),p&&null!=(c=null==(h=t.validation)?void 0:h.call(t,g,e))&&!c){if(!("invalidValue"in t))return"integrated"!==this.mode&&E.warnOnce(`invalid value of type [${typeof g}] ignored:`,`[${g}]`),Zh;g=t.invalidValue}return t.processor&&(n.has(t)||n.set(t,t.processor()),g=null==(d=n.get(t))?void 0:d(g,i===Zh?void 0:i)),null==(u=s.get(t))||u.extend(g),g},initDataDomain:o,scopes:i,allScopesHaveSameDefs:a}}buildAccessors(t){const e=new Map;if("integrated"===this.mode)return e;for(const i of t){if(!i.property.includes(".")&&!i.property.includes("["))continue;let t;t=i.property.startsWith("[")?`return datum${i.property};`:`return datum.${i.property};`,e.set(i.property,new Function("datum",t))}return e}},Qh=class t{constructor(t){this.mode=t,this.debug=Ls.create(!0,"data-model"),this.requested=[],this.status="setup"}request(t,e,i){return S(this,null,function*(){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");return new Promise((s,n)=>{this.requested.push({id:t,opts:i,data:e,resolve:s,reject:n})})})}execute(){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const t=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",t);const e=this.mergeRequested(t);this.debug("DataController.execute() - merged",e),this.debug.check()&&(Ss().processedData=[]);const i=this.requested.map(({id:t})=>t),s=this.hasMultipleDataSources(t);for(const{opts:n,data:a,resolves:o,rejects:r,ids:l}of e)try{const e=new qh(n,this.mode),h=e.processData(a,t);this.debug.check()&&Ss("processedData").push(h),0===(null==h?void 0:h.partialValidDataCount)?o.forEach((t,n)=>t({dataModel:e,processedData:this.processScopedData(l[n],h,i,s)})):h?this.splitResult(e,h,l,o):r.forEach(t=>t(new Error("AG Charts - no processed data generated")))}catch(t){r.forEach(e=>e(t))}}hasMultipleDataSources(t){if(t.length){const[{data:e},...i]=t;return i.some(t=>e!==t.data)}return!1}processScopedData(t,e,i,s){const n=e=>{if(Array.isArray(e))return e.map(n);const a=s?m(m({},e),e[t]):e;for(const t of i)delete a[t];return a},a=e=>{var i;return Array.isArray(e)?e.map(a):null!=(i=null==e?void 0:e[t])?i:e};return y(m({},e),{data:e.data.map(t=>{var e;return y(m({},t),{datum:n(t.datum),values:s?null==(e=t.values)?void 0:e.map(a):t.values})})})}validateRequests(t){const e=[];for(const[i,s]of t.entries())i>0&&s.data.length!==t[0].data.length&&!1===s.opts.groupByData?s.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):e.push(s);return e}mergeRequested(e){const i=[];for(const s of e){const e=i.find(t.groupMatch(s));e?e.push(s):i.push([s])}return i.map(t.mergeRequests)}splitResult(t,e,i,s){for(let n=0;n<i.length;n++){const a=i[n];(0,s[n])({dataModel:t,processedData:y(m({},e),{data:e.data.filter(({validScopes:t})=>{var e;return null==(e=null==t?void 0:t.has(a))||e})})})}}static groupMatch({data:t,opts:e}){function i(t){return t.filter(t=>"key"===t.type).map(t=>t.property).join(";")}return([s])=>(!1===e.groupByData||s.data===t)&&s.opts.groupByKeys===e.groupByKeys&&s.opts.groupByFn===e.groupByFn&&i(s.opts.props)===i(e.props)}static mergeRequests(e){return e.reduce((e,i)=>{var s,n,{id:a,data:o,resolve:r,reject:l,opts:h}=i,c=h,{props:d}=c,u=f(c,["props"]);e.ids.push(a),e.rejects.push(l),e.resolves.push(r),null!=e.data||(e.data=o),null!=e.opts||(e.opts=y(m({},u),{props:[]}));for(const i of d){const o=y(m({},i),{scopes:[a]});t.createIdsMap(a,o);const r=e.opts.props.find(e=>e.type===o.type&&t.deepEqual(e,o));r?(null!=r.scopes||(r.scopes=[]),r.scopes.push(...null!=(s=o.scopes)?s:[]),"key"!==r.type&&"value"!==r.type||!(null==(n=o.idsMap)?void 0:n.size)||t.mergeIdsMap(o.idsMap,r.idsMap)):e.opts.props.push(o)}return e},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(t,e){for(const[i,s]of t)if(e.has(i))for(const t of s)e.get(i).add(t);else e.set(i,new Set(s))}static createIdsMap(t,e){null!=e.id&&(null!=e.idsMap||(e.idsMap=new Map),e.idsMap.has(t)?e.idsMap.get(t).add(e.id):e.idsMap.set(t,new Set([e.id])))}static deepEqual(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){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(!t.deepEqual(e[s],i[s]))return!1;return!0}const a=Object.keys(e);if(n=a.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const n=a[s];if(!(t.skipKeys.has(n)||Object.hasOwn(i,n)&&t.deepEqual(e[n],i[n])))return!1}return!0}return!1}};Qh.skipKeys=new Set(["id","idsMap","type","scopes"]);var Jh=Qh,tc=class t extends ah{constructor(t){super(),this.chart=t}subscribe(e=t.DEFAULT_GROUP){let i=this.get(e);return i||(i=new Set,t.chartsGroups.set(e,i)),i.add(this.chart),this}unsubscribe(e=t.DEFAULT_GROUP){var i;return null==(i=this.get(e))||i.delete(this.chart),this}getChart(){return this.chart}getGroup(e=t.DEFAULT_GROUP){const i=this.get(e);return i?Array.from(i):[]}getGroupSiblings(e=t.DEFAULT_GROUP){return this.getGroup(e).filter(t=>t!==this.chart)}get(e){return t.chartsGroups.get(e)}};tc.chartsGroups=new Map,tc.DEFAULT_GROUP=Symbol("sync-group-default");var ec=tc,ic=class extends ah{constructor(){super(...arguments),this.axisZoomManagers=new Map,this.state=new Sh(void 0,"initial"),this.rejectCallbacks=new Map}updateAxes(t){var e;const i=new Map(t.map(t=>[t.id,this.axisZoomManagers.get(t.id)]));this.axisZoomManagers.clear();for(const s of t)this.axisZoomManagers.set(s.id,null!=(e=i.get(s.id))?e:new sc(s));this.state.size>0&&t.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}updateZoom(t,e,i=!0,s){var n;if(s&&this.rejectCallbacks.set(t,s),0===this.axisZoomManagers.size){const a=this.state.stateId();return void("initial"===a||a===t||i?(this.state.set(t,e),a!==t&&(null==(n=this.rejectCallbacks.get(a))||n(t))):null==s||s(a))}this.state.set(t,e),this.axisZoomManagers.forEach(i=>{i.updateZoom(t,null==e?void 0:e[i.getDirection()])}),this.applyChanges(t)}updateAxisZoom(t,e,i){var s;null==(s=this.axisZoomManagers.get(e))||s.updateZoom(t,i),this.applyChanges(t)}fireZoomPanStartEvent(t){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:t})}getZoom(){let t,e;if(this.axisZoomManagers.forEach(i=>{"x"===i.getDirection()?null!=t||(t=i.getZoom()):"y"===i.getDirection()&&(null!=e||(e=i.getZoom()))}),t||e)return{x:t,y:e}}getAxisZoom(t){var e,i;return null!=(i=null==(e=this.axisZoomManagers.get(t))?void 0:e.getZoom())?i:{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}applyChanges(t){if(!Array.from(this.axisZoomManagers.values(),t=>t.applyChanges()).some(Boolean))return;const e={};for(const[t,i]of this.axisZoomManagers.entries())e[t]=i.getZoom();this.listeners.dispatch("zoom-change",y(m({type:"zoom-change"},this.getZoom()),{axes:e,callerId:t}))}},sc=class{constructor(t){this.axis=t;const[e=0,i=1]=t.visibleRange;this.state=new Sh({min:e,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(t,e){this.state.set(t,e)}getZoom(){return Me(this.state.stateValue())}applyChanges(){const t=this.currentZoom;return this.currentZoom=this.state.stateValue(),t.min!==this.currentZoom.min||t.max!==this.currentZoom.max}},nc=class extends fe{constructor(){super(...arguments),this.enabled=!1}};function ac(t,e){const{bbox:i,showFocusBox:s}=e;if(s&&t.updateFocusIndicatorRect(e.bbox),void 0!==i){const{x:t,y:e}=i.computeCenter();return{type:"keyboard",offsetX:t,offsetY:e}}}b([$n(Qn)],nc.prototype,"enabled",2),b([$n(ea)],nc.prototype,"tabIndex",2);var oc=["top","right","bottom","left"],rc=["category","grouped-category","ordinal-time","number","log","time"],lc=class{constructor(){this.result=[],this.valid=[],this.invalid=[]}push(t,e){const{result:i,valid:s,invalid:n}=this;var a;(function(t){return rc.includes(t.type)})(e)&&("string"==typeof(a=e.position)&&oc.includes(a)?s.push(t):n.push(t)),i.push(t)}guessInvalidPositions(){const t=this.valid.filter(t=>rc.includes(t.type)).map(t=>t.position).filter(t=>void 0!==t),e=["top","right","bottom","left"];for(const i of this.invalid){let s=e.pop();for(;t.includes(s)&&void 0!==s;)s=e.pop();if(void 0===s)break;i.position=s}return this.result}},hc=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo","stacked","grouped","stackGroup"],cc=class extends pr{applyOptions(t){for(const e of this.moduleMap.values())e.module.optionsKey in t&&be(e.moduleInstance)&&e.moduleInstance.set(t[e.module.optionsKey])}*legends(){for(const{module:t,moduleInstance:e}of this.moduleMap.values())"legend"===t.type&&(yield{legendType:t.identifier,legend:e})}},dc="ag-chart-overlay",uc="ag-chart-dark-overlay",pc=class extends fe{constructor(t,e){super(),this.className=t,this.defaultText=e,this.darkTheme=!1}getText(){var t;return null!=(t=this.text)?t:this.defaultText}getElement(t,e){null!=this.element||(this.element=Ms("div",dc,{position:"absolute"})),this.element.classList.toggle(uc,this.darkTheme),this.focusBox=e;const i=this.element;if(i.style.left=`${e.x}px`,i.style.top=`${e.y}px`,i.style.width=`${e.width}px`,i.style.height=`${e.height}px`,this.renderer){const t=this.renderer();t instanceof HTMLElement?i.replaceChildren(t):i.innerHTML=t}else{const e=Ms("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",font:"12px Verdana, sans-serif"});e.innerText=this.getText(),i.replaceChildren(e),null==t||t.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(t){i.style.opacity=String(t)},onStop(){i.style.opacity="1"}})}return this.element}removeElement(t){if(this.element){if(t){const{element:e}=this;t.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(t){e.style.opacity=String(t)},onStop(){e.remove()}})}else this.element.remove();this.element=void 0,this.focusBox=void 0}}};b([$n(ta,{optional:!0})],pc.prototype,"text",2),b([$n(Jn,{optional:!0})],pc.prototype,"renderer",2),b([$n(Qn)],pc.prototype,"darkTheme",2);var gc=class extends fe{constructor(){super(...arguments),this.loading=new pc("ag-chart-loading-overlay","Loading data..."),this.noData=new pc("ag-chart-no-data-overlay","No data to display"),this.noVisibleSeries=new pc("ag-chart-no-visible-series","No visible series")}getFocusInfo(){for(const t of[this.loading,this.noData,this.noVisibleSeries])if(void 0!==t.focusBox)return{text:t.getText(),rect:t.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement()}};b([$n(Zn)],gc.prototype,"loading",2),b([$n(Zn)],gc.prototype,"noData",2),b([$n(Zn)],gc.prototype,"noVisibleSeries",2);var mc=`\n.${dc} {\n    color: #181d1f;\n}\n\n.${dc}.${uc} {\n    color: #ffffff;\n}\n\n.${dc}--loading {\n    color: rgb(140, 140, 140); /* DEFAULT_MUTED_LABEL_COLOUR */\n}\n\n.${dc}__loading-background {\n    background: white; /* DEFAULT_BACKGROUND_FILL */\n}\n\n.${dc}.${uc} .${dc}__loading-background {\n    background: #192232; /* DEFAULT_DARK_BACKGROUND_FILL */\n}\n`;function yc(t,e=[0,0]){for(const i of t)"number"==typeof i&&(i<0&&(e[0]+=i),i>0&&(e[1]+=i));return e}function fc(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:t=>yc(t)}}function xc(t,e){return{id:t,type:"aggregate",matchGroupIds:e?[e]:void 0,aggregateFunction:t=>yc(t),groupAggregateFunction:(t,e=[0,0])=>{var i,s;return e[0]+=null!=(i=null==t?void 0:t[0])?i:0,e[1]+=null!=(s=null==t?void 0:t[1])?s:0,e}}}function bc(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:t=>Yh.extendDomain(t)}}function vc(t){return{id:t,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(t,e=[0,0])=>{var i,s;return e[0]+=null!=(i=null==t?void 0:t[0])?i:0,e[1]+=null!=(s=null==t?void 0:t[1])?s:0,e}}}function Sc(t,e){return{id:t,matchGroupIds:e?[e]:void 0,type:"aggregate",aggregateFunction:t=>yc(t),groupAggregateFunction:(t,e=[0,0,-1])=>{var i,s;return e[0]+=null!=(i=null==t?void 0:t[0])?i:0,e[1]+=null!=(s=null==t?void 0:t[1])?s:0,e[2]++,e},finalFunction:(t=[0,0,0])=>{const e=t[0]+t[1];return e>=0?[0,e/t[2]]:[e/t[2],0]}}}function Mc(t,e,i){const s={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(t,i=[])=>{const s=i[1]-i[0];return e.aggregateFunction(t).map(t=>t/s)}};return e.groupAggregateFunction&&(s.groupAggregateFunction=e.groupAggregateFunction),s}function kc(t){return()=>{let e=0;return i=>Vt(i)?(e+=t?Math.max(0,i):i,e):i}}function Dc(){return()=>{let t=0;return e=>{if(!Vt(e))return e;const i=t;return t+=e,i}}}var wc={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let t=NaN;return(e=1/0,i)=>{const s=i.keys[0],n=Math.abs(s-t);return t=s,!isNaN(n)&&n>0&&n<e?n:e}}},Ic={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:t}})=>null==t?void 0:t.slice().sort((t,e)=>{for(let i=0;i<t.length;i++){const s=t[i]-e[i];if(0!==s)return s}return 0})};function Cc({normaliseTo:t,mode:e}){const i=(e,i)=>{const s=e*t/i;return s>=0?Math.min(t,s):Math.max(-t,s)};return()=>()=>(t,s)=>{const n=[0,0];for(const i of s){const s=t[i],a=s<0?0:1;"sum"===e?n[a]+=s:n[a]=0===a?Math.min(n[a],s):Math.max(n[a],s)}const a=Math.max(Math.abs(n[0]),n[1]);for(const e of s)t[e]=i(t[e],a)}}function Lc(t,e,i="sum"){return{type:"group-value-processor",matchGroupIds:t,adjust:Oo({normaliseTo:e,mode:i},Cc)}}function Ac({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:s}){const n=t[1]-t[0],a=(i,s,a)=>{const o=t[0]+(i-s)/a*n;return 0===a?e:o>=t[1]?t[1]:o<t[0]?t[0]:o};return()=>(e,n)=>{let[o,r]=e.domain.values[n];null!=i&&(o=i),null!=s&&(r=s);const l=r-o;e.domain.values[n]=[t[0],t[1]];for(const t of e.data){let i=t.values;"ungrouped"===e.type&&(i=[i]);for(const t of i)t[n]=a(t[n],o,l)}}}function Tc(t,e,i,s,n){return{type:"property-value-processor",property:t,adjust:Oo({normaliseTo:e,rangeMin:s,rangeMax:n,zeroDomain:i},Ac)}}function Nc(t){return{type:"processor",property:"animationValidation",calculate(e){const{keys:i,values:s}=e.defs,{input:n,data:a}=e;let o=!0,r=!0;const l=[];for(let e=0;e<s.length;e++)(null==t?void 0:t.includes(s[e].id))&&l.push([e,s[e]]);const h=(t,i,s)=>{var l;if("category"===i.valueType){const i=e.domain[s][t];return void(o&&(o=i.length===n.count))}let h=null==(l=a[0])?void 0:l[s][t];for(let e=1;(o||r)&&e<a.length;e++){const i=a[e][s][t];r&&(r=h<=i),o&&(o=h!==i),h=i}};for(let t=0;(o||r)&&t<i.length;t++)h(t,i[t],"keys");for(let t=0;(o||r)&&t<l.length;t++){const[e,i]=l[t];h(e,i,"values")}return{uniqueKeys:o,orderedKeys:r}}}}function Oc({mode:t,separateNegative:e}){return()=>()=>(i,s)=>{const n=[0,0];for(const a of s){const s=i[a],o=Ys(s)&&e?0:1;Vt(s)&&("normal"===t&&(n[o]+=s),i[a]=n[o],"trailing"===t&&(n[o]+=s))}}}function Rc({mode:t,sum:e}){return()=>{const i=[];let s=!0;return()=>(n,a)=>{let o=0;for(const r of a){const a=n[r],l=s&&"current"===e?0:i[r];i[r]=a;const h="current"===e?a:l;Vt(a)&&Vt(l)?("normal"===t&&(o+=h),n[r]=o,"trailing"===t&&(o+=h)):n[r]=o}s=!1}}}function Ec(t,e,i,s=!1){let n;return n=e.startsWith("window")?Oo({mode:e.endsWith("-trailing")?"trailing":"normal",sum:i},Rc):Oo({mode:e,separateNegative:s},Oc),{type:"group-value-processor",matchGroupIds:[t],adjust:n}}function Pc(t,e=!0){return{type:"processor",property:"diff",calculate:i=>{const s=new Map,n=new Map,a=new Map,o=new Map,r=Math.max(t.data.length,i.data.length);for(let l=0;l<r;l++){const r=t.data[l],h=i.data[l],c=r?Bc(r.keys):"",d=h?Bc(h.keys):"";h&&r&&c===d?cs(r.values,h.values)||a.set(d,h):(o.has(d)?(!e&&cs(o.get(d).values,h.values)||(a.set(d,h),s.set(d,h)),o.delete(d)):h&&n.set(d,h),n.has(c)?(!e&&cs(n.get(c).values,r.values)||(a.set(c,r),s.set(c,r)),n.delete(c)):r&&(a.delete(c),o.set(c,r)))}return{changed:n.size>0||a.size>0||o.size>0,added:n,updated:a,removed:o,moved:s}}}}function Bc(t,...e){let i;return i=Ot(t)?t.map(t=>Uo(t)).join("___"):Uo(t),("string"==typeof i||"number"==typeof i||i instanceof Date)&&e.length>0&&(i+=`___${e.join("___")}`),i}var Fc=(t=>(t[t.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",t[t.NEAREST_BY_MAIN_AXIS_FIRST=1]="NEAREST_BY_MAIN_AXIS_FIRST",t[t.NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST=2]="NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST",t[t.NEAREST_NODE=3]="NEAREST_NODE",t))(Fc||{});function zc(t){return null!=t&&$o(t)}function Gc(t){return null!=t}function _c(t){switch(t){case"number":case"log":case"ordinal-time":case"time":case"color":return zc;default:return Gc}}function jc(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function Wc(t,e,i={}){return m({property:t,type:"key",valueType:jc(e),validation:_c(e)},i)}function Vc(t,e,i={}){return m({property:t,type:"value",valueType:jc(e),validation:_c(e)},i)}function Kc(t,e={}){const i=e,{min:s=-1/0,max:n=1/0}=i,a=f(i,["min","max"]);return m({type:"value",property:t,valueType:"range",validation:zc,processor:()=>t=>Vt(t)?_s(s,t,n):t},a)}function Yc(t,e,i={}){const s=i,{onlyPositive:n}=s,a=f(s,["onlyPositive"]);return y(m({},Vc(t,e,a)),{processor:kc(n)})}function $c(t,e,i={}){return y(m({},Vc(t,e,i)),{processor:Dc()})}function Hc(t,e,i="current",s,n){return[Vc(t,n,s),Ec(s.groupId,e,i,s.separateNegative),...null!=s.rangeId?[bc(s.rangeId,s.groupId)]:[]]}var Uc=class{constructor(t,e,{datum:i},s){this.type=t,this.event=e,this.datum=i,this.seriesId=s.id}},Xc=class{constructor(t,e,i){this.series=t,this.seriesGrouping=e,this.oldGrouping=i,this.type="groupingChanged"}},Zc=class extends Zl{constructor(t){super(),this.destroyFns=[],this.seriesGrouping=void 0,this.NodeEvent=Uc,this.internalId=Fs(this),this.rootGroup=new ko({name:"seriesRoot",isVirtual:!0}),this.axes={x:void 0,y:void 0},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new pr,this._declarationOrder=-1,this.seriesListeners=new ih;const{moduleCtx:e,pickModes:i=[1],directionKeys:s={},directionNames:n={},contentGroupVirtual:a=!0,canHaveAxes:o=!1}=t;this.ctx=e,this.directionKeys=s,this.directionNames=n,this.canHaveAxes=o,this.contentGroup=this.rootGroup.appendChild(new ko({name:`${this.internalId}-content`,isVirtual:a,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("data")})),this.highlightGroup=new ko({name:`${this.internalId}-highlight`,isVirtual:a,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("highlight")}),this.highlightNode=this.highlightGroup.appendChild(new ko({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new ko({name:"highlightLabel",zIndex:10})),this.pickModes=i,this.labelGroup=this.rootGroup.appendChild(new ko({name:`${this.internalId}-series-labels`,zIndex:8})),this.annotationGroup=new ko({name:`${this.id}-annotation`,isVirtual:a,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("annotation")})}get id(){var t,e;return null!=(e=null==(t=this.properties)?void 0:t.id)?e:this.internalId}get type(){var t;return null!=(t=this.constructor.type)?t:""}get data(){var t;return null!=(t=this._data)?t:this._chartData}set visible(t){this.properties.visible=t,this.visibleChanged()}get visible(){return this.properties.visible}get hasData(){return null!=this.data&&this.data.length>0}get tooltipEnabled(){var t,e;return null!=(e=null==(t=this.properties.tooltip)?void 0:t.enabled)&&e}onDataChange(){this.nodeDataRefresh=!0}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({id:i,type:s}),e&&this.ctx.seriesStateManager.registerSeries({id:i,type:s,visible:n,seriesGrouping:e}),this.fireEvent(new Xc(this,e,t))}getBandScalePadding(){return{inner:1,outer:0}}getGroupZIndexSubOrder(t,e=0){let i=0;switch(t){case"data":case"paths":break;case"labels":i+=2e4;break;case"marker":i+=1e4;break;case"highlight":e+=15e3;break;case"annotation":i+=15e3}return[()=>this._declarationOrder+i,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.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(t,e){const i=this.resolveKeyDirection(t),s=null==e?void 0:e[i],n=[];if(!s)return n;const a=(...t)=>{for(const e of t)Array.isArray(e)?a(...e):"object"==typeof e?a(...Object.values(e)):n.push(e)};return a(...s.map(t=>this.properties[t])),n}getKeys(t){return this.getDirectionValues(t,this.directionKeys)}getKeyProperties(t){var e;return null!=(e=this.directionKeys[this.resolveKeyDirection(t)])?e:[]}getNames(t){return this.getDirectionValues(t,this.directionNames)}resolveKeyDirection(t){return t}getDomain(t){const e=this.getSeriesDomain(t),i=this.moduleMap.mapModules(e=>e.getDomain(t));return e.concat(i.flat())}markNodeDataDirty(){this.nodeDataRefresh=!0}visibleChanged(){this.ctx.seriesStateManager.registerSeries(this)}getOpacity(){const{dimOpacity:t=1,enabled:e=!0}=this.properties.highlightStyle.series;if(!e||1===t)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;default:return t}}getStrokeWidth(t){const{strokeWidth:e,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||void 0===e)return t;switch(this.isItemIdHighlighted()){case 1:return e;case 0:case 2:return t}}isItemIdHighlighted(){var t,e;const i=null==(e=null==(t=this.ctx.highlightManager)?void 0:t.getActiveHighlight())?void 0:e.series;return null==i?0:i!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(t=>t.getTooltipParams()).reduce((t,e)=>Object.assign(t,e),{})}pickNode(t,e){const{pickModes:i,visible:s,rootGroup:n}=this;if(s&&n.visible)for(const s of i){if(e&&!e.includes(s))continue;let i;switch(s){case 0:i=this.pickNodeExactShape(t);break;case 1:case 2:i=this.pickNodeMainAxisFirst(t,2===s);break;case 3:i=this.pickNodeClosestDatum(t)}if(i)return{pickMode:s,match:i.datum,distance:i.distance}}}pickNodeExactShape(t){const e=this.contentGroup.pickNode(t.x,t.y);if(e&&!0!==e.datum.missing)return{datum:e.datum,distance:0}}pickNodeClosestDatum(t){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(t,e){const i=Zs(t.x,t.y,e);if(void 0!==i.nearest&&!0!==i.nearest.datum.missing)return{datum:i.nearest.datum,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(t,e){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}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)}toggleSeriesItem(t,e){this.visible=e,this.nodeDataRefresh=!0,this.dispatch("visibility-changed",{itemId:t,enabled:e})}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return y(m({},this.ctx),{series:this})}getLabelText(t,e,i=String){var s;return t.formatter&&null!=(s=this.ctx.callbackCache.call(t.formatter,m({seriesId:this.id},e)))?s:i(e.value)}getMarkerStyle(t,e,i=t.getStyle()){var s,n;const a=Xt({size:null!=(n=null==(s=e.datum.point)?void 0:s.size)?n:0},i);return t.formatter?Xt(this.ctx.callbackCache.call(t.formatter,y(m(m({seriesId:this.id},a),e),{datum:e.datum.datum})),a):a}updateMarkerStyle(t,e,i,s=e.getStyle(),{applyTranslation:n=!0}={}){const{point:a}=i.datum,o=this.getMarkerStyle(e,i,s),r=this.visible&&o.size>0&&a&&!isNaN(a.x)&&!isNaN(a.y);n?t.setProperties(y(m({visible:r},o),{translationX:null==a?void 0:a.x,translationY:null==a?void 0:a.y})):t.setProperties(m({visible:r},o)),"function"!=typeof e.shape||t.dirtyPath||(t.path.clear(!0),t.updatePath(),t.checkPathDirty())}getMinRects(t,e){}get nodeDataDependencies(){var t;return null!=(t=this._nodeDataDependencies)?t:{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(t){const{width:e,height:i}=null!=t?t:{width:NaN,height:NaN},s=t?{seriesRectWidth:e,seriesRectHeight:i}:void 0,n=null!=Se(this.nodeDataDependencies,s);return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(t){}};Zc.highlightedZIndex=1e12,b([Xr({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],Zc.prototype,"seriesGrouping",2);var qc=class{constructor(t,e,i){this.seriesRoot=t,this.highlightRoot=e,this.annotationRoot=i,this.groups={},this.series={},this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(t){this.expectedSeriesCount=t}requestGroup(t){var e,i,s;const{internalId:n,type:a,rootGroup:o,highlightGroup:r,annotationGroup:l,seriesGrouping:h}=t,{groupIndex:c=n}=null!=h?h:{};if(null!=this.series[n])throw new Error(`AG Charts - series already has an allocated layer: ${this.series[n]}`);0===Object.keys(this.series).length&&(this.mode=this.expectedSeriesCount>=30?"aggressive-grouping":"normal"),null!=(e=this.groups)[a]||(e[a]={});const d=this.lookupIdx(c);let u=this.groups[a][d];return u||(u=null!=(s=(i=this.groups[a])[d])?s:i[d]={seriesIds:[],group:this.seriesRoot.appendChild(new ko({name:`${a}-content`,layer:!0,zIndex:4,zIndexSubOrder:t.getGroupZIndexSubOrder("data")})),highlight:this.highlightRoot.appendChild(new ko({name:`${a}-highlight`,zIndex:4,zIndexSubOrder:t.getGroupZIndexSubOrder("highlight")})),annotation:this.annotationRoot.appendChild(new ko({name:`${a}-annotation`,zIndex:4,zIndexSubOrder:t.getGroupZIndexSubOrder("annotation")}))}),this.series[n]={layerState:u,seriesConfig:t},u.seriesIds.push(n),u.group.appendChild(o),u.highlight.appendChild(r),u.annotation.appendChild(l),u.group}changeGroup(t){var e,i;const{internalId:s,seriesGrouping:n,type:a,rootGroup:o,highlightGroup:r,annotationGroup:l,oldGrouping:h}=t,{groupIndex:c=s}=null!=n?n:{};(null==(i=null==(e=this.groups[a])?void 0:e[c])?void 0:i.seriesIds.includes(s))||(null!=this.series[s]&&this.releaseGroup({internalId:s,seriesGrouping:h,type:a,rootGroup:o,highlightGroup:r,annotationGroup:l}),this.requestGroup(t))}releaseGroup(t){var e,i,s,n,a;const{internalId:o,seriesGrouping:r,rootGroup:l,highlightGroup:h,annotationGroup:c,type:d}=t,{groupIndex:u=o}=null!=r?r:{};if(null==this.series[o])throw new Error(`AG Charts - series doesn't have an allocated layer: ${o}`);const p=this.lookupIdx(u),g=null!=(s=null==(e=this.groups[d])?void 0:e[p])?s:null==(i=this.series[o])?void 0:i.layerState;if(g&&(g.seriesIds=g.seriesIds.filter(t=>t!==o),g.group.removeChild(l),g.highlight.removeChild(h),g.annotation.removeChild(c)),0===(null==g?void 0:g.seriesIds.length))this.seriesRoot.removeChild(g.group),this.highlightRoot.removeChild(g.highlight),this.annotationRoot.removeChild(g.annotation),delete this.groups[d][p],delete this.groups[d][o];else if((null==g?void 0:g.seriesIds.length)>0){const t=null==(a=this.series[null==(n=null==g?void 0:g.seriesIds)?void 0:n[0]])?void 0:a.seriesConfig;g.group.zIndexSubOrder=null==t?void 0:t.getGroupZIndexSubOrder("data"),g.highlight.zIndexSubOrder=null==t?void 0:t.getGroupZIndexSubOrder("highlight"),g.annotation.zIndexSubOrder=null==t?void 0:t.getGroupZIndexSubOrder("annotation")}delete this.series[o]}lookupIdx(t){return"normal"===this.mode?t:"string"!=typeof t||(t=Number(t.split("-").slice(-1)[0]))?Math.floor(30*_s(0,t/this.expectedSeriesCount,1)):0}destroy(){for(const t of Object.values(this.groups))for(const e of Object.values(t))this.seriesRoot.removeChild(e.group),this.highlightRoot.removeChild(e.highlight),this.annotationRoot.removeChild(e.annotation);this.groups={},this.series={}}},Qc=class{constructor(t,e){this.chartLike=t,this.layoutService=e,this.destroyFns=[],this.destroyFns.push(this.layoutService.addListener("start-layout",t=>this.positionPadding(t.shrinkRect)),this.layoutService.addListener("start-layout",t=>this.positionCaptions(t.shrinkRect)))}destroy(){this.destroyFns.forEach(t=>t())}positionPadding(t){const{padding:e}=this.chartLike;return t.shrink(e.left,"left"),t.shrink(e.top,"top"),t.shrink(e.right,"right"),t.shrink(e.bottom,"bottom"),{shrinkRect:t}}positionCaptions(t){var e,i;const{title:s,subtitle:n,footnote:a}=this.chartLike,o=t.clone(),r=e=>{var i;const s=t.height/10,n=null!=(i=e.lineHeight)?i:e.fontSize*Bo.defaultLineHeightRatio,a=t.width,o=Math.max(n,s);e.computeTextWrap(a,o)},l=t=>"left"===t?o.x:"right"===t?o.x+o.width:("center"!==t&&E.error(`invalid textAlign value: ${t}`),o.x+o.width/2),h=(t,e)=>{const i=o.y;t.node.x=l(t.textAlign),t.node.y=i,t.node.textBaseline="top",r(t);const s=t.node.computeBBox(),n=Math.ceil(s.y-i+s.height+e);o.shrink(n,"top")};if(s.node.visible=s.enabled,n.node.visible=n.enabled,a.node.visible=a.enabled,s.enabled){const{spacing:t=(n.enabled?ol.SMALL_PADDING:ol.LARGE_PADDING)}=s;h(s,t)}return n.enabled&&h(n,null!=(e=n.spacing)?e:0),a.enabled&&((t,e)=>{const i=o.y+o.height;t.node.x=l(t.textAlign),t.node.y=i,t.node.textBaseline="bottom",r(t);const s=t.node.computeBBox(),n=Math.ceil(i-s.y+e);o.shrink(n,"bottom")})(a,null!=(i=a.spacing)?i:0),{shrinkRect:o}}},Jc=class{constructor(t,e,i,s){this.chart=t,this.dataService=e,this.updateService=i,this.zoomManager=s,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.updateService.update(1)}onDataError(){this.updateService.update(3)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(){(this.dirtyZoom||this.dirtyDataSource)&&this.updateWindow().catch(t=>E.errorOnce(t))}onZoomChange(){this.dirtyZoom=!0}updateWindow(){return S(this,null,function*(){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:null==e?void 0:e.min,windowEnd:null==e?void 0:e.max})})}getValidAxis(){return this.chart.axes.find(t=>"time"===t.type)}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||(this.lastAxisZooms.set(t.id,e),0))}getAxisWindow(t,e){var i,s;const n=null==(s=(i=t.scale).getDomain)?void 0:s.call(i);if(!e||!n||0===n.length||isNaN(Number(n[0])))return;const a=Number(n[1])-Number(n[0]);return{min:new Date(Number(n[0])+a*e.min),max:new Date(Number(n[0])+a*e.max)}}},td=class{constructor(t,e,i,s,n){this.chartLike=t,this.overlays=e,this.dataService=i,this.layoutService=s,this.animationManager=n,this.destroyFns=[],this.destroyFns.push(this.layoutService.addListener("layout-complete",t=>this.onLayoutComplete(t)))}destroy(){this.destroyFns.forEach(t=>t())}onLayoutComplete({series:{rect:t}}){const e=this.dataService.isLoading(),i=this.chartLike.series.some(t=>t.hasData),s=this.chartLike.series.some(t=>t.visible);this.toggleOverlay(this.overlays.loading,t,e),this.toggleOverlay(this.overlays.noData,t,!e&&!i),this.toggleOverlay(this.overlays.noVisibleSeries,t,i&&!s)}toggleOverlay(t,e,i){if(i){const i=t.getElement(this.animationManager,e);this.chartLike.element.append(i)}else t.removeElement(this.animationManager)}},ed=Ls.create(!0,"opts"),id=class extends fe{constructor(){super(...arguments),this.padding=new ql(0)}};b([$n(Qn,{optional:!0})],id.prototype,"clip",2),b([$n(Zn)],id.prototype,"padding",2);var sd=class t extends Zl{constructor(t,e){var i,s;super(),this.id=Fs(this),this.seriesRoot=new ko({name:`${this.id}-series-root`}),this.highlightRoot=new ko({name:`${this.id}-highlight-root`,layer:!0,zIndex:5,nonEmptyChildDerivedZIndex:!0}),this.annotationRoot=new ko({name:`${this.id}-annotation-root`,layer:!0,zIndex:10}),this.debug=Ls.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this.padding=new ql(20),this.seriesArea=new id,this.title=new ol,this.subtitle=new ol,this.footnote=new ol,this.keyboard=new nc,this.mode="standalone",this.destroyed=!1,this._skipSync=!1,this._destroyFns=[],this.chartAnimationPhase="initial",this.modulesManager=new cc,this.zoomManager=new ic,this.processors=[],this.processedOptions={},this.userOptions={},this.queuedUserOptions=[],this._pendingFactoryUpdatesCount=0,this._performUpdateNoRenderCount=0,this._performUpdateSkipAnimations=!1,this.performUpdateType=7,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new Xl,this.updateRequestors={},this.performUpdateTrigger=Ql((t,e=0)=>setTimeout(t,e),t=>S(this,[t],function*({count:t}){this.destroyed||this.updateMutex.acquire(()=>S(this,null,function*(){try{yield this.performUpdate(t)}catch(t){E.error("update error",t)}})).catch(t=>E.errorOnce(t))})),this._performUpdateSplits={},this.axes=[],this.series=[],this.focus={hasFocus:!1,series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.pointerScheduler=Ql((t,e)=>requestAnimationFrame(t),()=>{this.lastInteractionEvent&&(this.performUpdateType<=4?this.pointerScheduler.schedule():(this.handlePointer(this.lastInteractionEvent,!1),this.lastInteractionEvent=void 0))}),this.onSeriesNodeClick=t=>{const e=y(m({},t),{type:"seriesNodeClick"});Object.defineProperty(e,"series",{enumerable:!1,get:()=>t.series}),this.fireEvent(e)},this.onSeriesNodeDoubleClick=t=>{const e=y(m({},t),{type:"seriesNodeDoubleClick"});this.fireEvent(e)},this.seriesGroupingChanged=t=>{if(!(t instanceof Xc))return;const{series:e,seriesGrouping:i,oldGrouping:s}=t;null!=e.rootGroup.parent&&this.seriesLayerManager.changeGroup({internalId:e.internalId,type:e.type,rootGroup:e.rootGroup,highlightGroup:e.highlightGroup,annotationGroup:e.annotationGroup,getGroupZIndexSubOrder:t=>e.getGroupZIndexSubOrder(t),seriesGrouping:i,oldGrouping:s})},this.dataProcessListeners=new Set,this.chartOptions=t;let n=null==e?void 0:e.scene;const a=null!=(i=null==e?void 0:e.element)?i:Ms("div","ag-chart-wrapper",{position:"relative",userSelect:"none"}),o=null==e?void 0:e.container;this.element=a;const r=new ko({name:"root"});r.visible=!1,r.append(this.seriesRoot),r.append(this.highlightRoot),r.append(this.annotationRoot),this.axisGridGroup=new ko({name:"Axes-Grids",layer:!0,zIndex:1}),r.appendChild(this.axisGridGroup),this.axisGroup=new ko({name:"Axes",layer:!0,zIndex:2}),r.appendChild(this.axisGroup),this.sizeMonitor=new Jl,this.sizeMonitor.observe(this.element,t=>this.rawResize(t));const{overrideDevicePixelRatio:l}=t.specialOverrides;null!=n||(n=new Hl({pixelRatio:l,canvasPosition:"absolute"})),n.setRoot(r).setContainer(a),this.autoSize=!0,this.tooltip=new al,this.seriesLayerManager=new qc(this.seriesRoot,this.highlightRoot,this.annotationRoot);const h=this.ctx=new Wh(this,{scene:n,syncManager:new ec(this),element:a,updateCallback:(t=0,e)=>this.update(t,e),updateMutex:this.updateMutex});this.overlays=new gc,null!=(s=this.overlays.loading).renderer||(s.renderer=()=>function(t,e){const{animationDuration:i}=wn.add,s=Ms("div",`${dc}--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 ${i*e}ms linear 50ms both`}),n=Ms("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),a=Ms("p",{marginTop:"1em"});a.innerText=t;const o=Ms("div",`${dc}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),r=Ms("style");return r.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),s.replaceChildren(r,n,a,o),Ds(mc,"chartOverlays"),s}(this.overlays.loading.getText(),h.animationManager.defaultDuration)),this.processors=[new Qc(this,h.layoutService),new Jc(this,h.dataService,h.updateService,h.zoomManager),new td(this,this.overlays,h.dataService,h.layoutService,h.animationManager)],this.highlight=new Vh,this.container=o;const{All:c}=ph,d=this.getModuleContext(),u=h.regionManager.addRegion("series",this.seriesRoot,this.axisGroup);h.regionManager.addRegion("root",r),this._destroyFns.push(h.dataService.addListener("data-load",t=>{this.data=t.data}),h.scene.attachNode(this.title.node),h.scene.attachNode(this.subtitle.node),h.scene.attachNode(this.footnote.node),this.title.registerInteraction(d,"title"),this.subtitle.registerInteraction(d,"subtitle"),this.footnote.registerInteraction(d,"footnote"),h.interactionManager.addListener("click",t=>this.onClick(t)),h.interactionManager.addListener("dblclick",t=>this.onDoubleClick(t)),u.addListener("hover",t=>this.onMouseMove(t)),u.addListener("leave",t=>this.onLeave(t)),u.addListener("blur",()=>this.onBlur()),u.addListener("tab",t=>this.onTab(t)),u.addListener("nav-vert",t=>this.onNavVert(t)),u.addListener("nav-hori",t=>this.onNavHori(t)),u.addListener("submit",t=>this.onSubmit(t)),h.keyNavManager.addListener("browserfocus",t=>this.onBrowserFocus(t)),h.interactionManager.addListener("page-left",()=>this.destroy()),h.interactionManager.addListener("contextmenu",t=>this.onContextMenu(t),c),h.animationManager.addListener("animation-start",()=>this.onAnimationStart()),h.animationManager.addListener("animation-frame",()=>{this.update(6)}),h.highlightManager.addListener("highlight-change",t=>this.changeHighlightDatum(t)),h.zoomManager.addListener("zoom-pan-start",()=>this.resetPointer()),h.zoomManager.addListener("zoom-change",()=>{this.resetPointer(),this.series.map(t=>{var e;return null==(e=t.animationState)?void 0:e.transition("updateData")});const t="initial"!==this.chartAnimationPhase;this.update(3,{forceNodeDataRefresh:!0,skipAnimations:t})}))}static getInstance(e){return t.chartsInstances.get(e)}get canvasElement(){return this.ctx.scene.canvas.element}getCanvasDataURL(t){return this.ctx.scene.getDataURL(t)}onAutoSizeChange(t){const{style:e}=this.element;if(t){if(e.display="block",e.width="100%",e.height="100%",!this._lastAutoSize)return;this.resize(void 0,void 0,"autoSize option")}else e.display="inline-block",e.width="auto",e.height="auto"}download(t,e){this.ctx.scene.download(t,e)}getOptions(){var t;return null!=(t=this.queuedUserOptions.at(-1))?t:this.userOptions}getModuleContext(){return this.ctx}getAriaLabel(){var t;const e=[this.title,this.subtitle,this.footnote].filter(t=>t.enabled&&t.text).map(t=>t.text).join(". ");return`chart, ${null!=(t=this.series.length)?t:0} series, ${e}`}resetAnimations(){this.chartAnimationPhase="initial";for(const t of this.series)t.resetAnimation(this.chartAnimationPhase);for(const t of this.axes)t.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}destroy(t){if(this.destroyed)return;const e=null==t?void 0:t.keepTransferableResources;let i;return this.performUpdateType=7,this._destroyFns.forEach(t=>t()),this.processors.forEach(t=>t.destroy()),this.tooltip.destroy(),this.overlays.destroy(),this.sizeMonitor.unobserve(this.element),this.modulesManager.destroy(),e?(this.ctx.scene.strip(),i={container:this.container,scene:this.ctx.scene,element:this.element}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(t=>t.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.zoomManager.destroy(),this.destroyed=!0,Object.freeze(this),i}resetPointer(t=!1){t||this.ctx.tooltipManager.removeTooltip(this.id),this.ctx.highlightManager.updateHighlight(this.id),this.lastInteractionEvent=void 0}requestFactoryUpdate(t){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(()=>S(this,null,function*(){this.destroyed||(yield t(this),this.destroyed||this._pendingFactoryUpdatesCount--)})).catch(t=>E.errorOnce(t)))}update(t=0,e){var i,s;const{forceNodeDataRefresh:n=!1,skipAnimations:a,seriesToUpdate:o=this.series,newAnimationBatch:r}=null!=e?e:{};n&&this.series.forEach(t=>t.markNodeDataDirty());for(const t of o)this.seriesToUpdate.add(t);if(a&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),r&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this._skipSync=null!=(i=null==e?void 0:e.skipSync)&&i,this.debug.check()){let e=null!=(s=(new Error).stack)?s:"<unknown>";e=e.replace(/\([^)]*/g,""),this.updateRequestors[e]=t}t<this.performUpdateType&&(this.performUpdateType=t,this.performUpdateTrigger.schedule(null==e?void 0:e.backOffMs))}performUpdate(t){return S(this,null,function*(){const{performUpdateType:e,extraDebugStats:i,_performUpdateSplits:s,ctx:n}=this,a=[...this.seriesToUpdate];this.performUpdateType=7,this.seriesToUpdate.clear(),0===this.updateShortcutCount&&e<6&&(n.animationManager.startBatch(this._performUpdateSkipAnimations),n.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.debug("Chart.performUpdate() - start",_h[e]);let o=performance.now();null!=s.start||(s.start=o);const r=t=>{null!=s[t]||(s[t]=0),s[t]+=performance.now()-o,o=performance.now()};let l=!1;switch(e){case 0:this.updateDOM();case 1:yield this.updateData(),r("⬇️");case 2:yield this.processData(),this.resetPointer(!0),r("🏭");case 3:if(this.checkUpdateShortcut(3))break;if(!this.checkFirstAutoSize(a)){l=!0;break}yield this.processLayout(),r("⌖");case 4:if(this.checkUpdateShortcut(4))break;const{seriesRect:t}=this;yield Promise.all(a.map(e=>e.update({seriesRect:t}))),r("🤔");case 5:if(this.checkUpdateShortcut(5))break;const o=n.tooltipManager.getTooltipMeta(this.id);e<=4&&null!=(null==o?void 0:o.lastPointerEvent)&&this.handlePointer(o.lastPointerEvent,!0),r("↖");case 6:if(this.checkUpdateShortcut(6))break;n.animationManager.endBatch(),i.updateShortcutCount=this.updateShortcutCount,yield n.scene.render({debugSplitTimes:s,extraDebugStats:i}),this.ctx.regionManager.updateFocusWrapperRect(),this.extraDebugStats={};for(const t in s)delete s[t];case 7:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,n.animationManager.endBatch()}l||n.updateService.dispatchUpdateComplete(this.getMinRects());const h=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round(100*(h-s.start))/100,count:t,performUpdateType:_h[e]})})}updateThemeClassName(){const{element:t,processedOptions:{theme:e}}=this,i="ag-charts-theme-",s=[`${i}default`,`${i}default-dark`];let n=s[0],a=!1;"string"==typeof e?(n=e.replace("ag-",i),a=e.includes("-dark")):"string"==typeof(null==e?void 0:e.baseTheme)&&(n=e.baseTheme.replace("ag-",i),a=e.baseTheme.includes("-dark")),s.includes(n)||(n=a?s[1]:s[0]),t.classList.forEach(e=>{e.startsWith(i)&&e!==n&&t.classList.remove(e)}),t.classList.add(n)}updateDOM(){this.updateThemeClassName();const{enabled:t,tabIndex:e}=this.keyboard;this.element.tabIndex=t?null!=e?e:0:-1,qr(this.ctx.scene.canvas.element,"role","figure"),qr(this.ctx.scene.canvas.element,"aria-label",this.getAriaLabel())}checkUpdateShortcut(t){return this.updateShortcutCount>3?(E.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=t&&(this.updateShortcutCount++,!0)}checkFirstAutoSize(t){if(this.autoSize&&!this._lastAutoSize){const e=this._performUpdateNoRenderCount++,i=40*p(e+1,2);if(e<8)return this.update(3,{seriesToUpdate:t,backOffMs:i}),this.debug("Chart.checkFirstAutoSize() - backing off until first size update",i),!1;this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}return this._performUpdateNoRenderCount=0,!0}onAxisChange(t,e=[]){for(const i of e)t.includes(i)||(i.detachAxis(this.axisGroup,this.axisGridGroup),i.destroy());for(const i of t)(null==e?void 0:e.includes(i))||i.attachAxis(this.axisGroup,this.axisGridGroup)}onSeriesChange(t,e){var i,s;const n=null!=(i=null==e?void 0:e.filter(e=>!t.includes(e)))?i:[];this.destroySeries(n),null==(s=this.seriesLayerManager)||s.setSeriesCount(t.length);for(const i of t){if(null==e?void 0:e.includes(i))continue;null==i.rootGroup.parent&&this.seriesLayerManager.requestGroup(i);const t=this;i.chart={get mode(){return t.mode},get isMiniChart(){return!1},get seriesRect(){return t.seriesRect},placeLabels:()=>t.placeLabels()},i.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(i),i.addChartEventListeners()}}destroySeries(t){null==t||t.forEach(t=>{t.removeEventListener("nodeClick",this.onSeriesNodeClick),t.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),t.removeEventListener("groupingChanged",this.seriesGroupingChanged),t.destroy(),this.seriesLayerManager.releaseGroup(t),t.chart=void 0})}addSeriesListeners(t){this.hasEventListener("seriesNodeClick")&&t.addEventListener("nodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&t.addEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),t.addEventListener("groupingChanged",this.seriesGroupingChanged)}updateAllSeriesListeners(){this.series.forEach(t=>{t.removeEventListener("nodeClick",this.onSeriesNodeClick),t.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),this.addSeriesListeners(t)})}assignSeriesToAxes(){this.axes.forEach(t=>{t.boundSeries=this.series.filter(e=>e.axes[t.direction]===t)})}assignAxesToSeries(){const t=ps(this.axes,t=>t.direction);this.series.forEach(e=>{e.directions.forEach(i=>{const s=t[i];if(!s)return void E.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);const n=e.getKeys(i),a=s.find(t=>!t.keys.length||n.some(e=>t.keys.includes(e)));a?e.axes[i]=a:E.warnOnce(`no matching axis for direction [${i}] and keys [${n}]; check series and axes configuration.`)})})}rawResize({width:t,height:e}){var i;if(!this.autoSize)return;if(t=Math.floor(t),e=Math.floor(e),0===t&&0===e)return;const[s=0,n=0]=null!=(i=this._lastAutoSize)?i:[];s===t&&n===e||(this._lastAutoSize=[t,e],this.resize(void 0,void 0,"SizeMonitor"))}resize(t,e,i){var s,n,a,o;const{scene:r,animationManager:l}=this.ctx;if(null!=t||(t=null!=(n=this.width)?n:this.autoSize?null==(s=this._lastAutoSize)?void 0:s[0]:r.canvas.width),null!=e||(e=null!=(o=this.height)?o:this.autoSize?null==(a=this._lastAutoSize)?void 0:a[1]:r.canvas.height),this.debug(`Chart.resize() from ${i}`,{width:t,height:e,stack:(new Error).stack}),t&&e&&Vt(t)&&Vt(e)&&r.resize(t,e)){this.resetPointer(),l.reset();let t=!0;this.autoSize&&this._firstAutoSize&&(t=!1,this._firstAutoSize=!1),this.update(3,{forceNodeDataRefresh:!0,skipAnimations:t})}}updateData(){return S(this,null,function*(){this.series.forEach(t=>t.setChartData(this.data));const t=this.modulesManager.mapModules(t=>{var e;return null==(e=t.updateData)?void 0:e.call(t,{data:this.data})});yield Promise.all(t)})}processData(){return S(this,null,function*(){if(this.series.some(t=>t.canHaveAxes)){this.assignAxesToSeries();const t=this.modulesManager.getModule("sync");(null==t?void 0:t.enabled)?t.syncAxes(this._skipSync):this.assignSeriesToAxes()}const t=new Jh(this.mode),e=this.series.map(e=>e.processData(t)),i=this.modulesManager.mapModules(e=>{var i;return null==(i=e.processData)?void 0:i.call(e,{dataController:t})});t.execute(),yield Promise.all([...e,...i]);for(const{legendType:t,legend:e}of this.modulesManager.legends())e.data=this.getLegendData(t,"integrated"!==this.mode);this.dataProcessListeners.forEach(t=>t()),this.dataProcessListeners.clear()})}placeLabels(){const t=[],e=[];for(const i of this.series){if(!i.visible)continue;const s=i.getLabelData();Wr(null==s?void 0:s[0])&&(e.push(s),t.push(i))}const{seriesRect:i}=this,{top:s,right:n,bottom:a,left:o}=this.seriesArea.padding,r=i&&e.length>0?function(t,e,i=5){var s,n;const a=[];t=t.map(t=>t.slice().sort((t,e)=>e.point.size-t.point.size));for(let o=0;o<t.length;o++){const r=a[o]=[],l=t[o];if((null==l?void 0:l.length)&&l[0].label)for(let o=0,h=l.length;o<h;o++){const h=l[o],{point:c,label:d,marker:u}=h,{text:p,width:g,height:m}=d,y=.5*c.size;let f=0,x=0;if(y>0&&null!=h.placement){const t=Vr[h.placement];f=(.5*g+y+i)*t.x,x=(.5*m+y+i)*t.y}const b=c.x-.5*g+f-((null!=(s=null==u?void 0:u.center.x)?s:.5)-.5)*c.size,v=c.y-.5*m+x-((null!=(n=null==u?void 0:u.center.y)?n:.5)-.5)*c.size;e&&!jr(e,b,v,g,m)||t.some(t=>t.some(t=>{var e;return Gr(t.point,null==(e=t.marker)?void 0:e.center,b,v,g,m)}))||a.some(t=>t.some(t=>_r(t,b,v,g,m)))||r.push({index:o,text:p,x:b,y:v,width:g,height:m,datum:h})}}return a}(e,{x:-o,y:-s,width:i.width+o+n,height:i.height+s+a}):[];return new Map(r.map((e,i)=>[t[i],e]))}getLegendData(t,e){var i,s;const n=this.series.filter(t=>t.properties.showInLegend).flatMap(e=>e.getLegendData(t));if(e&&n.every(t=>"category"===t.legendType)){const t={},e=new Map(this.series.map(t=>[t.id,t.type]));for(const{seriesId:a,marker:o,label:r}of n){if(null==o.fill)continue;const n=e.get(a),l=null!=(i=t[n])?i:t[n]={};null!=l[s=r.text]||(l[s]=o.fill),l[r.text]!==o.fill&&E.warnOnce(`legend item '${r.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}return n}processLayout(){return S(this,null,function*(){var t;const e=this.animationRect;yield this.performLayout(),e&&!(null==(t=this.animationRect)?void 0:t.equals(e))&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)})}performLayout(){return S(this,null,function*(){const{width:t,height:e}=this.ctx.scene;let i={shrinkRect:new Js(0,0,t,e)};i=this.ctx.layoutService.dispatchPerformLayout("start-layout",i),i=this.ctx.layoutService.dispatchPerformLayout("before-series",i);const s=this.modulesManager.mapModules(t=>S(this,null,function*(){null!=t.performLayout&&(i=yield t.performLayout(i))}));return yield Promise.all(s),i.shrinkRect})}pickSeriesNode(t,e,i){var s,n;const a=performance.now(),o=e?[0]:void 0,r=[...this.series].reverse();let l;for(const e of r){if(!e.visible||!e.rootGroup.visible)continue;const{match:n,distance:a}=null!=(s=e.pickNode(t,o))?s:{};if(n&&null!=a&&((!l||l.distance>a)&&a<=(null!=i?i:1/0)&&(l={series:e,distance:a,datum:n}),0===a))break}return this.extraDebugStats.pickSeriesNode=Math.round((null!=(n=this.extraDebugStats.pickSeriesNode)?n:0)+(performance.now()-a)),l}onMouseMove(t){this.lastInteractionEvent=t,this.pointerScheduler.schedule(),this.extraDebugStats.mouseX=t.offsetX,this.extraDebugStats.mouseY=t.offsetY,this.update(6)}onLeave(t){this.tooltip.pointerLeftOntoTooltip(t)||(this.resetPointer(),this.update(6),this.ctx.cursorManager.updateCursor("chart"))}onBrowserFocus(t){t.delta>0?(this.focus.datum=void 0,this.focus.series=void 0,this.focus.datumIndex=0,this.focus.seriesIndex=0):(this.focus.datum=void 0,this.focus.series=void 0,this.focus.datumIndex=1/0,this.focus.seriesIndex=1/0)}onAnimationStart(){this.focus.hasFocus&&this.onBlur()}onBlur(){this.ctx.regionManager.updateFocusIndicatorRect(void 0),this.resetPointer(),this.focus.hasFocus=!1}onTab(t){this.handleFocus(),t.consume(),this.focus.hasFocus=!0}onNavVert(t){this.focus.seriesIndex+=t.delta,this.handleFocus(),t.consume()}onNavHori(t){this.focus.datumIndex+=t.delta,this.handleFocus(t.delta),t.consume()}onSubmit(t){const{series:e,datum:i}=this.focus,s=t.sourceEvent.sourceEvent;void 0!==e&&void 0!==i?e.fireNodeClickEvent(s,i):this.fireEvent({type:"click",event:s})}onContextMenu(t){this.ctx.tooltipManager.removeTooltip(this.id);const{Default:e,ContextMenu:i}=ph;this.ctx.interactionManager.getState()&(e|i)&&this.checkSeriesNodeRange(t,()=>{this.ctx.highlightManager.updateHighlight(this.id)})}handleFocus(t){this.focus.hasFocus=!0;const e=this.overlays.getFocusInfo();null==e?this.handleSeriesFocus(null!=t?t:0):(this.ctx.regionManager.updateFocusIndicatorRect(e.rect),this.ctx.ariaAnnouncementService.announceValue(e.text))}handleSeriesFocus(t){const{series:e,seriesRect:i,focus:s}=this,n=e.filter(t=>t.visible);if(0===n.length)return;s.seriesIndex=_s(0,s.seriesIndex,n.length-1),s.series=n[s.seriesIndex];const a=s.series.pickFocus({datumIndex:s.datumIndex,datumIndexDelta:t,seriesRect:i});if(void 0===a)return;const{datum:o,datumIndex:r}=a;s.datumIndex=r,s.datum=o;const l=ac(this.ctx.regionManager,a);if(void 0!==l){this.lastInteractionEvent=l;const t=s.series.getTooltipHtml(o),e=Fh.makeTooltipMeta(this.lastInteractionEvent,o);this.ctx.highlightManager.updateHighlight(this.id,o),this.ctx.tooltipManager.updateTooltip(this.id,e,t),this.ctx.ariaAnnouncementService.announceValue(t.ariaLabel)}}static isHoverEvent(t){return void 0!==t&&"hover"===t.type}handlePointer(e,i){if(16!==this.ctx.interactionManager.getState()||!t.isHoverEvent(e))return;const{lastPick:s,hoverRect:n}=this,{offsetX:a,offsetY:o}=e,r=(t=!1)=>{s&&this.resetPointer(t)};(i?!this.ctx.animationManager.isActive():null==n?void 0:n.containsPoint(a,o))?(this.handlePointerTooltip(e,r),this.handlePointerNode(e)):r()}handlePointerTooltip(t,e){const{lastPick:i,tooltip:s}=this,{range:n}=s,{offsetX:a,offsetY:o}=t;let r;Vt(n)&&(r=n);const l=this.pickSeriesNode({x:a,y:o},"exact"===n,r);if(!l)return this.ctx.tooltipManager.removeTooltip(this.id),void("tooltip"===this.highlight.range&&e(!0));const h="node"===this.highlight.range||!i||i!==l.datum;let c;h&&(c=l.series.getTooltipHtml(l.datum),"tooltip"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id,l.datum));const d=null!=r,u=this.tooltip.enabled&&l.series.tooltipEnabled,p="exact"===n&&0===l.distance,g=u&&("nearest"===n||d||p)&&(!h||void 0!==c),m=Fh.makeTooltipMeta(t,l.datum);g&&this.ctx.tooltipManager.updateTooltip(this.id,m,c)}handlePointerNode(t){this.checkSeriesNodeRange(t,(t,e)=>{(t.hasEventListener("nodeClick")||t.hasEventListener("nodeDoubleClick"))&&this.ctx.cursorManager.updateCursor("chart","pointer"),"node"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id,e)})||(this.ctx.cursorManager.updateCursor("chart"),"node"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id))}onClick(t){this.checkSeriesNodeClick(t)?this.update(4):this.fireEvent({type:"click",event:t.sourceEvent})}onDoubleClick(t){this.checkSeriesNodeDoubleClick(t)?this.update(4):this.fireEvent({type:"doubleClick",event:t.sourceEvent})}checkSeriesNodeClick(t){return this.checkSeriesNodeRange(t,(e,i)=>e.fireNodeClickEvent(t.sourceEvent,i))}checkSeriesNodeDoubleClick(t){return this.checkSeriesNodeRange(t,(e,i)=>e.fireNodeDoubleClickEvent(t.sourceEvent,i))}checkSeriesNodeRange(t,e){var i;const s=this.pickSeriesNode({x:t.offsetX,y:t.offsetY},!1),n=null==s?void 0:s.datum,a=null==n?void 0:n.series.properties.nodeClickRange;let o;Vt(a)&&(o=a);let r=this.pickSeriesNode({x:t.offsetX,y:t.offsetY},!0);if(r?this.ctx.highlightManager.updatePicked(this.id,r.datum):this.ctx.highlightManager.updatePicked(this.id),n&&"nearest"===a)return e(n.series,n),!0;if("exact"!==a&&(r=this.pickSeriesNode({x:t.offsetX,y:t.offsetY},!1,o)),!r)return!1;const l=null!=o,h="exact"===a&&0===r.distance;return!(!l&&!h||void 0!==t.pointerHistory&&!(null==(i=t.pointerHistory)?void 0:i.every(t=>{const e={x:t.offsetX,y:t.offsetY},i=this.pickSeriesNode(e,!1,o);return(null==i?void 0:i.datum)===(null==r?void 0:r.datum)})))&&(e(r.series,r.datum),!0)}changeHighlightDatum(t){var e,i;const s=new Set,{series:n,datum:a}=null!=(e=t.currentHighlight)?e:{},{series:o,datum:r}=null!=(i=t.previousHighlight)?i:{};o&&s.add(o),n&&s.add(n),(null==o?void 0:o.properties.cursor)&&r&&this.ctx.cursorManager.updateCursor(o.id),(null==n?void 0:n.properties.cursor)&&a&&this.ctx.cursorManager.updateCursor(n.id,n.properties.cursor),this.lastPick=t.currentHighlight,null==n||null==o?this.update(4):this.update(4,{seriesToUpdate:s})}waitForUpdate(t=1e4,e=!1){return S(this,null,function*(){const i=performance.now();for(this._pendingFactoryUpdatesCount>0&&(yield this.updateMutex.waitForClearAcquireQueue());7!==this.performUpdateType;){if(performance.now()-i>t){const i=`Chart.waitForUpdate() timeout of ${t} reached - first chart update taking too long.`;if(e)throw new Error(i);E.warnOnce(i)}yield Ul(50)}yield this.updateMutex.waitForClearAcquireQueue()})}waitForDataProcess(t){return new Promise(e=>{this.dataProcessListeners.add(e),Wt(t)&&setTimeout(()=>{this.dataProcessListeners.has(e)&&(this.dataProcessListeners.delete(e),e())},t)})}getMinRects(){const{width:t,height:e}=this.ctx.scene,i=this.series.map(i=>i.getMinRects(t,e)).filter(Nt);if(0===i.length)return;let s=0,n=0,a=0,o=0;for(const{minRect:t,minVisibleRect:e}of i)s=Math.max(s,t.width),n=Math.max(n,t.height),a=Math.max(a,e.width),o=Math.max(o,e.height);const r=new Js(0,0,s,n);let l=r.clone();return a>0&&o>0&&(l=new Js(0,0,a,o)),{minRect:r,minVisibleRect:l}}filterMiniChartSeries(t){return null==t?void 0:t.filter(t=>!1!==t.showInMiniChart)}applyOptions(t){var e,i,s,n,a;const o=this.processedOptions,r=t.diffOptions(o),l=t.userOptions;if(null==r)return;ed("AgChartV2.updateDelta() - applying delta",r);const h=Xt(r,o),c=this.applyModules(h);r.listeners&&this.registerListeners(this,r.listeners),we(this,r,{skip:["type","data","series","listeners","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","axes","topology"]});let d=!1,u="no-op";(null==(e=r.series)?void 0:e.length)&&(u=this.applySeries(this,r.series,null==o?void 0:o.series),d=!0),"replaced"===u&&this.resetAnimations(),this.applyAxes(this,h,o,u)&&(d=!0),r.data&&(this.data=r.data),(null==(i=r.legend)?void 0:i.listeners)&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,r.legend.listeners),r.listeners&&this.updateAllSeriesListeners(),this.chartOptions=t,this.processedOptions=h,this.userOptions=Xt(l,this.userOptions);const p=this.modulesManager.getModule("navigator"),g=this.modulesManager.getModule("zoom");(null==p?void 0:p.enabled)||(null==g?void 0:g.enabled)||this.ctx.zoomManager.updateZoom("chart");const m=null==p?void 0:p.miniChart,y=null!=(a=null==(n=null==(s=h.navigator)?void 0:s.miniChart)?void 0:n.series)?a:h.series;!0===(null==m?void 0:m.enabled)&&null!=y?this.applyMiniChartOptions(m,y,h,o):!1===(null==m?void 0:m.enabled)&&(m.series=[],m.axes=[]),Ds("\n/* Reset */\n\n[class^='ag-charts'],\n[class^='ag-charts']:focus,\n[class^='ag-charts']:after,\n[class^='ag-charts']:before {\n    box-sizing: border-box;\n    outline: none;\n}\n\nbutton[class^='ag-charts'] {\n    background: none;\n    border: 0;\n}\n\n\n\n/* Icons */\n\n[class^='ag-charts-icon'] {\n    display: block;\n    /* speak: none; */\n    mask-size: contain;\n    mask-repeat: no-repeat;\n    background-color: currentColor;\n}\n\n.ag-charts-icon-zoom-in {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+);\n}\n\n.ag-charts-icon-zoom-out {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-reset {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXJvdGF0ZS1jY3ciPjxwYXRoIGQ9Ik0zIDEyYTkgOSAwIDEgMCA5LTkgOS43NSA5Ljc1IDAgMCAwLTYuNzQgMi43NEwzIDgiLz48cGF0aCBkPSJNMyAzdjVoNSIvPjwvc3ZnPg==);\n}\n\n.ag-charts-icon-pan-left {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tbGVmdCI+PHBhdGggZD0ibTE1IDE4LTYtNiA2LTYiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-pan-right {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQiPjxwYXRoIGQ9Im05IDE4IDYtNi02LTYiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-pan-start {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tZmlyc3QiPjxwYXRoIGQ9Im0xNyAxOC02LTYgNi02Ii8+PHBhdGggZD0iTTcgNnYxMiIvPjwvc3ZnPg==);\n}\n\n.ag-charts-icon-pan-end {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tbGFzdCI+PHBhdGggZD0ibTcgMTggNi02LTYtNiIvPjxwYXRoIGQ9Ik0xNyA2djEyIi8+PC9zdmc+);\n}\n\n\n\n/* AG Charts Theme Default */\n\n.ag-charts-theme-default,\n.ag-charts-theme-default-dark {\n    /* Colors */\n    --ag-charts-active-color: var(--ag-active-color, #2196f3);\n    --ag-charts-background-color: var(--ag-background-color, #fff);\n    --ag-charts-foreground-color: var(--ag-foreground-color, #181d1f);\n    --ag-charts-border-color: var(--ag-border-color, #dddddd);\n\n    /* Sizing */\n    --ag-charts-font-size: var(--ag-font-size, 14px);\n    --ag-charts-size: var(--ag-grid-size, 8px);\n\n    /* Borders */\n    --ag-charts-border: var(--ag-borders, solid 1px);\n    --ag-charts-border-critical: var(--ag-borders-critical, solid 1px);\n\n    /* Toolbar */\n    --ag-charts-toolbar-foreground-color: var(--ag-header-foreground-color, var(--ag-charts-foreground-color));\n    --ag-charts-toolbar-background-color: var(\n        --ag-header-background-color,\n        color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 2%)\n    );\n    --ag-charts-toolbar-size: var(--ag-header-height, 48px);\n    --ag-charts-toolbar-padding: calc(var(--ag-charts-size) * 2);\n    --ag-charts-toolbar-border: var(--ag-charts-border, solid 1px) var(--ag-charts-border-color);\n    --ag-charts-toolbar-border-critical: var(--ag-charts-border-critical, solid 1px) var(--ag-charts-border-color);\n    --ag-charts-toolbar-hover-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-active-color) 12%);\n    --ag-charts-toolbar-disabled-foreground-color: var(\n        --ag-disabled-foreground-color,\n        color-mix(in srgb, transparent, var(--ag-charts-toolbar-foreground-color) 50%)\n    );\n    --ag-charts-toolbar-disabled-background-color: var(\n        --ag-input-disabled-background-color,\n        color-mix(in srgb, var(--ag-charts-toolbar-background-color), var(--ag-charts-toolbar-foreground-color) 6%)\n    );\n    --ag-charts-toolbar-gap: var(--ag-charts-size);\n\n    /* Buttons */\n    --ag-charts-button-padding: var(--ag-charts-size);\n    --ag-charts-button-radius: var(--ag-border-radius, 4px);\n\n    /* Focus Indicator */\n    --ag-charts-focus-border: solid 2px var(--ag-input-focus-border-color, var(--ag-charts-active-color));\n    --ag-charts-focus-border-shadow: var(--ag-input-focus-box-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-focus-border) 47%));\n\n    /* Icons */\n    --ag-charts-icon-font-family: 'agChartsDefault';\n    --ag-charts-icon-font-weight: normal;\n    --ag-charts-icon-font-color: color-mix(in srgb, transparent, var(--ag-charts-foreground-color), 90%);\n}\n\n\n\n/* AG Charts Theme Default Dark */\n\n.ag-charts-theme-default-dark {\n    /* Colors */\n    --ag-charts-background-color: var(--ag-background-color, color-mix(in srgb, #fff, #182230 97%));\n    --ag-charts-foreground-color: var(--ag-foreground-color, #fff);\n    --ag-charts-border-color: var(--ag-border-color, rgba(255, 255, 255, 0.16));\n    --ag-charts-hover-color: var(\n        --ag-row-hover-color,\n        color-mix(in srgb, transparent, var(--ag-charts-active-color) 20%)\n    );\n\n    /* Toolbar */\n    --ag-charts-toolbar-background-color: var(--ag-header-background-color, color-mix(in srgb, #fff, #182230 93%));\n}\n\n\n","chart"),this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes),d||(d=this.shouldForceNodeDataRefresh(r,u));const f=d||c?0:3;this.maybeResetAnimations(u),ed("AgChartV2.applyChartOptions() - update type",_h[f],{seriesStatus:u,forceNodeDataRefresh:d}),this.update(f,{forceNodeDataRefresh:d,newAnimationBatch:!0})}maybeResetAnimations(t){if("standalone"===this.mode)switch(t){case"series-grouping-change":case"replaced":this.resetAnimations()}}shouldForceNodeDataRefresh(t,e){const i=!!t.data||"data-change"===e||"replaced"===e,s=Ae.getKeys(),n=Object.values(s).some(e=>null!=t[e]),a=null!=t.title&&null!=t.subtitle;return i||n||a}applyMiniChartOptions(t,e,i,s){var n,a,o,r,l;const h=null!=(o=null==(a=null==(n=null==s?void 0:s.navigator)?void 0:n.miniChart)?void 0:a.series)?o:null==s?void 0:s.series,c=this.applySeries(t,this.filterMiniChartSeries(e),this.filterMiniChartSeries(h));this.applyAxes(t,i,s,c,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const d=t.axes,u=d.find(t=>"x"===t.direction);for(const t of d)t.gridLine.enabled=!1,t.label.enabled=t===u,t.tick.enabled=!1,t.interactionEnabled=!1;if(null!=u){const t=null==(r=i.navigator)?void 0:r.miniChart,e=null==t?void 0:t.label,s=null==(l=null==t?void 0:t.label)?void 0:l.interval;u.line.enabled=!1,u.label.set(Qt(e,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),u.tick.set(Qt(s,["enabled","width","size","color","interval","step"]));const n=null==s?void 0:s.step;null!=n&&(u.tick.interval=n)}}applyModules(t){var e;const{type:i}=this.constructor;let s=!1;for(const n of Mt.byType("root","legend")){const a=null!=t[n.optionsKey]&&n.chartTypes.includes(i);a!==this.modulesManager.isEnabled(n)&&(a?(this.modulesManager.addModule(n,t=>new t.instanceConstructor(this.getModuleContext())),"legend"===n.type&&(null==(e=this.modulesManager.getModule(n))||e.attachLegend(this.ctx.scene)),this[n.optionsKey]=this.modulesManager.getModule(n)):(this.modulesManager.removeModule(n),delete this[n.optionsKey]),s=!0)}return s}applySeries(t,e,i){var s;if(!e)return"no-change";const n=function(t,e,i){var s,n,a,o;const r=(t,e)=>{const i=[t];for(const t of hc)t in e&&null!=e[t]&&i.push(`${t}=${e[t]}`);return i.join(";")},l=new Map;let h=0;for(const e of t){const t=r(e.type,e.properties);l.has(t)||l.set(t,[]),null==(s=l.get(t))||s.push([e,h++])}const c=new Map;for(const t of e){const e=r(t.type,t);c.has(e)||c.set(e,[]),null==(n=c.get(e))||n.push(t)}if(![...l.keys()].some(t=>c.has(t)))return{status:"no-overlap",oldKeys:l.keys(),newKeys:c.keys()};const d=[];let u=-1;for(const[t,e]of c.entries())for(const s of e){u++;const e=l.get(t);if(null==e||e.length<1){d.push({opts:s,idx:u,status:"add"}),l.delete(t);continue}const[n,r]=e.shift(),h=Se(null!=(a=null==i?void 0:i[r])?a:{},null!=s?s:{}),{groupIndex:c,stackIndex:p}=null!=(o=null==h?void 0:h.seriesGrouping)?o:{};null!=c||null!=p?d.push({opts:s,series:n,diff:h,idx:r,status:"series-grouping"}):h?d.push({opts:s,series:n,diff:h,idx:r,status:"update"}):d.push({opts:s,series:n,idx:r,status:"no-op"}),0===e.length&&l.delete(t)}for(const t of l.values())for(const[e,i]of t)d.push({series:e,idx:i,status:"remove"});return{status:"overlap",changes:d}}(t.series,e,i);if("no-overlap"===n.status)return ed(`AgChartV2.applySeries() - creating new series instances, status: ${n.status}`,n),t.series=e.map(t=>this.createSeries(t)),"replaced";ed("AgChartV2.applySeries() - matchResult",n);const a=[];let o=!1,r=!1,l=!1;for(const t of n.changes)switch(r||(r="series-grouping"===t.status),o||(o=null!=(null==(s=t.diff)?void 0:s.data)),l||(l="no-op"!==t.status),t.status){case"add":const e=this.createSeries(t.opts);a.push(e),ed("AgChartV2.applySeries() - created new series",e);break;case"remove":ed(`AgChartV2.applySeries() - removing series at previous idx ${t.idx}`,t.series);break;case"no-op":a.push(t.series),ed(`AgChartV2.applySeries() - no change to series at previous idx ${t.idx}`,t.series);break;default:const{series:i,diff:s,idx:n}=t;ed(`AgChartV2.applySeries() - applying series diff previous idx ${n}`,s,i),this.applySeriesValues(i,s),i.markNodeDataDirty(),a.push(i)}for(let t=0;t<a.length;t++)a[t]._declarationOrder=t;return ed("AgChartV2.applySeries() - final series instances",a),t.series=a,r?"series-grouping-change":o?"data-change":l?"updated":"no-op"}applyAxes(t,e,i,s,n=[]){if(!("axes"in e)||!e.axes)return!1;n=["axes[].type",...n];const{axes:a}=e;return"replaced"!==s&&t.axes.length===a.length&&t.axes.every((t,e)=>t.type===a[e].type)&&ue(i)?(t.axes.forEach((t,e)=>{var s,o;const r=Se(null!=(o=null==(s=i.axes)?void 0:s[e])?o:{},a[e]);ed(`AgChartV2.applyAxes() - applying axis diff idx ${e}`,r);const l=`axes[${e}]`;we(t,r,y(m({},$a),{path:l,skip:n}))}),!0):(ed(`AgChartV2.applyAxes() - creating new axes instances; seriesStatus: ${s}`),t.axes=this.createAxis(a,n),!0)}createSeries(t){const e=Le.create(t.type,this.getModuleContext());return this.applySeriesOptionModules(e,t),this.applySeriesValues(e,t),e}applySeriesOptionModules(t,e){const i=t.createModuleContext(),s=t.getModuleMap();for(const n of Mt.byType("series-option"))n.optionsKey in e&&n.seriesTypes.includes(t.type)&&s.addModule(n,t=>new t.instanceConstructor(i))}applySeriesValues(t,e){const i=t.getModuleMap(),s=e,{type:n,data:a,listeners:o,seriesGrouping:r,showInMiniChart:l}=s,h=f(s,["type","data","listeners","seriesGrouping","showInMiniChart"]);for(const t of le)if("series-option"===t.type&&t.optionsKey in h){const e=i.getModule(t.optionsKey),s=h[t.optionsKey];delete h[t.optionsKey],e.properties.set(s)}t.properties.set(h),"data"in e&&t.setOptionsData(a),o&&this.registerListeners(t,o),"seriesGrouping"in e&&(t.seriesGrouping=null==r?void 0:m(m({},t.seriesGrouping),r))}createAxis(t,e){const i=new lc,s=this.getModuleContext();for(let n=0;n<t.length;n++){const a=t[n],o=kt.create(a.type,s);this.applyAxisModules(o,a),we(o,a,y(m({},$a),{path:`axes[${n}]`,skip:e})),i.push(o,a)}return i.guessInvalidPositions()}applyAxisModules(t,e){const i=t.createModuleContext(),s=t.getModuleMap();for(const n of Mt.byType("axis-option")){const a=null!=e[n.optionsKey];a!==s.isEnabled(n)&&(a?(s.addModule(n,t=>new t.instanceConstructor(i)),t[n.optionsKey]=s.getModule(n)):(s.removeModule(n),delete t[n.optionsKey]))}}registerListeners(t,e){t.clearEventListeners();for(const[i,s]of Object.entries(e))Ft(s)&&t.addEventListener(i,s)}};sd.chartsInstances=new WeakMap,b([Xr({newValue(t){this.destroyed||(t.setAttribute("data-ag-charts",""),t.appendChild(this.element),sd.chartsInstances.set(t,this))},oldValue(t){t.removeAttribute("data-ag-charts"),t.removeChild(this.element),sd.chartsInstances.delete(t)}})],sd.prototype,"container",2),b([Xr({newValue(t){this.resize(t,void 0,"width option")}})],sd.prototype,"width",2),b([Xr({newValue(t){this.resize(void 0,t,"height option")}})],sd.prototype,"height",2),b([Xr({newValue(t){this.onAutoSizeChange(t)}}),$n(Qn)],sd.prototype,"autoSize",2),b([$n(Zn)],sd.prototype,"padding",2),b([$n(Zn)],sd.prototype,"seriesArea",2),b([$n(Zn)],sd.prototype,"title",2),b([$n(Zn)],sd.prototype,"subtitle",2),b([$n(Zn)],sd.prototype,"footnote",2),b([$n(Zn)],sd.prototype,"keyboard",2),b([$n(Ba(["standalone","integrated"],"a chart mode"))],sd.prototype,"mode",2),b([Xr({changeValue(t,e){this.onAxisChange(t,e)}})],sd.prototype,"axes",2),b([Xr({changeValue(t,e){this.onSeriesChange(t,e)}})],sd.prototype,"series",2);var nd=sd;function ad(t,e,i,s,n,a,o,r){const l=(i-t)*(r-a)-(s-e)*(o-n);if(0===l)return 0;const h=((o-n)*(e-a)-(t-n)*(r-a))/l,c=((i-t)*(e-a)-(s-e)*(t-n))/l;return h>=0&&h<=1&&c>=0&&c<=1?1:0}function od(t,e,i,s,n,a,o,r,l,h,c,d){let u=0;const p=h-d,g=c-l,m=l*(d-h)-h*(c-l),y=rd(t,i,n,o),f=rd(e,s,a,r),x=function(t,e,i,s){if(0===t)return function(t,e,i){if(0===t)return function(t,e){const i=-e/t;return 0!==t&&i>=0&&i<=1?[i]:[]}(e,i);const s=e*e-4*t*i,n=[];if(0===s){const i=-e/(2*t);i>=0&&i<=1&&n.push(i)}else if(s>0){const i=Math.sqrt(s),a=(-e-i)/(2*t),o=(-e+i)/(2*t);a>=0&&a<=1&&n.push(a),o>=0&&o<=1&&n.push(o)}return n}(e,i,s);const n=e/t,a=i/t,o=(3*a-n*n)/9,r=(9*n*a-s/t*27-2*n*n*n)/54,l=o*o*o+r*r,h=1/3,c=[];if(l>=0){const t=Math.sqrt(l),e=Math.sign(r+t)*Math.pow(Math.abs(r+t),h),i=Math.sign(r-t)*Math.pow(Math.abs(r-t),h),s=Math.abs(Math.sqrt(3)*(e-i)/2),a=-h*n+(e+i);if(a>=0&&a<=1&&c.push(a),0===s){const t=-h*n-(e+i)/2;t>=0&&t<=1&&c.push(t)}}else{const t=Math.acos(r/Math.sqrt(-o*o*o)),e=h*n,i=2*Math.sqrt(-o),s=i*Math.cos(h*t)-e,a=i*Math.cos(h*(t+2*Math.PI))-e,l=i*Math.cos(h*(t+4*Math.PI))-e;s>=0&&s<=1&&c.push(s),a>=0&&a<=1&&c.push(a),l>=0&&l<=1&&c.push(l)}return c}(p*y[0]+g*f[0],p*y[1]+g*f[1],p*y[2]+g*f[2],p*y[3]+g*f[3]+m);for(const t of x){const e=t*t,i=t*e,s=y[0]*i+y[1]*e+y[2]*t+y[3],n=f[0]*i+f[1]*e+f[2]*t+f[3];let a;a=l===c?(n-h)/(d-h):(s-l)/(c-l),a>=0&&a<=1&&u++}return u}function rd(t,e,i,s){return[3*e-t-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function ld(t,e,i,s,n,a,o,r,l,h){if(isNaN(t)||isNaN(e))return 0;a&&([n,s]=[s,n]);const c=(h-r)/(l-o),d=r-c*o,u=Math.pow(c,2)+1,p=2*(c*(d-e)-t),g=Math.pow(t,2)+Math.pow(d-e,2)-Math.pow(i,2),m=Math.pow(p,2)-4*u*g;if(m<0)return 0;const y=(-p+Math.sqrt(m))/2/u,f=(-p-Math.sqrt(m))/2/u;let x=0;return[y,f].forEach(i=>{if(!(i>=Math.min(o,l)&&i<=Math.max(o,l)))return;const a=i-t,r=c*i+d-e;Fn(Math.atan2(r,a),s,n)&&x++}),x}var hd=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.openedPath=!1,this.closedPath=!1}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,a){this.openedPath=!0,this.path2d.arc(t,e,i,s,n,a),this.commands.push(2),this.params.push(t,e,i,s,n,a?1:0)}cubicCurveTo(t,e,i,s,n,a){this.openedPath||this.moveTo(t,e),this.path2d.bezierCurveTo(t,e,i,s,n,a),this.commands.push(3),this.params.push(t,e,i,s,n,a)}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,a=-1e4,o=-1e4;let r=NaN,l=NaN,h=0,c=0,d=0;for(let u=0,p=0;u<n;u++)switch(i[u]){case 0:d+=ad(r,l,h,c,a,o,t,e),h=s[p++],r=h,c=s[p++],l=c;break;case 1:d+=ad(h,c,s[p++],s[p++],a,o,t,e),h=s[p-2],c=s[p-1];break;case 3:d+=od(h,c,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],a,o,t,e),h=s[p-2],c=s[p-1];break;case 2:const i=s[p++],n=s[p++],u=s[p++],g=s[p++],m=s[p++];d+=ld(i,n,u,g,m,Boolean(s[p++]),a,o,t,e),isNaN(r)||(d+=ad(h,c,i+Math.cos(g)*u,n+Math.sin(g)*u,a,o,t,e)),h=i+Math.cos(m)*u,c=n+Math.sin(m)*u;break;case 4:d+=ad(r,l,h,c,a,o,t,e)}return d%2==1}distanceSquared(t,e){let i=1/0;const s=this.commands,n=this.params,a=s.length;let o=NaN,r=NaN,l=0,h=0;for(let c=0,d=0;c<a;c++)switch(s[c]){case 0:l=o=n[d++],h=r=n[d++];break;case 1:i=Br(t,e,l,h,n[d++],n[d++],i);break;case 3:E.error("Command.Curve distanceSquare not implemented");break;case 2:{const s=n[d++],a=n[d++],o=n[d++],r=n[d++],c=n[d++],u=s+Math.cos(r)*o,p=a+Math.sin(r)*o,g=Boolean(n[d++]);i=Br(t,e,l,h,u,p,i),i=Fr(t,e,s,a,o,r,c,g,i),l=s+Math.cos(c)*o,h=a+Math.sin(c)*o;break}case 4:i=Br(t,e,l,h,o,r,i)}return i}getPoints(){const{commands:t,params:e}=this,i=[];let s=0;for(let n=0;n<t.length;n++)switch(t[n]){case 0:case 1:i.push({x:e[s++],y:e[s++]});break;case 3:s+=4,i.push({x:e[s++],y:e[s++]});break;case 2:i.push({x:e[s++],y:e[s++]}),s+=4}return i}};function cd(t){const{redraw:e=3,changeCb:i,convertor:s}=null!=t?t:{};return sn({redraw:e,type:"path",convertor:s,changeCb:i})}var dd=class extends Lo{constructor(){super(...arguments),this.path=new hd,this._clipX=NaN,this._clipY=NaN,this._dirtyPath=!0}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(this,3))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){var t,e,i,s;this._dirtyPath||(this.dirtyPath=this.path.isDirty()||null!=(e=null==(t=this.fillShadow)?void 0:t.isDirty())&&e||null!=(s=null==(i=this._clipPath)?void 0:i.isDirty())&&s)}isPointInPath(t,e){const i=this.transformPoint(t,e);return this.path.closedPath&&this.path.isPointInPath(i.x,i.y)}distanceSquared(t,e){const i=this.transformPoint(t,e);return this.path.distanceSquared(i.x,i.y)}isDirtyPath(){return!1}updatePath(){}render(t){var e,i,s,n;const{ctx:a,forceRender:o,stats:r}=t;if(0!==this.dirty||o){if(this.computeTransformMatrix(),this.matrix.toContext(a),(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),isNaN(this._clipX)||isNaN(this._clipY)||null==this.clipMode)this.drawPath(a);else{a.save();const t=this.strokeWidth/2;if(null!=this._clipPath||(this._clipPath=new hd),this._clipPath.clear(),this._clipPath.rect(-t,-t,this._clipX+t,this._clipY+t+t),"normal"===this.clipMode&&a.clip(null==(e=this._clipPath)?void 0:e.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(a),"punch-out"===this.clipMode){a.clip(null==(i=this._clipPath)?void 0:i.getPath2D());const{x:t=-1e4,y:e=-1e4,width:n=2e4,height:o=2e4}=null!=(s=this.computeBBox())?s:{};a.clearRect(t,e,n,o)}a.restore()}null==(n=this.fillShadow)||n.markClean(),super.render(t)}else r&&(r.nodesSkipped+=this.nodeCount.count)}drawPath(t){this.fillStroke(t,this.path.getPath2D())}};dd.className="Path",b([cd()],dd.prototype,"clipMode",2),b([cd()],dd.prototype,"clipX",1),b([cd()],dd.prototype,"clipY",1);var ud=class{constructor(t,e,i){this.root=new md(t,e,i)}clear(t){this.root.clear(t)}addValue(t,e){const i={hitTester:t,value:e,distanceSquared:(e,i)=>t.distanceSquared(e,i)};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}},pd=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)}},gd=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=null!=i?i:Js.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)&&(void 0===this.subdivisions?0===this.maxdepth||this.elems.length<this.capacity?this.elems.push(t):this.subdivide(t):this.subdivisions.addElem(t))}find(t,e,i){this.findCondition(t,e,i)&&(void 0===this.subdivisions?this.findAction(t,e,i):this.subdivisions.find(t,e,i))}subdivide(t){this.subdivisions=this.makeSubdivisions();for(const t of this.elems)this.subdivisions.addElem(t);this.subdivisions.addElem(t),this.elems.length=0}makeSubdivisions(){const{x:t,y:e,width:i,height:s}=this.boundary,{capacity:n}=this,a=this.maxdepth-1,o=i/2,r=s/2,l=new Js(t,e,o,r),h=new Js(t+o,e,o,r),c=new Js(t,e+r,o,r),d=new Js(t+o,e+r,o,r);return new pd(this.child(n,a,l),this.child(n,a,h),this.child(n,a,c),this.child(n,a,d))}},md=class t extends gd{addCondition(t){const{x:e,y:i}=t.hitTester.midPoint;return this.boundary.containsPoint(e,i)}findCondition(t,e,i){const{best:s}=i;return 0!==s.distanceSquared&&this.boundary.distanceSquared(t,e)<s.distanceSquared}findAction(t,e,i){const s=Zs(t,e,this.elems,i.best.distanceSquared);void 0!==s.nearest&&s.distanceSquared<i.best.distanceSquared&&(i.best=s)}child(e,i,s){return new t(e,i,s)}},yd=class extends dd{constructor(){super(...arguments),this.x=0,this.y=0,this.size=12}computeBBox(){const{x:t,y:e,size:i}=this,{center:s}=this.constructor;return new Js(t-i*s.x,e-i*s.y,i,i)}applyPath(t,e){const{path:i}=this;let{x:s,y:n}=this;null!=this.repeat&&(s=0,n=0),i.clear();for(const{x:a,y:o,t:r}of e)s+=a*t,n+=o*t,"move"===r?i.moveTo(s,n):i.lineTo(s,n);i.closePath()}executeFill(t,e){if(!e)return;if(null==this.repeat)return super.executeFill(t,e);t.save();let i=this.translationX,s=this.translationY;for(const n of this.repeat)t.translate(n.x-i,n.y-s),t.fill(e),i=n.x,s=n.y;t.restore()}executeStroke(t,e){if(!e)return;if(null==this.repeat)return super.executeStroke(t,e);t.save();let i=this.translationX,s=this.translationY;for(const n of this.repeat)t.translate(n.x-i,n.y-s),t.stroke(e),i=n.x,s=n.y;t.restore()}};yd.center={x:.5,y:.5},b([cd()],yd.prototype,"x",2),b([cd()],yd.prototype,"y",2),b([cd({convertor:Math.abs})],yd.prototype,"size",2),b([cd()],yd.prototype,"repeat",2);var fd=class extends yd{updatePath(){const{x:t,y:e,path:i,size:s}=this,n=s/2;i.clear(),i.arc(t,e,n,0,2*Math.PI),i.closePath()}};fd.className="Circle";var xd=class t extends yd{updatePath(){const e=this.size/4.2;super.applyPath(e,t.moves)}};xd.className="Cross",xd.moves=[{x:-1,y:0,t:"move"},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:-1,y:1},{x:-1,y:-1}];var bd=xd,vd=class t extends yd{updatePath(){const e=this.size/2;super.applyPath(e,t.moves)}};vd.className="Diamond",vd.moves=[{x:0,y:-1,t:"move"},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:1,y:-1}];var Sd=vd,Md=class extends yd{rad(t){return t/180*Math.PI}updatePath(){const{x:t,path:e,size:i,rad:s}=this,n=i/4,a=this.y+n/2;e.clear(),e.arc(t-n,a-n,n,s(130),s(330)),e.arc(t+n,a-n,n,s(220),s(50)),e.lineTo(t,a+n),e.closePath()}};Md.className="Heart";var kd=class extends yd{updatePath(){const{path:t,x:e,y:i}=this,s=this.size,n=.5;t.clear(),t.moveTo(e+-.34375*s,i+-.65625*s),t.cubicCurveTo(e+-.34375*s,i+-.848509*s,e+-.192259*s,i+-1*s,e+0*s,i+-1*s),t.cubicCurveTo(e+(.692259-n)*s,i+-1*s,e+.34375*s,i+-.848509*s,e+.34375*s,i+-.65625*s),t.cubicCurveTo(e+.34375*s,i+-.506176*s,e+.284625*s,i+(.600181-1)*s,e+(.716461-n)*s,i+(.695393-1)*s),t.cubicCurveTo(e+.199009*s,i+-.280231*s,e+(.681271-n)*s,i+-.256896*s,e+(.663785-n)*s,i+(.766105-1)*s),t.cubicCurveTo(e+(.611893-n)*s,i+(.834367-1)*s,e+(.562228-n)*s,i+(.899699-1)*s,e+(.528896-n)*s,i+(.980648-1)*s),t.cubicCurveTo(e+(.524075-n)*s,i+(.992358-1)*s,e+(.512663-n)*s,i+0*s,e+0*s,i+0*s),t.cubicCurveTo(e+(.487337-n)*s,i+0*s,e+(.475925-n)*s,i+(.992358-1)*s,e+(.471104-n)*s,i+(.980648-1)*s),t.cubicCurveTo(e+(.487337-n)*s,i+0*s,e+(.475925-n)*s,i+(.992358-1)*s,e+(.471104-n)*s,i+(.980648-1)*s),t.cubicCurveTo(e+(.437772-n)*s,i+(.899699-1)*s,e+(.388107-n)*s,i+(.834367-1)*s,e+(.336215-n)*s,i+(.766105-1)*s),t.cubicCurveTo(e+(.318729-n)*s,i+-.256896*s,e+-.199009*s,i+-.280231*s,e+(.283539-n)*s,i+(.695393-1)*s),t.cubicCurveTo(e+-.284625*s,i+(.600181-1)*s,e+-.34375*s,i+-.506176*s,e+-.34375*s,i+-.65625*s),t.closePath()}};kd.className="MapPin",kd.center={x:.5,y:1};var Dd=class t extends yd{updatePath(){const e=this.size/3;super.applyPath(e,t.moves)}};Dd.className="Plus",Dd.moves=[{x:-.5,y:-.5,t:"move"},{x:0,y:-1},{x:1,y:0},{x:0,y:1},{x:1,y:0},{x:0,y:1},{x:-1,y:0},{x:0,y:1},{x:-1,y:0},{x:0,y:-1},{x:-1,y:0},{x:0,y:-1}];var wd=Dd,Id=class extends yd{updatePath(){const{path:t,x:e,y:i}=this,s=this.size/2;t.clear(),t.moveTo(this.align(e-s),this.align(i-s)),t.lineTo(this.align(e+s),this.align(i-s)),t.lineTo(this.align(e+s),this.align(i+s)),t.lineTo(this.align(e-s),this.align(i+s)),t.closePath()}};Id.className="Square";var Cd=class extends yd{updatePath(){const{x:t,y:e,path:i,size:s}=this,n=s/2,a=Math.PI/2;i.clear();for(let o=0;o<10;o++){const r=o%2==0?s:n,l=o*Math.PI/5-a,h=t+Math.cos(l)*r,c=e+Math.sin(l)*r;i.lineTo(h,c)}i.closePath()}};Cd.className="Star";var Ld=class t extends yd{updatePath(){const e=1.1*this.size;super.applyPath(e,t.moves)}};Ld.className="Triangle",Ld.moves=[{x:0,y:-.48,t:"move"},{x:.5,y:.87},{x:-1,y:0}];var Ad=Ld,Td={circle:fd,cross:bd,diamond:Sd,heart:Md,pin:kd,plus:wd,square:Id,star:Cd,triangle:Ad},Nd=Object.keys(Td);function Od(t){return"string"==typeof t&&Nd.includes(t)}function Rd(t=Id){return Od(t)?Td[t]:"function"==typeof t?t:Id}var Ed=class extends Zc{constructor(){super(...arguments),this.showFocusBox=!0}getScaleInformation({xScale:t,yScale:e}){return{isContinuousX:Xa.is(t),isContinuousY:Xa.is(e),xScaleType:null==t?void 0:t.type,yScaleType:null==e?void 0:e.type}}getModulePropertyDefinitions(){var t,e;const i=null==(t=this.axes.x)?void 0:t.scale,s=null==(e=this.axes.y)?void 0:e.scale;return this.moduleMap.mapModules(t=>t.getPropertyDefinitions(this.getScaleInformation({xScale:i,yScale:s}))).flat()}requestDataModel(t,e,i){return S(this,null,function*(){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=yield t.request(this.id,null!=e?e:[],i);return this.dataModel=s,this.processedData=n,this.dispatch("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}})}isProcessedDataAnimatable(){var t,e;const i=null==(e=null==(t=this.processedData)?void 0:t.reduced)?void 0:e.animationValidation;if(!i)return!0;const{orderedKeys:s,uniqueKeys:n}=i;return s&&n}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(t){return this.doPickFocus(t,this)}doPickFocus(t,e){const i=this.getNodeData();if(void 0===i||0===i.length)return;const{datumIndexDelta:s,seriesRect:n}=t,a=this.computeFocusDatumIndex(t,i,e.seriesItemEnabled);if(void 0===a)return;const{showFocusBox:o}=this,r=i[a],l=this.computeFocusBounds({datumIndex:a,datumIndexDelta:s,seriesRect:n});return void 0!==l?{bbox:l,showFocusBox:o,datum:r,datumIndex:a}:void 0}computeFocusDatumIndex(t,e,i){i&&e.length!==i.length&&E.error(`invalid state: nodeData.length (${e.length} !== seriesItemEnabled.length (${null==i?void 0:i.length})`);const s=t=>{const s=e[t];return(void 0===s.missing||!1===s.missing)&&(void 0===i||i[t])},n=t=>{for(;t>=0&&!s(t);)t--;return-1===t?void 0:t},a=t=>{for(;t<e.length&&!s(t);)t++;return t===e.length?void 0:t};let o;const r=_s(0,t.datumIndex,e.length-1);return t.datumIndexDelta<0?o=n(r):t.datumIndexDelta>0?o=a(r):(null!=o||(o=a(r)),null!=o||(o=n(r))),void 0===o?0===t.datumIndexDelta?void 0:t.datumIndex-t.datumIndexDelta:o}},Pd=class extends fe{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};b([$n(ma,{optional:!0})],Pd.prototype,"fill",2),b([$n(na,{optional:!0})],Pd.prototype,"fillOpacity",2),b([$n(ma,{optional:!0})],Pd.prototype,"stroke",2),b([$n(sa,{optional:!0})],Pd.prototype,"strokeWidth",2),b([$n(na,{optional:!0})],Pd.prototype,"strokeOpacity",2),b([$n(Da,{optional:!0})],Pd.prototype,"lineDash",2),b([$n(sa,{optional:!0})],Pd.prototype,"lineDashOffset",2);var Bd=class extends fe{};b([$n(sa,{optional:!0})],Bd.prototype,"strokeWidth",2),b([$n(na,{optional:!0})],Bd.prototype,"dimOpacity",2),b([$n(Qn,{optional:!0})],Bd.prototype,"enabled",2);var Fd=class extends fe{constructor(){super(...arguments),this.color="black"}};b([$n(ma,{optional:!0})],Fd.prototype,"color",2);var zd=class extends fe{constructor(){super(...arguments),this.item=new Pd,this.series=new Bd,this.text=new Fd}};b([$n(Zn)],zd.prototype,"item",2),b([$n(Zn)],zd.prototype,"series",2),b([$n(Zn)],zd.prototype,"text",2);var Gd=class extends fe{constructor(){super(...arguments),this.visible=!0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlightStyle=new zd}};b([$n(ta,{optional:!0})],Gd.prototype,"id",2),b([$n(Qn)],Gd.prototype,"visible",2),b([$n(Qn)],Gd.prototype,"showInLegend",2),b([$n(ta)],Gd.prototype,"cursor",2),b([$n(Ea)],Gd.prototype,"nodeClickRange",2),b([$n(Zn)],Gd.prototype,"highlightStyle",2);var _d={x:["xKey"],y:["yKey"]},jd={x:["xName"],y:["yName"]},Wd=class extends Uc{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},Vd=class extends Gd{};b([$n(ta,{optional:!0})],Vd.prototype,"legendItemName",2);var Kd=class extends Ed{constructor(t){var e=t,{pathsPerSeries:i=1,hasMarkers:s=!1,hasHighlightedLabels:n=!1,pathsZIndexSubOrderOffset:a=[],datumSelectionGarbageCollection:o=!0,markerSelectionGarbageCollection:r=!0,animationAlwaysUpdateSelections:l=!1,animationResetFns:h,directionKeys:c,directionNames:d}=e,u=f(e,["pathsPerSeries","hasMarkers","hasHighlightedLabels","pathsZIndexSubOrderOffset","datumSelectionGarbageCollection","markerSelectionGarbageCollection","animationAlwaysUpdateSelections","animationResetFns","directionKeys","directionNames"]);if(super(m({directionKeys:c,directionNames:d,canHaveAxes:!0},u)),this.NodeEvent=Wd,this.dataNodeGroup=this.contentGroup.appendChild(new ko({name:`${this.id}-series-dataNodes`,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("data")})),this.markerGroup=this.contentGroup.appendChild(new ko({name:`${this.id}-series-markers`,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("marker")})),this.labelGroup=this.contentGroup.appendChild(new ko({name:`${this.id}-series-labels`,zIndex:8,zIndexSubOrder:this.getGroupZIndexSubOrder("labels")})),this.labelSelection=Er.select(this.labelGroup,Bo),this.highlightSelection=Er.select(this.highlightNode,()=>this.opts.hasMarkers?this.markerFactory():this.nodeFactory()),this.highlightLabelSelection=Er.select(this.highlightLabel,Bo),this.annotationSelections=new Set,this.minRectsCache={dirtyNodeData:!0},this.debug=Ls.create(),!c||!d)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:i,hasMarkers:s,hasHighlightedLabels:n,pathsZIndexSubOrderOffset:a,directionKeys:c,directionNames:d,animationResetFns:h,animationAlwaysUpdateSelections:l,datumSelectionGarbageCollection:o,markerSelectionGarbageCollection:r},this.paths=[];for(let t=0;t<i;t++)this.paths[t]=new dd,this.paths[t].zIndex=4,this.paths[t].zIndexSubOrder=this.getGroupZIndexSubOrder("paths",t),this.contentGroup.appendChild(this.paths[t]);this.datumSelection=Er.select(this.dataNodeGroup,()=>this.nodeFactory(),o),this.markerSelection=Er.select(this.markerGroup,()=>this.markerFactory(),r),this.animationState=new yr("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),highlightMarkers:t=>this.animateReadyHighlightMarkers(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:t=>this.resetAllAnimation(t),reset:"empty"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){var t;return null==(t=this.contextNodeData)?void 0:t.nodeData}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t?this.animationState.transition("skip"):"disabled"===t&&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(t){return S(this,arguments,function*({seriesRect:t}){var e,i;const{visible:s,_contextNodeData:n}=this,a=(null==(i=null==(e=this.ctx.highlightManager)?void 0:e.getActiveHighlight())?void 0:i.series)===this,o=this.checkResize(t),r=yield this.updateHighlightSelection(a);yield this.updateSelections(s),yield this.updateNodes(r,a,s);const l=this.getAnimationData(t,n);l&&(o&&this.animationState.transition("resize",l),this.animationState.transition("update",l))})}updateSelections(t){return S(this,null,function*(){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=yield this.createNodeData();const t=this.isProcessedDataAnimatable();this._contextNodeData&&(null!=(e=this._contextNodeData).animationValid||(e.animationValid=t)),this.minRectsCache.dirtyNodeData=!0;const{dataModel:i,processedData:s}=this;void 0!==i&&void 0!==s&&this.dispatch("data-update",{dataModel:i,processedData:s})}yield this.updateSeriesSelections()}})}updateSeriesSelections(t){return S(this,null,function*(){const{datumSelection:e,labelSelection:i,markerSelection:s,paths:n}=this,a=this._contextNodeData;if(!a)return;const{nodeData:o,labelData:r,itemId:l}=a;yield this.updatePaths({seriesHighlighted:t,itemId:l,contextData:a,paths:n}),this.datumSelection=yield this.updateDatumSelection({nodeData:o,datumSelection:e}),this.labelSelection=yield this.updateLabelSelection({labelData:r,labelSelection:i}),this.opts.hasMarkers&&(this.markerSelection=yield this.updateMarkerSelection({nodeData:o,markerSelection:s}))})}markerFactory(){return new(Rd())}getGroupZIndexSubOrder(t,e=0){var i;const s=super.getGroupZIndexSubOrder(t,e);if("paths"===t){const[t]=s,n=null!=(i=this.opts.pathsZIndexSubOrderOffset[e])?i:0;s[0]=Ft(t)?()=>Number(t())+n:Number(t)+n}return s}updateNodes(t,e,i){return S(this,null,function*(){var s;const{highlightSelection:n,highlightLabelSelection:a,opts:{hasMarkers:o,hasHighlightedLabels:r}}=this,l=!this.ctx.animationManager.isSkipped(),h=this.visible&&null!=this._contextNodeData&&i;this.rootGroup.visible=l||h,this.contentGroup.visible=l||h,this.highlightGroup.visible=(l||h)&&e;const c=this.getOpacity();o?(yield this.updateMarkerNodes({markerSelection:n,isHighlight:!0}),this.animationState.transition("highlightMarkers",n)):(yield this.updateDatumNodes({datumSelection:n,isHighlight:!0}),this.animationState.transition("highlight",n)),r&&(yield this.updateLabelNodes({labelSelection:a}));const{dataNodeGroup:d,markerGroup:u,datumSelection:p,labelSelection:g,markerSelection:m,paths:y,labelGroup:f}=this,{itemId:x}=null!=(s=this.contextNodeData)?s:{};d.opacity=c,d.visible=l||h,f.visible=h,o&&(u.opacity=c,u.zIndex=d.zIndex>=4?d.zIndex:d.zIndex+1,u.visible=h),f&&(f.opacity=c),yield this.updatePathNodes({seriesHighlighted:e,itemId:x,paths:y,opacity:c,visible:h,animationEnabled:l}),d.visible&&(yield this.updateDatumNodes({datumSelection:p,highlightedItems:t,isHighlight:!1}),yield this.updateLabelNodes({labelSelection:g}),o&&(yield this.updateMarkerNodes({markerSelection:m,isHighlight:!1})))})}getHighlightLabelData(t,e){const i=t.filter(t=>t.datum===e.datum&&t.itemId===e.itemId);return 0===i.length?void 0:i}getHighlightData(t,e){return e?[e]:void 0}updateHighlightSelection(t){return S(this,null,function*(){var e;const{highlightSelection:i,highlightLabelSelection:s,_contextNodeData:n}=this;if(!n)return;const a=null==(e=this.ctx.highlightManager)?void 0:e.getActiveHighlight(),o=t&&(null==a?void 0:a.datum)?a:void 0;let r,l;if(null!=o){const t=this.isLabelEnabled(),{labelData:e,nodeData:i}=n;l=this.getHighlightData(i,o),r=t?this.getHighlightLabelData(e,o):void 0}return this.highlightSelection=yield this.updateHighlightSelectionItem({items:l,highlightSelection:i}),this.highlightLabelSelection=yield this.updateHighlightSelectionLabel({items:r,highlightLabelSelection:s}),l})}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:t}of this.datumSelection)!0!==t.datum.missing&&(yield t)}getQuadTree(){if(void 0===this.quadtree){const{width:t,height:e}=this.ctx.scene.canvas,i=new Js(0,0,t,e);this.quadtree=new ud(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(t){}pickNodeExactShape(t){var e;const i=super.pickNodeExactShape(t);if(i)return i;const{x:s,y:n}=t,{opts:{hasMarkers:a}}=this;let o;const{dataNodeGroup:r,markerGroup:l}=this;if(o=r.pickNode(s,n),!o&&a&&(o=null==l?void 0:l.pickNode(s,n)),o&&!0!==o.datum.missing)return{datum:o.datum,distance:0};for(const i of this.moduleMap.modules()){const{datum:s}=null!=(e=i.pickNodeExact(t))?e:{};if(null!=s&&!0!==(null==s?void 0:s.missing))return{datum:s,distance:0}}}pickNodeClosestDatum(t){var e,i;const{x:s,y:n}=t,{axes:a,rootGroup:o,_contextNodeData:r}=this;if(!r)return;const l=a.x,h=a.y,c=o.transformPoint(s,n);let d,u=1/0;for(const t of r.nodeData){const{point:{x:e=NaN,y:i=NaN}={}}=t;if(isNaN(e)||isNaN(i))continue;if(!(null==l?void 0:l.inRange(e))||!(null==h?void 0:h.inRange(i)))continue;const s=Math.max(p(c.x-e,2)+p(c.y-i,2),0);s<u&&(u=s,d=t)}for(const e of this.moduleMap.modules()){const i=e.pickNodeNearest(t);if(void 0!==i&&i.distanceSquared<u){u=i.distanceSquared,d=i.datum;break}}return d?{datum:d,distance:Math.max(Math.sqrt(u)-(null!=(i=null==(e=d.point)?void 0:e.size)?i:0),0)}:void 0}pickNodeMainAxisFirst(t,e){var i,s,n,a;const{x:o,y:r}=t,{axes:l,rootGroup:h,_contextNodeData:c}=this;if(!c)return;const d=l.x,u=l.y,g=[d,u].filter(t=>t instanceof Cl).map(t=>t.direction);if(e&&0===g.length)return;const[m="x"]=g,y=h.transformPoint(o,r),f="x"===m?[y.x,y.y]:[y.y,y.x],x=[1/0,1/0];let b;for(const t of c.nodeData){const{x:e=NaN,y:n=NaN}=null!=(s=null!=(i=t.point)?i:t.midPoint)?s:{};if(isNaN(e)||isNaN(n)||!0===t.missing)continue;if(!(null==d?void 0:d.inRange(e))||!(null==u?void 0:u.inRange(n)))continue;const a="x"===m?[e,n]:[n,e];let o=!0;for(let t=0;t<a.length;t++){const e=Math.abs(a[t]-f[t]);if(e>x[t]){o=!1;break}e<x[t]&&(x[t]=e,x.fill(1/0,t+1,x.length))}o&&(b=t)}if(b){let e=Math.max(p(x[0],2)+p(x[1],2)-(null!=(a=null==(n=b.point)?void 0:n.size)?a:0),0);for(const i of this.moduleMap.modules()){const s=i.pickNodeMainAxisFirst(t);if(void 0!==s&&s.distanceSquared<e){b=s.datum,e=s.distanceSquared;break}}return{datum:b,distance:Math.sqrt(e)}}}onLegendItemClick(t){const{legendItemName:e}=this.properties,{enabled:i,itemId:s,series:n}=t,a=null!=e&&e===t.legendItemName;(n.id===this.id||a)&&this.toggleSeriesItem(s,i)}onLegendItemDoubleClick(t){const{enabled:e,itemId:i,series:s,numVisibleItems:n}=t,{legendItemName:a}=this.properties,o=null!=a&&a===t.legendItemName;s.id===this.id||o||e&&1===n?this.toggleSeriesItem(i,!0):this.toggleSeriesItem(i,!1)}isPathOrSelectionDirty(){return!1}getLabelData(){return[]}shouldFlipXY(){return!1}getMinRects(t,e){const{dirtyNodeData:i,sizeCache:s,minRect:n,minVisibleRect:a}=this.minRectsCache,o=JSON.stringify({width:t,height:e});if(o===s&&!i&&n&&a)return{minRect:n,minVisibleRect:a};const r=this.computeMinRects(t,e);return this.minRectsCache={dirtyNodeData:!1,sizeCache:o,minRect:null==r?void 0:r.minRect,minVisibleRect:null==r?void 0:r.minVisibleRect},r}computeMinRects(t,e){var i,s;const n=this._contextNodeData;if(!(null==n?void 0:n.nodeData.length))return;const{nodeData:a}=n,o=Array(a.length),r=Array(a.length);for(const[t,{midPoint:e}]of a.entries())o[t]=null!=(i=null==e?void 0:e.x)?i:0,r[t]=null!=(s=null==e?void 0:e.y)?s:0;let l,h,c,d;o.sort((t,e)=>t-e),r.sort((t,e)=>t-e);let u=0,p=0;for(let i=1;i<a.length;i++)o[i]>=0&&(null!=l||(l=i)),o[i]>t&&(null!=h||(h=i)),r[i]>=0&&(null!=c||(c=i)),r[i]>e&&(null!=d||(d=i)),u=Math.max(u,o[i]-o[i-1]),p=Math.max(p,r[i]-r[i-1]);null!=h||(h=a.length),null!=d||(d=a.length);const g=null!=l&&null!=h?o.slice(l,h):[],m=null!=c&&null!=d?r.slice(c,d):[];let y=0,f=0;for(let t=1;t<Math.max(g.length,m.length);t++){const e=g[t],i=g[t-1],s=m[t],n=m[t-1];null!=e&&null!=i&&(y=Math.max(y,e-i)),null!=s&&null!=n&&(f=Math.max(f,s-n))}return{minRect:new Js(0,0,u,p),minVisibleRect:new Js(0,0,y,f)}}updateHighlightSelectionItem(t){const{opts:{hasMarkers:e}}=this,{items:i,highlightSelection:s}=t,n=null!=i?i:[];if(e){const t=s;return this.updateMarkerSelection({nodeData:n,markerSelection:t})}return this.updateDatumSelection({nodeData:n,datumSelection:s})}updateHighlightSelectionLabel(t){var e;return this.updateLabelSelection({labelData:null!=(e=t.items)?e:[],labelSelection:t.highlightLabelSelection})}updateDatumSelection(t){return S(this,null,function*(){return t.datumSelection})}updateDatumNodes(t){return S(this,null,function*(){})}updateMarkerSelection(t){return S(this,null,function*(){return t.markerSelection})}updateMarkerNodes(t){return S(this,null,function*(){})}updatePaths(t){return S(this,null,function*(){t.paths.forEach(t=>t.visible=!1)})}updatePathNodes(t){return S(this,null,function*(){const{paths:e,opacity:i,visible:s}=t;for(const t of e)t.opacity=i,t.visible=s})}resetAllAnimation(t){var e,i,s;const{path:n,datum:a,label:o,marker:r}=null!=(i=null==(e=this.opts)?void 0:e.animationResetFns)?i:{};this.ctx.animationManager.stopByAnimationGroupId(this.id),n&&t.paths.forEach(t=>{mr([t],n)}),a&&mr([t.datumSelection],a),o&&mr([t.labelSelection],o),r&&this.opts.hasMarkers&&mr([t.markerSelection],r),!1===(null==(s=t.contextData)?void 0:s.animationValid)&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){var e,i;const{datum:s}=null!=(i=null==(e=this.opts)?void 0:e.animationResetFns)?i:{};s&&mr([t],s)}animateReadyHighlightMarkers(t){var e,i;const{marker:s}=null!=(i=null==(e=this.opts)?void 0:e.animationResetFns)?i:{};s&&mr([t],s)}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animationTransitionClear(){const t=this.getAnimationData();t&&this.animationState.transition("clear",t)}getAnimationData(t,e){const{_contextNodeData:i}=this;if(i)return{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:e,paths:this.paths,seriesRect:t}}calculateScaling(){const t={};for(const e of Object.values(Ya)){const i=this.axes[e];if(i)if(i.scale instanceof Rr){const{range:s,domain:n}=i.scale;t[e]={type:"log",convert:t=>i.scale.convert(t),domain:[n[0],n[1]],range:[s[0],s[1]]}}else if(i.scale instanceof Xa){const{range:s}=i.scale,n=i.scale.getDomain();t[e]={type:"continuous",domain:[n[0],n[1]],range:[s[0],s[1]]}}else if(i.scale){const{domain:s}=i.scale;t[e]={type:"category",domain:s,range:s.map(t=>i.scale.convert(t))}}}return t}},Yd=["top","right","bottom","left"],$d=class t extends nd{constructor(t,e){super(t,e),this.paired=!0,this.firstSeriesTranslation=!0,this._lastCrossLineIds=void 0,this._lastAxisWidths={top:0,bottom:0,left:0,right:0},this._lastClipSeries=!1,this._lastVisibility={crossLines:!0,series:!0}}onAxisChange(t,e){super.onAxisChange(t,e),this.zoomManager.updateAxes(t)}destroySeries(t){super.destroySeries(t),this.firstSeriesTranslation=!0}performLayout(){return S(this,null,function*(){const e=yield v(t.prototype,this,"performLayout").call(this),{firstSeriesTranslation:i,seriesRoot:s,annotationRoot:n,highlightRoot:a}=this,{animationRect:o,seriesRect:r,visibility:l,clipSeries:h}=this.updateAxes(e);this.seriesRoot.visible=l.series,this.seriesRect=r,this.animationRect=o;const{x:c,y:d}=r;if(i){for(const t of[s,n,a])t.translationX=Math.floor(c),t.translationY=Math.floor(d);this.firstSeriesTranslation=!1}else{const{translationX:t,translationY:e}=s;Nn(this.id,"seriesRect",this.ctx.animationManager,[s,a,n],{translationX:t,translationY:e},{translationX:Math.floor(c),translationY:Math.floor(d)},{phase:"update"})}const u=r.clone().grow(this.seriesArea.padding);this.hoverRect=u;const p=this.seriesArea.clip||h?u:void 0;s.setClipRectInGroupCoordinateSpace(p),a.setClipRectInGroupCoordinateSpace(p),n.setClipRectInGroupCoordinateSpace(p),this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:h,series:{rect:r,paddedRect:u,visible:l.series,shouldFlipXY:this.shouldFlipXY()},axes:this.axes.map(t=>m({id:t.id},t.getLayoutState()))});const g=this.modulesManager.mapModules(t=>{var e;return null==(e=t.performCartesianLayout)?void 0:e.call(t,{seriesRect:r})});return yield Promise.all(g),e})}updateAxes(t){var e;const i=this.axes.flatMap(t=>{var e;return null!=(e=t.crossLines)?e:[]}).map(t=>t.id);let s,n,a;null!=this._lastCrossLineIds&&this._lastCrossLineIds.length===i.length&&this._lastCrossLineIds.every((t,e)=>i[e]===t)?(s=m({},this._lastAxisWidths),n=this._lastClipSeries,a=m({},this._lastVisibility)):(s={top:0,bottom:0,left:0,right:0},n=!1,a={crossLines:!0,series:!0},this._lastCrossLineIds=i);const o=new Set(this.axes.map(t=>t.position));for(const t of Object.keys(s))o.has(t)||delete s[t];const r=(t,e,i)=>!Object.keys(t).some(t=>null==s[t])&&a.crossLines===i.crossLines&&a.series===i.series&&Object.entries(s).every(([e,i])=>{const s=t[e];return null==i&&null==s||i===s})&&n===e,l=t=>qt(t,t=>t&&Math.abs(t)===1/0?0:null!=t?Math.ceil(t):t);let h={},c={},d=!1,u=null==(e=this.seriesRect)?void 0:e.clone(),p=0,g={};do{Object.assign(s,h),n=d,Object.assign(a,c);const e=this.updateAxesPass(s,t.clone(),u);if(h=l(e.axisWidths),c=e.visibility,d=e.clipSeries,u=e.seriesRect,g=e.primaryTickCounts,p++>10){E.warn("unable to find stable axis layout.");break}}while(!r(h,d,c));return this.axes.forEach(t=>{t.update(g[t.direction])}),this.axes.forEach(e=>{if(e.setCrossLinesVisible(a.crossLines),u)switch(e.clipGrid(u.x,u.y,u.width+5,u.height+5),e.position){case"left":case"right":e.clipTickLines(t.x,u.y,t.width+5,u.height+5);break;case"top":case"bottom":e.clipTickLines(u.x,t.y,u.width+5,t.height+5)}}),this._lastAxisWidths=s,this._lastVisibility=a,{seriesRect:u,animationRect:t,visibility:a,clipSeries:n}}updateAxesPass(t,e,i){const s={},n={},a={series:!0,crossLines:!0};let o=!1;const r={},l=this.applySeriesPadding(e),h=i?this.buildCrossLinePadding(t):{},c=this.buildAxisBound(l,t,h,a),d=this.buildSeriesRect(c,t);return this.axes.forEach(e=>{var i,a;const{position:h="left"}=e,{clipSeries:u,axisThickness:p,axisOffset:g}=this.calculateAxisDimensions({axis:e,seriesRect:d,paddedBounds:l,axisWidths:t,newAxisWidths:n,primaryTickCounts:r,clipSeries:o,addInterAxisPadding:(null!=(i=s[h])?i:0)>0});s[h]=(null!=(a=s[h])?a:0)+1,o=o||u,this.positionAxis({axis:e,axisBound:c,axisOffset:g,axisThickness:p,axisWidths:t,primaryTickCounts:r,seriesRect:d})}),{clipSeries:o,seriesRect:d,axisWidths:n,visibility:a,primaryTickCounts:r}}buildCrossLinePadding(t){var e;const i={};this.axes.forEach(t=>{t.crossLines&&t.crossLines.forEach(t=>{var e;null==(e=t.calculatePadding)||e.call(t,i)})});for(const[s,n=0]of Object.entries(i))i[s]=Math.max(n-(null!=(e=t[s])?e:0),0);return i}applySeriesPadding(t){const e=t.clone(),i=this.axes.slice().reverse();return Yd.forEach(t=>{const s=this.seriesArea.padding[t],n=i.find(e=>e.position===t);n?n.seriesAreaPadding=s:e.shrink(s,t)}),e}buildAxisBound(t,e,i,s){var n,a,o,r;const l=t.clone(),{top:h=0,right:c=0,bottom:d=0,left:u=0}=i,p=u+c,g=h+d,m=(null!=(n=e.left)?n:0)+(null!=(a=e.right)?a:0)+p,y=(null!=(o=e.top)?o:0)+(null!=(r=e.bottom)?r:0)+g;return l.width<=m||l.height<=y?(s.crossLines=!1,s.series=!1,l):(l.x+=u,l.y+=h,l.width-=p,l.height-=g,l)}buildSeriesRect(t,e){const i=t.clone(),{top:s,bottom:n,left:a,right:o}=e;return i.x+=null!=a?a:0,i.y+=null!=s?s:0,i.width-=(null!=a?a:0)+(null!=o?o:0),i.height-=(null!=s?s:0)+(null!=n?n:0),i.width=Math.max(0,i.width),i.height=Math.max(0,i.height),i}clampToOutsideSeriesRect(t,e,i,s){const{x:n,y:a,width:o,height:r}=t,l=[n,a,n+o,a+r][("x"===i?0:1)+(1===s?0:2)];return(1===s?Math.min:Math.max)(e,l)}calculateAxisDimensions(t){var e,i,s;const{axis:n,seriesRect:a,paddedBounds:o,axisWidths:r,newAxisWidths:l,primaryTickCounts:h,addInterAxisPadding:c}=t;let{clipSeries:d}=t;const{position:u="left",direction:p}=n,g=n instanceof Cl||n instanceof zl,m="left"===u||"right"===u,y=null!=(e=l[u])?e:0,{min:f,max:x}=this.ctx.zoomManager.getAxisZoom(n.id);m?(g?(n.range=[0,a.height],n.visibleRange=[1-x,1-f]):(n.range=[a.height,0],n.visibleRange=[f,x]),n.gridLength=a.width):(n.range=[0,a.width],n.visibleRange=[f,x],n.gridLength=a.height);let b=n.nice?h[p]:void 0;const v="y"===p;n.thickness?n.maxThickness=n.thickness:n.maxThickness=.3*(v?o.width:o.height);const S=n.calculateLayout(b);let M;if(b=S.primaryTickCount,null!=h[p]||(h[p]=b),d||(d=n.dataDomain.clipped||n.visibleRange[0]>0||n.visibleRange[1]<1),null!=n.thickness&&n.thickness>0)M=n.thickness;else{const{bbox:t}=S;M=v?t.width:t.height}return c&&(M+=15),M=Math.ceil(M),l[u]=(null!=(i=l[u])?i:0)+M,n.gridPadding=(null!=(s=r[u])?s:0)-l[u],{clipSeries:d,axisThickness:M,axisOffset:y,primaryTickCount:b}}positionAxis(t){var e,i,s,n;const{axis:a,axisBound:o,axisWidths:r,seriesRect:l,axisOffset:h,axisThickness:c}=t,{position:d}=a;switch(d){case"top":a.translation.x=o.x+(null!=(e=r.left)?e:0),a.translation.y=this.clampToOutsideSeriesRect(l,o.y+1+h+c,"y",1);break;case"bottom":a.translation.x=o.x+(null!=(i=r.left)?i:0),a.translation.y=this.clampToOutsideSeriesRect(l,o.y+o.height+1-c-h,"y",-1);break;case"left":a.translation.y=o.y+(null!=(s=r.top)?s:0),a.translation.x=this.clampToOutsideSeriesRect(l,o.x+h+c,"x",1);break;case"right":a.translation.y=o.y+(null!=(n=r.top)?n:0),a.translation.x=this.clampToOutsideSeriesRect(l,o.x+o.width-c-h,"x",-1)}a.updatePosition({rotation:zn(a.rotation),sideFlag:a.label.getSideFlag()})}shouldFlipXY(){return!this.series.some(t=>!(t instanceof Kd&&t.shouldFlipXY()))}};$d.className="CartesianChart",$d.type="cartesian";var Hd=$d,Ud=class t{static isInstance(e){var i;return e instanceof t||"AgChartInstanceProxy"===(null==(i=e.constructor)?void 0:i.name)&&null!=e.chart||null!=e.chart&&this.validateImplementation(e)}static validateImplementation(t){var e;const i=Object.keys(null!=(e=Object.getPrototypeOf(t))?e:{});return["getOptions","destroy"].every(t=>i.includes(t))}constructor(t){this.chart=t}getOptions(){return Me(this.chart.getOptions())}resetAnimations(){this.chart.resetAnimations()}skipAnimations(){this.chart.skipAnimations()}destroy(){this.chart.destroy()}};Ud.chartInstances=new WeakMap,b([Xr({oldValue(t){Ud.chartInstances.delete(t)},newValue(t){Ud.chartInstances.set(t,this)}})],Ud.prototype,"chart",2);var Xd=Ud,Zd=class extends Xa{constructor(){super([0,1],[0,1]),this.type="number"}toDomain(t){return t}ticks(){var t;const e=null!=(t=this.tickCount)?t:Xa.defaultTickCount;if(!this.domain||this.domain.length<2||e<1||this.domain.some(t=>!isFinite(t)))return[];this.refresh();const[i,s]=this.getDomain(),{interval:n}=this;if(n){const t=Math.abs(n);if(!go({start:i,stop:s,interval:t,availableRange:this.getPixelRange()}))return po(i,s,t)}return ho(i,s,e,this.minTickCount,this.maxTickCount)}update(){!this.domain||this.domain.length<2||this.nice&&this.updateNiceDomain()}getTickStep(t,e){var i,s;const n=null!=(i=this.tickCount)?i:Xa.defaultTickCount;return null!=(s=this.interval)?s:uo(t,e,n,this.minTickCount,this.maxTickCount)}updateNiceDomain(){var t;const e=null!=(t=this.tickCount)?t:Xa.defaultTickCount;if(e<1)return void(this.niceDomain=[...this.domain]);let[i,s]=this.domain;if(1===e)[i,s]=function(t,e){const i=Math.abs(e-t),s=Math.floor(Math.log10(i)),n=Math.pow(10,s),a=t>e?Math.ceil:Math.floor,o=e<t?Math.floor:Math.ceil;return co.map(s=>{const r=s*n,l=a(t/r)*r,h=o(e/r)*r;return{error:1-i/Math.abs(h-l),domain:[l,h]}}).sort((t,e)=>t.error-e.error)[0].domain}(i,s);else{const t=i>s?Math.ceil:Math.floor,e=s<i?Math.floor:Math.ceil,n=4;for(let a=0;a<n;a++){const n=i,a=s,o=this.getTickStep(i,s),[r,l]=this.domain;if(o>=1)i=t(r/o)*o,s=e(l/o)*o;else{const n=1/o;i=t(r*n)/n,s=e(l*n)/n}if(i===n&&s===a)break}}this.niceDomain=[i,s]}tickFormat({ticks:t,specifier:e}){return Nr(null!=t?t:this.ticks(),e)}};var qd=class extends Ka{constructor(){super(...arguments),this.minSpacing=NaN,this.maxSpacing=NaN}};b([$n(Fa),Yn(NaN)],qd.prototype,"minSpacing",2),b([$n(za),Yn(NaN)],qd.prototype,"maxSpacing",2);var Qd=class extends wl{constructor(t,e=new Zd){super(t,e),this.min=NaN,this.max=NaN}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=hs(t,e,i);return{domain:s,clipped:n}}createTick(){return new qd}updateSecondaryAxisTicks(t){if(null==this.dataDomain)throw new Error("AG Charts - dataDomain not calculated, cannot perform tick calculation.");if(0===this.dataDomain.domain.length)return[];const[e,i]=function(t,e,i){let[s,n]=Ws(t);s=function(t,e,i){const s=Math.abs(e-t)/(i-1),n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return Math.floor(t/a)*a}(Math.floor(s),n,e);const a=function(t,e,i){return function(t){const e=Math.floor(Math.log10(t)),i=Math.pow(10,e),s=t/i*10;return s>0&&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}((e-t)/(i-1))}(s,n,e);n=s+(e-1)*a;const o=i?[n,s]:[s,n],r=function(t,e,i){const s=Math.floor(Math.log10(e)),n=e>0&&e<1?Math.abs(s):0,a=Math.pow(10,n),o=lo(n);for(let s=0;s<i;s++){const i=t+e*s;o[s]=Math.round(i*a)/a}return o}(s,a,e);return[o,r]}(this.dataDomain.domain,null!=t?t:0,this.reverse);return this.scale.nice=!1,this.scale.domain=e,this.scale.update(),i}formatDatum(t){return"number"==typeof t?t.toFixed(2):String(t)}};Qd.className="NumberAxis",Qd.type="number",b([$n(Un(oa,ca("max"))),Yn(NaN)],Qd.prototype,"min",2),b([$n(Un(oa,da("min"))),Yn(NaN)],Qd.prototype,"max",2);var Jd=Ga(t=>Wt(t)&&0!==t,"a non-zero number"),tu=class extends Qd{constructor(t){super(t,new Rr),this.min=NaN,this.max=NaN}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=hs(t,e,i),a=s[0]>s[1],o=s[0]<0&&s[1]>0,r=0===s[0]&&0===s[1];return(a||o||r)&&(o?E.warn("the data domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."):r&&E.warn("the data domain has 0 extent, no data is rendered.")),0===s[0]&&(s[0]=1),0===s[1]&&(s[1]=-1),{domain:s,clipped:n}}set base(t){this.scale.base=t}get base(){return this.scale.base}};tu.className="LogAxis",tu.type="log",b([$n(Un(oa,Jd,ca("max"))),Yn(NaN)],tu.prototype,"min",2),b([$n(Un(oa,Jd,da("min"))),Yn(NaN)],tu.prototype,"max",2);var eu=class extends Ka{constructor(){super(...arguments),this.minSpacing=NaN,this.maxSpacing=NaN}};b([$n(Fa),Yn(NaN)],eu.prototype,"minSpacing",2),b([$n(za),Yn(NaN)],eu.prototype,"maxSpacing",2);var iu=class extends wl{constructor(t){super(t,new yo),this.min=void 0,this.max=void 0,this.refreshScale()}normaliseDataDomain(t){var e;let{min:i,max:s}=this,n=!1;return"number"==typeof i&&(i=new Date(i)),"number"==typeof s&&(s=new Date(s)),t.length>2&&(t=(null!=(e=rs(t))?e:[0,1e3]).map(t=>new Date(t))),i instanceof Date&&(n||(n=i>t[0]),t=[i,t[1]]),s instanceof Date&&(n||(n=s<t[1]),t=[t[0],s]),t[0]>t[1]&&(t=[]),{domain:t,clipped:n}}createTick(){return new eu}onLabelFormatChange(t,e,i){i?super.onLabelFormatChange(t,e,i):this.labelFormatter=this.scale.tickFormat({ticks:t,domain:e})}calculatePadding(){return[0,0]}formatDatum(t){var e;const i=this.scale.tickFormat({specifier:"%m/%d/%y, %H:%M:%S"});return null!=(e=this.moduleCtx.callbackCache.call(i,t))?e:String(t)}};iu.className="TimeAxis",iu.type="time",b([$n(Un(pa,ca("max")),{optional:!0})],iu.prototype,"min",2),b([$n(Un(pa,da("min")),{optional:!0})],iu.prototype,"max",2);var su=1e-6,nu=(t,e,i,s,n)=>{let a=!1,o=!1,r=s-Math.sqrt(Math.max(p(n,2)-p(i,2),0)),l=0,h=0,c=i-Math.sqrt(Math.max(p(n,2)-p(s,2),0));return r>t?(a=!0,r=t,l=i-Math.sqrt(Math.max(p(n,2)-p(s-t,2)))):r<su&&(r=0),c>e?(o=!0,h=s-Math.sqrt(Math.max(p(n,2)-p(i-e,2))),c=e):c<su&&(c=0),{leading0:r,leading1:l,trailing0:h,trailing1:c,leadingClipped:a,trailingClipped:o}},au=(t,{x0:e,y0:i,x1:s,y1:n,cx:a,cy:o},r,l)=>{if(l&&t.moveTo(e,i),e!==s||i!==n){const l=Math.atan2(i-o,e-a),h=Math.atan2(n-o,s-a);t.arc(a,o,r,l,h)}else t.lineTo(e,i)},ou=(t,e,i,s,n,a,o)=>{let{topLeft:r,topRight:l,bottomRight:h,bottomLeft:c}=a;const d=Math.max(r+c,l+h),u=Math.max(r+l,c+h);if(d<=0&&u<=0)return void(null==o?t.rect(e,i,s,n):t.rect(o.x,o.y,o.width,o.height));if(null==o&&r===l&&r===h&&r===c)return void t.roundRect(e,i,s,n,r);if(s<0&&(e+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(null==o)o=new Js(e,i,s,n);else{const t=Math.max(e,o.x),a=Math.min(e+s,o.x+o.width),r=Math.max(i,o.y),l=Math.min(i+n,o.y+o.height);o=new Js(t,r,a-t,l-r)}const p=Math.max(d/n,u/s,1);p>1&&(r/=p,l/=p,h/=p,c/=p);let g,m,y,f,x=!0,b=!0,v=!0,S=!0;if(x){const t=nu(o.height,o.width,Math.max(e+r-o.x,0),Math.max(i+r-o.y,0),r);t.leadingClipped&&(S=!1),t.trailingClipped&&(b=!1),g={x0:Math.max(o.x+t.leading1,o.x),y0:Math.max(o.y+t.leading0,o.y),x1:Math.max(o.x+t.trailing1,o.x),y1:Math.max(o.y+t.trailing0,o.y),cx:e+r,cy:i+r}}if(b){const t=nu(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(e+s-l),0),l);t.leadingClipped&&(x=!1),t.trailingClipped&&(v=!1),m={x0:Math.min(o.x+o.width-t.leading0,o.x+o.width),y0:Math.max(o.y+t.leading1,o.y),x1:Math.min(o.x+o.width-t.trailing0,o.x+o.width),y1:Math.max(o.y+t.trailing1,o.y),cx:e+s-l,cy:i+l}}if(v){const t=nu(o.height,o.width,Math.max(o.x+o.width-(e+s-h),0),Math.max(o.y+o.height-(i+n-h),0),h);t.leadingClipped&&(b=!1),t.trailingClipped&&(S=!1),y={x0:Math.min(o.x+o.width-t.leading1,o.x+o.width),y0:Math.min(o.y+o.height-t.leading0,o.y+o.height),x1:Math.min(o.x+o.width-t.trailing1,o.x+o.width),y1:Math.min(o.y+o.height-t.trailing0,o.y+o.height),cx:e+s-h,cy:i+n-h}}if(S){const t=nu(o.width,o.height,Math.max(o.y+o.height-(i+n-c),0),Math.max(e+c-o.x,0),c);t.leadingClipped&&(v=!1),t.trailingClipped&&(x=!1),f={x0:Math.max(o.x+t.leading0,o.x),y0:Math.min(o.y+o.height-t.leading1,o.y+o.height),x1:Math.max(o.x+t.trailing0,o.x),y1:Math.min(o.y+o.height-t.trailing1,o.y+o.height),cx:e+c,cy:i+n-c}}let M=!1;x&&null!=g&&(au(t,g,r,!M),M||(M=!0)),b&&null!=m&&(au(t,m,l,!M),M||(M=!0)),v&&null!=y&&(au(t,y,h,!M),M||(M=!0)),S&&null!=f&&(au(t,f,c,!M),M||(M=!0)),t.closePath()},ru=class extends dd{constructor(){super(...arguments),this.borderPath=new hd,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=Lo.defaultStyles.strokeWidth,this.effectiveStrokeWidth=Lo.defaultStyles.strokeWidth,this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquared,this.microPixelEffectOpacity=1}set cornerRadius(t){this.topLeftCornerRadius=t,this.topRightCornerRadius=t,this.bottomRightCornerRadius=t,this.bottomLeftCornerRadius=t}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||Boolean(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){var t,e,i;const{path:s,borderPath:n,crisp:a,topLeftCornerRadius:o,topRightCornerRadius:r,bottomRightCornerRadius:l,bottomLeftCornerRadius:h}=this;let{x:c,y:d,width:u,height:p,strokeWidth:g,clipBBox:m}=this;const y=1/(null!=(e=null==(t=this.layerManager)?void 0:t.canvas.pixelRatio)?e:1);let f=1;if(s.clear(!0),n.clear(!0),a&&(u<=y&&(f*=u/y),p<=y&&(f*=p/y),u=this.align(c,u),p=this.align(d,p),c=this.align(c),d=this.align(d),m=null!=m?new Js(this.align(m.x),this.align(m.y),this.align(m.x,m.width),this.align(m.y,m.height)):void 0),g)if(u<y){const t=c+y/2;n.moveTo(t,d),n.lineTo(t,d+p),g=y,this.borderClipPath=void 0}else if(p<y){const t=d+y/2;n.moveTo(c,t),n.lineTo(c+u,t),g=y,this.borderClipPath=void 0}else if(g<u&&g<p){const t=g/2;c+=t,d+=t,u-=g,p-=g;const e=null==m?void 0:m.clone().shrink(t),i={topLeft:o>0?o-g:0,topRight:r>0?r-g:0,bottomRight:l>0?l-g:0,bottomLeft:h>0?h-g:0};this.borderClipPath=void 0,u>0&&p>0&&(null==e||(null==e?void 0:e.width)>0&&(null==e?void 0:e.height)>0)&&(ou(s,c,d,u,p,i,e),ou(n,c,d,u,p,i,e))}else this.borderClipPath=null!=(i=this.borderClipPath)?i:new hd,this.borderClipPath.clear(!0),this.borderClipPath.rect(c,d,u,p),n.rect(c,d,u,p);else{const t={topLeft:o,topRight:r,bottomRight:l,bottomLeft:h};this.borderClipPath=void 0,ou(s,c,d,u,p,t,m)}[o,r,l,h].every(t=>0===t)?(this.hittester=(t,e)=>{const i=this.transformPoint(t,e);return this.getCachedBBox().containsPoint(i.x,i.y)},this.distanceSquared=(t,e)=>this.getCachedBBox().distanceSquared(t,e)):(this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquared),this.effectiveStrokeWidth=g,this.lastUpdatePathStrokeWidth=g,this.microPixelEffectOpacity=f}computeBBox(){var t;const{x:e,y:i,width:s,height:n,clipBBox:a}=this;return null!=(t=null==a?void 0:a.clone())?t:new Js(e,i,s,n)}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:a,lineDashOffset:o,lineCap:r,lineJoin:l,borderPath:h,borderClipPath:c,opacity:d,microPixelEffectOpacity:u}=this;c&&t.clip(c.getPath2D()),t.strokeStyle=e,t.globalAlpha*=d*n*u,t.lineWidth=i,a&&t.setLineDash(a),o&&(t.lineDashOffset=o),r&&(t.lineCap=r),l&&(t.lineJoin=l),t.stroke(h.getPath2D()),t.globalAlpha=s}}};ru.className="Rect",b([cd()],ru.prototype,"x",2),b([cd()],ru.prototype,"y",2),b([cd()],ru.prototype,"width",2),b([cd()],ru.prototype,"height",2),b([cd()],ru.prototype,"topLeftCornerRadius",2),b([cd()],ru.prototype,"topRightCornerRadius",2),b([cd()],ru.prototype,"bottomRightCornerRadius",2),b([cd()],ru.prototype,"bottomLeftCornerRadius",2),b([cd()],ru.prototype,"clipBBox",2),b([cd()],ru.prototype,"crisp",2);var lu=class extends St{constructor(t){super(),this.node=new ko({name:"background",zIndex:0}),this.rectNode=new ru,this.visible=!0,this.fill="white",this.node.appendChild(this.rectNode),this.destroyFns.push(t.scene.attachNode(this.node),t.layoutService.addListener("layout-complete",t=>this.onLayoutComplete(t)))}onLayoutComplete(t){const{width:e,height:i}=t.chart;this.rectNode.width=e,this.rectNode.height=i}};b([$n(Qn),Ur("node","visible")],lu.prototype,"visible",2),b([$n(ma,{optional:!0}),Ur("rectNode","fill")],lu.prototype,"fill",2),b([$n(Zn,{optional:!0})],lu.prototype,"image",2);var hu={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology"],instanceConstructor:lu};function cu({orientation:t,bboxes:e,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:a=0,forceResult:o=!1}){const r="horizontal"===t,l={max:r?s:i,fn:r?t=>t.width:t=>t.height,padding:r?a:n},h={max:r?i:s,fn:r?t=>t.height:t=>t.width,padding:r?n:a};let c=0;const d=[];for(;c<e.length;){const t=du(e.slice(c),c,l,h,o);if(!t)return;c+=t.processedBBoxCount,d.push(t.pageIndices)}return function(t,e,i,s,n){let a=0,o=0;return{pages:t.map(t=>{"horizontal"===e&&(t=function(t){const e=[];for(const i of t[0])e.push([]);return t.forEach((t,i)=>{t.forEach((t,s)=>{e[s][i]=t})}),e}(t));let r=0;const l=t.map(t=>{const e=t.map(t=>(r=Math.max(t,r),i[t]));let a=0,o=0;return e.forEach(t=>{a+=t.height+s,o=Math.max(o,t.width+n)}),{indices:t,bboxes:e,columnHeight:Math.ceil(a),columnWidth:Math.ceil(o)}});let h=0,c=0;return l.forEach(t=>{h+=t.columnWidth,c=Math.max(c,t.columnHeight)}),a=Math.max(h,a),o=Math.max(c,o),{columns:l,startIndex:t[0][0],endIndex:r,pageWidth:h,pageHeight:c}}),maxPageWidth:a,maxPageHeight:o}}(d,t,e,n,a)}function du(t,e,i,s,n){let a=function(t,e){const i=t.length;let s=0;for(let n=0;n<i;n++)if(s+=e.fn(t[n])+e.padding,s>e.max)return i/n<2?Math.ceil(i/2):n;return i}(t,i);if(a<1){if(!n)return;a=1}let o=a;for(;o>=1;){const a=uu(t,e,o,i,s,n);if(null==a&&o<=1)return;if(null!=a){if("number"!=typeof a)return{processedBBoxCount:a.length*a[0].length,pageIndices:a};if(a<=1)return;o=a<o&&a>1?a:o,o--}else o--}}function uu(t,e,i,s,n,a){var o;const r=[];let l=0,h=0,c=[];const d=[];for(let u=0;u<t.length;u++){const p=(u+i)%i;0===p&&(l+=h,h=0,c.length>0&&r.push(c),c=[]);const g=s.fn(t[u])+s.padding;d[p]=Math.max(null!=(o=d[p])?o:0,g),h=Math.max(h,n.fn(t[u])+n.padding);const m=l+h,y=!a||r.length>0;if(m>n.max&&y){c=[];break}if(d.reduce((t,e)=>t+e,0)>s.max&&!a)return d.length<i?d.length:void 0;c.push(u+e)}return c.length>0&&r.push(c),r.length>0?r:void 0}var pu=class extends ko{constructor(){super({name:"markerLabelGroup"}),this.label=new Bo,this.line=new zr,this._marker=new Id,this._markerSize=15,this._spacing=8;const{marker:t,label:e,line:i}=this;e.textBaseline="middle",e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.y=1,this.append([i,t,e]),this.update()}set marker(t){this._marker!==t&&(this.removeChild(this._marker),this._marker=t,this.appendChild(t),this.update())}get marker(){return this._marker}set markerSize(t){this._markerSize!==t&&(this._markerSize=t,this.update())}get markerSize(){return this._markerSize}set spacing(t){this._spacing!==t&&(this._spacing=t,this.update())}get spacing(){return this._spacing}setSeriesStrokeOffset(t){const e=this.marker.size/2+t;this.line.x1=-e,this.line.x2=e,this.line.y1=0,this.line.y2=0,this.line.markDirtyTransform(),this.update()}update(){const{markerSize:t}=this,e=this.marker.constructor.center;this.marker.size=t,this.marker.x=(e.x-.5)*t,this.marker.y=(e.y-.5)*t;const i=this.line.visible?this.line.x2:-1/0,s=t/2;this.label.x=Math.max(i,s)+this.spacing}render(t){this.marker.opacity=this.opacity,this.label.opacity=this.opacity,this.line.opacity=this.opacity,super.render(t)}};pu.className="MarkerLabel",b([Ur("label")],pu.prototype,"text",2),b([Ur("label")],pu.prototype,"fontStyle",2),b([Ur("label")],pu.prototype,"fontWeight",2),b([Ur("label")],pu.prototype,"fontSize",2),b([Ur("label")],pu.prototype,"fontFamily",2),b([Ur("label","fill")],pu.prototype,"color",2),b([Ur("marker","fill")],pu.prototype,"markerFill",2),b([Ur("marker","stroke")],pu.prototype,"markerStroke",2),b([Ur("marker","strokeWidth")],pu.prototype,"markerStrokeWidth",2),b([Ur("marker","fillOpacity")],pu.prototype,"markerFillOpacity",2),b([Ur("marker","strokeOpacity")],pu.prototype,"markerStrokeOpacity",2),b([Ur("marker","visible")],pu.prototype,"markerVisible",2),b([Ur("line","stroke")],pu.prototype,"lineStroke",2),b([Ur("line","strokeWidth")],pu.prototype,"lineStrokeWidth",2),b([Ur("line","strokeOpacity")],pu.prototype,"lineStrokeOpacity",2),b([Ur("line","lineDash")],pu.prototype,"lineLineDash",2),b([Ur("line","visible")],pu.prototype,"lineVisible",2);var gu=class extends fe{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};b([$n(ma)],gu.prototype,"color",2),b([$n(Ia,{optional:!0})],gu.prototype,"fontStyle",2),b([$n(Ca,{optional:!0})],gu.prototype,"fontWeight",2),b([$n(sa)],gu.prototype,"fontSize",2),b([$n(ta)],gu.prototype,"fontFamily",2);var mu=class extends fe{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};b([$n(sa)],mu.prototype,"size",2),b([$n(ma,{optional:!0})],mu.prototype,"fill",2),b([$n(na,{optional:!0})],mu.prototype,"fillOpacity",2),b([$n(ma,{optional:!0})],mu.prototype,"stroke",2),b([$n(sa)],mu.prototype,"strokeWidth",2),b([$n(na)],mu.prototype,"strokeOpacity",2);var yu=class extends fe{constructor(t){super(),this.parent=t,this.shape=Ad,this.size=15,this.padding=8}};b([Xr({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],yu.prototype,"shape",2),b([$n(sa)],yu.prototype,"size",2),b([$n(sa)],yu.prototype,"padding",2);var fu=class extends fe{constructor(t,e,i,s){super(),this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.regionManager=i,this.cursorManager=s,this.id=Fs(this),this.marker=new yu(this),this.activeStyle=new mu,this.inactiveStyle=new mu,this.highlightStyle=new mu,this.label=new gu,this.group=new ko({name:"pagination"}),this.labelNode=new Bo,this.destroyFns=[],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 Ad,this._previousButton=new Ad,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]);const n=this.regionManager.addRegion("pagination",this.group);this.destroyFns.push(n.addListener("click",t=>this.onPaginationClick(t)),n.addListener("hover",t=>this.onPaginationMouseMove(t))),this.update(),this.updateMarkers()}destroy(){this.destroyFns.forEach(t=>t())}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){this._orientation=t,"horizontal"===t?(this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2):(this.previousButton.rotation=0,this.nextButton.rotation=Math.PI)}get orientation(){return this._orientation}set nextButton(t){this._nextButton!==t&&(this.group.removeChild(this._nextButton),this._nextButton=t,this.group.appendChild(t))}get nextButton(){return this._nextButton}set previousButton(t){this._previousButton!==t&&(this.group.removeChild(this._previousButton),this._previousButton=t,this.group.appendChild(t))}get previousButton(){return this._previousButton}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.computeBBox();this.nextButton.translationX=t.x+t.width+this.marker.size/2+this.marker.padding}updateLabel(){const{currentPage:t,totalPages:e,labelNode:i,label:{color:s,fontStyle:n,fontWeight:a,fontSize:o,fontFamily:r}}=this;i.text=`${t+1} / ${e}`,i.fill=s,i.fontStyle=n,i.fontWeight=a,i.fontSize=o,i.fontFamily=r}updateMarkers(){const{nextButton:t,previousButton:e,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:a,highlightStyle:o,highlightActive:r}=this,l=(t,e)=>e?a:t===r?o:n;this.updateMarker(t,l("next",i)),this.updateMarker(e,l("previous",s))}updateMarker(t,e){var i;const{size:s}=this.marker;t.size=s,t.fill=e.fill,t.fillOpacity=null!=(i=e.fillOpacity)?i:1,t.stroke=e.stroke,t.strokeWidth=e.strokeWidth,t.strokeOpacity=e.strokeOpacity}enableOrDisableButtons(){const{currentPage:t,totalPages:e}=this,i=0===e,s=t===e-1,n=0===t;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}nextButtonContainsPoint(t,e){return!this.nextButtonDisabled&&this.nextButton.containsPoint(t,e)}previousButtonContainsPoint(t,e){return!this.previousButtonDisabled&&this.previousButton.containsPoint(t,e)}clickNext(){this.incrementPage(),this.onPaginationChanged()}clickPrevious(){this.decrementPage(),this.onPaginationChanged()}setPage(t){t=_s(0,t,this.totalPages-1),this.currentPage!==t&&(this.currentPage=t,this.onPaginationChanged())}onPaginationClick(t){const{offsetX:e,offsetY:i}=t;this.nextButtonContainsPoint(e,i)?(this.clickNext(),t.consume()):this.previousButtonContainsPoint(e,i)&&(this.clickPrevious(),t.consume())}onPaginationMouseMove(t){const{offsetX:e,offsetY:i}=t;this.nextButtonContainsPoint(e,i)?(this.cursorManager.updateCursor(this.id,"pointer"),this.highlightActive="next"):this.previousButtonContainsPoint(e,i)?(this.cursorManager.updateCursor(this.id,"pointer"),this.highlightActive="previous"):(this.cursorManager.updateCursor(this.id),this.highlightActive=void 0),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(){const t=Rd(this.marker.shape||Ad);this.previousButton=new t,this.nextButton=new t,this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(6)}attachPagination(t){t.append(this.group)}computeBBox(){return this.group.computeBBox()}};fu.className="Pagination",b([$n(Zn)],fu.prototype,"marker",2),b([$n(Zn)],fu.prototype,"activeStyle",2),b([$n(Zn)],fu.prototype,"inactiveStyle",2),b([$n(Zn)],fu.prototype,"highlightStyle",2),b([$n(Zn)],fu.prototype,"label",2);var xu=class extends fe{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",this.formatter=void 0}};b([$n(sa,{optional:!0})],xu.prototype,"maxLength",2),b([$n(ma)],xu.prototype,"color",2),b([$n(Ia,{optional:!0})],xu.prototype,"fontStyle",2),b([$n(Ca,{optional:!0})],xu.prototype,"fontWeight",2),b([$n(sa)],xu.prototype,"fontSize",2),b([$n(ta)],xu.prototype,"fontFamily",2),b([$n(Jn,{optional:!0})],xu.prototype,"formatter",2);var bu=class extends fe{constructor(){super(...arguments),this.size=15,this.padding=8,this.enabled=!0}};b([Zr(t=>{var e;return null==(e=t.parent)?void 0:e.onMarkerShapeChange()})],bu.prototype,"shape",2),b([$n(sa)],bu.prototype,"size",2),b([$n(sa)],bu.prototype,"padding",2),b([$n(sa,{optional:!0})],bu.prototype,"strokeWidth",2),b([$n(Qn)],bu.prototype,"enabled",2);var vu=class extends fe{};b([$n(sa,{optional:!0})],vu.prototype,"strokeWidth",2),b([$n(sa,{optional:!0})],vu.prototype,"length",2);var Su=class extends fe{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.toggleSeriesVisible=!0,this.showSeriesStroke=!1,this.marker=new bu,this.label=new xu,this.line=new vu}};b([$n(sa,{optional:!0})],Su.prototype,"maxWidth",2),b([$n(sa)],Su.prototype,"paddingX",2),b([$n(sa)],Su.prototype,"paddingY",2),b([$n(Qn)],Su.prototype,"toggleSeriesVisible",2),b([$n(Qn)],Su.prototype,"showSeriesStroke",2),b([$n(Zn)],Su.prototype,"marker",2),b([$n(Zn)],Su.prototype,"label",2),b([$n(Zn)],Su.prototype,"line",2);var Mu=class extends fe{};b([$n(Jn,{optional:!0})],Mu.prototype,"legendItemClick",2),b([$n(Jn,{optional:!0})],Mu.prototype,"legendItemDoubleClick",2);var ku=class extends fe{constructor(t){super(),this.ctx=t,this.id=Fs(this),this.group=new ko({name:"legend",layer:!0,zIndex:11}),this.itemSelection=Er.select(this.group,pu),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.item=new Su,this.listeners=new Mu,this.enabled=!0,this.position="bottom",this.spacing=20,this.characterWidths=new Map,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.focus={mode:"item",index:0},this.item.marker.parent=this,this.pagination=new fu(e=>t.updateService.update(e),t=>this.updatePageNumber(t),t.regionManager,t.cursorManager),this.pagination.attachPagination(this.group),this.item.marker.parent=this;const e=t.regionManager.addRegionFromProperties({name:"legend",bboxproviders:[this.group],canInteraction:()=>this.enabled&&this.group.visible});this.destroyFns.push(e.addListener("click",t=>this.checkLegendClick(t),17),e.addListener("dblclick",t=>this.checkLegendDoubleClick(t),17),e.addListener("hover",t=>this.handleLegendMouseMove(t)),e.addListener("leave",t=>this.handleLegendMouseExit(t),17),e.addListener("enter",t=>this.handleLegendMouseEnter(t),17),e.addListener("blur",t=>this.onBlur(t)),e.addListener("tab",t=>this.onTab(t)),e.addListener("tab-start",t=>this.onTabStart(t)),e.addListener("nav-vert",t=>this.onNav(t)),e.addListener("nav-hori",t=>this.onNav(t)),e.addListener("submit",t=>this.onSubmit(t)),t.layoutService.addListener("start-layout",t=>this.positionLegend(t.shrinkRect)),()=>this.detachLegend())}set data(t){this._data=t,this.updateGroupVisibility()}get data(){return this._data}destroy(){this.destroyFns.forEach(t=>t()),this.pagination.destroy()}onMarkerShapeChange(){this.itemSelection.clear(),this.group.markDirty(this.group,2)}getOrientation(){if(void 0!==this.orientation)return this.orientation;switch(this.position){case"right":case"left":return"vertical";case"bottom":case"top":return"horizontal"}}getCharacterWidths(t){const{characterWidths:e}=this;if(e.has(t))return e.get(t);const i={"...":Bo.getTextSize("...",t).width};return e.set(t,i),i}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)}detachLegend(){var t;null==(t=this.group.parent)||t.removeChild(this.group)}getItemLabel(t){const{ctx:{callbackCache:e}}=this,{formatter:i}=this.item.label;return i?e.call(i,{itemId:t.itemId,value:t.label.text,seriesId:t.seriesId}):t.label.text}calcLayout(t,e){const{paddingX:i,paddingY:s,label:n,maxWidth:a,marker:{size:o,padding:r,shape:l},label:{maxLength:h=1/0,fontStyle:c,fontWeight:d,fontSize:u,fontFamily:p},line:g,showSeriesStroke:m}=this.item,y=[...this.data];this.reverseOrder&&y.reverse(),this.itemSelection.update(y);const f=[],x=zo(n),b=null!=a?a:.8*t,v=o+r+i;if(this.itemSelection.each((t,e)=>{var i,s,n;const a=Rd(null!=l?l:e.marker.shape),y=null!=(i=e.marker.enabled)?i:this.item.marker.enabled;t.marker&&t.marker instanceof a||(t.marker=new a),t.markerSize=o,t.spacing=r,t.fontStyle=c,t.fontWeight=d,t.fontSize=u,t.fontFamily=p;const S=null!=(s=e.itemId)?s:e.id,M=this.getItemLabel(e),k=(null!=M?M:"<unknown>").replace(/\r?\n/g," ");t.text=this.truncate(k,h,b,v,x,S),m&&void 0!==e.line?(t.lineVisible=!0,t.markerVisible=y,t.setSeriesStrokeOffset(null!=(n=g.length)?n:5)):(t.lineVisible=!1,t.markerVisible=!0),f.push(t.computeBBox())}),t=Math.max(1,t),e=Math.max(1,e),!isFinite(t))return!1;const S=this.size,M=this.oldSize;S[0]=t,S[1]=e,S[0]===M[0]&&S[1]===M[1]||(M[0]=S[0],M[1]=S[1]);const{pages:k,maxPageHeight:D,maxPageWidth:w}=this.updatePagination(f,t,e);this.pages=k,this.maxPageSize=[w-i,D-s];const I=this.pagination.currentPage,C=this.pages[I];this.pages.length<1||!C?this.visible=!1:(this.visible=!0,this.updatePositions(I),this.update())}truncate(t,e,i,s,n,a){const o=t.split("");let r=!1;if(t.length>e&&(t=`${t.substring(0,e)}`,r=!0),Math.floor(s+Bo.getTextSize(t,n).width)>i){let e="";const a=this.getCharacterWidths(n);let l=s+a["..."];for(const t of o){if(a[t]||(a[t]=Bo.getTextSize(t,n).width),l+=a[t],l>i)break;e+=t}t=e,r=!0}return r?(t+="...",this.truncatedItems.add(a)):this.truncatedItems.delete(a),t}updatePagination(t,e,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,t.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:a,maxPageHeight:o,maxPageWidth:r,paginationBBox:l,paginationVertical:h}=this.calculatePagination(t,e,i),c=a.findIndex(t=>t.endIndex>=n);this.pagination.currentPage=_s(0,c,a.length-1);const{paddingX:d,paddingY:u}=this.item,p=r-d,g=o-u;let m=0,y=-l.y-this.item.marker.size/2;return h?y+=g+8:(m+=-l.x+p+8,y+=(g-l.height)/2),this.pagination.translationX=m,this.pagination.translationY=y,this.pagination.update(),this.pagination.updateMarkers(),{maxPageHeight:o,maxPageWidth:r,pages:a}}calculatePagination(t,e,i){var s,n,a;const{paddingX:o,paddingY:r}=this.item,l=this.getOrientation(),h=["left","right"].includes(this.position);let c=this.pagination.computeBBox(),d=new Js(0,0,0,0),u=[],p=0,g=0,m=0;const y=t=>t.width===c.width&&t.height===c.height,f=void 0!==this.maxWidth&&void 0!==this.maxHeight;do{if(m++>10){E.warn("unable to find stable legend layout.");break}c=d;const y=e-(h?0:c.width),x=cu({orientation:l,bboxes:t,maxHeight:i-(h?c.height:0),maxWidth:y,itemPaddingY:r,itemPaddingX:o,forceResult:f});u=null!=(s=null==x?void 0:x.pages)?s:[],p=null!=(n=null==x?void 0:x.maxPageWidth)?n:0,g=null!=(a=null==x?void 0:x.maxPageHeight)?a:0;const b=u.length;if(this.pagination.visible=b>1,this.pagination.totalPages=b,this.pagination.update(),d=this.pagination.computeBBox(),!this.pagination.visible)break}while(!y(d));return{maxPageWidth:p,maxPageHeight:g,pages:u,paginationBBox:c,paginationVertical:h}}getPageItemCount(t){let e=0;for(const i of this.pages[t].columns)e+=i.indices.length;return e}getNodeIndexFromFocusIndex(){const{index:t}=this.focus,e=this.pages[this.pagination.currentPage];let i=0;for(const s of e.columns){if(t<i+s.indices.length)return s.indices[t-i];i+=s.indices.length}return-1}updatePositions(t=0){const{item:{paddingY:e},itemSelection:i,pages:s}=this;if(s.length<1||!s[t])return;const{columns:n,startIndex:a,endIndex:o}=s[t];let r=0,l=0;const h=n.length,c=n[0].indices.length,d="horizontal"===this.getOrientation(),u=n[0].bboxes[0].height+e,p=[];i.each((t,e,i)=>{var s,g;if(i<a||i>o)return void(t.visible=!1);const m=i-a;let y=0,f=0;d?(y=m%h,f=Math.floor(m/h)):(y=Math.floor(m/c),f=m%c),t.visible=!0;const x=n[y];x&&(l=u*f,r=null!=(s=p[f])?s:0,p[f]=(null!=(g=p[f])?g:0)+x.columnWidth,t.translationX=Math.floor(r),t.translationY=Math.floor(l))})}updatePageNumber(t){const{pages:e}=this,{startIndex:i,endIndex:s}=e[t];0===i?this.paginationTrackingIndex=0:t===e.length-1?this.paginationTrackingIndex=s:this.paginationTrackingIndex=Math.floor((i+s)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(t),this.ctx.updateService.update(6)}update(){const{label:{color:t},marker:e,line:i,showSeriesStroke:s}=this.item;this.itemSelection.each((n,a)=>{var o,r;const l=a.marker;n.markerFill=l.fill,n.markerStroke=l.stroke,n.markerStrokeWidth=null!=(o=e.strokeWidth)?o:Math.min(2,l.strokeWidth),n.markerFillOpacity=l.fillOpacity,n.markerStrokeOpacity=l.strokeOpacity,n.opacity=a.enabled?1:.5,n.color=t;const{line:h}=a;s&&void 0!==h&&(n.lineStroke=h.stroke,n.lineStrokeOpacity=h.strokeOpacity,n.lineStrokeWidth=null!=(r=i.strokeWidth)?r:Math.min(2,h.strokeWidth),n.lineLineDash=h.lineDash)})}getDatumForPoint(t,e){const i=[],s={dist:1/0,datum:void 0};for(const n of this.group.children){if(!n.visible)continue;if(!(n instanceof pu))continue;const a=n.computeBBox();if(a.grow(this.item.paddingX/2,"horizontal"),a.grow(this.item.paddingY/2,"vertical"),a.containsPoint(t,e))return n.datum;const o=t-a.x-this.item.paddingX/2,r=e-a.y-this.item.paddingY/2,l=p(o,2)+p(r,2);o>=0&&r>=0&&l<s.dist&&(s.dist=l,s.datum=n.datum),i.push(a)}if(Js.merge(i).containsPoint(t,e))return s.datum}computePagedBBox(){const t=this.group.computeBBox();if(this.pages.length<=1)return t;const[e,i]=this.maxPageSize;return t.height=Math.max(i,t.height),t.width=Math.max(e,t.width),t}checkLegendClick(t){const e=this.getDatumForPoint(t.offsetX,t.offsetY);this.doClick(e)&&t.consume()}doClick(t){const{listeners:{legendItemClick:e},ctx:{chartService:i,highlightManager:s},item:{toggleSeriesVisible:n},preventHidingAll:a}=this;if(!t)return!1;const{id:o,itemId:r,enabled:l}=t,h=i.series.find(t=>t.id===o);if(!h)return!1;let c=l;if(n){c=!l,a&&!c&&i.series.flatMap(t=>t.getLegendData("category")).filter(t=>t.enabled).length<2&&(c=!0);const e=c?"visible":"hidden";this.ctx.ariaAnnouncementService.announceValue(`${e}`),this.ctx.chartEventManager.legendItemClick(h,r,c,t.legendItemName)}return c?s.updateHighlight(this.id,{series:h,itemId:r,datum:void 0}):s.updateHighlight(this.id),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),null==e||e({type:"click",enabled:c,itemId:r,seriesId:h.id}),!0}checkLegendDoubleClick(t){var e;const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},item:{toggleSeriesVisible:n}}=this;if("integrated"===s.mode)return;const a=this.getDatumForPoint(t.offsetX,t.offsetY);if(!a)return;const{id:o,itemId:r,seriesId:l}=a,h=s.series.find(t=>t.id===o);if(h){if(t.consume(),n){const t=s.series.flatMap(t=>t.getLegendData("category")),i=t.filter(t=>t.enabled).length,n=t.find(t=>t.itemId===r&&t.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(h,r,null!=(e=null==n?void 0:n.enabled)&&e,i,null==n?void 0:n.legendItemName)}this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),null==i||i({type:"dblclick",enabled:!0,itemId:r,seriesId:h.id})}}handleLegendMouseMove(t){if(!this.enabled)return;const{offsetX:e,offsetY:i}=t;t.consume();const s=this.getDatumForPoint(e,i);this.doHover(t,s)}doHover(t,e){var i;const{item:{toggleSeriesVisible:s},listeners:n}=this;if(void 0===t||void 0===e)return this.ctx.cursorManager.updateCursor(this.id),void this.ctx.highlightManager.updateHighlight(this.id);const a=e?this.ctx.chartService.series.find(t=>t.id===(null==e?void 0:e.id)):void 0;if(e&&this.truncatedItems.has(null!=(i=e.itemId)?i:e.id)){const{offsetX:i,offsetY:s}=t;this.ctx.tooltipManager.updateTooltip(this.id,{offsetX:i,offsetY:s,lastPointerEvent:t,showArrow:!1},sl({content:this.getItemLabel(e)}))}else this.ctx.tooltipManager.removeTooltip(this.id);(s||null!=n.legendItemClick||null!=n.legendItemDoubleClick)&&this.ctx.cursorManager.updateCursor(this.id,"pointer"),(null==e?void 0:e.enabled)&&a?this.ctx.highlightManager.updateHighlight(this.id,{series:a,itemId:null==e?void 0:e.itemId,datum:void 0}):this.ctx.highlightManager.updateHighlight(this.id)}handleLegendMouseExit(t){this.doMouseExit()}doMouseExit(){this.ctx.cursorManager.updateCursor(this.id),this.ctx.tooltipManager.removeTooltip(this.id),16===this.ctx.interactionManager.getState()&&this.ctx.highlightManager.updateHighlight(this.id)}handleLegendMouseEnter(t){const{enabled:e,item:{toggleSeriesVisible:i},listeners:{legendItemClick:s,legendItemDoubleClick:n}}=this,a=this.getDatumForPoint(t.offsetX,t.offsetY);e&&void 0!==a&&(i||null!=s||null!=n)&&this.ctx.cursorManager.updateCursor(this.id,"pointer")}onBlur(t){this.doMouseExit(),this.focus.mode="item",this.ctx.regionManager.updateFocusIndicatorRect(void 0)}onTab(t){this.updateFocus(),t.consume()}onTabStart(t){if(!this.pagination.visible||!this.pagination.enabled)return;const e=e=>{this.focus.mode=e,this.updateFocus(),t.consume()};"item"===this.focus.mode&&1===t.delta?(this.focus.index=0===this.pagination.currentPage?1:0,e("page")):"page"===this.focus.mode&&-1===t.delta&&(this.focus.index=0,e("item"))}onNav(t){if("item"===this.focus.mode){const e=this.focus.index+t.delta,i=this.getPageItemCount(this.pagination.currentPage);this.focus.index=_s(-1,e,i),this.updateFocus(),t.consume()}else"page"===this.focus.mode&&(t.delta<0&&(this.focus.index=0),t.delta>0&&(this.focus.index=1),this.updateFocus(),t.consume())}onSubmit(t){"item"===this.focus.mode?this.doClick(this.getFocusedItem().datum):"page"===this.focus.mode&&(0===this.focus.index&&this.pagination.clickPrevious(),1===this.focus.index&&this.pagination.clickNext(),this.ctx.ariaAnnouncementService.announceValue(`Legend page ${this.pagination.currentPage+1} of ${this.pages.length}`))}maybeChangeFocusPage(){const t=this.pagination.currentPage,e=this.getPageItemCount(t);if(-1===this.focus.index)this.pagination.setPage(t-1);else{if(this.focus.index!==e)return;this.pagination.setPage(t+1)}const{currentPage:i}=this.pagination;t===i?this.focus.index=_s(0,this.focus.index,e-1):-1===this.focus.index?this.focus.index=this.getPageItemCount(i)-1:this.focus.index=0}getFocusedItem(){if("item"!==this.focus.mode)return E.error("getFocusedItem() should be called only when focus.mode is 'item'"),{nodeIndex:-1,node:void 0,datum:void 0};this.maybeChangeFocusPage();const t=this.getNodeIndexFromFocusIndex();if(t<0)return E.error(`Cannot access negative nodeIndex ${t}`),{nodeIndex:-1,node:void 0,datum:void 0};const e=this.itemSelection.nodes()[t];let i;return t<this.data.length?i=this.data[t]:E.error(`Cannot access datum[${t}]`),{nodeIndex:t,node:e,datum:i}}updateFocus(){const{focus:t,pagination:e}=this;if("item"===t.mode){const{nodeIndex:t,node:e,datum:i}=this.getFocusedItem();if(void 0===i)return;const s=null==e?void 0:e.computeTransformedBBox();this.doHover(ac(this.ctx.regionManager,{bbox:s,showFocusBox:!0}),i);const n=i&&this.getItemLabel(i);if(n){const e=i.enabled?"visible":"hidden";this.ctx.ariaAnnouncementService.announceValue(`Legend item ${t+1} of ${this.data.length}, ${n}, ${e}`)}}else if("page"===t.mode){const i=0===t.index?e.previousButton:e.nextButton;this.ctx.regionManager.updateFocusIndicatorRect(i.computeTransformedBBox());const s=["Previous legend page","Next legend page"][t.index];this.ctx.ariaAnnouncementService.announceValue(`${s}, button`)}}positionLegend(t){const e=t.clone();if(!this.enabled||!this.data.length)return{shrinkRect:e};const[i,s]=this.calculateLegendDimensions(t);this.group.translationX=0,this.group.translationY=0,this.calcLayout(i,s);const n=this.computePagedBBox(),a=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return t.height-n.height;default:return t.width-n.width}};if(this.visible){let i,s;switch(this.position){case"top":case"bottom":i=(t.width-n.width)/2,s=a(),e.shrink(n.height,this.position);break;default:i=a(),s=(t.height-n.height)/2,e.shrink(n.width,this.position)}this.group.translationX=Math.floor(-n.x+t.x+i),this.group.translationY=Math.floor(-n.y+t.y+s)}if(this.visible&&this.enabled&&this.data.length){const t=this.spacing;e.shrink(t,this.position);const i=n.clone();i.x+=this.group.translationX,i.y+=this.group.translationY}return{shrinkRect:e}}calculateLegendDimensions(t){const{width:e,height:i}=t,s=e/i;let n,a;switch(this.position){case"top":case"bottom":const t=s<1?Math.min(.5,1/s*.2):.2;n=this.maxWidth?Math.min(this.maxWidth,e):e,a=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*t);break;default:const o=s>1?Math.min(.5,.25*s):.25;n=this.maxWidth?Math.min(this.maxWidth,e):Math.round(e*o),a=this.maxHeight?Math.min(this.maxHeight,i):i}return[n,a]}};ku.className="Legend",b([$n(Zn)],ku.prototype,"pagination",2),b([$n(Zn)],ku.prototype,"item",2),b([$n(Zn)],ku.prototype,"listeners",2),b([Zr(t=>t.updateGroupVisibility()),$n(Qn)],ku.prototype,"enabled",2),b([$n(wa)],ku.prototype,"position",2),b([$n(sa,{optional:!0})],ku.prototype,"maxWidth",2),b([$n(sa,{optional:!0})],ku.prototype,"maxHeight",2),b([$n(Qn,{optional:!0})],ku.prototype,"reverseOrder",2),b([$n(Ba(["horizontal","vertical"],"an orientation"),{optional:!0})],ku.prototype,"orientation",2),b([$n(Qn,{optional:!0})],ku.prototype,"preventHidingAll",2),b([$n(sa)],ku.prototype,"spacing",2);var Du={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology"],instanceConstructor:ku,packageType:"community"},wu=class extends dd{constructor(){super(...arguments),this.zIndex=3,this._fill="#f2f2f2",this._stroke="#999999",this._strokeWidth=1,this._lineCap="square",this._centerX=0,this._centerY=0,this._width=8,this._gripLineGap=2,this._gripLineLength=8,this._height=16}set centerX(t){this._centerX!==t&&(this._centerX=t,this.dirtyPath=!0)}get centerX(){return this._centerX}set centerY(t){this._centerY!==t&&(this._centerY=t,this.dirtyPath=!0)}get centerY(){return this._centerY}set width(t){this._width!==t&&(this._width=t,this.dirtyPath=!0)}get width(){return this._width}set gripLineGap(t){this._gripLineGap!==t&&(this._gripLineGap=t,this.dirtyPath=!0)}get gripLineGap(){return this._gripLineGap}set gripLineLength(t){this._gripLineLength!==t&&(this._gripLineLength=t,this.dirtyPath=!0)}get gripLineLength(){return this._gripLineLength}set height(t){this._height!==t&&(this._height=t,this.dirtyPath=!0)}get height(){return this._height}layout(t,e){this.centerX=t,this.centerY=e}static align(t,e,i,s,n,a,o,r){const l=t.strokeWidth/2,h=t.align(i+n*o)+l,c=h+t.align(i+n*o,n*(r-o))-2*l,d=t.align(s+a/2)+l;t.layout(h,d),e.layout(c,d)}computeBBox(){const{centerX:t,centerY:e,width:i,height:s}=this;return new Js(t-i/2,e-s/2,i,s)}isPointInPath(t,e){const i=this.transformPoint(t,e);return this.computeBBox().containsPoint(i.x,i.y)}updatePath(){var t,e,i;const{centerX:s,centerY:n,path:a,strokeWidth:o,gripLineGap:r,gripLineLength:l}=this,h=null!=(i=null==(e=null==(t=this.layerManager)?void 0:t.canvas)?void 0:e.pixelRatio)?i:1;a.clear();const c=Math.floor(this.width/2*h)/h,d=Math.floor(this.height/2*h)/h;a.moveTo(s-c,n-d),a.lineTo(s+c,n-d),a.lineTo(s+c,n+d),a.lineTo(s-c,n+d),a.closePath();const u=Math.floor((r+o)/2*h)/h,p=Math.floor(l/2*h)/h;a.moveTo(s-u,n-p),a.lineTo(s-u,n+p),a.moveTo(s+u,n-p),a.lineTo(s+u,n+p)}};wu.className="RangeHandle",b([$n(ma)],wu.prototype,"_fill",2),b([$n(ma)],wu.prototype,"_stroke",2),b([$n(sa)],wu.prototype,"_strokeWidth",2),b([$n(Ma)],wu.prototype,"_lineCap",2),b([$n(sa)],wu.prototype,"_width",2),b([$n(sa)],wu.prototype,"_gripLineGap",2),b([$n(sa)],wu.prototype,"_gripLineLength",2),b([$n(sa)],wu.prototype,"_height",2);var Iu=class extends dd{constructor(){super(...arguments),this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1}layout(t,e,i,s){this.x=t,this.y=e,this.width=i,this.height=s,this.dirtyPath=!0}update(t,e){this.min=isNaN(t)?this.min:t,this.max=isNaN(e)?this.max:e,this.dirtyPath=!0}computeBBox(){const{x:t,y:e,width:i,height:s}=this;return new Js(t,e,i,s)}computeVisibleRangeBBox(){const{x:t,y:e,width:i,height:s,min:n,max:a}=this,o=t+i*n;return new Js(o,e,t+i*a-o,s)}updatePath(){const{path:t,x:e,y:i,width:s,height:n,min:a,max:o,strokeWidth:r}=this,l=r/2;t.clear();const h=this.align(e)+l,c=this.align(i)+l,d=h+this.align(e,s)-2*l,u=c+this.align(i,n)-2*l;t.moveTo(h,c),t.lineTo(d,c),t.lineTo(d,u),t.lineTo(h,u),t.closePath();const p=this.align(e+s*a)+l,g=p+this.align(e+s*a,s*(o-a))-2*l;t.moveTo(p,c),t.lineTo(p,u),t.lineTo(g,u),t.lineTo(g,c),t.closePath()}};Iu.className="RangeMask";var Cu=class extends ko{constructor(t){super({name:"rangeSelectorGroup",layer:!0,zIndex:12}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.isContainerNode=!0,this.background=new ko({name:"navigator-background"}),this.background.zIndex=1,this.appendChild(this.background),this.append(t)}layout(t,e,i,s,n,a){this.x=t,this.y=e,this.width=i,this.height=s,this.lOffset=n,this.rOffset=a,this.background.translationX=t,this.background.translationY=e}updateBackground(t,e){null!=t&&this.background.removeChild(t),null!=e&&this.background.appendChild(e)}computeBBox(){const{x:t,y:e,width:i,height:s,lOffset:n,rOffset:a}=this;return new Js(t-n,e,i+(n+a),s)}},Lu=class extends St{constructor(t){super(),this.ctx=t,this.miniChart=void 0,this.enabled=!1,this.mask=new Iu,this.minHandle=new wu,this.maxHandle=new wu,this.height=30,this.margin=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new Cu([this.mask,this.minHandle,this.maxHandle]),this._min=0,this._max=1,this.minRange=.001;const e=t.regionManager.addRegion("navigator",this.rangeSelector);this.destroyFns.push(t.scene.attachNode(this.rangeSelector),e.addListener("hover",t=>this.onHover(t),25),e.addListener("drag-start",t=>this.onDragStart(t),25),e.addListener("drag",t=>this.onDrag(t),25),e.addListener("drag-end",()=>this.onDragEnd(),25),e.addListener("leave",t=>this.onLeave(t),25),t.zoomManager.addListener("zoom-change",t=>this.onZoomChange(t))),this.updateGroupVisibility()}updateBackground(t,e){var i;null==(i=this.rangeSelector)||i.updateBackground(t,e)}updateGroupVisibility(){const{enabled:t}=this;null!=this.rangeSelector&&t!==this.rangeSelector.visible&&(this.rangeSelector.visible=t,t?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}performLayout(t){return S(this,arguments,function*({shrinkRect:t}){if(this.enabled){const e=this.height+this.margin;t.shrink(e,"bottom"),this.y=t.y+t.height+this.margin}else this.y=0;return{shrinkRect:t}})}performCartesianLayout(t){return S(this,null,function*(){const{x:e,width:i}=t.seriesRect;if(this.enabled){const{y:t,height:s}=this;this.layoutNodes(e,t,i,s)}this.x=e,this.width=i})}onHover(t){if(!this.enabled)return;const{mask:e,minHandle:i,maxHandle:s}=this,{offsetX:n,offsetY:a}=t;i.containsPoint(n,a)||s.containsPoint(n,a)?this.ctx.cursorManager.updateCursor("navigator","ew-resize"):e.computeVisibleRangeBBox().containsPoint(n,a)?this.ctx.cursorManager.updateCursor("navigator","grab"):this.ctx.cursorManager.updateCursor("navigator")}onDragStart(t){if(!this.enabled)return;const{mask:e,minHandle:i,maxHandle:s,x:n,width:a,_min:o}=this,{offsetX:r,offsetY:l}=t;i.zIndex<s.zIndex?s.containsPoint(r,l)?this.dragging="max":i.containsPoint(r,l)&&(this.dragging="min"):i.containsPoint(r,l)?this.dragging="min":s.containsPoint(r,l)&&(this.dragging="max"),null==this.dragging&&e.computeVisibleRangeBBox().containsPoint(r,l)&&(this.dragging="pan",this.panStart=(r-n)/a-o),null!=this.dragging&&this.ctx.zoomManager.fireZoomPanStartEvent("navigator")}onDrag(t){if(!this.enabled||null==this.dragging)return;const{dragging:e,minRange:i,panStart:s,x:n,width:a}=this;let{_min:o,_max:r}=this;const{offsetX:l}=t,h=(l-n)/a;if("min"===e)o=_s(0,h,r-i);else if("max"===e)r=_s(o+i,h,1);else if("pan"===e&&null!=s){const t=r-o;o=_s(0,h-s,1-t),r=o+t}this._min=o,this._max=r,this.updateZoom()}onDragEnd(){this.dragging=void 0}onLeave(t){this.ctx.cursorManager.updateCursor("navigator")}onZoomChange(t){const{x:e}=t;e&&(this._min=e.min,this._max=e.max,this.updateNodes(e.min,e.max))}layoutNodes(t,e,i,s){const{rangeSelector:n,mask:a,minHandle:o,maxHandle:r,_min:l,_max:h}=this;n.layout(t,e,i,s,o.width/2,r.width/2),a.layout(t,e,i,s),wu.align(o,r,t,e,i,s,l,h),l+(h-l)/2<.5?(o.zIndex=3,r.zIndex=4):(o.zIndex=4,r.zIndex=3)}updateNodes(t,e){this.mask.update(t,e)}updateZoom(){if(!this.enabled)return;const{_min:t,_max:e}=this,i=this.ctx.zoomManager.getZoom();return null!=t&&null!=e?this.ctx.zoomManager.updateZoom("navigator",{x:{min:t,max:e},y:null==i?void 0:i.y},!1,t=>{null==this.min&&null==this.max||E.warnOnce(`Could not apply [navigator.min] or [navigator.max] as [${t}] has modified the initial zoom state.`)}):void 0}};b([$n(Zn,{optional:!0})],Lu.prototype,"miniChart",2),b([$n(Qn),Zr(t=>t.updateGroupVisibility())],Lu.prototype,"enabled",2),b([$n(sa)],Lu.prototype,"height",2),b([$n(sa)],Lu.prototype,"margin",2),b([Xr({newValue(t){this._min=t,this.updateZoom()}}),$n(Un(na,ca("max")),{optional:!0})],Lu.prototype,"min",2),b([Xr({newValue(t){this._max=t,this.updateZoom()}}),$n(Un(na,da("min")),{optional:!0})],Lu.prototype,"max",2);var Au={type:"root",optionsKey:"navigator",packageType:"community",chartTypes:["cartesian"],instanceConstructor:Lu,themeTemplate:{navigator:{enabled:!1,height:30,mask:{fill:"#999999",stroke:"#999999",strokeWidth:1,fillOpacity:.2},minHandle:{fill:"#f2f2f2",stroke:"#999999",strokeWidth:1,width:9,height:16,gripLineGap:1,gripLineLength:8},maxHandle:{fill:"#f2f2f2",stroke:"#999999",strokeWidth:1,width:9,height:16,gripLineGap:1,gripLineLength:8}}}},Tu=({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}},Nu=t=>{const{fill:e,stroke:i}=Tu(t);return{marker:{fill:e,stroke:i}}};function Ou(t,e,i,s,n){const{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:r}=n,l=(s,n,a)=>{i.animate({id:`${t}_${e}_${n.id}_${s}`,groupId:t,from:0,to:1,ease:xn,collapsable:!1,onUpdate(t,e){e&&"removed"!==s||(n.path.clear(!0),a(t,n),n.checkPathDirty())},onStop(){"added"===s&&(n.path.clear(!0),a(1,n),n.checkPathDirty())},phase:An[s]})};for(const t of s)i.isSkipped()||(l("removed",t,r),l("updated",t,o)),l("added",t,a)}var Ru=null;function Eu(t){if(null!=t)return""===t?"":(null!=Ru||(Ru=Ms("div")),Ru.textContent=String(t),Ru.innerHTML)}function Pu({id:t},e,i,...s){Nn(t,e,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function Bu({id:t},e,i,...s){Nn(t,e,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function Fu(t){return{opacity:1}}var zu=class extends fe{constructor(){super(...arguments),this._dirty=3}markDirty(t,e=1){this._dirty<e&&(this._dirty=e)}markClean(t){this._dirty=0}isDirty(){return this._dirty>0}},Gu=class extends zu{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};b([$n(Qn),sn({redraw:3})],Gu.prototype,"enabled",2),b([$n(ma),sn({redraw:3})],Gu.prototype,"color",2),b([$n(ea),sn({redraw:3})],Gu.prototype,"xOffset",2),b([$n(ea),sn({redraw:3})],Gu.prototype,"yOffset",2),b([$n(sa),sn({redraw:3})],Gu.prototype,"blur",2);var _u=Ga(t=>Od(t)||"function"==typeof yd&&Object.create(t.prototype)instanceof yd,"a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class"),ju=class extends zu{constructor(){super(...arguments),this.enabled=!0,this.shape=fd,this.size=6,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1}getStyle(){const{size:t,fill:e,fillOpacity:i,stroke:s,strokeWidth:n,strokeOpacity:a}=this;return{size:t,fill:e,fillOpacity:i,stroke:s,strokeWidth:n,strokeOpacity:a}}getDiameter(){return this.size+this.strokeWidth}};b([$n(Qn),sn({redraw:3})],ju.prototype,"enabled",2),b([$n(_u),sn({redraw:3})],ju.prototype,"shape",2),b([$n(sa),sn({redraw:3})],ju.prototype,"size",2),b([$n(ma,{optional:!0}),sn({redraw:3})],ju.prototype,"fill",2),b([$n(na),sn({redraw:3})],ju.prototype,"fillOpacity",2),b([$n(ma,{optional:!0}),sn({redraw:3})],ju.prototype,"stroke",2),b([$n(sa),sn({redraw:3})],ju.prototype,"strokeWidth",2),b([$n(na),sn({redraw:3})],ju.prototype,"strokeOpacity",2),b([$n(Jn,{optional:!0}),sn({redraw:3})],ju.prototype,"formatter",2);var Wu=class extends fe{constructor(){super(...arguments),this.enabled=!1}};b([$n(Qn)],Wu.prototype,"enabled",2);var Vu=class extends fe{constructor(){super(...arguments),this.enabled=!0,this.interaction=new Wu,this.position=new nl}toTooltipHtml(t,e){return this.renderer?sl(this.renderer(e),t):sl(t)}};b([$n(Qn)],Vu.prototype,"enabled",2),b([$n(Qn,{optional:!0})],Vu.prototype,"showArrow",2),b([$n(Jn,{optional:!0})],Vu.prototype,"renderer",2),b([$n(Zn)],Vu.prototype,"interaction",2),b([$n(Zn)],Vu.prototype,"position",2);var Ku=class extends Vd{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.shadow=new Gu,this.marker=new ju,this.label=new Go,this.tooltip=new Vu,this.connectMissingData=!1}};function Yu({id:t},e,i,...s){Nn(t,"markers",e,s,{opacity:0},{opacity:1},{phase:i?An[i]:"trailing"}),s.forEach(t=>t.cleanup())}function $u({id:t},e,...i){Nn(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(t=>t.cleanup())}function Hu({id:t,nodeDataDependencies:e},i,...s){const n=e.seriesRectWidth;Tn(t,"markers",i,s,{fromFn:(t,e)=>{var i,s;const a=null!=(s=null==(i=e.midPoint)?void 0:i.x)?s:n;let o=_s(0,kn(a/n),1);return isNaN(o)&&(o=0),{scalingX:0,scalingY:0,delay:o,duration:.2,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function Uu(t){return{opacity:1,scalingX:1,scalingY:1}}function Xu(t,e){var i,s,n,a;return{translationX:null!=(s=null==(i=e.point)?void 0:i.x)?s:NaN,translationY:null!=(a=null==(n=e.point)?void 0:n.y)?a:NaN}}function Zu(t,e){const i=(e,i)=>{const s=t[i][e];return Array.isArray(s)?s[0]:s},s=e=>{const{xValue:s}=e;return t.moved[s]?{point:i(s,"moved"),status:"updated"}:t.removed[s]?{point:i(s,"removed"),status:"removed"}:t.added[s]?{point:i(s,"added"),status:"added"}:{status:"unknown"}};return{fromFn:(t,i)=>{var n,a,o,r,l,h;const{status:c,point:d}=s(i);if("unknown"===c)return{opacity:0};const u={translationX:null!=(a=null==(n=null==d?void 0:d.from)?void 0:n.x)?a:t.translationX,translationY:null!=(r=null==(o=null==d?void 0:d.from)?void 0:o.y)?r:t.translationY,opacity:t.opacity,phase:An[c]};return"added"===e?y(m({},u),{opacity:0,translationX:null==(l=null==d?void 0:d.to)?void 0:l.x,translationY:null==(h=null==d?void 0:d.to)?void 0:h.y,phase:An.added}):("added"===c&&(u.opacity=0),u)},toFn:(t,i)=>{var n,a;const{status:o,point:r}=s(i);if("unknown"===o)return{opacity:0};const l={translationX:i.point.x,translationY:i.point.y,opacity:1,phase:An[o]};return"removed"===o||"removed"===e?y(m({},l),{translationX:null==(n=null==r?void 0:r.to)?void 0:n.x,translationY:null==(a=null==r?void 0:r.to)?void 0:a.y,opacity:0,phase:An.removed}):l}}}function qu(t,{datumIndex:e}){const i=t.getNodeData();if(void 0===i)return;const s=i[e];if(void 0===s||void 0===s.point)return;const n=t.getFormattedMarkerStyle(s).size,a=n/2,{x:o,y:r}=t.contentGroup.inverseTransformPoint(s.point.x-a,s.point.y-a);return new Js(o,r,n,n)}function Qu(t){return t.reduce(({min:t,max:e},i)=>((null==t||t.point.x>i.point.x)&&(t=i),(null==e||e.point.x<i.point.x)&&(e=i),{min:t,max:e}),{})}function Ju(t,e,i){const s=(e.y-t.y)/(e.x-t.x);return{x:i,y:(i-t.x)*s+t.y}}function tp(t,e,i,s){let n=-1,a=0;const o=[];for(;a<t.length;)t[a].change!==e?t[a].change!==i?(o.length>0&&(s(o,n,a),o.length=0),n=a,a++):a++:(o.push(t[a]),a++);o.length>0&&s(o,n,a)}function ep(t,e){tp(t,"out","in",(i,s,n)=>{var a,o;-1===s&&t[n]?i.forEach(e=>e.to=t[n].from):n===t.length&&t[s]?i.forEach(e=>e.to=t[s].from):"intersect"===e&&(null==(a=t[s])?void 0:a.from)&&(null==(o=t[n])?void 0:o.from)?i.forEach(e=>e.to=Ju(t[s].from,t[n].from,e.from.x)):i.forEach(t=>t.to=t.from)}),tp(t,"in","out",(i,s,n)=>{var a,o;-1===s&&t[n]?i.forEach(e=>e.from=t[n].to):n===t.length&&t[s]?i.forEach(e=>e.from=t[s].to):"intersect"===e&&(null==(a=t[s])?void 0:a.to)&&(null==(o=t[n])?void 0:o.to)?i.forEach(e=>e.from=Ju(t[s].to,t[n].to,e.to.x)):i.forEach(t=>t.from=t.to)})}function ip(t,e,i){const s=isNaN(t.x)?e.x:t.x,n=isNaN(t.y)?e.y:t.y,a=e.x-t.x,o=e.y-t.y;return{x:s+(isNaN(a)?0:a*i),y:n+(isNaN(o)?0:o*i)}}function sp(t,e,i){const{path:s}=i;let n;for(const i of t){const{from:t,to:a}=i,o=e[i.change];if(null==o||null==t||null==a)continue;const{x:r,y:l}=ip(t,a,o);if(!1===i.moveTo)s.lineTo(r,l);else if(!0!==i.moveTo&&n){if(n){const t="in"===i.moveTo?o:1-o,{x:e,y:a}=ip(n,{x:r,y:l},t);s.lineTo(e,a),s.moveTo(r,l)}}else s.moveTo(r,l);n={x:r,y:l}}}function np({id:t,visible:e,nodeDataDependencies:i},s,...n){const{seriesRectWidth:a,seriesRectHeight:o}=i;Nn(t,"path_properties",s,n,{clipX:0},{clipX:a},{phase:"initial",start:{clipMode:"normal",clipY:o,visible:e},finish:{clipMode:void 0,visible:e}})}function ap({id:t},e,i,s="add",...n){Nn(t,e,i,n,{opacity:0},{opacity:1},{phase:s})}function op({id:t},e,i,...s){Nn(t,e,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function rp(t){return e=>({opacity:t.getOpacity(),clipScalingX:1,clipMode:void 0})}function lp({nodeDataDependencies:t},e){const i=t=>isFinite(t)?t:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}function hp(t){return"continuous"===t.type||"log"===t.type}function cp(t){return"category"===t.type}function dp(t,e){return t.domain.length===e.domain.length&&t.range.length===e.range.length&&t.domain.every((t,i)=>t===e.domain[i])&&t.range.every((t,i)=>t===e.range[i])}function up(t,e){return void 0===t||void 0===e?void 0!==t||void 0!==e:hp(t)&&hp(e)?t.type===e.type&&dp(t,e):!(!cp(t)||!cp(e))&&dp(t,e)}function pp(t,e){if(!e)return NaN;if(t instanceof Date&&(t=t.getTime()),"continuous"===e.type&&"number"==typeof t)return(t-e.domain[0])/(e.domain[1]-e.domain[0])*(e.range[1]-e.range[0])+e.range[0];if("log"===e.type&&"number"==typeof t)return e.convert(t);const i=e.domain.findIndex(e=>e===t);return i>=0?e.range[i]:NaN}function gp(t,e){const i=Number(t),s=Number(e);return isNaN(i)||isNaN(s)?t===e:Math.abs(s-i)<.25}function mp(t=!1,e=!1){return t===e?Boolean(t):t?"in":"out"}function yp(t,e,i={}){var s,n,a,o;const{backfillSplitMode:r="intersect"}=i,l=e=>{var i,s;return{x:pp(null!=(i=e.xValue)?i:NaN,t.scales.x),y:pp(null!=(s=e.yValue)?s:NaN,t.scales.y)}},h=t=>{var i,s;return{x:pp(null!=(i=t.xValue)?i:NaN,e.scales.x),y:pp(null!=(s=t.yValue)?s:NaN,e.scales.y)}},c=[],d={added:{},moved:{},removed:{}},u=(t,e,i,s="move")=>{t&&(isNaN(t.point.x)||isNaN(t.point.y))&&(t=e);const n={from:null==t?void 0:t.point,to:null==e?void 0:e.point,moveTo:mp(null==t?void 0:t.point.moveTo,null==e?void 0:e.point.moveTo),change:s};"move"===s?(d.moved[i]=n,f++,x++):"in"===s?(d.added[i]=n,x++):"out"===s&&(d.removed[i]=n,f++),c.push(n)},{min:p,max:g}=Qu(e.nodeData),{min:m,max:y}=Qu(t.nodeData);let f=0,x=0;for(;f<e.nodeData.length||x<t.nodeData.length;){const i=e.nodeData[f],r=t.nodeData[x],c=i?l(i):void 0,d=r?h(r):void 0,b=void 0;if(c&&gp(c.x,null==r?void 0:r.point.x))u(i,r,r.xValue,"move");else if(c&&c.x<(null!=(s=null==m?void 0:m.point.x)?s:-1/0))u(i,b,i.xValue,"out");else if(c&&c.x>(null!=(n=null==y?void 0:y.point.x)?n:1/0))u(i,b,i.xValue,"out");else if(d&&d.x<(null!=(a=null==p?void 0:p.point.x)?a:-1/0))u(b,r,r.xValue,"in");else if(d&&d.x>(null!=(o=null==g?void 0:g.point.x)?o:1/0))u(b,r,r.xValue,"in");else if(c&&c.x<(null==r?void 0:r.point.x))u(i,b,i.xValue,"out");else if(d&&d.x<(null==i?void 0:i.point.x))u(b,r,r.xValue,"in");else if(i)u(i,b,i.xValue,"out");else{if(!r)throw new Error("Unable to process points");u(b,r,r.xValue,"in")}}return ep(c,r),{result:c,resultMap:d}}function fp(t,e,i,s={}){var n,a,o;const{backfillSplitMode:r="intersect",multiDatum:l=!1}=s,h=[],c={added:{},moved:{},removed:{}},d={added:{},moved:{},removed:{}},u={in:"added",move:"moved",out:"removed"};let p,g;const y=(t,e)=>{var i;const s=u[e.change];l?(null!=(i=d[s])[t]||(i[t]=[]),d[s][t].push(e)):c[s][t]=e,p=e,g=Uo(t)};let f=0,x=0,b=!1;for(;f<e.nodeData.length||x<t.nodeData.length;){const s=e.nodeData[f],r=t.nodeData[x],c=Uo(null==s?void 0:s.xValue),d=Uo(null==r?void 0:r.xValue);let u;if(c===d)u={change:"move",moveTo:mp(null!=(n=s.point.moveTo)&&n,r.point.moveTo),from:s.point,to:r.point},y(null==s?void 0:s.xValue,u),f++,x++;else if(null==i?void 0:i.removed.has(String(c)))u={change:"out",moveTo:null!=(a=s.point.moveTo)&&a,from:s.point},y(null==s?void 0:s.xValue,u),f++;else if(null==i?void 0:i.added.has(String(d)))u={change:"in",moveTo:null!=(o=r.point.moveTo)&&o,to:r.point},y(null==r?void 0:r.xValue,u),x++;else if(l&&p&&g===c)u=m({},p),y(null==s?void 0:s.xValue,u),f++;else{if(!l||!p||g!==d){b=!0;break}u=m({},p),y(null==r?void 0:r.xValue,u),x++}h.push(u)}let v=-1/0;return b||(b=h.some(t=>{const{change:e,to:{x:i=-1/0}={}}=t;if("out"===e)return;const s=i<v;return v=i,s})),b?{result:void 0,resultMap:void 0}:(ep(h,r),{result:h,resultMap:l?d:c})}function xp(t,e,i){var s,n,a,o;let r="updated";const l=t=>t.visible;if(!l(e)&&l(t))r="added";else if(l(e)&&!l(t))r="removed";else for(let t=0;t<i.length&&"move"===i[t].change&&(null==(s=i[t].from)?void 0:s.x)===(null==(n=i[t].to)?void 0:n.x)&&(null==(a=i[t].from)?void 0:a.y)===(null==(o=i[t].to)?void 0:o.y);t++)if(t===i.length-1)return"no-op";return r}function bp(t,e,i,s,n){const a=xp(t,e,i),o=function(t,e){const i="none"===e?"updated":t,s={fromFn:e=>{let s;return s="removed"===t?{finish:{visible:!1}}:"added"===t?{start:{visible:!0}}:{},m({phase:An[i]},s)},toFn:t=>({phase:An[i]})};return"fade"===e?{fromFn:e=>{const i="added"===t?0:e.opacity;return m({opacity:i},s.fromFn(e))},toFn:e=>m({opacity:"removed"===t?0:1},s.toFn(e))}:s}(a,s);return{status:a,path:{addPhaseFn:(t,e)=>{n(i,{move:1,in:t},e)},updatePhaseFn:(t,e)=>{n(i,{move:t},e)},removePhaseFn:(t,e)=>{n(i,{move:0,out:t},e)}},pathProperties:o}}function vp(t,e,i){var s,n,a;const o="category"===(null==(s=t.scales.x)?void 0:s.type);if(o!==("category"===(null==(n=e.scales.x)?void 0:n.type)))return;const{result:r,resultMap:l}=o?fp(t,e,i):yp(t,e);let h="updated";if(e.visible&&!t.visible?h="removed":!e.visible&&t.visible&&(h="added"),void 0===r||void 0===l)return;const c=null==(a=null==i?void 0:i.changed)||a||function(t,e){return!up(t.scales.x,e.scales.x)||!up(t.scales.y,e.scales.y)}(t,e)||"updated"!==h,d=bp(t,e,r,"fade",sp),u=Zu(l,h);return y(m({},d),{marker:u,hasMotion:c})}b([$n(ta)],Ku.prototype,"xKey",2),b([$n(ta,{optional:!0})],Ku.prototype,"xName",2),b([$n(ta)],Ku.prototype,"yKey",2),b([$n(ta,{optional:!0})],Ku.prototype,"yName",2),b([$n(sa,{optional:!0})],Ku.prototype,"normalizedTo",2),b([$n(ma)],Ku.prototype,"fill",2),b([$n(na)],Ku.prototype,"fillOpacity",2),b([$n(ma)],Ku.prototype,"stroke",2),b([$n(sa)],Ku.prototype,"strokeWidth",2),b([$n(na)],Ku.prototype,"strokeOpacity",2),b([$n(Da)],Ku.prototype,"lineDash",2),b([$n(sa)],Ku.prototype,"lineDashOffset",2),b([$n(Zn)],Ku.prototype,"shadow",2),b([$n(Zn)],Ku.prototype,"marker",2),b([$n(Zn)],Ku.prototype,"label",2),b([$n(Zn)],Ku.prototype,"tooltip",2),b([$n(Qn)],Ku.prototype,"connectMissingData",2);var Sp=(t=>(t[t.Fill=0]="Fill",t[t.Stroke=1]="Stroke",t[t.Marker=2]="Marker",t[t.Label=3]="Label",t))(Sp||{});function Mp(t){const{points:e,phantomPoints:i}=t.fillData;return{top:e,bottom:i}}function kp(t,e,i){return{scales:e.scales,nodeData:i[t],visible:e.visible}}function Dp(t,e,i){var s,n;const a="category"===(null==(s=t.scales.x)?void 0:s.type);if(a!==("category"===(null==(n=e.scales.x)?void 0:n.type)))return;let o="updated";e.visible&&!t.visible?o="removed":!e.visible&&t.visible&&(o="added");const{resultMap:r}=a?fp(t,e,i,{backfillSplitMode:"static",multiDatum:!0}):yp(t,e,{backfillSplitMode:"static"}),{top:l,bottom:h}=a?function(t,e,i){const s=Mp(e),n=Mp(t),a={multiDatum:!0};return{top:fp(kp("top",t,n),kp("top",e,s),i,a),bottom:fp(kp("bottom",t,n),kp("bottom",e,s),i,a)}}(t,e,i):function(t,e){const i=Mp(e),s=Mp(t);return{top:yp(kp("top",t,s),kp("top",e,i)),bottom:yp(kp("bottom",t,s),kp("bottom",e,i))}}(t,e);if(void 0===r||void 0===l.result||void 0===h.result)return;const c=bp(t,e,[...l.result,...h.result.reverse()],!!e.stackVisible&&t.stackVisible?"none":"fade",sp),d=Zu(r,o);return{status:c.status,fill:c,marker:d}}var wp=class extends Kd{constructor(t){super({moduleCtx:t,directionKeys:_d,directionNames:jd,pathsPerSeries:2,pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[1,0],animationResetFns:{path:rp({getOpacity:()=>this.getOpacity()}),label:Fu,marker:(t,e)=>m(m({},{opacity:1,scalingX:1,scalingY:1}),Xu(0,e))}}),this.properties=new Ku}processData(t){return S(this,null,function*(){var e,i;if(null==this.data||!this.properties.isValid())return;const{data:s,visible:n,seriesGrouping:{groupIndex:a=this.id,stackCount:o=1}={}}=this,{xKey:r,yKey:l,connectMissingData:h,normalizedTo:c}=this.properties,d=!this.ctx.animationManager.isSkipped(),u=null==(e=this.axes.x)?void 0:e.scale,p=null==(i=this.axes.y)?void 0:i.scale,{isContinuousX:g,xScaleType:f,yScaleType:x}=this.getScaleInformation({xScale:u,yScale:p}),b=[`area-stack-${a}-yValues`,`area-stack-${a}-yValues-trailing`,`area-stack-${a}-yValues-prev`,`area-stack-${a}-yValues-trailing-prev`,`area-stack-${a}-yValues-marker`],v=[];Nt(c)&&(v.push(Lc([b[0],b[1],b[4]],c,"range")),v.push(Lc([b[2],b[3]],c,"range"))),!g&&d&&this.processedData&&v.push(Pc(this.processedData)),d&&v.push(Nc());const S={invalidValue:null};h&&o>1&&(S.invalidValue=0),n||(S.forceValue=0),yield this.requestDataModel(t,s,{props:[Wc(r,f,{id:"xValue"}),Vc(l,x,m({id:"yValueRaw"},S)),...Hc(l,"window","current",y(m({id:"yValueEnd"},S),{groupId:b[0]}),x),...Hc(l,"window-trailing","current",y(m({id:"yValueStart"},S),{groupId:b[1]}),x),...Hc(l,"window","last",y(m({id:"yValuePreviousEnd"},S),{groupId:b[2]}),x),...Hc(l,"window-trailing","last",y(m({id:"yValuePreviousStart"},S),{groupId:b[3]}),x),...Hc(l,"normal","current",y(m({id:"yValueCumulative"},S),{groupId:b[4]}),x),...v],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")})}getSeriesDomain(t){const{processedData:e,dataModel:i,axes:s}=this;if(!e||!i||0===e.data.length)return[];const n=s.x,a=s.y,o=i.resolveProcessedDataDefById(this,"xValue"),r=i.getDomain(this,"xValue","key",e),l=i.getDomain(this,"yValueEnd","value",e);return"x"===t?"key"===(null==o?void 0:o.def.type)&&"category"===o.def.valueType?r:Uh(rs(r),n):Uh(a instanceof tu||a instanceof iu?l:[l[0]>0?0:l[0],l[1]<0?0:l[1]],a)}createNodeData(){return S(this,null,function*(){var t;const{axes:e,data:i,processedData:{data:s}={},dataModel:n}=this,a=e.x,o=e.y;if(!(a&&o&&i&&n&&this.properties.isValid()))return;const{yKey:r,xKey:l,marker:h,label:c,fill:d,stroke:u,connectMissingData:p}=this.properties,{scale:g}=a,{scale:f}=o,{isContinuousY:x}=this.getScaleInformation({xScale:g,yScale:f}),b=(null!=(t=g.bandwidth)?t:0)/2,v=n.resolveProcessedDataDefsByIds(this,["yValueStart","yValueEnd","yValueRaw","yValuePreviousStart","yValuePreviousEnd","yValueCumulative"]),S=t=>y(m({},t),{point:y(m({},t.point),{moveTo:!0})}),M=(t,e,i)=>{const s=g.convert(t)+b,n=f.convert(e);return[{point:{x:s,y:f.convert(i)},yValue:i,xValue:t},{point:{x:s,y:n},yValue:e,xValue:t}]},k=(t,e,i)=>{let s;return(Nt(this.properties.normalizedTo)?x&&$o(i):!isNaN(i))&&(s=e),{x:g.convert(t)+b,y:f.convert(s),size:h.size}},D=r,w=[],I=[],{visibleSameStackCount:C}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),L={itemId:D,fillData:{itemId:D,points:[],phantomPoints:[]},strokeData:{itemId:D,points:[]},labelData:w,nodeData:I,scales:this.calculateScaling(),visible:this.visible,stackVisible:C>0},A=L.fillData.points,T=L.fillData.phantomPoints,N=L.strokeData.points;let O,R=-1,E=-1/0;return null==s||s.forEach(t=>{const{keys:e,keys:[i],datum:s,values:a}=t;a.forEach((t,a)=>{var o,g,m;R++;const y=s[a],f=n.resolveProcessedDataDefsValues(v,{keys:e,values:t}),{yValueRaw:x,yValueCumulative:b}=f;let{yValueStart:C,yValueEnd:L,yValuePreviousStart:P,yValuePreviousEnd:B}=f;const F=null!=x,z=k(i,+b,x);if(F&&h&&I.push({index:R,series:this,itemId:D,datum:y,midPoint:{x:z.x,y:z.y},cumulativeValue:L,yValue:x,xValue:i,yKey:r,xKey:l,point:z,fill:null!=(o=h.fill)?o:d,stroke:null!=(g=h.stroke)?g:u,strokeWidth:null!=(m=h.strokeWidth)?m:this.getStrokeWidth(this.properties.strokeWidth)}),F&&c){const t=this.getLabelText(c,{value:x,datum:y,xKey:l,yKey:r,xName:this.properties.xName,yName:this.properties.yName},t=>Vt(t)?t.toFixed(2):String(t));w.push({index:R,series:this,itemId:r,datum:y,x:z.x,y:z.y,label:t?{text:t,fontStyle:c.fontStyle,fontWeight:c.fontWeight,fontSize:c.fontSize,fontFamily:c.fontFamily,textAlign:"center",textBaseline:"bottom",fill:c.color}:void 0})}const G=null!=O&&null!=i,_=null!=E&&F;_||(C=null!=C?C:0,L=null!=C?C:0,P=null!=P?P:0,B=null!=P?P:0);const[j,W]=M(O,P,B),[V,K]=M(i,C,L);!G||p&&!_||(A.push(j,V),T.push(W,K)),_&&R>0&&N.push(S(j),V),O=i,E=x})}),N.length>0&&(N[0]=S(N[0])),L})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}markerFactory(){const{shape:t}=this.properties.marker;return new(Rd(t))}updatePathNodes(t){return S(this,null,function*(){const{opacity:e,visible:i,animationEnabled:s}=t,[n,a]=t.paths,o=this.getStrokeWidth(this.properties.strokeWidth);a.setProperties({tag:1,fill:void 0,lineJoin:a.lineCap="round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:o,strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i}),n.setProperties({tag:0,stroke:void 0,lineJoin:"round",pointerEvents:1,fill:this.properties.fill,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,strokeOpacity:this.properties.strokeOpacity,fillShadow:this.properties.shadow,opacity:e,visible:i||s,strokeWidth:o}),lp(this,a),lp(this,n)})}updatePaths(t){return S(this,null,function*(){this.updateAreaPaths(t.paths,t.contextData)})}updateAreaPaths(t,e){this.updateFillPath(t,e),this.updateStrokePath(t,e)}updateFillPath(t,e){const{fillData:i}=e,[s]=t,{path:n}=s;let a;n.clear(!0);for(const{point:t}of O(i.points,function*(t){for(let e=t.length-1;e>=0;e--)yield t[e]}(i.phantomPoints)))t.moveTo?n.moveTo(t.x,t.y):(null==a?void 0:a.y)!==t.y&&(a&&n.lineTo(a.x,a.y),n.lineTo(t.x,t.y)),a=t;a&&n.lineTo(a.x,a.y),n.closePath(),s.checkPathDirty()}updateStrokePath(t,e){const{strokeData:i}=e,[,s]=t,{path:n}=s;n.clear(!0);for(const{point:t}of i.points)t.moveTo?n.moveTo(t.x,t.y):n.lineTo(t.x,t.y);s.checkPathDirty()}updateMarkerSelection(t){return S(this,null,function*(){const{nodeData:e,markerSelection:i}=t;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?e:[])})}updateMarkerNodes(t){return S(this,null,function*(){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,marker:a,fill:o,stroke:r,strokeWidth:l,fillOpacity:h,strokeOpacity:c,highlightStyle:d}=this.properties,u=Xt(i&&d.item,a.getStyle(),{fill:o,stroke:r,strokeWidth:l,fillOpacity:h,strokeOpacity:c});e.each((t,e)=>{this.updateMarkerStyle(t,a,{datum:e,highlighted:i,xKey:s,yKey:n},u)}),i||this.properties.marker.markClean()})}updateLabelSelection(t){return S(this,null,function*(){const{labelData:e,labelSelection:i}=t;return i.update(e,t=>{t.tag=3})})}updateLabelNodes(t){return S(this,null,function*(){const{labelSelection:e}=t,{enabled:i,fontStyle:s,fontWeight:n,fontSize:a,fontFamily:o,color:r}=this.properties.label;e.each((t,e)=>{const{x:l,y:h,label:c}=e;c&&i&&this.visible?(t.fontStyle=s,t.fontWeight=n,t.fontSize=a,t.fontFamily=o,t.textAlign=c.textAlign,t.textBaseline=c.textBaseline,t.text=c.text,t.x=l,t.y=h-10,t.fill=r,t.visible=!0):t.visible=!1})})}getTooltipHtml(t){const{id:e,axes:i,dataModel:s}=this,{xKey:n,xName:a,yName:o,tooltip:r,marker:l}=this.properties,{yKey:h,xValue:c,yValue:d,datum:u,itemId:p}=t,g=i.x,m=i.y;if(!this.properties.isValid()||!(g&&m&&Vt(d))||!s)return el;const y=g.formatDatum(c),f=m.formatDatum(d),x=Eu(o),b=Eu(y+": "+f),v=Xt({fill:this.properties.fill},l.getStyle(),{stroke:this.properties.stroke,strokeWidth:this.properties.strokeWidth}),{fill:S}=this.getMarkerStyle(l,{datum:t,xKey:n,yKey:h,highlighted:!1},v);return r.toTooltipHtml({title:x,content:b,backgroundColor:S},{datum:u,itemId:p,xKey:n,xName:a,yKey:h,yName:o,color:S,title:x,seriesId:e})}getLegendData(t){var e,i,s,n;if(!(null==(e=this.data)?void 0:e.length)||!this.properties.isValid()||"category"!==t)return[];const{yKey:a,yName:o,fill:r,stroke:l,fillOpacity:h,strokeOpacity:c,strokeWidth:d,lineDash:u,marker:p,visible:g}=this.properties,m=!p.enabled||void 0===p.fill;return[{legendType:t,id:this.id,itemId:a,seriesId:this.id,enabled:g,label:{text:null!=o?o:a},marker:{shape:p.shape,fill:m?r:p.fill,fillOpacity:m?h:p.fillOpacity,stroke:null!=(i=p.stroke)?i:l,strokeOpacity:null!=(s=p.strokeOpacity)?s:c,strokeWidth:null!=(n=p.strokeWidth)?n:0,enabled:p.enabled||d<=0},line:{stroke:l,strokeOpacity:c,strokeWidth:d,lineDash:u}}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:a}=this.ctx;this.updateAreaPaths(n,s),np(this,a,...n),mr([e],Xu),Hu(this,a,e),Pu(this,"labels",a,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){var e,i;const{animationManager:s}=this.ctx,{markerSelection:n,labelSelection:a,contextData:o,paths:r,previousContextData:l}=t,[h,c]=r;if(null==h&&null==c)return;super.resetAllAnimation(t);const d=()=>{this.updateAreaPaths(r,o),this.updateStrokePath(r,o)};if(null==o||null==l)return d(),Yu(this,s,"added",n),ap(this,"fill_path_properties",s,"add",h),ap(this,"stroke",s,"trailing",c),void Pu(this,"labels",s,a);const u=Dp(o,l,null==(i=null==(e=this.processedData)?void 0:e.reduced)?void 0:i.diff);if(void 0===u)return s.skipCurrentBatch(),void d();"no-op"!==u.status&&(Yu(this,s,void 0,n),Tn(this.id,"fill_path_properties",s,[h],u.fill.pathProperties),Ou(this.id,"fill_path_update",s,[h],u.fill.path),this.updateStrokePath(r,o),ap(this,"stroke",s,"trailing",c),Pu(this,"labels",s,a))}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new ko}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=t;return this.getMarkerStyle(this.properties.marker,{datum:t,xKey:e,yKey:i,highlighted:!0})}computeFocusBounds(t){return qu(this,t)}};wp.className="AreaSeries",wp.type="area";var Ip={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",instanceConstructor:wp,stackable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{__extends__:Ve,nodeClickRange:"nearest",tooltip:{position:{type:"node"}},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:ti,xOffset:3,yOffset:3,blur:5},marker:{__extends__:Ke,enabled:!1,fillOpacity:1,strokeOpacity:1,strokeWidth:0},label:{enabled:!1,fontSize:12,fontFamily:Ye,color:$e}}},paletteFactory:t=>{const{marker:e}=Nu(t);return{fill:e.fill,stroke:e.stroke,marker:e}}};function*Cp(t){for(const e of t.children)yield e}function Lp(t,e){for(const i of e){const e=i.datum;void 0===e?E.error("undefined datum"):t.addValue(i,e)}}function Ap(t,e){const{x:i,y:s}=t.contentGroup.transformPoint(e.x,e.y),{nearest:n,distanceSquared:a}=t.getQuadTree().find(i,s);if(void 0!==n)return{datum:n.value,distance:Math.sqrt(a)}}var Tp=class extends Vd{constructor(){super(...arguments),this.direction="vertical"}};b([$n(Oa)],Tp.prototype,"direction",2);var Np=class extends Kd{constructor(){super(...arguments),this.groupScale=new Kn,this.smallestDataInterval=void 0}getBandScalePadding(){return{inner:.2,outer:.1}}shouldFlipXY(){return!this.isVertical()}isVertical(){return"vertical"===this.properties.direction}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]}updateGroupScale(t){const{groupScale:e,smallestDataInterval:i,ctx:{seriesStateManager:s}}=this,n=t.scale,a=Xa.is(n)?n.calcBandwidth(i):n.bandwidth,o=[],{index:r,visibleGroupCount:l}=s.getVisiblePeerGroupIndex(this);for(let t=0;t<l;t++)o.push(String(t));return e.domain=o,e.range=[0,null!=a?a:0],t instanceof Cl?e.paddingInner=t.groupPaddingInner:e.padding=t instanceof zl?.1:0,e.round=0!==e.padding,{barWidth:e.bandwidth>=1?e.bandwidth:e.rawBandwidth,groupIndex:r}}resolveKeyDirection(t){return"x"===this.getBarDirection()?"x"===t?"y":"x":t}initQuadTree(t){Lp(t,this.datumNodesIter())}pickNodeClosestDatum(t){return Ap(this,t)}},Op=class extends Go{constructor(){super(...arguments),this.placement="inside"}};b([$n(Ra)],Op.prototype,"placement",2);var Rp=class extends Tp{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.shadow=new Gu,this.label=new Op,this.tooltip=new Vu}};function Ep({rect:t,config:e}){const{crisp:i=!0,fill:s,stroke:n,strokeWidth:a,fillOpacity:o,strokeOpacity:r,lineDash:l,lineDashOffset:h,fillShadow:c,cornerRadius:d=0,topLeftCornerRadius:u=!0,topRightCornerRadius:p=!0,bottomRightCornerRadius:g=!0,bottomLeftCornerRadius:m=!0,visible:y=!0}=e;t.crisp=i,t.fill=s,t.stroke=n,t.strokeWidth=a,t.fillOpacity=o,t.strokeOpacity=r,t.lineDash=l,t.lineDashOffset=h,t.fillShadow=c,t.topLeftCornerRadius=u?d:0,t.topRightCornerRadius=p?d:0,t.bottomRightCornerRadius=g?d:0,t.bottomLeftCornerRadius=m?d:0,t.visible=y}function Pp(t){var e,i,s,n,a,o,r=t,{datum:l,isHighlighted:h,style:c,highlightStyle:d,formatter:u,seriesId:p,ctx:{callbackCache:g}}=r,y=f(r,["datum","isHighlighted","style","highlightStyle","formatter","seriesId","ctx"]);const{fill:x,fillOpacity:b,stroke:v,strokeWidth:S}=Xt(h&&d,c),{strokeOpacity:M,fillShadow:k,lineDash:D,lineDashOffset:w,cornerRadius:I=0,topLeftCornerRadius:C=!0,topRightCornerRadius:L=!0,bottomRightCornerRadius:A=!0,bottomLeftCornerRadius:T=!0}=c;let N;return u&&(N=g.call(u,m({datum:l.datum,xKey:l.xKey,fill:x,stroke:v,strokeWidth:S,cornerRadius:I,highlighted:h,seriesId:p},y))),{fill:null!=(e=null==N?void 0:N.fill)?e:x,stroke:null!=(i=null==N?void 0:N.stroke)?i:v,strokeWidth:null!=(s=null==N?void 0:N.strokeWidth)?s:S,fillOpacity:null!=(n=null==N?void 0:N.fillOpacity)?n:b,strokeOpacity:null!=(a=null==N?void 0:N.strokeOpacity)?a:M,lineDash:D,lineDashOffset:w,fillShadow:k,cornerRadius:null!=(o=null==N?void 0:N.cornerRadius)?o:I,topLeftCornerRadius:C,topRightCornerRadius:L,bottomRightCornerRadius:A,bottomLeftCornerRadius:T}}function Bp(t=[]){const[e,i]=t;return!(0!==e||1!==i)}b([$n(ta)],Rp.prototype,"xKey",2),b([$n(ta,{optional:!0})],Rp.prototype,"xName",2),b([$n(ta)],Rp.prototype,"yKey",2),b([$n(ta,{optional:!0})],Rp.prototype,"yName",2),b([$n(ta,{optional:!0})],Rp.prototype,"stackGroup",2),b([$n(ea,{optional:!0})],Rp.prototype,"normalizedTo",2),b([$n(ma)],Rp.prototype,"fill",2),b([$n(na)],Rp.prototype,"fillOpacity",2),b([$n(ma)],Rp.prototype,"stroke",2),b([$n(sa)],Rp.prototype,"strokeWidth",2),b([$n(na)],Rp.prototype,"strokeOpacity",2),b([$n(Da)],Rp.prototype,"lineDash",2),b([$n(sa)],Rp.prototype,"lineDashOffset",2),b([$n(sa)],Rp.prototype,"cornerRadius",2),b([$n(Jn,{optional:!0})],Rp.prototype,"formatter",2),b([$n(Zn,{optional:!0})],Rp.prototype,"shadow",2),b([$n(Zn)],Rp.prototype,"label",2),b([$n(Zn)],Rp.prototype,"tooltip",2);var Fp=t=>{var e;return Ys(null!=(e=t.yValue)?e:0)};function zp(t,e,i){const{startingX:s,startingY:n}=function(t,e){const i=e[t?"y":"x"];let s=1/0,n=0;return i?(t?n=i.scale.convert(Xa.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(Xa.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}(t,e);return{isVertical:t,calculate:(e,i)=>{let a=t?e.x:s,o=t?n:e.y,r=t?e.width:0,l=t?0:e.height;const{opacity:h}=e;let c;return i&&(isNaN(a)||isNaN(o))&&(({x:a,y:o}=i),r=t?i.width:0,l=t?0:i.height,t&&!Fp(i)?o+=i.height:!t&&Fp(i)&&(a+=i.width)),c=null==e.clipBBox?void 0:Fp(e)?t?new Js(a,o-l,r,l):new Js(a-r,o,r,l):new Js(a,o,r,l),{x:a,y:o,width:r,height:l,clipBBox:c,opacity:h}},mode:i}}function Gp(t,e){return{isVertical:t,calculate:e=>({x:t?e.x:e.x+e.width/2,y:t?e.y+e.height/2:e.y,width:t?e.width:0,height:t?0:e.height,clipBBox:e.clipBBox,opacity:e.opacity}),mode:e}}function _p(t){const e=t=>null==t||isNaN(t.x)||isNaN(t.y);return{toFn:(i,s,n)=>{let a;return a="removed"===n&&null==i.datum&&"fade"===t.mode?y(m({},jp(0,s)),{opacity:0}):"removed"===n||e(s)?t.calculate(s,i.previousDatum):{x:s.x,y:s.y,width:s.width,height:s.height,clipBBox:s.clipBBox,opacity:s.opacity},a},fromFn:(i,s,n)=>{let a;"updated"===n&&e(s)?n="removed":"updated"===n&&e(i.previousDatum)&&(n="added"),a="added"===n&&null==i.previousDatum&&"fade"===t.mode?y(m({},jp(0,s)),{opacity:0}):"unknown"===n||"added"===n?t.calculate(s,i.previousDatum):{x:i.x,y:i.y,width:i.width,height:i.height,clipBBox:i.clipBBox,opacity:i.opacity};const o=An[n];return y(m({},a),{phase:o})}}}function jp(t,{x:e,y:i,width:s,height:n,clipBBox:a,opacity:o}){return{x:e,y:i,width:s,height:n,clipBBox:a,opacity:o}}function Wp(t,e,i){if(void 0===t)return;const{x:s,y:n,width:a,height:o}=t;return e.inverseTransformBBox(new Js(s,n,a,o)).clip(i)}function Vp(t,e,i){if(e.enabled&&i){const{x:s,y:n,text:a,textAlign:o,textBaseline:r}=i,{color:l,fontStyle:h,fontWeight:c,fontSize:d,fontFamily:u}=e;t.setProperties({visible:!0,x:s,y:n,text:a,fill:l,fontStyle:h,fontWeight:c,fontSize:d,fontFamily:u,textAlign:o,textBaseline:r})}else t.visible=!1}function Kp({isPositive:t,isVertical:e,placement:i,padding:s=0,rect:n}){let a=n.x+n.width/2,o=n.y+n.height/2,r="center",l="middle";switch(i){case"start":e?(o=t?n.y+n.height+s:n.y-s,l=t?"top":"bottom"):(a=t?n.x-s:n.x+n.width+s,r=t?"start":"end");break;case"outside":case"end":e?(o=t?n.y-s:n.y+n.height+s,l=t?"bottom":"top"):(a=t?n.x+n.width+s:n.x-s,r=t?"start":"end")}return{x:a,y:o,textAlign:r,textBaseline:l}}var Yp=class extends Np{constructor(t){super({moduleCtx:t,directionKeys:_d,directionNames:jd,pickModes:[0],pathsPerSeries:0,hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:jp,label:Fu}}),this.properties=new Rp}processData(t){return S(this,null,function*(){var e,i,s;if(!this.properties.isValid()||!this.data)return;const{seriesGrouping:{groupIndex:n=this.id}={},data:a=[]}=this,{xKey:o,yKey:r,normalizedTo:l}=this.properties,h=!this.ctx.animationManager.isSkipped(),c=null==(e=this.getCategoryAxis())?void 0:e.scale,d=null==(i=this.getValueAxis())?void 0:i.scale,{isContinuousX:u,xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:c,yScale:d}),y=`bar-stack-${n}-yValues`,f=`${y}-trailing`,x=[];Vt(l)&&x.push(Lc([y,f],Math.abs(l),"range")),h&&this.processedData&&x.push(Pc(this.processedData)),h&&x.push(Nc());const b=this.visible?{}:{forceValue:0},{processedData:v}=yield this.requestDataModel(t,a,{props:[Wc(o,p,{id:"xValue"}),Vc(r,g,m({id:"yValue-raw",invalidValue:null},b)),...Hc(r,"normal","current",m({id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:y,separateNegative:!0},b),g),...Hc(r,"trailing","current",m({id:"yValue-start",invalidValue:null,missingValue:0,groupId:f,separateNegative:!0},b),g),...u?[wc]:[],...x],groupByKeys:!0,groupByData:!1});this.smallestDataInterval=null==(s=v.reduced)?void 0:s.smallestKeyInterval,this.animationState.transition("updateData")})}getSeriesDomain(t){var e;const{processedData:i,dataModel:s,smallestDataInterval:n}=this;if(!i||!s||0===i.data.length)return[];const a=this.getCategoryAxis(),o=this.getValueAxis(),r=s.resolveProcessedDataDefById(this,"xValue"),l=s.getDomain(this,"xValue","key",i),h=s.getDomain(this,"yValue-end","value",i);if(t===this.getCategoryDirection()){if("key"===(null==r?void 0:r.def.type)&&"category"===r.def.valueType)return l;const t=Vt(n)?.5*n:0,i=null!=(e=rs(l))?e:[NaN,NaN];return Uh([i[0]+-t,i[1]+t],a)}return this.getValueAxis()instanceof tu?Uh(h,o):Uh([Math.min(0,h[0]),Math.max(0,h[1])],o)}createNodeData(){return S(this,null,function*(){const{dataModel:t}=this,e=this.getCategoryAxis(),i=this.getValueAxis();if(!(t&&e&&i&&this.properties.isValid()))return;const s=e.scale,n=i.scale,{xKey:a,yKey:o,xName:r,yName:l,fill:h,stroke:c,strokeWidth:d,cornerRadius:u,legendItemName:p,label:g}=this.properties,y=i.isReversed(),{barWidth:f,groupIndex:x}=this.updateGroupScale(e),b=Xa.is(s)?-.5*f:0,v=t.resolveProcessedDataIndexById(this,"xValue"),S=t.resolveProcessedDataIndexById(this,"yValue-raw"),M=t.resolveProcessedDataIndexById(this,"yValue-start"),k=t.resolveProcessedDataIndexById(this,"yValue-end"),D=t.resolveProcessedDataIndexById(this,"yValue-range"),w=!this.ctx.animationManager.isSkipped(),I={itemId:o,nodeData:[],labelData:[],scales:this.calculateScaling(),visible:this.visible||w},{groupScale:C,processedData:L}=this;return null==L||L.data.forEach(({keys:t,datum:e,values:i,aggValues:w})=>{i.forEach((i,L)=>{var A;const T=t[v],N=s.convert(T),O=+i[k],R=+i[M],E=i[S],P=E>=0&&!Object.is(E,-0),B=P!==y,F=null!=(A=null==w?void 0:w[D][P?1:0])?A:0,z=N+C.convert(String(x))+b;if(isNaN(O))return;const G=n.convert(O),_=n.convert(R),j="x"===this.getBarDirection(),W=n.convert(F),V=n.convert(0),K={x:j?Math.min(G,_):z,y:j?z:Math.min(G,_),width:j?Math.abs(_-G):f,height:j?f:Math.abs(_-G)},Y=new Js(K.x,K.y,K.width,K.height),$={x:j?Math.min(V,W):z,y:j?z:Math.min(V,W),width:j?Math.abs(V-W):f,height:j?f:Math.abs(V-W),clipBBox:Y},{fontStyle:H,fontWeight:U,fontSize:X,fontFamily:Z,color:q,placement:Q}=g,J=this.getLabelText(this.properties.label,{datum:e[L],value:E,xKey:a,yKey:o,xName:r,yName:l,legendItemName:p},t=>Vt(t)?t.toFixed(2):String(t)),tt=J?m({text:J,fill:q,fontStyle:H,fontWeight:U,fontSize:X,fontFamily:Z},Kp({isPositive:P,isVertical:!j,placement:Q,rect:K})):void 0,et=this.shouldFlipXY()?K.height:K.width,it={series:this,itemId:o,datum:e[L],valueIndex:L,cumulativeValue:O,xValue:T,yValue:E,yKey:o,xKey:a,capDefaults:{lengthRatioMultiplier:et,lengthMax:et},x:$.x,y:$.y,width:$.width,height:$.height,midPoint:{x:K.x+K.width/2,y:K.y+K.height/2},fill:h,stroke:c,opacity:1,strokeWidth:d,cornerRadius:u,topLeftCornerRadius:j!==B,topRightCornerRadius:B,bottomRightCornerRadius:j===B,bottomLeftCornerRadius:!B,clipBBox:Y,label:tt,missing:null==E};I.nodeData.push(it),I.labelData.push(it)})}),I})}nodeFactory(){return new ru}updateDatumSelection(t){return S(this,null,function*(){return t.datumSelection.update(t.nodeData,t=>{t.tag=0},t=>Bc(t.xValue,t.valueIndex))})}updateDatumNodes(t){return S(this,null,function*(){if(!this.properties.isValid())return;const{yKey:e,stackGroup:i,fill:s,fillOpacity:n,stroke:a,strokeWidth:o,strokeOpacity:r,lineDash:l,lineDashOffset:h,formatter:c,shadow:d,highlightStyle:{item:u}}=this.properties,p=this.axes.x,g=Bp(null==p?void 0:p.visibleRange),m="x"===this.getCategoryDirection();t.datumSelection.each((p,y)=>{var f,x,b,v;const S={fill:s,stroke:a,fillOpacity:n,strokeOpacity:r,lineDash:l,lineDashOffset:h,fillShadow:d,strokeWidth:this.getStrokeWidth(o),cornerRadius:y.cornerRadius,topLeftCornerRadius:y.topLeftCornerRadius,topRightCornerRadius:y.topRightCornerRadius,bottomRightCornerRadius:y.bottomRightCornerRadius,bottomLeftCornerRadius:y.bottomLeftCornerRadius},M=m?(null!=(x=null==(f=y.clipBBox)?void 0:f.width)?x:y.width)>0:(null!=(v=null==(b=y.clipBBox)?void 0:b.height)?v:y.height)>0,k=Pp({datum:y,ctx:this.ctx,seriesId:this.id,isHighlighted:t.isHighlight,highlightStyle:u,yKey:e,style:S,formatter:c,stackGroup:i});k.crisp=g,k.visible=M,Ep({rect:p,config:k})})})}updateLabelSelection(t){return S(this,null,function*(){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e,t=>{t.tag=1,t.pointerEvents=1})})}updateLabelNodes(t){return S(this,null,function*(){t.labelSelection.each((t,e)=>{Vp(t,this.properties.label,e.label)})})}getTooltipHtml(t){var e;const{id:i,processedData:s,ctx:{callbackCache:n}}=this,a=this.getCategoryAxis(),o=this.getValueAxis();if(!(s&&this.properties.isValid()&&a&&o))return el;const{xKey:r,yKey:l,xName:h,yName:c,fill:d,stroke:u,strokeWidth:p,tooltip:g,formatter:y,stackGroup:f,legendItemName:x}=this.properties,{xValue:b,yValue:v,datum:S,itemId:M}=t,k=a.formatDatum(b),D=o.formatDatum(v),w=Eu(c),I=Eu(k+": "+D);let C;y&&(C=n.call(y,{seriesId:i,datum:S,xKey:r,yKey:l,stackGroup:f,fill:d,stroke:u,strokeWidth:this.getStrokeWidth(p),highlighted:!1}));const L=null!=(e=null==C?void 0:C.fill)?e:d;return g.toTooltipHtml({title:w,content:I,backgroundColor:L},m({seriesId:i,itemId:M,datum:S,xKey:r,yKey:l,xName:h,yName:c,stackGroup:f,title:w,color:L,legendItemName:x},this.getModuleTooltipParams()))}getLegendData(t){var e,i;const{showInLegend:s}=this.properties;if("category"!==t||!(null==(e=this.data)?void 0:e.length)||!this.properties.isValid()||!s)return[];const{yKey:n,yName:a,fill:o,stroke:r,strokeWidth:l,fillOpacity:h,strokeOpacity:c,legendItemName:d,visible:u}=this.properties;return[{legendType:"category",id:this.id,itemId:n,seriesId:this.id,enabled:u,label:{text:null!=(i=null!=d?d:a)?i:n},marker:{fill:o,fillOpacity:h,stroke:r,strokeWidth:l,strokeOpacity:c},legendItemName:d}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const s=_p(zp(this.isVertical(),this.axes,"normal"));Tn(this.id,"nodes",this.ctx.animationManager,[t],s),Pu(this,"labels",this.ctx.animationManager,e),Pu(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(t){var e,i,s;const{datumSelection:n,labelSelection:a,annotationSelections:o,previousContextData:r}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=null==(i=null==(e=this.processedData)?void 0:e.reduced)?void 0:i.diff,h=null==r?"fade":"normal",c=_p(zp(this.isVertical(),this.axes,h));Tn(this.id,"nodes",this.ctx.animationManager,[n],c,(t,e)=>Bc(e.xValue,e.valueIndex),l),(null==(s=null==l?void 0:l.changed)||s)&&(Pu(this,"labels",this.ctx.animationManager,a),Pu(this,"annotations",this.ctx.animationManager,...o))}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t,seriesRect:e}){var i;return Wp(null==(i=this.contextNodeData)?void 0:i.nodeData[t].clipBBox,this.contentGroup,e)}};Yp.className="BarSeries",Yp.type="bar";var $p={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",instanceConstructor:Yp,stackable:!0,groupable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],swapDefaultAxesCondition:t=>"horizontal"===(null==t?void 0:t.direction),themeTemplate:{series:{__extends__:Ve,direction:"vertical",fillOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontWeight:"normal",fontSize:12,fontFamily:Ye,color:Ue,placement:"inside"},shadow:{enabled:!1,color:ti,xOffset:3,yOffset:3,blur:5}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:.3}}}},paletteFactory:Tu},Hp=t=>{const e=pn.fromString(t),[i,s,n]=pn.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:s,h:n,a:e.a}},Up=class{constructor(){this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(Hp)}update(){const{domain:t,range:e}=this;t.length<2&&(E.warnOnce("`colorDomain` should have at least 2 values."),0===t.length?t.push(0,1):1===t.length&&t.push(t[0]+1));for(let e=1;e<t.length;e++)if(t[e-1]>=t[e]){E.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((t,e)=>t-e);break}if(e.length<t.length)for(let i=e.length;i<t.length;i++)e.push(e.length>0?e[0]:"black");this.parsedRange=this.range.map(Hp)}convert(t){this.refresh();const{domain:e,range:i,parsedRange:s}=this,n=e[0],a=e.at(-1),o=i[0],r=i[i.length-1];if(t<=n)return o;if(t>=a)return r;let l,h;if(2===e.length){const e=(t-n)/(a-n),s=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(e*(i.length-1)),i.length-2),h=(e-l*s)/s}else{for(l=0;l<e.length-2&&!(t<e[l+1]);l++);const i=e[l];h=(t-i)/(e[l+1]-i)}return((t,e,i)=>{let s,n;if(i=_s(0,i,1),Number.isNaN(t.h)&&Number.isNaN(e.h))s=0,n=0;else if(Number.isNaN(t.h))s=e.h,n=e.c;else if(Number.isNaN(e.h))s=t.h,n=t.c;else{const a=t.h;let o=e.h;const r=e.h-t.h;r>180?o-=360:r<-180&&(o+=360),s=a*(1-i)+o*i,n=t.c*(1-i)+e.c*i}const a=t.l*(1-i)+e.l*i,o=t.a*(1-i)+e.a*i;return pn.fromOKLCH(a,n,s,o)})(s[l],s[l+1],h).toRgbaString()}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&E.warnOnce("Expected update to not invalidate scale"))}};b([Wn],Up.prototype,"domain",2),b([Wn],Up.prototype,"range",2);var Xp=class extends ju{constructor(){super(...arguments),this.maxSize=30}};b([$n(sa),sn({redraw:3})],Xp.prototype,"maxSize",2),b([$n(xa,{optional:!0}),sn({redraw:3})],Xp.prototype,"domain",2);var Zp=class extends Go{constructor(){super(...arguments),this.placement="top"}};b([$n(Pa)],Zp.prototype,"placement",2);var qp=class extends Vd{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.marker=new Xp,this.label=new Zp,this.tooltip=new Vu}};b([$n(ta)],qp.prototype,"xKey",2),b([$n(ta)],qp.prototype,"yKey",2),b([$n(ta)],qp.prototype,"sizeKey",2),b([$n(ta,{optional:!0})],qp.prototype,"labelKey",2),b([$n(ta,{optional:!0})],qp.prototype,"colorKey",2),b([$n(ta,{optional:!0})],qp.prototype,"xName",2),b([$n(ta,{optional:!0})],qp.prototype,"yName",2),b([$n(ta,{optional:!0})],qp.prototype,"sizeName",2),b([$n(ta,{optional:!0})],qp.prototype,"labelName",2),b([$n(ta,{optional:!0})],qp.prototype,"colorName",2),b([$n(xa,{optional:!0})],qp.prototype,"colorDomain",2),b([$n(ya)],qp.prototype,"colorRange",2),b([$n(ta,{optional:!0})],qp.prototype,"title",2),b([$n(Zn)],qp.prototype,"marker",2),b([$n(Zn)],qp.prototype,"label",2),b([$n(Zn)],qp.prototype,"tooltip",2);var Qp=class extends Wd{constructor(t,e,i,s){super(t,e,i,s),this.sizeKey=s.properties.sizeKey}},Jp=class extends Kd{constructor(t){super({moduleCtx:t,directionKeys:_d,directionNames:jd,pickModes:[2,3,0],pathsPerSeries:0,hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:Fu,marker:Uu}}),this.NodeEvent=Qp,this.properties=new qp,this.sizeScale=new Zd,this.colorScale=new Up}processData(t){return S(this,null,function*(){var e,i,s,n;if(!this.properties.isValid()||null==this.data||!this.visible)return;const a=null==(e=this.axes.x)?void 0:e.scale,o=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:r,yScaleType:l}=this.getScaleInformation({xScale:a,yScale:o}),h=this.colorScale.type,c=this.sizeScale.type,{xKey:d,yKey:u,sizeKey:p,labelKey:g,colorDomain:m,colorRange:y,colorKey:f,marker:x}=this.properties,{dataModel:b,processedData:v}=yield this.requestDataModel(t,this.data,{props:[Wc(d,r,{id:"xKey-raw"}),Wc(u,l,{id:"yKey-raw"}),...g?[Wc(g,"band",{id:"labelKey-raw"})]:[],Vc(d,r,{id:"xValue"}),Vc(u,l,{id:"yValue"}),Vc(p,c,{id:"sizeValue"}),...f?[Vc(f,h,{id:"colorValue"})]:[],...g?[Vc(g,"band",{id:"labelValue"})]:[]]}),S=b.resolveProcessedDataIndexById(this,"sizeValue"),M=null!=(s=v.domain.values[S])?s:[];if(this.sizeScale.domain=x.domain?x.domain:M,f){const t=b.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=null!=(n=null!=m?m:v.domain.values[t])?n:[],this.colorScale.range=y,this.colorScale.update()}this.animationState.transition("updateData")})}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s="x"===t?"xValue":"yValue",n=e.resolveProcessedDataDefById(this,s),a=e.getDomain(this,s,"value",i);if("value"===(null==n?void 0:n.def.type)&&"category"===(null==n?void 0:n.def.valueType))return a;const o=this.axes[t];return Uh(rs(a),o)}createNodeData(){return S(this,null,function*(){var t,e,i;const{axes:s,dataModel:n,processedData:a,colorScale:o,sizeScale:r}=this,{xKey:l,yKey:h,sizeKey:c,labelKey:d,xName:u,yName:p,sizeName:g,labelName:y,label:f,colorKey:x,marker:b,visible:v}=this.properties,S=Rd(b.shape),{placement:M}=f,k=s.x,D=s.y;if(!(n&&a&&v&&k&&D))return;const w=n.resolveProcessedDataIndexById(this,"xValue"),I=n.resolveProcessedDataIndexById(this,"yValue"),C=c?n.resolveProcessedDataIndexById(this,"sizeValue"):-1,L=x?n.resolveProcessedDataIndexById(this,"colorValue"):-1,A=d?n.resolveProcessedDataIndexById(this,"labelValue"):-1,T=k.scale,N=D.scale,O=(null!=(t=T.bandwidth)?t:0)/2,R=(null!=(e=N.bandwidth)?e:0)/2,E=[];r.range=[b.size,b.maxSize];const P=f.getFont();for(const{values:t,datum:e}of null!=(i=a.data)?i:[]){const i=t[w],s=t[I],n=T.convert(i)+O,a=N.convert(s)+R,v=this.getLabelText(f,{value:d?t[A]:s,datum:e,xKey:l,yKey:h,sizeKey:c,labelKey:d,xName:u,yName:p,sizeName:g,labelName:y}),k=Bo.getTextSize(String(v),P),D=c?r.convert(t[C]):b.size,B=x?o.convert(t[L]):void 0;E.push({series:this,itemId:h,yKey:h,xKey:l,datum:e,xValue:i,yValue:s,sizeValue:t[C],point:{x:n,y:a,size:D},midPoint:{x:n,y:a},fill:B,label:m({text:v},k),marker:S,placement:M})}return{itemId:h,nodeData:E,labelData:E,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){var t,e;return null!=(e=null==(t=this.contextNodeData)?void 0:t.labelData)?e:[]}markerFactory(){const{shape:t}=this.properties.marker;return new(Rd(t))}updateMarkerSelection(t){return S(this,null,function*(){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,t=>Bc([t.xValue,t.yValue,t.label.text]))})}updateMarkerNodes(t){return S(this,null,function*(){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,sizeKey:a,labelKey:o,marker:r}=this.properties,l=Xt(i&&this.properties.highlightStyle.item,r.getStyle());this.sizeScale.range=[r.size,r.maxSize],e.each((t,e)=>{this.updateMarkerStyle(t,r,{datum:e,highlighted:i,xKey:s,yKey:n,sizeKey:a,labelKey:o},l)}),i||this.properties.marker.markClean()})}updateLabelSelection(t){return S(this,null,function*(){var e,i;const s=this.properties.label.enabled&&null!=(i=null==(e=this.chart)?void 0:e.placeLabels().get(this))?i:[];return t.labelSelection.update(s.map(t=>y(m({},t.datum),{point:{x:t.x,y:t.y,size:t.datum.point.size}})))})}updateLabelNodes(t){return S(this,null,function*(){const{label:e}=this.properties;t.labelSelection.each((t,i)=>{var s,n,a,o;t.text=i.label.text,t.fill=e.color,t.x=null!=(n=null==(s=i.point)?void 0:s.x)?n:0,t.y=null!=(o=null==(a=i.point)?void 0:a.y)?o:0,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.textAlign="left",t.textBaseline="top"})})}getTooltipHtml(t){var e;const i=this.axes.x,s=this.axes.y;if(!this.properties.isValid()||!i||!s)return el;const{xKey:n,yKey:a,sizeKey:o,labelKey:r,xName:l,yName:h,sizeName:c,labelName:d,marker:u,tooltip:p}=this.properties,g=null!=(e=this.properties.title)?e:h,m=Xt({fill:t.fill,strokeWidth:this.getStrokeWidth(u.strokeWidth)},u.getStyle()),{fill:y="gray"}=this.getMarkerStyle(u,{datum:t,highlighted:!1,xKey:n,yKey:a,sizeKey:o,labelKey:r},m),{datum:f,xValue:x,yValue:b,sizeValue:v,label:{text:S},itemId:M}=t,k=Eu(i.formatDatum(x)),D=Eu(s.formatDatum(b));let w=`<b>${Eu(null!=l?l:n)}</b>: ${k}<br><b>${Eu(null!=h?h:a)}</b>: ${D}`;return o&&(w+=`<br><b>${Eu(null!=c?c:o)}</b>: ${Eu(String(v))}`),r&&(w=`<b>${Eu(null!=d?d:r)}</b>: ${Eu(S)}<br>`+w),p.toTooltipHtml({title:g,content:w,backgroundColor:y},{datum:f,itemId:M,xKey:n,xName:l,yKey:a,yName:h,sizeKey:o,sizeName:c,labelKey:r,labelName:d,title:g,color:y,seriesId:this.id})}getLegendData(){var t,e;if(!(null==(t=this.data)?void 0:t.length)||!this.properties.isValid())return[];const{yKey:i,yName:s,title:n,marker:a,visible:o}=this.properties,{shape:r,fill:l,stroke:h,fillOpacity:c,strokeOpacity:d,strokeWidth:u}=a;return[{legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:o,label:{text:null!=(e=null!=n?n:s)?e:i},marker:{shape:r,fill:null!=l?l:"rgba(0, 0, 0, 0)",stroke:null!=h?h:"rgba(0, 0, 0, 0)",fillOpacity:null!=c?c:1,strokeOpacity:null!=d?d:1,strokeWidth:null!=u?u:0}}]}animateEmptyUpdateReady({markerSelection:t,labelSelection:e}){$u(this,this.ctx.animationManager,t),Pu(this,"labels",this.ctx.animationManager,e)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new ko}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 qu(this,t)}};Jp.className="BubbleSeries",Jp.type="bubble";var tg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",instanceConstructor:Jp,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:Ve,tooltip:{position:{type:"node"}},marker:{__extends__:Ke,maxSize:30,fillOpacity:.8},label:{enabled:!1,fontSize:12,fontFamily:Ye,color:$e}}},paletteFactory:Nu},eg=class extends Vd{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 Gu,this.label=new Go,this.tooltip=new Vu}};b([$n(ta)],eg.prototype,"xKey",2),b([$n(ta,{optional:!0})],eg.prototype,"yKey",2),b([$n(ta,{optional:!0})],eg.prototype,"xName",2),b([$n(ta,{optional:!0})],eg.prototype,"yName",2),b([$n(ma,{optional:!0})],eg.prototype,"fill",2),b([$n(na)],eg.prototype,"fillOpacity",2),b([$n(ma,{optional:!0})],eg.prototype,"stroke",2),b([$n(sa)],eg.prototype,"strokeWidth",2),b([$n(na)],eg.prototype,"strokeOpacity",2),b([$n(Da)],eg.prototype,"lineDash",2),b([$n(sa)],eg.prototype,"lineDashOffset",2),b([$n(sa)],eg.prototype,"cornerRadius",2),b([$n(Qn)],eg.prototype,"areaPlot",2),b([$n(ra,{optional:!0})],eg.prototype,"bins",2),b([$n(Ba(["count","sum","mean"],"a histogram aggregation"))],eg.prototype,"aggregation",2),b([$n(sa,{optional:!0})],eg.prototype,"binCount",2),b([$n(Zn)],eg.prototype,"shadow",2),b([$n(Zn)],eg.prototype,"label",2),b([$n(Zn)],eg.prototype,"tooltip",2);var ig=class extends Kd{constructor(t){super({moduleCtx:t,directionKeys:_d,directionNames:jd,pickModes:[0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:jp,label:Fu}}),this.properties=new eg,this.calculatedBins=[]}deriveBins(t){const e=ho(t[0],t[1],10),i=uo(t[0],t[1],10),[s]=e;return[[s-i,s],...e.map(t=>[t,t+i])]}calculateNiceBins(t,e){const i=Math.floor(t[0]),s=t[1],n=e||1,{start:a,binSize:o}=this.calculateNiceStart(i,s,n);return this.getBins(a,s,o,n)}getBins(t,e,i,s){const n=[],a=this.calculatePrecision(i);for(let o=0;o<s;o++){const r=Math.round((t+o*i)*a)/a;let l=Math.round((t+(o+1)*i)*a)/a;o===s-1&&(l=Math.max(l,e)),n[o]=[r,l]}return n}calculatePrecision(t){let e=10;if(isFinite(t)&&t>0)for(;t<1;)e*=10,t*=10;return e}calculateNiceStart(t,e,i){const s=Math.abs(e-t)/i,n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return{start:Math.floor(t/a)*a,binSize:s}}processData(t){return S(this,null,function*(){var e,i;this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:s,yKey:n,areaPlot:a,aggregation:o}=this.properties,r=null==(e=this.axes.x)?void 0:e.scale,l=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:h,yScaleType:c}=this.getScaleInformation({yScale:l,xScale:r}),d=[Wc(s,h),Ic];if(n){let t=vc("groupAgg");"count"===o||("sum"===o?t=xc("groupAgg"):"mean"===o&&(t=Sc("groupAgg"))),a&&(t=Mc("groupAgg",t)),d.push(Vc(n,c,{invalidValue:void 0}),t)}else{let t=vc("groupAgg");a&&(t=Mc("groupAgg",t)),d.push(t)}!this.ctx.animationManager.isSkipped()&&this.processedData&&d.push(Pc(this.processedData,!1)),yield this.requestDataModel(t,this.data,{props:d,groupByFn:t=>{var e;const i=Uh(t.domain.keys[0]);if(0===i.length)return t.domain.groups=[],()=>[];const s=Wt(this.properties.binCount)?this.calculateNiceBins(i,this.properties.binCount):null!=(e=this.properties.bins)?e:this.deriveBins(i),n=s.length;return this.calculatedBins=[...s],t=>{const e=t.keys[0];for(let t=0;t<n;t++){const i=s[t];if(e>=i[0]&&e<i[1])return i;if(t===n-1&&e<=i[1])return i}return[]}}}),this.animationState.transition("updateData")})}getSeriesDomain(t){var e,i,s,n;const{processedData:a,dataModel:o}=this;if(!a||!o||!this.calculatedBins.length)return[];const r=o.getDomain(this,"groupAgg","aggregate",a),l=null==(e=this.calculatedBins)?void 0:e[0][0],h=null==(n=this.calculatedBins)?void 0:n[(null!=(s=null==(i=this.calculatedBins)?void 0:i.length)?s:0)-1][1];return Uh("x"===t?[l,h]:r)}createNodeData(){return S(this,null,function*(){var t;const{id:e,axes:i,processedData:s,ctx:{callbackCache:n}}=this,a=i.x,o=i.y;if(!a||!o)return;const{scale:r}=a,{scale:l}=o,{xKey:h,yKey:c,xName:d,yName:u,fill:p,stroke:g,strokeWidth:m,cornerRadius:y}=this.properties,{formatter:f=t=>String(t.value),fontStyle:x,fontWeight:b,fontSize:v,fontFamily:S,color:M}=this.properties.label,k=[],D={itemId:null!=(t=this.properties.yKey)?t:this.id,nodeData:k,labelData:k,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return this.visible&&s&&"grouped"===s.type?(s.data.forEach(t=>{var i;const{aggValues:[[s,a]]=[[0,0]],datum:D,datum:{length:w},keys:I,keys:[C,L]}=t,A=r.convert(C),T=r.convert(L),N=s+a,O=l.convert(0),R=l.convert(N),E=Math.abs(T-A),P=Math.abs(R-O),B=Math.min(A,T),F=Math.min(O,R);let z;0!==N&&(z={text:null!=(i=n.call(f,{value:N,datum:D,seriesId:e,xKey:h,yKey:c,xName:d,yName:u}))?i:String(N),fontStyle:x,fontWeight:b,fontSize:v,fontFamily:S,fill:M,x:B+E/2,y:F+P/2});const G={x:B+E/2,y:F+P/2},_=o.isReversed();k.push({series:this,datum:D,aggregatedValue:N,frequency:w,domain:I,yKey:c,xKey:h,x:B,y:F,xValue:A,yValue:R,width:E,height:P,midPoint:G,fill:p,stroke:g,cornerRadius:y,topLeftCornerRadius:!_,topRightCornerRadius:!_,bottomRightCornerRadius:_,bottomLeftCornerRadius:_,opacity:1,strokeWidth:m,label:z})}),k.sort((t,e)=>t.x-e.x),D):D})}nodeFactory(){return new ru}updateDatumSelection(t){return S(this,null,function*(){const{nodeData:e,datumSelection:i}=t;return i.update(e,t=>{t.tag=0,t.crisp=!0},t=>t.domain.join("_"))})}updateDatumNodes(t){return S(this,null,function*(){const{isHighlight:e}=t,{fillOpacity:i,strokeOpacity:s,lineDash:n,lineDashOffset:a,shadow:o,highlightStyle:{item:{fill:r,fillOpacity:l=i,stroke:h,strokeWidth:c}}}=this.properties;t.datumSelection.each((t,d,u)=>{var p,g;const{cornerRadius:m,topLeftCornerRadius:y,topRightCornerRadius:f,bottomRightCornerRadius:x,bottomLeftCornerRadius:b}=d,v=e&&void 0!==c?c:d.strokeWidth,S=e?l:i;t.fill=null!=(p=e?r:void 0)?p:d.fill,t.stroke=null!=(g=e?h:void 0)?g:d.stroke,t.fillOpacity=S,t.strokeOpacity=s,t.strokeWidth=v,t.lineDash=n,t.lineDashOffset=a,t.topLeftCornerRadius=y?m:0,t.topRightCornerRadius=f?m:0,t.bottomRightCornerRadius=x?m:0,t.bottomLeftCornerRadius=b?m:0,t.fillShadow=o,t.zIndex=e?Zc.highlightedZIndex:u,t.visible=d.height>0})})}updateLabelSelection(t){return S(this,null,function*(){const{labelData:e,labelSelection:i}=t;return i.update(e,t=>{t.tag=1,t.pointerEvents=1,t.textAlign="center",t.textBaseline="middle"})})}updateLabelNodes(t){return S(this,null,function*(){const e=this.isLabelEnabled();t.labelSelection.each((t,i)=>{const s=i.label;s&&e?(t.text=s.text,t.x=s.x,t.y=s.y,t.fontStyle=s.fontStyle,t.fontWeight=s.fontWeight,t.fontSize=s.fontSize,t.fontFamily=s.fontFamily,t.fill=s.fill,t.visible=!0):t.visible=!1})})}initQuadTree(t){Lp(t,Cp(this.contentGroup.children[0]))}pickNodeClosestDatum(t){return Ap(this,t)}getTooltipHtml(t){const e=this.axes.x,i=this.axes.y;if(!this.properties.isValid()||!e||!i)return el;const{xKey:s,yKey:n,xName:a,yName:o,fill:r,aggregation:l,tooltip:h}=this.properties,{aggregatedValue:c,frequency:d,domain:[u,p],itemId:g}=t,m=`${Eu(null!=a?a:s)}: ${e.formatDatum(u)} - ${e.formatDatum(p)}`;let y=n?`<b>${Eu(null!=o?o:n)} (${l})</b>: ${i.formatDatum(c)}<br>`:"";y+=`<b>Frequency</b>: ${d}`;const f={title:m,backgroundColor:r,content:y};return h.toTooltipHtml(f,{datum:{data:t.datum,aggregatedValue:t.aggregatedValue,domain:t.domain,frequency:t.frequency},itemId:g,xKey:s,xName:a,yKey:n,yName:o,color:r,title:m,seriesId:this.id})}getLegendData(t){var e,i;if(!(null==(e=this.data)?void 0:e.length)||"category"!==t)return[];const{xKey:s,yName:n,fill:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:h,visible:c}=this.properties;return[{legendType:"category",id:this.id,itemId:s,seriesId:this.id,enabled:c,label:{text:null!=(i=null!=n?n:s)?i:"Frequency"},marker:{fill:null!=a?a:"rgba(0, 0, 0, 0)",stroke:null!=r?r:"rgba(0, 0, 0, 0)",fillOpacity:o,strokeOpacity:h,strokeWidth:l}}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=_p(zp(!0,this.axes,"normal"));Tn(this.id,"datums",this.ctx.animationManager,[t],i),Pu(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){var e,i;const s=null==(i=null==(e=this.processedData)?void 0:e.reduced)?void 0:i.diff,n=_p(zp(!0,this.axes,"normal"));Tn(this.id,"datums",this.ctx.animationManager,[t.datumSelection],n,(t,e)=>Bc(e.domain),s),Pu(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t,seriesRect:e}){var i;return Wp(null==(i=this.contextNodeData)?void 0:i.nodeData[t],this.contentGroup,e)}};ig.className="HistogramSeries",ig.type="histogram";var sg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",instanceConstructor:ig,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:Ve,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:12,fontFamily:Ye,color:Ue},shadow:{enabled:!1,color:ti,xOffset:3,yOffset:3,blur:5}}},paletteFactory:({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}}},ng=class extends Vd{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.marker=new ju,this.label=new Go,this.tooltip=new Vu,this.connectMissingData=!1}};b([$n(ta)],ng.prototype,"xKey",2),b([$n(ta)],ng.prototype,"yKey",2),b([$n(ta,{optional:!0})],ng.prototype,"xName",2),b([$n(ta,{optional:!0})],ng.prototype,"yName",2),b([$n(ta,{optional:!0})],ng.prototype,"title",2),b([$n(ma)],ng.prototype,"stroke",2),b([$n(sa)],ng.prototype,"strokeWidth",2),b([$n(na)],ng.prototype,"strokeOpacity",2),b([$n(Da)],ng.prototype,"lineDash",2),b([$n(sa)],ng.prototype,"lineDashOffset",2),b([$n(Zn)],ng.prototype,"marker",2),b([$n(Zn)],ng.prototype,"label",2),b([$n(Zn)],ng.prototype,"tooltip",2),b([$n(Qn)],ng.prototype,"connectMissingData",2);var ag=class extends Kd{constructor(t){super({moduleCtx:t,directionKeys:_d,directionNames:jd,hasMarkers:!0,pickModes:[2,3,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:rp({getOpacity:()=>this.getOpacity()}),label:Fu,marker:(t,e)=>m(m({},{opacity:1,scalingX:1,scalingY:1}),Xu(0,e))}}),this.properties=new ng}processData(t){return S(this,null,function*(){var e,i;if(!this.properties.isValid()||null==this.data)return;const{xKey:s,yKey:n}=this.properties,a=!this.ctx.animationManager.isSkipped(),o=null==(e=this.axes.x)?void 0:e.scale,r=null==(i=this.axes.y)?void 0:i.scale,{isContinuousX:l,xScaleType:h,yScaleType:c}=this.getScaleInformation({xScale:o,yScale:r}),d=[];l||d.push(Wc(s,h,{id:"xKey"})),a&&(d.push(Nc(l?["xValue"]:void 0)),this.processedData&&d.push(Pc(this.processedData))),d.push(Vc(s,h,{id:"xValue"}),Vc(n,c,{id:"yValue",invalidValue:void 0})),yield this.requestDataModel(t,this.data,{props:d}),this.animationState.transition("updateData")})}getSeriesDomain(t){const{axes:e,dataModel:i,processedData:s}=this;if(!s||!i)return[];const n=e.x,a=e.y,o=i.resolveProcessedDataDefById(this,"xValue");if("x"===t){const t=i.getDomain(this,"xValue","value",s);return"value"===(null==o?void 0:o.def.type)&&"category"===o.def.valueType?t:Uh(rs(t),n)}return Uh(i.getDomain(this,"yValue","value",s),a)}createNodeData(){return S(this,null,function*(){var t,e,i;const{processedData:s,dataModel:n,axes:a}=this,o=a.x,r=a.y;if(!(s&&n&&o&&r))return;const{xKey:l,yKey:h,xName:c,yName:d,marker:u,label:p,connectMissingData:g,legendItemName:m}=this.properties,y=o.scale,f=r.scale,x=(null!=(t=y.bandwidth)?t:0)/2,b=(null!=(e=f.bandwidth)?e:0)/2,v=[],S=u.enabled?u.size:0,M=n.resolveProcessedDataIndexById(this,"xValue"),k=n.resolveProcessedDataIndexById(this,"yValue");let D,w=!0;for(let t=0;t<s.data.length;t++){const{datum:e,values:n}=null!=D?D:s.data[t],a=n[M],o=n[k];if(void 0===o)w=!g;else{const n=y.convert(a)+x;if(isNaN(n)){w=!g,D=void 0;continue}D=void 0===(null==(i=s.data[t+1])?void 0:i.values[k])?void 0:s.data[t+1];const r=f.convert(o)+b,u=this.getLabelText(p,{value:o,datum:e,xKey:l,yKey:h,xName:c,yName:d,legendItemName:m},t=>Vt(t)?t.toFixed(2):String(t));v.push({series:this,datum:e,yKey:h,xKey:l,point:{x:n,y:r,moveTo:w,size:S},midPoint:{x:n,y:r},yValue:o,xValue:a,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},label:u?{text:u,fontStyle:p.fontStyle,fontWeight:p.fontWeight,fontSize:p.fontSize,fontFamily:p.fontFamily,textAlign:"center",textBaseline:"bottom",fill:p.color}:void 0}),w=!1}}return{itemId:h,nodeData:v,labelData:v,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}markerFactory(){const{shape:t}=this.properties.marker;return new(Rd(t))}updatePathNodes(t){return S(this,null,function*(){const{paths:[e],opacity:i,visible:s,animationEnabled:n}=t;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,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),n||(e.visible=s),lp(this,e)})}updateMarkerSelection(t){return S(this,null,function*(){let{nodeData:e}=t;const{markerSelection:i}=t,{shape:s,enabled:n}=this.properties.marker;return e=s&&n?e:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(e,void 0,t=>Bc(t.xValue))})}updateMarkerNodes(t){return S(this,null,function*(){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,stroke:a,strokeWidth:o,strokeOpacity:r,marker:l,highlightStyle:h}=this.properties,c=Xt(i&&h.item,l.getStyle(),{stroke:a,strokeWidth:o,strokeOpacity:r}),d=this.ctx.animationManager.isSkipped();e.each((t,e)=>{this.updateMarkerStyle(t,l,{datum:e,highlighted:i,xKey:s,yKey:n},c,{applyTranslation:d})}),i||l.markClean()})}updateLabelSelection(t){return S(this,null,function*(){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])})}updateLabelNodes(t){return S(this,null,function*(){const{enabled:e,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:a,color:o}=this.properties.label;t.labelSelection.each((t,r)=>{const{point:l,label:h}=r;r&&h&&e?(t.fontStyle=i,t.fontWeight=s,t.fontSize=n,t.fontFamily=a,t.textAlign=h.textAlign,t.textBaseline=h.textBaseline,t.text=h.text,t.x=l.x,t.y=l.y-10,t.fill=o,t.visible=!0):t.visible=!1})})}getTooltipHtml(t){var e;const i=this.axes.x,s=this.axes.y;if(!this.properties.isValid()||!i||!s)return el;const{xKey:n,yKey:a,xName:o,yName:r,strokeWidth:l,marker:h,tooltip:c}=this.properties,{datum:d,xValue:u,yValue:p,itemId:g}=t,y=i.formatDatum(u),f=s.formatDatum(p),x=Eu(null!=(e=this.properties.title)?e:r),b=Eu(y+": "+f),v=Xt({fill:h.stroke},h.getStyle(),{strokeWidth:l}),{fill:S}=this.getMarkerStyle(h,{datum:t,xKey:n,yKey:a,highlighted:!1},v);return c.toTooltipHtml({title:x,content:b,backgroundColor:S},m({datum:d,itemId:g,xKey:n,xName:o,yKey:a,yName:r,title:x,color:S,seriesId:this.id},this.getModuleTooltipParams()))}getLegendData(t){var e,i,s,n,a,o,r,l,h,c;if(!(null==(e=this.data)?void 0:e.length)||!this.properties.isValid()||"category"!==t)return[];const{yKey:d,yName:u,stroke:p,strokeOpacity:g,strokeWidth:m,lineDash:y,title:f,marker:x,visible:b,legendItemName:v}=this.properties,S="rgba(0, 0, 0, 0)";return[{legendType:"category",id:this.id,itemId:d,legendItemName:v,seriesId:this.id,enabled:b,label:{text:null!=(s=null!=(i=null!=v?v:f)?i:u)?s:d},marker:{shape:x.shape,fill:null!=(n=x.fill)?n:S,stroke:null!=(o=null!=(a=x.stroke)?a:p)?o:S,fillOpacity:null!=(r=x.fillOpacity)?r:1,strokeOpacity:null!=(h=null!=(l=x.strokeOpacity)?l:g)?h:1,strokeWidth:null!=(c=x.strokeWidth)?c:0,enabled:x.enabled},line:{stroke:null!=p?p:S,strokeOpacity:g,strokeWidth:m,lineDash:y}}]}updatePaths(t){return S(this,null,function*(){this.updateLinePaths(t.paths,t.contextData)})}updateLinePaths(t,e){const{nodeData:i}=e,[s]=t,{path:n}=s;n.clear(!0);for(const t of i)t.point.moveTo?n.moveTo(t.point.x,t.point.y):n.lineTo(t.point.x,t.point.y);s.checkPathDirty()}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s,contextData:n,paths:a}=t,{animationManager:o}=this.ctx;this.updateLinePaths(a,n),np(this,o,...a),mr([e],Xu),Hu(this,o,e),Pu(this,"labels",o,i),Pu(this,"annotations",o,...s)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateLinePaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){var e,i;const{animationManager:s}=this.ctx,{markerSelection:n,labelSelection:a,annotationSelections:o,contextData:r,paths:l,previousContextData:h}=t,[c]=l;super.resetAllAnimation(t);const d=()=>{this.updateLinePaths(l,r)};if(null==r||null==h)return d(),Yu(this,s,"added",n),ap(this,"path_properties",s,"add",c),Pu(this,"labels",s,a),void Pu(this,"annotations",s,...o);const u=vp(r,h,null==(i=null==(e=this.processedData)?void 0:e.reduced)?void 0:i.diff);if(void 0===u)return s.skipCurrentBatch(),void d();"no-op"!==u.status&&(Yu(this,s,void 0,n),Tn(this.id,"path_properties",s,[c],u.pathProperties),Ou(this.id,"path_update",s,[c],u.path),u.hasMotion&&(Pu(this,"labels",s,a),Pu(this,"annotations",s,...o)))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new ko}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:t,xKey:e,yKey:i,highlighted:!0})}computeFocusBounds(t){return qu(this,t)}};ag.className="LineSeries",ag.type="line";var og={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",instanceConstructor:ag,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{__extends__:Ve,tooltip:{position:{type:"node"}},strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,marker:{__extends__:Ke,fillOpacity:1,strokeOpacity:1,strokeWidth:0},label:{enabled:!1,fontSize:12,fontFamily:Ye,color:$e}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:1}}}},paletteFactory:t=>{const{marker:e}=Nu(t);return{stroke:e.fill,marker:e}}},rg=class extends Go{constructor(){super(...arguments),this.placement="top"}};b([$n(Pa)],rg.prototype,"placement",2);var lg=class extends Vd{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.marker=new ju,this.label=new rg,this.tooltip=new Vu}};b([$n(ta)],lg.prototype,"xKey",2),b([$n(ta)],lg.prototype,"yKey",2),b([$n(ta,{optional:!0})],lg.prototype,"labelKey",2),b([$n(ta,{optional:!0})],lg.prototype,"colorKey",2),b([$n(ta,{optional:!0})],lg.prototype,"xName",2),b([$n(ta,{optional:!0})],lg.prototype,"yName",2),b([$n(ta,{optional:!0})],lg.prototype,"labelName",2),b([$n(ta,{optional:!0})],lg.prototype,"colorName",2),b([$n(xa,{optional:!0})],lg.prototype,"colorDomain",2),b([$n(ya)],lg.prototype,"colorRange",2),b([$n(ta,{optional:!0})],lg.prototype,"title",2),b([$n(Zn)],lg.prototype,"marker",2),b([$n(Zn)],lg.prototype,"label",2),b([$n(Zn)],lg.prototype,"tooltip",2);var hg=class extends Kd{constructor(t){super({moduleCtx:t,directionKeys:_d,directionNames:jd,pickModes:[2,3,0],pathsPerSeries:0,hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:Uu,label:Fu}}),this.properties=new lg,this.colorScale=new Up}processData(t){return S(this,null,function*(){var e,i,s;if(!this.properties.isValid()||null==this.data||!this.visible)return;const n=null==(e=this.axes.x)?void 0:e.scale,a=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:o,yScaleType:r}=this.getScaleInformation({xScale:n,yScale:a}),l=this.colorScale.type,{xKey:h,yKey:c,labelKey:d,colorKey:u,colorDomain:p,colorRange:g}=this.properties,{dataModel:m,processedData:y}=yield this.requestDataModel(t,this.data,{props:[Wc(h,o,{id:"xKey-raw"}),Wc(c,r,{id:"yKey-raw"}),...d?[Wc(d,"band",{id:"labelKey-raw"})]:[],Vc(h,o,{id:"xValue"}),Vc(c,r,{id:"yValue"}),...u?[Vc(u,l,{id:"colorValue"})]:[],...d?[Vc(d,"band",{id:"labelValue"})]:[]]});if(u){const t=m.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=null!=(s=null!=p?p:y.domain.values[t])?s:[],this.colorScale.range=g,this.colorScale.update()}this.animationState.transition("updateData")})}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s="x"===t?"xValue":"yValue",n=e.resolveProcessedDataDefById(this,s),a=e.getDomain(this,s,"value",i);if("value"===(null==n?void 0:n.def.type)&&"category"===(null==n?void 0:n.def.valueType))return a;const o=this.axes[t];return Uh(rs(a),o)}createNodeData(){return S(this,null,function*(){var t,e,i;const{axes:s,dataModel:n,processedData:a,colorScale:o}=this,{xKey:r,yKey:l,labelKey:h,colorKey:c,xName:d,yName:u,labelName:p,marker:g,label:y,visible:f}=this.properties,{placement:x}=y,b=Rd(g.shape),v=s.x,S=s.y;if(!(n&&a&&f&&v&&S))return;const M=n.resolveProcessedDataIndexById(this,"xValue"),k=n.resolveProcessedDataIndexById(this,"yValue"),D=c?n.resolveProcessedDataIndexById(this,"colorValue"):-1,w=h?n.resolveProcessedDataIndexById(this,"labelValue"):-1,I=v.scale,C=S.scale,L=(null!=(t=I.bandwidth)?t:0)/2,A=(null!=(e=C.bandwidth)?e:0)/2,T=[],N=y.getFont();for(const{values:t,datum:e}of null!=(i=a.data)?i:[]){const i=t[M],s=t[k],n=I.convert(i)+L,a=C.convert(s)+A,f=this.getLabelText(y,{value:h?t[w]:s,datum:e,xKey:r,yKey:l,labelKey:h,xName:d,yName:u,labelName:p}),v=Bo.getTextSize(f,N),S=c?o.convert(t[D]):void 0;T.push({series:this,itemId:l,yKey:l,xKey:r,datum:e,xValue:i,yValue:s,capDefaults:{lengthRatioMultiplier:g.getDiameter(),lengthMax:1/0},point:{x:n,y:a,size:g.size},midPoint:{x:n,y:a},fill:S,label:m({text:f},v),marker:b,placement:x})}return{itemId:l,nodeData:T,labelData:T,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){var t,e;return null!=(e=null==(t=this.contextNodeData)?void 0:t.labelData)?e:[]}markerFactory(){const{shape:t}=this.properties.marker;return new(Rd(t))}updateMarkerSelection(t){return S(this,null,function*(){const{nodeData:e,markerSelection:i}=t;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?e:[])})}updateMarkerNodes(t){return S(this,null,function*(){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,labelKey:a,marker:o,highlightStyle:r}=this.properties,l=Xt(i&&r.item,o.getStyle());e.each((t,e)=>{this.updateMarkerStyle(t,o,{datum:e,highlighted:i,xKey:s,yKey:n,labelKey:a},l)}),i||o.markClean()})}updateLabelSelection(t){return S(this,null,function*(){var e,i;const s=this.isLabelEnabled()&&null!=(i=null==(e=this.chart)?void 0:e.placeLabels().get(this))?i:[];return t.labelSelection.update(s.map(({datum:t,x:e,y:i})=>y(m({},t),{point:{x:e,y:i,size:t.point.size},placement:"top"})),t=>{t.pointerEvents=1})})}updateLabelNodes(t){return S(this,null,function*(){const{label:e}=this.properties;t.labelSelection.each((t,i)=>{var s,n,a,o;t.text=i.label.text,t.fill=e.color,t.x=null!=(n=null==(s=i.point)?void 0:s.x)?n:0,t.y=null!=(o=null==(a=i.point)?void 0:a.y)?o:0,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.textAlign="left",t.textBaseline="top"})})}getTooltipHtml(t){const e=this.axes.x,i=this.axes.y;if(!this.properties.isValid()||!e||!i)return el;const{xKey:s,yKey:n,labelKey:a,xName:o,yName:r,labelName:l,title:h=r,marker:c,tooltip:d}=this.properties,{datum:u,xValue:p,yValue:g,label:y,itemId:f}=t,x=Xt({fill:t.fill,strokeWidth:this.getStrokeWidth(c.strokeWidth)},c.getStyle()),{fill:b="gray"}=this.getMarkerStyle(c,{datum:t,highlighted:!1,xKey:s,yKey:n,labelKey:a},x),v=Eu(e.formatDatum(p)),S=Eu(i.formatDatum(g));let M=`<b>${Eu(null!=o?o:s)}</b>: ${v}<br><b>${Eu(null!=r?r:n)}</b>: ${S}`;return a&&(M=`<b>${Eu(null!=l?l:a)}</b>: ${Eu(y.text)}<br>`+M),d.toTooltipHtml({title:h,content:M,backgroundColor:b},m({datum:u,itemId:f,xKey:s,xName:o,yKey:n,yName:r,labelKey:a,labelName:l,title:h,color:b,seriesId:this.id},this.getModuleTooltipParams()))}getLegendData(t){var e,i,s,n,a,o;const{yKey:r,yName:l,title:h,marker:c,visible:d}=this.properties,{fill:u,stroke:p,fillOpacity:g,strokeOpacity:m,strokeWidth:y}=c;return(null==(e=this.data)?void 0:e.length)&&this.properties.isValid()&&"category"===t?[{legendType:"category",id:this.id,itemId:r,seriesId:this.id,enabled:d,label:{text:null!=(i=null!=h?h:l)?i:r},marker:{shape:c.shape,fill:null!=(n=null!=(s=c.fill)?s:u)?n:"rgba(0, 0, 0, 0)",stroke:null!=(o=null!=(a=c.stroke)?a:p)?o:"rgba(0, 0, 0, 0)",fillOpacity:null!=g?g:1,strokeOpacity:null!=m?m:1,strokeWidth:null!=y?y:0}}]:[]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s}=t;$u(this,this.ctx.animationManager,e),Pu(this,"labels",this.ctx.animationManager,i),Pu(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new ko}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 qu(this,t)}};hg.className="ScatterSeries",hg.type="scatter";var cg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",instanceConstructor:hg,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:Ve,tooltip:{position:{type:"node"}},marker:{__extends__:Ke,fillOpacity:.8},label:{enabled:!1,fontSize:12,fontFamily:Ye,color:$e}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:1}}}},paletteFactory:Nu},dg=class t{constructor(t,e,i,s){this.startAngle=t,this.endAngle=e,this.innerRadius=i,this.outerRadius=s}clone(){const{startAngle:e,endAngle:i,innerRadius:s,outerRadius:n}=this;return new t(e,i,s,n)}[zs](e,i){return new t(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 ug(t,e,i){const s=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),{innerRadius:n,outerRadius:a}=i;if(i.startAngle===i.endAngle||s<Math.min(n,a)||s>Math.max(n,a))return!1;const o=Bn(i.startAngle),r=Bn(i.endAngle),l=Math.atan2(e,t);return o<r?l<=r&&l>=o:l<=r&&l>=-Math.PI||l>=o&&l<=Math.PI}function pg(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:a}=e,o={x:a*Math.cos(i),y:a*Math.sin(i)},r={x:a*Math.cos(s),y:a*Math.sin(s)},l=0===n?{x:0,y:0}:{x:n*Math.cos(i),y:n*Math.sin(i)},h=0===n?{x:0,y:0}:{x:n*Math.cos(s),y:n*Math.sin(s)};return ad(t.start.x,t.start.y,t.end.x,t.end.y,o.x,o.y,l.x,l.y)||ad(t.start.x,t.start.y,t.end.x,t.end.y,r.x,r.y,h.x,h.y)||ld(0,0,a,i,s,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function gg(t,e){const i={x:t.x,y:t.y},s={x:t.x+t.width,y:t.y},n={x:t.x,y:t.y+t.height},a={x:t.x+t.width,y:t.y+t.height};return pg({start:i,end:s},e)||pg({start:n,end:a},e)}function mg(t,e,i,s){if(0===i&&0===s)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 n=0,a=1;for(let o=0;o<8;o+=1){const o=(n+a)/2;Math.asin(Math.abs(o*i)/(t+o*i))+Math.asin(Math.abs(o*s)/(t+o*s))-e<0?n=o:a=o}return n}function yg(t,e){return _n(t,e)<1e-6?e:En(t-e)+e}function fg(t,e,i=0){const s=Math.abs(e-t)>=2*Math.PI?2*Math.PI:En(e-t);return{startAngle:t=yg(t,i),endAngle:e=t+s}}function xg(t,e,i,s,n,a){const o=Math.sin(a),r=Math.cos(a),l=p(t,2)+p(e,2)-p(i,2);let h=NaN,c=NaN,d=NaN,u=NaN;if(r>.5){const i=o/r,s=1+p(i,2),n=-2*(t+e*i),a=p(n,2)-4*s*l;if(a<0)return;const g=(-n+Math.sqrt(a))/(2*s),m=(-n-Math.sqrt(a))/(2*s);h=g,c=g*i,d=m,u=m*i}else{const i=r/o,s=1+p(i,2),n=-2*(e+t*i),a=p(n,2)-4*s*l;if(a<0)return;const g=(-n+Math.sqrt(a))/(2*s),m=(-n-Math.sqrt(a))/(2*s);h=g*i,c=g,d=m*i,u=m}const g=d*r+u*o,m=h*r+c*o>0?yg(Math.atan2(c-e,h-t),s):NaN,y=g>0?yg(Math.atan2(u-e,d-t),s):NaN;return m>=s&&m<=n?m:y>=s&&y<=n?y:void 0}function bg(t,e,i,s,n,a){const o=Math.hypot(t,e),r=o-(p(o,2)-p(i,2)+p(a,2))/(2*o),l=Math.atan2(e,t),h=Math.acos(-r/i),c=yg(l+h,s),d=yg(l-h,s);return c>=s&&c<=n?c:d>=s&&d<=n?d:void 0}var vg=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){null==t||!this.isValid()||t<this.a0||(this.a0=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(t){null==t||!this.isValid()||t>this.a1||(this.a1=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},Sg=class extends dd{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=2*Math.PI,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(){const t=this.outerRadius;return new Js(this.centerX-t,this.centerY-t,2*t,2*t)}normalizedRadii(){const{concentricEdgeInset:t}=this;return{innerRadius:Math.max(Math.min(this.innerRadius,this.outerRadius)+t,0),outerRadius:Math.max(Math.max(this.innerRadius,this.outerRadius)-t,0)}}normalizedClipSector(){const{clipSector:t}=this;if(null==t)return;const{startAngle:e,endAngle:i}=fg(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),a=fg(t.startAngle,t.endAngle,e);return new dg(Math.max(e,a.startAngle),Math.min(i,a.endAngle),Math.max(s,t.innerRadius),Math.min(n,t.outerRadius))}getAngleOffset(t){return t>0?this.radialEdgeInset/t:0}arc(t,e,i,s,n,a,o,r){if(t<=0)return;const{startAngle:l,endAngle:h}=fg(this.startAngle,this.endAngle),{innerRadius:c,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(r&&c<=0)return;const p=this.getAngleOffset(c),g=this.getAngleOffset(d),m=r?this.getAngleOffset(c+t):this.getAngleOffset(d-t),y=o?l+m+e:h-m-e,f=r?c+t:d-t,x=f*Math.cos(y),b=f*Math.sin(y);if(null!=u){const t=1e-6;if(!(o||y>=l-t&&y<=u.endAngle-t))return;if(o&&!(y>=u.startAngle+t&&y<=h-t))return;if(r&&!(f>=u.innerRadius-t))return;if(!(r||f<=u.outerRadius+t))return}const v=new vg(x,b,t,i,s);if(null!=u){let e,h;if(r?(v.clipStart(xg(x,b,t,i,s,u.endAngle-p)),v.clipEnd(xg(x,b,t,i,s,u.startAngle+p))):(v.clipStart(xg(x,b,t,i,s,u.startAngle+g)),v.clipEnd(xg(x,b,t,i,s,u.endAngle-g))),o?(e=bg(x,b,t,i,s,u.innerRadius),h=bg(x,b,t,i,s,u.outerRadius)):(e=bg(x,b,t,i,s,u.outerRadius),h=bg(x,b,t,i,s,u.innerRadius)),v.clipStart(e),v.clipEnd(h),null!=e){const{x:t,y:i}=v.pointAt(e),s=yg(Math.atan2(i,t),l);o?null==a||a.clipStart(s):n.clipEnd(s)}if(null!=h){const{x:t,y:e}=v.pointAt(h),i=yg(Math.atan2(e,t),l);o?n.clipStart(i):null==a||a.clipEnd(i)}}if(null!=u){const{x:t,y:e}=v.pointAt((v.a0+v.a1)/2);if(!ug(t,e,u))return}const{x:S,y:M}=v.pointAt(o===r?v.a0:v.a1),k=yg(Math.atan2(M,S),l),D=r?a:n;return o?null==D||D.clipStart(k):null==D||D.clipEnd(k),v}updatePath(){var t,e,i,s,n;const{path:a,centerX:o,centerY:r,concentricEdgeInset:l,radialEdgeInset:h}=this;let{startOuterCornerRadius:c,endOuterCornerRadius:d,startInnerCornerRadius:u,endInnerCornerRadius:p}=this;const{startAngle:g,endAngle:m}=fg(this.startAngle,this.endAngle),{innerRadius:y,outerRadius:f}=this.normalizedRadii(),x=this.normalizedClipSector(),b=m-g,v=b>=2*Math.PI-1e-6;if(a.clear(),(null!=(t=null==x?void 0:x.startAngle)?t:g)===(null!=(e=null==x?void 0:x.endAngle)?e:m))return;if(v&&null==this.clipSector&&0===c&&0===d&&0===u&&0===p)return a.moveTo(o+f*Math.cos(g),r+f*Math.sin(g)),a.arc(o,r,f,g,m),y>l&&(a.moveTo(o+y*Math.cos(m),r+y*Math.sin(m)),a.arc(o,r,y,m,g,!0)),void a.closePath();const S=this.getAngleOffset(y),M=this.getAngleOffset(f);if(b<2*M)return;const k=(null!=(i=null==x?void 0:x.innerRadius)?i:y)>l,D=y<l||b<2*S,w=f-y,I=Math.max(c,u,d,p),C=I>0?Math.min(w/I,1):1;c*=C,d*=C,u*=C,p*=C;const L=mg(f,b-2*M,-c,-d);if(c*=L,d*=L,!D&&k){const t=mg(y,b-2*S,u,p);u*=t,p*=t}else u=0,p=0;const A=Math.max(c+u,d+p),T=A>0?Math.min(w/A,1):1;c*=T,d*=T,u*=T,p*=T;let N=0,O=0;const R=c/(f-c),E=d/(f-d);if(R>=0&&R<.999999)N=Math.asin(R);else{N=b/2;const t=f/(1/Math.sin(N)+1);c=Math.min(t,c)}if(E>=0&&E<.999999)O=Math.asin(E);else{O=b/2;const t=f/(1/Math.sin(O)+1);d=Math.min(t,d)}const P=Math.asin(u/(y+u)),B=Math.asin(p/(y+p)),F=null!=(s=null==x?void 0:x.outerRadius)?s:f,z=this.getAngleOffset(F),G=new vg(0,0,F,g+z,m-z),_=null!=(n=null==x?void 0:x.innerRadius)?n:y,j=this.getAngleOffset(_),W=k?new vg(0,0,_,g+j,m-j):void 0;null!=x&&(G.clipStart(x.startAngle),G.clipEnd(x.endAngle),null==W||W.clipStart(x.startAngle),null==W||W.clipEnd(x.endAngle));const V=this.arc(c,N,g-.5*Math.PI,g+N,G,W,!0,!1),K=this.arc(d,O,m-O,m+.5*Math.PI,G,W,!1,!1),Y=this.arc(p,B,m+.5*Math.PI,m+Math.PI-B,G,W,!1,!0),$=this.arc(u,P,g+Math.PI+P,g+1.5*Math.PI,G,W,!0,!0);if(D){const t=b<.5*Math.PI?h*(1+Math.cos(b))/Math.sin(b):NaN;let e;e=t>0&&t<f?Math.max(Math.hypot(h,t),y):y;const i=g+.5*b;a.moveTo(o+e*Math.cos(i),r+e*Math.sin(i))}else if(!0===(null==$?void 0:$.isValid())){const{x:t,y:e}=$.pointAt($.a1);a.moveTo(o+t,r+e)}else if(!0===(null==W?void 0:W.isValid())){const{x:t,y:e}=W.pointAt(W.a0);a.moveTo(o+t,r+e)}else{const t=g+b/2,e=y*Math.cos(t),i=y*Math.sin(t);a.moveTo(o+e,r+i)}if(!0===(null==V?void 0:V.isValid())){const{cx:t,cy:e,r:i,a0:s,a1:n}=V;a.arc(o+t,r+e,i,s,n)}if(G.isValid()){const{r:t,a0:e,a1:i}=G;a.arc(o,r,t,e,i)}if(!0===(null==K?void 0:K.isValid())){const{cx:t,cy:e,r:i,a0:s,a1:n}=K;a.arc(o+t,r+e,i,s,n)}if(!D){if(!0===(null==Y?void 0:Y.isValid())){const{cx:t,cy:e,r:i,a0:s,a1:n}=Y;a.arc(o+t,r+e,i,s,n)}if(!0===(null==W?void 0:W.isValid())){const{r:t,a0:e,a1:i}=W;a.arc(o,r,t,i,e,!0)}if(!0===(null==$?void 0:$.isValid())){const{cx:t,cy:e,r:i,a0:s,a1:n}=$;a.arc(o+t,r+e,i,s,n)}}a.closePath()}isPointInPath(t,e){var i;const s=this.transformPoint(t,e),{startAngle:n,endAngle:a,innerRadius:o,outerRadius:r}=null!=(i=this.clipSector)?i:this;return ug(s.x,s.y,{startAngle:n,endAngle:a,innerRadius:Math.min(o,r),outerRadius:Math.max(o,r)})}};Sg.className="Sector",b([cd()],Sg.prototype,"centerX",2),b([cd()],Sg.prototype,"centerY",2),b([cd()],Sg.prototype,"innerRadius",2),b([cd()],Sg.prototype,"outerRadius",2),b([cd()],Sg.prototype,"startAngle",2),b([cd()],Sg.prototype,"endAngle",2),b([cd()],Sg.prototype,"clipSector",2),b([cd()],Sg.prototype,"concentricEdgeInset",2),b([cd()],Sg.prototype,"radialEdgeInset",2),b([cd()],Sg.prototype,"startOuterCornerRadius",2),b([cd()],Sg.prototype,"endOuterCornerRadius",2),b([cd()],Sg.prototype,"startInnerCornerRadius",2),b([cd()],Sg.prototype,"endInnerCornerRadius",2);var Mg=class extends ol{constructor(){super(...arguments),this.showInLegend=!1}};b([$n(Qn)],Mg.prototype,"showInLegend",2);var kg=class extends Go{constructor(){super(...arguments),this.margin=2}set(t,e){return super.set(t)}};b([$n(ta)],kg.prototype,"text",2),b([$n(ea)],kg.prototype,"margin",2);var Dg=class extends fe{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};b([$n(ma)],Dg.prototype,"fill",2),b([$n(na)],Dg.prototype,"fillOpacity",2);var wg=class extends Go{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};b([$n(sa)],wg.prototype,"offset",2),b([$n(aa)],wg.prototype,"minAngle",2),b([$n(sa)],wg.prototype,"minSpacing",2),b([$n(sa)],wg.prototype,"maxCollisionOffset",2),b([$n(Qn)],wg.prototype,"avoidCollisions",2);var Ig=class extends Go{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};b([$n(ea)],Ig.prototype,"positionOffset",2),b([$n(na)],Ig.prototype,"positionRatio",2);var Cg=class extends fe{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};b([$n(ya,{optional:!0})],Cg.prototype,"colors",2),b([$n(sa)],Cg.prototype,"length",2),b([$n(sa)],Cg.prototype,"strokeWidth",2);var Lg=class extends Gd{constructor(){super(...arguments),this.fills=Object.values(Be),this.strokes=Object.values(Fe),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=void 0,this.innerLabels=new xe(kg),this.title=new Mg,this.innerCircle=new Dg,this.shadow=new Gu,this.calloutLabel=new wg,this.sectorLabel=new Ig,this.calloutLine=new Cg,this.tooltip=new Vu,this.__BACKGROUND_COLOR_DO_NOT_USE=void 0}isValid(){const t=super.isValid();return null==this.innerRadiusRatio&&null==this.innerRadiusOffset?(E.warnOnce("Either an [innerRadiusRatio] or an [innerRadiusOffset] must be set to render a donut series."),!1):t}};function Ag(t,e,i,s){const n=[i.convert(0),i.convert(1)],a=[s.convert(0),s.convert(1)],o=Math.PI/-2+zn(e),r=t?"initial":"update";return{nodes:{toFn:(t,e,i,{prevLive:s})=>{var a,r;let{startAngle:l,endAngle:h,innerRadius:c,outerRadius:d}=e;const{stroke:u,fill:p}=e.sectorFormat;if("removed"===i&&s?(l=null==(a=s.datum)?void 0:a.endAngle,h=null==(r=s.datum)?void 0:r.endAngle):"removed"!==i||s||(l=o,h=o),"removed"===i){const t=(({radius:t})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*t}))(e);c=t.innerRadius,d=t.outerRadius}return{startAngle:l,endAngle:h,outerRadius:d,innerRadius:c,stroke:u,fill:p}},fromFn:(e,i,s,{prevFromProps:n})=>{var l,h,c,d,u,p;let{startAngle:g,endAngle:m,innerRadius:y,outerRadius:f}=e,{fill:x,stroke:b}=i.sectorFormat;if("unknown"===s||"added"===s&&!n?(g=o,m=o,y=i.innerRadius,f=i.outerRadius):"added"===s&&n&&(g=null!=(l=n.endAngle)?l:o,m=null!=(h=n.endAngle)?h:o,y=null!=(c=n.innerRadius)?c:i.innerRadius,f=null!=(d=n.outerRadius)?d:i.outerRadius),"added"===s&&!t){const t=(({radius:t})=>({innerRadius:a[0],outerRadius:a[0]+(a[1]-a[0])*t}))(i);y=t.innerRadius,f=t.outerRadius}return"updated"===s&&(x=null!=(u=e.fill)?u:x,b=null!=(p=e.stroke)?p:b),{startAngle:g,endAngle:m,innerRadius:y,outerRadius:f,fill:x,stroke:b,phase:r}}},innerCircle:{fromFn:(t,e)=>{var i,s,n;return{size:null!=(n=null!=(s=null==(i=t.previousDatum)?void 0:i.radius)?s:t.size)?n:0,phase:r}},toFn:(t,e)=>{var i;return{size:null!=(i=e.radius)?i:0}}}}}function Tg(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,fill:e.sectorFormat.fill,stroke:e.sectorFormat.stroke}}function Ng(t,e){const i=e.y-t.centerY,s=e.x-t.centerX,n=Math.atan2(i,s),a=t.getItemNodes();for(const t of a)if(!0!==t.datum.missing&&Fn(n,t.startAngle,t.endAngle)){const e=Math.sqrt(s*s+i*i);let n=0;return e<t.innerRadius?n=t.innerRadius-e:e>t.outerRadius&&(n=e-t.outerRadius),{datum:t.datum,distance:n}}}function Og(t,e){const i=t.getNodeData();if(void 0===i)return;const{centerX:s,centerY:n}=t,a=i[e.datumIndex],o=[{radius:a.innerRadius,angle:a.startAngle},{radius:a.innerRadius,angle:a.endAngle},{radius:a.outerRadius,angle:a.startAngle},{radius:a.outerRadius,angle:a.endAngle}],r=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const t of r)Fn(t,a.startAngle,a.endAngle)&&o.push({radius:a.outerRadius,angle:t});const l=o.map(({radius:t,angle:e})=>jn(s,n,t,e)),h=l.map(t=>t.x),c=l.map(t=>t.y),d=Math.min(...h),u=Math.min(...c),p=Math.max(...h)-d,g=Math.max(...c)-u;return new Js(d,u,p,g)}b([$n(ta)],Lg.prototype,"angleKey",2),b([$n(ta,{optional:!0})],Lg.prototype,"angleName",2),b([$n(ta,{optional:!0})],Lg.prototype,"radiusKey",2),b([$n(ta,{optional:!0})],Lg.prototype,"radiusName",2),b([$n(sa,{optional:!0})],Lg.prototype,"radiusMin",2),b([$n(sa,{optional:!0})],Lg.prototype,"radiusMax",2),b([$n(ta,{optional:!0})],Lg.prototype,"calloutLabelKey",2),b([$n(ta,{optional:!0})],Lg.prototype,"calloutLabelName",2),b([$n(ta,{optional:!0})],Lg.prototype,"sectorLabelKey",2),b([$n(ta,{optional:!0})],Lg.prototype,"sectorLabelName",2),b([$n(ta,{optional:!0})],Lg.prototype,"legendItemKey",2),b([$n(ya)],Lg.prototype,"fills",2),b([$n(ya)],Lg.prototype,"strokes",2),b([$n(na)],Lg.prototype,"fillOpacity",2),b([$n(na)],Lg.prototype,"strokeOpacity",2),b([$n(Da)],Lg.prototype,"lineDash",2),b([$n(sa)],Lg.prototype,"lineDashOffset",2),b([$n(sa)],Lg.prototype,"cornerRadius",2),b([$n(Jn,{optional:!0})],Lg.prototype,"formatter",2),b([$n(aa)],Lg.prototype,"rotation",2),b([$n(ea)],Lg.prototype,"outerRadiusOffset",2),b([$n(na)],Lg.prototype,"outerRadiusRatio",2),b([$n(ea,{optional:!0})],Lg.prototype,"innerRadiusOffset",2),b([$n(na,{optional:!0})],Lg.prototype,"innerRadiusRatio",2),b([$n(sa)],Lg.prototype,"strokeWidth",2),b([$n(sa,{optional:!0})],Lg.prototype,"sectorSpacing",2),b([$n(Sa)],Lg.prototype,"innerLabels",2),b([$n(Zn)],Lg.prototype,"title",2),b([$n(Zn)],Lg.prototype,"innerCircle",2),b([$n(Zn)],Lg.prototype,"shadow",2),b([$n(Zn)],Lg.prototype,"calloutLabel",2),b([$n(Zn)],Lg.prototype,"sectorLabel",2),b([$n(Zn)],Lg.prototype,"calloutLine",2),b([$n(Zn)],Lg.prototype,"tooltip",2),b([$n(ta,{optional:!0})],Lg.prototype,"__BACKGROUND_COLOR_DO_NOT_USE",2);var Rg=class extends Ed{constructor(t){var e=t,{useLabelLayer:i=!1,pickModes:s=[0],canHaveAxes:n=!1,animationResetFns:a}=e,o=f(e,["useLabelLayer","pickModes","canHaveAxes","animationResetFns"]);super(y(m({},o),{useLabelLayer:i,pickModes:s,contentGroupVirtual:!1,directionKeys:{x:["angleKey"],y:["radiusKey"]},directionNames:{x:["angleName"],y:["radiusName"]},canHaveAxes:n})),this.itemGroup=this.contentGroup.appendChild(new ko),this.nodeData=[],this.itemSelection=Er.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=Er.select(this.labelGroup,Bo,!1),this.highlightSelection=Er.select(this.highlightGroup,()=>this.nodeFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.showFocusBox=!1,this.itemGroup.zIndexSubOrder=[()=>this._declarationOrder,1],this.animationResetFns=a,this.animationState=new yr("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),highlightMarkers:t=>this.animateReadyHighlightMarkers(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return this.itemGroup.children}getNodeData(){return this.nodeData}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t&&this.animationState.transition("skip")}getLabelData(){return[]}computeLabelsBBox(t,e){return null}resetAllAnimation(){var t;const{item:e,label:i}=null!=(t=this.animationResetFns)?t:{};this.ctx.animationManager.stopByAnimationGroupId(this.id),e&&mr([this.itemSelection,this.highlightSelection],e),i&&mr([this.labelSelection],i),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(t){var e;const{item:i}=null!=(e=this.animationResetFns)?e:{};i&&mr([this.highlightSelection],i)}animateReadyHighlightMarkers(t){}animateReadyResize(t){this.resetAllAnimation()}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animationTransitionClear(){this.animationState.transition("clear",this.getAnimationData())}getAnimationData(t){return{seriesRect:t}}},Eg=class extends Uc{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}},Pg=class extends Rg{constructor(t){super({moduleCtx:t,pickModes:[0],useLabelLayer:!0,animationResetFns:{item:Tg,label:Fu}}),this.properties=new Lg,this.previousRadiusScale=new Zd,this.radiusScale=new Zd,this.backgroundGroup=this.rootGroup.appendChild(new ko({name:`${this.id}-background`,layer:!0,zIndex:0})),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new ko({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new fd),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new fd),this.innerCircleGroup=this.backgroundGroup.appendChild(new ko({name:`${this.id}-innerCircle`})),this.seriesItemEnabled=[],this.surroundingRadius=void 0,this.NodeEvent=Eg,this.angleScale=new Zd,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2);const e=new ko({name:"pieCalloutLabels"}),i=new ko({name:"pieSectorLabels"}),s=new ko({name:"innerLabels"});this.labelGroup.append(e),this.labelGroup.append(i),this.labelGroup.append(s),this.calloutLabelSelection=Er.select(e,ko),this.sectorLabelSelection=Er.select(i,Bo),this.innerLabelsSelection=Er.select(s,Bo),this.innerCircleSelection=Er.select(this.innerCircleGroup,fd)}addChartEventListeners(){var t;this.destroyFns.push(null==(t=this.ctx.chartEventManager)?void 0:t.addListener("legend-item-click",t=>this.onLegendItemClick(t)))}get visible(){return super.visible&&(0===this.seriesItemEnabled.length||this.seriesItemEnabled.some(t=>t))}nodeFactory(){return new Sg}getSeriesDomain(t){return"x"===t?this.angleScale.domain:this.radiusScale.domain}processData(t){return S(this,null,function*(){var e,i,s,n,a;if(null==this.data||!this.properties.isValid())return;let{data:o}=this;const{visible:r,seriesItemEnabled:l}=this,{angleKey:h,radiusKey:c,calloutLabelKey:d,sectorLabelKey:u,legendItemKey:p}=this.properties,g=!this.ctx.animationManager.isSkipped(),f=[],x=[];p?f.push(Wc(p,"band",{id:"legendItemKey"})):d?f.push(Wc(d,"band",{id:"calloutLabelKey"})):u&&f.push(Wc(u,"band",{id:"sectorLabelKey"}));const b=this.radiusScale.type,v=this.radiusScale.type;c&&x.push(Kc(c,{id:"radiusValue",min:null!=(e=this.properties.radiusMin)?e:0,max:this.properties.radiusMax}),Vc(c,b,{id:"radiusRaw"}),Tc({id:"radiusValue"},[0,1],1,null!=(i=this.properties.radiusMin)?i:0,this.properties.radiusMax)),d&&x.push(Vc(d,"band",{id:"calloutLabelValue"})),u&&x.push(Vc(u,"band",{id:"sectorLabelValue"})),p&&x.push(Vc(p,"band",{id:"legendItemValue"})),g&&this.processedData&&f.length>0&&x.push(Pc(this.processedData)),x.push(Nc()),o=o.map((t,e)=>r&&l[e]?t:y(m({},t),{[h]:0})),yield this.requestDataModel(t,o,{props:[...f,Yc(h,v,{id:"angleValue",onlyPositive:!0}),Vc(h,v,{id:"angleRaw"}),Tc({id:"angleValue"},[0,1],0,0),...x]});for(const t of null!=(a=null==(n=null==(s=this.processedData)?void 0:s.defs)?void 0:n.values)?a:[]){const{id:e,missing:i,property:s}=t,n=Xh(this,i);"angleRaw"!==e&&n>0&&E.warnOnce(`no value was found for the key '${String(s)}' on ${n} data element${n>1?"s":""}`)}this.animationState.transition("updateData")})}maybeRefreshNodeData(){return S(this,null,function*(){var t;if(!this.nodeDataRefresh)return;const{nodeData:e=[]}=null!=(t=yield this.createNodeData())?t:{};this.nodeData=e,this.nodeDataRefresh=!1})}getProcessedDataIndexes(t){return{angleIdx:t.resolveProcessedDataIndexById(this,"angleValue"),radiusIdx:this.properties.radiusKey?t.resolveProcessedDataIndexById(this,"radiusValue"):-1,calloutLabelIdx:this.properties.calloutLabelKey?t.resolveProcessedDataIndexById(this,"calloutLabelValue"):-1,sectorLabelIdx:this.properties.sectorLabelKey?t.resolveProcessedDataIndexById(this,"sectorLabelValue"):-1,legendItemIdx:this.properties.legendItemKey?t.resolveProcessedDataIndexById(this,"legendItemValue"):-1}}createNodeData(){return S(this,null,function*(){const{id:t,processedData:e,dataModel:i,angleScale:s}=this,{rotation:n,innerRadiusRatio:a}=this.properties;if(!this.properties.isValid())return this.zerosumOuterRing.visible=!0,this.zerosumInnerRing.visible=!0,{itemId:t,nodeData:[],labelData:[]};if(!e||!i||"ungrouped"!==e.type)return;const{angleIdx:o,radiusIdx:r,calloutLabelIdx:l,sectorLabelIdx:h,legendItemIdx:c}=this.getProcessedDataIndexes(i);let d=0,u=0;const p=e.data.map((t,e)=>{var i;const{datum:a,values:p}=t,g=p[o],y=s.convert(d)+zn(n);d=g,u+=g;const f=s.convert(d)+zn(n),x=Math.abs(f-y),b=y+x/2,v=p[o+1],S=r>=0&&null!=(i=p[r])?i:1,M=r>=0?p[r+1]:void 0,k=c>=0?p[c]:void 0,D=this.getLabels(a,b,x,!0,p[l],p[h],k),w=this.getSectorFormat(a,e,!1);return m({itemId:e,series:this,datum:a,index:e,angleValue:v,midAngle:b,midCos:Math.cos(b),midSin:Math.sin(b),startAngle:y,endAngle:f,sectorFormat:w,radiusValue:M,radius:S,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(S),0),legendItemValue:k},D)});return this.zerosumOuterRing.visible=0===u,this.zerosumInnerRing.visible=0===u&&null!=a&&1!==a&&a>0,{itemId:t,nodeData:p,labelData:p}})}getLabels(t,e,i,s,n,a,o){const{calloutLabel:r,sectorLabel:l,legendItemKey:h}=this.properties,c=!s||r.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!c&&!d&&!h)return{};const u={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 c&&i>zn(r.minAngle)&&(p.calloutLabel=y(m({},this.getTextAlignment(e)),{text:this.getLabelText(r,y(m({},u),{value:n})),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0})),d&&(p.sectorLabel={text:this.getLabelText(l,y(m({},u),{value:a}))}),null!=h&&null!=o&&(p.legendItem={key:h,text:o}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Bn(t)- -.75*Math.PI;return e[Us(Math.floor(i/(Math.PI/2)),e.length)]}getSectorFormat(t,e,i){var s,n,a,o,r;const{callbackCache:l,highlightManager:h}=this.ctx,{angleKey:c,radiusKey:d,fills:u,strokes:p,formatter:g,sectorSpacing:m,__BACKGROUND_COLOR_DO_NOT_USE:y}=this.properties,f=h.getActiveHighlight(),x=i&&(null==f?void 0:f.series)===this&&e===f.itemId;let b=p[e%p.length];null==m&&null==b&&(b=y);const{fill:v,fillOpacity:S,stroke:M,strokeWidth:k,strokeOpacity:D}=Xt(x&&this.properties.highlightStyle.item,{fill:u.length>0?u[e%u.length]:void 0,fillOpacity:this.properties.fillOpacity,stroke:b,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()});let w;return g&&(w=l.call(g,{datum:t,angleKey:c,radiusKey:d,fill:v,stroke:M,fills:u,strokes:p,strokeWidth:k,highlighted:x,seriesId:this.id})),{fill:null!=(s=null==w?void 0:w.fill)?s:v,fillOpacity:null!=(n=null==w?void 0:w.fillOpacity)?n:S,stroke:null!=(a=null==w?void 0:w.stroke)?a:M,strokeWidth:null!=(o=null==w?void 0:w.strokeWidth)?o:k,strokeOpacity:null!=(r=null==w?void 0:w.strokeOpacity)?r:D}}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),this.nodeData=this.nodeData.map(t=>{var e=t,{radius:i}=e,s=f(e,["radius"]);return y(m({},s),{radius:i,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(i),0)})})}getTitleTranslationY(){var t,e;const i=Math.max(0,this.radiusScale.range[1]);return 0===i?NaN:-i-(2+(null!=(e=null==(t=this.properties.title)?void 0:t.spacing)?e:0))-Math.max(0,-i)}update(t){return S(this,arguments,function*({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:null==t?void 0:t.width,seriesRectHeight:null==t?void 0:t.height},s=null!=Se(this.nodeDataDependencies,i);if(s&&(this._nodeDataDependencies=i),yield 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 t=this.getTitleTranslationY(),i=e.node.computeBBox();e.node.visible=e.enabled&&isFinite(t)&&!this.bboxIntersectsSurroundingSeries(i,0,t),e.node.translationY=isFinite(t)?t:0}for(const t of[this.zerosumInnerRing,this.zerosumOuterRing])t.fillOpacity=0,t.stroke=this.properties.calloutLabel.color,t.strokeWidth=1,t.strokeOpacity=1;this.updateNodeMidPoint(),yield this.updateSelections(),yield this.updateNodes(t)})}updateTitleNodes(){var t,e;const{oldTitle:i}=this,{title:s}=this.properties;i!==s&&(i&&(null==(t=this.labelGroup)||t.removeChild(i.node)),s&&(s.node.textBaseline="bottom",null==(e=this.labelGroup)||e.appendChild(s.node)),this.oldTitle=s)}updateNodeMidPoint(){this.nodeData.forEach(t=>{const e=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,e),y:t.midSin*Math.max(0,e)}})}updateSelections(){return S(this,null,function*(){yield this.updateGroupSelection(),this.updateInnerCircleSelection()})}updateGroupSelection(){return S(this,null,function*(){const{itemSelection:t,highlightSelection:e,calloutLabelSelection:i,sectorLabelSelection:s,innerLabelsSelection:n}=this,a=(t,e)=>{let i=this.nodeData;e&&(i=i.map(t=>y(m({},t),{sectorFormat:m({},t.sectorFormat)}))),t.update(i,void 0,t=>this.getDatumId(t)),this.ctx.animationManager.isSkipped()&&t.cleanup()};a(t,!1),a(e,!0),i.update(this.nodeData,t=>{const e=new zr;e.tag=0,e.pointerEvents=1,t.appendChild(e);const i=new Bo;i.tag=1,i.pointerEvents=1,t.appendChild(i)}),s.update(this.nodeData,t=>{t.pointerEvents=1}),n.update(this.properties.innerLabels,t=>{t.pointerEvents=1})})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const t=Math.min(i,this.getOuterRadius()),s=1;e=Math.ceil(2*t+s)}const s=t?[{radius:e}]:[];this.innerCircleSelection.update(s)}updateNodes(t){return S(this,null,function*(){const e=this.ctx.highlightManager.getActiveHighlight(),i=this.visible&&this.seriesItemEnabled.indexOf(!0)>=0;this.rootGroup.visible=i,this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&(null==e?void 0:e.series)===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((t,{radius:e})=>{var i,s;t.setProperties({fill:null==(i=this.properties.innerCircle)?void 0:i.fill,opacity:null==(s=this.properties.innerCircle)?void 0:s.fillOpacity,size:e})});const s=(t,e,i,s)=>{const n=this.getSectorFormat(e.datum,e.itemId,s);e.sectorFormat.fill=n.fill,e.sectorFormat.stroke=n.stroke;const a=this.ctx.animationManager.isSkipped();a&&(t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius),(s||a)&&(t.fill=n.fill,t.stroke=n.stroke),t.strokeWidth=n.strokeWidth,t.fillOpacity=n.fillOpacity,t.strokeOpacity=this.properties.strokeOpacity,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset,t.fillShadow=this.properties.shadow,t.cornerRadius=this.properties.cornerRadius,t.inset=null!=this.properties.sectorSpacing?(this.properties.sectorSpacing+(null!=n.stroke?n.strokeWidth:0))/2:0,t.lineJoin=null!=this.properties.sectorSpacing?"miter":"round"};this.itemSelection.each((t,e,i)=>s(t,e,0,!1)),this.highlightSelection.each((t,i,n)=>{const a=(null==e?void 0:e.series)===this&&t.datum.itemId===e.itemId;s(t,i,0,!0),t.visible=a}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")})}updateCalloutLineNodes(){var t;const{calloutLine:e}=this.properties,i=e.length,s=e.strokeWidth,n=null!=(t=e.colors)?t:this.properties.strokes,{offset:a}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((t,e)=>{var o;const r=t.datum,{calloutLabel:l,outerRadius:h}=r;if((null==l?void 0:l.text)&&!l.hidden&&0!==h){t.visible=!0,t.strokeWidth=s,t.stroke=n[e%n.length],t.fill=void 0;const c=r.midCos*h,d=r.midSin*h;let u=r.midCos*(h+i),p=r.midSin*(h+i);if((null!=(o=l.collisionTextAlign)?o:0!==l.collisionOffsetY)&&null!=l.box){const t=l.box;let e=u,i=p;u<t.x?e=t.x:u>t.x+t.width&&(e=t.x+t.width),p<t.y?i=t.y:p>t.y+t.height&&(i=t.y+t.height);const s=e-u,n=i-p,o=Math.sqrt(Math.pow(s,2)+Math.pow(n,2)),r=o-a;r>0&&(u+=s*r/o,p+=n*r/o)}t.x1=c,t.y1=d,t.x2=u,t.y2=p}else t.visible=!1})}getLabelOverflow(t,e,i){const s=i.x-this.centerX,n=i.x+i.width-this.centerX,a=i.y-this.centerY,o=i.y+i.height-this.centerY;let r=1;e.x+1<s?r=(e.x+e.width-s)/e.width:e.x+e.width-1>n&&(r=(n-e.x)/e.width);const l=e.y+1<a||e.y+e.height-1>o;return{textLength:1===r?t.length:Math.floor(t.length*r)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(e)}}bboxIntersectsSurroundingSeries(t,e=0,i=0){const{surroundingRadius:s}=this;if(null==s)return!1;const n=[{x:t.x+e,y:t.y+i},{x:t.x+t.width+e,y:t.y+i},{x:t.x+t.width+e,y:t.y+t.height+i},{x:t.x+e,y:t.y+t.height+i}],a=p(s,2);return n.some(t=>p(t.x,2)+p(t.y,2)>a)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,a=t.convert(0),o=this.nodeData,r=this.nodeData.filter(t=>{return!(!(e=t).calloutLabel||0===e.outerRadius);var e});if(r.forEach(t=>{const e=t.calloutLabel;null!=e&&(e.hidden=!1,e.collisionTextAlign=void 0,e.collisionOffsetY=0)}),r.length<=1)return;const l=r.filter(t=>t.midCos<0).sort((t,e)=>t.midSin-e.midSin),h=r.filter(t=>t.midCos>=0).sort((t,e)=>t.midSin-e.midSin),c=r.filter(t=>{var e;return t.midSin<0&&"center"===(null==(e=t.calloutLabel)?void 0:e.textAlign)}).sort((t,e)=>t.midCos-e.midCos),d=r.filter(t=>{var e;return t.midSin>=0&&"center"===(null==(e=t.calloutLabel)?void 0:e.textAlign)}).sort((t,e)=>t.midCos-e.midCos),u=new Bo,p=t=>{var e;const n=t.calloutLabel;if(null==n)return new Js(0,0,0,0);const a=t.outerRadius+i.length+s,o=t.midCos*a,r=t.midSin*a+n.collisionOffsetY;return u.text=n.text,u.x=o,u.y=r,u.setFont(this.properties.calloutLabel),u.setAlign({textAlign:null!=(e=n.collisionTextAlign)?e:n.textAlign,textBaseline:n.textBaseline}),u.computeBBox()},g=(t,e,i)=>{const s=p(t).grow(n/2),a=p(e).grow(n/2);if(s.x<a.x+a.width&&s.x+s.width>a.x&&("to-top"===i?s.y<a.y+a.height:s.y+s.height>a.y)){const t="to-top"===i?s.y-a.y-a.height:s.y+s.height-a.y;e.calloutLabel.collisionOffsetY=t}},m=t=>{const e=t.slice().sort((t,e)=>Math.abs(t.midSin)-Math.abs(e.midSin))[0],i=t.indexOf(e);for(let e=i-1;e>=0;e--){const i=t[e+1],s=t[e];g(i,s,"to-top")}for(let e=i+1;e<t.length;e++){const i=t[e-1],s=t[e];g(i,s,"to-bottom")}},y=t=>{const e=r.some(t=>0!==t.calloutLabel.collisionOffsetY),i=t.map(t=>p(t)),s=i.map(t=>t.clone().grow(n/2));let l=!1;for(let e=0;e<s.length&&!l;e++){const i=s[e];for(let n=e+1;n<t.length;n++){const t=s[n];if(i.collidesBBox(t)){l=!0;break}}}const h=o.map(t=>{const{startAngle:e,endAngle:i,outerRadius:s}=t;return{startAngle:e,endAngle:i,innerRadius:a,outerRadius:s}}),c=i.some(t=>h.some(e=>gg(t,e)));(l||e||c)&&t.filter(t=>"center"===t.calloutLabel.textAlign).forEach(t=>{const e=t.calloutLabel;t.midCos<0?e.collisionTextAlign="right":t.midCos>0?e.collisionTextAlign="left":e.collisionTextAlign="center"})};m(l),m(h),y(c),y(d)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,color:o}=i,r=new Bo;this.calloutLabelSelection.selectByTag(1).forEach(s=>{var l;const{datum:h}=s,c=h.calloutLabel,d=e.convert(h.radius),u=Math.max(0,d);if(!(null==c?void 0:c.text)||0===u||c.hidden)return void(s.visible=!1);const p=u+n+a,g=h.midCos*p,m=h.midSin*p+c.collisionOffsetY,y={textAlign:null!=(l=c.collisionTextAlign)?l:c.textAlign,textBaseline:c.textBaseline};r.text=c.text,r.x=g,r.y=m,r.setFont(this.properties.calloutLabel),r.setAlign(y);const f=r.computeBBox();let x=c.text,b=!0;if(i.avoidCollisions){const{textLength:e,hasVerticalOverflow:i}=this.getLabelOverflow(c.text,f,t);x=c.text.length===e?c.text:`${c.text.substring(0,e)}…`,b=!i}s.text=x,s.x=g,s.y=m,s.setFont(this.properties.calloutLabel),s.setAlign(y),s.fill=o,s.visible=b})}computeLabelsBBox(t,e){return S(this,null,function*(){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,maxCollisionOffset:o,minSpacing:r}=i;if(!i.avoidCollisions)return null;yield this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],h=new Bo;let c;const{title:d}=this.properties;if((null==d?void 0:d.text)&&d.enabled){const t=this.getTitleTranslationY();isFinite(t)&&(h.text=d.text,h.x=0,h.y=t,h.setFont(d),h.setAlign({textBaseline:"bottom",textAlign:"center"}),c=h.computeBBox(),l.push(c))}return this.nodeData.forEach(i=>{var s;const d=i.calloutLabel;if(!d||0===i.outerRadius)return null;const u=i.outerRadius+n+a,p=i.midCos*u,g=i.midSin*u+d.collisionOffsetY;h.text=d.text,h.x=p,h.y=g,h.setFont(this.properties.calloutLabel),h.setAlign({textAlign:null!=(s=d.collisionTextAlign)?s:d.textAlign,textBaseline:d.textBaseline});const m=h.computeBBox();if(d.box=m,Math.abs(d.collisionOffsetY)>o)d.hidden=!0;else{if(c){const t=e.y-this.centerY,i=new Js(c.x-r,t,c.width+2*r,c.y+c.height+r-t);if(m.collidesBBox(i))return void(d.hidden=!0)}if(t.hideWhenNecessary){const{textLength:t,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:s}=this.getLabelOverflow(d.text,m,e),n=d.text.length>2&&t<2;if(i||n||s)return void(d.hidden=!0)}d.hidden=!1,l.push(m)}}),0===l.length?null:Js.merge(l)})}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:a,positionOffset:o,positionRatio:r,color:l}=this.properties.sectorLabel;this.sectorLabelSelection.each((t,h)=>{const{sectorLabel:c,outerRadius:d}=h;let u=!1;if(c&&0!==d){const p=e*(1-r)+d*r+o;t.fill=l,t.fontStyle=s,t.fontWeight=n,t.fontSize=i,t.fontFamily=a,t.text=c.text,t.x=h.midCos*p,t.y=h.midSin*p,t.textAlign="center",t.textBaseline="middle";const g=t.computeBBox(),m=[[g.x,g.y],[g.x+g.width,g.y],[g.x+g.width,g.y+g.height],[g.x,g.y+g.height]],{startAngle:y,endAngle:f}=h,x={startAngle:y,endAngle:f,innerRadius:e,outerRadius:d};m.every(([t,e])=>ug(t,e,x))&&(u=!0)}t.visible=u})}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((i,s)=>{const{fontStyle:n,fontWeight:a,fontSize:o,fontFamily:r,color:l}=s;i.fontStyle=n,i.fontWeight=a,i.fontSize=o,i.fontFamily=r,i.text=s.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",t.push(i.computeBBox()),e.push(s.margin)});const i=t=>0===t?0:e[t],s=t=>t===e.length-1?0:e[t],n=t.reduce((t,e,n)=>t+e.height+i(n)+s(n),0),a=Math.max(...t.map(t=>t.width)),o=this.getInnerRadius(),r=Math.sqrt(Math.pow(a/2,2)+Math.pow(n/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let e=0,a=-n/2;e<t.length;e++){const n=t[e].height+a+i(e);l.push(n),a=n+s(e)}this.innerLabelsSelection.each((t,e,i)=>{t.y=l[i],t.visible=r})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}getDatumLegendName(t){const{angleKey:e,calloutLabelKey:i,sectorLabelKey:s,legendItemKey:n}=this.properties,{sectorLabel:a,calloutLabel:o,legendItem:r}=t;return n&&void 0!==r?r.text:i&&i!==e&&void 0!==(null==o?void 0:o.text)?o.text:s&&s!==e&&void 0!==(null==a?void 0:a.text)?a.text:void 0}pickNodeClosestDatum(t){return Ng(this,t)}getTooltipHtml(t){var e;if(!this.properties.isValid())return el;const{datum:i,angleValue:s,sectorFormat:{fill:n},itemId:a}=t,o=Eu(null==(e=this.properties.title)?void 0:e.text),r=Vt(s)?Hs(s):String(s),l=this.getDatumLegendName(t);return this.properties.tooltip.toTooltipHtml({title:null!=o?o:l,content:o&&l?`${l}: ${r}`:r,backgroundColor:n},{datum:i,itemId:a,title:o,color:n,seriesId:this.id,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})}getLegendData(t){var e,i,s,n,a;const{visible:o,processedData:r,dataModel:l}=this;if(!l||!(null==r?void 0:r.data.length)||!this.properties.isValid()||"category"!==t)return[];const{angleKey:h,calloutLabelKey:c,sectorLabelKey:d,legendItemKey:u}=this.properties;if(!(u||c&&c!==h||d&&d!==h))return[];const{calloutLabelIdx:p,sectorLabelIdx:g,legendItemIdx:m}=this.getProcessedDataIndexes(l),y=(null==(e=this.properties.title)?void 0:e.showInLegend)&&this.properties.title.text,f=[];for(let t=0;t<r.data.length;t++){const{datum:e,values:l}=r.data[t],x=[];y&&x.push(y);const b=this.getLabels(e,2*Math.PI,2*Math.PI,!1,l[p],l[g],l[m]);if(u&&void 0!==b.legendItem?x.push(b.legendItem.text):c&&c!==h&&void 0!==(null==(i=b.calloutLabel)?void 0:i.text)?x.push(null==(s=b.calloutLabel)?void 0:s.text):d&&d!==h&&void 0!==(null==(n=b.sectorLabel)?void 0:n.text)&&x.push(null==(a=b.sectorLabel)?void 0:a.text),0===x.length)continue;const v=this.getSectorFormat(e,t,!1);f.push({legendType:"category",id:this.id,itemId:t,seriesId:this.id,enabled:o&&this.seriesItemEnabled[t],label:{text:x.join(" - ")},marker:{fill:v.fill,stroke:v.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},legendItemName:null!=u?e[u]:void 0})}return f}onLegendItemClick(t){const{enabled:e,itemId:i,series:s,legendItemName:n}=t;s.id===this.id?this.toggleSeriesItem(i,e):null!=n&&this.toggleOtherSeriesItems(n,e)}toggleSeriesItem(t,e){this.seriesItemEnabled[t]=e,this.nodeDataRefresh=!0}toggleOtherSeriesItems(t,e){var i;if(!this.properties.legendItemKey||!this.dataModel)return;const s=this.dataModel.resolveProcessedDataIndexById(this,"legendItemValue");null==(i=this.processedData)||i.data.forEach(({values:i},n)=>{i[s]===t&&this.toggleSeriesItem(n,e)})}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=Ag(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Tn(this.id,"nodes",e,[this.itemSelection,this.highlightSelection],i.nodes),Tn(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),Pu(this,"callout",e,this.calloutLabelSelection),Pu(this,"sector",e,this.sectorLabelSelection),Pu(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){var t,e,i,s,n,a;const{itemSelection:o,highlightSelection:r,processedData:l,radiusScale:h,previousRadiusScale:c}=this,{animationManager:d}=this.ctx,u=null==(t=null==l?void 0:l.reduced)?void 0:t.diff;this.ctx.animationManager.stopByAnimationGroupId(this.id);const p=0===(null!=(e=null==u?void 0:u.moved.size)?e:0),g=(null!=(i=null==l?void 0:l.defs.keys.length)?i:0)>0,m=null==(a=null==(n=null==(s=null==l?void 0:l.reduced)?void 0:s.animationValidation)?void 0:n.uniqueKeys)||a;p&&g&&m||this.ctx.animationManager.skipCurrentBatch();const y=Ag(!1,this.properties.rotation,h,c);Tn(this.id,"nodes",d,[o,r],y.nodes,(t,e)=>this.getDatumId(e),u),Tn(this.id,"innerCircle",d,[this.innerCircleSelection],y.innerCircle),Pu(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Pu(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Pu(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,radiusScale:i,previousRadiusScale:s}=this,{animationManager:n}=this.ctx,a=Ag(!1,this.properties.rotation,i,s);Tn(this.id,"nodes",n,[t,e],a.nodes),Tn(this.id,"innerCircle",n,[this.innerCircleSelection],a.innerCircle),Bu(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Bu(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Bu(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumIdFromData(t){var e,i,s;const{calloutLabelKey:n,sectorLabelKey:a,legendItemKey:o}=this.properties;if(null==(s=null==(i=null==(e=this.processedData)?void 0:e.reduced)?void 0:i.animationValidation)?void 0:s.uniqueKeys)return o?t[o]:n?t[n]:a?t[a]:void 0}getDatumId(t){const{index:e}=t,i=this.getDatumIdFromData(t.datum);return null!=i?String(i):`${e}`}onDataChange(){var t;const{data:e,seriesItemEnabled:i}=this;this.seriesItemEnabled=null!=(t=null==e?void 0:e.map((t,e)=>{var s;return null==(s=i[e])||s}))?t:[]}computeFocusBounds(t){return Og(this,t)}};Pg.className="DonutSeries",Pg.type="donut";var Bg={series:{__extends__:Ve,title:{enabled:!0,fontStyle:void 0,fontWeight:"normal",fontSize:14,fontFamily:Ye,color:Xe,spacing:5},calloutLabel:{enabled:!0,fontStyle:void 0,fontWeight:void 0,fontSize:12,fontFamily:Ye,color:$e,offset:3,minAngle:0},sectorLabel:{enabled:!0,fontStyle:void 0,fontWeight:"normal",fontSize:12,fontFamily:Ye,color:Ue,positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2},fillOpacity:1,strokeOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,rotation:0,shadow:{enabled:!1,color:ti,xOffset:3,yOffset:3,blur:5},innerLabels:{fontStyle:void 0,fontWeight:void 0,fontSize:12,fontFamily:Ye,color:$e,margin:2},__BACKGROUND_COLOR_DO_NOT_USE:Je}},Fg=({takeColors:t,colorsCount:e,userPalette:i})=>{const{fills:s,strokes:n}=t(e);return{fills:s,strokes:i?n:[],calloutLine:{colors:n}}},zg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",instanceConstructor:Pg,themeTemplate:Bg,paletteFactory:Fg},Gg=class extends ol{constructor(){super(...arguments),this.showInLegend=!1}};b([$n(Qn)],Gg.prototype,"showInLegend",2);var _g=class extends Go{set(t,e){return super.set(t)}};b([Os("Use a Donut Series instead"),$n(ta,{optional:!0})],_g.prototype,"text",2),b([Os("Use a Donut Series instead"),$n(ea,{optional:!0})],_g.prototype,"margin",2);var jg=class extends fe{};b([Os("Use a Donut Series instead"),$n(ma,{optional:!0})],jg.prototype,"fill",2),b([Os("Use a Donut Series instead"),$n(na,{optional:!0})],jg.prototype,"fillOpacity",2);var Wg=class extends Go{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};b([$n(sa)],Wg.prototype,"offset",2),b([$n(aa)],Wg.prototype,"minAngle",2),b([$n(sa)],Wg.prototype,"minSpacing",2),b([$n(sa)],Wg.prototype,"maxCollisionOffset",2),b([$n(Qn)],Wg.prototype,"avoidCollisions",2);var Vg=class extends Go{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};b([$n(ea)],Vg.prototype,"positionOffset",2),b([$n(na)],Vg.prototype,"positionRatio",2);var Kg=class extends fe{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};b([$n(ya,{optional:!0})],Kg.prototype,"colors",2),b([$n(sa)],Kg.prototype,"length",2),b([$n(sa)],Kg.prototype,"strokeWidth",2);var Yg=class extends Gd{constructor(){super(...arguments),this.fills=Object.values(Be),this.strokes=Object.values(Fe),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=void 0,this.innerLabels=new xe(_g),this.title=new Gg,this.innerCircle=new jg,this.shadow=new Gu,this.calloutLabel=new Wg,this.sectorLabel=new Vg,this.calloutLine=new Kg,this.tooltip=new Vu,this.__BACKGROUND_COLOR_DO_NOT_USE=void 0}};b([$n(ta)],Yg.prototype,"angleKey",2),b([$n(ta,{optional:!0})],Yg.prototype,"angleName",2),b([$n(ta,{optional:!0})],Yg.prototype,"radiusKey",2),b([$n(ta,{optional:!0})],Yg.prototype,"radiusName",2),b([$n(sa,{optional:!0})],Yg.prototype,"radiusMin",2),b([$n(sa,{optional:!0})],Yg.prototype,"radiusMax",2),b([$n(ta,{optional:!0})],Yg.prototype,"calloutLabelKey",2),b([$n(ta,{optional:!0})],Yg.prototype,"calloutLabelName",2),b([$n(ta,{optional:!0})],Yg.prototype,"sectorLabelKey",2),b([$n(ta,{optional:!0})],Yg.prototype,"sectorLabelName",2),b([$n(ta,{optional:!0})],Yg.prototype,"legendItemKey",2),b([$n(ya)],Yg.prototype,"fills",2),b([$n(ya)],Yg.prototype,"strokes",2),b([$n(na)],Yg.prototype,"fillOpacity",2),b([$n(na)],Yg.prototype,"strokeOpacity",2),b([$n(Da)],Yg.prototype,"lineDash",2),b([$n(sa)],Yg.prototype,"lineDashOffset",2),b([$n(sa)],Yg.prototype,"cornerRadius",2),b([$n(Jn,{optional:!0})],Yg.prototype,"formatter",2),b([$n(aa)],Yg.prototype,"rotation",2),b([$n(ea)],Yg.prototype,"outerRadiusOffset",2),b([$n(na)],Yg.prototype,"outerRadiusRatio",2),b([Os("Use a Donut Series instead"),$n(ea,{optional:!0})],Yg.prototype,"innerRadiusOffset",2),b([Os("Use a Donut Series instead"),$n(na,{optional:!0})],Yg.prototype,"innerRadiusRatio",2),b([$n(sa)],Yg.prototype,"strokeWidth",2),b([$n(sa,{optional:!0})],Yg.prototype,"sectorSpacing",2),b([$n(Sa)],Yg.prototype,"innerLabels",2),b([$n(Zn)],Yg.prototype,"title",2),b([$n(Zn)],Yg.prototype,"innerCircle",2),b([$n(Zn)],Yg.prototype,"shadow",2),b([$n(Zn)],Yg.prototype,"calloutLabel",2),b([$n(Zn)],Yg.prototype,"sectorLabel",2),b([$n(Zn)],Yg.prototype,"calloutLine",2),b([$n(Zn)],Yg.prototype,"tooltip",2),b([$n(ta,{optional:!0})],Yg.prototype,"__BACKGROUND_COLOR_DO_NOT_USE",2);var $g=class extends Uc{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}},Hg=class extends Rg{constructor(t){super({moduleCtx:t,pickModes:[0],useLabelLayer:!0,animationResetFns:{item:Tg,label:Fu}}),this.properties=new Yg,this.previousRadiusScale=new Zd,this.radiusScale=new Zd,this.backgroundGroup=this.rootGroup.appendChild(new ko({name:`${this.id}-background`,layer:!0,zIndex:0})),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new ko({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new fd),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new fd),this.innerCircleGroup=this.backgroundGroup.appendChild(new ko({name:`${this.id}-innerCircle`})),this.seriesItemEnabled=[],this.surroundingRadius=void 0,this.NodeEvent=$g,this.angleScale=new Zd,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2);const e=new ko({name:"pieCalloutLabels"}),i=new ko({name:"pieSectorLabels"}),s=new ko({name:"innerLabels"});this.labelGroup.append(e),this.labelGroup.append(i),this.labelGroup.append(s),this.calloutLabelSelection=Er.select(e,ko),this.sectorLabelSelection=Er.select(i,Bo),this.innerLabelsSelection=Er.select(s,Bo),this.innerCircleSelection=Er.select(this.innerCircleGroup,fd)}addChartEventListeners(){var t;this.destroyFns.push(null==(t=this.ctx.chartEventManager)?void 0:t.addListener("legend-item-click",t=>this.onLegendItemClick(t)))}get visible(){return super.visible&&(0===this.seriesItemEnabled.length||this.seriesItemEnabled.some(t=>t))}nodeFactory(){return new Sg}getSeriesDomain(t){return"x"===t?this.angleScale.domain:this.radiusScale.domain}processData(t){return S(this,null,function*(){var e,i,s,n,a;if(null==this.data||!this.properties.isValid())return;let{data:o}=this;const{visible:r,seriesItemEnabled:l}=this,{angleKey:h,radiusKey:c,calloutLabelKey:d,sectorLabelKey:u,legendItemKey:p}=this.properties,g=!this.ctx.animationManager.isSkipped(),f=[],x=[];p?f.push(Wc(p,"band",{id:"legendItemKey"})):d?f.push(Wc(d,"band",{id:"calloutLabelKey"})):u&&f.push(Wc(u,"band",{id:"sectorLabelKey"}));const b=this.radiusScale.type,v=this.radiusScale.type;c&&x.push(Kc(c,{id:"radiusValue",min:null!=(e=this.properties.radiusMin)?e:0,max:this.properties.radiusMax}),Vc(c,b,{id:"radiusRaw"}),Tc({id:"radiusValue"},[0,1],1,null!=(i=this.properties.radiusMin)?i:0,this.properties.radiusMax)),d&&x.push(Vc(d,"band",{id:"calloutLabelValue"})),u&&x.push(Vc(u,"band",{id:"sectorLabelValue"})),p&&x.push(Vc(p,"band",{id:"legendItemValue"})),g&&this.processedData&&f.length>0&&x.push(Pc(this.processedData)),x.push(Nc()),o=o.map((t,e)=>r&&l[e]?t:y(m({},t),{[h]:0})),yield this.requestDataModel(t,o,{props:[...f,Yc(h,v,{id:"angleValue",onlyPositive:!0}),Vc(h,v,{id:"angleRaw"}),Tc({id:"angleValue"},[0,1],0,0),...x]});for(const t of null!=(a=null==(n=null==(s=this.processedData)?void 0:s.defs)?void 0:n.values)?a:[]){const{id:e,missing:i,property:s}=t,n=Xh(this,i);"angleRaw"!==e&&n>0&&E.warnOnce(`no value was found for the key '${String(s)}' on ${n} data element${n>1?"s":""}`)}this.animationState.transition("updateData")})}maybeRefreshNodeData(){return S(this,null,function*(){var t;if(!this.nodeDataRefresh)return;const{nodeData:e=[]}=null!=(t=yield this.createNodeData())?t:{};this.nodeData=e,this.nodeDataRefresh=!1})}getProcessedDataIndexes(t){return{angleIdx:t.resolveProcessedDataIndexById(this,"angleValue"),radiusIdx:this.properties.radiusKey?t.resolveProcessedDataIndexById(this,"radiusValue"):-1,calloutLabelIdx:this.properties.calloutLabelKey?t.resolveProcessedDataIndexById(this,"calloutLabelValue"):-1,sectorLabelIdx:this.properties.sectorLabelKey?t.resolveProcessedDataIndexById(this,"sectorLabelValue"):-1,legendItemIdx:this.properties.legendItemKey?t.resolveProcessedDataIndexById(this,"legendItemValue"):-1}}createNodeData(){return S(this,null,function*(){const{id:t,processedData:e,dataModel:i,angleScale:s}=this,{rotation:n}=this.properties;if(!e||!i||"ungrouped"!==e.type)return;const{angleIdx:a,radiusIdx:o,calloutLabelIdx:r,sectorLabelIdx:l,legendItemIdx:h}=this.getProcessedDataIndexes(i);let c=0,d=0;const u=e.data.map((t,e)=>{var i;const{datum:u,values:p}=t,g=p[a],y=s.convert(c)+zn(n);c=g,d+=g;const f=s.convert(c)+zn(n),x=Math.abs(f-y),b=y+x/2,v=p[a+1],S=o>=0&&null!=(i=p[o])?i:1,M=o>=0?p[o+1]:void 0,k=h>=0?p[h]:void 0,D=this.getLabels(u,b,x,!0,p[r],p[l],k),w=this.getSectorFormat(u,e,!1);return m({itemId:e,series:this,datum:u,index:e,angleValue:v,midAngle:b,midCos:Math.cos(b),midSin:Math.sin(b),startAngle:y,endAngle:f,sectorFormat:w,radiusValue:M,radius:S,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(S),0),legendItemValue:k},D)});this.zerosumOuterRing.visible=0===d;const{innerRadiusRatio:p=1}=this.properties;return this.zerosumInnerRing.visible=0===d&&1!==p&&p>0,{itemId:t,nodeData:u,labelData:u}})}getLabels(t,e,i,s,n,a,o){const{calloutLabel:r,sectorLabel:l,legendItemKey:h}=this.properties,c=!s||r.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!c&&!d&&!h)return{};const u={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 c&&i>zn(r.minAngle)&&(p.calloutLabel=y(m({},this.getTextAlignment(e)),{text:this.getLabelText(r,y(m({},u),{value:n})),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0})),d&&(p.sectorLabel={text:this.getLabelText(l,y(m({},u),{value:a}))}),null!=h&&null!=o&&(p.legendItem={key:h,text:o}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Bn(t)- -.75*Math.PI;return e[Us(Math.floor(i/(Math.PI/2)),e.length)]}getSectorFormat(t,e,i){var s,n,a,o,r;const{callbackCache:l,highlightManager:h}=this.ctx,{angleKey:c,radiusKey:d,fills:u,strokes:p,formatter:g,sectorSpacing:m,__BACKGROUND_COLOR_DO_NOT_USE:y}=this.properties,f=h.getActiveHighlight(),x=i&&(null==f?void 0:f.series)===this&&e===f.itemId;let b=p[e%p.length];null!=m&&(null!=b||(b=y));const{fill:v,fillOpacity:S,stroke:M,strokeWidth:k,strokeOpacity:D}=Xt(x&&this.properties.highlightStyle.item,{fill:u.length>0?u[e%u.length]:void 0,fillOpacity:this.properties.fillOpacity,stroke:b,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()});let w;return g&&(w=l.call(g,{datum:t,angleKey:c,radiusKey:d,fill:v,stroke:M,fills:u,strokes:p,strokeWidth:k,highlighted:x,seriesId:this.id})),{fill:null!=(s=null==w?void 0:w.fill)?s:v,fillOpacity:null!=(n=null==w?void 0:w.fillOpacity)?n:S,stroke:null!=(a=null==w?void 0:w.stroke)?a:M,strokeWidth:null!=(o=null==w?void 0:w.strokeWidth)?o:k,strokeOpacity:null!=(r=null==w?void 0:w.strokeOpacity)?r:D}}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(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(t){const e=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e),this.nodeData=this.nodeData.map(t=>{var e=t,{radius:i}=e,s=f(e,["radius"]);return y(m({},s),{radius:i,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(i),0)})})}getTitleTranslationY(){var t,e;const i=Math.max(0,this.radiusScale.range[1]);return 0===i?NaN:-i-(2+(null!=(e=null==(t=this.properties.title)?void 0:t.spacing)?e:0))-Math.max(0,-i)}update(t){return S(this,arguments,function*({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:null==t?void 0:t.width,seriesRectHeight:null==t?void 0:t.height},s=null!=Se(this.nodeDataDependencies,i);if(s&&(this._nodeDataDependencies=i),yield 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 t=this.getTitleTranslationY(),i=e.node.computeBBox();e.node.visible=e.enabled&&isFinite(t)&&!this.bboxIntersectsSurroundingSeries(i,0,t),e.node.translationY=isFinite(t)?t:0}for(const t of[this.zerosumInnerRing,this.zerosumOuterRing])t.fillOpacity=0,t.stroke=this.properties.calloutLabel.color,t.strokeWidth=1,t.strokeOpacity=1;this.updateNodeMidPoint(),yield this.updateSelections(),yield this.updateNodes(t)})}updateTitleNodes(){var t,e;const{oldTitle:i}=this,{title:s}=this.properties;i!==s&&(i&&(null==(t=this.labelGroup)||t.removeChild(i.node)),s&&(s.node.textBaseline="bottom",null==(e=this.labelGroup)||e.appendChild(s.node)),this.oldTitle=s)}updateNodeMidPoint(){this.nodeData.forEach(t=>{const e=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,e),y:t.midSin*Math.max(0,e)}})}updateSelections(){return S(this,null,function*(){yield this.updateGroupSelection(),this.updateInnerCircleSelection()})}updateGroupSelection(){return S(this,null,function*(){const{itemSelection:t,highlightSelection:e,calloutLabelSelection:i,sectorLabelSelection:s,innerLabelsSelection:n}=this,a=(t,e)=>{let i=this.nodeData;e&&(i=i.map(t=>y(m({},t),{sectorFormat:m({},t.sectorFormat)}))),t.update(i,void 0,t=>this.getDatumId(t)),this.ctx.animationManager.isSkipped()&&t.cleanup()};a(t,!1),a(e,!0),i.update(this.nodeData,t=>{const e=new zr;e.tag=0,e.pointerEvents=1,t.appendChild(e);const i=new Bo;i.tag=1,i.pointerEvents=1,t.appendChild(i)}),s.update(this.nodeData,t=>{t.pointerEvents=1}),n.update(this.properties.innerLabels,t=>{t.pointerEvents=1})})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const t=Math.min(i,this.getOuterRadius()),s=1;e=Math.ceil(2*t+s)}const s=t?[{radius:e}]:[];this.innerCircleSelection.update(s)}updateNodes(t){return S(this,null,function*(){const e=this.ctx.highlightManager.getActiveHighlight(),i=this.visible&&this.seriesItemEnabled.indexOf(!0)>=0;this.rootGroup.visible=i,this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&(null==e?void 0:e.series)===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((t,{radius:e})=>{var i,s;t.setProperties({fill:null==(i=this.properties.innerCircle)?void 0:i.fill,opacity:null==(s=this.properties.innerCircle)?void 0:s.fillOpacity,size:e})});const s=(t,e,i,s)=>{const n=this.getSectorFormat(e.datum,e.itemId,s);e.sectorFormat.fill=n.fill,e.sectorFormat.stroke=n.stroke;const a=this.ctx.animationManager.isSkipped();a&&(t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius),(s||a)&&(t.fill=n.fill,t.stroke=n.stroke),t.strokeWidth=n.strokeWidth,t.fillOpacity=n.fillOpacity,t.strokeOpacity=this.properties.strokeOpacity,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset,t.fillShadow=this.properties.shadow,t.cornerRadius=this.properties.cornerRadius,t.inset=null!=this.properties.sectorSpacing?(this.properties.sectorSpacing+(null!=n.stroke?n.strokeWidth:0))/2:0,t.lineJoin=null!=this.properties.sectorSpacing?"miter":"round"};this.itemSelection.each((t,e,i)=>s(t,e,0,!1)),this.highlightSelection.each((t,i,n)=>{const a=(null==e?void 0:e.series)===this&&t.datum.itemId===e.itemId;s(t,i,0,!0),t.visible=a}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")})}updateCalloutLineNodes(){var t;const{calloutLine:e}=this.properties,i=e.length,s=e.strokeWidth,n=null!=(t=e.colors)?t:this.properties.strokes,{offset:a}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((t,e)=>{var o;const r=t.datum,{calloutLabel:l,outerRadius:h}=r;if((null==l?void 0:l.text)&&!l.hidden&&0!==h){t.visible=!0,t.strokeWidth=s,t.stroke=n[e%n.length],t.fill=void 0;const c=r.midCos*h,d=r.midSin*h;let u=r.midCos*(h+i),p=r.midSin*(h+i);if((null!=(o=l.collisionTextAlign)?o:0!==l.collisionOffsetY)&&null!=l.box){const t=l.box;let e=u,i=p;u<t.x?e=t.x:u>t.x+t.width&&(e=t.x+t.width),p<t.y?i=t.y:p>t.y+t.height&&(i=t.y+t.height);const s=e-u,n=i-p,o=Math.sqrt(Math.pow(s,2)+Math.pow(n,2)),r=o-a;r>0&&(u+=s*r/o,p+=n*r/o)}t.x1=c,t.y1=d,t.x2=u,t.y2=p}else t.visible=!1})}getLabelOverflow(t,e,i){const s=i.x-this.centerX,n=i.x+i.width-this.centerX,a=i.y-this.centerY,o=i.y+i.height-this.centerY;let r=1;e.x+1<s?r=(e.x+e.width-s)/e.width:e.x+e.width-1>n&&(r=(n-e.x)/e.width);const l=e.y+1<a||e.y+e.height-1>o;return{textLength:1===r?t.length:Math.floor(t.length*r)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(e)}}bboxIntersectsSurroundingSeries(t,e=0,i=0){const{surroundingRadius:s}=this;if(null==s)return!1;const n=[{x:t.x+e,y:t.y+i},{x:t.x+t.width+e,y:t.y+i},{x:t.x+t.width+e,y:t.y+t.height+i},{x:t.x+e,y:t.y+t.height+i}],a=p(s,2);return n.some(t=>p(t.x,2)+p(t.y,2)>a)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,a=t.convert(0),o=this.nodeData,r=this.nodeData.filter(t=>{return!(!(e=t).calloutLabel||0===e.outerRadius);var e});if(r.forEach(t=>{const e=t.calloutLabel;null!=e&&(e.hidden=!1,e.collisionTextAlign=void 0,e.collisionOffsetY=0)}),r.length<=1)return;const l=r.filter(t=>t.midCos<0).sort((t,e)=>t.midSin-e.midSin),h=r.filter(t=>t.midCos>=0).sort((t,e)=>t.midSin-e.midSin),c=r.filter(t=>{var e;return t.midSin<0&&"center"===(null==(e=t.calloutLabel)?void 0:e.textAlign)}).sort((t,e)=>t.midCos-e.midCos),d=r.filter(t=>{var e;return t.midSin>=0&&"center"===(null==(e=t.calloutLabel)?void 0:e.textAlign)}).sort((t,e)=>t.midCos-e.midCos),u=new Bo,p=t=>{var e;const n=t.calloutLabel;if(null==n)return new Js(0,0,0,0);const a=t.outerRadius+i.length+s,o=t.midCos*a,r=t.midSin*a+n.collisionOffsetY;return u.text=n.text,u.x=o,u.y=r,u.setFont(this.properties.calloutLabel),u.setAlign({textAlign:null!=(e=n.collisionTextAlign)?e:n.textAlign,textBaseline:n.textBaseline}),u.computeBBox()},g=(t,e,i)=>{const s=p(t).grow(n/2),a=p(e).grow(n/2);if(s.x<a.x+a.width&&s.x+s.width>a.x&&("to-top"===i?s.y<a.y+a.height:s.y+s.height>a.y)){const t="to-top"===i?s.y-a.y-a.height:s.y+s.height-a.y;e.calloutLabel.collisionOffsetY=t}},m=t=>{const e=t.slice().sort((t,e)=>Math.abs(t.midSin)-Math.abs(e.midSin))[0],i=t.indexOf(e);for(let e=i-1;e>=0;e--){const i=t[e+1],s=t[e];g(i,s,"to-top")}for(let e=i+1;e<t.length;e++){const i=t[e-1],s=t[e];g(i,s,"to-bottom")}},y=t=>{const e=r.some(t=>0!==t.calloutLabel.collisionOffsetY),i=t.map(t=>p(t)),s=i.map(t=>t.clone().grow(n/2));let l=!1;for(let e=0;e<s.length&&!l;e++){const i=s[e];for(let n=e+1;n<t.length;n++){const t=s[n];if(i.collidesBBox(t)){l=!0;break}}}const h=o.map(t=>{const{startAngle:e,endAngle:i,outerRadius:s}=t;return{startAngle:e,endAngle:i,innerRadius:a,outerRadius:s}}),c=i.some(t=>h.some(e=>gg(t,e)));(l||e||c)&&t.filter(t=>"center"===t.calloutLabel.textAlign).forEach(t=>{const e=t.calloutLabel;t.midCos<0?e.collisionTextAlign="right":t.midCos>0?e.collisionTextAlign="left":e.collisionTextAlign="center"})};m(l),m(h),y(c),y(d)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,color:o}=i,r=new Bo;this.calloutLabelSelection.selectByTag(1).forEach(s=>{var l;const{datum:h}=s,c=h.calloutLabel,d=e.convert(h.radius),u=Math.max(0,d);if(!(null==c?void 0:c.text)||0===u||c.hidden)return void(s.visible=!1);const p=u+n+a,g=h.midCos*p,m=h.midSin*p+c.collisionOffsetY,y={textAlign:null!=(l=c.collisionTextAlign)?l:c.textAlign,textBaseline:c.textBaseline};r.text=c.text,r.x=g,r.y=m,r.setFont(this.properties.calloutLabel),r.setAlign(y);const f=r.computeBBox();let x=c.text,b=!0;if(i.avoidCollisions){const{textLength:e,hasVerticalOverflow:i}=this.getLabelOverflow(c.text,f,t);x=c.text.length===e?c.text:`${c.text.substring(0,e)}…`,b=!i}s.text=x,s.x=g,s.y=m,s.setFont(this.properties.calloutLabel),s.setAlign(y),s.fill=o,s.visible=b})}computeLabelsBBox(t,e){return S(this,null,function*(){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,maxCollisionOffset:o,minSpacing:r}=i;if(!i.avoidCollisions)return null;yield this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],h=new Bo;let c;const{title:d}=this.properties;if((null==d?void 0:d.text)&&d.enabled){const t=this.getTitleTranslationY();isFinite(t)&&(h.text=d.text,h.x=0,h.y=t,h.setFont(d),h.setAlign({textBaseline:"bottom",textAlign:"center"}),c=h.computeBBox(),l.push(c))}return this.nodeData.forEach(i=>{var s;const d=i.calloutLabel;if(!d||0===i.outerRadius)return null;const u=i.outerRadius+n+a,p=i.midCos*u,g=i.midSin*u+d.collisionOffsetY;h.text=d.text,h.x=p,h.y=g,h.setFont(this.properties.calloutLabel),h.setAlign({textAlign:null!=(s=d.collisionTextAlign)?s:d.textAlign,textBaseline:d.textBaseline});const m=h.computeBBox();if(d.box=m,Math.abs(d.collisionOffsetY)>o)d.hidden=!0;else{if(c){const t=e.y-this.centerY,i=new Js(c.x-r,t,c.width+2*r,c.y+c.height+r-t);if(m.collidesBBox(i))return void(d.hidden=!0)}if(t.hideWhenNecessary){const{textLength:t,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:s}=this.getLabelOverflow(d.text,m,e),n=d.text.length>2&&t<2;if(i||n||s)return void(d.hidden=!0)}d.hidden=!1,l.push(m)}}),0===l.length?null:Js.merge(l)})}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:a,positionOffset:o,positionRatio:r,color:l}=this.properties.sectorLabel,h=e>0,c=1===this.seriesItemEnabled.filter(Boolean).length;this.sectorLabelSelection.each((t,d)=>{const{sectorLabel:u,outerRadius:p}=d;let g=!1;if(u&&0!==p){const m=e*(1-r)+p*r+o;t.fill=l,t.fontStyle=s,t.fontWeight=n,t.fontSize=i,t.fontFamily=a,t.text=u.text,!h&&c?(t.x=0,t.y=0):(t.x=d.midCos*m,t.y=d.midSin*m),t.textAlign="center",t.textBaseline="middle";const y=t.computeBBox(),f=[[y.x,y.y],[y.x+y.width,y.y],[y.x+y.width,y.y+y.height],[y.x,y.y+y.height]],{startAngle:x,endAngle:b}=d,v={startAngle:x,endAngle:b,innerRadius:e,outerRadius:p};f.every(([t,e])=>ug(t,e,v))&&(g=!0)}t.visible=g})}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((i,s)=>{const{fontStyle:n,fontWeight:a,fontSize:o,fontFamily:r,color:l,margin:h=2}=s;i.fontStyle=n,i.fontWeight=a,i.fontSize=o,i.fontFamily=r,i.text=s.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",t.push(i.computeBBox()),e.push(h)});const i=t=>0===t?0:e[t],s=t=>t===e.length-1?0:e[t],n=t.reduce((t,e,n)=>t+e.height+i(n)+s(n),0),a=Math.max(...t.map(t=>t.width)),o=this.getInnerRadius(),r=Math.sqrt(Math.pow(a/2,2)+Math.pow(n/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let e=0,a=-n/2;e<t.length;e++){const n=t[e].height+a+i(e);l.push(n),a=n+s(e)}this.innerLabelsSelection.each((t,e,i)=>{t.y=l[i],t.visible=r})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}getDatumLegendName(t){const{angleKey:e,calloutLabelKey:i,sectorLabelKey:s,legendItemKey:n}=this.properties,{sectorLabel:a,calloutLabel:o,legendItem:r}=t;return n&&void 0!==r?r.text:i&&i!==e&&void 0!==(null==o?void 0:o.text)?o.text:s&&s!==e&&void 0!==(null==a?void 0:a.text)?a.text:void 0}pickNodeClosestDatum(t){return Ng(this,t)}getTooltipHtml(t){var e;if(!this.properties.isValid())return el;const{datum:i,angleValue:s,sectorFormat:{fill:n},itemId:a}=t,o=Eu(null==(e=this.properties.title)?void 0:e.text),r=Vt(s)?Hs(s):String(s),l=this.getDatumLegendName(t);return this.properties.tooltip.toTooltipHtml({title:null!=o?o:l,content:o&&l?`${l}: ${r}`:r,backgroundColor:n},{datum:i,itemId:a,title:o,color:n,seriesId:this.id,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})}getLegendData(t){var e,i,s,n,a;const{visible:o,processedData:r,dataModel:l}=this;if(!l||!(null==r?void 0:r.data.length)||"category"!==t)return[];const{angleKey:h,calloutLabelKey:c,sectorLabelKey:d,legendItemKey:u}=this.properties;if(!(u||c&&c!==h||d&&d!==h))return[];const{calloutLabelIdx:p,sectorLabelIdx:g,legendItemIdx:m}=this.getProcessedDataIndexes(l),y=(null==(e=this.properties.title)?void 0:e.showInLegend)&&this.properties.title.text,f=[];for(let t=0;t<r.data.length;t++){const{datum:e,values:l}=r.data[t],x=[];y&&x.push(y);const b=this.getLabels(e,2*Math.PI,2*Math.PI,!1,l[p],l[g],l[m]);if(u&&void 0!==b.legendItem?x.push(b.legendItem.text):c&&c!==h&&void 0!==(null==(i=b.calloutLabel)?void 0:i.text)?x.push(null==(s=b.calloutLabel)?void 0:s.text):d&&d!==h&&void 0!==(null==(n=b.sectorLabel)?void 0:n.text)&&x.push(null==(a=b.sectorLabel)?void 0:a.text),0===x.length)continue;const v=this.getSectorFormat(e,t,!1);f.push({legendType:"category",id:this.id,itemId:t,seriesId:this.id,enabled:o&&this.seriesItemEnabled[t],label:{text:x.join(" - ")},marker:{fill:v.fill,stroke:v.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},legendItemName:null!=u?e[u]:void 0})}return f}onLegendItemClick(t){const{enabled:e,itemId:i,series:s,legendItemName:n}=t;s.id===this.id?this.toggleSeriesItem(i,e):null!=n&&this.toggleOtherSeriesItems(n,e)}toggleSeriesItem(t,e){this.seriesItemEnabled[t]=e,this.nodeDataRefresh=!0}toggleOtherSeriesItems(t,e){var i;if(!this.properties.legendItemKey||!this.dataModel)return;const s=this.dataModel.resolveProcessedDataIndexById(this,"legendItemValue");null==(i=this.processedData)||i.data.forEach(({values:i},n)=>{i[s]===t&&this.toggleSeriesItem(n,e)})}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=Ag(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Tn(this.id,"nodes",e,[this.itemSelection,this.highlightSelection],i.nodes),Tn(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),Pu(this,"callout",e,this.calloutLabelSelection),Pu(this,"sector",e,this.sectorLabelSelection),Pu(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){var t,e,i,s,n,a;const{itemSelection:o,highlightSelection:r,processedData:l,radiusScale:h,previousRadiusScale:c}=this,{animationManager:d}=this.ctx,u=null==(t=null==l?void 0:l.reduced)?void 0:t.diff;this.ctx.animationManager.stopByAnimationGroupId(this.id);const p=0===(null!=(e=null==u?void 0:u.moved.size)?e:0),g=(null!=(i=null==l?void 0:l.defs.keys.length)?i:0)>0,m=null==(a=null==(n=null==(s=null==l?void 0:l.reduced)?void 0:s.animationValidation)?void 0:n.uniqueKeys)||a;p&&g&&m||this.ctx.animationManager.skipCurrentBatch();const y=Ag(!1,this.properties.rotation,h,c);Tn(this.id,"nodes",d,[o,r],y.nodes,(t,e)=>this.getDatumId(e),u),Tn(this.id,"innerCircle",d,[this.innerCircleSelection],y.innerCircle),Pu(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Pu(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Pu(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,radiusScale:i,previousRadiusScale:s}=this,{animationManager:n}=this.ctx,a=Ag(!1,this.properties.rotation,i,s);Tn(this.id,"nodes",n,[t,e],a.nodes),Tn(this.id,"innerCircle",n,[this.innerCircleSelection],a.innerCircle),Bu(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Bu(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Bu(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumIdFromData(t){var e,i,s;const{calloutLabelKey:n,sectorLabelKey:a,legendItemKey:o}=this.properties;if(null==(s=null==(i=null==(e=this.processedData)?void 0:e.reduced)?void 0:i.animationValidation)?void 0:s.uniqueKeys)return o?t[o]:n?t[n]:a?t[a]:void 0}getDatumId(t){const{index:e}=t,i=this.getDatumIdFromData(t.datum);return null!=i?String(i):`${e}`}onDataChange(){var t;const{data:e,seriesItemEnabled:i}=this;this.seriesItemEnabled=null!=(t=null==e?void 0:e.map((t,e)=>{var s;return null==(s=i[e])||s}))?t:[]}computeFocusBounds(t){return Og(this,t)}};Hg.className="PieSeries",Hg.type="pie";var Ug={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",instanceConstructor:Hg,themeTemplate:Bg,paletteFactory:Fg},Xg=["start","center","end"],Zg=["annotations","ranges","zoom"],qg=(t=>(t.Top="top",t.Right="right",t.Bottom="bottom",t.Left="left",t.FloatingTop="floating-top",t.FloatingBottom="floating-bottom",t))(qg||{}),Qg=Object.values(qg),Jg=class extends fe{constructor(t,e){super(),this.onChange=t,this.onButtonsChange=e,this.align="start",this.position="top"}};b([Zr(t=>{t.onChange(t.enabled)}),$n(Qn)],Jg.prototype,"enabled",2),b([Zr(t=>{t.onChange(t.enabled)}),$n(Ba(["start","center","end"]),{optional:!0})],Jg.prototype,"align",2),b([Zr(t=>{t.onChange(t.enabled)}),$n(Ba(["top","right","bottom","left","floating-top","floating-bottom"]),{optional:!0})],Jg.prototype,"position",2),b([Zr(t=>{t.onButtonsChange(t.buttons)}),$n(ra,{optional:!0})],Jg.prototype,"buttons",2);var tm="ag-charts-toolbar",em={align:`${tm}__align`,button:`${tm}__button`,icon:`${tm}__icon`,label:`${tm}__label`},im={top:`${tm}--top`,right:`${tm}--right`,bottom:`${tm}--bottom`,left:`${tm}--left`,"floating-top":`${tm}--floating-top`,"floating-bottom":`${tm}--floating-bottom`,hidden:`${tm}--hidden`,preventFlash:`${tm}--prevent-flash`,floatingHidden:`${tm}--floating-hidden`,align:{start:`${em.align}--start`,center:`${em.align}--center`,end:`${em.align}--end`},button:{hidden:`${em.button}--hidden`}},sm=`\n.${tm} {\n    align-items: center;\n    background: var(--ag-charts-toolbar-background-color);\n    border-bottom: var(--ag-charts-toolbar-border-critical);\n    border-top: var(--ag-charts-toolbar-border-critical);\n    border-left: var(--ag-charts-toolbar-border);\n    border-right: var(--ag-charts-toolbar-border);\n    display: flex;\n    flex-wrap: nowrap;\n    opacity: 1;\n    position: absolute;\n    transform: translateY(0);\n    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;\n}\n\n.${im.hidden},\n.${im.preventFlash} {\n    visibility: hidden;\n}\n\n.${im.floatingHidden} {\n    opacity: 0;\n    transition: opacity 0.4s ease-in-out;\n}\n\n.${im.top},\n.${im.bottom} {\n    flex-direction: row;\n    height: var(--ag-charts-toolbar-size);\n    padding: 0 var(--ag-charts-toolbar-padding);\n    width: 100%;\n}\n\n.${im.left},\n.${im.right} {\n    flex-direction: column;\n    padding: var(--ag-charts-toolbar-padding) 0;\n    width: var(--ag-charts-toolbar-size);\n}\n\n.${im["floating-top"]},\n.${im["floating-bottom"]} {\n    background: none;\n    border: none;\n    flex-direction: row;\n    height: var(--ag-charts-toolbar-size);\n    overflow: hidden;\n    padding: 0 var(--ag-charts-toolbar-padding);\n    pointer-events: none;\n    width: 100%;\n}\n\n.${em.align} {\n    display: flex;\n    flex-direction: inherit;\n    flex-wrap: inherit;\n    max-width: 100%;\n}\n\n.${im.align.center},\n.${im.align.end} {\n    margin-left: auto;\n}\n\n.${im.left} .${im.align.center},\n.${im.left} .${im.align.end},\n.${im.right} .${im.align.center},\n.${im.right} .${im.align.end} {\n    margin-left: 0;\n    margin-top: auto;\n}\n\n.${im["floating-top"]} .${em.align},\n.${im["floating-bottom"]} .${em.align} {\n    gap: var(--ag-charts-toolbar-gap);\n    transition: transform 0.4s ease-in-out;\n}\n\n.${em.button} {\n    align-items: center;\n    border-radius: var(--ag-charts-button-radius);\n    color: var(--ag-charts-toolbar-foreground-color);\n    display: flex;\n    font-size: 14px;\n    font-weight: 500;\n    justify-content: center;\n    margin: 0;\n    padding: var(--ag-charts-button-padding);\n    pointer-events: all;\n    transition: background-color .25s ease-in-out;\n}\n\n.${im.left} .${em.button},\n.${im.right} .${em.button} {\n    height: var(--ag-charts-toolbar-size);\n    max-width: 100%;\n    overflow: hidden;\n}\n\n.${im["floating-top"]} .${em.button},\n.${im["floating-bottom"]} .${em.button} {\n    background: var(--ag-charts-toolbar-background-color);\n    border: var(--ag-charts-toolbar-border-critical);\n}\n\n.${im.button.hidden} {\n    display: none;\n}\n\n.${em.button}:hover {\n    background: var(--ag-charts-toolbar-hover-color);\n}\n\n.${em.button}:disabled {\n    background: var(--ag-charts-toolbar-disabled-background-color);\n    color: var(--ag-charts-toolbar-disabled-foreground-color);\n}\n\n.${em.button}:not([disabled]) {\n    cursor: pointer;\n}\n\n.${em.icon} {\n    height: 1.2em;\n    width: 1.2em;\n}\n\n.${em.icon} + .${em.label} {\n    margin-left: var(--ag-charts-size);\n}\n\n.${em.icon},\n.${em.label} {\n    pointer-events: none;\n}\n\n`,nm=class extends St{constructor(t){super(),this.ctx=t,this.enabled=!0,this.annotations=new Jg(this.onGroupChanged.bind(this,"annotations"),this.onGroupButtonsChanged.bind(this,"annotations")),this.ranges=new Jg(this.onGroupChanged.bind(this,"ranges"),this.onGroupButtonsChanged.bind(this,"ranges")),this.zoom=new Jg(this.onGroupChanged.bind(this,"zoom"),this.onGroupButtonsChanged.bind(this,"zoom")),this.margin=10,this.floatingDetectionRange=28,this.positions={top:new Set,right:new Set,bottom:new Set,left:new Set,"floating-top":new Set,"floating-bottom":new Set},this.positionAlignments={top:{},right:{},bottom:{},left:{},"floating-top":{},"floating-bottom":{}},this.groupCallers={annotations:0,ranges:0,zoom:0},this.groupButtons={annotations:[],ranges:[],zoom:[]},this.pendingButtonToggledEvents=[],this.groupProxied=new Set,this.container=t.toolbarManager.element,this.elements={top:this.container.appendChild(Ms("div")),right:this.container.appendChild(Ms("div")),bottom:this.container.appendChild(Ms("div")),left:this.container.appendChild(Ms("div")),"floating-top":this.container.appendChild(Ms("div")),"floating-bottom":this.container.appendChild(Ms("div"))},Ds(sm,tm),this.renderToolbar("top"),this.renderToolbar("right"),this.renderToolbar("bottom"),this.renderToolbar("left"),this.renderToolbar("floating-top"),this.renderToolbar("floating-bottom"),this.toggleVisibilities(),this.destroyFns.push(t.interactionManager.addListener("hover",this.onHover.bind(this),31),t.interactionManager.addListener("leave",this.onLeave.bind(this),31),t.toolbarManager.addListener("button-toggled",this.onButtonToggled.bind(this)),t.toolbarManager.addListener("group-toggled",this.onGroupToggled.bind(this)),t.toolbarManager.addListener("proxy-group-options",this.onProxyGroupOptions.bind(this)),t.layoutService.addListener("layout-complete",this.onLayoutComplete.bind(this)),()=>this.destroyElements())}destroyElements(){for(const t of Object.values(this.elements))t.remove()}onHover(t){const{enabled:e,elements:i,floatingDetectionRange:s,ctx:{scene:n}}=this,{offsetY:a,sourceEvent:{target:o}}=t,{FloatingBottom:r,FloatingTop:l}=qg;if(!e)return;const h=i[r],c=i[l],d=a>h.offsetTop-s&&a<n.canvas.element.offsetHeight||o===h,u=c.offsetTop+c.offsetHeight+s,p=a>0&&a<u||o===c;h.classList.toggle(im.floatingHidden,!d),c.classList.toggle(im.floatingHidden,!p),this.translateFloatingElements(r,d),this.translateFloatingElements(l,p)}onLeave(t){const{enabled:e,elements:i,ctx:{scene:s}}=this,{relatedTarget:n,target:a}=t.sourceEvent,{FloatingBottom:o,FloatingTop:r}=qg;e&&a===s.canvas.element&&(Zg.some(t=>this.groupButtons[t].some(t=>t===n))||(i[o].classList.add(im.floatingHidden),i[r].classList.add(im.floatingHidden),this.translateFloatingElements(o,!1),this.translateFloatingElements(r,!1)))}onGroupChanged(t){null==this[t]||this.groupProxied.has(t)||(this.createGroup(t),this.toggleVisibilities())}onGroupButtonsChanged(t,e){this.enabled&&!this.groupProxied.has(t)&&(this.createGroupButtons(t,e),this.toggleVisibilities())}onLayoutComplete(){for(const t of Qg)this.elements[t].classList.remove(im.preventFlash)}onButtonToggled(t){const{group:e,value:i,enabled:s}=t;if(0!==this.groupButtons[e].length)for(const t of this.groupButtons[e])t.dataset.toolbarValue===`${i}`&&(t.disabled=!s);else this.pendingButtonToggledEvents.push(t)}onGroupToggled(t){const{group:e,visible:i}=t;this.toggleGroup(e,i),this.toggleVisibilities()}onProxyGroupOptions(t){const{group:e,options:i}=t;this.groupProxied.add(e),this.createGroup(e,i.enabled,i.position),this.createGroupButtons(e,i.buttons),this.toggleGroup(e,i.enabled),this[e].set(i)}createGroup(t,e,i){null!=e||(e=this[t].enabled),null!=i||(i=this[t].position);for(const s of Qg)e&&i===s?this.positions[s].add(t):this.positions[s].delete(t)}createGroupButtons(t,e){var i,s;for(const e of this.groupButtons[t])e.remove();this.groupButtons[t]=[];const n=null!=(i=this[t].align)?i:"start",a=null!=(s=this[t].position)?s:"top",o=this.positionAlignments[a][n];for(const i of null!=e?e:[]){const e=this.createButtonElement(t,i);null==o||o.appendChild(e),this.groupButtons[t].push(e)}}toggleGroup(t,e){e?this.groupCallers[t]+=1:this.groupCallers[t]=Math.max(0,this.groupCallers[t]-1)}processPendingEvents(){var t;const e=(null!=(t=this.pendingButtonToggledEvents)?t:[]).slice();for(const t of e)this.onButtonToggled(t);this.pendingButtonToggledEvents=[]}performLayout(t){return S(this,arguments,function*({shrinkRect:t}){const{elements:e,margin:i}=this;return e.top.classList.contains(im.hidden)||t.shrink(e.top.offsetHeight+2*i,"top"),e.right.classList.contains(im.hidden)||t.shrink(e.right.offsetWidth+i,"right"),e.bottom.classList.contains(im.hidden)||t.shrink(e.bottom.offsetHeight+2*i,"bottom"),e.left.classList.contains(im.hidden)||t.shrink(e.left.offsetWidth+i,"left"),{shrinkRect:t}})}performCartesianLayout(t){return S(this,null,function*(){const{elements:e,margin:i}=this,{seriesRect:s}=t,{FloatingBottom:n,FloatingTop:a}=qg;e.top.style.top=s.y-e.top.offsetHeight-2*i+"px",e.top.style.left=`${i}px`,e.top.style.width=`calc(100% - ${2*i}px)`,e.right.style.top=`${s.y+i}px`,e.right.style.right=`${i}px`,e.right.style.height=`calc(100% - ${s.y+2*i}px)`,e.bottom.style.bottom=`${i}px`,e.bottom.style.left=`${i}px`,e.bottom.style.width=`calc(100% - ${2*i}px)`,e.left.style.top=`${s.y}px`,e.left.style.left=`${i}px`,e.left.style.height=`calc(100% - ${s.y+2*i}px)`,e[a].style.top=`${s.y}px`,e[a].style.paddingTop=`${i}px`,e[n].style.top=s.y+s.height-e[n].offsetHeight+"px",e[n].style.paddingBottom=`${i}px`})}toggleVisibilities(){var t;if(null==this.elements)return;const e=t=>this[t].enabled&&this.groupCallers[t]>0,i=t=>e=>"string"!=typeof e.value&&"number"!=typeof e.value||`${e.value}`===t.dataset.toolbarValue;for(const t of Qg){const i=this.enabled&&Array.from(this.positions[t].values()).some(e);this.elements[t].classList.toggle(im.hidden,!i)}for(const s of Zg){if(null==this[s])continue;const n=e(s);for(const e of this.groupButtons[s]){const a=n&&(null==(t=this[s].buttons)?void 0:t.some(i(e)));e.classList.toggle(im.button.hidden,!a)}}}translateFloatingElements(t,e){const{elements:i,margin:s,positionAlignments:n}=this,a=i[t],o=Object.values(n[t]);for(const t of o)t.style.transform=e&&""!==t.style.transform?"translateY(0)":`translateY(${a.offsetHeight+s}px)`}renderToolbar(t="top"){const e=this.elements[t];e.classList.add(tm,im[t],im.preventFlash),"floating-top"!==t&&"floating-bottom"!==t||e.classList.add(im.floatingHidden);for(const i of Xg){const s=Ms("div");s.classList.add(em.align,im.align[i]),e.appendChild(s),this.positionAlignments[t][i]=s}}createButtonElement(t,e){const i=Ms("button");i.classList.add(em.button),i.dataset.toolbarGroup=t,i.tabIndex=-1,"string"!=typeof e.value&&"number"!=typeof e.value||(i.dataset.toolbarValue=`${e.value}`),e.tooltip&&(i.title=e.tooltip);let s="";return null!=e.icon&&(s=`<span class="ag-charts-icon-${e.icon} ${em.icon}"></span>`),null!=e.label&&(s=`${s}<span class="${em.label}">${e.label}</span>`),i.innerHTML=s,i.onclick=this.onButtonPress.bind(this,t,e.value),this.destroyFns.push(()=>i.remove()),i}onButtonPress(t,e){this.ctx.toolbarManager.pressButton(t,e)}};b([Zr(t=>{t.processPendingEvents(),t.toggleVisibilities()}),$n(Qn)],nm.prototype,"enabled",2);var am=864e5,om=30*am,rm={type:"root",optionsKey:"toolbar",packageType:"community",chartTypes:["cartesian"],instanceConstructor:nm,themeTemplate:{toolbar:{enabled:!0,annotations:{enabled:!1,position:"left",align:"start",buttons:[{label:"Li",value:"line"},{label:"PCh",value:"parallel-channel"}]},ranges:{enabled:!1,position:"top",align:"start",buttons:[{label:"1m",value:om},{label:"3m",value:3*om},{label:"6m",value:6*om},{label:"YTD",value:(t,e)=>[new Date(`${new Date(e).getFullYear()}-01-01`).getTime(),e]},{label:"1y",value:365*am},{label:"All",value:(t,e)=>[t,e]}]},zoom:{enabled:!1,position:"top",align:"end",buttons:[{icon:"zoom-out",tooltip:"Zoom out",value:"zoom-out"},{icon:"zoom-in",tooltip:"Zoom in",value:"zoom-in"},{icon:"pan-left",tooltip:"Pan left",value:"pan-left"},{icon:"pan-right",tooltip:"Pan right",value:"pan-right"},{icon:"pan-start",tooltip:"Pan to the start",value:"pan-start"},{icon:"pan-end",tooltip:"Pan to the end",value:"pan-end"},{icon:"reset",tooltip:"Reset the zoom",value:"reset"}]}}}};var lm=class t extends nd{constructor(t,e){super(t,e)}performLayout(){return S(this,null,function*(){const e=yield v(t.prototype,this,"performLayout").call(this),{seriesArea:{padding:i},seriesRoot:s,annotationRoot:n,highlightRoot:a}=this,o=e.clone();e.shrink(i.left,"left"),e.shrink(i.top,"top"),e.shrink(i.right,"right"),e.shrink(i.bottom,"bottom"),this.seriesRect=e,this.animationRect=e,this.hoverRect=e;for(const t of[s,n,a])t.translationX=Math.floor(e.x),t.translationY=Math.floor(e.y);return yield Promise.all(this.series.map(t=>S(this,null,function*(){yield t.update({seriesRect:e})}))),s.visible=this.series[0].visible,s.setClipRectInGroupCoordinateSpace(new Js(e.x,e.y,e.width,e.height)),this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:o,paddedRect:e,visible:!0},axes:[]}),e})}};lm.className="HierarchyChart",lm.type="hierarchy";var hm=lm,cm=class extends Ml{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}computeLabelsBBox(t,e){return null}};b([$n(Ba(["polygon","circle"],"a polar axis shape"))],cm.prototype,"shape",2),b([$n(na)],cm.prototype,"innerRadiusRatio",2);var dm=class t extends nd{constructor(t,e){super(t,e),this.padding=new ql(40),this.axisGroup.zIndex=6}performLayout(){return S(this,null,function*(){const e=yield v(t.prototype,this,"performLayout").call(this),i=e.clone();return this.computeSeriesRect(e),yield this.computeCircle(e),this.axes.forEach(t=>t.update()),this.hoverRect=e,this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:i,paddedRect:e,visible:!0},axes:[]}),e})}updateAxes(t,e,i){var s,n;const a=this.axes.find(t=>"x"===t.direction),o=this.axes.find(t=>"y"===t.direction);if(!(a instanceof cm&&o instanceof cm))return;const r=a.scale,l=null==(s=r.ticks)?void 0:s.call(r).map(t=>r.convert(t)),h=o.innerRadiusRatio;a.innerRadiusRatio=h,null==(n=a.computeRange)||n.call(a),a.gridLength=i,o.gridAngles=l,o.gridRange=a.range,o.range=[i,i*h],[a,o].forEach(i=>{i.translation.x=t,i.translation.y=e,i.calculateLayout()})}computeSeriesRect(t){const{seriesArea:{padding:e}}=this;t.shrink(e.left,"left"),t.shrink(e.top,"top"),t.shrink(e.right,"right"),t.shrink(e.bottom,"bottom"),this.seriesRect=t,this.animationRect=t}computeCircle(t){return S(this,null,function*(){const e=this.series.filter(t=>t instanceof Rg),i=this.axes.filter(t=>t instanceof cm),s=(t,i,s)=>{this.updateAxes(t,i,s),e.forEach(e=>{e.centerX=t,e.centerY=i,e.radius=s});const n=e.filter(t=>t instanceof Hg||t instanceof Pg);if(n.length>1){const t=n.map(t=>{const e=t.getInnerRadius();return{series:t,innerRadius:e}}).sort((t,e)=>t.innerRadius-e.innerRadius);t.at(-1).series.surroundingRadius=void 0;for(let e=0;e<t.length-1;e++)t[e].series.surroundingRadius=t[e+1].innerRadius}},n=t.x+t.width/2,a=t.y+t.height/2,o=Math.max(0,Math.min(t.width,t.height)/2);let r=o;s(n,a,r);const l=(...l)=>S(this,[...l],function*({hideWhenNecessary:l=!1}={}){const h=[];for(const s of[...i,...e]){const e=yield s.computeLabelsBBox({hideWhenNecessary:l},t);e&&h.push(e)}if(0===h.length)return void s(n,a,o);const c=Js.merge(h),d=this.refineCircle(c,r,t);s(d.centerX,d.centerY,d.radius),d.radius!==r&&(r=d.radius)});return yield l(),yield l(),yield l(),yield l({hideWhenNecessary:!0}),yield l({hideWhenNecessary:!0}),{radius:r,centerX:n,centerY:a}})}refineCircle(t,e,i){const s=-e,n=-e,a=e,o=e;let r=Math.max(0,s-t.x),l=Math.max(0,n-t.y),h=Math.max(0,t.x+t.width-a),c=Math.max(0,t.y+t.height-o);r=h=Math.max(r,h),l=c=Math.max(l,c);const d=i.width-r-h,u=i.height-l-c;let p=Math.min(d,u)/2;const g=.5*i.width/2,m=.5*i.height/2,y=Math.min(g,m);if(p<y){p=y;const t=r+h;if(2*p+(l+c)>i.height){const t=i.height-2*p;2*Math.min(l,c)>t?(l=t/2,c=t/2):l>c?l=t-c:c=t-l}if(2*p+t>i.width){const t=i.width-2*p;2*Math.min(r,h)>t?(r=t/2,h=t/2):r>h?r=t-h:h=t-r}}const f=r+2*p+h,x=l+2*p+c;return{centerX:i.x+(i.width-f)/2+r+p,centerY:i.y+(i.height-x)/2+l+p,radius:p}}};dm.className="PolarChart",dm.type="polar";var um=dm,pm=Math.PI/180,gm=t=>t*pm,mm=t=>-Math.log(Math.tan(.25*Math.PI+t*pm*.5)),ym=t=>t/pm,fm=t=>(Math.atan(Math.exp(-t))-.25*Math.PI)/(.5*pm),xm=class t{constructor(e,i){this.domain=e,this.range=i,this.type="mercator",this.bounds=t.bounds(e)}static bounds(t){const[[e,i],[s,n]]=t,a=gm(e),o=mm(i),r=gm(s),l=mm(n);return new Js(Math.min(a,r),Math.min(o,l),Math.abs(r-a),Math.abs(l-o))}static fixedScale(){return new t([[ym(0),fm(0)],[ym(1),fm(1)]],[[0,0],[1,1]])}convert([t,e]){const[[i,s],[n,a]]=this.range,o=(n-i)/this.bounds.width,r=(a-s)/this.bounds.height;return[(gm(t)-this.bounds.x)*o+i,(mm(e)-this.bounds.y)*r+s]}invert([t,e]){const[[i,s],[n,a]]=this.range,o=(n-i)/this.bounds.width,r=(a-s)/this.bounds.height;return[ym((t-i)/o+this.bounds.x),fm((e-s)/r+this.bounds.y)]}};function bm(t){return"map-shape"===t.type||"map-line"===t.type||"map-marker"===t.type||"map-shape-background"===t.type||"map-line-background"===t.type}var vm=class t extends nd{constructor(t,e){super(t,e),this.xAxis=new Qd(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new Qd(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}updateData(){return S(this,null,function*(){yield v(t.prototype,this,"updateData").call(this);const{topology:e}=this.getOptions();this.series.forEach(t=>{bm(t)&&t.setChartTopology(e)})})}performLayout(){return S(this,null,function*(){const e=yield v(t.prototype,this,"performLayout").call(this),{seriesArea:{padding:i},seriesRoot:s,annotationRoot:n,highlightRoot:a}=this,o=e.clone();e.shrink(i.left,"left"),e.shrink(i.top,"top"),e.shrink(i.right,"right"),e.shrink(i.bottom,"bottom"),this.seriesRect=e,this.animationRect=e,this.hoverRect=e;const r=this.series.filter(bm),l=r.reduce((t,e)=>{if(!e.visible)return t;const i=e.topologyBounds;return null==i?t:null==t?i:(t.merge(i),t)},void 0);let h;if(null!=l){const{lon0:t,lat0:i,lon1:s,lat1:n}=l,a=[[t,i],[s,n]],o=xm.bounds(a),{width:r,height:c}=e,d=Math.min(r/o.width,c/o.height),u=o.width*d,p=o.height*d,g=(r-u)/2,m=(c-p)/2,y=g,f=m,x=g+u,b=m+p,v=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),S=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),M=(x-y)/(v.max-v.min),k=y-M*v.min,D=(b-f)/(1-S.min-(1-S.max)),w=f-D*(1-S.max);h=new xm(a,[[k,w],[k+M,w+D]])}r.forEach(t=>{t.scale=h});const c=this.series.some(t=>t.visible);s.visible=c;for(const t of[s,n,a])t.translationX=Math.floor(e.x),t.translationY=Math.floor(e.y),t.setClipRectInGroupCoordinateSpace(new Js(e.x,e.y,e.width,e.height));return this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:o,paddedRect:e,visible:c},axes:[]}),e})}};vm.className="TopologyChart",vm.type="topology";var Sm=vm,Mm=Ls.create(!0,"opts");function km(t){if(ue(t))return"cartesian";if(pe(t))return"polar";if(ge(t))return"hierarchy";if(me(t))return"topology";throw new Error(`AG Chart - unknown type of chart for options with type: ${t.type}`)}var Dm=class t{static licenseCheck(t){var e,i,s,n;this.licenseChecked||(this.licenseManager=null==(i=(e=vt).licenseManager)?void 0:i.call(e,t),null==(s=this.licenseManager)||s.setLicenseKey(this.licenseKey,this.gridContext),null==(n=this.licenseManager)||n.validateLicense(),this.licenseChecked=!0)}static setLicenseKey(t){this.licenseKey=t}static setGridContext(t){this.gridContext=t}static getLicenseDetails(t){var e,i;return null==(i=(e=vt).licenseManager)?void 0:i.call(e,{}).getLicenseDetails(t)}static getInstance(t){return Lm.getInstance(t)}static create(t){var e,i,s;this.licenseCheck(t);const n=Lm.createOrUpdate(t);return(null==(e=this.licenseManager)?void 0:e.isDisplayWatermark())&&(null==(s=(i=vt).injectWatermark)||s.call(i,n.chart.element,this.licenseManager.getWatermarkMessage())),n}static update(e,i){if(!Xd.isInstance(e))throw new Error(t.INVALID_CHART_REF_MESSAGE);Lm.createOrUpdate(i,e)}static updateDelta(e,i){if(!Xd.isInstance(e))throw new Error(t.INVALID_CHART_REF_MESSAGE);Lm.updateUserDelta(e,i)}static download(e,i){if(!(e instanceof Xd))throw new Error(t.INVALID_CHART_REF_MESSAGE);Lm.download(e,i).catch(t=>E.errorOnce(t))}static getImageDataURL(e,i){if(!(e instanceof Xd))throw new Error(t.INVALID_CHART_REF_MESSAGE);return Lm.getImageDataURL(e,i)}};Dm.INVALID_CHART_REF_MESSAGE="AG Charts - invalid chart reference passed",Dm.licenseChecked=!1,Dm.gridContext=!1;var wm=Dm,Im=class{static warnDeprecated(t){Ns()(`AgChart.${t}`,`Use AgCharts.${t} instead`)}static create(t){return this.warnDeprecated("create"),wm.create(t)}static update(t,e){return this.warnDeprecated("update"),wm.update(t,e)}static updateDelta(t,e){return this.warnDeprecated("updateDelta"),wm.updateDelta(t,e)}static download(t,e){return this.warnDeprecated("download"),wm.download(t,e)}static getImageDataURL(t,e){return this.warnDeprecated("getImageDataURL"),wm.getImageDataURL(t,e)}},Cm=class t{static getInstance(t){const e=nd.getInstance(t);return e?Xd.chartInstances.get(e):void 0}static initialiseModules(){t.initialised||(function(){Mt.register(hu,Du,Au,rm,Ip,$p,tg,og,cg,zg,Ug,sg);for(const t of[Qd,Cl,iu,zl,tu])kt.register(t.type,{instanceConstructor:t,hidden:t===zl})}(),function(){for(const t of Mt.modules){if("enterprise"!==t.packageType||ce(t)||E.errorOnce("Unexpected enterprise module registered: "+t.identifier),"root"===t.type&&t.themeTemplate)for(const e of t.chartTypes)re.set(e,t.themeTemplate);if("series"===t.type){if(t.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${t.identifier}`);Le.register(t.identifier,t)}if("series-option"===t.type&&t.themeTemplate)for(const e of t.seriesTypes)Le.setThemeTemplate(e,t.themeTemplate);if("axis-option"===t.type&&t.themeTemplate)for(const e of t.axisTypes){const i=t.themeTemplate[e],s=m(m({},t.themeTemplate),i);for(const e of t.axisTypes)delete s[e];kt.setThemeTemplate(e,s)}"axis"===t.type&&kt.register(t.identifier,t),"legend"===t.type&&Ae.register(t.identifier,t)}if(Mt.hasEnterpriseModules()){const t=le.filter(({useCount:t})=>null==t||0===t);t.length>0&&E.errorOnce("Enterprise modules expected but not registered: ",t)}}(),t.initialised=!0)}static createOrUpdate(e,i){t.initialiseModules(),Mm(">>> AgChartV2.createOrUpdate() user options",e);const s=e,{overrideDevicePixelRatio:n,document:a,window:o}=s,r=f(s,["overrideDevicePixelRatio","document","window"]),l=new Ts(r,{overrideDevicePixelRatio:n,document:a,window:o});let h=null==i?void 0:i.chart;return null!=h&&km(r)===km(h.processedOptions)||(h=t.createChartInstance(l,h)),null==i?i=new Xd(h):i.chart=h,Mm.check()&&"undefined"!=typeof window&&(null!=window.agChartInstances||(window.agChartInstances={}),window.agChartInstances[h.id]=h),h.queuedUserOptions.push(r),h.requestFactoryUpdate(t=>{t.applyOptions(l),t.queuedUserOptions.splice(0,t.queuedUserOptions.indexOf(r))}),i}static updateUserDelta(e,i){De(i=Me(i,{shallow:["data"]}),t=>{if("object"==typeof t)for(const[e,i]of Object.entries(t))void 0===i&&Object.assign(t,{[e]:Symbol("UNSET")})},{skip:["data"]});const{chart:s}=e,n=s.getOptions(),a=Xt(i,n);Mm(">>> AgChartV2.updateUserDelta() user delta",i),Mm("AgChartV2.updateUserDelta() - base options",n),t.createOrUpdate(a,e)}static download(e,i){return S(this,null,function*(){try{const s=yield t.prepareResizedChart(e,i);s.chart.ctx.scene.download(null==i?void 0:i.fileName,null==i?void 0:i.fileFormat),s.destroy()}catch(t){E.errorOnce(t)}})}static getImageDataURL(e,i){return S(this,null,function*(){const s=yield t.prepareResizedChart(e,i),n=s.chart.ctx.scene.getDataURL(null==i?void 0:i.fileFormat);return s.destroy(),n})}static prepareResizedChart(e){return S(this,arguments,function*({chart:e},i={}){var s,n,a,o;const r=null!=(n=null!=(s=i.width)?s:e.width)?n:e.ctx.scene.canvas.width,l=null!=(o=null!=(a=i.height)?a:e.height)?o:e.ctx.scene.canvas.height,h=Xt({container:document.createElement("div"),overrideDevicePixelRatio:1,autoSize:!1,width:r,height:l},Mt.hasEnterpriseModules()&&{animation:{enabled:!1}},e.userOptions),c=t.createOrUpdate(h);return c.chart.ctx.zoomManager.updateZoom("agChartV2",e.ctx.zoomManager.getZoom()),e.series.forEach((t,e)=>{t.visible||(c.chart.series[e].visible=!1)}),e.update(0,{forceNodeDataRefresh:!0}),yield c.chart.waitForUpdate(),c})}static createChartInstance(e,i){const s=null==i?void 0:i.destroy({keepTransferableResources:!0});return new(t.getChartByOptions(e.processedOptions))(e,s)}static getChartByOptions(t){if(ue(t))return Hd;if(ge(t))return hm;if(pe(t))return um;if(me(t))return Sm;throw new Error("AG Charts - couldn't apply configuration, check options are correctly structured and series types are specified")}};Cm.initialised=!1;var Lm=Cm,Am="9.3.2",Tm={};x(Tm,{Arc:()=>Nm,BBox:()=>Js,BandScale:()=>Kn,Caption:()=>ol,ChangeDetectableProperties:()=>zu,Circle:()=>fd,ContinuousScale:()=>Xa,Diamond:()=>Sd,DropShadow:()=>Gu,ExtendedPath2D:()=>hd,Group:()=>ko,HdpiCanvas:()=>_l,Image:()=>Bm,Label:()=>Go,Line:()=>zr,LinearGradientFill:()=>Om,LinearScale:()=>Zd,Marker:()=>yd,Node:()=>hn,OrdinalTimeScale:()=>xo,Path:()=>dd,PointerEvents:()=>rn,RadialColumnShape:()=>Em,Rect:()=>ru,RedrawType:()=>tn,Scene:()=>Hl,SceneChangeDetection:()=>sn,ScenePathChangeDetection:()=>cd,Sector:()=>Sg,SectorBox:()=>dg,Selection:()=>Er,Shape:()=>Lo,Square:()=>Id,Text:()=>Bo,Tooltip:()=>al,Triangle:()=>Ad,easing:()=>mn,getFont:()=>zo,getMarker:()=>Rd,getRadialColumnWidth:()=>Pm,motion:()=>Fm,nearestSquared:()=>Zs,nearestSquaredInContainer:()=>qs,toRadians:()=>zn,toTooltipHtml:()=>sl});var Nm=class extends dd{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return Ks(En(this.startAngle),En(this.endAngle))}updatePath(){const t=this.path;t.clear(),t.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),1===this.type?t.closePath():2!==this.type||this.fullPie||(t.lineTo(this.centerX,this.centerY),t.closePath())}computeBBox(){return new Js(this.centerX-this.radius,this.centerY-this.radius,2*this.radius,2*this.radius)}isPointInPath(t,e){const i=this.transformPoint(t,e),s=this.computeBBox();return 0!==this.type&&s.containsPoint(i.x,i.y)&&this.path.isPointInPath(i.x,i.y)}};Nm.className="Arc",Nm.defaultStyles=Object.assign({},Lo.defaultStyles,{lineWidth:1,fillStyle:null}),b([cd()],Nm.prototype,"centerX",2),b([cd()],Nm.prototype,"centerY",2),b([cd()],Nm.prototype,"radius",2),b([cd()],Nm.prototype,"startAngle",2),b([cd()],Nm.prototype,"endAngle",2),b([cd()],Nm.prototype,"counterClockwise",2),b([cd()],Nm.prototype,"type",2);var Om=class extends Lo{constructor(){super(...arguments),this.direction="to-right",this.stops=void 0,this._mask=void 0}get mask(){return this._mask}set mask(t){null!=this._mask&&this.removeChild(this._mask),null!=t&&this.appendChild(t),this._mask=t}isPointInPath(t,e){var i,s;return null!=(s=null==(i=this.mask)?void 0:i.isPointInPath(t,e))&&s}computeBBox(){var t;return null==(t=this.mask)?void 0:t.computeBBox()}render(t){const{mask:e,stops:i}=this,{ctx:s,devicePixelRatio:n}=t,a=1/n,o=null==e?void 0:e.computeTransformedBBox();if(null==e||null==i||null==o)return;e.dirtyPath&&(e.updatePath(),e.dirtyPath=!1),s.save(),s.clip(e.path.getPath2D()),s.setTransform(n,0,0,n,0,0);const r=Math.floor(o.x),l=Math.ceil(o.x+o.width),h=Math.floor(o.y),c=Math.ceil(o.y+o.height),d=new Up,[u,p]="to-right"===this.direction?[r,l]:[h,c];if(d.domain=i.map((t,e)=>u+(p-u)*e/(i.length-1)),d.range=i,d.update(),"to-right"===this.direction){const t=c-h;for(let e=r;e<=l;e+=a)s.fillStyle=d.convert(e),s.fillRect(e,h,a,t)}else{const t=l-r;for(let e=h;e<=c;e+=a)s.fillStyle=d.convert(e),s.fillRect(r,e,t,a)}s.restore()}};function Rm(t,e,i){const s=Math.sqrt(p(t,2)+p(e,2)),n=Math.atan2(e,t)+i;return{x:Math.cos(n)*s,y:Math.sin(n)*s}}b([sn({redraw:3})],Om.prototype,"direction",2),b([sn({redraw:3})],Om.prototype,"stops",2),b([sn({redraw:3})],Om.prototype,"_mask",2);var Em=class extends dd{constructor(){super(...arguments),this.borderPath=new hd,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}getRotation(){const{startAngle:t,endAngle:e}=this;return En(t+_n(t,e)/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,a=t/2,o=-i,r=-e,l=this.getRotation(),h=[[n,r],[n,o],[a,o],[a,r],[n,r]].map(([t,e])=>Rm(t,e,l));s.clear(!0),s.moveTo(h[0].x,h[0].y),s.lineTo(h[1].x,h[1].y),s.lineTo(h[2].x,h[2].y),s.lineTo(h[3].x,h[3].y),s.lineTo(h[0].x,h[0].y),s.closePath()}updateBeveledPath(){const{columnWidth:t,path:e,outerRadius:i,innerRadius:s,axisInnerRadius:n,axisOuterRadius:a,isRadiusAxisReversed:o}=this,r=Ks(s,n),l=Math.asin(t/2/s),h=this.getRotation(),c=(t,e)=>Rm(t,e,h),d=(t,e)=>Math.sqrt(p(t,2)+p(e,2)),u=(t,e)=>e>t?0:Math.sqrt(p(t,2)-p(e,2)),g=(t,e,i)=>i?t<e:t>e,m=r&&!isNaN(l)&&l<Math.PI/6;let y=-t/2,f=t/2;const x=-i,b=-s*(m?Math.cos(l):1),v=g(a,d(s,t/2),!o);if(v){const t=u(a,s);y=-t,f=t}e.clear(!0);const S=c(y,b);e.moveTo(S.x,S.y);const M=Ks(s,i),k=g(a,d(i,t/2),!o);if(M&&m)e.arc(0,0,s,En(-l-Math.PI/2)+h,En(l-Math.PI/2)+h,!1);else if(k){const s=-u(a,t/2),n=u(a,i);if(!v){const t=c(y,s);e.lineTo(t.x,t.y)}if(e.arc(0,0,a,Math.atan2(s,y)+h,Math.atan2(x,-n)+h,!1),!Ks(n,0)){const t=c(n,x);e.lineTo(t.x,t.y)}e.arc(0,0,a,Math.atan2(x,n)+h,Math.atan2(s,f)+h,!1)}else{const t=c(y,x),i=c(f,x);e.lineTo(t.x,t.y),e.lineTo(i.x,i.y)}const D=c(f,b);if(e.lineTo(D.x,D.y),m)e.arc(0,0,s,En(l-Math.PI/2)+h,En(-l-Math.PI/2)+h,!0);else{const t=c(y,b);e.lineTo(t.x,t.y)}e.closePath()}};function Pm(t,e,i,s,n){const a=_n(t,e),o=a*(1-s)/2;if(t+=o,e-=o,a<.001)return 2*i*n;if(a>=2*Math.PI){const i=t+a/2;t=i-Math.PI,e=i+Math.PI}const r=i*Math.cos(t),l=i*Math.sin(t),h=i*Math.cos(e),c=i*Math.sin(e),d=Math.floor(Math.sqrt(p(r-h,2)+p(l-c,2))),u=2*i*n;return Math.max(1,Math.min(u,d))}Em.className="RadialColumnShape",b([cd()],Em.prototype,"isBeveled",2),b([cd()],Em.prototype,"columnWidth",2),b([cd()],Em.prototype,"startAngle",2),b([cd()],Em.prototype,"endAngle",2),b([cd()],Em.prototype,"outerRadius",2),b([cd()],Em.prototype,"innerRadius",2),b([cd()],Em.prototype,"axisInnerRadius",2),b([cd()],Em.prototype,"axisOuterRadius",2),b([cd()],Em.prototype,"isRadiusAxisReversed",2);var Bm=class extends hn{constructor(t){super(),this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1,this.sourceImage=t}render(t){const{ctx:e,forceRender:i,stats:s}=t;if(0===this.dirty&&!i)return void(s&&s.nodesSkipped++);this.computeTransformMatrix(),this.matrix.toContext(e);const n=this.sourceImage;e.globalAlpha=this.opacity,e.drawImage(n,0,0,n.width,n.height,this.x,this.y,this.width,this.height),super.render(t)}};b([sn({redraw:3})],Bm.prototype,"x",2),b([sn({redraw:3})],Bm.prototype,"y",2),b([sn({redraw:3})],Bm.prototype,"width",2),b([sn({redraw:3})],Bm.prototype,"height",2),b([sn({redraw:3})],Bm.prototype,"opacity",2);var Fm=m(m({},Es),gr),zm={};x(zm,{CARTESIAN_AXIS_TYPE:()=>Re,ChartTheme:()=>xi,DEFAULT_ANNOTATION_BACKGROUND_FILL:()=>di,DEFAULT_ANNOTATION_HANDLE_FILL:()=>ui,DEFAULT_ANNOTATION_STROKE:()=>ci,DEFAULT_AXIS_GRID_COLOUR:()=>Ze,DEFAULT_AXIS_LINE_COLOUR:()=>qe,DEFAULT_BACKGROUND_COLOUR:()=>Je,DEFAULT_COLOURS:()=>ei,DEFAULT_CROSS_LINES_COLOUR:()=>Qe,DEFAULT_DIVERGING_SERIES_COLOUR_RANGE:()=>ri,DEFAULT_FONT_FAMILY:()=>Ye,DEFAULT_HIERARCHY_FILLS:()=>li,DEFAULT_HIERARCHY_STROKES:()=>hi,DEFAULT_INSIDE_SERIES_LABEL_COLOUR:()=>Ue,DEFAULT_INVERTED_LABEL_COLOUR:()=>He,DEFAULT_LABEL_COLOUR:()=>$e,DEFAULT_MUTED_LABEL_COLOUR:()=>Xe,DEFAULT_POLAR_SERIES_STROKE:()=>oi,DEFAULT_SHADOW_COLOUR:()=>ti,DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE:()=>ai,DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS:()=>si,DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS:()=>ii,DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS:()=>ni,EXTENDS_AXES_DEFAULTS:()=>Ge,EXTENDS_AXES_GRID_LINE_DEFAULTS:()=>We,EXTENDS_AXES_LINE_DEFAULTS:()=>_e,EXTENDS_AXES_TICK_DEFAULTS:()=>je,EXTENDS_CARTESIAN_MARKER_DEFAULTS:()=>Ke,EXTENDS_SERIES_DEFAULTS:()=>Ve,FONT_SIZE:()=>Te,FONT_WEIGHT:()=>Ne,IS_DARK_THEME:()=>ze,POLAR_AXIS_SHAPE:()=>Pe,POLAR_AXIS_TYPE:()=>Ee,POSITION:()=>Oe,getChartTheme:()=>os,markerPaletteFactory:()=>Nu,singleSeriesPaletteFactory:()=>Tu,themes:()=>Gm});var Gm=qt(as,t=>null==t?void 0:t()),_m={};x(_m,{BandScale:()=>Kn,ColorScale:()=>Up,ContinuousScale:()=>Xa,Invalidating:()=>Wn,LinearScale:()=>Zd,OrdinalTimeScale:()=>xo,TimeScale:()=>yo});var jm={};function Wm(t,e){const i={};if(Array.isArray(e))for(let s=0;s<t.length;s++)i[`${t[s]}`]=e[s];else for(let s=0;s<t.length;s++)i[`${t[s]}`]=e;return i}x(jm,{Color:()=>pn,Logger:()=>E,Padding:()=>ql,angleBetween:()=>_n,areArrayItemsStrictlyEqual:()=>Kr,areArrayNumbersEqual:()=>Yr,bifurcate:()=>ms,checkDatum:()=>Ho,clamp:()=>_s,clampArray:()=>js,countFractionDigits:()=>Xs,createId:()=>Fs,deepClone:()=>Me,displacePointFromVector:()=>jn,extent:()=>rs,findMinMax:()=>Ws,findRangeExtent:()=>Vs,isBetweenAngles:()=>Fn,isContinuous:()=>$o,isDate:()=>Pt,isDenseInterval:()=>go,isEqual:()=>Ks,isNegative:()=>Ys,isNumber:()=>Vt,isNumberEqual:()=>Ks,isNumberObject:()=>Yo,isString:()=>jt,isStringObject:()=>Ko,jsonApply:()=>we,jsonDiff:()=>Se,jsonWalk:()=>De,mod:()=>Us,normalisedExtent:()=>ls,normalisedExtentWithMetadata:()=>hs,normalizeAngle180:()=>Bn,normalizeAngle360:()=>En,normalizeAngle360Inclusive:()=>Pn,range:()=>po,resetIds:()=>Bs,round:()=>$s,sanitizeHtml:()=>Eu,setAttribute:()=>qr,shallowClone:()=>ke,tickFormat:()=>Nr,tickStep:()=>uo,ticks:()=>ho,toDegrees:()=>Gn,toFixed:()=>Hs,toRadians:()=>zn,transformIntegratedCategoryValue:()=>Uo,zipObject:()=>Wm});var Vm={};function Km({defs:t,values:e,xAxis:i,yAxis:s}){if(!i||!s)throw new Error("Axes must be defined");const n={};for(const[a,{def:o}]of t)if(Object.hasOwn(e,a)){const{scale:t}="key"===o.type?i:s;n[a]=Math.round(t.convert(e[a]))}return n}x(Vm,{AND:()=>Un,ARRAY:()=>ra,ARRAY_OF:()=>la,AbstractBarSeries:()=>Np,AbstractBarSeriesProperties:()=>Tp,ActionOnSet:()=>Xr,Animation:()=>Ln,AnimationManager:()=>fh,AreaSeriesTag:()=>Sp,Axis:()=>Ml,AxisLabel:()=>cl,AxisTick:()=>Ka,BOOLEAN:()=>Qn,BOOLEAN_ARRAY:()=>fa,Background:()=>lu,BackgroundModule:()=>hu,BaseModuleInstance:()=>St,BaseProperties:()=>fe,COLOR_STRING:()=>ma,COLOR_STRING_ARRAY:()=>ya,CartesianAxis:()=>wl,CartesianSeries:()=>Kd,CartesianSeriesNodeEvent:()=>Wd,CartesianSeriesProperties:()=>Vd,CategoryAxis:()=>Cl,CategoryAxisTick:()=>Il,ChartAxisDirection:()=>Ya,ChartEventManager:()=>bh,ChartOptions:()=>Ts,ChartUpdateType:()=>_h,ContextMenuRegistry:()=>vh,CursorManager:()=>Mh,DATE:()=>ua,DATE_ARRAY:()=>va,DATE_OR_DATETIME_MS:()=>pa,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>_d,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>jd,DEFAULT_TOOLTIP_CLASS:()=>Jr,DEFAULT_TOOLTIP_DARK_CLASS:()=>tl,DEGREE:()=>aa,DIRECTION:()=>Oa,DataController:()=>Jh,DataModel:()=>qh,DataModelSeries:()=>Ed,DataService:()=>sh,Default:()=>Yn,Deprecated:()=>Os,DeprecatedAndRenamedTo:()=>Rs,EMPTY_TOOLTIP_CONTENT:()=>el,FONT_STYLE:()=>Ia,FONT_WEIGHT:()=>Ca,FUNCTION:()=>Jn,GREATER_THAN:()=>da,GestureDetector:()=>Dh,GroupedCategoryAxis:()=>zl,HierarchyNode:()=>$m,HierarchySeries:()=>Hm,HierarchySeriesProperties:()=>Um,HighlightManager:()=>wh,HighlightStyle:()=>zd,INTERACTION_RANGE:()=>Ea,InteractionManager:()=>mh,InteractionState:()=>ph,LABEL_PLACEMENT:()=>Pa,LESS_THAN:()=>ca,LINE_CAP:()=>Ma,LINE_DASH:()=>Da,LINE_JOIN:()=>ka,Layers:()=>Vo,LayoutService:()=>zh,LonLatBBox:()=>Xm,MARKER_SHAPE:()=>_u,MATCHING_CROSSLINE_TYPE:()=>Xo,MAX_SPACING:()=>za,MIN_SPACING:()=>Fa,MercatorScale:()=>xm,Motion:()=>mn,NAN:()=>ia,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>An,NUMBER:()=>ea,NUMBER_ARRAY:()=>xa,NUMBER_OR_NAN:()=>oa,Navigator:()=>Lu,NavigatorModule:()=>Au,OBJECT:()=>Zn,OBJECT_ARRAY:()=>Sa,OR:()=>Xn,OVERFLOW_STRATEGY:()=>Na,ObserveChanges:()=>Zr,PHASE_METADATA:()=>wn,PHASE_ORDER:()=>Dn,PLACEMENT:()=>Ra,PLAIN_OBJECT:()=>qn,POINTER_INTERACTION_TYPES:()=>lh,POSITION:()=>wa,POSITIVE_NUMBER:()=>sa,PolarAxis:()=>cm,PolarSeries:()=>Rg,PropertiesArray:()=>xe,ProxyOnWrite:()=>Hr,ProxyProperty:()=>$r,ProxyPropertyOnWrite:()=>Ur,QUICK_TRANSITION:()=>.2,RATIO:()=>na,RepeatType:()=>In,SKIP_JS_BUILTINS:()=>te,SMALLEST_KEY_INTERVAL:()=>wc,SORT_DOMAIN_GROUPS:()=>Ic,STRING:()=>ta,STRING_ARRAY:()=>ba,Series:()=>Zc,SeriesGroupingChangedEvent:()=>Xc,SeriesItemHighlightStyle:()=>Pd,SeriesMarker:()=>ju,SeriesNodeEvent:()=>Uc,SeriesNodePickMode:()=>Fc,SeriesProperties:()=>Gd,SeriesTooltip:()=>Vu,StateMachine:()=>yr,TEXT_ALIGN:()=>Aa,TEXT_WRAP:()=>La,ToolbarManager:()=>Ph,Tooltip:()=>al,TooltipManager:()=>Fh,TooltipPosition:()=>nl,UNION:()=>Ba,UpdateService:()=>jh,VERTICAL_ALIGN:()=>Ta,Validate:()=>$n,ZoomManager:()=>ic,__FORCE_MODULE_DETECTION:()=>Zm,accumulateGroup:()=>Ec,accumulatedValue:()=>kc,accumulativeValueProperty:()=>Yc,addHitTestersToQuadtree:()=>Lp,adjustLabelPlacement:()=>Kp,allInStringUnion:()=>fs,animationValidation:()=>Nc,area:()=>Mc,arraysEqual:()=>cs,assignJsonApplyConstructedArray:()=>Ha,backfillPathPointData:()=>ep,basicContinuousCheckDatumValidation:()=>zc,bifurcate:()=>ms,buildFormatter:()=>so,buildResetPathFn:()=>rp,calculateDefaultTimeTickFormat:()=>oo,calculatePlacement:()=>Qr,checkCrisp:()=>Bp,childrenIter:()=>Cp,circularSliceArray:()=>gs,clamp:()=>_s,clampArray:()=>js,collapsedStartingBarPosition:()=>zp,computeBarFocusBounds:()=>Wp,computeMarkerFocusBounds:()=>qu,computeSectorFocusBounds:()=>Og,convertValuesToScaleByDefs:()=>Km,countFractionDigits:()=>Xs,createDatumId:()=>Bc,createDeprecationWarning:()=>Ns,createElement:()=>Ms,dateToNumber:()=>no,deconstructSelectionsOrNodes:()=>Cn,deepClone:()=>Me,deepMerge:()=>Ut,defaultTimeTickFormat:()=>ao,determinePathStatus:()=>xp,diff:()=>Pc,downloadUrl:()=>ks,enterpriseModule:()=>vt,extent:()=>rs,extractDecoratedProperties:()=>Tt,findMinMax:()=>Ws,findQuadtreeMatch:()=>Ap,findRangeExtent:()=>Vs,fixNumericExtent:()=>Uh,fromToMotion:()=>Tn,getDocument:()=>vs,getMissCount:()=>Xh,getPath:()=>Jt,getRectConfig:()=>Pp,getWindow:()=>Ss,groupAccumulativeValueProperty:()=>Hc,groupAverage:()=>Sc,groupBy:()=>ps,groupCount:()=>vc,groupSum:()=>xc,injectStyle:()=>Ds,isArray:()=>Ot,isBoolean:()=>Rt,isDate:()=>Et,isDecoratedObject:()=>Lt,isDefined:()=>Nt,isEnumKey:()=>Yt,isEnumValue:()=>$t,isEqual:()=>Ks,isFiniteNumber:()=>Vt,isFunction:()=>Ft,isHtmlElement:()=>Kt,isNegative:()=>Ys,isNumber:()=>Wt,isObject:()=>zt,isObjectLike:()=>Gt,isPlainObject:()=>_t,isProperties:()=>be,isRegExp:()=>Bt,isString:()=>jt,isSymbol:()=>Ht,isValidDate:()=>Pt,jsonApply:()=>we,jsonDiff:()=>Se,jsonWalk:()=>De,keyProperty:()=>Wc,listDecoratedProperties:()=>At,mapIterable:()=>ys,mapValues:()=>qt,markerFadeInAnimation:()=>Yu,markerPaletteFactory:()=>Nu,markerScaleInAnimation:()=>$u,markerSwipeScaleInAnimation:()=>Hu,mergeArrayDefaults:()=>Zt,mergeDefaults:()=>Xt,midpointStartingBarPosition:()=>Gp,minMax:()=>Qu,mod:()=>Us,moduleRegistry:()=>Mt,normaliseGroupTo:()=>Lc,normalisePropertyTo:()=>Tc,normalisedExtent:()=>ls,normalisedExtentWithMetadata:()=>hs,pairCategoryData:()=>fp,pairContinuousData:()=>yp,partialAssign:()=>ie,pathFadeInAnimation:()=>ap,pathFadeOutAnimation:()=>op,pathSwipeInAnimation:()=>np,pickByMatchingAngle:()=>Ng,predicateWithMessage:()=>Ga,prepareAreaPathAnimation:()=>Dp,prepareAxisAnimationContext:()=>pl,prepareAxisAnimationFunctions:()=>yl,prepareBarAnimationFunctions:()=>_p,prepareLinePathAnimation:()=>vp,prepareLinePathAnimationFns:()=>bp,prepareMarkerAnimation:()=>Zu,preparePieSeriesAnimationFunctions:()=>Ag,range:()=>bc,rangedValueProperty:()=>Kc,renderPartialPath:()=>sp,resetAxisGroupFn:()=>fl,resetAxisLabelSelectionFn:()=>bl,resetAxisLineSelectionFn:()=>vl,resetAxisSelectionFn:()=>xl,resetBarSelectionsFn:()=>jp,resetIds:()=>Bs,resetLabelFn:()=>Fu,resetMarkerFn:()=>Uu,resetMarkerPositionFn:()=>Xu,resetMotion:()=>mr,resetPieSelectionsFn:()=>Tg,round:()=>$s,seriesLabelFadeInAnimation:()=>Pu,seriesLabelFadeOutAnimation:()=>Bu,setDocument:()=>ws,setPath:()=>ee,setWindow:()=>Is,shallowClone:()=>ke,singleSeriesPaletteFactory:()=>Tu,staticFromToMotion:()=>Nn,stringify:()=>Wa,sum:()=>fc,sumValues:()=>yc,toArray:()=>ds,toFixed:()=>Hs,toTooltipHtml:()=>sl,trailingAccumulatedValue:()=>Dc,trailingAccumulatedValueProperty:()=>$c,unique:()=>us,updateClipPath:()=>lp,updateLabelNode:()=>Vp,updateRect:()=>Ep,validateCrossLineValues:()=>Zo,valueProperty:()=>Vc,without:()=>Qt});var Ym=class t{constructor(t,e,i,s,n,a,o,r,l,h,c){this.series=t,this.index=e,this.datum=i,this.size=s,this.colorValue=n,this.fill=a,this.stroke=o,this.sumSize=r,this.depth=l,this.parent=h,this.children=c,this.midPoint={x:0,y:0}}contains(t){let e=t;for(;null!=e&&e.index>=this.index;){if(e===this)return!0;e=e.parent}return!1}walk(e,i=t.Walk.PreOrder){i===t.Walk.PreOrder&&e(this),this.children.forEach(t=>{t.walk(e,i)}),i===t.Walk.PostOrder&&e(this)}*[Symbol.iterator](){yield this;for(const t of this.children)yield*k(t)}};Ym.Walk={PreOrder:0,PostOrder:1};var $m=Ym,Hm=class extends Zc{constructor(t){super({moduleCtx:t,pickModes:[0],contentGroupVirtual:!1}),this.rootNode=new $m(this,0,void 0,0,void 0,void 0,void 0,0,void 0,void 0,[]),this.colorDomain=[0,0],this.maxDepth=0,this.animationState=new yr("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t&&this.animationState.transition("skip")}processData(){return S(this,null,function*(){var t,e;const{childrenKey:i,sizeKey:s,colorKey:n,fills:a,strokes:o,colorRange:r}=this.properties;let l=0,h=0,c=1/0,d=-1/0;const u=new Array((null!=(e=null==(t=this.data)?void 0:t.length)?e:0)+1).fill(void 0),p=(t,e)=>{const a=(l+=1,l),o=null!=e.depth?e.depth+1:0,r=null!=i?t[i]:void 0,p=null==r||0===r.length;let m=null!=s?t[s]:void 0;m=Number.isFinite(m)?Math.max(m,0):p?1:0;const y=m;h=Math.max(h,o);const f=null!=n?t[n]:void 0;return"number"==typeof f&&(u[a]=f,c=Math.min(c,f),d=Math.max(d,f)),g(new $m(this,a,t,m,f,void 0,void 0,y,o,e,[]),r)},g=(t,e)=>(null==e||e.forEach(e=>{const i=p(e,t);t.children.push(i),t.sumSize+=i.sumSize}),t),m=g(new $m(this,0,void 0,0,void 0,void 0,void 0,0,void 0,void 0,[]),this.data),y=[c,d];let f;null!=r&&Number.isFinite(c)&&Number.isFinite(d)&&(f=new Up,f.domain=y,f.range=r,f.update()),m.children.forEach((t,e)=>{t.walk(t=>{let i;const s=u[t.index];null!=s&&(i=null==f?void 0:f.convert(s)),null!=i||(i=null==a?void 0:a[e%a.length]),t.fill=i,t.stroke=null==f?null==o?void 0:o[e%o.length]:"rgba(0, 0, 0, 0.2)"})}),this.rootNode=m,this.maxDepth=h,this.colorDomain=y})}update(t){return S(this,arguments,function*({seriesRect:t}){yield this.updateSelections(),yield this.updateNodes();const e=this.getAnimationData();this.checkResize(t)&&this.animationState.transition("resize",e),this.animationState.transition("update",e)})}resetAllAnimation(t){var e;const i=null==(e=this.animationResetFns)?void 0:e.datum;this.ctx.animationManager.stopByAnimationGroupId(this.id),null!=i&&mr(t.datumSelections,i)}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){var e;const i=null==(e=this.animationResetFns)?void 0:e.datum;null!=i&&mr([t],i)}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animationTransitionClear(){this.animationState.transition("clear",this.getAnimationData())}getAnimationData(){return{datumSelections:[this.groupSelection]}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}getLabelData(){return[]}getSeriesDomain(){return[NaN,NaN]}getLegendData(t){const{colorKey:e,colorName:i,colorRange:s,visible:n}=this.properties;return"gradient"===t&&null!=e&&null!=s?[{legendType:"gradient",enabled:n,seriesId:this.id,colorName:i,colorRange:s,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(t){return`${t.index}`}getDatumId(t){return this.getDatumIdFromData(t)}},Um=class extends Gd{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Be),this.strokes=Object.values(Fe)}};b([$n(ta)],Um.prototype,"childrenKey",2),b([$n(ta,{optional:!0})],Um.prototype,"sizeKey",2),b([$n(ta,{optional:!0})],Um.prototype,"colorKey",2),b([$n(ta,{optional:!0})],Um.prototype,"colorName",2),b([$n(ya)],Um.prototype,"fills",2),b([$n(ya)],Um.prototype,"strokes",2),b([$n(ya,{optional:!0})],Um.prototype,"colorRange",2);var Xm=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)}},Zm=0},45401(t,e,i){"use strict";i.d(e,{Ku:()=>Cf,LW:()=>DS,Mo:()=>bS,On:()=>Lf,a9:()=>CS,n1:()=>LS,uB:()=>iM,ui:()=>yS,xv:()=>Hi});var s=i(26203),n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=(t,e)=>{for(var i in e)n(t,i,{get:e[i],enumerable:!0})},r=(t,e,i,s)=>{for(var o,r=s>1?void 0:s?a(e,i):e,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(s?o(e,i,r):o(r))||r);return s&&r&&n(e,i,r),r},l=class{constructor(){this.destroyFns=[]}destroy(){for(const t of this.destroyFns)t()}},h=new class{constructor(){this.modules=[],this.dependencies=new Map,this.modulesByOptionKey=new Map}register(...t){for(const e of t){this.registerDependencies(e);const t=this.modules.find(t=>!(e.type!==t.type||"optionsKey"in e&&"optionsKey"in t&&e.optionsKey!==t.optionsKey||e.identifier!==t.identifier));if(t){if("enterprise"===e.packageType&&"community"===t.packageType){const i=this.modules.indexOf(t);this.modules.splice(i,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=>"enterprise"===t.packageType)}*byType(...t){const e=new Set,i=this.modules.filter(e=>t.includes(e.type)),s=t=>{const e=this.dependencies.get(t);return e?.flatMap(s).concat(e)??[]},n=[];for(const a of i){const i="optionsKey"in a?a.optionsKey:a.contextKey;if(!e.has(i)){for(const a of s(i)){if(e.has(a))continue;const i=this.modulesByOptionKey.get(a);i?t.includes(i.type)&&(yield i,e.add(a)):n.push(a)}yield a,e.add(i)}}if(n.length>0)throw new Error(`Could not resolve module dependencies: ${n}`)}registerDependencies(t){if(null==t.dependencies||0===t.dependencies.length)return;const e="optionsKey"in t?t.optionsKey:t.contextKey;this.dependencies.set(e,t.dependencies)}},c={containsPoint:function(t,e,i){return e>=t.x&&e<=t.x+t.width&&i>=t.y&&i<=t.y+t.height},equals:function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},isEmpty:function(t){return null==t||0===t.height||0===t.width||isNaN(t.height)||isNaN(t.width)},normalize:function(t){let{x:e,y:i,width:s,height:n}=t;return(null==s||s>0)&&(null==n||n>0)?t:(null!=e&&null!=s&&s<0&&(s=-s,e-=s),null!=i&&null!=n&&n<0&&(n=-n,i-=n),{x:e,y:i,width:s,height:n})}},d=Symbol("interpolate"),u=t=>null!=t[d];function p(t,e,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const s of i){const i=s.distanceSquared(t,e);if(0===i)return{nearest:s,distanceSquared:0};i<n.distanceSquared&&(n.nearest=s,n.distanceSquared=i)}return n}function g(t,e,i,s=1/0){const{x:n=t,y:a=e}=i.transformPoint?.(t,e)??{},o={nearest:void 0,distanceSquared:s};for(const t of i.children){const{nearest:e,distanceSquared:i}=t.nearestSquared(n,a,o.distanceSquared);if(0===i)return{nearest:e,distanceSquared:i};i<o.distanceSquared&&(o.nearest=e,o.distanceSquared=i)}return o}var m=class t{constructor(t,e,i,s){this.x=t,this.y=e,this.width=i,this.height=s}static fromDOMRect({x:e,y:i,width:s,height:n}){return new t(e,i,s,n)}static merge(e){let i=1/0,s=1/0,n=-1/0,a=-1/0;for(const t of e)t.x<i&&(i=t.x),t.y<s&&(s=t.y),t.x+t.width>n&&(n=t.x+t.width),t.y+t.height>a&&(a=t.y+t.height);return new t(i,s,n-i,a-s)}static nearestBox(t,e,i){return p(t,e,i)}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:()=>({})}}clone(){const{x:e,y:i,width:s,height:n}=this;return new t(e,i,s,n)}equals(t){return c.equals(this,t)}containsPoint(t,e){return c.containsPoint(this,t,e)}intersection(e){if(!this.collidesBBox(e))return;const i=(0,s.qE)(e.x,this.x,e.x+e.width),n=(0,s.qE)(e.y,this.y,e.y+e.height),a=(0,s.qE)(e.x,this.x+this.width,e.x+e.width),o=(0,s.qE)(e.y,this.y+this.height,e.y+e.height);return new t(i,n,a-i,o-n)}collidesBBox(t){return this.x<t.x+t.width&&this.x+this.width>t.x&&this.y<t.y+t.height&&this.y+this.height>t.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(t,e){if(this.containsPoint(t,e))return 0;const i=t-(0,s.qE)(this.x,t,this.x+this.width),n=e-(0,s.qE)(this.y,e,this.y+this.height);return i*i+n*n}shrink(t,e){if("number"==typeof t)this.applyMargin(t,e);else for(const e of Object.keys(t)){const i=t[e];"number"==typeof i&&this.applyMargin(i,e)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(t,e){if("number"==typeof t)this.applyMargin(-t,e);else for(const e of Object.keys(t)){const i=t[e];"number"==typeof i&&this.applyMargin(-i,e)}return this}applyMargin(t,e){switch(e){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=2*t;break;case"horizontal":this.x+=t,this.width-=2*t;break;case void 0:this.x+=t,this.y+=t,this.width-=2*t,this.height-=2*t}}translate(t,e){return this.x+=t,this.y+=e,this}[d](e,i){return new t(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)}};m.zero=Object.freeze(new m(0,0,0,0)),m.NaN=Object.freeze(new m(NaN,NaN,NaN,NaN));var y=m,f=Date.now(),x={create:(...t)=>Object.assign((...e)=>{x.check(...t)&&("function"==typeof e[0]&&(e=(0,s.$r)(e[0]())),(()=>{const t=Date.now()-f;if(t>2e3){const e=(Math.floor(t/100)/10).toFixed(1);s.Vy.log(`**** ${e}s since last log message ****`)}f=Date.now()})(),s.Vy.log(...e))},{check:()=>x.check(...t),group:(e,i)=>x.check(...t)?s.Vy.logGroup(e,i):i()}),check:(...t)=>(0===t.length&&t.push(!0),(0,s.$r)((0,s.zk)("agChartsDebug")).some(e=>t.includes(e))),inDevelopmentMode(t){if(x.check("dev"))return t()}};function b({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 v(t){if(x.check("canvas")){const e=t.save.bind(t),i=t.restore.bind(t);let s=0;Object.assign(t,{save(){e(),s++},restore(){if(0===s)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(0!==s)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function S(t,e,i){return[Math.floor(t*i),Math.floor(e*i)]}var M=class{constructor(t){const{width:e,height:i,pixelRatio:s,willReadFrequently:n=!1}=t;this.width=e,this.height=i,this.pixelRatio=s;const[a,o]=S(e,i,s);this.canvas=new OffscreenCanvas(a,o),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),v(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[n,a]=S(t,e,i);s.width=n,s.height=a}n.setTransform(i,0,0,i,0,0),this.width=t,this.height=e,this.pixelRatio=i}clear(){b(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)}},k=Symbol("BREAK"),D="__decorator_config",w="__decorator_accessors";function I(t,e){if(null==Object.getOwnPropertyDescriptor(t,D)&&Object.defineProperty(t,D,{value:{}}),null==Object.getOwnPropertyDescriptor(t,w)){const e=Object.getPrototypeOf(t)?.[w],i=e?.slice()??[];Object.defineProperty(t,w,{value:i})}const i=t[D],s=e.toString();if(null!=i[s])return i[s];i[s]={setters:[],getters:[],observers:[]};const n=Object.getOwnPropertyDescriptor(t,e);let a=n?.get,o=n?.set;if(null==a||null==o){const i=t[w];let s=i.indexOf(e);-1===s&&(s=i.push(e)-1),a??(a=function(){let t=this.__accessors;return null==t&&(t=i.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:t})),t[s]}),o??(o=function(t){let e=this.__accessors;null==e&&(e=i.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:e})),e[s]=t})}return Object.defineProperty(t,e,{set:function(t){const{setters:n,observers:r}=i[s];let l;n.some(t=>t.length>2)&&(l=a.call(this));for(const i of n)if((t=i(this,e,t,l))===k)return;o.call(this,t);for(const e of r)e(this,t,l)},get:function(){let t=a.call(this);for(const n of i[s].getters)if(t=n(this,e,t),t===k)return;return t},enumerable:!0,configurable:!1}),i[s]}function C(t,e,i){return(s,n)=>{const a=I(s,n);a.setters.push(t),e&&a.getters.unshift(e),i&&Object.assign(a,i)}}function L(t){return(e,i)=>{I(e,i).observers.push(t)}}function A(t){return void 0!==t&&D in t}function T(t){const e=new Set;for(;A(t);)e.add(t?.[D]),t=Object.getPrototypeOf(t);return Array.from(e).flatMap(t=>Object.keys(t))}function N(t){return T(t).reduce((e,i)=>(e[i]=t[i]??null,e),{})}function O(t,e){return Array.isArray(t)?!!Array.isArray(e)&&t.length===e.length&&t.every((t,i)=>O(t,e[i])):(0,s.Qd)(t)?!!(0,s.Qd)(e)&&R(t,e,O):t===e}function R(t,e,i){if(Object.is(t,e))return!0;for(const i of Object.keys(e))if(!(i in t))return!1;for(const s of Object.keys(t)){if(!(s in e))return!1;if(!i(t[s],e[s]))return!1}return!0}function E(...t){const e={};for(const i of t){if(!(0,s.Gv)(i))continue;const t=A(i)?T(i):Object.keys(i);for(const n of t)(0,s.Qd)(e[n])&&(0,s.Qd)(i[n])?e[n]=E(e[n],i[n]):e[n]??(e[n]=i[n])}return e}function P(...t){const e={};for(const i of t){if(!(0,s.Gv)(i))continue;const t=A(i)?T(i):Object.keys(i);for(const n of t)(0,s.Qd)(e[n])&&(0,s.Qd)(i[n])?e[n]=P(e[n],i[n]):n in e||(e[n]??(e[n]=i[n]))}return e}function B(t,...e){return e&&(0,s.cy)(t)?t.map(t=>E(t,...e)):t}function F(t,e){const i={};for(const[n,a]of(0,s.jO)(t))i[n]=e(a,n,t);return i}function z(t,e){const i={...t};for(const t of e)delete i[t];return i}function G(t,e){return((0,s.cy)(e)?e:e.split(".")).reduce((t,e)=>t[e],t)}var _=new Set(["__proto__","constructor","prototype"]);function j(t,e,i){const n=(0,s.cy)(e)?e.slice():e.split("."),a=n.pop();if(n.some(t=>_.has(t)))return;const o=n.reduce((t,e)=>t[e],t);return o[a]=i,o[a]}function W(t,e,i){if(void 0===i)return e;for(const s of t){const t=i[s];void 0!==t&&(e[s]=t)}return e}function V(t){return null!=t&&"object"==typeof t&&(0,s.Qd)(t)?(Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const i=t[e];null===i||"object"!=typeof i&&"function"!=typeof i||Object.isFrozen(i)||V(i)}),t):t}function K(t,e){return(0,s.Qd)(t)&&e in t}function Y(t,e){return K(t,e)&&"string"==typeof t[e]}var $=(t,e)=>t===e;function H(t){return function(e,i){const s=`__${i}`;e[i]||function(t,e,i,s){const{changeCb:n,convertor:a,checkDirtyOnAssignment:o=!1}=s??{},r={changeCb:n,checkDirtyOnAssignment:o,convertor:a},l=function(t,e,i){const{checkDirtyOnAssignment:s}=i;return s?function(i){const s=e.call(this,i);return!0===i?._dirty&&this.markDirty(t),s}:e}(i,function(t,e){const{changeCb:i}=e;return i?function(e){const s=t.call(this,e);return s!==Z&&i.call(this,this),s}:t}(function(t,e){const{convertor:i}=e;return i?function(e){t.call(this,i(e))}:t}(function(t,e){const{equals:i=$}=e;return function(e){const s=this[t];return i(e,s)?Z:(this[t]=e,this.onChangeDetection(t),e)}}(i,r),r),r),r);Object.defineProperty(t,e,{set:l,get:function(){return this[i]},enumerable:!0,configurable:!0})}(e,i,s,t)}}function U(t){return H(t)}function X(t){return(t??{}).equals=s.r1,H(t)}var Z=Symbol("no-change"),q=(t=>(t[t.All=0]="All",t[t.None=1]="None",t))(q||{}),Q=class t{constructor(e){this.serialNumber=t._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=(0,s.sX)(this),this.pointerEvents=0,this.scene=void 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,(e?.debugDirty??t._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(t,e,i){const n=t?.toSVG();if(null==n||!n.elements.length&&!n.defs?.length)return;const a=(0,s.FJ)("svg");if(a.setAttribute("width",String(e)),a.setAttribute("height",String(i)),a.setAttribute("viewBox",`0 0 ${e} ${i}`),n.defs?.length){const t=(0,s.FJ)("defs");t.append(...n.defs),a.append(t)}return a.append(...n.elements),a.outerHTML}static*extractBBoxes(t,e){for(const i of t)if(!e||i.visible&&!i.transitionOut){const t=i.getBBox();t&&(yield t)}}get datum(){return this._datum}set datum(t){this._datum!==t&&(this._previousDatum=this._datum,this._datum=t)}get previousDatum(){return this._previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}get dirty(){return this._dirty}closestDatum(){for(const{datum:t}of this.traverseUp(!0))if(null!=t)return t}preRender(t,e=1){this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=e,this.childNodeCounts.thisComplexity=e;for(const e of this.children()){const i=e.preRender(t);this.childNodeCounts.groups+=i.groups,this.childNodeCounts.nonGroups+=i.nonGroups,this.childNodeCounts.complexity+=i.complexity}return this.childNodeCounts}render(t){const{stats:e}=t;if(this._dirty=!1,this.debugDirtyProperties(),t.debugNodeSearch){const e=this.name??this.id;t.debugNodeSearch.some(t=>"string"==typeof t?t===e:t.test(e))&&(t.debugNodes[this.name??this.id]=this)}e&&(e.nodesRendered++,e.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(t){this.scene=t,this._debug=t?.layersManager?.debug;for(const e of this.children())e.setScene(t)}sortChildren(t){if(this.dirtyZIndex=!1,!this.childNodes)return;const e=[...this.childNodes].sort(t);this.childNodes.clear();for(const t of e)this.childNodes.add(t)}*traverseUp(t){let e=this;for(t&&(yield e);e=e.parentNode;)yield e}*children(){if(this.childNodes)for(const t of this.childNodes)yield t}*descendants(){for(const t of this.children())yield t,yield*t.descendants()}isLeaf(){return!this.childNodes?.size}isRoot(){return!this.parentNode}append(t){this.childNodes??(this.childNodes=new Set);for(const e of(0,s.Rp)(t))e.parentNode?.removeChild(e),this.childNodes.add(e),e.parentNode=this,e.setScene(this.scene);this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}appendChild(t){return this.append(t),t}removeChild(t){if(!this.childNodes?.delete(t))throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`);delete t.parentNode,t.setScene(),this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}remove(){this.parentNode?.removeChild(this)}clear(){for(const t of this.children())delete t.parentNode,t.setScene();this.childNodes?.clear(),this.invalidateCachedBBox()}destroy(){this.parentNode?.removeChild(this)}setProperties(t,e){if(e)for(const i of e)this[i]=t[i];else Object.assign(this,t);return this}containsPoint(t,e){return!1}pickNode(t,e){if(this.visible&&1!==this.pointerEvents&&this.containsPoint(t,e))if(null!=this.childNodes&&0!==this.childNodes.size){const i=[...this.children()];for(let s=i.length-1;s>=0;s--){const n=i[s].pickNode(t,e);if(n)return n}}else if(!this.isContainerNode)return this}pickNodes(t,e,i=[]){if(!this.visible||1===this.pointerEvents||!this.containsPoint(t,e))return i;this.isContainerNode||i.push(this);for(const s of this.children())s.pickNodes(t,e,i);return i}invalidateCachedBBox(){null!=this.cachedBBox&&(this.cachedBBox=void 0,this.parentNode?.invalidateCachedBBox())}getBBox(){return null==this.cachedBBox&&(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(t){this.markDirty(t)}markDirty(t){const{_dirty:e}=this;null!=t&&this._debugDirtyProperties&&this.markDebugProperties(t),null==this.cachedBBox&&e||(this.invalidateCachedBBox(),this._dirty=!0,this.parentNode&&this.parentNode.markDirty())}markClean(){if(this._dirty){this._dirty=!1,this.debugDirtyProperties();for(const t of this.children())t.markClean()}}markDebugProperties(t){const e=this._debugDirtyProperties?.get(t)??[],i=(new Error).stack?.split("\n").filter(t=>!("Error"===t||t.includes(".markDebugProperties")||t.includes(".markDirty")||t.includes("Object.assign ")||t.includes(`${this.constructor.name}.`)))??"unknown";e.push(i[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(t,e)}debugDirtyProperties(){null!=this._debugDirtyProperties&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((t,e)=>{t.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${e} (${t.length}x)`),t.forEach(t=>console.log(t)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){const{parentNode:t}=this;t&&(t.dirtyZIndex=!0)}toSVG(){}};Q._nextSerialNumber=0,Q._debugEnabled=!1,r([H()],Q.prototype,"visible",2),r([U({equals:O,changeCb:t=>t.onZIndexChange()})],Q.prototype,"zIndex",2);var J=Q,tt=2*Math.PI,et=Math.PI/2;function it(t){return t%=tt,(t+=tt)%tt}function st(t){return t%=tt,(t+=tt)!==tt&&(t%=tt),t}function nt(t){return(t%=tt)<-Math.PI?t+=tt:t>=Math.PI&&(t-=tt),t}function at(t,e,i){const s=it(t),n=it(e),a=it(i);return n<a?n<=s&&s<=a:!(n>a)||n<=s||s<=a}function ot(t){return t/180*Math.PI}function rt(t){return t/Math.PI*180}function lt(t,e){return t=it(t),(e=it(e))-t+(t>e?tt:0)}function ht(t){const e=it(t);return e<=et?e/et:e<=Math.PI?(Math.PI-e)/et:e<=1.5*Math.PI?(e-Math.PI)/et:(tt-e)/et}function ct(t,e,i){const s=ht(i);return t*s+e*Math.abs(1-s)}function dt(t){return t?it(ot(t)):0}var ut=(t,e,i)=>t*(1-i)+e*i,pt=t=>{const e=t<0?-1:1,i=Math.abs(t);return i<=.04045?t/12.92:e*((i+.055)/1.055)**2.4},gt=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},mt=class t{constructor(t,e,i,n=1){this.r=(0,s.qE)(0,t||0,1),this.g=(0,s.qE)(0,e||0,1),this.b=(0,s.qE)(0,i||0,1),this.a=(0,s.qE)(0,n||0,1)}static validColorString(e){return e.indexOf("#")>=0?!!t.parseHex(e):e.indexOf("rgb")>=0?!!t.stringToRgba(e):t.nameToHex.has(e.toLowerCase())}static fromString(e){if(e.indexOf("#")>=0)return t.fromHexString(e);const i=t.nameToHex.get(e.toLowerCase());if(i)return t.fromHexString(i);if(e.indexOf("rgb")>=0)return t.fromRgbaString(e);throw new Error(`Invalid color string: '${e}'`)}static parseHex(t){let e;switch((t=t.replace(/ /g,"").slice(1)).length){case 6:case 8:e=[];for(let i=0;i<t.length;i+=2)e.push(parseInt(`${t[i]}${t[i+1]}`,16));break;case 3:case 4:e=t.split("").map(t=>parseInt(t,16)).map(t=>t+16*t)}if(e?.length>=3&&e.every(t=>t>=0))return 3===e.length&&e.push(255),e}static fromHexString(e){const i=t.parseHex(e);if(i){const[e,s,n,a]=i;return new t(e/255,s/255,n/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${e}'`)}static stringToRgba(t){let e=-1,i=-1;for(let s=0;s<t.length;s++){const n=t[s];if(-1===e&&"("===n)e=s;else if(")"===n){i=s;break}}if(-1===e||-1===i)return;const n=t.substring(e+1,i).split(","),a=[];for(let t=0;t<n.length;t++){const e=n[t];let i=parseFloat(e);if(!Number.isFinite(i))return;e.indexOf("%")>=0?(i=(0,s.qE)(0,i,100),i/=100):3===t?i=(0,s.qE)(0,i,1):(i=(0,s.qE)(0,i,255),i/=255),a.push(i)}return a}static fromRgbaString(e){const i=t.stringToRgba(e);if(i){if(3===i.length)return new t(i[0],i[1],i[2]);if(4===i.length)return new t(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${e}'`)}static fromArray(e){if(4===e.length)return new t(e[0],e[1],e[2],e[3]);if(3===e.length)return new t(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 a=t.HSBtoRGB(e,i,s);return new t(a[0],a[1],a[2],n)}static fromHSL(e,i,s,n=1){const a=t.HSLtoRGB(e,i,s);return new t(a[0],a[1],a[2],n)}static fromOKLCH(e,i,s,n=1){const a=t.OKLCHtoRGB(e,i,s);return new t(a[0],a[1],a[2],n)}static padHex(t){return 1===t.length?"0"+t:t}toHexString(){let e="#"+t.padHex(Math.round(255*this.r).toString(16))+t.padHex(Math.round(255*this.g).toString(16))+t.padHex(Math.round(255*this.b).toString(16));return this.a<1&&(e+=t.padHex(Math.round(255*this.a).toString(16))),e}toRgbaString(t=3){const e=[Math.round(255*this.r),Math.round(255*this.g),Math.round(255*this.b)],i=Math.pow(10,t);return 1!==this.a?(e.push(Math.round(this.a*i)/i),`rgba(${e.join(", ")})`):`rgb(${e.join(", ")})`}toString(){return 1===this.a?this.toHexString():this.toRgbaString()}toHSB(){return t.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,e,i){const s=pt(t),n=pt(e),a=pt(i),o=Math.cbrt(.4122214708*s+.5363325363*n+.0514459929*a),r=Math.cbrt(.2119034982*s+.6806995451*n+.1073969566*a),l=Math.cbrt(.0883024619*s+.2817188376*n+.6299787005*a),h=.2104542553*o+.793617785*r-.0040720468*l,c=1.9779984951*o-2.428592205*r+.4505937099*l,d=.0259040371*o+.7827717662*r-.808675766*l,u=180*Math.atan2(d,c)/Math.PI;return[h,Math.hypot(c,d),u>=0?u:u+360]}static OKLCHtoRGB(t,e,i){const s=t,n=e*Math.cos(i*Math.PI/180),a=e*Math.sin(i*Math.PI/180),o=(s+.3963377774*n+.2158037573*a)**3,r=(s-.1055613458*n-.0638541728*a)**3,l=(s-.0894841775*n-1.291485548*a)**3,h=-1.2684380046*o+2.6097574011*r-.3413193965*l,c=-.0041960863*o-.7034186147*r+1.707614701*l;return[gt(4.0767416621*o-3.3077115913*r+.2309699292*l),gt(h),gt(c)]}static RGBtoHSL(t,e,i){const s=Math.min(t,e,i),n=Math.max(t,e,i),a=(n+s)/2;let o,r;if(n===s)o=0,r=0;else{const l=n-s;r=a>.5?l/(2-n-s):l/(n+s),o=n===t?(e-i)/l+(e<i?6:0):n===e?(i-t)/l+2:(t-e)/l+4,o*=60}return[o,r,a]}static HSLtoRGB(t,e,i){if(0===e)return[i,i,i];const s=i<.5?i*(1+e):i+e-i*e,n=2*i-s;function a(t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+6*(s-n)*t:t<.5?s:t<2/3?n+(s-n)*(2/3-t)*6:n}return[a((t=(t%360+360)%360)/360+1/3),a(t/360),a(t/360-1/3)]}static RGBtoHSB(t,e,i){const s=Math.min(t,e,i),n=Math.max(t,e,i);let a=0;if(s!==n){const o=n-s,r=(n-t)/o,l=(n-e)/o,h=(n-i)/o;a=t===n?h-l:e===n?2+r-h:4+l-r,a/=6,a<0&&(a+=1)}return[360*a,0===n?0:(n-s)/n,n]}static HSBtoRGB(t,e,i){t=(t%360+360)%360/360;let s=0,n=0,a=0;if(0===e)s=n=a=i;else{const o=6*(t-Math.floor(t)),r=o-Math.floor(o),l=i*(1-e),h=i*(1-e*r),c=i*(1-e*(1-r));switch(0|o){case 0:s=i,n=c,a=l;break;case 1:s=h,n=i,a=l;break;case 2:s=l,n=i,a=c;break;case 3:s=l,n=h,a=i;break;case 4:s=c,n=l,a=i;break;case 5:s=i,n=l,a=h}}return[s,n,a]}static mix(e,i,s){return new t(ut(e.r,i.r,s),ut(e.g,i.g,s),ut(e.b,i.b,s),ut(e.a,i.a,s))}static lighten(e,i){const n=t.RGBtoOKLCH(e.r,e.g,e.b);return t.fromOKLCH((0,s.qE)(0,n[0]+i,1),n[1],n[2])}static darken(e,i){const n=t.RGBtoOKLCH(e.r,e.g,e.b);return t.fromOKLCH((0,s.qE)(0,n[0]-i,1),n[1],n[2])}static interpolate(e,i){const s=1/(e.length-1),n=e.map(e=>t.RGBtoOKLCH(e.r,e.g,e.b));return Array.from({length:i},(a,o)=>{const r=o/(i-1),l=e.length<=2?0:Math.min(Math.floor(r*(e.length-1)),e.length-2),h=(r-l*s)/s,c=n[l],d=n[l+1];return t.fromOKLCH(ut(c[0],d[0],h),ut(c[1],d[1],h),ut(c[2],d[2],h))})}};mt.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 yt=mt,ft=class{ticks(t,e,i){}niceDomain(t,e=this.domain){return e}tickFormatter(t){}datumFormatter(t){}get bandwidth(){}get step(){}get inset(){}},xt=(t,e)=>{const i=Symbol(String(e));t[i]=void 0,Object.defineProperty(t,e,{get(){return this[i]},set(t){this[i]!==t&&(this[i]=t,this.invalid=!0)},enumerable:!0,configurable:!1})},bt=t=>{const e=yt.fromString(t),[i,s,n]=yt.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:s,h:n,a:e.a}},vt=1e-6,St=t=>t.c<vt||t.l<vt||t.l>1-vt,Mt=class extends ft{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(bt)}update(){const{domain:t,range:e}=this;t.length<2&&(s.Vy.warnOnce("`colorDomain` should have at least 2 values."),0===t.length?t.push(0,1):1===t.length&&t.push(t[0]+1));for(let e=1;e<t.length;e++)if(t[e-1]>=t[e]){s.Vy.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((t,e)=>t-e);break}if(e.length<t.length)for(let i=e.length;i<t.length;i++)e.push(e.length>0?e[0]:"black");this.parsedRange=this.range.map(bt)}normalizeDomains(...t){return{domain:t.flat(),animatable:!0}}toDomain(){}convert(t){this.refresh();const{domain:e,range:i,parsedRange:n}=this,a=e[0],o=e.at(-1),r=i[0],l=i[i.length-1];if(t<=a)return r;if(t>=o)return l;let h,c;if(2===e.length){const e=(t-a)/(o-a),s=1/(i.length-1);h=i.length<=2?0:Math.min(Math.floor(e*(i.length-1)),i.length-2),c=(e-h*s)/s}else{for(h=0;h<e.length-2&&!(t<e[h+1]);h++);const i=e[h];c=(t-i)/(e[h+1]-i)}return((t,e,i)=>{let n;if(i=(0,s.qE)(0,i,1),St(t))n=e.h;else if(St(e))n=t.h;else{const s=t.h;let a=e.h;const o=e.h-t.h;o>180?a-=360:o<-180&&(a+=360),n=s*(1-i)+a*i}const a=t.c*(1-i)+e.c*i,o=t.l*(1-i)+e.l*i,r=t.a*(1-i)+e.a*i;return yt.fromOKLCH(o,a,n,r)})(n[h],n[h+1],c).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&s.Vy.warnOnce("Expected update to not invalidate scale"))}};r([xt],Mt.prototype,"domain",2),r([xt],Mt.prototype,"range",2);var kt=class{constructor(t,e=[],i){this.colorSpace=t,this.stops=e,this.bbox=i,this._cache=void 0}createGradient(t,e,i){const s=this.bbox??e;if(isNaN(s.x)||isNaN(s.y))return;if(null!=this._cache&&this._cache.ctx===t&&this._cache.bbox.equals(s))return this._cache.gradient;const{stops:n,colorSpace:a}=this;if(0===n.length)return;if(1===n.length)return n[0].color;let o=this.createCanvasGradient(t,s,i);if(null==o)return;const r="oklch"===a;let l=n[0];o.addColorStop(l.stop,l.color);for(let t=1;t<n.length;t+=1){const e=n[t];if(r){const t=new Mt;t.domain=[l.stop,e.stop],t.range=[l.color,e.color];for(let i=l.stop+.05;i<e.stop;i+=.05)o.addColorStop(i,t.convert(i))}o.addColorStop(e.stop,e.color),l=e}return"createPattern"in o&&(o=o.createPattern()),this._cache={ctx:t,bbox:s,gradient:o},o}toSvg(t){const e=this.bbox??t,i=this.createSvgGradient(e);return this.stops.forEach(({stop:t,color:e})=>{const n=(0,s.FJ)("stop");n.setAttribute("offset",`${t}`),n.setAttribute("stop-color",`${e}`),i.appendChild(n)}),i}},Dt=class extends kt{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}createCanvasGradient(t,e,i){const{angle:s}=this,n=dt(s+-90),a=i?.centerX??e.x+.5*e.width,o=i?.centerY??e.y+.5*e.height;return t.createConicGradient(n,a,o)}createSvgGradient(t){return(0,s.FJ)("linearGradient")}},wt=class extends kt{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}getGradientPoints(t){const{angle:e}=this,i=dt(e+90),s=Math.cos(i),n=Math.sin(i),a=t.width,o=t.height,r=t.x+.5*a,l=t.y+.5*o,h=Math.sqrt(o*o+a*a)/2,c=Math.atan2(o,a);let d;d=i<Math.PI/2?i:i<Math.PI?Math.PI-i:i<1.5*Math.PI?i-Math.PI:2*Math.PI-i;const u=h*Math.abs(Math.cos(d-c));return{x0:r+s*u,y0:l+n*u,x1:r-s*u,y1:l-n*u}}createCanvasGradient(t,e){const{x0:i,y0:s,x1:n,y1:a}=this.getGradientPoints(e);if(!(isNaN(i)||isNaN(s)||isNaN(n)||isNaN(a)))return t.createLinearGradient(i,s,n,a)}createSvgGradient(t){const{x0:e,y0:i,x1:n,y1:a}=this.getGradientPoints(t),o=(0,s.FJ)("linearGradient");return o.setAttribute("x1",String(e)),o.setAttribute("y1",String(i)),o.setAttribute("x2",String(n)),o.setAttribute("y2",String(a)),o.setAttribute("gradientUnits","userSpaceOnUse"),o}},It=class extends kt{constructor(t,e,i){super(t,e,i)}createCanvasGradient(t,e,i){const s=i?.centerX??e.x+.5*e.width,n=i?.centerY??e.y+.5*e.height,a=i?.innerRadius??0,o=i?.outerRadius??Math.hypot(.5*e.width,.5*e.height)/Math.SQRT2;return t.createRadialGradient(s,n,a,s,n,o)}createSvgGradient(t){const e=t.x+.5*t.width,i=t.y+.5*t.height,n=(0,s.FJ)("radialGradient");return n.setAttribute("cx",String(e)),n.setAttribute("cy",String(i)),n.setAttribute("r",String(Math.hypot(.5*t.width,.5*t.height)/Math.SQRT2)),n.setAttribute("gradientUnits","userSpaceOnUse"),n}},Ct=function(t,e){I(t,e).optional=!0},Lt=class{handleUnknownProperties(t,e){}set(t){const{className:e=this.constructor.name}=this.constructor;if("object"!=typeof t)return s.Vy.warn(`unable to set ${e} - expecting a properties object`),this;const i=new Set(Object.keys(t));for(const e of T(this))if(i.has(e)){const n=t[e],a=this;if(Tt(a[e]))if(a[e]instanceof At){const t=a[e].reset(n);null!=t?a[e]=t:s.Vy.warn(`unable to set [${e}] - expecting a properties array`)}else a[e].set(n);else(0,s.Qd)(n)?a[e]=P(n,a[e]??{}):a[e]=n;i.delete(e)}this.handleUnknownProperties(i,t);for(const t of i)s.Vy.warn(`unable to set [${t}] in ${e} - property is unknown`);return this}toJson(){return T(this).reduce((t,e)=>{const i=this[e];return t[e]=Tt(i)?i.toJson():i,t},{})}},At=class t extends Array{constructor(t,...e){super(e.length);const i=(s=t,Boolean(s?.prototype?.constructor?.name)?e=>(new t).set(e):t);var s;Object.defineProperty(this,"itemFactory",{value:i,enumerable:!1,configurable:!1}),this.set(e)}set(t){if((0,s.cy)(t)){this.length=t.length;for(let e=0;e<t.length;e++)this[e]=this.itemFactory(t[e])}return this}reset(e){if(Array.isArray(e))return new t(this.itemFactory,...e)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function Tt(t){return t instanceof Lt||t instanceof At}var Nt=class extends Lt{constructor(){super(...arguments),this.color="black"}};function Ot(t){return t.flatMap((e,i)=>{const{stop:s}=e,n=t.at(i+1)?.color;return null!=n?[e,{stop:s,color:n}]:[e]})}function Rt(t,e,i,n="continuous"){const a=t.map(t=>"string"==typeof t?{color:t}:t);if(0===a.length)return function(t,e){const i="discrete"===e?1:0,s=t.map((t,e,{length:s})=>({stop:(e+i)/(s-1+i),color:t}));return"discrete"===e?Ot(s):s}(e,n);if(!function(t){let e;for(const i of t)if(null!=i?.stop){if(null!=e&&i.stop<e)return!1;e=i.stop}return!0}(a))return s.Vy.warnOnce("[fills] must have the stops defined in ascending order"),[];const o=Math.min(...i),r=Math.max(...i),l="discrete"===n,h=new Float64Array(a.length);let c=0,d=-1;for(let t=0;t<a.length;t+=1){const e=a[t];if(t>=d){d=a.length-1;for(let e=t+1;e<a.length;e+=1)if(null!=a[e]?.stop){d=e;break}}let i=e?.stop;if(null==i){const e=a[c]?.stop,s=a[d]?.stop,n=e??o,h=l&&null==e?1:0;i=n+((s??r)-n)*(t-c+h)/(d-c+h)}else c=t;h[t]=Math.max(0,Math.min(1,(i-o)/(r-o)))}let u,p=a.find(t=>null!=t.color)?.color;const g=a.map((t,i)=>{let s=t?.color;const n=h[i];return null!=s?p=s:null!=p?s=p:(null==u&&(u=new Mt,u.domain=[0,1],u.range=e),s=u.convert(n)),{stop:n,color:s}});return"discrete"===n?Ot(g):g}r([Ct],Nt.prototype,"stop",2),r([Ct],Nt.prototype,"color",2);var Et=class{constructor(t,e){this.imageLoader=t,this._cache=void 0,this.url=e.url,this.backgroundFill=e.backgroundFill??"black",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.repeat=e.repeat??"no-repeat",this.width=e.width,this.height=e.height,this.fit=e.fit??"stretch",this.rotation=e.rotation??0}createCanvasImage(t,e,i,n){if(!e)return null;const[a,o]=this.getSize(e.width,e.height,i,n);return a<1||o<1?(s.Vy.warnOnce("Image fill is too small to render, ignoring."),null):t.createPattern(e,this.repeat)}getSize(t,e,i,s){const{fit:n}=this;let a=t,o=e,r=1;const l=i/s,h=t/e;return"stretch"===n||0===t||0===e?(a=i,o=s):"contain"===n?r=h>l?i/t:s/e:"cover"===n&&(r=h>l?s/e:i/t),[Math.max(1,a*r),Math.max(1,o*r)]}setImageTransform(t,e){if("string"==typeof t)return;const{url:i,rotation:s,width:n,height:a}=this,o=this.imageLoader?.loadImage(i);if(!o)return;const r=dt(s),l=Math.cos(r),h=Math.sin(r),[c,d]=this.getSize(o.width,o.height,n??e.width,a??e.height),u=c/o.width,p=d/o.height,g=e.x+e.width/2,m=e.y+e.height/2,y=(l*c-h*d)/2,f=(h*c+l*d)/2;t?.setTransform(new DOMMatrix([l*u,h*p,-h*u,l*p,g-y,m-f]))}createPattern(t,e,i,s){const n=this.width??e,a=this.height??i,o=this._cache;if(null!=o&&o.ctx===t&&o.width===n&&o.height===a)return o.pattern;const r=this.imageLoader?.loadImage(this.url,s),l=this.createCanvasImage(t,r,n,a);return null==l?this.backgroundFill:(this._cache={ctx:t,pattern:l,width:n,height:a},l)}toSvg(t,e){const{url:i,rotation:n,backgroundFill:a,backgroundFillOpacity:o}=this,{x:r,y:l,width:h,height:c}=t,d=(0,s.FJ)("pattern");d.setAttribute("viewBox",`0 0 ${h} ${c}`),d.setAttribute("x",String(r)),d.setAttribute("y",String(l)),d.setAttribute("width",String(h)),d.setAttribute("height",String(c)),d.setAttribute("patternUnits","userSpaceOnUse");const u=(0,s.FJ)("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(h)),u.setAttribute("height",String(c)),u.setAttribute("fill",a),u.setAttribute("fill-opacity",String(o)),d.appendChild(u);const p=(0,s.FJ)("image");return p.setAttribute("href",i),p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("width",String(h)),p.setAttribute("height",String(c)),p.setAttribute("preserveAspectRatio","none"),p.setAttribute("transform",`scale(${1/e}) rotate(${n}, ${h/2}, ${c/2})`),d.appendChild(p),d}},Pt=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,Bt=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,Ft=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,zt=/^[01]/,Gt={z:[],h:[Bt],v:[Bt],m:[Bt,Bt],l:[Bt,Bt],t:[Bt,Bt],s:[Bt,Bt,Bt,Bt],q:[Bt,Bt,Bt,Bt],c:[Bt,Bt,Bt,Bt,Bt,Bt],a:[Bt,Bt,Bt,zt,zt,Bt,Bt]};function _t(t,e,i){const n=Gt[t.toLocaleLowerCase()],a={command:t,params:[]};for(const o of n){const n=e.slice(i),r=o.exec(n);if(null==r)return 1===a.params.length?[i,a]:void s.Vy.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${t}]`);{a.params.push(parseFloat(r[0])),i+=r[0].length;const t=Ft.exec(n.slice(r[0].length));null!=t&&(i+=t[0].length)}}return[i,a]}function jt(t,e,i,s){const n=t-i,a=e-s;return n*n+a*a}function Wt(t,e,i,s,n,a,o){if(i===n&&s===a)return Math.min(o,jt(t,e,i,s));const r=n-i,l=a-s,h=Math.max(0,Math.min(1,((t-i)*r+(e-s)*l)/(r*r+l*l))),c=i+h*r,d=s+h*l;return Math.min(o,jt(t,e,c,d))}function Vt(t,e,i,s,n,a,o,r,l){if(r&&([o,a]=[a,o]),!at(Math.atan2(e-s,t-i),a,o)){const o=i+Math.cos(a)*n,r=s+Math.sin(a)*n,h=i+Math.cos(a)*n,c=s+Math.sin(a)*n;return Math.min(l,jt(t,e,o,r),jt(t,e,h,c))}const h=n-Math.sqrt(jt(t,e,i,s));return Math.min(l,h*h)}function Kt(t,e,i,s,n,a,o,r){const l=(i-t)*(r-a)-(s-e)*(o-n);if(0===l)return 0;const h=((o-n)*(e-a)-(t-n)*(r-a))/l,c=((i-t)*(e-a)-(s-e)*(t-n))/l;return h>=0&&h<=1&&c>=0&&c<=1?1:0}function Yt(t,e,i,s,n,a,o,r,l,h,c,d){let u=0;const p=h-d,g=c-l,m=l*(d-h)-h*(c-l),y=$t(t,i,n,o),f=$t(e,s,a,r),x=function(t,e,i,s){if(0===t)return function(t,e,i){if(0===t)return function(t,e){const i=-e/t;return 0!==t&&i>=0&&i<=1?[i]:[]}(e,i);const s=e*e-4*t*i,n=[];if(0===s){const i=-e/(2*t);i>=0&&i<=1&&n.push(i)}else if(s>0){const i=Math.sqrt(s),a=(-e-i)/(2*t),o=(-e+i)/(2*t);a>=0&&a<=1&&n.push(a),o>=0&&o<=1&&n.push(o)}return n}(e,i,s);const n=e/t,a=i/t,o=(3*a-n*n)/9,r=(9*n*a-s/t*27-2*n*n*n)/54,l=o*o*o+r*r,h=1/3,c=[];if(l>=0){const t=Math.sqrt(l),e=Math.sign(r+t)*Math.pow(Math.abs(r+t),h),i=Math.sign(r-t)*Math.pow(Math.abs(r-t),h),s=Math.abs(Math.sqrt(3)*(e-i)/2),a=-h*n+(e+i);if(a>=0&&a<=1&&c.push(a),0===s){const t=-h*n-(e+i)/2;t>=0&&t<=1&&c.push(t)}}else{const t=Math.acos(r/Math.sqrt(-o*o*o)),e=h*n,i=2*Math.sqrt(-o),s=i*Math.cos(h*t)-e,a=i*Math.cos(h*(t+2*Math.PI))-e,l=i*Math.cos(h*(t+4*Math.PI))-e;s>=0&&s<=1&&c.push(s),a>=0&&a<=1&&c.push(a),l>=0&&l<=1&&c.push(l)}return c}(p*y[0]+g*f[0],p*y[1]+g*f[1],p*y[2]+g*f[2],p*y[3]+g*f[3]+m);for(const t of x){const e=t*t,i=t*e,s=y[0]*i+y[1]*e+y[2]*t+y[3],n=f[0]*i+f[1]*e+f[2]*t+f[3];let a;a=l===c?(n-h)/(d-h):(s-l)/(c-l),a>=0&&a<=1&&u++}return u}function $t(t,e,i,s){return[3*e-t-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function Ht(t,e,i,s,n,a,o,r,l,h){if(isNaN(t)||isNaN(e))return 0;a&&([n,s]=[s,n]);const c=(h-r)/(l-o),d=r-c*o,u=Math.pow(c,2)+1,p=2*(c*(d-e)-t),g=Math.pow(t,2)+Math.pow(d-e,2)-Math.pow(i,2),m=Math.pow(p,2)-4*u*g;if(m<0)return 0;const y=(-p+Math.sqrt(m))/2/u,f=(-p-Math.sqrt(m))/2/u;let x=0;return[y,f].forEach(i=>{if(!(i>=Math.min(o,l)&&i<=Math.max(o,l)))return;const a=i-t,r=c*i+d-e;at(Math.atan2(r,a),s,n)&&x++}),x}function Ut(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 Xt(t,e,i,s,n){if(n<=Math.min(t,s))return t<s?0:1;if(n>=Math.max(t,s))return t<s?1:0;let a=0,o=1,r=NaN;for(let l=0;l<12;l+=1)r=(a+o)/2,Ut(t,e,i,s,r)<n?a=r:o=r;return r}function Zt(t,e,i,s,n,a,o,r,l){const h=(1-l)*t+l*i,c=(1-l)*e+l*s,d=(1-l)*i+l*n,u=(1-l)*s+l*a,p=(1-l)*n+l*o,g=(1-l)*a+l*r,m=(1-l)*h+l*d,y=(1-l)*c+l*u,f=(1-l)*d+l*p,x=(1-l)*u+l*g,b=(1-l)*m+l*f,v=(1-l)*y+l*x;return[[{x:t,y:e},{x:h,y:c},{x:m,y},{x:b,y:v}],[{x:b,y:v},{x:f,y:x},{x:p,y:g},{x:o,y:r}]]}function qt(t,e,i,s){const n=3*e-t-3*i+s,a=2*(t-2*e+i),o=-t+e;if(0===n){if(0!==a){const t=-o/a;if(t>0&&t<1)return[t]}return[]}const r=a*a-4*n*o;if(r>=0){const t=Math.sqrt(r);return[(-a+t)/(2*n),(-a-t)/(2*n)].filter(t=>t>0&&t<1)}return[]}function Qt(t,e,i,s,n,a,o,r){return[...qt(t,i,n,o),...qt(e,s,a,r)]}var Jt=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 0===this.commands.length}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()}appendSvg(t){let e,i,s=0,n=0,a=0,o=0;for(const{command:r,params:l}of t){e??(e=l[0]),i??(i=l[1]);const t=r===r.toLowerCase(),h=t?e:0,c=t?i:0;switch(r.toLowerCase()){case"m":this.moveTo(h+l[0],c+l[1]),e=h+l[0],i=c+l[1],s=e,n=i;break;case"c":this.cubicCurveTo(h+l[0],c+l[1],h+l[2],c+l[3],h+l[4],c+l[5]),a=h+l[2],o=c+l[3],e=h+l[4],i=c+l[5];break;case"s":this.cubicCurveTo(e+e-a,i+i-o,h+l[0],c+l[1],h+l[2],c+l[3]),a=h+l[0],o=c+l[1],e=h+l[2],i=c+l[3];break;case"q":this.cubicCurveTo((h+2*l[0])/3,(c+2*l[1])/3,(2*l[0]+l[2])/3,(2*l[1]+l[3])/3,l[2],l[3]),a=l[0],o=l[1],e=l[2],i=l[3];break;case"t":this.cubicCurveTo((e+2*(e+e-a))/3,(i+2*(i+i-o))/3,(2*(e+e-a)+l[0])/3,(2*(i+i-o)+l[1])/3,l[0],l[1]),a=e+e-a,o=i+i-o,e=l[0],i=l[1];break;case"a":this.ellipse(e,i,l[0],l[1],l[2]*Math.PI/180,l[3],l[4],h+l[5],c+l[6]),e=h+l[5],i=c+l[6];break;case"h":this.lineTo(h+l[0],i),e=h+l[0];break;case"l":this.lineTo(h+l[0],c+l[1]),e=h+l[0],i=c+l[1];break;case"v":this.lineTo(e,c+l[0]),i=c+l[0];break;case"z":this.closePath(),e=s,i=n;break;default:throw new Error(`Could not translate command '${r}' with '${l.join(" ")}'`)}}}ellipse(t,e,i,s,n,a,o,r,l){i=Math.abs(i),s=Math.abs(s);const h=(t-r)/2,c=(e-l)/2,d=Math.sin(n),u=Math.cos(n),p=u*h+d*c,g=-d*h+u*c,m=p/i,y=g/s;let f=m*m+y*y,x=(t+r)/2,b=(e+l)/2,v=0,S=0;f>=1?(f=Math.sqrt(f),i*=f,s*=f):(f=Math.sqrt(1/f-1),a===o&&(f=-f),v=f*i*y,S=-f*s*m,x+=u*v-d*S,b+=d*v+u*S);const M=Math.atan2((g-S)/s,(p-v)/i),k=M+(Math.atan2((-g-S)/s,(-p-v)/i)-M),D=!!(1-o);this.ellipticalArc(x,b,i,s,n,M,k,D)}ellipticalArc(t,e,i,s,n,a,o,r){r&&([a,o]=[o,a]);const l=[],h=.5522847498307935,c=Math.sin(a),d=Math.cos(a),u=Math.sin(n),p=Math.cos(n);let g=p*d*i-u*c*s,m=u*d*i+p*c*s,y=-p*c*i-u*d*s,f=-u*c*i+p*d*s;l.push(g+t,m+e),o=it(o-=a);const x=Math.PI/2,b=Math.floor(o/x),v=o%x;for(let i=0;i<b;i++)l.push(g+y*h+t,m+f*h+e,g*h+y+t,m*h+f+e,y+t,f+e),[g,y]=[y,-g],[m,f]=[f,-m];if(v>0){const i=Math.sin(v),s=Math.cos(v),n=Math.tan(v/4)*(4/3),a=s+n*i,o=i-n*s;l.push(g+y*n+t,m+f*n+e,g*a+y*o+t,m*a+f*o+e,g*s+y*i+t,m*s+f*i+e)}if(r)for(let t=0,e=l.length-2;t<e;t+=2,e-=2)[l[t],l[e]]=[l[e],l[t]],[l[t+1],l[e+1]]=[l[e+1],l[t+1]];for(let t=2;t<l.length;t+=6){const[e,i,s,n,a,o]=l.slice(t,t+6);this.cubicCurveTo(e,i,s,n,a,o)}}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,a){this.openedPath=!0,this.path2d.arc(t,e,i,s,n,a),this.commands.push(2),this.params.push(t,e,i,s,n,a?1:0)}cubicCurveTo(t,e,i,s,n,a){this.openedPath||this.moveTo(t,e),this.path2d.bezierCurveTo(t,e,i,s,n,a),this.commands.push(3),this.params.push(t,e,i,s,n,a)}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,a=-1e4,o=-1e4;let r=NaN,l=NaN,h=0,c=0,d=0;for(let u=0,p=0;u<n;u++)switch(i[u]){case 0:d+=Kt(r,l,h,c,a,o,t,e),h=s[p++],r=h,c=s[p++],l=c;break;case 1:d+=Kt(h,c,s[p++],s[p++],a,o,t,e),h=s[p-2],c=s[p-1];break;case 3:d+=Yt(h,c,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],a,o,t,e),h=s[p-2],c=s[p-1];break;case 2:{const i=s[p++],n=s[p++],l=s[p++],u=s[p++],g=s[p++];d+=Ht(i,n,l,u,g,Boolean(s[p++]),a,o,t,e),isNaN(r)||(d+=Kt(h,c,i+Math.cos(u)*l,n+Math.sin(u)*l,a,o,t,e)),h=i+Math.cos(g)*l,c=n+Math.sin(g)*l;break}case 4:d+=Kt(r,l,h,c,a,o,t,e)}return d%2==1}distanceSquared(t,e){let i=1/0;const n=this.commands,a=this.params,o=n.length;let r=NaN,l=NaN,h=0,c=0;for(let d=0,u=0;d<o;d++)switch(n[d]){case 0:h=r=a[u++],c=l=a[u++];break;case 1:i=Wt(t,e,h,c,a[u++],a[u++],i);break;case 3:s.Vy.error("Command.Curve distanceSquare not implemented");break;case 2:{const s=a[u++],n=a[u++],o=a[u++],r=a[u++],l=a[u++],d=s+Math.cos(r)*o,p=n+Math.sin(r)*o,g=Boolean(a[u++]);i=Wt(t,e,h,c,d,p,i),i=Vt(t,e,s,n,o,r,l,g,i),h=s+Math.cos(l)*o,c=n+Math.sin(l)*o;break}case 4:i=Wt(t,e,h,c,r,l,i)}return i}toSVG(t=(t,e)=>({x:t,y:e})){const e=[],{commands:i,params:s}=this,n=(i,...s)=>{e.push(i);for(let i=0;i<s.length;i+=2){const{x:n,y:a}=t(s[i],s[i+1]);e.push(n,a)}};let a=0;for(const t of i)switch(t){case 0:n("M",s[a++],s[a++]);break;case 1:n("L",s[a++],s[a++]);break;case 3:n("C",s[a++],s[a++],s[a++],s[a++],s[a++],s[a++]);break;case 2:{const t=s[a++],i=s[a++],o=s[a++],r=s[a++],l=s[a++],h=s[a++];let c=h?r-l:l-r;c<0&&(c+=2*Math.ceil(-c/(2*Math.PI))*Math.PI),h&&(c=-c);const d=Math.max(Math.ceil(Math.abs(c)/(Math.PI/2)),1),u=c/d,p=4/3*Math.tan(u/4);n(0===e.length?"M":"L",t+Math.cos(r)*o,i+Math.sin(r)*o);for(let e=0;e<d;e+=1){const s=r+u*(e+0),a=r+u*(e+1),l=o*Math.sin(s),h=o*Math.cos(s),c=o*Math.sin(a),d=o*Math.cos(a);n("C",t+h-p*l,i+l+p*h,t+d+p*c,i+c-p*d,t+d,i+c)}break}case 4:e.push("Z")}return e.join(" ")}computeBBox(){const{commands:t,params:e}=this;let[i,s,n,a]=[1/0,1/0,-1/0,-1/0],[o,r]=[NaN,NaN],[l,h]=[NaN,NaN];const c=(t,e,l)=>{i=Math.min(e,i),s=Math.min(t,s),n=Math.max(t,n),a=Math.max(e,a),l&&([o,r]=[t,e])},d=(t,e,i,s,n)=>{const a=t+i*Math.cos(s),o=e+i*Math.sin(s);c(a,o,n)};let u=0;for(const i of t)switch(i){case 0:c(e[u++],e[u++],!0),[l,h]=[o,r];break;case 1:c(e[u++],e[u++],!0);break;case 3:{const t=e[u++],i=e[u++],s=e[u++],n=e[u++],a=e[u++],l=e[u++];Qt(o,r,t,i,s,n,a,l).forEach(e=>{const h=Ut(o,t,s,a,e),d=Ut(r,i,n,l,e);c(h,d)}),c(a,l,!0);break}case 2:{const t=e[u++],i=e[u++],s=e[u++],n=it(e[u++]),a=it(e[u++]),o=e[u++];d(t,i,s,n);const r=[0,Math.PI/2,Math.PI,3*Math.PI/2],[l,h]=o?[a,n]:[n,a];for(const e of r)(l<h&&l<=e&&e<=h||l>h&&(l<=e||e<=h))&&d(t,i,s,e);d(t,i,s,a,!0);break}case 4:[o,r]=[l,h]}return new y(s,i,n-s,a-i)}};function te(t,e,i){const s=Math.round(e*t)/t;return null==i?s:0===i?0:i<1?Math.ceil(i*t)/t:Math.round((i+e)*t)/t-s}function ee(t,e){return Math.floor(e*t)/t}function ie(t,e,i){const{width:s,height:n,padding:a,strokeWidth:o}=e,r=s/2,l=n/2,h=Math.max(1,s-a-o/2),c=Math.max(1,n-a-o/2);let d=!1;for(const[e,s]of i){const i=r+(e-.5)*h,n=l+(s-.5)*c;d?t.lineTo(i,n):t.moveTo(i,n),d=!0}t.closePath()}var se={circles(t,{width:e,strokeWidth:i,padding:s}){const n=e/2,a=Math.max(1,n-s-i/2);t.arc(n,n,a,0,2*Math.PI)},squares(t,{width:e,height:i,pixelRatio:s,padding:n,strokeWidth:a}){const o=n+a/2;t.moveTo(te(s,o),te(s,o)),t.lineTo(te(s,e-o),te(s,o)),t.lineTo(te(s,e-o),te(s,i-o)),t.lineTo(te(s,o),te(s,i-o)),t.closePath()},triangles(t,e){ie(t,e,[[.5,0],[1,1],[0,1]])},diamonds(t,e){ie(t,e,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(t,{width:e,height:i,padding:s}){const n=Math.max(1,(e-s)/2),a=n/2,o=Math.PI/2;for(let s=0;s<10;s++){const r=s%2==0?n:a,l=s*Math.PI/5-o,h=e/2+Math.cos(l)*r,c=i/2+Math.sin(l)*r;t.lineTo(h,c)}t.closePath()},hearts(t,{width:e,height:i,padding:s}){const n=Math.max(1,e/4-s/2),a=e/2,o=i/2+n/2;t.arc(a-n,o-n,n,ot(130),ot(330)),t.arc(a+n,o-n,n,ot(220),ot(50)),t.lineTo(a,o+n),t.closePath()},crosses(t,e){ie(t,e,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},"vertical-lines"(t,{width:e,height:i,pixelRatio:s,strokeWidth:n}){const a=te(s,e/2)-n%2/2;t.moveTo(a,0),t.lineTo(a,i)},"horizontal-lines"(t,{width:e,height:i,pixelRatio:s,strokeWidth:n}){const a=te(s,i/2)-n%2/2;t.moveTo(0,a),t.lineTo(e,a)},"forward-slanted-lines"(t,{width:e,height:i,strokeWidth:s}){const n=Math.atan2(i,e),a=s*Math.cos(n),o=s*Math.sin(n);t.moveTo(-a,o),t.lineTo(a,-o),t.moveTo(-a,i+o),t.lineTo(e+a,-o),t.moveTo(e-a,i+o),t.lineTo(e+a,i-o)},"backward-slanted-lines"(t,{width:e,height:i,strokeWidth:s}){const n=Math.atan2(i,e),a=s*Math.cos(n),o=s*Math.sin(n);t.moveTo(e-a,-o),t.lineTo(e+a,o),t.moveTo(-a,-o),t.lineTo(e+a,i+o),t.moveTo(-a,i-o),t.lineTo(a,i+o)}},ne=class{constructor(t){this._cache=void 0,this.width=Math.max(t?.width??10,1),this.height=Math.max(t?.height??10,1),this.fill=t.fill??"none",this.fillOpacity=t.fillOpacity??1,this.backgroundFill=t.backgroundFill??"none",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.stroke=t.stroke??"black",this.strokeOpacity=t.strokeOpacity??1,this.strokeWidth=t.strokeWidth??1,this.padding=t.padding??1,this.pattern=t.pattern??"forward-slanted-lines",this.rotation=t.rotation??0,this.scale=t.scale??1,this.path=t.path}getPath(t){const{pattern:e,width:i,height:n,padding:a,strokeWidth:o,path:r}=this,l=new Jt,h=function(t){if(!t)return;const e=[];let i,n=0;for(;n<t.length;){const a=Pt.exec(t.slice(n));let o;if(null==a){if(!i)return void s.Vy.warnOnce(`Invalid SVG path, error at index ${n}: Missing command.`);o=i}else o=a[1],n+=a[0].length;const r=_t(o,t,n);if(!r)return;n=r[0],i=o,e.push(r[1])}return e}(r);return h?l.appendSvg(h):se[e](l,{width:i,height:n,pixelRatio:t,strokeWidth:o,padding:a}),l}renderStroke(t,e){const{stroke:i,strokeWidth:s,strokeOpacity:n}=this;s&&(e.strokeStyle=i,e.lineWidth=s,e.globalAlpha=n,e.stroke(t))}renderFill(t,e){const{fill:i,fillOpacity:s}=this;"none"!==i&&(e.fillStyle=i,e.globalAlpha=s,e.fill(t))}createCanvasPattern(t,e){const{width:i,height:n,scale:a,backgroundFill:o,backgroundFillOpacity:r}=this;if(i*a<1||n*a<1)return s.Vy.warnOnce("Pattern fill is too small to render, ignoring."),null;const l=new M({width:i,height:n,pixelRatio:e*a}),h=l.context;"none"!==o&&(h.fillStyle=o,h.globalAlpha=r,h.fillRect(0,0,i,n));const c=this.getPath(e).getPath2D();this.renderFill(c,h),this.renderStroke(c,h);const d=t.createPattern(l.canvas,"repeat");return this.setPatternTransform(d,e),l.destroy(),d}setPatternTransform(t,e,i=0,s=0){const n=dt(this.rotation),a=1/e,o=Math.cos(n)*a,r=Math.sin(n)*a;t?.setTransform(new DOMMatrix([o,r,-r,o,i,s]))}createPattern(t,e){if(null!=this._cache&&this._cache.ctx===t&&this._cache.pixelRatio===e)return this._cache.pattern;const i=this.createCanvasPattern(t,e);return null!=i?(this._cache={ctx:t,pattern:i,pixelRatio:e},i):void 0}toSvg(){const{width:t,height:e,fill:i,fillOpacity:n,backgroundFill:a,backgroundFillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:h,rotation:c,scale:d}=this,u=(0,s.FJ)("pattern");u.setAttribute("viewBox",`0 0 ${t} ${e}`),u.setAttribute("width",String(t)),u.setAttribute("height",String(e)),u.setAttribute("patternUnits","userSpaceOnUse");const p=(0,s.FJ)("rect");p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("width",String(t)),p.setAttribute("height",String(e)),p.setAttribute("fill",a),p.setAttribute("fill-opacity",String(o)),u.appendChild(p);const g=(0,s.FJ)("path");return g.setAttribute("fill",i),g.setAttribute("fill-opacity",String(n)),g.setAttribute("stroke-opacity",String(h)),g.setAttribute("stroke",r),g.setAttribute("stroke-width",String(l)),g.setAttribute("transform",`rotate(${c}) scale(${d})`),g.setAttribute("d",this.getPath(1).toSVG()),u.appendChild(g),u}};function ae(t){return(0,s.Gv)(t)&&"gradient"==t.type}function oe(t){return(0,s.cy)(t)&&t.every(t=>"string"==typeof t)}function re(t){return null!==t&&(0,s.Gv)(t)&&"pattern"==t.type}function le(t){return null!==t&&(0,s.Gv)(t)&&"image"==t.type}function he(t){return ae(t)||re(t)}var ce=class t extends J{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=t.defaultStyles.fill,this.stroke=t.defaultStyles.stroke,this.strokeWidth=t.defaultStyles.strokeWidth,this.lineDash=t.defaultStyles.lineDash,this.lineDashOffset=t.defaultStyles.lineDashOffset,this.lineCap=t.defaultStyles.lineCap,this.lineJoin=t.defaultStyles.lineJoin,this.miterLimit=void 0,this.opacity=t.defaultStyles.opacity,this.fillShadow=t.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:t}=this.constructor;Object.assign(this,t)}getGradient(t){if(ae(t))return this.createGradient(t)}createGradient(t){const{colorSpace:e="rgb",gradient:i="linear",colorStops:s,rotation:n=0,reverse:a=!1}=t;if(null==s)return;let o=Rt(s,["black"],[0,1]);switch(a&&(o=o.map(t=>({color:t.color,stop:1-t.stop})).reverse()),i){case"linear":return new wt(e,o,n);case"radial":return new It(e,o);case"conic":return new Dt(e,o,n)}}getPattern(t){if(re(t))return this.createPattern(t)}createPattern(t){return new ne(t)}getImage(t){if(le(t))return this.createImage(t)}createImage(t){return new Et(this.imageLoader,t)}onFillChange(){"object"==typeof this.fill&&O(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this.fillImage=this.getImage(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(t,e){return te(this.layerManager?.canvas?.pixelRatio??1,t,e)}preRender(t,e){return this.dirty&&(this.cachedDefaultGradientFillBBox=void 0),super.preRender(t,e)}fillStroke(t,e){this.renderFill(t,e),this.renderStroke(t,e)}renderFill(t,e){const{fill:i,fillImage:s}=this;if(i&&"none"!==i){const{globalAlpha:i}=t;s&&(t.globalAlpha=s.backgroundFillOpacity,t.fillStyle=s.backgroundFill,this.executeFill(t,e),t.globalAlpha=i),this.applyFillAndAlpha(t),this.applyShadow(t),this.executeFill(t,e),t.globalAlpha=i}t.shadowColor="rgba(0, 0, 0, 0)"}executeFill(t,e){e?t.fill(e):t.fill()}applyFillAndAlpha(t){const{fill:e,fillGradient:i,fillPattern:s,fillImage:n,fillOpacity:a,opacity:o}=this;if(t.globalAlpha*=o*a,i){const{fillBBox:e=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:s}=this;t.fillStyle=i.createGradient(t,e,s)??"black"}else if(s){const{x:e,y:i}=this.getBBox(),n=this.layerManager?.canvas?.pixelRatio??1,a=s.createPattern(t,n);s.setPatternTransform(a,n,e,i),a?t.fillStyle=a:(t.fillStyle=s.fill,t.globalAlpha*=s.fillOpacity)}else if(n){const e=this.getBBox(),i=n.createPattern(t,e.width,e.height,this);n.setImageTransform(i,e),t.fillStyle=i??"transparent"}else t.fillStyle="string"==typeof e?e:"black"}applyStrokeAndAlpha(t){const{stroke:e,strokeOpacity:i,strokeGradient:s,opacity:n}=this;t.strokeStyle=s?.createGradient(t,this.getBBox())??("string"==typeof e?e:void 0)??"black",t.globalAlpha*=n*i}applyShadow(t){const e=this.layerManager?.canvas.pixelRatio??1,i=this.fillShadow;i?.enabled&&(t.shadowColor=i.color,t.shadowOffsetX=i.xOffset*e,t.shadowOffsetY=i.yOffset*e,t.shadowBlur=i.blur*e)}renderStroke(t,e){const{stroke:i,strokeWidth:s,lineDash:n,lineDashOffset:a,lineCap:o,lineJoin:r,miterLimit:l}=this;if(i&&s){const{globalAlpha:i}=t;this.applyStrokeAndAlpha(t),t.lineWidth=s,n&&t.setLineDash(n),a&&(t.lineDashOffset=a),o&&(t.lineCap=o),r&&(t.lineJoin=r),null!=l&&(t.miterLimit=l),this.executeStroke(t,e),t.globalAlpha=i}}executeStroke(t,e){e?t.stroke(e):t.stroke()}getDefaultGradientFillBBox(){return null==this.cachedDefaultGradientFillBBox&&(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(t,e){return this.isPointInPath(t,e)}applySvgFillAttributes(t,e){const{fill:i,fillOpacity:n}=this;if("string"==typeof i)t.setAttribute("fill",i);else if(ae(i)&&this.fillGradient){e??(e=[]);const i=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),n=(0,s.lk)();i.setAttribute("id",n),e.push(i),t.setAttribute("fill",`url(#${n})`)}else if(re(i)&&this.fillPattern){e??(e=[]);const i=this.fillPattern.toSvg(),n=(0,s.lk)();i.setAttribute("id",n),e.push(i),t.setAttribute("fill",`url(#${n})`)}else if(le(i)&&this.fillImage){e??(e=[]);const i=this.layerManager?.canvas?.pixelRatio??1,n=this.fillImage.toSvg(this.getBBox(),i),a=(0,s.lk)();n.setAttribute("id",a),e.push(n),t.setAttribute("fill",`url(#${a})`)}else t.setAttribute("fill","none");return t.setAttribute("fill-opacity",String(n)),e}applySvgStrokeAttributes(t){const{stroke:e,strokeOpacity:i,strokeWidth:s,lineDash:n,lineDashOffset:a}=this;if(null!=e&&(t.setAttribute("stroke","string"==typeof e?e:"none"),t.setAttribute("stroke-opacity",String(i)),t.setAttribute("stroke-width",String(s))),!0===n?.some(t=>0!==t)){const e=n.length%2==1?[...n,...n]:n;t.setAttribute("stroke-dasharray",e.join(" ")),t.setAttribute("stroke-dashoffset",String(a))}}};ce.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},r([H()],ce.prototype,"fillOpacity",2),r([H()],ce.prototype,"strokeOpacity",2),r([U({equals:O,changeCb:t=>t.onFillChange()})],ce.prototype,"fill",2),r([U({equals:O,changeCb:t=>t.onStrokeChange()})],ce.prototype,"stroke",2),r([H()],ce.prototype,"strokeWidth",2),r([X()],ce.prototype,"lineDash",2),r([H()],ce.prototype,"lineDashOffset",2),r([H()],ce.prototype,"lineCap",2),r([H()],ce.prototype,"lineJoin",2),r([H()],ce.prototype,"miterLimit",2),r([H({convertor:t=>(0,s.qE)(0,t,1)})],ce.prototype,"opacity",2),r([U({equals:$,checkDirtyOnAssignment:!0})],ce.prototype,"fillShadow",2),r([U({equals:c.equals,changeCb:t=>t.onFillChange()})],ce.prototype,"fillBBox",2),r([U({equals:O,changeCb:t=>t.onFillChange()})],ce.prototype,"fillParams",2);var de=ce,ue=[1,0,0,1,0,0],pe=class t{get e(){return[...this.elements]}constructor(t=ue){this.elements=[...t]}setElements(t){const e=this.elements;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this}get identity(){const t=this.elements;return(0,s.YX)(t[0],1)&&(0,s.YX)(t[1],0)&&(0,s.YX)(t[2],0)&&(0,s.YX)(t[3],1)&&(0,s.YX)(t[4],0)&&(0,s.YX)(t[5],0)}AxB(t,e,i){const s=t[0]*e[0]+t[2]*e[1],n=t[1]*e[0]+t[3]*e[1],a=t[0]*e[2]+t[2]*e[3],o=t[1]*e[2]+t[3]*e[3],r=t[0]*e[4]+t[2]*e[5]+t[4],l=t[1]*e[4]+t[3]*e[5]+t[5];(i=i??t)[0]=s,i[1]=n,i[2]=a,i[3]=o,i[4]=r,i[5]=l}multiplySelf(t){return this.AxB(this.elements,t.elements),this}multiply(e){const i=new Array(6);return e instanceof t?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 t(i)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const e=this.elements;let i=e[0],s=e[1],n=e[2],a=e[3];const o=e[4],r=e[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,new t([a,-s,-n,i,n*r-a*o,s*o-i*r])}invertSelf(){const t=this.elements;let e=t[0],i=t[1],s=t[2],n=t[3];const a=t[4],o=t[5],r=1/(e*n-i*s);return e*=r,i*=r,s*=r,n*=r,t[0]=n,t[1]=-i,t[2]=-s,t[3]=e,t[4]=s*o-n*a,t[5]=i*a-e*o,this}transformPoint(t,e){const i=this.elements;return{x:t*i[0]+e*i[2]+i[4],y:t*i[1]+e*i[3]+i[5]}}transformBBox(t,e){const i=this.elements,s=i[0],n=i[1],a=i[2],o=i[3],r=.5*t.width,l=.5*t.height,h=t.x+r,c=t.y+l,d=Math.abs(r*s)+Math.abs(l*a),u=Math.abs(r*n)+Math.abs(l*o);return e??(e=new y(0,0,0,0)),e.x=h*s+c*a+i[4]-d,e.y=h*n+c*o+i[5]-u,e.width=d+d,e.height=u+u,e}toContext(t){if(this.identity)return;const e=this.elements;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}static updateTransformMatrix(t,e,i,s,n,a,o){const r=e,l=i;let h,c;1===r&&1===l?(h=0,c=0):(h=o?.scalingCenterX??0,c=o?.scalingCenterY??0);const d=s,u=Math.cos(d),p=Math.sin(d);let g,m;0===d?(g=0,m=0):(g=o?.rotationCenterX??0,m=o?.rotationCenterY??0);const y=n,f=a,x=h*(1-r)-g,b=c*(1-l)-m;return t.setElements([u*r,p*r,-p*l,u*l,u*x-p*b+g+y,p*x+u*b+m+f]),t}};function ge(t){return ye(t.constructor)}var me=Symbol("isMatrixTransform");function ye(t){return!0===t[me]}function fe(t){var e;const i=t;if(ye(t))return t;const n=Symbol("matrix_combined_transform");class a extends i{constructor(){super(...arguments),this[e]=new pe,this._dirtyTransform=!0}markDirtyTransform(){this._dirtyTransform=!0,super.markDirty()}onChangeDetection(t){super.onChangeDetection(t),this.markDirtyTransform()}updateMatrix(t){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(ue),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(t){return this.computeTransformMatrix(),this[n].identity?t.clone():this[n].transformBBox(t)}toParentPoint(t,e){return this.computeTransformMatrix(),this[n].identity?{x:t,y:e}:this[n].transformPoint(t,e)}fromParent(t){return this.computeTransformMatrix(),this[n].identity?t.clone():this[n].inverse().transformBBox(t)}fromParentPoint(t,e){return this.computeTransformMatrix(),this[n].identity?{x:t,y:e}:this[n].inverse().transformPoint(t,e)}computeBBox(){const t=super.computeBBox();return t?this.toParent(t):t}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(t,e){return({x:t,y:e}=this.fromParentPoint(t,e)),super.pickNode(t,e)}pickNodes(t,e,i){return({x:t,y:e}=this.fromParentPoint(t,e)),super.pickNodes(t,e,i)}render(t){this.computeTransformMatrix();const{ctx:e}=t,i=this[n];let s=!1;i.identity||(e.save(),s=!0,i.toContext(e)),super.render(t),s&&e.restore()}toSVG(){this.computeTransformMatrix();const t=super.toSVG(),e=this[n];if(e.identity||null==t)return t;const i=(0,s.FJ)("g");i.append(...t.elements);const[a,o,r,l,h,c]=e.e;return i.setAttribute("transform",`matrix(${a} ${o} ${r} ${l} ${h} ${c})`),{elements:[i],defs:t.defs}}}return e=n,a[me]=!0,a}function xe(t){var e;const i=t,s=Symbol("matrix_rotation");class n extends(fe(i)){constructor(){super(...arguments),this[e]=new pe,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(t){super.updateMatrix(t);const{rotation:e,rotationCenterX:i,rotationCenterY:n}=this;0!==e&&(pe.updateTransformMatrix(this[s],1,1,e,0,0,{rotationCenterX:i,rotationCenterY:n}),t.multiplySelf(this[s]))}}return e=s,r([H()],n.prototype,"rotationCenterX",2),r([H()],n.prototype,"rotationCenterY",2),r([H()],n.prototype,"rotation",2),n}function be(t){var e;const i=t,s=Symbol("matrix_scale");class n extends(fe(i)){constructor(){super(...arguments),this[e]=new pe,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(t){super.updateMatrix(t);const{scalingX:e,scalingY:i,scalingCenterX:n,scalingCenterY:a}=this;1===e&&1===i||(pe.updateTransformMatrix(this[s],e,i,0,0,0,{scalingCenterX:n,scalingCenterY:a}),t.multiplySelf(this[s]))}}return e=s,r([H()],n.prototype,"scalingX",2),r([H()],n.prototype,"scalingY",2),r([H()],n.prototype,"scalingCenterX",2),r([H()],n.prototype,"scalingCenterY",2),n}function ve(t){var e;const i=t,s=Symbol("matrix_translation");class n extends(fe(i)){constructor(){super(...arguments),this[e]=new pe,this.translationX=0,this.translationY=0}updateMatrix(t){super.updateMatrix(t);const{translationX:e,translationY:i}=this;0===e&&0===i||(pe.updateTransformMatrix(this[s],1,1,0,e,i),t.multiplySelf(this[s]))}}return e=s,r([H()],n.prototype,"translationX",2),r([H()],n.prototype,"translationY",2),n}var Se,Me=class{static fromCanvas(t,e){const i=[];for(const e of t.traverseUp())ge(e)&&i.unshift(e);for(const t of i)e=t.fromParent(e);return ge(t)&&(e=t.fromParent(e)),e}static toCanvas(t,e){null==e?e=t.getBBox():ge(t)&&(e=t.toParent(e));for(const i of t.traverseUp())ge(i)&&(e=i.toParent(e));return e}static fromCanvasPoint(t,e,i){const s=[];for(const e of t.traverseUp())ge(e)&&s.unshift(e);for(const t of s)({x:e,y:i}=t.fromParentPoint(e,i));return ge(t)&&({x:e,y:i}=t.fromParentPoint(e,i)),{x:e,y:i}}static toCanvasPoint(t,e,i){ge(t)&&({x:e,y:i}=t.toParentPoint(e,i));for(const s of t.traverseUp())ge(s)&&({x:e,y:i}=s.toParentPoint(e,i));return{x:e,y:i}}},ke=(t,e)=>Math.sign(t-e);function De(t,e){if("number"==typeof t&&"number"==typeof e)return ke(t,e);const i="number"==typeof t?[t]:t,s="number"==typeof e?[e]:e,n=Math.min(i.length,s.length);for(let t=0;t<n;t+=1){const e=ke(i[t],s[t]);if(0!==e)return e}return ke(i.length,s.length)}var we=class t extends J{constructor(t){super(t),this.opacity=1,this.renderToOffscreenCanvas=!1,this.optimizeForInfrequentRedraws=!1,this.layer=void 0,this.image=void 0,this._lastWidth=NaN,this._lastHeight=NaN,this._lastDevicePixelRatio=NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=!0===t?.renderToOffscreenCanvas}static is(e){return e instanceof t}static computeChildrenBBox(t,e=!0){return y.merge(J.extractBBoxes(t,e))}static compareChildren(t,e){return De(t.zIndex,e.zIndex)||t.serialNumber-e.serialNumber}containsPoint(t,e){return!0}computeBBox(){return t.computeChildrenBBox(this.children())}computeSafeClippingBBox(t){const e=this.computeBBox();if(!e.isFinite())return;let i=0;for(const t of this.descendants())t instanceof de&&(i=Math.max(i,t.strokeWidth));const s=Math.max(1,i/2*4),{x:n,y:a}=Me.toCanvasPoint(this,0,0),o=ee(t,n+e.x-s)-n,r=ee(t,a+e.y-s)-a,l=Math.ceil(e.x+e.width-o+s),h=Math.ceil(e.y+e.height-r+s);return new y(o,r,l,h)}prepareSharedCanvas(t,e,i){return null==Se||Se.pixelRatio!==i?Se=new M({width:t,height:e,pixelRatio:i}):Se.resize(t,e,i),Se}isDirty(t){const{width:e,height:i,devicePixelRatio:s}=t,{dirty:n,dirtyZIndex:a,layer:o}=this,r=null!=o&&(this._lastWidth!==e||this._lastHeight!==i),l=this._lastDevicePixelRatio!==s;if(this._lastWidth=e,this._lastHeight=i,this._lastDevicePixelRatio=s,n||a||r||l)return!0;for(const t of this.children())if(t.dirty)return!0;return!1}preRender(t){const e=super.preRender(t,0);return e.groups+=1,e.nonGroups-=1,this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&e.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this.layerManager?.addLayer({name:this.name})):null!=this.layer&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),e}render(e){const{layer:i,renderToOffscreenCanvas:s}=this,n={...e};if(!s)return this.renderInContext(n),void super.render(n);const{ctx:a,stats:o,devicePixelRatio:r}=e;let{image:l}=this;if(this.isDirty(e)){l?.bitmap.close(),l=void 0;const e=i?void 0:this.computeSafeClippingBBox(r),s=(t,...e)=>{const i=t.context;n.ctx=i,t.clear(),i.save(),i.setTransform(...e),i.globalAlpha=1,this.renderInContext(n),i.restore(),i.verifyDepthZero?.()};if(i)s(i,a.getTransform());else if(e){const{x:t,y:i,width:n,height:a}=e,o=this.prepareSharedCanvas(n,a,r);s(o,r,0,0,r,-t*r,-i*r),l={bitmap:o.transferToImageBitmap(),x:t,y:i,width:n,height:a}}else this.dirtyZIndex&&this.sortChildren(t.compareChildren);this.image=l,o&&o.layersRendered++}else this.skipRender(n),o&&o.layersSkipped++;const{globalAlpha:h}=a;if(a.globalAlpha=h*this.opacity,i)a.save(),a.resetTransform(),i.drawImage(a),a.restore();else if(l){const{bitmap:t,x:e,y:i,width:s,height:n}=l;a.drawImage(t,0,0,s*r,n*r,e,i,s,n)}a.globalAlpha=h,super.render(n)}skipRender(t){const{stats:e}=t;for(const t of this.children())t.markClean(),e&&(e.nodesSkipped+=this.childNodeCounts.groups+this.childNodeCounts.nonGroups,e.opsSkipped+=this.childNodeCounts.complexity)}applyClip(t,e){const{x:i,y:s,width:n,height:a}=e;t.beginPath(),t.rect(i,s,n,a),t.clip()}renderInContext(e){const{ctx:i,stats:s}=e;this.dirtyZIndex&&this.sortChildren(t.compareChildren),i.save(),i.globalAlpha*=this.opacity,null!=this.clipRect&&(this.applyClip(i,this.clipRect),e.clipBBox=Me.toCanvas(this,this.clipRect));for(const t of this.children())t.visible?(i.save(),t.render(e),i.restore()):(t.markClean(),s&&(s.nodesSkipped+=t.childNodeCounts.nonGroups+t.childNodeCounts.groups,s.opsSkipped+=t.childNodeCounts.complexity));i.restore()}setClipRect(t){this.clipRect=t?Me.fromCanvas(this,t):void 0}setClipRectCanvasSpace(t){this.clipRect=t}setScene(t){this.layer&&(this.scene?.layersManager.removeLayer(this.layer),this.layer=void 0),super.setScene(t)}getVisibility(){for(const t of this.traverseUp(!0))if(!t.visible)return!1;return!0}toSVG(){if(!this.visible)return;const t=[],e=[];for(const i of this.children()){const s=i.toSVG();null!=s&&(e.push(...s.elements),null!=s.defs&&t.push(...s.defs))}return{elements:e,defs:t}}};we.className="Group",r([H({convertor:t=>(0,s.qE)(0,t,1)})],we.prototype,"opacity",2);var Ie=we,Ce=class extends(be(Ie)){},Le=class extends(xe(Ie)){},Ae=class extends(ve(Ie)){},Te=class extends(xe(ve(Ie))){};function Ne(t,e){t&&(null==(e=c.normalize(e)).width?t.style.removeProperty("width"):t.style.width=`${e.width}px`,null==e.height?t.style.removeProperty("height"):t.style.height=`${e.height}px`,null==e.x?t.style.removeProperty("left"):t.style.left=`${e.x}px`,null==e.y?t.style.removeProperty("top"):t.style.top=`${e.y}px`)}function Oe(t){const e=parseFloat(t.style.width)||t.offsetWidth,i=parseFloat(t.style.height)||t.offsetHeight;return{x:parseFloat(t.style.left)||t.offsetLeft,y:parseFloat(t.style.top)||t.offsetTop,width:e,height:i}}function Re(t){if(t.focus({preventScroll:!0}),null==t.lastChild?.textContent)return;const e=(0,s.YE)().createRange();e.setStart(t.lastChild,t.lastChild.textContent.length),e.setEnd(t.lastChild,t.lastChild.textContent.length);const i=(0,s.zk)().getSelection();i?.removeAllRanges(),i?.addRange(e)}function Ee(){const t=(0,s.zk)("navigator");if("scheduling"in t){const e=t.scheduling;if("isInputPending"in e)return e.isInputPending({includeContinuous:!0})}return!1}function Pe(t){return`ag-charts-icon ag-charts-icon-${t}`}var Be="class-instance";function Fe(t,e,i){if((0,s.cy)(e)){if(!(0,s.cy)(t)||t.length!==e.length||e.some((e,s)=>null!=Fe(t[s],e,i)))return e}else{if((0,s.Qd)(e)){if(!(0,s.Qd)(t))return e;const n={},a=new Set([...Object.keys(t),...Object.keys(e)]);for(const s of a)if(t[s]!==e[s])if(i?.has(s))n[s]=e[s];else if(typeof t[s]==typeof e[s]){const a=Fe(t[s],e[s],i);null!==a&&(n[s]=a)}else n[s]=e[s];return Object.keys(n).length?n:null}if(t!==e)return e}return null}function ze(t,e){for(const i of Object.keys(t))if(t[i]!==e?.[i])return!1;return!0}function Ge(t,e){return(0,s.cy)(t)?function(t,e){const i=[],n=e?.seen;for(const a of t)"object"==typeof a&&n?.includes(a)?s.Vy.warn("cycle detected in array",a):(n?.push(a),i.push(Ge(a,e)),n?.pop());return i}(t,e):(0,s.Qd)(t)?function(t,e){const i={};for(const s of Object.keys(t))e?.assign?.has(s)?i[s]=t[s]:e?.shallow?.has(s)?i[s]=_e(t[s]):i[s]=Ge(t[s],e);return i}(t,e):t instanceof Map?new Map(Ge(Array.from(t))):_e(t)}function _e(t){return(0,s.cy)(t)?t.slice(0):(0,s.Qd)(t)?{...t}:(0,s.$P)(t)?new Date(t):(0,s.gd)(t)?new RegExp(t.source,t.flags):t}function je(t,e,i,n,a,o){if((0,s.cy)(t)){o=e(t,n,a,o);let s=0;for(const r of t)o=je(r,e,i,n?.[s],a,o),s++}else if((0,s.Qd)(t)){o=e(t,n,a,o);for(const s of Object.keys(t))i?.has(s)||(o=je(t[s],e,i,n?.[s],a,o))}return o}function We(t,e,i={}){const{path:n,matcherPath:a=n?.replace(/(\[[0-9+]+])/i,"[]"),skip:o=[]}=i;if(null==t)throw new Error(`AG Charts - target is uninitialised: ${n??"<root>"}`);if(null==e)return t;if(Tt(t))return t.set(e);const r=t,l=Ve(t);for(const h of Object.keys(e)){if(_.has(h))continue;const c=`${a?a+".":""}${h}`;if(o.includes(c))continue;const d=e[h],u=`${n?n+".":""}${h}`,p=r.constructor,g=r[h];try{const e=Ve(g),n=Ve(d);if(l===Be&&!(h in t)&&"context"!==h){if(void 0===d)continue;s.Vy.warn(`unable to set [${u}] in ${p?.name} - property is unknown`);continue}if(null!=e&&null!=n&&n!==e&&(e!==Be||"object"!==n)){s.Vy.warn(`unable to set [${u}] in ${p?.name} - can't apply type of [${n}], allowed types are: [${e}]`);continue}if(Tt(g))r[h].set(d);else if("object"===n&&"context"!==h){if(null==g){s.Vy.warn(`unable to set [${u}] in ${p?.name} - property is unknown`);continue}We(g,d,{...i,path:u,matcherPath:c})}else r[h]=d}catch(t){s.Vy.warn(`unable to set [${u}] in [${p?.name}]; nested error is: ${t.message}`)}}return t}function Ve(t){return null==t?null:(0,s.uE)(t)||(0,s.$P)(t)?"primitive":(0,s.cy)(t)?"array":(0,s.Gv)(t)?(0,s.Qd)(t)?"object":Be:(0,s.Tn)(t)?"function":"primitive"}function Ke(t,e,i,s){return $e(t,e,s??t,{matches:new Map},i)}var Ye=Symbol("operation-resolved-undefined");function $e(t,e,i,n,a,o=[],r={}){if((0,s.cy)(t)){He(t,e,i,n,o,r);let s=0;for(const l of t)$e(l,e,i,n,a,[...o,`${s}`],r),s++}else if((0,s.Qd)(t)){He(t,e,i,n,o,r);for(const s of Object.keys(t)){if(a?.has(s))continue;const l=t[s];Xe(l)?t[s]=Ue(l,e,i,n,[...o,s],r):$e(l,e,i,n,a,[...o,s],r)}}return r}function He(t,e,i,n,a,o){if((0,s.cy)(t))for(let s=0;s<t.length;s++)t[s]=Ue(t[s],e,i,n,[...a,`${s}`],o),t[s]===Ye&&(t[s]=void 0);else{let s=!1;for(const r of Object.keys(t))t[r]=Ue(t[r],e,i,n,[...a,r],o),s||(s=qe(r,ei)),t[r]===Ye&&delete t[r];if(s&&Object.keys(t).length>1)for(const e of Object.keys(t))qe(e,ei)&&delete t[e]}}function Ue(t,e,i,s,n,a){const o=Xe(t);if(!o)return t;a[n.join(".")]=t;const r=Ze(o.operation,o.values,e,i,n,s);return void 0===r?Ye:r}function Xe(t){if(!(0,s.Qd)(t))return;const[e]=Object.keys(t);return qe(e,ei)?{operation:e,values:t[e]}:void 0}function Ze(t,e,i,n,a,o){return o.referencedParams??(o.referencedParams=new Set),(0,s.cy)(e)&&!["$find","$map"].includes(t)&&(e=e.map(t=>{const e=Xe(t);return e?Ze(e.operation,e.values,i,n,a,o):t})),(0,ei[t])(e,a,i,n,o)}function qe(t,e){return(0,s.Kg)(t)&&((0,s.Gv)(e)||(0,s.cy)(e))&&t in e}function Qe(t){return(0,s.Et)(t)&&t>=0&&t<=1}function Je(t){return(0,s.Gv)(t)&&"gradient"==t.type}function ti(t,e){const i=e.split("/");let s=[...t];e.startsWith("/")&&(s=[],i.shift());let n=!1;for(const e of i){if(".."===e)s.pop(),n||s.pop();else if("."===e)s.pop();else if("$index"===e){const e=t.findLast(t=>!isNaN(Number(t)));null!=e&&s.push(e)}else if("$prevIndex"===e){const e=t.findLast(t=>!isNaN(Number(t)));null!=e&&s.push(""+(Number(e)-1))}else 0!==e.length&&s.push(e);n=".."===e}return s}var ei={...{$ref:function t(e,i,n,a,o){if(!qe(e,n))return void s.Vy.warnOnce(`\`$ref\` json operation failed on [${String(e)}] at [${i.join(".")}], expecting one of [${Object.keys(n).join(", ")}].`);const r=Xe(n[e]);return"$ref"!==r?.operation?n[e]:o.referencedParams?.has(r.values)?void s.Vy.warnOnce(`\`$ref\` json operation failed on [${String(e)}] at [${i.join(".")}], circular reference detected with [${[...o.referencedParams].join(", ")}].`):(o.referencedParams?.add(r.values),t(r.values,i,n,a,o))},$path:function(t,e,i,n){let a,o=!1,r=!1,l=n;if((0,s.cy)(t))o=!0,a=t[1],r=3===t.length,l=r?t[2]:l,t=t[0];else if(!(0,s.Kg)(t))return void s.Vy.warnOnce(`\`$path\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a string.`);const h=ti(r?[]:e,t);let c=l;for(const i of h){if(!qe(i,c))return o?a:void s.Vy.warnOnce(`\`$path\` json operation failed on [${String(t)}] at [${e.join(".")}] resolved to [${h.join(".")}], could not find path in object.`);c=c[i]}return Object.isFrozen(c)?Ge(c):c},$palette:function(t,e,i,n){if(!(0,s.Kg)(t))return;const a=i.__palette;if(["fill","fillFallback","stroke","gradient","range2"].includes(t)){const i=e.findLastIndex(t=>!isNaN(Number(t)));let o=Number(e[i]);if(isNaN(o))return;const r=e.slice(0,i),l=["map-shape-background","map-line-background"];switch(o-=G(n,r).slice(0,o).filter(t=>l.includes(t.type)).length,t){case"fill":return(0,s.XK)(a.fills,1,o)[0];case"fillFallback":return(0,s.XK)(a.fillsFallback,1,o)[0];case"stroke":return(0,s.XK)(a.strokes,1,o)[0];case"gradient":return(0,s.XK)(a.sequentialColors,1,o)[0];case"range2":return(0,s.XK)(a.fills,2,o)}return}return"gradients"===t?a.sequentialColors:G(a,t)}},$if:([t,e,i])=>t?e:i,$eq:([t,e])=>t===e,$not:([t])=>!t,$or:t=>(0,s.cy)(t)&&t.some(Boolean),$and:t=>(0,s.cy)(t)&&t.every(Boolean),$switch:()=>{},$isOperation:function(t,e,i,n){const a=(0,s.Kg)(t)?ti(e,t):e;return null!=Xe(0===a.length?n:G(n,a))},$isEven:function([t],e){if("number"==typeof t)return t%2==0;s.Vy.warnOnce(`\`$isEven\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a number.`)},$mul:function([t,e],i){if("number"==typeof t&&"number"==typeof e)return t*e;s.Vy.warnOnce(`\`$mul\` json operation failed on [${String(t)}] and [${String(e)}] at [${i.join(".")}], expecting two numbers.`)},$round:function([t],e){if("number"==typeof t)return Math.round(t);s.Vy.warnOnce(`\`$round\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a number.`)},$map:function([t,e],i,n,a,o){const r=Xe(e);if(r&&(e=Ze(r.operation,r.values,n,a,i,o)),!(0,s.cy)(e))return[];const l=Xe(t);return l?(o.matches.set(i.join("."),e),e.map(()=>({[l.operation]:l.values}))):[]},$find:function([t,e],i,n,a,o){const r=Xe(e);if(r&&(e=Ze(r.operation,r.values,n,a,i,o)),!(0,s.cy)(e))return;const l=Xe(t);return l?e.find(t=>Ze(l.operation,l.values,n,t,[],o)):t?e[0]:void 0},$merge:function(t){if((0,s.cy)(t)){for(const e of t)if(!(0,s.Qd)(e))return;return E(...t)}},$omit:function([t,e]){if((0,s.cy)(t)&&(0,s.Qd)(e))return z(e,t)},$value:function(t,e,i,s,n){if("$1"!==t&&"$index"!==t)return t;const a=e.findLastIndex(t=>!isNaN(Number(t)));if(-1===a)return t;const o=Number(e[a]);if("$index"===t)return o;const r=e.slice(0,a).join(".");return n.matches.get(r)?.at(o)},$rem:function([t],e,i){const n="fontSize";if(qe(n,i)&&"number"==typeof i[n]&&"number"==typeof t)return Math.round(t*i[n]);s.Vy.warnOnce(`\`$rem\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a number.`)},$mix:function([t,e,i],n){const a=`\`$mix\` json operation failed on [${String(t)}, ${String(e)}, ${String(i)}] at [${n.join(".")}], expecting`,o=`${a} two colors and a number between 0 and 1.`;if("string"!=typeof e||!Qe(i))return void s.Vy.warnOnce(o);if("string"==typeof t)try{return yt.mix(yt.fromString(t),yt.fromString(e),i).toString()}catch{return void s.Vy.warnOnce(o)}if(!Je(t))return void s.Vy.warnOnce(o);let r=t.colorStops;try{r=r?.map(t=>{let s;return"string"==typeof t.color&&(s=yt.mix(yt.fromString(t.color),yt.fromString(e),i).toString()),{...t,color:s}})}catch{return void s.Vy.warnOnce(`${a} a gradient, a color and a number between 0 and 1.`)}return{...t,colorStops:r}},$foregroundBackgroundMix:function([t],e,i){const n="foregroundColor",a="backgroundColor";if(qe(n,i)&&qe(a,i)&&"string"==typeof i[n]&&"string"==typeof i[a]&&Qe(t))return yt.mix(yt.fromString(i[n]),yt.fromString(i[a]),t).toString();s.Vy.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(t)}}}] at [${e.join(".")}], expecting a number between 0 and 1.`)},$foregroundBackgroundAccentMix:function([t,e],i,n){const a="foregroundColor",o="backgroundColor",r="accentColor";if(qe(a,n)&&qe(o,n)&&qe(r,n)&&"string"==typeof n[a]&&"string"==typeof n[o]&&"string"==typeof n[r]&&Qe(t)&&Qe(e))return yt.mix(yt.mix(yt.fromString(n[a]),yt.fromString(n[o]),t),yt.fromString(n[r]),e).toString();s.Vy.warnOnce(`\`$foregroundBackgroundAccentMix\` json operation failed on [${String(t)}, ${String(e)}}] at [${i.join(".")}], expecting two numbers between 0 and 1.`)},$interpolate:function([t,e]){if((0,s.cy)(t)&&(0,s.Et)(e))return yt.interpolate(t.map(t=>yt.fromString(t)),e).map(t=>t.toString())},$isGradient:([t])=>Je(t),$isPattern:([t])=>{return null!==(e=t)&&(0,s.Gv)(e)&&"pattern"==e.type;var e},$isImage:([t])=>{return null!==(e=t)&&(0,s.Gv)(e)&&"image"==e.type;var e}},ii=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise(e=>{this.acquireQueue.push([t,e]),this.available&&this.dispatchNext().catch(t=>s.Vy.errorOnce(t))})}async acquireImmediately(t){return!!this.available&&(await this.acquire(t),!0)}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(t){s.Vy.error("mutex callback error",t),e?.()}[t,e]=this.acquireQueue.shift()??[]}this.available=!0}},si=class{constructor(){this.eventListeners=new Map}addEventListener(t,e){if("function"!=typeof e)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){const i=this.eventListeners.get(t);null!=i&&(i.delete(e),0===i.size&&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))}},ni=class extends Lt{constructor(t=0,e=t,i=t,s=e){super(),this.top=t,this.right=e,this.bottom=i,this.left=s}};function ai(t,e){const i=(0,s.cy)(t)?t:t.split(".");if(1===i.length){const[t]=i;return C((e,i,s)=>e[t]=s,e=>e[t],e)}return C((t,e,s)=>j(t,i,s),t=>G(t,i),e)}function oi(t){return C((e,i,s)=>e[t]=s)}function ri(t,e){return C((i,s,n)=>i[t][e??s]=n)}function li(t){const{newValue:e,oldValue:i,changeValue:s}=t;return C((t,n,a,o)=>(a!==o&&(void 0!==o&&i?.call(t,o),void 0!==a&&e?.call(t,a),s?.call(t,a,o)),a))}function hi(t){return L(t)}function ci(t,e){let i,s,n=0,a=!1;const o=()=>a,r=()=>{a=!1,s?.(),s=void 0,i=void 0,n>0&&t(l)},l=()=>{const t=n;n=0,a=!0;const i=e({count:t});i?i.then(r,r):r()};return{schedule(e){0!==n||o()||t(l,e),n++},async await(){if(o())for(null==i&&(i=new Promise(t=>{s=t}));o();)await i}}}r([Ct],ni.prototype,"top",2),r([Ct],ni.prototype,"right",2),r([Ct],ni.prototype,"bottom",2),r([Ct],ni.prototype,"left",2);var di=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function ui(t,e,i){const{offsetX:s,offsetY:n,clientX:a,clientY:o}=e,{currentX:r,currentY:l}=mi.calcCurrentXY(i,e);return{type:t,offsetX:s,offsetY:n,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:e}}function pi(t,e,i){return{type:t,sourceEvent:e}}var gi={blur:t=>({type:"blur",sourceEvent:t}),change:t=>({type:"change",sourceEvent:t}),contextmenu:(t,e)=>ui("contextmenu",t,e),focus:t=>({type:"focus",sourceEvent:t}),keydown:t=>({type:"keydown",sourceEvent:t}),keyup:t=>({type:"keyup",sourceEvent:t}),click:(t,e)=>ui("click",t,e),dblclick:(t,e)=>ui("dblclick",t,e),mouseenter:(t,e)=>ui("mouseenter",t,e),mousemove:(t,e)=>ui("mousemove",t,e),mouseleave:(t,e)=>ui("mouseleave",t,e),wheel:t=>{const{offsetX:e,offsetY:i,clientX:s,clientY:n}=t,a=0===t.deltaMode?.01:1;return{type:"wheel",offsetX:e,offsetY:i,clientX:s,clientY:n,deltaX:t.deltaX*a,deltaY:t.deltaY*a,sourceEvent:t}},touchstart:(t,e)=>pi("touchstart",t),touchmove:(t,e)=>pi("touchmove",t),touchend:(t,e)=>pi("touchend",t),touchcancel:(t,e)=>pi("touchcancel",t)},mi=class{static alloc(t,e,i){return gi[t](e,i)}static isHTMLEvent(t){return di.includes(t)}static calcCurrentXY(t,e){const i=t.getBoundingClientRect();return{currentX:e.clientX-i.x,currentY:e.clientY-i.y}}},yi=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 i=i=>{const s=mi.alloc(t,i,e.getElement());for(const i of this.widgetListeners?.[t]??[])i(s,e)},s={};t.startsWith("touch")&&(s.passive=!1),this.initSourceHandler(t,i),e.getElement().addEventListener(t,i,s)}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(0,s.jO)(this.sourceListeners??{}))t.getElement().removeEventListener(e,i);this.widgetListeners=void 0,this.sourceListeners=void 0}},fi=class{constructor(t,e,i,n){this.glob=t,this.self=e,this.window=(0,s.zk)(),this.mousegeneral=t=>{t.stopPropagation(),t.stopImmediatePropagation()},this.mousemove=t=>{t.stopPropagation(),t.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(t)},this.mouseup=t=>{0===t.button&&(t.stopPropagation(),t.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(t),this.destroy())};const{window:a,mousegeneral:o,mousemove:r,mouseup:l}=this;a.addEventListener("mousedown",o,{capture:!0}),a.addEventListener("mouseenter",o,{capture:!0}),a.addEventListener("mouseleave",o,{capture:!0}),a.addEventListener("mouseout",o,{capture:!0}),a.addEventListener("mouseover",o,{capture:!0}),a.addEventListener("mousemove",r,{capture:!0}),a.addEventListener("mouseup",l,{capture:!0}),e.mouseDragger=this,t.globalMouseDragCallbacks=i,t.globalMouseDragCallbacks.mousedown(n)}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}},xi=!1,bi=class{constructor(t,e,i,n,a){this.glob=t,this.self=e,this.initialTouch=n,this.target=a,this.longTapInterrupted=!1,this.longtap=()=>{const{target:t,initialTouch:e}=this;if(!this.longTapInterrupted){t.dispatchEvent(new TouchEvent("touchcancel",{touches:[e],bubbles:!0})),xi=!0;const i=t=>{t.preventDefault()},n=e=>{xi=!1,e.preventDefault(),t.removeEventListener("touchmove",i),t.removeEventListener("touchend",n),t.removeEventListener("touchcancel",n)};t.addEventListener("touchmove",i,{passive:!1}),t.addEventListener("touchend",n,{passive:!1}),t.addEventListener("touchcancel",n,{passive:!1});const{clientX:a,clientY:o}=e,r=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:(0,s.zk)(),clientX:a,clientY:o,pointerType:"touch"});t.dispatchEvent(r)}},this.touchmove=t=>{const{glob:e,self:i,initialTouch:s}=this,n=this.findInitialFinger(t.targetTouches);null!=n&&(this.longTapInterrupted=this.longTapInterrupted||function(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY;return i*i+s*s}(s,n)>100,i.dragTouchEnabled&&null!=n&&e.globalTouchDragCallbacks?.touchmove(t,n))},this.touchend=t=>{this.longTapInterrupted=!0;const e=this.findInitialFinger(t.changedTouches,t.touches);null!=e&&this.glob.globalTouchDragCallbacks?.touchend(t,e),this.destroy()},this.longtapTimer=setTimeout(this.longtap,500);const{touchmove:o,touchend:r}=this;a.addEventListener("touchmove",o,{passive:!1}),a.addEventListener("touchstart",r,{passive:!1}),a.addEventListener("touchend",r,{passive:!1}),a.addEventListener("touchcancel",r,{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(t=>Array.from(t)).flat();return Array.from(e).find(t=>t.identifier===this.initialTouch.identifier)}};function vi(t,e,i,s){const{currentX:n,currentY:a}=mi.calcCurrentXY(t.getElement(),s),o=s.pageX-i.pageX,r=s.pageY-i.pageY;return{type:e,device:"mouse",offsetX:i.offsetX+o,offsetY:i.offsetY+r,clientX:s.clientX,clientY:s.clientY,currentX:n,currentY:a,originDeltaX:o,originDeltaY:r,sourceEvent:s}}function Si(t,{pageX:e,pageY:i}){const{x:s,y:n}=t.getElement().getBoundingClientRect();return{offsetX:e-s,offsetY:i-n}}function Mi(t,e,i,s,n){const{currentX:a,currentY:o}=mi.calcCurrentXY(t.getElement(),n),r=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:e,device:"touch",offsetX:i.offsetX+r,offsetY:i.offsetY+l,clientX:n.clientX,clientY:n.clientY,currentX:a,currentY:o,originDeltaX:r,originDeltaY:l,sourceEvent:s}}var ki={},Di=class{constructor(t){this.dispatchCallback=t,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(t){this.listeners??(this.listeners=new Map);let e=this.listeners.get(t);return void 0===e&&(e=new Set,this.listeners.set(t,e)),e}add(t,e,i){switch(this.getListenerSet(t).add(i),t){case"drag-start":case"drag-move":case"drag-end":this.registerDragTrigger(e)}}remove(t,e,i){this.getListenerSet(t).delete(i)}registerDragTrigger(t){if(null==this.dragTriggerRemover){const e=e=>this.triggerMouseDrag(t,e),i=e=>this.triggerTouchDrag(t,e);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){0===e.button&&this.startMouseDrag(t,e)}startMouseDrag(t,e){const i={pageX:NaN,pageY:NaN,offsetX:NaN,offsetY:NaN};W(["pageX","pageY","offsetX","offsetY"],i,e);const s={mousedown:e=>{const s=vi(t,"drag-start",i,e);this.dispatch("drag-start",t,s)},mousemove:e=>{const s=vi(t,"drag-move",i,e);this.dispatch("drag-move",t,s)},mouseup:e=>{const s=vi(t,"drag-end",i,e);this.dispatch("drag-end",t,s),this.endDrag(t,s)}};this.mouseDragger=function(t,e,i,s){if(null==t.globalMouseDragCallbacks)return new fi(t,e,i,s)}(ki,this,s,e)}endDrag(t,{sourceEvent:e,clientX:i,clientY:s}){const n=t.getElement(),a=n.getBoundingClientRect();c.containsPoint(a,i,s)||(n.dispatchEvent(new MouseEvent("mouseleave",e)),e.target?.dispatchEvent(new MouseEvent("mouseenter",e)))}triggerTouchDrag(t,e){const i=e.targetTouches[0];1===e.targetTouches.length&&null!=i&&this.startOneFingerTouch(t,e,i)}startOneFingerTouch(t,e,i){const s={pageX:NaN,pageY:NaN,...Si(t,i)};W(["pageX","pageY"],s,i);const n={touchmove:(e,i)=>{const n=Mi(t,"drag-move",s,e,i);this.dispatch("drag-move",t,n)},touchend:(e,i)=>{const n=Mi(t,"drag-end",s,e,i);this.dispatch("drag-end",t,n)}},a=t.getElement();this.touchDragger=function(t,e,i,s,n){if(null==t.globalTouchDragCallbacks&&!xi)return new bi(t,e,i,s,n)}(ki,this,n,i,a);const o=Mi(t,"drag-start",s,e,i);this.dispatch("drag-start",t,o)}dispatch(t,e,i){for(const s of this.getListenerSet(t))s(i,e);this.dispatchCallback(t,i)}},wi=class{constructor(t){this.elem=t}setBounds(t){Ne(this.elemContainer??this.elem,t)}getBounds(){return Oe(this.elemContainer??this.elem)}static setElementContainer(t,e){Ne(e,t.getBounds()),(0,s.Hs)(t.elem,{width:"100%",height:"100%"}),t.elem.remove(),t.elemContainer=e,t.elemContainer.replaceChildren(t.elem)}},Ii=class extends wi{constructor(t){super(t),this.elem=t,this.index=NaN,this.children=[]}set id(t){(0,s.Bq)(this.elem,"id",t)}get id(){return(0,s.D$)(this.elem,"id")}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.parent?.removeChild(this),this.children.forEach(t=>{t.parent=void 0,t.destroy()}),this.children.length=0,this.destructor(),this.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove()}setHidden(t){(0,s.EM)(this.elem,"display",t?"none":void 0)}isHidden(){return"none"===(0,s.zk)()?.getComputedStyle?.(this.elem).display}setCursor(t){(0,s.EM)(this.elem,"cursor",t)}setTextContent(t){this.elem.textContent=t??null}setAriaDescribedBy(t){(0,s.Bq)(this.elem,"aria-describedby",t)}setAriaHidden(t){(0,s.Bq)(this.elem,"aria-hidden",t)}setAriaLabel(t){(0,s.Bq)(this.elem,"aria-label",t)}setAriaExpanded(t){(0,s.Bq)(this.elem,"aria-expanded",t)}setAriaControls(t){(0,s.Bq)(this.elem,"aria-controls",t)}setAriaHasPopup(t){(0,s.Bq)(this.elem,"aria-haspopup",t)}setInnerHTML(t){this.elem.innerHTML=t}setPointerEvents(t){(0,s.EM)(this.elem,"pointer-events",t)}isDisabled(){return(0,s.D$)(this.elem,"aria-disabled",!1)}hasPopup(){const t=(0,s.D$)(this.elem,"aria-haspopup");return void 0!==t&&"false"!==t}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(t){this.elem.focus(t)}setFocusOverride(t){(0,s.Bq)(this.elem,"data-focus-override",t)}setPreventsDefault(t){(0,s.Bq)(this.elem,"data-preventdefault",t)}setTabIndex(t){(0,s.Bq)(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(e=>e===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(void 0!==t)return this.children.filter(e=>void 0!==e.domIndex&&e.domIndex>t).reduce((t,e)=>!t||e.domIndex<t.domIndex?e:t,void 0)}addListener(t,e){return mi.isHTMLEvent(t)?(this.htmlListener??(this.htmlListener=new yi),this.htmlListener.add(t,this,e)):(this.internalListener??(this.internalListener=new Di(this.onDispatch.bind(this))),this.internalListener.add(t,this,e)),()=>this.removeListener(t,e)}removeListener(t,e){mi.isHTMLEvent(t)?this.htmlListener?.remove(t,this,e):null!=this.htmlListener&&this.internalListener?.remove(t,this,e)}setDragTouchEnabled(t){this.internalListener??(this.internalListener=new Di(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=t}onDispatch(t,e){if(!e.sourceEvent?.bubbles)return;let{parent:i}=this;for(;null!=i;){const{internalListener:s}=i;if(null!=s){const n={...e,...mi.calcCurrentXY(i.getElement(),e)};s.dispatch(t,i,n)}i=i.parent}}static addWindowEvent(t,e){const i=t=>{t.persisted||e()};return(0,s.zk)().addEventListener("pagehide",i),()=>(0,s.zk)().removeEventListener("pagehide",i)}},Ci=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 t=this.store.keys();let e=this.store.size-this.maxCacheSize;for(;e>0;){const i=t.next();i.done||this.store.delete(i.value),e--}}return e}clear(){this.store.clear()}},Li=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="string"==typeof t.font?t.font:Ti.toFontString(t.font),i=`${e}-${t.textAlign??"start"}-${t.textBaseline??"alphabetic"}`;return this.instanceMap.get(i)??this.createFontMeasurer(e,t,i)}static clear(){this.instanceMap.clear()}static createFontMeasurer(t,e,i){const s=function(t=0,e=0){return new OffscreenCanvas(t,e).getContext("2d")}();s.font=t,s.textAlign=e.textAlign??"start",s.textBaseline=e.textBaseline??"alphabetic";const n=new Ai(s,e);return this.instanceMap.set(i,n),n}};Li.instanceMap=new Ci(10);var Ai=class{constructor(t,e){this.ctx=t,this.measureMap=new Ci(100),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline),t.font="string"==typeof e.font?e.font:Ti.toFontString(e.font),this.textMeasurer=new Ni(t=>this.cachedCtxMeasureText(t),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)}},Ti=class{static toFontString({fontSize:t=10,fontStyle:e,fontWeight:i,fontFamily:s,lineHeight:n}){let a="";return e&&(a+=`${e} `),i&&(a+=`${i} `),a+=`${t}px`,n&&(a+=`/${n}px`),a+=` ${s}`,a.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;default:return 1}}};Ti.EllipsisChar="…",Ti.defaultLineHeight=1.15,Ti.lineSplitter=/\r?\n/g;var Ni=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,a=0;const o=Ti.getVerticalModifier(this.textBaseline),r=[];let l=0;const h=t.length;for(const o of t){const t=this.measureTextFn(o);t.fontBoundingBoxAscent??(t.fontBoundingBoxAscent=t.emHeightAscent),t.fontBoundingBoxDescent??(t.fontBoundingBoxDescent=t.emHeightDescent),e<t.width&&(e=t.width),n<t.actualBoundingBoxLeft&&(n=t.actualBoundingBoxLeft),0===l?(i+=t.actualBoundingBoxAscent,s+=t.actualBoundingBoxAscent):a+=t.fontBoundingBoxAscent,l===h-1?i+=t.actualBoundingBoxDescent:a+=t.fontBoundingBoxDescent,r.push({text:o,width:t.width,height:t.actualBoundingBoxAscent+t.actualBoundingBoxDescent,lineHeight:t.fontBoundingBoxAscent+t.fontBoundingBoxDescent,offsetTop:t.actualBoundingBoxAscent,offsetLeft:t.actualBoundingBoxLeft}),l++}return i+=a,s+=a*o,{width:e,height:i,offsetTop:s,offsetLeft:n,lineMetrics:r}}textWidth(t,e){if(e){let e=0;for(let i=0;i<t.length;i++)e+=this.textWidth(t.charAt(i));return e}return t.length>1?this.measureTextFn(t).width:this.charMap.get(t)??this.charWidth(t)}measureText(t){return this.getMetrics(t)}measureLines(t){const e="string"==typeof t?t.split(Ti.lineSplitter):t;return this.getMultilineMetrics(e)}charWidth(t){const{width:e}=this.measureTextFn(t);return this.charMap.set(t,e),e}},Oi=class t extends de{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=t.defaultStyles.textAlign,this.textBaseline=t.defaultStyles.textBaseline}onTextChange(){this.lines=this.text?.split("\n").map(t=>t.trim())??[]}static computeBBox(t,e,i,s){const{offsetTop:n,offsetLeft:a,width:o,height:r}=Li.measureLines(t,s),l=s.lineHeight?s.lineHeight*t.length:r;return new y(e-a,i-n,o,l)}computeBBox(){const{x:e,y:i,lines:s,textBaseline:n,textAlign:a,lineHeight:o}=this;return t.computeBBox(s,e,i,{font:this,textBaseline:n,textAlign:a,lineHeight:o})}getTextMeasureBBox(){return this.computeBBox()}isPointInPath(t,e){const i=this.getBBox();return!!i&&i.containsPoint(t,e)}render(t){const{ctx:e,stats:i}=t;if(!this.lines.length||!this.layerManager)return i&&(i.nodesSkipped+=1),super.render(t);const{fill:s,stroke:n,strokeWidth:a}=this,{globalAlpha:o}=e,{pixelRatio:r}=this.layerManager.canvas;if(!(s||null!=n&&a>0))return super.render(t);const l=Ti.toFontString(this);if(e.font!==l&&(e.font=l),e.textAlign=this.textAlign,e.textBaseline=this.textBaseline,s){this.applyFillAndAlpha(e);const{fillShadow:t}=this;t?.enabled&&(e.shadowColor=t.color,e.shadowOffsetX=t.xOffset*r,e.shadowOffsetY=t.yOffset*r,e.shadowBlur=t.blur*r),this.renderLines((t,i,s)=>e.fillText(t,i,s)),e.globalAlpha=o}if(n&&a){this.applyStrokeAndAlpha(e),e.lineWidth=a;const{lineDash:t,lineDashOffset:i,lineCap:s,lineJoin:n}=this;t&&e.setLineDash([...t]),i&&(e.lineDashOffset=i),s&&(e.lineCap=s),n&&(e.lineJoin=n),this.renderLines((t,i,s)=>e.strokeText(t,i,s)),e.globalAlpha=o}super.render(t)}renderLines(t){const{lines:e,x:i,y:s}=this,n=this.lineHeight??Ti.getLineHeight(this.fontSize);let a=(n-n*e.length)*Ti.getVerticalModifier(this.textBaseline);for(const o of e)t(o,i,s+a),a+=n}setFont(t){this.fontFamily=t.fontFamily,this.fontSize=t.fontSize,this.fontStyle=t.fontStyle,this.fontWeight=t.fontWeight}setAlign(t){this.textAlign=t.textAlign,this.textBaseline=t.textBaseline}toSVG(){if(!this.visible||!this.text)return;const t=(0,s.FJ)("text");return this.applySvgFillAttributes(t),t.setAttribute("font-family",this.fontFamily?.split(",")[0]??""),t.setAttribute("font-size",String(this.fontSize)),t.setAttribute("font-style",this.fontStyle??""),t.setAttribute("font-weight",String(this.fontWeight??"")),t.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),t.setAttribute("alignment-baseline",{alphabetic:"alphabetic",top:"top",bottom:"bottom",hanging:"hanging",middle:"middle",ideographic:"ideographic"}[this.textBaseline??"alphabetic"]),t.setAttribute("x",String(this.x)),t.setAttribute("y",String(this.y)),t.textContent=this.text??"",{elements:[t]}}};Oi.className="Text",Oi.defaultStyles={...de.defaultStyles,textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"},r([H()],Oi.prototype,"x",2),r([H()],Oi.prototype,"y",2),r([H({convertor:t=>(0,s.vM)(t)?String(t):t,changeCb:t=>t.onTextChange()})],Oi.prototype,"text",2),r([H()],Oi.prototype,"fontStyle",2),r([H()],Oi.prototype,"fontWeight",2),r([H()],Oi.prototype,"fontSize",2),r([H()],Oi.prototype,"fontFamily",2),r([H()],Oi.prototype,"textAlign",2),r([H()],Oi.prototype,"textBaseline",2),r([H()],Oi.prototype,"lineHeight",2);var Ri=Oi,Ei=class extends(xe(Ri)){},Pi=class extends(xe(ve(Ri))){},Bi=class{static wrapText(t,e){return this.wrapLines(t,e).join("\n")}static wrapLines(t,e){const i=this.textWrap(t,e);return"hide"===e.overflow&&i.some(t=>t.endsWith(Ti.EllipsisChar))?[]:i}static appendEllipsis(t){return t.replace(/[.,]{1,5}$/,"")+Ti.EllipsisChar}static truncateLine(t,e,i,s){const n=e.textWidth(Ti.EllipsisChar);let a=0,o=0;for(;o<t.length;o++){const s=e.textWidth(t.charAt(o));if(a+s>i)break;a+=s}if(t.length===o&&(!s||a+n<=i))return s?t+Ti.EllipsisChar:t;for(t=t.slice(0,o).trimEnd();t.length&&e.textWidth(t)+n>i;)t=t.slice(0,-1).trimEnd();return t+Ti.EllipsisChar}static textWrap(t,e){const i=t.split(Ti.lineSplitter),s=Li.getMeasurer(e);if("never"===e.textWrap)return i.map(t=>this.truncateLine(t.trimEnd(),s,e.maxWidth));const n=[],a="hyphenate"===e.textWrap,o=null==e.textWrap||"on-space"===e.textWrap;for(const t of i){let i=t.trimEnd();if(""===i){n.push(i);continue}let r=0,l=0,h=0;for(;r<i.length;){const t=i.charAt(r);if(l+=s.textWidth(t)," "===t&&(h=r),l>e.maxWidth){if(0===r)break;const t=s.textWidth(i.slice(0,r+1));if(t<=e.maxWidth){l=t,r++;continue}if(h){const t=this.getWordAt(i,h+1),a=s.textWidth(t);if(a<=e.maxWidth){n.push(i.slice(0,h).trimEnd()),i=i.slice(h).trimStart(),r=0,l=0,h=0;continue}o&&a>e.maxWidth&&n.push(i.slice(0,h).trimEnd(),this.truncateLine(i.slice(h).trimStart(),s,e.maxWidth,!0))}else o&&n.push(this.truncateLine(i,s,e.maxWidth,!0));if(o){i="";break}const c=a?"-":"";let d=i.slice(0,r).trim();for(;d.length&&s.textWidth(d+c)>e.maxWidth;)d=d.slice(0,-1).trimEnd();if(n.push(d+c),!d.length){i="";break}i=i.slice(d.length).trimStart(),r=-1,l=0,h=0}r++}i&&n.push(i)}return this.avoidOrphans(n,s,e),this.clipLines(n,s,e)}static getWordAt(t,e){const i=t.indexOf(" ",e);return-1===i?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 s=0,a=0;s<n.length;s++){const{lineHeight:o}=n[s];if(a+=o,a>i.maxHeight){if("hide"===i.overflow)return[];const n=t.slice(0,s||1),a=n.pop();return n.concat(this.truncateLine(a,e,i.maxWidth,!0))}}return t}static avoidOrphans(t,e,i){if(!1===i.avoidOrphans||t.length<2)return;const{length:s}=t,n=t[s-1],a=t[s-2];if(a.length<n.length)return;const o=a.lastIndexOf(" ");if(-1===o||o===a.indexOf(" ")||n.includes(" "))return;const r=a.slice(o+1);e.textWidth(n+r)<=i.maxWidth&&(t[s-2]=a.slice(0,o),t[s-1]=r+" "+n)}},Fi=class extends Lt{constructor(){super(...arguments),this.id=(0,s.sX)(this),this.node=new Ei({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(t,e){return t.layoutManager.addListener("layout:complete",()=>this.updateA11yText(t,e))}computeTextWrap(t,e){const{text:i,padding:s,wrapping:n}=this,a=Math.min(this.maxWidth??1/0,t)-2*s,o=this.maxHeight??e-2*s;if(!isFinite(a)&&!isFinite(o))return void(this.node.text=i);const r=Bi.wrapText(i??"",{maxWidth:a,maxHeight:o,font:this,textWrap:n});this.node.text=r,this.truncated=r.includes(Ti.EllipsisChar)}updateA11yText(t,e){const{proxyInteractionService:i}=t;if(this.enabled&&this.text){const s=Me.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",e=>this.handleMouseMove(t,e)),this.proxyText.addListener("mouseleave",e=>this.handleMouseLeave(t,e))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(t,e){if(null!=e&&this.enabled&&this.node.visible&&this.truncated){const{x:i,y:s}=Me.toCanvas(this.node),n=e.sourceEvent.offsetX+i,a=e.sourceEvent.offsetY+s;t.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:a,showArrow:!1},[{type:"structured",title:this.text}])}}handleMouseLeave(t,e){t.tooltipManager.removeTooltip(this.id)}};Fi.SMALL_PADDING=10,r([Ct,ri("node","visible")],Fi.prototype,"enabled",2),r([Ct,ri("node")],Fi.prototype,"text",2),r([Ct,ri("node")],Fi.prototype,"textAlign",2),r([Ct,ri("node")],Fi.prototype,"fontStyle",2),r([Ct,ri("node")],Fi.prototype,"fontWeight",2),r([Ct,ri("node")],Fi.prototype,"fontSize",2),r([Ct,ri("node")],Fi.prototype,"fontFamily",2),r([Ct,ri("node","fill")],Fi.prototype,"color",2),r([Ct],Fi.prototype,"spacing",2),r([Ct],Fi.prototype,"maxWidth",2),r([Ct],Fi.prototype,"maxHeight",2),r([Ct],Fi.prototype,"wrapping",2),r([Ct],Fi.prototype,"padding",2),r([Ct],Fi.prototype,"layoutStyle",2);var zi=(t=>(t.X="x",t.Y="y",t.Angle="angle",t.Radius="radius",t))(zi||{});function Gi(t){switch(t){case"x":case"y":case"angle":case"radius":return!0;default:return!1}}var _i=(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))(_i||{}),ji=class{constructor(){this.events=new s.bk,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 Wi(t,e);for(const t of Object.values(_i))"number"==typeof t&&this.elements.get(t)?.forEach(t=>t(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})}},Wi=class{constructor(t,e){this.width=t,this.height=e,this.layoutBox=new y(0,0,t,e)}},Vi=class{constructor(){this.title=new Fi,this.subtitle=new Fi,this.footnote=new Fi}positionCaptions(t){const{title:e,subtitle:i,footnote:s}=this,n=t.layoutBox.height/10;if(e.enabled){const{spacing:i}=e;this.positionCaption("top",e,t.layoutBox,n),this.shrinkLayoutByCaption("top",e,t.layoutBox,i)}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 t of[e,i,s])if("overlay"===t.layoutStyle)if("left"===t.textAlign)t.node.x=n.x+t.padding;else if("right"===t.textAlign){const e=t.node.getBBox();t.node.x=n.x+n.width-e.width-t.padding}}computeX(t,e){return"left"===t?e.x:"right"===t?e.x+e.width:e.x+e.width/2}positionCaption(t,e,i,s){const n=Math.max(Ti.getLineHeight(e.fontSize),s);e.node.x=this.computeX(e.textAlign,i)+e.padding,e.node.y=i.y+("top"===t?0:i.height)+e.padding,e.node.textBaseline=t,e.computeTextWrap(i.width,n)}shrinkLayoutByCaption(t,e,i,s=0){if("block"===e.layoutStyle){const n=e.node.getTextMeasureBBox();i.shrink("top"===t?Math.ceil(n.y-i.y+n.height+s):Math.ceil(i.y+i.height-n.y+s),t)}}};r([Ct],Vi.prototype,"title",2),r([Ct],Vi.prototype,"subtitle",2),r([Ct],Vi.prototype,"footnote",2);var Ki=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],Yi=class{constructor(t){this.chartService=t,this.mementoOriginatorKey="chartType"}createMemento(){let t=this.chartService.publicApi?.getOptions()?.chartType;return null==t&&(t="candlestick"),t}guardMemento(t){return null==t||Ki.includes(t)}restoreMemento(t,e,i){if(null==i)return;const n={chartType:i};this.chartService.publicApi?.updateDelta(n).catch(t=>s.Vy.error("error restoring state",t))}},$i=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)}},Hi="11.3.2",Ui=Symbol("previous-memento-not-found"),Xi=class{constructor(t){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=x.create(!0,"history"),this.destroyFns=new $i,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.historyIndex<this.history.length-1&&(this.history=this.history.slice(0,this.historyIndex+1)),this.history.length>this.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const t of e){if(!this.originators.has(t.mementoOriginatorKey))throw new Error(`Originator [${t.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(t.mementoOriginatorKey,t.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 t=this.findPreviousMemento(e);if(t===Ui)throw new Error(`Could not find previous memento for [${e}].`);this.restoreMemento(e,t)}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):Ui}restoreMemento(t,e){this.originators.get(t)?.restoreMemento(Hi,Hi,e)}debugEvent(...t){this.debug(...t,this.history.map((t,e)=>e===this.historyIndex?`** ${t.label} **`:t.label))}},Zi=class t{constructor(t){this.version=t.split("-")[0]}save(...t){const e={version:this.version};for(const i of Object.values(t))e[i.mementoOriginatorKey]=this.encode(i,i.createMemento());return e}restore(t,...e){if("object"==typeof t)if(null!=t)if("version"in t&&"string"==typeof t.version)for(const i of e){const e=this.decode(i,t[i.mementoOriginatorKey]),n=[];if(!i.guardMemento(e,n)){const t=n.length>0?`\n\n${n.join("\n\n")}\n\n`:"";return void s.Vy.warnOnce(`Could not restore [${i.mementoOriginatorKey}] data, value was invalid, ignoring.${t}`,e)}i.restoreMemento(this.version,t.version,e)}else s.Vy.warnOnce("Could not restore data, missing [version] string in object, ignoring.");else s.Vy.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");else s.Vy.warnOnce(`Could not restore data of type [${typeof t}], expecting an object, ignoring.`)}encode(e,i){try{return JSON.parse(JSON.stringify(i,t.encodeTypes))}catch(t){throw new Error(`Failed to encode [${e.mementoOriginatorKey}] value [${t}].`,{cause:t})}}decode(e,i){if(null==i)return i;try{return JSON.parse(JSON.stringify(i),t.decodeTypes)}catch(t){throw new Error(`Failed to decode [${e.mementoOriginatorKey}] value [${t}].`,{cause:t})}}static encodeTypes(t,e){return(0,s.$P)(this[t])?{__type:"date",value:this[t].toISOString()}:e}static decodeTypes(t,e){return(0,s.Gv)(this[t])&&"__type"in this[t]&&"date"===this[t].__type?new Date(this[t].value):e}},qi=class{constructor(){this.caretaker=new Zi(Hi),this.state=new Map}setState(t,e){O(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)}},Qi=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(e=>e.symbol===t);if(s>=0){i.splice(s,1),0===i.length&&this.registeredListeners.delete(e);break}}}dispatch(t,...e){for(const i of this.getListenersByType(t))try{i.handler(...e)}catch(t){s.Vy.errorOnce(t)}}getListenersByType(t){return this.registeredListeners.get(t)??[]}destroy(){this.registeredListeners.clear()}},Ji=class{constructor(){this.listeners=new Qi,this.destroyFns=[],this.destroyed=!1}addListener(t,e){return this.listeners.addListener(t,e)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(t=>t()),this.destroyed=!0}},ts=class t{constructor(t,e,i){this.element=t,this.topTabGuard=e,this.bottomTabGuard=i,this.destroyFns=[],this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,t=>this.onTab(t,!1)),this.initTabGuard(this.bottomTabGuard,t=>this.onTab(t,!0)),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",t=>this.onBlur(t),{capture:!0})}set tabIndex(t){this.guardTabIndex=t,0===this.guardTabIndex?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){for(const t of this.destroyFns)t();this.destroyFns.length=0}initTabGuard(t,e){const i=()=>e(t);t.addEventListener("focus",i),this.destroyFns.push(()=>t.removeEventListener("focus",i))}setGuardIndices(t){const e=t;(0,s.Bq)(this.topTabGuard,"tabindex",e),(0,s.Bq)(this.bottomTabGuard,"tabindex",e)}onFocus(){this.hasFocus=!0,0!==this.guardTabIndex&&this.setGuardIndices(0)}onBlur({relatedTarget:t}){const{topTabGuard:e,bottomTabGuard:i}=this;this.hasFocus=!1,0!==this.guardTabIndex&&t!==e&&t!==i&&this.setGuardIndices(this.guardTabIndex)}onTab(t,e){if(0!==this.guardTabIndex){let i;0===t.tabIndex?(i=this.findExitTarget(!e),this.setGuardIndices(this.guardTabIndex)):i=this.findEnterTarget(e),i?.focus()}}static queryFocusable(t,e){const i=(0,s.zk)();return Array.from(t.querySelectorAll(e)).filter(t=>{if(t instanceof HTMLElement){const e=i.getComputedStyle(t);return"none"!==e.display&&"none"!==e.visibility}return!1})}findEnterTarget(e){const i=t.queryFocusable(this.element,'[tabindex="0"]');return i[e?i.length-1:0]}findExitTarget(e){const i=t.queryFocusable((0,s.YE)(),"[tabindex]").filter(t=>t.tabIndex>0).sort((t,e)=>t.tabIndex-e.tabIndex),{before:n,after:a}=t.findBeforeAndAfter(i,this.guardTabIndex);return e?n:a}static findBeforeAndAfter(t,e){let i,s,n=0,a=t.length-1;for(;n<=a;){const o=Math.floor((n+a)/2),r=t[o].tabIndex;if(r===e){i=t[o-1]||void 0,s=t[o+1]||void 0;break}r<e?(i=t[o],n=o+1):(s=t[o],a=o-1)}return{before:i,after:s}}};function es(t,e,i,s,n){e.addEventListener(i,s);const a=()=>e.removeEventListener(i,s,n);return t.push(a),a}function is(t,e,i,s=["Escape"]){es(t,e,"keydown",t=>{ls(t,...s)&&i(t)})}function ss(t,e,i){const s=es(t,window,"mousedown",t=>{[0,2].includes(t.button)&&!as(e,t)&&(i(),s())});return s}function ns(t,e,i){const s=es(t,window,"touchstart",t=>{Array.from(t.targetTouches).some(t=>!as(e,t))&&(i(),s())});return s}function as(t,e){return e.target instanceof Node&&t.contains(e.target)}function os(t,e,i,n){i.forEach(t=>(0,s.Bq)(t,"data-focus-visible-override",n)),es(t,e,"keydown",()=>{i.forEach(t=>(0,s.Bq)(t,"data-focus-visible-override",!0))},{once:!0})}function rs(t){return!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)}function ls(t,...e){return rs(t)&&e.some(e=>t.key===e)}function hs(t,e,i,s){i&&es(t,e,"keydown",t=>{ls(t,s)&&i.focus()})}function cs(t,e,i,s,n,a){hs(t,e,n,a),hs(t,e,i,s),es(t,e,"keydown",t=>{ls(t,s,a)&&t.preventDefault()})}var ds={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function us(t){const{orientation:e,buttons:i,wrapAround:s=!1,onEscape:n,onFocus:a,onBlur:o}=t,{nextKey:r,prevKey:l}=ds[e],h=t=>{t.target&&"tabIndex"in t.target&&(i.forEach(t=>t.tabIndex=-1),t.target.tabIndex=0)},[c,d]=s?[i.length,i.length]:[0,1/0],u=[];for(let t=0;t<i.length;t++){const e=i[(c+t-1)%d],s=i[t],p=i[(c+t+1)%d];es(u,s,"focus",h),a&&es(u,s,"focus",a),o&&es(u,s,"blur",o),n&&is(u,s,n),cs(u,s,p,r,e,l),s.tabIndex=0===t?0:-1}return u}var ps=class{constructor(t,e,i){this.lastFocus=e,this.closeCallback=i,this.destroyFns=[],this.destroyFns.push(ss(this.destroyFns,t,()=>this.close(!0))),this.destroyFns.push(ns(this.destroyFns,t,()=>this.close(!0)))}close(t){this.destroyFns.forEach(t=>t()),this.destroyFns.length=0,this.closeCallback(),this.finishClosing(t)}finishClosing(t){this.destroyFns.forEach(t=>t()),this.destroyFns.length=0,(0,s.Bq)(this.lastFocus,"aria-expanded",!1),t||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}};function gs(t){const{sourceEvent:e,orientation:i,menu:n,buttons:a,closeCallback:o,overrideFocusVisible:r}=t,{nextKey:l,prevKey:h}=ds[i],c=fs(e);(0,s.Bq)(c,"aria-expanded",!0);const d=new ps(n,c,o),u=()=>d.close(),{destroyFns:p}=d;return n.role="menu",n.ariaOrientation=i,p.push(...us({orientation:i,buttons:a,onEscape:u,wrapAround:!0})),n.tabIndex=-1,is(p,n,u),es(p,n,"keydown",t=>{t.target!==n||t.key!==l&&t.key!==h||(t.preventDefault(),a[0]?.focus())}),a[0]?.focus({preventScroll:!0}),void 0!==r&&os(p,n,a,r),d}function ms(t,e){return i=>{if("true"===t.ariaDisabled)return i.preventDefault();e(i)}}function ys(t){return"button"in t?0===t.button:rs(t)&&("Space"===t.code||"Enter"===t.key)}function fs(t){if(t?.target instanceof HTMLElement&&"tabindex"in t.target.attributes)return t.target}function xs(t){const e=t=>{t.defaultPrevented||(0,s.D$)(t.target,"data-preventdefault",!0)&&ls(t,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&t.preventDefault()};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}var bs=class{constructor(t){this.callback=t,this.devicePixelRatio=(0,s.zk)("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=t=>{t.matches||(this.devicePixelRatio=(0,s.zk)("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=(0,s.zk)("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);t?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=t}},vs=class{constructor(){let t;this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([t,e])=>this.observe(t,e)),this.queuedObserveRequests=[],this.observeWindow()},"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(t=>{for(const{target:e,contentRect:{width:i,height:s}}of t){const t=this.elements.get(e);this.checkSize(t,e,i,s)}})),this.pixelRatioObserver=new bs(()=>{clearTimeout(t),t=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady="complete"===(0,s.YE)("readyState"),this.documentReady?this.observeWindow():(0,s.zk)()?.addEventListener("load",this.onLoad)}destroy(){(0,s.zk)()?.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(null!=i.size&&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)return void this.queuedObserveRequests.push([t,e]);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)}},Ss=class extends Map{constructor(t,e){super(),this.defaultValue=t,this.defaultState=e}set(t,e){return this.delete(t),void 0!==e&&super.set(t,e),this}stateId(){return Array.from(this.keys()).pop()??this.defaultState}stateValue(){return Array.from(this.values()).pop()??this.defaultValue}},Ms=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],ks=new Set(["canvas-container","canvas","tooltip-container"]),Ds=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}],["tooltip-container",{childElementType:"div"}]]),ws={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON:()=>ws};function Is(t,e){const i=(0,s.n)("div");return i.className="ag-charts-tab-guard",t.insertAdjacentElement(e,i),i}var Cs=class t extends Ji{constructor(t,e,i,n="normal"){super(),this.chart=t,this.styleContainer=i,this.mode=n,this.anchorName=`--${(0,s.sX)(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.documentRoot=void 0,this.initiallyConnected=void 0,this.containerSize=void 0,this.sizeMonitor=new vs,this.cursorState=new Ss("default"),this.minWidth=0,this.minHeight=0,this.element=this.initDOM(),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName);let a=!1;if(this.observer=function(t,e){if("undefined"==typeof IntersectionObserver)return;const i=new IntersectionObserver(i=>{for(const s of i)s.target===t&&e(s.intersectionRatio)},{root:t});return i.observe(t),i}(this.element,t=>{0!==t||a||this.listeners.dispatch("hidden",{type:"hidden"}),a=0===t}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",'.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>*{pointer-events:none}.ag-charts-canvas canvas{display:block}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{top:0;left:0;outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{inset:0;pointer-events:none;position:absolute;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-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-icon-size: 16px;--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;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-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{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-chrome-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);background:var(--ag-charts-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}\n'),this.setContainer(e),this.destroyFns.push(xs(this.element)),"normal"===this.mode){const t=this.rootElements["canvas-center"].element;if(null==t)throw new Error("Error initializing tab guards");const e=Is(t,"beforebegin"),i=Is(t,"afterend");this.tabGuards=new ts(t,e,i)}}initDOM(){if("normal"===this.mode){const t=(0,s.n)("div");return t.innerHTML='<div role="presentation" class="ag-charts-wrapper ag-charts-styles" data-ag-charts><div role="presentation" class="ag-charts-canvas-center"><div role="presentation" class="ag-charts-canvas-container"><div role="presentation" class="ag-charts-canvas" aria-hidden="true"></div><div role="figure" class="ag-charts-canvas-proxy"><div role="presentation" class="ag-charts-series-area"></div></div><div role="presentation" class="ag-charts-canvas-overlay ag-charts-tooltip-container"></div></div></div></div>',t.firstChild}const t=(0,s.n)("div");t.role="presentation",t.dataset.agCharts="",t.classList.add("ag-charts-wrapper");const e=(0,s.n)("div");return t.appendChild(e),e.role="presentation",e.classList.add("ag-charts-series-area"),t}initRootElements(){const{mode:t,element:e}=this,i={};for(const n of Ms){const a=`ag-charts-${n}`;let o;if(o="normal"===t?e.classList.contains(a)?e:e.getElementsByClassName(a)[0]:ks.has(n)?e:e.getElementsByClassName(a)[0]??(0,s.n)("div"),null==o)throw new Error(`AG Charts - unable to find DOM element ${a}`);i[n]={element:o,children:new Map,listeners:[]}}return i}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0,Object.values(this.rootElements).forEach(t=>{t.children.forEach(t=>t.remove()),t.element.remove()}),this.element.remove()}postRenderUpdate(){"minimal"!==this.mode&&null!=this.pendingContainer&&this.pendingContainer!==this.container&&(0===t.batchedUpdateContainer.length&&(0,s.zk)().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),t.batchedUpdateContainer.push(this))}applyBatchedUpdateContainer(){for(const e of t.batchedUpdateContainer)e.destroyed||e.updateContainer();t.batchedUpdateContainer.splice(0)}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=null==this.containerSize?"hidden":"",this.containerSize?(t.width=`${this.containerSize.width??0}px`,t.height=`${this.containerSize.height??0}px`):(t.width="",t.height=""),this.updateContainerClassName()}setTabGuardIndex(t){this.tabGuards&&(this.tabGuards.tabIndex=t)}setContainer(t){t!==this.container&&(this.pendingContainer=t,"minimal"!==this.mode&&null!=this.container||this.updateContainer())}updateContainer(){const{pendingContainer:t}=this;if(null!=t&&t!==this.container){if(this.container&&(this.container.removeChild(this.element),this.sizeMonitor.unobserve(this.container)),null!=this.documentRoot)for(const t of this.rootElements.styles.children.keys())this.removeChild("styles",t);this.container=t,this.pendingContainer=void 0,this.documentRoot=this.getShadowDocumentRoot(t),this.initiallyConnected="minimal"===this.mode||t.isConnected;for(const[t,e]of this.styles)this.addStyles(t,e);t.appendChild(this.element),this.sizeMonitor.observe(t,t=>{this.containerSize=t,this.updateContainerSize(),this.listeners.dispatch("resize",{type:"resize"})}),this.listeners.dispatch("container-changed",{type:"container-changed"})}}setThemeClass(t){this.element.classList.forEach(e=>{e.startsWith("ag-charts-theme-")&&e!==t&&this.element.classList.remove(e)}),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[n,a]of(0,s.jO)(t)){let t=`${a}`;i.includes(n)&&(t=`${a}px`),this.element.style.setProperty(`--ag-charts-${e[n]}`,t)}}updateCanvasLabel(t){(0,s.Bq)(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=(0,s.zk)(),e=new y(0,0,t.innerWidth,t.innerHeight),i=this.getRawOverlayClientRect();return e.intersection(i)?.toDOMRect()??ws}getRawOverlayClientRect(){let t=this.element;const e=this.element.getRootNode()?.fullscreenElement;for(;null!=t;){let i;if(null!=e&&t===e)i=!0;else{const e=t.computedStyleMap?.(),s=e?.get("overflow-y")?.toString();i="auto"===s||"scroll"===s}if(i)return y.fromDOMRect(t.getBoundingClientRect());t=t.parentElement}if(null!=this.documentRoot)return y.fromDOMRect(this.documentRoot.getBoundingClientRect());const{innerWidth:i,innerHeight:n}=(0,s.zk)();return new y(0,0,i,n)}getShadowDocumentRoot(t=this.container){const e=t?.ownerDocument?.body??(0,s.YE)("body");for(;null!=t;){if(t===e)return;if(t.parentNode instanceof DocumentFragment)return t;t=t.parentNode}}getParent(t){return this.rootElements[t].element}getChildBoundingClientRect(t){const{children:e}=this.rootElements[t],i=[];for(const t of e.values())i.push(y.fromDOMRect(t.getBoundingClientRect()));return y.merge(i)}isManagedChildDOMElement(t,e,i){const{children:s}=this.rootElements[e],n=s?.get(i);return null!=n&&t.contains(n)}contains(t,e){return null==e?this.element.contains(t):this.rootElements[e].element.contains(t)}addStyles(e,i){const n="data-ag-charts";if(this.styles.set(e,i),null==this.container)return;const a=t=>t.getAttribute(n)===e,o=t=>{const e=new Set(["TITLE","META"]);let i,o=!0;for(const s of t.children)if(o&&e.has(s.tagName))i=s;else{if(o=!1,a(s))return;s.hasAttribute(n)&&(i=s)}const r=(0,s.n)("style");return null!=this.chart.styleNonce&&(r.nonce=this.chart.styleNonce),null==i?t.prepend(r):t.insertBefore(r,i.nextSibling),r};let r;this.styleContainer?r=o(this.styleContainer):!1===this.initiallyConnected?r=this.addChild("styles",e):null!=this.documentRoot||t.headStyles.has(e)?null!=this.documentRoot&&(r=this.addChild("styles",e)):(r=o((0,s.YE)("head")),t.headStyles.add(e)),null==r||a(r)||(r.setAttribute(n,e),r.innerHTML=i)}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,n){const{element:a,children:o,listeners:r}=this.rootElements[t];if(!o)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(o.has(e))return o.get(e);const{childElementType:l="div"}=Ds.get(t)??{};if(i&&i.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const h=i??(0,s.n)(l);for(const[t,e,i]of r)h.addEventListener(t,e,i);if(o.set(e,h),"style"===l&&null!=this.chart.styleNonce&&(h.nonce=this.chart.styleNonce),n){const t=a.querySelector(n.query);if(null==t)throw new Error(`AG Charts - addChild query failed ${n.query}`);t.insertAdjacentElement(n.where,h)}else a?.appendChild(h);return h}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("ag-charts-wrapper--safe-horizontal",i>=(e?.width??1/0)),t.classList.toggle("ag-charts-wrapper--safe-vertical",s>=(e?.height??1/0))}};Cs.batchedUpdateContainer=[],Cs.headStyles=new Set;var Ls=Cs,As=class extends Ii{constructor(){super((0,s.n)("div")),this.textElement=(0,s.FJ)("text"),this.textElement.role="presentation",this.svgElement=(0,s.FJ)("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 e=this.textElement,i=e.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}},Ts=class extends Ii{constructor(t,e){super(t),(0,s.Bq)(this.elem,"role",e),this.setEnabled(!0)}destructor(){}setEnabled(t){(0,s.Bq)(this.elem,"aria-disabled",!t)}addListener(t,e){return super.addListener(t,(i,s)=>{("click"!==t&&"dblclick"!==t||!this.isDisabled())&&e(i,s)})}},Ns=class extends Ts{constructor(){super((0,s.n)("button"))}},Os=class extends Ii{constructor(){super((0,s.n)("div")),(0,s.Bq)(this.elem,"role","group")}destructor(){}},Rs=class extends Ii{constructor(t,e){super((0,s.n)("div")),this.focusedChildIndex=0,this.onChildFocus=(t,e)=>{const i=this.children[this.focusedChildIndex];this.focusedChildIndex=e.index,i?.setTabIndex(-1),e.setTabIndex(0)},this.onChildKeyDown=(t,e)=>{const i=this.orientation,[s,n]="both"===i?[ds.horizontal,ds.vertical]:[ds[i],void 0];let a=-1;if(rs(t.sourceEvent)){const i=t.sourceEvent.key;i===s.nextKey||i===n?.nextKey?a=e.index+1:i!==s.prevKey&&i!==n?.prevKey||(a=e.index-1)}this.children[a]?.focus()},(0,s.Bq)(this.elem,"role",e),this.orientation=t}get orientation(){return(0,s.D$)(this.elem,"aria-orientation")??"both"}set orientation(t){(0,s.Bq)(this.elem,"aria-orientation","both"!==t?t:void 0)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const t of this.children)this.removeChildListeners(t),t.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(t){t.addListener("focus",this.onChildFocus),t.addListener("keydown",this.onChildKeyDown)}removeChildListeners(t){t.removeListener("focus",this.onChildFocus),t.removeListener("keydown",this.onChildKeyDown)}onChildAdded(t){this.addChildListeners(t),t.setTabIndex(1===this.children.length?0:-1)}onChildRemoved(t){this.removeChildListeners(t);const{focusedChildIndex:e,children:i}=this,s=e===t.index;for(let t=0;t<i.length;t++){const s=i[t];s.index===e&&(this.focusedChildIndex=t),s.index=t}if(s){const t=i[e]??i[e-1];t?(this.focusedChildIndex=t.index,t.setTabIndex(0)):this.focusedChildIndex=0}}},Es=class extends Rs{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(t=>t.getElement().parentElement.remove())}addChildToDOM(t,e){const i=(0,s.n)("div");(0,s.Bq)(i,"role","listitem"),(0,s.EM)(i,"position","absolute"),Ii.setElementContainer(t,i),this.appendOrInsert(i,e),this.setHidden(!1)}removeChildFromDOM(t){t.getElement().parentElement.remove(),this.setHidden(0===this.children.length)}setHidden(t){0===this.children.length&&(t=!0),super.setHidden(t)}},Ps=class extends Ii{constructor(t){super(t)}destructor(){}},Bs=new Intl.NumberFormat("en-US",{style:"percent"});function Fs(t,e=2){return"number"==typeof t?_s(t,e):"string"==typeof t?t:String(t??"")}function zs(t){return Bs.format(t)}var Gs=(new Map).set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function _s(t,e){let i=Gs.get(e);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:e,useGrouping:!1}),Gs.set(e,i)),i.format(t)}var js=class t extends Ii{constructor(){super((0,s.n)("input")),this._step=t.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(t){this._step=t,this.getElement().step=t.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(t){if(t!==this._keyboardStep?.step&&(void 0!==this._keyboardStep&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),void 0!==t)){const e=()=>this.getElement().step=t.attributeValue,i=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:t,onKeyDown:e,onKeyUp:i,onBlur:i},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return(0,s.D$)(this.elem,"aria-orientation")??"both"}set orientation(e){(0,s.Bq)(this.elem,"aria-orientation","both"!==e?e:void 0),t.registerDefaultPreventers(this,e)}destructor(){}clampValueRatio(t,e){const i=this.getValueRatio(),n=(0,s.qE)(t,i,e);return n!==i&&this.setValueRatio(n),n}setValueRatio(t,e){const{divider:i}=this.step,s=Math.round(1e4*t)/i,{ariaValueText:n=zs(s/i)}=e??{},a=this.getElement();a.value=`${s}`,a.ariaValueText=n}getValueRatio(){return parseFloat(this.getElement().value)/this.step.divider}static registerDefaultPreventers(e,i){"both"===i?e.removeListener("keydown",t.onKeyDown):e.addListener("keydown",t.onKeyDown)}static onKeyDown(t,e){let i=[];const{orientation:s}=e;"horizontal"===s?i=["ArrowUp","ArrowDown"]:"vertical"===s&&(i=["ArrowLeft","ArrowRight"]),i.includes(t.sourceEvent.code)&&t.sourceEvent.preventDefault()}};js.STEP_ONE={attributeValue:"1",divider:1},js.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var Ws=js,Vs=class extends Ns{constructor(){super(),(0,s.Bq)(this.elem,"role","switch"),this.setChecked(!1)}setChecked(t){(0,s.Bq)(this.elem,"aria-checked",t)}},Ks=class extends Rs{constructor(t="horizontal"){super(t,"toolbar")}destructor(){}};function Ys(t,e){return e.params?.type===t}function $s(t){const e={params:t,result:void 0};return e.result=function(t){if("button"===t)return new Ns;if("slider"===t)return new Ws;if("toolbar"===t)return new Ks;if("group"===t)return new Os;if("list"===t)return new Es;if("region"===t)return new Ps((0,s.n)("div"));if("text"===t)return new As;if("listswitch"===t)return new Vs;throw Error("AG Charts - error allocating meta")}(e.params.type),e}var Hs=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=$s(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),Ys("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=$s(t);if(Ys("button",e)){const{params:t,result:i}=e,s=i.getElement();if(this.initInteract(t,i),"string"==typeof t.textContent)s.textContent=t.textContent;else{const{textContent:e}=t;this.addLocalisation(()=>{s.textContent=this.localeManager.t(e.id,e.params)})}this.setParent(e.params,e.result)}if(Ys("slider",e)){const{params:t,result:i}=e,s=i.getElement();this.initInteract(t,i),s.type="range",s.role="presentation",s.style.margin="0px",this.addLocalisation(()=>{s.ariaLabel=this.localeManager.t(t.ariaLabel.id,t.ariaLabel.params)}),this.setParent(e.params,e.result)}if(Ys("text",e)){const{params:t,result:i}=e;this.initElement(t,i),this.setParent(e.params,e.result)}if(Ys("listswitch",e)){const{params:t,result:i}=e;this.initInteract(t,i),i.setTextContent(t.textContent),i.setChecked(t.ariaChecked),i.setAriaDescribedBy(t.ariaDescribedBy),this.setParent(e.params,e.result)}if(Ys("region",e)){const{params:t,result:i}=e,s=i.getElement();this.initInteract(t,i),s.role="region",this.setParent(e.params,e.result)}return e.result}initElement(t,e){const i=e.getElement();return(0,s.EM)(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);void 0!==i&&(n.tabIndex=i),void 0!==s&&(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)}}},Us={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}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},Xs=/\$\{(\w+)}(?:\[(\w+)])?/gi,Zs={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),percent0to2dp:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})},qs=class extends Qi{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=Us,getLocaleText:n}=this,a=i[t];return n?.({key:t,defaultValue:a,variables:e})??(({defaultValue:t,variables:e})=>t?.replaceAll(Xs,(t,i,n)=>{const a=e[i],o=null!=n?Zs[n]:null;return null!=n&&null==o&&s.Vy.warnOnce(`Format style [${n}] is not supported`),null!=o?o.format(a):"number"==typeof a?Zs.number.format(a):a instanceof Date?Zs.datetime.format(a):String(a)}))({key:t,defaultValue:a,variables:e})??t}},Qs=class{constructor(t){this.enabled=!0,this.width=600,this.height=300;const{width:e,height:i,canvasElement:n,willReadFrequently:a=!1}=t;this.pixelRatio=t.pixelRatio??(0,s.zk)("devicePixelRatio")??1,this.element=n??(0,s.n)("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:a}),this.onEnabledChange(),this.resize(e??0,i??0,this.pixelRatio),v(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(){b(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.resetTransform()}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};r([hi(t=>t.onEnabledChange())],Qs.prototype,"enabled",2);var Js=class extends s.bk{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(t,e){const i=this.cache.get(t);if(i?.image)return i.image;if(null!=i&&e)return void i.nodes.add(e);if(!e)return;const s={image:void 0,nodes:new Set([e])},n=new Image;return this.imageLoadingCount++,n.onload=()=>{s.image=n,s.nodes.forEach(t=>t.markDirty()),s.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:t})},n.onerror=()=>{this.imageLoadingCount--,s.nodes.clear(),this.emit("image-error",{uri:t})},n.src=t,this.cache.set(t,s),s.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){this.cache.forEach(t=>{t.nodes.clear()}),this.cache.clear()}},tn=class{constructor(t){this.canvas=t,this.debug=x.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,a=new M({width:e,height:i,pixelRatio:s});return this.layersMap.set(a,{id:this.nextLayerId++,name:n,canvas:a}),this.debug("Scene.addLayer() - layers",this.layersMap),a}removeLayer(t){this.layersMap.has(t)&&(this.layersMap.delete(t),t.destroy(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}clear(){for(const t of this.layersMap.values())t.canvas.destroy();this.layersMap.clear()}};function en(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 sn(t,e,i,n,a={},o=y.zero){if(!x.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:r=0,layersSkipped:l=0,nodesRendered:h=0,nodesSkipped:c=0,opsPerformed:d=0,opsSkipped:u=0}=n??{},p=performance.now(),{start:g,...m}=e,f=Object.entries(m).map(([t,e])=>cn(t,e)).filter(t=>null!=t).join(" + "),b=Object.entries(a).map(([t,e])=>`${t}: ${JSON.stringify(e)}`).join(" ; "),v=x.check("scene:stats:verbose"),S=function(){if(!("memory"in performance))return;const{totalJSHeapSize:t,usedJSHeapSize:e,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[e,t,i])"number"==typeof n&&s.push(en(n));return`Heap ${s.join(" / ")}`}(),M=[`${cn("⏱️",g,p)} (${f})`,`${b}`,`Layers: ${v?hn(r,l):t.size}`,v?`Nodes: ${hn(h,c)}`:null,v?`Ops: ${hn(d,u)}`:null,v&&S?S:null].filter(s.Kg),k=new Ni(t=>i.measureText(t)),D=new Map(M.map(t=>[t,k.measureLines(t)])),w=Math.max(...Array.from(D.values(),t=>t.width)),I=function(t,e){let i=0;for(const s of t)i+=e(s);return i}(D.values(),t=>t.height),C=2+o.x;i.save(),i.fillStyle="white",i.fillRect(C,0,w,I),i.fillStyle="black";let L=0;for(const[t,e]of D.entries())L+=e.height,i.fillText(t,C,L);i.restore()}var nn=new Set,an=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function on(t){const{...e}=t;for(const t of Object.keys(e))an.has(t)||"number"!=typeof e[t]&&"string"!=typeof e[t]&&"boolean"!=typeof e[t]&&(nn.add(t),delete e[t]);return e}function rn(t,e){if(!x.check(!0,"scene"))return{};let i=0;return{node:"json"===e?on(t):t,name:t.name??t.id,dirty:t.dirty,...Array.from(t.children(),t=>rn(t,e)).reduce((t,e)=>{let{name:s}=e;const{node:{visible:n,opacity:a,zIndex:o,translationX:r,translationY:l,rotation:h,scalingX:c,scalingY:d},node:u}=e;(!n||a<=0)&&(s=`(${s})`),Ie.is(u)&&u.renderToOffscreenCanvas&&(s=`*${s}*`);const p=Array.isArray(o)?`(${o.join(", ")})`:o,g=[`${(i++).toString().padStart(3,"0")}|`,`${s??"<unknown>"}`,`z: ${p}`,r&&`x: ${r}`,l&&`y: ${l}`,h&&`r: ${h}`,null!=c&&1!==c&&`sx: ${c}`,null!=d&&1!==d&&`sy: ${d}`].filter(t=>!!t).join(" ");let m=g,y=1;for(;null!=t[m]&&y<100;)m=`${g} (${y++})`;return t[m]=e,t},{})}}function ln(t){if(!t.dirty)return{dirtyTree:{},paths:[]};const e=Array.from(t.children(),t=>ln(t)).filter(t=>t.paths.length>0),i=Ie.is(t)?t.name??t.id:t.id,s=e.length?e.flatMap(t=>t.paths).map(t=>`${i}.${t}`):[i];return{dirtyTree:{name:i,node:t,dirty:t.dirty,...e.map(t=>t.dirtyTree).filter(t=>null!=t.dirty).reduce((t,e)=>(t[e.name??"<unknown>"]=e,t),{})},paths:s}}function hn(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function cn(t,e,i){const s=null!=i?i-e:e;return`${t}: ${Math.round(100*s)/100}ms`}var dn=class extends s.bk{constructor(t){super(),this.debug=x.create(!0,"scene"),this.id=(0,s.sX)(this),this.imageLoader=new Js,this.root=null,this.pendingSize=null,this.isDirty=!1,this.destroyFns=[],this.updateDebugFlags(),this.canvas=new Qs(t),this.layersManager=new tn(this.canvas),this.destroyFns.push(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:t})=>{s.Vy.warnOnce(`Unable to load image ${t}`)}))}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(t){const{element:e}=this.canvas;return e.parentElement?.removeChild(e),t.appendChild(e),this}setRoot(t){return this.root===t||(this.isDirty=!0,this.root?.setScene(),this.root=t,t&&(t.visible=!0,t.setScene(this))),this}updateDebugFlags(){x.inDevelopmentMode(()=>J._debugEnabled=!0)}clearCanvas(){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){(0,s.Is)(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)}render(t){const{debugSplitTimes:e={start:performance.now()},extraDebugStats:i,seriesRect:n}=t??{},{canvas:a,canvas:{context:o}={},root:r,pendingSize:l,width:h,height:c,pixelRatio:d}=this;if(!o)return;const u=performance.now();let p=!1;if(l&&(p=!0,this.layersManager.resize(...l),this.pendingSize=null),r&&!r.visible)return void(this.isDirty=!1);if(!1===r?.dirty&&!this.isDirty)return this.debug.check()&&this.debug("Scene.render() - no-op",{tree:rn(r,"console")}),void sn(this.layersManager,e,o,void 0,i,n);const g={ctx:o,width:h,height:c,devicePixelRatio:d,debugNodes:{}};x.check("scene:stats:verbose")&&(g.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),function(t){const e=(0,s.$r)((0,s.zk)("agChartsSceneDebug")),i=[];for(const t of e)"layout"===t?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(t);t.debugNodeSearch=i}(g);let m=!1;if((!1!==r?.dirty||p)&&(m=!0,a.clear()),r&&x.check("scene:dirtyTree")){const{dirtyTree:t,paths:e}=ln(r);x.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:t,paths:e})}if(r&&m){if(r.visible&&r.preRender(g),this.debug.check()){const t=rn(r,"console");this.debug("Scene.render() - before",{canvasCleared:m,tree:t})}if(r.visible)try{o.save(),r.render(g),o.restore()}catch(t){throw this.canvas.reset(),t}}e["✍️"]=performance.now()-u,o.verifyDepthZero?.(),this.isDirty=!1,sn(this.layersManager,e,o,g.stats,i,n),function(t,e){t.save();for(const[i,n]of Object.entries(e)){const e=Me.toCanvas(n);e?(t.globalAlpha=.8,t.strokeStyle="red",t.lineWidth=1,t.strokeRect(e.x,e.y,e.width,e.height),t.fillStyle="red",t.strokeStyle="white",t.font="16px sans-serif",t.textBaseline="top",t.textAlign="left",t.lineWidth=2,t.strokeText(i,e.x,e.y,e.width),t.fillText(i,e.x,e.y,e.width)):s.Vy.log(`Scene.render() - no bbox for debugged node [${i}].`)}t.restore()}(o,g.debugNodes),r&&this.debug.check()&&this.debug("Scene.render() - after",{tree:rn(r,"console"),canvasCleared:m})}toSVG(){const{root:t,width:e,height:i}=this;if(null!=t)return J.toSVG(t,e,i)}strip(){const{context:t,pixelRatio:e}=this.canvas;t.setTransform(e,0,0,e,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.destroyFns.forEach(t=>t()),Object.assign(this,{canvas:void 0})}};function un(t,e){return!(!function(t){return"context"in t}(t)||null==e[0]||"object"!=typeof e[0]||(e[0].context=t.context,0))}function pn(t,e,i,s){return un(t,s)||e&&un(e,s),i(...s)}dn.className="Scene";var gn=class{constructor(){this.cache=new WeakMap}call(t,e,i,...s){let n,a=this.cache.get(i);try{n=JSON.stringify(s)}catch{return this.invoke(t,e,i,s,a)}return null==a&&(a=new Map,this.cache.set(i,a)),a.has(n)?a.get(n):this.invoke(t,e,i,s,a,n)}invoke(t,e,i,n,a,o){try{const s=pn(t,e,i,n);return a&&null!=o&&a.set(o,s),s}catch(t){return void s.Vy.warnOnce("User callback errored, ignoring",t)}}invalidateCache(){this.cache=new WeakMap}},mn=class extends Ji{constructor(t,e){super(),this.annotationRoot=t,this.fireChartEvent=e,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(t){return null==t||(0,s.cy)(t)}restoreMemento(t,e,i){this.annotations=this.cleanData(i??[]).map(t=>E(t,this.getAnnotationTypeStyles(t.type))),this.listeners.dispatch("restore-annotations",{type:"restore-annotations",annotations:this.annotations})}updateData(t){this.annotations=this.cleanData(t??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:Ge([...this.annotations])})}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}},yn=(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))(yn||{}),fn=class{constructor(t){this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new Ie({name:"Axes-Grids",zIndex:1}),this.axisGroup=new Ie({name:"Axes",zIndex:2}),this.axisLabelGroup=new Ie({name:"Axes-Labels",zIndex:13}),this.axisCrosslineRangeGroup=new Ie({name:"Axes-Crosslines-Range",zIndex:4}),this.axisCrosslineLineGroup=new Ie({name:"Axes-Crosslines-Line",zIndex:8}),this.axisCrosslineLabelGroup=new Ie({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 t of e){const e=t.createAxisContext();this.axes.has(e.direction)?this.axes.get(e.direction)?.push(e):this.axes.set(e.direction,[e])}}getAxisContext(t){return this.axes.get(t)??[]}destroy(){this.axes.clear(),this.sceneRoot.removeChild(this.axisGroup),this.sceneRoot.removeChild(this.axisGridGroup)}},xn=(t=>(t[t.FULL=0]="FULL",t[t.UPDATE_DATA=1]="UPDATE_DATA",t[t.PROCESS_DATA=2]="PROCESS_DATA",t[t.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",t[t.PERFORM_LAYOUT=4]="PERFORM_LAYOUT",t[t.SERIES_UPDATE=5]="SERIES_UPDATE",t[t.PRE_SCENE_RENDER=6]="PRE_SCENE_RENDER",t[t.SCENE_RENDER=7]="SCENE_RENDER",t[t.NONE=8]="NONE",t))(xn||{}),bn=class extends Qi{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=x.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(t){"function"==typeof t&&(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 null!=this.dataSourceCallback}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(t){return(0,s.nF)(t=>this.fetch(t).catch(t=>s.Vy.error("callback failed",t)),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return(0,s.nF)((t,e)=>{this.debug(`DataService - dispatching 'data-load' | ${t}`),this.dispatch("data-load",{type:"data-load",data:e})},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++;let n;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);try{n=await this.dataSourceCallback(t),this.debug(`DataService - response | ${performance.now()-e}ms | ${i}`)}catch(t){this.debug(`DataService - request failed | ${i}`),s.Vy.errorOnce(`DataService - request failed | [${t}]`)}this.isLoadingInitialData=!1;const a=this.freshRequests.findIndex(t=>t===i);-1===a||this.dispatchOnlyLatest&&a!==this.freshRequests.length-1?this.debug(`DataService - discarding stale request | ${i}`):(this.freshRequests=this.freshRequests.slice(a+1),0===this.freshRequests.length&&(this.isLoadingData=!1),Array.isArray(n)?this.throttledDispatch(i,n):this.dispatch("data-error"))}};r([li({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],bn.prototype,"dispatchThrottle",2),r([li({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],bn.prototype,"requestThrottle",2);var vn=class{constructor(t,e){this.domManager=t,this.updateService=e,this.observers=[]}updateFonts(t){t&&0!==t.size&&(this.loadFonts(t),t.forEach(t=>{this.observeFontStatus(t)}))}destroy(){for(const t of this.observers)t.disconnect();this.observers=[]}loadFonts(t){const e=Array.from(t).map(t=>encodeURIComponent(t)),i=":wght@100;200;300;400;500;600;700;800;900",s=`${i}&family=`,n=`@import url('https://fonts.googleapis.com/css2?family=${e.join(s)}${i}&display=swap');\n`;this.domManager.addStyles(`google-font-${e.join("-")}`,n)}observeFontStatus(t){const e=window.document.createElement("div");e.style.setProperty("position","absolute"),e.style.setProperty("top","0"),e.style.setProperty("margin","0"),e.style.setProperty("padding","0"),e.style.setProperty("overflow","hidden"),e.style.setProperty("visibility","hidden"),e.style.setProperty("width","auto"),e.style.setProperty("max-width","none"),e.style.setProperty("font-synthesis","none"),e.style.setProperty("font-family",t),e.style.setProperty("font-size","16px"),e.style.setProperty("white-space","nowrap"),e.textContent="UVWxyz",this.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(t)}`,e);const i=new ResizeObserver(t=>{const e=t?.at(0)?.contentBoxSize.at(0)?.inlineSize;null!=e&&e>0&&(Li.clear(),this.updateService.update(4))});i.observe(e),this.observers.push(i)}};function Sn(t,e){if("string"==typeof t)try{t=yt.fromString(t)}catch{t=yt.fromArray([0,0,0])}if("string"==typeof e)try{e=yt.fromString(e)}catch{e=yt.fromArray([0,0,0])}return i=>yt.mix(t,e,i).toRgbaString()}var Mn={};o(Mn,{easeIn:()=>Dn,easeInOut:()=>In,easeInOutQuad:()=>An,easeInQuad:()=>Cn,easeOut:()=>wn,easeOutQuad:()=>Ln,inverseEaseOut:()=>Tn,linear:()=>kn});var kn=t=>t,Dn=t=>1-Math.cos(t*Math.PI/2),wn=t=>Math.sin(t*Math.PI/2),In=t=>-(Math.cos(t*Math.PI)-1)/2,Cn=t=>t*t,Ln=t=>1-(1-t)**2,An=t=>t<.5?2*t*t:1-(-2*t+2)**2/2,Tn=t=>2*Math.asin(t)/Math.PI,Nn=["initial","remove","update","add","trailing","end","none"],On={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:.2,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1.2,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},Rn=(t=>(t.Loop="loop",t.Reverse="reverse",t))(Rn||{});function En(t){return t.every(t=>t instanceof J)?{nodes:t,selections:[]}:{nodes:[],selections:t}}function Pn(t,e){return t===e||(Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((t,i)=>Pn(t,e[i])):u(t)&&u(e)?t.equals(e):!(!(0,s.Qd)(t)||!(0,s.Qd)(e))&&R(t,e,Pn))}var Bn=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??kn,this.phase=t.phase;const e=t.duration??On[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,!0===t.skip&&(this.onUpdate?.(t.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),!1!==t.collapsable&&(this.duration=this.checkCollapse(t,this.duration))}checkCollapse(t,e){return Pn(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((0,s.qE)(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(t,e){if("object"!=typeof e||u(e))return this.interpolateValue(t,e);const i=[];for(const s of Object.keys(e)){const n=this.interpolateValue(t[s],e[s]);null!=n&&i.push([s,n])}return t=>{const e={};for(const[s,n]of i)e[s]=n(t);return e}}interpolateValue(t,e){if(null!=t&&null!=e){if(u(t))return i=>t[d](e,i);try{switch(typeof t){case"number":return function(t,e){return i=>Number(t)*(1-i)+Number(e)*i}(t,e);case"string":return Sn(t,e);case"boolean":if(t===e)return()=>t;break;case"object":return()=>t;default:throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}catch{}throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}},Fn=class{constructor(t){this.maxAnimationTime=t,this.debug=x.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Nn.map(t=>[t,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(Nn[this.currentPhase])??[]}checkOverlappingId(t){null!=t&&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 Nn.indexOf(t.phase)<this.currentPhase?(this.debug("Skipping animation due to being for an earlier phase",t.id),void t.stop()):(this.controllers.set(t.id,t),void this.phases.get(t.phase)?.push(t))}removeAnimation(t){this.controllers.delete(t.id);const e=this.phases.get(t.phase),i=e?.indexOf(t);null!=i&&i>=0&&e?.splice(i,1)}progress(t){if(!this.isReady)return;let e=0===t?.01:t;const i=()=>{const t=Nn[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:t,phaseMeta:On[t]}};let{phase:s,phaseControllers:n,phaseMeta:a}=i();const o=()=>null==Nn[this.currentPhase],r=()=>{for(({phase:s,phaseControllers:n,phaseMeta:a}=i());!o()&&0===n.length;)this.currentPhase++,({phase:s,phaseControllers:n,phaseMeta:a}=i()),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:e},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${t}ms; phase ${s} with ${n?.length} of ${l}`);do{const t=e,i=a.skipIfNoEarlierAnimations&&0===this.animationTimeConsumed;let s=0;for(const a of n)i?a.stop():e=Math.min(a.update(t),e),a.isComplete&&(s++,this.removeAnimation(a));this.animationTimeConsumed+=t-e,this.debug(`AnimationBatch - updated ${n.length} controllers; ${s} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),r()}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&&!0!==On[e.phase].skipIfNoEarlierAnimations){t=!1;break}if(!t)for(const[,t]of this.controllers)t.autoplay&&t.play(!0)}skip(t=!0){if(!1===this.skipAnimations&&!0===t){for(const t of this.controllers.values())t.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(t){s.Vy.error("Error during animation stop",t)}this.dispatchStopped()}stopByAnimationId(t){if(null!=t&&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}getRemainingTime(t){if(!this.isActive())return 0;let e=0;for(const[i,s]of this.phases)0!==s.length&&(null!=t&&t!==i||(e+=Math.max(...s.map(t=>t.isComplete?0:t.delay+t.duration-(t.elapsed??0)))));return e}destroy(){this.stop(),this.controllers.clear()}},zn=(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))(zn||{}),Gn=class{constructor(){this.stateQueue=34}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}isState(t){return!!(this.stateQueue&-this.stateQueue&t)}};function _n(t){return null==t||!isNaN(t)&&t>=0&&t<=2}var jn=class{constructor(t,e){this.interactionManager=t,this.chartUpdateMutex=e,this.defaultDuration=1e3,this.batch=new Fn(1.5*this.defaultDuration),this.debug=x.create(!0,"animation"),this.events=new s.bk,this.rafAvailable="undefined"!=typeof requestAnimationFrame,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(t){return void this.failsafeOnError(t)}let{id:i}=t;null==i&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()||"none"===t.phase;s&&this.debug("AnimationManager - skipping animation");const{delay:n,duration:a}=t;if(!_n(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!_n(a))throw new Error(`Animation duration of ${a} is unsupported (${i})`);const o=new Bn({...t,id:i,skip:s,autoplay:!!this.isPlaying&&t.autoplay,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(t){this.failsafeOnError(t)}}stopByAnimationGroupId(t){try{this.batch.stopByAnimationGroupId(t)}catch(t){this.failsafeOnError(t)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(t=!0){this.skipAnimations=t}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(t){return this.batch.getRemainingTime(t)}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:(new Error).stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(t){this.requestId=(0,s.zk)().requestAnimationFrame(e=>{t(e).catch(t=>s.Vy.error(t))})}forceTimeJump(t,e){return!1}requestAnimation(){if(!this.rafAvailable)return;if(!this.batch.isActive()||null!==this.requestId)return;let t;const e=async i=>{const s=()=>{const e=i-(t??i);t=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:e}),this.interactionManager.pushState(2);try{this.batch.progress(e)}catch(t){this.failsafeOnError(t)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:e})};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(){null!==this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(t,e=!0){s.Vy.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 Fn(1.5*this.defaultDuration),!0===t&&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()}},Wn=class extends Ji{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 a={type:"legend-item-click",legendType:t,series:e,itemId:i,enabled:s,legendItemName:n};this.listeners.dispatch("legend-item-click",a)}legendItemDoubleClick(t,e,i,s,n,a){const o={type:"legend-item-double-click",legendType:t,series:e,itemId:i,enabled:s,legendItemName:a,numVisibleItems:n};this.listeners.dispatch("legend-item-double-click",o)}},Vn=class{constructor(){this.download={type:"action",showOn:"always",label:"contextMenuDownload",enabled:!0,action:void 0,items:void 0},this["zoom-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuZoomToCursor",enabled:!0,action:void 0,items:void 0},this["pan-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuPanToCursor",enabled:!0,action:void 0,items:void 0},this["toggle-series-visibility"]={type:"action",showOn:"legend-item",label:"contextMenuToggleSeriesVisibility",enabled:!0,action:void 0,items:void 0},this["toggle-other-series"]={type:"action",showOn:"legend-item",label:"contextMenuToggleOtherSeries",enabled:!0,action:void 0,items:void 0},this.separator={type:"separator",showOn:"always",label:"separator",enabled:!0,action:void 0,items:void 0}}},Kn=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","toggle-series-visibility","toggle-other-series"]}},Yn=class{constructor(){this.items=new Vn,this.lists=new Kn}},$n=class extends Ji{constructor(){super(),this.builtins=new Yn,this.hiddenActions=new Set,this.setVisible("zoom-to-cursor",!1),this.setVisible("pan-to-cursor",!1)}static check(t,e){return e.showOn==t}static checkCallback(t,e,i){return t===e}dispatchContext(t,e,i,s){const{widgetEvent:n}=e;if(n.sourceEvent.defaultPrevented)return;const a={type:"context-setup",showOn:t,x:s?.x??e.canvasX,y:s?.y??e.canvasY,context:i,widgetEvent:n};this.listeners.dispatch("context-setup",a),a.type="context-complete",this.listeners.dispatch("context-complete",a)}isVisible(t){return!this.hiddenActions.has(t)}setVisible(t,e){e?this.hiddenActions.delete(t):this.hiddenActions.add(t)}},Hn=class extends Ji{constructor(){super(...arguments),this.highlightStates=new Ss}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||null!=t&&null!=e&&t?.series===e?.series&&t?.itemId===e?.itemId&&t?.datum===e?.datum}};function Un(t,e){if(null==t||0===e.length)return[!1,!1];const i=t.valueOf(),s=e[0],n=e[e.length-1];if("string"==typeof s)return[i===s,i===n];let a=s.valueOf(),o=n.valueOf();return a>o&&([a,o]=[o,a]),[i===a,i===o]}function Xn(t,e,i,s,n){const{xValue:a,yValue:o}=t,[r,l]=Un(o,n),[h,c]=Un(a,s);return{xKey:e,yKey:i,xValue:a,yValue:o,first:h,last:c,min:r,max:l}}function Zn(t,[e,i],n){const a=(0,s.S3)(0,t-1,t=>{const i=n(t)?.[1]??NaN;return!Number.isFinite(i)||i>e})??0;let o=(0,s.I5)(0,t-1,t=>{const e=n(t)?.[0]??NaN;return!Number.isFinite(e)||e<i})??t-1;return o=Math.min(o+1,t),[a,o]}function qn(t,e,i){if(i){const{x:t,y:e,width:s,height:n}=i;return{canvasX:t+s/2,canvasY:e+n/2}}const s=e.yBar?.upperPoint??e.midPoint??t.datumMidPoint?.(e);if(s){const{x:e,y:i}=Me.toCanvasPoint(t.contentGroup,s.x,s.y);return{canvasX:Math.round(e),canvasY:Math.round(i)}}}function Qn(t,e,i,s,n){let a=-1,o=0,r=0,l=!1;for(;o<s&&a<=e-t;){a+=1;const s=i+r;l||(r*=-1),r>=0&&(r+=1),l&&r<0&&(r-=1),s<t||s>e?l=!0:n(s)&&(o+=1)}return o}var Jn=class{constructor(t,e,i){this.domManager=e,this.tooltip=i,this.stateTracker=new Ss,this.suppressState=new Ss(!1),this.appliedState=null,this.destroyFns=[],this.destroyFns.push(i.setup(t,e),e.addListener("hidden",()=>this.tooltip.hide()))}destroy(){this.destroyFns.forEach(t=>t())}updateTooltip(t,e,i,s){i??(i=this.stateTracker.get(t)?.content),this.stateTracker.set(t,{meta:e,content:i,pagination:s}),this.applyStates()}removeTooltip(t){this.stateTracker.delete(t),this.applyStates()}suppressTooltip(t){this.suppressState.set(t,!0)}unsuppressTooltip(t){this.suppressState.delete(t)}applyStates(){const t=this.stateTracker.stateId(),e=t?this.stateTracker.get(t):void 0;if(this.suppressState.stateValue()||null==e?.meta||null==e?.content)return this.appliedState=null,void this.tooltip.hide();const i=this.domManager.getBoundingClientRect(),s="extended"===this.tooltip.bounds?this.domManager.getOverlayClientRect():i;if(this.appliedState?.content===e?.content){const t=this.tooltip.isVisible();this.tooltip.show(s,i,e?.meta,null,void 0,t)}else this.tooltip.show(s,i,e?.meta,e?.content,e?.pagination);this.appliedState=e}static makeTooltipMeta(t,e,i,s){const{canvasX:n,canvasY:a}=t,o=e.properties.tooltip,{placement:r,defaultPlacement:l,anchorTo:h,defaultAnchorTo:c,xOffset:d,yOffset:u}=o.position,p=qn(e,i,s);return{canvasX:n,canvasY:a,nodeCanvasX:p?.canvasX??n,nodeCanvasY:p?.canvasY??a,enableInteraction:o.interaction?.enabled??!1,showArrow:o.showArrow,position:{placement:r,defaultPlacement:l,anchorTo:h,defaultAnchorTo:c,xOffset:d,yOffset:u}}}isEnteringInteractiveTooltip(t){const{tooltip:e}=this,i=t.relatedTarget;return e.interactive&&e.enabled&&e.isVisible()&&e.contains(i)}};function ta(t,e,i){const{offsetX:s,offsetY:n,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:h}=i;return{type:e,device:t,offsetX:s,offsetY:n,clientX:a,clientY:o,currentX:r,currentY:l,sourceEvent:h}}function ea(t,e){return t*t+e*e>=9}var ia=class{constructor(t){this.destroyFns=[],this.listeners=new Qi,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[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=e,this.touch.clientY=i}onTouchMove(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-e),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=e,this.touch.clientY=i}onTouchEnd(t){t.sourceEvent.preventDefault()}onMouseMove(t){this.dispatch(t)}onDblClick(t){this.dispatch({device:"mouse",...t})}onDragStart(t){this.dragStartEvent=t}onDragMove(t){null!=this.dragStartEvent&&ea(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)return this.dispatch(t),void(this.isDragging=!1);if("mouse"===t.device){const e=ta("mouse","click",t);this.dispatch(e)}else if("touchend"===t.sourceEvent.type){if(ea(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const e=ta("touch","click",t);this.dispatch(e);const i=Date.now();if(void 0!==this.lastClick&&i-this.lastClick.time<=505&&function(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY;return i*i+s*s<900}(this.lastClick,t)){const e=ta(t.device,"dblclick",t);this.dispatch(e),this.lastClick=void 0}else this.lastClick={time:i,clientX:t.clientX,clientY:t.clientY}}}},sa=class extends Ps{constructor(t){super(t)}addChildToDOM(){}removeChildFromDOM(){}},na=class{constructor(t){this.seriesWidget=new sa(t.getParent("series-area")),this.chartWidget=new sa(t.getParent("canvas-proxy")),this.containerWidget=new sa(t.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),this.seriesDragInterpreter=new ia(this.seriesWidget)}destroy(){this.seriesDragInterpreter.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}};function aa(t,e){const[i,n]=oa(e);return(0,s.qE)(i,t,n)}function oa(t){if(0===t.length)return[];const e=[1/0,-1/0];for(const i of t)i<e[0]&&(e[0]=i),i>e[1]&&(e[1]=i);return e}function ra(t){const[e,i]=oa(t);return i-e}var la=class t extends ft{constructor(t=[],e=[]){super(),this.domain=t,this.range=e,this.defaultClamp=!1}static is(e){return e instanceof t}normalizeDomains(...t){return ca(...t)}transform(t){return t}transformInvert(t){return t}calcBandwidth(t=1,e=1){const{domain:i}=this,s=this.getPixelRange();if(0===i.length)return s;let n=Math.abs(i[1].valueOf()-i[0].valueOf())/t+1;if(0!==e){const t=Math.floor(s);n=Math.min(n,t)}return s/Math.max(1,n)}convert(t,e){const{domain:i}=this;if(!i||i.length<2)return NaN;const s=e?.clamp??this.defaultClamp,n=Number(this.transform(i[0])),a=Number(this.transform(i[1])),o=Number(this.transform(t)),{range:r}=this,[l,h]=r;if(s){const[t,e]=oa([n,a]);if(o<t)return l;if(o>e)return h}return n===a?(l+h)/2:o===n?l:o===a?h:l+(o-n)/(a-n)*(h-l)}invert(t,e){const i=this.domain.map(t=>this.transform(t)),[s,n]=i,{range:a}=this,[o,r]=a;let l;return l=o===r?this.toDomain((Number(s)+Number(n))/2):this.toDomain(Number(s)+(t-o)/(r-o)*(Number(n)-Number(s))),this.transformInvert(l)}getPixelRange(){const[t,e]=this.range;return Math.abs(e-t)}};la.defaultTickCount=5;var ha=la;function ca(...t){let e,i,s=1/0,n=-1/0;for(const a of t)for(const t of a){const a=t.valueOf();a<s&&(s=a,e=t),a>n&&(n=a,i=t)}return null!=e&&null!=i?{domain:[e,i],animatable:!0}:{domain:[],animatable:!1}}var da={};o(da,{TimeInterval:()=>ba,day:()=>Ma,friday:()=>Ba,hour:()=>Aa,millisecond:()=>ka,minute:()=>Ca,monday:()=>Oa,month:()=>Sa,saturday:()=>Fa,second:()=>wa,sunday:()=>Na,thursday:()=>Pa,tuesday:()=>Ra,utcDay:()=>_a,utcHour:()=>Wa,utcMinute:()=>ja,utcMonth:()=>Ga,utcYear:()=>za,wednesday:()=>Ea,year:()=>va});var ua=1e3,pa=6e4,ga=36e5,ma=864e5,ya=6048e5,fa=2592e6,xa=31536e6,ba=class t{constructor(t,e,i,s,n,a=1,o){this.unit=t,this.milliseconds=e,this.hierarchy=i,this._encode=s,this._decode=n,this.step=a,this._rangeCallback=o}static extent(t,e,i){if(t.getTime()>e.getTime()&&([t,e]=[e,t],null!=i&&(i=[1-i[1],1-i[0]])),null!=i){const s=e.getTime()-t.getTime(),n=t.getTime();t=new Date(n+i[0]*s),e=new Date(n+i[1]*s)}return[t,e]}getOffset(t,e){return Math.floor(this._encode(new Date(t)))%e}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)}rangeIndices(e,i,{extend:s=!1,visibleRange:n=[0,1],limit:a}){[e,i]=t.extent(e,i,n);const o=this._encode(s?this.floor(e):this.ceil(e));let r=this._encode(s?this.ceil(i):this.floor(i));return null!=a&&r-o>a&&(r=o+a),[o,r]}range(t,e,i={}){let s;s=t.getTime()>e.getTime()?this._rangeCallback?.(e,t):this._rangeCallback?.(t,e);const[n,a]=this.rangeIndices(t,e,i),o=[];for(let t=n;t<=a;t++){const e=this._decode(t);o.push(e)}return s?.(),o}previous(t){return this._decode(this._encode(this.ceil(t))-1)}next(t){return this._decode(this._encode(this.floor(t))+1)}rangeCount(t,e,i={}){const[s,n]=this.rangeIndices(t,e,i);return n-s}every(e,i){if(1===e&&null!=i?.snapTo)return this;const{unit:n,milliseconds:a,hierarchy:o,step:r}=this;let l,h=0;const c=e;c!==(e=Math.max(1,Math.round(e)))&&s.Vy.warnOnce(`interval step of [${c}] rounded to [${e}].`);const{snapTo:d="start"}=i??{};if("string"==typeof d){const t=h;l=(i,s)=>{const n="start"===d?i:s;return h=this.getOffset(n,e),()=>h=t}}else"number"==typeof d?h=this.getOffset(new Date(d),e):d instanceof Date&&(h=this.getOffset(d,e));return new t(n,a*e,o,t=>Math.floor((this._encode(t)-h)/e),t=>this._decode(t*e+h),r*e,l)}},va=new ba("year",525949.2*60*1e3,void 0,function(t){return t.getFullYear()},function(t){const e=new Date;return e.setFullYear(t),e.setMonth(0,1),e.setHours(0,0,0,0),e}),Sa=new ba("month",va.milliseconds/12,va,function(t){return 12*t.getFullYear()+t.getMonth()},function(t){const e=Math.floor(t/12);return new Date(e,t-12*e,1)}),Ma=new ba("day",864e5,Sa,function(t){const e=t.getTimezoneOffset()*pa;return Math.floor((t.getTime()-e)/ma)},function(t){const e=new Date(1970,0,1);return e.setDate(e.getDate()+t),e}),ka=new ba("millisecond",1,Ma,function(t){return t.getTime()},function(t){return new Date(t)}),Da=(new Date).getTimezoneOffset()*pa,wa=new ba("second",1e3,Ma,function(t){return Math.floor((t.getTime()-Da)/ua)},function(t){return new Date(Da+t*ua)}),Ia=(new Date).getTimezoneOffset()*pa,Ca=new ba("minute",6e4,Ma,function(t){return Math.floor((t.getTime()-Ia)/pa)},function(t){return new Date(Ia+t*pa)}),La=(new Date).getTimezoneOffset()*pa,Aa=new ba("hour",36e5,Ma,function(t){return Math.floor((t.getTime()-La)/ga)},function(t){return new Date(La+t*ga)});function Ta(t){const e=(7+t-4)%7;return new ba("day",6048e5,Sa,function(t){const i=t.getTimezoneOffset()*pa;return Math.floor((t.getTime()-i)/ya-e/7)},function(t){const i=new Date(1970,0,1);return i.setDate(i.getDate()+7*t+e),i},7)}var Na=Ta(0),Oa=Ta(1),Ra=Ta(2),Ea=Ta(3),Pa=Ta(4),Ba=Ta(5),Fa=Ta(6),za=new ba("year",va.milliseconds,void 0,function(t){return t.getUTCFullYear()},function(t){const e=new Date;return e.setUTCFullYear(t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0),e}),Ga=new ba("month",Sa.milliseconds,za,function(t){return 12*t.getUTCFullYear()+t.getUTCMonth()},function(t){const e=Math.floor(t/12),i=t-12*e;return new Date(Date.UTC(e,i,1))}),_a=new ba("day",864e5,Ga,function(t){return Math.floor(t.getTime()/ma)},function(t){const e=new Date(0);return e.setUTCDate(e.getUTCDate()+t),e.setUTCHours(0,0,0,0),e}),ja=new ba("minute",6e4,_a,function(t){return Math.floor(t.getTime()/pa)},function(t){return new Date(t*pa)}),Wa=new ba("hour",36e5,_a,function(t){return Math.floor(t.getTime()/ga)},function(t){return new Date(t*ga)}),Va={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 Ka(t,e=new Date(t.getFullYear(),0,1)){const i=t.getTimezoneOffset()-e.getTimezoneOffset(),s=t.getTime()-e.getTime()+6e4*i;return Math.floor(s/864e5)}function Ya(t,e){const i=(e-new Date(t.getFullYear(),0,1).getDay()+7)%7,s=new Date(t.getFullYear(),0,i+1);return s<=t?Math.floor(Ka(t,s)/7)+1:0}function $a(t,e=t.getFullYear()){const i=new Date(e,0,1).getDay(),s=new Date(e,0,(4-i+7)%7-3+1);return s<=t?Math.floor(Ka(t,s)/7)+1:$a(t,e-1)}var Ha={a:t=>Va.shortDays[t.getDay()],A:t=>Va.days[t.getDay()],b:t=>Va.shortMonths[t.getMonth()],B:t=>Va.months[t.getMonth()],c:"%x, %X",d:(t,e)=>Xa(t.getDate(),2,e??"0"),e:"%_d",f:(t,e)=>Xa(1e3*t.getMilliseconds(),6,e??"0"),H:(t,e)=>Xa(t.getHours(),2,e??"0"),I:(t,e)=>{const i=t.getHours()%12;return 0===i?"12":Xa(i,2,e??"0")},j:(t,e)=>Xa(Ka(t)+1,3,e??"0"),m:(t,e)=>Xa(t.getMonth()+1,2,e??"0"),M:(t,e)=>Xa(t.getMinutes(),2,e??"0"),L:(t,e)=>Xa(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)=>Xa(t.getSeconds(),2,e??"0"),u:t=>{let e=t.getDay();return e<1&&(e+=7),String(e%7)},U:(t,e)=>Xa(Ya(t,0),2,e??"0"),V:(t,e)=>Xa($a(t),2,e??"0"),w:(t,e)=>Xa(t.getDay(),2,e??"0"),W:(t,e)=>Xa(Ya(t,1),2,e??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(t,e)=>Xa(t.getFullYear()%100,2,e??"0"),Y:(t,e)=>Xa(t.getFullYear(),4,e??"0"),Z:t=>function(t){const e=t.getTimezoneOffset(),i=Math.abs(e);return`${e>0?"-":"+"}${Xa(Math.floor(i/60),2,"0")}${Xa(Math.floor(i%60),2,"0")}`}(t),"%":()=>"%"},Ua={_:" ",0:"0","-":""};function Xa(t,e,i){const s=String(Math.floor(t));return s.length>=e?s:`${i.repeat(e-s.length)}${s}`}function Za(t){const e=[];for(;t.length>0;){let i=t.indexOf("%");if(0!==i){const s=i>0?t.substring(0,i):t;e.push(s)}if(i<0)break;const s=t[i+1],n=Ua[s];null!=n&&i++;const a=t[i+1],o=Ha[a];if("function"==typeof o)e.push([o,n]);else if("string"==typeof o){const t=Za(o);e.push([t,n])}else e.push(`${n??""}${a}`);t=t.substring(i+2)}return t=>{const i="number"==typeof t?new Date(t):t;return e.map(t=>"string"==typeof t?t:t[0](i,t[1])).join("")}}function qa(t){return t instanceof Date?t.getTime():t}function Qa(t,e,i){const s=Za(Ja(t,e,i));return t=>s(t)}function Ja(t,e,i=0){let s=1/0;for(let e=1;e<t.length;e++)s=Math.min(s,Math.abs(t[e].valueOf()-t[e-1].valueOf()));const[n,a]=0===e.length?[0,0]:oa([e[0].valueOf(),e[e.length-1].valueOf()]),o=new Date(n).getFullYear(),r=new Date(a).getFullYear()-o>0,l=isFinite(s)?function(t,e){return t<ua?0:t<pa?1:t<ga?2:t<ma?3:t<ya?4:t<24192e5||t<26784e5&&function(t){let e=new Date(t[0]).getMonth();for(let i=1;i<t.length;i++){const s=new Date(t[i]).getMonth();if(e===s)return!0;e=s}return!1}(e)?5:t<xa?6:7}(s,t):(h=t[0],wa.floor(h)<h?0:Ca.floor(h)<h?1:Aa.floor(h)<h?2:Ma.floor(h)<h?3:Sa.floor(h)<h?Na.floor(h)<h?4:5:va.floor(h)<h?6:7);var h;return function(t,e,i){const s=qa(i[0]),n=qa(i.at(-1)),a=Math.abs(n-s),o=[["hour",216e5,12096e5,3,"%I %p"],["hour",pa,216e5,3,"%I:%M"],["second",1e3,216e5,1,":%S"],["ms",0,216e5,0,".%L"],["am/pm",pa,216e5,3,"%p"]," ",["day",ma,ya,4,"%a"],["month",0===a?0:ya,314496e5,5,"%b %d"],["month",3024e6,31536e7,6,"%B"]," ",["year",e||7===t?0:xa,1/0,7,"%Y"]].filter(e=>{if("string"==typeof e)return!0;const[i,s,n,o]=e;return o>=t&&s<=a&&a<n}).reduce((t,e)=>("string"==typeof e?t.result.push(e):t.used.has(e[0])||(t.result.push(e),t.used.add(e[0])),t),{result:[],used:new Set}).result,r=o.findIndex(t=>"string"!=typeof t),l=o.findLastIndex(t=>"string"!=typeof t);return o.slice(r,l+1).map(t=>"string"==typeof t?t:t[4]).join("").replaceAll(/\s+/g," ").trim()}(Math.max(l-i,0),r,t)}var to=class t extends ft{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(e){return e instanceof t}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(t){t=(0,s.qE)(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this.invalid=!0,this._paddingInner=(0,s.qE)(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this.invalid=!0,this._paddingOuter=(0,s.qE)(0,t,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&s.Vy.warnOnce("Expected update to not invalidate scale"))}convert(t,e){this.refresh();const i=this.findIndex(t);return null==i||i<0||i>=this.bands.length?NaN:this.ordinalRange(i)}invertNearestIndex(t){this.refresh();const e=this.bands.length;if(0===e)return-1;let i=0,s=e-1,n=1/0,a=0;for(;i<=s;){const e=(s+i)/2|0,o=this.ordinalRange(e),r=Math.abs(o-t);if(0===r)return e;r<n&&(n=r,a=e),o<t?i=e+1:s=e-1}return a}update(){const[t,e]=this.range;let{_paddingInner:i}=this;const{_paddingOuter:s,round:n,bands:a}=this,o=a.length;if(0===o)return;const r=e-t;let l;1===o?(i=0,l=r*(1-2*s)):l=r/Math.max(1,o-i+2*s);const h=n?Math.floor(l):l;let c=t+(r-h*(o-i))/2,d=h*(1-i);n&&(c=Math.round(c),d=Math.round(d)),this._step=h,this._inset=c,this._bandwidth=d,this._rawBandwidth=l*(1-i)}ordinalRange(t){const{_inset:e,_step:i,range:n}=this,a=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return(0,s.qE)(a,e+i*t,o)}};r([xt],to.prototype,"range",2),r([xt],to.prototype,"round",2);var eo=to,io=class t extends eo{static is(e){return e instanceof t}toDomain(t){return new Date(t)}convert(t,e){const{domain:i,bands:n}=this;if(i.length<=0)return NaN;const a=this.ordinalRange(0),o=this.ordinalRange(n.length-1),r=e?.interpolate??!1,l=i[0].valueOf()>i[i.length-1].valueOf();if(!r){const i=super.convert(t,e);return l?o-(i-a):i}if(0===n.length)return a;const h=t.valueOf();let c;c=l?((0,s.S3)(0,i.length-1,t=>i[t].valueOf()<=h)??i.length)-1:(0,s.I5)(0,i.length-1,t=>i[t].valueOf()<=h)??0,c=Math.min(Math.max(c,0),i.length-2);const d=i[c].valueOf(),u=i[c+1].valueOf();return(c+(h-d)/(u-d))/(i.length-1)*(o-a)+a}invert(t,e=!1){this.refresh();const{domain:i,bands:n}=this,a=i[0].valueOf()>i[i.length-1].valueOf();let o;return o=e?this.invertNearestIndex(t-this.bandwidth/2):(0,s.S3)(0,n.length-1,e=>this.ordinalRange(e)>=t)??0,n[a?n.length-1-o:o]}tickFormatter({domain:t,ticks:e,specifier:i},s){return null!=i?Za(i):Qa(e,t,s)}},so={bottomCenter:function(t){return{x:(t.x1+t.x2)/2,y:Math.max(t.y1,t.y2)}},center:function(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}},clone:function(t){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}},collides:function(t,e){const i=no(t),s=no(e);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1},end:function(t){return{x:t.x2,y:t.y2}},from:function(t,e,i,s){if("number"==typeof t)return{x1:t,y1:e,x2:i,y2:s};if("width"in t)return no({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}]`)},height:function(t){return Math.abs(t.y2-t.y1)},round:function(t){return{x1:Math.round(t.x1),y1:Math.round(t.y1),x2:Math.round(t.x2),y2:Math.round(t.y2)}},start:function(t){return{x:t.x1,y:t.y1}},topCenter:function(t){return{x:(t.x1+t.x2)/2,y:Math.min(t.y1,t.y2)}},origin:function(){return{x1:0,y1:0,x2:0,y2:0}},width:function(t){return Math.abs(t.x2-t.x1)}};function no(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 ao(t,e,i,s,n){return e+(n-t)/(i-t)*(s-e)}function oo(t,e,i,s,n){return t+(i-t)/(s-e)*(n-e)}function ro(t,e,i){return[oo(t,i.min,e,i.max,0),oo(t,i.min,e,i.max,1)]}function lo(t,e,i,n,a,o){if(i<=a&&o<=n)return i;const r=a-i,l=o-n,h=Math.abs(r)<Math.abs(l)?r:l;return(0,s.qE)(t,i+h,e)}var ho=["rangeX","rangeY","ratioX","ratioY","autoScaledAxes"],co=class{constructor(){this.enabled=!1,this.padding=0,this.manuallyAdjusted=!1}},uo=t=>(0,s.W$)((e,{options:i})=>!ha.is(t?.scale)&&!io.is(t?.scale)||null==e||null==i.end||e<=i.end,"to be less than end"),po=class extends Ji{constructor(t,e){super(),this.fireChartEvent=t,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new Ss(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new co,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:t}=this,e=!this.didLayoutAxes;this.didLayoutAxes=!0,t?this.restoreMemento(t.version,t.mementoVersion,t.memento):e&&this.autoScaleYZoom("zoom-manager")}))}createMemento(){return this.getMementoRanges()}guardMemento(t,e){if(null==t)return!0;if(!(0,s.Gv)(t))return!1;for(const e of Object.keys(t))if(!ho.includes(e))return!1;const i=this.getPrimaryAxis("x"),n=this.getPrimaryAxis("y"),a={rangeX:{start:(0,s.Uo)((0,s.or)(s.ai,s.p6),uo(i)),end:(0,s.or)(s.ai,s.p6)},rangeY:{start:(0,s.Uo)((0,s.or)(s.ai,s.p6),uo(n)),end:(0,s.or)(s.ai,s.p6)},ratioX:{start:(0,s.Uo)(s.CG,(0,s.Xe)("end")),end:s.CG},ratioY:{start:(0,s.Uo)(s.CG,(0,s.Xe)("end")),end:s.CG},autoScaledAxes:(0,s.jk)((0,s.KC)("y"))},{invalid:o}=(0,s.tf)(t,a);return!(o.length>0&&(e.push(...o.map(String)),1))}restoreMemento(t,e,i){const{independentAxes:s}=this;if(!this.axes||!this.didLayoutAxes)return void(this.pendingMemento={version:t,mementoVersion:e,memento:i});this.pendingMemento=void 0;const n=this.getDefinedZoom();if(n.x=i?.rangeX?this.rangeToRatio(i.rangeX,"x")??{min:0,max:1}:i?.ratioX?{min:i.ratioX.start??0,max:i.ratioX.end??1}:{min:0,max:1},!this.navigatorModule||this.zoomModule){let t=i?.autoScaledAxes?.includes("y");i?.rangeY?(n.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1},t??(t=!1)):i?.ratioY?(n.y={min:i.ratioY.start??0,max:i.ratioY.end??1},t??(t=!1)):(n.y={min:0,max:1},t??(t=!0)),n.autoScaleYAxis=t}if(this.lastRestoredState=n,!0!==s)return void this.updateZoom("zoom-manager",n);const a=this.getPrimaryAxis("x"),o=this.getPrimaryAxis("y");for(const t of[a,o])t&&this.updateAxisZoom("zoom-manager",t.id,n[t.direction])}updateAxes(t){this.axes=t;const e=new Map(t.map(t=>[t.id,this.axisZoomManagers.get(t.id)]));this.axisZoomManagers.clear();for(const i of t)this.axisZoomManagers.set(i.id,e.get(i.id)??new go(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}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom(t,e){if(e?.x&&(e.x.min<0||e.x.max>1)&&(s.Vy.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)&&(s.Vy.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),0===this.axisZoomManagers.size){const i=this.state.stateId();return void("initial"!==i&&i!==t||this.state.set(t,e))}this.state.set(t,e);const i=e?.autoScaleYAxis;null!=i&&(this.autoScaleYAxis.manuallyAdjusted=!i),this.axisZoomManagers.forEach(i=>{i.updateZoom(t,e?.[i.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 i=this.axisZoomManagers.get(e),s=i?.getDirection();if(null==s)return;const n=this.getRestoredZoom();if("y"===s){const t=n?.autoScaleYAxis??!0;this.autoScaleYAxis.manuallyAdjusted=!t}for(const e of this.axes)e.direction===s&&this.updateAxisZoom(t,e.id,n?.[s]??{min:0,max:1})}setAxisManuallyAdjusted(t,e){const i=this.axisZoomManagers.get(e)?.getDirection();"y"===i&&(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()&&!this.isNavigatorEnabled())return!1;const n=this.getZoom();if(void 0===n||!n.x&&!n.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 s.Vy.warnOnce("cannot pan to target BBox - chart too small?"),!1;const a=function(t,e,i){const{x:n={min:0,max:1},y:a={min:0,max:1}}=e,o=so.from(i),r=so.from(t),l=function(t,e,i){const[s,n]=ro(t.x1,t.x2,e),[a,o]=ro(t.y1,t.y2,i);return{x1:s,x2:n,y1:a,y2:o}}(r,n,a),h=lo(l.x1,l.x2,r.x1,r.x2,o.x1,o.x2),c=lo(l.y1,l.y2,r.y1,r.y2,o.y1,o.y2),d={x:{min:ao(r.x1,n.min,r.x2,n.max,h),max:ao(r.x1,n.min,r.x2,n.max,h+t.width)},y:{min:ao(r.y1,a.min,r.y2,a.max,c),max:ao(r.y1,a.min,r.y2,a.max,c+t.height)}},u=d.x.max-d.x.min,p=d.y.max-d.y.min;return d.x.min=(0,s.qE)(0,d.x.min,1-u),d.x.max=d.x.min+u,d.y.min=(0,s.qE)(0,d.y.min,1-p),d.y.max=d.y.min+p,d}(e,n,i);return this.independentAxes?(this.updatePrimaryAxisZoom(t,"x",a.x),this.updatePrimaryAxisZoom(t,"y",a.y)):this.updateZoom(t,a),!0}fireZoomPanStartEvent(t){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:t})}extendToEnd(t,e,i){return this.extendWith(t,e,t=>Number(t)-i)}extendWith(t,e,i){const s=this.getPrimaryAxis(e);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;const[,a]=n,o=i(a),r=this.rangeToRatio({start:o,end:a},e);r&&this.updateZoom(t,{[e]:r})}updateWith(t,e,i){const s=this.getPrimaryAxis(e);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;let[a,o]=n;[a,o]=i(a,o);const r=this.rangeToRatio({start:a,end:o},e);r&&this.updateZoom(t,{[e]:r})}getZoom(){let t,e;if(this.axisZoomManagers.forEach(i=>{"x"===i.getDirection()?t??(t=i.getZoom()):"y"===i.getDirection()&&(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 a=0;const o=[t.x.min,t.x.max],r=[t.y.min,t.y.max];for(const t of i?.boundSeries??[]){n.add(t.id);const i=e-(a??0);if(a+=t.getVisibleItems(o,r,i),a>=e)return!0}for(const t of s?.boundSeries??[]){if(n.has(t.id))continue;const i=e-(a??0);if(a+=t.getVisibleItems(o,r,i),a>=e)return!0}return 0===n.size}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(null==n?.x||!s.enabled||s.manuallyAdjusted)return;const{padding:a}=s;let o;if(o=0===n.x?.min&&1===n.x?.max?{min:0,max:1}:i?this.primaryAxisZoom("y",n.x,{padding:a}):this.combinedAxisZoom("y",n.x,{padding:a}),null!=o){if(i){const t=this.getPrimaryAxis("y"),e=null==t?void 0:this.axisZoomManagers.get(t.id);e?.updateZoom("zoom-manager",o)}else for(const t of this.axisZoomManagers.values())"y"===t.getDirection()&&t.updateZoom("zoom-manager",o);e&&this.applyChanges(t)}}applyChanges(t){if(this.autoScaleYZoom(t,!1),!Array.from(this.axisZoomManagers.values(),t=>t.applyChanges()).includes(!0))return;const e={};for(const[t,i]of this.axisZoomManagers.entries())e[t]=i.getZoom();this.listeners.dispatch("zoom-change",{type:"zoom-change",...this.getZoom(),axes:e,callerId:t}),this.fireChartEvent({type:"zoom",...this.getMementoRanges()})}getRangeDirection(t,e){const i=this.getPrimaryAxis(e);if(!i||!ha.is(i.scale)&&!io.is(i.scale))return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,a]=s;let o,r;return n<=a?(o=i.scale.invert(0),r=i.scale.invert(n+(a-n)*t.max)):(o=i.scale.invert(n-(n-a)*t.min),r=i.scale.invert(0)),{start:o,end:r}}rangeToRatio(t,e){const i=this.getPrimaryAxis(e);if(!i)return;const n=this.getDomainPixelExtents(i);if(!n)return;const[a,o]=n;let r=null==t.start?a:i.scale.convert?.(t.start),l=null==t.end?o:i.scale.convert?.(t.end);if(!(0,s.Bf)(r)||!(0,s.Bf)(l))return;const[h,c]=[Math.min(a,o),Math.max(a,o)];if(r<h||r>c)return void s.Vy.warnOnce(`Invalid range start [${t.start}], expecting a value between [${i.scale.invert?.(a)}] and [${i.scale.invert?.(o)}], ignoring.`);if(l<h||l>c)return void s.Vy.warnOnce(`Invalid range end [${t.end}], expecting a value between [${i.scale.invert?.(a)}] and [${i.scale.invert?.(o)}], ignoring.`);r=Math.min(c,Math.max(h,r)),l=Math.min(c,Math.max(h,l));const d=o-a;return{min:Math.abs((r-a)/d),max:Math.abs((l-a)/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(null!=i&&null!=s)return[i,s]}getDomainPixelExtents(t){const{domain:e}=t.scale,i=t.scale.convert?.(e.at(0)),n=t.scale.convert?.(e.at(-1));if((0,s.Bf)(i)&&(0,s.Bf)(n))return[i,n]}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,n){const a=t.scale,o=a.range;a.range=[0,1];const r=e.scale,l=r.range;r.range=[0,1];let h=1,c=!1,d=0,u=!1;for(const t of e.boundSeries){const{connectsToYAxis:e}=t,s=t.getRange("y",[i.min,i.max]);for(const t of s){const i=r.convert(t);Number.isFinite(i)&&(i<h&&(h=i,c=!e||t<0),i>d&&(d=i,u=!e||t>0))}}if((0,s.Bf)(e.min)&&(h=0),(0,s.Bf)(e.max)&&(d=1),a.range=o,r.range=l,h>=d)return;const p=(c?n:0)+(u?n:0),g=Math.min((d-h)*(1+p),1);if(!(g<=0)){if(c&&u){const t=(d+h)/2;h=t-g/2,d=t+g/2}else!c&&u?d=h+g:c&&!u&&(h=d-g);return h<0?(d+=-h,h=0):d>1&&(h-=d-1,d=1),{min:h,max:d}}}primaryAxisZoom(t,e,{padding:i=0}={}){const s="x"===t?"y":"x",n=this.getPrimaryAxis(s),a=this.getPrimaryAxis(t);if(null!=n&&null!=a)return this.zoomBounds(n,a,e,i)}combinedAxisZoom(t,e,{padding:i=0}={}){const s="x"===t?"y":"x",n=new Map;for(const t of this.axes)if(t.direction===s)for(const e of t.boundSeries)n.set(e,t);let a=1,o=0;for(const s of this.axes)if(s.direction===t)for(const t of s.boundSeries){const r=n.get(t);if(null==r)continue;const l=this.zoomBounds(r,s,e,i);if(null==l)return;a=Math.min(a,l.min),o=Math.max(o,l.max)}if(a<1e-6&&(a=0),o>.999999&&(o=1),!(a>o))return{min:a,max:o}}},go=class{constructor(t){this.axis=t;const[e=0,i=1]=t.visibleRange;this.state=new Ss({min:e,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(t,e){this.state.set(t,e)}getZoom(){return Ge(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}};function mo(t,e,i,s,n,a){if(0===t.size)return!1;let o=t.x,r=t.y;null!=e&&(o-=(e.x-.5)*t.size,r-=(e.y-.5)*t.size);let l=o;o<i?l=i:o>i+n&&(l=i+n);let h=r;r<s?h=s:r>s+a&&(h=s+a);const c=o-l,d=r-h;return Math.sqrt(c*c+d*d)<=.5*t.size}function yo(t,e,i,s,n){const a=t.x+t.width>e&&t.x<e+s,o=t.y+t.height>i&&t.y<i+n;return a&&o}function fo(t,e,i,s,n){return e+s<t.x+t.width&&e>t.x&&i>t.y&&i+n<t.y+t.height}function xo(t){return null!=t&&"object"==typeof t.point&&"object"==typeof t.label}var bo={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0},"top-left":{x:-1,y:-1},"top-right":{x:1,y:-1},"bottom-left":{x:-1,y:1},"bottom-right":{x:1,y:1}};function vo(t,e=0){const i=[];for(let s=0;s<t.length;s++){const n=t[s],{point:{x:a,y:o},label:{text:r}}=n;let{width:l,height:h}=n.label;if(l+=e,h+=e,i.some(t=>yo(t,a,o,l,h)))return!0;i.push({index:s,text:r,x:a,y:o,width:l,height:h,datum:n})}return!1}var So=class{constructor(){this.labelData=new Map}updateLabels(t,e,i=y.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(t=>t.id));for(const t of this.labelData.keys())n.has(t)||this.labelData.delete(t);for(const e of t){const t=e.getLabelData();t.every(xo)&&this.labelData.set(e.id,t)}const a=function(t,e,i=5){const s=new Map,n=[],a=new Map([...t.entries()].map(([t,e])=>[t,e.toSorted((t,e)=>e.point.size-t.point.size)])),o=[...a.values()].flat();for(const[t,r]of a.entries()){const a=[];if(r[0]?.label){for(let t=0,s=r.length;t<s;t++){const s=r[t],{point:l,label:h,anchor:c}=s,{text:d,width:u,height:p}=h,g=.5*l.size;let m=0,y=0;if(g>0&&null!=s.placement){const t=bo[s.placement];m=(.5*u+g+i)*t.x,y=(.5*p+g+i)*t.y}const f=l.x-.5*u+m-((c?.x??.5)-.5)*l.size,x=l.y-.5*p+y-((c?.y??.5)-.5)*l.size;if(e&&!fo(e,f,x,u,p))continue;if(o.some(t=>mo(t.point,t.anchor,f,x,u,p)))continue;if(n.some(t=>yo(t,f,x,u,p)))continue;const b={index:t,text:d,x:f,y:x,width:u,height:p,datum:s};a.push(b),n.push(b)}s.set(t,a)}}return s}(this.labelData,s,5);for(const e of t)e.updatePlacedLabelData?.(a.get(e.id)??[])}},Mo=class extends Ji{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 null==t||(0,s.cy)(t)}restoreMemento(t,e,i){i?.forEach(t=>{const{seriesId:e,data:i}=this.getRestoredData(t)??{};e&&i&&this.updateData(e,i)}),this.update()}getRestoredData(t){const{seriesId:e,itemId:i,legendItemName:s,visible:n}=t;if(e){const t=(this.legendDataMap.get(e)??[]).map(t=>{const s=t.seriesId===e&&(!i||t.itemId===i);return s&&t.isFixed&&this.warnFixed(t.seriesId,t.itemId),!t.isFixed&&s?{...t,enabled:n}:t});return{seriesId:e,data:t}}if(null!=i||null!=s)for(const t of this.getData()){if(null!=i&&t.itemId!==i||null!=s&&t.legendItemName!==s)continue;if(t.isFixed)return void this.warnFixed(t.seriesId,i);const e=(this.legendDataMap.get(t.seriesId)??[]).map(t=>t.itemId===i||t.legendItemName===s?{...t,enabled:n}:t);return{seriesId:t.seriesId,data:e}}}warnFixed(t,e){s.Vy.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(t,e,i,s){if(s)return void this.getData().forEach(e=>{const i=(this.legendDataMap.get(e.seriesId)??[]).map(e=>e.legendItemName===s?{...e,enabled:t}:e);this.updateData(e.seriesId,i)});const n=this.getData(e),a=1===n.length,o=n.map(e=>null==i&&a||e.itemId===i?{...e,enabled:t}:e);this.updateData(e,o)}getData(t){return t?this.legendDataMap.get(t)??[]:[...this.legendDataMap].reduce((t,[e,i])=>t.concat(i),[])}getDatum({seriesId:t,itemId:e}={}){return this.getData(t).find(t=>t.itemId===e)}getSeriesEnabled(t){const e=this.getData(t);if(e.length>0)return e.some(t=>t.enabled)}getItemEnabled({seriesId:t,itemId:e}={}){return this.getDatum({seriesId:t,itemId:e})?.enabled??!0}},ko=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]&&0===Object.keys(this.groups[e]).length&&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 i of Object.values(this.groups[t]??{}))i.visible&&(s.add(i.grouping.groupIndex),i.grouping.groupIndex===e.groupIndex&&n.add(i.grouping.stackIndex));const a=Array.from(s);return a.sort((t,e)=>t-e),{visibleGroupCount:a.length,visibleSameStackCount:n.size,index:a.indexOf(e.groupIndex)}}},Do=class{constructor(t){this.updateCallback=t,this.events=new s.bk}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(t){this.events.emit("update-complete",{type:"update-complete",apiUpdate:t})}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})}},wo=class{constructor(t,e){this.callbackCache=new gn,this.chartEventManager=new Wn,this.highlightManager=new Hn,this.layoutManager=new ji,this.localeManager=new qs,this.seriesStateManager=new ko,this.stateManager=new qi,this.seriesLabelLayoutManager=new So,this.destroyFns=[],this.contextModules=[];const{scene:i,root:s,syncManager:n,container:a,fireEvent:o,updateCallback:r,updateMutex:l,styleContainer:c,chartType:d,domMode:u}=e;this.chartService=t,this.syncManager=n,this.domManager=new Ls(this.chartService,a,c,u),this.widgets=new na(this.domManager);const p=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new dn({canvasElement:p}),this.scene.setRoot(s),this.destroyFns.push(this.scene.on("scene-changed",()=>{this.updateService.update(7)})),this.axisManager=new fn(s),this.legendManager=new Mo,this.annotationManager=new mn(t.annotationRoot,o),this.chartTypeOriginator=new Yi(t),this.interactionManager=new Gn,this.contextMenuRegistry=new $n,this.updateService=new Do(r),this.proxyInteractionService=new Hs(this.localeManager,this.domManager),this.fontManager=new vn(this.domManager,this.updateService),this.historyManager=new Xi(this.chartEventManager),this.animationManager=new jn(this.interactionManager,l),this.dataService=new bn(this.animationManager),this.tooltipManager=new Jn(this.localeManager,this.domManager,t.tooltip),this.zoomManager=new po(o,this.layoutManager);for(const t of h.byType("context")){if(!t.chartTypes.includes(d))continue;const e=t.moduleFactory(this);this.contextModules.push(e),this[t.contextKey]=e}}destroy(){this.animationManager.destroy(),this.highlightManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.chartEventManager.destroy(),this.domManager.destroy(),this.fontManager.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()),this.destroyFns.forEach(t=>t())}},Io=class extends Lt{constructor(){super(...arguments),this.range="tooltip"}};function Co(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function Lo(t,e){if(null==t||null==e)return t===e;if(t.size!==e.size)return!1;for(const[i,s]of t){const t=e.get(i);if(null==t)return!1;if(!Co(s,t))return!1}return!0}function Ao(t,e,i,n){return e===t.data&&(0,s.r1)(i,t.ids)&&function(t,e){const{props:i,...n}=t,{props:a,...o}=e;return O(n,o)&&function(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i+=1){const{type:n,idsMap:a,scopes:o,data:r,...l}=t[i],{type:h,idsMap:c,scopes:d,data:u,...p}=e[i];if(n!==h)return!1;if(o&&d&&!(0,s.r1)(o,d))return!1;if(r&&u&&r!==u)return!1;if(!O(l,p)||!Lo(a,c))return!1}return!0}(i,a)}(n,t.opts)}r([Ct],Io.prototype,"range",2);var To=class t{constructor(){this.domain=new Set}static is(e){return e instanceof t}extend(t){this.domain.add(t)}getDomain(){return Array.from(this.domain)}},No=class t{constructor(){this.domain=[1/0,-1/0]}static is(e){return e instanceof t}static extendDomain(t,e=[1/0,-1/0]){for(const i of t)"number"==typeof i&&(e[0]>i&&(e[0]=i),e[1]<i&&(e[1]=i));return e}extend(t){this.domain[0]>t&&(this.domain[0]=t),this.domain[1]<t&&(this.domain[1]=t)}getDomain(){return[...this.domain]}},Oo=class{constructor(t){const e=t.reduce((t,e)=>Math.max(t,e.length),0);let i=1<<32-Math.clz32(e);e===i/2&&(i>>>=1),this.maxLevelSize=i;const s=new Float64Array(2*(2*i-1)).fill(NaN);for(const e of t)for(let t=0;t<e.length;t+=1){const n=Number(e[t]),a=i+t-1,o=0+(2*a|0),r=1+(2*a|0),l=s[o],h=s[r];(!Number.isFinite(l)||n<l)&&(s[o]=n),(!Number.isFinite(h)||n>h)&&(s[r]=n)}for(let t=i/2|0;t>=1;t=t/2|0){const e=t-1|0,i=e+t|0;for(let n=0;n<t;n+=1){const t=e+n,a=i+2*n,o=a+1,r=s[0+(2*a|0)],l=s[0+(2*o|0)];s[0+(2*t|0)]=!Number.isFinite(l)||r<l?r:l;const h=s[1+(2*a|0)],c=s[1+(2*o|0)];s[1+(2*t|0)]=!Number.isFinite(c)||h>c?h:c}}this.buffer=s}computeRangeInto(t,e,i,s,n,a,o){const r=n+a-1;if(r<e||n>=i)return o;if(n>=e&&r<i){const e=t[0+(2*s|0)],i=t[1+(2*s|0)];Number.isFinite(e)&&(o[0]=Math.min(o[0],e)),Number.isFinite(i)&&(o[1]=Math.max(o[1],i))}else a>1&&(s=2*s|0,a=a/2|0,this.computeRangeInto(t,e,i,s+1|0,n,a,o),this.computeRangeInto(t,e,i,s+2|0,n+a,a,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[0],t[1]]}},Ro=Symbol("domain-ranges");function Eo(t){return t.map(t=>(0,s.Gv)(t)?JSON.stringify(t):t).join("-")}function Po(t){const e=t?.map(Number);return e?.every(Number.isFinite)?e:[]}function Bo(t,e){return e?.get(t.id)??0}function Fo(t){return"scopes"in t&&Array.isArray(t.scopes)}function zo(t,e){const i=[];for(let s=0;s<t;s+=1)i[s]=e;return i}function Go(t,e,i){const s=[];for(const n of t){const t=n.get(e)?.[i];if(null==t)return;s.push(t)}return s}function _o(t){const e=[];let i,s=0;const n=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;i=n.exec(t);){if(i.index!==s)return;s=i.index+i[0].length;const t=i[1].trim();if(t.startsWith("."))e.push(t.slice(1).trim());else if(t.startsWith("[")){const i=t.slice(1,-1).trim();i.startsWith("'")?e.push(i.slice(1,-1).replace(/(?<!\\)\\'/g,"'")):i.startsWith('"')?e.push(i.slice(1,-1).replace(/(?<!\\)\\"/g,'"')):e.push(i)}else e.push(t)}if(s===t.length)return e}function jo(t){return e=>{let i=e;for(const e of t)i=i[e];return i}}var Wo=class{constructor(t,e="standalone",i=!1){this.opts=t,this.mode=e,this.suppressFieldDotNotation=i,this.debug=x.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(t,e,i,s){for(const n of t)s.has(n)||s.set(n,zo(e.length,!1)),s.get(n)[i]=!0};let s=!0;for(const e of t.props){if("key"===e.type&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");"value"===e.type&&s&&(s=!1)}const n=({matchGroupIds:t=[]})=>{for(const e of t)if(this.values.every(t=>t.groupId!==e))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${e}).`)},a=new Set,o=new Set;for(const e of t.props){const t="key"===e.type?a:o;switch(Fo(e)&&e.scopes?.forEach(e=>t.add(e)),e.type){case"key":this.keys.push({...e,index:this.keys.length,missing:new Map});break;case"value":if(null==e.property)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(e)}`);this.values.push({...e,index:this.values.length,missing:new Map});break;case"aggregate":n(e),this.aggregates.push({...e,index:this.aggregates.length});break;case"group-value-processor":n(e),this.groupProcessors.push({...e,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...e,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...e,index:this.reducers.length});break;case"processor":this.processors.push({...e,index:this.processors.length})}}if(this.opts.groupByKeys||null!=this.opts.groupByFn){const t=new Set(o.values());if(a.forEach(e=>t.delete(e)),t.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...t.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(null==n)throw new Error(`AG Charts - didn't find keys for [${e}, ${t.id}]`);return n.get(t.id)}hasColumnById(t,e){return null!=this.scopeCache.get(t.id)?.get(e)}resolveColumnById(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.columns?.[s];if(null==n)throw new Error(`AG Charts - didn't find column for [${e}, ${t.id}]`);return n}*forEachDatum(t,e,i){const s=e.columnScopes.findIndex(e=>e.has(t.id));for(const t of i.datumIndices[s]??[])yield e.columns[s][t]}*forEachGroupDatum(t,e){const i=e.columnScopes.findIndex(e=>e.has(t.id)),s={groupIndex:0,columnIndex:i},n=[];for(const t of e.groups){s.group=t;let e=0;for(const a of t.datumIndices[i]??n)s.datumIndex=a,s.valueIndex=e++,yield s;s.groupIndex++}}*forEachGroupDatumTuple(t,e){const i={columnIndex:e.columnScopes.findIndex(e=>e.has(t.id)),datumIndexes:[void 0,void 0,void 0]};for(const s of this.forEachGroupDatum(t,e))i.group=i.nextGroup,i.groupIndex=i.nextGroupIndex,i.nextGroup=s.group,i.nextGroupIndex=s.groupIndex,i.datumIndexes[0]=i.datumIndexes[1],i.datumIndexes[1]=i.datumIndexes[2],i.datumIndexes[2]=s.datumIndex,null!=i.group&&null!=i.datumIndexes[1]&&(yield i);i.group=i.nextGroup,i.groupIndex=i.nextGroupIndex,i.nextGroup=void 0,i.nextGroupIndex=void 0,i.datumIndexes[0]=i.datumIndexes[1],i.datumIndexes[1]=i.datumIndexes[2],i.datumIndexes[2]=void 0,null!=i.group&&null!=i.datumIndexes[1]&&(yield i)}getDomain(t,e,i,s){const n=this.getDomainsByType(i??"value",s);return n?.[this.resolveProcessedDataIndexById(t,e)]??[]}getDomainBetweenRange(t,e,[i,s],n){const a=e.map(e=>this.resolveProcessedDataIndexById(t,e)),o=a.join(":"),r=n[Ro];let l=r.get(o);if(null==l){const t=a.map(t=>n.columns[t]);l=new Oo(t),r.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:n,groupProcessors:a,reducers:o,processors:r,propertyProcessors:l}=this,h=performance.now();if(e&&0===this.keys.length)return;let c=this.extractData(t);e?c=this.groupData(c):i&&(c=this.groupData(c,i(c))),a.length>0&&"grouped"===c.type&&this.postProcessGroups(c),n.length>0&&"ungrouped"===c.type?this.aggregateUngroupedData(c):n.length>0&&"grouped"===c.type&&this.aggregateGroupedData(c),l.length>0&&this.postProcessProperties(c),o.length>0&&this.reduceData(c),r.length>0&&this.postProcessData(c),this.warnDataMissingProperties(t);const d=performance.now();return c.time=d-h,this.debug.check()&&function(t){const e=(t,e)=>{e.length>0&&(s.Vy.log(`DataModel.processData() - ${t}`),s.Vy.table(e))};s.Vy.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??[])}(c),this.processScopeCache(),c}warnDataMissingProperties(t){if(0!==t.size)for(const e of(0,s.nl)(this.keys,this.values))for(const[i,n]of e.missing){if(n<(t.get(i)?.length??1/0))continue;const a=null==i?"":` for ${i}`;s.Vy.warnOnce(`the key '${e.property}' was not found in any data element${a}.`)}}processScopeCache(){this.scopeCache.clear();for(const t of(0,s.nl)(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)){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)}else this.scopeCache.set(e,new Map([[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=null==t||0===t.length,s="string"==typeof e?e:e.id,n=this.values.reduce((e,n,a)=>((null==n.scopes||i&&!n.scopes.length||n.scopes.some(e=>t?.includes(e)))&&(n.property===s||n.id===s||(e=>{if(e.idsMap)for(const[i,n]of e.idsMap)if(t?.includes(i)&&n.has(s))return!0;return!1})(n))&&e.push(a),e),[]);if(0===n.length)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(e)} in scope(s) ${JSON.stringify(t)}`);return n}extractData(t){const{dataDomain:e,processValue:i,allScopesHaveSameDefs:s}=this.initDataDomainProcessor(),{keys:n,values:a}=this,{invalidData:o,invalidKeys:r,allKeyMappings:l}=this.extractKeys(n,t,i),{columns:h,columnScopes:c,partialValidDataCount:d,maxDataLength:u}=this.extractValues(o,a,t,r,i),p=t=>{const i=e.get(t),s=i.getDomain();return No.is(i)&&s[0]>s[1]?[]:s};return{type:"ungrouped",input:{count:u},scopes:new Set(t.keys()),dataSources:t,aggregation:void 0,keys:[...l.values()],columns:h,columnScopes:c,invalidKeys:r,invalidData:o,domain:{keys:n.map(p),values:a.map(p)},defs:{allScopesHaveSameDefs:s,keys:n,values:a},partialValidDataCount:d,time:0,[Ro]:new Map}}extractKeys(t,e,i){const s=new Map,n=new Map,a=new Map;let o,r;const l=(t,e)=>{const i=r.get(t);o.set(e,o.get(i)),s.has(i)&&(s.set(e,s.get(i)),n.set(e,n.get(i)))};for(const h of t){const{invalidValue:t,scopes:c}=h;o=new Map,r=new Map,a.set(h,o);for(const a of c??[]){const c=e.get(a)??[];if(r.has(c)){l(c,a);continue}const d=[];let u,p;o.set(a,d),r.set(c,a);for(let e=0;e<c.length;e++){if(null==c[e]||"object"!=typeof c[e])continue;const s=i(h,c[e],e,a);s.valid?d.push(s.value):(d.push(t),u??(u=zo(c.length,!1)),p??(p=zo(c.length,!1)),u[e]=!0,p[e]=!0)}u&&p&&(s.set(a,u),n.set(a,p))}}return{invalidData:n,invalidKeys:s,allKeyMappings:a}}extractValues(t,e,i,n,a){let o=0;const r=[],l=[];let h=0;for(const c of e){const{invalidValue:e}=c;if(new Set(c.scopes.map(t=>i.get(t))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(c)}`);const d=new Set(c.scopes),u=(0,s.$1)(c.scopes),p=i.get(u),g=new Array;for(let i=0;i<p.length;i++){if(null==p[i]||"object"!=typeof p[i])continue;const s=p[i],r=n.get(u)?.[i],l=a(c,s,i,c.scopes);let h=l.value;!r&&l.valid||this.markScopeDatumInvalid(c.scopes,p,i,t),r?h=e:l.valid||(o+=1,h=e),g[i]=h}r.push(g),l.push(d),h=Math.max(h,g.length)}return{columns:r,columnScopes:l,partialValidDataCount:o,maxDataLength:h}}groupData(t,e){var i;const n=new Map,{keys:a,columns:o,columnScopes:r,invalidKeys:l,invalidData:h}=t,c=t.scopes,d=new Set;for(const t of c){const u=o.map((t,e)=>e).filter(e=>!d.has(e)&&r[e].has(t));if(0===u.length)continue;for(const t of u)d.add(t);const p=new Set;for(const t of u)for(const e of r[t])p.add(e);const g=a.map(e=>e.get(t)).filter(t=>null!=t),m=o[(0,s.$1)(u)],y=h?.get(t),f=l?.get(t);for(let s=0;s<m.length;s++){if(!0===f?.[s])continue;const a=g.map(t=>t[s]);if(null==a||0===a.length)throw new Error("AG Charts - no keys found for scope: "+t);const o=e?.(a)??a,r=Eo(o),l=n.get(r)??{keys:o,datumIndices:[],validScopes:c};if(n.has(r)||n.set(r,l),!0===y?.[s]){l.validScopes===c&&(l.validScopes=new Set(c.values()));for(const t of p)l.validScopes.delete(t)}for(const t of u)(i=l.datumIndices)[t]??(i[t]=[]),l.datumIndices[t].push(s)}}const u=[],p=[];for(const{keys:t,datumIndices:e,validScopes:i}of n.values())u.push(t),p.push({datumIndices:e,keys:t,aggregation:[],validScopes:i});return{...t,type:"grouped",domain:{...t.domain,groups:u},groups:p}}aggregateUngroupedData(t){const e=this.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{keys:i,columns:n,dataSources:a}=t,o=(0,s.$1)(a.keys()),r=a.get(o);t.aggregation=r?.map((t,s)=>{const a=[];for(const[t,r]of this.aggregates.entries()){const l=this.valueGroupIdxLookup(r);let h=r.groupAggregateFunction?.()??[1/0,-1/0];const c=l.map(t=>n[t][s]),d=Go(i,o,s),u=null!=d?r.aggregateFunction(c,d):void 0;u&&(h=r.groupAggregateFunction?.(u,h)??No.extendDomain(u,h));const p=r.finalFunction?.(h)??h;a[t]=p,No.extendDomain(p,e[t])}return a})}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 a=this.valueGroupIdxLookup(n);for(const o of t.groups){o.aggregation??(o.aggregation=[]);const t=o.keys;let r=n.groupAggregateFunction?.()??[1/0,-1/0];const l=Math.max(...a.map(t=>o.datumIndices[t]?.length??0));for(let e=0;e<l;e++){const s=a.map(t=>i[t][o.datumIndices[t]?.[e]]),l=n.aggregateFunction(s,t);l&&(r=n.groupAggregateFunction?.(l,r)??No.extendDomain(l,r))}const h=n.finalFunction?.(r)??r;o.aggregation[s]=h,No.extendDomain(h,e[s])}}}postProcessGroups(t){const{groupProcessors:e}=this,{columnScopes:i,columns:n,invalidData:a}=t;for(const o of e){const e=this.valueGroupIdxLookup(o),r=o.adjust()();for(const i of t.groups)r(n,e,i);for(const o of e){const e="category"===this.values[o].valueType,r=n[o],l=(0,s.$1)(i[o]),h=a?.get(l),c=e?new To:new No;for(let t=0;t<r.length;t+=1)!0!==h?.[t]&&c.extend(r[t]);t.domain.values[o]=c.getDomain()}}}postProcessProperties(t){for(const{adjust:e,property:i,scopes:s}of this.propertyProcessors)for(const n of this.valueIdxLookup(s,i))e()(t,n)}reduceData(t){t.reduced??(t.reduced={});const{dataSources:e,keys:i}=t;for(const n of this.reducers){const a=n.reducer();let o=n.initialValue;if("grouped"===t.type)for(const e of t.groups)o=a(o,e.keys);else{const t=(0,s.$1)(e.keys()),n=i.map(e=>e.get(t)).filter(t=>null!=t),r=n.map(()=>{}),l=e.get(t);for(let t=0;t<l.length;t+=1){for(let e=0;e<r.length;e++)r[e]=n[e]?.[t];o=a(o,r)}}t.reduced[n.property]=o}}postProcessData(t){t.reduced??(t.reduced={});for(const e of this.processors)t.reduced[e.property]=e.calculate(t,t.reduced[e.property])}initDataDomainProcessor(){const{keys:t,values:e}=this,i=new Set;for(const t of e)if(t.scopes)for(const e of t.scopes)i.add(e);const n=new Map,a=new Map;let o=!0;const r=()=>{for(const a of(0,s.nl)(t,e))"category"===a.valueType?n.set(a,new To):(n.set(a,new No),o&&(o=(a.scopes??[]).length===i.size))};r();const l=this.buildAccessors((0,s.nl)(t,e)),h={value:void 0,missing:!1,valid:!1};return{dataDomain:n,processValue:(t,e,i,o)=>{let c,d;if(l.has(t.property)){try{d=l.get(t.property)(e)}catch{}c=null!=d}else c=t.property in e,d=c?e[t.property]:t.missingValue;if(null!=t.forceValue&&(d=c&&(0,s.cI)(d)?-1*t.forceValue:t.forceValue,c=!0),h.missing=!c,!c&&!("missingValue"in t))if("string"==typeof o){const e=t.missing.get(o)??0;t.missing.set(o,e+1)}else for(const e of o){const i=t.missing.get(e)??0;t.missing.set(e,i+1)}if(n.has(t)||r(),c&&!1===t.validation?.(d,e,i)){if(h.valid=!1,!("invalidValue"in t))return"integrated"!==this.mode&&s.Vy.warnOnce(`invalid value of type [${typeof d}] for [${t.scopes} / ${t.id}] ignored:`,`[${d}]`),h.value=void 0,h;d=t.invalidValue}else h.valid=!0;if(t.processor){let e=a.get(t);null==e&&(e=t.processor(),a.set(t,e)),d=e(d,i)}return n.get(t)?.extend(d),h.value=d,h},initDataDomain:r,scopes:i,allScopesHaveSameDefs:o}}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 t=_o(i.property);if(null==t){s.Vy.warnOnce("Invalid property path [%s]",i.property);continue}const n=jo(t);e.set(i.property,n)}return e}},Vo=class t{constructor(t,e){this.mode=t,this.suppressFieldDotNotation=e,this.debug=x.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(t,e,i){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");return new Promise((s,n)=>{this.requested.push({id:t,opts:i,data:e,resolve:s,reject:n})})}execute(t){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const e=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",e);const i=this.mergeRequested(e);this.debug("DataController.execute() - merged",i),this.debug.check()&&((0,s.zk)().processedData=[]);const n=[];for(const{data:a,ids:o,opts:r,resolves:l,rejects:h}of i){const i=t?.find(t=>Ao(t,a,o,r));let c,d;if(null==i)try{c=new Wo(r,this.mode,this.suppressFieldDotNotation);const t=new Map(e.map(t=>[t.id,t.data]));d=c.processData(t)}catch(t){h.forEach(e=>e(t));continue}else({dataModel:c,processedData:d}=i);n.push({opts:r,data:a,ids:o,dataModel:c,processedData:d}),this.debug.check()&&(0,s.zk)("processedData").push(d),0===d?.partialValidDataCount?l.forEach(t=>t({dataModel:c,processedData:d})):d?this.splitResult(c,d,o,l):h.forEach(t=>t(new Error("AG Charts - no processed data generated")))}return n}validateRequests(t){const e=[];for(const[i,s]of t.entries())i>0&&s.data.length!==t[0].data.length&&!1===s.opts.groupByData&&!1===s.opts.groupByKeys?s.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):e.push(s);return e}mergeRequested(e){const i=[];for(const s of e){const e=i.find(t.groupMatch(s));e?e.push(s):i.push([s])}return i.map(t.mergeRequests)}splitResult(t,e,i,s){for(let n=0;n<i.length;n++)(0,s[n])({dataModel:t,processedData:e})}static groupMatch({data:t,opts:e}){function i(t){return t.filter(t=>"key"===t.type).map(t=>t.property).join(";")}const{groupByData:s,groupByKeys:n=!1,groupByFn:a,props:o}=e,r=i(o);return([e])=>(!1===s||e.data===t)&&(e.opts.groupByKeys??!1)===n&&e.opts.groupByFn===a&&i(e.opts.props)===r}static mergeRequests(e){const i=new Set(["key","group-value-processor"]);return e.reduce((e,{id:s,data:n,resolve:a,reject:o,opts:{props:r,...l}})=>{e.ids.push(s),e.rejects.push(o),e.resolves.push(a),e.data??(e.data=n),e.opts??(e.opts={...l,props:[]});for(const a of r){const o={...a,scopes:[s],data:n};t.createIdsMap(s,o);const r=e.opts.props.find(e=>e.type===o.type&&(i.has(e.type)||e.data===o.data)&&t.deepEqual(e,o));r?(r.scopes??(r.scopes=[]),r.scopes.push(...o.scopes??[]),"key"!==r.type&&"value"!==r.type||!o.idsMap?.size||t.mergeIdsMap(o.idsMap,r.idsMap)):e.opts.props.push(o)}return e},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(t,e){for(const[i,s]of t){const t=e.get(i);if(null==t)e.set(i,new Set(s));else for(const e of s)t.add(e)}}static createIdsMap(t,e){null!=e.id&&(e.idsMap??(e.idsMap=new Map),e.idsMap.has(t)?e.idsMap.get(t).add(e.id):e.idsMap.set(t,new Set([e.id])))}static deepEqual(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){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(!t.deepEqual(e[s],i[s]))return!1;return!0}const a=Object.keys(e);if(n=a.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const n=a[s];if(!(t.skipKeys.has(n)||Object.hasOwn(i,n)&&t.deepEqual(e[n],i[n])))return!1}return!0}return!1}};Vo.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var Ko=Vo,Yo=new 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)}},$o=[{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 Ho(t){return $o.find(e=>"series"===e.type&&e.identifier===t)?.chartTypes}function Uo(t){if(!function(t){return"enterprise"===t.packageType}(t))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const e=$o.find(e=>e.type===t.type&&(!("optionsKey"in e)||!("optionsKey"in t)||e.optionsKey===t.optionsKey)&&(!("contextKey"in e)||!("contextKey"in t)||e.contextKey===t.contextKey)&&e.identifier===t.identifier&&t.chartTypes.every(t=>e.chartTypes.includes(t)));return e&&(e.useCount??(e.useCount=0),e.useCount++),null!=e}var Xo=new 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),{})}},Zo=class extends Map{get(t){return super.get(t)??"unknown"}isCartesian(t){return"cartesian"===this.get(t)}isPolar(t){return"polar"===this.get(t)}isHierarchy(t){return"hierarchy"===this.get(t)}isTopology(t){return"topology"===this.get(t)}isFlowProportion(t){return"flow-proportion"===this.get(t)}isStandalone(t){return"standalone"===this.get(t)}isGauge(t){return"gauge"===this.get(t)}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))}},qo=class extends Map{set(t,e){return super.set(t,E(e,this.get(t)))}},Qo=new Zo,Jo=new Zo,tr=new qo,er=new class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(t,{chartTypes:[e],moduleFactory:i,tooltipDefaults:s,defaultAxes:n,themeTemplate:a,solo:o,stackable:r,groupable:l,stackedByDefault:h,hidden:c}){this.setThemeTemplate(t,a),this.seriesMap.set(t,{moduleFactory:i,tooltipDefaults:s,defaultAxes:n,solo:o,stackable:r,groupable:l,stackedByDefault:h}),Qo.set(t,e),c||Jo.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){const e=this.seriesMap.get(t)?.defaultAxes;return null==e?null:{axes:Ge(e)}}setThemeTemplate(t,e){const i=this.themeTemplates.get(t);this.themeTemplates.set(t,E(e,i))}getThemeTemplate(t){return this.themeTemplates.get(t)}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}},ir=class t extends Ji{constructor(t){super(),this.chart=t}subscribe(e=t.DEFAULT_GROUP){let i=this.get(e);return i||(i={members:new Set},t.chartsGroups.set(e,i)),i.members.add(this.chart),this}unsubscribe(e=t.DEFAULT_GROUP){const i=this.get(e);return i?.members.delete(this.chart),delete i?.domains?.x?.sources?.[this.chart.id],delete i?.domains?.y?.sources?.[this.chart.id],this}getChart(){return this.chart}getGroupState(e=t.DEFAULT_GROUP){return this.get(e)}getGroupMembers(e=t.DEFAULT_GROUP){const i=this.get(e);return i?Array.from(i.members):[]}getGroupSiblings(e=t.DEFAULT_GROUP){return this.getGroupMembers(e).filter(t=>t!==this.chart)}getGroupSyncMode(e=t.DEFAULT_GROUP){return this.getGroupMembers(e).some(t=>t.series.length>1)?"multi-series":"single-series"}get(e){return t.chartsGroups.get(e)}};ir.chartsGroups=new Map,ir.DEFAULT_GROUP=Symbol("sync-group-default");var sr=ir,nr=class extends Lt{constructor(){super(...arguments),this.enabled=!1}};r([Ct],nr.prototype,"enabled",2),r([Ct],nr.prototype,"tabIndex",2);var ar={};o(ar,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>or,fromToMotion:()=>rr,staticFromToMotion:()=>lr});var or={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function rr(t,e,i,s,n,a,o){const{fromFn:r,toFn:l,applyFn:h=(t,e)=>t.setProperties(e)}=n,{nodes:c,selections:d}=En(s),u=(s,n)=>{let c,d=0,u=0;for(const p of n){const g=s[d]===p,m={last:u>=n.length-1,lastLive:d>=s.length-1,prev:n[u-1],prevFromProps:c,prevLive:s[d-1],next:n[u+1],nextLive:s[d+(g?1:0)]},y=`${t}_${e}_${p.id}`;i.stopByAnimationId(y);let f="unknown";g?a&&o&&(f=hr(p,p.datum,a,o)):f="removed",p.transitionOut="removed"===f;const{phase:x,start:b,finish:v,delay:S,duration:M,...k}=r(p,p.datum,f,m),{phase:D,start:w,finish:I,delay:C,duration:L,...A}=l(p,p.datum,f,m),T=null==v;i.animate({id:y,groupId:t,phase:x??D??"update",duration:M??L,delay:S??C,from:k,to:A,ease:wn,collapsable:T,onPlay:()=>{const t={...b,...w,...k};h(p,t,"start")},onUpdate(t){h(p,t,"update")},onStop:()=>{const t={...b,...w,...k,...A,...v,...I};h(p,t,"end")}}),g&&d++,u++,c=k}};let p=0;for(const s of d){const n=s.nodes();u(n.filter(t=>!s.isGarbage(t)),n),i.animate({id:`${t}_${e}_selection_${p}`,groupId:t,phase:"end",from:0,to:1,ease:wn,onStop(){s.cleanup()}}),p++}u(c,c)}function lr(t,e,i,s,n,a,o){const{nodes:r,selections:l}=En(s),{start:h,finish:c,phase:d}=o;i.animate({id:`${t}_${e}`,groupId:t,phase:d??"update",from:n,to:a,ease:wn,onPlay:()=>{if(h){for(const t of r)t.setProperties(h);for(const t of l)for(const e of t.nodes())e.setProperties(h)}},onUpdate(t){for(const e of r)e.setProperties(t);for(const e of l)for(const i of e.nodes())i.setProperties(t)},onStop:()=>{for(const t of r)t.setProperties({...a,...c});for(const t of l){for(const e of t.nodes())e.setProperties({...a,...c});t.cleanup()}}})}function hr(t,e,i,s){const n=i(t,e);return s.added.has(n)?"added":s.removed.has(n)?"removed":null==t.previousDatum&&null!=t.datum?"added":null!=t.previousDatum&&null==t.datum?"removed":"updated"}var cr={};function dr(t,e){const{nodes:i,selections:s}=En(t);for(const t of s){for(const i of t.nodes()){const t=e(i,i.datum);i.setProperties(t)}t.cleanup()}for(const t of i){const i=e(t,t.datum);t.setProperties(i)}}o(cr,{resetMotion:()=>dr});var ur=class t{constructor(t,e,i=!0){this.parentNode=t,this.autoCleanup=i,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=x.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(J,e)?()=>new e:e}static select(e,i,s=!0){return new t(e,i,s)}static selectAll(t,e){const i=[],s=t=>{e(t)&&i.push(t);for(const e of t.children())s(e)};return s(t),i}static selectByClass(e,...i){return t.selectAll(e,t=>i.some(e=>t instanceof e))}static selectByTag(e,i){return t.selectAll(e,t=>t.tag===i)}createNode(t,e,i){const s=this.nodeFactory(t);return s.datum=t,e?.(s),null==i?this._nodes.push(s):this._nodes.splice(i,0,s),this.parentNode.appendChild(s),s}update(t,e,i){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",t),i){const s=new Map(t.map((t,e)=>[i(t),[t,e]]));for(const[t,e]of this._nodesMap.entries())if(s.has(e)){const[i]=s.get(e);t.datum=i,this.garbageBin.delete(t),s.delete(e)}else this.garbageBin.add(t);for(const[t,[i,n]]of s.entries())this._nodesMap.set(this.createNode(i,e,n),t)}else{const i=Math.max(t.length,this.data.length);for(let s=0;s<i;s++)s>=t.length?this.garbageBin.add(this._nodes[s]):s>=this._nodes.length?this.createNode(t[s],e):(this._nodes[s].datum=t[s],this.garbageBin.delete(this._nodes[s]))}return this.data=t.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return 0===this.garbageBin.size||(this._nodes=this._nodes.filter(t=>!this.garbageBin.has(t)||(this._nodesMap.delete(t),this.garbageBin.delete(t),t.destroy(),!1))),this}clear(){return this.update([]),this}isGarbage(t){return this.garbageBin.has(t)}each(t){for(const e of this._nodes.entries())t(e[1],e[1].datum,e[0]);return this}*[Symbol.iterator](){for(let t=0;t<this._nodes.length;t++){const e=this._nodes[t];yield{node:e,datum:e.datum,index:t}}}select(e){return t.selectAll(this.parentNode,e)}selectByClass(e){return t.selectByClass(this.parentNode,e)}selectByTag(e){return t.selectByTag(this.parentNode,e)}nodes(){return this._nodes}at(t){return this._nodes.at(t)}get length(){return this._nodes.length}},pr=class extends de{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(t){this.x1=t,this.x2=t}set y(t){this.y1=t,this.y2=t}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new y(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(t,e){return(this.x1===this.x2||this.y1===this.y2)&&this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(t,e)}distanceSquared(t,e){const{x1:i,y1:s,x2:n,y2:a}=this;return Wt(t,e,i,s,n,a,1/0)}render(t){const{ctx:e,devicePixelRatio:i}=t;let{x1:s,y1:n,x2:a,y2:o}=this;if(s===a){const{strokeWidth:t}=this,e=Math.round(s*i)/i+Math.trunc(t*i)%2/(2*i);s=e,a=e}else if(n===o){const{strokeWidth:t}=this,e=Math.round(n*i)/i+Math.trunc(t*i)%2/(2*i);n=e,o=e}e.beginPath(),e.moveTo(s,n),e.lineTo(a,o),this.fillStroke(e),this.fillShadow?.markClean(),super.render(t)}toSVG(){if(!this.visible)return;const t=(0,s.FJ)("line");return t.setAttribute("x1",String(this.x1)),t.setAttribute("y1",String(this.y1)),t.setAttribute("x2",String(this.x2)),t.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(t),{elements:[t]}}};pr.className="Line",pr.defaultStyles={...de.defaultStyles,fill:void 0,strokeWidth:1},r([H()],pr.prototype,"x1",2),r([H()],pr.prototype,"y1",2),r([H()],pr.prototype,"x2",2),r([H()],pr.prototype,"y2",2);var gr="color: green",mr="color: grey";function yr(){return L(()=>{})}function fr(t,e){const i=T(e);if(0===i.length)return;const s=N(t);for(const t of i)t in s&&(e[t]=s[t])}var xr=class{transitionRoot(t,e){this.parent?this.parent.transitionRoot(t,e):this.transition(t,e)}},br=class t extends xr{constructor(t,e,i){super(),this.defaultState=t,this.states=e,this.enterEach=i,this.debug=x.create(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,gr)}transition(e,i){if(!this.transitionChild(e,i)||this.state===t.child||this.state===t.parent)return;const s=this.state,n=this.states[this.state];let a=n[e];const o=`%c${this.constructor.name} | ${this.state} -> ${e} ->`;if(Array.isArray(a))a=a.find(t=>{if(!t.guard)return!0;const e=t.guard(i);return e||this.debug(`${o} (guarded)`,t.target,mr),e});else if("object"==typeof a&&!(a instanceof t)&&a.guard&&!a.guard(i))return void this.debug(`${o} (guarded)`,a.target,mr);if(!a)return void this.debug(`${o} ${this.state}`,mr);const r=this.getDestinationState(a),l=r===this.state?void 0:n.onExit;this.debug(`${o} ${r}`,gr),this.state=r,"function"==typeof a?a(i):"object"!=typeof a||a instanceof t||a.action?.(i),l?.(),this.enterEach?.(s,r),r!==s&&r!==t.child&&r!==t.parent&&this.states[r].onEnter?.(s,i)}transitionAsync(t,e){setTimeout(()=>{this.transition(t,e)},0)}is(e){return this.state===t.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!==t.child||!this.childState||(fr(this,this.childState),this.childState.transition(e,i),!this.childState.is(t.parent)||(this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${this.defaultState}`,gr),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1))}getDestinationState(e){let i=this.state;return"string"==typeof e?i=e:e instanceof t?(this.childState=e,this.childState.parent=this,i=t.child):"object"==typeof e&&(e.target instanceof t?(this.childState=e.target,this.childState.parent=this,i=t.child):null!=e.target&&(i=e.target)),i}};br.child="__child",br.parent="__parent";var vr=br,Sr=class extends xr{constructor(...t){super(),this.stateMachines=t;for(const e of t)e.parent=this}transition(t,e){for(const i of this.stateMachines)fr(this,i),i.transition(t,e)}transitionAsync(t,e){for(const i of this.stateMachines)fr(this,i),i.transitionAsync(t,e)}},Mr=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=(0,s.Kg)(t)?t:t.optionsKey;this.moduleMap.get(e)?.moduleInstance.destroy(),this.moduleMap.delete(e)}getModule(t){return this.moduleMap.get((0,s.Kg)(t)?t:t.optionsKey)?.moduleInstance}isEnabled(t){return this.moduleMap.has((0,s.Kg)(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 kr(t){return"string"==typeof t?da[t]:t}function Dr(t){return kr(t).unit}function wr(t){return kr(t).hierarchy}function Ir(t){return kr(t).milliseconds}function Cr(t,e,i,s){return kr(t).range(e,i,s)}function Lr(t,e){return kr(t).floor(e)}var Ar=class t extends io{constructor(){super(...arguments),this.type="unit-time",this._domain=[],this._bands=void 0}static is(e){return e instanceof t}set domain(t){t!==this._domain&&(this._domain=t,this._bands=void 0)}get domain(){return this._domain}get interval(){return this._interval}set interval(t){this._interval!==t&&(this._interval=t,this._bands=void 0)}get bands(){return this._bands??(this._bands=this.calculateBands(this._domain,[0,1])),this._bands}normalizeDomains(...t){return ca(...t)}convert(t,e){const{domain:i,interval:s}=this;if(i.length<2)return NaN;if(null!=s){const e=t.valueOf(),[n,a]=this.calculateBandRange(i,s),o=Math.min(n.valueOf(),a.valueOf()),r=Math.max(n.valueOf(),a.valueOf());if(e<o||e>=r+Ir(s))return NaN}return super.convert(t,e)}calculateBandRange(t,e){return[Lr(e,t[0]),Lr(e,t[1])]}calculateBands(t,e,i=!1){if(t===this.domain&&0===e[0]&&1===e[1]&&!i&&null!=this._bands)return this._bands;if(t.length<2)return[];const{interval:s}=this;if(null==s)return[];const[n,a]=this.calculateBandRange(t,s);return Cr(s,n,a,{visibleRange:e,extend:i})}ticks({interval:t},e=this.domain,i=[0,1],n=!1){if(e.length<2)return;const a=this.calculateBands(e,i,n),o=this.interval?Ir(this.interval):1/0;if(null==t)return{ticks:a,count:void 0};const r=Math.min(e[0].valueOf(),e[1].valueOf()),l=Math.max(e[0].valueOf(),e[1].valueOf()),h=[];let c,d,u,p,g,m;t instanceof ba?(c=t.range(e[0],e[1],{extend:!0,visibleRange:i}),d=0,u=c.length-1):(c=a,d=(0,s.I5)(0,a.length-1,t=>a[t].valueOf()<=r)??0,u=(0,s.I5)(0,a.length-1,t=>a[t].valueOf()<=l)??a.length-1);for(let t=d;t<=u;t++){const e=c[t].valueOf(),i=(0,s.I5)(0,a.length-1,t=>a[t].valueOf()<=e),n=null!=i&&i!=p?a[i]:void 0;p=i,null!=n&&e-n.getTime()<=o&&h.push(n)}if(this.interval){const t=this.calculateBandRange([new Date(r),new Date(l)],this.interval);g=t[0].valueOf(),m=t[1].valueOf()}else g=r,m=l;let y=(0,s.S3)(0,h.length-1,t=>h[t].valueOf()>=g)??0,f=(0,s.I5)(0,h.length-1,t=>h[t].valueOf()<=m)??h.length-1;return n&&(y=Math.max(y-1,0),f=Math.min(f+1,h.length-1)),{ticks:h.slice(y,f+1),count:h.length}}findIndex(t){const{bands:e}=this,i=t.valueOf();return(0,s.I5)(0,e.length-1,t=>e[t].valueOf()<=i)}datumFormatter(t){const e=this.tickFormatter(t,1);return t=>{const i=this.findIndex(t);return e(null!=i?this.bands[i]:t)}}};Ar.defaultTickCount=12;var Tr=Ar;function Nr(t,e){return t.valueOf()-e.valueOf()}function Or(t){const e=t.slice().sort(Nr);return null==Rr(e)?function(t){let e=NaN;const i=[];for(const s of t){const t=s.valueOf();e!==t&&i.push(s),e=t}return i}(e):e}function Rr(t){if(0===t.length)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 t=s.valueOf();if(Math.sign(t-i)!==e)return;i=t}return e}var Er=(t,e,i)=>({duration:e*i,timeInterval:t,step:i}),Pr=[Er(wa,ua,1),Er(wa,ua,5),Er(wa,ua,15),Er(wa,ua,30),Er(Ca,pa,1),Er(Ca,pa,5),Er(Ca,pa,15),Er(Ca,pa,30),Er(Aa,ga,1),Er(Aa,ga,3),Er(Aa,ga,6),Er(Aa,ga,12),Er(Ma,ma,1),Er(Ma,ma,2),Er(Na,ya,1),Er(Na,ya,2),Er(Na,ya,3),Er(Sa,fa,1),Er(Sa,fa,2),Er(Sa,fa,3),Er(Sa,fa,4),Er(Sa,fa,6),Er(va,xa,1)],Br=[1,2,5,10];function Fr(t,e){return Math.abs(Math.round(t)-t)<e}function zr(t,e,i){return Math.abs(e-t)>=i?Math.abs(e-t)/i+1:1}function Gr(t,e,i,s,n,a){if(t===e)return{ticks:[t],count:1};if(i<2)return{ticks:[t,e],count:2};const o=Vr(t,e,i,s,n);if(!Number.isFinite(o))return{ticks:[],count:0};let r=t,l=e;if(Fr(r/o,1e-12)||(r=Math.ceil(r/o)*o),Fr(l/o,1e-12)||(l=Math.floor(l/o)*o),null!=a){const i=l-r,s=e-t;a=[(t+s*a[0]-r)/i,(t+s*a[1]-r)/i]}const{ticks:h}=$r(r,l,o,a);return{ticks:h,count:zr(t,e,o)}}var _r=Math.floor(2*Na.milliseconds/Sa.milliseconds*10)/10;function jr({timeInterval:t,step:e}){return t.milliseconds*e<=(t.hierarchy?.milliseconds??1/0)*_r}function Wr(t,e,i,s,n,{weekStart:a,primaryOnly:o=!1,targetInterval:r}){if(i<=0)return;const l=r??Math.abs(e-t)/Math.max(i,1),h=Pr.findLast(t=>(!o||jr(t))&&l>t.duration),c=Pr.find(t=>(!o||jr(t))&&l<=t.duration);if(null==h){const a=Math.max(Vr(t,e,i,s,n),1);return ka.every(a)}if(null==c){const a=null==r?Vr(t/xa,e/xa,i,s,n):1;return va.every(a)}const{timeInterval:d,step:u}=l-h.duration<c.duration-l?h:c;return d===Na?a?.every(u)??Ma.every(7*u):d.every(u)}function Vr(t,e,i,n=0,a=1/0){if(t===e)return(0,s.qE)(1,n,a);if(i<1)return NaN;const o=Math.abs(e-t),r=10**Math.floor(Math.log10(o/i));let l=NaN,h=1/0,c=!1;for(const t of Br){const e=Math.ceil(o/(t*r)),s=e>=n&&e<=a;if(c&&!s)continue;const d=Math.abs(e-i);(h>d||c!==s)&&(c||(c=s),h=d,l=t)}return l*r}function Kr(t){for(let e=t.length-1;e>=0;e-=1)if("0"!==t[e])return e+1;return 0}function Yr(t,e){const i=(0,s.sA)(e??",f");(null==i.precision||isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...t.map(t=>{if(!Number.isFinite(t))return 0;const[e,s]=t.toExponential((i.type?6:12)-1).split(/[.e]/g);return("1"!==e&&"-1"!==e?1:0)+Kr(s)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...t.map(t=>{if(!Number.isFinite(t)||0===t)return 0;const e=Math.floor(Math.log10(Math.abs(t))),s=i.type?6:12,n=Kr(t.toExponential(s-1).split(/[.e]/g)[1]);return Math.max(0,n-e)}))));const n=(0,s.OR)(i);return t=>n(Number(t))}function $r(t,e,i,n){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0};if(t===e)return{ticks:[t],count:1};const a=10**(0,s.o3)(i),o=Math.min(t,e),r=Math.max(t,e);let l,h;if(null==n||0===n[0]&&1===n[1])l=o,h=r;else{const i=e-t,s=t+i*n[0],a=e-i*(1-n[1]);l=Math.min(s,a),h=Math.max(s,a)}l=Math.floor(l*a)/a,h=Math.ceil(h*a)/a;const c=[];for(let t=0;;t+=1){const e=Math.round((o+i*t)*a)/a;if(e>r)break;e>=l&&e<=h&&c.push(e)}return{ticks:c,count:zr(o,r,i)}}function Hr(t,e){return t>=e&&(s.Vy.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0)}function Ur(t,e){const i=Math.abs(e-t),s=10**Math.floor(Math.log10(i));let n=1/0,a=[t,e];for(const o of Br){const r=o*s,l=Math.floor(t/r)*r,h=Math.ceil(e/r)*r,c=1-i/Math.abs(h-l);n>c&&(n=c,a=[l,h])}return a}function Xr(t,e,i,n,a,o){if(t<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};o=Math.max(o,t/(a+1)),i??(i=o),n??(n=t),i>n&&(i===o?i=n:n=i);const r=Math.max(1,Math.floor(t/(e*i))),l=Math.min(r,Math.ceil(t/(e*n)));return{minTickCount:l,maxTickCount:r,tickCount:(0,s.qE)(l,Math.floor(a/e),r)}}var Zr=class t extends ha{constructor(){super([],[0,1]),this.type="time"}static is(e){return e instanceof t}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[];let[i,s]=e;const n=this.getPixelRange();for(let e=0;e<4;e++){const[e,a]=Jr(i,s,t,n);if(qa(i)===qa(e)&&qa(s)===qa(a))break;i=e,s=a}return[i,s]}ticks(t,e=this.domain,i=[0,1],s=!1){const{nice:n,interval:a,tickCount:o=ha.defaultTickCount,minTickCount:r,maxTickCount:l}=t;if(e.length<2)return;const h=e.map(qa),c=h[0],d=h[h.length-1];return null!=a?{ticks:Qr({start:c,stop:d,interval:a,availableRange:this.getPixelRange(),visibleRange:i,extend:s})??qr({start:c,stop:d,tickCount:o,minTickCount:r,maxTickCount:l,visibleRange:i,extend:s}),count:void 0}:n&&2===o?{ticks:e,count:void 0}:n&&1===o?{ticks:e.slice(0,1),count:void 0}:{ticks:qr({start:c,stop:d,tickCount:o,minTickCount:r,maxTickCount:l,visibleRange:i,extend:s}),count:void 0}}_tickFormatter({domain:t,ticks:e,specifier:i},s){return null!=i?Za(i):Qa(e,t,s)}tickFormatter(t){return this._tickFormatter(t)}datumFormatter(t){return this._tickFormatter(t,1)}};function qr({start:t,stop:e,tickCount:i,minTickCount:s,maxTickCount:n,visibleRange:a,extend:o}){const r=Wr(t,e,i,s,n,{weekStart:Na});return r?r.range(new Date(t),new Date(e),{visibleRange:a,extend:o}):[]}function Qr({start:t,stop:e,interval:i,availableRange:s,visibleRange:n,extend:a}){if(!i)return[];if(i instanceof ba||"string"==typeof i){const o=Cr(i,new Date(t),new Date(e),{visibleRange:n,extend:a});if(Hr(o.length,s))return;return o}const o=Math.abs(i);if(Hr(Math.abs(e-t)/o,s))return;const r=Pr.findLast(t=>o%t.duration===0);if(r)return r.timeInterval.every(o/(r.duration/r.step)).range(new Date(t),new Date(e),{visibleRange:n,extend:a});let l=new Date(Math.min(t,e));const h=new Date(Math.max(t,e)),c=[];for(;l<=h;)c.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+o);return c}function Jr(t,e,i,s){const{interval:n}=i,a=Math.min(qa(t),qa(e)),o=Math.max(qa(t),qa(e));let r;if(n instanceof ba)r=n;else if("string"==typeof n)r=n;else{let t;"number"==typeof n&&(t=(o-a)/Math.max(n,1),Hr(t,s)&&(t=void 0)),t??(t=i.tickCount??ha.defaultTickCount),r=Wr(a,o,t,i.minTickCount,i.maxTickCount,{weekStart:Na})}if(null==r)return[t,e];const l=Cr(r,new Date(a),new Date(o),{extend:!0});if(null==l||l.length<2)return[t,e];const h=l[0],c=l[l.length-1];return t<=e?[h,c]:[c,h]}var tl=class t extends io{constructor(){super(...arguments),this.type="ordinal-time",this._domain=[],this.isReversed=!1}static is(e){return e instanceof t}set domain(t){t!==this._domain&&(this.invalid=!0,this._domain=t,this._bands=void 0,this.isReversed=t.length>0&&t[0]>t[t.length-1],this.sortedTimestamps=void 0,this.precomputedSteps=void 0)}get domain(){return this._domain}get bands(){return this._bands??(this._bands=this.isReversed?this.domain.slice().reverse():this.domain),this._bands}normalizeDomains(...t){const e=t.filter(t=>t.length>0);if(0===e.length)return{domain:[],animatable:!1};if(1===e.length){let t=e[0];const i=Rr(t);return-1===i?t=t.slice().reverse():null==i&&(t=Or(t.slice())),{domain:t,animatable:!0}}return{domain:Or(e.flat()),animatable:!0}}ticks({interval:t,maxTickCount:e},i=this.domain,s=[0,1],n=!1){if(!i.length)return;this.refresh();const{isReversed:a}=this;if(null==t)return{ticks:el(i,e,a,s,n),count:void 0};const o=i[0].valueOf(),r=i[i.length-1].valueOf(),[l,h]=this.range;let c=Qr({start:o,stop:r,interval:t,availableRange:Math.abs(h-l),visibleRange:s,extend:n})??el(i,e,a,s,n),d=-1;return c=c.filter(t=>{const e=this.findInterval(t.valueOf()),i=e===d;return d=e,!i}),{ticks:c,count:void 0}}getSortedTimestamps(){let{sortedTimestamps:t}=this;return null==t&&(t??(t=this.bands.map(qa)),this.sortedTimestamps=t),t}getPrecomputedSteps(){const{domain:t}=this;let{precomputedSteps:e}=this;const i=t.length<1e4?t.length:Math.ceil(t.length/16);if(null!=e||i<=1)return e;const s=this.getSortedTimestamps();e=new Int32Array(i);const n=s[0],a=s[s.length-1]-n,o=s.length-1;for(let t=0;t<e.length;t+=1)e[t]=this.findIntervalInRange(n+t/i*a,0,o);this.precomputedSteps=e}findIntervalInRange(t,e,i){const s=this.getSortedTimestamps();for(;e<=i;){const n=(e+i)/2|0;if(s[n]===t)return n;s[n]<t?e=n+1:i=n-1}return e}findInterval(t){const e=this.getPrecomputedSteps();let i,s;if(null==e)i=0,s=this.domain.length-1;else{const n=this.getSortedTimestamps(),a=n[0],o=n[n.length-1],r=Math.min((t-a)/(o-a)*e.length|0,e.length-1|0);i=e[r],s=r<e.length-2?e[r+1]:n.length-1}return this.findIntervalInRange(t,i,s)}datumFormatter(t){return this.tickFormatter(t)}findIndex(t){const e=this.getSortedTimestamps(),i=Number(t);if(!(i<e[0]))return this.findInterval(i)}};function el(t,e,i,s,n){const a=[],o=Math.ceil(t.length/e),r=Math.floor(o/2);let l=Math.floor(s[0]*t.length),h=Math.ceil(s[1]*t.length);n&&(l>o&&(l-=o),h<t.length-o&&(h+=o));for(let e=l;e<h;e+=1){const s=i?t.length-1-e:e;(o<=0||(s+r)%o===0)&&a.push(t[e])}return a}var il=class extends de{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.horizontal=!1,this.restoreOwnStyles()}computeBBox(){return new y(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(t,e){return!1}render(t){const{ctx:e}=t;let{x1:i,y1:s,x2:n,y2:a}=this;i=this.align(i),s=this.align(s),n=this.align(n),a=this.align(a);const{fill:o,horizontal:r}=this,{globalAlpha:l}=e;null!=o&&(this.applyFillAndAlpha(e),e.beginPath(),e.moveTo(i,s),e.lineTo(n,s),e.lineTo(n,a),e.lineTo(i,a),e.closePath(),e.fill(),e.globalAlpha=l);const{stroke:h,strokeWidth:c,startLine:d,endLine:u}=this;if((d||u)&&h&&c){const{lineDash:t,lineDashOffset:o,lineCap:h,lineJoin:p}=this;this.applyStrokeAndAlpha(e),e.lineWidth=c,t&&e.setLineDash([...t]),o&&(e.lineDashOffset=o),h&&(e.lineCap=h),p&&(e.lineJoin=p),e.beginPath(),d&&(e.moveTo(i,s),r?e.lineTo(i,a):e.lineTo(n,s)),u&&(e.moveTo(n,a),r?e.lineTo(n,s):e.lineTo(i,a)),e.stroke(),e.globalAlpha=l}this.fillShadow?.markClean(),super.render(t)}};function sl(t){return(0,s.Bf)(t)||(0,s.vd)(t)||function(t){return null!=t&&Object.hasOwn(t,"valueOf")&&(0,s.Bf)(t.valueOf())}(t)}function nl(t){return function(t){return null!=t&&Object.hasOwn(t,"toString")&&(0,s.Kg)(t.toString())}(t)&&Object.hasOwn(t,"id")?t.id:t}function al(t){switch(t.type){case"line":return t.value;case"range":return t.range}}function ol(t,e){if(null==t)return!1;const i=ha.is(e)||io.is(e),n=t=>function(t,e){return null!=t&&(!e||sl(t))}(t,i)&&!isNaN(e.convert(t));if((0,s.cy)(t)){const[e,i]=t;return n(e)&&n(i)}return n(t)}il.className="Range",il.defaultStyles={...de.defaultStyles,strokeWidth:1},r([H()],il.prototype,"x1",2),r([H()],il.prototype,"y1",2),r([H()],il.prototype,"x2",2),r([H()],il.prototype,"y2",2),r([H()],il.prototype,"startLine",2),r([H()],il.prototype,"endLine",2),r([H()],il.prototype,"horizontal",2);var rl={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:-1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},ll={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:-1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},hl={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},cl={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},dl=class extends Lt{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};r([Ct],dl.prototype,"enabled",2),r([Ct],dl.prototype,"text",2),r([Ct],dl.prototype,"fontStyle",2),r([Ct],dl.prototype,"fontWeight",2),r([Ct],dl.prototype,"fontSize",2),r([Ct],dl.prototype,"fontFamily",2),r([Ct],dl.prototype,"padding",2),r([Ct],dl.prototype,"color",2),r([Ct],dl.prototype,"position",2),r([Ct],dl.prototype,"rotation",2),r([Ct],dl.prototype,"parallel",2);var ul=class extends Lt{constructor(){super(),this.id=(0,s.sX)(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new dl,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.position="top",this.rangeGroup=new Ie({name:this.id}),this.lineGroup=new Ie({name:this.id}),this.labelGroup=new Ie({name:this.id}),this.crossLineRange=new il,this.crossLineLabel=new Pi,this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.lineGroup.append(this.crossLineRange),this.labelGroup.append(this.crossLineLabel),this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}update(t){const{enabled:e,type:i,data:s,scale:n}=this;if(!(n&&e&&t&&ol(al(this),n)&&null!=s))return this.rangeGroup.visible=!1,this.lineGroup.visible=!1,void(this.labelGroup.visible=!1);this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateNodes();const a="range"===i;a!==this._isRange&&(a?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=a}calculateLayout(t,e){if(this.data=void 0,!t)return;const{type:i,range:s,value:n,scale:a,clippedRange:o,strokeWidth:r=0}=this;if(!a)return;const l=a.bandwidth??0,h=a.step??0,c=(e?-1:1)*(a instanceof eo?(h-l)/2:0);let d,u,p,g;if("line"===i){const t=l/2;d=a.convert(n)+t,u=NaN,p=a.convert(n,{clamp:!0})+t,g=NaN}else{if(!s)return;{const[t,e]=s,i=t?.valueOf()===e?.valueOf()&&tl.is(a)?l/2+c:0;d=a.convert(t)+i,u=a.convert(e)+l,p=a.convert(t,{clamp:!0})+i-c,g=a.convert(e,{clamp:!0})+l+c}}p=aa(p,o),g=aa(g,o);const m=(d===p||u===g||p!==g)&&Math.abs(g-p)>0;m&&p>g&&([p,g]=[g,p],[d,u]=[u,d]),d-c>=p&&(d-=c),u+c<=g&&(u+=c),this.startLine=r>0&&d>=p&&d<=p+c,this.endLine=r>0&&u>=g-l-c&&u<=g,("range"!==i||m||this.startLine||this.endLine)&&(this.data=[p,g],!1!==this.label.enabled&&this.label.text)}updateNodes(){const{position:t,data:[e,i]=[0,0],gridLength:s}=this,n=Number.isFinite(i)?i-e:0;let a;switch(t){case"top":case"bottom":a=new y(e,"top"===t?0:-s,n,s);break;case"left":case"right":a=new y("left"===t?0:-s,e,s,n)}this.updateRangeNode(a);const{label:o}=this;!1!==o.enabled&&o.text&&(this.updateLabel(),this.positionLabel(a))}updateRangeNode(t){const{type:e,position:i,crossLineRange:s,startLine:n,endLine:a,fill:o,fillOpacity:r,stroke:l,strokeWidth:h,strokeOpacity:c,lineDash:d}=this;s.x1=t.x,s.x2=t.x+t.width,s.y1=t.y,s.y2=t.y+t.height,s.horizontal="top"===i||"bottom"===i,s.startLine=n,s.endLine=a,s.fill="range"===e?o:void 0,s.fillOpacity=r??1,s.stroke=l,s.strokeWidth=h??1,s.strokeOpacity=c??1,s.lineDash=d}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)}get anchor(){const t="left"===this.position||"right"===this.position,e="range"===this.type,{position:i=this.defaultLabelPosition}=this.label;return e?(t?hl:cl)[i]:(t?rl:ll)[i]}positionLabel(t){const{crossLineLabel:e,label:i,anchor:s}=this;e.rotation=ot(i.rotation??0),e.textBaseline="middle",e.textAlign="center";const n=e.getBBox();if(!n)return;const{width:a,height:o}=n,r=i.padding+a/2,l=i.padding+o/2,h=t.x+t.width*(s.rangeH+1)/2-r*s.labelH,c=t.y+t.height*(s.rangeV+1)/2-l*s.labelV;e.x=h,e.y=c,e.rotationCenterX=h,e.rotationCenterY=c}computeLabelSize(){const{label:t}=this;if(!1===t.enabled||!t.text)return;const e=new Pi;e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text,e.rotation=ot(t.rotation??0),e.textBaseline="middle",e.textAlign="center";const i=e.getBBox();if(!i)return;const{width:s,height:n}=i;return{width:s,height:n}}calculatePadding(t){const{label:e,anchor:i}=this,s=this.computeLabelSize();if(!s)return;const{width:n,height:a}=s,o=e.padding+n,r=e.padding+a,l="left"===this.position||"right"===this.position;l&&(-1===i.rangeH&&1===i.labelH?t.left=Math.max(t.left??0,o):1===i.rangeH&&-1===i.labelH&&(t.right=Math.max(t.right??0,o))),l||(-1===i.rangeV&&1===i.labelV?t.top=Math.max(t.top??0,r):1===i.rangeV&&-1===i.labelV&&(t.bottom=Math.max(t.bottom??0,r)))}};ul.className="CrossLine",r([Ct],ul.prototype,"enabled",2),r([Ct],ul.prototype,"type",2),r([Ct],ul.prototype,"range",2),r([Ct],ul.prototype,"value",2),r([Ct],ul.prototype,"defaultColorRange",2),r([Ct],ul.prototype,"fill",2),r([Ct],ul.prototype,"fillOpacity",2),r([Ct],ul.prototype,"stroke",2),r([Ct],ul.prototype,"strokeWidth",2),r([Ct],ul.prototype,"strokeOpacity",2),r([Ct],ul.prototype,"lineDash",2),r([Ct],ul.prototype,"label",2);var pl=class extends Lt{constructor(){super(...arguments),this.enabled=!0}getFont(){return Ti.toFontString(this)}};function gl(t,e,i,s,n){const a=e>0&&e<=Math.PI,o=i>0&&i<=Math.PI;if(t){if(!e&&!i)return"center";if(s*(a||o?-1:1)==-1)return"end"}else if(s*n===-1)return"end";return"start"}function ml(t,e){if(null!=t)return"string"==typeof t?t:(0,s.Qd)(t)&&null!=e?t[Dr(e)]:void 0}r([Ct],pl.prototype,"enabled",2),r([Ct],pl.prototype,"color",2),r([Ct],pl.prototype,"fontStyle",2),r([Ct],pl.prototype,"fontWeight",2),r([Ct],pl.prototype,"fontSize",2),r([Ct],pl.prototype,"fontFamily",2),r([Ct],pl.prototype,"formatter",2);var yl=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};r([Ct],yl.prototype,"enabled",2),r([Ct],yl.prototype,"width",2),r([Ct],yl.prototype,"style",2);var fl=class extends Lt{};r([Ct],fl.prototype,"step",2),r([Ct],fl.prototype,"values",2),r([Ct],fl.prototype,"minSpacing",2),r([Ct],fl.prototype,"maxSpacing",2);var xl=class extends Lt{constructor(){super(...arguments),this.enabled=!0,this.spacing=5,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}getFont(){return Ti.toFontString(this)}};r([Ct],xl.prototype,"enabled",2),r([Ct],xl.prototype,"fontStyle",2),r([Ct],xl.prototype,"fontWeight",2),r([Ct],xl.prototype,"fontSize",2),r([Ct],xl.prototype,"fontFamily",2),r([Ct],xl.prototype,"spacing",2),r([Ct],xl.prototype,"minSpacing",2),r([Ct],xl.prototype,"color",2),r([Ct],xl.prototype,"rotation",2),r([Ct],xl.prototype,"avoidCollisions",2),r([Ct],xl.prototype,"mirrored",2),r([Ct],xl.prototype,"parallel",2),r([Ct],xl.prototype,"itemStyler",2),r([Ct],xl.prototype,"formatter",2),r([Ct],xl.prototype,"format",2);var bl=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};r([Ct],bl.prototype,"enabled",2),r([Ct],bl.prototype,"width",2),r([Ct],bl.prototype,"stroke",2);var vl=class extends Lt{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};r([Ct],vl.prototype,"enabled",2),r([Ct],vl.prototype,"width",2),r([Ct],vl.prototype,"size",2),r([Ct],vl.prototype,"stroke",2);var Sl=class extends Lt{constructor(){super(...arguments),this.caption=new Fi,this.enabled=!1,this.spacing=Fi.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};r([Ct],Sl.prototype,"enabled",2),r([Ct],Sl.prototype,"text",2),r([Ct],Sl.prototype,"spacing",2),r([Ct],Sl.prototype,"fontStyle",2),r([Ct],Sl.prototype,"fontWeight",2),r([Ct],Sl.prototype,"fontSize",2),r([Ct],Sl.prototype,"fontFamily",2),r([Ct],Sl.prototype,"color",2),r([Ct],Sl.prototype,"wrapping",2),r([Ct],Sl.prototype,"formatter",2);var Ml=(t=>(t[t.TickAndDomain=0]="TickAndDomain",t[t.TicksOnly=1]="TicksOnly",t[t.Off=2]="Off",t))(Ml||{});function kl(t){const[e,i]=oa(t.range),s=Math.floor(e),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var Dl=2*Math.PI,wl=Dl/2;function Il(t){const{min:e,max:i}=t,s=t=>t<e||t>i,n={fromFn(t,e,i){let{x1:n,x2:a,y1:o,y2:r}=t,l=t.opacity;return("added"===i||s(e.offset))&&(({x1:n,x2:a,y1:o,y2:r}=e),l=0),{x1:n,x2:a,y1:o,y2:r,opacity:l,phase:or[i]}},toFn(t,e,i){const{x1:s,x2:n,y1:a,y2:o}=e;let r=1;return"removed"===i&&(r=0),{x1:s,x2:n,y1:a,y2:o,opacity:r}},applyFn(t,e){t.setProperties(e),t.visible=!s(t.y)}},a={fromFn(t,e,i){const n=t.previousDatum??e;let{x:a,y:o,rotationCenterX:r,rotationCenterY:l,rotation:h}=n,c=t.opacity;return"removed"===i||s(n.y)?h=e.rotation:("added"===i||s(t.datum.y))&&(({x:a,y:o,rotationCenterX:r,rotationCenterY:l,rotation:h}=e),c=0),{x:a,y:o,rotationCenterX:r,rotationCenterY:l,rotation:h,opacity:c,phase:or[i]}},toFn(t,e,i){const{x:s,y:n,rotationCenterX:a,rotationCenterY:o}=e;let r=0,l=1;var h,c;return"added"===i?r=e.rotation:"removed"===i?(l=0,r=e.rotation):(h=t.previousDatum?.rotation??e.rotation,c=e.rotation,r=Math.abs(c-h)<wl?c:h>c?c+Dl:c-Dl),{x:s,y:n,rotationCenterX:a,rotationCenterY:o,rotation:r,opacity:l,finish:{rotation:e.rotation}}}};return{tick:n,line:{fromFn(t,e){const{x1:i,x2:s,y1:n,y2:a}=t.previousDatum??e;return{x1:i,x2:s,y1:n,y2:a,phase:or.updated}},toFn(t,e){const{x1:i,x2:s,y1:n,y2:a}=e;return{x1:i,x2:s,y1:n,y2:a}}},label:a,group:{fromFn(t,e){const{translationX:i,translationY:s}=t;return{translationX:i,translationY:s,phase:or.updated}},toFn(t,e){const{translationX:i,translationY:s}=e;return{translationX:i,translationY:s}}}}}function Cl(){return(t,e)=>({translationX:e.translationX,translationY:e.translationY})}function Ll(){return(t,e)=>({x:e.x,y:e.y,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,rotation:e.rotation})}function Al(){return(t,e)=>{const{x1:i,x2:s,y1:n,y2:a}=e;return{x1:i,x2:s,y1:n,y2:a}}}var Tl={millisecond:"%Y %b %e %H:%M:%S.%L",second:"%Y %b %e %H:%M:%S",minute:"%Y %b %e %H:%M",hour:"%Y %b %e %H:%M",day:"%Y %b %e",month:"%Y %b",year:"%Y"},Nl={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},Ol=/%[-_0]?L/,Rl=/%[-_0]?S/,El=/%[-_0]?M/,Pl=/%[-_0]?[HI]/,Bl=/^%[-_0]?[de]$/,Fl=/^%[-_0]?[Bbm]$/,zl=/^%[-_0]?[Yy]$/,Gl=class extends(ve(pr)){},_l=(t=>(t[t.TickLines=0]="TickLines",t[t.AxisLine=1]="AxisLine",t[t.TickLabels=2]="TickLabels",t))(_l||{}),jl=class t{constructor(e,i){this.moduleCtx=e,this.scale=i,this.id=(0,s.sX)(this),this.nice=!0,this.reverse=!1,this.keys=[],this.interval=new fl,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 Ie({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new Te({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new Te({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new Ie({name:`${this.id}-Labels`,zIndex:9}),this.gridGroup=new Ae({name:`${this.id}-Axis-grid`,zIndex:1}),this.gridLineGroup=this.gridGroup.appendChild(new Ie({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new Te({name:`${this.id}-CrossLines-Range`,zIndex:4}),this.crossLineLineGroup=new Te({name:`${this.id}-CrossLines-Line`,zIndex:8}),this.crossLineLabelGroup=new Te({name:`${this.id}-CrossLines-Label`,zIndex:13}),this.tickLabelGroupSelection=ur.select(this.tickLabelGroup,Pi,!1),this._crossLines=[],this.line=new bl,this.tick=new vl,this.gridLine=new yl,this.label=this.createLabel(),this.defaultTickMinSpacing=t.defaultTickMinSpacing,this.translation={x:0,y: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 Sl,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.animatable=!0,this._cachedUnzoomedInputDomain=void 0,this._cachedUnzoomedRangeExtent=NaN,this._cachedUnzoomedTickCount=0,this.moduleMap=new Mr,this.range=this.scale.range.slice(),this.crossLines.forEach(t=>this.initCrossLine(t))}get type(){return this.constructor.type??""}get labelNodes(){return this.tickLabelGroupSelection.nodes()}set crossLines(t){const{CrossLineConstructor:e}=this.constructor;this._crossLines.forEach(t=>this.detachCrossLine(t)),this._crossLines=t.map(t=>{const i=new e;return i.set(t),i}),this._crossLines.forEach(t=>{this.attachCrossLine(t),this.initCrossLine(t)})}get crossLines(){return this._crossLines}resetAnimation(t){}attachCrossLine(t){this.crossLineRangeGroup.appendChild(t.rangeGroup),this.crossLineLineGroup.appendChild(t.lineGroup),this.crossLineLabelGroup.appendChild(t.labelGroup)}detachCrossLine(t){this.crossLineRangeGroup.removeChild(t.rangeGroup),this.crossLineLineGroup.removeChild(t.lineGroup),this.crossLineLabelGroup.removeChild(t.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(t=>t())}updateScale(){const{range:t,visibleRange:e,scale:i}=this,s=(t[1]-t[0])/(e[1]-e[0]),n=s*e[0],a=t[0]-n;i.range=[a,a+s],this.crossLines.forEach(e=>{e.clippedRange=[t[0],t[1]]})}setCrossLinesVisible(t){this.crossLineRangeGroup.visible=t,this.crossLineLineGroup.visible=t,this.crossLineLabelGroup.visible=t}attachAxis(t){t.gridNode.appendChild(this.gridGroup),t.axisNode.appendChild(this.axisGroup),t.labelNode.appendChild(this.labelGroup),t.crossLineRangeNode.appendChild(this.crossLineRangeGroup),t.crossLineLineNode.appendChild(this.crossLineLineGroup),t.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(t){t.gridNode.removeChild(this.gridGroup),t.axisNode.removeChild(this.axisGroup),t.labelNode.removeChild(this.labelGroup),t.crossLineRangeNode.removeChild(this.crossLineRangeGroup),t.crossLineLineNode.removeChild(this.crossLineLineGroup),t.crossLineLabelNode.removeChild(this.crossLineLabelGroup)}attachLabel(t){this.labelGroup.append(t)}inRange(t,e=0){const[i,s]=oa(this.range);return t>=i-e&&t<=s+e}getRangeOverflow(t){const{range:e,visibleRange:i}=this,s=(e[1]-e[0])/(i[1]-i[0]),[n,a]=oa([e[0]-s*i[0],e[0]-s*i[0]+s]);return t<n?t-n:t>a?t-a:0}defaultDatumFormatter(t,e){return Fs(t,e+1)}defaultLabelFormatter(t,e){return Fs(t,e)}onGridLengthChange(t,e){e^t&&this.onGridVisibilityChange(),this.crossLines.forEach(t=>this.initCrossLine(t))}onGridVisibilityChange(){}createLabel(){return new xl}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.updateCrossLines()}getLabelStyles(t,e,i=this.label){const s={color:i.color,spacing:i.spacing,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight};let n;i.itemStyler&&(n=this.callWithContext(i.itemStyler,{...t,...s}));const{color:a,fontFamily:o,fontSize:r,fontStyle:l,fontWeight:h,spacing:c}=E(n,e,s);return{fill:a,fontFamily:o,fontSize:r,fontStyle:l,fontWeight:h,spacing:c}}getTickSize(t=this.tick){return t.enabled?t.size:0}processData(){const{includeInvisibleDomains:t,boundSeries:e,direction:i}=this,s=(t?e:e.filter(t=>t.isEnabled())).map(t=>t.getDomain(i));this.setDomains(...s)}setDomains(...t){let e,i;t.length>0?({domain:e,animatable:i}=this.scale.normalizeDomains(...t)):(e=[],i=!0),this.dataDomain=this.normaliseDataDomain(e),this.reverse&&this.dataDomain.domain.reverse(),this.animatable=i}calculateLayout(t,e){const{scale:i,label:n,visibleRange:a,nice:o}=this;this.chartPadding=e,this.updateScale();const r=ra(this.range),l=this.dataDomain.domain;let h,c,d;if(0===a[0]&&1===a[1])h=void 0,c=void 0;else if(this._cachedUnzoomedInputDomain===l&&this._cachedUnzoomedRangeExtent===r)h=this.scale.domain,c=this._cachedUnzoomedTickCount;else{const t=this.calculateTickLayout(l,o?0:2,[0,1]);h=t.niceDomain,c=t.rawTickCount??0}d=o?null==h?0:1:2;const{niceDomain:u,ticks:p,rawTickCount:g=0,tickDomain:m,fractionDigits:y,bbox:f}=this.calculateTickLayout(h??l,d,a,t);c??(c=g);const x=0!==g&&0!==c?{zoomed:g,unzoomed:c}:void 0,b=Tr.is(i)?i.interval:void 0;this.scale.domain=u,this._cachedUnzoomedInputDomain=l,this._cachedUnzoomedRangeExtent=r,this._cachedUnzoomedTickCount=c;const v=ml(null==b?n.format:function(t,e){if(!(0,s.Qd)(t))return t;const i=Dr(e),{millisecond:n,second:a,minute:o,hour:r,day:l,month:h,year:c}=t,d=Nl[i],u=Tl[i];if(d>=Nl.year&&!zl.test(c)||d>=Nl.month&&!Fl.test(h)||d>=Nl.day&&!Bl.test(l))return u;let p;switch(i){case"year":return c;case"month":return`${h} ${c}`;case"day":return`${h} ${l} ${c}`;case"hour":p=r;break;case"minute":p=o;break;case"second":p=a;break;case"millisecond":p=n;break;default:return u}return d>=Nl.hour&&!Pl.test(p)||d>=Nl.minute&&!El.test(p)||d>=Nl.second&&!Rl.test(p)||d>=Nl.millisecond&&!Ol.test(p)?u:`${p} ${h} ${l} ${c}`}(n.format,b),b);return this.labelFormatter=i.tickFormatter({domain:m,specifier:v,ticks:p,fractionDigits:y})??(t=>this.defaultLabelFormatter(t,y)),this.datumFormatter=i.datumFormatter({domain:m,specifier:v,ticks:p,fractionDigits:y})??(t=>this.defaultDatumFormatter(t,y)),this.scaleFormatterParams={domain:m,ticks:p,fractionDigits:y},this.layout.label={fractionDigits:y,spacing:this.label.spacing,format:this.label.format},this.layoutCrossLines(),{primaryTickCount:x,bbox:f}}updateCrossLines(){const t=this.isAnySeriesActive();this.crossLines.forEach(e=>{e.update(t)})}updatePosition(){const{crossLineRangeGroup:t,crossLineLineGroup:e,crossLineLabelGroup:i,gridGroup:s,translation:n}=this,a=Math.floor(n.x),o=Math.floor(n.y);s.setProperties({translationX:a,translationY:o}),t.setProperties({translationX:a,translationY:o}),e.setProperties({translationX:a,translationY:o}),i.setProperties({translationX:a,translationY:o})}formatTick(t,e,i,s,n,a){const{labelFormatter:o,label:{formatter:r}}=this;let l;if(r){const a=this.getFormatterBoundSeries(),o=n?Dr(n):void 0,h=n?kr(n).step:void 0;l=this.callWithContext(r,{value:t,index:e,domain:i,fractionDigits:s,unit:o,step:h,boundSeries:a})}else a?l=a(t):o&&(l=o(t));return String(l??t)}formatDatum(t){const{label:{formatter:e},datumFormatter:i=this.labelFormatter}=this;let n;if(e){const{domain:i}=this.scale,s=this.getFormatterBoundSeries();n=this.callWithContext(e,{value:t,index:NaN,domain:i,boundSeries:s})}else i?n=this.callWithContext(i,t):(0,s.cy)(t)&&(n=t.filter(Boolean).join(" - "));return String(n??t)}getScaleValueFormatter(t){const{scaleFormatterParams:e}=this;let i;try{null!=t&&null!=e&&(i=this.scale.tickFormatter({...e,specifier:t}))}catch{s.Vy.warnOnce(`the format string ${t} is invalid, ignoring.`)}return i??(i=t=>this.formatDatum(t)),i}getBBox(){return this.axisGroup.getBBox()}initCrossLine(t){t.scale=this.scale,t.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(t=>this.includeInvisibleDomains||t.isEnabled())}clipTickLines(t,e,i,s){this.tickLineGroup.setClipRect(new y(t,e,i,s))}clipGrid(t,e,i,s){this.gridGroup.setClipRect(new y(t,e,i,s))}getFormatterBoundSeries(){const{direction:t}=this,e=[];for(const i of this.boundSeries){const s=i.getKeys(t),n=i.getNames(t);for(let t=0;t<s.length;t++)e.push({key:s[t],name:n[t]})}return e}getTitleFormatterParams(t){const{direction:e}=this;return{domain:t,direction:e,boundSeries:this.getFormatterBoundSeries(),defaultValue:this.title?.text}}normaliseDataDomain(t){return{domain:[...t],clipped:!1}}getLayoutState(){return{id:this.id,rect:this.getBBox(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale,...this.layout}}getModuleMap(){return this.moduleMap}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),{...this.moduleCtx,parent:this.axisContext}}createAxisContext(){const{scale:t}=this;return{axisId:this.id,scale:this.scale,direction:this.direction,continuous:ha.is(t)||io.is(t),getCanvasBounds:()=>Me.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((t,e)=>(e.getKeyProperties(this.direction).forEach(e=>t.add(e)),t),new Set),seriesIds:()=>this.boundSeries.map(t=>t.id),scaleValueFormatter:t=>this.getScaleValueFormatter(t),scaleInvert:e=>t.invert(e,!0),scaleInvertNearest:e=>t.invert(e,!0),attachLabel:t=>this.attachLabel(t),inRange:(t,e)=>this.inRange(t,e),getRangeOverflow:t=>this.getRangeOverflow(t)}}isReversed(){return this.reverse}callWithContext(t,...e){const{callbackCache:i,chartService:s}=this.moduleCtx;return i.call(this,s,t,...e)}};jl.defaultTickMinSpacing=50,jl.CrossLineConstructor=ul,r([Ct],jl.prototype,"nice",2),r([Ct],jl.prototype,"reverse",2),r([Ct],jl.prototype,"keys",2),r([Ct],jl.prototype,"interval",2),r([Ct],jl.prototype,"title",2),r([hi((t,e,i)=>t.onGridLengthChange(e,i))],jl.prototype,"gridLength",2);var Wl=jl;function Vl(){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 Kl=class{constructor(t){this.axis=t}estimateTickCount(t,e,i){const{scale:s,range:n,defaultTickMinSpacing:a}=this.axis,o=Tr.is(s)?Tr.defaultTickCount:ha.defaultTickCount;return Xr(ra(n),ra(t),e,i,o,a)}filterTicks(t,e){const{minSpacing:i,maxSpacing:s}=this.axis.interval,n=null!=i||null!=s?Math.ceil(t.length/e):2,a=t.length%n?-1:0;return t.filter((t,e)=>(e+a)%n===0)}generateTicks({domain:t,primaryTickCount:e,visibleRange:i,niceMode:s,parallelFlipRotation:n,regularFlipRotation:a,labelX:o,sideFlag:r,removeOverflowLabels:l,removeOverflowThreshold:h=0}){const{scale:c,label:d,primaryLabel:u,interval:{minSpacing:p,maxSpacing:g}}=this.axis,{parallel:m,fontFamily:f,fontSize:x,fontStyle:b,fontWeight:v}=d,S=void 0!==e,{defaultRotation:M,configuredRotation:k,parallelFlipFlag:D,regularFlipFlag:w}=function(t,e,i=0,s=0){const n=dt(t),a=!n&&s>=0&&s<=Math.PI?-1:1,o=!n&&i>=0&&i<=Math.PI?-1:1;let r=0;return e?r=a*Math.PI/2:-1===o&&(r=Math.PI),{configuredRotation:n,defaultRotation:r,parallelFlipFlag:a,regularFlipFlag:o}}(d.rotation,m,a,n),{maxTickCount:I}=this.estimateTickCount(i,p,g),C=!ha.is(c)&&!io.is(c)||isNaN(I)?10:I;let L=gl(m,k,0,r,w);const A=function(t,e,i,s,n){return t&&!e?i*s===-1?n?"hanging":"top":"bottom":"middle"}(m,k,r,D,null==u),T=Ti.toFontString({fontFamily:f,fontSize:x,fontStyle:b,fontWeight:v}),N=Li.getMeasurer({font:T}),O={fontFamily:f,fontSize:x,fontStyle:b,fontWeight:v,textBaseline:A,textAlign:L},R=d.enabled&&d.avoidCollisions,E=k+M,P=new pe,B=t=>{const e=E+t;pe.updateTransformMatrix(P,1,1,e,0,0)},F=({ticks:t},e)=>(B(e),function(t,e,i,s){const n=[];for(const{tickLabel:a,translationY:o}of t){if(!a)continue;const{x:t,y:r}=i.transformBBox(new y(e,o,0,0)),{width:l,height:h}=s.measureLines(a);n.push({point:{x:t,y:r},label:{text:a,width:l,height:h}})}return n}(t,o,P,N)),z=(e,i)=>{if(!R)return!1;const s=0!==k||0!==i,n=function(t,e){return null!=t?t:e?0:10}(d.minSpacing,s);return vo(((e,i)=>{const{niceDomain:s,ticks:n,rawTicks:a,timeInterval:r}=e;if(null==r)return[];B(i);const l=function(t){if(t.length<2)return 1/0;let e=0,i=t[0].translationY;for(let s=1;s<t.length;s++){const n=t[s].translationY,a=Math.abs(n-i);e=Math.max(e,a),i=n}return e}(n),{width:h,height:p}=function(t,e,i,s,n,a,o){const r={domain:s,ticks:n,fractionDigits:0,specifier:ml(e.format,a)??("string"==typeof e.format?e.format:void 0)},l=t.tickFormatter(r),h=a?wr(a):void 0,c=ml(i?.format,h),d=c?t.tickFormatter({...r,specifier:c}):l,u=new Date(s[0]),p=new Date(s[s.length-1]),g=h?.range(new Date(s[0]),new Date(s[s.length-1]),{extend:!0});let m=0,y=0;if(null!=l){let t,e;null!=g&&g.length>1?(t=g[0],e=g[1]):(t=u,e=p);const i=Cr(a,t,e,{limit:50});for(const t of i){const e=l(t),{width:i,height:s}=o.measureLines(e);m=Math.max(m,i),y=Math.max(y,s)}}if(null!=d&&null!=g)for(const t of g){const e=d(t),{width:i,height:s}=o.measureLines(e);m=Math.max(m,i),y=Math.max(y,s)}return{width:Math.ceil(m),height:Math.ceil(y)}}(c,d,u,s??t,a,r,N);return function({width:t,height:e,spacing:i},s,n){const a=[];for(const o of[0,i]){const{x:i,y:r}=n.transformBBox(new y(s,o,0,0));a.push({point:{x:i,y:r},label:{text:void 0,width:t,height:e}})}return a}({width:h,height:p,spacing:l},o,P)})(e,i),n)||vo(F(e,i),n)};let G={tickDomain:[],ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0,niceDomain:void 0},_=0,j=0,W=!0,V=!1;for(;!V&&W&&_<=C;){j=0;for(const n of this.getTickStrategies({domain:t,niceMode:s,secondaryAxis:S,index:_}))({tickData:G,index:_,autoRotation:j,terminate:V}=n({index:_,tickData:G,textProps:O,terminate:V,primaryTickCount:e,visibleRange:i,labelsOverlap:()=>z(G,j)}));W=z(G,j)}L=gl(m,k,j,r,w);const K=k+j;if(l&&G.ticks.length>2){const t=F(G,j),e=G.ticks.at(-1),s=t.at(-1);if(null!=e&&null!=s&&e.translationY+s.label.width/2>this.axis.range[1]+h){e.tickLabel=void 0;const t=G.ticks[0];0===t.translationY&&0===i[0]&&1===i[1]&&(t.tickLabel=void 0)}}return{tickData:G,rotation:K,textBaseline:A,textAlign:L}}getTickStrategies({domain:t,niceMode:e,index:i,secondaryAxis:s}){const{scale:n,label:a,interval:o}=this.axis,{minSpacing:r}=o,l=ha.is(n)||io.is(n),h=a.enabled&&a.avoidCollisions,c=!l&&0!==i&&h,d=!0===a.autoRotate&&void 0===a.rotation,u=[];let p;if(p=o.values?3:s?1:c?2:0,u.push(({index:i,tickData:s,primaryTickCount:n,visibleRange:a,terminate:o})=>this.createTickData(t,e,a,n,p,i,s,o)),!l&&null!=r){const i=({index:i,tickData:s,primaryTickCount:n,visibleRange:a,terminate:o})=>this.createTickData(t,e,a,n,2,i,s,o);u.push(i)}if(h&&d){const t=({index:t,tickData:e,labelsOverlap:i,terminate:s})=>({index:t,tickData:e,autoRotation:i()?dt(a.autoRotateAngle):0,terminate:s});u.push(t)}return u}ticksEqual(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i+=1)if(t[i]?.valueOf()!==e[i]?.valueOf())return!1;return!0}createTickData(t,e,i,s,n,a,o,r){const{scale:l,interval:h}=this.axis,{step:c,values:d,minSpacing:u,maxSpacing:p}=h,{maxTickCount:g,minTickCount:m,tickCount:y}=this.estimateTickCount(i,u,p),f=ha.is(l)||io.is(l),x=!f||isNaN(g)?10:g,b=t=>f?Math.max(y-t,m):g,v=o.rawTicks,S=null==c&&null==d&&b(a)>m&&(f||2===n),M={domain:t,niceMode:e,visibleRange:i,primaryTickCount:s,tickGenerationType:n,previousTicks:v,minTickCount:m,maxTickCount:g,tickCount:0};if(M.tickCount=b(a),o=this.getTicks(M),S&&this.ticksEqual(o.rawTicks,v)){let t=a,e=x;for(;t<=e;)a=(t+e)/2|0,M.tickCount=b(a),o=this.getTicks(M),this.ticksEqual(o.rawTicks,v)?t=a+1:e=a-1}return r||(r=null!=c||null!=d),{tickData:o,index:a+=1,autoRotation:0,terminate:r}}getTimeIntervalTicks(t,e,i){const n=wr(i);if(null==n)return;const{scale:a,reverse:o}=this.axis;if(!Zr.is(a)&&!io.is(a))return;o&&(t=[1-t[1],1-t[0]]);const r=Math.min(a.domain[0].valueOf(),a.domain[a.domain.length-1].valueOf()),l=Math.max(a.domain[0].valueOf(),a.domain[a.domain.length-1].valueOf());let[h,c]=ba.extent(new Date(r),new Date(l),t);h=n.floor(h),h.valueOf()>=r&&(h=n.previous(h)),c=n.ceil(c),c.valueOf()<=l&&(c=n.next(c));const d=n.range(h,c),u=Ir(i),p=Tr.is(a)&&null!=a.interval&&Ir(a.interval)<u;let g,m=new Set;if(Zr.is(a)||Tr.is(a)){g=[];const t={...e,interval:i},n=!Tr.is(a)||p;for(let e=0;e<d.length-1;e+=1){const i=d[e],o=d[e+1],h=e===d.length-2,c=o.valueOf()-i.valueOf(),p=[Math.max((r-i.valueOf())/c,0),Math.min((l-i.valueOf())/c,1)],y=n?this.timeScaleTicks(t,[i,o],p,!0):a.ticks(t,[i,o],p,!0)?.ticks??[];if((0,s.nm)(y,t=>t.valueOf()<i.valueOf()),h||(0,s.xA)(y,t=>n?t.valueOf()+u>o.valueOf():t.valueOf()>=o.valueOf()),0===y.length)continue;const f=Nr(y[0],i);(n?0===f:f<=u)&&m.add(g.length),g.push(...y)}}else if(tl.is(a)){g=a.ticks(e,void 0,t,!0)?.ticks??[];let i=0;for(let t=0;t<g.length;t++){const e=g[t];let s=!1;for(;i<d.length&&Nr(d[i],e)<=0;)s=!0,i++;s&&m.add(t)}}else g=[];return(0===m.size||1===m.size&&m.has(0))&&(m=void 0),{ticks:g,tickCount:void 0,primaryTicksIndices:m,interpolate:p}}timeScaleTicks(t,e,i,s){const{interval:n}=t;if(null==n)return e;const a=e[0].valueOf(),o=e[1].valueOf();if("number"!=typeof n)return kr(n).every(1,{snapTo:e[0]}).range(e[0],e[1],{visibleRange:i,extend:s});const r=[];for(let t=a;t<=o;t+=n){const e=new Date(t);r.push(e)}return r}getTicks({domain:t,niceMode:e,visibleRange:i,tickGenerationType:n,previousTicks:a,tickCount:o,minTickCount:r,maxTickCount:l,primaryTickCount:h}){const{axis:c}=this,{label:d,primaryLabel:u,range:p,scale:g,interval:m}=c,y=Vl(),f={nice:0===e,interval:m.step,tickCount:o,minTickCount:r,maxTickCount:l},x={...f,nice:0===e||1===e};let b;1===n&&null!=h&&ha.is(g)&&(b=function(t,e,i,n,a){let[o,r]=oa(e.map(Number));const l=Math.floor(i.unzoomed);if(l<=1){const[e,i]=function(t,e){let i=t,s=e,n=0;do{[i,s]=Ur(i,s);const{ticks:t}=Gr(i,s,5);if(t.length%2==1)return[i,s];i-=1,s+=1}while(n++<10);return[t,e]}(o,r),s=5*Math.pow(2,-Math.ceil(Math.log2(a[1]-a[0]))),{ticks:l}=Gr(e,i,s,void 0,void 0,a),h=[t.toDomain(e),t.toDomain(i)];return n&&h.reverse(),{domain:h,ticks:l}}if(o===r){const t=Math.floor(Math.log10(o)),e=Math.pow(10,t),i=Math.min(e,1),s=l-1;o-=i*Math.floor(s/2),r=o+i*s}let h=o,c=r;h=function(t,e,i){t=Math.floor(t);const s=Math.abs(e-t)/(i-1),n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return Math.floor(t/a)*a}(h,c,l);const d=function(t,e,i){return function(t){const e=Math.floor(Math.log10(t)),i=Math.pow(10,e),s=t/i;return s>0&&s<=1?i:s>1&&s<=2?2*i:s>2&&s<=5?5*i:s>5&&s<=10?10*i:t}((e-t)/(i-1))}(h,c,l);c=h+(l-1)*d;const u=Math.floor(h/d)*d,p=Math.floor(c/d)*d;u<=o&&p>=r&&(h=u,c=p);const g=[t.toDomain(h),t.toDomain(c)];n&&g.reverse();const m=function(t,e,i){const n=(0,s.o3)(e),a=Math.pow(10,n),o=[];for(let s=0;s<i;s++){const i=t+e*s;o.push(Math.round(i*a)/a)}return o}(h,d*((i.unzoomed-1)/(i.zoomed-1)),Math.floor(i.zoomed));return{domain:g,ticks:m}}(g,t,h,c.reverse,i));const v=0===e?b?.domain??g.niceDomain(f,t):t;let S,M,k,D,w=v,I=!1;const C=g.domain;switch(g.domain=v,n){case 3:if(w=m.values,S=m.values,M=S.length,I=Tr.is(g),ha.is(g)){const[t,e]=oa(v.map(Number));S=S.filter(i=>Number(i)>=t&&Number(i)<=e).sort((t,e)=>Number(t)-Number(e))}break;case 1:if(b)S=b.ticks,M=b.ticks.length;else{const t=g.ticks(x,v,i);S=t?.ticks??[],M=t?.count}break;case 2:S=this.filterTicks(a,o),M=void 0;break;default:{if(v.length>0&&null==x.interval&&(Tr.is(g)||null!=u&&(Zr.is(g)||tl.is(g)))){const t=v;k=Wr(Math.min(t[0].valueOf(),t[t.length-1].valueOf()),Math.max(t[0].valueOf(),t[t.length-1].valueOf()),o,r,l,{weekStart:null==u?Na:void 0,primaryOnly:Tr.is(g)})}const t=Tr.is(g)?g.interval:void 0;null!=t&&null!=k&&Ir(t)>Ir(k)&&(k=t);const e=k?this.getTimeIntervalTicks(i,x,k):void 0;if(e)({ticks:S,tickCount:M,primaryTicksIndices:D,interpolate:I}=e);else{const t=Tr.is(g)&&null!=k?{...x,interval:x.interval??k}:x,e=g.ticks(t,v,i);S=e?.ticks??[],M=e?.count}}}const L=S.reduce((t,e)=>Math.max(t,"number"==typeof e?(0,s.o3)(e):0),0),A={domain:w,ticks:S,fractionDigits:L,specifier:ml(d.format,k)??("string"==typeof d.format?d.format:void 0)},T=g.tickFormatter(A),N=ml(u?.format,k?wr(k):void 0),O=N?g.tickFormatter({...A,specifier:N}):T,R=(g.bandwidth??0)/2,E=[];for(let t=0;t<S.length;t++){const e=S[t],i=g.convert(e,{interpolate:I})+R,s=D?.has(t)??!1;if(p.length>0&&!c.inRange(i,.001))continue;const n=s&&!0===u?.enabled?O:T,a=d.enabled?c.formatTick(e,t,v,L,k,n):"";E.push({tick:e,tickId:y(a),tickLabel:a,translationY:Math.floor(i),primary:s})}return g.domain=C,{tickDomain:w,rawTicks:S,rawTickCount:M,fractionDigits:L,timeInterval:k,ticks:E,niceDomain:v}}},Yl=class extends xl{constructor(){super(...arguments),this.autoRotateAngle=335}};r([Ct],Yl.prototype,"autoRotate",2),r([Ct],Yl.prototype,"autoRotateAngle",2);var $l=class t extends Wl{constructor(t,e){let i;super(t,e),this.headingLabelGroup=this.axisGroup.appendChild(new Ae({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new Ae({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new pr({zIndex:1})),this.tickLineGroupSelection=ur.select(this.tickLineGroup,pr,!1),this.gridLineGroupSelection=ur.select(this.gridLineGroup,pr,!1),this.tempText=new Pi({debugDirty:!1}),this.tempCaption=new Fi,this.tickGenerator=new Kl(this),this.generatedTicks=void 0,this.animationManager=t.animationManager,this.animationState=new vr("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:t=>this.animateReadyUpdate(t),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.title.caption.node),this.destroyFns.push(t.layoutManager.addListener("layout:complete",t=>{const e=[t.chart.width,t.chart.height];null==i||(0,s.r1)(e,i)||this.animationState.transition("resize"),i=e}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(e){return e instanceof t}get primaryLabel(){}get primaryTick(){}get horizontal(){return"top"===this.position||"bottom"===this.position}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}resetAnimation(t){"initial"===t&&this.animationState.transition("reset")}get direction(){return"top"===this.position||"bottom"===this.position?"x":"y"}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new Yl}updateDirection(){switch(this.position){case"top":this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.label.mirrored=!1,this.label.parallel=!1}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(t,e){return this.updateDirection(),super.calculateLayout(t,e)}layoutCrossLines(){const t=this.isAnySeriesActive();this.crossLines.forEach(e=>{e.calculateLayout?.(t,this.reverse)})}calculateTickLayout(t,e,i,s){const n=this.label.getSideFlag(),a=this.horizontal?-.5*Math.PI:0,o=it(a),r=it(a-Math.PI/2),l=n*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding);if(2===e&&!1===this.label.enabled&&!1===this.tick.enabled&&!1===this.gridLine.enabled){const{bbox:e,spacing:i}=this.tickBBox(t,[],[]);return this.generatedTicks={ticks:[],tickLines:[],gridLines:[],labels:[],spacing:i},{ticks:[],rawTickCount:0,tickDomain:t,niceDomain:t,fractionDigits:0,timeInterval:void 0,bbox:e}}const h=this.horizontal&&ha.is(this.scale),c=this.tickGenerator.generateTicks({domain:t,niceMode:e,visibleRange:i,primaryTickCount:s,parallelFlipRotation:o,regularFlipRotation:r,labelX:l,sideFlag:n,removeOverflowLabels:h,removeOverflowThreshold:this.chartPadding?.right}),{tickData:d}=c,{ticks:u,tickDomain:p,rawTicks:g,rawTickCount:m,fractionDigits:y,timeInterval:f,niceDomain:x=t}=d,b=u.map(t=>this.getTickLabelProps(t,c)),{position:v,horizontal:S,gridPadding:M,gridLength:k}=this,D="bottom"===v||"right"===v?-1:1,w=M,I=D*k-M,{gridLine:C}=this,L=u.map(({tickId:t,translationY:e},i)=>{const[s,n,a,o]=S?[e,w,e,I]:[w,e,I,e],{style:r,width:l}=C,{stroke:h,lineDash:c}=r[i%r.length]??{};return{tickId:t,offset:e,x1:s,y1:n,x2:a,y2:o,stroke:h,strokeWidth:l,lineDash:c}}),{tick:A,primaryTick:T}=this,N=u.map(({primary:t,tickId:e,translationY:i})=>{const s=t&&T?.enabled?T:A,n=-D*this.getTickSize(s),[a,o,r,l]=S?[i,0,i,n]:[0,i,n,i],{stroke:h,width:c}=s;return{tickId:e,offset:i,x1:a,y1:o,x2:r,y2:l,stroke:h,strokeWidth:c,lineDash:void 0}}),{bbox:O,spacing:R}=this.tickBBox(p,u,b);return this.generatedTicks={ticks:u,gridLines:L,tickLines:N,labels:b,spacing:R},{ticks:g,rawTickCount:m,tickDomain:p,niceDomain:x,fractionDigits:y,timeInterval:f,bbox:O}}update(){this.updateDirection();const t=Array.from(this.tickLabelGroupSelection.nodes(),t=>t.datum.tickId);super.update(),this.tickLineGroup.visible=this.tick.enabled||(this.primaryTick?.enabled??!1),this.tickLabelGroup.visible=this.label.enabled||(this.primaryTick?.enabled??!1);const{generatedTicks:e}=this;if(this.updateTitle(this.scale.domain,e?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),this.generatedTicks){const{ticks:e}=this.generatedTicks;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const i=e.map(t=>t.tickId),n=(0,s.E3)(t,i);this.animationState.transition("update",n)}}const{enabled:i,stroke:n,width:a}=this.line;this.lineNode.setProperties({stroke:n,strokeWidth:i?a:0}),this.updateTickLines(),this.updateGridLines()}getAxisTransform(){return{translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){super.updatePosition();const t=this.getAxisTransform();this.tickLineGroup.datum=t,this.tickLabelGroup.datum=t,this.lineNodeGroup.datum=t,this.headingLabelGroup.datum=t}getAxisLineCoordinates(){const{horizontal:t}=this,[e,i]=oa(this.range);return t?{x1:e,x2:i,y1:0,y2:0}:{x1:0,x2:0,y1:e,y2:i}}getTickLineBBox(t){const{position:e,primaryTick:i}=this,s=Math.max(this.getTickSize(),i?.enabled?this.getTickSize(i):0),{translationY:n}=t;switch(e){case"top":return new y(n,-s,n,s);case"bottom":return new y(n,0,n,s);case"left":return new y(-s,n,s,n);case"right":return new y(0,n,s,n)}}lineNodeBBox(){const{position:t,seriesAreaPadding:e}=this,{y1:i,y2:s}=this.getAxisLineCoordinates(),n=s-i;switch(t){case"top":return new y(i,-e,n,e);case"bottom":return new y(i,0,n,e);case"left":return new y(-e,i,e,n);case"right":return new y(0,i,e,n)}}titleBBox(t,e){const{tempCaption:i}=this;return i.node.setProperties(this.titleProps(i,t,e)),i.node.getBBox()}tickBBox(t,e,i){const{tick:n,primaryTick:a,label:o,primaryLabel:r,title:l,position:h,horizontal:c,seriesAreaPadding:d}=this,u=[];if(u.push(this.lineNodeBBox()),n.enabled||a?.enabled)for(const t of e)u.push(this.getTickLineBBox(t));const{tempText:p}=this;if(o.enabled)for(const t of i){if(!t.visible)continue;p.setProperties(t);const e=p.getBBox();e&&u.push(e)}if(r?.enabled&&null!=r.format&&"bottom"===h){const{fontSize:t,format:e}=r,i=((0,s.Qd)(e)?Object.values(e):[e]).reduce((t,e)=>Math.max(t,(0,s.lt)(e)),0),o=this.getTickSize(a??n)+r.spacing+d,l=2,h=i*Ti.getLineHeight(t)+l;u.push(new y(0,o,1,h))}let g=0;if(l.enabled){const e=y.merge(u);g=c?e.height:e.width,u.push(this.titleBBox(t,g))}return{bbox:y.merge(u),spacing:g}}titleProps(t,e,i){const{title:s}=this;if(!s.enabled)return t.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};t.enabled=!0,t.color=s.color,t.fontFamily=s.fontFamily,t.fontSize=s.fontSize,t.fontStyle=s.fontStyle,t.fontWeight=s.fontWeight,t.wrapping=s.wrapping;const n=(s.spacing??0)+i,{range:a}=this,o=(a[0]+a[1])/2;let r,l,h,c;switch(this.position){case"top":r=o,l=-n,h=0,c="bottom";break;case"bottom":r=o,l=n,h=0,c="top";break;case"left":r=-n,l=o,h=-.5*Math.PI,c="bottom";break;case"right":r=n,l=o,h=.5*Math.PI,c="bottom"}const{formatter:d=t=>t.defaultValue}=s,u=this.callWithContext(d,this.getTitleFormatterParams(e));return t.text=u,{visible:!0,text:u,textBaseline:c,x:r,y:l,rotationCenterX:r,rotationCenterY:l,rotation:h}}getTickLabelProps(t,e){const{horizontal:i,primaryLabel:s,primaryTick:n,seriesAreaPadding:a,scale:o}=this,{tickId:r,tickLabel:l="",translationY:h,primary:c}=t,d=c&&s?.enabled?s:this.label,u=c&&n?.enabled?n:this.tick,{rotation:p,textBaseline:g,textAlign:m}=e,{range:y}=o,f=this.label.getSideFlag()*(this.getTickSize(u)+d.spacing+a),x=""!==l,b=i?h:f,v=i?-f:h;return{...this.getLabelStyles({value:l},void 0,d),tickId:r,rotation:p,text:l,textAlign:m,textBaseline:g,visible:x,x:b,y:v,rotationCenterX:b,rotationCenterY:v,range:y}}updateSelections(){if(!this.generatedTicks)return;const t=this.getAxisLineCoordinates(),{tickLines:e,gridLines:i,labels:s}=this.generatedTicks,n=t=>t.tickId;this.lineNode.datum=t,this.gridLineGroupSelection.update(this.gridLine.enabled?i:[],void 0,n),this.tickLineGroupSelection.update(e,void 0,n),this.tickLabelGroupSelection.update(s,void 0,n)}updateGridLines(){this.gridLineGroupSelection.each((t,e)=>{t.stroke=e.stroke,t.strokeWidth=e.strokeWidth,t.lineDash=e.lineDash})}updateTickLines(){this.tickLineGroupSelection.each((t,e)=>{t.stroke=e.stroke,t.strokeWidth=e.strokeWidth,t.lineDash=e.lineDash})}updateTitle(t,e){const{caption:i}=this.title,s=this.titleProps(i,t,e);i.node.visible=s.visible,i.node.text=s.text,i.node.textBaseline=s.textBaseline,i.node.datum=s}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((t,e)=>{t.fill=e.fill,t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text,t.textBaseline=e.textBaseline,t.textAlign=e.textAlign??"center"})}animateReadyUpdate(t){const{animationManager:e}=this.moduleCtx,i=Il(kl(this));rr(this.id,"axis-group",e,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],i.group),rr(this.id,"line",e,[this.lineNode],i.line),rr(this.id,"line-paths",e,[this.gridLineGroupSelection,this.tickLineGroupSelection],i.tick,(t,e)=>e.tickId,t),rr(this.id,"tick-labels",e,[this.tickLabelGroupSelection],i.label,(t,e)=>e.tickId,t),rr(this.id,"title",e,[this.title.caption.node],i.label,(t,e)=>e.tickId,t)}resetSelectionNodes(){dr([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],(t,e)=>({translationX:e.translationX,translationY:e.translationY})),dr([this.gridLineGroupSelection,this.tickLineGroupSelection],(t,e)=>{const{x1:i,x2:s,y1:n,y2:a}=e;return{x1:i,x2:s,y1:n,y2:a}}),dr([this.tickLabelGroupSelection],(t,e)=>({x:e.x,y:e.y,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,rotation:e.rotation})),dr([this.title.caption.node],(t,e)=>({x:e.x,y:e.y,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,rotation:e.rotation})),dr([this.lineNode],(t,e)=>{const{x1:i,x2:s,y1:n,y2:a}=e;return{x1:i,x2:s,y1:n,y2:a}})}};r([Ct],$l.prototype,"thickness",2),r([Ct],$l.prototype,"position",2);var Hl=$l,Ul=["top","right","bottom","left"];function Xl(t){return"string"==typeof t&&Ul.includes(t)}var Zl=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function ql(t){const{series:e}=t;return e?.[0]?.type??"line"}function Ql(t){const e=ql(t);return Qo.isCartesian(e)||function(t){const e=Ho(t)?.find(t=>"cartesian"===t);return"cartesian"===e}(e)}function Jl(t){const e=ql(t);return Qo.isPolar(e)||function(t){const e=Ho(t)?.find(t=>"polar"===t);return"polar"===e}(e)}function th(t){const e=ql(t);return Qo.isHierarchy(e)||function(t){const e=Ho(t)?.find(t=>"hierarchy"===t);return"hierarchy"===e}(e)}function eh(t){const e=ql(t);return Qo.isTopology(e)||function(t){const e=Ho(t)?.find(t=>"topology"===t);return"topology"===e}(e)}function ih(t){const e=ql(t);return Qo.isFlowProportion(e)||function(t){const e=Ho(t)?.find(t=>"flow-proportion"===t);return"flow-proportion"===e}(e)}function sh(t){const e=ql(t);return Qo.isStandalone(e)||function(t){const e=Ho(t)?.find(t=>"standalone"===t);return"standalone"===e}(e)}function nh(t){const e=ql(t);return Qo.isGauge(e)||function(t){const e=Ho(t)?.find(t=>"gauge"===t);return"gauge"===e}(e)}var ah=class extends Mr{applyOptions(t){for(const e of this.moduleMap.values())e.module.optionsKey in t&&Tt(e.moduleInstance)&&e.moduleInstance.set(t[e.module.optionsKey])}*legends(){for(const{module:t,moduleInstance:e}of this.moduleMap.values())"legend"===t.type&&(yield{legendType:t.identifier,legend:e})}},oh="ag-charts-overlay",rh="ag-charts-dark-overlay",lh=class extends Lt{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 t=this.renderer();if(t instanceof HTMLElement)this.content=t;else{const e=(0,s.n)("div");e.innerHTML=t;const{firstElementChild:i}=e;i instanceof HTMLElement&&1===e.childElementCount?this.content=i:this.content=e}}else{const i=(0,s.n)("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)"});i.innerText=this.getText(e),this.content=i,t?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(t){i.style.opacity=String(t)},onStop(){i.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(t){i.style.opacity=String(t)},onStop(){t?.()}})}else t?.();this.content=void 0,this.focusBox=void 0}}};r([Ct],lh.prototype,"enabled",2),r([Ct],lh.prototype,"text",2),r([Ct],lh.prototype,"renderer",2);var hh=class extends Lt{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new lh("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new lh("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new lh("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new lh("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(t){for(const e of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(void 0!==e.focusBox)return{text:e.getText(t),rect:e.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};r([Ct],hh.prototype,"darkTheme",2),r([Ct],hh.prototype,"loading",2),r([Ct],hh.prototype,"noData",2),r([Ct],hh.prototype,"noVisibleSeries",2),r([Ct],hh.prototype,"unsupportedBrowser",2);var ch=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.ANY_CONTENT=1]="ANY_CONTENT",t))(ch||{}),dh=(t=>(t[t.FOREGROUND=0]="FOREGROUND",t[t.HIGHLIGHT=1]="HIGHLIGHT",t[t.LABEL=2]="LABEL",t))(dh||{});function uh(t,e,i,s){if(ae(t))return{type:"gradient",gradient:t.gradient??e.gradient,colorStops:t.colorStops??e.colorStops,bounds:t.bounds??e.bounds,rotation:t.rotation??e.rotation,reverse:t.reverse??e.reverse};if(re(t)){const e=t.pattern??i.pattern;let s=t.strokeWidth;return"backward-slanted-lines"===e||"forward-slanted-lines"===e||"horizontal-lines"===e||"vertical-lines"===e?s??(s=i.strokeWidth):s??(s=0),{type:"pattern",pattern:e,width:t.width??t.height??i.width,height:t.height??t.width??i.height,path:t.path,padding:t.padding??i.padding,fill:t.fill??i.fill,fillOpacity:t.fillOpacity??i.fillOpacity,backgroundFill:t.backgroundFill??i.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??i.backgroundFillOpacity,stroke:t.stroke??i.stroke,strokeOpacity:t.strokeOpacity??i.strokeOpacity,strokeWidth:s,rotation:t.rotation??i.rotation,scale:t.scale??i.scale}}return le(t)?{type:"image",url:t.url,width:t.width,height:t.height,backgroundFill:t.backgroundFill??s.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??s.backgroundFillOpacity,rotation:t.rotation??s.rotation,repeat:t.repeat??s.repeat,fit:t.fit??s.fit}:t}function ph(t,e,i,s){return ae(t?.fill)||re(t?.fill)||le(t?.fill)?{...t,fill:uh(t.fill,e,i,s)}:t}function gh(t,e,i,s){null!=i&&ae(e)&&null!=e.bounds&&"item"!==e.bounds?t.fillBBox=i[e.bounds]:t.fillBBox=void 0,t.fillParams=s}function mh(t,e,i,s,n){const a=i?.fill??e.fill;t.fill=a,gh(t,i?.fill??e.fill,s,n),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 yh=(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))(yh||{}),fh=class{constructor(t,e,i,s){this.type=t,this.event=e,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=s.id}preventDefault(){this.defaultPrevented=!0}},xh=class{constructor(t,e,i){this.series=t,this.seriesGrouping=e,this.oldGrouping=i,this.type="groupingChanged"}},bh=class extends si{constructor(t){super(),this.destroyFns=[],this.usesPlacedLabels=!1,this.seriesGrouping=void 0,this.NodeEvent=fh,this.internalId=(0,s.sX)(this),this.contentGroup=new Ae({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new Ae({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new Ae({name:`${this.internalId}-annotation`}),this.labelGroup=new Ae({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new Mr,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this._declarationOrder=-1,this.seriesListeners=new Qi,this._pickNodeCache=new Ci;const{moduleCtx:e,pickModes:i,directionKeys:n={},directionNames:a={},canHaveAxes:o=!1,usesPlacedLabels:r=!1}=t;this.ctx=e,this.directionKeys=n,this.directionNames=a,this.canHaveAxes=o,this.usesPlacedLabels=r,this.highlightGroup=new Ae({name:`${this.internalId}-highlight`}),this.highlightNode=this.highlightGroup.appendChild(new Ie({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new Ie({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(t,this.id),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){return null!=this.data&&this.data.length>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}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 xh(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&&(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)}removeEventListener(t,e){return super.removeEventListener(t,e)}hasEventListener(t){return super.hasEventListener(t)}addListener(t,e){return this.seriesListeners.addListener(t,e)}dispatch(t,e){this.seriesListeners.dispatch(t,e)}addChartEventListeners(){}updatedDomains(){}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 a=(...t)=>{for(const e of t)Array.isArray(e)?a(...e):"object"==typeof e?a(...Object.values(e)):n.push(e)};return a(...s.map(t=>this.properties[t])),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(e=>e.getDomain(t)).flat();return 0!==i.length?e.concat(i):e}getRange(t,e){return this.getSeriesRange(t,e)}getVisibleItems(t,e,i){return 1/0}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){this.ctx.seriesStateManager.updateSeries(this)}getOpacity(){const{dimOpacity:t=1,enabled:e=!0}=this.properties.highlightStyle.series;if(!e||1===t)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;default:return t}}getStrokeWidth(t){const{strokeWidth:e,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||void 0===e)return t;switch(this.isItemIdHighlighted()){case 1:return e;case 0:case 2:return t}}isItemIdHighlighted(){const t=this.ctx.highlightManager?.getActiveHighlight()?.series;return null==t?0:t!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(t=>t.getTooltipParams()).reduce((t,e)=>Object.assign(t,e),{})}pickNodes(t,e,i=!1){const{pickModes:s,pickModeAxis:n,visible:a,contentGroup:o}=this;if(!a||!o.visible)return;if("highlight"===e&&!this.properties.highlight.enabled)return;if("highlight-tooltip"===e&&!this.properties.highlight.enabled)return;let r=1/0;if("tooltip"===e||"highlight-tooltip"===e){const{tooltip:t}=this.properties;r="number"==typeof t.range?t.range:1/0,i||(i="exact"===t.range)}else if("event"===e||"context-menu"===e){const{nodeClickRange:t}=this.properties;r="number"==typeof t?t:1/0,i||(i="exact"===t)}const l=s.filter(t=>!i||0===t),{x:h,y:c}=t,d=JSON.stringify({x:h,y:c,maxDistance:r,selectedPickModes:l});if(this._pickNodeCache.has(d))return this._pickNodeCache.get(d);for(const e of l){let i;switch(e){case 0:{const e=this.pickNodesExactShape(t);i=0===e.length?void 0:{datums:e,distance:0};break}case 1:{const e=this.pickNodeClosestDatum(t),s=0===e?.distance?this.pickNodesExactShape(t):void 0;i=null!=s&&0!==s.length?{datums:s,distance:0}:e?{datums:[e.datum],distance:e.distance}:void 0;break}case 2:{const e=null!=n?this.pickNodeMainAxisFirst(t,"main-category"===n):void 0;i=null!=e?{datums:[e.datum],distance:e.distance}:void 0;break}}if(i&&i.distance<=r)return this._pickNodeCache.set(d,{pickMode:e,datums:i.datums,distance:i.distance})}return this._pickNodeCache.set(d,void 0)}pickNodesExactShape(t){const e=[];for(const i of this.contentGroup.pickNodes(t.x,t.y)){const t=i.closestDatum();null!=t&&!0!==t.missing&&e.push(t)}return e}pickNodeClosestDatum(t){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(t,e){const i=p(t.x,t.y,e),s=i.nearest?.closestDatum();if(null!=s&&!0!==s.missing)return{datum:s,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(t,e){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(t){}fireNodeClickEvent(t,e){const i=new this.NodeEvent("seriesNodeClick",t,e,this);return this.fireEvent(i),!i.defaultPrevented}fireNodeDoubleClickEvent(t,e){const i=new this.NodeEvent("seriesNodeDoubleClick",t,e,this);return this.fireEvent(i),!i.defaultPrevented}createNodeContextMenuActionEvent(t,e){return new this.NodeEvent("nodeContextMenuAction",t,e,this)}onLegendInitialState(t,e){const{visible:i=!0,itemId:s,legendItemName:n}=e??{};this.toggleSeriesItem(i,t,s,n)}onLegendItemClick(t){const{enabled:e,itemId:i,series:s,legendType:n}=t,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,r=null!=a&&a===t.legendItemName;(s.id===this.id||r||null!=o)&&this.toggleSeriesItem(e,n,i,a,t)}onLegendItemDoubleClick(t){const{enabled:e,itemId:i,series:s,numVisibleItems:n,legendType:a}=t,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,r="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=null!=o&&o===t.legendItemName;s.id===this.id||l||null!=r?this.toggleSeriesItem(!0,a,i,o,t):e&&1===n?this.toggleSeriesItem(!0,a,void 0,o):this.toggleSeriesItem(!1,a,void 0,o)}toggleSeriesItem(t,e,i,s,n){const a=this.id;(t||"category"!==e)&&(this.visible=t),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const o={type:"seriesVisibilityChange",seriesId:a,itemId:i,legendItemName:n?.legendItemName??s,visible:t};this.fireEvent(o),this.ctx.legendManager.toggleItem(t,a,i,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getLabelText(t,e,i=Fs){return t.formatter?this.cachedCallWithContext(t.formatter,{seriesId:this.id,...e})??this.callWithContext(i,e.value):this.callWithContext(i,e.value)}getMarkerStyle(t,e,i,s=!1,n=t.size??0,a){const{itemStyler:o,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:h}=t;let c=ph(E({size:n},a,t.getStyle()),r,l,h);return o&&i&&(c=ph(E(this.cachedCallWithContext(o,{seriesId:this.id,...c,...i,highlighted:s,datum:e}),c),r,l,h)),c}updateMarkerStyle(t,e,i,s,n,a,o,r,{applyTranslation:l=!0,selected:h=!0}={}){const c=this.getMarkerStyle(t,i,n,a,s?.size,o),{shape:d,size:u}=c,p=this.visible&&u>0&&s&&!isNaN(s.x)&&!isNaN(s.y);if(mh(e,c,void 0,r),l?e.setProperties({visible:p,shape:d,size:u,x:s?.x,y:s?.y,scalingCenterX:s?.x,scalingCenterY:s?.y}):e.setProperties({visible:p,shape:d,size:u}),h||(e.fillOpacity*=.25,e.strokeOpacity*=.125),"function"==typeof t.shape&&!e.dirtyPath){e.path.clear(!0),e.updatePath(),e.checkPathDirty();const t=e.getBBox();if(void 0!==s&&t.isFinite()){const e=t.computeCenter(),[i,n]=["x","y"].map(t=>(c.strokeWidth??0)+Math.abs(e[t]-s[t]));s.focusSize=Math.max(t.width+i,t.height+n)}}}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=null!=Fe(this.nodeDataDependencies,s);return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(t){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(t,e){const{datumCallbackCache:i}=this,n=i.get(t);if(null!=n)return n;try{const s=e();return i.set(t,s),s}catch(t){s.Vy.error(String(t))}}cachedCallWithContext(t,...e){return this.ctx.callbackCache.call(this.properties,this.ctx.chartService,t,...e)}callWithContext(t,...e){return pn(this.properties,this.ctx.chartService,t,e)}formatTooltipWithContext(t,e,i){return t.formatTooltip(this.properties,this.ctx.chartService,e,i)}};r([li({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],bh.prototype,"seriesGrouping",2);var vh=class extends de{constructor(){super(...arguments),this.path=new Jt,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("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}onChangeDetection(t){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(t))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)}distanceSquared(t,e){return this.distanceSquaredTransformedPoint(t,e)}svgPathData(t){return this.updatePathIfDirty(),this.path.toSVG(t)}distanceSquaredTransformedPoint(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)?0:this.path.distanceSquared(t,e)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(t){return t.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=t.devicePixelRatio,this.updatePathIfDirty(),super.preRender(t,this.path.commands.length)}render(t){const{ctx:e}=t;if(!this.clip||isNaN(this._clipX)||isNaN(this._clipY))this._clipPath=void 0,this.drawPath(e);else{e.save();const t=this.strokeWidth/2;this._clipPath??(this._clipPath=new Jt),this._clipPath.clear(),this._clipPath.rect(-t,-t,this._clipX+t,this._clipY+t+t),e.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(e),e.restore()}this.fillShadow?.markClean(),super.render(t)}drawPath(t){this.fillStroke(t,this.path.getPath2D())}toSVG(){if(!this.visible)return;const t=(0,s.FJ)("path");t.setAttribute("d",this.svgPathData());const e=this.applySvgFillAttributes(t,[]);return this.applySvgStrokeAttributes(t),{elements:[t],defs:e}}};vh.className="Path",r([H()],vh.prototype,"clip",2),r([H()],vh.prototype,"clipX",1),r([H()],vh.prototype,"clipY",1);var Sh=class{constructor(t){this.swapChain=t,this.hasBeenActivated=!1,this.div=(0,s.n)("div"),this.svg=(0,s.FJ)("svg"),this.outerPath=(0,s.FJ)("path"),this.innerPath=(0,s.FJ)("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=(0,s.n)("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",t=>this.onSwap(t))}clear(){}update(t,e,i){if(null!=e)if(t instanceof vh){const i=(i,s)=>{let{x:n,y:a}=Me.toCanvasPoint(t,i,s);return n-=e.x??0,a-=e.y??0,{x:n,y:a}},s=t.svgPathData(i);this.outerPath.setAttribute("d",s),this.innerPath.setAttribute("d",s),this.show(this.svg)}else{let s;if(i){const i=Math.max(t.x-e.x,0),n=Math.max(t.y-e.y,0),a=Math.min(t.x+t.width-e.x,e.width),o=Math.min(t.y+t.height-e.y,e.height);s=new y(i,n,a-i,o-n)}else s=new y(t.x-e.x,t.y-e.y,t.width,t.height);Ne(this.div,s),this.show(this.div)}}onSwap(t){t!==this.element.parentElement&&(this.element.remove(),t.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(t){this.hasBeenActivated=!0,this.element.innerHTML="",this.element.append(t)}overrideFocusVisible(t){this.focusVisible=t;const e=this.element.parentElement;e?.style.setProperty("opacity",{true:"1",false:"0",undefined:""}[`${t}`])}isFocusVisible(t=!1){if(!t&&!this.hasBeenActivated)return!1;const e=this.element.parentElement;return null!=e&&"1"===(0,s.zk)().getComputedStyle(e).opacity}},Mh=class{constructor(t,e,i){this.label1=t,this.label2=e,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=t=>((0,s.EM)(t.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",t)),this.onFocus=t=>((0,s.EM)(t.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",t)),(0,s.Bq)(this.label1,"id",(0,s.wW)()),(0,s.Bq)(this.label2,"id",(0,s.wW)()),(0,s.EM)(this.label1,"display","none"),(0,s.EM)(this.label2,"display","none"),this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),(0,s.Bq)(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap("")}createAnnouncer(t){const e=(0,s.n)("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),"swap"===t&&e(this.activeAnnouncer)}dispatch(t,e){"focus"===t?this.hasFocus=!0:"blur"===t&&(this.hasFocus=!1),this.listeners[t].forEach(t=>t(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],(0,s.Wp)(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),(0,s.Wp)(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:e}),this.dispatch("swap",this.activeAnnouncer)}},kh={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 Dh(t,e){for(const i of e)if("code"in i){if(i.code===t.code)return!0}else if(!(i.key!==t.key||void 0!==i.shift&&i.shift!==t.shiftKey||void 0!==i.ctrlOrMeta&&i.ctrlOrMeta!==t.ctrlKey&&i.ctrlOrMeta!==t.metaKey))return!0;return!1}function wh(){return(t,e)=>{const i=[`Property [${t}] is deprecated.`,e].filter(Boolean).join(" ");s.Vy.warnOnce(i)}}function Ih(t,e){const i=wh(),s=e?.default;return C((e,n,a)=>(a!==s&&i(n.toString(),t),a))}function Ch(t,e){const i=wh();return C((s,n,a)=>(a!==s[t]&&(i(n.toString(),`Use [${t}] instead.`),j(s,t,e?e(a):a)),k),(e,s)=>(i(s.toString(),`Use [${t}] instead.`),G(e,t)))}function Lh(t,e,i,s){let{top:n,right:a,bottom:o,left:r,width:l,height:h}=s;return null!=r?null!=l?a=i.width-r+l:null!=a&&(l=i.width-r-a):null!=a&&null!=l&&(r=i.width-a-l),null!=n?null!=h?o=i.height-n-h:null!=o&&(h=i.height-o-n):null!=o&&null!=h&&(n=i.height-o-h),null==l?null==h?(l=t,h=e):l=Math.ceil(t*h/e):null==h&&(h=Math.ceil(e*l/t)),null==r&&(r=null==a?Math.floor((i.width-l)/2):i.width-a-l),null==n&&(n=null==o?Math.floor((i.height-h)/2):i.height-h-o),{x:r,y:n,width:l,height:h}}var Ah=class extends Qi{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,null!=this.animationFrameHandle&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(t,e){if(Number.isNaN(this.x)||Number.isNaN(this.y))return this.x=t,this.y=e,this.vx=0,this.vy=0,this.emitUpdate(),void(null!=this.animationFrameHandle&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0));this.x1=t,this.y1=e,this.t0=Date.now(),null==this.animationFrameHandle&&(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:t,y1:e,t0:i}=this,s=Date.now(),n=s-i;this.t0=s;const a=.001,o=0|Math.ceil(n/1);let{x:r,y:l,vx:h,vy:c}=this;for(let i=0;i<o;i+=1)h+=-(200*(r-t)+12*h)/.1*a,c+=-(200*(l-e)+12*c)/.1*a,r+=h*a,l+=c*a;Math.hypot(r-t,l-e)<.5?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=r,this.y=l,this.vx=h,this.vy=c,this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.dispatch("update",{type:"update",x:this.x,y:this.y})}},Th=null;function Nh(t){return""===t?"":(Th??(Th=(0,s.n)("div")),Th.textContent=String(t),Th.innerHTML.replace(/\n/g,"<br>"))}function Oh(t,e){const{path:i,size:s}=t,{x:n,y:a}=t;i.clear();let o=!1;for(const[t,r]of e){const e=n+(t-.5)*s,l=a+(r-.5)*s;o?i.lineTo(e,l):i.moveTo(e,l),o=!0}i.closePath()}var Rh={circle({path:t,x:e,y:i,size:s}){const n=s/2;t.arc(e,i,n,0,2*Math.PI),t.closePath()},cross(t){Oh(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){Oh(t,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:t,x:e,y:i,size:s}){const n=s/4;i+=n/2,t.arc(e-n,i-n,n,ot(130),ot(330)),t.arc(e+n,i-n,n,ot(220),ot(50)),t.lineTo(e,i+n),t.closePath()},pin({path:t,x:e,y:i,size:s}){const n=.5,a=.5;t.moveTo(e+-.34375*s,i+-.15625*s),t.cubicCurveTo(e+-.34375*s,i+-.348509*s,e+-.192259*s,i+-.5*s,e+0*s,i+-.5*s),t.cubicCurveTo(e+(.692259-n)*s,i+-.5*s,e+.34375*s,i+-.348509*s,e+.34375*s,i+-.15625*s),t.cubicCurveTo(e+.34375*s,i+(.493824-a)*s,e+.284625*s,i+(.600181-a)*s,e+(.716461-n)*s,i+(.695393-a)*s),t.cubicCurveTo(e+.199009*s,i+.219769*s,e+(.681271-n)*s,i+.243104*s,e+(.663785-n)*s,i+(.766105-a)*s),t.cubicCurveTo(e+(.611893-n)*s,i+(.834367-a)*s,e+(.562228-n)*s,i+.399699*s,e+(.528896-n)*s,i+(.980648-a)*s),t.cubicCurveTo(e+(.524075-n)*s,i+(.992358-a)*s,e+(.512663-n)*s,i+.5*s,e+0*s,i+.5*s),t.cubicCurveTo(e+(.487337-n)*s,i+.5*s,e+(.475925-n)*s,i+(.992358-a)*s,e+(.471104-n)*s,i+(.980648-a)*s),t.cubicCurveTo(e+(.487337-n)*s,i+.5*s,e+(.475925-n)*s,i+(.992358-a)*s,e+(.471104-n)*s,i+(.980648-a)*s),t.cubicCurveTo(e+(.437772-n)*s,i+.399699*s,e+(.388107-n)*s,i+(.834367-a)*s,e+(.336215-n)*s,i+(.766105-a)*s),t.cubicCurveTo(e+(.318729-n)*s,i+.243104*s,e+-.199009*s,i+.219769*s,e+(.283539-n)*s,i+(.695393-a)*s),t.cubicCurveTo(e+-.284625*s,i+(.600181-a)*s,e+-.34375*s,i+(.493824-a)*s,e+-.34375*s,i+-.15625*s),t.closePath()},plus(t){Oh(t,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:t,x:e,y:i,size:s,pixelRatio:n}){const a=s/2;t.moveTo(te(n,e-a),te(n,i-a)),t.lineTo(te(n,e+a),te(n,i-a)),t.lineTo(te(n,e+a),te(n,i+a)),t.lineTo(te(n,e-a),te(n,i+a)),t.closePath()},star({path:t,x:e,y:i,size:s}){const n=s/2,a=n/2,o=Math.PI/2;for(let s=0;s<10;s++){const r=s%2==0?n:a,l=s*Math.PI/5-o,h=e+Math.cos(l)*r,c=i+Math.sin(l)*r;t.lineTo(h,c)}t.closePath()},triangle(t){Oh(t,[[.5,0],[1,.87],[0,.87]])}},Eh=class extends vh{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,a=this.layerManager?.canvas?.pixelRatio??1,o=Ph.anchor(e),r={path:t,x:i-(o.x-.5)*n,y:s-(o.y-.5)*n,size:n,pixelRatio:a};t.clear(),"string"==typeof e?Rh[e](r):"function"==typeof e&&e(r)}computeBBox(){const{x:t,y:e,size:i}=this,s=Ph.anchor(this.shape);return new y(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)}};r([U({equals:$})],Eh.prototype,"shape",2),r([H()],Eh.prototype,"x",2),r([H()],Eh.prototype,"y",2),r([H({convertor:Math.abs})],Eh.prototype,"size",2);var Ph=class extends(xe(be(ve(Eh)))){static anchor(t){return"pin"===t?{x:.5,y:1}:"function"==typeof t&&"anchor"in t?t.anchor:{x:.5,y:.5}}constructor(t){super(t),null!=t?.shape&&(this.shape=t.shape)}};function Bh(t,e,i=e*(5/3)){const s=new Ie,n=Math.min(t.marker.strokeWidth??1,2),a=Math.min(t.line?.strokeWidth??0,2),o=Math.max(!1===t.marker.enabled?0:e,null==t.line?0:i),r=Math.max(!1===t.marker.enabled?0:e,a);if(null!=t.line){const{stroke:e,strokeOpacity:i,lineDash:n}=t.line,l=new pr;l.x1=0,l.y1=r/2,l.x2=o,l.y2=r/2,l.stroke=e,l.strokeOpacity=i,l.strokeWidth=a,l.lineDash=n,s.append(l)}if(!1!==t.marker.enabled){const{shape:i,fill:a,fillOpacity:l,stroke:h,strokeOpacity:c,lineDash:d,lineDashOffset:u}=t.marker,p=new Ph;p.shape=i??"square",p.size=e,p.fill=a,p.fillOpacity=l??1,p.stroke=h,p.strokeOpacity=c??1,p.strokeWidth=n,p.lineDash=d,p.lineDashOffset=u??0;const g=Ph.anchor(i),m=o/2+(g.x-.5)*e,y=r/2+(g.y-.5)*e,f=e/(e+n);p.x=m,p.y=y,p.scalingCenterX=m,p.scalingCenterY=y,p.scalingX=f,p.scalingY=f,s.append(p)}return Ie.toSVG(s,o,r)}var Fh="ag-charts-tooltip",zh="ag-charts-tooltip--dark";function Gh(t){const e=[],i=new Map;for(const s of t)if("structured"===s.type){const{heading:t}=s,n=null!=t?i.get(t):void 0,a={type:"structured",heading:t,items:[s]};null==n?(i.set(t,a),e.push(a)):n.items.push(s)}else e.push(s);return e}function _h(t){const e=Gh(t),i=[];return e.forEach(t=>{if("raw"===t.type)return"";null!=t.heading&&i.push(t.heading),t.items.forEach(t=>{null!=t.title&&i.push(t.title),t.data?.forEach(t=>{i.push(t.label??t.fallbackLabel,t.value)})})}),i.join("; ")}function jh(t,e,i){let s="";null==t?s+=`<span class="${Fh}-label">${Nh(e)}</span>`:(s+=`<span class="${Fh}-label">${Nh(t)}</span>`,s+=" ",s+=`<span class="${Fh}-value">${Nh(e)}</span>`);const n=[`${Fh}-row`];return i&&n.push(`${Fh}-row--inline`),s=`<div class="${n.join(" ")}">${s}</div>`,s}function Wh(t,e){if(null==t||1===e.length)return;const i=t?.t("tooltipPaginationStatus",{index:e.index+1,count:e.length});return`<div class="${Fh}-footer">${i}</div>`}function Vh(t,e,i,s){const n=1===e.items.length?e.items[0]:void 0;let a,o,r;switch(i){case"compact":a=!0,o=n?.title;break;case"single":a=null!=n&&(null==e.heading||null==n.title)&&1===n.data?.length&&null==n.data[0].label&&null!=n.data[0].value,r=e.heading??n?.title;break;case"shared":a=!1}let l="";if(a&&null!=n?(null!=o&&(l+=jh(void 0,o,!1)),n.data?.forEach(t=>{l+=jh(t.label??r,t.value,!1),l+=" "})):(null!=e.heading&&(l+=`<span class="${Fh}-heading">${Nh(e.heading)}</span>`,l+=" "),e.items.forEach(t=>{l+=function(t){let e="";if(t.data?.length&&t.data.every(t=>null==t.value||""===t.value))return e;const i=null==t.title&&1===t.data?.length,s=null==t.symbol?void 0:Bh(t.symbol,12);return null==s||null==t.title&&!t.data?.length||(e+=`<span class="${Fh}-symbol">${s}</span>`),null!=t.title&&(e+=`<span class="${Fh}-title">${Nh(t.title)}</span>`,e+=" "),t.data?.forEach(t=>{e+=jh(t.label??t.fallbackLabel,t.value,i),e+=" "}),e}(t)})),0===l.length)return;const h="compact"!==i&&null!=s?Wh(t,s):void 0;return h+null&&(l+=h),l=`<div class="${Fh}-content">${l.trimEnd()}</div>`,l}function Kh(t,e,i,s){const n=Gh(e);if(0!==n.length){if(1===n.length&&"structured"===n[0].type)return Vh(t,n[0],i,s);{const e=n.map(e=>"structured"===e.type?Vh(t,e,i):e.rawHtmlString);return null!=s&&e.push(function(t,e){const i=null==e?void 0:Wh(t,e);return null==i?"":`<div class="${Fh}-content">${i}</div>`}(t,s)??""),e.join("")}}}var Yh={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},$h={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},Hh={left:3,"top-left":void 0,"bottom-left":void 0,top:2,center:void 0,bottom:1,right:0,"top-right":void 0,"bottom-right":void 0},Uh={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},Xh=class extends Lt{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}get defaultAnchorTo(){const{type:t,_seriesOverrideType:e}=this,i=t??e??"pointer";return"node"===i||"pointer"===i?i:"chart"}get defaultPlacement(){const{type:t,_seriesOverrideType:e}=this,i=t??e??"pointer";return"node"===i||"pointer"===i?"top":i}};r([Ct,Ih("Use `anchorTo` and/or `placement` options instead.")],Xh.prototype,"type",2),r([Ct],Xh.prototype,"_seriesOverrideType",2),r([Ct],Xh.prototype,"xOffset",2),r([Ct],Xh.prototype,"yOffset",2),r([Ct],Xh.prototype,"anchorTo",2),r([Ct],Xh.prototype,"placement",2);var Zh=class extends Lt{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new Xh,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.destroyFns=[],this.springAnimation=new Ah,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new vs,this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.destroyFns.push(this.springAnimation.addListener("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(t,e){return"togglePopover"in(0,s.zk)().HTMLElement.prototype&&(this.element=e.addChild("tooltip-container",Fh),this.element.setAttribute("popover","manual"),this.element.className=Fh,this.element.style.positionAnchor=e.anchorName,this.sizeMonitor.observe(this.element,t=>{this._elementSize=t,this.updateTooltipPosition()})),this.localeManager=t,()=>{e.removeChild("tooltip-container",Fh),this.destroyFns.forEach(t=>t()),this.element&&this.sizeMonitor.unobserve(this.element)}}isVisible(){return this._visible}contains(t){return this.element?.contains(t)??!1}updateTooltipPosition(){const{element:t,_elementSize:e,positionParams:i}=this;if(null==t||null==e||null==i)return;const{canvasRect:n,relativeRect:a,meta:o}=i,{x:r,y:l}=this.springAnimation;let h=o.position?.placement??this.position.placement??o.position?.defaultPlacement??this.position.defaultPlacement;Array.isArray(h)||(h=[h]);const c=o.position?.anchorTo??this.position.anchorTo??o.position?.defaultAnchorTo??this.position.defaultAnchorTo,d=o.position?.xOffset??0,u=o.position?.yOffset??0,p=a.x,g=a.y,m=a.width-e.width-1+p,y=a.height-e.height+g;let f,x,b=0,v=!1;do{f=h[b],b+=1;const t=this.getTooltipBounds({elementSize:e,placement:f,anchorTo:c,canvasX:r,canvasY:l,yOffset:u,xOffset:d,canvasRect:n});x=Lh(e.width,e.height,a,t),v=!1,1&Uh[f]&&(v||(v=x.x<p||x.x>m)),2&Uh[f]&&(v||(v=x.y<g||x.y>y))}while(b<h.length&&v);const S=(0,s.qE)(p,x.x,m),M=(0,s.qE)(g,x.y,y);v||(v=S!==x.x||M!==x.y);const k="chart"!==c&&!v&&!d&&!u,D=o.showArrow??this.showArrow??k;this.arrowPosition=D?Hh[f]:void 0,this.updateClassModifiers(),t.style.translate=`${S}px ${M}px`}show(t,e,i,s,n,a=!1){const{element:o}=this;if(null!=o&&null!=s&&0!==s.length){const t=Kh(this.localeManager,s,this.mode,this.pagination?n:void 0);if(null==t)return void this.toggle(!1);o.innerHTML=t}else if(null==o||""===o.innerHTML)return void this.toggle(!1);const r={x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height};switch(this.positionParams={canvasRect:e,relativeRect:r,meta:i},i.position?.anchorTo??this.position.anchorTo??i.position?.defaultAnchorTo??this.position.defaultAnchorTo){case"node":this.springAnimation.update(i.nodeCanvasX??i.canvasX,i.nodeCanvasY??i.canvasY);break;case"pointer":this.springAnimation.update(i.canvasX,i.canvasY);break;case"chart":this.springAnimation.reset()}i.enableInteraction?(this.enableInteraction=!0,o.style.pointerEvents="auto",o.removeAttribute("aria-hidden"),o.tabIndex=-1):(this.enableInteraction=!1,o.style.pointerEvents="none",o.setAttribute("aria-hidden","true"),o.removeAttribute("tabindex")),o.style.setProperty("--top",`${e.top}px`),o.style.setProperty("--left",`${e.left}px`),this.updateClassModifiers(),this.toggle(!0,a)}hide(){this.toggle(!1)}toggle(t,e=!1){const{delay:i}=this;t&&i>0&&!e?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(t))}toggleCallback(t){this.element?.isConnected&&this._visible!==t&&(this._visible=t,this.element.togglePopover(t),t?this.updateTooltipPosition():this.springAnimation.reset())}updateClassModifiers(){if(!this.element?.isConnected)return;const{classList:t}=this.element,e=(e,i)=>t.toggle(`${Fh}--${e}`,i);e("no-interaction",!this.enableInteraction),e("arrow-top",1===this.arrowPosition),e("arrow-right",3===this.arrowPosition),e("arrow-bottom",2===this.arrowPosition),e("arrow-left",0===this.arrowPosition),e("compact","compact"===this.mode),t.toggle(zh,this.darkTheme);for(const e of this.wrapTypes)t.toggle(`${Fh}--wrap-${e}`,e===this.wrapping)}getTooltipBounds(t){const{elementSize:e,anchorTo:i,placement:s,canvasX:n,canvasY:a,yOffset:o,xOffset:r,canvasRect:l}=t,{width:h,height:c}=e,d={width:h,height:c};if("node"===i||"pointer"===i){const t=Yh[s],e=$h[s];return d.top=a+o+c*(e-1)/2+8*e,d.left=n+r+h*(t-1)/2+8*t,d}switch(s){case"top":return d.top=o,d.left=l.width/2-h/2+r,d;case"right":return d.top=l.height/2-c/2+o,d.left=l.width-h/2+r,d;case"left":return d.top=l.height/2-c/2+o,d.left=r,d;case"bottom":return d.top=l.height-c+o,d.left=l.width/2-h/2+r,d;case"top-left":return d.top=o,d.left=r,d;case"top-right":return d.top=o,d.left=l.width-h+r,d;case"bottom-right":return d.top=l.height-c+o,d.left=l.width-h+r,d;case"bottom-left":return d.top=l.height-c+o,d.left=r,d}return d}};function qh(t,e){return t.series===e.series&&O(t.datumIndex,e.datumIndex)}r([Ct],Zh.prototype,"enabled",2),r([Ct],Zh.prototype,"mode",2),r([Ct],Zh.prototype,"showArrow",2),r([Ct],Zh.prototype,"delay",2),r([Ct],Zh.prototype,"range",2),r([Ct],Zh.prototype,"wrapping",2),r([Ct],Zh.prototype,"position",2),r([Ct],Zh.prototype,"pagination",2),r([Ct],Zh.prototype,"darkTheme",2),r([Ct],Zh.prototype,"bounds",2);var Qh=class{constructor(){this.candidates=[]}get current(){return this.active}reset(){this.candidates.length=0,this.active=void 0}update(t,e){this.candidates=t;let i=null!=e?t.findIndex(t=>qh(t,e)):-1;return-1===i&&(i=0),this.active=t[i],{current:this.active,index:i,length:t.length}}next(){const{candidates:t,active:e}=this,i=null==e?-1:t.findIndex(t=>qh(t,e));if(-1===i)return;let s=i+1;return s>=t.length&&(s=0),this.active=t[s],{current:this.active,index:s,length:this.candidates.length}}},Jh=class extends Ji{constructor(t){super(),this.chart=t,this.id=(0,s.sX)(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=ci((t,e)=>(0,s.zk)().requestAnimationFrame(t),()=>{(this.tooltip.lastHover||this.highlight.pendingHoverEvent)&&(this.chart.getUpdateType()<=5?this.hoverScheduler.schedule():(this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)))}),this.tooltipCandidates=new Qh;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 Mh(e,i,"img"),this.swapChain.addListener("blur",t=>this.onBlur(t)),this.swapChain.addListener("focus",()=>this.onFocus()),"normal"===t.ctx.domManager.mode&&(this.focusIndicator=new Sh(this.swapChain),this.focusIndicator.overrideFocusVisible("integrated"!==t.mode&&void 0));const{seriesDragInterpreter:n,seriesWidget:a,containerWidget:o}=t.ctx.widgets;a.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"),a.addListener("focus",()=>this.swapChain.focus()),a.addListener("mousemove",t=>this.onHover(t)),a.addListener("wheel",t=>this.onWheel(t)),a.addListener("mouseleave",t=>this.onLeave(t)),a.addListener("keydown",t=>this.onKeyDown(t)),a.addListener("contextmenu",(t,e)=>this.onContextMenu(t,e)),n.addListener("drag-move",t=>this.onDragMove(t)),n.addListener("click",t=>this.onClick(t,a)),n.addListener("dblclick",t=>this.onClick(t,a)),o.addListener("contextmenu",(t,e)=>this.onContextMenu(t,e)),o.addListener("click",(t,e)=>this.onClick(t,e)),o.addListener("dblclick",(t,e)=>this.onClick(t,e)),t.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),t.ctx.domManager.addListener("resize",()=>this.clearAll()),t.ctx.highlightManager.addListener("highlight-change",t=>this.changeHighlightDatum(t)),t.ctx.layoutManager.addListener("layout:complete",t=>this.layoutComplete(t)),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()))}get bbox(){return(this.seriesRect??y.zero).clone()}isState(t){return this.chart.ctx.interactionManager.isState(t)}isIgnoredTouch(t){return"touch"===t.device&&"click"!==t.type&&"hover"!==this.chart.ctx.chartService.touch.dragAction&&("drag"!==this.chart.ctx.chartService.touch.dragAction||!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(){null!=this.highlight.stashedHoverEvent&&(this.highlight.pendingHoverEvent=this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),null!=this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!0)}updateComplete(){this.isState(34)&&this.focusIndicator?.isFocusVisible()&&this.handleSeriesFocus(0,0,!0)}update(t,e){this.chart.ctx.updateService.update(t,e)}seriesChanged(t){this.focus.sortedSeries=[...t].sort((t,e)=>{let i=t.properties.focusPriority??1/0,s=e.properties.focusPriority??1/0;return i===s&&([i,s]=[t._declarationOrder,e._declarationOrder]),i<s?-1:i>s?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),"normal"===this.chart.ctx.domManager.mode&&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:e,currentY:i}=t;this.chart.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:t,canvasX:e,canvasY:i},void 0)}return}let s,n;if(this.focusIndicator?.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(n=Me.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(36)){const e=this.pickNodes({x:t.currentX,y:t.currentY},"context-menu");e&&(this.chart.ctx.highlightManager.updateHighlight(this.id),s=e.matches[0].datum)}const a=s?.series;this.clearAll();const o=t.currentX+e.cssLeft(),r=t.currentY+e.cssTop();a&&s?this.chart.ctx.contextMenuRegistry.dispatchContext("series-node",{widgetEvent:t,canvasX:o,canvasY:r},{pickedSeries:a,pickedNode:s},n):this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{widgetEvent:t,canvasX:o,canvasY:r},void 0,n)}onLeave(t){if(!this.isState(41))return;const e=t.sourceEvent.relatedTarget;"ag-charts-text-input__textarea"!==e?.className&&(this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(t.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),"keyboard"!==this.hoverDevice&&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)&&("touch"!==t.device&&"drag-move"===t.type||(this.tooltip.lastHover=t),"touch"===t.device&&"hover"===this.chart.ctx.chartService.touch.dragAction&&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.pickNodes({x:e,y:i},"event")?.matches,n=s?.[0];n?.series.hasEventListener("seriesNodeClick")||n?.series.hasEventListener("seriesNodeDoubleClick")||null!=s&&s.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}}onClick(t,e){if(e===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),"touch"===t.device&&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))return this.update(5),void t.sourceEvent.preventDefault();const i={type:"click"===t.type?"click":"doubleClick",event:t.sourceEvent};this.chart.fireEvent(i)}onFocus(){this.isState(34)&&(this.hoverDevice=this.focusIndicator?.isFocusVisible(!0)?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(t){this.isState(34)&&(this.hoverDevice="pointer",this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(t)||this.clearAll(),this.focusIndicator?.overrideFocusVisible(void 0))}onKeyDown(t){if(!this.isState(43))return;const e=function(t){for(const[e,{activatesFocusIndicator:i=!0,bindings:n}]of(0,s.jO)(kh))if(Dh(t,n))return{name:e,activatesFocusIndicator:i}}(t.sourceEvent);switch(!1===e?.activatesFocusIndicator&&this.focusIndicator?.overrideFocusVisible("keyboard"===this.previousInputDevice),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;void 0!==e&&void 0!==i?e.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s}),s.preventDefault()}checkSeriesNodeClick(t){var e;const i=this.pickNodes({x:t.currentX,y:t.currentY},"event");if(null==i||0===i.matches.length)return;const s=this.chart.tooltip.pagination?this.tooltipCandidates.update(i.matches,this.tooltipCandidates.current)?.current:void 0,{series:n,datum:a}=s??i.matches[0],o=null==s?i.distance:0;if("click"===t.type){const i=n.fireNodeClickEvent(t.sourceEvent,a)&&this.chart.tooltip.pagination?this.tooltipCandidates.next():void 0;if(null!=i){t.sourceEvent.preventDefault();const{currentX:s,currentY:n}=t,a=s+(this.hoverRect?.x??0),o=n+(this.hoverRect?.y??0);(e=this.highlight).pendingHoverEvent??(e.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1),this.showTooltip(i.current,a,o,{index:i.index,length:i.length})}return!0}return"dblclick"===t.type&&(t.preventZoomDblClick=0===o,n.fireNodeDoubleClickEvent(t.sourceEvent,a),!0)}handleFocus(t,e){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);null==i?this.handleSeriesFocus(t,e):this.focusIndicator?.update(i.rect,this.seriesRect,!1)}handleSeriesFocus(t,e,i=!1){if("hierarchy"===this.chart.chartType||"gauge"===this.chart.chartType)return void this.handleSoloSeriesFocus(t,e,i);const{focus:n}=this,a=n.sortedSeries.filter(t=>t.visible&&t.focusable);if(0===a.length)return;const o=n.datumIndex-e,r=n.seriesIndex-t;n.seriesIndex=(0,s.qE)(0,n.seriesIndex,a.length-1),n.series=a[n.seriesIndex];const l=this.focus.datumIndex,h=this.focus.seriesIndex;this.updatePickedFocus(l,e,o,h,t,r,i)}handleSoloSeriesFocus(t,e,i){this.focus.series=this.focus.sortedSeries[0];const s=this.focus.datumIndex,n=this.focus.seriesIndex,a=this.focus.datumIndex-e,o=this.focus.seriesIndex-t;this.updatePickedFocus(s,e,a,n,t,o,i)}updatePickedFocus(t,e,i,s,n,a,o){const{focus:r,hoverRect:l,seriesRect:h}=this;if(void 0===r.series||void 0===l)return;const c=r?.series?.pickFocus({datumIndex:t,datumIndexDelta:e,otherIndex:s,otherIndexDelta:n,seriesRect:h});if(!c)return;const{datum:d}=c;if(void 0!==c.otherIndex&&(r.seriesIndex=c.otherIndex),r.datumIndex=c.datumIndex,r.datum=d,this.focusIndicator?.isFocusVisible()&&this.chart.ctx.animationManager.reset(),this.focusIndicator?.isFocusVisible()){const t=function({bounds:t}){return t instanceof y?t:null!=t?Me.toCanvas(t):y.NaN}(c),{x:e,y:i}=t.computeCenter();if(!l.containsPoint(e,i)&&this.chart.ctx.zoomManager.panToBBox(this.id,l,t))return;const{x1:s,x2:n,y1:a,y2:o}=so.from(t),r=l.containsPoint(s,a),h=l.containsPoint(n,a),d=l.containsPoint(s,o),u=l.containsPoint(n,o);if(!(r||h||d||u)){const e=so.from(l);c.movedBounds=t.clone(),s<e.x1&&n<e.x1?(c.movedBounds.x=e.x1-2,c.movedBounds.width=4):s>e.x2&&n>e.x2&&(c.movedBounds.x=e.x2-2,c.movedBounds.width=4),a<e.y1&&o<e.y1?(c.movedBounds.y=e.y1-2,c.movedBounds.height=4):a>e.y2&&o>e.y2&&(c.movedBounds.y=e.y2-2,c.movedBounds.height=4)}}this.focusIndicator?.update(c.movedBounds??c.bounds,this.seriesRect,c.clipFocusBox);const u=function(t,e,i){const{x:s,y:n}=function(t,e,i){const s=qn(t,i.datum,i.movedBounds);if(null!=s)return{x:s.canvasX,y:s.canvasY};const n=i.bounds;if(null!=n){if(n instanceof y){const{x:t,y:i}=n.computeCenter();return{x:e.x+t,y:e.y+i}}return Me.toCanvas(n).computeCenter()}}(t,e,i)??{};if(void 0!==s&&void 0!==n)return{type:"keyboard",canvasX:s,canvasY:n}}(r.series,l,c);if(void 0!==u&&"keyboard"===this.hoverDevice){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0;const t=this.chart.getTooltipContent(r.series,d.datumIndex,d),s=Jn.makeTooltipMeta(u,r.series,d,c.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,d),r.series.tooltipEnabled??this.chart.tooltip.enabled?this.chart.ctx.tooltipManager.updateTooltip(this.id,s,t):this.chart.ctx.tooltipManager.removeTooltip(this.id),o||(0===e&&0===n||i!==c.datumIndex||a!==(c.otherIndex??r.seriesIndex))&&this.swapChain.update(this.getDatumAriaText(d,t))}}getDatumAriaText(t,e){const i=null==e?"":_h(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),a=e.currentY+(this.hoverRect?.y??0);if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,a))return void this.clearHighlight();const{range:o}=this.chart.highlight,r="tooltip"===o?"highlight-tooltip":"highlight",l=this.pickNodes({x:i,y:s},r);if(!l||0===l.matches.length)return void this.chart.ctx.highlightManager.updateHighlight(this.id);const{current:h}=this.tooltipCandidates,c=null==h?void 0:l.matches.find(t=>qh(t,h)),d=c?.datum??l.matches[0].datum;this.chart.ctx.highlightManager.updateHighlight(this.id,d),this.hoverDevice="pointer"}handleHoverTooltip(t,e){const{current:i}=this.tooltipCandidates;if(this.tooltipCandidates.reset(),!this.isState(41))return;const{currentX:s,currentY:n}=t,a=s+(this.hoverRect?.x??0),o=n+(this.hoverRect?.y??0),r=t.sourceEvent.target;if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(a,o))return void("pointer"==this.hoverDevice&&this.clearTooltip());if(r&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(r,"canvas-overlay",Fh))return;const l=this.pickNodes({x:t.currentX,y:t.currentY},"tooltip");if(l&&0!==l.matches.length)if(this.hoverDevice="pointer",0===l.distance){const{current:t,index:e,length:s}=this.tooltipCandidates.update(l.matches,this.chart.tooltip.pagination?i:void 0);this.showTooltip(t,a,o,{index:e,length:s})}else this.showTooltip(l.matches[0],a,o);else"pointer"==this.hoverDevice&&this.clearTooltip()}showTooltip({series:t,datum:e,datumIndex:i},s,n,a){const o=this.chart.getTooltipContent(t,i,e);if((t.tooltipEnabled??this.chart.tooltip.enabled)&&null!=o){const i=Jn.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:n},t,e,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,i,o,a)}else this.chart.ctx.tooltipManager.removeTooltip(this.id)}changeHighlightDatum(t){const e=new Set,{series:i,datum:s}=t.currentHighlight??{},{series:n,datum:a}=t.previousHighlight??{};n&&e.add(n),i&&e.add(i),n?.properties.cursor&&a&&this.chart.ctx.domManager.updateCursor(n.id),i?.properties.cursor&&"default"!==i?.properties.cursor&&s&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),null==i||null==n?this.update(5):this.update(5,{seriesToUpdate:e})}pickNodes(t,e,i){const s=[...this.series].reverse();let n;for(const a of s){if(!a.visible||!a.contentGroup.visible)continue;const s=a.pickNodes(t,e,i);if(null==s||0===s.datums.length)continue;const{datums:o,distance:r}=s;if(0!==s.datums.length)if(0===r){0!==n?.distance&&(n={matches:[],distance:0});for(const t of o){const{datumIndex:e}=t;n.matches.push({series:a,datum:t,datumIndex:e})}}else if(null==n||n.distance>r){const[t]=o,{datumIndex:e}=t;n={matches:[{series:a,datum:t,datumIndex:e}],distance:r}}}return n}},tc=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:a=e}=n??{},o=this.series.get(e);if(null!=o)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(o)}`);0===this.series.size&&(this.mode=this.expectedSeriesCount>=30?"aggressive-grouping":"normal");let r=this.groups.get(i);null==r&&(r=new Map,this.groups.set(i,r));const l=this.lookupIdx(a);let h=r.get(l);return null==h&&(h={type:i,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new Ie({name:`${t.contentGroup.name??i}-managed-layer`,zIndex:t.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},r.set(l,h)),this.series.set(e,{layerState:h,seriesConfig:t}),h.seriesIds.push(e),h.group.appendChild(s),h.group}changeGroup(t){const{internalId:e,seriesGrouping:i,type:s,contentGroup:n,oldGrouping:a}=t,{groupIndex:o=e}=i??{};this.groups.get(s)?.get(o)?.seriesIds.includes(e)||(this.series.has(e)&&this.releaseGroup({internalId:e,seriesGrouping:a,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(t=>t!==e),n.group.removeChild(i)),0===n?.seriesIds.length?(this.seriesRoot.removeChild(n.group),this.groups.get(n.type)?.delete(n.id),this.groups.get(s)?.delete(e)):null!=n&&n.seriesIds.length>0&&(n.group.zIndex=this.getLowestSeriesZIndex(n.seriesIds)),this.series.delete(e)}updateLayerCompositing(){this.groups.forEach(t=>{t.forEach(t=>{const{group:e,seriesIds:i}=t;let s;if(0===i.length)s=!1;else if(i.length>1)s=!0;else{const t=this.series.get(i[0]);s=!0===t?.seriesConfig.renderToOffscreenCanvas()}e.renderToOffscreenCanvas=s,e.zIndex=this.getLowestSeriesZIndex(i)})})}lookupIdx(t){return"normal"===this.mode?t:"string"!=typeof t||(t=Number(t.split("-").at(-1)))?Math.floor(30*(0,s.qE)(0,t/this.expectedSeriesCount,1)):0}destroy(){this.groups.forEach(t=>{t.forEach(t=>{this.seriesRoot.removeChild(t.group)})}),this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(t){return t.reduce((t,e)=>{const i=this.series.get(e),s=i?.seriesConfig.contentGroup.zIndex;return null==t||null==s?s:De(t,s)<=0?t:s},void 0)??1}},ec=class extends Lt{constructor(){super(...arguments),this.dragAction="drag"}};r([Ct],ec.prototype,"dragAction",2);var ic=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",t=>this.onUpdateComplete(t)),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(4)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(t){(t.apiUpdate||this.dirtyZoom||this.dirtyDataSource)&&this.updateWindow(t)}onZoomChange(){this.dirtyZoom=!0}updateWindow(t){if(!this.dataService.isLazy())return;const e=this.getValidAxis();let i,s=!0;if(e){const n=this.zoomManager.getAxisZoom(e.id);i=this.getAxisWindow(e,n),s=this.shouldRefresh(t,e,n)}this.dirtyZoom=!1,this.dirtyDataSource=!1,s&&this.dataService.load({windowStart:i?.min,windowEnd:i?.max})}getValidAxis(){return this.chart.axes.find(t=>"time"===t.type)}shouldRefresh(t,e,i){if(t.apiUpdate)return!0;if(this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const s=this.lastAxisZooms.get(e.id);return!(s&&i.min===s.min&&i.max===s.max||(this.lastAxisZooms.set(e.id,i),0))}getAxisWindow(t,e){const{domain:i}=t.scale;if(!e||0===i.length||isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]);return{min:new Date(Number(i[0])+s*e.min),max:new Date(Number(i[0])+s*e.max)}}},sc=/^((?!chrome|android).)*safari/i,nc=/Version\/(\d+(\.\d+)?)/,ac=/Chrome/,oc=/Chrome\/(\d+)/,rc=/Edg/,lc=/OPR/,hc=new Set(["map-shape-background","map-line-background"]),cc=class{constructor(t,e,i,s,n,a,o){this.chartLike=t,this.overlays=e,this.dataService=i,this.layoutManager=s,this.localeManager=n,this.animationManager=a,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(oh),this.destroyFns.push(this.layoutManager.addListener("layout:complete",t=>this.onLayoutComplete(t)))}destroy(){this.destroyFns.forEach(t=>t()),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:t}}){const e=this.dataService.isLoading(),i=this.chartLike.series.some(t=>t.hasData),n=this.chartLike.series.some(t=>t.visible&&!hc.has(t.type));this.overlays.darkTheme?this.overlayElem.classList.add(rh):this.overlayElem.classList.remove(rh),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 a=e,o=!e&&!i,r=i&&!n,l=this.overlays.unsupportedBrowser.enabled&&function(){const{userAgent:t}=(0,s.zk)("navigator");if(sc.test(t)){const e=nc.exec(t);if(null==e)return!1;const i=parseFloat(e[1]),n=Math.floor(i)>16;return n||s.Vy.warnOnce(`Unsupported Safari version: ${i}; ${t}`),!n}if(ac.test(t)&&!rc.test(t)&&!lc.test(t)){const e=oc.exec(t);if(null==e)return!1;const i=parseInt(e[1],10),n=i>126;return n||s.Vy.warnOnce(`Unsupported Chrome version: ${i}; ${t}`),!n}return!1}();a?this.showOverlay(this.overlays.loading,t):this.hideOverlay(this.overlays.loading),o?this.showOverlay(this.overlays.noData,t):this.hideOverlay(this.overlays.noData),r?this.showOverlay(this.overlays.noVisibleSeries,t):this.hideOverlay(this.overlays.noVisibleSeries),l?this.showOverlay(this.overlays.unsupportedBrowser,t):this.hideOverlay(this.overlays.unsupportedBrowser);const h=a||o||r||l;(0,s.Bq)(this.overlayElem,"aria-hidden",!h)}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=" "},this.animationManager)}},dc=x.create(!0,"opts"),uc=class extends Lt{constructor(){super(...arguments),this.padding=new ni(0)}};r([Ct],uc.prototype,"clip",2),r([Ct],uc.prototype,"padding",2);var pc=class t extends si{constructor(t,e){var i;super(),this.id=(0,s.sX)(this),this.seriesRoot=new Ae({name:`${this.id}-series-root`,zIndex:5}),this.annotationRoot=new Ae({name:`${this.id}-annotation-root`,zIndex:9}),this.titleGroup=new Ie({name:"titles",zIndex:13}),this.debug=x.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new s.iN,this.padding=new ni(20),this.seriesArea=new uc,this.keyboard=new nr,this.touch=new ec,this.mode="standalone",this.chartCaptions=new Vi,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.destroyed=!1,this._destroyFns=[],this.chartAnimationPhase="initial",this.modulesManager=new ah,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new s.iN,this.performUpdateType=8,this.runningUpdateType=8,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new ii,this.updateRequestors={},this.performUpdateTrigger=ci((t,e=0)=>{0===e?queueMicrotask(t):setTimeout(t,e)},({count:t})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(t)}catch(t){s.Vy.error("update error",t)}}).catch(t=>s.Vy.errorOnce(t))}),this._performUpdateSplits={},this.axes=[],this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=t=>{this.fireEvent(t)},this.onSeriesNodeDoubleClick=t=>{this.fireEvent(t)},this.onSeriesVisibilityChange=t=>{this.fireEvent(t)},this.seriesGroupingChanged=t=>{if(!(t instanceof xh))return;const{series:e,seriesGrouping:i,oldGrouping:s}=t;e.contentGroup.isRoot()||this.seriesLayerManager.changeGroup({internalId:e.internalId,type:e.type,contentGroup:e.contentGroup,renderToOffscreenCanvas:()=>e.renderToOffscreenCanvas(),seriesGrouping:i,oldGrouping:s})},this.chartOptions=t;const n=e?.scene,a=e?.container??t.processedOptions.container??void 0,o=e?.styleContainer??t.specialOverrides.styleContainer;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const r=new Ie({name:"root"});r.visible=!1,r.append(this.seriesRoot),r.append(this.annotationRoot),r.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),this.tooltip=new Zh,this.seriesLayerManager=new tc(this.seriesRoot),this.mode=t.userOptions.mode??this.mode,this.styleNonce=t.processedOptions.styleNonce;const l=this.ctx=new wo(this,{chartType:this.getChartType(),scene:n,root:r,container:a,styleContainer:o,domMode:t.optionMetadata.domMode,syncManager:new sr(this),fireEvent:t=>this.fireEvent(t),updateCallback:(t,e)=>this.update(t,e),updateMutex:this.updateMutex});this._destroyFns.push(l.domManager.addListener("resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new hh,(i=this.overlays.loading).renderer??(i.renderer=()=>function(t,e){const{animationDuration:i}=On.add,n=i*e,a=(0,s.n)("div",`${oh}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${n}ms linear 50ms both`}),o=(0,s.n)("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),r=(0,s.n)("p",{marginTop:"1em"});r.innerText=t;const l=(0,s.n)("div",`${oh}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),h=(0,s.n)("style");return h.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(" "),a.replaceChildren(h,o,r,l),a}(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new ic(this,l.dataService,l.updateService,l.zoomManager,l.animationManager),new cc(this,this.overlays,l.dataService,l.layoutManager,l.localeManager,l.animationManager,l.domManager)],this.highlight=new Io,this.container=a;const h=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new Jh(this.initSeriesAreaDependencies()),this._destroyFns.push(l.layoutManager.registerElement(0,t=>{t.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(t)}),l.layoutManager.addListener("layout:complete",t=>this.chartCaptions.positionAbsoluteCaptions(t)),l.dataService.addListener("data-load",t=>{this.data=t.data}),this.title.registerInteraction(h,"beforebegin"),this.subtitle.registerInteraction(h,"beforebegin"),this.footnote.registerInteraction(h,"afterend"),Ii.addWindowEvent("page-left",()=>this.destroy()),l.animationManager.addListener("animation-frame",()=>{this.update(7)}),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(t=>t.animationState?.transition("updateData"));const t="initial"!==this.chartAnimationPhase;this.update(4,{forceNodeDataRefresh:!0,skipAnimations:t})})),this.parentResize(l.domManager.containerSize)}static getInstance(e){return t.chartsInstances.get(e)}get canvasElement(){return this.ctx.scene.canvas.element}download(t,e){this.ctx.scene.download(t,e)}getCanvasDataURL(t){return this.ctx.scene.getDataURL(t)}toSVG(){return this.ctx.scene.toSVG()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}overrideFocusVisible(t){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(t)}initSeriesAreaDependencies(){const{ctx:t,tooltip:e,highlight:i,overlays:s,seriesRoot:n,mode:a}=this,o=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,getTooltipContent:(t,e,i)=>this.getTooltipContent(t,e,i),chartType:o,ctx:t,tooltip:e,highlight:i,overlays:s,seriesRoot:n,mode:a}}getModuleContext(){return this.ctx}getTooltipContent(t,e,i){const s=!1!==t.properties.tooltip.enabled?t.getTooltipContent(e,i):void 0,n=null==s?[]:[s];if("shared"!==this.tooltip.mode||1===this.series.length)return n;const a=t.getCategoryValue(e);return null==a?n:this.series.flatMap(e=>{if(e===t)return n;if(!e.isEnabled()||!1===e.properties.tooltip.enabled)return[];const i=e.datumIndexForCategoryValue(a),s=null==i?void 0:e.getTooltipContent(i,void 0);return null==s?[]:[s]})}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(t=>t.enabled&&t.text).map(t=>t.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}resetAnimations(){this.chartAnimationPhase="initial";for(const t of this.series)t.resetAnimation(this.chartAnimationPhase);for(const t of this.axes)t.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}detachAndClear(){this.container=void 0,this.ctx.scene.clearCanvas()}destroy(t){if(this.destroyed)return;const e=t?.keepTransferableResources;let i;return this.performUpdateType=8,this._destroyFns.forEach(t=>t()),this.processors.forEach(t=>t.destroy()),this.overlays.destroy(),this.modulesManager.destroy(),e?(this.ctx.scene.strip(),i={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(t=>t.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.destroyed=!0,Object.freeze(this),i}requestFactoryUpdate(t){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await t(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(t=>s.Vy.errorOnce(t)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const t of this.series)t.resetDatumCallbackCache()}update(t=0,e){if(this.destroyed)return;const{forceNodeDataRefresh:i=!1,skipAnimations:s,seriesToUpdate:n=this.series,newAnimationBatch:a,apiUpdate:o=!1}=e??{};this.apiUpdate=o,this.ctx.widgets.seriesWidget.setDragTouchEnabled("none"!==this.touch.dragAction),i&&this.series.forEach(t=>t.markNodeDataDirty());for(const t of n)this.seriesToUpdate.add(t);if(s&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),a&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this.debug.check()){let e=(new Error).stack??"<unknown>";e=e.replace(/\([^)]*/g,""),this.updateRequestors[e]=t}t<this.performUpdateType&&(this.performUpdateType=t,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(e?.backOffMs))}async performUpdate(t){const{performUpdateType:e,extraDebugStats:i,_performUpdateSplits:s,ctx:n}=this,a=[...this.seriesToUpdate];this.clearCallbackCache(),this.performUpdateType=8,this.seriesToUpdate.clear(),this.runningUpdateType=e,0===this.updateShortcutCount&&e<7&&(n.animationManager.startBatch(this._performUpdateSkipAnimations),n.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",xn[e]);let o=performance.now();s.start??(s.start=o);const r=t=>{s[t]??(s[t]=0),s[t]+=performance.now()-o,o=performance.now()};switch(e){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;await this.updateData(),r("⬇️");case 2:if(this.checkUpdateShortcut(2))break;await this.processData(),this.seriesAreaManager.dataChanged(),r("🏭");case 3:if(this.checkUpdateShortcut(3))break;await this.processDomains(),r("⛰️");case 4:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(4))break;await this.processLayout(),r("⌖");case 5:if(this.checkUpdateShortcut(5))break;await this.updateSeries(a),r("🤔"),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing();case 6:if(this.checkUpdateShortcut(6))break;n.updateService.dispatchPreSceneRender(),r("↖");case 7:if(this.checkUpdateShortcut(7))break;n.animationManager.endBatch(),i.updateShortcutCount=this.updateShortcutCount,n.scene.render({debugSplitTimes:s,extraDebugStats:i,seriesRect:this.seriesRect}),this.extraDebugStats={};for(const t of Object.keys(s))delete s[t];this.ctx.domManager.incrementDataCounter("sceneRenders"),this.ctx.domManager.postRenderUpdate();case 8:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,n.animationManager.endBatch()}this.destroyed||(n.updateService.dispatchUpdateComplete(this.apiUpdate),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=8,this.syncStatus="ready"),this._performUpdateNotify.notify();const l=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round(100*(l-s.start))/100,count:t,performUpdateType:xn[e]})}updateThemeClassName(){const t="ag-charts-theme-",e=[`${t}default`,`${t}default-dark`];let i=e[0],s=!1,{theme:n}=this.chartOptions.processedOptions;for(;"string"!=typeof n&&null!=n;)n=n.baseTheme;"string"==typeof n&&(i=n.replace("ag-",t),s=n.includes("-dark")),e.includes(i)||(i=s?e[1]:e[0]),this.ctx.domManager.setThemeClass(i)}updateDOM(){this.updateThemeClassName();const{enabled:t,tabIndex:e}=this.keyboard;this.ctx.domManager.setTabGuardIndex(t?e??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(t){return!!this.destroyed||(this.updateShortcutCount>3?(s.Vy.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=t&&(this.updateShortcutCount++,!0))}async checkFirstAutoSize(){null!=this.width&&null!=this.height||this._lastAutoSize||await this._autoSizeNotify.await(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}onAxisChange(t,e){null==e&&0===t.length||this.ctx.axisManager.updateAxes(e??[],t)}onSeriesChange(t,e){const i=e?.filter(e=>!t.includes(e))??[];this.destroySeries(i),this.seriesLayerManager?.setSeriesCount(t.length);for(const i of t){if(e?.includes(i))continue;const t=this.seriesLayerManager.requestGroup(i);i.attachSeries(t,this.seriesRoot,this.annotationRoot);const s=this;i.chart={get mode(){return s.mode},get isMiniChart(){return!1},get seriesRect(){return s.seriesRect}},i.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(i),i.addChartEventListeners()}this.seriesAreaManager?.seriesChanged(t)}destroySeries(t){t?.forEach(t=>{t.removeEventListener("seriesNodeClick",this.onSeriesNodeClick),t.removeEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),t.removeEventListener("groupingChanged",this.seriesGroupingChanged),t.destroy(),this.seriesLayerManager.releaseGroup(t),t.detachSeries(void 0,this.seriesRoot,this.annotationRoot),t.chart=void 0})}addSeriesListeners(t){this.hasEventListener("seriesNodeClick")&&t.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&t.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&t.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),t.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const t of this.axes)t.boundSeries=this.series.filter(e=>e.axes[t.direction]===t)}assignAxesToSeries(){const t=(0,s.$z)(this.axes,t=>t.direction);for(const e of this.series)for(const i of e.directions){const n=t[i];if(!n)return void s.Vy.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);const a=e.getKeys(i),o=n.find(t=>!t.keys.length||a.some(e=>t.keys.includes(e)));if(!o)return void s.Vy.warnOnce(`no matching axis for direction [${i}] and keys [${a}]; check series and axes configuration.`);e.axes[i]=o}}parentResize(t){if(null==t||null!=this.width&&null!=this.height)return;let{width:e,height:i}=t;const{pixelRatio:s}=t;if(e=Math.floor(e),i=Math.floor(i),0===e&&0===i)return;const[n=0,a=0,o=1]=this._lastAutoSize??[];n===e&&a===i&&o===s||(this._lastAutoSize=[e,i,s],this.resize("SizeMonitor",{}))}resize(t,e){const{scene:i,animationManager:n}=this.ctx,{inWidth:a,inHeight:o,inMinWidth:r,inMinHeight:l,inOverrideDevicePixelRatio:h}=e;this.ctx.domManager.setSizeOptions(r??this.minWidth,l??this.minHeight,a??this.width,o??this.height);const c=a??this.width??this._lastAutoSize?.[0],d=o??this.height??this._lastAutoSize?.[1],u=h??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${t}`,{width:c,height:d,pixelRatio:u,stack:(new Error).stack}),null!=c&&null!=d&&(0,s.Bf)(c)&&(0,s.Bf)(d)&&i.resize(c,d,u)){n.reset();let t=!0;null!=this.width&&null!=this.height||!this._firstAutoSize||(t=!1,this._firstAutoSize=!1),this.update(4,{forceNodeDataRefresh:!0,skipAnimations:t}),this._autoSizeNotify.notify()}}async updateData(){this.series.forEach(t=>t.setChartData(this.data));const t=this.modulesManager.mapModules(t=>t.updateData?.(this.data));await Promise.all(t)}async processData(){this.series.some(t=>t.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const t=new Ko(this.mode,this.suppressFieldDotNotation),e=this.series.map(e=>e.processData(t)),i=this.modulesManager.mapModules(e=>e.processData?.(t));this._cachedData=t.execute(this._cachedData),await Promise.all([...e,...i]),this.updateLegends()}async processDomains(){for(const t of this.axes)t.processData();for(const t of this.series)t.updatedDomains()}updateLegends(t){for(const{legend:e,legendType:i}of this.modulesManager.legends())"category"===i?this.setCategoryLegendData(t):this.setLegendData(i,e)}setCategoryLegendData(t){var e;const{ctx:{legendManager:i,stateManager:n}}=this;t&&this.series.forEach(e=>{const i=t.find(t=>t.seriesId===e.id);e.onLegendInitialState("category",i)});const a=this.series.flatMap(t=>{const e=t.getLegendData("category");return i.updateData(t.id,e),e});if(t)n.setStateAndRestore(i,t);else{if("integrated"!==this.mode){const t={},i=new Map(this.series.map(t=>[t.id,t.type]));for(const{seriesId:n,symbol:{marker:o},label:r}of a.filter(t=>!t.hideInLegend)){if(null==o.fill)continue;const a=i.get(n),l=t[a]??(t[a]={});l[e=r.text]??(l[e]=o.fill),l[r.text]!==o.fill&&s.Vy.warnOnce(`legend item '${r.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}i.update()}}setLegendData(t,e){e.data=this.series.filter(t=>t.properties.showInLegend).flatMap(e=>e.getLegendData(t))}async processLayout(){const t=this.animationRect,{width:e,height:i}=this.ctx.scene,s=this.ctx.layoutManager.createContext(e,i);await this.performLayout(s),t&&!this.animationRect?.equals(t)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}async updateSeries(t){const{seriesRect:e}=this;await Promise.all(t.map(t=>t.update({seriesRect:e}))),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(t=>t.visible&&t.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(t=1e4,e=!1){const i=performance.now();for(;(this._pendingFactoryUpdatesCount>0||8!==this.performUpdateType||8!==this.runningUpdateType||this.ctx.scene.waitingForUpdate())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),8===this.performUpdateType&&8===this.runningUpdateType||await this._performUpdateNotify.await(),performance.now()-i>t){const i=`Chart.waitForUpdate() timeout of ${t} reached - first chart update taking too long.`;if(e)throw new Error(i);s.Vy.warnOnce(i)}Ee()&&await(0,s.v7)(),this.ctx.scene.waitingForUpdate()&&await(0,s.v7)(50)}}filterMiniChartSeries(t){return t?.filter(t=>!1!==t.showInMiniChart)}applyOptions(t){const e=this.firstApply?t.processedOptions:t.diffOptions(this.chartOptions);if(null==e||0===Object.keys(e).length)return;const i=this.firstApply?{}:this.chartOptions.processedOptions,s=t.processedOptions;dc("Chart.applyOptions() - applying delta",e);const n=this.applyModules(s);e.listeners&&this.registerListeners(this,e.listeners),We(this,e,{skip:["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer"]});let a=!1,o="no-op";null!=e.series&&(o=this.applySeries(this,e.series,i?.series),a=!0),"replaced"===o&&this.resetAnimations(),this.applyAxes(this,s,i,o,[])&&(a=!0),e.data&&(this.data=e.data),e.legend?.listeners&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,e.legend.listeners),e.locale?.localeText&&(this.modulesManager.getModule("locale").localeText=e.locale?.localeText),this.chartOptions=t;const r=this.modulesManager.getModule("navigator"),l=this.modulesManager.getModule("zoom");r?.enabled||l?.enabled||this.ctx.zoomManager.updateZoom("chart");const h=r?.miniChart,c=s.navigator?.miniChart?.series??s.series;!0===h?.enabled&&null!=c?this.applyMiniChartOptions(h,c,s,i):!1===h?.enabled&&(h.series=[],h.axes=[]),this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes),a||(a=this.shouldForceNodeDataRefresh(e,o));const d=a||n?0:4;this.maybeResetAnimations(o),this.shouldClearLegendData(s,i,o)&&this.ctx.legendManager.clearData(),this.applyInitialState(s),dc("Chart.applyOptions() - update type",xn[d],{seriesStatus:o,forceNodeDataRefresh:a}),this.update(d,{apiUpdate:!0,forceNodeDataRefresh:a,newAnimationBatch:!0}),this.firstApply=!1}applyInitialState(t){const{annotationManager:e,chartTypeOriginator:i,historyManager:s,stateManager:n,zoomManager:a}=this.ctx,{initialState:o}=t;if("annotations"in t&&t.annotations?.enabled&&null!=o?.annotations){const t=o.annotations.map(t=>E(t,e.getAnnotationTypeStyles(t.type)));n.setState(e,t)}null!=o?.chartType&&n.setState(i,o.chartType),(t.navigator?.enabled||t.zoom?.enabled)&&null!=o?.zoom&&n.setState(a,o.zoom),null!=o?.legend&&this.updateLegends(o.legend),null!=o&&s.clear()}maybeResetAnimations(t){if("standalone"===this.mode)switch(t){case"series-grouping-change":case"replaced":this.resetAnimations()}}shouldForceNodeDataRefresh(t,e){const i=!!t.data||"data-change"===e||"replaced"===e,s=Xo.getKeys(),n=Object.values(s).some(e=>null!=t[e]),a=null!=t.title&&null!=t.subtitle;return i||n||a}shouldClearLegendData(t,e,i){const s="replaced"===i||"series-grouping-change"===i||"updated"===i&&(t.series?.length!==e.series?.length||!t.series?.every((t,i)=>t.type===e.series?.[i].type)),n=null!=e.legend&&null==t.legend;return s||n}applyMiniChartOptions(t,e,i,s){const n=s?.navigator?.miniChart?.series??s?.series,a=this.applySeries(t,this.filterMiniChartSeries(e),this.filterMiniChartSeries(n));this.applyAxes(t,i,s,a,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const o=t.series;for(const t of o)t.properties.id=void 0;const r=t.axes,l=r.find(t=>"x"===t.direction);for(const t of r)t.nice=!1,t.gridLine.enabled=!1,t.label.enabled=t===l,t.tick.enabled=!1,t.interactionEnabled=!1;if(null!=l){const t=i.navigator?.miniChart,e=t?.label,s=t?.label?.interval;if(l.line.enabled=!1,l.label.set(z(e,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),l.tick.set(z(s,["enabled","width","size","color","interval","step"])),"grouped-category"===l.type){l.label.enabled=!1,l.label.rotation=0;const{depthOptions:t}=l;if(0===t.length)t.set([{label:{enabled:!0}}]);else for(let e=1;e<t.length;e++)t[e].label.enabled=!1}else"time"!==l.type&&"unit-time"!==l.type&&"ordinal-time"!==l.type||(l.parentLevel.enabled=!1);const n=s?.step;null!=n&&(l.interval.step=n)}}applyModules(t){const{type:e}=this.constructor;let i=!1;for(const s of h.byType("root","legend")){const n=null!=t[s.optionsKey]&&s.chartTypes.includes(e);n!==this.modulesManager.isEnabled(s)&&(n?(this.modulesManager.addModule(s,t=>t.moduleFactory(this.getModuleContext())),"legend"===s.type&&this.modulesManager.getModule(s)?.attachLegend(this.ctx.scene),this[s.optionsKey]=this.modulesManager.getModule(s)):(this.modulesManager.removeModule(s),delete this[s.optionsKey]),i=!0)}return i}initSeriesDeclarationOrder(t){for(let e=0;e<t.length;e++)t[e].setSeriesIndex(e)}applySeries(t,e,i){if(!e)return"no-change";const s=function(t,e,i){const s=(t,e,i)=>{const s=[t];for(const t of Zl)t in e&&null!=e[t]&&s.push(`${t}=${e[t]}`);return i?.seriesGrouping&&s.push(`seriesGrouping.groupId=${i?.seriesGrouping.groupId}`),s.join(";")},n=new Map;let a=0;for(const e of t){const t=s(e.type,e.properties,i?.[a]);n.has(t)||n.set(t,[]),n.get(t)?.push([e,a++])}const o=new Map;a=0;for(const t of e){const e=s(t.type,t,t);o.has(e)||o.set(e,[]),o.get(e)?.push([t,a++])}if(![...n.keys()].some(t=>o.has(t)))return{status:"no-overlap",oldKeys:n.keys(),newKeys:o.keys()};const r=[];for(const[t,e]of o.entries())for(const[s,a]of e){const e=n.get(t);if(null==e||e.length<1){r.push({opts:s,targetIdx:a,idx:a,status:"add"}),n.delete(t);continue}const[o,l]=e.shift(),h=Fe(i?.[l]??{},s??{}),{groupIndex:c,stackIndex:d}=h?.seriesGrouping??{};null!=c||null!=d?r.push({opts:s,series:o,diff:h,targetIdx:a,idx:l,status:"series-grouping"}):h?r.push({opts:s,series:o,diff:h,targetIdx:a,idx:l,status:"update"}):r.push({opts:s,series:o,targetIdx:a,idx:l,status:"no-op"}),0===e.length&&n.delete(t)}for(const t of n.values())for(const[e,i]of t)r.push({series:e,idx:i,targetIdx:-1,status:"remove"});return{status:"overlap",changes:r}}(t.series,e,i);if("no-overlap"===s.status){dc(`Chart.applySeries() - creating new series instances, status: ${s.status}`,s);const i=e.map(t=>this.createSeries(t));return this.initSeriesDeclarationOrder(i),t.series=i,"replaced"}dc("Chart.applySeries() - matchResult",s);const n=[];let a=!1,o=!1,r=!1;const l=s.changes.toSorted((t,e)=>t.targetIdx-e.targetIdx);for(const t of l)switch(o||(o="series-grouping"===t.status),a||(a=null!=t.diff?.data),r||(r="no-op"!==t.status),t.status){case"add":{const e=this.createSeries(t.opts);n.push(e),dc("Chart.applySeries() - created new series",e);break}case"remove":dc(`Chart.applySeries() - removing series at previous idx ${t.idx}`,t.series);break;case"no-op":n.push(t.series),dc(`Chart.applySeries() - no change to series at previous idx ${t.idx}`,t.series);break;default:{const{series:e,diff:i,idx:s}=t;dc(`Chart.applySeries() - applying series diff previous idx ${s}`,i,e),this.applySeriesValues(e,i),e.markNodeDataDirty(),n.push(e)}}return this.initSeriesDeclarationOrder(n),dc("Chart.applySeries() - final series instances",n),t.series=n,o?"series-grouping-change":a?"data-change":r?"updated":"no-op"}applyAxes(t,e,i,s,n=[]){if(!("axes"in e)||!e.axes)return!1;n=["axes[].type",...n];const a=e.axes.map(t=>"time"===t.type&&null!=t.unit?{...t,type:"unit-time"}:t);return"replaced"!==s&&t.axes.length===a.length&&t.axes.every((t,e)=>t.type===a[e].type)&&Ql(i)?(t.axes.forEach((t,e)=>{const s=Fe(i.axes?.[e]??{},a[e]);dc(`Chart.applyAxes() - applying axis diff idx ${e}`,s),We(t,s,{path:`axes[${e}]`,skip:n})}),!0):(dc(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${s}`),t.axes=this.createAxis(a,n),!0)}createSeries(t){const e=er.create(t.type,this.getModuleContext());return this.applySeriesOptionModules(e,t),this.applySeriesValues(e,t),e}applySeriesOptionModules(t,e){const i=t.createModuleContext(),s=t.getModuleMap();for(const n of h.byType("series-option"))n.optionsKey in e&&n.seriesTypes.includes(t.type)&&s.addModule(n,t=>t.moduleFactory(i))}applySeriesValues(t,e){const i=t.getModuleMap(),{type:s,data:n,listeners:a,seriesGrouping:o,showInMiniChart:r,...l}=e;for(const t of $o)if("series-option"===t.type&&t.optionsKey in l){const e=i.getModule(t.optionsKey);if(e){const i=l[t.optionsKey];delete l[t.optionsKey],e.properties.set(i)}}null!=l.visible&&(t.visible=l.visible),t.properties.set(l),"data"in e&&t.setOptionsData(n),a&&this.registerListeners(t,a,{nodeClick:"seriesNodeClick",nodeDoubleClick:"seriesNodeDoubleClick"}),"seriesGrouping"in e&&(t.seriesGrouping=null==o?void 0:{...t.seriesGrouping,...o})}createAxis(t,e){const i=[],s=this.getModuleContext();for(let n=0;n<t.length;n++){const a=t[n],o=Yo.create(a.type,s);this.applyAxisModules(o,a),We(o,a,{path:`axes[${n}]`,skip:e}),i.push(o)}return function(t){const e=[],i=[],s=[...Ul];for(const s of t)s instanceof Hl&&(Xl(s.position)?i.push(s.position):e.push(s));for(const t of e){let e;do{e=s.pop()}while(e&&i.includes(e));if(null==e)break;t.position=e}}(i),i}applyAxisModules(t,e){const i=t.createModuleContext(),s=t.getModuleMap();for(const n of h.byType("axis-option")){const a=null!=e[n.optionsKey];a!==s.isEnabled(n)&&(a?(s.addModule(n,t=>t.moduleFactory(i)),t[n.optionsKey]=s.getModule(n)):(s.removeModule(n),delete t[n.optionsKey]))}}registerListeners(t,e,i){t.clearEventListeners();for(const[n,a]of(0,s.jO)(e))if((0,s.Tn)(a)){const e=i?.[n];null==e?t.addEventListener(n,a):t.addEventListener(e,t=>{if(t?.type===e){const e=new Proxy(t,{get:(t,e,i)=>"type"===e?n:Reflect.get(t,e,i)});a(e)}else a(t)})}}};pc.chartsInstances=new WeakMap,r([li({newValue(t){this.destroyed||(this.ctx.domManager.setContainer(t),pc.chartsInstances.set(t,this))},oldValue(t){pc.chartsInstances.delete(t)}})],pc.prototype,"container",2),r([li({newValue(t){this.resize("width option",{inWidth:t})}})],pc.prototype,"width",2),r([li({newValue(t){this.resize("height option",{inHeight:t})}})],pc.prototype,"height",2),r([li({newValue(t){this.resize("minWidth option",{inMinWidth:t})}})],pc.prototype,"minWidth",2),r([li({newValue(t){this.resize("minHeight option",{inMinHeight:t})}})],pc.prototype,"minHeight",2),r([li({newValue(t){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:t})}})],pc.prototype,"overrideDevicePixelRatio",2),r([Ct],pc.prototype,"padding",2),r([Ct],pc.prototype,"seriesArea",2),r([Ct],pc.prototype,"keyboard",2),r([Ct],pc.prototype,"touch",2),r([Ct],pc.prototype,"mode",2),r([Ct],pc.prototype,"styleNonce",2),r([ai("chartCaptions.title")],pc.prototype,"title",2),r([ai("chartCaptions.subtitle")],pc.prototype,"subtitle",2),r([ai("chartCaptions.footnote")],pc.prototype,"footnote",2),r([Ct],pc.prototype,"suppressFieldDotNotation",2),r([Ct],pc.prototype,"loadGoogleFonts",2),r([li({changeValue(t,e){this.onAxisChange(t,e)}})],pc.prototype,"axes",2),r([li({changeValue(t,e){this.onSeriesChange(t,e)}})],pc.prototype,"series",2);var gc=pc,mc=x.create(!0,"opts"),yc="AG Charts - Chart was destroyed, cannot perform request.",fc=class{constructor(t,e,i){this.factoryApi=e,this.licenseManager=i,this.chart=t}async update(t){if(!this.chart)throw new Error(yc);return mc.group("AgChartInstance.update()",async()=>{this.factoryApi.update(t,this),await(this.chart?.waitForUpdate())})}async updateDelta(t){if(!this.chart)throw new Error(yc);return mc.group("AgChartInstance.updateDelta()",async()=>{this.factoryApi.updateUserDelta(this,t),await(this.chart?.waitForUpdate())})}getOptions(){if(!this.chart)throw new Error(yc);const t=Ge(this.chart.getOptions());for(const e of Object.keys(t))e.startsWith("_")&&delete t[e];return t}waitForUpdate(){if(!this.chart)throw new Error(yc);return this.chart.waitForUpdate()}async download(t){if(!this.chart)throw new Error(yc);const e=await this.prepareResizedChart(this,this.chart,t);try{e.chart?.download(t?.fileName,t?.fileFormat)}finally{e.destroy()}}async __toSVG(t){if(!this.chart)throw new Error(yc);const e=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...t});try{return e?.chart?.toSVG()}finally{e?.destroy()}}async getImageDataURL(t){if(!this.chart)throw new Error(yc);const e=await this.prepareResizedChart(this,this.chart,t);try{return e.chart.getCanvasDataURL(t?.fileFormat)}finally{e.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(t){const{chart:e}=this;if(!e)return;const i=this.getEnabledOriginators();i.includes(e.ctx.legendManager)?(await this.setStateOriginators(t,i.filter(t=>t!==e.ctx.zoomManager)),await this.setStateOriginators(t,[e.ctx.zoomManager])):await this.setStateOriginators(t,i)}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(t,e,i={}){const s=i.width??e.width??e.ctx.scene.canvas.width,n=i.height??e.height??e.ctx.scene.canvas.height,a=t.getState(),o=h.hasEnterpriseModules(),r={...e.chartOptions.processedOverrides,container:document.createElement("div"),width:s,height:n};null!=i.width&&null!=i.height&&(r.overrideDevicePixelRatio=1);const l=e.getOptions();o&&(r.animation={enabled:!1},this.licenseManager?.isDisplayWatermark()&&(r.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 c={...e.chartOptions.specialOverrides},d={...e.chartOptions.optionMetadata},u=this.factoryApi.create(l,r,c,d);await u.setState(a),u.chart?.ctx.zoomManager.updateZoom("chartProxy",e.ctx.zoomManager.getZoom()),u.chart?.ctx.legendManager.clearData(),u.chart?.ctx.legendManager.update(e.ctx.legendManager.getData()),e.series.forEach((t,e)=>{u.chart.series[e].visible=t.visible});const p=[];for(const t of e.modulesManager.legends())p.push(t.legend.pagination?.currentPage??0);for(const t of u.chart.modulesManager.legends()){const e=p.shift()??0;t.legend.pagination&&t.legend.pagination.setPage(e)}return u.chart?.update(0,{forceNodeDataRefresh:!0}),await u.waitForUpdate(),u}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:t,optionMetadata:e},ctx:{annotationManager:i,chartTypeOriginator:s,zoomManager:n,legendManager:a}}=this.chart,o=[];return"annotations"in t&&t.annotations?.enabled&&o.push(i),"price-volume"===e.presetType&&o.push(s),(t.navigator?.enabled||t.zoom?.enabled)&&o.push(n),"legend"in this.chart&&o.push(a),o}async setStateOriginators(t,e){this.factoryApi.caretaker.restore(t,...e),this.chart?.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await(this.chart?.waitForUpdate())}};fc.chartInstances=new WeakMap,r([li({oldValue(t){t.destroyed||(t.publicApi=void 0),fc.chartInstances.delete(t)},newValue(t){t&&(t.publicApi=this,fc.chartInstances.set(t,this))}})],fc.prototype,"chart",2);var xc=fc,bc=class extends l{constructor(t){super(),this.ctx=t,this.localeText=void 0}};r([hi(t=>{t.ctx.localeManager.setLocaleText(t.localeText)}),Ct],bc.prototype,"localeText",2),r([hi(t=>{t.ctx.localeManager.setLocaleTextFormatter(t.getLocaleText)}),Ct],bc.prototype,"getLocaleText",2);var vc={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new bc(t)};function Sc(t,e,i){if(null==i||0===i[0]&&1===i[1])return{ticks:t,count:t.length};const n=(0,s.qE)(0,Math.floor(i[0]*t.length),t.length),a=(0,s.qE)(0,Math.ceil(i[1]*t.length),t.length),o=e?t.length-a:n,r=e?t.length-n:a;return{ticks:t.slice(o,r),count:t.length}}var Mc=class t extends eo{constructor(){super(...arguments),this.type="band",this.index=void 0,this._domain=[]}static is(e){return e instanceof t}set domain(t){this._domain!==t&&(this.invalid=!0,this._domain=t,this.index=void 0)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...t){let e;const i=new Set;let s=!0;for(const n of t)i.has(n)||(i.add(n),null==e?e=kc(n):(s&&(s=Dc(n,e)),e=kc([...e,...n])));return e??(e=[]),{domain:e,animatable:s}}toDomain(t){}invert(t,e=!1){this.refresh();const i=e?this.bandwidth/2:0,s=this.invertNearestIndex(Math.max(0,t-i));return e||t===this.ordinalRange(s)?this.domain[s]:void 0}ticks(t,e=this.domain,i){return Sc(e,!1,i)}findIndex(t){let{index:e}=this;if(null==e){const{domain:t}=this;e=new Map;for(let i=0;i<t.length;i++)e.set(qa(t[i]),i);this.index=e}return e.get(qa(t))}};function kc(t){let e;const i=new Set;for(const s of t){const n=qa(s),a=i.size;i.add(n),i.size!==a?e?.push(s):e??(e=t.slice(0,i.size))}return e??t}function Dc(t,e){let i=-1;for(const s of t){const t=e.indexOf(s);if(-1===t)i=1/0;else{if(t<=i)return!1;i=t}}return!0}var wc=class t extends Hl{constructor(t,e=new Mc){super(t,e),this.groupPaddingInner=.1,this.includeInvisibleDomains=!0,this.nice=!1}static is(e){return e instanceof t}normaliseDataDomain(t){return{domain:t,clipped:!1}}updateScale(){super.updateScale();let{paddingInner:t,paddingOuter:e}=this;if(!(0,s.Bf)(t)||!(0,s.Bf)(e)){const i=this.reduceBandScalePadding();t??(t=i.inner),e??(e=i.outer)}this.scale.paddingInner=t??0,this.scale.paddingOuter=e??0}reduceBandScalePadding(){return this.boundSeries.reduce((t,e)=>{const i=e.getBandScalePadding?.();return i&&(t.inner>i.inner&&(t.inner=i.inner),t.outer<i.outer&&(t.outer=i.outer)),t},{inner:1/0,outer:-1/0})}};wc.className="CategoryAxis",wc.type="category",r([Ct],wc.prototype,"groupPaddingInner",2),r([Ct],wc.prototype,"paddingInner",2),r([Ct],wc.prototype,"paddingOuter",2);var Ic=wc,Cc=class t extends Mc{static is(e){return e instanceof t}normalizeDomains(...t){const{domain:e}=super.normalizeDomains(...t);return{domain:e,animatable:!1}}findIndex(t){return super.findIndex(t)??this.getMatchIndex(t)}getMatchIndex(t){const e=JSON.stringify(t),i=this._domain.find(t=>JSON.stringify(t)===e);if(null!=i)return super.findIndex(i)}};function Lc(t){if(0===t.length)return null;let e=1/0,i=-1/0;for(const s of t){const t=s instanceof Date?s.getTime():s;"number"==typeof t&&(t<e&&(e=t),t>i&&(i=t))}const s=[e,i];return s.every(isFinite)?s:null}function Ac(t,e,i){let s=!1;return t.length>2&&(t=Lc(t)??[NaN,NaN]),null!=e&&(s||(s=e>t[0]),t=[e,t[1]]),null!=i&&(s||(s=i<t[1]),t=[t[0],i]),t[0]>t[1]&&(t=[]),{extent:t,clipped:s}}var Tc=new WeakMap;function Nc(t,e){const i=JSON.stringify(t,null,0);return Tc.has(e)||Tc.set(e,new Map),Tc.get(e)?.has(i)||Tc.get(e)?.set(i,e(t)),Tc.get(e)?.get(i)}function Oc(t,e){const i=new Map,s={},n=new WeakMap;return(...a)=>{const o=0===a.length?[s]:((...t)=>t.map(t=>"object"==typeof t||"symbol"==typeof t?t:(i.has(t)||i.set(t,{v:t}),i.get(t))))(...a);let r=n;for(const t of o.slice(0,-1))r.has(t)||r.set(t,new WeakMap),r=r.get(t);const l=o.at(-1);let h=r.get(l);return h?e?.("hit",t,a):(h=t(...a),r.set(l,h),e?.("miss",t,a)),h}}function Rc(t,e=[0,0]){for(const i of t)"number"==typeof i&&(i<0&&(e[0]+=i),i>0&&(e[1]+=i));return e}function Ec(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:t=>Rc(t)}}function Pc(t,e){return{id:t,type:"aggregate",matchGroupIds:e?[e]:void 0,aggregateFunction:t=>Rc(t),groupAggregateFunction:(t,e=[0,0])=>(e[0]+=t?.[0]??0,e[1]+=t?.[1]??0,e)}}function Bc(t){return{id:t,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(t,e=[0,0])=>(e[0]+=t?.[0]??0,e[1]+=t?.[1]??0,e)}}function Fc(t,e){return{id:t,matchGroupIds:e?[e]:void 0,type:"aggregate",aggregateFunction:t=>Rc(t),groupAggregateFunction:(t,e=[0,0,-1])=>(e[0]+=t?.[0]??0,e[1]+=t?.[1]??0,e[2]++,e),finalFunction:(t=[0,0,0])=>{const e=t[0]+t[1];return e>=0?[0,e/t[2]]:[e/t[2],0]}}}function zc(t,e,i){const s={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(t,i=[])=>{const s=i[1]-i[0];return e.aggregateFunction(t).map(t=>t/s)}};return e.groupAggregateFunction&&(s.groupAggregateFunction=e.groupAggregateFunction),s}function Gc(t){return()=>{let e=0;return i=>(0,s.Bf)(i)?(e+=t?Math.max(0,i):i,e):i}}function _c(){return()=>{let t=0;return e=>{if(!(0,s.Bf)(e))return e;const i=t;return t+=e,i}}}function jc(t){return null!=t&&sl(t)}function Wc(t){return null!=t}function Vc(t){switch(t){case"number":case"log":case"ordinal-time":case"unit-time":case"time":case"color":return jc;default:return Wc}}function Kc(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function Yc(t,e,i={}){return{property:t,type:"key",valueType:Kc(e),validation:Vc(e),...i}}function $c(t,e,i={}){return{property:t,type:"value",valueType:Kc(e),validation:Vc(e),...i}}function Hc(t,e={}){return{property:t,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...e}}var Uc=function(t){return t};function Xc(...t){const e=t.filter(t=>null!=t);return 0===e.length?()=>Uc:1===e.length?e[0]:()=>{const t=e.map(t=>t());return(e,i)=>t.reduce((t,e)=>e(t,i),e)}}function Zc(t,e={}){const{min:i=-1/0,max:n=1/0,processor:a,...o}=e;return{type:"value",property:t,valueType:"range",validation:jc,processor:Xc(a,()=>t=>(0,s.Bf)(t)?(0,s.qE)(i,t,n):t),...o}}function qc(t,e,i={}){const{onlyPositive:s,processor:n,...a}=i;return{...$c(t,e,a),processor:Xc(n,Gc(s))}}function Qc(t,e,i={}){return{...$c(t,e,i),processor:_c()}}function Jc(t,e,i,s,n){return[$c(t,n,s),ud(s.groupId,e,i,s.separateNegative),...null!=s.rangeId?[(a=s.rangeId,o=s.groupId,{id:a,matchGroupIds:[o],type:"aggregate",aggregateFunction:t=>No.extendDomain(t)})]:[]];var a,o}function td(t,e,i){return[$c(t,e,i),gd(i.groupId)]}var ed={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let t=NaN;return(e=1/0,i)=>{const s="number"==typeof i[0]?i[0]:Number(i[0]),n=Math.abs(s-t);return t=s,!isNaN(n)&&n>0&&n<e?n:e}}},id={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer:()=>{let t=NaN;return(e=-1/0,i)=>{const s="number"==typeof i[0]?i[0]:Number(i[0]),n=Math.abs(s-t);return t=s,!isNaN(n)&&n>0&&n>e?n:e}}},sd={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:t}})=>t?.slice().sort((t,e)=>{for(let i=0;i<t.length;i++){const s=t[i]-e[i];if(0!==s)return s}return 0})};function nd({normaliseTo:t}){const e=(e,i)=>{if(0===i)return null;const s=(e??0)*t/i;return s>=0?Math.min(t,s):Math.max(-t,s)};return()=>()=>(t,i,s)=>{const n=function(t,e,i){const s=[0,0];for(const n of e){const e=t[n];for(const t of i.datumIndices[n]??[]){const i=e[t];if(null==i)continue;const n="number"==typeof i?i:Math.max(...i.map(t=>t??0)),a=n<0?0:1;s[a]=0===a?Math.min(s[a],n):Math.max(s[a],n)}}return Math.max(Math.abs(s[0]),s[1])}(t,i,s);for(const a of i)for(const i of s.datumIndices[a]??[]){const s=t[a],o=s[i];s[i]=null!=o?"number"==typeof o?e(o,n):o.map(t=>e(t,n)):void 0}}}function ad(t,e){return{type:"group-value-processor",matchGroupIds:t,adjust:Nc({normaliseTo:e},nd)}}function od({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:s}){const n=t[1]-t[0],a=(i,s,a)=>{const o=t[0]+(i-s)/a*n;return 0===a?e:o>=t[1]?t[1]:o<t[0]?t[0]:o};return()=>(e,n)=>{let[o,r]=e.domain.values[n];null!=i&&(o=i),null!=s&&(r=s);const l=r-o;e.domain.values[n]=[t[0],t[1]];const h=e.columns[n];for(let t=0;t<h.length;t+=1)h[t]=a(h[t],o,l)}}function rd(t,e,i,s,n){return{type:"property-value-processor",property:t,adjust:Nc({normaliseTo:e,rangeMin:s,rangeMax:n,zeroDomain:i},od)}}function ld(t,e,i,s){let n=3;if("category"===e.valueType)return i.length<t&&(n&=-2),n;let a=s[0]?.valueOf();for(let t=1;0!==n&&t<s.length;t++){const e=s[t]?.valueOf();(!Number.isFinite(e)||a>e)&&(n&=-3),Number.isFinite(e)&&a===e&&(n&=-2),a=e}return n}function hd(t){return{type:"processor",property:"animationValidation",calculate(e){const{keys:i,values:s}=e.defs,{input:{count:n},domain:{keys:a,values:o},keys:r,columns:l}=e;let h=3;if(0!==n){for(let t=0;0!==h&&t<i.length;t++)for(const e of i[t].scopes)h&=ld(n,i[t],a[t],r[t].get(e));for(let e=0;0!==h&&e<s.length;e++){const i=s[e];t?.includes(i.id)&&(h&=ld(n,i,o[e],l[e]))}}return{uniqueKeys:!!(1&h),orderedKeys:!!(2&h)}}}}function cd({mode:t,separateNegative:e}){return()=>()=>(i,n,a)=>{const o=[0,0];for(const r of n)for(const n of a.datumIndices[r]??[]){const a=i[r],l=a[n],h=(0,s.cI)(l)&&e?0:1;(0,s.Bf)(l)&&("normal"===t&&(o[h]+=l),a[n]=o[h],"trailing"===t&&(o[h]+=l))}}}function dd({mode:t,sum:e}){return()=>{const i=[];let n=!0;return()=>(a,o,r)=>{let l=0;for(const h of o){const o=a[h];for(const a of r.datumIndices[h]??[]){const r=o[a],c=n&&"current"===e?0:i[h];i[h]=r;const d="current"===e?r:c;(0,s.Bf)(r)&&(0,s.Bf)(c)?("normal"===t&&(l+=d),o[a]=l,"trailing"===t&&(l+=d)):o[a]=l}}n=!1}}}function ud(t,e,i,s=!1){let n;return n=e.startsWith("window")?Nc({mode:e.endsWith("-trailing")?"trailing":"normal",sum:i},dd):Nc({mode:e,separateNegative:s},cd),{type:"group-value-processor",matchGroupIds:[t],adjust:n}}function pd(){return()=>(t,e,i)=>{const s=new Float64Array(e.length);let n=0;for(const a of e){const e=t[a];for(const t of i.datumIndices[a]??[]){const i=e[t];s[n]=Number.isFinite(i)?i:NaN,n+=1,e[t]=s.subarray(0,n)}}}}function gd(t){return{type:"group-value-processor",matchGroupIds:[t],adjust:pd}}function md(t){return t.id??t.property}function yd(t,e,i,s,n){for(const{previousIndex:a,nextIndex:o}of i){const i=t[a],r=e[o];if(i[s]!==r[n])return!1}return!0}function fd(t,e,i=!0){return{type:"processor",property:"diff",calculate(s,n){const a=new Map,o=new Map,r=new Map,l=new Map,h=e.keys,c=s.keys,d=e.columns,u=s.columns,p=function(t,e,i){const s=new Map,n=e.defs.values;for(let e=0;e<n.length;e+=1){const i=n[e];if(!1===i.scopes?.includes(t))continue;const a=md(i);if(s.has(a))return;s.set(a,e)}const a=[],o=i.defs.values;for(let e=0;e<o.length;e+=1){const i=o[e];if(!1===i.scopes?.includes(t))continue;const n=md(i),r=s.get(n);if(null==r)return;s.delete(n),a.push({previousIndex:r,nextIndex:e})}if(0===s.size)return a}(t,e,s);if(null==p)return n;const g=Math.max(e.input.count,s.input.count);for(let n=0;n<g;n++){const g=n<e.input.count,m=n<s.input.count,y=g?Go(h,t,n):void 0,f=null!=y?xd(y):"",x=m?Go(c,t,n):void 0,b=null!=x?xd(x):"";if(m&&g&&f===b){yd(d,u,p,n,n)||r.set(b,n);continue}const v=l.get(b);null!=v?(!i&&yd(d,u,p,v,n)||(r.set(b,n),a.set(b,n)),l.delete(b)):m&&o.set(b,n);const S=o.get(f);null!=S?(!i&&yd(d,u,p,S,n)||(r.set(f,n),a.set(f,n)),o.delete(f)):g&&(r.delete(f),l.set(f,n))}const m={changed:o.size>0||r.size>0||l.size>0,added:new Set(o.keys()),updated:new Set(r.keys()),removed:new Set(l.keys()),moved:new Set(a.keys())};return{...n,[t]:m}}}}function xd(t,...e){let i;return i=(0,s.cy)(t)?t.map(t=>nl(t)).join("___"):nl(t),("string"==typeof i||"number"==typeof i||"boolean"==typeof i||i instanceof Date)&&e.length>0&&(i+=`___${e.join("___")}`),i}var bd=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(t,e){t>this.right&&(this.right=t),t<this.left&&(this.left=t),e>this.bottom&&(this.bottom=e),e<this.top&&(this.top=e)}},vd=class t{constructor(t="",e,i){this.label=t,this.parent=e,this.refId=i,this.position=0,this.subtreeLeft=NaN,this.subtreeRight=NaN,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.index=0,this.screen=0,this.depth=e?e.depth+1:0}insertTick(e,i){let s=this;for(let n=0;n<e.length;n++){const a=e[n],o=n!==e.length-1,{children:r}=s,l=r.find(t=>t.label===a);if(l&&o)s=l;else{const e=new t(a,s,i);e.index=r.length,r.push(e),o&&(s=e)}}}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((t,e)=>e!==this.index)??[]}};function Sd(t,e,i){const s=i/(e.index-t.index);e.change-=s,e.shift+=i,t.change+=s,e.prelim+=i,e.mod+=i}function Md(t,e,i){return e.getSiblings().indexOf(t.ancestor)>=0?t.ancestor:i}function kd(t,e){const i=t.getLeftSibling();if(i){let s=t,n=t,a=i,o=n.getLeftmostSibling(),r=n.mod,l=s.mod,h=a.mod,c=o.mod;for(;a.nextRight()&&n.nextLeft();){a=a.nextRight(),n=n.nextLeft(),o=o.nextLeft(),s=s.nextRight(),s.ancestor=t;const i=a.prelim+h-(n.prelim+r)+1;i>0&&(Sd(Md(a,t,e),t,i),r+=i,l+=i),h+=a.mod,r+=n.mod,c+=o.mod,l+=s.mod}a.nextRight()&&!s.nextRight()?s.mod+=h-l:(n.nextLeft()&&!o.nextLeft()&&(o.mod+=r-c),e=t)}return e}function Dd(t){const{children:e}=t;if(e.length){let[i]=e;for(const t of e)Dd(t),i=kd(t,i);!function({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}}(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 e=t.getLeftSibling();t.prelim=e?e.prelim+1:0}}function wd(t,e,i){t.position=t.prelim+e,i.insertNode(t);for(const s of t.children)wd(s,e+t.mod,i)}function Id(t){const{children:e}=t;let i=0;for(const t of e)Id(t),t.children.length?i+=t.leafCount:i++;t.leafCount=i,e.length?(t.subtreeLeft=e[0].subtreeLeft,t.subtreeRight=e[e.length-1].subtreeRight,t.position=(t.subtreeLeft+t.subtreeRight)/2):(t.subtreeLeft=t.position,t.subtreeRight=t.position)}function Cd(t){const e=new Ld,i=function(t){const e=t.reduce((t,e)=>t<e.length?e.length:t,0),i=new vd;for(let s=0;s<t.length;s++){const n=t[s];for(;n.length<e;)n.push("");i.insertTick(n,s)}return i}(t);return Dd(i),wd(i,-i.prelim,e),Id(i),e}var Ld=class{constructor(){this.dimensions=new bd,this.nodes=[],this.depth=0}insertNode(t){this.depth<t.depth&&(this.depth=t.depth),this.dimensions.update(t.position,t.depth),this.nodes.push(t)}scaling(t,e){let i=1;if(t>0){const{left:e,right:s}=this.dimensions;s!==e&&(i=t/(s-e))}return e&&(i*=-1),i}},Ad=class extends Lt{constructor(){super(...arguments),this.enabled=!0}};r([Ct],Ad.prototype,"enabled",2),r([Ct],Ad.prototype,"avoidCollisions",2),r([Ct],Ad.prototype,"color",2),r([Ct],Ad.prototype,"spacing",2),r([Ct],Ad.prototype,"rotation",2),r([Ct],Ad.prototype,"fontStyle",2),r([Ct],Ad.prototype,"fontWeight",2),r([Ct],Ad.prototype,"fontSize",2),r([Ct],Ad.prototype,"fontFamily",2);var Td=class extends Lt{constructor(){super(...arguments),this.enabled=!0}};r([Ct],Td.prototype,"enabled",2),r([Ct],Td.prototype,"width",2),r([Ct],Td.prototype,"stroke",2);var Nd=class extends Lt{constructor(){super(...arguments),this.label=new Ad,this.tick=new Td}};r([Ct],Nd.prototype,"label",2),r([Ct],Nd.prototype,"tick",2);var Od=class extends Ic{constructor(t){super(t,new Cc),this.tickScale=new Cc,this.depthOptions=new At(Nd),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:t}=this.tickTreeLayout,{range:e,step:i,inset:s,bandwidth:n}=this.scale,a=Math.abs(e[1]-e[0])-i,o=this.tickTreeLayout.scaling(a,e[0]>e[1]),r=s+n/2;let l=0;for(const e of t){const t=e.position*o;l>t&&(l=t),e.screen=t+r}for(const e of t)e.screen-=l}getDepthOptionsMap(t){const e=[],{depthOptions:i,label:s}=this,n=this.horizontal?0:-90;for(let a=0;a<t;a++)e.push(i[a]?.label.enabled??s.enabled?{enabled:!0,spacing:i[a]?.label.spacing??s.spacing,rotation:i[a]?.label.rotation??(a?n:s.rotation),avoidCollisions:i[a]?.label.avoidCollisions??s.avoidCollisions}:{enabled:!1,spacing:0,rotation:0,avoidCollisions:!1});return e}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((t,e)=>t.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:y.zero,spacing:0,separatorLayout:[],tickLabelLayout:[]};const{step:t}=this.scale,{title:e,label:i,range:n,depthOptions:a,horizontal:o}=this,{depth:r,nodes:l}=this.tickTreeLayout,h=Math.ceil(i.fontSize/t),c=o?-i.getSideFlag():i.getSideFlag(),d=[],u=new Map,p=new Pi,g=this.getDepthOptionsMap(r),m=c*g[0].spacing,f=(t,e)=>{const l=r-t.depth;if(!g[l]?.enabled||e%h!==0||!(0,s.r4)(t.screen,n))return!1;const c=this.formatTick(t.label,e-1,this.scale.domain),d=this.getLabelStyles({value:c,depth:l},a[l]?.label);return p.setProperties({...d,text:c,textAlign:"center",textBaseline:i.parallel?"hanging":"bottom",lineHeight:Ti.getLineHeight(d.fontSize),x:o?t.screen:m,y:o?m:t.screen,rotation:0}),!0},x={};l.forEach((t,e)=>{const i=r-t.depth;if(!f(t,e)||!p.getBBox())return;u.set(e,p.getBBox()),p.rotation=dt(g[i]?.rotation);const{width:s,height:n}=p.getBBox(),a=o?n:s;x[i]??(x[i]=0),x[i]<a&&(x[i]=a)});const b=Vl(),v=new Map;l.forEach((e,s)=>{if(0===s)return;const n=f(e,s),a=!e.children.length,l=r-e.depth;if(e.parent){const t=a?e.position:e.position-(e.leafCount-1)/2;if(!v.has(t)){const e=this.depthOptions[l]?.tick;let i=x[0];for(let t=0;t<=l;t++)i+=g[t].spacing,0!==t&&(i+=x[t]);v.set(t,{tickSize:i,tickStroke:e?.stroke,tickWidth:!1!==e?.enabled?e?.width:0})}}if(!n)return;const h=dt(g[l].rotation),{width:m,height:y}=u.get(s),S=(t=>{if(0===t)return 0;let e=x[0];for(let i=1;i<=t;i++)e+=g[i].spacing,i!==t&&(e+=x[i]);return e})(l);if(p.textAlign="end",p.textBaseline="middle",p.rotation=h,o?(p.x+=m/2,p.y+=(S+ct(m/2,y/2,h))*c,p.rotationCenterX=e.screen,p.rotationCenterY=p.y):(p.x+=S*c+ct((g[l].spacing*c+m)/2,i.mirrored?m:0,h),p.rotationCenterX=p.x-m/2,p.rotationCenterY=e.screen),g[l].avoidCollisions){const{width:i,height:n}=p.getBBox();if((o?i:n)>(a?t:e.leafCount*t))return void u.delete(s)}const{text:M=""}=p;d.push({text:M,visible:!0,range:this.scale.range,tickId:b(M),fill:p.fill,fontFamily:p.fontFamily,fontSize:p.fontSize,fontStyle:p.fontStyle,fontWeight:p.fontWeight,rotation:p.rotation,rotationCenterX:p.rotationCenterX,rotationCenterY:p.rotationCenterY,textAlign:p.textAlign,textBaseline:p.textBaseline,x:p.x,y:p.y}),u.set(s,Me.toCanvas(p))});const{enabled:S,stroke:M,width:k}=this.line;this.lineNode.datum=o?{x1:n[0],x2:n[1],y1:0,y2:0}:{x1:0,x2:0,y1:n[0],y2:n[1]},this.lineNode.setProperties({stroke:M,strokeWidth:S?k:0});const D=[...v.values()];D.push(D[0]);const w=[this.lineNodeBBox(),y.merge(u.values()),new y(0,0,D[0].tickSize*c,0)];let I=0;if(e.enabled){const t=y.merge(w);I=o?t.height:t.width,w.push(this.titleBBox(this.scale.domain,I))}return{bbox:y.merge(w),spacing:I,separatorLayout:D,tickLabelLayout:d}}update(){if(!this.computedLayout)return;this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:t,tick:e,gridLine:i,gridLength:s}=this,{separatorLayout:n,spacing:a}=this.computedLayout,{position:o,horizontal:r,gridPadding:l}=this,h="bottom"===o||"right"===o?-1:1,c=l,d=h*s-l,u=t.ticks({nice:!1,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0}).ticks.map((e,i)=>({tickId:xd(e,i),offset:Math.round(t.convert(e))}));this.gridLineGroupSelection.update(i.enabled&&s?u.map(({tickId:t,offset:e},s)=>{const[n,a,o,l]=r?[e,e,c,d]:[c,d,e,e],{style:h,width:u}=i,{stroke:p,lineDash:g}=h[s%h.length]??{};return{tickId:t,offset:e,x1:n,y1:o,x2:a,y2:l,stroke:p,strokeWidth:u,lineDash:g}}):[]),this.tickLineGroupSelection.update(e.enabled?u.map(({tickId:t,offset:i},s)=>{const{tickSize:a=this.getTickSize(),tickStroke:o=e.stroke,tickWidth:l=e.width}=n[s]??{},c=-h*a,[d,u,p,g]=r?[i,i,0,c]:[0,c,i,i];return{tickId:t,offset:i,x1:d,y1:p,x2:u,y2:g,stroke:o,strokeWidth:l,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateTickLines(),this.updateTitle(this.scale.domain,a),this.resetSelectionNodes()}calculateLayout(){const{separatorLayout:t,tickLabelLayout:e,spacing:i,bbox:s}=this.computeLayout();return this.computedLayout={separatorLayout:t,tickLabelLayout:e,spacing:i},{bbox:s,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(t=>t.visible).flatMap(e=>e.getDomain(t));this.dataDomain={domain:Lc(e)??this.filterDuplicateArrays(e),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(t=>(0,s.$r)((0,s.Gv)(t)&&"value"in t?t.value:t));this.tickTreeLayout=Cd(i);const n=[];for(const t of this.tickTreeLayout.nodes)t.leafCount||null==t.refId||n.push(this.dataDomain.domain[t.refId]);this.scale.domain=(0,s.EG)(this.dataDomain.domain,n),this.tickScale.domain=i.concat([[""]])}filterDuplicateArrays(t){const e=new Set;return t.filter(t=>{const i=(0,s.cy)(t)?JSON.stringify(t):t;return!e.has(i)&&(e.add(i),!0)})}};Od.className="GroupedCategoryAxis",Od.type="grouped-category",r([Ct],Od.prototype,"depthOptions",2);var Rd={2:(t,e)=>Math.log2(e),[Math.E]:(t,e)=>Math.log(e),10:(t,e)=>Math.log10(e)},Ed=(t,e)=>Math.log(e)/Math.log(t);function Pd(t,e,i){const s=Math.min(...e),n=Rd[t]??Ed;return s>=0?n(t,i):-n(t,-i)}var Bd={[Math.E]:(t,e)=>Math.exp(e),10:(t,e)=>e>=0?10**e:1/10**-e},Fd=(t,e)=>t**e;function zd(t,e,i){const s=Math.min(...e),n=Bd[t]??Fd;return s>=0?n(t,i):-n(t,-i)}var Gd=class t extends ha{constructor(t=[1,10],e=[0,1]){super(t,e),this.type="log",this.defaultClamp=!0,this.base=10,this.log=t=>Pd(this.base,this.domain,t),this.pow=t=>zd(this.base,this.domain,t)}static is(e){return e instanceof t}toDomain(t){return t}transform(t){const[e,i]=oa(this.domain);return e>=0!=i>=0?NaN:e>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[e,i]=oa(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,a=s>n?Math.ceil:Math.floor,o=s>n?Math.floor:Math.ceil;return[zd(i,e,a(Pd(i,e,s))),zd(i,e,o(Pd(i,e,n)))]}ticks({interval:t,tickCount:e=ha.defaultTickCount},i=this.domain,n){if(!i||i.length<2||e<1)return;const a=this.base,[o,r]=i,l=Math.min(o,r),h=Math.max(o,r);let c=this.log(l),d=this.log(h);if(t){const e=t=>t>=l&&t<=h,i=Math.min(Math.abs(t),Math.abs(d-c)),{ticks:s,count:a}=$r(c,d,i,n),o=s.map(this.pow).filter(e);if(!Hr(o.length,this.getPixelRange()))return{ticks:o,count:a}}if(!(0,s.Fq)(a)||d-c>=e){const t=Math.min(d-c,e),{ticks:i,count:s}=Gr(c,d,t,void 0,void 0,n);return{ticks:i.map(this.pow),count:s}}const u=[],p=l>0;c=Math.floor(c)-1,d=Math.round(d)+1;const g=ra(this.range)/e;let m=1/0;for(let t=c;t<=d;t++){const e=this.convert(this.pow(t+1));for(let i=1;i<a;i++){const s=p?i:a-i+1,n=this.pow(t)*s,o=this.convert(n),r=Math.abs(m-o),c=Math.abs(o-e);n>=l&&n<=h&&(1===i||r>=g&&c>=g||0===u.length)&&(u.push(n),m=o)}}return Sc(u,p,n)}tickFormatter({specifier:t}){return null!=t?(0,s.OR)(t):String}datumFormatter(t){return this.tickFormatter(t)}},_d=class t extends ha{constructor(){super([0,1],[0,1]),this.type="number"}static is(e){return e instanceof t}static getTickStep(t,e,i){const{interval:s,tickCount:n=ha.defaultTickCount,minTickCount:a,maxTickCount:o}=i;return s??Vr(t,e,n,a,o)}toDomain(t){return t}ticks({interval:t,tickCount:e=ha.defaultTickCount,minTickCount:i,maxTickCount:s},n=this.domain,a){if(!n||n.length<2||e<1||!n.every(isFinite))return{ticks:[],count:0};const[o,r]=n;if(t){const e=Math.abs(t);if(!Hr((r-o)/e,this.getPixelRange()))return $r(o,r,e,a)}return Gr(o,r,e,i,s,a)}niceDomain(e,i=this.domain){if(i.length<2)return[];const{tickCount:s=ha.defaultTickCount}=e;let[n,a]=i;if(1===s)[n,a]=Ur(n,a);else if(s>1){const s=n>a?Math.ceil:Math.floor,o=n>a?Math.floor:Math.ceil,r=4;for(let l=0;l<r;l++){const r=n,l=a,h=t.getTickStep(n,a,e),[c,d]=i;if(n=s(c/h)*h,a=o(d/h)*h,n===r&&a===l)break}}return[n,a]}tickFormatter({ticks:t,fractionDigits:e,specifier:i}){return null!=i?Yr(t,i):t=>Fs(t,e)}datumFormatter({ticks:t,fractionDigits:e,specifier:i}){return null!=i?Yr(t,i):t=>Fs(t,e+1)}},jd=class extends Hl{constructor(t,e=new _d){super(t,e)}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=Ac(t,e,i);return{domain:s,clipped:n}}};jd.className="NumberAxis",jd.type="number",r([Ct],jd.prototype,"min",2),r([Ct],jd.prototype,"max",2);var Wd=class extends jd{normaliseDataDomain(t){const{min:e,max:i}=this,{extent:n,clipped:a}=Ac(t,e,i);return n[0]<0&&n[1]>0||t[0]<0&&t[1]>0?(s.Vy.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:a}):0===n[0]||0===n[1]||0===t[0]||0===t[1]?(s.Vy.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:a}):{domain:n,clipped:a}}set base(t){this.scale.base=t}get base(){return this.scale.base}constructor(t){super(t,new Gd)}defaultDatumFormatter(t,e){return String(t)}defaultLabelFormatter(t,e){return String(t)}};Wd.className="LogAxis",Wd.type="log";var Vd=class extends Lt{constructor(){super(...arguments),this.enabled=!1,this.label=new xl,this.tick=new vl}};r([Ct],Vd.prototype,"enabled",2),r([Ct],Vd.prototype,"label",2),r([Ct],Vd.prototype,"tick",2);var Kd=class extends Hl{constructor(t){super(t,new Zr),this.parentLevel=new Vd,this.min=void 0,this.max=void 0,this.groupPaddingInner=.1}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}normaliseDataDomain(t){return Yd(t,this.min,this.max)}};function Yd(t,e,i){let s=!1;return"number"==typeof e&&(e=new Date(e)),"number"==typeof i&&(i=new Date(i)),t.length>2&&(t=Lc(t)?.map(t=>new Date(t))??[]),e instanceof Date&&(s||(s=e>t[0]),t=[e,t[1]]),i instanceof Date&&(s||(s=i<t[1]),t=[t[0],i]),t[0]>t[1]&&(t=[]),{domain:t,clipped:s}}Kd.className="TimeAxis",Kd.type="time",r([Ct],Kd.prototype,"parentLevel",2),r([Ct],Kd.prototype,"min",2),r([Ct],Kd.prototype,"max",2),r([Ct],Kd.prototype,"groupPaddingInner",2),r([Ct],Kd.prototype,"paddingInner",2),r([Ct],Kd.prototype,"paddingOuter",2);var $d=class extends Ic{constructor(t){super(t,new Tr),this.parentLevel=new Vd,this.min=void 0,this.max=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}updateScale(){super.updateScale(),this.scale.interval=this.unit}normaliseDataDomain(t){return Yd(t,this.min,this.max)}};$d.className="UnitTimeAxis",$d.type="unit-time",r([Ct],$d.prototype,"parentLevel",2),r([Ct],$d.prototype,"min",2),r([Ct],$d.prototype,"max",2),r([Ct],$d.prototype,"unit",2);var Hd=(t,{x0:e,y0:i,x1:s,y1:n,cx:a,cy:o},r,l)=>{if(l&&t.moveTo(e,i),e!==s||i!==n){const l=Math.atan2(i-o,e-a),h=Math.atan2(n-o,s-a);t.arc(a,o,r,l,h)}else t.lineTo(e,i)},Ud=1e-6,Xd=(t,e,i,s,n)=>{let a=!1,o=!1,r=s-Math.sqrt(Math.max(n**2-i**2,0)),l=0,h=0,c=i-Math.sqrt(Math.max(n**2-s**2,0));return r>t?(a=!0,r=t,l=i-Math.sqrt(Math.max(n**2-(s-t)**2))):r<Ud&&(r=0),c>e?(o=!0,h=s-Math.sqrt(Math.max(n**2-(i-e)**2)),c=e):c<Ud&&(c=0),{leading0:r,leading1:l,trailing0:h,trailing1:c,leadingClipped:a,trailingClipped:o}},Zd=(t,e,i,s,n,a,o)=>{let{topLeft:r,topRight:l,bottomRight:h,bottomLeft:c}=a;const d=Math.max(r+c,l+h),u=Math.max(r+l,c+h);if(d<=0&&u<=0)return void(null==o?t.rect(e,i,s,n):t.rect(o.x,o.y,o.width,o.height));if(null==o&&r===l&&r===h&&r===c)return void t.roundRect(e,i,s,n,r);if(s<0&&(e+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(null==o)o=new y(e,i,s,n);else{const t=Math.max(e,o.x),a=Math.min(e+s,o.x+o.width),r=Math.max(i,o.y),l=Math.min(i+n,o.y+o.height);o=new y(t,r,a-t,l-r)}const p=Math.max(d/n,u/s,1);p>1&&(r/=p,l/=p,h/=p,c/=p);let g,m,f,x,b=!0,v=!0,S=!0,M=!0;if(b){const t=Xd(o.height,o.width,Math.max(e+r-o.x,0),Math.max(i+r-o.y,0),r);t.leadingClipped&&(M=!1),t.trailingClipped&&(v=!1),g={x0:Math.max(o.x+t.leading1,o.x),y0:Math.max(o.y+t.leading0,o.y),x1:Math.max(o.x+t.trailing1,o.x),y1:Math.max(o.y+t.trailing0,o.y),cx:e+r,cy:i+r}}if(v){const t=Xd(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(e+s-l),0),l);t.leadingClipped&&(b=!1),t.trailingClipped&&(S=!1),m={x0:Math.min(o.x+o.width-t.leading0,o.x+o.width),y0:Math.max(o.y+t.leading1,o.y),x1:Math.min(o.x+o.width-t.trailing0,o.x+o.width),y1:Math.max(o.y+t.trailing1,o.y),cx:e+s-l,cy:i+l}}if(S){const t=Xd(o.height,o.width,Math.max(o.x+o.width-(e+s-h),0),Math.max(o.y+o.height-(i+n-h),0),h);t.leadingClipped&&(v=!1),t.trailingClipped&&(M=!1),f={x0:Math.min(o.x+o.width-t.leading1,o.x+o.width),y0:Math.min(o.y+o.height-t.leading0,o.y+o.height),x1:Math.min(o.x+o.width-t.trailing1,o.x+o.width),y1:Math.min(o.y+o.height-t.trailing0,o.y+o.height),cx:e+s-h,cy:i+n-h}}if(M){const t=Xd(o.width,o.height,Math.max(o.y+o.height-(i+n-c),0),Math.max(e+c-o.x,0),c);t.leadingClipped&&(S=!1),t.trailingClipped&&(b=!1),x={x0:Math.max(o.x+t.leading0,o.x),y0:Math.min(o.y+o.height-t.leading1,o.y+o.height),x1:Math.max(o.x+t.trailing0,o.x),y1:Math.min(o.y+o.height-t.trailing1,o.y+o.height),cx:e+c,cy:i+n-c}}let k=!1;b&&null!=g&&(Hd(t,g,r,!k),k||(k=!0)),v&&null!=m&&(Hd(t,m,l,!k),k||(k=!0)),S&&null!=f&&(Hd(t,f,h,!k),k||(k=!0)),M&&null!=x&&Hd(t,x,c,!k),t.closePath()},qd=class extends vh{constructor(){super(...arguments),this.borderPath=new Jt,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=de.defaultStyles.strokeWidth,this.effectiveStrokeWidth=de.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||Boolean(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:t,borderPath:e,crisp:i,topLeftCornerRadius:s,topRightCornerRadius:n,bottomRightCornerRadius:a,bottomLeftCornerRadius:o}=this;let{x:r,y:l,width:h,height:c,strokeWidth:d,clipBBox:u}=this;const p=1/(this.layerManager?.canvas.pixelRatio??1);let g=1;if(t.clear(!0),e.clear(!0),i&&(h<=p&&(g*=h/p),c<=p&&(g*=c/p),h=this.align(r,h),c=this.align(l,c),r=this.align(r),l=this.align(l),u=null!=u?new y(this.align(u.x),this.align(u.y),this.align(u.x,u.width),this.align(u.y,u.height)):void 0),d)if(h<p){const t=r+p/2;e.moveTo(t,l),e.lineTo(t,l+c),d=p,this.borderClipPath=void 0}else if(c<p){const t=l+p/2;e.moveTo(r,t),e.lineTo(r+h,t),d=p,this.borderClipPath=void 0}else if(d<h&&d<c){const i=d/2;r+=i,l+=i,h-=d,c-=d;const p=u?.clone().shrink(i),g={topLeft:s>0?s-d:0,topRight:n>0?n-d:0,bottomRight:a>0?a-d:0,bottomLeft:o>0?o-d:0};this.borderClipPath=void 0,h>0&&c>0&&(null==p||p?.width>0&&p?.height>0)&&(Zd(t,r,l,h,c,g,p),Zd(e,r,l,h,c,g,p))}else this.borderClipPath=this.borderClipPath??new Jt,this.borderClipPath.clear(!0),this.borderClipPath.rect(r,l,h,c),e.rect(r,l,h,c);else{const e={topLeft:s,topRight:n,bottomRight:a,bottomLeft:o};this.borderClipPath=void 0,Zd(t,r,l,h,c,e,u)}if([s,n,a,o].every(t=>0===t)){const t=this.getBBox();this.hittester=t.containsPoint.bind(t),this.distanceSquared=(t,e)=>this.getBBox().distanceSquared(t,e)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=d,this.lastUpdatePathStrokeWidth=d,this.microPixelEffectOpacity=g}computeBBox(){const{x:t,y:e,width:i,height:s,clipBBox:n}=this;return n?.clone()??new y(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)}applyFillAndAlpha(t){super.applyFillAndAlpha(t),t.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(t){super.applyStrokeAndAlpha(t),t.globalAlpha*=this.microPixelEffectOpacity}renderStroke(t){const{stroke:e,effectiveStrokeWidth:i}=this;if(e&&i){const{globalAlpha:e}=t,{lineDash:s,lineDashOffset:n,lineCap:a,lineJoin:o,borderPath:r,borderClipPath:l}=this;l&&t.clip(l.getPath2D()),this.applyStrokeAndAlpha(t),t.lineWidth=i,s&&t.setLineDash(s),n&&(t.lineDashOffset=n),a&&(t.lineCap=a),o&&(t.lineJoin=o),t.stroke(r.getPath2D()),t.globalAlpha=e}}};qd.className="Rect",r([H()],qd.prototype,"x",2),r([H()],qd.prototype,"y",2),r([H()],qd.prototype,"width",2),r([H()],qd.prototype,"height",2),r([H()],qd.prototype,"topLeftCornerRadius",2),r([H()],qd.prototype,"topRightCornerRadius",2),r([H()],qd.prototype,"bottomRightCornerRadius",2),r([H()],qd.prototype,"bottomLeftCornerRadius",2),r([U({equals:c.equals})],qd.prototype,"clipBBox",2),r([H()],qd.prototype,"crisp",2);var Qd=class extends l{constructor(t){super(),this.ctx=t,this.rectNode=new qd,this.textNode=new Ri,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",t=>this.onLayoutComplete(t)))}createNode(){return new Ie({name:"background",zIndex:0})}onLayoutComplete(t){const{width:e,height:i}=t.chart;this.rectNode.width=e,this.rectNode.height=i}};r([Ct,ri("node","visible")],Qd.prototype,"visible",2),r([Ct,ri("rectNode","fill")],Qd.prototype,"fill",2),r([Ct],Qd.prototype,"image",2),r([Ct,ri("textNode")],Qd.prototype,"text",2);var Jd={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Qd(t)};function tu({orientation:t,bboxes:e,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:a=0,forceResult:o=!1}){const r="horizontal"===t,l={max:r?s:i,fn:r?t=>t.width:t=>t.height,padding:r?a:n},h={max:r?i:s,fn:r?t=>t.height:t=>t.width,padding:r?n:a};let c=0;const d=[];for(;c<e.length;){const t=eu(e.slice(c),c,l,h,o);if(!t)return;c+=t.processedBBoxCount,d.push(t.pageIndices)}return function(t,e,i,s,n){let a=0,o=0;return{pages:t.map(t=>{"horizontal"===e&&(t=function(t){const e=[];for(const i of t[0])e.push([]);return t.forEach((t,i)=>{t.forEach((t,s)=>{e[s][i]=t})}),e}(t));let r=0;const l=t.map(t=>{const e=t.map(t=>(r=Math.max(t,r),i[t]));let a=0,o=0;return e.forEach(t=>{a+=t.height+s,o=Math.max(o,t.width+n)}),{indices:t,bboxes:e,columnHeight:Math.ceil(a),columnWidth:Math.ceil(o)}});let h=0,c=0;return l.forEach(t=>{h+=t.columnWidth,c=Math.max(c,t.columnHeight)}),a=Math.max(h,a),o=Math.max(c,o),{columns:l,startIndex:t[0][0],endIndex:r,pageWidth:h,pageHeight:c}}),maxPageWidth:a,maxPageHeight:o}}(d,t,e,n,a)}function eu(t,e,i,s,n){let a=function(t,e){const i=t.length;let s=0;for(let n=0;n<i;n++)if(s+=e.fn(t[n])+e.padding,s>e.max)return i/n<2?Math.ceil(i/2):n;return i}(t,i);if(a<1){if(!n)return;a=1}let o=a;for(;o>=1;){const a=iu(t,e,o,i,s,n);if(null==a&&o<=1)return;if(null!=a){if("number"!=typeof a)return{processedBBoxCount:a.length*a[0].length,pageIndices:a};if(a<=1)return;o=a<o&&a>1?a:o,o--}else o--}}function iu(t,e,i,s,n,a){const o=[];let r=0,l=0,h=[];const c=[];for(let d=0;d<t.length;d++){const u=(d+i)%i;0===u&&(r+=l,l=0,h.length>0&&o.push(h),h=[]);const p=s.fn(t[d])+s.padding;c[u]=Math.max(c[u]??0,p),l=Math.max(l,n.fn(t[d])+n.padding);const g=r+l,m=!a||o.length>0;if(g>n.max&&m){h=[];break}if(c.reduce((t,e)=>t+e,0)>s.max&&!a)return c.length<i?c.length:void 0;h.push(d+e)}return h.length>0&&o.push(h),o.length>0?o:void 0}var su=class extends Lt{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};r([Ct],su.prototype,"color",2),r([Ct],su.prototype,"fontStyle",2),r([Ct],su.prototype,"fontWeight",2),r([Ct],su.prototype,"fontSize",2),r([Ct],su.prototype,"fontFamily",2);var nu=class extends Lt{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};r([Ct],nu.prototype,"size",2),r([Ct],nu.prototype,"fill",2),r([Ct],nu.prototype,"fillOpacity",2),r([Ct],nu.prototype,"stroke",2),r([Ct],nu.prototype,"strokeWidth",2),r([Ct],nu.prototype,"strokeOpacity",2);var au=class extends Lt{constructor(t){super(),this.parent=t,this.shape="triangle",this.size=15,this.padding=8}};r([li({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],au.prototype,"shape",2),r([Ct],au.prototype,"size",2),r([Ct],au.prototype,"padding",2);var ou=class extends Lt{constructor(t,e){super(),this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.id=(0,s.sX)(this),this.marker=new au(this),this.activeStyle=new nu,this.inactiveStyle=new nu,this.highlightStyle=new nu,this.label=new su,this.group=new Ae({name:"pagination"}),this.labelNode=new Ri,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 Ph,this.previousButton=new Ph,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){this._orientation=t,"horizontal"===t?(this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2):(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+2*(this.marker.size/2+this.marker.padding)}updateLabel(){const{currentPage:t,totalPages:e,labelNode:i,label:{color:s,fontStyle:n,fontWeight:a,fontSize:o,fontFamily:r}}=this;i.text=`${t+1} / ${e}`,i.fill=s,i.fontStyle=n,i.fontWeight=a,i.fontSize=o,i.fontFamily=r}updateMarkers(){const{nextButton:t,previousButton:e,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:a,highlightStyle:o,highlightActive:r}=this,l=(t,e)=>e?a:t===r?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=0===e,s=t===e-1,n=0===t;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}setPage(t){t=(0,s.qE)(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(),"next"!==e||this.nextButtonDisabled?"previous"!==e||this.previousButtonDisabled||(this.decrementPage(),this.onPaginationChanged()):(this.incrementPage(),this.onPaginationChanged())}onMouseHover(t){this.highlightActive=t,this.updateMarkers(),this.chartUpdateCallback(7)}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(7)}attachPagination(t){t.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){return{prev:Me.toCanvas(this.previousButton),next:Me.toCanvas(this.nextButton)}}};ou.className="Pagination",r([Ct],ou.prototype,"marker",2),r([Ct],ou.prototype,"activeStyle",2),r([Ct],ou.prototype,"inactiveStyle",2),r([Ct],ou.prototype,"highlightStyle",2),r([Ct],ou.prototype,"label",2);var ru=class{constructor(t,e){this.dirty=!0,this.destroyFns=new $i,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=(0,s.n)("p"),this.itemDescription.style.display="none",this.itemDescription.id=(0,s.wW)(),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,a=e.localeManager,o=i.length;i.each((t,i,r)=>{t.proxyButton?.destroy(),t.proxyButton=e.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(a,s.getItemLabel(i),r,o),ariaChecked:!!t.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const l=t.proxyButton;l.addListener("click",e=>n.onClick(e.sourceEvent,t.datum,l)),l.addListener("dblclick",e=>n.onDoubleClick(e.sourceEvent,t.datum)),l.addListener("mouseenter",e=>n.onHover(e.sourceEvent,t)),l.addListener("mouseleave",()=>n.onLeave()),l.addListener("contextmenu",e=>n.onContextClick(e,t)),l.addListener("blur",()=>n.onLeave()),l.addListener("focus",e=>n.onHover(e.sourceEvent,t)),l.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=Me.toCanvas(e);this.itemList.setBounds(n);const a=Math.max(...t.nodes().map(t=>t.getBBox().height));t.each((t,e)=>{if(t.proxyButton){const e=t.pageIndex===i.currentPage,{x:o,y:r,height:l,width:h}=Me.toCanvas(t),c=(a-l)/2,d={x:o-n.x,y:r-c-n.y,height:a,width:h},u=s&&e;t.proxyButton.setCursor("pointer"),t.proxyButton.setEnabled(u),t.proxyButton.setPointerEvents(u?void 0:"none"),t.proxyButton.setBounds(d)}})}updatePaginationProxyButtons(t,e){const{pagination:i}=t;if(this.paginationGroup.setHidden(!i.visible),e&&"ctx"in t){const{ctx:e,oldPages:s,newPages:n}=t,a=(s?.length??n.length)>1,o=n.length>1;a!==o&&(o?(this.prevButton=e.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",e=>this.onPageButton(t,e,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0)),this.nextButton??(this.nextButton=e.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup})),this.nextButton.addListener("click",e=>this.onPageButton(t,e,"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(0!==i.currentPage),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[a,o]=[e[s],t[s]];return a.id!==o.id})}onLocaleChanged(t,e,i){const s=e.length;e.each(({proxyButton:e},n,a)=>{const o=e?.getElement();if(null!=o){const e=i.getItemLabel(n);o.textContent=this.getItemAriaText(t,e,a,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 lu(t,e,i,s){const n={defaultPrevented:!1,apiEvent:{type:t,itemId:e,seriesId:i,event:s,preventDefault:()=>n.defaultPrevented=!0}};return n}var hu=class extends(ve(Ie)){constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new Ie({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new Ri),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new Ph({zIndex:1})),this.line=this.symbolsGroup.appendChild(new pr({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()}getTextMeasureBBox(){return this.layout(),y.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const t=this.enabled?1:.5;this.label.opacity=t,this.opacity=t}layout(){const{marker:t,line:e,length:i,isCustomMarker:s}=this;let n=0,a=0;if(t.visible){const{size:e}=t,o=Ph.anchor(t.shape);n=(o.x-.5)*e+i/2,a=(o.y-.5)*e,s?(t.x=0,t.y=0,t.translationX=n,t.translationY=a):(t.x=n,t.y=a,t.translationX=0,t.translationY=0)}e.visible&&(e.x1=0,e.x2=i,e.y1=0,e.y2=0)}preRender(t){const e=super.preRender(t);return this.layout(),e}layoutLabel(){const{length:t,spacing:e}=this;this.label.x=t+e}computeBBox(){return this.layout(),super.computeBBox()}};hu.className="MarkerLabel",r([ri("label")],hu.prototype,"text",2),r([ri("label")],hu.prototype,"fontStyle",2),r([ri("label")],hu.prototype,"fontWeight",2),r([ri("label")],hu.prototype,"fontSize",2),r([ri("label")],hu.prototype,"fontFamily",2),r([ri("label","fill")],hu.prototype,"color",2),r([hi(t=>t.layoutLabel())],hu.prototype,"spacing",2),r([hi(t=>t.layoutLabel())],hu.prototype,"length",2),r([H()],hu.prototype,"isCustomMarker",2);var cu=class extends Lt{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"}};r([Ct],cu.prototype,"maxLength",2),r([Ct],cu.prototype,"color",2),r([Ct],cu.prototype,"fontStyle",2),r([Ct],cu.prototype,"fontWeight",2),r([Ct],cu.prototype,"fontSize",2),r([Ct],cu.prototype,"fontFamily",2),r([Ct],cu.prototype,"formatter",2);var du=class extends Lt{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};r([Ct],du.prototype,"shape",2),r([Ct],du.prototype,"size",2),r([Ct],du.prototype,"padding",2),r([Ct],du.prototype,"strokeWidth",2),r([Ct],du.prototype,"enabled",2);var uu=class extends Lt{};r([Ct],uu.prototype,"strokeWidth",2),r([Ct],uu.prototype,"length",2);var pu=class extends Lt{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new du,this.label=new cu,this.line=new uu}};r([Ct],pu.prototype,"maxWidth",2),r([Ct],pu.prototype,"paddingX",2),r([Ct],pu.prototype,"paddingY",2),r([Ct],pu.prototype,"showSeriesStroke",2),r([Ct],pu.prototype,"marker",2),r([Ct],pu.prototype,"label",2),r([Ct],pu.prototype,"line",2);var gu=class extends Lt{};r([Ct],gu.prototype,"legendItemClick",2),r([Ct],gu.prototype,"legendItemDoubleClick",2);var mu={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1},yu={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:0,rotation:0,scale:1},fu={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},xu=class extends Lt{constructor(t){super(),this.ctx=t,this.id=(0,s.sX)(this),this.group=new Ae({name:"legend",zIndex:14}),this.itemSelection=ur.select(this.group,hu),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 pu,this.listeners=new gu,this.enabled=!0,this.position="bottom",this.spacing=20,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.pagination=new ou(e=>t.updateService.update(e),t=>this.updatePageNumber(t)),this.pagination.attachPagination(this.group);const{items:e}=t.contextMenuRegistry.builtins;e["toggle-series-visibility"].action=t=>this.contextToggleVisibility(t),e["toggle-other-series"].action=t=>this.contextToggleOtherSeries(t),this.destroyFns.push(t.legendManager.addListener("legend-change",this.onLegendDataChange.bind(this))),this.destroyFns.push(()=>delete e["toggle-series-visibility"].action,()=>delete e["toggle-other-series"].action,t.layoutManager.registerElement(1,t=>this.positionLegend(t)),t.localeManager.addListener("locale-changed",()=>this.onLocaleChanged()),()=>this.group.remove()),this.domProxy=new ru(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(t.legendManager)}set data(t){O(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(t=>!t.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(){return this.orientation??"horizontal"}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(t){t.appendChild(this.group)}getItemLabel(t){const{formatter:e}=this.item.label;if(e){const i=t.datum;return this.cachedCallWithContext(e,{itemId:t.itemId,value:t.label.text,seriesId:t.seriesId,...i&&{datum:i}})}return t.label.text}calcLayout(t,e){const{paddingX:i,paddingY:s,label:n,maxWidth:a,label:{maxLength:o=1/0,fontStyle:r,fontWeight:l,fontSize:h,fontFamily:c}}=this.item,d=[...this.data];this.reverseOrder&&d.reverse(),this.itemSelection.update(d);const u=[],p=Ti.toFontString(n),g=a??.8*t,{markerWidth:m,anyLineEnabled:y}=this.calculateMarkerWidth();if(this.itemSelection.each((t,e)=>{t.fontStyle=r,t.fontWeight=l,t.fontSize=h,t.fontFamily=c;const i=this.updateMarkerLabel(t,e,m,y),s=e.itemId??e.id,n=(this.getItemLabel(e)??"<unknown>").replace(/\r?\n/g," ");t.text=this.truncate(n,o,g,i,p,s),u.push(t.getTextMeasureBBox())}),t=Math.max(1,t),e=Math.max(1,e),!isFinite(t))return{};const f=this.size,x=this.oldSize;f[0]=t,f[1]=e,f[0]===x[0]&&f[1]===x[1]||(x[0]=f[0],x[1]=f[1]);const{pages:b,maxPageHeight:v,maxPageWidth:S}=this.updatePagination(u,t,e),M=this.pages;this.pages=b,this.maxPageSize=[S-i,v-s];const k=this.pagination.currentPage,D=this.pages[k];return this.pages.length<1||!D?(this.visible=!1,{oldPages:M}):(this.visible=!0,this.updatePositions(k),this.update(),{oldPages:M})}isCustomMarker(t,e){return t&&void 0!==e&&"string"!=typeof e}calcSymbolsEnabled(t){const{showSeriesStroke:e,marker:i}=this.item,s=!!i.enabled||!e||(t.marker.enabled??!0);return{markerEnabled:s,lineEnabled:!(!t.line||!e),isCustomMarker:this.isCustomMarker(s,t.marker.shape)}}calcSymbolsLengths(t,e,i){const{marker:s,line:n}=this.item;let a;const{shape:o}=t.marker;if(this.isCustomMarker(e,o)){const t=new Ph;t.shape=o,t.updatePath();const e=t.getBBox();a=Math.max(e.width,e.height)}return{markerLength:e?s.size:0,lineLength:i?n.length??25:0,customMarkerSize:a}}calculateMarkerWidth(){let t=0,e=!1;return this.itemSelection.each((i,s)=>{const{symbol:n}=s,{lineEnabled:a,markerEnabled:o}=this.calcSymbolsEnabled(n),{markerLength:r,lineLength:l,customMarkerSize:h=-1/0}=this.calcSymbolsLengths(n,o,a);t=Math.max(t,l,h,r),e||(e=a)}),{markerWidth:t,anyLineEnabled:e}}updateMarkerLabel(t,e,i,s){const{marker:n,paddingX:a}=this.item,{symbol:o}=e;let r=a;const{markerEnabled:l,isCustomMarker:h}=this.calcSymbolsEnabled(o),c=n.padding;(l||s)&&(r+=c+i);const{marker:d,line:u}=t;return d.visible=l,d.visible&&(d.shape=n.shape??o.marker.shape??"square",d.size=n.size,mh(d,this.getMarkerStyles(o))),u.visible=s,u.visible&&mh(u,this.getLineStyles(o)),t.length=i,t.spacing=c,t.isCustomMarker=h,r}truncate(t,e,i,s,n,a){let o=!1;t.length>e&&(t=t.substring(0,e),o=!0);const r=Li.getMeasurer({font:n}),l=Bi.truncateLine(t,r,i-s,o);return l.endsWith(Ti.EllipsisChar)?this.truncatedItems.add(a):this.truncatedItems.delete(a),l}updatePagination(t,e,i){const n=this.getOrientation(),a=Math.min(this.paginationTrackingIndex,t.length);this.pagination.orientation=n,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:o,maxPageHeight:r,maxPageWidth:l,paginationBBox:h,paginationVertical:c}=this.calculatePagination(t,e,i),d=o.findIndex(t=>t.endIndex>=a);this.pagination.currentPage=(0,s.qE)(0,d,o.length-1);const{paddingX:u,paddingY:p}=this.item,g=l-u,m=r-p;let y=0,f=-h.y-this.item.marker.size/2;c?f+=m+8:(y+=-h.x+g+8,f+=(m-h.height)/2),this.pagination.translationX=y,this.pagination.translationY=f,this.pagination.update(),this.pagination.updateMarkers();let x=0;return this.itemSelection.each((t,e,i)=>{i>(o[x]?.endIndex??1/0)&&x++,t.pageIndex=x}),{maxPageHeight:r,maxPageWidth:l,pages:o}}calculatePagination(t,e,i){const{paddingX:n,paddingY:a}=this.item,o=this.getOrientation(),r=["left","right"].includes(this.position);let l=this.pagination.getBBox(),h=new y(0,0,0,0),c=[],d=0,u=0,p=0;const g=t=>t.width===l.width&&t.height===l.height,m=void 0!==this.maxWidth&&void 0!==this.maxHeight;do{if(p++>10){s.Vy.warn("unable to find stable legend layout.");break}l=h;const g=e-(r?0:l.width),y=tu({orientation:o,bboxes:t,maxHeight:i-(r?l.height:0),maxWidth:g,itemPaddingY:a,itemPaddingX:n,forceResult:m});c=y?.pages??[],d=y?.maxPageWidth??0,u=y?.maxPageHeight??0;const f=c.length;if(this.pagination.visible=f>1,this.pagination.totalPages=f,this.pagination.update(),this.pagination.updateMarkers(),h=this.pagination.getBBox(),!this.pagination.visible)break}while(!g(h));return{maxPageWidth:d,maxPageHeight:u,pages:c,paginationBBox:h,paginationVertical:r}}updatePositions(t=0){const{item:{paddingY:e},itemSelection:i,pages:s}=this;if(s.length<1||!s[t])return;const{columns:n,startIndex:a,endIndex:o}=s[t];let r=0,l=0;const h=n.length,c=n[0].indices.length,d="horizontal"===this.getOrientation(),u=n[0].bboxes[0].height+e,p=[];i.each((t,e,i)=>{if(i<a||i>o)return void(t.visible=!1);const s=i-a;let g,m;d?(g=s%h,m=Math.floor(s/h)):(g=Math.floor(s/c),m=s%c),t.visible=!0;const y=n[g];y&&(l=Math.floor(u*m),r=Math.floor(p[m]??0),p[m]=(p[m]??0)+y.columnWidth,t.translationX=r,t.translationY=l)})}updatePageNumber(t){const{itemSelection:e,group:i,pagination:s,pages:n,toggleSeries:a}=this,{startIndex:o,endIndex:r}=n[t];0===o?this.paginationTrackingIndex=0:t===n.length-1?this.paginationTrackingIndex=r:this.paginationTrackingIndex=Math.floor((o+r)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(t),this.domProxy.onPageChange({itemSelection:e,group:i,pagination:s,interactive:a}),this.ctx.updateService.update(7)}update(){const{label:{color:t}}=this.item;this.itemSelection.each((e,i)=>{e.setEnabled(i.enabled),e.color=t}),this.updateContextMenu()}updateContextMenu(){this.ctx.contextMenuRegistry.setVisible("toggle-series-visibility",this.toggleSeries),this.ctx.contextMenuRegistry.setVisible("toggle-other-series",this.toggleSeries)}getLineStyles(t){const{stroke:e,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=t.line??{},a=Math.min(2,s??1);return{stroke:e,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??a,lineDash:n}}getMarkerStyles({marker:t}){const{fill:e,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:a,lineDash:o,lineDashOffset:r}=t,l=Math.min(2,a??1);return re(e)&&(e.width=8,e.height=8,e.padding=1,e.strokeWidth=Math.min(2,e.strokeWidth??2)),le(e)&&(e.fit="contain",e.width=void 0,e.height=void 0,e.repeat="no-repeat"),ph({fill:e,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:o,lineDashOffset:r},mu,yu,fu)}computePagedBBox(){const t=Ie.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(e=>e.datum?.itemId===t.itemId)[0]??{};if(void 0===e||void 0===i)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{sourceEvent:i}=t,s=e.datum;this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!1:this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!0;const n=this.ctx.chartService.series.length>1&&!0!==this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries;this.ctx.contextMenuRegistry.setVisible("toggle-other-series",n);const{offsetX:a,offsetY:o}=i,{x:r,y:l}=Me.toCanvasPoint(e,a,o);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:t,canvasX:r,canvasY:l},{legendItem:s})}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:a},preventHidingAll:o,toggleSeries:r}=this;if(!e)return!1;const{legendType:l,seriesId:h,itemId:c,enabled:d}=e,u=n.series.find(t=>t.id===h);if(!u)return!1;let p=d;const g=lu("click",c,u.id,t);return s?.(g.apiEvent),g.defaultPrevented||(r&&(p=!d,o&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.chartEventManager.legendItemClick(l,u,c,p,e.legendItemName)),p?a.updateHighlight(this.id,{series:u,itemId:c,datum:void 0,datumIndex:void 0}):a.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(!e)return!1;const{legendType:a,id:o,itemId:r,seriesId:l}=e,h=s.series.find(t=>t.id===o);if(!h)return!1;const c=lu("dblclick",r,h.id,t);if(i?.(c.apiEvent),c.defaultPrevented)return!0;if(n){const t=s.series.flatMap(t=>t.getLegendData("category"));let e=0;const i=new Set;for(const s of t)s.enabled&&(e+=1,null!=s.legendItemName&&i.add(s.legendItemName));i.size>0&&(e=i.size);const n=t.find(t=>t.itemId===r&&t.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(a,h,r,n?.enabled??!1,e,n?.legendItemName)}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(t,e){let i;return t instanceof FocusEvent?i=Me.toCanvas(e).computeCenter():(t.preventDefault(),i=Me.toCanvasPoint(e,t.offsetX,t.offsetY)),{canvasX:i.x,canvasY:i.y,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(t=>t.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const s=this.toTooltipMeta(t,e);this.ctx.tooltipManager.updateTooltip(this.id,s,[{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:a}=e,[o,r]=this.calculateLegendDimensions(e),{oldPages:l}=this.calcLayout(o,r),h=this.computePagedBBox(),c=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return a-h.height;default:return n-h.width}};if(this.visible){const t=this.spacing;let o,r;switch(this.position){case"top":case"bottom":o=(n-h.width)/2,r=c(),e.shrink(h.height+t,this.position);break;default:o=c(),r=(a-h.height)/2,e.shrink(h.width+t,this.position)}this.group.translationX=Math.floor(i+o-h.x),this.group.translationY=Math.floor(s+r-h.y)}return l}positionLegendDOM(t){const{ctx:e,itemSelection:i,pagination:s,pages:n,toggleSeries:a,group:o,listeners:{legendItemClick:r,legendItemDoubleClick:l}}=this,h=this.visible&&this.enabled,c=a||null!=l||null!=r;this.domProxy.update({visible:h,interactive:c,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;let n,a;switch(this.position){case"top":case"bottom":{const t=s<1?Math.min(.5,1/s*.2):.2;n=this.maxWidth?Math.min(this.maxWidth,e):e,a=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*t);break}default:{const t=s>1?Math.min(.5,.25*s):.25;n=this.maxWidth?Math.min(this.maxWidth,e):Math.round(e*t),a=this.maxHeight?Math.min(this.maxHeight,i):i}}return[n,a]}cachedCallWithContext(t,...e){const{callbackCache:i,chartService:s}=this.ctx;return i.call(this,s,t,...e)}};xu.className="Legend",r([Ct],xu.prototype,"toggleSeries",2),r([Ct],xu.prototype,"pagination",2),r([Ct],xu.prototype,"item",2),r([Ct],xu.prototype,"listeners",2),r([hi((t,e,i)=>{if(t.updateGroupVisibility(),e===i)return;const{ctx:{legendManager:s,stateManager:n}}=t;!1===i&&!0===e&&n.restoreState(s)}),Ct],xu.prototype,"enabled",2),r([Ct],xu.prototype,"position",2),r([Ct],xu.prototype,"maxWidth",2),r([Ct],xu.prototype,"maxHeight",2),r([Ct],xu.prototype,"reverseOrder",2),r([Ct],xu.prototype,"orientation",2),r([Ct],xu.prototype,"preventHidingAll",2),r([Ct],xu.prototype,"spacing",2);var bu={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new xu(t),packageType:"community",removable:"standalone-only"},vu={};o(vu,{CARTESIAN_AXIS_TYPE:()=>Du,CARTESIAN_POSITION:()=>ku,FONT_SIZE:()=>Su,FONT_SIZE_RATIO:()=>Mu,POLAR_AXIS_SHAPE:()=>Iu,POLAR_AXIS_TYPE:()=>wu});var Su=(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))(Su||{}),Mu=(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))(Mu||{}),ku=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t))(ku||{}),Du=(t=>(t.CATEGORY="category",t.GROUPED_CATEGORY="grouped-category",t.ORDINAL_TIME="ordinal-time",t.UNIT_TIME="unit-time",t.NUMBER="number",t.TIME="time",t.LOG="log",t))(Du||{}),wu=(t=>(t.ANGLE_CATEGORY="angle-category",t.ANGLE_NUMBER="angle-number",t.RADIUS_CATEGORY="radius-category",t.RADIUS_NUMBER="radius-number",t))(wu||{}),Iu=(t=>(t.CIRCLE="circle",t.POLYGON="polygon",t))(Iu||{}),Cu={};o(Cu,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>qu,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>tp,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>ep,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>ip,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>sp,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Qu,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Ju,DEFAULT_CAPTION_ALIGNMENT:()=>Ou,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Nu,DEFAULT_FIBONACCI_STROKES:()=>Uu,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Zu,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Hu,DEFAULT_GRIDLINE_ENABLED:()=>lp,DEFAULT_POLAR_SERIES_STROKE:()=>Yu,DEFAULT_SEPARATION_LINES_COLOUR:()=>Au,DEFAULT_SHADOW_COLOUR:()=>Tu,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>$u,DEFAULT_TEXTBOX_COLOR:()=>op,DEFAULT_TEXTBOX_FILL:()=>np,DEFAULT_TEXTBOX_STROKE:()=>ap,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Xu,DEFAULT_TOOLBAR_POSITION:()=>rp,IS_DARK_THEME:()=>Lu,PALETTE_ALT_DOWN_FILL:()=>Wu,PALETTE_ALT_DOWN_STROKE:()=>_u,PALETTE_ALT_NEUTRAL_FILL:()=>Vu,PALETTE_ALT_NEUTRAL_STROKE:()=>Ku,PALETTE_ALT_UP_FILL:()=>ju,PALETTE_ALT_UP_STROKE:()=>Gu,PALETTE_DOWN_FILL:()=>Bu,PALETTE_DOWN_STROKE:()=>Eu,PALETTE_NEUTRAL_FILL:()=>zu,PALETTE_NEUTRAL_STROKE:()=>Fu,PALETTE_UP_FILL:()=>Pu,PALETTE_UP_STROKE:()=>Ru});var Lu=Symbol("is-dark-theme"),Au=Symbol("default-separation-lines-colour"),Tu=Symbol("default-shadow-colour"),Nu=Symbol("default-caption-layout-style"),Ou=Symbol("default-caption-alignment"),Ru=Symbol("palette-up-stroke"),Eu=Symbol("palette-down-stroke"),Pu=Symbol("palette-up-fill"),Bu=Symbol("palette-down-fill"),Fu=Symbol("palette-neutral-stroke"),zu=Symbol("palette-neutral-fill"),Gu=Symbol("palette-alt-up-stroke"),_u=Symbol("palette-alt-down-stroke"),ju=Symbol("palette-alt-up-fill"),Wu=Symbol("palette-alt-down-fill"),Vu=Symbol("palette-gray-fill"),Ku=Symbol("palette-gray-stroke"),Yu=Symbol("default-polar-series-stroke"),$u=Symbol("default-sparkline-crosshair-stroke"),Hu=Symbol("default-financial-charts-annotation-stroke"),Uu=Symbol("default-hierarchy-strokes"),Xu=Symbol("default-text-annotation-color"),Zu=Symbol("default-financial-charts-annotation-background-fill"),qu=Symbol("default-annotation-handle-fill"),Qu=Symbol("default-annotation-statistics-fill"),Ju=Symbol("default-annotation-statistics-stroke"),tp=Symbol("default-annotation-statistics-color"),ep=Symbol("default-annotation-statistics-divider-stroke"),ip=Symbol("default-annotation-statistics-fill"),sp=Symbol("default-annotation-statistics-stroke"),np=Symbol("default-textbox-fill"),ap=Symbol("default-textbox-stroke"),op=Symbol("default-textbox-color"),rp=Symbol("default-toolbar-position"),lp=Symbol("default-gridline-enabled"),hp=[{type:"number",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"bottom","left"]}},{type:"category",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"left","bottom"]}}],cp={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$value:"$1"}]}]},{$palette:"fillFallback"},{$palette:"fill"}]},dp={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$value:"$1"}]}]},{$palette:"fillsFallback"},{$palette:"fills"}]},up={$if:[{$isGradient:[{$palette:"fill"}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},pp={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$value:"$1"}]}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},gp={type:"pattern",pattern:"forward-slanted-lines",width:10,height:10,padding:2,fill:{$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isImage:[{$palette:"fill"}]}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:up,strokeOpacity:1,strokeWidth:4,backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},mp={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0};function yp(t){return F(t,t=>{const e=yt.fromString(t);return[yt.darken(e,.15).toString(),t,yt.lighten(e,.15).toString()]})}function fp(t,e,i,s,n){const{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:r}=n,l=(s,n,a)=>{i.animate({id:`${t}_${e}_${n.id}_${s}`,groupId:t,from:0,to:1,ease:wn,collapsable:!1,onUpdate(t,e){e&&"removed"!==s||(n.path.clear(!0),a(t,n),n.checkPathDirty())},onStop(){"added"===s&&(n.path.clear(!0),a(1,n),n.checkPathDirty())},phase:or[s]})};for(const t of s)i.isSkipped()||(l("removed",t,r),l("updated",t,o)),l("added",t,a)}function xp({id:t},e,i,...s){for(const t of s)t.cleanup();lr(t,e,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function bp({id:t},e,i,...s){lr(t,e,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function vp(t){return{opacity:1}}var Sp=class extends Lt{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(t){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(t){this.markDirty()}},Mp=class extends Sp{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};r([Ct,H()],Mp.prototype,"enabled",2),r([Ct,H()],Mp.prototype,"color",2),r([Ct,H()],Mp.prototype,"xOffset",2),r([Ct,H()],Mp.prototype,"yOffset",2),r([Ct,H()],Mp.prototype,"blur",2);var kp=class extends Lt{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};r([Ct],kp.prototype,"fill",2),r([Ct],kp.prototype,"fillOpacity",2),r([Ct],kp.prototype,"stroke",2),r([Ct],kp.prototype,"strokeWidth",2),r([Ct],kp.prototype,"strokeOpacity",2),r([Ct],kp.prototype,"lineDash",2),r([Ct],kp.prototype,"lineDashOffset",2);var Dp=class extends Lt{};r([Ct],Dp.prototype,"strokeWidth",2),r([Ct],Dp.prototype,"dimOpacity",2),r([Ct],Dp.prototype,"enabled",2);var wp=class extends Lt{constructor(){super(...arguments),this.color="black"}};r([Ct],wp.prototype,"color",2);var Ip=class extends Lt{constructor(){super(...arguments),this.enabled=!0}};r([Ct],Ip.prototype,"enabled",2);var Cp=class extends Lt{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1}};r([Ct],Cp.prototype,"type",2),r([Ct],Cp.prototype,"colorStops",2),r([Ct],Cp.prototype,"bounds",2),r([Ct],Cp.prototype,"gradient",2),r([Ct],Cp.prototype,"rotation",2),r([Ct],Cp.prototype,"reverse",2);var Lp=class extends Lt{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.scale=1,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};r([Ct],Lp.prototype,"type",2),r([Ct],Lp.prototype,"colorStops",2),r([Ct],Lp.prototype,"bounds",2),r([Ct],Lp.prototype,"gradient",2),r([Ct],Lp.prototype,"rotation",2),r([Ct],Lp.prototype,"scale",2),r([Ct],Lp.prototype,"reverse",2),r([Ct],Lp.prototype,"path",2),r([Ct],Lp.prototype,"pattern",2),r([Ct],Lp.prototype,"width",2),r([Ct],Lp.prototype,"height",2),r([Ct],Lp.prototype,"padding",2),r([Ct],Lp.prototype,"fill",2),r([Ct],Lp.prototype,"fillOpacity",2),r([Ct],Lp.prototype,"backgroundFill",2),r([Ct],Lp.prototype,"backgroundFillOpacity",2),r([Ct],Lp.prototype,"stroke",2),r([Ct],Lp.prototype,"strokeOpacity",2),r([Ct],Lp.prototype,"strokeWidth",2);var Ap=class extends Lt{constructor(){super(...arguments),this.type="image",this.url="",this.rotation=0,this.scale=1,this.backgroundFill="black",this.backgroundFillOpacity=1,this.repeat="no-repeat",this.fit="contain"}};r([Ct],Ap.prototype,"type",2),r([Ct],Ap.prototype,"url",2),r([Ct],Ap.prototype,"rotation",2),r([Ct],Ap.prototype,"scale",2),r([Ct],Ap.prototype,"backgroundFill",2),r([Ct],Ap.prototype,"backgroundFillOpacity",2),r([Ct],Ap.prototype,"repeat",2),r([Ct],Ap.prototype,"fit",2);var Tp=class extends Lt{constructor(){super(...arguments),this.item=new kp,this.series=new Dp,this.text=new wp}};r([Ct],Tp.prototype,"item",2),r([Ct],Tp.prototype,"series",2),r([Ct],Tp.prototype,"text",2);var Np=class extends Lt{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new Ip,this.highlightStyle=new Tp}handleUnknownProperties(t,e){"context"in e&&(this.context=e.context,t.delete("context"))}};r([Ct],Np.prototype,"id",2),r([Ct],Np.prototype,"visible",2),r([Ct],Np.prototype,"focusPriority",2),r([Ct],Np.prototype,"showInLegend",2),r([Ct],Np.prototype,"cursor",2),r([Ct],Np.prototype,"nodeClickRange",2),r([Ct],Np.prototype,"highlight",2),r([Ct],Np.prototype,"highlightStyle",2);var Op=class extends Sp{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillGradientDefaults=new Cp,this.fillPatternDefaults=new Lp,this.fillImageDefaults=new Ap,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}=this;return{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};r([Ct,H()],Op.prototype,"enabled",2),r([Ct,U({equals:$})],Op.prototype,"shape",2),r([Ct,H()],Op.prototype,"size",2),r([Ct,U({equals:O})],Op.prototype,"fill",2),r([Ct],Op.prototype,"fillGradientDefaults",2),r([Ct],Op.prototype,"fillPatternDefaults",2),r([Ct],Op.prototype,"fillImageDefaults",2),r([Ct,H()],Op.prototype,"fillOpacity",2),r([Ct,H()],Op.prototype,"stroke",2),r([Ct,H()],Op.prototype,"strokeWidth",2),r([Ct,H()],Op.prototype,"strokeOpacity",2),r([Ct],Op.prototype,"lineDash",2),r([Ct],Op.prototype,"lineDashOffset",2),r([Ct,U({equals:$})],Op.prototype,"itemStyler",2);var Rp=class extends Lt{constructor(){super(...arguments),this.enabled=!1}};r([Ct],Rp.prototype,"enabled",2);var Ep=class extends Lt{constructor(){super(...arguments),this.interaction=new Rp,this.position=new Xh,this.range=void 0,this.class=void 0}formatTooltip(t,e,i,s){const n=null==this.renderer?void 0:pn(t,e,this.renderer,[s]);return"string"==typeof n?{type:"raw",rawHtmlString:n}:null!=n?{type:"structured",...i,...n}:{type:"structured",...i}}};r([Ct],Ep.prototype,"enabled",2),r([Ct],Ep.prototype,"showArrow",2),r([Ct],Ep.prototype,"renderer",2),r([Ct],Ep.prototype,"interaction",2),r([Ct],Ep.prototype,"position",2),r([Ct],Ep.prototype,"range",2),r([Ct],Ep.prototype,"class",2);var Pp=class{constructor(t,e,i){this.root=new zp(t,e,i)}clear(t){this.root.clear(t)}addValue(t,e){const i={hitTester:t,value:e,distanceSquared:(e,i)=>t.distanceSquared(e,i)};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}},Bp=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)}},Fp=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=i??y.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)&&(void 0===this.subdivisions?0===this.maxdepth||this.elems.length<this.capacity?this.elems.push(t):this.subdivide(t):this.subdivisions.addElem(t))}find(t,e,i){this.findCondition(t,e,i)&&(void 0===this.subdivisions?this.findAction(t,e,i):this.subdivisions.find(t,e,i))}subdivide(t){this.subdivisions=this.makeSubdivisions();for(const t of this.elems)this.subdivisions.addElem(t);this.subdivisions.addElem(t),this.elems.length=0}makeSubdivisions(){const{x:t,y:e,width:i,height:s}=this.boundary,{capacity:n}=this,a=this.maxdepth-1,o=i/2,r=s/2,l=new y(t,e,o,r),h=new y(t+o,e,o,r),c=new y(t,e+r,o,r),d=new y(t+o,e+r,o,r);return new Bp(this.child(n,a,l),this.child(n,a,h),this.child(n,a,c),this.child(n,a,d))}},zp=class t extends Fp{addCondition(t){const{x:e,y:i}=t.hitTester.midPoint;return this.boundary.containsPoint(e,i)}findCondition(t,e,i){const{best:s}=i;return 0!==s.distanceSquared&&this.boundary.distanceSquared(t,e)<s.distanceSquared}findAction(t,e,i){const s=p(t,e,this.elems,i.best.distanceSquared);void 0!==s.nearest&&s.distanceSquared<i.best.distanceSquared&&(i.best=s)}child(e,i,s){return new t(e,i,s)}},Gp=class extends bh{constructor({clipFocusBox:t,categoryKey:e,...i}){super(i),this.categoryKey=e,this.clipFocusBox=t??!0}getScaleInformation({xScale:t,yScale:e}){return{isContinuousX:ha.is(t),isContinuousY:ha.is(e),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(void 0===e||0===e.length)return;const i=this.computeFocusDatumIndex(t,e);if(void 0===i)return;const{clipFocusBox:s}=this,n=e[i],a={...t,datumIndex:i},o=this.computeFocusBounds(a);return void 0!==o?{bounds:o,clipFocusBox:s,datum:n,datumIndex:i}:void 0}isDatumEnabled(t,e){const{missing:i=!1,enabled:s=!0,focusable:n=!0}=t[e];return!i&&s&&n}computeFocusDatumIndex(t,e){const i=(t,i)=>{for(;t>=0&&!this.isDatumEnabled(e,t);)t+=i;return-1===t?void 0:t},n=(t,i)=>{for(;t<e.length&&!this.isDatumEnabled(e,t);)t+=i;return t===e.length?void 0:t};let a;const o=(0,s.qE)(0,t.datumIndex,e.length-1);return a=t.datumIndexDelta<0?i(o,t.datumIndexDelta):t.datumIndexDelta>0?n(o,t.datumIndexDelta):n(o,1)??i(o,-1),void 0===a?0===t.datumIndexDelta?void 0:t.datumIndex-t.datumIndexDelta:a}keysOrValues(t){const e=this.dataModel.resolveProcessedDataIndexById(this,t);return this.processedData?.keys[e]?.get(this.id)??this.processedData?.columns[e]??[]}getCategoryKey(){return this.categoryKey}getCategoryValue(t){const{processedData:e,dataModel:i}=this,s=this.getCategoryKey();if(e&&i&&s)return e.invalidData?.get(this.id)?.[t]?void 0:this.keysOrValues(s)[t]}datumIndexForCategoryValue(t){const{processedData:e,dataModel:i}=this,s=this.getCategoryKey();if(!e||!i||!s)return;t=t.valueOf();const n=e.invalidData?.get(this.id),a=this.keysOrValues(s);for(let e=0;e<a.length;e+=1){if(!0===n?.[e])continue;const i=a[e]?.valueOf();if(O(t,i))return e}}},_p={x:["xKey"],y:["yKey"]},jp={x:["xName"],y:["yName"]},Wp=class extends fh{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},Vp=class extends Np{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}};r([Ct],Vp.prototype,"legendItemName",2),r([Ct],Vp.prototype,"pickOutsideVisibleMinorAxis",2);var Kp=100,Yp=class extends Gp{constructor({pathsPerSeries:t=["path"],hasMarkers:e=!1,hasHighlightedLabels:i=!1,pathsZIndexSubOrderOffset:s=[],datumSelectionGarbageCollection:n=!0,markerSelectionGarbageCollection:a=!0,animationAlwaysUpdateSelections:o=!1,animationResetFns:r,directionKeys:l,directionNames:h,...c}){if(super({directionKeys:l,directionNames:h,canHaveAxes:!0,...c}),this.NodeEvent=Wp,this.dataNodeGroup=this.contentGroup.appendChild(new Ie({name:`${this.id}-series-dataNodes`,zIndex:0})),this.markerGroup=this.contentGroup.appendChild(new Ie({name:`${this.id}-series-markers`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new Ae({name:`${this.id}-series-labels`})),this.labelSelection=ur.select(this.labelGroup,Ri),this.highlightSelection=ur.select(this.highlightNode,()=>this.opts.hasMarkers?new Ph:this.nodeFactory()),this.highlightLabelSelection=ur.select(this.highlightLabel,Ri),this.annotationSelections=new Set,this.debug=x.create(),!l||!h)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:t,hasMarkers:e,hasHighlightedLabels:i,pathsZIndexSubOrderOffset:s,directionKeys:l,directionNames:h,animationResetFns:r,animationAlwaysUpdateSelections:o,datumSelectionGarbageCollection:n,markerSelectionGarbageCollection:a},this.paths=t.map(t=>new vh({name:`${this.id}-${t}`})),this.datumSelection=ur.select(this.dataNodeGroup,()=>this.nodeFactory(),n),this.markerSelection=ur.select(this.markerGroup,Ph,a),this.animationState=new vr("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),highlightMarkers:t=>this.animateReadyHighlightMarkers(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:t=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(t):this.animateWaitingUpdateReady(t)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:t=>this.resetAllAnimation(t),reset:"empty"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},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)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(t,e,i){for(const e of t)this.contentGroup.appendChild(e)}detachPaths(t,e,i){for(const e of t)this.contentGroup.removeChild(e)}renderToOffscreenCanvas(){const t=this.getNodeData();return null!=t&&t.length>Kp}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t?this.animationState.transition("skip"):"disabled"===t&&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,s=this.ctx.highlightManager?.getActiveHighlight()?.series,n=s===this,a=this.checkResize(t),o=this.updateHighlightSelection(n);this.updateSelections(e),this.updateNodes(o,n,e);const r=this.getAnimationData(t,i);r&&(a&&this.animationState.transition("resize",r),this.animationState.transition("update",r))}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 t=this.isProcessedDataAnimatable();this._contextNodeData&&((e=this._contextNodeData).animationValid??(e.animationValid=t));const{dataModel:i,processedData:s}=this;void 0!==i&&void 0!==s&&this.dispatch("data-update",{dataModel:i,processedData:s})}this.updateSeriesSelections()}}updateSeriesSelections(t){const{datumSelection:e,labelSelection:i,markerSelection:s,paths:n}=this,a=this._contextNodeData;if(!a)return;const{nodeData:o,labelData:r,itemId:l}=a;this.updatePaths({seriesHighlighted:t,itemId:l,contextData:a,paths:n}),this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:i})??i,this.opts.hasMarkers&&(this.markerSelection=this.updateMarkerSelection({nodeData:o,markerSelection:s}))}getShapeFillBBox(){const{axes:t}=this,e=t.x,i=t.y,[s,n]=oa(e?.range??[0,1]),[a,o]=oa(i?.range??[0,1]),r=this.getSeriesDomain("x"),l=[e?.scale.convert(r.at(0)),e?.scale.convert(r.at(-1))],h=this.getSeriesDomain("y"),c=[i?.scale.convert(h.at(0)),i?.scale.convert(h.at(-1))],[d,u]=oa(l),[p,g]=oa(c);return{axis:new y(s,a,n-s,o-a),series:new y(d,p,u-d,g-p)}}updateNodes(t,e,i){const{highlightSelection:s,highlightLabelSelection:n,opts:{hasMarkers:a,hasHighlightedLabels:o}}=this,r=!this.ctx.animationManager.isSkipped(),l=this.visible&&null!=this._contextNodeData&&i;this.contentGroup.visible=r||l,this.highlightGroup.visible=(r||l)&&e;const h=this.getOpacity();a?(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:c,markerGroup:d,datumSelection:u,labelSelection:p,markerSelection:g,paths:m,labelGroup:y}=this,{itemId:f}=this.contextNodeData??{};c.opacity=h,c.visible=r||l,y.visible=l,a&&(d.opacity=h,d.visible=l),y&&(y.opacity=h),this.updatePathNodes({seriesHighlighted:e,itemId:f,paths:m,opacity:h,visible:l,animationEnabled:r}),c.visible&&(this.updateDatumNodes({datumSelection:u,highlightedItems:t,isHighlight:!1}),this.usesPlacedLabels||this.updateLabelNodes({labelSelection:p}),a&&this.updateMarkerNodes({markerSelection:g,isHighlight:!1}))}getHighlightLabelData(t,e){const i=t.filter(t=>t.datum===e.datum&&t.itemId===e.itemId);return 0===i.length?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(),a=t&&n?.datum?n:void 0;let o,r;if(null!=a){const t=this.isLabelEnabled(),{labelData:e,nodeData:i}=s;r=this.getHighlightData(i,a),o=t?this.getHighlightLabelData(e,a):void 0}return this.highlightSelection=this.updateHighlightSelectionItem({items:r,highlightSelection:e}),this.highlightLabelSelection=this.updateHighlightSelectionLabel({items:o,highlightLabelSelection:i}),r}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:t}of this.datumSelection)!0!==t.datum.missing&&(yield t)}getQuadTree(){if(void 0===this.quadtree){const{width:t,height:e}=this.ctx.scene.canvas,i=new y(0,0,t,e);this.quadtree=new Pp(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(t){}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);if(0!==e.length)return e;const{x:i,y:s}=t,{opts:{hasMarkers:n}}=this,{dataNodeGroup:a,markerGroup:o}=this;let r=a.pickNodes(i,s).filter(t=>!0!==t.datum.missing);if(0===r.length&&n&&(r=o?.pickNodes(i,s).filter(t=>!0!==t.datum.missing)),0!==r.length)return r.map(t=>t.datum);for(const e of this.moduleMap.modules()){const{datum:i}=e.pickNodeExact(t)??{};if(null!=i&&!0!==i?.missing)return[i]}return[]}pickNodeClosestDatum(t){const{x:e,y:i}=t,{axes:s,_contextNodeData:n}=this;if(!n)return;const a=s.x,o=s.y,r=e,l=i;let h,c=1/0;for(const t of n.nodeData){const{point:{x:e=NaN,y:i=NaN}={}}=t;if(isNaN(e)||isNaN(i))continue;if(!a?.inRange(e)||!o?.inRange(i))continue;const s=Math.max((r-e)**2+(l-i)**2,0);s<c&&(c=s,h=t)}for(const e of this.moduleMap.modules()){const i=e.pickNodeNearest(t);if(void 0!==i&&i.distanceSquared<c){c=i.distanceSquared,h=i.datum;break}}return h?{datum:h,distance:Math.max(Math.sqrt(c)-(h.point?.size??0)/2,0)}:void 0}pickNodeMainAxisFirst(t,e){const{x:i,y:s}=t,{axes:n,_contextNodeData:a}=this,{pickOutsideVisibleMinorAxis:o}=this.properties;if(!a)return;const r=n.x,l=n.y,h=[r,l].filter(Ic.is).map(t=>t.direction);if(e&&0===h.length)return;const[c="x"]=h,d=[i,s];"x"!==c&&d.reverse();const u=[1/0,1/0];let p;for(const t of a.nodeData){const{x:e=NaN,y:i=NaN}=t.point??t.midPoint??{};if(isNaN(e)||isNaN(i)||!0===t.missing)continue;const s=[r?.inRange(e),l?.inRange(i)];if("x"!==c&&s.reverse(),!s[0]||!o&&!s[1])continue;const n=[e,i];"x"!==c&&n.reverse();let a=!0;for(let t=0;t<n.length;t++){const e=Math.abs(n[t]-d[t]);if(e>u[t]){a=!1;break}e<u[t]&&(u[t]=e,u.fill(1/0,t+1,u.length))}a&&(p=t)}if(p){let e=Math.max(u[0]**2+u[1]**2-(p.point?.size??0),0);for(const i of this.moduleMap.modules()){const s=i.pickNodeMainAxisFirst(t);if(void 0!==s&&s.distanceSquared<e){p=s.datum,e=s.distanceSquared;break}}return{datum:p,distance:Math.sqrt(e)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRange(t,e,i){const s=this.keysOrValues(t);return Zn(i?.length??s.length,e,t=>{const e=i?.[t]??t;return this.xCoordinateRange(s[e],0,e)})}domainForVisibleRange(t,e,i,s,n,a){const{processedData:o,dataModel:r}=this,[l,h]=s,c=this.keysOrValues(i);if(n){const t=this.visibleRange(i,s,a);return r.getDomainBetweenRange(this,e,t,o)}const d=e.map(t=>this.keysOrValues(t));let u=1/0,p=-1/0;return c.forEach((t,i)=>{const[s,n]=this.xCoordinateRange(t,0,i);if(!(n<l||s>h))for(let t=0;t<e.length;t++){const e=d[t][i];u=Math.min(u,e),p=Math.max(p,e)}}),u>p?[NaN,NaN]:[u,p]}domainForClippedRange(t,e,i,n){const{processedData:a,dataModel:o,axes:r}=this,l=function(t){let e,i;if((t instanceof jd||t instanceof Kd)&&({min:e,max:i}=t),null!=e||null!=i)return e??(e=-1/0),i??(i=1/0),[e,i]}(r["x"===t?"y":"x"]);if(!l)return e.flatMap(t=>o.getDomain(this,t,"value",a));const h=this.keysOrValues(i);if(n){const t=function(t,e,i){const n=e[0].valueOf(),a=e[1].valueOf(),o=(0,s.S3)(0,t-1,t=>{const e=i(t)?.valueOf();return!Number.isFinite(e)||e>=n});let r=(0,s.I5)(0,t-1,t=>{const e=i(t)?.valueOf();return!Number.isFinite(e)||e<=a});return null==o||null==r?[0,0]:(r=Math.min(r+1,t),[o,r])}(h.length,l,t=>h[t]);return o.getDomainBetweenRange(this,e,t,a)}const c=e.map(t=>this.keysOrValues(t)),d=l[0].valueOf(),u=l[1].valueOf(),p=[];return h.forEach((t,e)=>{const i=t.valueOf();if(i<d||i>u)return;const s=c.map(t=>t[e]);i>=d&&p.push(...s),i<=u&&p.push(...s)}),p}countVisibleItems(t,e,i,n,a){const{dataModel:o,processedData:r}=this;if(!o||!r)return 1/0;const l=this.keysOrValues(t),h=e.map(t=>o.resolveColumnById(this,t,r)),c=this.axes.x,d=this.axes.y,u=this.shouldFlipXY(),p=c.range,g=d.range,m=(t,e,i)=>t[0]+(i-e[0])/(e[1]-e[0])*(t[1]-t[0]),y=m(p,c.visibleRange,i[0]),f=m(p,c.visibleRange,i[1]),x=m(g,d.visibleRange,u?n[0]:n[1]),b=m(g,d.visibleRange,u?n[1]:n[0]),v=Math.round((i[0]+(i[1]-i[0])/2)*l.length);return Qn(0,l.length-1,v,a,t=>{let[e,i]=this.xCoordinateRange(l[t],0,t),[n,a]=this.yCoordinateRange(h.map(e=>e[t]),0,t);return!!((0,s.Bf)(e)&&(0,s.Bf)(i)&&(0,s.Bf)(n)&&(0,s.Bf)(a))&&(u&&([e,i,n,a]=[n,a,e,i]),e>=y&&i<=f&&n>=x&&a<=b)})}updateHighlightSelectionItem(t){const{opts:{hasMarkers:e}}=this,{items:i,highlightSelection:s}=t,n=i??[];if(e){const t=s;return this.updateMarkerSelection({nodeData:n,markerSelection:t})}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(t=>t.visible=!1)}updatePathNodes(t){const{paths:e,opacity:i,visible:s}=t;for(const t of e)t.opacity=i,t.visible=s}resetPathAnimation(t){const{path:e}=this.opts?.animationResetFns??{};e&&t.paths.forEach(t=>{dr([t],e)})}resetDatumAnimation(t){const{datum:e}=this.opts?.animationResetFns??{};e&&dr([t.datumSelection],e)}resetLabelAnimation(t){const{label:e}=this.opts?.animationResetFns??{};e&&dr([t.labelSelection],e)}resetMarkerAnimation(t){const{marker:e}=this.opts?.animationResetFns??{};e&&this.opts.hasMarkers&&dr([t.markerSelection],e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(t),this.resetDatumAnimation(t),this.resetLabelAnimation(t),this.resetMarkerAnimation(t),!1===t.contextData?.animationValid&&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&&dr([t],e)}animateReadyHighlightMarkers(t){const{marker:e}=this.opts?.animationResetFns??{};e&&dr([t],e)}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(t,e){const{_contextNodeData:i}=this;if(i)return{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:e,paths:this.paths,seriesRect:t}}updateLabelSelection(t){return t.labelSelection}getScaling(t){if(t instanceof Gd){const{range:e,domain:i}=t;return{type:"log",convert:e=>t.convert(e),domain:[i[0],i[1]],range:[e[0],e[1]]}}if(t instanceof ha){const{range:e,domain:i}=t;return{type:"continuous",domain:[i[0],i[1]],range:[e[0],e[1]]}}if(t instanceof eo){const{domain:e}=t;return{type:"category",domain:e,inset:t.inset,step:t.step}}}calculateScaling(){const t={};for(const e of Object.values(zi)){const i=this.axes[e];if(!i)continue;const s=this.getScaling(i.scale);null!=s&&(t[e]=s)}return t}},$p=class extends Lt{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};r([Ct],$p.prototype,"type",2),r([Ct],$p.prototype,"tension",2),r([Ct],$p.prototype,"position",2);var Hp=class extends Vp{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillGradientDefaults=new Cp,this.fillPatternDefaults=new Lp,this.fillImageDefaults=new Ap,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new $p,this.shadow=new Mp,this.marker=new Op,this.label=new pl,this.tooltip=new Ep,this.connectMissingData=!1}};function Up(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 Xp(t,e,i){const[s,n]=Up(t),a=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)*a,cp1y:i.y-(t.cp2y-s.y)*o,cp2x:i.x-(t.cp1x-s.x)*a,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)*a}}}function Zp(t,e,i){const{moveTo:s}=t,[n,a]=function(t){const e=Up(t);return e[0].x>e[1].x&&e.reverse(),e}(t),{x:o,y:r}=n,{x:l,y:h}=a;if(i<o)return Xp(t,n,n);if(e>l)return Xp(t,a,a);switch(t.type){case"linear":{const t=r===h?void 0:(h-r)/(l-o);return{type:"linear",moveTo:s,x0:e,y0:null==t?r:t*(e-o)+r,x1:i,y1:null==t?r:t*(i-o)+r}}case"step":if(i<=t.stepX){const n=t.y0;return{type:"step",moveTo:s,x0:e,y0:n,x1:i,y1:n,stepX:i}}if(e>=t.stepX){const n=t.y1;return{type:"step",moveTo:s,x0:e,y0:n,x1:i,y1:n,stepX:e}}{const{y0:n,y1:a,stepX:o}=t;return{type:"step",moveTo:s,x0:e,y0:n,x1:i,y1:a,stepX:o}}case"cubic":{const n=Xt(t.cp0x,t.cp1x,t.cp2x,t.cp3x,e);let[a,o]=Zt(t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,n);const r=Xt(o[0].x,o[1].x,o[2].x,o[3].x,i);return[o,a]=Zt(o[0].x,o[0].y,o[1].x,o[1].y,o[2].x,o[2].y,o[3].x,o[3].y,r),{type:"cubic",moveTo:s,cp0x:o[0].x,cp0y:o[0].y,cp1x:o[1].x,cp1y:o[1].y,cp2x:o[2].x,cp2y:o[2].y,cp3x:o[3].x,cp3y:o[3].y}}}}r([Ct],Hp.prototype,"xKey",2),r([Ct],Hp.prototype,"xName",2),r([Ct],Hp.prototype,"yKey",2),r([Ct],Hp.prototype,"yName",2),r([Ct],Hp.prototype,"yFilterKey",2),r([Ct],Hp.prototype,"normalizedTo",2),r([Ct],Hp.prototype,"fill",2),r([Ct],Hp.prototype,"fillGradientDefaults",2),r([Ct],Hp.prototype,"fillPatternDefaults",2),r([Ct],Hp.prototype,"fillImageDefaults",2),r([Ct],Hp.prototype,"fillOpacity",2),r([Ct],Hp.prototype,"stroke",2),r([Ct],Hp.prototype,"strokeWidth",2),r([Ct],Hp.prototype,"strokeOpacity",2),r([Ct],Hp.prototype,"lineDash",2),r([Ct],Hp.prototype,"lineDashOffset",2),r([Ct],Hp.prototype,"interpolation",2),r([Ct],Hp.prototype,"shadow",2),r([Ct],Hp.prototype,"marker",2),r([Ct],Hp.prototype,"label",2),r([Ct],Hp.prototype,"tooltip",2),r([Ct],Hp.prototype,"connectMissingData",2);var qp={start:0,middle:.5,end:1},Qp=.05;function Jp(t,e,i){return(e-t)*i+t}function tg(t,e){return"linear"===t.type?function(t,e){const{x0:i,y0:s,x1:n,y1:a}=t,o=(a-s)/(n-i)*(e-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:e,leftCp2y:o,stepX:e,stepY0:o,stepY1:o,rightCp1x:e,rightCp1y:o,rightCp2x:n,rightCp2y:a}}(t,e):"cubic"===t.type?function(t,e){const{cp0x:i,cp0y:s,cp1x:n,cp1y:a,cp2x:o,cp2y:r,cp3x:l,cp3y:h}=t,c=Xt(i,n,o,l,e),[d,u]=Zt(i,s,n,a,o,r,l,h,c),p=d[3].y;return{leftCp1x:d[1].x,leftCp1y:d[1].y,leftCp2x:d[2].x,leftCp2y:d[2].y,stepX:e,stepY0:p,stepY1:p,rightCp1x:u[1].x,rightCp1y:u[1].y,rightCp2x:u[2].x,rightCp2y:u[2].y}}(t,e):function(t){const{x0:e,y0:i,x1:s,y1:n,stepX:a}=t;return{leftCp1x:(e+a)/2,leftCp1y:i,leftCp2x:(e+a)/2,leftCp2y:i,stepX:a,stepY0:i,stepY1:n,rightCp1x:(a+s)/2,rightCp1y:n,rightCp2x:(a+s)/2,rightCp2y:n}}(t)}function eg(t,e,i,s,n,a,o){switch(e){case 0:o?t.moveTo(n,a):t.moveTo(i,s);break;case 1:o?t.lineTo(n,a):t.lineTo(i,s)}}function ig(t,e,i,s,n,a){a?t.lineTo(e,i):t.lineTo(s,n)}function sg(t,e,i,s,n,a,o,r,l,h){h?t.cubicCurveTo(a,o,s,n,e,i):t.cubicCurveTo(s,n,a,o,r,l)}function ng(t,e,i,s,n,a,o){o?(t.lineTo(a,n),t.lineTo(a,i),t.lineTo(e,i)):(t.lineTo(a,i),t.lineTo(a,n),t.lineTo(s,n))}function ag(t,e,i,s){const[n,a]=Up(e);switch(eg(t,i,n.x,n.y,a.x,a.y,s),e.type){case"linear":ig(t,e.x0,e.y0,e.x1,e.y1,s);break;case"cubic":sg(t,e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,s);break;case"step":ng(t,e.x0,e.y0,e.x1,e.y1,e.stepX,s)}}function og(t,e,i){const[s,n]=Up(t),[a,o]=Up(e);return[{x:Jp(s.x,a.x,i),y:Jp(s.y,a.y,i)},{x:Jp(n.x,o.x,i),y:Jp(n.y,o.y,i)}]}function rg(t,e,i,s,n,a){const[{x:o,y:r},{x:l,y:h}]=og(e,i,s);if(eg(t,n,o,r,l,h,a),"cubic"===e.type&&"cubic"===i.type)sg(t,o,r,Jp(e.cp1x,i.cp1x,s),Jp(e.cp1y,i.cp1y,s),Jp(e.cp2x,i.cp2x,s),Jp(e.cp2y,i.cp2y,s),l,h,a);else if("step"===e.type&&"step"===i.type)ng(t,o,r,l,h,Jp(e.stepX,i.stepX,s),a);else if("linear"===e.type&&"linear"===i.type)ig(t,o,r,l,h,a);else{let n;n="step"===e.type?e.stepX:"step"===i.type?i.stepX:(o+l)/2;const c=tg(e,n),d=tg(i,n),u=Jp(c.leftCp1x,d.leftCp1x,s),p=Jp(c.leftCp1y,d.leftCp1y,s),g=Jp(c.leftCp2x,d.leftCp2x,s),m=Jp(c.leftCp2y,d.leftCp2y,s),y=Jp(c.stepX,d.stepX,s),f=Jp(c.stepY0,d.stepY0,s),x=Jp(c.stepY1,d.stepY1,s),b=Jp(c.rightCp1x,d.rightCp1x,s),v=Jp(c.rightCp1y,d.rightCp1y,s),S=Jp(c.rightCp2x,d.rightCp2x,s),M=Jp(c.rightCp2y,d.rightCp2y,s);a?(t.cubicCurveTo(S,M,b,v,y,x),t.lineTo(y,f),t.cubicCurveTo(g,m,u,p,o,r)):(t.cubicCurveTo(u,p,g,m,y,f),t.lineTo(y,x),t.cubicCurveTo(b,v,S,M,l,h))}}var lg=(t=>(t[t.Zero=0]="Zero",t[t.Split=1]="Split",t))(lg||{});function hg(t,e){if(!e)return NaN;if(t instanceof Date&&(t=t.getTime()),"continuous"===e.type&&"number"==typeof t)return(t-e.domain[0])/(e.domain[1]-e.domain[0])*(e.range[1]-e.range[0])+e.range[0];if("log"===e.type&&"number"==typeof t)return e.convert(t);if("category"!==e.type)return NaN;let i=e.domain.findIndex(e=>e===t);return-1===i&&(i=e.domain.findIndex(e=>{return s=e,null!=(i=t)&&null!=s&&"object"==typeof i&&"object"==typeof s&&("id"in i&&"id"in s?i.id===s.id:i.toString()===s.toString());var i,s})),i>=0?e.inset+e.step*i:NaN}function cg(t){return nl(t).valueOf()}function dg({data:t},e){return t.map((t,i)=>({xValue0Index:e.indexOf(cg(t.xValue0)),xValue1Index:e.indexOf(cg(t.xValue1)),datumIndex:i}))}function ug(t,e,i){if(i.xValue1Index===i.xValue0Index+1)return t;const s=Up(t),n=(s[1].x-s[0].x)/(i.xValue1Index-i.xValue0Index),a=s[0].x+(e-i.xValue0Index)*n;return Zp(t,a,a+n)}function pg(t,e){const[i,s]=Up(t),n=hg(0,e.scales.y);return Xp(t,{x:i.x,y:n},{x:s.x,y:n})}function gg(t){const[e,i]=Up(t);return function(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}}}(t,{x:(e.x+i.x)/2,y:(e.y+i.y)/2})}function mg(t,e,i,s,n,a){let o,r;if(n.xValue0Index>=a.xValue1Index){const t=s.findLast(t=>t.xValue1Index<=a.xValue1Index)?.datumIndex,e=null!=t?i.data[t]:void 0;o=e?.xValue1,r=e?.yValue1}else if(n.xValue0Index<=a.xValue0Index){const t=s.find(t=>t.xValue0Index>=a.xValue0Index)?.datumIndex,e=null!=t?i.data[t]:void 0;o=e?.xValue0,r=e?.yValue0}if(null==o||null==r)switch(e){case 0:return pg(t,i);case 1:return gg(t)}const l={x:hg(o,i.scales.x),y:hg(r,i.scales.y)};return Xp(t,l,l)}function yg(t,e){if(null==e)return;const i=cg(t.xValue0),s=cg(t.xValue1);return e.find(t=>cg(t.xValue0)===i&&cg(t.xValue1)===s)?.span}function fg(t,e,i,s,n,a,o){const r=t.data[s.datumIndex],l=r.span,h=yg(r,n);if(null!=h)o.removed.push({from:h,to:h}),o.moved.push({from:h,to:l}),o.added.push({from:l,to:l});else{const n=mg(l,e,t,i,s,a);o.added.push({from:n,to:l})}}function xg(t,e,i,s,n,a,o){const r=t.data[s.datumIndex],l=r.span,h=yg(r,n);if(null!=h)o.removed.push({from:l,to:l}),o.moved.push({from:l,to:h}),o.added.push({from:h,to:h});else{const n=mg(l,e,t,i,s,a);o.removed.push({from:l,to:n})}}function bg(t,e,i,s,n){const a=e[n.xValue0Index],o=i.data.find(t=>cg(t.xValue0)===a),r=e[n.xValue1Index],l=i.data.find(t=>cg(t.xValue1)===r);if(null==o||null==l)return;const[{x:h},{x:c}]=Up(t),d=hg(o.xValue0,i.scales.x),u=hg(o.yValue0,i.scales.y),p=hg(l.xValue1,i.scales.x),g=hg(l.yValue1,i.scales.y);let m=s.data[n.datumIndex].span;return m=Xp(m,{x:d,y:u},{x:p,y:g}),m=Zp(m,h,c),m}function vg(t,e,i,s,n,a,o,r,l){const h=n+1,c=o.find(t=>t.xValue0Index<=n&&t.xValue1Index>=h),d=a.find(t=>t.xValue0Index<=n&&t.xValue1Index>=h),u=e.zeroData,p=t.zeroData;if(null==c&&null!=d)return void fg(t,i,a,d,u,r,l);if(null!=c&&null==d)return void xg(e,i,o,c,p,r,l);if(null==c||null==d)return;let g;g=c.xValue0Index===d.xValue0Index&&c.xValue1Index===d.xValue1Index?0:c.xValue0Index<=d.xValue0Index&&c.xValue1Index>=d.xValue1Index?-1:c.xValue0Index>=d.xValue0Index&&c.xValue1Index<=d.xValue1Index?1:0;const m=ug(e.data[c.datumIndex].span,n,c),y=ug(t.data[d.datumIndex].span,n,d);if(1===g){const n=bg(m,s,e,t,d);null!=n?(l.removed.push({from:m,to:n}),l.moved.push({from:n,to:y}),l.added.push({from:y,to:y})):xg(e,i,o,c,p,r,l)}else if(-1===g){const n=bg(y,s,t,e,c);null!=n?(l.removed.push({from:m,to:m}),l.moved.push({from:m,to:n}),l.added.push({from:n,to:y})):fg(t,i,a,d,u,r,l)}else l.removed.push({from:m,to:m}),l.moved.push({from:m,to:y}),l.added.push({from:y,to:y})}function Sg(t,e,i){const{span:s}=e;switch(i){case 0:return yg(e,t.zeroData)??pg(s,t);case 1:return gg(s)}}function Mg(t,e,i){if(!function(t,e){const i=e.scales.x,s=t.scales.x;if("category"!==i?.type||"category"!==s?.type)return!0;let n=-1/0;for(const t of i.domain){const e=hg(t,s);if(Number.isFinite(e)){if(e<n)return!1;n=e}}return!0}(t,e))return;const s=function(t,e){const i=new Map;for(const{xValue0:e,xValue1:s}of t.data){const t=cg(e),n=cg(s);i.set(t,e).set(n,s)}const s=Array.from(i,([t,e])=>({axisValue:t,value:e}));s.sort((e,i)=>hg(e.value,t.scales.x)-hg(i.value,t.scales.x));const n=[];for(const{xValue0:t,xValue1:s}of e.data){const e=cg(t),a=cg(s);i.has(e)||(i.set(e,t),n.push({axisValue:e,value:t})),i.has(a)||(i.set(a,s),n.push({axisValue:a,value:s}))}n.sort((t,i)=>hg(t.value,e.scales.x)-hg(i.value,e.scales.x));const a=s;let o=0;for(const t of n){for(let i=a.length-1;i>o;i-=1)if(hg(t.value,e.scales.x)>hg(a[i].value,e.scales.x)){o=i+1;break}a.splice(o,0,t),o+=1}if(!function(t,e){let i=-1/0;for(const s of t){const t=hg(s.value,e.scales.x);if(Number.isFinite(t)){if(t<i)return!1;i=t}}return!0}(a,e))return;const r=a.map(t=>t.axisValue);return{axisValues:r,oldDataAxisIndices:dg(e,r),newDataAxisIndices:dg(t,r)}}(t,e);return null==s?function(t,e,i){const s=[],n=[];for(const t of e.data){const s=t.span,a=Sg(e,t,i);n.push({from:s,to:a})}for(const e of t.data){const n=e.span,a=Sg(t,e,i);s.push({from:a,to:n})}return{removed:n,moved:[],added:s}}(t,e,i):function(t,e,i,s){const n={removed:[],moved:[],added:[]},{axisValues:a,oldDataAxisIndices:o,newDataAxisIndices:r}=t,l={xValue0Index:Math.max(o.at(0)?.xValue0Index??-1/0,r.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(o.at(-1)?.xValue1Index??1/0,r.at(-1)?.xValue1Index??1/0)};for(let t=0;t<a.length-1;t+=1)vg(e,i,s,a,t,r,o,l,n);return n}(s,t,e,i)}function kg(t){return"continuous"===t.type||"log"===t.type}function Dg(t){return"category"===t.type}function wg(t,e){return void 0===t||void 0===e?void 0!==t||void 0!==e:kg(t)&&kg(e)?t.type===e.type&&(0,s.r1)(t.domain,e.domain)&&(0,s.r1)(t.range,e.range):!(!Dg(t)||!Dg(e))&&t.inset===e.inset&&t.step===e.step&&(0,s.r1)(t.domain,e.domain)}function Ig(t){return null!=t&&("category"===t.type?t.domain.every(t=>null!=t):t.domain.every(t=>Number.isFinite(t)||t instanceof Date)&&t.range.every(t=>Number.isFinite(t)))}function Cg(t,e){let i;const s=t.map(t=>t.point);switch(e.type){case"linear":i=function(t){const e=[];let i=0,s=NaN,n=NaN;for(const{x:a,y:o}of t){if(i>0){const t=1===i;e.push({type:"linear",moveTo:t,x0:s,y0:n,x1:a,y1:o})}i+=1,s=a,n=o}return e}(s);break;case"smooth":i=function(t,e){const i=Array.isArray(t)?t:Array.from(t);if(i.length<=1)return[];const s=i.map((t,e)=>{const s=0===e?t:i[e-1],n=e===i.length-1?t:i[e+1],a=0===e||e===i.length-1;if(Math.sign(s.y-t.y)===Math.sign(n.y-t.y))return 0;if(!a){const e=Math.abs(s.y-n.y),i=Math.abs(t.y-s.y)/e,a=Math.abs(t.y-n.y)/e;if(i<=Qp||1-i<=Qp||a<=Qp||1-a<=Qp)return 0}return(n.y-s.y)/(n.x-s.x)});0===s[1]&&(s[0]*=2),0===s[s.length-2]&&(s[s.length-1]*=2);const n=[];for(let t=1;t<i.length;t+=1){const a=i[t-1],o=s[t-1],r=i[t],l=s[t],h=r.x-a.x,c=r.y-a.y;let d=h*e/3,u=h*o*e/3,p=h*e/3,g=h*l*e/3;0===l&&Math.abs(u)>Math.abs(c)&&(d*=Math.abs(c/u),u=Math.sign(u)*Math.abs(c)),0===o&&Math.abs(g)>Math.abs(c)&&(p*=Math.abs(c/g),g=Math.sign(g)*Math.abs(c)),n.push({type:"cubic",moveTo:1===t,cp0x:a.x,cp0y:a.y,cp1x:a.x+d,cp1y:a.y+u,cp2x:r.x-p,cp2y:r.y-g,cp3x:r.x,cp3y:r.y})}return n}(s,e.tension);break;case"step":i=function(t,e){const i=[];let s=0,n=NaN,a=NaN;const o="number"==typeof e?e:qp[e];for(const{x:e,y:r}of t){if(s>0){const t=1===s,l=n+(e-n)*o;i.push({type:"step",moveTo:t,x0:n,y0:a,x1:e,y1:r,stepX:l})}s+=1,n=e,a=r}return i}(s,e.position)}return i.map((e,i)=>({span:e,xValue0:t[i].xDatum,yValue0:t[i].yDatum,xValue1:t[i+1].xDatum,yValue1:t[i+1].yDatum}))}function Lg(t,e,i=.001){return Math.abs(t.x-e.x)<i&&Math.abs(t.y-e.y)<i}function Ag({path:t},e){let i;for(const{span:s}of e){const[e,n]=Up(s);ag(t,s,null!=i&&Lg(i,e)?1:0,!1),i=n}}function Tg(t,e,i){let s;for(const n of i){const[i,a]=og(n.from,n.to,t),o=null!=s&&Lg(s,i)?1:0;rg(e.path,n.from,n.to,t,o,!1),s=a}}function Ng(t,e,i){return{status:t,path:{addPhaseFn:(t,i)=>Tg(t,i,e.added),updatePhaseFn:(t,i)=>Tg(t,i,e.moved),removePhaseFn:(t,i)=>Tg(t,i,e.removed)},pathProperties:Og(t,i)}}function Og(t,e){const i="none"===e?"updated":t,s={fromFn:e=>{let s;return s="removed"===t?{finish:{visible:!1}}:"added"===t?{start:{visible:!0}}:{},{phase:or[i],...s}},toFn:t=>({phase:or[i]})};return"fade"===e?{fromFn:e=>({opacity:"added"===t?0:e.opacity,...s.fromFn(e)}),toFn:e=>({opacity:"removed"===t?0:1,...s.toFn(e)})}:s}function Rg(t,e,i){if("category"===t.scales.x?.type!=("category"===e.scales.x?.type)||!Ig(t.scales.x)||!Ig(e.scales.x))return;if(null==t.strokeData||null==e.strokeData)return;let s="updated";e.visible&&!t.visible?s="removed":!e.visible&&t.visible&&(s="added");const n=Mg({scales:t.scales,data:t.strokeData.spans},{scales:e.scales,data:e.strokeData.spans},1);return null!=n?{status:s,stroke:Ng(s,n,"fade"),hasMotion:(i?.changed??!0)||!wg(t.scales.x,e.scales.x)||!wg(t.scales.y,e.scales.y)||"updated"!==s}:void 0}function Eg({path:t},{spans:e,phantomSpans:i}){for(let s=0;s<e.length;s+=1){const{span:n}=e[s],a=i[s].span;ag(t,n,0,!1),ag(t,a,1,!0),t.closePath()}}function Pg(t,{path:e},i,s){for(let n=0;n<i.length;n+=1){const a=i[n],o=s[n];rg(e,a.from,a.to,t,0,!1),rg(e,o.from,o.to,t,1,!0),e.closePath()}}function Bg(t,e,i,s){return{status:t,path:{addPhaseFn:(t,s)=>Pg(t,s,e.added,i.added),updatePhaseFn:(t,s)=>Pg(t,s,e.moved,i.moved),removePhaseFn:(t,s)=>Pg(t,s,e.removed,i.removed)},pathProperties:Og(t,s)}}function Fg(t,e){if("category"===t.scales.x?.type!=("category"===e.scales.x?.type)||!Ig(t.scales.x)||!Ig(e.scales.x))return;let i="updated";e.visible&&!t.visible?i="removed":!e.visible&&t.visible&&(i="added");const s=Mg({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},0);if(null==s)return;const n=Mg({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},0);if(null==n)return;const a=Mg({scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},{scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},0);if(null==a)return;const o="none";return{status:i,fill:Bg(i,s,n,o),stroke:Ng(i,a,o)}}function zg({id:t},e,i,...s){lr(t,"markers",e,s,{opacity:0},{opacity:1},{phase:i?or[i]:"trailing"}),s.forEach(t=>t.cleanup())}function Gg({id:t},e,...i){lr(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(t=>t.cleanup())}function _g({id:t,nodeDataDependencies:e},i,...n){const a=e.seriesRectWidth;rr(t,"markers",i,n,{fromFn:(t,e)=>{const i=e.midPoint?.x??a;let n=(0,s.qE)(0,Tn(i/a),1);return isNaN(n)&&(n=0),{scalingX:0,scalingY:0,delay:n,duration:.2,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function jg(t){return{opacity:1,scalingX:1,scalingY:1}}function Wg(t,e){return{x:e.point?.x??NaN,y:e.point?.y??NaN,scalingCenterX:e.point?.x??NaN,scalingCenterY:e.point?.y??NaN}}function Vg(t,{datumIndex:e}){const i=t.getNodeData();if(void 0===i)return;const s=i[e],{point:n}=s??{};if(null==s||null==n)return;const a=4+(n.focusSize??t.getFormattedMarkerStyle(s).size),o=a/2,r=s.point.x-o,l=s.point.y-o;return Me.toCanvas(t.contentGroup,new y(r,l,a,a))}function Kg({id:t,visible:e,nodeDataDependencies:i},s,...n){const{seriesRectWidth:a,seriesRectHeight:o}=i;lr(t,"path_properties",s,n,{clipX:0},{clipX:a},{phase:"initial",start:{clip:!0,clipY:o,visible:e},finish:{clip:!1,visible:e}})}function Yg({id:t},e,i,s="add",...n){lr(t,e,i,n,{opacity:0},{opacity:1},{phase:s})}function $g(t){return e=>({visible:t.getVisible(),opacity:t.getOpacity(),clipScalingX:1,clip:!1})}function Hg({nodeDataDependencies:t},e){const i=t=>isFinite(t)?t:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}var Ug=class extends Yp{constructor(t){super({moduleCtx:t,directionKeys:_p,directionNames:jp,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:$g({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:vp,marker:(t,e)=>({opacity:1,scalingX:1,scalingY:1,...Wg(0,e)})},clipFocusBox:!1}),this.properties=new Hp,this.connectsToYAxis=!0,this.backgroundGroup=new Ie({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){return super.renderToOffscreenCanvas()||null!=this.contextNodeData&&(this.contextNodeData.fillData.spans.length>Kp||this.contextNodeData.strokeData.spans.length>Kp)}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||(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(null==this.data)return;const{data:e,visible:i,seriesGrouping:{groupIndex:n=this.id,stackCount:a=1}={}}=this,{xKey:o,yKey:r,yFilterKey:l,connectMissingData:h,normalizedTo:c}=this.properties,d=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,p=this.axes.y?.scale,{xScaleType:g,yScaleType:m}=this.getScaleInformation({xScale:u,yScale:p}),y={value:`area-stack-${n}-yValue`,values:`area-stack-${n}-yValues`,stack:`area-stack-${n}-yValue-stack`,marker:`area-stack-${n}-yValues-marker`},f=[];(0,s.vM)(c)&&f.push(ad(Object.values(y),c)),d&&f.push(hd());const x={invalidValue:null};((0,s.vM)(c)||h)&&a>1&&(x.invalidValue=0),i||(x.forceValue=0),await this.requestDataModel(t,e,{props:[Yc(o,g,{id:"xValue"}),$c(r,m,{id:"yValueRaw",...x}),...null!=l?[$c(l,m,{id:"yFilterRaw"})]:[],...td(r,m,{id:"yValueStack",...x,groupId:y.stack}),$c(r,m,{id:"yValue",...x,groupId:y.value}),...Jc(r,"window","current",{id:"yValueEnd",...x,groupId:y.values},m),...Jc(r,"normal","current",{id:"yValueCumulative",...x,groupId:y.marker},m),...f],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("x"===t){const t=i.resolveProcessedDataDefById(this,"xValue"),s=i.getDomain(this,"xValue","key",e);return"key"===t?.def.type&&"category"===t.def.valueType?s:Po(Lc(s))}const a=this.domainForClippedRange("y",["yValueCumulative"],"xValue",!0);return Po(n instanceof Wd||n instanceof Kd?a:Number.isFinite(a[1]-a[0])?[a[0]>0?0:a[0],a[1]<0?0:a[1]]:[])}getSeriesRange(t,e){const[i,s]=this.domainForVisibleRange("y",["yValueCumulative"],"xValue",e,!0);return[Math.min(i,0),Math.max(s,0)]}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValueCumulative"],t,e,i)}createNodeData(){const{axes:t,data:e,processedData:i,dataModel:n}=this,a=t.x,o=t.y;if(!(a&&o&&e&&n&&"grouped"===i?.type))return;const{yKey:r,xKey:l,yFilterKey:h,marker:c,label:d,fill:u,stroke:p,connectMissingData:g,interpolation:m}=this.properties,{scale:y}=a,{scale:f}=o,{isContinuousY:x}=this.getScaleInformation({xScale:y,yScale:f}),b=(y.bandwidth??0)/2,v=n.resolveKeysById(this,"xValue",i),S=n.resolveColumnById(this,"yValueEnd",i),M=n.resolveColumnById(this,"yValueRaw",i),k=n.resolveColumnById(this,"yValueCumulative",i),D=null!=h?n.resolveColumnById(this,"yFilterRaw",i):void 0,w=n.resolveColumnById(this,"yValueStack",i),I=(t,e,i)=>{let n;return((0,s.vM)(this.properties.normalizedTo)?x&&sl(i):!isNaN(i))&&(n=e),{x:y.convert(t)+b,y:f.convert(n),size:c.size}},C=[],L=[],{visibleSameStackCount:A}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let T=!1;const{dataSources:N}=i,O=N.get(this.id)??[];for(const{datumIndex:t}of n.forEachGroupDatum(this,i)){const e=v[t];if(null==e)return;const i=O[t],s=M[t],n=k[t],a=S[t],o=Number.isFinite(s),h=I(e,+n,s),g=null!=D?D[t]===s:void 0;if(!1===g&&(T=!0),o&&c&&L.push({series:this,itemId:r,datum:i,datumIndex:t,midPoint:{x:h.x,y:h.y},cumulativeValue:a,yValue:s,xValue:e,yKey:r,xKey:l,point:h,fill:c.fill??u,stroke:c.stroke??p,strokeWidth:c.strokeWidth??this.getStrokeWidth(this.properties.strokeWidth),selected:g}),o&&d){const e=this.getLabelText(d,{value:s,datum:i,xKey:l,yKey:r,xName:this.properties.xName,yName:this.properties.yName});C.push({series:this,itemId:r,datum:i,datumIndex:t,x:h.x,y:h.y,labelText:e})}}const R=(t,e)=>({point:{x:y.convert(t)+b,y:f.convert(e)},xDatum:t,yDatum:e}),E=t=>{const e=[];for(const{datumIndexes:[s,a,o]}of n.forEachGroupDatumTuple(this,i)){const i=v[a],n=w[a],r=n[t],l=Number.isFinite(r);if(g&&!l)continue;const h=null!=s?w[s]:void 0,c=null!=o?w[o]:void 0;let d=0,u=0;for(let e=0;e<=t;e+=1){const t=n[e];Number.isFinite(t)&&((null==h||Number.isFinite(h[e]))&&(d+=t),(null==c||Number.isFinite(c[e]))&&(u+=t))}const p=e[e.length-1];if(g||d===u&&l){const t=g?r:Math.max(d,u),s=R(i,t);Array.isArray(p)?p.push(s):null!=p?(p.skip+=1,e.push([s])):e.push([s])}else if(!l&&Array.isArray(p)&&1===p.length)e[e.length-1]={skip:1};else{const t=R(i,d),s=R(i,u);Array.isArray(p)?p.push(t):null!=p&&(p.skip+=1),e.push(l?[s]:{skip:0})}}return(t=>t.flatMap(t=>Array.isArray(t)?Cg(t,m):new Array(t.skip).fill(null)))(e)},P=this.seriesGrouping?.stackIndex??0,B=()=>Cg(Array.from(n.forEachGroupDatum(this,i),({datumIndex:t})=>{const e=v[t],i=w[t][P];if(!g||Number.isFinite(i))return R(e,0)}).filter(t=>null!=t),m),F=E(P),z=F.map(()=>null);for(let t=P-1;t>=-1;t-=1){let e;for(let i=0;i<z.length;i+=1)null==z[i]&&(e??(e=-1!==t?E(t):B()),z[i]=e[i])}const G=F.map((t,e)=>t??z[e]),_=F.filter(t=>null!=t);return{itemId:r,fillData:{itemId:r,spans:G,phantomSpans:z},strokeData:{itemId:r,spans:_},labelData:C,nodeData:L,scales:this.calculateScaling(),visible:this.visible,stackVisible:A>0,crossFiltering:T}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{opacity:e,visible:i,animationEnabled:s}=t,[n,a]=t.paths,o=!0===this.contextNodeData?.crossFiltering,r=this.getStrokeWidth(this.properties.strokeWidth);a.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:r,strokeOpacity:this.properties.strokeOpacity*(o?.25:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i||s}),mh(n,{fill:uh(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults),stroke:void 0,fillOpacity:this.properties.fillOpacity*(o?.125:1)},void 0,this.getShapeFillBBox()),n.setProperties({lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:e,visible:i||s}),Hg(this,a),Hg(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 e of t)e.path.clear(),e.markDirty("AreaSeries")}updateFillPath(t,e){const[i]=t;i.path.clear(),Eg(i,e.fillData),i.markDirty("AreaSeries")}updateStrokePath(t,e){const{spans:i}=e.strokeData,[,s]=t;s.path.clear(),Ag(s,i),s.markDirty("AreaSeries")}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t,s=this.properties.marker.enabled||!0===this.contextNodeData?.crossFiltering;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(s?e:[])}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,marker:a,fill:o,stroke:r,strokeWidth:l,fillOpacity:h,strokeOpacity:c,highlightStyle:d}=this.properties,u=this.getSeriesDomain("x"),p=this.getSeriesDomain("y"),g=E(i&&d.item,a.getStyle(),{fill:o,stroke:r,strokeWidth:l,fillOpacity:h,strokeOpacity:c}),m=this.getShapeFillBBox();e.each((t,e)=>{this.updateMarkerStyle(a,t,e.datum,e.point,Xn(e,s,n,u,p),i,g,m,{selected:e.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:a,fontFamily:o,color:r}=this.properties.label;e.each((t,e)=>{const{x:l,y:h,labelText:c}=e;c&&i&&this.visible?(t.fontStyle=s,t.fontWeight=n,t.fontSize=a,t.fontFamily=o,t.textAlign="center",t.textBaseline="bottom",t.text=c,t.x=l,t.y=h-10,t.fill=r,t.visible=!0):t.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:o,xName:r,yKey:l,yName:h,tooltip:c,marker:d}=a,u=n.x,p=n.y;if(!(i&&s&&u&&p))return;const g=s.dataSources.get(this.id)?.[t],m=i.resolveKeysById(this,"xValue",s)[t],y=i.resolveColumnById(this,"yValueRaw",s)[t],{xDomain:f,yDomain:x}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));if(null==m)return;const b=d.getStyle(),v={datum:g,xValue:m,yValue:y},S=this.getMarkerStyle(d,g,Xn(v,o,l,f,x),!1,void 0,b);return this.formatTooltipWithContext(c,{heading:u.formatDatum(m),symbol:this.legendItemSymbol(),data:[{label:h,fallbackLabel:l,value:p.formatDatum(y)}]},{seriesId:e,datum:g,title:h,xKey:o,xName:r,yKey:l,yName:h,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,marker:o,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:h}=this.properties,c=!o.enabled||void 0===o.fill,d=c?uh(t,r,l,h):uh(o.fill,o.fillGradientDefaults,o.fillPatternDefaults,o.fillImageDefaults);return{marker:{...this.getMarkerStyle(o,void 0,void 0,!1,void 0,{fill:d,fillOpacity:c?i:o.fillOpacity}),enabled:o.enabled||n<=0},line:{stroke:e,strokeOpacity:s,strokeWidth:n,lineDash:a}}}getLegendData(t){if("category"!==t)return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:a,legendItemName:o,showInLegend:r}=this.properties;return[{legendType:t,id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:o??a??n},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!r}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:a}=this.ctx;this.updateAreaPaths(n,s),Kg(this,a,...n),dr([e],Wg),_g(this,a,e),xp(this,"labels",a,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{markerSelection:i,labelSelection:s,contextData:n,paths:a,previousContextData:o}=t,[r,l]=a;if(null==r&&null==l)return;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const h=()=>{this.resetPathAnimation(t),this.updateAreaPaths(a,n)},c=()=>{e.skipCurrentBatch(),h()};if(null==n||null==o)return h(),zg(this,e,"added",i),Yg(this,"fill_path_properties",e,"add",r),Yg(this,"stroke_path_properties",e,"add",l),void xp(this,"labels",e,s);if(n.crossFiltering!==o.crossFiltering)return void c();const d=Fg(n,o);void 0!==d?"no-op"!==d.status&&(zg(this,e,void 0,i),rr(this.id,"fill_path_properties",e,[r],d.fill.pathProperties),fp(this.id,"fill_path_update",e,[r],d.fill.path),rr(this.id,"stroke_path_properties",e,[l],d.stroke.pathProperties),fp(this.id,"stroke_path_update",e,[l],d.stroke.path),xp(this,"labels",e,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,n)})):c()}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Ie}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=t,s=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,t.datum,Xn(t,e,i,s,n),!0)}computeFocusBounds(t){return Vg(this,t)}};Ug.className="AreaSeries",Ug.type="area";var Xg=(0,s.KC)("millisecond","second","minute","hour","day","month","year"),Zg=(0,s.W$)(s.t$,"a valid number format string"),qg={enabled:s.zM,text:s.Yj,padding:s.ai,...s.LV},Qg=(0,s.W$)({enabled:s.zM,type:(0,s.mw)((0,s.KC)("line","range")),range:(0,s.Uo)((0,s.W$)((t,{options:e})=>"range"===e.type,"crossLine type to be 'range'"),(0,s.jk)(s.sw),(0,s.O9)(2,2)),value:(0,s.Uo)((0,s.W$)((t,{options:e})=>"line"===e.type,"crossLine type to be 'line'"),s.sw),label:qg,fill:s.Yj,fillOpacity:s.CG,...s.AF,...s.mL},"cross-line options"),Jg={...Qg,label:{...qg,position:(0,s.KC)("top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"),rotation:s.ai}},tm={enabled:s.zM,rotation:s.ai,avoidCollisions:s.zM,minSpacing:s.Ly,spacing:s.Ly,formatter:s.E2,itemStyler:(0,s.YI)({...s.LV,spacing:s.ai}),...s.LV},em={autoRotate:s.zM,autoRotateAngle:s.ai,...tm},im={format:Zg,...em},sm={format:(0,s.or)(s.Yj,s.Ik),...em},nm={enabled:s.zM,width:s.Ly,size:s.Ly,stroke:s.yW},am={enabled:s.zM,label:sm,tick:nm},om={reverse:s.zM,gridLine:{enabled:s.zM,width:s.Ly,style:(0,s.J$)({stroke:(0,s.or)(s.yW,s.I_),lineDash:(0,s.jk)(s.Ly)},"a grid-line style object array")},interval:{values:(0,s.jk)(s.sw),minSpacing:s.Ly},label:tm,line:{enabled:s.zM,width:s.Ly,stroke:s.yW},tick:nm};om.context=(0,s._L)(()=>!0),om.layoutConstraints=(0,s._L)({stacked:(0,s.mw)(s.zM),align:(0,s.mw)((0,s.KC)("start","end")),unit:(0,s.mw)((0,s.KC)("percent","px")),width:(0,s.mw)(s.Ly)});var rm={...om,keys:(0,s.jk)(s.Yj),crossLines:(0,s.J$)(Jg,"a cross-line options array"),position:(0,s.KC)("top","right","bottom","left"),thickness:s.Ly,title:{enabled:s.zM,text:s.Yj,spacing:s.Ly,formatter:s.E2,...s.LV}};function lm(t){const e={enabled:s.zM,xOffset:s.ai,yOffset:s.ai,renderer:(0,s.R3)((0,s.or)(s.Yj,(0,s.fd)({text:s.Yj,color:s.yW,backgroundColor:s.yW,opacity:s.CG},"crosshair label renderer result object")))};return t&&(e.format=s.Yj),{enabled:s.zM,snap:s.zM,label:e,...s.AF,...s.mL}}function hm(t,e){return{min:(0,s.Uo)(t,(0,s.Xe)("max")),max:(0,s.Uo)(t,(0,s.MM)("min")),nice:s.zM,interval:{step:e?(0,s.or)(s.MX,Xg,(0,s.hR)(ba)):s.MX,values:(0,s.jk)(t),minSpacing:(0,s.Uo)(s.Ly,(0,s.Xe)("maxSpacing")),maxSpacing:(0,s.Uo)(s.Ly,(0,s.MM)("minSpacing"))}}}rm.title._enabledFromTheme=(0,s._L)(s.zM);var cm=(0,s.or)((0,s.KC)("circle","cross","diamond","heart","plus","pin","square","star","triangle"),s.E2),dm=(0,s.KC)("never","always","hyphenate","on-space"),um=(0,s.KC)("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),pm=(0,s.KC)("pointer","node","top","right","bottom","left","top-left","top-right","bottom-left","bottom-right"),gm=(0,s.or)(s.Ly,(0,s.KC)("exact","nearest")),mm=(0,s.KC)("pointer","start","middle","end"),ym={enabled:s.zM,text:s.Yj,textAlign:(0,s.KC)("left","center","right"),wrapping:(0,s.KC)("never","always","hyphenate","on-space"),spacing:s.Ly,maxWidth:s.Ly,maxHeight:s.Ly,...s.LV};ym.padding=(0,s._L)(s.Ly);var fm={enabled:s.zM,text:s.Yj,renderer:(0,s.R3)((0,s.or)(s.Yj,s.Sc))},xm=["defaults","download","zoom-to-cursor","pan-to-cursor","toggle-series-visibility","toggle-other-series","separator"],bm={type:(0,s.KC)("action","separator"),showOn:(0,s.KC)("always","series-area","series-node","legend-item"),label:(0,s.mw)(s.Yj),enabled:s.zM,action:s.E2,items:(t,e)=>Mm(t,e)};bm.iconUrl=(0,s._L)(s.Yj);var vm=(0,s.fd)(bm),Sm=(0,s.W$)((t,e)=>{let i;return"string"==typeof t?xm.includes(t)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new s.yI(s.By.Invalid,`a context menu item string alias: ["${xm.join('", "')}"]`,t,e.path))):i=vm(t,e),i},`a context menu item object or string alias: [${xm.join(", ")}]`),Mm=(0,s.jk)(Sm,"a menu items array",!1),km=(0,s.J$)({label:(0,s.mw)(s.Yj),action:(0,s.mw)(s.E2)},"a context menu actions array"),Dm={label:s.Yj,ariaLabel:s.Yj,tooltip:s.Yj,icon:(0,s.KC)("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")},wm={width:s.Ly,height:s.Ly,minWidth:s.Ly,minHeight:s.Ly,suppressFieldDotNotation:s.zM,title:ym,subtitle:ym,footnote:ym,padding:{top:s.Ly,right:s.Ly,bottom:s.Ly,left:s.Ly},seriesArea:{clip:s.zM,padding:{top:s.Ly,right:s.Ly,bottom:s.Ly,left:s.Ly}},legend:{enabled:s.zM,position:(0,s.KC)("top","right","bottom","left"),orientation:(0,s.KC)("horizontal","vertical"),maxWidth:s.Ly,maxHeight:s.Ly,spacing:s.Ly,preventHidingAll:s.zM,reverseOrder:s.zM,toggleSeries:s.zM,item:{marker:{size:s.Ly,shape:cm,padding:s.Ly,strokeWidth:s.Ly},line:{length:s.Ly,strokeWidth:s.Ly},label:{maxLength:s.Ly,formatter:s.E2,...s.LV},maxWidth:s.Ly,paddingX:s.Ly,paddingY:s.Ly,showSeriesStroke:s.zM},pagination:{marker:{size:s.Ly,shape:cm,padding:s.Ly},activeStyle:{...s.Fu,...s.AF},inactiveStyle:{...s.Fu,...s.AF},highlightStyle:{...s.Fu,...s.AF},label:s.LV},listeners:{legendItemClick:s.E2,legendItemDoubleClick:s.E2}},gradientLegend:{enabled:s.zM,position:(0,s.KC)("top","right","bottom","left"),spacing:s.Ly,reverseOrder:s.zM,gradient:{preferredLength:s.Ly,thickness:s.Ly},scale:{label:{...s.LV,format:Zg,formatter:s.E2},padding:s.Ly,interval:{step:s.ai,values:s.YO,minSpacing:(0,s.Uo)(s.Ly,(0,s.Xe)("maxSpacing")),maxSpacing:(0,s.Uo)(s.Ly,(0,s.MM)("minSpacing"))}}},listeners:{seriesNodeClick:s.E2,seriesNodeDoubleClick:s.E2,seriesVisibilityChange:s.E2,click:s.E2,doubleClick:s.E2,annotations:s.E2,zoom:s.E2},loadGoogleFonts:s.zM,highlight:{range:(0,s.KC)("tooltip","node")},overlays:{loading:fm,noData:fm,noVisibleSeries:fm,unsupportedBrowser:fm},tooltip:{enabled:s.zM,showArrow:s.zM,pagination:s.zM,delay:s.Ly,range:gm,wrapping:dm,mode:(0,s.KC)("single","shared","compact"),position:{type:pm,anchorTo:(0,s.KC)("pointer","node","chart"),placement:(0,s.or)(um,(0,s.jk)(um)),xOffset:s.ai,yOffset:s.ai}},animation:{enabled:s.zM,duration:s.Ly},contextMenu:{enabled:s.zM,items:Mm,extraActions:km,extraSeriesAreaActions:km,extraNodeActions:km,extraLegendItemActions:km},dataSource:{getData:s.E2},keyboard:{enabled:s.zM,tabIndex:s.ai},touch:{dragAction:(0,s.KC)("none","drag","hover")},ranges:{enabled:s.zM,buttons:(0,s.J$)({...Dm,value:(0,s.or)(s.ai,(0,s.Uo)((0,s.jk)((0,s.or)(s.ai,s.p6)),(0,s.O9)(2,2)),s.E2)},"range button options array")},locale:{localeText:s.Ik,getLocaleText:(0,s.R3)(s.Yj)},background:{visible:s.zM,fill:s.yW,image:{url:(0,s.mw)(s.Yj),top:s.ai,right:s.ai,bottom:s.ai,left:s.ai,width:s.Ly,height:s.Ly,opacity:s.CG}},styleNonce:s.Yj,sync:{enabled:s.zM,groupId:s.Yj,axes:(0,s.KC)("x","y","xy"),nodeInteraction:s.zM,zoom:s.zM},zoom:{enabled:s.zM,enableAxisDragging:s.zM,enableDoubleClickToReset:s.zM,enablePanning:s.zM,enableScrolling:s.zM,enableSelecting:s.zM,enableTwoFingerZoom:s.zM,keepAspectRatio:s.zM,anchorPointX:mm,anchorPointY:mm,axes:(0,s.KC)("x","y","xy"),deceleration:(0,s.or)((0,s.KC)("off","short","long"),s.CG),minVisibleItems:s.Ly,minVisibleItemsX:s.Ly,minVisibleItemsY:s.Ly,panKey:(0,s.KC)("alt","ctrl","meta","shift"),scrollingStep:s.CG,autoScaling:{enabled:s.zM,padding:s.CG},buttons:{enabled:s.zM,buttons:(0,s.J$)({...Dm,value:(0,s.KC)("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:s.Yj},"zoom button options array"),visible:(0,s.KC)("always","zoomed","hover")}}};wm.dataSource.requestThrottle=(0,s._L)(s.Ly),wm.dataSource.updateThrottle=(0,s._L)(s.Ly),wm.dataSource.updateDuringInteraction=(0,s._L)(s.zM),wm.zoom.enableIndependentAxes=(0,s._L)(s.zM),wm.statusBar=(0,s._L)(s.sw),wm.foreground=(0,s._L)({visible:s.zM,text:s.Yj,image:{url:s.Yj,top:s.ai,right:s.ai,bottom:s.ai,left:s.ai,width:s.Ly,height:s.Ly,opacity:s.CG},...s.Fu}),wm.context=(0,s._L)(()=>!0),wm.overrideDevicePixelRatio=(0,s._L)(s.ai),wm.sync.domainMode=(0,s._L)((0,s.KC)("direction","position","key"));var Im={cursor:s.Yj,showInLegend:s.zM,nodeClickRange:gm,listeners:{nodeClick:s.E2,nodeDoubleClick:s.E2},highlightStyle:{item:{...s.Fu,...s.AF},series:{enabled:s.zM,dimOpacity:s.CG,strokeWidth:s.Ly}}},Cm={...Im,id:s.Yj,visible:s.zM,data:s.YO};Cm.context=(0,s._L)(()=>!0),Cm.seriesGrouping=(0,s._L)(s.sw),Cm.highlight=(0,s._L)({enabled:s.zM});var Lm={enabled:s.zM,shape:cm,size:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,shape:cm,size:s.Ly}),...s.Fu,...s.AF,...s.mL},Am={enabled:s.zM,formatter:s.E2,...s.LV},Tm={...Am,lineHeight:s.Ly,minimumFontSize:s.Ly,wrapping:dm,overflowStrategy:(0,s.KC)("ellipsis","hide")},Nm={visible:s.zM,cap:{visible:s.zM,length:s.Ly,lengthRatio:s.CG,...s.AF,...s.mL},...s.AF,...s.mL},Om={...Nm,xLowerKey:s.Yj,xUpperKey:s.Yj,yLowerKey:s.Yj,yUpperKey:s.Yj,xLowerName:s.Yj,xUpperName:s.Yj,yLowerName:s.Yj,yUpperName:s.Yj,itemStyler:(0,s.YI)({visible:s.zM,...s.AF,...s.mL,cap:{visible:s.zM,length:s.Ly,lengthRatio:s.CG,...s.AF,...s.mL}})},Rm={enabled:s.zM,showArrow:s.zM,range:gm,renderer:(0,s.R3)((0,s.or)(s.Yj,(0,s.fd)({heading:s.Yj,title:s.Yj,data:(0,s.J$)({label:(0,s.mw)(s.Yj),value:(0,s.mw)(s.Yj)})},"tooltip renderer result object"))),position:{type:pm,anchorTo:(0,s.KC)("node","pointer","chart"),placement:(0,s.or)(um,(0,s.jk)(um)),xOffset:s.ai,yOffset:s.ai},interaction:{enabled:s.zM}};Rm.position._seriesOverrideType=(0,s._L)(pm);var Em={enabled:s.zM,xOffset:s.ai,yOffset:s.ai,blur:s.Ly,color:s.yW},Pm=(0,s.is)({linear:{},smooth:{tension:s.CG},step:{position:(0,s.KC)("start","middle","end")}},"interpolation line options"),Bm={showInMiniChart:s.zM,connectMissingData:s.zM,interpolation:Pm,label:Am,marker:Lm,tooltip:Rm,shadow:Em,...Im,...s.Fu,...s.AF,...s.mL},Fm={...Bm,...Cm,type:(0,s.mw)((0,s.dY)("area")),xKey:(0,s.mw)(s.Yj),yKey:(0,s.mw)(s.Yj),xName:s.Yj,yName:s.Yj,stacked:s.zM,stackGroup:s.Yj,normalizedTo:s.ai},zm={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:t=>new Ug(t),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{nodeClickRange:"nearest",tooltip:{position:{_seriesOverrideType:"node"}},fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:gp,fillImageDefaults:mp,stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Tu,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:gp},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},Gm={type:"series",name:"area",chartType:"cartesian",options:Fm,create:t=>new Ug(t)};function _m(t,e){for(const i of e){const e=i.datum;void 0===e?s.Vy.error("undefined datum"):t.addValue(i,e)}}function jm(t,e){const{x:i,y:s}=e,{nearest:n,distanceSquared:a}=t.getQuadTree().find(i,s);if(void 0!==n)return{datum:n.value,distance:Math.sqrt(a)}}var Wm=class extends Vp{constructor(){super(...arguments),this.direction="vertical"}};r([Ct],Wm.prototype,"direction",2);var Vm=class extends Yp{constructor(){super(...arguments),this.groupScale=new Mc,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(t,e){const i="boolean"==typeof e?1:.5,n=(0,s.Bf)(this.smallestDataInterval)?this.smallestDataInterval*i:0,a=Lc(t)??[NaN,NaN];return"boolean"==typeof e?a[e?0:1]-=(e?1:-1)*n:(a[0]-=n,a[1]+=n),Po(a)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return"vertical"===this.properties.direction}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,e){return ha.is(t.scale)?t.scale.calcBandwidth(this.smallestDataInterval,e):t.scale.bandwidth}xCoordinateRange(t){const e=this.axes[this.getCategoryDirection()],i=e.scale,s=this.getBandwidth(e,0)??0,n=ha.is(i)?-.5*s:0,a=i.convert(t)+n;return[a,a+s]}yCoordinateRange(t){const e=this.axes[this.getBarDirection()].scale,i=t.map(t=>e.convert(t));if(1===i.length){const t=e.convert(0);return[Math.min(i[0],t),Math.max(i[0],t)]}return[Math.min(...i),Math.max(...i)]}updateGroupScale(t){const e=[],{groupScale:i}=this,s=this.getBandwidth(t),{index:n,visibleGroupCount:a}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);for(let t=0;t<a;t++)e.push(String(t));return i.domain=e,i.range=[0,s??0],t instanceof Od?i.paddingInner=t.groupPaddingInner:t instanceof Ic?(i.paddingInner=t.groupPaddingInner,i.round=0!==i.padding):i.padding=0,{barWidth:i.bandwidth>=1?i.bandwidth:i.rawBandwidth,groupIndex:n}}resolveKeyDirection(t){return"x"===this.getBarDirection()?"x"===t?"y":"x":t}initQuadTree(t){_m(t,this.datumNodesIter())}pickNodeClosestDatum(t){return jm(this,t)}},Km=class extends pl{constructor(){super(...arguments),this.placement="inside-center",this.padding=0}};r([Ct],Km.prototype,"placement",2),r([Ct],Km.prototype,"padding",2);var Ym=class extends Wm{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Cp,this.fillPatternDefaults=new Lp,this.fillImageDefaults=new Ap,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 Mp,this.label=new Km,this.tooltip=new Ep,this.sparklineMode=!1,this.fastDataProcessing=!1}};function $m(t,e,i,s){if(null!=e){const[t,i]=e;if(0!==t||1!==i)return!1}if(ha.is(t)){const e=t.calcBandwidth(s)-t.calcBandwidth(i);if(e>0&&e<1)return!1}return!0}r([Ct],Ym.prototype,"xKey",2),r([Ct],Ym.prototype,"xName",2),r([Ct],Ym.prototype,"yKey",2),r([Ct],Ym.prototype,"yName",2),r([Ct],Ym.prototype,"yFilterKey",2),r([Ct],Ym.prototype,"stackGroup",2),r([Ct],Ym.prototype,"normalizedTo",2),r([Ct],Ym.prototype,"fill",2),r([Ct],Ym.prototype,"fillGradientDefaults",2),r([Ct],Ym.prototype,"fillPatternDefaults",2),r([Ct],Ym.prototype,"fillImageDefaults",2),r([Ct],Ym.prototype,"fillOpacity",2),r([Ct],Ym.prototype,"stroke",2),r([Ct],Ym.prototype,"strokeWidth",2),r([Ct],Ym.prototype,"strokeOpacity",2),r([Ct],Ym.prototype,"lineDash",2),r([Ct],Ym.prototype,"lineDashOffset",2),r([Ct],Ym.prototype,"cornerRadius",2),r([Ct],Ym.prototype,"crisp",2),r([Ct],Ym.prototype,"itemStyler",2),r([Ct],Ym.prototype,"shadow",2),r([Ct],Ym.prototype,"label",2),r([Ct],Ym.prototype,"tooltip",2),r([Ct],Ym.prototype,"sparklineMode",2),r([Ct],Ym.prototype,"fastDataProcessing",2);var Hm=t=>(0,s.cI)(t.yValue??0);function Um(t,e,i){const{startingX:s,startingY:n}=function(t,e){const i=e[t?"y":"x"];let s=1/0,n=0;return i?(t?n=i.scale.convert(ha.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(ha.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}(t,e);return{isVertical:t,calculate:(e,i)=>{let a=t?e.x:s,o=t?n:e.y,r=t?e.width:0,l=t?0:e.height;const{opacity:h=1}=e;let c;return i&&(isNaN(a)||isNaN(o))&&(({x:a,y:o}=i),r=t?i.width:0,l=t?0:i.height,t&&!Hm(i)?o+=i.height:!t&&Hm(i)&&(a+=i.width)),c=null==e.clipBBox?void 0:Hm(e)?t?new y(a,o-l,r,l):new y(a-r,o,r,l):new y(a,o,r,l),{x:a,y:o,width:r,height:l,clipBBox:c,opacity:h}},mode:i}}function Xm(t,e){return{isVertical:t,calculate:e=>({x:t?e.x:e.x+e.width/2,y:t?e.y+e.height/2:e.y,width:t?e.width:0,height:t?0:e.height,clipBBox:e.clipBBox,opacity:e.opacity??1}),mode:e}}function Zm(t){const e=t=>null==t||isNaN(t.x)||isNaN(t.y);return{toFn:(i,s,n)=>"removed"===n&&null==i.datum&&"fade"===t.mode?{...qm(i,s),opacity:0}:"removed"===n||e(s)?t.calculate(s,i.previousDatum):{x:s.x,y:s.y,width:s.width,height:s.height,clipBBox:s.clipBBox,opacity:s.opacity??1},fromFn:(i,s,n)=>{let a;"updated"===n&&e(s)?n="removed":"updated"===n&&e(i.previousDatum)&&(n="added"),a="added"===n&&null==i.previousDatum&&"fade"===t.mode?{...qm(i,s),opacity:0}:"unknown"===n||"added"===n?t.calculate(s,i.previousDatum):{x:i.x,y:i.y,width:i.width,height:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1};const o=or[n];return{...a,phase:o}},applyFn:(t,e,i)=>{t.setProperties(e),t.crisp="end"===i&&(t.datum?.crisp??!1)}}}function qm(t,{x:e,y:i,width:s,height:n,clipBBox:a,opacity:o=1}){return{x:e,y:i,width:s,height:n,clipBBox:a,opacity:o,crisp:t.datum?.crisp??!1}}function Qm(t,e){if(void 0===e)return;const{x:i,y:s,width:n,height:a}=e;return Me.toCanvas(t.contentGroup,new y(i,s,n,a))}function Jm(t,e,i,s,n,a){let o=a?.reduced?.diff?.[t];if(o?.changed)return o;const r=function(t,e){if(!e)return!1;const i=t.scales,s=e.scales;if(!wg(i.x,s.x))return!0;if(!wg(i.y,s.y))return!0;if(!ty(t)||!ty(e))return!1;return!wg(t.groupScale,e.groupScale)}(s,n);return null==o&&null!=a?.reduced?.diff?(o={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},r?o.updated=new Set(Array.from(e,({datum:t})=>i(t))):o.added=new Set(Array.from(e,({datum:t})=>i(t)))):r&&(o={changed:!0,added:new Set,updated:new Set(Array.from(e,({datum:t})=>i(t))),removed:new Set,moved:new Set}),o}function ty(t){return"object"==typeof t&&null!==t&&"groupScale"in t}function ey(t,e,i){if(e.enabled&&i){const{x:s,y:n,text:a,textAlign:o,textBaseline:r}=i,{color:l,fontStyle:h,fontWeight:c,fontSize:d,fontFamily:u}=e;t.setProperties({visible:!0,x:s,y:n,text:a,fill:l,fontStyle:h,fontWeight:c,fontSize:d,fontFamily:u,textAlign:o,textBaseline:r})}else t.visible=!1}var iy={"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 sy({isUpward:t,isVertical:e,placement:i,padding:s=0,rect:n}){let a=n.x+n.width/2,o=n.y+n.height/2,r="center",l="middle";if("inside-center"!==i){const h=(t?1:-1)*(e?-1:1),{direction:c,textAlignment:d}=iy[i],u=.5*(c+1);e?(o=(t?n.y+n.height:n.y)+n.height*h*u+s*d*h,l=d===h?"top":"bottom"):(a=(t?n.x:n.x+n.width)+n.width*h*u+s*d*h,r=d===h?"left":"right")}return{x:a,y:o,textAlign:r,textBaseline:l}}var ny=class extends Vm{constructor(t){super({moduleCtx:t,directionKeys:_p,directionNames:jp,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:qm,label:vp}}),this.properties=new Ym,this.connectsToYAxis=!0,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}crossFilteringEnabled(){return null!=this.properties.yFilterKey&&(null==this.seriesGrouping||0===this.seriesGrouping.stackIndex)}async processData(t){if(!this.data)return;const{xKey:e,yKey:i,yFilterKey:n,normalizedTo:a,fastDataProcessing:o}=this.properties,{seriesGrouping:{groupIndex:r=this.id}={},data:l}=this,h=this.seriesGrouping?.groupCount??0,c=(this.seriesGrouping?.stackCount??0)>=1||null!=a,d=!o||h>1||c,u=!this.ctx.animationManager.isSkipped(),p=this.getCategoryAxis()?.scale,g=this.getValueAxis()?.scale,{isContinuousX:m,xScaleType:y,yScaleType:f}=this.getScaleInformation({xScale:p,yScale:g}),x=`bar-stack-${r}-yValues`,b=`${x}-trailing`,v=this.visible?{}:{forceValue:0},S=[Yc(e,y,{id:"xValue"}),$c(i,f,{id:"yValue-raw",invalidValue:null,...v})];this.crossFilteringEnabled()&&S.push($c(n,f,{id:"yFilterValue",invalidValue:null,...v})),c&&S.push(...Jc(i,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:x,separateNegative:!0,...v},f),...Jc(i,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:b,separateNegative:!0,...v},f)),m&&S.push(ed,id),(0,s.Bf)(a)&&S.push(ad([x,b],Math.abs(a))),u&&this.processedData&&S.push(fd(this.id,this.processedData)),!u&&d||S.push(hd());const{dataModel:M,processedData:k}=await this.requestDataModel(t,l,{props:S,groupByKeys:d,groupByData:!d});this.dataAggregationFilters=this.aggregateData(M,k),this.smallestDataInterval=k.reduced?.smallestKeyInterval,this.largestDataInterval=k.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(null==i||null==e)return[];if(t===this.getCategoryDirection()){const t=i.resolveProcessedDataDefById(this,"xValue"),s=i.getDomain(this,"xValue","key",e);return"key"===t?.def.type&&"category"===t.def.valueType?s:this.padBandExtent(s)}const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";let n=this.domainForClippedRange(t,[s],"xValue",!0);const a=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",e):void 0;return null!=a&&(n=[Math.min(n[0],a[0]),Math.max(n[1],a[1])]),this.getValueAxis()instanceof Wd?Po(n):Po(Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[])}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(),a=this.getValueAxis();if(!(t&&e&&n&&a))return;const o=e.dataSources?.get(this.id);if(null==o)return;const r=n.scale,l=a.scale,{xKey:h,yKey:c,xName:d,yName:u,legendItemName:p,label:g}=this.properties,m=a.isReversed(),{barWidth:f,groupIndex:x}=this.updateGroupScale(n),b=i.convert(String(x)),v=ha.is(r)?-.5*f:0,S=t.resolveKeysById(this,"xValue",e),M=t.resolveColumnById(this,"yValue-raw",e),k=this.crossFilteringEnabled()?t.resolveColumnById(this,"yFilterValue",e):void 0,D=!this.ctx.animationManager.isSkipped(),w=t=>r.convert(S[t])+b+v,I=this.properties.crisp??$m(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),C=l.convert(0),L=({datum:t,datumIndex:e,valueIndex:i,xValue:s,yValue:n,cumulativeValue:a,phantom:o,currY:r,prevY:d,x:u,width:p,isPositive:f,yRange:x,labelText:b,opacity:v,crossScale:S=1})=>{const M=f!==m,k=l.convert(r),D=l.convert(d),w=l.convert(x),L="x"===this.getBarDirection(),A=.5*p*(1-S),T={x:L?Math.min(k,D):u+A,y:L?u+A:Math.min(k,D),width:L?Math.abs(D-k):p*S,height:L?p*S:Math.abs(D-k)},N=new y(T.x,T.y,T.width,T.height),O={x:L?Math.min(C,w):u+A,y:L?u+A:Math.min(C,w),width:L?Math.abs(C-w):p*S,height:L?p*S:Math.abs(C-w)},R=this.shouldFlipXY()?T.height:T.width;return{series:this,itemId:o?xd(c,o):c,datum:t,datumIndex:e,valueIndex:i,cumulativeValue:a,phantom:o,xValue:s,yValue:n,yKey:c,xKey:h,capDefaults:{lengthRatioMultiplier:R,lengthMax:R},x:O.x,y:O.y,width:O.width,height:O.height,midPoint:{x:T.x+T.width/2,y:T.y+T.height/2},opacity:v,topLeftCornerRadius:L!==M,topRightCornerRadius:M,bottomRightCornerRadius:L===M,bottomLeftCornerRadius:!M,clipBBox:N,crisp:I,label:null!=b?{text:b,...sy({isUpward:M,isVertical:!L,placement:g.placement,padding:g.padding,rect:T})}:void 0,missing:null==n,focusable:!o}},A=[],T=[],N=[],O=(t,e,i,s,n,a,r,l)=>{const g=S[t];if(null==g)return;const m=M[t],y=null!=k?Number(k[t]):void 0,f=m>=0&&!Object.is(m,-0);if(!Number.isFinite(a))return;if(null!=y&&!Number.isFinite(y))return;const x=null!=m?this.getLabelText(this.properties.label,{datum:o[t],value:y??m,xKey:h,yKey:c,xName:d,yName:u,legendItemName:p}):void 0,b=null!=y&&y>m,v=L({datum:o[t],datumIndex:t,valueIndex:e,xValue:g,yValue:y??m,cumulativeValue:y??a,phantom:!1,currY:null!=y?n+y:a,prevY:n,x:i,width:s,isPositive:f,yRange:Math.max(n+(y??-1/0),r),labelText:x,opacity:l,crossScale:b?.6:void 0});if(T.push(v),N.push(v),null!=y){const h=L({datum:o[t],datumIndex:t,valueIndex:e,xValue:g,yValue:y,cumulativeValue:y,phantom:!0,currY:a,prevY:n,x:i,width:s,isPositive:f,yRange:r,labelText:void 0,opacity:l,crossScale:void 0});A.push(h)}},[R,E]=r.range,P=E-R,B=s?.find(t=>t.maxRange>P);if("grouped"===e.type){const i=f,s=t.hasColumnById(this,"yValue-start"),n=s?t.resolveColumnById(this,"yValue-start",e):void 0,a=s?t.resolveColumnById(this,"yValue-end",e):void 0,o=s?t.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:r,valueIndex:l,group:{aggregation:h}}of t.forEachGroupDatum(this,e)){const t=w(r),e=M[r],c=e>=0&&!Object.is(e,-0),d=s?Number(n?.[r]):0,u=s?Number(a?.[r]):e;let p=u;s&&(p=h[o][c?1:0]),O(r,l,t,i,d,u,p,1)}}else if(null==B){const t=f;let[i,s]=this.visibleRange("xValue",n.range);e.input.count<1e3&&(i=0,s=e.input.count);for(let e=i;e<s;e+=1){const i=w(e),s=Number(M[e]);O(e,0,i,t,0,s,s,1)}}else{const{indexData:t,indices:e}=B,[i,s]=this.visibleRange("xValue",n.range,e);for(let e=i;e<s;e+=1){const i=4*e,s=t[i+0],n=t[i+1],a=t[i+2],o=t[i+3];if(-1===s)continue;const r=w((s+n)/2|0),l=Math.abs(w(n)-w(s))+f,h=null!=S[o]?Number(M[o]):NaN,c=null!=S[a]?Number(M[a]):NaN;h>0&&O(o,0,r,l,0,h,h,c>=0?c/h:1),c<0&&O(a,1,r,l,0,c,c,h<=0?h/c:1)}}return{itemId:c,nodeData:A.length>0?[...A,...T]:T,labelData:N,scales:this.calculateScaling(),visible:this.visible||D,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new qd}getHighlightData(t,e){const i=t.find(t=>t.datum===e.datum&&!t.phantom);return null!=i?[i]:void 0}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,t=>this.getDatumId(t))}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i,fillGradientDefaults:s,fillPatternDefaults:n,fillImageDefaults:a}=e,o=t?e.highlightStyle.item:void 0;return ph({fill:o?.fill??e.fill,fillOpacity:o?.fillOpacity??e.fillOpacity,stroke:o?.stroke??e.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:o?.strokeOpacity??e.strokeOpacity,lineDash:o?.lineDash??e.lineDash??[],lineDashOffset:o?.lineDashOffset??e.lineDashOffset,cornerRadius:i},s,n,a)}getItemStyleOverrides(t,e,i,s,n,a){const{id:o,properties:r}=this,{xKey:l,yKey:h,itemStyler:c,fillGradientDefaults:d,fillPatternDefaults:u,fillImageDefaults:p}=r;if(null==c)return;const{xDomain:g,yDomain:m}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));return ph(this.cachedDatumCallback(xd(t,a?"highlight":"node"),()=>this.callWithContext(c,{seriesId:o,...Xn(e,l,h,g,m),datum:e,xValue:i,yValue:s,highlighted:a,...n})),d,u,p)}updateDatumNodes(t){const{shadow:e}=this.properties,i="x"===this.getCategoryDirection(),s=this.getItemBaseStyle(t.isHighlight),n=this.getShapeFillBBox();t.datumSelection.each((a,o)=>{const r=this.getItemStyleOverrides(String(o.datumIndex),o.datum,o.xValue,o.yValue,s,t.isHighlight);a.opacity=o.opacity??0,mh(a,s,r,n);const l=r?.cornerRadius??s.cornerRadius;a.topLeftCornerRadius=o.topLeftCornerRadius?l:0,a.topRightCornerRadius=o.topRightCornerRadius?l:0,a.bottomRightCornerRadius=o.bottomRightCornerRadius?l:0,a.bottomLeftCornerRadius=o.bottomLeftCornerRadius?l:0,a.visible=i?(o.clipBBox?.width??o.width)>0:(o.clipBBox?.height??o.height)>0,a.crisp=o.crisp,a.fillShadow=e})}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e,t=>{t.pointerEvents=1})}updateLabelNodes(t){t.labelSelection.each((t,e)=>{ey(t,this.properties.label,e.label)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yKey:r,yName:l,legendItemName:h,stackGroup:c,tooltip:d}=n,u=this.getCategoryAxis(),p=this.getValueAxis();if(!(i&&s&&u&&p))return;const g=s.dataSources.get(this.id)?.[t],m=i.resolveKeysById(this,"xValue",s)[t],y=i.resolveColumnById(this,"yValue-raw",s)[t];if(null==m)return;const f=this.getItemBaseStyle(!1);return Object.assign(f,this.getItemStyleOverrides(String(t),g,m,y,f,!1)),this.formatTooltipWithContext(d,{heading:u.formatDatum(m),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:r,value:p.formatDatum(y)}]},{seriesId:e,datum:g,title:l,xKey:a,xName:o,yKey:r,yName:l,legendItemName:h,stackGroup:c,...f,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:h}=this.properties;return{marker:ph({fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:a,lineDashOffset:o},r,l,h)}}getLegendData(t){const{showInLegend:e}=this.properties;if("category"!==t)return[];const{id:i,ctx:{legendManager:s},visible:n}=this,{yKey:a,yName:o,legendItemName:r}=this.properties;return[{legendType:"category",id:i,itemId:a,seriesId:i,enabled:n&&s.getItemEnabled({seriesId:i,itemId:a}),label:{text:r??o??a},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!e}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const s=Zm(Um(this.isVertical(),this.axes,"normal"));rr(this.id,"nodes",this.ctx.animationManager,[t],s),xp(this,"labels",this.ctx.animationManager,e),xp(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(t){const{datumSelection:e,labelSelection:i,annotationSelections:s,contextData:n,previousContextData:a}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);const o=Jm(this.id,e,this.getDatumId.bind(this),t.contextData,a,this.processedData),r=null==a?"fade":"normal",l=Zm(Um(this.isVertical(),this.axes,r));rr(this.id,"nodes",this.ctx.animationManager,[e],l,(t,e)=>this.getDatumId(e),o),!o?.changed&&wg(n.groupScale,a?.groupScale)||(xp(this,"labels",this.ctx.animationManager,i),xp(this,"annotations",this.ctx.animationManager,...s))}getDatumId(t){return xd(t.xValue,t.valueIndex,t.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t].clipBBox;return Qm(this,e)}};ny.className="BarSeries",ny.type="bar";var ay={direction:(0,s.KC)("horizontal","vertical"),showInMiniChart:s.zM,cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),crisp:s.zM,label:{...Am,placement:(0,s.KC)("inside-center","inside-start","inside-end","outside-start","outside-end"),padding:s.Ly},errorBar:Nm,shadow:Em,tooltip:Rm,...Im,...s.Fu,...s.AF,...s.mL};ay.sparklineMode=(0,s._L)(s.zM);var oy={...ay,...Cm,type:(0,s.mw)((0,s.dY)("bar")),xKey:(0,s.mw)(s.Yj),yKey:(0,s.mw)(s.Yj),xName:s.Yj,yName:s.Yj,direction:(0,s.KC)("horizontal","vertical"),grouped:s.zM,stacked:s.zM,stackGroup:s.Yj,normalizedTo:s.ai,legendItemName:s.Yj,errorBar:Om};oy.pickOutsideVisibleMinorAxis=(0,s._L)(s.zM),oy.fastDataProcessing=(0,s._L)(s.zM),oy.focusPriority=(0,s._L)(s.ai);var ry={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:t=>new ny(t),stackable:!0,groupable:!0,tooltipDefaults:{range:"exact"},defaultAxes:hp,themeTemplate:{series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:gp,fillImageDefaults:mp,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:Tu,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}}}}},ly={type:"series",name:"bar",chartType:"cartesian",options:oy,create:t=>new ny(t)},hy=class extends Op{constructor(){super(...arguments),this.maxSize=30}};r([Ct,H()],hy.prototype,"maxSize",2),r([Ct,X()],hy.prototype,"domain",2);var cy=class extends pl{constructor(){super(...arguments),this.placement="top"}};r([Ct],cy.prototype,"placement",2);var dy=class extends Vp{constructor(){super(...arguments),this.label=new cy,this.tooltip=new Ep,this.marker=new hy}};r([Ct],dy.prototype,"xKey",2),r([Ct],dy.prototype,"yKey",2),r([Ct],dy.prototype,"sizeKey",2),r([Ct],dy.prototype,"labelKey",2),r([Ct],dy.prototype,"xFilterKey",2),r([Ct],dy.prototype,"yFilterKey",2),r([Ct],dy.prototype,"sizeFilterKey",2),r([Ct],dy.prototype,"xName",2),r([Ct],dy.prototype,"yName",2),r([Ct],dy.prototype,"sizeName",2),r([Ct],dy.prototype,"labelName",2),r([Ct],dy.prototype,"title",2),r([ai("marker.shape")],dy.prototype,"shape",2),r([ai("marker.size")],dy.prototype,"size",2),r([ai("marker.maxSize")],dy.prototype,"maxSize",2),r([ai("marker.domain")],dy.prototype,"domain",2),r([ai("marker.fillGradientDefaults")],dy.prototype,"fillGradientDefaults",2),r([ai("marker.fillPatternDefaults")],dy.prototype,"fillPatternDefaults",2),r([ai("marker.fillImageDefaults")],dy.prototype,"fillImageDefaults",2),r([ai("marker.fill")],dy.prototype,"fill",2),r([ai("marker.fillOpacity")],dy.prototype,"fillOpacity",2),r([ai("marker.stroke")],dy.prototype,"stroke",2),r([ai("marker.strokeWidth")],dy.prototype,"strokeWidth",2),r([ai("marker.strokeOpacity")],dy.prototype,"strokeOpacity",2),r([ai("marker.lineDash")],dy.prototype,"lineDash",2),r([ai("marker.lineDashOffset")],dy.prototype,"lineDashOffset",2),r([ai("marker.itemStyler")],dy.prototype,"itemStyler",2),r([Ct],dy.prototype,"label",2),r([Ct],dy.prototype,"tooltip",2);var uy=class extends Wp{constructor(t,e,i,s){super(t,e,i,s),this.sizeKey=s.properties.sizeKey}},py=class extends Yp{constructor(t){super({moduleCtx:t,directionKeys:_p,directionNames:jp,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:vp,marker:jg},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=uy,this.properties=new dy,this.sizeScale=new _d}get pickModeAxis(){return"main-category"}async processData(t){if(null==this.data||!this.visible)return;const e=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:e,yScale:i}),a=this.sizeScale.type,{xKey:o,yKey:r,sizeKey:l,xFilterKey:h,yFilterKey:c,sizeFilterKey:d,labelKey:u,marker:p}=this.properties,{dataModel:g,processedData:m}=await this.requestDataModel(t,this.data,{props:[$c(o,s,{id:"xValue"}),$c(r,n,{id:"yValue"}),...null!=h?[$c(h,s,{id:"xFilterValue"})]:[],...null!=c?[$c(c,n,{id:"yFilterValue"})]:[],...null!=d?[$c(d,a,{id:"sizeFilterValue"})]:[],$c(l,a,{id:"sizeValue"}),...u?[$c(u,"band",{id:"labelValue"})]:[]]}),y=g.resolveProcessedDataIndexById(this,"sizeValue"),f=p.domain?[p.domain[0],p.domain[1]]:void 0;this.sizeScale.domain=f??m.domain.values[y]??[],this.animationState.transition("updateData")}xCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:a,sizeKey:o}=s,r=this.axes.x.scale.convert(t),l=null!=o?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(null!=l?n.convert(l[i]):a)*e;return[r-h,r+h]}yCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:a,sizeKey:o}=s,r=this.axes.y.scale.convert(t[0]),l=null!=o?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(null!=l?n.convert(l[i]):a)*e;return[r-h,r+h]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s={x:"xValue",y:"yValue"},n=s[t],a=e.resolveProcessedDataDefById(this,n),o=e.getDomain(this,n,"value",i);if("value"===a?.def.type&&"category"===a?.def.valueType)return o;const r=s["x"===t?"y":"x"];return Po(Lc(this.domainForClippedRange(t,[n],r,!1)))}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,sizeScale:s,visible:n}=this,{xKey:a,yKey:o,sizeKey:r,xFilterKey:l,yFilterKey:h,sizeFilterKey:c,labelKey:d,xName:u,yName:p,sizeName:g,labelName:m,label:y,marker:f}=this.properties,{placement:x}=y,b=Ph.anchor(f.shape),v=t.x,S=t.y;if(!(e&&i&&n&&v&&S))return;const M=e.resolveColumnById(this,"xValue",i),k=e.resolveColumnById(this,"yValue",i),D=null!=r?e.resolveColumnById(this,"sizeValue",i):void 0,w=null!=d?e.resolveColumnById(this,"labelValue",i):void 0,I=null!=l?e.resolveColumnById(this,"xFilterValue",i):void 0,C=null!=h?e.resolveColumnById(this,"yFilterValue",i):void 0,L=null!=c?e.resolveColumnById(this,"sizeFilterValue",i):void 0,A=v.scale,T=S.scale,N=(A.bandwidth??0)/2,O=(T.bandwidth??0)/2,R=[];s.range=[f.size,f.maxSize];const E=y.getFont(),P=Li.getMeasurer({font:E});return i.dataSources.get(this.id)?.forEach((t,e)=>{const i=M[e],n=k[e],l=D?.[e],h=A.convert(i)+N,c=T.convert(n)+O;let v;null!=I&&null!=C&&(v=I[e]===i&&C[e]===n,null!=L&&v&&(v=L[e]===l));const S=this.getLabelText(y,{value:null!=w?w[e]:n,datum:t,xKey:a,yKey:o,sizeKey:r,labelKey:d,xName:u,yName:p,sizeName:g,labelName:m}),E=P.measureText(String(S)),B=null!=l?s.convert(l):f.size;R.push({series:this,itemId:o,yKey:o,xKey:a,datum:t,datumIndex:e,xValue:i,yValue:n,sizeValue:l,point:{x:h,y:c,size:B},midPoint:{x:h,y:c},label:{text:S,...E},anchor:b,placement:x,selected:v})}),{itemId:o,nodeData:R,labelData:R,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,t=>xd([t.xValue,t.yValue,t.sizeValue,t.label.text]))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,sizeKey:a,labelKey:o,marker:r}=this.properties,l=E(i&&this.properties.highlightStyle.item,r.getStyle());this.sizeScale.range=[r.size,r.maxSize];const h=this.getShapeFillBBox();e.each((t,e)=>{this.updateMarkerStyle(r,t,e.datum,e.point,{xKey:s,yKey:n,sizeKey:a,labelKey:o},i,l,h,{selected:e.selected})}),i||this.properties.marker.markClean()}updatePlacedLabelData(t){this.labelSelection.update(t.map(t=>({...t.datum,point:{x:t.x,y:t.y,size:t.datum.point.size}})),t=>{t.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{label:e}=this.properties;t.labelSelection.each((t,i)=>{t.text=i.label.text,t.fill=e.color,t.x=i.point?.x??0,t.y=i.point?.y??0,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.textAlign="left",t.textBaseline="top"})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:o,xName:r,yKey:l,yName:h,sizeKey:c,sizeName:d,labelKey:u,labelName:p,title:g,tooltip:m,marker:y}=a,f=n.x,x=n.y;if(!(i&&s&&f&&x))return;const b=s.dataSources.get(this.id)?.[t],v=i.resolveColumnById(this,"xValue",s)[t],S=i.resolveColumnById(this,"yValue",s)[t],M=this.contextNodeData?.nodeData[t];if(null==v||null==M)return;const k=[{label:r,fallbackLabel:o,value:f.formatDatum(v)},{label:h,fallbackLabel:l,value:x.formatDatum(S)}];if(null!=c){const e=i.resolveColumnById(this,"sizeValue",s)[t];k.push({label:d,fallbackLabel:c,value:String(e)})}const D=y.getStyle(),w=this.getMarkerStyle(y,b,{xKey:o,yKey:l,sizeKey:c,labelKey:u,highlighted:!0},!1,void 0,D);return this.formatTooltipWithContext(m,{title:g,symbol:this.legendItemSymbol(),data:k},{seriesId:e,datum:b,title:l,xKey:o,xName:r,yKey:l,yName:h,sizeKey:c,sizeName:d,labelKey:u,labelName:p,...w,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(){const{id:t,ctx:{legendManager:e},visible:i}=this,{yKey:s,yName:n,title:a}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i&&e.getItemEnabled({seriesId:t,itemId:s}),label:{text:a??n??s},symbol:this.legendItemSymbol()}]}animateEmptyUpdateReady({markerSelection:t,labelSelection:e}){Gg(this,this.ctx.animationManager,t),xp(this,"labels",this.ctx.animationManager,e)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Ie}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,sizeKey:s,labelKey:n,marker:a}=this.properties;return this.getMarkerStyle(a,t,{xKey:e,yKey:i,sizeKey:s,labelKey:n},!1,t.point.size)}computeFocusBounds(t){return Vg(this,t)}};py.className="BubbleSeries",py.type="bubble";var gy={title:s.Yj,domain:(0,s.jk)(s.ai),maxSize:s.Ly,showInMiniChart:s.zM,label:{placement:(0,s.KC)("top","right","bottom","left"),...Am},tooltip:Rm,...Im,...z(Lm,["enabled"])},my={...gy,...Cm,type:(0,s.mw)((0,s.dY)("bubble")),xKey:(0,s.mw)(s.Yj),yKey:(0,s.mw)(s.Yj),sizeKey:(0,s.mw)(s.Yj),labelKey:s.Yj,xName:s.Yj,yName:s.Yj,sizeName:s.Yj,labelName:s.Yj},yy={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:t=>new py(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:gp,fillImageDefaults:mp,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},fy={type:"series",name:"bubble",chartType:"cartesian",options:my,create:t=>new py(t)},xy=class extends Vp{constructor(){super(...arguments),this.fillGradientDefaults=new Cp,this.fillPatternDefaults=new Lp,this.fillImageDefaults=new Ap,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 Mp,this.label=new pl,this.tooltip=new Ep}};r([Ct],xy.prototype,"xKey",2),r([Ct],xy.prototype,"yKey",2),r([Ct],xy.prototype,"xName",2),r([Ct],xy.prototype,"yName",2),r([Ct],xy.prototype,"fill",2),r([Ct],xy.prototype,"fillGradientDefaults",2),r([Ct],xy.prototype,"fillPatternDefaults",2),r([Ct],xy.prototype,"fillImageDefaults",2),r([Ct],xy.prototype,"fillOpacity",2),r([Ct],xy.prototype,"stroke",2),r([Ct],xy.prototype,"strokeWidth",2),r([Ct],xy.prototype,"strokeOpacity",2),r([Ct],xy.prototype,"lineDash",2),r([Ct],xy.prototype,"lineDashOffset",2),r([Ct],xy.prototype,"cornerRadius",2),r([Ct],xy.prototype,"areaPlot",2),r([Ct],xy.prototype,"bins",2),r([Ct],xy.prototype,"aggregation",2),r([Ct],xy.prototype,"binCount",2),r([Ct],xy.prototype,"shadow",2),r([Ct],xy.prototype,"label",2),r([Ct],xy.prototype,"tooltip",2);var by=class extends Yp{constructor(t){super({moduleCtx:t,directionKeys:_p,directionNames:jp,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:qm,label:vp}}),this.properties=new xy,this.calculatedBins=[]}deriveBins(t){const e=Gr(t[0],t[1],10).ticks,i=Vr(t[0],t[1],10),[s]=e;return[[s-i,s],...e.map(t=>[t,t+i])]}calculateNiceBins(t,e){const i=Math.floor(t[0]),s=t[1],n=e||1,{start:a,binSize:o}=this.calculateNiceStart(i,s,n);return this.getBins(a,s,o,n)}getBins(t,e,i,s){const n=[],a=this.calculatePrecision(i);for(let o=0;o<s;o++){const r=Math.round((t+o*i)*a)/a;let l=Math.round((t+(o+1)*i)*a)/a;o===s-1&&(l=Math.max(l,e)),n[o]=[r,l]}return n}calculatePrecision(t){let e=10;if(isFinite(t)&&t>0)for(;t<1;)e*=10,t*=10;return e}calculateNiceStart(t,e,i){const s=Math.abs(e-t)/i,n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return{start:Math.floor(t/a)*a,binSize:s}}async processData(t){this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:e,yKey:i,areaPlot:n,aggregation:a}=this.properties,o=this.axes.x?.scale,r=this.axes.y?.scale,{xScaleType:l,yScaleType:h}=this.getScaleInformation({yScale:r,xScale:o}),c=[Yc(e,l),sd];if(i){let t=Bc("groupAgg");"count"===a||("sum"===a?t=Pc("groupAgg"):"mean"===a&&(t=Fc("groupAgg"))),n&&(t=zc("groupAgg",t)),c.push($c(i,h,{invalidValue:void 0}),t)}else{c.push(Hc("count"));let t=Bc("groupAgg");n&&(t=zc("groupAgg",t)),c.push(t)}!this.ctx.animationManager.isSkipped()&&this.processedData&&c.push(fd(this.id,this.processedData,!1)),await this.requestDataModel(t,this.data,{props:c,groupByFn:t=>{const e=Po(t.domain.keys[0]);if(0===e.length)return t.domain.groups=[],()=>[];const i=(0,s.Et)(this.properties.binCount)?this.calculateNiceBins(e,this.properties.binCount):this.properties.bins??this.deriveBins(e),n=i.length;return this.calculatedBins=[...i],t=>{let e=t[0];if((0,s.$P)(e)&&(e=e.getTime()),!(0,s.Et)(e))return[];for(let t=0;t<n;t++){const s=i[t];if(e>=s[0]&&e<s[1])return s;if(t===n-1&&e<=s[1])return s}return[]}}}),this.animationState.transition("updateData")}xCoordinateRange(){return[NaN,NaN]}yCoordinateRange(){return[NaN,NaN]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i||!this.calculatedBins.length)return[];const s=i.getDomain(this,"groupAgg","aggregate",e),n=this.calculatedBins?.[0][0],a=this.calculatedBins?.[(this.calculatedBins?.length??0)-1][1];return Po("x"===t?[n,a]:s)}getSeriesRange(t,[e,i]){const{dataModel:s,processedData:n}=this;if(!s||"grouped"!==n?.type)return[NaN,NaN];const a=this.axes.x.scale;let o=-1/0;return n.groups.forEach(({keys:t,aggregation:s})=>{const[[n,r]=[0,0]]=s,[l,h]=t,[c,d]=oa([a.convert(l),a.convert(h)]);if(d>=e&&c<=i){const t=n+r;o=Math.max(o,t)}}),0>o?[NaN,NaN]:[0,o]}frequency(t){return t.datumIndices.reduce((t,e)=>t+e.length,0)}createNodeData(){const{id:t,axes:e,processedData:i,dataModel:s}=this,n=e.x,a=e.y;if(!n||!a||!s)return;const{scale:o}=n,{scale:r}=a,{xKey:l,yKey:h,xName:c,yName:d}=this.properties,u=this.properties.label.formatter,p=[],g={itemId:this.properties.yKey??this.id,nodeData:p,labelData:p,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return this.visible&&null!=i&&"grouped"===i.type?(i.groups.forEach((e,n)=>{const{keys:g,aggregation:m}=e,[[y,f]=[0,0]]=m,x=this.frequency(e),b=g,[v,S]=b,M=[...s.forEachDatum(this,i,e)],k=o.convert(v),D=o.convert(S),w=y+f,I=r.convert(0),C=r.convert(w),L=Math.abs(D-k),A=Math.abs(C-I),T=Math.min(k,D),N=Math.min(I,C);let O;0!==w&&(O={x:T+L/2,y:N+A/2,text:this.cachedDatumCallback(xd(n,"label"),()=>u?.({value:w,datum:M,seriesId:t,xKey:l,yKey:h,xName:c,yName:d}))??a.formatDatum(w)});const R={x:T+L/2,y:N+A/2},E=a.isReversed();p.push({series:this,datumIndex:n,datum:M,aggregatedValue:w,frequency:x,domain:b,yKey:h,xKey:l,x:T,y:N,xValue:k,yValue:C,width:L,height:A,midPoint:R,topLeftCornerRadius:!E,topRightCornerRadius:!E,bottomRightCornerRadius:E,bottomLeftCornerRadius:E,label:O,crisp:!0})}),p.sort((t,e)=>t.x-e.x),g):g}nodeFactory(){return new qd}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t;return i.update(e,void 0,t=>t.domain.join("_"))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return ph({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},e.fillGradientDefaults,e.fillPatternDefaults,e.fillImageDefaults)}updateDatumNodes(t){const{isHighlight:e}=t,{shadow:i}=this.properties,s=this.getItemBaseStyle(e),n=this.getShapeFillBBox();t.datumSelection.each((t,e)=>{const{cornerRadius:a}=s,{topLeftCornerRadius:o,topRightCornerRadius:r,bottomRightCornerRadius:l,bottomLeftCornerRadius:h}=e;mh(t,s,void 0,n),t.topLeftCornerRadius=o?a:0,t.topRightCornerRadius=r?a:0,t.bottomRightCornerRadius=l?a:0,t.bottomLeftCornerRadius=h?a:0,t.crisp=e.crisp,t.fillShadow=i,t.visible=e.height>0})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,t=>{t.pointerEvents=1,t.textAlign="center",t.textBaseline="middle"})}updateLabelNodes(t){const{fontStyle:e,fontWeight:i,fontFamily:s,fontSize:n,color:a}=this.properties.label,o=this.isLabelEnabled();t.labelSelection.each((t,r)=>{o&&r?.label?(t.text=r.label.text,t.x=r.label.x,t.y=r.label.y,t.fontStyle=e,t.fontWeight=i,t.fontFamily=s,t.fontSize=n,t.fill=a,t.visible=!0):t.visible=!1})}initQuadTree(t){const{value:e}=this.contentGroup.children().next();e&&_m(t,e.children())}pickNodeClosestDatum(t){return jm(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a,ctx:{localeManager:o}}=this,{xKey:r,xName:l,yKey:h,yName:c,tooltip:d}=a,u=n.x,p=n.y;if(!i||"grouped"!==s?.type||!u||!p)return;const g=s.groups[t],{aggregation:m,keys:y}=g,[[f,x]=[0,0]]=m,b=this.frequency(g),v=y,[S,M]=v,k=f+x,D={data:[...i.forEachDatum(this,s,g)],aggregatedValue:k,frequency:b,domain:v},w=[{label:l,fallbackLabel:r,value:`${u.formatDatum(S)} - ${u.formatDatum(M)}`},{label:o.t("seriesHistogramTooltipFrequency"),value:p.formatDatum(b)}];if(null!=h){let t;switch(a.aggregation){case"sum":t=o.t("seriesHistogramTooltipSum",{yName:c??h});break;case"mean":t=o.t("seriesHistogramTooltipMean",{yName:c??h});break;case"count":t=o.t("seriesHistogramTooltipCount",{yName:c??h})}w.push({label:t,value:p.formatDatum(k)})}return this.formatTooltipWithContext(d,{symbol:this.legendItemSymbol(),data:w},{seriesId:e,datum:D,title:c,xKey:r,xName:l,yKey:h,yName:c,xRange:[S,M],frequency:b,...this.getItemBaseStyle(!1)})}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:h}=this.properties;return{marker:ph({fill:t??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:e,strokeOpacity:n,strokeWidth:s,lineDash:a,lineDashOffset:o},r,l,h)}}getLegendData(t){if("category"!==t)return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:a??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!o}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=Zm(Um(!0,this.axes,"normal"));rr(this.id,"datums",this.ctx.animationManager,[t],i),xp(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const e=Zm(Um(!0,this.axes,"normal")),i=Jm(this.id,t.datumSelection,t=>xd(t.domain),t.contextData,t.previousContextData,this.processedData);rr(this.id,"datums",this.ctx.animationManager,[t.datumSelection],e,(t,e)=>xd(e.domain),i),i?.changed&&xp(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return Qm(this,this.contextNodeData?.nodeData[t])}};by.className="HistogramSeries",by.type="histogram";var vy={showInMiniChart:s.zM,cornerRadius:s.Ly,label:Am,tooltip:Rm,shadow:Em,...Im,...s.Fu,...s.AF,...s.mL},Sy={...vy,...Cm,type:(0,s.mw)((0,s.dY)("histogram")),xKey:(0,s.mw)(s.Yj),yKey:s.Yj,xName:s.Yj,yName:s.Yj,areaPlot:s.zM,aggregation:(0,s.KC)("count","sum","mean"),bins:(0,s.jk)((0,s.jk)(s.ai)),binCount:s.Ly},My={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:t=>new by(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:gp,fillImageDefaults:mp,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:Tu,xOffset:3,yOffset:3,blur:5}}}},ky={type:"series",name:"histogram",chartType:"cartesian",enterprise:!0,options:Sy,create:t=>new by(t)},Dy=class extends Vp{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new $p,this.marker=new Op,this.label=new pl,this.tooltip=new Ep,this.connectMissingData=!1,this.sparklineMode=!1}};r([Ct],Dy.prototype,"xKey",2),r([Ct],Dy.prototype,"yKey",2),r([Ct],Dy.prototype,"xName",2),r([Ct],Dy.prototype,"yName",2),r([Ct],Dy.prototype,"yFilterKey",2),r([Ct],Dy.prototype,"stackGroup",2),r([Ct],Dy.prototype,"normalizedTo",2),r([Ct],Dy.prototype,"title",2),r([Ct],Dy.prototype,"stroke",2),r([Ct],Dy.prototype,"strokeWidth",2),r([Ct],Dy.prototype,"strokeOpacity",2),r([Ct],Dy.prototype,"lineDash",2),r([Ct],Dy.prototype,"lineDashOffset",2),r([Ct],Dy.prototype,"interpolation",2),r([Ct],Dy.prototype,"marker",2),r([Ct],Dy.prototype,"label",2),r([Ct],Dy.prototype,"tooltip",2),r([Ct],Dy.prototype,"connectMissingData",2),r([Ct],Dy.prototype,"sparklineMode",2);var wy=class extends Yp{constructor(t){super({moduleCtx:t,directionKeys:_p,directionNames:jp,categoryKey:"xValue",hasMarkers:!0,pickModes:[2,1,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:$g({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:vp,marker:(t,e)=>({opacity:1,scalingX:1,scalingY:1,...Wg(0,e)})},clipFocusBox:!1}),this.properties=new Dy,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}async processData(t){if(null==this.data)return;const{data:e,visible:i,seriesGrouping:{groupIndex:n=this.id,stackCount:a=0}={}}=this,{xKey:o,yKey:r,yFilterKey:l,connectMissingData:h,normalizedTo:c}=this.properties,d=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,p=this.axes.y?.scale,{isContinuousX:g,xScaleType:m,yScaleType:y}=this.getScaleInformation({xScale:u,yScale:p}),f=a>=1||null!=c,x={invalidValue:null};h&&f&&(x.invalidValue=0),f&&!i&&(x.forceValue=0);const b=[];if(g&&!f||b.push(Yc(o,m,{id:"xKey"})),b.push($c(o,m,{id:"xValue"}),$c(r,y,{id:"yValueRaw",...x,invalidValue:void 0})),null!=l&&b.push($c(l,y,{id:"yFilterRaw"})),f){const t=[`line-stack-${n}-yValues`,`line-stack-${n}-yValues-trailing`,`line-stack-${n}-yValues-marker`];b.push(...Jc(r,"window","current",{id:"yValueEnd",...x,groupId:t[0]},y),...Jc(r,"window-trailing","current",{id:"yValueStart",...x,groupId:t[1]},y),...Jc(r,"normal","current",{id:"yValueCumulative",...x,groupId:t[2]},y)),(0,s.vM)(c)&&b.push(ad([t[0],t[1],t[2]],c))}d&&(b.push(hd(g?["xValue"]:void 0)),this.processedData&&b.push(fd(this.id,this.processedData)));const{dataModel:v,processedData:S}=await this.requestDataModel(t,e,{props:b,groupByKeys:f,groupByData:!f});this.dataAggregationFilters=this.aggregateData(v,S),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("x"===t){const t=e.resolveProcessedDataDefById(this,"xValue"),s=e.getDomain(this,"xValue","value",i);return"value"===t?.def.type&&"category"===t.def.valueType?s:Po(Lc(s))}const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return Po(this.domainForClippedRange("y",[s],"xValue",!0))}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,a=i.y;if(!(t&&e&&n&&a))return;const{xKey:o,yKey:r,yFilterKey:l,xName:h,yName:c,marker:d,label:u,connectMissingData:p,interpolation:g,legendItemName:m}=this.properties,y=this.dataModel?.hasColumnById(this,"yValueEnd"),f=n.scale,x=a.scale,b=(f.bandwidth??0)/2,v=(x.bandwidth??0)/2,S=d.enabled?d.size:0,M=e.dataSources.get(this.id)??[],k=t.resolveColumnById(this,"xValue",e),D=t.resolveColumnById(this,"yValueRaw",e),w=y?t.resolveColumnById(this,"yValueEnd",e):void 0,I=y?t.resolveColumnById(this,"yValueCumulative",e):D,C=null!=l?t.resolveColumnById(this,"yFilterRaw",e):void 0,L={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},A=[];let T;const N=t=>{const e=M[t],i=k[t],s=D[t],n=w?.[t],a=C?.[t],l=(d=t,f.convert(k[d])+b);var d;const g=(t=>x.convert(I[t])+v)(t);if(!Number.isFinite(l))return;if(null!=s){const d=u.enabled?this.getLabelText(u,{value:s,datum:e,xKey:o,yKey:r,xName:h,yName:c,legendItemName:m}):void 0;A.push({series:this,datum:e,datumIndex:t,yKey:r,xKey:o,point:{x:l,y:g,size:S},midPoint:{x:l,y:g},cumulativeValue:n,yValue:s,xValue:i,capDefaults:L,labelText:d,selected:a})}if(null==T)return;const y=T[T.length-1];if(null!=s){const t={point:{x:l,y:g},xDatum:i,yDatum:s};Array.isArray(y)?y.push(t):null!=y?(y.skip+=1,T.push([t])):T.push([t])}else p||(Array.isArray(y)||null==y?T.push({skip:0}):y.skip+=1)},[O,R]=f.range,E=R-O,P=s?.find(t=>t.maxRange>E),B=P?.indices;let[F,z]=this.visibleRange("xValue",n.range,B);F=Math.max(F-1,0),z=Math.min(z+1,B?.length??k.length),e.input.count<1e3&&(F=0,z=e.input.count),null==B&&(T=[]);for(let t=F;t<z;t+=1)N(B?.[t]??t);const G=T?.flatMap(t=>Array.isArray(t)?Cg(t,g):[]),_=null!=G?{itemId:r,spans:G}:void 0,j=C?.some((t,e)=>t===D[e])??!1;return{itemId:r,nodeData:A,labelData:A,strokeData:_,scales:this.calculateScaling(),visible:this.visible,crossFiltering:j}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[e],opacity:i,visible:s,animationEnabled:n}=t,a=!0===this.contextNodeData?.crossFiltering;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*(a?.25:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),n||(e.visible=s),Hg(this,e)}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return ph({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},i.fillGradientDefaults,i.fillPatternDefaults,i.fillImageDefaults)}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{xKey:o,yKey:r,marker:l}=a,{itemStyler:h}=l;if(null!=h)return this.cachedDatumCallback(xd(t,s?"highlight":"node"),()=>{const t=this.getSeriesDomain("x"),a=this.getSeriesDomain("y");return this.callWithContext(h,{seriesId:n,...Xn(e,o,r,t,a),datum:e,highlighted:s,...i})})}updateMarkerSelection(t){let{nodeData:e}=t;const{markerSelection:i}=t;return e=this.properties.marker.enabled||!0===this.contextNodeData?.crossFiltering?e:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(e,void 0,t=>xd(t.xValue))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,stroke:a,strokeWidth:o,strokeOpacity:r,marker:l,highlightStyle:h}=this.properties,c=this.getSeriesDomain("x"),d=this.getSeriesDomain("y"),u=E(i&&h.item,l.getStyle(),{stroke:a,strokeWidth:o,strokeOpacity:r}),p=this.ctx.animationManager.isSkipped(),g=this.getShapeFillBBox();e.each((t,e)=>{this.updateMarkerStyle(l,t,e.datum,e.point,Xn(e,s,n,c,d),i,u,g,{applyTranslation:p,selected:e.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:a,color:o}=this.properties.label;t.labelSelection.each((t,r)=>{e&&r?.labelText?(t.fontStyle=i,t.fontWeight=s,t.fontSize=n,t.fontFamily=a,t.textAlign="center",t.textBaseline="bottom",t.text=r.labelText,t.x=r.point.x,t.y=r.point.y-10,t.fill=o,t.visible=!0):t.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:o,xName:r,yKey:l,yName:h,tooltip:c}=a,d=n.x,u=n.y;if(!(i&&s&&d&&u))return;const p=s.dataSources.get(this.id)?.[t],g=i.resolveColumnById(this,"xValue",s)[t],m=i.resolveColumnById(this,"yValueRaw",s)[t];if(null==g)return;const y=this.getMarkerItemBaseStyle(!1);return Object.assign(y,this.getMarkerItemStyleOverrides(String(t),p,y,!1)),this.formatTooltipWithContext(c,{heading:d.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:h,fallbackLabel:l,value:u.formatDatum(m)}]},{seriesId:e,datum:p,title:h,xKey:o,xName:r,yKey:l,yName:h,...y,...this.getModuleTooltipParams()})}legendItemSymbol(){const t="rgba(0, 0, 0, 0)",{stroke:e,strokeOpacity:i,strokeWidth:s,lineDash:n,marker:a}=this.properties;return{marker:{...this.getMarkerStyle(a,void 0,void 0,!1,void 0,{fill:a.fill??t,stroke:a.stroke??e??t}),enabled:a.enabled},line:{stroke:e??t,strokeOpacity:i,strokeWidth:s,lineDash:n}}}getLegendData(t){if("category"!==t)return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:a,title:o,legendItemName:r,showInLegend:l}=this.properties;return[{legendType:"category",id:e,itemId:n,legendItemName:r,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:r??o??a??n},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(t){this.updateLinePaths(t.paths,t.contextData)}plotNodeDataPoints(t,e){if(0===e.length)return;const i=e[0].point;t.moveTo(i.x,i.y);for(let i=1;i<e.length;i+=1){const{x:s,y:n}=e[i].point;t.lineTo(s,n)}}updateLinePaths(t,e){const i=e.strokeData?.spans,[s]=t;s.path.clear(),null!=i?Ag(s,i):this.plotNodeDataPoints(s.path,e.nodeData),s.markDirty("LineSeries")}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s,contextData:n,paths:a}=t,{animationManager:o}=this.ctx;this.updateLinePaths(a,n),Kg(this,o,...a),dr([e],Wg),_g(this,o,e),xp(this,"labels",o,i),xp(this,"annotations",o,...s)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateLinePaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{markerSelection:i,labelSelection:s,annotationSelections:n,contextData:a,paths:o,previousContextData:r}=t,[l]=o;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const h=()=>{this.resetPathAnimation(t),this.updateLinePaths(o,a)},c=()=>{e.skipCurrentBatch(),h()};if(null==a||null==r)return h(),zg(this,e,"added",i),Yg(this,"path_properties",e,"add",l),xp(this,"labels",e,s),void xp(this,"annotations",e,...n);if(a.crossFiltering!==r.crossFiltering)return void c();const d=Rg(a,r,this.processedData?.reduced?.diff?.[this.id]);void 0!==d?"no-op"!==d.status&&(rr(this.id,"path_properties",e,[l],d.stroke.pathProperties),"added"===d.status?this.updateLinePaths(o,a):"removed"===d.status?this.updateLinePaths(o,r):fp(this.id,"path_update",e,[l],d.stroke.path),d.hasMotion&&(zg(this,e,void 0,i),xp(this,"labels",e,s),xp(this,"annotations",e,...n))):c()}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Ie}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=this.properties,s=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,t.datum,Xn(t,e,i,s,n),!0)}computeFocusBounds(t){return Vg(this,t)}};wy.className="LineSeries",wy.type="line";var Iy={title:s.Yj,showInMiniChart:s.zM,connectMissingData:s.zM,interpolation:Pm,label:Am,marker:Lm,tooltip:Rm,errorBar:Nm,...Im,...s.AF,...s.mL};Iy.sparklineMode=(0,s._L)(s.zM);var Cy={...Iy,...Cm,type:(0,s.dY)("line"),xKey:(0,s.mw)(s.Yj),yKey:(0,s.mw)(s.Yj),xName:s.Yj,yName:s.Yj,stacked:s.zM,stackGroup:s.Yj,normalizedTo:s.ai,legendItemName:s.Yj,errorBar:Om};Cy.pickOutsideVisibleMinorAxis=(0,s._L)(s.zM),Cy.focusPriority=(0,s._L)(s.ai);var Ly={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:t=>new wy(t),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{tooltip:{position:{_seriesOverrideType:"node"}},stroke:up,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:gp,fillImageDefaults:mp},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},Ay={type:"series",name:"line",chartType:"cartesian",options:Cy,create:t=>new wy(t)},Ty=class extends pl{constructor(){super(...arguments),this.placement="top"}};r([Ct],Ty.prototype,"placement",2);var Ny=class extends Vp{constructor(){super(...arguments),this.label=new Ty,this.tooltip=new Ep,this.marker=new Op}};r([Ct],Ny.prototype,"xKey",2),r([Ct],Ny.prototype,"yKey",2),r([Ct],Ny.prototype,"labelKey",2),r([Ct],Ny.prototype,"xFilterKey",2),r([Ct],Ny.prototype,"yFilterKey",2),r([Ct],Ny.prototype,"xName",2),r([Ct],Ny.prototype,"yName",2),r([Ct],Ny.prototype,"labelName",2),r([Ct],Ny.prototype,"title",2),r([ai("marker.shape")],Ny.prototype,"shape",2),r([ai("marker.size")],Ny.prototype,"size",2),r([ai("marker.fill")],Ny.prototype,"fill",2),r([ai("marker.fillGradientDefaults")],Ny.prototype,"fillGradientDefaults",2),r([ai("marker.fillPatternDefaults")],Ny.prototype,"fillPatternDefaults",2),r([ai("marker.fillImageDefaults")],Ny.prototype,"fillImageDefaults",2),r([ai("marker.fillOpacity")],Ny.prototype,"fillOpacity",2),r([ai("marker.stroke")],Ny.prototype,"stroke",2),r([ai("marker.strokeWidth")],Ny.prototype,"strokeWidth",2),r([ai("marker.strokeOpacity")],Ny.prototype,"strokeOpacity",2),r([ai("marker.lineDash")],Ny.prototype,"lineDash",2),r([ai("marker.lineDashOffset")],Ny.prototype,"lineDashOffset",2),r([ai("marker.itemStyler")],Ny.prototype,"itemStyler",2),r([Ct],Ny.prototype,"label",2),r([Ct],Ny.prototype,"tooltip",2);var Oy=class extends Yp{constructor(t){super({moduleCtx:t,directionKeys:_p,directionNames:jp,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:jg,label:vp},usesPlacedLabels:!0,clipFocusBox:!1}),this.properties=new Ny}get pickModeAxis(){return"main-category"}async processData(t){if(null==this.data||!this.visible)return;const e=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:e,yScale:i}),{xKey:a,yKey:o,xFilterKey:r,yFilterKey:l,labelKey:h}=this.properties;await this.requestDataModel(t,this.data,{props:[$c(a,s,{id:"xValue"}),$c(o,n,{id:"yValue"}),...null!=r?[$c(r,s,{id:"xFilterValue"})]:[],...null!=l?[$c(l,n,{id:"yFilterValue"})]:[],...h?[$c(h,"band",{id:"labelValue"})]:[]]}),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],a=e.resolveProcessedDataDefById(this,n),o=e.getDomain(this,n,"value",i);if("value"===a?.def.type&&"category"===a?.def.valueType)return o;const r=s["x"===t?"y":"x"];return Po(Lc(this.domainForClippedRange(t,[n],r,!1)))}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,visible:s}=this,{xKey:n,yKey:a,xFilterKey:o,yFilterKey:r,labelKey:l,xName:h,yName:c,labelName:d,marker:u,label:p}=this.properties,{placement:g}=p,m=Ph.anchor(u.shape),y=t.x,f=t.y;if(!(e&&i&&s&&y&&f))return;const x=e.resolveColumnById(this,"xValue",i),b=e.resolveColumnById(this,"yValue",i),v=null!=l?e.resolveColumnById(this,"labelValue",i):void 0,S=null!=o?e.resolveColumnById(this,"xFilterValue",i):void 0,M=null!=r?e.resolveColumnById(this,"yFilterValue",i):void 0,k=y.scale,D=f.scale,w=(k.bandwidth??0)/2,I=(D.bandwidth??0)/2,C=[],L=p.getFont(),A=Li.getMeasurer({font:L});return(i.dataSources.get(this.id)??[]).forEach((t,e)=>{const i=x[e],s=b[e],o=k.convert(i)+w,r=D.convert(s)+I,y=null!=S&&null!=M?S[e]===i&&M[e]===s:void 0,f=this.getLabelText(p,{value:null!=v?v?.[e]:s,datum:t,xKey:n,yKey:a,labelKey:l,xName:h,yName:c,labelName:d}),L=A.measureText(f);C.push({series:this,itemId:a,yKey:a,xKey:n,datum:t,datumIndex:e,xValue:i,yValue:s,capDefaults:{lengthRatioMultiplier:u.getDiameter(),lengthMax:1/0},point:{x:o,y:r,size:u.size},midPoint:{x:o,y:r},label:{text:f,...L},anchor:m,placement:g,selected:y})}),{itemId:a,nodeData:C,labelData:C,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:[])}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,labelKey:a,marker:o,highlightStyle:r}=this.properties,l=E(i&&r.item,o.getStyle()),h=this.getShapeFillBBox();e.each((t,e)=>{this.updateMarkerStyle(o,t,e.datum,e.point,{xKey:s,yKey:n,labelKey:a},i,l,h,{selected:e.selected})}),i||o.markClean()}updatePlacedLabelData(t){this.labelSelection.update(t.map(t=>({...t.datum,point:{x:t.x,y:t.y,size:t.datum.point.size}})),t=>{t.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{label:e}=this.properties;t.labelSelection.each((t,i)=>{t.text=i.label.text,t.fill=e.color,t.x=i.point?.x??0,t.y=i.point?.y??0,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.textAlign="left",t.textBaseline="top"})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{xKey:o,xName:r,yKey:l,yName:h,labelKey:c,labelName:d,title:u,tooltip:p,marker:g}=a,m=n.x,y=n.y;if(!(i&&s&&m&&y))return;const f=s.dataSources.get(this.id)?.[t],x=i.resolveColumnById(this,"xValue",s)[t],b=i.resolveColumnById(this,"yValue",s)[t],v=this.contextNodeData?.nodeData[t];if(null==x||null==v)return;const S=this.getMarkerStyle(g,v.datum,{xKey:o,yKey:l,labelKey:c,highlighted:!0});return this.formatTooltipWithContext(p,{symbol:this.legendItemSymbol(),title:u,data:[{label:r,fallbackLabel:o,value:m.formatDatum(x)},{label:h,fallbackLabel:l,value:y.formatDatum(b)}]},{seriesId:e,datum:f,title:h,xKey:o,xName:r,yKey:l,yName:h,labelKey:c,labelName:d,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(t){if("category"!==t)return[];const{yKey:e,yName:i,title:s,showInLegend:n}=this.properties,{id:a,ctx:{legendManager:o},visible:r}=this;return[{legendType:"category",id:a,itemId:e,seriesId:a,enabled:r&&o.getItemEnabled({seriesId:a,itemId:e}),label:{text:s??i??e},symbol:this.legendItemSymbol(),hideInLegend:!n}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s}=t;Gg(this,this.ctx.animationManager,e),xp(this,"labels",this.ctx.animationManager,i),xp(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Ie}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,labelKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,t.datum,{xKey:e,yKey:i,labelKey:s},!0)}computeFocusBounds(t){return Vg(this,t)}};Oy.className="ScatterSeries",Oy.type="scatter";var Ry={title:s.Yj,showInMiniChart:s.zM,label:{placement:(0,s.KC)("top","right","bottom","left"),...Am},tooltip:Rm,errorBar:Nm,...Im,...z(Lm,["enabled"])},Ey={...Ry,...Cm,type:(0,s.mw)((0,s.dY)("scatter")),xKey:(0,s.mw)(s.Yj),yKey:(0,s.mw)(s.Yj),labelKey:s.Yj,xName:s.Yj,yName:s.Yj,labelName:s.Yj,errorBar:Om},Py={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:t=>new Oy(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:gp,fillImageDefaults:mp,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},By={type:"series",name:"scatter",chartType:"cartesian",options:Ey,create:t=>new Oy(t)},Fy=class t{constructor(t,e,i,s){this.startAngle=t,this.endAngle=e,this.innerRadius=i,this.outerRadius=s}clone(){const{startAngle:e,endAngle:i,innerRadius:s,outerRadius:n}=this;return new t(e,i,s,n)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[d](e,i){return new t(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 zy({startAngle:t,endAngle:e,innerRadius:i,outerRadius:s}){let n=1/0,a=1/0,o=-1/0,r=-1/0;const l=(t,e)=>{n=Math.min(t,n),a=Math.min(e,a),o=Math.max(t,o),r=Math.max(e,r)};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)),at(0,t,e)&&l(s,0),at(.5*Math.PI,t,e)&&l(0,s),at(Math.PI,t,e)&&l(-s,0),at(1.5*Math.PI,t,e)&&l(0,-s),new y(n,a,o-n,r-a)}function Gy(t,e,i){const s=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),{innerRadius:n,outerRadius:a}=i;if(i.startAngle===i.endAngle||s<Math.min(n,a)||s>Math.max(n,a))return!1;const o=nt(i.startAngle),r=nt(i.endAngle),l=Math.atan2(e,t);return o<r?l<=r&&l>=o:l<=r&&l>=-Math.PI||l>=o&&l<=Math.PI}function _y(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:a}=e,o={x:a*Math.cos(i),y:a*Math.sin(i)},r={x:a*Math.cos(s),y:a*Math.sin(s)},l=0===n?{x:0,y:0}:{x:n*Math.cos(i),y:n*Math.sin(i)},h=0===n?{x:0,y:0}:{x:n*Math.cos(s),y:n*Math.sin(s)};return Kt(t.start.x,t.start.y,t.end.x,t.end.y,o.x,o.y,l.x,l.y)||Kt(t.start.x,t.start.y,t.end.x,t.end.y,r.x,r.y,h.x,h.y)||Ht(0,0,a,i,s,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function jy(t,e){const i={x:t.x,y:t.y},s={x:t.x+t.width,y:t.y},n={x:t.x,y:t.y+t.height},a={x:t.x+t.width,y:t.y+t.height};return _y({start:i,end:s},e)||_y({start:n,end:a},e)}function Wy(t,e,i,s){if(0===i&&0===s)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 n=0,a=1;for(let o=0;o<8;o+=1){const o=(n+a)/2;Math.asin(Math.abs(o*i)/(t+o*i))+Math.asin(Math.abs(o*s)/(t+o*s))-e<0?n=o:a=o}return n}function Vy(t,e){return lt(t,e)<1e-6?e:it(t-e)+e}function Ky(t,e,i=0){const s=Math.abs(e-t)>=2*Math.PI?2*Math.PI:it(e-t);return{startAngle:t=Vy(t,i),endAngle:e=t+s}}function Yy(t,e,i,s,n,a){const o=Math.sin(a),r=Math.cos(a),l=t**2+e**2-i**2;let h,c,d,u;if(r>.5){const i=o/r,s=1+i**2,n=-2*(t+e*i),a=n**2-4*s*l;if(a<0)return;const p=(-n+Math.sqrt(a))/(2*s),g=(-n-Math.sqrt(a))/(2*s);h=p,c=p*i,d=g,u=g*i}else{const i=r/o,s=1+i**2,n=-2*(e+t*i),a=n**2-4*s*l;if(a<0)return;const p=(-n+Math.sqrt(a))/(2*s),g=(-n-Math.sqrt(a))/(2*s);h=p*i,c=p,d=g*i,u=g}const p=d*r+u*o,g=h*r+c*o>0?Vy(Math.atan2(c-e,h-t),s):NaN,m=p>0?Vy(Math.atan2(u-e,d-t),s):NaN;return g>=s&&g<=n?g:m>=s&&m<=n?m:void 0}function $y(t,e,i,s,n,a){const o=Math.hypot(t,e),r=o-(o**2-i**2+a**2)/(2*o),l=Math.atan2(e,t),h=Math.acos(-r/i),c=Vy(l+h,s),d=Vy(l-h,s);return c>=s&&c<=n?c:d>=s&&d<=n?d:void 0}var Hy=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){null==t||!this.isValid()||t<this.a0||(this.a0=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(t){null==t||!this.isValid()||t>this.a1||(this.a1=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},Uy=class extends vh{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=2*Math.PI,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 zy(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(null==t)return;const{startAngle:e,endAngle:i}=Ky(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),a=Ky(t.startAngle,t.endAngle,e);return new Fy(Math.max(e,a.startAngle),Math.min(i,a.endAngle),Math.max(s,t.innerRadius),Math.min(n,t.outerRadius))}getAngleOffset(t){return t>0?this.radialEdgeInset/t:0}arc(t,e,i,s,n,a,o,r){if(t<=0)return;const{startAngle:l,endAngle:h}=Ky(this.startAngle,this.endAngle),{innerRadius:c,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(r&&c<=0)return;const p=r?this.getAngleOffset(c+t):this.getAngleOffset(d-t),g=o?l+p+e:h-p-e,m=r?c+t:d-t,y=m*Math.cos(g),f=m*Math.sin(g);if(null!=u){const t=1e-6;if(!(o||g>=l-t&&g<=u.endAngle-t))return;if(o&&!(g>=u.startAngle+t&&g<=h-t))return;if(r&&m<u.innerRadius-t)return;if(!r&&m>u.outerRadius+t)return}const x=new Hy(y,f,t,i,s);if(null!=u){let e,h;if(r?(x.clipStart(Yy(y,f,t,i,s,u.endAngle)),x.clipEnd(Yy(y,f,t,i,s,u.startAngle))):(x.clipStart(Yy(y,f,t,i,s,u.startAngle)),x.clipEnd(Yy(y,f,t,i,s,u.endAngle))),o?(e=$y(y,f,t,i,s,u.innerRadius),h=$y(y,f,t,i,s,u.outerRadius)):(e=$y(y,f,t,i,s,u.outerRadius),h=$y(y,f,t,i,s,u.innerRadius)),x.clipStart(e),x.clipEnd(h),null!=e){const{x:t,y:i}=x.pointAt(e),s=Vy(Math.atan2(i,t),l);o?a?.clipStart(s):n.clipEnd(s)}if(null!=h){const{x:t,y:e}=x.pointAt(h),i=Vy(Math.atan2(e,t),l);o?n.clipStart(i):a?.clipEnd(i)}}if(null!=u){const{x:t,y:e}=x.pointAt((x.a0+x.a1)/2);if(!Gy(t,e,u))return}const{x:b,y:v}=x.pointAt(o===r?x.a0:x.a1),S=Vy(Math.atan2(v,b),l),M=r?a:n;return o?M?.clipStart(S):M?.clipEnd(S),x}updatePath(){const{path:t,centerX:e,centerY:i,concentricEdgeInset:s,radialEdgeInset:n}=this;let{startOuterCornerRadius:a,endOuterCornerRadius:o,startInnerCornerRadius:r,endInnerCornerRadius:l}=this;const{startAngle:h,endAngle:c}=Ky(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:u}=this.normalizedRadii(),p=this.normalizedClipSector(),g=c-h,m=g>=2*Math.PI-1e-6;if(t.clear(),0===d&&0===u||d>u)return;if((p?.startAngle??h)===(p?.endAngle??c))return;if(m&&null==this.clipSector&&0===a&&0===o&&0===r&&0===l)return t.moveTo(e+u*Math.cos(h),i+u*Math.sin(h)),t.arc(e,i,u,h,c),d>s&&(t.moveTo(e+d*Math.cos(c),i+d*Math.sin(c)),t.arc(e,i,d,c,h,!0)),void t.closePath();if(null==this.clipSector&&Math.abs(d-u)<1e-6)return t.arc(e,i,u,h,c,!1),t.arc(e,i,u,c,h,!0),void t.closePath();const y=this.getAngleOffset(d),f=this.getAngleOffset(u);if(g<2*f)return;const x=(p?.innerRadius??d)>s,b=d<s||g<2*y,v=u-d,S=Math.max(a,r,o,l),M=S>0?Math.min(v/S,1):1;a*=M,o*=M,r*=M,l*=M;const k=Wy(u,g-2*f,-a,-o);if(a*=k,o*=k,!b&&x){const t=Wy(d,g-2*y,r,l);r*=t,l*=t}else r=0,l=0;const D=Math.max(a+r,o+l),w=D>0?Math.min(v/D,1):1;a*=w,o*=w,r*=w,l*=w;let I=0,C=0;const L=a/(u-a),A=o/(u-o);if(L>=0&&L<.999999)I=Math.asin(L);else{I=g/2;const t=u/(1/Math.sin(I)+1);a=Math.min(t,a)}if(A>=0&&A<.999999)C=Math.asin(A);else{C=g/2;const t=u/(1/Math.sin(C)+1);o=Math.min(t,o)}const T=Math.asin(r/(d+r)),N=Math.asin(l/(d+l)),O=p?.outerRadius??u,R=this.getAngleOffset(O),E=new Hy(0,0,O,h+R,c-R),P=p?.innerRadius??d,B=this.getAngleOffset(P),F=x?new Hy(0,0,P,h+B,c-B):void 0;null!=p&&(E.clipStart(p.startAngle),E.clipEnd(p.endAngle),F?.clipStart(p.startAngle),F?.clipEnd(p.endAngle));const z=this.arc(a,I,h-.5*Math.PI,h+I,E,F,!0,!1),G=this.arc(o,C,c-C,c+.5*Math.PI,E,F,!1,!1),_=this.arc(l,N,c+.5*Math.PI,c+Math.PI-N,E,F,!1,!0),j=this.arc(r,T,h+Math.PI+T,h+1.5*Math.PI,E,F,!0,!0);if(b){const s=g<.5*Math.PI?n*(1+Math.cos(g))/Math.sin(g):NaN;let a;a=s>0&&s<u?Math.max(Math.hypot(n,s),d):n,a=Math.max(a,d);const o=h+.5*g;t.moveTo(e+a*Math.cos(o),i+a*Math.sin(o))}else if(!0===j?.isValid()||!0===F?.isValid());else{const s=h+g/2,n=d*Math.cos(s),a=d*Math.sin(s);t.moveTo(e+n,i+a)}if(!0===z?.isValid()){const{cx:s,cy:n,r:a,a0:o,a1:r}=z;t.arc(e+s,i+n,a,o,r)}if(E.isValid()){const{r:s,a0:n,a1:a}=E;t.arc(e,i,s,n,a)}if(!0===G?.isValid()){const{cx:s,cy:n,r:a,a0:o,a1:r}=G;t.arc(e+s,i+n,a,o,r)}if(!b){if(!0===_?.isValid()){const{cx:s,cy:n,r:a,a0:o,a1:r}=_;t.arc(e+s,i+n,a,o,r)}if(!0===F?.isValid()){const{r:s,a0:n,a1:a}=F;t.arc(e,i,s,a,n,!0)}if(!0===j?.isValid()){const{cx:s,cy:n,r:a,a0:o,a1:r}=j;t.arc(e+s,i+n,a,o,r)}}t.closePath()}isPointInPath(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:a}=this.clipSector??this;return Gy(t-this.centerX,e-this.centerY,{startAngle:i,endAngle:s,innerRadius:Math.min(n,a),outerRadius:Math.max(n,a)})}};Uy.className="Sector",r([H()],Uy.prototype,"centerX",2),r([H()],Uy.prototype,"centerY",2),r([H()],Uy.prototype,"innerRadius",2),r([H()],Uy.prototype,"outerRadius",2),r([H()],Uy.prototype,"startAngle",2),r([H()],Uy.prototype,"endAngle",2),r([U({equals:(t,e)=>t.equals(e)})],Uy.prototype,"clipSector",2),r([H()],Uy.prototype,"concentricEdgeInset",2),r([H()],Uy.prototype,"radialEdgeInset",2),r([H()],Uy.prototype,"startOuterCornerRadius",2),r([H()],Uy.prototype,"endOuterCornerRadius",2),r([H()],Uy.prototype,"startInnerCornerRadius",2),r([H()],Uy.prototype,"endInnerCornerRadius",2);var Xy={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Zy={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},qy=class extends Fi{constructor(){super(...arguments),this.showInLegend=!1}};r([Ct],qy.prototype,"showInLegend",2);var Qy=class extends pl{constructor(){super(...arguments),this.spacing=2}set(t,e){return super.set(t)}};r([Ct],Qy.prototype,"text",2),r([Ct],Qy.prototype,"spacing",2);var Jy=class extends Lt{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};r([Ct],Jy.prototype,"fill",2),r([Ct],Jy.prototype,"fillOpacity",2);var tf=class extends pl{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};r([Ct],tf.prototype,"offset",2),r([Ct],tf.prototype,"minAngle",2),r([Ct],tf.prototype,"minSpacing",2),r([Ct],tf.prototype,"maxCollisionOffset",2),r([Ct],tf.prototype,"avoidCollisions",2);var ef=class extends pl{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};r([Ct],ef.prototype,"positionOffset",2),r([Ct],ef.prototype,"positionRatio",2);var sf=class extends Lt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};r([Ct],sf.prototype,"colors",2),r([Ct],sf.prototype,"length",2),r([Ct],sf.prototype,"strokeWidth",2);var nf=class extends Np{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Xy),this.strokes=Object.values(Zy),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.innerLabels=new At(Qy),this.title=new qy,this.innerCircle=new Jy,this.shadow=new Mp,this.calloutLabel=new tf,this.sectorLabel=new ef,this.calloutLine=new sf,this.tooltip=new Ep}};function af(t,e,i,s){const n=[i.convert(0),i.convert(1)],a=[s.convert(0),s.convert(1)],o=Math.PI/-2+ot(e),r=t?"initial":"update";return{nodes:{toFn:(t,e,i,{prevLive:s})=>{let{startAngle:a,endAngle:r,innerRadius:l,outerRadius:h}=e;const{stroke:c,fill:d}=e.sectorFormat;if("removed"===i&&s?(a=s.datum?.endAngle,r=s.datum?.endAngle):"removed"!==i||s||(a=o,r=o),"removed"===i){const t=(({radius:t})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*t}))(e);l=t.innerRadius,h=t.outerRadius}return{startAngle:a,endAngle:r,outerRadius:h,innerRadius:l,stroke:c,fill:d}},fromFn:(e,i,s,{prevFromProps:n})=>{let{startAngle:l,endAngle:h,innerRadius:c,outerRadius:d}=e,{fill:u,stroke:p}=i.sectorFormat;if("updated"===s&&null==e.previousDatum&&(s="added"),"unknown"===s||"added"===s&&!n?(l=o,h=o,c=i.innerRadius,d=i.outerRadius):"added"===s&&n&&(l=n.endAngle??o,h=n.endAngle??o,c=n.innerRadius??i.innerRadius,d=n.outerRadius??i.outerRadius),"added"===s&&!t){const t=(({radius:t})=>({innerRadius:a[0],outerRadius:a[0]+(a[1]-a[0])*t}))(i);c=t.innerRadius,d=t.outerRadius}return"updated"===s&&(u=e.fill??u,p=("string"==typeof e.stroke?e.stroke:void 0)??p),{startAngle:l,endAngle:h,innerRadius:c,outerRadius:d,fill:u,stroke:p,phase:r}}},innerCircle:{fromFn:(t,e)=>({size:t.previousDatum?.radius??t.size??0,phase:r}),toFn:(t,e)=>({size:e.radius??0})}}}function of(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,stroke:e.sectorFormat.stroke}}function rf(t,e){const i=e.y-t.centerY,s=e.x-t.centerX,n=Math.atan2(i,s),a=t.getItemNodes();for(const t of a)if(!0!==t.datum.missing&&at(n,t.startAngle,t.endAngle)){const e=Math.sqrt(s*s+i*i);let n=0;return e<t.innerRadius?n=t.innerRadius-e:e>t.outerRadius&&(n=e-t.outerRadius),{datum:t.datum,distance:n}}}r([Ct],nf.prototype,"angleKey",2),r([Ct],nf.prototype,"angleName",2),r([Ct],nf.prototype,"angleFilterKey",2),r([Ct],nf.prototype,"radiusKey",2),r([Ct],nf.prototype,"radiusName",2),r([Ct],nf.prototype,"radiusMin",2),r([Ct],nf.prototype,"radiusMax",2),r([Ct],nf.prototype,"calloutLabelKey",2),r([Ct],nf.prototype,"calloutLabelName",2),r([Ct],nf.prototype,"sectorLabelKey",2),r([Ct],nf.prototype,"sectorLabelName",2),r([Ct],nf.prototype,"legendItemKey",2),r([Ct],nf.prototype,"defaultColorRange",2),r([Ct],nf.prototype,"defaultPatternFills",2),r([Ct],nf.prototype,"fills",2),r([Ct],nf.prototype,"strokes",2),r([Ct],nf.prototype,"fillOpacity",2),r([Ct],nf.prototype,"strokeOpacity",2),r([Ct],nf.prototype,"lineDash",2),r([Ct],nf.prototype,"lineDashOffset",2),r([Ct],nf.prototype,"cornerRadius",2),r([Ct],nf.prototype,"itemStyler",2),r([Ct],nf.prototype,"rotation",2),r([Ct],nf.prototype,"outerRadiusOffset",2),r([Ct],nf.prototype,"outerRadiusRatio",2),r([Ct],nf.prototype,"innerRadiusOffset",2),r([Ct],nf.prototype,"innerRadiusRatio",2),r([Ct],nf.prototype,"strokeWidth",2),r([Ct],nf.prototype,"sectorSpacing",2),r([Ct],nf.prototype,"hideZeroValueSectorsInLegend",2),r([Ct],nf.prototype,"innerLabels",2),r([Ct],nf.prototype,"title",2),r([Ct],nf.prototype,"innerCircle",2),r([Ct],nf.prototype,"shadow",2),r([Ct],nf.prototype,"calloutLabel",2),r([Ct],nf.prototype,"sectorLabel",2),r([Ct],nf.prototype,"calloutLine",2),r([Ct],nf.prototype,"tooltip",2);var lf=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.FOREGROUND=1]="FOREGROUND",t[t.HIGHLIGHT=2]="HIGHLIGHT",t[t.LABEL=3]="LABEL",t))(lf||{}),hf=class extends Gp{constructor({categoryKey:t,useLabelLayer:e=!1,pickModes:i=[1,0],canHaveAxes:s=!1,animationResetFns:n,...a}){super({...a,categoryKey:t,useLabelLayer:e,pickModes:i,directionKeys:{angle:["angleKey"],radius:["radiusKey"]},directionNames:{angle:["angleName"],radius:["radiusName"]},canHaveAxes:s}),this.directions=["angle","radius"],this.itemGroup=this.contentGroup.appendChild(new Ie),this.nodeData=[],this.itemSelection=ur.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=ur.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=ur.select(this.highlightGroup,()=>this.nodeFactory()),this.highlightLabelSelection=ur.select(this.highlightLabel,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=n,this.animationState=new vr("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),highlightMarkers:t=>this.animateReadyHighlightMarkers(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}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)}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t&&this.animationState.transition("skip")}labelFactory(){const t=new Ri;return t.pointerEvents=1,t}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)))}getInnerRadius(){return 0}computeLabelsBBox(t,e){return null}getShapeFillBBox(){const t=this.radius;return{series:new y(-t,-t,2*t,2*t),axis:new y(-t,-t,2*t,2*t)}}resetAllAnimation(){const{item:t,label:e}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&dr([this.itemSelection,this.highlightSelection],t),e&&dr([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&&dr([this.highlightSelection],e),i&&dr([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(void 0!==e)return this.itemSelection.select(t=>t instanceof vh&&t.datum===e)[0]}getSeriesRange(t,e){return[NaN,NaN]}},cf=class extends fh{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}},df=class extends hf{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:of,label:vp}}),this.properties=new nf,this.phantomNodeData=void 0,this.backgroundGroup=new Ae({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new _d,this.radiusScale=new _d,this.phantomGroup=this.backgroundGroup.appendChild(new Ie({name:"phantom"})),this.phantomSelection=ur.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Ie({name:"pieCalloutLabels"})),this.calloutLabelSelection=new ur(this.calloutLabelGroup,Ie),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Ie({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Ph({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new Ph({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new Ie({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new Ie({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=ur.select(this.innerLabelsGroup,Ri),this.innerCircleSelection=ur.select(this.innerCircleGroup,()=>new Ph({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=cf,this.angleScale=new _d,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+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)}nodeFactory(){return new Uy}getSeriesDomain(t){return"angle"===t?this.angleScale.domain:this.radiusScale.domain}async processData(t){if(null==this.data)return;const{visible:e,id:i,ctx:{legendManager:n}}=this,{angleKey:a,angleFilterKey:o,radiusKey:r,calloutLabelKey:l,sectorLabelKey:h,legendItemKey:c}=this.properties,d=()=>(t,s)=>e&&n.getItemEnabled({seriesId:i,itemId:s})?t:0,u=!this.ctx.animationManager.isSkipped(),p=[],g=[];c?p.push(Yc(c,"band",{id:"legendItemKey"})):l?p.push(Yc(l,"band",{id:"calloutLabelKey"})):h&&p.push(Yc(h,"band",{id:"sectorLabelKey"}));const m=this.radiusScale.type,y=this.angleScale.type;r&&g.push(Zc(r,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:d}),$c(r,m,{id:"radiusRaw",processor:d}),rd("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),l&&g.push($c(l,"band",{id:"calloutLabelValue"})),h&&g.push($c(h,"band",{id:"sectorLabelValue"})),c&&g.push($c(c,"band",{id:"legendItemValue"})),o&&g.push(qc(o,y,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:d}),$c(o,y,{id:"angleFilterRaw"}),rd("angleFilterValue",[0,1],0,0)),u&&this.processedData&&p.length>0&&g.push(fd(this.id,this.processedData)),g.push(hd()),await this.requestDataModel(t,this.data,{props:[...p,qc(a,y,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:d}),$c(a,y,{id:"angleRaw"}),rd("angleValue",[0,1],0,0),...g]});for(const t of this.processedData?.defs?.values??[]){const{id:e,missing:i,property:n}=t,a=Bo(this,i);"angleRaw"!==e&&a>0&&s.Vy.warnOnce(`no value was found for the key '${String(n)}' on ${a} data element${a>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){return{angleValues:t.resolveColumnById(this,"angleValue",e),angleRawValues:t.resolveColumnById(this,"angleRaw",e),angleFilterValues:null!=this.properties.angleFilterKey?t.resolveColumnById(this,"angleFilterValue",e):void 0,angleFilterRawValues:null!=this.properties.angleFilterKey?t.resolveColumnById(this,"angleFilterRaw",e):void 0,radiusValues:this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,radiusRawValues:this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,calloutLabelValues:this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,sectorLabelValues:this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,legendItemValues:this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:a}=this,{rotation:o,innerRadiusRatio:r}=this.properties;if(!i||"ungrouped"!==e?.type)return;const{angleValues:l,angleRawValues:h,angleFilterValues:c,angleFilterRawValues:d,radiusValues:u,radiusRawValues:p,calloutLabelValues:g,sectorLabelValues:m,legendItemValues:y}=this.getProcessedDataValues(i,e),f=d?.some((t,e)=>t>h[e])??!1;let x=0,b=0;const v=[],S=null!=d?[]:void 0,M=e.dataSources.get(this.id)??[],k=e.invalidData?.get(this.id);return M.forEach((e,i)=>{if(!0===k?.[i])return;const r=f?c[i]:l[i],M=null==d||f?1:Math.sqrt(d[i]/h[i]),D=s.convert(x)+ot(o);x=r,b+=r;const w=s.convert(x)+ot(o),I=Math.abs(w-D),C=D+I/2,L=h[i],A=(u?.[i]??1)*M,T=p?.[i],N=y?.[i],O=this.getLabels(e,C,I,!0,g?.[i],m?.[i],N),R=this.getSectorFormat(e,i,!1),E={itemId:i,series:this,datum:e,datumIndex:i,angleValue:L,midAngle:C,midCos:Math.cos(C),midSin:Math.sin(C),startAngle:D,endAngle:w,radius:A,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(A),0),sectorFormat:R,radiusValue:T,legendItemValue:N,enabled:a&&n.getItemEnabled({seriesId:t,itemId:i}),focusable:!0,...O};v.push(E),null!=S&&S.push({...E,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}),this.zerosumOuterRing.visible=0===b,this.zerosumInnerRing.visible=0===b&&null!=r&&1!==r&&r>0,{itemId:t,nodeData:v,labelData:v,phantomNodeData:S}}getLabels(t,e,i,s,n,a,o){const{calloutLabel:r,sectorLabel:l,legendItemKey:h}=this.properties,c=!s||r.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!c&&!d&&!h)return{};const u={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 c&&i>=ot(r.minAngle)&&(p.calloutLabel={...this.getTextAlignment(e),text:this.getLabelText(r,{...u,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),d&&(p.sectorLabel={text:this.getLabelText(l,{...u,value:a})}),null!=h&&null!=o&&(p.legendItem={key:h,text:o}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=nt(t)- -.75*Math.PI,n=Math.floor(i/(Math.PI/2));return e[(0,s.GT)(n,e.length)]}getNodeFill(t,e,i){return uh(t,{type:"gradient",bounds:"series",colorStops:e.map(t=>({color:t})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"none",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0},{type:"image",backgroundFill:i,backgroundFillOpacity:1,fit:"contain",repeat:"no-repeat",rotation:0})}getFillParams(t,e,i){if(ae(t)&&"item"!==t.bounds)return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getSectorFormat(t,e,i){const{angleKey:s,radiusKey:n,calloutLabelKey:a,sectorLabelKey:o,legendItemKey:r,fills:l,strokes:h,defaultColorRange:c,defaultPatternFills:d,itemStyler:u}=this.properties,p=h[e%h.length],{fill:g,fillOpacity:m,stroke:y,strokeWidth:f,strokeOpacity:x,lineDash:b,lineDashOffset:v,cornerRadius:S}=E(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[e%l.length]:void 0,stroke:p,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties),M=c[e%c.length],k=d[e%d.length],D=g??"black";let w;return u&&(w=this.cachedDatumCallback(this.getDatumId(e)+(i?"-highlight":"-hide"),()=>this.callWithContext(u,{datum:t,angleKey:s,radiusKey:n,calloutLabelKey:a,sectorLabelKey:o,legendItemKey:r,fill:this.getNodeFill(D,M,k),fillOpacity:m,stroke:y,strokeWidth:f,strokeOpacity:x,lineDash:b,lineDashOffset:v,cornerRadius:S,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(w?.fill??D,M,k),fillOpacity:w?.fillOpacity??m,stroke:w?.stroke??y,strokeWidth:w?.strokeWidth??f,strokeOpacity:w?.strokeOpacity??x,lineDash:w?.lineDash??b,lineDashOffset:w?.lineDashOffset??v,cornerRadius:w?.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=t=>({...t,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(t.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const t=Math.max(0,this.radiusScale.range[1]);return 0===t?NaN:-t-(2+(this.properties.title?.spacing??0))-Math.max(0,-t)}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},s=null!=Fe(this.nodeDataDependencies,i);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 t=this.getTitleTranslationY();e.node.y=isFinite(t)?t:0;const i=e.node.getBBox();e.node.visible=e.enabled&&isFinite(t)&&!this.bboxIntersectsSurroundingSeries(i)}for(const t of[this.zerosumInnerRing,this.zerosumOuterRing])t.fillOpacity=0,t.stroke=this.properties.calloutLabel.color,t.strokeWidth=1,t.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=t=>{const e=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,e),y:t.midSin*Math.max(0,e)}};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:a,innerLabelsSelection:o}=this,r=this.nodeData.map(t=>({...t,sectorFormat:{...t.sectorFormat}})),l=(t,e)=>{t.update(e,void 0,t=>this.getDatumId(t.datumIndex)),this.ctx.animationManager.isSkipped()&&t.cleanup()};l(t,this.nodeData),l(e,r),l(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,t=>{const e=new pr;e.tag=0,e.pointerEvents=1,t.appendChild(e);const i=new Ri;i.tag=1,i.pointerEvents=1,t.appendChild(i)}),a.update(this.nodeData),s.update(r),o.update(this.properties.innerLabels,t=>{t.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const t=Math.min(i,this.getOuterRadius()),s=1;e=Math.ceil(2*t+s)}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((t,{radius:e})=>{t.setProperties({fill:this.getNodeFill(this.properties.innerCircle?.fill,["black"],"black"),opacity:this.properties.innerCircle?.fillOpacity,size:e})});const s=this.radiusScale.range[0],n=this.radiusScale.range[1],a=this.getShapeFillBBox(),o=this.ctx.animationManager.isSkipped(),r=(t,e,i,r)=>{const l=this.getSectorFormat(e.datum,e.itemId,r);e.sectorFormat.fill=l.fill,e.sectorFormat.stroke=l.stroke,o&&(t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius),(r||o)&&(t.fill=l.fill,t.stroke=l.stroke);const h=this.getFillParams(l.fill,s,n);gh(t,l.fill,a,h),t.strokeWidth=l.strokeWidth,t.fillOpacity=l.fillOpacity,t.strokeOpacity=l.strokeOpacity,t.lineDash=l.lineDash,t.lineDashOffset=l.lineDashOffset,t.cornerRadius=l.cornerRadius,t.fillShadow=this.properties.shadow;const c=Math.max((this.properties.sectorSpacing+(null!=l.stroke?l.strokeWidth:0))/2,0);t.inset=c,t.lineJoin=this.properties.sectorSpacing>=0||c>0?"miter":"round"};this.itemSelection.each((t,e,i)=>r(t,e,0,!1)),this.highlightSelection.each((t,i,s)=>{r(t,i,0,!0),t.visible=i.itemId===e?.itemId}),this.phantomSelection.each((t,e,i)=>r(t,e,0,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:t,strokeWidth:e,colors:i},strokes:s}=this.properties,n=e,a=oe(i)?i??this.properties.strokes:s,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach(e=>{const i=e.closestDatum(),{calloutLabel:s,outerRadius:r,datumIndex:l}=i;if(s?.text&&!s.hidden&&0!==r){e.visible=!0,e.strokeWidth=n,e.stroke=a[l%a.length],e.fill=void 0;const h=i.midCos*r,c=i.midSin*r;let d=i.midCos*(r+t),u=i.midSin*(r+t);if((s.collisionTextAlign??0!==s.collisionOffsetY)&&null!=s.box){const t=s.box;let e=d,i=u;d<t.x?e=t.x:d>t.x+t.width&&(e=t.x+t.width),u<t.y?i=t.y:u>t.y+t.height&&(i=t.y+t.height);const n=e-d,a=i-u,r=Math.sqrt(Math.pow(n,2)+Math.pow(a,2)),l=r-o;l>0&&(d+=n*l/r,u+=a*l/r)}e.x1=h,e.y1=c,e.x2=d,e.y2=u}else e.visible=!1})}getLabelOverflow(t,e,i){const s=-this.centerX,n=s+i.width,a=-this.centerY,o=a+i.height;let r=1;e.x+1<s?r=(e.x+e.width-s)/e.width:e.x+e.width-1>n&&(r=(n-e.x)/e.width);const l=e.y+1<a||e.y+e.height-1>o;return{textLength:1===r?t.length:Math.floor(t.length*r)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(e)}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(null==e)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(t=>t.x**2+t.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,a=t.convert(0),o=this.calloutNodeData,r=o.filter(t=>{return!(!(e=t).calloutLabel||0===e.outerRadius);var e});if(r.forEach(t=>{const e=t.calloutLabel;null!=e&&(e.hidden=!1,e.collisionTextAlign=void 0,e.collisionOffsetY=0)}),r.length<=1)return;const l=r.filter(t=>t.midCos<0).sort((t,e)=>t.midSin-e.midSin),h=r.filter(t=>t.midCos>=0).sort((t,e)=>t.midSin-e.midSin),c=r.filter(t=>t.midSin<0&&"center"===t.calloutLabel?.textAlign).sort((t,e)=>t.midCos-e.midCos),d=r.filter(t=>t.midSin>=0&&"center"===t.calloutLabel?.textAlign).sort((t,e)=>t.midCos-e.midCos),u=t=>{const e=t.calloutLabel;if(null==e)return y.zero.clone();const n=t.outerRadius+i.length+s,a=t.midCos*n,o=t.midSin*n+e.collisionOffsetY,r=e.collisionTextAlign??e.textAlign,l=e.textBaseline;return Ri.computeBBox(e.text,a,o,{font:this.properties.calloutLabel,textAlign:r,textBaseline:l})},p=(t,e,i)=>{const s=u(t).grow(n/2),a=u(e).grow(n/2);s.x<a.x+a.width&&s.x+s.width>a.x&&("to-top"===i?s.y<a.y+a.height:s.y+s.height>a.y)&&(e.calloutLabel.collisionOffsetY="to-top"===i?s.y-a.y-a.height:s.y+s.height-a.y)},g=t=>{const e=t.slice().sort((t,e)=>Math.abs(t.midSin)-Math.abs(e.midSin))[0],i=t.indexOf(e);for(let e=i-1;e>=0;e--){const i=t[e+1],s=t[e];p(i,s,"to-top")}for(let e=i+1;e<t.length;e++){const i=t[e-1],s=t[e];p(i,s,"to-bottom")}},m=t=>{const e=r.some(t=>0!==t.calloutLabel.collisionOffsetY),i=t.map(t=>u(t)),s=i.map(t=>t.clone().grow(n/2));let l=!1;for(let e=0;e<s.length&&!l;e++){const i=s[e];for(let n=e+1;n<t.length;n++){const t=s[n];if(i.collidesBBox(t)){l=!0;break}}}const h=o.map(t=>{const{startAngle:e,endAngle:i,outerRadius:s}=t;return{startAngle:e,endAngle:i,innerRadius:a,outerRadius:s}}),c=i.some(t=>h.some(e=>jy(t,e)));(l||e||c)&&t.filter(t=>"center"===t.calloutLabel.textAlign).forEach(t=>{const e=t.calloutLabel;t.midCos<0?e.collisionTextAlign="right":t.midCos>0?e.collisionTextAlign="left":e.collisionTextAlign="center"})};g(l),g(h),m(c),m(d)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,color:o}=i,r=new Ri;this.calloutLabelSelection.selectByTag(1).forEach(s=>{const l=s.closestDatum(),h=l.calloutLabel,c=e.convert(l.radius),d=Math.max(0,c);if(!h?.text||0===d||h.hidden)return void(s.visible=!1);const u=d+n+a,p=l.midCos*u,g=l.midSin*u+h.collisionOffsetY,m={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};r.text=h.text,r.x=p,r.y=g,r.setFont(this.properties.calloutLabel),r.setAlign(m);const y=r.getBBox();let f=h.text,x=!0;if(i.avoidCollisions){const{textLength:e,hasVerticalOverflow:i}=this.getLabelOverflow(h.text,y,t);f=h.text.length===e?h.text:`${h.text.substring(0,e)}…`,x=!i}s.text=f,s.x=p,s.y=g,s.setFont(this.properties.calloutLabel),s.setAlign(m),s.fill=o,s.visible=x})}computeLabelsBBox(t,e){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,maxCollisionOffset:o,minSpacing:r}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],h=new Ri;let c;const{title:d}=this.properties;if(d?.text&&d.enabled){const t=this.getTitleTranslationY();isFinite(t)&&(h.text=d.text,h.x=0,h.y=t,h.setFont(d),h.setAlign({textBaseline:"bottom",textAlign:"center"}),c=h.getBBox(),l.push(c))}return this.calloutNodeData.forEach(i=>{const s=i.calloutLabel;if(!s||0===i.outerRadius)return null;const d=i.outerRadius+n+a,u=i.midCos*d,p=i.midSin*d+s.collisionOffsetY;h.text=s.text,h.x=u,h.y=p,h.setFont(this.properties.calloutLabel),h.setAlign({textAlign:s.collisionTextAlign??s.textAlign,textBaseline:s.textBaseline});const g=h.getBBox();if(s.box=g,Math.abs(s.collisionOffsetY)>o)s.hidden=!0;else{if(c){const t=-this.centerY,e=new y(c.x-r,t,c.width+2*r,c.y+c.height+r-t);if(g.collidesBBox(e))return void(s.hidden=!0)}if(t.hideWhenNecessary){const{textLength:t,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:n}=this.getLabelOverflow(s.text,g,e),a=s.text.length>2&&t<2;if(i||a||n)return void(s.hidden=!0)}s.hidden=!1,l.push(g)}}),0===l.length?null:y.merge(l)}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:a,positionOffset:o,positionRatio:r,color:l}=this.properties.sectorLabel,h=(t,h)=>{const{sectorLabel:c,outerRadius:d}=h;let u=!1;if(c&&0!==d){const p=e*(1-r)+d*r+o;t.fill=l,t.fontStyle=s,t.fontWeight=n,t.fontSize=i,t.fontFamily=a,t.text=c.text,t.x=h.midCos*p,t.y=h.midSin*p,t.textAlign="center",t.textBaseline="middle";const g=t.getBBox(),m=[[g.x,g.y],[g.x+g.width,g.y],[g.x+g.width,g.y+g.height],[g.x,g.y+g.height]],{startAngle:y,endAngle:f}=h,x={startAngle:y,endAngle:f,innerRadius:e,outerRadius:d};m.every(([t,e])=>Gy(t,e,x))&&(u=!0)}t.visible=u};this.labelSelection.each(h),this.highlightLabelSelection.each(h)}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((i,s)=>{const{fontStyle:n,fontWeight:a,fontSize:o,fontFamily:r,color:l}=s;i.fontStyle=n,i.fontWeight=a,i.fontSize=o,i.fontFamily=r,i.text=s.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",t.push(i.getBBox()),e.push(s.spacing)});const i=t=>0===t?0:e[t],s=t=>t===e.length-1?0:e[t],n=t.reduce((t,e,n)=>t+e.height+i(n)+s(n),0),a=Math.max(...t.map(t=>t.width)),o=this.getInnerRadius(),r=Math.sqrt(Math.pow(a/2,2)+Math.pow(n/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let e=0,a=-n/2;e<t.length;e++){const n=t[e].height+a+i(e);l.push(n),a=n+s(e)}this.innerLabelsSelection.each((t,e,i)=>{t.y=l[i],t.visible=r})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}pickNodeClosestDatum(t){return rf(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:a,calloutLabelKey:o,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:h,angleKey:c,angleName:d,radiusKey:u,radiusName:p,tooltip:g}=n,m=this.properties.title.text;if(!i||!s)return;const y=s.dataSources.get(this.id)?.[t],{angleRawValues:f,legendItemValues:x,calloutLabelValues:b,sectorLabelValues:v}=this.getProcessedDataValues(i,s),S=f[t],M=x?.[t]??(o===c?void 0:b?.[t])??(l===c?void 0:v?.[t])??d;return this.formatTooltipWithContext(g,{title:m,symbol:this.legendItemSymbol(t),data:[{label:M,fallbackLabel:c,value:Fs(S,3)}]},{seriesId:e,datum:y,title:d,legendItemKey:a,calloutLabelKey:o,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:h,angleKey:c,angleName:d,radiusKey:u,radiusName:p,...this.getSectorFormat(y,t,!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.[t],i=this.getSectorFormat(e,t,!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r}=this.properties;let{fill:l}=i;const{stroke:h}=i;return ae(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:h,fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r}}}getLegendData(t){const{visible:e,processedData:i,dataModel:s,id:n,ctx:{legendManager:a}}=this;if(!s||!i||"category"!==t)return[];const{angleKey:o,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:h,showInLegend:c}=this.properties;if(!(h||r&&r!==o||l&&l!==o))return[];const{angleRawValues:d,calloutLabelValues:u,sectorLabelValues:p,legendItemValues:g}=this.getProcessedDataValues(s,i),m=this.properties.title?.showInLegend&&this.properties.title.text,y=[],f=this.properties.hideZeroValueSectorsInLegend,x=i.dataSources.get(this.id),b=i.invalidData?.get(this.id);for(let t=0;t<i.input.count;t++){const i=x?.[t],s=d[t];if(!0===b?.[t]||f&&0===s)continue;const v=[];m&&v.push(m);const S=this.getLabels(i,2*Math.PI,2*Math.PI,!1,u?.[t],p?.[t],g?.[t]);h&&void 0!==S.legendItem?v.push(S.legendItem.text):r&&r!==o&&void 0!==S.calloutLabel?.text?v.push(S.calloutLabel?.text):l&&l!==o&&void 0!==S.sectorLabel?.text&&v.push(S.sectorLabel?.text),0!==v.length&&y.push({legendType:"category",id:n,datum:i,itemId:t,seriesId:n,hideToggleOtherSeries:!0,enabled:e&&a.getItemEnabled({seriesId:n,itemId:t}),label:{text:v.join(" - ")},symbol:this.legendItemSymbol(t),legendItemName:null!=h?i[h]:void 0,hideInLegend:!c})}return y}setLegendState(t){const{id:e,ctx:{legendManager:i,updateService:s}}=this;t.forEach((t,s)=>i.toggleItem(t,e,s)),i.update(),s.update(5)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=af(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);rr(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(t,e)=>this.getDatumId(e.datumIndex)),rr(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),xp(this,"callout",e,this.calloutLabelSelection),xp(this,"sector",e,this.labelSelection),xp(this,"highlight",e,this.highlightLabelSelection),xp(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:a}=this,{animationManager:o}=this.ctx,r=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=0===(r?.moved.size??0),h=(s?.defs.keys.length??0)>0;l&&h&&(s?.reduced?.animationValidation?.uniqueKeys??1)||this.ctx.animationManager.skipCurrentBatch();const c=!this.nodeData.some(t=>t.enabled),d=af(!1,this.properties.rotation,n,a);rr(this.id,"nodes",o,[t,e,i],d.nodes,(t,e)=>this.getDatumId(e.datumIndex),r),rr(this.id,"innerCircle",o,[this.innerCircleSelection],d.innerCircle),xp(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),xp(this,"sector",this.ctx.animationManager,this.labelSelection),xp(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.noVisibleData!==c&&(this.noVisibleData=c,xp(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:a}=this.ctx,o=af(!1,this.properties.rotation,s,n);rr(this.id,"nodes",a,[t,e,i],o.nodes,(t,e)=>this.getDatumId(e.datumIndex)),rr(this.id,"innerCircle",a,[this.innerCircleSelection],o.innerCircle),bp(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),bp(this,"sector",this.ctx.animationManager,this.labelSelection),bp(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),bp(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t){return`${t}`}};df.className="DonutSeries",df.type="donut";var uf={radiusMin:s.Ly,radiusMax:s.Ly,rotation:s.ai,outerRadiusOffset:s.ai,outerRadiusRatio:s.CG,hideZeroValueSectorsInLegend:s.zM,sectorSpacing:s.Ly,cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),title:{enabled:s.zM,text:s.Yj,showInLegend:s.zM,spacing:s.Ly,...s.LV},calloutLabel:{enabled:s.zM,offset:s.ai,minAngle:s.Ly,avoidCollisions:s.zM,formatter:s.E2,...s.LV},sectorLabel:{enabled:s.zM,positionOffset:s.ai,positionRatio:s.CG,formatter:s.E2,...s.LV},calloutLine:{colors:(0,s.jk)(s.yW),length:s.Ly,strokeWidth:s.Ly},fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),tooltip:Rm,shadow:Em,...Im,...s.mL,...z(s.Fu,["fill"]),...z(s.AF,["stroke"])},pf={...uf,...Cm,type:(0,s.mw)((0,s.dY)("pie")),angleKey:(0,s.mw)(s.Yj),radiusKey:s.Yj,calloutLabelKey:s.Yj,sectorLabelKey:s.Yj,legendItemKey:s.Yj,angleName:s.Yj,radiusName:s.Yj,calloutLabelName:s.Yj,sectorLabelName:s.Yj};pf.defaultColorRange=(0,s._L)((0,s.jk)((0,s.jk)(s.yW))),pf.defaultPatternFills=(0,s._L)((0,s.jk)(s.yW)),pf.title._enabledFromTheme=(0,s._L)(s.zM),pf.calloutLabel._enabledFromTheme=(0,s._L)(s.zM),pf.sectorLabel._enabledFromTheme=(0,s._L)(s.zM);var gf={...uf,innerRadiusOffset:s.ai,innerRadiusRatio:s.CG,innerCircle:{fill:s.Yj,fillOpacity:s.CG},innerLabels:{spacing:s.Ly,...s.LV}},mf={...gf,...pf,type:(0,s.mw)((0,s.dY)("donut")),innerLabels:(0,s.J$)({text:(0,s.mw)(s.Yj),spacing:s.Ly,...s.LV},"inner label options array")},yf={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:t=>new df(t),tooltipDefaults:{range:"exact"},themeTemplate:{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,colors:{$map:[{$if:[{$or:[{$isGradient:[{$value:"$1"}]},{$isPattern:[{$value:"$1"}]},{$isImage:[{$value:"$1"}]}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:dp,fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},shadow:{enabled:!1,color:Tu,xOffset:3,yOffset:3,blur:5},innerLabels:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},legend:{enabled:!0}}},ff={type:"series",name:"donut",chartType:"polar",options:mf,create:t=>new df(t)},xf=class extends Fi{constructor(){super(...arguments),this.showInLegend=!1}};r([Ct],xf.prototype,"showInLegend",2);var bf=class extends pl{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};r([Ct],bf.prototype,"offset",2),r([Ct],bf.prototype,"minAngle",2),r([Ct],bf.prototype,"minSpacing",2),r([Ct],bf.prototype,"maxCollisionOffset",2),r([Ct],bf.prototype,"avoidCollisions",2);var vf=class extends pl{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};r([Ct],vf.prototype,"positionOffset",2),r([Ct],vf.prototype,"positionRatio",2);var Sf=class extends Lt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};r([Ct],Sf.prototype,"colors",2),r([Ct],Sf.prototype,"length",2),r([Ct],Sf.prototype,"strokeWidth",2);var Mf=class extends Np{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(Xy),this.strokes=Object.values(Zy),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 xf,this.shadow=new Mp,this.calloutLabel=new bf,this.sectorLabel=new vf,this.calloutLine=new Sf,this.tooltip=new Ep}};r([Ct],Mf.prototype,"angleKey",2),r([Ct],Mf.prototype,"angleName",2),r([Ct],Mf.prototype,"angleFilterKey",2),r([Ct],Mf.prototype,"radiusKey",2),r([Ct],Mf.prototype,"radiusName",2),r([Ct],Mf.prototype,"radiusMin",2),r([Ct],Mf.prototype,"radiusMax",2),r([Ct],Mf.prototype,"calloutLabelKey",2),r([Ct],Mf.prototype,"calloutLabelName",2),r([Ct],Mf.prototype,"sectorLabelKey",2),r([Ct],Mf.prototype,"sectorLabelName",2),r([Ct],Mf.prototype,"legendItemKey",2),r([Ct],Mf.prototype,"defaultColorRange",2),r([Ct],Mf.prototype,"defaultPatternFills",2),r([Ct],Mf.prototype,"fills",2),r([Ct],Mf.prototype,"strokes",2),r([Ct],Mf.prototype,"fillOpacity",2),r([Ct],Mf.prototype,"strokeOpacity",2),r([Ct],Mf.prototype,"lineDash",2),r([Ct],Mf.prototype,"lineDashOffset",2),r([Ct],Mf.prototype,"cornerRadius",2),r([Ct],Mf.prototype,"itemStyler",2),r([Ct],Mf.prototype,"rotation",2),r([Ct],Mf.prototype,"outerRadiusOffset",2),r([Ct],Mf.prototype,"outerRadiusRatio",2),r([Ct],Mf.prototype,"strokeWidth",2),r([Ct],Mf.prototype,"sectorSpacing",2),r([Ct],Mf.prototype,"hideZeroValueSectorsInLegend",2),r([Ct],Mf.prototype,"title",2),r([Ct],Mf.prototype,"shadow",2),r([Ct],Mf.prototype,"calloutLabel",2),r([Ct],Mf.prototype,"sectorLabel",2),r([Ct],Mf.prototype,"calloutLine",2),r([Ct],Mf.prototype,"tooltip",2);var kf=class extends fh{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}},Df=class extends hf{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:of,label:vp}}),this.properties=new Mf,this.phantomNodeData=void 0,this.backgroundGroup=new Ae({name:`${this.id}-background`,zIndex:0}),this.previousRadiusScale=new _d,this.radiusScale=new _d,this.phantomGroup=this.backgroundGroup.appendChild(new Ie({name:"phantom"})),this.phantomSelection=ur.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Ie({name:"pieCalloutLabels"})),this.calloutLabelSelection=new ur(this.calloutLabelGroup,Ie),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Ie({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Ph({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=kf,this.angleScale=new _d,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+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)}nodeFactory(){const t=new Uy;return t.miterLimit=1e9,t}getSeriesDomain(t){return"angle"===t?this.angleScale.domain:this.radiusScale.domain}async processData(t){if(null==this.data)return;const{visible:e,id:i,ctx:{legendManager:n}}=this,{angleKey:a,angleFilterKey:o,radiusKey:r,calloutLabelKey:l,sectorLabelKey:h,legendItemKey:c}=this.properties,d=()=>(t,s)=>e&&n.getItemEnabled({seriesId:i,itemId:s})?t:0,u=!this.ctx.animationManager.isSkipped(),p=[],g=[];c?p.push(Yc(c,"band",{id:"legendItemKey"})):l?p.push(Yc(l,"band",{id:"calloutLabelKey"})):h&&p.push(Yc(h,"band",{id:"sectorLabelKey"}));const m=this.radiusScale.type,y=this.angleScale.type;r&&g.push(Zc(r,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:d}),$c(r,m,{id:"radiusRaw",processor:d}),rd("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),l&&g.push($c(l,"band",{id:"calloutLabelValue"})),h&&g.push($c(h,"band",{id:"sectorLabelValue"})),c&&g.push($c(c,"band",{id:"legendItemValue"})),o&&g.push(qc(o,y,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:d}),$c(o,y,{id:"angleFilterRaw"}),rd("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&p.length>0&&g.push(fd(this.id,this.processedData)),g.push(hd()),await this.requestDataModel(t,this.data,{props:[...p,qc(a,y,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:d}),$c(a,y,{id:"angleRaw"}),rd("angleValue",[0,1],0,0),...g]});for(const t of this.processedData?.defs?.values??[]){const{id:e,missing:i,property:n}=t,a=Bo(this,i);"angleRaw"!==e&&a>0&&s.Vy.warnOnce(`no value was found for the key '${String(n)}' on ${a} data element${a>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){return{angleValues:t.resolveColumnById(this,"angleValue",e),angleRawValues:t.resolveColumnById(this,"angleRaw",e),angleFilterValues:null!=this.properties.angleFilterKey?t.resolveColumnById(this,"angleFilterValue",e):void 0,angleFilterRawValues:null!=this.properties.angleFilterKey?t.resolveColumnById(this,"angleFilterRaw",e):void 0,radiusValues:this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,radiusRawValues:this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,calloutLabelValues:this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,sectorLabelValues:this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,legendItemValues:this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:a}=this,{rotation:o}=this.properties;if(!i||"ungrouped"!==e?.type)return;const{angleValues:r,angleRawValues:l,angleFilterValues:h,angleFilterRawValues:c,radiusValues:d,radiusRawValues:u,calloutLabelValues:p,sectorLabelValues:g,legendItemValues:m}=this.getProcessedDataValues(i,e),y=c?.some((t,e)=>t>l[e])??!1;let f=0,x=0;const b=[],v=null!=c?[]:void 0,S=e.dataSources.get(this.id)??[],M=e.invalidData?.get(this.id);return S.forEach((e,i)=>{if(!0===M?.[i])return;const S=y?h[i]:r[i],k=null==c||y?1:Math.sqrt(c[i]/l[i]),D=s.convert(f)+ot(o);f=S,x+=S;const w=s.convert(f)+ot(o),I=Math.abs(w-D),C=D+I/2,L=l[i],A=(d?.[i]??1)*k,T=u?.[i],N=m?.[i],O=this.getLabels(e,C,I,!0,p?.[i],g?.[i],N),R=this.getSectorFormat(e,i,!1),E={itemId:i,series:this,datum:e,datumIndex:i,angleValue:L,midAngle:C,midCos:Math.cos(C),midSin:Math.sin(C),startAngle:D,endAngle:w,radius:A,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(A),0),sectorFormat:R,radiusValue:T,legendItemValue:N,enabled:a&&n.getItemEnabled({seriesId:t,itemId:i}),...O};b.push(E),null!=v&&v.push({...E,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0)})}),this.zerosumOuterRing.visible=0===x,{itemId:t,nodeData:b,labelData:b,phantomNodeData:v}}getLabels(t,e,i,s,n,a,o){const{calloutLabel:r,sectorLabel:l,legendItemKey:h}=this.properties,c=!s||r.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!c&&!d&&!h)return{};const u={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 c&&i>=ot(r.minAngle)&&(p.calloutLabel={...this.getTextAlignment(e),text:this.getLabelText(r,{...u,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),d&&(p.sectorLabel={text:this.getLabelText(l,{...u,value:a})}),null!=h&&null!=o&&(p.legendItem={key:h,text:o}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=nt(t)- -.75*Math.PI,n=Math.floor(i/(Math.PI/2));return e[(0,s.GT)(n,e.length)]}getNodeFill(t,e,i){return uh(t,{type:"gradient",bounds:"series",colorStops:e.map(t=>({color:t})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"none",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0},{type:"image",backgroundFill:i,backgroundFillOpacity:1,fit:"contain",repeat:"no-repeat",rotation:0})}getFillParams(t,e,i){if(ae(t)&&"item"!==t.bounds)return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getSectorFormat(t,e,i){const{angleKey:s,radiusKey:n,calloutLabelKey:a,sectorLabelKey:o,legendItemKey:r,fills:l,strokes:h,defaultColorRange:c,defaultPatternFills:d,itemStyler:u}=this.properties,p=h[e%h.length],{fill:g,fillOpacity:m,stroke:y,strokeWidth:f,strokeOpacity:x,lineDash:b,lineDashOffset:v,cornerRadius:S}=E(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[e%l.length]:void 0,stroke:p,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties),M=c[e%c.length],k=d[e%d.length],D=g??"black";let w;return u&&(w=this.cachedDatumCallback(this.getDatumId(e)+(i?"-highlight":"-hide"),()=>this.callWithContext(u,{datum:t,angleKey:s,radiusKey:n,calloutLabelKey:a,sectorLabelKey:o,legendItemKey:r,fill:this.getNodeFill(D,M,k),strokeOpacity:x,stroke:y,strokeWidth:f,fillOpacity:m,lineDash:b,lineDashOffset:v,cornerRadius:S,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(w?.fill??D,M,k),fillOpacity:w?.fillOpacity??m,stroke:w?.stroke??y,strokeWidth:w?.strokeWidth??f,strokeOpacity:w?.strokeOpacity??x,lineDash:w?.lineDash??b,lineDashOffset:w?.lineDashOffset??v,cornerRadius:w?.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=t=>({...t,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(t.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const t=Math.max(0,this.radiusScale.range[1]);return 0===t?NaN:-t-(2+(this.properties.title?.spacing??0))-Math.max(0,-t)}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},s=null!=Fe(this.nodeDataDependencies,i);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 t=this.getTitleTranslationY();e.node.y=isFinite(t)?t:0;const i=e.node.getBBox();e.node.visible=e.enabled&&isFinite(t)&&!this.bboxIntersectsSurroundingSeries(i)}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=t=>{const e=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,e),y:t.midSin*Math.max(0,e)}};this.nodeData.forEach(t),this.phantomNodeData?.forEach(t)}updateSelections(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:n,labelSelection:a}=this,o=this.nodeData.map(t=>({...t,sectorFormat:{...t.sectorFormat}})),r=(t,e)=>{t.update(e,void 0,t=>this.getDatumId(t.datumIndex)),this.ctx.animationManager.isSkipped()&&t.cleanup()};r(t,this.nodeData),r(e,o),r(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,t=>{const e=new pr;e.tag=0,e.pointerEvents=1,t.appendChild(e);const i=new Ri;i.tag=1,i.pointerEvents=1,t.appendChild(i)}),a.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.radiusScale.range[0],n=this.radiusScale.range[1],a=this.getShapeFillBBox(),o=this.ctx.animationManager.isSkipped(),r=(t,e,i,r)=>{const l=this.getSectorFormat(e.datum,e.itemId,r);e.sectorFormat.fill=l.fill,e.sectorFormat.stroke=l.stroke,o&&(t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius),(r||o)&&(t.fill=l.fill,t.stroke=l.stroke);const h=this.getFillParams(l.fill,s,n);gh(t,l.fill,a,h),t.strokeWidth=l.strokeWidth,t.fillOpacity=l.fillOpacity,t.strokeOpacity=l.strokeOpacity,t.lineDash=l.lineDash,t.lineDashOffset=l.lineDashOffset,t.cornerRadius=l.cornerRadius,t.fillShadow=this.properties.shadow;const c=Math.max((this.properties.sectorSpacing+(null!=l.stroke?l.strokeWidth:0))/2,0);t.inset=c,t.lineJoin=this.properties.sectorSpacing>=0||c>0?"miter":"round"};this.itemSelection.each((t,e,i)=>r(t,e,0,!1)),this.highlightSelection.each((t,i,s)=>{r(t,i,0,!0),t.visible=i.itemId===e?.itemId}),this.phantomSelection.each((t,e,i)=>r(t,e,0,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:t,strokeWidth:e,colors:i},strokes:s}=this.properties,n=e,a=oe(i)?i:s,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach(e=>{const i=e.closestDatum(),{calloutLabel:s,outerRadius:r,datumIndex:l}=i;if(s?.text&&!s.hidden&&0!==r){e.visible=!0,e.strokeWidth=n,e.stroke=a[l%a.length],e.fill=void 0;const h=i.midCos*r,c=i.midSin*r;let d=i.midCos*(r+t),u=i.midSin*(r+t);if((s.collisionTextAlign??0!==s.collisionOffsetY)&&null!=s.box){const t=s.box;let e=d,i=u;d<t.x?e=t.x:d>t.x+t.width&&(e=t.x+t.width),u<t.y?i=t.y:u>t.y+t.height&&(i=t.y+t.height);const n=e-d,a=i-u,r=Math.sqrt(Math.pow(n,2)+Math.pow(a,2)),l=r-o;l>0&&(d+=n*l/r,u+=a*l/r)}e.x1=h,e.y1=c,e.x2=d,e.y2=u}else e.visible=!1})}getLabelOverflow(t,e,i){const s=-this.centerX,n=s+i.width,a=-this.centerY,o=a+i.height;let r=1;e.x+1<s?r=(e.x+e.width-s)/e.width:e.x+e.width-1>n&&(r=(n-e.x)/e.width);const l=e.y+1<a||e.y+e.height-1>o;return{textLength:1===r?t.length:Math.floor(t.length*r)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(e)}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(null==e)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(t=>t.x**2+t.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,a=t.convert(0),o=this.calloutNodeData,r=o.filter(t=>{return!(!(e=t).calloutLabel||0===e.outerRadius);var e});if(r.forEach(t=>{const e=t.calloutLabel;null!=e&&(e.hidden=!1,e.collisionTextAlign=void 0,e.collisionOffsetY=0)}),r.length<=1)return;const l=r.filter(t=>t.midCos<0).sort((t,e)=>t.midSin-e.midSin),h=r.filter(t=>t.midCos>=0).sort((t,e)=>t.midSin-e.midSin),c=r.filter(t=>t.midSin<0&&"center"===t.calloutLabel?.textAlign).sort((t,e)=>t.midCos-e.midCos),d=r.filter(t=>t.midSin>=0&&"center"===t.calloutLabel?.textAlign).sort((t,e)=>t.midCos-e.midCos),u=t=>{const e=t.calloutLabel;if(null==e)return y.zero.clone();const n=t.outerRadius+i.length+s,a=t.midCos*n,o=t.midSin*n+e.collisionOffsetY,r=e.collisionTextAlign??e.textAlign,l=e.textBaseline;return Ri.computeBBox(e.text,a,o,{font:this.properties.calloutLabel,textAlign:r,textBaseline:l})},p=(t,e,i)=>{const s=u(t).grow(n/2),a=u(e).grow(n/2);s.x<a.x+a.width&&s.x+s.width>a.x&&("to-top"===i?s.y<a.y+a.height:s.y+s.height>a.y)&&(e.calloutLabel.collisionOffsetY="to-top"===i?s.y-a.y-a.height:s.y+s.height-a.y)},g=t=>{const e=t.slice().sort((t,e)=>Math.abs(t.midSin)-Math.abs(e.midSin))[0],i=t.indexOf(e);for(let e=i-1;e>=0;e--){const i=t[e+1],s=t[e];p(i,s,"to-top")}for(let e=i+1;e<t.length;e++){const i=t[e-1],s=t[e];p(i,s,"to-bottom")}},m=t=>{const e=r.some(t=>0!==t.calloutLabel.collisionOffsetY),i=t.map(t=>u(t)),s=i.map(t=>t.clone().grow(n/2));let l=!1;for(let e=0;e<s.length&&!l;e++){const i=s[e];for(let n=e+1;n<t.length;n++){const t=s[n];if(i.collidesBBox(t)){l=!0;break}}}const h=o.map(t=>{const{startAngle:e,endAngle:i,outerRadius:s}=t;return{startAngle:e,endAngle:i,innerRadius:a,outerRadius:s}}),c=i.some(t=>h.some(e=>jy(t,e)));(l||e||c)&&t.filter(t=>"center"===t.calloutLabel.textAlign).forEach(t=>{const e=t.calloutLabel;t.midCos<0?e.collisionTextAlign="right":t.midCos>0?e.collisionTextAlign="left":e.collisionTextAlign="center"})};g(l),g(h),m(c),m(d)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,color:o}=i,r=new Ri;this.calloutLabelSelection.selectByTag(1).forEach(s=>{const l=s.closestDatum(),h=l.calloutLabel,c=e.convert(l.radius),d=Math.max(0,c);if(!h?.text||0===d||h.hidden)return void(s.visible=!1);const u=d+n+a,p=l.midCos*u,g=l.midSin*u+h.collisionOffsetY,m={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};r.text=h.text,r.x=p,r.y=g,r.setFont(this.properties.calloutLabel),r.setAlign(m);const y=r.getBBox();let f=h.text,x=!0;if(i.avoidCollisions){const{textLength:e,hasVerticalOverflow:i}=this.getLabelOverflow(h.text,y,t);f=h.text.length===e?h.text:`${h.text.substring(0,e)}…`,x=!i}s.text=f,s.x=p,s.y=g,s.setFont(this.properties.calloutLabel),s.setAlign(m),s.fill=o,s.visible=x})}computeLabelsBBox(t,e){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,maxCollisionOffset:o,minSpacing:r}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],h=new Ri;let c;const{title:d}=this.properties;if(d?.text&&d.enabled){const t=this.getTitleTranslationY();isFinite(t)&&(h.text=d.text,h.x=0,h.y=t,h.setFont(d),h.setAlign({textBaseline:"bottom",textAlign:"center"}),c=h.getBBox(),l.push(c))}return this.calloutNodeData.forEach(i=>{const s=i.calloutLabel;if(!s||0===i.outerRadius)return null;const d=i.outerRadius+n+a,u=i.midCos*d,p=i.midSin*d+s.collisionOffsetY;h.text=s.text,h.x=u,h.y=p,h.setFont(this.properties.calloutLabel),h.setAlign({textAlign:s.collisionTextAlign??s.textAlign,textBaseline:s.textBaseline});const g=h.getBBox();if(s.box=g,Math.abs(s.collisionOffsetY)>o)s.hidden=!0;else{if(c){const t=-this.centerY,e=new y(c.x-r,t,c.width+2*r,c.y+c.height+r-t);if(g.collidesBBox(e))return void(s.hidden=!0)}if(t.hideWhenNecessary){const{textLength:t,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:n}=this.getLabelOverflow(s.text,g,e),a=s.text.length>2&&t<2;if(i||a||n)return void(s.hidden=!0)}s.hidden=!1,l.push(g)}}),0===l.length?null:y.merge(l)}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:a,positionOffset:o,positionRatio:r,color:l}=this.properties.sectorLabel,h=e>0,c=1===this.ctx.legendManager.getData(this.id)?.filter(t=>t.enabled).length,d=(t,d)=>{const{sectorLabel:u,outerRadius:p,startAngle:g,endAngle:m}=d;let y=!1;if(u&&0!==p){const f=e*(1-r)+p*r+o;t.fill=l,t.fontStyle=s,t.fontWeight=n,t.fontSize=i,t.fontFamily=a,t.text=u.text,!h&&c?(t.x=0,t.y=0):(t.x=d.midCos*f,t.y=d.midSin*f),t.textAlign="center",t.textBaseline="middle";const x=t.getBBox(),b=[[x.x,x.y],[x.x+x.width,x.y],[x.x+x.width,x.y+x.height],[x.x,x.y+x.height]],v={startAngle:g,endAngle:m,innerRadius:e,outerRadius:p};b.every(([t,e])=>Gy(t,e,v))&&(y=!0)}t.visible=y};this.labelSelection.each(d),this.highlightLabelSelection.each(d)}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius()}pickNodeClosestDatum(t){return rf(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:a,calloutLabelKey:o,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:h,angleKey:c,angleName:d,radiusKey:u,radiusName:p,tooltip:g}=n,m=this.properties.title.text;if(!i||!s)return;const y=s.dataSources.get(this.id)?.[t],{angleRawValues:f,legendItemValues:x,calloutLabelValues:b,sectorLabelValues:v}=this.getProcessedDataValues(i,s),S=f[t],M=x?.[t]??(o===c?void 0:b?.[t])??(l===c?void 0:v?.[t])??d;return this.formatTooltipWithContext(g,{title:m,symbol:this.legendItemSymbol(t),data:[{label:M,fallbackLabel:c,value:Fs(S,3)}]},{seriesId:e,datum:y,title:d,legendItemKey:a,calloutLabelKey:o,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:h,angleKey:c,angleName:d,radiusKey:u,radiusName:p,...this.getSectorFormat(y,t,!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.[t],i=this.getSectorFormat(e,t,!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r}=this.properties;let{fill:l}=i;const{stroke:h}=i;return ae(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:h,fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r}}}getLegendData(t){const{id:e,visible:i,processedData:s,dataModel:n,ctx:{legendManager:a}}=this;if(!n||!s||"category"!==t)return[];const{angleKey:o,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:h,showInLegend:c}=this.properties;if(!(h||r&&r!==o||l&&l!==o))return[];const{calloutLabelValues:d,sectorLabelValues:u,legendItemValues:p,angleRawValues:g}=this.getProcessedDataValues(n,s),m=this.properties.title?.showInLegend&&this.properties.title.text,y=[],f=this.properties.hideZeroValueSectorsInLegend,x=s.dataSources.get(this.id),b=s.invalidData?.get(this.id);for(let t=0;t<s.input.count;t++){const s=x?.[t],n=g[t];if(!0===b?.[t]||f&&0===n)continue;const v=[];m&&v.push(m);const S=this.getLabels(s,2*Math.PI,2*Math.PI,!1,d?.[t],u?.[t],p?.[t]);h&&void 0!==S.legendItem?v.push(S.legendItem.text):r&&r!==o&&void 0!==S.calloutLabel?.text?v.push(S.calloutLabel?.text):l&&l!==o&&void 0!==S.sectorLabel?.text&&v.push(S.sectorLabel?.text),0!==v.length&&y.push({legendType:"category",id:e,datum:s,itemId:t,seriesId:e,hideToggleOtherSeries:!0,enabled:i&&a.getItemEnabled({seriesId:e,itemId:t}),label:{text:v.join(" - ")},symbol:this.legendItemSymbol(t),legendItemName:null!=h?s[h]:void 0,hideInLegend:!c})}return y}setLegendState(t){const{id:e,ctx:{legendManager:i,updateService:s}}=this;t.forEach((t,s)=>i.toggleItem(t,e,s)),i.update(),s.update(5)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=af(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);rr(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(t,e)=>this.getDatumId(e.datumIndex)),xp(this,"callout",e,this.calloutLabelSelection),xp(this,"sector",e,this.labelSelection),xp(this,"highlight",e,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:a}=this,{animationManager:o}=this.ctx,r=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=0===(r?.moved.size??0),h=(s?.defs.keys.length??0)>0;l&&h&&(s?.reduced?.animationValidation?.uniqueKeys??1)||this.ctx.animationManager.skipCurrentBatch();const c=af(!1,this.properties.rotation,n,a);rr(this.id,"nodes",o,[t,e,i],c.nodes,(t,e)=>this.getDatumId(e.datumIndex),r),xp(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),xp(this,"sector",this.ctx.animationManager,this.labelSelection),xp(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:a}=this.ctx,o=af(!1,this.properties.rotation,s,n);rr(this.id,"nodes",a,[t,e,i],o.nodes,(t,e)=>this.getDatumId(e.datumIndex)),bp(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),bp(this,"sector",this.ctx.animationManager,this.labelSelection),bp(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t){return`${t}`}};Df.className="PieSeries",Df.type="pie";var wf={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:t=>new Df(t),tooltipDefaults:{range:"exact"},themeTemplate:{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,colors:{$map:[{$if:[{$or:[{$isGradient:[{$value:"$1"}]},{$isPattern:[{$value:"$1"}]},{$isImage:[{$value:"$1"}]}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:dp,fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Tu,xOffset:3,yOffset:3,blur:5}},legend:{enabled:!0}}},If={type:"series",name:"pie",chartType:"polar",options:pf,create:t=>new Df(t)};function Cf(){h.register(Jd,bu,vc,zm,ry,yy,Ly,Py,yf,wf,My);for(const t of[jd,Ic,Kd,Od,Wd,$d])Yo.register(t.type,{moduleFactory:e=>new t(e)})}var Lf=["bar","line","scatter"],Af=(t=>(t.POINTER="pointer",t.NODE="node",t.CHART="chart",t))(Af||{}),Tf=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t.TOP_RIGHT="top-right",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t.TOP_LEFT="top-left",t.CENTER="center",t))(Tf||{}),Nf=(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))(Nf||{}),Of=Symbol("IGNORED_PROP");function Rf(t,e){const i={};for(const s of Object.keys(e)){const n=e[s];n!==Of&&Object.hasOwn(t,s)&&(i[s]=n)}return i}function Ef(t){const{enabled:e,mode:i,showArrow:s,range:n,position:a,pagination:o,delay:r,wrapping:l,interaction:h,renderer:c,...d}=t,u=Rf(t,{enabled:e,showArrow:s,range:n,position:a,interaction:h,renderer:c,...d});return{chartTooltipOptions:Rf(t,{enabled:Of,showArrow:Of,range:Of,position:Of,mode:i,pagination:o,delay:r,wrapping:l,...d}),seriesTooltipOptions:u}}function Pf(t,e){if(null==e)return t;const{targets:i,...s}=e;return null!=(t=E(t,s)).targets&&null!=i&&(t.targets=B(t.targets,i)),t}var Bf={fills:(0,s.Uo)((0,s.O9)(2),(0,s.jk)((0,s.fd)({color:s.yW,stop:s.ai},"")),s.hz),fillMode:(0,s.KC)("continuous","discrete")},Ff={value:(0,s.mw)(s.ai),text:s.Yj,shape:(0,s.or)((0,s.KC)("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),s.E2),placement:(0,s.KC)("before","after","middle"),spacing:s.Ly,size:s.Ly,rotation:s.ai,...s.Fu,...s.AF,...s.mL},zf={value:(0,s.mw)(s.ai),text:s.Yj,shape:(0,s.or)((0,s.KC)("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),s.E2),placement:(0,s.KC)("inside","outside","middle"),spacing:s.Ly,size:s.Ly,rotation:s.ai,label:{...Am,spacing:s.Ly},...s.Fu,...s.AF,...s.mL},Gf={direction:(0,s.KC)("horizontal","vertical"),cornerMode:(0,s.KC)("container","item"),cornerRadius:s.Ly,thickness:s.Ly,segmentation:{enabled:s.zM,spacing:s.Ly,interval:{values:(0,s.jk)(s.ai),step:s.ai,count:s.ai}},bar:{enabled:s.zM,thickness:s.Ly,thicknessRatio:s.CG,...Bf,...s.Fu,...s.AF,...s.mL},label:{...Tm,text:s.Yj,spacing:s.Ly,avoidCollisions:s.zM,placement:(0,s.KC)("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:Rm,...z(Im,["listeners"])},_f={...Gf,...z(Cm,["listeners"]),type:(0,s.mw)((0,s.dY)("linear-gauge")),value:(0,s.mw)(s.ai),scale:{min:(0,s.Uo)(s.ai,(0,s.Xe)("max")),max:(0,s.Uo)(s.ai,(0,s.MM)("min")),label:{enabled:s.zM,formatter:s.E2,rotation:s.ai,spacing:s.Ly,minSpacing:s.Ly,placement:(0,s.KC)("before","after"),avoidCollisions:s.zM,format:Zg,...s.LV},interval:{values:(0,s.jk)(s.ai),step:s.ai},...Bf,...s.Fu,...s.AF,...s.mL},targets:(0,s.J$)(Ff,"target options array")};_f.margin=(0,s._L)(s.ai),_f.defaultColorRange=(0,s._L)((0,s.jk)(s.yW)),_f.defaultTarget=(0,s._L)({...Ff,value:s.ai,label:{...Am,spacing:s.ai}}),_f.defaultScale=(0,s._L)(_f.scale),_f.scale.defaultFill=(0,s._L)(s.yW);var jf={outerRadius:s.Ly,innerRadius:s.Ly,outerRadiusRatio:s.CG,innerRadiusRatio:s.CG,startAngle:s.ai,endAngle:s.ai,spacing:s.Ly,cornerMode:(0,s.KC)("container","item"),cornerRadius:s.Ly,scale:{min:(0,s.Uo)(s.ai,(0,s.Xe)("max")),max:(0,s.Uo)(s.ai,(0,s.MM)("min")),label:{enabled:s.zM,formatter:s.E2,rotation:s.ai,spacing:s.Ly,minSpacing:s.Ly,avoidCollisions:s.zM,format:Zg,...s.LV},interval:{values:(0,s.jk)(s.ai),step:s.ai},...Bf,...s.Fu,...s.AF,...s.mL},segmentation:{enabled:s.zM,spacing:s.Ly,interval:{values:(0,s.jk)(s.ai),step:s.ai,count:s.ai}},bar:{enabled:s.zM,...Bf,...s.Fu,...s.AF,...s.mL},needle:{enabled:s.zM,spacing:s.Ly,radiusRatio:s.CG,...s.Fu,...s.AF,...s.mL},label:{text:s.Yj,spacing:s.Ly,...Tm},secondaryLabel:{text:s.Yj,...Tm},tooltip:Rm,...Im},Wf={...jf,...Cm,type:(0,s.mw)((0,s.dY)("radial-gauge")),value:(0,s.mw)(s.ai),targets:(0,s.J$)(zf,"target options array")};Wf.defaultColorRange=(0,s._L)((0,s.jk)(s.yW)),Wf.defaultTarget=(0,s._L)({...zf,value:s.ai,label:{...Am,spacing:s.ai}}),Wf.scale.defaultFill=(0,s._L)(s.yW);var Vf={stroke:Hu},Kf={fill:qu},Yf={color:"white",fill:Hu},$f={color:Hu},Hf={color:Xu,fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"}},Uf={...Hf,fontSize:{$ref:"fontSize"},color:tp,fill:Qu,stroke:Ju,strokeWidth:1,divider:{stroke:ep,strokeWidth:1,strokeOpacity:.5}},Xf={...Vf,background:{fill:Zu,fillOpacity:.2},handle:{...Kf},text:{...$f},statistics:{...Uf}},Zf={line:{...Vf,handle:{...Kf},text:{...$f}},"horizontal-line":{...Vf,handle:{...Kf},axisLabel:{...Yf},text:{...$f}},"vertical-line":{...Vf,handle:{...Kf},axisLabel:{...Yf},text:{...$f}},"disjoint-channel":{...Vf,background:{fill:Zu,fillOpacity:.2},handle:{...Kf},text:{...$f}},"parallel-channel":{...Vf,background:{fill:Zu,fillOpacity:.2},handle:{...Kf},text:{...$f}},"fibonacci-retracement":{...Vf,strokes:Uu,rangeStroke:Hu,handle:{...Kf},text:{...$f,position:"center"},label:{...Hf,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...Vf,strokes:Uu,rangeStroke:Hu,handle:{...Kf},text:{...$f,position:"center"},label:{...Hf,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...Vf,...Hf,color:{$ref:"textColor"},handle:{...Kf},fill:Zu,fillOpacity:.2},comment:{...Hf,color:"white",fontWeight:700,handle:{...Kf},fill:Hu},note:{...Hf,color:op,fill:Hu,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...Kf},background:{fill:np,stroke:ap,strokeWidth:1}},text:{...Hf,handle:{...Kf}},arrow:{...Vf,handle:{...Kf},text:{...$f}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...Kf,stroke:Hu}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...Kf,stroke:Hu}},"date-range":{...Xf},"price-range":{...Xf},"date-price-range":{...Xf},"quick-date-price-range":{up:{...Vf,fill:Zu,fillOpacity:.2,handle:{...Kf},statistics:{...Uf,color:"#fff",fill:Zu,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...Vf,stroke:sp,fill:ip,fillOpacity:.2,handle:{...Kf,stroke:sp},statistics:{...Uf,color:"#fff",fill:ip,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},qf=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],Qf=[{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"}],Jf="range-area";function tx(t,e){return[{type:"candlestick",focusPriority:0,...t,...e}]}function ex(t,e){return e[t]??e.default}var ix={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:$u,lineDash:[0],label:{enabled:!1}}},sx={...ix,nice:!1},nx={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},ax={style:[{stroke:{$ref:"gridLineColor"}}],width:2},ox={number:{gridLine:ax},time:{gridLine:ax},category:{gridLine:ax}},rx={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},navigator:{enabled:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...sx,interval:{values:[0]}},log:{...sx},time:{...sx},category:{...ix}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...nx,position:{...nx.position,anchorTo:"pointer"},range:"nearest"},axes:ox},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:nx},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:nx}}},lx=Oc(function(t,e){return"string"==typeof t?{...e,baseTheme:t}:null!=t?{...t,baseTheme:lx(t.baseTheme,e)}:e});function hx(t){if(Array.isArray(t)&&0!==t.length){const e=t[0];if("number"==typeof e)return{data:t.map((t,e)=>({x:e,y:t})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(e))return{data:t.map(t=>({x:t[0],y:t[1],datum:t})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}return{data:t}}function cx(t){switch(t?.type){case"number":{const{type:e,min:i,max:s,reverse:n}=t;return Rf(t,{type:e,reverse:n,min:i,max:s})}case"time":{const{type:e,min:i,max:s,reverse:n}=t;return Rf(t,{type:e,reverse:n,min:i,max:s})}default:const{paddingInner:e,paddingOuter:i,reverse:s}=t??{};return Rf({...t,type:"category"},{type:"category",reverse:s,paddingInner:e,paddingOuter:i})}}function dx(t,e,i){const s={};return null!=t?.stroke&&(s.style=[{stroke:t?.stroke}],s.enabled??(s.enabled=!0)),null!=t?.strokeWidth&&(s.width=t?.strokeWidth,s.enabled??(s.enabled=!0)),"bar"===i.type&&"horizontal"!==i.direction&&(s.enabled??(s.enabled=!0)),null!=t?.visible&&(s.enabled=t.visible),s.enabled??(s.enabled=e),s}var ux=Oc((t,e,i)=>s=>{const n=s.datum[s.xKey],a=s.datum[s.yKey],o=null!=i?s.datum[i]:s.datum,r=e?.renderer?.({context:t,datum:o,xValue:n,yValue:a});if("string"==typeof r)return r;const l=r?.content??a.toFixed(2);return r?.title?{heading:void 0,title:void 0,data:[{label:r.title,value:l}]}:{heading:void 0,title:l,data:[]}}),px={chartType:(0,s.KC)("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),dateKey:s.Yj,openKey:s.Yj,highKey:s.Yj,lowKey:s.Yj,closeKey:s.Yj,volumeKey:s.Yj,navigator:s.zM,volume:s.zM,rangeButtons:s.zM,statusBar:s.zM,toolbar:s.zM,zoom:s.zM,sync:s.zM,theme:s.sw,container:s.sw,width:s.sw,height:s.sw,minWidth:s.sw,minHeight:s.sw,listeners:s.sw,initialState:s.sw,title:s.sw,data:s.YO},gx={theme:s.sw,container:s.sw,animation:s.sw,background:s.sw,contextMenu:s.sw,listeners:s.sw,locale:s.sw,width:s.sw,height:s.sw,minWidth:s.sw,minHeight:s.sw,title:s.sw,subtitle:s.sw,footnote:s.sw,padding:s.sw,tooltip:{...Rm,...wm.tooltip}};gx.overrideDevicePixelRatio=(0,s._L)(s.Ly);var mx=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],yx={visible:s.zM,reverse:s.zM,stroke:s.yW,strokeWidth:s.Ly},fx={context:s.sw,tooltip:s.sw,theme:s.sw,background:s.sw,container:s.sw,width:s.sw,height:s.sw,minWidth:s.sw,minHeight:s.sw,padding:s.sw,listeners:s.sw,locale:s.sw,data:s.sw,styleNonce:s.Yj,axis:(0,s.is)({number:{...yx,min:(0,s.Uo)(s.ai,(0,s.Xe)("max")),max:(0,s.Uo)(s.ai,(0,s.MM)("min"))},category:{...yx,paddingInner:s.CG,paddingOuter:s.CG},time:{...yx,min:(0,s.Uo)((0,s.or)(s.ai,s.p6),(0,s.Xe)("max")),max:(0,s.Uo)((0,s.or)(s.ai,s.p6),(0,s.MM)("min"))}},"axis options","category"),min:(0,s.Uo)(s.ai,(0,s.Xe)("max")),max:(0,s.Uo)(s.ai,(0,s.MM)("min")),crosshair:{enabled:s.zM,snap:s.zM,...s.AF,...s.mL},xKey:s.Yj,yKey:s.Yj},xx={type:"preset",name:"price-volume",enterprise:!0,options:px,create:function(t,e,i){const{dateKey:n="date",highKey:a="high",openKey:o="open",lowKey:r="low",closeKey:l="close",volumeKey:h="volume",chartType:c="candlestick",navigator:d=!1,volume:u=!0,rangeButtons:p=!0,statusBar:g=!0,toolbar:m=!0,zoom:y=!0,sync:f=!1,theme:x,data:b,...v}=t,S=function(t,e,i,n,a,o){const r={xKey:e,openKey:a,closeKey:o,highKey:i,lowKey:n},l={xKey:e,yKey:o},h={pickOutsideVisibleMinorAxis:!0};switch(t??"candlestick"){case"ohlc":return function(t,e){return[{type:"ohlc",focusPriority:0,...t,...e}]}(h,r);case"line":case"step-line":return function(t,e){return[{type:"line",focusPriority:0,...t,...e}]}(h,l);case"hlc":return function(t,e,{xKey:i,highKey:s,closeKey:n,lowKey:a}){return[{type:Jf,focusPriority:0,...t,xKey:i,yHighKey:s,yLowKey:n,fill:Pu,stroke:Ru},{type:Jf,focusPriority:0,...t,xKey:i,yHighKey:n,yLowKey:a,fill:Bu,stroke:Eu},{type:"line",...t,...e}]}(h,l,r);case"high-low":return function(t,{xKey:e,highKey:i,lowKey:s}){return[{type:"range-bar",...t,xKey:e,yHighKey:i,yLowKey:s,fill:zu,stroke:Fu,tooltip:{range:"nearest"},focusPriority:0,fastDataProcessing:!0}]}(h,r);case"candlestick":case"hollow-candlestick":return tx(h,r);default:return s.Vy.warnOnce(`unknown chart type: ${t}; expected one of: ${qf.join(", ")}`),tx(h,r)}}(c,n,a,r,o,l),M=function(t,e,i,s,n){return s?[{type:"bar",xKey:"date",yKey:n,tooltip:{enabled:!1},itemStyler({datum:s}){const{up:n,down:a}=t().palette;return{fill:s[e]<s[i]?n?.fill:a?.fill}},focusPriority:1,fastDataProcessing:!0,highlight:{enabled:!1}}]:[]}(i,o,l,u,h),k={navigator:{enabled:d,...u?{miniChart:{enabled:d,series:[{type:"line",xKey:n,yKey:h,stroke:up,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},D={annotations:{enabled:m,optionsToolbar:{enabled:m},snap:!0,toolbar:{enabled:m,buttons:Qf,padding:0},data:b,xKey:n,volumeKey:u?h:void 0}},w=g?{statusBar:{enabled:!0,data:b,highKey:a,openKey:o,lowKey:r,closeKey:l,volumeKey:u?h:void 0}}:null,I={zoom:{enabled:y,autoScaling:{enabled:!0},enableIndependentAxes:!0}},C={ranges:{enabled:p}},L=f?{sync:{enabled:f,nodeInteraction:!0,zoom:!0}}:null,A=u?[{type:"number",position:"left",keys:[h],label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percent",align:"end"}}]:[];return{theme:{baseTheme:"string"==typeof x?x:"ag-financial",...E("object"==typeof x?x:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:5},chartToolbar:{enabled:m},annotations:{...Zf},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}}}},bar:{series:{fillOpacity:.5}},line:{series:{marker:{enabled:!1},...ex(c,{hlc:{stroke:{$palette:"altNeutral.stroke"},strokeWidth:2},line:{stroke:{$palette:"neutral.stroke"}},"step-line":{stroke:{$palette:"neutral.stroke"},interpolation:{type:"step"}}})}},candlestick:{series:{...ex(c,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},"range-area":{series:{fillOpacity:.3,strokeWidth:2}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...M,...S],axes:[{type:"number",position:"right",keys:[o,l,a,r],crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...A,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:b,...D,...k,...w,...I,...C,...L,...v}}},bx={type:"preset",name:"gauge-preset",enterprise:!0,options:(0,s.is)({"linear-gauge":{...z(_f,["type"]),...gx},"radial-gauge":{...z(Wf,["type"]),...gx}},"gauge options"),create:function(t,e){if(t.listeners){const{nodeClick:e,nodeDoubleClick:i,...s}=t.listeners;t={...t,listeners:{seriesNodeClick:e,seriesNodeDoubleClick:i,...s}}}switch(t.type){case"radial-gauge":return function(t){const{animation:e,background:i,container:s,contextMenu:n,footnote:a,height:o,listeners:r,locale:l,minHeight:h,minWidth:c,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:m,width:y,type:f,cursor:x,nodeClickRange:b,tooltip:v={},value:S,scale:M={},startAngle:k,endAngle:D,highlightStyle:w,segmentation:I,bar:C,needle:L,targets:A,outerRadius:T,innerRadius:N,outerRadiusRatio:O,innerRadiusRatio:R,cornerRadius:E,cornerMode:P,label:B,secondaryLabel:F,spacing:z,...G}=t,{chartTooltipOptions:_,seriesTooltipOptions:j}=Ef(v),W=Rf(t,{animation:e,background:i,container:s,contextMenu:n,footnote:a,height:o,listeners:r,locale:l,minHeight:h,minWidth:c,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:m,tooltip:_,width:y}),V=Rf(t,{needle:null!=L?{enabled:!0,...L}:Of,startAngle:k,endAngle:D,scale:M,type:f,cursor:x,nodeClickRange:b,tooltip:j,value:S,highlightStyle:w,segmentation:I,bar:C,targets:A,outerRadius:T,innerRadius:N,outerRadiusRatio:O,innerRadiusRatio:R,cornerRadius:E,cornerMode:P,label:B,secondaryLabel:F,spacing:z,...G});return"context"in t&&(W.context=t.context),{...W,series:[V]}}(Pf(t,e));case"linear-gauge":return function(t){const{animation:e,background:i,container:s,contextMenu:n,footnote:a,height:o,listeners:r,locale:l,minHeight:h,minWidth:c,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:m,width:y,type:f,cursor:x,nodeClickRange:b,tooltip:v={},value:S,scale:M={},direction:k="vertical",thickness:D,highlightStyle:w,segmentation:I,bar:C,targets:L,cornerRadius:A,cornerMode:T,label:N,...O}=t,{chartTooltipOptions:R,seriesTooltipOptions:E}=Ef(v),P=Rf(t,{animation:e,background:i,container:s,contextMenu:n,footnote:a,height:o,listeners:r,locale:l,minHeight:h,minWidth:c,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:m,tooltip:R,width:y}),B=Rf(t,{scale:M,type:f,cursor:x,nodeClickRange:b,tooltip:E,value:S,direction:k,thickness:D,highlightStyle:w,segmentation:I,bar:C,targets:L,cornerRadius:A,cornerMode:T,label:N,...O});return"context"in t&&(P.context=t.context),{...P,series:[B]}}(Pf(t,e));default:return{}}}},vx={type:"preset",name:"sparkline",options:(0,s.is)({area:{...fx,...z(Fm,mx)},bar:{...fx,...z(oy,mx)},line:{...fx,...z(Cy,mx)}},"sparkline options"),create:function(t){const{background:e,container:i,height:s,listeners:n,locale:a,minHeight:o,minWidth:r,overrideDevicePixelRatio:l,padding:h,width:c,theme:d,data:u,crosshair:p,axis:g,min:m,max:y,tooltip:f,context:x,styleNonce:b,...v}=t,S=Rf(t,{background:e,container:i,height:s,listeners:n,locale:a,minHeight:o,minWidth:r,overrideDevicePixelRatio:l,padding:h,width:c,styleNonce:b,tooltip:Of,context:Of,data:Of,crosshair:Of,axis:Of,min:Of,max:Of,theme:Of}),{data:M,series:[k]=[],datumKey:D}=hx(u),w=v;null!=k&&Object.assign(w,k),w.tooltip={...f,renderer:ux(x,f,D)},S.theme=lx(d,rx),S.data=M,S.series=[w];const I="bar"!==w.type||"horizontal"!==w.direction,[C,L]=I?["bottom","left"]:["left","bottom"],A={...cx(g),position:C,...Rf(t,{crosshair:p})},T={type:"number",gridLine:dx(g,!1,t),position:L,...Rf(t,{min:m,max:y})};return S.axes=I?[T,A]:[A,T],S},processData:hx},Sx=["top","right","bottom","left"],Mx=class t extends gc{constructor(t,e){super(t,e),this.paired=!0,this.lastUpdateClipRect=void 0,this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}onAxisChange(t,e){super.onAxisChange(t,e),this.syncAxisChanges(t,e),null!=this.ctx&&this.ctx.zoomManager.updateAxes(t)}destroySeries(t){super.destroySeries(t),this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}getChartType(){return"cartesian"}setRootClipRects(t){const{seriesRoot:e,annotationRoot:i}=this;e.setClipRect(t),i.setClipRect(t)}async processData(){await super.processData(),"init"===this.syncStatus&&(this.syncStatus="domains-calculated"),this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const t of this.axes){const e=await this.getSyncedDomain(t);null!=e&&t.setDomains(e)}}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{clipSeries:s,seriesRect:n,visible:a}=this.updateAxes(t.layoutBox);this.seriesRoot.visible=a,this.seriesRect=n,this.animationRect=t.layoutBox;const{x:o,y:r}=n;if(t.width!==this.lastLayoutWidth||t.height!==this.lastLayoutHeight)for(const t of[e,i])t.translationX=Math.floor(o),t.translationY=Math.floor(r);else{const{translationX:t,translationY:s}=e;lr(this.id,"seriesRect",this.ctx.animationManager,[e,i],{translationX:t,translationY:s},{translationX:Math.floor(o),translationY:Math.floor(r)},{phase:"update"})}this.lastLayoutWidth=t.width,this.lastLayoutHeight=t.height;const l=n.clone().grow(this.seriesArea.padding),h=this.seriesArea.clip||s?l:void 0,{lastUpdateClipRect:c}=this;this.lastUpdateClipRect=h,this.ctx.animationManager.isActive()&&null!=c?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:c,to:l,onUpdate:t=>this.setRootClipRects(t),onComplete:()=>this.setRootClipRects(h)}):this.setRootClipRects(h),this.ctx.layoutManager.emitLayoutComplete(t,{axes:this.axes.map(t=>t.getLayoutState()),series:{visible:a,rect:n,paddedRect:l},clipSeries:s})}updateAxes(t){const{clipSeries:e,seriesRect:i,overflows:s}=this.resolveAxesLayout(t);for(const e of this.axes)e.update(),e.setCrossLinesVisible(!s),this.clipAxis(e,i,t);return{clipSeries:e,seriesRect:i,visible:!s}}resolveAxesLayout(t){let e,i,n=0;do{if(i=e??this.getDefaultState(),e=this.updateAxesPass(new Map(i.axisAreaWidths),t.clone()),n++>10){s.Vy.warn("Max iterations reached. Unable to stabilize axes layout.");break}}while(!this.isLayoutStable(e,i));return this.lastAreaWidths=e.axisAreaWidths,e}updateAxesPass(e,i){const n=new Map,a={};let o=!1,r=!1;for(const t of Sx){const e=this.seriesArea.padding[t],s=this.axes.findLast(e=>e.position===t);s?s.seriesAreaPadding=e:i.shrink(e,t)}const l=(e.get("left")??0)+(e.get("right")??0),h=(e.get("top")??0)+(e.get("bottom")??0),c=this.buildCrossLinePadding(e),d=c.left+c.right,u=c.top+c.bottom;i.width<=l+d||i.height<=h+u?o=!0:i.shrink(c);const p=i.clone().shrink(Object.fromEntries(e));for(const t of this.axes){const{position:e="left",direction:i}=t;this.sizeAxis(t,p,e);const s="y"===i,{primaryTickCount:o,bbox:l}=t.calculateLayout(t.nice?a[i]:void 0,this.padding);a[i]??(a[i]=o),r||(r=t.dataDomain.clipped||t.visibleRange[0]>0||t.visibleRange[1]<1),n.set(t.id,Math.ceil(t.thickness??(s?l?.width:l?.height)??0))}const g=(0,s.$z)(this.axes,t=>t.position??"left"),{width:m,height:y,pixelRatio:f}=this.ctx.scene,x=new Map,b=new Map;for(const[e,i]of(0,s.jO)(g)){let s="left"===e||"right"===e?y%f:m%f,a=0;for(const e of i??[]){b.set(e.id,s);const i=n.get(e.id)??0;a=Math.max(a,s+i),e.layoutConstraints.stacked&&(s+=i+t.AxesPadding)}x.set(e,Math.ceil(a))}for(const[t,e]of(0,s.jO)(g))this.positionAxes({axes:e??[],position:t,axisWidths:n,axisOffsets:b,axisAreaWidths:x,axisBound:i,seriesRect:p});return{clipSeries:r,seriesRect:p,axisAreaWidths:x,overflows:o}}buildCrossLinePadding(t){const e={top:0,right:0,bottom:0,left:0};this.axes.forEach(t=>{const{position:i,label:s}=t;t.crossLines?.forEach(t=>{var n;t instanceof ul&&(t.position=i??"top",(n=t.label).parallel??(n.parallel=s.parallel)),t.calculatePadding?.(e)})});for(const[i,n=0]of(0,s.jO)(e))e[i]=Math.max(n-(t.get(i)??0),0);return e}clampToOutsideSeriesRect(t,e,i,s){const n="x"===i?t.x:t.y,a="x"===i?t.width:t.height;return 1===s?Math.min(e,n+a):Math.max(e,n)}async getSyncedDomain(t){const e=this.modulesManager.getModule("sync");if(e?.enabled)return await e.getSyncedDomain(t)}syncAxisChanges(t,e){const i=this.modulesManager.getModule("sync");if(!i?.enabled)return;const s=new Set(e??[]);for(const e of t)s.delete(e);for(const t of s)i.removeAxis(t)}sizeAxis(t,e,i){const s=t instanceof Ic,n="left"===i||"right"===i,{width:a,height:o}=e,r=n?o:a;let l=0,h=r,{min:c,max:d}=this.ctx.zoomManager.getAxisZoom(t.id);const{width:u,unit:p,align:g}=t.layoutConstraints;h="px"===p?l+u:h*u/100,"end"===g&&(l=r-(h-l),h=r),n&&(s?[c,d]=[1-d,1-c]:[l,h]=[h,l]),t.range=[l,h],t.visibleRange=[c,d],t.gridLength=n?a:o}positionAxes(t){const{axes:e,axisBound:i,axisWidths:s,axisOffsets:n,axisAreaWidths:a,seriesRect:o,position:r}=t,l=a.get(r)??0;let h="x",c="y",d=1;"top"!==r&&"bottom"!==r||(h="y",c="x");let u=i[h];"right"!==r&&"bottom"!==r||(d=-1,u+="x"===h?i.width:i.height);for(const t of e){const e=a.get("x"===c?"left":"top")??0,r=s.get(t.id)??0,p=n.get(t.id)??0;t.gridPadding=l-p-r,t.translation[c]=i[c]+e,t.translation[h]=this.clampToOutsideSeriesRect(o,u+d*(p+r),h,d)}}shouldFlipXY(){return this.series.every(t=>t instanceof Yp&&t.shouldFlipXY())}getDefaultState(){const t=new Map;if(this.lastAreaWidths)for(const{position:e="left"}of this.axes){const i=this.lastAreaWidths.get(e);null!=i&&t.set(e,i)}return{axisAreaWidths:t,clipSeries:!1,overflows:!1}}isLayoutStable(t,e){if(e.overflows!==t.overflows||e.clipSeries!==t.clipSeries)return!1;for(const i of t.axisAreaWidths.keys())if(!e.axisAreaWidths.has(i))return!1;for(const[i,s]of e.axisAreaWidths.entries()){const e=t.axisAreaWidths.get(i);if((null!=s||null!=e)&&s!==e)return!1}return!0}clipAxis(t,e,i){const s=Math.ceil(t.gridLine?.width??0),n=Math.ceil(t.line?.width??0);let{width:a,height:o}=e;switch(a+="x"===t.direction?s:n,o+="y"===t.direction?s:n,t.clipGrid(e.x,e.y,a,o),t.position){case"left":case"right":t.clipTickLines(i.x,e.y-s,i.width+s,e.height+2*s);break;case"top":case"bottom":t.clipTickLines(e.x-s,i.y,e.width+2*s,i.height+s)}}};Mx.className="CartesianChart",Mx.type="cartesian",Mx.AxesPadding=15;var kx=Mx,Dx={mode:(0,s._L)((0,s.KC)("integrated","standalone")),container:s.Sc,theme:s.sw,series:s.YO,annotations:s.sw,navigator:s.sw,initialState:{chartType:s.Yj,annotations:s.sw,legend:(0,s.J$)({visible:s.zM,seriesId:s.Yj,itemId:s.Yj,legendItemName:s.Yj},"legend state array"),zoom:s.sw}},wx={...wm,...Dx,axes:s.sw,data:s.YO},Ix={...wm,...Dx,axes:s.sw,data:s.YO},Cx={...wm,...Dx,data:s.YO,topology:s.eW},Lx={...wm,...Dx,data:s.YO},Ax={...wm,...Dx,data:s.YO},Tx={...wm,...Dx,data:s.YO,nodes:s.YO},Nx={...wm,...Dx,data:s.YO},Ox=new Set(["number","log","time"]),Rx=t=>(0,s.Gv)(t)&&!Ox.has(t.type),Ex={type:"chart",name:"cartesian",options:wx,detect:Ql,create:(t,e)=>new kx(t,e),validate(t,e,i){const n=[];"histogram"===t?.series?.[0]?.type&&t?.axes?.some(Rx)&&(n.push(new s.yI("invalid","only continuous axis types when histogram series is used",t.axes,i,"axes")),t=z(t,["axes"]));const a=(0,s.tf)(t,e,i);return a.invalid.push(...n),a}},Px=()=>{throw new Error("Enterprise module placeholder cannot be initialised")},Bx={type:"chart",name:"flow-proportion",placeholder:!0,options:{},detect:ih,create:Px},Fx={type:"chart",name:"gauge",placeholder:!0,options:{},detect:nh,create:Px},zx={type:"chart",name:"hierarchy",placeholder:!0,options:{},detect:th,create:Px},Gx={type:"chart",name:"standalone",placeholder:!0,options:{},detect:sh,create:Px},_x={type:"chart",name:"topology",placeholder:!0,options:{},detect:eh,create:Px},jx=class extends Wl{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}layoutCrossLines(){const t=this.label.getSideFlag(),e=this.isAnySeriesActive(),{rotation:i,parallelFlipRotation:s,regularFlipRotation:n}=this.calculateRotations();this.crossLines.forEach(a=>{a.sideFlag=-t,a.direction=i===-Math.PI/2?"angle":"radius",a.parallelFlipRotation=s,a.regularFlipRotation=n,a.calculateLayout?.(e,this.reverse)})}updatePosition(){super.updatePosition();const t=Math.floor(this.translation.x),e=Math.floor(this.translation.y);this.tickLineGroup.translationX=t,this.tickLineGroup.translationY=e,this.tickLabelGroup.translationX=t,this.tickLabelGroup.translationY=e,this.crossLineRangeGroup.translationX=t,this.crossLineRangeGroup.translationY=e,this.crossLineLineGroup.translationX=t,this.crossLineLineGroup.translationY=e,this.crossLineLabelGroup.translationX=t,this.crossLineLabelGroup.translationY=e,this.tickLabelGroupSelection.each((t,e)=>({x:e.x,y:e.y,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,rotation:e.rotation}))}computeLabelsBBox(t,e){return null}computeRange(){}getAxisLinePoints(){}};r([Ct],jx.prototype,"shape",2),r([Ct],jx.prototype,"innerRadiusRatio",2);var Wx=class extends gc{constructor(t,e){super(t,e),this.padding=new ni(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(t=>t.update()),this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:i,paddedRect:i}})}updateAxes(t,e,i,s){const n=this.axes.find(t=>"angle"===t.direction),a=this.axes.find(t=>"radius"===t.direction);if(!(n instanceof jx&&a instanceof jx))return;const o=n.scale,r=a.innerRadiusRatio;n.innerRadiusRatio=r,n.computeRange(),n.gridLength=s,a.gridAngles=o.ticks({nice:n.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(t=>o.convert(t)),a.gridRange=n.range,a.range=[s,s*r],[n,a].forEach(s=>{s.translation.x=t.x+e,s.translation.y=t.y+i,s.calculateLayout()})}async computeCircle(t){const e=this.series.filter(Vx),i=this.axes.filter(Kx),n=(i,s,n)=>{this.updateAxes(t,i,s,n),e.forEach(t=>{t.centerX=i,t.centerY=s,t.radius=n});const a=e.filter(t=>"donut"===t.type||"pie"===t.type);if(a.length>1){const t=a.map(t=>{const e=t.getInnerRadius();return{series:t,innerRadius:e}}).sort((t,e)=>t.innerRadius-e.innerRadius);t.at(-1).series.surroundingRadius=void 0;for(let e=0;e<t.length-1;e++)t[e].series.surroundingRadius=t[e+1].innerRadius}},a=t.width/2,o=t.height/2,r=Math.max(0,Math.min(t.width,t.height)/2);let l=r;n(a,o,l);const h=async({hideWhenNecessary:h=!1}={})=>{const c=[];for(const n of(0,s.nl)(i,e)){const e=await n.computeLabelsBBox({hideWhenNecessary:h},t);e&&c.push(e)}if(0===c.length)return void n(a,o,r);const d=y.merge(c),u=this.refineCircle(d,l,t);n(u.centerX,u.centerY,u.radius),l=u.radius};await h(),await h(),await h(),await h({hideWhenNecessary:!0}),await h({hideWhenNecessary:!0});for(const n of(0,s.nl)(i,e))await n.computeLabelsBBox({hideWhenNecessary:!0},t);return{radius:l,centerX:a,centerY:o}}refineCircle(t,e,i){const s=-e,n=-e,a=e,o=e;let r=Math.max(0,s-t.x),l=Math.max(0,n-t.y),h=Math.max(0,t.x+t.width-a),c=Math.max(0,t.y+t.height-o);r=h=Math.max(r,h),l=c=Math.max(l,c);const d=i.width-r-h,u=i.height-l-c;let p=Math.min(d,u)/2;const g=.5*i.width/2,m=.5*i.height/2,y=Math.min(g,m);if(p<y){p=y;const t=r+h;if(2*p+(l+c)>i.height){const t=i.height-2*p;2*Math.min(l,c)>t?(l=t/2,c=t/2):l>c?l=t-c:c=t-l}if(2*p+t>i.width){const t=i.width-2*p;2*Math.min(r,h)>t?(r=t/2,h=t/2):r>h?r=t-h:h=t-r}}const f=r+2*p+h,x=l+2*p+c;return{centerX:(i.width-f)/2+r+p,centerY:(i.height-x)/2+l+p,radius:p}}};function Vx(t){return t instanceof hf}function Kx(t){return t instanceof jx}Wx.className="PolarChart",Wx.type="polar";var Yx={type:"chart",name:"polar",options:Ix,detect:Jl,create:(t,e)=>new Wx(t,e),validate(t,e,i){const n=[],a=t?.series?.[0]?.type;"pie"!==a&&"donut"!==a||t?.axes&&(n.push(new s.Bk([],t.axes,i,"axes")),t=z(t,["axes"]));const o=(0,s.tf)(t,e,i);return o.invalid.push(...n),o}},$x={...rm,...hm(s.ai),type:(0,s.mw)((0,s.dY)("number")),label:im,crosshair:lm(!0)},Hx={...rm,...hm(s.ai),type:(0,s.mw)((0,s.dY)("log")),base:(0,s.Uo)(s.MX,(0,s.W$)(t=>1!==t,"not equal to 1")),label:im,crosshair:lm(!0)},Ux={...rm,...hm((0,s.or)(s.ai,s.p6),!0),type:(0,s.mw)((0,s.dY)("time")),label:sm,parentLevel:am,crosshair:lm(!0)};Ux.paddingInner=s.Ly,Ux.paddingOuter=s.Ly,Ux.groupPaddingInner=s.Ly;var Xx={...rm,type:(0,s.mw)((0,s.dY)("category")),label:em,paddingInner:s.CG,paddingOuter:s.CG,groupPaddingInner:s.CG,crosshair:lm()},Zx={...rm,type:(0,s.mw)((0,s.dY)("grouped-category")),label:em,crosshair:lm(),paddingInner:s.CG,groupPaddingInner:s.CG,depthOptions:(0,s.J$)({label:{enabled:s.zM,avoidCollisions:s.zM,rotation:s.ai,spacing:s.ai,...s.LV},tick:{enabled:s.zM,stroke:s.yW,width:s.Ly}},"depth options objects array")},qx={...rm,...hm((0,s.or)(s.ai,s.p6),!0),type:(0,s.mw)((0,s.dY)("unit-time")),unit:(0,s.or)((0,s.hR)(ba),Xg),label:sm,parentLevel:am,paddingInner:s.CG,paddingOuter:s.CG,groupPaddingInner:s.CG,crosshair:lm(!0)},Qx=(t,e)=>{const i={};for(const n of new Set([...Object.keys(t),...Object.keys(e)])){const a=t[n],o=e[n];(0,s.Qd)(a)&&(0,s.Qd)(o)?i[n]=Qx(a,o):i[n]=null!=a&&null!=o&&a!==o?(0,s.or)(a,o):a??o}return i},Jx=[Ex,{type:"axis",name:"number",chartType:"cartesian",options:$x,create:t=>new jd(t)},{type:"axis",name:"log",chartType:"cartesian",options:Hx,create:t=>new Wd(t)},{type:"axis",name:"time",chartType:"cartesian",options:Qx(Ux,qx),create:t=>new Kd(t)},{type:"axis",name:"category",chartType:"cartesian",options:Xx,create:t=>new Ic(t)},{type:"axis",name:"grouped-category",chartType:"cartesian",options:Zx,create:t=>new Od(t)},{type:"axis",name:"unit-time",chartType:"cartesian",options:qx,create:t=>new $d(t)},Gm,ly,fy,ky,Ay,By,Yx,ff,If,Bx,Fx,zx,Gx,_x,xx,bx,vx],tb={isEnterprise:!1};function eb(t,e){let i=[];const n=nh(t),a=ql(t),o=a?Qo.get(a):"unknown";for(const e of $o)if("unknown"===o||e.chartTypes.includes(o))if("root"===e.type||"legend"===e.type){const s=t[e.optionsKey];if(null==s)continue;e.optionsInnerKey?s[e.optionsInnerKey]&&(i.push(`${e.optionsKey}.${e.optionsInnerKey}`),delete s[e.optionsInnerKey]):(i.push(e.optionsKey),delete t[e.optionsKey])}else if("axis"===e.type){if(!("axes"in t)||!(0,s.cy)(t.axes)||!t.axes?.some(t=>t.type===e.identifier))continue;i.push(`axis[type=${e.identifier}]`),t.axes=t.axes.filter(t=>t.type!==e.identifier)}else if("axis-option"===e.type){if(!("axes"in t)||!(0,s.cy)(t.axes)||!t.axes?.some(t=>t[e.optionsKey]))continue;i.push(`axis.${e.optionsKey}`),t.axes.forEach(t=>{t[e.optionsKey]&&delete t[e.optionsKey]})}else if("series"===e.type){if(e.community)continue;if(!(0,s.cy)(t.series)||!t.series?.some(t=>t.type===e.identifier))continue;i.push(`series[type=${e.identifier}]`),t.series=t.series.filter(t=>t.type!==e.identifier)}else if("series-option"===e.type){if(!(0,s.cy)(t.series)||!t.series?.some(t=>t[e.optionsKey]))continue;i.push(`series.${e.optionsKey}`),t.series.forEach(t=>{t[e.optionsKey]&&delete t[e.optionsKey]})}if(i.length&&!e){n&&(i=["AgCharts.createGauge"]);let e="ag-charts-enterprise",a="https://www.ag-grid.com/charts/javascript/installation/";"integrated"===t.mode&&(e="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",a="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),s.Vy.warnOnce([`unable to use these enterprise features as '${e}' has not been loaded:`,"",...i,"",`See: ${a}`].join("\n"))}}function ib(t){return t?.up||t?.down||t?.neutral?"user-full":t?.fills||t?.strokes?"user-indexed":"inbuilt"}var sb="white",nb={get cartesian(){return{seriesTypes:Qo.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:Qo.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:Qo.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:Qo.topologyTypes,commonOptions:[]}},get"flow-proportion"(){return{seriesTypes:Qo.flowProportionTypes,commonOptions:[]}},get standalone(){return{seriesTypes:Qo.standaloneTypes,commonOptions:[]}},get gauge(){return{seriesTypes:Qo.gaugeTypes,commonOptions:[]}}},ab={"radial-gauge":!0,"linear-gauge":!0};function ob(t){return!0===ab[t]}var rb={millisecond:"%H:%M:%S.L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e %B",month:"%B",year:"%Y"},lb="%H:%M:%S.%L",hb="%H:%M:%S",cb="%H:%M",db="%H:%M",ub=Object.values(nb).reduce((t,{commonOptions:e})=>t.concat(e),[]),pb=class t{static getDefaultColors(){return{fills:Xy,fillsFallback:Object.values(Xy),strokes:Zy,sequentialColors:yp(Xy),divergingColors:[Xy.ORANGE,Xy.YELLOW,Xy.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:yt.interpolate([yt.fromHexString(Xy.BLUE),yt.fromHexString("#cbdef5")],8).map(t=>t.toString()),secondDivergingColors:[Xy.GREEN,Xy.YELLOW,Xy.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:Xy.GREEN,stroke:Zy.GREEN},down:{fill:Xy.RED,stroke:Zy.RED},neutral:{fill:Xy.GRAY,stroke:Zy.GRAY},altUp:{fill:Xy.BLUE,stroke:Zy.BLUE},altDown:{fill:Xy.ORANGE,stroke:Zy.ORANGE},altNeutral:{fill:Xy.GRAY,stroke:Zy.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:[.675]},backgroundColor:sb,borderColor:{$foregroundBackgroundMix:[.818]},foregroundColor:"#464646",fontFamily:"Verdana, sans-serif",fontSize:12,fontWeight:400,gridLineColor:{$foregroundBackgroundAccentMix:[.93,.085]},padding:20,subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:[.975]},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:"#181d1f",chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},inputBackgroundColor:{$ref:"backgroundColor"},inputTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"backgroundColor"}}}static getAxisDefaults(t,{title:e,time:i}){const s="modern"===i?rb:void 0;return E(t,e&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},"off"!==i&&{label:{format:{millisecond:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},lb,s?.millisecond]},second:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},hb,s?.second]},minute:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},cb,s?.minute]},hour:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},db,s?.hour]},day:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},"%e",s?.day]},month:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},"%b",s?.month]},year:{$if:[{$path:["../../parentLevel/enabled",{$path:"../enabled"}]},"%Y",s?.year]}}},parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},avoidCollisions:{$path:"../../label/avoidCollisions"},format:{millisecond:{$path:["../../../label/format/millisecond",lb]},second:{$path:["../../../label/format/second",hb]},minute:{$path:["../../../label/format/minute",cb]},hour:{$path:["../../../label/format/hour",db]},day:{$path:["../../../label/format/day","%e"]},month:{$path:["../../../label/format/month","%b"]},year:{$path:["../../../label/format/year","%Y"]}}},tick:{enabled:{$path:"../../tick/enabled"},size:{$path:"../../tick/size"},width:{$path:"../../tick/width"},stroke:{$path:"../../tick/stroke"}}}},{label:{enabled:!0,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,size:6,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,style:[{stroke:{$ref:"gridLineColor"},lineDash:[]}]},crossLines:{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.1,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"}}}})}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",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.4166666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:Nu,textAlign:Ou},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Nu,textAlign:Ou},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Nu,textAlign:Ou},legend:{position:"bottom",orientation:{$if:[{$or:[{$eq:[{$path:"./position"},"left"]},{$eq:[{$path:"./position"},"right"]}]},"vertical","horizontal"]},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:Lu,delay:0,pagination:!1},overlays:{darkTheme:Lu},listeners:{}}}constructor(t={}){const{overrides:e,palette:i,params:s}=Ge(t),n=this.createChartConfigPerChartType(this.getDefaults()),a={};e&&this.mergeOverrides(n,a,e);const{fills:o,strokes:r,sequentialColors:l,...h}=this.getDefaultColors();this.palette=V(E(i,{fills:Object.values(o),strokes:Object.values(r),sequentialColors:Object.values(l),...h})),this.paletteType=ib(i),this.params=E(s,this.getPublicParameters()),this.config=V(this.templateTheme(n)),this.presets=V(a)}mergeOverrides(t,e,i){for(const{seriesTypes:e,commonOptions:s}of Object.values(nb)){const n={...i.common};for(const t of ub)s.includes(t)||delete n[t];for(const i of e){const e=i;ob(e)||(t[e]=E(n,t[e]))}}Qo.seriesTypes.forEach(s=>{const n=s,a=i[n];ob(n)?e[n]=a:t[n]=E(a,t[n])})}createChartConfigPerChartType(t){for(const[e,{seriesTypes:i}]of(0,s.jO)(nb)){const s=tr.get(e);for(const e of i)t[e]??(t[e]=Ge(s))}return t}getDefaults(){const e=(e,i)=>{const s={},n={axes:{},...Xo.getThemeTemplates(),...this.getChartDefaults(),...tr.get(e)};for(const e of i){s[e]=E(er.getThemeTemplate(e),s[e]??Ge(n));const{axes:i}=s[e];for(const e of Yo.keys())i[e]=E(i[e],Yo.getThemeTemplate(e),t.axisDefault[e])}return s};return E(e("cartesian",Qo.cartesianTypes),e("polar",Qo.polarTypes),e("hierarchy",Qo.hierarchyTypes),e("topology",Qo.topologyTypes),e("flow-proportion",Qo.flowProportionTypes),e("standalone",Qo.standaloneTypes),e("gauge",Qo.gaugeTypes))}static applyTemplateTheme(t,e,i){if((0,s.cy)(t))for(let e=0;e<t.length;e++){const s=t[e];"symbol"==typeof s&&i?.has(s)&&(t[e]=i.get(s))}else for(const e of Object.keys(t)){const s=t[e];"symbol"==typeof s&&i?.has(s)&&(t[e]=i.get(s))}}templateTheme(e,i=!0){const s=i?Ge(e):e,n=this.getTemplateParameters();return je(s,t.applyTemplateTheme,void 0,void 0,n),s}getDefaultColors(){return t.getDefaultColors()}getPublicParameters(){return t.getDefaultPublicParameters()}getTemplateParameters(){const t=new Map;t.set(Lu,!1),t.set(Au,"#d9d9d9"),t.set(Tu,"#00000080"),t.set($u,"#aaa"),t.set(Nu,"block"),t.set(Ou,"center"),t.set(Uu,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),t.set(Yu,sb),t.set(Hu,Xy.BLUE),t.set(Zu,Xy.BLUE),t.set(Xu,Xy.BLUE),t.set(qu,sb),t.set(Qu,"#fafafa"),t.set(Ju,"#ddd"),t.set(tp,"#000"),t.set(ep,"#181d1f"),t.set(ip,"#e35c5c"),t.set(sp,"#e35c5c"),t.set(np,"#fafafa"),t.set(ap,"#ddd"),t.set(op,"#000"),t.set(rp,"top"),t.set(lp,!1);const e=this.getDefaultColors();return t.set(Ru,this.palette.up?.stroke??e.up.stroke),t.set(Pu,this.palette.up?.fill??e.up.fill),t.set(Eu,this.palette.down?.stroke??e.down.stroke),t.set(Bu,this.palette.down?.fill??e.down.fill),t.set(Fu,this.palette.neutral?.stroke??e.neutral.stroke),t.set(zu,this.palette.neutral?.fill??e.neutral.fill),t.set(Gu,this.palette.altUp?.stroke??e.up.stroke),t.set(ju,this.palette.altUp?.fill??e.up.fill),t.set(_u,this.palette.altDown?.stroke??e.down.stroke),t.set(Wu,this.palette.altDown?.fill??e.down.fill),t.set(Vu,this.palette.altNeutral?.fill??e.altNeutral.fill),t.set(Ku,this.palette.altNeutral?.stroke??e.altNeutral.stroke),t}};pb.axisDefault={number:pb.getAxisDefaults({keys:[],line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:"off"}),log:pb.getAxisDefaults({keys:[],base:10,line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:"off"}),category:pb.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:lp},crosshair:{enabled:!1}},{title:!0,time:"off"}),"grouped-category":pb.getAxisDefaults({keys:[],tick:{enabled:!0,stroke:Au},label:{spacing:10,rotation:270},paddingInner:.4,groupPaddingInner:.2,crosshair:{enabled:!1}},{title:!0,time:"off"}),time:pb.getAxisDefaults({keys:[],gridLine:{enabled:lp},crosshair:{enabled:!0}},{title:!0,time:"legacy"}),"ordinal-time":pb.getAxisDefaults({keys:[],groupPaddingInner:0,label:{autoRotate:!1},gridLine:{enabled:lp},crosshair:{enabled:!0}},{title:!0,time:"legacy"}),"unit-time":pb.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!1},gridLine:{enabled:lp},crosshair:{enabled:!0},parentLevel:{enabled:!0}},{title:!0,time:"modern"}),"angle-category":pb.getAxisDefaults({label:{spacing:5},gridLine:{enabled:lp},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}},{title:!1,time:"off"}),"angle-number":pb.getAxisDefaults({label:{spacing:5},gridLine:{enabled:lp}},{title:!1,time:"off"}),"radius-category":pb.getAxisDefaults({positionAngle:0,line:{enabled:!1}},{title:!0,time:"off"}),"radius-number":pb.getAxisDefaults({positionAngle:0,line:{enabled:!1},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}},{title:!0,time:"off"})};var gb=pb,mb="#192232",yb={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},fb={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},xb=class extends gb{getDefaultColors(){return{fills:yb,fillsFallback:Object.values(yb),strokes:fb,sequentialColors:yp(yb),divergingColors:[yb.ORANGE,yb.YELLOW,yb.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[yb.GREEN,yb.YELLOW,yb.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:yb.GREEN,stroke:fb.GREEN},down:{fill:yb.RED,stroke:fb.RED},neutral:{fill:yb.GRAY,stroke:fb.GRAY},altUp:{fill:yb.BLUE,stroke:fb.BLUE},altDown:{fill:yb.ORANGE,stroke:fb.ORANGE},altNeutral:{fill:yb.GRAY,stroke:fb.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:[.263]},backgroundColor:mb,borderColor:{$foregroundBackgroundMix:[.784]},chromeBackgroundColor:{$foregroundBackgroundMix:[.93]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundAccentMix:[.743,.01]},subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.57]},chromeTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$foregroundBackgroundAccentMix:[.35,.1]}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Lu,!0),t.set(Yu,mb),t.set(Au,"#7f8389"),t.set(Hu,yb.BLUE),t.set(Xu,"#fff"),t.set(Zu,yb.BLUE),t.set(qu,mb),t.set(Qu,"#28313e"),t.set(Ju,"#4b525d"),t.set(tp,"#fff"),t.set(ep,"#fff"),t.set(np,"#28313e"),t.set(ap,"#4b525d"),t.set(op,"#fff"),t}constructor(t){super(t)}},bb={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},vb={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},Sb=class extends xb{getDefaultColors(){return{...super.getDefaultColors(),fills:{...bb},fillsFallback:Object.values({...bb}),strokes:{...vb},sequentialColors:yp(bb),divergingColors:[bb.GREEN,bb.BLUE,bb.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:bb.GREEN,stroke:vb.GREEN},down:{fill:bb.RED,stroke:vb.RED},neutral:{fill:bb.BLUE,stroke:vb.BLUE},altUp:{fill:bb.GREEN,stroke:vb.GREEN},altDown:{fill:bb.RED,stroke:vb.RED},altNeutral:{fill:bb.GRAY,stroke:vb.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.88,.01]},padding:0}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Hu,bb.BLUE),t.set(Zu,bb.BLUE),t.set(Nu,"overlay"),t.set(Ou,"left"),t.set(rp,"bottom"),t.set(lp,!0),t}},Mb={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},kb={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},Db=class extends gb{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Mb},fillsFallback:Object.values({...Mb}),strokes:{...kb},sequentialColors:yp(Mb),divergingColors:[Mb.GREEN,Mb.BLUE,Mb.RED],up:{fill:Mb.GREEN,stroke:kb.GREEN},down:{fill:Mb.RED,stroke:kb.RED},neutral:{fill:Mb.BLUE,stroke:kb.BLUE},altUp:{fill:Mb.GREEN,stroke:kb.GREEN},altDown:{fill:Mb.RED,stroke:kb.RED},altNeutral:{fill:Mb.GRAY,stroke:kb.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.94,.01]},padding:0}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Hu,Mb.BLUE),t.set(Zu,Mb.BLUE),t.set(Nu,"overlay"),t.set(Ou,"left"),t.set(rp,"bottom"),t.set(lp,!0),t}},wb={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Ib={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},Cb=class extends xb{getDefaultColors(){return{...super.getDefaultColors(),fills:wb,fillsFallback:Object.values(wb),strokes:Ib,sequentialColors:yp(wb),divergingColors:[wb.ORANGE,wb.YELLOW,wb.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[wb.GREEN,wb.YELLOW,wb.RED],up:{fill:wb.GREEN,stroke:Ib.GREEN},down:{fill:wb.RED,stroke:Ib.RED},neutral:{fill:wb.GRAY,stroke:Ib.GRAY},altUp:{fill:wb.BLUE,stroke:Ib.BLUE},altDown:{fill:wb.RED,stroke:Ib.RED},altNeutral:{fill:wb.GRAY,stroke:Ib.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Hu,wb.BLUE),t.set(Zu,wb.BLUE),t}},Lb={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Ab={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},Tb=class extends gb{getDefaultColors(){return{...super.getDefaultColors(),fills:Lb,fillsFallback:Object.values(Lb),strokes:Ab,sequentialColors:yp(Lb),divergingColors:[Lb.ORANGE,Lb.YELLOW,Lb.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[Lb.GREEN,Lb.YELLOW,Lb.RED],up:{fill:Lb.GREEN,stroke:Ab.GREEN},down:{fill:Lb.RED,stroke:Ab.RED},neutral:{fill:Lb.GRAY,stroke:Ab.GRAY},altUp:{fill:Lb.BLUE,stroke:Ab.BLUE},altDown:{fill:Lb.RED,stroke:Ab.RED},altNeutral:{fill:Lb.GRAY,stroke:Ab.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Hu,Lb.BLUE),t.set(Zu,Lb.BLUE),t}},Nb={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Ob={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},Rb=class extends xb{getDefaultColors(){return{fills:Nb,fillsFallback:Object.values(Nb),strokes:Ob,sequentialColors:yp(Nb),divergingColors:[Nb.BLUE,Nb.RED],hierarchyColors:[],secondSequentialColors:[Nb.BLUE,Nb.PURPLE,Nb.MAGENTA,Nb.PINK,Nb.RED,Nb.ORANGE,Nb.YELLOW,Nb.GREEN],secondDivergingColors:[Nb.BLUE,Nb.RED],secondHierarchyColors:[],up:{fill:Nb.GREEN,stroke:Ob.GREEN},down:{fill:Nb.RED,stroke:Ob.RED},neutral:{fill:Nb.GRAY,stroke:Ob.GRAY},altUp:{fill:Nb.BLUE,stroke:Ob.BLUE},altDown:{fill:Nb.RED,stroke:Ob.RED},altNeutral:{fill:Nb.GRAY,stroke:Ob.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Hu,Nb.BLUE),t.set(Zu,Nb.BLUE),t}},Eb={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Pb={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},Bb=class extends gb{getDefaultColors(){return{...super.getDefaultColors(),fills:Eb,fillsFallback:Object.values(Eb),strokes:Pb,sequentialColors:yp(Eb),divergingColors:[Eb.BLUE,Eb.RED],hierarchyColors:[],secondSequentialColors:[Eb.BLUE,Eb.PURPLE,Eb.MAGENTA,Eb.PINK,Eb.RED,Eb.ORANGE,Eb.YELLOW,Eb.GREEN],secondDivergingColors:[Eb.BLUE,Eb.RED],secondHierarchyColors:[],up:{fill:Eb.GREEN,stroke:Pb.GREEN},down:{fill:Eb.RED,stroke:Pb.RED},neutral:{fill:Eb.GRAY,stroke:Pb.GRAY},altUp:{fill:Eb.BLUE,stroke:Pb.BLUE},altDown:{fill:Eb.RED,stroke:Pb.RED},altNeutral:{fill:Eb.GRAY,stroke:Pb.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Hu,Eb.BLUE),t.set(Zu,Eb.BLUE),t}},Fb={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},zb={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},Gb=class extends xb{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Fb,RED:Fb.ORANGE},fillsFallback:Object.values({...Fb,RED:Fb.ORANGE}),strokes:{...zb,RED:zb.ORANGE},sequentialColors:yp({...Fb,RED:Fb.ORANGE}),divergingColors:[Fb.ORANGE,Fb.YELLOW,Fb.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Fb.GREEN,Fb.YELLOW,Fb.ORANGE],up:{fill:Fb.GREEN,stroke:zb.GREEN},down:{fill:Fb.ORANGE,stroke:zb.ORANGE},neutral:{fill:Fb.GRAY,stroke:zb.GRAY},altUp:{fill:Fb.BLUE,stroke:zb.BLUE},altDown:{fill:Fb.ORANGE,stroke:zb.ORANGE},altNeutral:{fill:Fb.GRAY,stroke:zb.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Hu,Fb.BLUE),t.set(Zu,Fb.BLUE),t}},_b={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},jb={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},Wb=class extends gb{getDefaultColors(){return{...super.getDefaultColors(),fills:{..._b,RED:_b.ORANGE},fillsFallback:Object.values({..._b,RED:_b.ORANGE}),strokes:{...jb,RED:jb.ORANGE},sequentialColors:yp({..._b,RED:_b.ORANGE}),divergingColors:[_b.ORANGE,_b.YELLOW,_b.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[_b.GREEN,_b.YELLOW,_b.ORANGE],secondHierarchyColors:[],up:{fill:_b.GREEN,stroke:jb.GREEN},down:{fill:_b.ORANGE,stroke:jb.ORANGE},neutral:{fill:jb.GRAY,stroke:jb.GRAY},altUp:{fill:_b.BLUE,stroke:jb.BLUE},altDown:{fill:_b.ORANGE,stroke:jb.ORANGE},altNeutral:{fill:_b.GRAY,stroke:jb.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Hu,_b.BLUE),t.set(Zu,_b.BLUE),t}},Vb={...rm,type:(0,s.mw)((0,s.dY)("ordinal-time")),paddingInner:s.CG,paddingOuter:s.CG,groupPaddingInner:s.CG,label:sm,parentLevel:am,interval:hm((0,s.or)(s.ai,s.p6),!0).interval,crosshair:lm(!0)},Kb={...om,...hm(s.ai),type:(0,s.mw)((0,s.dY)("angle-number")),crossLines:(0,s.J$)(Qg),startAngle:s.ai,endAngle:s.ai,label:{...tm,orientation:(0,s.KC)("fixed","parallel","perpendicular"),format:Zg}},Yb={innerRadiusRatio:s.CG},$b={...om,...Yb,type:(0,s.mw)((0,s.dY)("angle-category")),shape:(0,s.KC)("polygon","circle"),crossLines:(0,s.J$)(Qg),startAngle:s.ai,endAngle:s.ai,paddingInner:s.CG,groupPaddingInner:s.CG,label:{...tm,orientation:(0,s.KC)("fixed","parallel","perpendicular")}},Hb={...om,...hm(s.ai),type:(0,s.mw)((0,s.dY)("radius-number")),shape:(0,s.KC)("polygon","circle"),positionAngle:s.ai,innerRadiusRatio:s.CG,crossLines:(0,s.J$)({...Qg,label:{...qg,positionAngle:s.ai}},"cross-line options"),title:{enabled:s.zM,text:s.Yj,spacing:s.Ly,formatter:s.E2,...s.LV},label:{...tm,format:Zg}},Ub={...om,type:(0,s.mw)((0,s.dY)("radius-category")),positionAngle:s.ai,innerRadiusRatio:s.CG,paddingInner:s.CG,paddingOuter:s.CG,groupPaddingInner:s.CG,label:tm,crossLines:(0,s.J$)({...Qg,label:{...qg,positionAngle:s.ai}},"cross-line options"),title:{enabled:s.zM,text:s.Yj,spacing:s.Ly,formatter:s.E2,...s.LV}},Xb={lineStyle:(0,s.KC)("solid","dashed","dotted"),...s.mL},Zb={...s.Fu,...s.AF,...s.mL},qb={visible:s.zM,locked:s.zM,handle:Zb,...s.LV},Qb={position:(0,s.KC)("top","center","bottom"),alignment:(0,s.KC)("left","center","right"),...s.LV},Jb={position:(0,s.KC)("top","inside","bottom"),alignment:(0,s.KC)("left","center","right"),...s.LV},tv={enabled:s.zM,cornerRadius:s.Ly,formatter:s.E2,...s.LV,...s.Fu,...s.AF,...s.mL},ev={visible:s.zM,...Xb,...s.AF},iv={divider:s.AF,...s.Fu,...s.AF,...s.LV},sv={handle:Zb,statistics:iv,...Xb,...s.Fu,...s.AF},nv={visible:s.zM,locked:s.zM,extendStart:s.zM,extendEnd:s.zM,handle:Zb,text:Qb,...Xb,...s.AF},av={visible:s.zM,locked:s.zM,axisLabel:tv,handle:Zb,text:Qb,...Xb,...s.AF},ov={visible:s.zM,locked:s.zM,extendStart:s.zM,extendEnd:s.zM,handle:Zb,text:Jb,background:s.Fu,...Xb,...s.AF},rv={...ov},lv={...ov,middle:ev},hv={label:s.LV,showFill:s.zM,isMultiColor:s.zM,strokes:(0,s.jk)(s.yW),rangeStroke:s.yW,bands:(0,s.KC)(4,6,10),...nv},cv={...s.Fu,...s.AF,...qb},dv={...s.Fu,...s.AF,...qb},uv={...s.Fu,...s.AF,...qb,background:{...s.Fu,...s.AF}},pv={visible:s.zM,locked:s.zM,handle:Zb,...s.Fu},gv={visible:s.zM,locked:s.zM,extendStart:s.zM,extendEnd:s.zM,handle:Zb,text:Qb,background:s.Fu,statistics:iv,...Xb,...s.AF},mv={visible:s.zM,up:sv,down:sv},yv={enabled:s.zM,axesButtons:{enabled:s.zM,axes:(0,s.KC)("x","y","xy")},toolbar:{enabled:s.zM,padding:s.Ly,buttons:(0,s.J$)({...Dm,value:(0,s.KC)("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:s.zM,buttons:(0,s.jk)((0,s.or)((0,s.fd)({...Dm,value:(0,s.mw)((0,s.KC)("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),(0,s.fd)({...Dm,value:(0,s.mw)((0,s.KC)("lock")),checkedOverrides:Dm})))}};yv.data=(0,s._L)(s.YO),yv.xKey=(0,s._L)(s.Yj),yv.volumeKey=(0,s._L)(s.Yj),yv.snap=(0,s._L)(s.zM);var fv={direction:(0,s.KC)("horizontal","vertical"),showInMiniChart:s.zM,cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly,whisker:{...s.AF,...s.mL},cap:{lengthRatio:s.CG}}),whisker:{...s.AF,...s.mL},cap:{lengthRatio:s.CG},tooltip:Rm,...Im,...s.Fu,...s.AF,...s.mL},xv={cornerRadius:s.Ly,wick:{...s.AF,...s.mL},...s.Fu,...s.AF,...s.mL},bv={item:{up:xv,down:xv},itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly,wick:{...s.AF,...s.mL}}),showInMiniChart:s.zM,tooltip:Rm,...Im},vv={fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),label:{spacing:s.Ly,maxWidth:s.Ly,...Am},link:{tension:s.CG,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,tension:s.CG}),...s.Fu,...s.AF,...s.mL},node:{width:s.Ly,spacing:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL}),...s.Fu,...s.AF,...s.mL},tooltip:Rm,...Im},Sv={direction:(0,s.KC)("horizontal","vertical"),fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),showInMiniChart:s.zM,label:{spacing:s.Ly,placement:(0,s.KC)("before","middle","after"),...Am},stageLabel:{rotation:s.ai,spacing:s.Ly,minSpacing:s.Ly,placement:(0,s.KC)("before","after"),avoidCollisions:s.zM,itemStyler:(0,s.YI)({...s.LV,spacing:s.ai}),format:s.Yj,...Am},tooltip:Rm,...Im,...z(s.Fu,["fill"]),...z(s.AF,["stroke"]),...s.mL},Mv={direction:(0,s.KC)("horizontal","vertical"),fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),showInMiniChart:s.zM,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL}),spacingRatio:s.CG,crisp:s.zM,dropOff:{enabled:s.zM,...s.Fu,...s.AF,...s.mL},stageLabel:{rotation:s.ai,spacing:s.Ly,minSpacing:s.Ly,placement:(0,s.KC)("before","after"),avoidCollisions:s.zM,itemStyler:(0,s.YI)({...s.LV,spacing:s.ai}),format:s.Yj,...Am},label:Am,tooltip:Rm,shadow:Em,...Im,...z(s.Fu,["fill"]),...z(s.AF,["stroke"]),...s.mL},kv={title:s.Yj,textAlign:(0,s.KC)("left","center","right"),verticalAlign:(0,s.KC)("top","middle","bottom"),itemPadding:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF}),showInMiniChart:s.zM,label:Tm,tooltip:Rm,...Im,...s.AF},Dv={showInMiniChart:s.zM,itemStyler:(0,s.YI)({...s.AF,...s.mL}),item:{up:{...s.AF,...s.mL},down:{...s.AF,...s.mL}},tooltip:Rm,...Im},wv={maxStrokeWidth:s.Ly,itemStyler:(0,s.YI)({...s.AF,...s.mL}),sizeDomain:(0,s.jk)(s.Ly),label:Am,tooltip:Rm,...Im,...s.AF,...s.mL,highlightStyle:{...Im.highlightStyle,...s.AF}},Iv={...s.AF,...s.mL},Cv={colorRange:(0,s.jk)(s.yW),maxSize:s.Ly,sizeDomain:(0,s.jk)(s.Ly),label:{placement:(0,s.KC)("top","bottom","left","right"),...Am},tooltip:Rm,...Im,...z(Lm,["enabled"]),highlightStyle:{...Im.highlightStyle,...s.Fu,...s.AF}},Lv={colorRange:(0,s.jk)(s.yW),padding:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL}),label:Tm,tooltip:Rm,...Im,...s.Fu,...s.AF,...s.mL,highlightStyle:{...Im.highlightStyle,...s.Fu,...s.AF}},Av={...Im,...s.Fu,...s.AF,...s.mL},Tv={cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),label:Am,tooltip:Rm,...Im,...s.Fu,...s.AF,...s.mL},Nv={direction:(0,s.KC)("horizontal","vertical"),aspectRatio:s.Ly,spacing:s.Ly,reverse:s.zM,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL}),fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),label:Am,stageLabel:{spacing:s.Ly,placement:(0,s.KC)("before","after"),...Am},tooltip:Rm,shadow:Em,...Im,...z(s.Fu,["fill"]),...z(s.AF,["stroke"]),...s.mL},Ov={connectMissingData:s.zM,marker:Lm,label:Am,tooltip:Rm,...Im,...s.Fu,...s.AF,...s.mL},Rv={connectMissingData:s.zM,marker:Lm,label:Am,tooltip:Rm,...Im,...s.AF,...s.mL},Ev={cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),label:Am,tooltip:Rm,...Im,...s.Fu,...s.AF,...s.mL},Pv={cornerRadius:s.Ly,columnWidthRatio:s.CG,maxColumnWidthRatio:s.CG,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),label:Am,tooltip:Rm,...Im,...s.Fu,...s.AF,...s.mL},Bv={showInMiniChart:s.zM,connectMissingData:s.zM,interpolation:Pm,label:{...Am,padding:s.Ly,placement:(0,s.KC)("inside","outside")},marker:Lm,tooltip:Rm,shadow:Em,...Im,...s.Fu,...s.AF,...s.mL},Fv={direction:(0,s.KC)("horizontal","vertical"),showInMiniChart:s.zM,cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),label:{...Am,padding:s.Ly,placement:(0,s.KC)("inside","outside")},tooltip:Rm,shadow:Em,...Im,...s.Fu,...s.AF,...s.mL},zv={fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),label:{...Am,spacing:s.Ly},link:{itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL}),...s.Fu,...s.AF,...s.mL},node:{width:s.Ly,spacing:s.Ly,alignment:(0,s.KC)("left","center","right","justify"),itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL}),...s.Fu,...s.AF,...s.mL},tooltip:Rm,...Im},Gv={fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),colorRange:(0,s.jk)(s.yW),sectorSpacing:s.Ly,cornerRadius:s.Ly,padding:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF}),label:{spacing:s.Ly,...Tm},secondaryLabel:Tm,tooltip:Rm,...Im,...z(s.Fu,["fill"]),...z(s.AF,["stroke"]),highlightStyle:{label:{color:s.yW},secondaryLabel:{color:s.yW},...s.Fu,...s.AF}},_v={fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),colorRange:(0,s.jk)(s.yW),itemStyler:(0,s.YI)({...s.Fu,...s.AF}),group:{gap:s.Ly,padding:s.Ly,cornerRadius:s.Ly,textAlign:(0,s.KC)("left","center","right"),interactive:s.zM,label:{...Am,spacing:s.Ly},...s.Fu,...s.AF},tile:{gap:s.Ly,padding:s.Ly,cornerRadius:s.Ly,textAlign:(0,s.KC)("left","center","right"),verticalAlign:(0,s.KC)("top","middle","bottom"),label:{...Am,spacing:s.Ly,lineHeight:s.Ly,minimumFontSize:s.Ly,wrapping:(0,s.KC)("never","always","hyphenate","on-space"),overflowStrategy:(0,s.KC)("ellipsis","hide")},secondaryLabel:{...Am,lineHeight:s.Ly,minimumFontSize:s.Ly,wrapping:(0,s.KC)("never","always","hyphenate","on-space"),overflowStrategy:(0,s.KC)("ellipsis","hide")},...s.Fu,...s.AF},tooltip:Rm,...Im,highlightStyle:{group:{label:{color:s.yW},...s.Fu,...s.AF},tile:{label:{color:s.yW},secondaryLabel:{color:s.yW},...s.Fu,...s.AF}}},jv={name:s.Yj,cornerRadius:s.Ly,itemStyler:(0,s.YI)({...s.Fu,...s.AF,...s.mL,cornerRadius:s.Ly}),label:{...Am,padding:s.Ly,placement:(0,s.KC)("inside-start","inside-center","inside-end","outside-start","outside-end")},tooltip:Rm,shadow:Em,...s.Fu,...s.AF,...s.mL},Wv={direction:(0,s.KC)("horizontal","vertical"),showInMiniChart:s.zM,item:{positive:jv,negative:jv,total:jv},line:{enabled:s.zM,...s.AF,...s.mL},tooltip:Rm,...Im},Vv=(0,s.fd)({__type:(0,s.mw)((0,s.dY)("date")),value:(0,s.or)(s.Yj,s.ai)},"a serializable date object"),Kv={width:s.Ly,height:s.Ly,grip:s.zM,fill:s.yW,stroke:s.yW,strokeWidth:s.Ly,cornerRadius:s.Ly},Yv={enabled:s.zM,height:s.Ly,spacing:s.Ly,cornerRadius:s.ai,mask:{fill:s.yW,fillOpacity:s.CG,stroke:s.yW,strokeWidth:s.Ly},minHandle:Kv,maxHandle:Kv,miniChart:{enabled:s.zM,padding:{top:s.Ly,bottom:s.Ly},label:{enabled:s.zM,avoidCollisions:s.zM,spacing:s.Ly,format:Zg,formatter:s.E2,interval:{minSpacing:s.Ly,maxSpacing:s.Ly,values:s.YO,step:s.ai},...s.LV},series:s.sw}},$v={number:{...z($x,["type","crossLines"]),top:z($x,["type","crossLines","position"]),right:z($x,["type","crossLines","position"]),bottom:z($x,["type","crossLines","position"]),left:z($x,["type","crossLines","position"]),crossLines:z(Jg,["type"])},log:{...z(Hx,["type","crossLines"]),top:z(Hx,["type","crossLines","position"]),right:z(Hx,["type","crossLines","position"]),bottom:z(Hx,["type","crossLines","position"]),left:z(Hx,["type","crossLines","position"]),crossLines:z(Jg,["type"])},category:{...z(Xx,["type","crossLines"]),top:z(Xx,["type","crossLines","position"]),right:z(Xx,["type","crossLines","position"]),bottom:z(Xx,["type","crossLines","position"]),left:z(Xx,["type","crossLines","position"]),crossLines:z(Jg,["type"])},time:{...z(Ux,["type","crossLines"]),top:z(Ux,["type","crossLines","position"]),right:z(Ux,["type","crossLines","position"]),bottom:z(Ux,["type","crossLines","position"]),left:z(Ux,["type","crossLines","position"]),crossLines:z(Jg,["type"])},"grouped-category":{...z(Zx,["type"]),top:z(Zx,["type","position"]),right:z(Zx,["type","position"]),bottom:z(Zx,["type","position"]),left:z(Zx,["type","position"]),crossLines:z(Jg,["type"])},"unit-time":{...z(qx,["type","crossLines"]),top:z(qx,["type","crossLines","position"]),right:z(qx,["type","crossLines","position"]),bottom:z(qx,["type","crossLines","position"]),left:z(qx,["type","crossLines","position"]),crossLines:z(Jg,["type"])},"ordinal-time":{...z(Vb,["type","crossLines"]),top:z(Vb,["type","crossLines","position"]),right:z(Vb,["type","crossLines","position"]),bottom:z(Vb,["type","crossLines","position"]),left:z(Vb,["type","crossLines","position"]),crossLines:z(Jg,["type"])}},Hv={"angle-category":{...z($b,["type","crossLines"]),crossLines:z(Qg,["type"])},"angle-number":{...z(Kb,["type","crossLines"]),crossLines:z(Qg,["type"])},"radius-category":{...z(Ub,["type","crossLines"]),crossLines:{...z(Qg,["type"]),label:{...qg,positionAngle:s.ai}}},"radius-number":{...z(Hb,["type","crossLines"]),crossLines:{...z(Qg,["type"]),label:{...qg,positionAngle:s.ai}}}},Uv={visible:s.zM};function Xv(t,e){const i={};for(const s of Reflect.ownKeys(t))i[s]=e(t[s],s,t);return i}var Zv=Xv({common:{...wm,navigator:Yv,axes:{...$v,...Hv},annotations:{...yv,line:nv,"horizontal-line":av,"vertical-line":av,"disjoint-channel":rv,"parallel-channel":lv,"fibonacci-retracement":hv,"fibonacci-retracement-trend-based":hv,callout:cv,comment:dv,note:uv,text:qb,arrow:nv,"arrow-up":pv,"arrow-down":pv,"date-range":gv,"price-range":gv,"date-price-range":gv,"quick-date-price-range":mv},chartToolbar:{enabled:s.zM},initialState:{legend:(0,s.J$)({visible:s.zM,seriesId:s.Yj,itemId:s.Yj,legendItemName:s.Yj},"legend state array"),zoom:{rangeX:{start:(0,s.or)(s.ai,Vv),end:(0,s.or)(s.ai,Vv)},rangeY:{start:(0,s.or)(s.ai,Vv),end:(0,s.or)(s.ai,Vv)},ratioX:{start:s.CG,end:s.CG},ratioY:{start:s.CG,end:s.CG},autoScaledAxes:(0,s.jk)((0,s.dY)("y"))}}},line:{...wm,axes:$v,series:Iy,navigator:Yv,...Uv},scatter:{...wm,axes:$v,series:Ry,navigator:Yv,...Uv},bubble:{...wm,axes:$v,series:gy,navigator:Yv,...Uv},area:{...wm,axes:$v,series:Bm,navigator:Yv,...Uv},bar:{...wm,axes:$v,series:ay,navigator:Yv,...Uv},"box-plot":{...wm,axes:$v,series:fv,navigator:Yv,...Uv},candlestick:{...wm,axes:$v,series:bv,navigator:Yv,...Uv},"cone-funnel":{...wm,axes:$v,series:Sv,navigator:Yv,...Uv},funnel:{...wm,axes:$v,series:Mv,navigator:Yv,...Uv},ohlc:{...wm,axes:$v,series:Dv,navigator:Yv,...Uv},histogram:{...wm,axes:z($v,["category","grouped-category","ordinal-time","unit-time"]),series:vy,navigator:Yv,...Uv},heatmap:{...wm,axes:$v,series:kv,navigator:Yv,...Uv},waterfall:{...wm,axes:$v,series:Wv,navigator:Yv,...Uv},"range-bar":{...wm,axes:$v,series:Fv,navigator:Yv,...Uv},"range-area":{...wm,axes:$v,series:Bv,navigator:Yv,...Uv},donut:{...wm,series:gf,navigator:Yv,...Uv},pie:{...wm,series:uf,navigator:Yv,...Uv},"radar-line":{...wm,axes:Hv,series:Rv,navigator:Yv,...Uv},"radar-area":{...wm,axes:Hv,series:Ov,navigator:Yv,...Uv},"radial-bar":{...wm,axes:Hv,series:Ev,navigator:Yv,...Uv},"radial-column":{...wm,axes:Hv,series:Pv,navigator:Yv,...Uv},nightingale:{...wm,axes:Hv,series:Tv,navigator:Yv,...Uv},sunburst:{...wm,series:Gv,navigator:Yv,...Uv},treemap:{...wm,series:_v,navigator:Yv,...Uv},"map-shape":{...wm,series:Lv,navigator:Yv,...Uv},"map-line":{...wm,series:wv,navigator:Yv,...Uv},"map-marker":{...wm,series:Cv,navigator:Yv,...Uv},"map-shape-background":{...wm,series:Av,navigator:Yv,...Uv},"map-line-background":{...wm,series:Iv,navigator:Yv,...Uv},sankey:{...wm,series:zv,navigator:Yv,...Uv},chord:{...wm,series:vv,navigator:Yv,...Uv},pyramid:{...wm,series:Nv,navigator:Yv,...Uv},"radial-gauge":{...wm,...jf,targets:z(zf,["value"]),tooltip:{...jf.tooltip,...wm.tooltip}},"linear-gauge":{...wm,...Gf,targets:z(Ff,["value"]),tooltip:{...Gf.tooltip,...wm.tooltip}}},function t(e,i){if((0,s.Bm)(i))return e;if((0,s.Tn)(e))return(0,s.or)(e,s.I_,s.Bm);if((0,s.Gv)(e))return(0,s.or)((0,s.fd)(s.ie in e?Xv(e,e=>(0,s.Gv)(e)?Xv(e,t):e):Xv(e,t)),s.I_,s.Bm);throw new Error(`Invalid theme override value: ${String(e)}`)}),qv={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Qv={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},Jv=class extends xb{getDefaultColors(){return{fills:qv,fillsFallback:Object.values(qv),strokes:Qv,sequentialColors:yp(qv),divergingColors:[qv.ORANGE,qv.YELLOW,qv.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[qv.GREEN,qv.YELLOW,qv.RED],secondHierarchyColors:[],up:{fill:qv.GREEN,stroke:Qv.GREEN},down:{fill:qv.RED,stroke:Qv.RED},neutral:{fill:qv.GRAY,stroke:Qv.GRAY},altUp:{fill:qv.BLUE,stroke:Qv.BLUE},altDown:{fill:qv.ORANGE,stroke:Qv.ORANGE},altNeutral:{fill:qv.GRAY,stroke:Qv.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Hu,qv.BLUE),t.set(Zu,qv.BLUE),t}},tS={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},eS={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},iS=class extends gb{getDefaultColors(){return{...super.getDefaultColors(),fills:tS,fillsFallback:Object.values(tS),strokes:eS,sequentialColors:yp(tS),divergingColors:[tS.ORANGE,tS.YELLOW,tS.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[tS.GREEN,tS.YELLOW,tS.RED],secondHierarchyColors:[],up:{fill:tS.GREEN,stroke:eS.GREEN},down:{fill:tS.RED,stroke:eS.RED},neutral:{fill:tS.GRAY,stroke:eS.GRAY},altUp:{fill:tS.BLUE,stroke:eS.BLUE},altDown:{fill:tS.ORANGE,stroke:eS.ORANGE},altNeutral:{fill:tS.GRAY,stroke:eS.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Hu,tS.BLUE),t.set(Zu,tS.BLUE),t}},sS=Oc(()=>new gb),nS=x.create(!0,"perf"),aS=(t,e,i)=>{nS("[CACHE] ChartTheme",t,e.name,i)},oS={"ag-default-dark":Oc(()=>new xb),"ag-sheets-dark":Oc(()=>new Gb,aS),"ag-polychroma-dark":Oc(()=>new Rb,aS),"ag-vivid-dark":Oc(()=>new Jv,aS),"ag-material-dark":Oc(()=>new Cb,aS),"ag-financial-dark":Oc(()=>new Sb,aS),"ag-default":sS,"ag-sheets":Oc(()=>new Wb,aS),"ag-polychroma":Oc(()=>new Bb,aS),"ag-vivid":Oc(()=>new iS,aS),"ag-material":Oc(()=>new Tb,aS),"ag-financial":Oc(()=>new Db,aS)},rS=Oc(function(t){if(t instanceof gb)return t;if(!function(t){const{invalid:e}=(0,s.tf)({theme:t},{theme:(0,s.or)(hS,s.Ik)});for(const t of e)s.Vy.warnOnce(String(t));return 0===e.length}(t))return sS();if(null==t||"string"==typeof t){const e=oS[t??"ag-default"];if(e)return e();throw new Error(`Cannot find theme \`${t}\`.`)}const{cleared:e,invalid:i}=(0,s.tf)(function(t){if(!(0,s.Gv)(t)||!(0,s.Gv)(t.baseTheme))return t;let e,i,n=t;const a=[];for(;"object"==typeof n;)e??(e=n.palette),i??(i=n.params),n.overrides&&a.push(n.overrides),n=n.baseTheme;return{baseTheme:n,overrides:E(...a),params:i,palette:e}}(t),lS,"theme");for(const t of i)s.Vy.warnOnce(String(t));const n=e?.baseTheme?rS(e.baseTheme):sS();return e?new n.constructor(e):n},aS),lS={baseTheme:(0,s.or)(s.Yj,s.Ik),overrides:Zv,params:{accentColor:s.yW,axisColor:s.yW,backgroundColor:s.yW,borderColor:s.yW,foregroundColor:s.yW,fontFamily:s.jj,fontSize:s.ai,fontWeight:(0,s.or)(s.Yj,s.ai),gridLineColor:s.yW,padding:s.ai,subtleTextColor:s.yW,textColor:s.yW,chromeBackgroundColor:s.yW,chromeFontFamily:s.jj,chromeFontSize:s.ai,chromeFontWeight:(0,s.or)(s.Yj,s.ai),chromeSubtleTextColor:s.yW,chromeTextColor:s.yW,inputBackgroundColor:s.yW,inputTextColor:s.yW,crosshairLabelBackgroundColor:s.yW,crosshairLabelTextColor:s.yW},palette:{fills:(0,s.jk)(s.Jp),strokes:(0,s.jk)(s.yW),up:{fill:(0,s.or)(s.yW,s.MP),stroke:s.yW},down:{fill:(0,s.or)(s.yW,s.MP),stroke:s.yW},neutral:{fill:(0,s.or)(s.yW,s.MP),stroke:s.yW}}},hS=(0,s.KC)("ag-default","ag-default-dark","ag-sheets","ag-sheets-dark","ag-polychroma","ag-polychroma-dark","ag-vivid","ag-vivid-dark","ag-material","ag-material-dark","ag-financial","ag-financial-dark"),cS=t=>`'${t}'`,dS=class t{constructor(e,i,s,n,a,o,r=!1){this.themeParameters={},this.optionMetadata=a??{},this.processedOverrides=s??{};let l,h,c,d,u,p,g,m=null;e instanceof t?(m=e,this.specialOverrides=m.specialOverrides,void 0===o&&(o=Fe(m.userOptions,i,t.JSON_DIFF_OPTS)),this.userOptions=Ge(P(o,m.userOptions),{...t.OPTIONS_CLONE_OPTS,seen:[]})):(this.userOptions=Ge(e??i,{...t.OPTIONS_CLONE_OPTS,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...n})),r&&this.removeLeftoverSymbols(this.userOptions),!r&&void 0!==o&&t.isFastPathDelta(o)&&null!=m?(({activeTheme:l,processedOptions:h,defaultAxes:c,fastDelta:d}=this.fastSetup(o,m)),u=m.themeParameters,p=m.annotationThemes):(t.perfDebug("ChartOptions.slowSetup()"),({activeTheme:l,processedOptions:h,defaultAxes:c,themeParameters:u,annotationThemes:p,googleFonts:g}=this.slowSetup(s,o,r))),this.activeTheme=l,this.processedOptions=h,this.defaultAxes=c,this.fastDelta=d??void 0,this.themeParameters=u,this.annotationThemes=p,this.googleFonts=g,x.inDevelopmentMode(()=>V(this))}static isFastPathDelta(e){for(const i of Object.keys(e??{}))if(!this.FAST_PATH_OPTIONS.has(i))return t.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return t.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}fastSetup(e,i){const{activeTheme:n,defaultAxes:a,processedOptions:o}=i,{presetType:r}=this.optionMetadata;if(null!=r&&null!=e?.data){const t=s.sy.getPresetModule(r);if(t?.processData){const{series:i,data:s}=t.processData(e.data);e=E({series:i,data:s},e)}}this.fastSeriesSetup(e,o);const l=E(e,o);return t.debug("ChartOptions.fastSetup() - processed options",l),{activeTheme:n,defaultAxes:a,processedOptions:l,fastDelta:e}}fastSeriesSetup(t,e){t?.series&&(t.series?.every((t,i)=>ze(t,e.series?.[i]??{}))?delete t.series:t.series=t.series.map((t,i)=>P(t,e.series?.[i]??{})))}slowSetup(e,i,n=!1){let a=Ge(this.userOptions,t.OPTIONS_CLONE_OPTS);i&&(a=E(i,a),n&&this.removeLeftoverSymbols(a));const{presetType:o}=this.optionMetadata;if(null!=o){const e=s.sy.getPresetModule(o);if(e){const{validate:i=s.tf}=e,n=a,o=a.type,r=null!=o?rS(a.theme).presets[o]:void 0,{cleared:l,invalid:h}=i(n,e.options,"");h.forEach(t=>s.Vy.warn(t)),(0,s.eh)(h,"")?a={}:(t.debug(">>> AgCharts.createOrUpdate() - applying preset",l),a=e.create(l,r,()=>this.activeTheme))}}this.soloSeriesIntegrity(a),tb.isEnterprise||eb(a);const r=rS(a.theme);if(null!=o&&r.templateTheme(a,!1),this.validateSeriesOptions(a),this.chartDef=s.sy.detectChartDefinition(a),!this.chartDef.placeholder){const{validate:t=s.tf}=this.chartDef,{cleared:e,invalid:i}=t(a,this.chartDef.options,"");i.forEach(t=>s.Vy.warn(t)),a=e}this.validateAxesOptions(a),this.removeDisabledOptions(a);const l=this.optionsType(a),{annotations:c={},axes:d={},series:u,...p}=this.getSeriesThemeConfig(l,r),[g,m]=this.splitAnnotationsOptions(c),y=Ge(m),f=this.getDefaultAxes(a,u);let x=E(e,a,g,p,f);this.processAxesOptions(x,d),this.processSeriesOptions(x,r),x=Ge(x,t.OPTIONS_CLONE_OPTS),(Ql(x)||sh(x)||function(t){const e=ql(t);return Jl(t)&&"pie"!==e&&"donut"!==e}(x))&&null==x.legend?.enabled&&(x.legend??(x.legend={}),x.legend.enabled=x.series.length>1),this.enableConfiguredOptions(x,a);let b=this.processFonts(x);const v=r.params;return b=this.processFonts(v,b),v.__palette=Ge(r.palette),v.__palette.type=(0,s.Gv)(a.theme)?ib(a.theme?.palette):"inbuilt",this.resolveThemeOperations(v,v),this.resolveThemeOperations(v,x),this.resolveThemeOperations(v,y),r.templateTheme(x,!1),function(t){const e="mode"in t&&"integrated"===t.mode;for(const i of h.byType("root","legend")){const s=t[i.optionsKey],n=null!=s&&!1===s.enabled,a=!("removable"in i)||!0===i.removable||"standalone-only"===i.removable&&!e;n&&a&&delete t[i.optionsKey]}}(x),tb.isEnterprise||eb(x,!0),this.validateSeriesOptions(x),this.validateAxesOptions(x),this.validatePluginOptions(x),this.processMiniChartSeriesOptions(x),x.loadGoogleFonts||b.clear(),t.debug(()=>["ChartOptions.slowSetup() - processed options",Ge(x)]),{activeTheme:r,processedOptions:x,defaultAxes:f,themeParameters:v,annotationThemes:y,googleFonts:b}}validatePluginOptions(t){for(const e of s.sy.listModulesByType(s.nR.Plugin)){const i=e.name;if(i in t&&(!e.chartType||e.chartType===this.chartDef?.name)){const{cleared:n,invalid:a}=(0,s.tf)(t[i],e.options,e.name);a.forEach(t=>s.Vy.warn(t)),t[i]=n}}}validateSeriesOptions(t){const e=this.chartDef?.name,i=[],n=t.series?.length??0;let a;for(let o=0;o<n;o++){const n=`series[${o}]`,r=t.series[o],l=s.sy.getSeriesModule(r.type??"line");if(null==l){a??(a=(0,s.lp)(Array.from(s.sy.listModulesByType(s.nR.Series)).filter(t=>!e||t.chartType===e).map(t=>t.name),"or",cS)),s.Vy.warn(`Unknown type \`${r.type}\` at \`${n}.type\`; expecting ${a}, ignoring.`);continue}if(e&&l.chartType!==e){s.Vy.warn(`Series type \`${l.name}\` at \`${n}.type\` is not supported by chart type \`${e}\`, ignoring.`);continue}const{validate:h=s.tf}=l,{cleared:c,invalid:d}=h(r,l.options,n);d.forEach(t=>s.Vy.warn(t)),(0,s.eh)(d,n)||i.push(c)}t.series=i}validateAxesOptions(t){if(!("axes"in t)||!t.axes)return;const e=this.chartDef?.name,i=[],n=t.axes.length??0;let a;for(let o=0;o<n;o++){const n=`axes[${o}]`;let r=t.axes[o];"time"===r.type&&null!=r.unit&&(r={...r,type:"unit-time"});const l=s.sy.getAxisModule(r.type);if(null==l){a??(a=(0,s.lp)(Array.from(s.sy.listModulesByType(s.nR.Axis)).filter(t=>t.chartType===e).map(t=>t.name),"or",cS)),s.Vy.warn(`Unknown type \`${r.type}\` at  \`${n}.type\`; expecting one of ${a}, ignoring all axes options.`),delete t.axes;break}if(l.chartType!==e){s.Vy.warn(`Axis type \`${l.name}\` at  \`${n}.type\` is not supported by chart type \`${e}\`, ignoring.`);break}const{validate:h=s.tf}=l,{cleared:c,invalid:d}=h(r,l.options,n);d.forEach(t=>s.Vy.warn(t)),(0,s.eh)(d,n)||i.push(c)}t.axes=i}diffOptions(e){return this===e?{}:null==e?this.processedOptions:this.fastDelta??Fe(e.processedOptions,this.processedOptions,t.JSON_DIFF_OPTS)}getSeriesThemeConfig(t,e){return e?.config[t]??{}}getDefaultAxes(t,e){const i=this.optionsType(t),s=t.series?.find(t=>(t.type??"line")===i)??{},n=er.cloneDefaultAxes(i);return Ke(n,{},void 0,E(s,e)),n}optionsType(t){return t.series?.[0]?.type??"line"}splitAnnotationsOptions(t){const{axesButtons:e=null,enabled:i=null,optionsToolbar:s=null,toolbar:n=null,...a}=t;return null==e&&null==i&&null==s&&null==n?[{},a]:[{annotations:{axesButtons:e,enabled:i,optionsToolbar:s,toolbar:n}},a]}processAxesOptions(t,e){"axes"in t&&(t.axes=t.axes?.map(t=>{const{crossLines:i,...s}=E(e[t.type]?.[t.position],e[t.type]);t.crossLines&&(t.crossLines=B(t.crossLines,i));const n=s.gridLine?.style;t.gridLine?.style&&n?.length&&(t.gridLine.style=t.gridLine.style.map((t,e)=>null!=t.stroke||null!=t.lineDash?E(t,n.at(e%n.length)):t));const{top:a,right:o,bottom:r,left:l,...h}=E(t,s);return h}))}processSeriesOptions(t,e){const i=this.getTooltipPositionDefaults(t),n=t.series?.map(n=>{n.type??(n.type="line");const{innerLabels:a,...o}=this.getSeriesThemeConfig(n.type,e).series??{},r=s.sy.getSeriesModule(n.type),l=Boolean(r?.options.tooltip),h=Boolean(r?.options.visible),c=l&&this.getTooltipRangeDefaults(t,n.type),d=E(this.getSeriesGroupingOptions(n),n,l&&i,c,o,h&&{visible:!0});return d.innerLabels&&(d.innerLabels=B(d.innerLabels,a)),d});t.series=this.setSeriesGroupingOptions(n??[])}processMiniChartSeriesOptions(t){let e=t.navigator?.miniChart?.series;null!=e&&(e=e.map(t=>(t.type??(t.type="line"),t)),t.navigator.miniChart.series=this.setSeriesGroupingOptions(e))}resolveThemeOperations(e,i){const s=Ke(i,e,new Set(["palette","data","theme"]));t.debug("ChartOptions.resolveTheme()",s)}getSeriesGroupingOptions(t){const e=er.isGroupable(t.type),i=er.isStackable(t.type),n=er.isStackedByDefault(t.type);t.grouped&&!e&&s.Vy.warnOnce(`unsupported grouping of series type "${t.type}".`),!t.stacked&&!t.stackGroup||i||s.Vy.warnOnce(`unsupported stacking of series type "${t.type}".`);let{grouped:a,stacked:o}=t;return o??(o=(n||null!=t.stackGroup)&&!(e&&a)),a??(a=!0),{stacked:i&&o,grouped:e&&a&&!(i&&o)}}setSeriesGroupingOptions(e){const i=this.getSeriesGrouping(e);t.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const s={},n=i.reduce((t,e)=>{var i;return"default"===e.groupType||(t[i=e.seriesType]??(t[i]=0),t[e.seriesType]+="stack"===e.groupType?1:e.series.length),t},{});return i.flatMap(t=>{var e;switch(s[e=t.seriesType]??(s[e]=0),t.groupType){case"stack":{const e=s[t.seriesType]++;return t.series.map((i,s)=>Object.assign(i,{seriesGrouping:{groupId:t.groupId,groupIndex:e,groupCount:n[t.seriesType],stackIndex:s,stackCount:t.series.length}}))}case"group":return t.series.map(e=>Object.assign(e,{seriesGrouping:{groupId:t.groupId,groupIndex:s[t.seriesType]++,groupCount:n[t.seriesType],stackIndex:0,stackCount:0}}))}return t.series}).map(({stacked:t,grouped:e,...i})=>i)}getSeriesGroupId(t){return[t.type,t.xKey,t.stacked?t.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(t){const e=new Map;return t.reduce((t,i)=>{const s=i.type;if(i.stacked||i.grouped){const n=this.getSeriesGroupId(i);if(!e.has(n)){const a={groupType:i.stacked?"stack":"group",seriesType:s,series:[],groupId:n};e.set(n,a),t.push(a)}e.get(n).series.push(i)}else t.push({groupType:"default",seriesType:s,series:[i],groupId:"__default__"});return t},[])}getTooltipPositionDefaults(t){const e=t.tooltip?.position;if(!(0,s.Qd)(e))return;const{type:i,anchorTo:n,placement:a,xOffset:o,yOffset:r}=e,l={};return(0,s.Kg)(i)&&(0,s.Xl)(Nf,i)&&(l.type=i),(0,s.Kg)(n)&&(0,s.Xl)(Af,n)&&(l.anchorTo=n),(0,s.Kg)(a)&&(0,s.Xl)(Tf,a)&&(l.placement=a),(0,s.Bf)(o)&&(l.xOffset=o),(0,s.Bf)(r)&&(l.yOffset=r),{tooltip:{position:l}}}getTooltipRangeDefaults(t,e){return{tooltip:{range:t.tooltip?.range??er.getTooltipDefauls(e)?.range}}}soloSeriesIntegrity(t){if(!(0,s.cy)(t.series))return;const e=t.series;if(e&&e.length>1&&e.some(t=>er.isSolo(t.type))){const i=this.optionsType(t);if(er.isSolo(i))s.Vy.warn(`series[0] of type '${i}' is incompatible with other series types. Only processing series[0]`),t.series=e.slice(0,1);else{const{solo:i,nonSolo:n}=(0,s.$z)(e,t=>er.isSolo(t.type)?"solo":"nonSolo"),a=(0,s.Am)(i.map(t=>t.type)).join(", ");s.Vy.warn(`Unable to mix these series types with the lead series type: ${a}`),t.series=n}}}static enableConfiguredJsonOptions(t,e){"object"==typeof e&&"enabled"in e&&!e._enabledFromTheme&&null==t.enabled&&(e.enabled=!0)}static cleanupEnabledFromThemeJsonOptions(t){null!=t._enabledFromTheme&&delete t._enabledFromTheme}enableConfiguredOptions(e,i){je(i,t.enableConfiguredJsonOptions,new Set(["data","theme"]),e),je(e,t.cleanupEnabledFromThemeJsonOptions,new Set(["data","theme"]))}static processFontOptions(t,e,i,s=new Set){if("object"==typeof t&&"fontFamily"in t)if(Array.isArray(t.fontFamily)){const e=[];for(const i of t.fontFamily)"object"==typeof i&&"googleFont"in i?(e.push(i.googleFont),s?.add(i.googleFont)):e.push(i);t.fontFamily=e.join(", ")}else"object"==typeof t.fontFamily&&"googleFont"in t.fontFamily&&(t.fontFamily=t.fontFamily.googleFont,s?.add(t.fontFamily));return s}processFonts(e,i=new Set){return je(e,t.processFontOptions,new Set(["data","theme"]),void 0,void 0,i)}static removeDisabledOptionJson(t){"enabled"in t&&!1===t.enabled&&Object.keys(t).forEach(e=>{"enabled"!==e&&delete t[e]})}removeDisabledOptions(e){je(e,t.removeDisabledOptionJson,new Set(["data","theme","contextMenu"]))}static removeLeftoverSymbolsJson(t){if(t&&(0,s.Gv)(t))for(const e of Object.keys(t)){const i=t[e];(0,s.Bm)(i)&&delete t[e]}}removeLeftoverSymbols(e){je(e,t.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(t){if(null==t.window?t.window=(0,s.zk)():(0,s.d1)(t.window),null==t.document?t.document=(0,s.YE)():(0,s._9)(t.document),null==t.window)throw new Error("AG Charts - unable to resolve global window");if(null==t.document)throw new Error("AG Charts - unable to resolve global document");return t}};dS.OPTIONS_CLONE_OPTS={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},dS.JSON_DIFF_OPTS=new Set(["data"]),dS.perfDebug=x.create(!0,"perf"),dS.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),dS.debug=x.create(!0,"opts");var uS=dS,pS=class t{constructor(t,e,i,s,n,a=1e3){this.name=t,this.buildItem=e,this.releaseItem=i,this.destroyItem=s,this.maxPoolSize=n,this.cleanupTimeMs=a,this.freePool=[],this.busyPool=new Set}static getPool(e,i,s,n,a){return this.pools.has(e)||this.pools.set(e,new t(e,i,s,n,a)),this.pools.get(e)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(e){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return null==i?(i=this.buildItem(e),t.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):t.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i]),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}obtainFree(){const e=this.freePool.pop();if(null==e)throw new Error("AG Charts - pool has no free instances");return t.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,e]),this.busyPool.add(e),{item:e,release:()=>this.release(e)}}release(e){if(!this.busyPool.has(e))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");t.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),t.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]);const i=Date.now(),s=i+.5*this.cleanupTimeMs;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)<s&&(clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=void 0),this.cleanPoolTimer||(this.cleanPoolDue=i+this.cleanupTimeMs,this.cleanPoolTimer=setTimeout(this.cleanPool.bind(this),this.cleanupTimeMs))}cleanPool(){const e=this.freePool.splice(0);for(const t of e)this.destroyItem(t);t.debug(()=>[`Pool[name=${this.name}]: Cleaned pool of ${e.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const t of this.busyPool.values())this.destroyItem(t);this.busyPool.clear()}};pS.pools=new Map,pS.debug=x.create(!0,"pool");var gS=pS;s.sy.registerMany(Jx);var mS=x.create(!0,"opts"),yS=class{static licenseCheck(t){this.licenseChecked||(this.licenseManager=tb.licenseManager?.(t),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(t){return tb.licenseManager?.({}).getLicenseDetails(t)}static getInstance(t){return xS.getInstance(t)}static create(t,e){return mS.group("AgCharts.create()",()=>{t=x.inDevelopmentMode(()=>V(Ge(t)))??t,this.licenseCheck(t);const i=xS.createOrUpdate({userOptions:t,licenseManager:this.licenseManager,optionsMetadata:e});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&tb.injectWatermark?.(i.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),i})}static createFinancialChart(t){return mS.group("AgCharts.createFinancialChart()",()=>this.create(t,{presetType:"price-volume"}))}static createGauge(t){return mS.group("AgCharts.createGauge()",()=>this.create(t,{presetType:"gauge-preset"}))}static __createSparkline(t){return mS.group("AgCharts.__createSparkline()",()=>{const{pool:e,...i}=t;return this.create(i,{presetType:"sparkline",pool:e??!0,domMode:"minimal"})})}};yS.licenseChecked=!1;var fS=class t{static getInstance(t){const e=gc.getInstance(t);return e?xc.chartInstances.get(e):void 0}static initialiseModules(){t.initialised||(Cf(),function(){for(const t of h.modules){if("enterprise"!==t.packageType||Uo(t)||s.Vy.errorOnce("Unexpected enterprise module registered: "+t.identifier),"root"===t.type&&t.themeTemplate)for(const e of t.chartTypes)tr.set(e,t.themeTemplate);if("series"===t.type){if(t.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${t.identifier}`);er.register(t.identifier,t)}if("series-option"===t.type&&t.themeTemplate)for(const e of t.seriesTypes)er.setThemeTemplate(e,t.themeTemplate);if("axis-option"===t.type&&t.themeTemplate)for(const e of t.axisTypes){const i=Yo.getThemeTemplate(e),s=E(t.themeTemplate,i);Yo.setThemeTemplate(e,s)}"axis"===t.type&&Yo.register(t.identifier,t),"legend"===t.type&&Xo.register(t.identifier,t)}if(h.hasEnterpriseModules()){const t=$o.filter(({useCount:t})=>null==t||0===t);t.length>0&&s.Vy.errorOnce("Enterprise modules expected but not registered: ",t)}}(),t.initialised=!0)}static createOrUpdate(e){let{proxy:i}=e;const{userOptions:n,licenseManager:a,processedOverrides:o=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:r=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:l=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:h,stripSymbols:c=!1}=e,d=null!=tb.styles?[["ag-charts-enterprise",tb.styles]]:[],{presetType:u}=l;t.initialiseModules(),mS(()=>[">>> AgCharts.createOrUpdate() user options",Ge(n)]);let p=n;yS.optionsMutationFn&&p&&(p=yS.optionsMutationFn(Ge(p),u),mS(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Ge(p)]));const g=this.getPool(l);let m,y=!1,f=i?.chart;null==f&&g?.hasFree()&&(m=g.obtainFree(),f=m.item);const{document:x,window:b,styleContainer:v,...S}=p??{},M=f?.getChartOptions(),k=new uS(M,S,o,{...r,document:x,window:b,styleContainer:v},l,h,c);return null!=f&&s.sy.detectChartDefinition(k.processedOptions)===s.sy.detectChartDefinition(f.chartOptions.processedOptions)||(m?.release(),m=this.getPool(k.optionMetadata)?.obtain(k),m?f=m.item:(y=!0,f=t.createChartInstance(k,f))),d.forEach(([t,e])=>{f.ctx.domManager.addStyles(t,e)}),f.ctx.fontManager.updateFonts(k.googleFonts),null==i?(i=new xc(f,t.callbackApi,a),i.releaseChart=m?.release):(m||y)&&(i.releaseChart?.(),i.chart=f,i.releaseChart=m?.release),mS.check()&&"undefined"!=typeof window&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[f.id]=f),f.queuedUserOptions.push(k.userOptions),f.queuedChartOptions.push(k),f.requestFactoryUpdate(t=>{mS.group(">>>> Chart.applyOptions()",()=>{t.applyOptions(k);const e=t.queuedUserOptions.indexOf(k.userOptions)+1;t.queuedUserOptions.splice(0,e),t.queuedChartOptions.splice(0,e)})}),i}static markRemovedProperties(t,e,i=!1){if("object"!=typeof t)return i;for(const e of Object.keys(t))void 0===t[e]&&(Object.assign(t,{[e]:Symbol("UNSET")}),i||(i=!0));return i}static updateUserDelta(e,i){const s=je(i=Ge(i,uS.OPTIONS_CLONE_OPTS),t.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);mS(()=>[">>> AgCharts.updateUserDelta() user delta",Ge(i)]),t.createOrUpdate({proxy:e,deltaOptions:i,stripSymbols:s})}static createChartInstance(t,e){const i=e?.destroy({keepTransferableResources:!0});return s.sy.detectChartDefinition(t.processedOptions).create(t,i)}static getPool(t){if(!0===t.pool)return gS.getPool(t.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};fS.caretaker=new Zi(Hi),fS.initialised=!1,fS.callbackApi={caretaker:fS.caretaker,create:(t,e,i,s)=>fS.createOrUpdate({userOptions:t,processedOverrides:e,specialOverrides:i,optionsMetadata:s}),update:(t,e)=>fS.createOrUpdate({userOptions:t,proxy:e}),updateUserDelta:(t,e)=>fS.updateUserDelta(t,e)},fS.detachAndClear=t=>t.detachAndClear(),fS.destroy=t=>t.destroy();var xS=fS,bS={};o(bS,{Arc:()=>vS,BBox:()=>y,Caption:()=>Fi,CategoryScale:()=>Mc,Group:()=>Ie,Line:()=>pr,LinearScale:()=>_d,Marker:()=>Ph,Path:()=>vh,RadialColumnShape:()=>MS,Rect:()=>qd,Scene:()=>dn,Sector:()=>Uy,Shape:()=>de,TranslatableGroup:()=>Ae,getRadialColumnWidth:()=>kS,toRadians:()=>ot});var vS=class extends vh{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return(0,s.YX)(it(this.startAngle),it(this.endAngle))}updatePath(){const t=this.path;t.clear(),t.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),1===this.type?t.closePath():2!==this.type||this.fullPie||(t.lineTo(this.centerX,this.centerY),t.closePath())}computeBBox(){return new y(this.centerX-this.radius,this.centerY-this.radius,2*this.radius,2*this.radius)}isPointInPath(t,e){const i=this.getBBox();return 0!==this.type&&i.containsPoint(t,e)&&this.path.isPointInPath(t,e)}};function SS(t,e,i){const s=Math.sqrt(t**2+e**2),n=Math.atan2(e,t)+i;return{x:Math.cos(n)*s,y:Math.sin(n)*s}}vS.className="Arc",r([H()],vS.prototype,"centerX",2),r([H()],vS.prototype,"centerY",2),r([H()],vS.prototype,"radius",2),r([H()],vS.prototype,"startAngle",2),r([H()],vS.prototype,"endAngle",2),r([H()],vS.prototype,"counterClockwise",2),r([H()],vS.prototype,"type",2);var MS=class extends vh{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,a=i/2,o=-e,r=-t;let l=1/0,h=1/0,c=-1/0,d=-1/0;for(let t=0;t<4;t+=1){const{x:e,y:i}=SS(t%2==0?n:a,t<2?o:r,s);l=Math.min(e,l),h=Math.min(i,h),c=Math.max(e,c),d=Math.max(i,d)}return new y(l,h,c-l,d-h)}getRotation(){const{startAngle:t,endAngle:e}=this;return it(t+lt(t,e)/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,a=t/2,o=-i,r=-e,l=this.getRotation(),h=[[n,r],[n,o],[a,o],[a,r]].map(([t,e])=>SS(t,e,l));s.clear(!0),s.moveTo(h[0].x,h[0].y),s.lineTo(h[1].x,h[1].y),s.lineTo(h[2].x,h[2].y),s.lineTo(h[3].x,h[3].y),s.closePath()}updateBeveledPath(){const{columnWidth:t,path:e,outerRadius:i,innerRadius:n,axisInnerRadius:a,axisOuterRadius:o,isRadiusAxisReversed:r}=this,l=(0,s.YX)(n,a),h=Math.asin(t/2/n),c=this.getRotation(),d=(t,e)=>SS(t,e,c),u=(t,e)=>Math.sqrt(t**2+e**2),p=(t,e)=>e>t?0:Math.sqrt(t**2-e**2),g=(t,e,i)=>i?t<e:t>e,m=l&&!isNaN(h)&&h<Math.PI/6;let y=-t/2,f=t/2;const x=-i,b=-n*(m?Math.cos(h):1),v=g(o,u(n,t/2),!r);if(v){const t=p(o,n);y=-t,f=t}e.clear(!0);const S=d(y,b);e.moveTo(S.x,S.y);const M=(0,s.YX)(n,i),k=g(o,u(i,t/2),!r);if(M&&m)e.arc(0,0,n,it(-h-Math.PI/2)+c,it(h-Math.PI/2)+c,!1);else if(k){const n=-p(o,t/2),a=p(o,i);if(!v){const t=d(y,n);e.lineTo(t.x,t.y)}if(e.arc(0,0,o,Math.atan2(n,y)+c,Math.atan2(x,-a)+c,!1),!(0,s.YX)(a,0)){const t=d(a,x);e.lineTo(t.x,t.y)}e.arc(0,0,o,Math.atan2(x,a)+c,Math.atan2(n,f)+c,!1)}else{const t=d(y,x),i=d(f,x);e.lineTo(t.x,t.y),e.lineTo(i.x,i.y)}const D=d(f,b);if(e.lineTo(D.x,D.y),m)e.arc(0,0,n,it(h-Math.PI/2)+c,it(-h-Math.PI/2)+c,!0);else{const t=d(y,b);e.lineTo(t.x,t.y)}e.closePath()}};function kS(t,e,i,s,n){const a=lt(t,e),o=a*(1-s)/2;if(t+=o,e-=o,a<.001)return 2*i*n;if(a>=2*Math.PI){const i=t+a/2;t=i-Math.PI,e=i+Math.PI}const r=i*Math.cos(t),l=i*Math.sin(t),h=i*Math.cos(e),c=i*Math.sin(e),d=Math.floor(Math.sqrt((r-h)**2+(l-c)**2)),u=2*i*n;return Math.max(1,Math.min(u,d))}MS.className="RadialColumnShape",r([H()],MS.prototype,"isBeveled",2),r([H()],MS.prototype,"columnWidth",2),r([H()],MS.prototype,"startAngle",2),r([H()],MS.prototype,"endAngle",2),r([H()],MS.prototype,"outerRadius",2),r([H()],MS.prototype,"innerRadius",2),r([H()],MS.prototype,"axisInnerRadius",2),r([H()],MS.prototype,"axisOuterRadius",2),r([H()],MS.prototype,"isRadiusAxisReversed",2);var DS={};o(DS,{ChartTheme:()=>gb,DEFAULT_ANNOTATION_HANDLE_FILL:()=>qu,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>tp,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>ep,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>ip,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>sp,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Qu,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Ju,DEFAULT_CAPTION_ALIGNMENT:()=>Ou,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Nu,DEFAULT_FIBONACCI_STROKES:()=>Uu,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Zu,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Hu,DEFAULT_GRIDLINE_ENABLED:()=>lp,DEFAULT_POLAR_SERIES_STROKE:()=>Yu,DEFAULT_SEPARATION_LINES_COLOUR:()=>Au,DEFAULT_SHADOW_COLOUR:()=>Tu,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>$u,DEFAULT_TEXTBOX_COLOR:()=>op,DEFAULT_TEXTBOX_FILL:()=>np,DEFAULT_TEXTBOX_STROKE:()=>ap,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Xu,DEFAULT_TOOLBAR_POSITION:()=>rp,IS_DARK_THEME:()=>Lu,PALETTE_ALT_DOWN_FILL:()=>Wu,PALETTE_ALT_DOWN_STROKE:()=>_u,PALETTE_ALT_NEUTRAL_FILL:()=>Vu,PALETTE_ALT_NEUTRAL_STROKE:()=>Ku,PALETTE_ALT_UP_FILL:()=>ju,PALETTE_ALT_UP_STROKE:()=>Gu,PALETTE_DOWN_FILL:()=>Bu,PALETTE_DOWN_STROKE:()=>Eu,PALETTE_NEUTRAL_FILL:()=>zu,PALETTE_NEUTRAL_STROKE:()=>Fu,PALETTE_UP_FILL:()=>Pu,PALETTE_UP_STROKE:()=>Ru,getChartTheme:()=>rS,resolveOperation:()=>IS,themeNames:()=>wS,themeSymbols:()=>Cu,themes:()=>oS});var wS=Object.keys(oS);function IS(t){const e=gb.getDefaultPublicParameters();e.__palette=gb.getDefaultColors();const i={operation:t};return Ke(i,e),i.operation}var CS={};o(CS,{Color:()=>yt,interpolateColor:()=>Sn});var LS={};o(LS,{AbstractBarSeries:()=>Vm,AbstractBarSeriesProperties:()=>Wm,ActionOnSet:()=>li,AnchoredPopover:()=>lM,Animation:()=>Bn,AnimationManager:()=>jn,Arc:()=>vS,Axis:()=>Wl,AxisGroupZIndexMap:()=>_l,AxisInterval:()=>fl,AxisLabel:()=>xl,AxisTick:()=>vl,AxisTickGenerator:()=>Kl,AxisTicks:()=>KS,BBox:()=>y,BBoxValues:()=>c,Background:()=>Qd,BackgroundModule:()=>Jd,BandScale:()=>eo,BarSeries:()=>ny,BarSeriesModule:()=>ry,BaseModuleInstance:()=>l,BaseProperties:()=>Lt,BaseToolbar:()=>gM,ButtonWidget:()=>Ns,CachedTextMeasurer:()=>Ai,CachedTextMeasurerPool:()=>Li,CallbackCache:()=>gn,Caption:()=>Fi,CartesianAxis:()=>Hl,CartesianSeries:()=>Yp,CartesianSeriesNodeEvent:()=>Wp,CartesianSeriesProperties:()=>Vp,CategoryAxis:()=>Ic,CategoryScale:()=>Mc,ChangeDetectableProperties:()=>Sp,Chart:()=>gc,ChartAxisDirection:()=>zi,ChartEventManager:()=>Wn,ChartOptions:()=>uS,ChartUpdateType:()=>xn,CollapseMode:()=>lg,Color:()=>yt,ColorScale:()=>Mt,ConicGradient:()=>Dt,ContextMenuBuiltins:()=>Yn,ContextMenuRegistry:()=>$n,ContinuousScale:()=>ha,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>_p,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>jp,DEFAULT_TOOLTIP_CLASS:()=>Fh,DEFAULT_TOOLTIP_DARK_CLASS:()=>zh,DIRECTION_SWAP_AXES:()=>hp,DOMManager:()=>Ls,DataController:()=>Ko,DataModel:()=>Wo,DataModelSeries:()=>Gp,DataService:()=>bn,Debug:()=>x,Deprecated:()=>Ih,DeprecatedAndRenamedTo:()=>Ch,DiscreteTimeScale:()=>io,DragInterpreter:()=>ia,DraggablePopover:()=>cM,DropShadow:()=>Mp,ExtendedPath2D:()=>Jt,FILL_IMAGE_DEFAULTS:()=>mp,FILL_PATTERN_DEFAULTS:()=>gp,FONT_SIZE_RATIO:()=>Mu,FillGradientDefaults:()=>Cp,FillImageDefaults:()=>Ap,FillPatternDefaults:()=>Lp,FloatingToolbar:()=>fM,Gradient:()=>kt,Group:()=>Ie,GroupedCategoryAxis:()=>Od,HdpiCanvas:()=>Qs,HierarchyNode:()=>RS,HierarchySeries:()=>ES,HierarchySeriesProperties:()=>PS,HighlightManager:()=>Hn,HighlightProperties:()=>Ip,HighlightStyle:()=>Tp,Image:()=>eM,InteractionManager:()=>Gn,InteractionState:()=>zn,InterpolationProperties:()=>$p,Invalidating:()=>xt,LARGEST_KEY_INTERVAL:()=>id,Label:()=>pl,LayoutElement:()=>_i,LayoutManager:()=>ji,LegendMarkerLabel:()=>hu,Line:()=>pr,LineSeries:()=>wy,LineSeriesModule:()=>Ly,LinearGradient:()=>wt,LinearScale:()=>_d,Listeners:()=>Qi,LogScale:()=>Gd,LonLatBBox:()=>BS,Marker:()=>Ph,Menu:()=>hM,MenuItemWidget:()=>sM,MenuWidget:()=>aM,MercatorScale:()=>WS,ModuleRegistry:()=>s.sy,Motion:()=>Mn,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>or,NativeWidget:()=>Ps,NewAreaSeriesModule:()=>Gm,NewBarSeriesModule:()=>ly,NewBubbleSeriesModule:()=>fy,NewHistogramSeriesModule:()=>ky,NewLineSeriesModule:()=>Ay,NewScatterSeriesModule:()=>By,NiceMode:()=>Ml,Node:()=>J,NumberAxis:()=>jd,ObserveChanges:()=>hi,OrdinalTimeScale:()=>tl,PHASE_METADATA:()=>On,PHASE_ORDER:()=>Nn,PREV_NEXT_KEYS:()=>ds,Padding:()=>ni,ParallelStateMachine:()=>Sr,Path:()=>vh,PointerEvents:()=>q,PolarAxis:()=>jx,PolarSeries:()=>hf,PolarZIndexMap:()=>lf,Popover:()=>rM,PropertiesArray:()=>At,Property:()=>Ct,ProxyInteractionService:()=>Hs,ProxyOnWrite:()=>oi,ProxyProperty:()=>ai,ProxyPropertyOnWrite:()=>ri,QUICK_TRANSITION:()=>.2,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>Kp,RadialColumnShape:()=>MS,Range:()=>il,Rect:()=>qd,RepeatType:()=>Rn,Rotatable:()=>xe,RotatableGroup:()=>Le,RotatableText:()=>Ei,SAFE_FILLS_OPERATION:()=>dp,SAFE_FILL_OPERATION:()=>cp,SAFE_RANGE2_OPERATION:()=>pp,SAFE_STROKE_FILL_OPERATION:()=>up,SKIP_JS_BUILTINS:()=>_,SMALLEST_KEY_INTERVAL:()=>ed,SORT_DOMAIN_GROUPS:()=>sd,Scalable:()=>be,ScalableGroup:()=>Ce,Scene:()=>dn,SceneArrayChangeDetection:()=>X,SceneChangeDetection:()=>H,SceneObjectChangeDetection:()=>U,Sector:()=>Uy,SectorBox:()=>Fy,Selection:()=>ur,Series:()=>bh,SeriesContentZIndexMap:()=>dh,SeriesGroupingChangedEvent:()=>xh,SeriesItemHighlightStyle:()=>kp,SeriesMarker:()=>Op,SeriesNodeEvent:()=>fh,SeriesNodePickMode:()=>yh,SeriesProperties:()=>Np,SeriesTooltip:()=>Ep,SeriesZIndexMap:()=>ch,Shape:()=>de,SimpleTextMeasurer:()=>Ni,SliderWidget:()=>Ws,StateMachine:()=>vr,StateMachineProperty:()=>yr,StopProperties:()=>Nt,SvgPath:()=>tM,TRIPLE_EQ:()=>$,Text:()=>Ri,TextUtils:()=>Ti,TextWrapper:()=>Bi,ThemeConstants:()=>vu,ThemeSymbols:()=>Cu,TimeAxisParentLevel:()=>Vd,TimeScale:()=>Zr,Toolbar:()=>mM,ToolbarButtonProperties:()=>dM,ToolbarButtonWidget:()=>uM,ToolbarWidget:()=>Ks,Tooltip:()=>Zh,TooltipManager:()=>Jn,TooltipPosition:()=>Xh,Transformable:()=>Me,TransformableGroup:()=>Te,TransformableText:()=>Pi,Translatable:()=>ve,TranslatableGroup:()=>Ae,TranslatableLine:()=>Gl,UnitTimeScale:()=>Tr,UpdateService:()=>Do,Vec2:()=>AS,Vec4:()=>so,WIDGET_HTML_EVENTS:()=>di,Widget:()=>Ii,WidgetEventUtil:()=>mi,ZIndexMap:()=>yn,ZoomManager:()=>po,accumulateGroup:()=>ud,accumulateStack:()=>gd,accumulatedValue:()=>Gc,accumulativeValueProperty:()=>qc,addEscapeEventListener:()=>is,addHitTestersToQuadtree:()=>_m,addMouseCloseListener:()=>ss,addOverrideFocusVisibleEventListener:()=>os,addTouchCloseListener:()=>ns,adjustLabelPlacement:()=>sy,angleBetween:()=>lt,angleCategoryAxisOptionsDefs:()=>$b,angleNumberAxisOptionsDefs:()=>Kb,angularPadding:()=>ct,animationValidation:()=>hd,annotationCalloutStylesDefs:()=>cv,annotationChannelStyleDefs:()=>ov,annotationChannelTextDefs:()=>Jb,annotationCommentStylesDefs:()=>dv,annotationCrossLineStyleDefs:()=>av,annotationDisjointChannelStyleDefs:()=>rv,annotationFibonacciStylesDefs:()=>hv,annotationLineStyleDefs:()=>nv,annotationLineTextDefs:()=>Qb,annotationMeasurerStylesDefs:()=>gv,annotationNoteStylesDefs:()=>uv,annotationOptionsDef:()=>yv,annotationParallelChannelStyleDefs:()=>lv,annotationQuickMeasurerStylesDefs:()=>mv,annotationShapeStylesDefs:()=>pv,annotationTextStylesDef:()=>qb,applyShapeFillBBox:()=>gh,applyShapeStyle:()=>mh,areScalingEqual:()=>wg,area:()=>zc,autoSizedLabelOptionsDefs:()=>Tm,boxPlotSeriesThemeableOptionsDef:()=>fv,buildFormatter:()=>Za,buildResetPathFn:()=>$g,calculateDataDiff:()=>Jm,calculateDefaultTimeTickFormat:()=>Ja,calculateDerivativeExtrema:()=>qt,calculateDerivativeExtremaXY:()=>Qt,calculateLabelTranslation:()=>HS,calculatePlacement:()=>Lh,callWithContext:()=>pn,candlestickSeriesThemeableOptionsDef:()=>bv,cartesianAxisCrosshairOptions:()=>lm,cartesianAxisLabelOptionsDefs:()=>em,cartesianAxisOptionsDefs:()=>rm,cartesianChartOptionsDefs:()=>wx,cartesianCrossLineOptionsDefs:()=>Jg,cartesianNumericAxisLabel:()=>im,cartesianTimeAxisLabel:()=>sm,cartesianTimeAxisParentLevel:()=>am,checkCrisp:()=>$m,chordSeriesThemeableOptionsDef:()=>vv,clampArray:()=>aa,clippedRoundRect:()=>Zd,collapsedStartingBarPosition:()=>Um,commonAxisLabelOptionsDefs:()=>tm,commonAxisOptionsDefs:()=>om,commonChartOptionsDefs:()=>wm,commonCrossLineLabelOptionsDefs:()=>qg,commonCrossLineOptionsDefs:()=>Qg,commonSeriesOptionsDefs:()=>Cm,commonSeriesThemeableOptionsDefs:()=>Im,compareDates:()=>Nr,computeBarFocusBounds:()=>Qm,computeMarkerFocusBounds:()=>Vg,coneFunnelSeriesThemeableOptionsDef:()=>Sv,continuousAxisOptions:()=>hm,countExpandingSearch:()=>Qn,createButton:()=>US,createCheckbox:()=>XS,createDatumId:()=>xd,createDeprecationWarning:()=>wh,createIcon:()=>QS,createSelect:()=>ZS,createTextArea:()=>qS,dateToNumber:()=>qa,datesSortOrder:()=>Rr,datumKeys:()=>Go,datumStylerProperties:()=>Xn,deconstructSelectionsOrNodes:()=>En,deepClone:()=>Ge,deepFreeze:()=>V,defaultTimeTickFormat:()=>Qa,diff:()=>fd,drawCorner:()=>Hd,drawMarkerUnitPolygon:()=>Oh,easing:()=>Mn,enterpriseModule:()=>tb,errorBarOptionsDefs:()=>Om,errorBarThemeableOptionsDefs:()=>Nm,evaluateBezier:()=>Ut,extent:()=>Lc,extractDecoratedProperties:()=>N,fillsOptionsDef:()=>Bf,findMinMax:()=>oa,findQuadtreeMatch:()=>jm,findRangeExtent:()=>ra,fixNumericExtent:()=>Po,flowProportionChartOptionsDefs:()=>Tx,focusCursorAtEnd:()=>Re,formatNumber:()=>_s,formatPercent:()=>zs,formatValue:()=>Fs,fromToMotion:()=>rr,funnelSeriesThemeableOptionsDef:()=>Mv,gaugeChartOptionsDefs:()=>Nx,getAngleRatioRadians:()=>ht,getColorStops:()=>Rt,getCrossLineValue:()=>al,getDateTicksForInterval:()=>Qr,getDatumRefPoint:()=>qn,getElementBBox:()=>Oe,getIconClassNames:()=>Pe,getLastFocus:()=>fs,getMissCount:()=>Bo,getPath:()=>G,getPathComponents:()=>_o,getRadialColumnWidth:()=>kS,getSequentialColors:()=>yp,getShapeFill:()=>uh,getShapeStyle:()=>ph,groupAccumulativeValueProperty:()=>Jc,groupAverage:()=>Fc,groupCount:()=>Bc,groupStackValueProperty:()=>td,groupSum:()=>Pc,hasNoModifiers:()=>rs,heatmapSeriesThemeableOptionsDef:()=>kv,hierarchyChartOptionsDefs:()=>Ax,initMenuKeyNav:()=>gs,initRovingTabIndex:()=>us,interpolatePoints:()=>Cg,interpolationOptionsDefs:()=>Pm,isAgFlowProportionChartOptions:()=>ih,isAgGaugeChartOptions:()=>nh,isAgHierarchyChartOptions:()=>th,isAgStandaloneChartOptions:()=>sh,isAgTopologyChartOptions:()=>eh,isBetweenAngles:()=>at,isButtonClickEvent:()=>ys,isChartAxisDirection:()=>Gi,isContinuous:()=>sl,isDecoratedObject:()=>A,isDenseInterval:()=>Hr,isGradientFill:()=>ae,isGradientOrPatternFill:()=>he,isImageFill:()=>le,isInputPending:()=>Ee,isObjectWithProperty:()=>K,isObjectWithStringProperty:()=>Y,isPatternFill:()=>re,isProperties:()=>Tt,isScaleValid:()=>Ig,jsonApply:()=>We,jsonDiff:()=>Fe,jsonPropertyCompare:()=>ze,jsonResolveOperations:()=>Ke,jsonWalk:()=>je,keyProperty:()=>Yc,legendSymbolSvg:()=>Bh,lineDistanceSquared:()=>Wt,linearGaugeSeriesOptionsDef:()=>_f,linearGaugeSeriesThemeableOptionsDef:()=>Gf,linearGaugeTargetOptionsDef:()=>Ff,listDecoratedProperties:()=>T,makeAccessibleClickListener:()=>ms,mapLineBackgroundSeriesThemeableOptionsDef:()=>Iv,mapLineSeriesThemeableOptionsDef:()=>wv,mapMarkerSeriesThemeableOptionsDef:()=>Cv,mapShapeBackgroundSeriesThemeableOptionsDef:()=>Av,mapShapeSeriesThemeableOptionsDef:()=>Lv,mapValues:()=>F,markerFadeInAnimation:()=>zg,markerOptionsDefs:()=>Lm,markerScaleInAnimation:()=>Gg,markerSwipeScaleInAnimation:()=>_g,merge:()=>P,mergeArrayDefaults:()=>B,mergeDefaults:()=>E,midpointStartingBarPosition:()=>Xm,moduleRegistry:()=>h,motion:()=>bM,nearestSquared:()=>p,nearestSquaredInContainer:()=>g,nightingaleSeriesThemeableOptionsDef:()=>Tv,normaliseGroupTo:()=>ad,normalisePropertyTo:()=>rd,normalisedExtentWithMetadata:()=>Ac,normalizeAngle180:()=>nt,normalizeAngle360:()=>it,normalizeAngle360FromDegrees:()=>dt,normalizeAngle360Inclusive:()=>st,normalizeContinuousDomains:()=>ca,numberFormatValidator:()=>Zg,objectsEqual:()=>O,objectsEqualWith:()=>R,ohlcSeriesThemeableOptionsDef:()=>Dv,ordinalTimeAxisOptionsDefs:()=>Vb,pairUpSpans:()=>Mg,partialAssign:()=>W,pathFadeInAnimation:()=>Yg,pathMotion:()=>fp,pathSwipeInAnimation:()=>Kg,pickByMatchingAngle:()=>rf,plotAreaPathFill:()=>Eg,plotInterpolatedAreaSeriesFillSpans:()=>Pg,plotInterpolatedLinePathStroke:()=>Tg,plotLinePathStroke:()=>Ag,polarChartOptionsDefs:()=>Ix,prepareAreaFillAnimationFns:()=>Bg,prepareAreaPathAnimation:()=>Fg,prepareAxisAnimationContext:()=>kl,prepareAxisAnimationFunctions:()=>Il,prepareBarAnimationFunctions:()=>Zm,prepareLinePathAnimation:()=>Rg,prepareLinePathPropertyAnimation:()=>Og,prepareLinePathStrokeAnimationFns:()=>Ng,preparePieSeriesAnimationFunctions:()=>af,pyramidSeriesThemeableOptionsDef:()=>Nv,radarAreaSeriesThemeableOptionsDef:()=>Ov,radarLineSeriesThemeableOptionsDef:()=>Rv,radialBarSeriesThemeableOptionsDef:()=>Ev,radialColumnSeriesThemeableOptionsDef:()=>Pv,radialGaugeSeriesOptionsDef:()=>Wf,radialGaugeSeriesThemeableOptionsDef:()=>jf,radialGaugeTargetOptionsDef:()=>zf,radiusCategoryAxisOptionsDefs:()=>Ub,radiusNumberAxisOptionsDefs:()=>Hb,range:()=>$r,rangeAreaSeriesThemeableOptionsDef:()=>Bv,rangeBarSeriesThemeableOptionsDef:()=>Fv,rangeValidator:()=>gm,rangedValueProperty:()=>Zc,resetAxisGroupFn:()=>Cl,resetAxisLabelSelectionFn:()=>Ll,resetAxisLineSelectionFn:()=>Al,resetBarSelectionsFn:()=>qm,resetLabelFn:()=>vp,resetMarkerFn:()=>jg,resetMarkerPositionFn:()=>Wg,resetMotion:()=>dr,resetPieSelectionsFn:()=>of,rowCountProperty:()=>Hc,sankeySeriesThemeableOptionsDef:()=>zv,scale:()=>hg,sectorBox:()=>zy,seriesLabelFadeInAnimation:()=>xp,seriesLabelFadeOutAnimation:()=>bp,seriesLabelOptionsDefs:()=>Am,setElementBBox:()=>Ne,setPath:()=>j,shadowOptionsDefs:()=>Em,shallowClone:()=>_e,solveBezier:()=>Xt,sortAndUniqueDates:()=>Or,splitBezier:()=>Zt,standaloneChartOptionsDefs:()=>Lx,staticFromToMotion:()=>lr,stopPageScrolling:()=>xs,sum:()=>Ec,sumValues:()=>Rc,sunburstSeriesThemeableOptionsDef:()=>Gv,timeIntervalUnit:()=>Xg,toDegrees:()=>rt,toRadians:()=>ot,toolbarButtonOptionsDefs:()=>Dm,tooltipContentAriaLabel:()=>_h,tooltipHtml:()=>Kh,tooltipOptionsDefs:()=>Rm,topologyChartOptionsDefs:()=>Cx,trailingAccumulatedValue:()=>_c,trailingAccumulatedValueProperty:()=>Qc,treemapSeriesThemeableOptionsDef:()=>_v,updateClipPath:()=>Hg,updateLabelNode:()=>ey,validateCrossLineValue:()=>ol,valueProperty:()=>$c,visibleRangeIndices:()=>Zn,waterfallSeriesThemeableOptionsDef:()=>Wv,without:()=>z});var AS={add:function(t,e){return"number"==typeof e?{x:t.x+e,y:t.y+e}:{x:t.x+e.x,y:t.y+e.y}},angle:function(t,e){return null==e?Math.atan2(t.y,t.x):Math.atan2(t.y,t.x)-Math.atan2(e.y,e.x)},apply:function(t,e){return t.x=e.x,t.y=e.y,t},equal:function(t,e){return t.x===e.x&&t.y===e.y},distance:function(t,e){const i=TS(t,e);return Math.sqrt(i.x*i.x+i.y*i.y)},distanceSquared:function(t,e){const i=TS(t,e);return i.x*i.x+i.y*i.y},from:function(t,e){if("number"==typeof t)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}]`)},gradient:function(t,e,i){const s=e.x-t.x;return(null==i?e.y-t.y:i-e.y-(i-t.y))/s},intercept:function(t,e,i){return(null==i?t.y:i-t.y)-e*t.x},intersectAtX:function(t,e,i=0,s){const n=t===1/0?1/0:t*i+e;return{x:i,y:null==s?n:s-n}},intersectAtY:function(t,e,i=0,s){return{x:t===1/0?1/0:(i-e)/t,y:null==s?i:s-i}},length:NS,lengthSquared:function(t){return t.x*t.x+t.y*t.y},multiply:function(t,e){return"number"==typeof e?{x:t.x*e,y:t.y*e}:{x:t.x*e.x,y:t.y*e.y}},normalized:function(t){const e=NS(t);return{x:t.x/e,y:t.y/e}},origin:function(){return{x:0,y:0}},required:function(t){return{x:t?.x??0,y:t?.y??0}},rotate:function(t,e,i={x:0,y:0}){const s=NS(t);return{x:i.x+s*Math.cos(e),y:i.y+s*Math.sin(e)}},round:function(t,e=2){return{x:(0,s.GB)(t.x,e),y:(0,s.GB)(t.y,e)}},sub:TS};function TS(t,e){return"number"==typeof e?{x:t.x-e,y:t.y-e}:{x:t.x-e.x,y:t.y-e.y}}function NS(t){return Math.sqrt(t.x*t.x+t.y*t.y)}var OS=class t{constructor(t,e,i,s,n,a,o,r,l){this.series=t,this.datumIndex=e,this.datum=i,this.sizeValue=s,this.colorValue=n,this.sumSize=a,this.depth=o,this.parent=r,this.children=l,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(e,i=t.Walk.PreOrder){i===t.Walk.PreOrder&&e(this),this.children.forEach(t=>{t.walk(e,i)}),i===t.Walk.PostOrder&&e(this)}*[Symbol.iterator](){yield this;for(const t of this.children)yield*t}};OS.Walk={PreOrder:0,PostOrder:1};var RS=OS,ES=class extends bh{constructor(t){super({moduleCtx:t,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new Mt,this.animationState=new vr("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t&&this.animationState.transition("skip")}processData(){const{NodeClass:t}=this,{childrenKey:e,sizeKey:i,colorKey:s,colorRange:n}=this.properties;let a=0,o=1/0,r=-1/0;const l=(n,l,c)=>{const d=null!=c.depth?c.depth+1:0,u=null!=e?n[e]:void 0,p=null==u||0===u.length;let g=null!=i?n[i]:void 0;g=Number.isFinite(g)?Math.max(g,0):p?1:0;const m=g;a=Math.max(a,d);const y=null!=s?n[s]:void 0;return"number"==typeof y&&(o=Math.min(o,y),r=Math.max(r,y)),h(new t(this,l,n,g,y,m,d,c,[]),u)},h=(t,e)=>{const{datumIndex:i}=t;return e?.forEach((e,s)=>{const n=l(e,i.concat(s),t);t.children.push(n),t.sumSize+=n.sumSize}),t},c=h(new t(this,[],void 0,0,void 0,0,void 0,void 0,[]),this.data),d=[o,r];this.colorScale.domain=o<r?[o,r]:[0,1],this.colorScale.range=n??["black"],this.colorScale.update(),this.rootNode=c,this.maxDepth=a,this.colorDomain=d}update({seriesRect:t}){this.updateSelections(),this.updateNodes();const e=this.getAnimationData();this.checkResize(t)&&this.animationState.transition("resize",e),this.animationState.transition("update",e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}getLegendData(t){const{colorKey:e,colorName:i,colorRange:s}=this.properties,{id:n,ctx:{legendManager:a},visible:o}=this;return"gradient"===t&&null!=e&&null!=s?[{legendType:"gradient",enabled:o&&a.getItemEnabled({seriesId:n}),seriesId:n,colorName:i,colorRange:s,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(t){return t.datumIndex.join(":")}getDatumId(t){return this.getDatumIdFromData(t)}removeMeIndexPathForIndex(t){return this.datumSelection.at(t+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(t){for(const{index:e,datum:i}of this.datumSelection)if((0,s.r1)(i.datumIndex,t))return e-1;return 0}pickFocus(t){if(!this.rootNode?.children.length)return;const e=(0,s.qE)(0,t.datumIndex-t.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:n}=t;let a=this.removeMeIndexPathForIndex(e);const o=a.reduce((t,e)=>t.children[e],this.rootNode);if(n>0&&o.hasChildren)a=[...a,0];else if(n<0&&a.length>1)a=a.slice(0,-1);else if(0===n&&0!==i){const t=o.parent.children.length-1;a=a.slice(),a[a.length-1]=(0,s.qE)(0,a[a.length-1]+i,t)}const r=a.reduce((t,e)=>t.children[e],this.rootNode),l=this.computeFocusBounds(this.datumSelection.at(e+1));return null!=l?{datum:r,datumIndex:this.removeMeIndexForIndexPath(a),otherIndex:r.depth,bounds:l,clipFocusBox:!0}:void 0}getDatumAriaText(t,e){if(t instanceof this.NodeClass)return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(t.depth??-1)+1,count:t.children.length,description:e});s.Vy.error(`datum is not HierarchyNode: ${JSON.stringify(t)}`)}getCategoryValue(t){}datumIndexForCategoryValue(t){}},PS=class extends Np{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Xy),this.fillGradientDefaults=new Cp,this.fillPatternDefaults=new Lp,this.fillImageDefaults=new Ap,this.strokes=Object.values(Zy)}};r([Ct],PS.prototype,"childrenKey",2),r([Ct],PS.prototype,"sizeKey",2),r([Ct],PS.prototype,"colorKey",2),r([Ct],PS.prototype,"colorName",2),r([Ct],PS.prototype,"fills",2),r([Ct],PS.prototype,"fillGradientDefaults",2),r([Ct],PS.prototype,"fillPatternDefaults",2),r([Ct],PS.prototype,"fillImageDefaults",2),r([Ct],PS.prototype,"strokes",2),r([Ct],PS.prototype,"colorRange",2);var BS=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)}},FS=Math.PI/180,zS=t=>t*FS,GS=t=>-Math.log(Math.tan(.25*Math.PI+t*FS*.5)),_S=t=>t/FS,jS=t=>(Math.atan(Math.exp(-t))-.25*Math.PI)/(.5*FS),WS=class t extends ft{constructor(e,i){super(),this.domain=e,this.range=i,this.type="mercator",this.bounds=t.bounds(e)}static bounds(t){const[[e,i],[s,n]]=t,a=zS(e),o=GS(i),r=zS(s),l=GS(n);return new y(Math.min(a,r),Math.min(o,l),Math.abs(r-a),Math.abs(l-o))}static fixedScale(){return new t([[_S(0),jS(0)],[_S(1),jS(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...t){let e=-1/0,i=1/0,s=-1/0,n=1/0;for(const a of t)for(const[t,o]of a)e=Math.min(t,e),i=Math.max(t,i),s=Math.min(o,s),n=Math.max(o,n);return{domain:[[e,s],[i,n]],animatable:!0}}convert([t,e]){const[[i,s],[n,a]]=this.range,o=(n-i)/this.bounds.width,r=(a-s)/this.bounds.height;return[(zS(t)-this.bounds.x)*o+i,(GS(e)-this.bounds.y)*r+s]}invert([t,e]){const[[i,s],[n,a]]=this.range,o=(n-i)/this.bounds.width,r=(a-s)/this.bounds.height;return[_S((t-i)/o+this.bounds.x),jS((e-s)/r+this.bounds.y)]}},VS=class t{constructor(){this.id=(0,s.sX)(this),this.axisGroup=new Ae({name:`${this.id}-AxisTicks`,zIndex:2}),this.labelSelection=ur.select(this.axisGroup,Ri),this.interval=new fl,this.label=new xl,this.scale=new _d,this.position="bottom",this.translationX=0,this.translationY=0,this.padding=0}attachAxis(t){t.appendChild(this.axisGroup)}calculateLayout(){const t=[],e=this.generateTicks(),{translationX:i,translationY:s}=this;return this.labelSelection.update(e.ticks.map(t=>this.createLabelDatum(t)),void 0,t=>t.tickId),this.labelSelection.each((e,i)=>{e.setProperties(i),i.visible&&t.push(e.getBBox())}),this.axisGroup.setProperties({translationX:i,translationY:s}),t.length>0?y.merge(t):void 0}getLabelParams(t){const{padding:e}=this,{translate:i}=t;switch(this.position){case"top":case"bottom":return{x:i,y:e,textAlign:"center",textBaseline:"top"};case"left":case"right":return{x:e,y:i,textAlign:"start",textBaseline:"middle"}}}inRange(t,e=.001){const[i,s]=oa(this.scale.range);return t>=i-e&&t<=s+e}createLabelDatum(t){const{x:e,y:i,textBaseline:s,textAlign:n}=this.getLabelParams(t);return{visible:Boolean(t.tickLabel),tickId:t.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:t.tickLabel,textAlign:n,textBaseline:s,x:e,y:i}}generateTicks(){const{minSpacing:e,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:n,tickCount:a}=Xr(ra(this.scale.range),1,e,i,t.DefaultTickCount,t.DefaultMinSpacing),o=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:a,minTickCount:n,maxTickCount:s});if("bottom"===this.position||"top"===this.position){const t=Li.getMeasurer({font:this.label}),{domain:e}=this.scale,i=e[0]>e[1]?-1:1;let s=-1/0*i;o.ticks=o.ticks.filter(e=>Math.sign(e.translate-s)===i&&(s=e.translate+t.textWidth(e.tickLabel,!0)*i,!0))}return o}getTicksData(t){const e=[],i=t.nice?this.scale.niceDomain(t):this.scale.domain,n=this.scale.ticks(t,i)?.ticks??[],a=n.reduce((t,e)=>Math.max(t,(0,s.o3)(e)),0),o=[],r=Vl(),l="string"==typeof this.label.format?this.scale.tickFormatter({domain:i,ticks:n,fractionDigits:a,specifier:this.label.format}):t=>Fs(t,a);for(let t=0;t<n.length;t++){const s=n[t],h=this.scale.convert(s);if(!this.inRange(h))continue;const c=this.label.formatter?.({value:s,index:t,domain:i,fractionDigits:a,boundSeries:o})??l(s),d=r(c);e.push({tick:s,tickId:d,tickLabel:c,translate:h})}return{rawTicks:n,fractionDigits:a,ticks:e}}};VS.DefaultTickCount=5,VS.DefaultMinSpacing=10;var KS=VS,YS={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}},$S={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 HS({yDirection:t,padding:e=0,position:i="top",bbox:s}){const n=t?YS:$S,{xTranslationDirection:a,yTranslationDirection:o}=n[i];return{xTranslation:a*(e+s.width/2),yTranslation:o*(e+s.height/2)}}function US(t,e){const i=(0,s.n)("button",JS("ag-charts-input ag-charts-button",e));return void 0!==t.label?i.append(t.label):(i.append(QS(t.icon)),i.ariaLabel=t.altText),i.addEventListener("click",t.onPress),(0,s.Wp)(i,e),i}function XS(t,e){const i=(0,s.n)("input",JS("ag-charts-input ag-charts-checkbox",e));return i.type="checkbox",i.checked=t.checked,i.addEventListener("change",e=>t.onChange(i.checked,e)),i.addEventListener("keydown",t=>{ys(t)&&(t.preventDefault(),i.click())}),(0,s.Wp)(i,e),i}function ZS(t,e){const i=(0,s.n)("select",JS("ag-charts-input ag-charts-select",e));return i.append(...t.options.map(t=>{const e=(0,s.n)("option");return e.value=t.value,e.textContent=t.label,e})),(0,s.Bq)(i,"data-preventdefault",!1),i.value=t.value,i.addEventListener("change",e=>t.onChange(i.value,e)),(0,s.Wp)(i,e),i}function qS(t,e){const i=(0,s.n)("textarea",JS("ag-charts-input ag-charts-textarea",e));return i.value=t.value,i.addEventListener("input",e=>t.onChange(i.value,e)),(0,s.Wp)(i,e),(0,s.Bq)(i,"data-preventdefault",!1),i}function QS(t){const e=(0,s.n)("span",`ag-charts-icon ag-charts-icon-${t}`);return(0,s.Bq)(e,"aria-hidden",!0),e}function JS(t,e){return null==e?t:`${t} ${e.class}`}var tM=class extends vh{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 t=s.split(/\s+/g).map(Number);this.commands.push([i,t])}this.checkPathDirty()}}updatePath(){const{path:t,x:e,y:i}=this;t.clear();let s=e,n=i;for(const[a,o]of this.commands)switch(a){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 '${a}' with '${o.join(" ")}'`)}t.closePath()}};r([H()],tM.prototype,"x",2),r([H()],tM.prototype,"y",2);var eM=class extends J{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)}};r([H()],eM.prototype,"x",2),r([H()],eM.prototype,"y",2),r([H()],eM.prototype,"width",2),r([H()],eM.prototype,"height",2),r([H()],eM.prototype,"opacity",2);var iM={};o(iM,{ButtonWidget:()=>Ns,MenuItemWidget:()=>sM,MenuWidget:()=>aM,NativeWidget:()=>Ps,SliderWidget:()=>Ws,ToolbarWidget:()=>Ks,WIDGET_HTML_EVENTS:()=>di,Widget:()=>Ii,WidgetEventUtil:()=>mi});var sM=class extends Ts{constructor(){super((0,s.n)("div"),"menuitem")}},nM=["Escape","ArrowLeft"],aM=class t extends Rs{constructor(t="vertical"){super(t,"menu"),this.closeSubMenu=t=>this.openSubMenu(t,void 0)}destructor(){this.selfClose("2")}addSeparator(){const t=(0,s.YE)().createElement("div");return(0,s.Bq)(t,"role","separator"),this.elem.appendChild(t),t}onChildAdded(t){super.onChildAdded(t),t.hasPopup()||t.addListener("mouseenter",this.closeSubMenu)}onChildRemoved(t){super.onChildRemoved(t),t.hasPopup()||t.removeListener("mouseenter",this.closeSubMenu)}addSubMenu(){const e=new sM,i=(0,s.wW)(),n=new t(this.orientation),a=t=>{e.isDisabled()||this.openSubMenu(t,n)};return e.setAriaHasPopup("menu"),e.setAriaExpanded(!1),e.setAriaControls(i),e.addListener("click",a),e.addListener("mouseenter",a),e.addListener("keydown",t=>{rs(t.sourceEvent)&&"ArrowRight"===t.sourceEvent.code&&a(t)}),n.addListener("close-widget",()=>e.setAriaExpanded(!1)),n.addListener("open-widget",()=>e.setAriaExpanded(!0)),n.id=i,this.addChild(e),{subMenuButton:e,subMenu:n}}openSubMenu(t,e){const{openScope:i}=this;i&&(i.openSubMenu?.selfClose("4"),e?.open(t),i.openSubMenu=e)}open(t,e){const{overrideFocusVisible:i}=e??{};if(null!=this.openScope)return;this.openScope={lastFocus:fs(t.sourceEvent),openSubMenu:void 0,abort:()=>this.selfClose("1"),close:()=>this.selfClose("0"),removers:new $i};const n=this.children.map(t=>t.getElement());(0,s.Bq)(this.openScope.lastFocus,"aria-expanded",!0),ss(this.openScope.removers,this.elem,this.openScope.abort),ns(this.openScope.removers,this.elem,this.openScope.abort);for(const t of this.children)is(this.openScope.removers,t.getElement(),this.openScope.close,nM);void 0!==i&&os(this.openScope.removers,this.elem,n,i),this.internalListener?.dispatch("open-widget",this,{type:"open-widget"}),this.children[0]?.focus({preventScroll:!0})}selfClose(t){if(void 0===this.openScope)return;const{lastFocus:e,removers:i,openSubMenu:n}=this.openScope;this.openScope=void 0,n?.selfClose("3"),(0,s.Bq)(e,"aria-expanded",!1),"0"===t&&e?.focus({preventScroll:!0}),i.destroy(),this.internalListener?.dispatch("close-widget",this,{type:"close-widget"})}close(){this.selfClose("0")}},oM="canvas-overlay",rM=class extends l{constructor(t,e,i){super(),this.ctx=t,this.hideFns=[],this.moduleId=`popover-${e}`,this.element=i?.detached?(0,s.n)("div"):t.domManager.addChild(oM,this.moduleId),this.element.setAttribute("role","presentation"),this.destroyFns.push(()=>t.domManager.removeChild(oM,this.moduleId))}attachTo(t){this.element.parentElement||t.element.append(this.element)}hide(t){const{lastFocus:e=this.lastFocus}=t??{};0!==this.element.children.length&&(this.hideFns.forEach(t=>t()),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=(0,s.n)("div","ag-charts-popover");if(null!=e.ariaLabel&&i.setAttribute("aria-label",e.ariaLabel),null!=e.class&&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 t=fs(e.sourceEvent);void 0!==t&&(this.lastFocus=t,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"),null!=t.x&&e.style.setProperty("left",`${Math.floor(t.x)}px`),null!=t.y&&e.style.setProperty("top",`${Math.floor(t.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},lM=class extends rM{setAnchor(t,e){this.anchor=t,this.fallbackAnchor=e,this.updatePosition(t),this.repositionWithinBounds()}showWithChildren(t,e){const i=e.anchor??this.anchor,n=e.fallbackAnchor??this.fallbackAnchor,a=super.showWithChildren(t,e);return i&&this.setAnchor(i,n),(0,s.zk)().requestAnimationFrame(()=>{this.repositionWithinBounds()}),a}repositionWithinBounds(){const{anchor:t,ctx:e,fallbackAnchor:i}=this,n=this.getPopoverElement();if(!t||!n)return;const a=e.domManager.getBoundingClientRect(),{offsetWidth:o,offsetHeight:r}=n;let l=(0,s.qE)(0,t.x,a.width-o),h=(0,s.qE)(0,t.y,a.height-r);l!==t.x&&null!=i?.x&&(l=(0,s.qE)(0,i.x-o,a.width-o)),h!==t.y&&null!=i?.y&&(h=(0,s.qE)(0,i.y-r,a.height-r)),this.updatePosition({x:l,y:h})}},hM=class extends lM{show(t){const e=t.items.map(e=>this.createRow(t,e)),i=this.showWithChildren(e,t);i.classList.add("ag-charts-menu"),i.setAttribute("role","menu"),this.menuCloser=gs({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,n=e.value===t.value,a=(0,s.n)("div","ag-charts-menu__row");if(a.setAttribute("role",i),"menuitemradio"===i&&a.setAttribute("aria-checked",(t.value===e.value).toString()),"string"==typeof e.value&&(a.dataset.popoverId=e.value),a.classList.toggle("ag-charts-menu__row--active",n),null!=e.icon){const t=(0,s.n)("span",`ag-charts-menu__icon ${Pe(e.icon)}`);a.appendChild(t)}const o=null!=e.strokeWidth;if(o&&(a.classList.toggle("ag-charts-menu__row--stroke-width-visible",o),a.style.setProperty("--strokeWidth",o?`${e.strokeWidth}px`:null)),null!=e.label){const t=(0,s.n)("span","ag-charts-menu__label");t.textContent=this.ctx.localeManager.t(e.label),a.appendChild(t)}"altText"in e&&(a.ariaLabel=this.ctx.localeManager.t(e.altText));const r=i=>{ys(i)&&(t.onPress?.(e),i.preventDefault(),i.stopPropagation())};return a.addEventListener("keydown",r),a.addEventListener("click",r),a.addEventListener("mousemove",()=>{a.focus({preventScroll:!0})}),a}},cM=class extends rM{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:AS.from(t.clientX,t.clientY),position:AS.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=AS.sub(AS.from(t.clientX,t.clientY),e.client),n=AS.add(e.position,s),a=this.ctx.domManager.getBoundingClientRect(),o={};n.x>=0&&n.x+i.offsetWidth<=a.width&&(o.x=n.x),n.y>=0&&n.y+i.offsetHeight<=a.height&&(o.y=n.y),this.updatePosition(o)}onDragEnd(){this.dragStartState=void 0}},dM=class extends Lt{};r([Ct],dM.prototype,"icon",2),r([Ct],dM.prototype,"label",2),r([Ct],dM.prototype,"ariaLabel",2),r([Ct],dM.prototype,"tooltip",2);var uM=class extends Ns{constructor(t){super(),this.localeManager=t}update(t){const{localeManager:e}=this;t.tooltip&&(this.elem.title=e.t(t.tooltip));let i="";null!=t.icon&&(i=`<span class="${Pe(t.icon)} ag-charts-toolbar__icon"></span>`),null!=t.label&&(i=`${i}<span class="ag-charts-toolbar__label">${e.t(t.label)}</span>`),this.elem.innerHTML=i}setChecked(t){(0,s.Bq)(this.elem,"aria-checked",t)}},pM="ag-charts-toolbar__button--active",gM=class extends Ks{constructor(t,e="horizontal"){super(e),this.localeManager=t,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new Qi,this.hasPrefix=!1,this.buttonWidgets=[],this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal","horizontal"===e),this.toggleClass("ag-charts-toolbar--vertical","vertical"===e)}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[e,i]of t.entries())(this.buttonWidgets.at(e)??this.createButton(e,i)).update(i);for(let i=t.length;i<e.length;i++){const t=this.buttonWidgets.at(i);t?.destroy()}this.buttonWidgets.splice(t.length),this.refreshButtonClasses()}updateButtonByIndex(t,e){this.buttonWidgets.at(t)?.update(e)}clearActiveButton(){for(const t of this.buttonWidgets)t.toggleClass(pM,!1)}toggleActiveButtonByIndex(t){if(-1!==t)for(const[e,i]of this.buttonWidgets.entries())i.toggleClass(pM,null!=t&&t===e)}toggleButtonEnabledByIndex(t,e){-1!==t&&this.buttonWidgets.at(t)?.setEnabled(e)}toggleSwitchCheckedByIndex(t,e){-1!==t&&this.buttonWidgets.at(t)?.setChecked(e)}getButtonBounds(){return this.buttonWidgets.map(t=>this.getButtonWidgetBounds(t))}setButtonHiddenByIndex(t,e){this.buttonWidgets.at(t)?.setHidden(e)}getButtonWidgetBounds(t){const e=this.getBounds(),i=t.getBounds();return new y(i.x+e.x,i.y+e.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:t,hasPrefix:e}=this;let i,s,n;for(const[a,o]of t.entries())i=!e&&0===a||n!=o.section,s=a===t.length-1||o.section!=t.at(a+1)?.section,o.toggleClass("ag-charts-toolbar__button--first",i),o.toggleClass("ag-charts-toolbar__button--last",s),o.toggleClass("ag-charts-toolbar__button--gap",a>0&&i),n=o.section}createButton(t,e){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const n={index:t,...e instanceof Lt?e.toJson():e},a=this.getButtonWidgetBounds(i);this.events.dispatch("button-pressed",{event:s,button:n,buttonBounds:a})}),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}},mM=class extends gM{createButtonWidget(){return new uM(this.localeManager)}},yM=class extends cM{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 y(t?.offsetLeft??0,t?.offsetTop??0,t?.offsetWidth??0,t?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(t,e,i){const s=this.getPopoverElement();if(!s)return;const n=t.position??"above",{offsetWidth:a,offsetHeight:o}=s;let r=t.y-o-i,l=t.x-a/2;"below"===n?r=t.y+i:"right"===n?(r=t.y-o/2,l=t.x+e):"above-left"===n&&(l=t.x),this.updatePosition({x:l,y:r})}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((0,s.qE)(0,t.x,i.width-e.width)),t.y=Math.floor((0,s.qE)(0,t.y,i.height-e.height)),super.updatePosition(t),this.onPopoverMoved()}},fM=class extends gM{constructor(t,e){super(t.localeManager),this.hasPrefix=!0,this.popover=new yM(t,e,this.onPopoverMoved.bind(this)),this.dragHandle=new xM(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 y(i.x+e.x-s.width,i.y+e.y,i.width,i.height)}},xM=class extends Ps{constructor(t){super((0,s.n)("div","ag-charts-floating-toolbar__drag-handle"));const e=new Ps((0,s.n)("span",`${Pe("drag-handle")} ag-charts-toolbar__icon`));e.setAriaHidden(!0),this.addChild(e),this.elem.title=t}},bM={...ar,...cr};yS.create.bind(yS),yS.__createSparkline.bind(yS)},40682(t,e,i){"use strict";i.r(e),i.d(e,{AgChart:()=>wm,AgCharts:()=>Dm,AgErrorBarSupportedSeriesTypes:()=>D,AgTooltipPositionType:()=>w,Marker:()=>md,VERSION:()=>Lm,_ModuleSupport:()=>Wm,_Scale:()=>Gm,_Scene:()=>Am,_Theme:()=>Fm,_Util:()=>_m,__FORCE_MODULE_DETECTION:()=>I,time:()=>C});var s=Object.defineProperty,n=Object.defineProperties,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,l=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,d=Reflect.get,u=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),p=Math.pow,g=(t,e,i)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,m=(t,e)=>{for(var i in e||(e={}))h.call(e,i)&&g(t,i,e[i]);if(r)for(var i of r(e))c.call(e,i)&&g(t,i,e[i]);return t},y=(t,e)=>n(t,o(e)),f=(t,e)=>{var i={};for(var s in t)h.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&r)for(var s of r(t))e.indexOf(s)<0&&c.call(t,s)&&(i[s]=t[s]);return i},x=(t,e)=>{for(var i in e)s(t,i,{get:e[i],enumerable:!0})},b=(t,e,i,n)=>{for(var o,r=n>1?void 0:n?a(e,i):e,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(n?o(e,i,r):o(r))||r);return n&&r&&s(e,i,r),r},v=(t,e,i)=>d(l(t),i,e),S=(t,e,i)=>new Promise((s,n)=>{var a=t=>{try{r(i.next(t))}catch(t){n(t)}},o=t=>{try{r(i.throw(t))}catch(t){n(t)}},r=t=>t.done?s(t.value):Promise.resolve(t.value).then(a,o);r((i=i.apply(t,e)).next())}),M=function(t,e){this[0]=t,this[1]=e},k=t=>{var e,i=t[u("asyncIterator")],s=!1,n={};return null==i?(i=t[u("iterator")](),e=t=>n[t]=e=>i[t](e)):(i=i.call(t),e=t=>n[t]=e=>{if(s){if(s=!1,"throw"===t)throw e;return e}return s=!0,{done:!1,value:new M(new Promise(s=>{var n=i[t](e);if(!(n instanceof Object))throw TypeError("Object expected");s(n)}),1)}}),n[u("iterator")]=()=>n,e("next"),"throw"in i?e("throw"):n.throw=t=>{throw t},"return"in i&&e("return"),n},D=["bar","line","scatter"],w=(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))(w||{}),I=0,C={};x(C,{day:()=>J,friday:()=>rt,hour:()=>q,millisecond:()=>B,minute:()=>U,monday:()=>st,month:()=>ct,saturday:()=>lt,second:()=>Y,sunday:()=>it,thursday:()=>ot,tuesday:()=>nt,utcDay:()=>yt,utcHour:()=>mt,utcMinute:()=>gt,utcMonth:()=>ft,utcYear:()=>xt,wednesday:()=>at,year:()=>ut});var L=new Map;function A(t,e){L.has(e)||(L.set(e,!0),t())}function T(t){return t}function*N(...t){for(const e of t)yield*k(e)}function O(t,e=0,i){const{leading:s=!0,trailing:n=!0}=null!=i?i:{};let a,o,r=!1;function l(){n&&o?(a=setTimeout(l,e),t(...o)):r=!1,o=null}return Object.assign(function(...i){r?o=i:(r=!0,a=setTimeout(l,e),s?t(...i):o=i)},{cancel(){clearTimeout(a),r=!1,o=null}})}A.clear=()=>L.clear();var R={log(...t){console.log(...t)},warn(t,...e){console.warn(`AG Charts - ${t}`,...e)},error(t,...e){"object"==typeof t?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)},table(...t){console.table(...t)},warnOnce(t,...e){A(()=>R.warn(t,...e),`Logger.warn: ${t}`)},errorOnce(t,...e){A(()=>R.error(t,...e),`Logger.error: ${t}`)}},E=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,i){var s;const n=null==(s=this._rangeCallback)?void 0:s.call(this,t,e),a=this._encode(i?this.floor(t):this.ceil(t)),o=this._encode(i?this.ceil(e):this.floor(e));if(o<a)return[];const r=[];for(let t=a;t<=o;t++){const e=this._decode(t);r.push(e)}return null==n||n(),r}},P=class extends E{getOffset(t,e){const i="number"==typeof t||t instanceof Date?this._encode(new Date(t)):0;return Math.floor(i)%e}every(t,e){let i,s=0;const n=t;n!==(t=Math.max(1,Math.round(t)))&&R.warnOnce(`interval step of [${n}] rounded to [${t}].`);const{snapTo:a="start"}=null!=e?e:{};if("string"==typeof a){const e=s;i=(i,n)=>{const o="start"===a?i:n;return s=this.getOffset(o,t),()=>s=e}}else"number"==typeof a?s=this.getOffset(new Date(a),t):a instanceof Date&&(s=this.getOffset(a,t));return new E(e=>{const i=this._encode(e);return Math.floor((i-s)/t)},e=>this._decode(e*t+s),i)}},B=new P(function(t){return t.getTime()},function(t){return new Date(t)}),F=B,z=(new Date(0).getFullYear(),1e3),G=6e4,_=36e5,j=864e5,W=6048e5,V=31536e6,K=(new Date).getTimezoneOffset()*G,Y=new P(function(t){return Math.floor((t.getTime()-K)/z)},function(t){return new Date(K+t*z)}),$=Y,H=(new Date).getTimezoneOffset()*G,U=new P(function(t){return Math.floor((t.getTime()-H)/G)},function(t){return new Date(H+t*G)}),X=U,Z=(new Date).getTimezoneOffset()*G,q=new P(function(t){return Math.floor((t.getTime()-Z)/_)},function(t){return new Date(Z+t*_)}),Q=q,J=new P(function(t){const e=t.getTimezoneOffset()*G;return Math.floor((t.getTime()-e)/j)},function(t){const e=new Date(1970,0,1);return e.setDate(e.getDate()+t),e}),tt=J;function et(t){const e=(7+t-4)%7;return new P(function(t){const i=t.getTimezoneOffset()*G;return Math.floor((t.getTime()-i)/W-e/7)},function(t){const i=new Date(1970,0,1);return i.setDate(i.getDate()+7*t+e),i})}var it=et(0),st=et(1),nt=et(2),at=et(3),ot=et(4),rt=et(5),lt=et(6),ht=it,ct=new P(function(t){return 12*t.getFullYear()+t.getMonth()},function(t){const e=Math.floor(t/12);return new Date(e,t-12*e,1)}),dt=ct,ut=new P(function(t){return t.getFullYear()},function(t){const e=new Date;return e.setFullYear(t),e.setMonth(0,1),e.setHours(0,0,0,0),e}),pt=ut,gt=new P(function(t){return Math.floor(t.getTime()/G)},function(t){return new Date(t*G)}),mt=new P(function(t){return Math.floor(t.getTime()/_)},function(t){return new Date(t*_)}),yt=new P(function(t){return Math.floor(t.getTime()/j)},function(t){const e=new Date(0);return e.setUTCDate(e.getUTCDate()+t),e.setUTCHours(0,0,0,0),e}),ft=new P(function(t){return 12*t.getUTCFullYear()+t.getUTCMonth()},function(t){const e=Math.floor(t/12),i=t-12*e;return new Date(Date.UTC(e,i,1))}),xt=new P(function(t){return t.getUTCFullYear()},function(t){const e=new Date;return e.setUTCFullYear(t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0),e}),bt={isEnterprise:!1},vt=class{constructor(){this.destroyFns=[]}destroy(){for(const t of this.destroyFns)t()}},St=new class{constructor(){this.modules=[],this.dependencies=new Set,this.dependents=new Set}register(...t){for(const e of t){this.registerDependencies(e);const t=this.modules.find(t=>e.type===t.type&&e.optionsKey===t.optionsKey&&e.identifier===t.identifier);if(t){if("enterprise"===e.packageType&&"community"===t.packageType){const i=this.modules.indexOf(t);this.modules.splice(i,1,e)}}else this.modules.push(e)}}hasEnterpriseModules(){return this.modules.some(t=>"enterprise"===t.packageType)}*byType(...t){for(const e of this.modules)t.includes(e.type)&&this.dependencies.has(e.optionsKey)&&(yield e);for(const e of this.modules)!t.includes(e.type)||this.dependencies.has(e.optionsKey)||this.dependents.has(e.optionsKey)||(yield e);for(const e of this.modules)t.includes(e.type)&&this.dependents.has(e.optionsKey)&&(yield e)}registerDependencies(t){if(null!=t.dependencies&&0!==t.dependencies.length){if(this.dependencies.has(t.optionsKey))throw new Error(`Module [${t.optionsKey}] can not both be depended upon by any module and have dependencies of [${t.dependencies}].`);for(const e of t.dependencies){if(this.dependents.has(e))throw new Error(`Module [${e}] can not both be depended upon by any module and have dependencies of [${t.optionsKey}].`);this.dependencies.add(e)}this.dependents.add(t.optionsKey)}}},Mt=new class{constructor(){this.axesMap=new Map,this.hidden=new Set,this.themeTemplates=new Map}register(t,e){this.axesMap.set(t,e.instanceConstructor),e.themeTemplate&&this.setThemeTemplate(t,e.themeTemplate),e.hidden&&this.hidden.add(t)}create(t,e){const i=this.axesMap.get(t);if(i)return new i(e);throw new Error(`AG Charts - unknown axis type: ${t}`)}has(t){return this.axesMap.has(t)}keys(){return this.axesMap.keys()}publicKeys(){return[...this.keys()].filter(t=>!this.hidden.has(t))}setThemeTemplate(t,e){return this.themeTemplates.set(t,e),this}getThemeTemplate(t){return this.themeTemplates.get(t)}},kt=Symbol("BREAK"),Dt="__decorator_config";function wt(t,e){null==Object.getOwnPropertyDescriptor(t,Dt)&&Object.defineProperty(t,Dt,{value:{}});const i=t[Dt],s=e.toString();if(void 0!==i[s])return i[s];const n=new WeakMap;i[s]={setters:[],getters:[],observers:[],valuesMap:n};const a=Object.getOwnPropertyDescriptor(t,e),o=null==a?void 0:a.set,r=null==a?void 0:a.get;return Object.defineProperty(t,e,{set:function(t){const{setters:a,observers:l}=i[s];let h;a.some(t=>t.length>2)&&(h=r?r.call(this):n.get(this));for(const i of a)if((t=i(this,e,t,h))===kt)return;o?o.call(this,t):n.set(this,t);for(const e of l)e(this,t,h)},get:function(){let t=r?r.call(this):n.get(this);for(const n of i[s].getters)if(t=n(this,e,t),t===kt)return;return t},enumerable:!0,configurable:!1}),i[s]}function It(t,e,i){return(s,n)=>{const a=wt(s,n);a.setters.push(t),e&&a.getters.unshift(e),i&&Object.assign(a,i)}}function Ct(t){return void 0!==t&&Dt in t}function Lt(t){const e=new Set;for(;Ct(t);)e.add(null==t?void 0:t[Dt]),t=Object.getPrototypeOf(t);return Array.from(e).flatMap(t=>Object.keys(t))}function At(t){return Lt(t).reduce((e,i)=>{var s;return e[i]=null!=(s=t[i])?s:null,e},{})}function Tt(t){return null!=t}function Nt(t){return Array.isArray(t)}function Ot(t){return"boolean"==typeof t}function Rt(t){return t instanceof Date}function Et(t){return Rt(t)&&!isNaN(Number(t))}function Pt(t){return t instanceof RegExp}function Bt(t){return"function"==typeof t}function Ft(t){return"object"==typeof t&&null!==t&&!Nt(t)}function zt(t){return Nt(t)||Gt(t)}function Gt(t){return"object"==typeof t&&null!==t&&t.constructor===Object}function _t(t){return"string"==typeof t}function jt(t){return"number"==typeof t}function Wt(t){return jt(t)&&Number.isFinite(t)}function Vt(t){return"undefined"!=typeof window&&t instanceof HTMLElement}function Kt(t,e){return _t(e)&&Object.keys(t).includes(e)}function Yt(t,e){return Object.values(t).includes(e)}function $t(t){return"symbol"==typeof t}function Ht(...t){return Ut(...t.reverse())}function Ut(...t){const e={};for(const i of t){if(!Ft(i))continue;const t=Ct(i)?Lt(i):Object.keys(i);for(const s of t)Gt(e[s])&&Gt(i[s])?e[s]=Ut(e[s],i[s]):null!=e[s]||(e[s]=i[s])}return e}function Xt(t,...e){return e&&Nt(t)?t.map(t=>Ut(t,...e)):t}function Zt(t,e){return Object.entries(t).reduce((i,[s,n])=>(i[s]=e(n,s,t),i),{})}function qt(t,e){const i=m({},t);for(const t of e)delete i[t];return i}function Qt(t,e){return(Nt(e)?e:e.split(".")).reduce((t,e)=>t[e],t)}var Jt=new Set(["__proto__","constructor","prototype"]);function te(t,e,i){const s=Nt(e)?e.slice():e.split("."),n=s.pop();s.some(t=>Jt.has(t))||(s.reduce((t,e)=>t[e],t)[n]=i)}function ee(t,e,i){if(void 0===i)return e;for(const s of t){const t=i[s];void 0!==t&&(e[s]=t)}return e}var ie=class extends Map{get(t){var e;return null!=(e=super.get(t))?e:"unknown"}isCartesian(t){return"cartesian"===this.get(t)}isPolar(t){return"polar"===this.get(t)}isHierarchy(t){return"hierarchy"===this.get(t)}isTopology(t){return"topology"===this.get(t)}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))}},se=class extends Map{set(t,e){return super.set(t,Ut(e,this.get(t)))}},ne=new ie,ae=new ie,oe=new se,re=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology"],optionsInnerKey:"image"},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"],optionsInnerKey:"miniChart"},{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:"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:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bullet"},{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-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"}];function le(t){var e;return null==(e=re.find(e=>"series"===e.type&&e.identifier===t))?void 0:e.chartTypes}function he(t){if(!function(t){return"enterprise"===t.packageType}(t))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const e=re.find(e=>e.type===t.type&&e.optionsKey===t.optionsKey&&e.identifier===t.identifier&&t.chartTypes.every(t=>e.chartTypes.includes(t)));return e&&(null!=e.useCount||(e.useCount=0),e.useCount++),null!=e}function ce(t){var e,i,s;return null!=(s=null==(i=null==(e=t.series)?void 0:e[0])?void 0:i.type)?s:"line"}function de(t){const e=ce(t);return null==e||("cartesian"===e?(R.warnOnce(`type '${e}' is deprecated, use a series type instead`),!0):ne.isCartesian(e)||"cartesian"===(null==(i=le(e))?void 0:i.find(t=>"cartesian"===t)));var i}function ue(t){const e=ce(t);return null!=e&&("polar"===e?(R.warnOnce(`type '${e}' is deprecated, use a series type instead`),!0):ne.isPolar(e)||"polar"===(null==(i=le(e))?void 0:i.find(t=>"polar"===t)));var i}function pe(t){const e=ce(t);return null!=e&&("hierarchy"===e?(R.warnOnce(`type '${e}' is deprecated, use a series type instead`),!0):ne.isHierarchy(e)||"hierarchy"===(null==(i=le(e))?void 0:i.find(t=>"hierarchy"===t)));var i}function ge(t){const e=ce(t);return null!=e&&("topology"===e?(R.warnOnce(`type '${e}' is deprecated, use a series type instead`),!0):ne.isTopology(e)||"topology"===(null==(i=le(e))?void 0:i.find(t=>"topology"===t)));var i}function me(t){return null!=t&&Mt.has(t)}var ye=class{set(t){const{className:e=this.constructor.name}=this.constructor;if("object"!=typeof t)return R.warn(`unable to set ${e} - expecting a properties object`),this;const i=new Set(Object.keys(t));for(const e of Lt(this))if(i.has(e)){const s=t[e],n=this;xe(n[e])?n[e]=n[e]instanceof fe?n[e].reset(s):n[e].set(s):n[e]=s,i.delete(e)}for(const t of i)R.warn(`unable to set [${t}] in ${e} - property is unknown`);return this}isValid(){return Lt(this).every(t=>{const{optional:e}=function(t,e){const i=e.toString();for(;Ct(t);){const e=t[Dt];if(Object.hasOwn(e,i))return e[i];t=Object.getPrototypeOf(t)}}(this,t),i=e||void 0!==this[t];return i||R.warnOnce(`[${t}] is required.`),i})}toJson(){return Lt(this).reduce((t,e)=>{const i=this[e];return t[e]=xe(i)?i.toJson():i,t},{})}},fe=class t extends Array{constructor(t,...e){super(e.length),Object.defineProperty(this,"itemFactory",{value:t,enumerable:!1,configurable:!1}),this.set(e)}set(t){if(Nt(t)){this.length=t.length;for(let e=0;e<t.length;e++)this[e]=(new this.itemFactory).set(t[e])}return this}reset(e){return new t(this.itemFactory,...e)}toJson(){return this.map(t=>{var e,i;return null!=(i=null==(e=null==t?void 0:t.toJson)?void 0:e.call(t))?i:t})}};function xe(t){return t instanceof ye||t instanceof fe}var be="class-instance";function ve(t,e,i){if(Nt(e)){if(!Nt(t)||t.length!==e.length||e.some((e,i)=>null!=ve(t[i],e)))return e}else{if(Gt(e)){if(!Gt(t))return e;const s={},n=new Set([...Object.keys(t),...Object.keys(e)]);for(const a of n)if(t[a]!==e[a]&&!(null==i?void 0:i.includes(a)))if(typeof t[a]==typeof e[a]){const i=ve(t[a],e[a]);null!==i&&(s[a]=i)}else s[a]=e[a];return Object.keys(s).length?s:null}if(t!==e)return e}return null}function Se(t,e){return Nt(t)?t.map(t=>Se(t,e)):Gt(t)?Zt(t,(t,i)=>{var s;return(null==(s=null==e?void 0:e.shallow)?void 0:s.includes(i))?Me(t):Se(t,e)}):Me(t)}function Me(t){return Nt(t)?[...t]:Gt(t)?m({},t):Rt(t)?new Date(t):Pt(t)?new RegExp(t.source,t.flags):t}function ke(t,e,i,...s){var n;if(Nt(t))e(t,...s),t.forEach((t,n)=>{ke(t,e,i,...we(s,n))});else if(Gt(t)){e(t,...s);for(const a of Object.keys(t)){if(null==(n=null==i?void 0:i.skip)?void 0:n.includes(a))continue;const o=t[a];(Nt(o)||Gt(o))&&ke(o,e,i,...we(s,a))}}}function De(t,e,i={}){const{path:s,constructedArrays:n,matcherPath:a=(null==s?void 0:s.replace(/(\[[0-9+]+])/i,"[]")),skip:o=[]}=i;if(null==t)throw new Error(`AG Charts - target is uninitialised: ${null!=s?s:"<root>"}`);if(null==e)return t;if(xe(t))return t.set(e);const r=t,l=Ie(t);for(const h in e){if(Jt.has(h))continue;const c=`${a?a+".":""}${h}`;if(o.includes(c))continue;const d=e[h],u=`${s?s+".":""}${h}`,p=r.constructor,g=r[h];let f;try{const e=Ie(g),s=Ie(d);if(l===be&&!(h in t)){R.warn(`unable to set [${u}] in ${null==p?void 0:p.name} - property is unknown`);continue}if(null!=e&&null!=s&&s!==e&&(e!==be||"object"!==s)){R.warn(`unable to set [${u}] in ${null==p?void 0:p.name} - can't apply type of [${s}], allowed types are: [${e}]`);continue}if(xe(g))r[h].set(d);else if("array"===s)if(null!=f||(f=null==n?void 0:n.get(g)),null==f)r[h]=d;else{const t=d;r[h]=t.map(t=>De(new f,t,y(m({},i),{path:u,matcherPath:c+"[]"})))}else s===be?r[h]=d:"object"===s?null!=g?De(g,d,y(m({},i),{path:u,matcherPath:c})):null==f?(r[h]={},De(r[h],d,y(m({},i),{path:u,matcherPath:c}))):r[h]=De(new f,d,y(m({},i),{path:u,matcherPath:c})):r[h]=d}catch(t){R.warn(`unable to set [${u}] in [${null==p?void 0:p.name}]; nested error is: ${t.message}`)}}return t}function we(t,e){return t.map(t=>null==t?void 0:t[e])}function Ie(t){return null==t?null:Vt(t)||Rt(t)?"primitive":Nt(t)?"array":Ft(t)?Gt(t)?"object":be:Bt(t)?"function":"primitive"}var Ce=new class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(t,{chartTypes:[e],instanceConstructor:i,defaultAxes:s,themeTemplate:n,enterpriseThemeTemplate:a,paletteFactory:o,solo:r,stackable:l,groupable:h,stackedByDefault:c,swapDefaultAxesCondition:d,hidden:u}){this.setThemeTemplate(t,n,a),this.seriesMap.set(t,{instanceConstructor:i,defaultAxes:s,paletteFactory:o,solo:r,stackable:l,groupable:h,stackedByDefault:c,swapDefaultAxesCondition:d}),ne.set(t,e),u||ae.set(t,e)}create(t,e){var i;const s=null==(i=this.seriesMap.get(t))?void 0:i.instanceConstructor;if(s)return new s(e);throw new Error(`AG Charts - unknown series type: ${t}`)}cloneDefaultAxes(t){var e;const i=null==(e=this.seriesMap.get(t))?void 0:e.defaultAxes;return i?{axes:Se(i)}:null}setThemeTemplate(t,e,i={}){const s=this.themeTemplates.get(t);this.themeTemplates.set(t,{community:Ut(e,null==s?void 0:s.community),enterprise:Ut(i,e,null==s?void 0:s.community)})}getThemeTemplate(t){const e=this.themeTemplates.get(t);return bt.isEnterprise?null==e?void 0:e.enterprise:null==e?void 0:e.community}getPaletteFactory(t){var e;return null==(e=this.seriesMap.get(t))?void 0:e.paletteFactory}isSolo(t){var e,i;return null!=(i=null==(e=this.seriesMap.get(t))?void 0:e.solo)&&i}isGroupable(t){var e,i;return null!=(i=null==(e=this.seriesMap.get(t))?void 0:e.groupable)&&i}isStackable(t){var e,i;return null!=(i=null==(e=this.seriesMap.get(t))?void 0:e.stackable)&&i}isStackedByDefault(t){var e,i;return null!=(i=null==(e=this.seriesMap.get(t))?void 0:e.stackedByDefault)&&i}isDefaultAxisSwapNeeded(t){var e,i,s;let n;for(const a of null!=(e=t.series)?e:[]){const{type:t="line"}=a,e=null==(s=null==(i=this.seriesMap.get(t))?void 0:i.swapDefaultAxesCondition)?void 0:s.call(i,a);if(null!=e){if(null!=n&&n!=e)throw new Error("AG Charts - The provided series have incompatible directions");n=e}}return n}},Le=new class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(t,{optionsKey:e,instanceConstructor:i,themeTemplate:s}){this.legendMap.set(t,{optionsKey:e,instanceConstructor:i}),this.themeTemplates.set(e,s)}create(t,e){var i;const s=null==(i=this.legendMap.get(t))?void 0:i.instanceConstructor;if(s)return new s(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),{})}},Ae=(t=>(t[t.SMALL=12]="SMALL",t[t.MEDIUM=13]="MEDIUM",t[t.LARGE=17]="LARGE",t))(Ae||{}),Te=(t=>(t.NORMAL="normal",t.BOLD="bold",t.BOLDER="bolder",t.LIGHTER="lighter",t))(Te||{}),Ne=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t))(Ne||{}),Oe=(t=>(t.CATEGORY="category",t.ORDINAL_TIME="ordinal-time",t.NUMBER="number",t.TIME="time",t.LOG="log",t))(Oe||{}),Re=(t=>(t.ANGLE_CATEGORY="angle-category",t.ANGLE_NUMBER="angle-number",t.RADIUS_CATEGORY="radius-category",t.RADIUS_NUMBER="radius-number",t))(Re||{}),Ee=(t=>(t.CIRCLE="circle",t.POLYGON="polygon",t))(Ee||{}),Pe={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Be={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},Fe=Symbol("is-dark-theme"),ze=Symbol("extends-axes-defaults"),Ge=Symbol("extends-axes-line-defaults"),_e=Symbol("extends-axes-tick-defaults"),je=Symbol("extends-axes-grid-line-defaults"),We=Symbol("extends-series-defaults"),Ve=Symbol("extends-cartesian-marker-defaults"),Ke=Symbol("default-font"),Ye=Symbol("default-label-colour"),$e=Symbol("default-inverted-label-colour"),He=Symbol("default-inside-series-label-colour"),Ue=Symbol("default-muted-label-colour"),Xe=Symbol("default-axis-grid-colour"),Ze=Symbol("default-axis-line-colour"),qe=Symbol("default-cross-lines-colour"),Qe=Symbol("default-background-colour"),Je=Symbol("default-shadow-colour"),ti=Symbol("default-colours"),ei=Symbol("default-waterfall-series-positive-colors"),ii=Symbol("default-waterfall-series-negative-colors"),si=Symbol("default-waterfall-series-total-colors"),ni=Symbol("default-waterfall-series-connector-line-stroke"),ai=Symbol("default-polar-series-stroke"),oi=Symbol("default-diverging-series-colour-range"),ri=Symbol("default-hierarchy-fills"),li=Symbol("default-hierarchy-strokes"),hi=Symbol("default-annotation-stroke"),ci=Symbol("default-annotation-background-fill"),di=Symbol("default-annotation-handle-fill"),ui="white",pi={fills:Object.values(Pe),strokes:Object.values(Be)},gi={get cartesian(){return{seriesTypes:ne.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:ne.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:ne.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:ne.topologyTypes,commonOptions:[]}}},mi=Object.values(gi).reduce((t,{commonOptions:e})=>t.concat(e),[]),yi=class t{getPalette(){return pi}static getAxisDefaults(t){return Ut(t,{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:"normal",fontSize:13,fontFamily:Ke,color:Ye},label:{fontSize:12,fontFamily:Ke,padding:5,color:Ye,avoidCollisions:!0},line:{enabled:!0,width:1,color:Ze},tick:{enabled:!1,width:1,color:Ze},gridLine:{enabled:!0,style:[{stroke:Xe,lineDash:[]}]},crossLines:{enabled:!1,fill:qe,stroke:qe,fillOpacity:.1,strokeWidth:1,label:{enabled:!1,fontSize:12,fontFamily:Ke,padding:5,color:Ye}}})}static getSeriesDefaults(){return{visible:!0,showInLegend:!0,highlightStyle:{item:{fill:"#ffffff54",stroke:"#0006",strokeWidth:2},series:{dimOpacity:1}},nodeClickRange:"exact",tooltip:{enabled:!0}}}static getCartesianSeriesMarkerDefaults(){return{enabled:!0,shape:"circle",size:7,strokeWidth:1}}static getChartDefaults(){return{background:{visible:!0,fill:Qe},padding:{top:20,right:20,bottom:20,left:20},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",fontWeight:"normal",fontSize:17,fontFamily:Ke,color:Ye,wrapping:"hyphenate"},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontSize:13,fontFamily:Ke,color:Ue,wrapping:"hyphenate"},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:13,fontFamily:Ke,color:"rgb(140, 140, 140)",wrapping:"hyphenate"},legend:{position:"bottom",spacing:30,listeners:{},item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},toggleSeriesVisible:!0,label:{color:Ye,fontSize:12,fontFamily:Ke}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:Ye},inactiveStyle:{fill:Ue},highlightStyle:{fill:Ye},label:{color:Ye}}},tooltip:{enabled:!0,darkTheme:Fe,range:"nearest",delay:0},overlays:{loading:{darkTheme:Fe},noData:{darkTheme:Fe},noVisibleSeries:{darkTheme:Fe}},listeners:{}}}constructor(t={}){const{overrides:e,palette:i}=Se(t),s=this.createChartConfigPerChartType(this.getDefaults());e&&this.mergeOverrides(s,e),this.config=Object.freeze(this.templateTheme(s)),this.palette=Ut(i,this.getPalette())}mergeOverrides(t,e){for(const{seriesTypes:i,commonOptions:s}of Object.values(gi)){const n=m({},e.common);for(const t of mi)s.includes(t)||delete n[t];if(n)for(const e of i){const i=e;t[i]=Ut(n,t[i])}}ne.seriesTypes.forEach(i=>{const s=i;e[s]&&(t[s]=Ut(e[s],t[s]))})}createChartConfigPerChartType(t){for(const[e,{seriesTypes:i}]of Object.entries(gi)){const s=oe.get(e);for(const e of i)t[e]||(t[e]=Se(s))}return t}getDefaults(){const e=(e,i)=>{var s;const n={},a=m(m(m({axes:{}},Le.getThemeTemplates()),t.getChartDefaults()),oe.get(e));for(const o of i){n[o]=Ut(Ce.getThemeTemplate(o),null!=(s=n[o])?s:Se(a));const{axes:i}=n[o];for(const s of Mt.keys())i[s]=Ut(i[s],Mt.getThemeTemplate(s),"cartesian"===e&&t.cartesianAxisDefault[s])}return n};return Ut(e("cartesian",ne.cartesianTypes),e("polar",ne.polarTypes),e("hierarchy",ne.hierarchyTypes),e("topology",ne.topologyTypes))}templateTheme(t){const e=Se(t),{extensions:i,properties:s}=this.getTemplateParameters();return ke(e,t=>{if(t.__extends__){const e=t.__extends__,s=i.get(e);if(null==s)throw new Error(`AG Charts - no template variable provided for: ${e}`);Object.keys(s).forEach(e=>{e in t?Ft(t[e])&&(t[e]=Ut(t[e],s[e])):t[e]=s[e]}),delete t.__extends__}if(Nt(t))for(let e=0;e<t.length;e++){const i=t[e];s.has(i)&&(t[e]=s.get(i))}else for(const[e,i]of Object.entries(t))s.has(i)&&(t[e]=s.get(i))}),Se(e)}static getDefaultColors(){return{fills:Pe,strokes:Be}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Pe.BLUE,stroke:Be.BLUE,label:{color:Ye}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Pe.ORANGE,stroke:Be.ORANGE,label:{color:Ye}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Pe.GRAY,stroke:Be.GRAY,label:{color:Ye}}}getTemplateParameters(){const e=new Map;e.set(ze,t.getAxisDefaults()),e.set(Ge,t.getAxisDefaults().line),e.set(_e,t.getAxisDefaults().tick),e.set(je,t.getAxisDefaults().gridLine),e.set(We,t.getSeriesDefaults()),e.set(Ve,t.getCartesianSeriesMarkerDefaults());const i=new Map;return i.set(Fe,!1),i.set(Ke,"Verdana, sans-serif"),i.set(Ye,"rgb(70, 70, 70)"),i.set($e,"white"),i.set(Ue,"rgb(140, 140, 140)"),i.set(Xe,"rgb(224,234,241)"),i.set(Ze,"rgb(195, 195, 195)"),i.set(qe,"rgb(70, 70, 70)"),i.set(He,ui),i.set(Qe,ui),i.set(Je,"rgba(0, 0, 0, 0.5)"),i.set(oi,[Pe.ORANGE,Pe.YELLOW,Pe.GREEN]),i.set(ri,["#ffffff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"]),i.set(li,["#ffffff","#c5cbd1","#a4b1bd","#8498a9","#648096"]),i.set(ai,ui),i.set(ti,t.getDefaultColors()),i.set(ei,t.getWaterfallSeriesDefaultPositiveColors()),i.set(ii,t.getWaterfallSeriesDefaultNegativeColors()),i.set(si,t.getWaterfallSeriesDefaultTotalColors()),i.set(ni,t.getWaterfallSeriesDefaultTotalColors().stroke),i.set(hi,Be.BLUE),i.set(ci,Pe.BLUE),i.set(di,ui),{extensions:e,properties:i}}};yi.cartesianAxisDefault={number:yi.getAxisDefaults({line:{enabled:!1}}),log:yi.getAxisDefaults({base:10,line:{enabled:!1}}),category:yi.getAxisDefaults({groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:!1}}),time:yi.getAxisDefaults({gridLine:{enabled:!1}}),"grouped-category":yi.getAxisDefaults()};var fi=yi,xi="#192232",bi={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},vi={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},Si={fills:Object.values(bi),strokes:Object.values(vi)},Mi=class t extends fi{static getDefaultColors(){return{fills:bi,strokes:vi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:bi.BLUE,stroke:vi.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:bi.ORANGE,stroke:vi.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:bi.GRAY,stroke:vi.GRAY,label:{color:"white"}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(Fe,!0),e.properties.set(ti,t.getDefaultColors()),e.properties.set(ei,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(si,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(ai,xi),e.properties.set(Ye,"white"),e.properties.set(Ue,"#7D91A0"),e.properties.set(Xe,"#545A6E"),e.properties.set(qe,"white"),e.properties.set(oi,[bi.ORANGE,bi.YELLOW,bi.GREEN]),e.properties.set(ri,["#192834","#253746","#324859","#3f596c","#4d6a80"]),e.properties.set(li,["#192834","#3b5164","#496275","#577287","#668399"]),e.properties.set(Qe,xi),e.properties.set(He,xi),e.properties.set(hi,vi.BLUE),e.properties.set(ci,bi.BLUE),e.properties.set(di,xi),e}getPalette(){return Si}constructor(t){super(t)}},ki={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Di={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},wi={fills:Object.values(ki),strokes:Object.values(Di)},Ii=class t extends Mi{static getDefaultColors(){return{fills:ki,strokes:Di}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:ki.BLUE,stroke:Di.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:ki.RED,stroke:Di.RED,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:ki.GRAY,stroke:Di.GRAY,label:{color:"white"}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ti,t.getDefaultColors()),e.properties.set(ei,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(si,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(oi,[ki.ORANGE,ki.YELLOW,ki.GREEN]),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(hi,Di.BLUE),e.properties.set(ci,ki.BLUE),e}getPalette(){return wi}},Ci={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Li={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},Ai={fills:Object.values(Ci),strokes:Object.values(Li)},Ti=class t extends fi{static getDefaultColors(){return{fills:Ci,strokes:Li}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Ci.BLUE,stroke:Li.BLUE,label:{color:Ye}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Ci.RED,stroke:Li.RED,label:{color:Ye}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Ci.GRAY,stroke:Li.GRAY,label:{color:Ye}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ti,t.getDefaultColors()),e.properties.set(ei,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(si,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(oi,[Ci.ORANGE,Ci.YELLOW,Ci.GREEN]),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(hi,Li.BLUE),e.properties.set(ci,Ci.BLUE),e}getPalette(){return Ai}},Ni={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4"},Oi={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff"},Ri={fills:Object.values(Ni),strokes:Object.values(Oi)},Ei=class t extends Mi{static getDefaultColors(){return{fills:Ni,strokes:Oi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Ni.BLUE,stroke:Oi.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Ni.RED,stroke:Oi.RED,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:"#bbbbbb",stroke:"#eeeeee",label:{color:"white"}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ti,t.getDefaultColors()),e.properties.set(ei,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(si,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(oi,[Ni.BLUE,Ni.RED]),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(hi,Oi.BLUE),e.properties.set(ci,Ni.BLUE),e}getPalette(){return Ri}},Pi={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4"},Bi={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb"},Fi={fills:Object.values(Pi),strokes:Object.values(Bi)},zi=class t extends fi{static getDefaultColors(){return{fills:Pi,strokes:Bi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Pi.BLUE,stroke:Bi.BLUE,label:{color:Ye}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Pi.RED,stroke:Bi.RED,label:{color:Ye}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:"#bbbbbb",stroke:"#888888",label:{color:Ye}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ti,t.getDefaultColors()),e.properties.set(ei,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(si,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(oi,[Pi.BLUE,Pi.RED]),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(hi,Bi.BLUE),e.properties.set(ci,Pi.BLUE),e}getPalette(){return Fi}},Gi={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},_i={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},ji={fills:Object.values(Gi),strokes:Object.values(_i)},Wi=class t extends Mi{static getDefaultColors(){return{fills:y(m({},Gi),{RED:Gi.ORANGE}),strokes:y(m({},_i),{RED:_i.ORANGE})}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Gi.BLUE,stroke:_i.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Gi.ORANGE,stroke:_i.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Gi.GRAY,stroke:_i.GRAY,label:{color:"white"}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ti,t.getDefaultColors()),e.properties.set(ei,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(si,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(oi,[Gi.ORANGE,Gi.YELLOW,Gi.GREEN]),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(hi,_i.BLUE),e.properties.set(ci,Gi.BLUE),e}getPalette(){return ji}},Vi={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},Ki={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},Yi={fills:Object.values(Vi),strokes:Object.values(Ki)},$i=class t extends fi{static getDefaultColors(){return{fills:y(m({},Vi),{RED:Vi.ORANGE}),strokes:y(m({},Ki),{RED:Ki.ORANGE})}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Vi.BLUE,stroke:Ki.BLUE,label:{color:Ye}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Vi.ORANGE,stroke:Ki.ORANGE,label:{color:Ye}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Vi.GRAY,stroke:Ki.GRAY,label:{color:Ye}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ti,t.getDefaultColors()),e.properties.set(ei,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(si,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(oi,[Vi.ORANGE,Vi.YELLOW,Vi.GREEN]),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(hi,Ki.BLUE),e.properties.set(ci,Vi.BLUE),e}getPalette(){return Yi}},Hi={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Ui={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#c18aff",YELLOW:"#fff653",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},Xi={fills:Object.values(Hi),strokes:Object.values(Ui)},Zi=class t extends Mi{static getDefaultColors(){return{fills:Hi,strokes:Ui}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:Hi.BLUE,stroke:Ui.BLUE,label:{color:"white"}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:Hi.ORANGE,stroke:Ui.ORANGE,label:{color:"white"}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:Hi.GRAY,stroke:Ui.GRAY,label:{color:"white"}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ti,t.getDefaultColors()),e.properties.set(ei,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(si,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(oi,[Hi.ORANGE,Hi.YELLOW,Hi.GREEN]),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(hi,Ui.BLUE),e.properties.set(ci,Hi.BLUE),e}getPalette(){return Xi}},qi={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Qi={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},Ji={fills:Object.values(qi),strokes:Object.values(Qi)},ts=class t extends fi{static getDefaultColors(){return{fills:qi,strokes:Qi}}static getWaterfallSeriesDefaultPositiveColors(){return{fill:qi.BLUE,stroke:Qi.BLUE,label:{color:Ye}}}static getWaterfallSeriesDefaultNegativeColors(){return{fill:qi.ORANGE,stroke:Qi.ORANGE,label:{color:Ye}}}static getWaterfallSeriesDefaultTotalColors(){return{fill:qi.GRAY,stroke:Qi.GRAY,label:{color:Ye}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.properties.set(ti,t.getDefaultColors()),e.properties.set(ei,t.getWaterfallSeriesDefaultPositiveColors()),e.properties.set(ii,t.getWaterfallSeriesDefaultNegativeColors()),e.properties.set(si,t.getWaterfallSeriesDefaultTotalColors()),e.properties.set(oi,[qi.ORANGE,qi.YELLOW,qi.GREEN]),e.properties.set(ni,t.getWaterfallSeriesDefaultTotalColors().stroke),e.properties.set(hi,Qi.BLUE),e.properties.set(ci,qi.BLUE),e}getPalette(){return Ji}},es=()=>new fi,is=()=>new Mi,ss={undefined:es,null:es,"ag-default":es,"ag-sheets":()=>new $i,"ag-polychroma":()=>new zi,"ag-vivid":()=>new ts,"ag-material":()=>new Ti},ns=m(m({},{undefined:is,null:is,"ag-default-dark":is,"ag-sheets-dark":()=>new Wi,"ag-polychroma-dark":()=>new Ei,"ag-vivid-dark":()=>new Zi,"ag-material-dark":()=>new Ii}),ss);function as(t){let e=function(t){return void 0===t||"string"==typeof t||t instanceof fi?t:"object"==typeof t?function(t){if(null===t)return;let e=!0;const{baseTheme:i,palette:s,overrides:n}=t;if(void 0!==i&&"string"!=typeof i&&"object"!=typeof i&&(R.warn(`invalid theme.baseTheme type ${typeof i}, expected (string | object).`),e=!1),void 0!==n&&"object"!=typeof n&&(R.warn(`invalid theme.overrides type ${typeof n}, expected object.`),e=!1),"object"==typeof s){if(null!==s){const{fills:t,strokes:i}=s;void 0===t||Array.isArray(t)||(R.warn("theme.overrides.fills must be undefined or an array"),e=!1),void 0===i||Array.isArray(i)||(R.warn("theme.overrides.strokes must be undefined or an array"),e=!1)}}else void 0!==s&&(R.warn(`invalid theme.palette type ${typeof s}, expected object.`),e=!1);return e?t:void 0}(t):void R.warn(`invalid theme value type ${typeof t}, expected object or string.`)}(t);if(e instanceof fi)return e;if(null==e||"string"==typeof e){const t=ns[e];return t?t():(R.warnOnce(`the theme [${e}] is invalid, using [ag-default] instead.`),es())}const i=[];let s;for(;"object"==typeof e;)i.push(e.overrides),null!=s||(s=e.palette),e=e.baseTheme;const n={baseTheme:e,overrides:Ut(...i),palette:s};return new((n.baseTheme?as(n.baseTheme):es()).constructor)(n)}function os(t){if(0===t.length)return;let e=1/0,i=-1/0;for(let s of t)s instanceof Date&&(s=s.getTime()),"number"==typeof s&&(s<e&&(e=s),s>i&&(i=s));const s=[e,i];return s.every(isFinite)?s:void 0}function rs(t,e,i){return ls(t,e,i).extent}function ls(t,e,i){var s;let n=!1;return t.length>2&&(t=null!=(s=os(t))?s:[NaN,NaN]),isNaN(e)||(n||(n=e>t[0]),t=[e,t[1]]),isNaN(i)||(n||(n=i<t[1]),t=[t[0],i]),t[0]>t[1]&&(t=[]),{extent:t,clipped:n}}function hs(t,e){if(null==t||null==e||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(Array.isArray(t[i])&&Array.isArray(e[i])){if(!hs(t[i],e[i]))return!1}else if(t[i]!==e[i])return!1;return!0}function cs(t){return void 0===t?[]:Array.isArray(t)?t:[t]}function ds(t){return Array.from(new Set(t))}function us(t,e){return t.reduce((t,i)=>{const s=e(i);return null!=t[s]||(t[s]=[]),t[s].push(i),t},{})}function ps(t,e,i=0){if(0===t.length)return[];const s=[];for(let n=0;n<e;n++)s.push(t.at((n+i)%t.length));return s}function gs(t,e){return e.reduce(([e,i],s)=>t(s)?[[...e,s],i]:[e,[...i,s]],[[],[]])}function*ms(t,e){for(const i of t)yield e(i)}function ys(t,e){return!e.some(e=>!function(t,e){return function(t,e){return t.includes(e)}(t,e)}(t,e))}var fs={},xs=new WeakMap;function bs(t){var e;return t?null==(e=fs.document)?void 0:e[t]:fs.document}function vs(t){var e;return t?null==(e=fs.window)?void 0:e[t]:fs.window}function Ss(t,e,i){const s=bs().createElement(t);return"object"==typeof e&&(i=e,e=void 0),e&&s.classList.add(e),i&&Object.assign(s.style,i),s}function Ms(t,e){const{body:i}=bs(),s=Ss("a",{display:"none"});s.href=t,s.download=e,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}function ks(t,e){var i,s;const n=bs();if(e&&(null==(i=xs.get(n))?void 0:i.has(e)))return;const a=Ss("style");a.innerHTML=t,n.head.insertBefore(a,n.head.querySelector("style")),e&&!xs.has(n)?xs.set(n,new Set([e])):e&&(null==(s=xs.get(n))||s.add(e))}function Ds(t){fs.document=t}function ws(t){fs.window=t}"undefined"!=typeof window?fs.window=window:"undefined"!=typeof globalThis&&(fs.window=globalThis.window),"undefined"!=typeof document?fs.document=document:"undefined"!=typeof globalThis&&(fs.document=globalThis.document);var Is=Date.now(),Cs={create:(...t)=>Object.assign((...e)=>{Cs.check(...t)&&("function"==typeof e[0]&&(e=cs(e[0]())),(()=>{const t=Date.now()-Is;if(t>2e3){const e=(Math.floor(t/100)/10).toFixed(1);R.log(`**** ${e}s since last log message ****`)}Is=Date.now()})(),R.log(...e))},{check:()=>Cs.check(...t)}),check:(...t)=>(0===t.length&&t.push(!0),cs(vs("agChartsDebug")).some(e=>t.includes(e)))},Ls=new Set(["map-shape-background","map-line-background"]),As=class{constructor(t,e){var i,s;const n={shallow:["data"]},a=Se(t,n),o=this.optionsType(a);this.sanityCheckAndCleanup(a),this.userOptions=a,this.activeTheme=as(a.theme),this.defaultAxes=this.getDefaultAxes(a),this.specialOverrides=this.specialOverridesDefaults(m({},e));const r=this.getSeriesThemeConfig(o),{axes:l={},annotations:h={},series:c}=r,d=f(r,["axes","annotations","series"]);this.processedOptions=Se(Ut(this.userOptions,d,this.defaultAxes),n),this.processAxesOptions(this.processedOptions,l),this.processSeriesOptions(this.processedOptions),this.processMiniChartSeriesOptions(this.processedOptions),this.processAnnotationsOptions(this.processedOptions,h),(de(this.processedOptions)||function(t){const e=ce(t);return ue(t)&&"pie"!==e&&"donut"!==e}(this.processedOptions))&&null==(null==(i=this.processedOptions.legend)?void 0:i.enabled)&&(null!=(s=this.processedOptions).legend||(s.legend={}),this.processedOptions.legend.enabled=this.processedOptions.series.length>1),this.enableConfiguredOptions(this.processedOptions),bt.isEnterprise||function(t){var e,i,s,n;const a=[],o=ne.get(ce(t));for(const{type:r,chartTypes:l,optionsKey:h,optionsInnerKey:c,identifier:d}of re)if("unknown"===o||l.includes(o))if("root"===r||"legend"===r){const e=t[h];if(null==e)continue;c?e[c]&&(a.push(`${h}.${c}`),delete e[c]):(a.push(h),delete t[h])}else if("axis"===r){if(!("axes"in t)||!(null==(e=t.axes)?void 0:e.some(t=>t.type===d)))continue;a.push(`axis[type=${d}]`),t.axes=t.axes.filter(t=>t.type!==d)}else if("axis-option"===r){if(!("axes"in t)||!(null==(i=t.axes)?void 0:i.some(t=>t[h])))continue;a.push(`axis.${h}`),t.axes.forEach(t=>{t[h]&&delete t[h]})}else if("series"===r){if(!(null==(s=t.series)?void 0:s.some(t=>t.type===d)))continue;a.push(`series[type=${d}]`),t.series=t.series.filter(t=>t.type!==d)}else if("series-option"===r){if(!(null==(n=t.series)?void 0:n.some(t=>t[h])))continue;a.push(`series.${h}`),t.series.forEach(t=>{t[h]&&delete t[h]})}if(a.length){let e="ag-charts-enterprise",i="https://charts.ag-grid.com/javascript/installation/";"integrated"===t.mode&&(e="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",i="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),R.warnOnce([`unable to use these enterprise features as '${e}' has not been loaded:`,"",...a,"",`See: ${i}`].join("\n"))}}(this.processedOptions)}getOptions(){var t;return null!=(t=this.processedOptions)?t:{}}diffOptions(t){return ve(t,this.processedOptions)}getSeriesThemeConfig(t){var e,i;return Se(null!=(i=null==(e=this.activeTheme)?void 0:e.config[t])?i:{})}getDefaultAxes(t){const e=this.optionsType(t),i=Ce.cloneDefaultAxes(e);return Ce.isDefaultAxisSwapNeeded(t)&&this.swapAxesPosition(i),i}optionsType(t){var e,i,s;return null!=(s=null==(i=null==(e=t.series)?void 0:e[0])?void 0:i.type)?s:"line"}sanityCheckAndCleanup(t){var e;this.deprecationWarnings(t),this.axesTypeIntegrity(t),this.seriesTypeIntegrity(t),this.soloSeriesIntegrity(t),this.removeDisabledOptions(t),this.removeLeftoverSymbols(t),(null==(e=t.series)?void 0:e.some(t=>"bullet"===t.type))&&null!=t.sync&&!1!==t.sync.enabled&&(R.warnOnce("bullet series cannot be synced, disabling synchronization."),delete t.sync)}swapAxesPosition(t){var e;if(de(t)){const[i,s]=null!=(e=t.axes)?e:[];t.axes=[y(m({},i),{position:s.position}),y(m({},s),{position:i.position})]}}processAxesOptions(t,e){"axes"in t&&(t.axes=t.axes.map(t=>{var i,s,n;const a=Ut(null==(i=e[t.type])?void 0:i[t.position],e[t.type]),{crossLines:o}=a,r=f(a,["crossLines"]);t.crossLines&&(t.crossLines=Xt(t.crossLines,o));const l=null==(s=r.gridLine)?void 0:s.style;(null==(n=t.gridLine)?void 0:n.style)&&(null==l?void 0:l.length)&&(t.gridLine.style=t.gridLine.style.map((t,e)=>null!=t.stroke||null!=t.lineDash?Ut(t,l.at(e%l.length)):t));const h=Ut(t,r),{top:c,right:d,bottom:u,left:p}=h;return f(h,["top","right","bottom","left"])}))}processSeriesOptions(t){const e=this.getDefaultSeriesType(t),i=this.getTooltipPositionDefaults(t),s=Boolean(Ft(t.theme)&&t.theme.palette),n={colourIndex:0,userPalette:s},a=t.series.map(t=>{var a;null!=t.type||(t.type=e);const o=null!=(a=this.getSeriesThemeConfig(t.type).series)?a:{},{innerLabels:r}=o,l=f(o,["innerLabels"]),h=Ls.has(t.type)?{colourIndex:0,userPalette:s}:n,c=this.getSeriesPalette(t.type,h),d=Ut(this.getSeriesGroupingOptions(t),t,i,l,c);return d.innerLabels&&(d.innerLabels=Xt(d.innerLabels,r)),this.activeTheme.templateTheme(d)});t.series=this.setSeriesGroupingOptions(a)}processMiniChartSeriesOptions(t){var e,i;let s=null==(i=null==(e=t.navigator)?void 0:e.miniChart)?void 0:i.series;if(null==s)return;const n={colourIndex:0,userPalette:Boolean(Ft(t.theme)&&t.theme.palette)};s=s.map(t=>{var e;null!=t.type||(t.type="line");const i=null!=(e=this.getSeriesThemeConfig(t.type).series)?e:{},{innerLabels:s}=i,a=f(i,["innerLabels"]),o=Ut(this.getSeriesGroupingOptions(t),t,a,this.getSeriesPalette(t.type,n));return this.activeTheme.templateTheme(o)}),t.navigator.miniChart.series=this.setSeriesGroupingOptions(s)}processAnnotationsOptions(t,e){de(t)}getSeriesPalette(t,e){const i=Ce.getPaletteFactory(t),{colourIndex:s,userPalette:n}=e,{fills:a=[],strokes:o=[]}=this.activeTheme.palette;return null==i?void 0:i({userPalette:n,colorsCount:Math.max(a.length,o.length),themeTemplateParameters:this.activeTheme.getTemplateParameters(),takeColors:t=>(e.colourIndex+=t,{fills:ps(a,t,s),strokes:ps(o,t,s)})})}getSeriesGroupingOptions(t){const e=Ce.isGroupable(t.type),i=Ce.isStackable(t.type),s=Ce.isStackedByDefault(t.type);t.grouped&&!e&&R.warnOnce(`unsupported grouping of series type "${t.type}".`),!t.stacked&&!t.stackGroup||i||R.warnOnce(`unsupported stacking of series type "${t.type}".`);let{grouped:n,stacked:a}=t;return null!=a||(a=(s||null!=t.stackGroup)&&!(e&&n)),null!=n||(n=!0),{stacked:i&&a,grouped:e&&n&&!(i&&a)}}setSeriesGroupingOptions(t){const e=this.getSeriesGrouping(t);Cs.create(!0,"opts")("setSeriesGroupingOptions() - series grouping: ",e);const i={},s=e.reduce((t,e)=>{var i;return"default"===e.groupType||(null!=t[i=e.seriesType]||(t[i]=0),t[e.seriesType]+="stack"===e.groupType?1:e.series.length),t},{});return e.flatMap(t=>{var e;switch(null!=i[e=t.seriesType]||(i[e]=0),t.groupType){case"stack":const e=i[t.seriesType]++;return t.series.map((i,n)=>Object.assign(i,{seriesGrouping:{groupIndex:e,groupCount:s[t.seriesType],stackIndex:n,stackCount:t.series.length}}));case"group":return t.series.map(e=>Object.assign(e,{seriesGrouping:{groupIndex:i[t.seriesType]++,groupCount:s[t.seriesType],stackIndex:0,stackCount:0}}))}return t.series}).map(t=>{var e=t,{stacked:i,grouped:s}=e;return f(e,["stacked","grouped"])})}getSeriesGroupId(t){var e;return[t.type,t.xKey,t.stacked?null!=(e=t.stackGroup)?e:"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(t){const e=new Map;return t.reduce((t,i)=>{const s=i.type;if(i.stacked||i.grouped){const n=this.getSeriesGroupId(i);if(!e.has(n)){const a={groupType:i.stacked?"stack":"group",seriesType:s,series:[]};e.set(n,a),t.push(a)}e.get(n).series.push(i)}else t.push({groupType:"default",seriesType:s,series:[i]});return t},[])}getDefaultSeriesType(t){if(de(t))return"line";if(ue(t))return"pie";if(pe(t))return"treemap";if(ge(t))return"map-shape";throw new Error("Invalid chart options type detected.")}getTooltipPositionDefaults(t){var e;const i=null==(e=t.tooltip)?void 0:e.position;if(!Gt(i))return;const{type:s,xOffset:n,yOffset:a}=i,o={};return _t(s)&&Yt(w,s)&&(o.type=s),Wt(n)&&(o.xOffset=n),Wt(a)&&(o.yOffset=a),{tooltip:{position:o}}}deprecationWarnings(t){Object.entries({yKeys:"yKey",yNames:"yName"}).forEach(([e,i])=>{var s;(null==(s=t.series)?void 0:s.some(t=>null!=t[e]))&&R.warnOnce(`Property [series.${e}] is deprecated, please use [series.${i}] and multiple series instead.`)})}axesTypeIntegrity(t){var e;if("axes"in t){const i=null!=(e=t.axes)?e:[];for(const{type:e}of i)if(!me(e)){delete t.axes;const i=Array.from(Mt.publicKeys()).join(", ");R.warnOnce(`unknown axis type: ${e}; expected one of: ${i}`)}}}seriesTypeIntegrity(t){var e;const i=null!=(e=t.series)?e:[];t.series=i.filter(({type:t})=>{if(null==t||null!=(e=t)&&ne.has(e)||function(t){return re.some(e=>"series"===e.type&&e.identifier===t)}(t))return!0;var e;R.warnOnce(`unknown series type: ${t}; expected one of: ${ae.seriesTypes.join(", ")}`)})}soloSeriesIntegrity(t){const e=t.series;if(e&&e.length>1&&e.some(t=>Ce.isSolo(t.type))){const i=this.optionsType(t);if(Ce.isSolo(i))R.warn(`series[0] of type '${i}' is incompatible with other series types. Only processing series[0]`),t.series=e.slice(0,1);else{const{solo:i,nonSolo:s}=us(e,t=>Ce.isSolo(t.type)?"solo":"nonSolo"),n=ds(i.map(t=>t.type)).join(", ");R.warn(`Unable to mix these series types with the lead series type: ${n}`),t.series=s}}}enableConfiguredOptions(t){ke(this.userOptions,(t,e)=>{e&&"enabled"in e&&!e._enabledFromTheme&&null==t.enabled&&(e.enabled=!0)},{skip:["data","theme"]},t),ke(t,t=>{null!=t._enabledFromTheme&&delete t._enabledFromTheme},{skip:["data","theme"]})}removeDisabledOptions(t){ke(t,t=>{"enabled"in t&&!1===t.enabled&&Object.keys(t).forEach(e=>{"enabled"!==e&&delete t[e]})},{skip:["data","theme"]})}removeLeftoverSymbols(t){ke(t,t=>{if(t&&Ft(t))for(const[e,i]of Object.entries(t))$t(i)&&delete t[e]},{skip:["data"]})}specialOverridesDefaults(t){if(null!=t.window?ws(t.window):"undefined"!=typeof window?t.window=window:"undefined"!=typeof globalThis&&(t.window=globalThis.window),null!=t.document?Ds(t.document):"undefined"!=typeof document?t.document=document:"undefined"!=typeof globalThis&&(t.document=globalThis.document),null==t.window)throw new Error("AG Charts - unable to resolve global window");if(null==t.document)throw new Error("AG Charts - unable to resolve global document");return t}};function Ts(){return(t,e)=>{const i=[`Property [${t}] is deprecated.`,e].filter(Boolean).join(" ");R.warnOnce(i)}}function Ns(t,e){const i=Ts(),s=null==e?void 0:e.default;return It((e,n,a)=>(a!==s&&i(n.toString(),t),a))}function Os(t,e){const i=Ts();return It((s,n,a)=>(a!==s[t]&&(i(n.toString(),`Use [${t}] instead.`),te(s,t,e?e(a):a)),kt),(e,s)=>(i(s.toString(),`Use [${t}] instead.`),Qt(e,t)))}var Rs={};x(Rs,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Ln,fromToMotion:()=>An,staticFromToMotion:()=>Tn});var Es=new Map;function Ps(){Es.clear()}function Bs(t){var e;const i=t.constructor,s=Object.hasOwn(i,"className")?i.className:i.name;if(!s)throw new Error(`The ${i} is missing the 'className' property.`);const n=(null!=(e=Es.get(s))?e:0)+1;return Es.set(s,n),`${s}-${n}`}var Fs="$interpolate",zs=t=>null!=t[Fs];function Gs(t,e,i){return Math.min(i,Math.max(t,e))}function _s(t,e){const[i,s]=js(e);return Gs(i,t,s)}function js(t){return t.length?[Math.min(...t),Math.max(...t)]:[]}function Ws(t){const[e,i]=js(t);return i-e}function Vs(t,e,i=1e-10){return Math.abs(t-e)<i}function Ks(t){return-1===Math.sign(t)||Object.is(t,-0)}function Ys(t,e=2){const i=p(10,e);return Math.round(t*i)/i}function $s(t,e=2){const i=Math.floor(Math.log(Math.abs(t))/Math.LN10);return i>=0||!isFinite(i)?t.toFixed(e):t.toFixed(Math.abs(i)-1+e)}function Hs(t,e){return Math.floor(t%e+(t<0?e:0))}function Us(t,e=10){const[,i=""]=(Math.abs(t)%1).toLocaleString("en-GB",{minimumFractionDigits:0,maximumFractionDigits:e}).split(".");return i.length}function Xs(t,e,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const s of i){const i=s.distanceSquared(t,e);if(0===i)return{nearest:s,distanceSquared:0};i<n.distanceSquared&&(n.nearest=s,n.distanceSquared=i)}return n}function Zs(t,e,i,s=1/0){const{x:n,y:a}=i.transformPoint(t,e),o={nearest:void 0,distanceSquared:s};for(const t of i.children){const{nearest:e,distanceSquared:i}=t.nearestSquared(n,a,o.distanceSquared);if(0===i)return{nearest:e,distanceSquared:i};i<o.distanceSquared&&(o.nearest=e,o.distanceSquared=i)}return o}var qs=class t{constructor(t,e,i,s){this.x=t,this.y=e,this.width=i,this.height=s}clone(){const{x:e,y:i,width:s,height:n}=this;return new t(e,i,s,n)}equals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}containsPoint(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}collidesBBox(t){return this.x<t.x+t.width&&this.x+this.width>t.x&&this.y<t.y+t.height&&this.y+this.height>t.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(t,e){if(this.containsPoint(t,e))return 0;const i=t-Gs(this.x,t,this.x+this.width),s=e-Gs(this.y,e,this.y+this.height);return i*i+s*s}static nearestBox(t,e,i){return Xs(t,e,i)}clip(t){if(void 0===t)return this;const e=Math.max(this.x,t.x),i=Math.max(this.y,t.y),s=Math.min(this.x+this.width,t.x+t.width),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.y=i,this.width=Math.max(0,s-e),this.height=Math.max(0,n-i),this}shrink(t,e){const i=(t,e)=>{switch(t){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-=2*e;break;case"horizontal":this.x+=e,this.width-=2*e;break;case void 0:this.x+=e,this.width-=2*e,this.y+=e,this.height-=2*e}};return"number"==typeof t?i(e,t):"object"==typeof t&&Object.entries(t).forEach(([t,e])=>i(t,e)),this}grow(t,e){if("number"==typeof t)this.shrink(-t,e);else{const e=m({},t);for(const t in e)e[t]*=-1;this.shrink(e)}return this}combine(t){const{x:e,y:i,width:s,height:n}=this;this.x=Math.min(e,t.x),this.y=Math.min(i,t.y),this.width=Math.max(e+s,t.x+t.width)-this.x,this.height=Math.max(i+n,t.y+t.height)-this.y}static merge(e){let i=1/0,s=1/0,n=-1/0,a=-1/0;for(const t of e)t.x<i&&(i=t.x),t.y<s&&(s=t.y),t.x+t.width>n&&(n=t.x+t.width),t.y+t.height>a&&(a=t.y+t.height);return new t(i,s,n-i,a-s)}[Fs](e,i){return new t(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)}};qs.zero=new qs(0,0,0,0),qs.NaN=new qs(NaN,NaN,NaN,NaN);var Qs=qs,Js=(t=>(t[t.NONE=0]="NONE",t[t.TRIVIAL=1]="TRIVIAL",t[t.MINOR=2]="MINOR",t[t.MAJOR=3]="MAJOR",t))(Js||{}),tn=function(){try{return new Function("return true"),!0}catch(t){return!1}}();function en(t){const{changeCb:e,convertor:i}=null!=t?t:{};return function(s,n){const a=`__${n}`;s[n]||(tn&&null==e&&null==i?function(t,e,i,s){const{redraw:n=1,type:a="normal",checkDirtyOnAssignment:o=!1}=null!=s?s:{},r=new Function("value",`\n        const oldValue = this.${i};\n        if (value !== oldValue) {\n            this.${i} = value;\n            ${"normal"===a?`this.markDirty(this, ${n});`:""}\n            ${"transform"===a?`this.markDirtyTransform(${n});`:""}\n            ${"path"===a?`if (!this._dirtyPath) { this._dirtyPath = true; this.markDirty(this, ${n}); }`:""}\n            ${"font"===a?`if (!this._dirtyFont) { this._dirtyFont = true; this.markDirty(this, ${n}); }`:""}\n        }\n        ${o?"if (value != null && value._dirty > 0) { this.markDirty(value, value._dirty); }":""}\n`),l=new Function(`return this.${i};`);Object.defineProperty(t,e,{set:r,get:l,enumerable:!0,configurable:!0})}(s,n,a,t):function(t,e,i,s){const{redraw:n=1,type:a="normal",changeCb:o,convertor:r,checkDirtyOnAssignment:l=!1}=null!=s?s:{};Object.defineProperty(t,e,{set:function(t){const e=this[i];(t=r?r(t):t)!==e&&(this[i]=t,"normal"===a&&this.markDirty(this,n),"transform"===a&&this.markDirtyTransform(n),"path"!==a||this._dirtyPath||(this._dirtyPath=!0,this.markDirty(this,n)),"font"!==a||this._dirtyFont||(this._dirtyFont=!0,this.markDirty(this,n)),null==o||o(this)),l&&null!=t&&t._dirty>0&&this.markDirty(t,t._dirty)},get:function(){return this[i]},enumerable:!0,configurable:!0})}(s,n,a,t))}}var sn=class{constructor(){this._dirty=3}markDirty(t,e=1){this._dirty<e&&(this._dirty=e)}markClean(t){this._dirty=0}isDirty(){return this._dirty>0}},nn=class t{get e(){return[...this.elements]}constructor(t=[1,0,0,1,0,0]){this.elements=t}setElements(t){const e=this.elements;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this}get identity(){const t=this.elements;return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]}AxB(t,e,i){const s=t[0]*e[0]+t[2]*e[1],n=t[1]*e[0]+t[3]*e[1],a=t[0]*e[2]+t[2]*e[3],o=t[1]*e[2]+t[3]*e[3],r=t[0]*e[4]+t[2]*e[5]+t[4],l=t[1]*e[4]+t[3]*e[5]+t[5];(i=null!=i?i:t)[0]=s,i[1]=n,i[2]=a,i[3]=o,i[4]=r,i[5]=l}multiplySelf(t){return this.AxB(this.elements,t.elements),this}multiply(e){const i=new Array(6);return this.AxB(this.elements,e.elements,i),new t(i)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const e=this.elements;let i=e[0],s=e[1],n=e[2],a=e[3];const o=e[4],r=e[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,new t([a,-s,-n,i,n*r-a*o,s*o-i*r])}inverseTo(t){const e=this.elements;let i=e[0],s=e[1],n=e[2],a=e[3];const o=e[4],r=e[5],l=1/(i*a-s*n);return i*=l,s*=l,n*=l,a*=l,t.setElements([a,-s,-n,i,n*r-a*o,s*o-i*r]),this}invertSelf(){const t=this.elements;let e=t[0],i=t[1],s=t[2],n=t[3];const a=t[4],o=t[5],r=1/(e*n-i*s);return e*=r,i*=r,s*=r,n*=r,t[0]=n,t[1]=-i,t[2]=-s,t[3]=e,t[4]=s*o-n*a,t[5]=i*a-e*o,this}transformPoint(t,e){const i=this.elements;return{x:t*i[0]+e*i[2]+i[4],y:t*i[1]+e*i[3]+i[5]}}transformBBox(t,e){const i=this.elements,s=i[0],n=i[1],a=i[2],o=i[3],r=.5*t.width,l=.5*t.height,h=t.x+r,c=t.y+l,d=Math.abs(r*s)+Math.abs(l*a),u=Math.abs(r*n)+Math.abs(l*o);return e||(e=new Qs(0,0,0,0)),e.x=h*s+c*a+i[4]-d,e.y=h*n+c*o+i[5]-u,e.width=d+d,e.height=u+u,e}toContext(t){if(this.identity)return;const e=this.elements;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}static flyweight(e){return t.instance.setElements(e.elements)}static updateTransformMatrix(t,e,i,s,n,a,o){const[r,l]=[0,0],h=e,c=i;let d,u;1===h&&1===c?(d=0,u=0):(d=null==(null==o?void 0:o.scalingCenterX)?r:null==o?void 0:o.scalingCenterX,u=null==(null==o?void 0:o.scalingCenterY)?l:null==o?void 0:o.scalingCenterY);const p=s,g=Math.cos(p),m=Math.sin(p);let y,f;0===p?(y=0,f=0):(y=null==(null==o?void 0:o.rotationCenterX)?r:null==o?void 0:o.rotationCenterX,f=null==(null==o?void 0:o.rotationCenterY)?l:null==o?void 0:o.rotationCenterY);const x=n,b=a,v=d*(1-h)-y,S=u*(1-c)-f;return t.setElements([g*h,m*h,-m*c,g*c,g*v-m*S+y+x,m*v+g*S+f+b]),t}static fromContext(e){const i=e.getTransform();return new t([i.a,i.b,i.c,i.d,i.e,i.f])}};nn.instance=new nn;var an=nn,on=(t=>(t[t.All=0]="All",t[t.None=1]="None",t))(on||{}),rn=class t extends sn{constructor({isVirtual:e,tag:i,zIndex:s}={}){super(),this.serialNumber=t._nextSerialNumber++,this.id=Bs(this),this.isContainerNode=!1,this._virtualChildren=[],this._children=[],this.childSet={},this.matrix=new an,this.dirtyTransform=!1,this.scalingX=1,this.scalingY=1,this.scalingCenterX=null,this.scalingCenterY=null,this.rotationCenterX=null,this.rotationCenterY=null,this.rotation=0,this.translationX=0,this.translationY=0,this._childNodeCounts={groups:0,nonGroups:0},this.visible=!0,this.dirtyZIndex=!1,this.zIndex=0,this.zIndexSubOrder=void 0,this.pointerEvents=0,this.isVirtual=null!=e&&e,this.tag=null!=i?i:NaN,this.zIndex=null!=s?s:0}get datum(){var t,e;return null!=(e=this._datum)?e:null==(t=this._parent)?void 0:t.datum}get previousDatum(){return this._previousDatum}set datum(t){this._datum!==t&&(this._previousDatum=this._datum),this._datum=t}_setLayerManager(t){this._layerManager=t,this._debug=null==t?void 0:t.debug;for(const e of this._children)e._setLayerManager(t);for(const e of this._virtualChildren)e._setLayerManager(t)}get layerManager(){return this._layerManager}*ancestors(){let t=this;for(;t=t.parent;)yield t}*traverseUp(){yield this,yield*k(this.ancestors())}get parent(){return this._parent}get children(){return this._virtualChildren.length?this._children.concat(this._virtualChildren.flatMap(t=>t.children)):this._children}get virtualChildren(){return this._virtualChildren}hasVirtualChildren(){return this._virtualChildren.length>0}setProperties(t,e){const i=null!=e?e:Object.keys(t);for(const e of i)this[e]=t[e];return this}append(t){Array.isArray(t)||(t=[t]);for(const e of t){if(e.parent)throw new Error(`${e} already belongs to another parent: ${e.parent}.`);if(e.layerManager)throw new Error(`${e} already belongs to a scene: ${e.layerManager}.`);if(this.childSet[e.id])throw new Error(`Duplicate ${e.constructor.name} node: ${e}`);e.isVirtual?this._virtualChildren.push(e):this._children.push(e),this.childSet[e.id]=!0,e._parent=this,e._setLayerManager(this.layerManager)}this.dirtyZIndex=!0,this.markDirty(this,3)}appendChild(t){return this.append(t),t}removeChild(t){const e=()=>{throw new Error("The node to be removed is not a child of this node.")};if(t.parent!==this&&e(),t.isVirtual){const i=this._virtualChildren.indexOf(t);i<0&&e(),this._virtualChildren.splice(i,1)}else{const i=this._children.indexOf(t);i<0&&e(),this._children.splice(i,1)}return delete this.childSet[t.id],t._parent=void 0,t._setLayerManager(),this.dirtyZIndex=!0,this.markDirty(t,3),t}calculateCumulativeMatrix(){this.computeTransformMatrix();const t=an.flyweight(this.matrix);for(const e of this.ancestors())e.computeTransformMatrix(),t.preMultiplySelf(e.matrix);return t}transformPoint(t,e){return this.calculateCumulativeMatrix().invertSelf().transformPoint(t,e)}inverseTransformPoint(t,e){return this.calculateCumulativeMatrix().transformPoint(t,e)}transformBBox(t){return this.calculateCumulativeMatrix().invertSelf().transformBBox(t)}inverseTransformBBox(t){return this.calculateCumulativeMatrix().transformBBox(t)}markDirtyTransform(){this.dirtyTransform=!0,this.markDirty(this,3)}containsPoint(t,e){return!1}pickNode(t,e){var i;if(!this.visible||1===this.pointerEvents||!this.containsPoint(t,e))return;const{children:s}=this;if(s.length>1e3)for(let n=s.length-1;n>=0;n--){const a=s[n],o=(null==(i=a.computeTransformedBBox())?void 0:i.containsPoint(t,e))?a.pickNode(t,e):void 0;if(o)return o}else if(s.length)for(let i=s.length-1;i>=0;i--){const n=s[i].pickNode(t,e);if(n)return n}else if(!this.isContainerNode)return this}getCachedBBox(){var t;return null!=(t=this.cachedBBox)?t:Qs.zero}computeBBox(){}computeTransformedBBox(){const t=this.computeBBox();if(!t)return;this.computeTransformMatrix();const e=an.flyweight(this.matrix);for(const t of this.ancestors())t.computeTransformMatrix(),e.preMultiplySelf(t.matrix);return e.transformBBox(t,t),t}computeTransformMatrix(){if(!this.dirtyTransform)return;const{matrix:t,scalingX:e,scalingY:i,rotation:s,translationX:n,translationY:a,scalingCenterX:o,scalingCenterY:r,rotationCenterX:l,rotationCenterY:h}=this;an.updateTransformMatrix(t,e,i,s,n,a,{scalingCenterX:o,scalingCenterY:r,rotationCenterX:l,rotationCenterY:h}),this.dirtyTransform=!1}preRender(){this._childNodeCounts.groups=0,this._childNodeCounts.nonGroups=1;for(const t of this.children){const e=t.preRender();this._childNodeCounts.groups+=e.groups,this._childNodeCounts.nonGroups+=e.nonGroups}return this._childNodeCounts}render(t){const{stats:e}=t;this._dirty=0,this.cachedBBox=this.computeBBox(),e&&e.nodesRendered++}markDirty(t,e=1,i=e){this._dirty>e||this._dirty===e&&e===i||(this._dirty=e,this.parent?this.parent.markDirty(this,i):this.layerManager&&this.layerManager.markDirty())}get dirty(){return this._dirty}markClean(t){const{force:e=!1,recursive:i=!0}=null!=t?t:{};if(0!==this._dirty||e){if(this._dirty=0,!1!==i)for(const t of this._virtualChildren)t.markClean({force:e});if(!0===i)for(const t of this._children)t.markClean({force:e})}}onVisibleChange(){}get nodeCount(){let t=1,e=this._dirty>=0||this.dirtyTransform?1:0,i=this.visible?1:0;const s=s=>{const{count:n,visibleCount:a,dirtyCount:o}=s.nodeCount;t+=n,i+=a,e+=o};for(const t of this._children)s(t);for(const t of this._virtualChildren)s(t);return{count:t,visibleCount:i,dirtyCount:e}}onZIndexChange(){this.parent&&(this.parent.dirtyZIndex=!0)}};rn._nextSerialNumber=0,b([en({type:"transform"})],rn.prototype,"scalingX",2),b([en({type:"transform"})],rn.prototype,"scalingY",2),b([en({type:"transform"})],rn.prototype,"scalingCenterX",2),b([en({type:"transform"})],rn.prototype,"scalingCenterY",2),b([en({type:"transform"})],rn.prototype,"rotationCenterX",2),b([en({type:"transform"})],rn.prototype,"rotationCenterY",2),b([en({type:"transform"})],rn.prototype,"rotation",2),b([en({type:"transform"})],rn.prototype,"translationX",2),b([en({type:"transform"})],rn.prototype,"translationY",2),b([en({redraw:3,changeCb:t=>t.onVisibleChange()})],rn.prototype,"visible",2),b([en({redraw:1,changeCb:t=>t.onZIndexChange()})],rn.prototype,"zIndex",2),b([en({redraw:1,changeCb:t=>t.onZIndexChange()})],rn.prototype,"zIndexSubOrder",2);var ln=rn,hn=t=>{const e=t<0?-1:1,i=Math.abs(t);return i<=.04045?t/12.92:e*p((i+.055)/1.055,2.4)},cn=t=>{const e=t<0?-1:1,i=Math.abs(t);return i>.0031308?e*(1.055*p(i,1/2.4)-.055):12.92*t},dn=class t{constructor(t,e,i,s=1){this.r=Gs(0,t||0,1),this.g=Gs(0,e||0,1),this.b=Gs(0,i||0,1),this.a=Gs(0,s||0,1)}static validColorString(e){return e.indexOf("#")>=0?!!t.parseHex(e):e.indexOf("rgb")>=0?!!t.stringToRgba(e):!!t.nameToHex[e.toLowerCase()]}static fromString(e){if(e.indexOf("#")>=0)return t.fromHexString(e);const i=t.nameToHex[e.toLowerCase()];if(i)return t.fromHexString(i);if(e.indexOf("rgb")>=0)return t.fromRgbaString(e);throw new Error(`Invalid color string: '${e}'`)}static tryParseFromString(e){try{return t.fromString(e)}catch(i){return R.warnOnce(`invalid color string: '${e}'.`),t.fromArray([0,0,0])}}static parseHex(t){let e;switch((t=t.replace(/ /g,"").slice(1)).length){case 6:case 8:e=[];for(let i=0;i<t.length;i+=2)e.push(parseInt(`${t[i]}${t[i+1]}`,16));break;case 3:case 4:e=t.split("").map(t=>parseInt(t,16)).map(t=>t+16*t)}if((null==e?void 0:e.length)>=3&&e.every(t=>t>=0))return 3===e.length&&e.push(255),e}static fromHexString(e){const i=t.parseHex(e);if(i){const[e,s,n,a]=i;return new t(e/255,s/255,n/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${e}'`)}static stringToRgba(t){let[e,i]=[NaN,NaN];for(let s=0;s<t.length;s++){const n=t[s];if(e||"("!==n){if(")"===n){i=s;break}}else e=s}const s=e&&i&&t.substring(e+1,i);if(!s)return;const n=s.split(","),a=[];for(let t=0;t<n.length;t++){const e=n[t];let i=parseFloat(e);if(isNaN(i))return;e.indexOf("%")>=0?(i=Gs(0,i,100),i/=100):3===t?i=Gs(0,i,1):(i=Gs(0,i,255),i/=255),a.push(i)}return a}static fromRgbaString(e){const i=t.stringToRgba(e);if(i){if(3===i.length)return new t(i[0],i[1],i[2]);if(4===i.length)return new t(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${e}'`)}static fromArray(e){if(4===e.length)return new t(e[0],e[1],e[2],e[3]);if(3===e.length)return new t(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 a=t.HSBtoRGB(e,i,s);return new t(a[0],a[1],a[2],n)}static fromHSL(e,i,s,n=1){const a=t.HSLtoRGB(e,i,s);return new t(a[0],a[1],a[2],n)}static fromOKLCH(e,i,s,n=1){const a=t.OKLCHtoRGB(e,i,s);return new t(a[0],a[1],a[2],n)}static padHex(t){return 1===t.length?"0"+t:t}toHexString(){let e="#"+t.padHex(Math.round(255*this.r).toString(16))+t.padHex(Math.round(255*this.g).toString(16))+t.padHex(Math.round(255*this.b).toString(16));return this.a<1&&(e+=t.padHex(Math.round(255*this.a).toString(16))),e}toRgbaString(t=3){const e=[Math.round(255*this.r),Math.round(255*this.g),Math.round(255*this.b)],i=Math.pow(10,t);return 1!==this.a?(e.push(Math.round(this.a*i)/i),`rgba(${e.join(", ")})`):`rgb(${e.join(", ")})`}toString(){return 1===this.a?this.toHexString():this.toRgbaString()}toHSB(){return t.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,e,i){const s=hn(t),n=hn(e),a=hn(i),o=Math.cbrt(.4122214708*s+.5363325363*n+.0514459929*a),r=Math.cbrt(.2119034982*s+.6806995451*n+.1073969566*a),l=Math.cbrt(.0883024619*s+.2817188376*n+.6299787005*a),h=.2104542553*o+.793617785*r-.0040720468*l,c=1.9779984951*o-2.428592205*r+.4505937099*l,d=.0259040371*o+.7827717662*r-.808675766*l,u=180*Math.atan2(d,c)/Math.PI;return[h,Math.hypot(c,d),u>=0?u:u+360]}static OKLCHtoRGB(t,e,i){const s=t,n=e*Math.cos(i*Math.PI/180),a=e*Math.sin(i*Math.PI/180),o=p(s+.3963377774*n+.2158037573*a,3),r=p(s-.1055613458*n-.0638541728*a,3),l=p(s-.0894841775*n-1.291485548*a,3),h=-1.2684380046*o+2.6097574011*r-.3413193965*l,c=-.0041960863*o-.7034186147*r+1.707614701*l;return[cn(4.0767416621*o-3.3077115913*r+.2309699292*l),cn(h),cn(c)]}static RGBtoHSL(t,e,i){const s=Math.min(t,e,i),n=Math.max(t,e,i),a=(n+s)/2;let o,r;if(n===s)o=NaN,r=0;else{const l=n-s;r=a>.5?l/(2-n-s):l/(n+s),o=n===t?(e-i)/l+(e<i?6:0):n===e?(i-t)/l+2:(t-e)/l+4,o*=60}return[o,r,a]}static HSLtoRGB(t,e,i){if(0===e)return[i,i,i];const s=i<.5?i*(1+e):i+e-i*e,n=2*i-s;function a(t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+6*(s-n)*t:t<.5?s:t<2/3?n+(s-n)*(2/3-t)*6:n}return[a(t/360+1/3),a(t/360),a(t/360-1/3)]}static RGBtoHSB(t,e,i){const s=Math.min(t,e,i),n=Math.max(t,e,i);let a=NaN;if(s!==n){const o=n-s,r=(n-t)/o,l=(n-e)/o,h=(n-i)/o;a=t===n?h-l:e===n?2+r-h:4+l-r,a/=6,a<0&&(a+=1)}return[360*a,0===n?0:(n-s)/n,n]}static HSBtoRGB(t,e,i){isNaN(t)&&(t=0),t=(t%360+360)%360/360;let s=0,n=0,a=0;if(0===e)s=n=a=i;else{const o=6*(t-Math.floor(t)),r=o-Math.floor(o),l=i*(1-e),h=i*(1-e*r),c=i*(1-e*(1-r));switch(0|o){case 0:s=i,n=c,a=l;break;case 1:s=h,n=i,a=l;break;case 2:s=l,n=i,a=c;break;case 3:s=l,n=h,a=i;break;case 4:s=c,n=l,a=i;break;case 5:s=i,n=l,a=h}}return[s,n,a]}derive(e,i,s,n){const a=t.RGBtoHSB(this.r,this.g,this.b);let o=a[2];0==o&&s>1&&(o=.05);const r=((a[0]+e)%360+360)%360,l=Gs(0,a[1]*i,1);o=Gs(0,o*s,1);const h=Gs(0,this.a*n,1),c=t.HSBtoRGB(r,l,o);return c.push(h),t.fromArray(c)}brighter(){return this.derive(0,1,1/.7,1)}darker(){return this.derive(0,1,.7,1)}static interpolate(e,i){const s=t.tryParseFromString(e),n=t.tryParseFromString(i);return e=>{const i=(t,i)=>t*(1-e)+i*e;return new t(i(s.r,n.r),i(s.g,n.g),i(s.b,n.b),i(s.a,n.a)).toString()}}};dn.didDebug=!1,dn.nameToHex=Object.freeze({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 un=dn;function pn(t,e){return i=>Number(t)*(1-i)+Number(e)*i}var gn={};x(gn,{easeIn:()=>yn,easeInOut:()=>xn,easeInOutQuad:()=>Sn,easeInQuad:()=>bn,easeOut:()=>fn,easeOutQuad:()=>vn,inverseEaseOut:()=>Mn,linear:()=>mn});var mn=t=>t,yn=t=>1-Math.cos(t*Math.PI/2),fn=t=>Math.sin(t*Math.PI/2),xn=t=>-(Math.cos(t*Math.PI)-1)/2,bn=t=>t*t,vn=t=>1-p(1-t,2),Sn=t=>t<.5?2*t*t:1-p(-2*t+2,2)/2,Mn=t=>2*Math.asin(t)/Math.PI,kn=["initial","remove","update","add","trailing","end","none"],Dn={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:.2,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1.2,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},wn=(t=>(t.Loop="loop",t.Reverse="reverse",t))(wn||{});function In(t){return t.every(t=>t instanceof ln)?{nodes:t,selections:[]}:{nodes:[],selections:t}}var Cn=class{constructor(t){var e,i,s,n,a,o,r;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=null==(e=t.autoplay)||e,this.ease=null!=(i=t.ease)?i:mn,this.phase=t.phase;const l=null!=(s=t.duration)?s:Dn[this.phase].animationDuration;this.duration=l*t.defaultDuration,this.delay=(null!=(n=t.delay)?n: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,!0===t.skip&&(null==(a=this.onUpdate)||a.call(this,t.to,!1,this),null==(o=this.onStop)||o.call(this,this),null==(r=this.onComplete)||r.call(this,this),this.isComplete=!0),!1!==t.collapsable&&(this.duration=this.checkCollapse(t,this.duration))}checkCollapse(t,e){return t.from===t.to?0:"object"==typeof t.from&&ve(t.from,t.to)?e:0}play(t=!1){var e,i;this.isPlaying||this.isComplete||(this.isPlaying=!0,null==(e=this.onPlay)||e.call(this,this),this.autoplay&&(this.autoplay=!1,t&&(null==(i=this.onUpdate)||i.call(this,this.from,!0,this))))}pause(){this.isPlaying=!1}stop(){var t;this.isPlaying=!1,this.isComplete||(this.isComplete=!0,null==(t=this.onStop)||t.call(this,this))}update(t){var e,i;if(this.isComplete)return t;!this.isPlaying&&this.autoplay&&this.play(!0);const s=this.elapsed;if(this.elapsed+=t,this.delay>this.elapsed)return 0;const n=this.interpolate(this.isReverse?1-this.delta:this.delta);null==(e=this.onUpdate)||e.call(this,n,!1,this);const a=this.delay+this.duration;return this.elapsed>=a?(this.stop(),this.isComplete=!0,null==(i=this.onComplete)||i.call(this,this),t-(a-s)):0}get delta(){return this.ease(Gs(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(t,e){if("object"!=typeof e||zs(e))return this.interpolateValue(t,e);const i=[];for(const s in e){const n=this.interpolateValue(t[s],e[s]);null!=n&&i.push([s,n])}return t=>{const e={};for(const[s,n]of i)e[s]=n(t);return e}}interpolateValue(t,e){if(void 0!==t&&void 0!==e){if(zs(t))return i=>t[Fs](e,i);try{switch(typeof t){case"number":return pn(t,e);case"string":return function(t,e){if("string"==typeof t)try{t=un.fromString(t)}catch(e){t=un.fromArray([0,0,0])}if("string"==typeof e)try{e=un.fromString(e)}catch(t){e=un.fromArray([0,0,0])}const i=pn(t.r,e.r),s=pn(t.g,e.g),n=pn(t.b,e.b),a=pn(t.a,e.a);return t=>un.fromArray([i(t),s(t),n(t),a(t)]).toRgbaString()}(t,e);case"boolean":if(t===e)return()=>t}}catch(t){}throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}},Ln={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function An(t,e,i,s,n,a,o){const{fromFn:r,toFn:l,intermediateFn:h}=n,{nodes:c,selections:d}=In(s),u=(s,n)=>{var c;let d,u=0,p=0;for(const g of n){const y=s[u]===g,x={last:p>=n.length-1,lastLive:u>=s.length-1,prev:n[p-1],prevFromProps:d,prevLive:s[u-1],next:n[p+1],nextLive:s[u+(y?1:0)]},b=`${t}_${e}_${g.id}`;i.stopByAnimationId(b);let v="unknown";y?a&&o&&(v=Nn(g,g.datum,a,o)):v="removed";const S=r(g,g.datum,v,x),{phase:M,start:k,finish:D,delay:w,duration:I}=S,C=f(S,["phase","start","finish","delay","duration"]),L=l(g,g.datum,v,x),{phase:A,start:T,finish:N,delay:O,duration:R}=L,E=f(L,["phase","start","finish","delay","duration"]),P=null==D&&null==N;i.animate({id:b,groupId:t,phase:null!=(c=null!=M?M:A)?c:"update",duration:null!=I?I:R,delay:null!=w?w:O,from:C,to:E,ease:fn,collapsable:P,onPlay:()=>{g.setProperties(m(m({},k),T))},onUpdate(t){g.setProperties(t),h&&g.setProperties(h(g,g.datum,v,x))},onStop:()=>{g.setProperties(m(m(m(m(m(m({},k),T),C),E),D),N))}}),y&&u++,p++,d=C}};let p=0;for(const s of d){const n=s.nodes();u(n.filter(t=>!s.isGarbage(t)),n),i.animate({id:`${t}_${e}_selection_${p}`,groupId:t,phase:"end",from:0,to:1,ease:fn,onStop(){s.cleanup()}}),p++}u(c,c)}function Tn(t,e,i,s,n,a,o){const{nodes:r,selections:l}=In(s),{start:h,finish:c,phase:d}=o,u=null==c;i.animate({id:`${t}_${e}`,groupId:t,phase:null!=d?d:"update",from:n,to:a,ease:fn,collapsable:u,onPlay:()=>{if(h){for(const t of r)t.setProperties(h);for(const t of l)for(const e of t.nodes())e.setProperties(h)}},onUpdate(t){for(const e of r)e.setProperties(t);for(const e of l)for(const i of e.nodes())i.setProperties(t)},onStop:()=>{for(const t of r)t.setProperties(m(m({},a),c));for(const t of l)for(const e of t.nodes())e.setProperties(m(m({},a),c))}})}function Nn(t,e,i,s){const n=i(t,e);return s.added.has(n)?"added":s.removed.has(n)?"removed":"updated"}var On=2*Math.PI;function Rn(t){return t%=On,(t+=On)%On}function En(t){return t%=On,(t+=On)!==On&&(t%=On),t}function Pn(t){return(t%=On)<-Math.PI?t+=On:t>=Math.PI&&(t-=On),t}function Bn(t,e,i){const s=Rn(t),n=Rn(e),a=En(i);return n<=a?n<=s&&s<=a:n<=s||s<=a}function Fn(t){return t/180*Math.PI}function zn(t){return t/Math.PI*180}function Gn(t,e){return t=Rn(t),(e=Rn(e))-t+(t>e?2*Math.PI:0)}function _n(t,e,i,s){return{x:t+i*Math.cos(s),y:e+i*Math.sin(s)}}var jn=(t,e)=>{const i=Symbol(String(e));t[i]=void 0,Object.defineProperty(t,e,{get(){return this[i]},set(t){this[i]!==t&&(this[i]=t,this.invalid=!0)},enumerable:!0,configurable:!1})},Wn=class t{constructor(){this.type="band",this.invalid=!0,this.interval=void 0,this.index=new Map,this.ordinalRange=[],this._domain=[],this.range=[0,1],this._bandwidth=1,this._step=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0,this.round=!1}static is(e){return e instanceof t}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&R.warnOnce("Expected update to not invalidate scale"))}set domain(t){this.invalid=!0;const e=[];this.index=new Map;const i=this.index;t.forEach(t=>{void 0===this.getIndex(t)&&i.set(t,e.push(t)-1)}),this._domain=e}get domain(){return this._domain}ticks(){this.refresh();let{interval:t=1}=this;"number"!=typeof t&&(t=Number(t));const e=Math.abs(Math.round(t));return this._domain.filter((t,i)=>i%e===0)}convert(t){this.refresh();const e=this.getIndex(t);if(void 0===e)return NaN;const i=this.ordinalRange[e];return void 0===i?NaN:i}invert(t){this.refresh();const e=this.ordinalRange.findIndex(e=>e===t);return this.domain[e]}invertNearest(t){var e;this.refresh();let i=-1,s=1/0;const n=this.ordinalRange.findIndex((e,n)=>{if(e===t)return!0;const a=Math.abs(t-e);return a<s&&(s=a,i=n),!1});return null!=(e=this.domain[n])?e:this.domain[i]}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(t){t=Gs(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this._paddingInner=Gs(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this._paddingOuter=Gs(0,t,1)}get paddingOuter(){return this._paddingOuter}update(){const t=this._domain.length;if(0===t)return;const e=this.round,i=this._paddingInner,s=this._paddingOuter,[n,a]=this.range,o=a-n,r=o/Math.max(1,t+2*s-i),l=e?Math.floor(r):r,h=n+(o-l*(t-i))/2,c=e?Math.round(h):h,d=l*(1-i),u=e?Math.round(d):d,p=r*(1-i),g=[];for(let e=0;e<t;e++)g.push(c+l*e);this._bandwidth=u,this._rawBandwidth=p,this._step=l,this.ordinalRange=g}getIndex(t){if(!(t instanceof Date))return this.index.get(t);const e=t.valueOf();let i=0;for(const t of this.index.keys()){if(t instanceof Date&&t.valueOf()===e)return i;i++}}};b([jn],Wn.prototype,"interval",2),b([jn],Wn.prototype,"range",2),b([jn],Wn.prototype,"round",2);var Vn=Wn;function Kn(t,e=[void 0]){return It((i,s,n)=>e.includes(n)?Bt(t)?t(n):t:n)}function Yn(t,e={}){const{optional:i=!1,property:s}=e;return It((n,a,o)=>{var r;const l=y(m({},e),{target:n,property:a});if(i&&void 0===o||t(o,l))return xe(n[a])&&!xe(o)?(n[a].set(o),n[a]):o;const h=null!=s?s:String(a).replace(/^_*/,""),c=null!=(r=n.constructor.className)?r:n.constructor.name.replace(/Properties$/,"");let d=ja(o);if(null!=d&&d.length>50){const t=d.length-50;d=d.slice(0,50)+`... (+${t} characters)`}return R.warn(`Property [${h}] of [${c}] cannot be set to [${d}]${t.message?`; expecting ${Ga(t,l)}`:""}, ignoring.`),kt},void 0,{optional:i})}var $n,Hn=(...t)=>{const e=[];return za((i,s)=>(e.length=0,t.every(t=>{const n=t(i,s);return n||e.push(Ga(t,s)),n})),()=>e.filter(Boolean).join(" AND "))},Un=(...t)=>za((e,i)=>t.some(t=>t(e,i)),e=>t.map(function(t){return e=>Ga(e,t)}(e)).filter(Boolean).join(" OR ")),Xn=_a(za((t,e)=>xe(t)||Ft(t)&&xe(e.target[e.property]),"a properties object")),Zn=_a(za(t=>Ft(t),"an object")),qn=za(Ot,"a boolean"),Qn=za(Bt,"a function"),Jn=za(_t,"a string"),ta=($n=za(Wt,"a number"),Object.assign($n,{restrict({min:t,max:e}={}){const i=["a number"],s=jt(t),n=jt(e);return s&&n?i.push(`between ${t} and ${e} inclusive`):s?i.push(`greater than or equal to ${t}`):n&&i.push(`less than or equal to ${e}`),za(i=>Wt(i)&&(!s||i>=t)&&(!n||i<=e),i.join(" "))}})),ea=za(t=>jt(t)&&isNaN(t),"NaN"),ia=ta.restrict({min:0}),sa=ta.restrict({min:0,max:1}),na=ta.restrict({min:-360,max:360}),aa=Un(ta,ea),oa=function(t){return Object.assign(t,{restrict({length:t,minLength:e}={}){let i="an array";return jt(e)&&e>0?i="a non-empty array":jt(t)&&(i=`an array of length ${t}`),za(i=>Nt(i)&&(!jt(t)||i.length===t)&&(!jt(e)||i.length>=e),i)}})}(za(Nt,"an array")),ra=(t,e)=>za((e,i)=>Nt(e)&&e.every(e=>t(e,i)),t=>{var i;const s=null!=(i=Ga(oa,t))?i:"";return e?`${s} of ${e}`:s}),la=t=>Wt(t)||Et(t),ha=t=>za((e,i)=>!la(e)||!la(i.target[t])||e<i.target[t],`to be less than ${t}`),ca=t=>za((e,i)=>!la(e)||!la(i.target[t])||e>i.target[t],`to be greater than ${t}`),da=za(Et,"Date object"),ua=Un(da,ia),pa="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",ga=za(t=>_t(t)&&un.validColorString(t),`color String. ${pa}`),ma=za(ra(ga),`color strings. ${pa}`),ya=ra(qn,"boolean values"),fa=ra(ta,"numbers"),xa=ra(Jn,"strings"),ba=za(ra(da),"Date objects"),va=za(ra(Xn),"objects"),Sa=Pa(["butt","round","square"],"a line cap"),Ma=Pa(["round","bevel","miter"],"a line join"),ka=za(ra(ia),"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."),Da=Pa(["top","right","bottom","left"],"a position"),wa=Pa(["normal","italic","oblique"],"a font style"),Ia=Un(Pa(["normal","bold","bolder","lighter"],"a font weight"),ta.restrict({min:1,max:1e3})),Ca=Pa(["never","always","hyphenate","on-space"],"a text wrap strategy"),La=Pa(["left","center","right"],"a text align"),Aa=Pa(["top","middle","bottom"],"a vertical align"),Ta=Pa(["ellipsis","hide"],"an overflow strategy"),Na=Pa(["horizontal","vertical"],"a direction"),Oa=Pa(["inside","outside"],"a placement"),Ra=Un(Pa(["exact","nearest"],"interaction range"),ta),Ea=Pa(["top","bottom","left","right"]);function Pa(t,e="a"){return za(e=>t.includes(e),`${e} keyword such as ${function(t){const e=t.map(t=>`'${t}'`);if(1===e.length)return e[0];const i=e.pop();return`${e.join(", ")} or ${i}`}(t)}`)}var Ba=Un(Hn(ta.restrict({min:1}),ha("maxSpacing")),ea),Fa=Un(Hn(ta.restrict({min:1}),ca("minSpacing")),ea);function za(t,e){return t.message=e,t}function Ga(t,e){return Bt(t.message)?t.message(e):t.message}function _a(t){return Object.assign(t,{restrict:e=>za(t=>t instanceof e,i=>{var s;return null!=(s=Ga(t,i))?s:`an instance of ${e.name}`})})}function ja(t){if("number"==typeof t){if(isNaN(t))return"NaN";if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity"}return JSON.stringify(t)}var Wa=za(t=>Wt(t)&&t>0||t instanceof E,"a non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'"),Va=class extends ye{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6,this.color=void 0,this.interval=void 0,this.values=void 0}};b([Yn(qn)],Va.prototype,"enabled",2),b([Yn(ia)],Va.prototype,"width",2),b([Yn(ia)],Va.prototype,"size",2),b([Yn(ga,{optional:!0})],Va.prototype,"color",2),b([Yn(Wa,{optional:!0})],Va.prototype,"interval",2),b([Yn(oa,{optional:!0})],Va.prototype,"values",2);var Ka=(t=>(t.X="x",t.Y="y",t))(Ka||{}),Ya={constructedArrays:new WeakMap};function $a(t,e){var i;null==(i=Ya.constructedArrays)||i.set(t,e)}var Ha=class t{constructor(e,i){this.invalid=!0,this.nice=!1,this.interval=void 0,this.tickCount=t.defaultTickCount,this.minTickCount=0,this.maxTickCount=1/0,this.niceDomain=[],this.defaultClampMode="raw",this.domain=e,this.range=i}static is(e){return e instanceof t}transform(t){return t}transformInvert(t){return t}calcBandwidth(t=1){const{range:e}=this,i=this.getDomain(),s=Math.abs(e[1]-e[0]),n=Math.abs(i[1]-i[0])/t+1,a=Math.floor(s),o=Math.min(n,a);return s/Math.max(1,o)}getDomain(){return this.nice&&(this.refresh(),this.niceDomain.length)?this.niceDomain:this.domain}convert(t,e){var i;const s=null!=(i=null==e?void 0:e.clampMode)?i:this.defaultClampMode;if(!this.domain||this.domain.length<2)return NaN;this.refresh();const n=this.getDomain().map(t=>this.transform(t)),[a,o]=n,{range:r}=this,[l,h]=r;if(t=this.transform(t),"clamped"===s){const[e,i]=js(n.map(Number));if(Number(t)<e)return l;if(Number(t)>i)return h}return a===o?(l+h)/2:t===a?l:t===o?h:l+(Number(t)-Number(a))/(Number(o)-Number(a))*(h-l)}invert(t){this.refresh();const e=this.getDomain().map(t=>this.transform(t)),[i,s]=e,{range:n}=this,[a,o]=n,r=a>o;let l;return t<(r?o:a)?r?s:i:t>(r?a:o)?r?i:s:(l=a===o?this.toDomain((Number(i)+Number(s))/2):this.toDomain(Number(i)+(t-a)/(o-a)*(Number(s)-Number(i))),this.transformInvert(l))}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&R.warnOnce("Expected update to not invalidate scale"))}getPixelRange(){const[t,e]=this.range;return Math.abs(e-t)}};Ha.defaultTickCount=5,Ha.defaultMaxTickCount=6,b([jn],Ha.prototype,"domain",2),b([jn],Ha.prototype,"range",2),b([jn],Ha.prototype,"nice",2),b([jn],Ha.prototype,"interval",2),b([jn],Ha.prototype,"tickCount",2),b([jn],Ha.prototype,"minTickCount",2),b([jn],Ha.prototype,"maxTickCount",2);var Ua=Ha,Xa={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 Za(t,e=new Date(t.getFullYear(),0,1)){const i=t.getTimezoneOffset()-e.getTimezoneOffset(),s=t.getTime()-e.getTime()+6e4*i;return Math.floor(s/864e5)}function qa(t,e){const i=(e-new Date(t.getFullYear(),0,1).getDay()+7)%7,s=new Date(t.getFullYear(),0,i+1);return s<=t?Math.floor(Za(t,s)/7)+1:0}function Qa(t,e=t.getFullYear()){const i=new Date(e,0,1).getDay(),s=new Date(e,0,(4-i+7)%7-3+1);return s<=t?Math.floor(Za(t,s)/7)+1:Qa(t,e-1)}var Ja={a:t=>Xa.shortDays[t.getDay()],A:t=>Xa.days[t.getDay()],b:t=>Xa.shortMonths[t.getMonth()],B:t=>Xa.months[t.getMonth()],c:"%x, %X",d:(t,e)=>eo(t.getDate(),2,null!=e?e:"0"),e:"%_d",f:(t,e)=>eo(1e3*t.getMilliseconds(),6,null!=e?e:"0"),H:(t,e)=>eo(t.getHours(),2,null!=e?e:"0"),I:(t,e)=>{const i=t.getHours()%12;return 0===i?"12":eo(i,2,null!=e?e:"0")},j:(t,e)=>eo(Za(t)+1,3,null!=e?e:"0"),m:(t,e)=>eo(t.getMonth()+1,2,null!=e?e:"0"),M:(t,e)=>eo(t.getMinutes(),2,null!=e?e:"0"),L:(t,e)=>eo(t.getMilliseconds(),3,null!=e?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)=>eo(t.getSeconds(),2,null!=e?e:"0"),u:t=>{let e=t.getDay();return e<1&&(e+=7),String(e%7)},U:(t,e)=>eo(qa(t,0),2,null!=e?e:"0"),V:(t,e)=>eo(Qa(t),2,null!=e?e:"0"),w:(t,e)=>eo(t.getDay(),2,null!=e?e:"0"),W:(t,e)=>eo(qa(t,1),2,null!=e?e:"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(t,e)=>eo(t.getFullYear()%100,2,null!=e?e:"0"),Y:(t,e)=>eo(t.getFullYear(),4,null!=e?e:"0"),Z:t=>function(t){const e=t.getTimezoneOffset(),i=Math.abs(e);return`${e>0?"-":"+"}${eo(Math.floor(i/60),2,"0")}${eo(Math.floor(i%60),2,"0")}`}(t),"%":()=>"%"},to={_:" ",0:"0","-":""};function eo(t,e,i){const s=String(Math.floor(t));return s.length>=e?s:`${i.repeat(e-s.length)}${s}`}function io(t){const e=[];for(;t.length>0;){let i=t.indexOf("%");if(0!==i){const s=i>0?t.substring(0,i):t;e.push(s)}if(i<0)break;const s=t[i+1],n=to[s];null!=n&&i++;const a=t[i+1],o=Ja[a];if("function"==typeof o)e.push([o,n]);else if("string"==typeof o){const t=io(o);e.push([t,n])}else e.push(`${null!=n?n:""}${a}`);t=t.substring(i+2)}return t=>{const i="number"==typeof t?new Date(t):t;return e.map(t=>"string"==typeof t?t:t[0](i,t[1])).join("")}}function so(t){return t instanceof Date?t.getTime():t}function no(t,e){const i=ao(t,e);return t=>io(i)(t)}function ao(t=[],e=t){let i=8;const s=t=>{t<i&&(i=t)};for(const e of t)s(oo(e));const n=so(e[0]),a=so(e.at(-1)),o=new Date(n).getFullYear(),r=new Date(a).getFullYear();return function(t,e,i){const s=so(i[0]),n=so(i.at(-1)),a=Math.abs(n-s),o=[["hour",216e5,12096e5,3,"%I %p"],["hour",G,216e5,3,"%I:%M"],["second",1e3,216e5,1,":%S"],["ms",0,216e5,0,".%L"],["am/pm",G,216e5,3,"%p"]," ",["day",j,6048e5,4,"%a"],["month",0===a?0:W,314496e5,5,"%b %d"],["month",3024e6,31536e7,6,"%B"]," ",["year",e||8===t?0:V,1/0,8,"%Y"]].filter(e=>{if("string"==typeof e)return!0;const[i,s,n,o]=e;return o>=t&&s<=a&&a<n}).reduce((t,e)=>("string"==typeof e?t.result.push(e):t.used.has(e[0])||(t.result.push(e),t.used.add(e[0])),t),{result:[],used:new Set}).result,r=o.findIndex(t=>"string"!=typeof t),l=o.length-[...o].reverse().findIndex(t=>"string"!=typeof t);return o.slice(r,l).map(t=>"string"==typeof t?t:t[4]).join("").replaceAll(/\s+/g," ").trim()}(i,r-o>0,t)}function oo(t){return $.floor(t)<t?0:X.floor(t)<t?1:Q.floor(t)<t?2:tt.floor(t)<t?3:dt.floor(t)<t?ht.floor(t)<t?4:5:pt.floor(t)<t?6:8}var ro=(t,e=[])=>Object.assign(e,{fractionDigits:t});function lo(t,e,i,s,n){if(i<2)return uo(t,e,e-t);const a=co(t,e,i,s,n);return isNaN(a)?ro(0):uo(t=Math.ceil(t/a)*a,e=Math.floor(e/a)*a,a)}var ho=[1,2,5,10];function co(t,e,i,s=0,n=1/0){const a=Math.abs(e-t),o=a/i,r=Math.floor(Math.log10(o)),l=Math.pow(10,r),h=ho.map(t=>{const e=t*l,o=Math.ceil(a/e);return{multiplier:t,isWithinBounds:o>=s&&o<=n,diffCount:Math.abs(o-i)}}).sort((t,e)=>t.isWithinBounds!==e.isWithinBounds?t.isWithinBounds?-1:1:t.diffCount-e.diffCount)[0].multiplier;return!h||isNaN(h)?NaN:h*l}function uo(t,e,i){const s=Math.min(t,e),n=Math.max(t,e),a=Us(i),o=Math.pow(10,a),r=Math.ceil((n-s)/i),l=ro(a);for(let t=0;t<=r;t++){const e=s+i*t;l.push(Math.round(e*o)/o)}return l}function po({start:t,stop:e,interval:i,count:s,availableRange:n}){return null!=s||(s=(e-t)/("number"==typeof i?i:1)),s>=n&&(R.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0)}var go=class t extends Ua{constructor(){super([],[0,1]),this.type="time"}toDomain(t){return new Date(t)}static getTickInterval({start:e,stop:i,count:s,minCount:n,maxCount:a,target:o}){let r,l;const h=null!=s?s:Ua.defaultTickCount,c=null!=o?o:Math.abs(i-e)/Math.max(h,1),d=t.getIntervalIndex(c);if(0===d)l=Math.max(co(e,i,h,n,a),1),r=F;else if(d===t.tickIntervals.length)l=void 0===o?co(e/V,i/V,h,n,a):1,r=pt;else{const e=c-t.tickIntervals[d-1][2]<t.tickIntervals[d][2]-c?d-1:d;[r,l]=t.tickIntervals[e]}return r.every(l)}static getIntervalIndex(e){let i=0;for(;i<t.tickIntervals.length&&e>t.tickIntervals[i][2];)i++;return i}invert(t){return new Date(super.invert(t))}ticks(){if(!this.domain||this.domain.length<2)return[];this.refresh();const[e,i]=this.getDomain().map(so),s=Math.min(e,i),n=Math.max(e,i),{interval:a,nice:o,tickCount:r,minTickCount:l,maxTickCount:h}=this;if(void 0!==a){const e=this.getPixelRange(),i=t.getTicksForInterval({start:s,stop:n,interval:a,availableRange:e});return null!=i?i:t.getDefaultTicks({start:s,stop:n,tickCount:r,minTickCount:l,maxTickCount:h})}if(o){if(2===r)return this.niceDomain;if(1===r)return this.niceDomain.slice(0,1)}return t.getDefaultTicks({start:s,stop:n,tickCount:r,minTickCount:l,maxTickCount:h})}static getDefaultTicks({start:e,stop:i,tickCount:s,minTickCount:n,maxTickCount:a}){const o=t.getTickInterval({start:e,stop:i,count:s,minCount:n,maxCount:a});return o?o.range(new Date(e),new Date(i)):[]}static getTicksForInterval({start:e,stop:i,interval:s,availableRange:n}){if(!s)return[];if(s instanceof E){const t=s.range(new Date(e),new Date(i));if(po({start:e,stop:i,interval:s,count:t.length,availableRange:n}))return;return t}const a=Math.abs(s);if(po({start:e,stop:i,interval:a,availableRange:n}))return;const o=[...t.tickIntervals];o.reverse();const r=o.find(t=>a%t[2]===0);if(r)return r[0].every(a/(r[2]/r[1])).range(new Date(e),new Date(i));let l=new Date(e);const h=new Date(i),c=[];for(;l<=h;)c.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+a);return c}tickFormat({ticks:t,domain:e,specifier:i}){return null==i?no(t,e):io(i)}update(){!this.domain||this.domain.length<2||this.nice&&this.updateNiceDomain()}updateNiceDomain(){let[t,e]=this.domain;for(let i=0;i<4;i++){this.updateNiceDomainIteration(t,e);const[i,s]=this.niceDomain;if(so(t)===so(i)&&so(e)===so(s))break;t=i,e=s}}updateNiceDomainIteration(e,i){const s=Math.min(so(e),so(i)),n=Math.max(so(e),so(i)),a=e>i,{interval:o}=this;let r;if(o instanceof E)r=o;else{const e="number"==typeof o?(n-s)/Math.max(o,1):this.tickCount;r=t.getTickInterval({start:s,stop:n,count:e,minCount:this.minTickCount,maxCount:this.maxTickCount})}if(r){const t=r.range(new Date(s),new Date(n),!0),e=a?[...t].reverse():t,i=e[0],o=e.at(-1);this.niceDomain=[i,o]}}};go.tickIntervals=[[$,1,z],[$,5,5e3],[$,15,15e3],[$,30,3e4],[X,1,G],[X,5,3e5],[X,15,9e5],[X,30,18e5],[Q,1,_],[Q,3,108e5],[Q,6,216e5],[Q,12,432e5],[tt,1,j],[tt,2,1728e5],[ht,1,W],[ht,2,12096e5],[ht,3,18144e5],[dt,1,2592e6],[dt,2,5184e6],[dt,3,7776e6],[dt,4,10368e6],[dt,6,15552e6],[pt,1,V]];var mo=go,yo=class t extends Vn{constructor(){super(...arguments),this.type="ordinal-time",this.tickCount=Ua.defaultTickCount,this.minTickCount=0,this.maxTickCount=1/0,this.interval=void 0,this.index=new Map,this._domain=[]}static is(e){return e instanceof t}toDomain(t){return new Date(t)}set domain(t){if(this.invalid=!0,0===t.length)return void(this._domain=[]);const e=this.updateIndex(t);this._domain=e}get domain(){return this._domain}updateIndex(t){this.index=new Map;const{index:e}=this,i=[],s=[],n=t[0]>t.at(-1),a=n?0:1;t.forEach((o,r)=>{const l=t[r+1],h=n?o:this.toDomain(so(o)+1),c=n?this.toDomain(so(l)+1):l,d=n?[c,h]:[h,c];i.push(o),void 0!==l&&void 0===e.get(d)&&(s.push(Math.abs(so(c)-so(h))),e.set(d,r+a))}),s.sort((t,e)=>t-e);const o=s.length,r=Math.floor(o/2);this.medianInterval=o>2&&o%2==0?(s[r-1]+s[r+1])/2:s[r];const l=Math.max(0,mo.getIntervalIndex(this.medianInterval)-1),[h,c]=mo.tickIntervals[l],d=h.every(c),u=n?t.length-1:0,p=t[u],g=[d.floor(t[u]),p];return e.set(g,u),i}ticks(){if(!this.domain)return[];this.refresh();const[t,e]=[so(this.domain[0]),so(this.domain.at(-1))],i=Math.min(t,e),s=Math.max(t,e),n=t>e;let a;void 0!==this.interval&&(a=this.getTicksForInterval({start:i,stop:s,interval:this.interval}));const o=this.domain.length,{maxTickCount:r,tickCount:l}=this;let h,{minTickCount:c}=this;isFinite(r)&&o<=r&&(c=Math.max(1,o),h=this.medianInterval),null!=a||(a=this.getDefaultTicks({start:i,stop:s,tickCount:l,minTickCount:c,maxTickCount:r,isReversed:n,interval:h}));const d=new Set;return a.filter(t=>{const e=this.convert(t);return!isNaN(e)&&!d.has(e)&&(d.add(e),!0)})}getDefaultTicks({start:t,stop:e,tickCount:i,minTickCount:s,maxTickCount:n,isReversed:a,interval:o}){const r=mo.getTickInterval({start:t,stop:e,count:i,minCount:s,maxCount:n,target:o});if(!r)return[];const l=Math.ceil(this.domain.length/n),h=[];for(const[t,e]of this.index.entries()){if(e%l>0)continue;const i=a?r.ceil(t[0]):r.floor(t[1]);h.splice(e,0,i)}return h}getTicksForInterval({start:t,stop:e,interval:i}){var s;const[n,a]=this.range,o=Math.abs(a-n);return null!=(s=mo.getTicksForInterval({start:t,stop:e,interval:i,availableRange:o}))?s:[]}convert(t){if("number"==typeof t&&(t=new Date(t)),!(t instanceof Date))return NaN;let e;this.refresh();for(const[i,s]of this.index.entries())if(t>=i[0]&&t<=i[1]){e=s;break}if(void 0===e)return NaN;const i=this.ordinalRange[e];return void 0===i?NaN:i}tickFormat({ticks:t,domain:e,specifier:i}){return null==i?no(t,e):io(i)}invert(t){return new Date(super.invert(t))}invertNearest(t){return new Date(super.invertNearest(t))}};b([jn],yo.prototype,"tickCount",2),b([jn],yo.prototype,"minTickCount",2),b([jn],yo.prototype,"maxTickCount",2),b([jn],yo.prototype,"interval",2);var fo=yo;function xo(t,e){return"number"==typeof t&&"number"==typeof e?t-e:"string"==typeof t&&"string"==typeof e?t.localeCompare(e):null==t&&null==e?0:null==t?-1:null==e?1:String(t).localeCompare(String(e))}function bo(t){return"function"==typeof t?t():t}function vo(t,e,i){for(const s in t){const n=i(bo(t[s]),bo(e[s]));if(0!==n)return n}return 0}var So=class t extends ln{constructor(t){var e;super({isVirtual:null==t?void 0:t.isVirtual}),this.opts=t,this.opacity=1,this.lastBBox=void 0;const{zIndex:i,zIndexSubOrder:s}=null!=t?t:{};this.isContainerNode=!0,void 0!==i&&(this.zIndex=i),void 0!==s&&(this.zIndexSubOrder=s),this.name=null==(e=this.opts)?void 0:e.name}static is(e){return e instanceof t}onZIndexChange(){var t;super.onZIndexChange(),this.layer&&(null==(t=this._layerManager)||t.moveLayer(this.layer,this.zIndex,this.zIndexSubOrder))}isLayer(){return null!=this.layer}_setLayerManager(t){if(this._layerManager&&this.layer&&(this._layerManager.removeLayer(this.layer),this.layer=void 0),this.layer)throw new Error("AG Charts - unable to deregister scene rendering layer!");super._setLayerManager(t)}initialiseLayer(){var t;this.layer||this._layerManager&&!0===(null==(t=this.opts)?void 0:t.layer)&&(this.layer=this._layerManager.addLayer({name:this.name,zIndex:this.zIndex,zIndexSubOrder:this.zIndexSubOrder,getComputedOpacity:()=>this.getComputedOpacity(),getVisibility:()=>this.getVisibility()}))}getComputedOpacity(){let e=1;for(const i of this.traverseUp())i instanceof t&&(e*=i.opacity);return e}getVisibility(){for(const t of this.traverseUp())if(!t.visible)return!1;return!0}onVisibleChange(){this.layer&&(this.layer.enabled=this.visible)}markDirty(t,e=1){if(this.isVirtual)return void super.markDirty(t,e);let i=e;(e<2||null!=this.layer)&&(i=1),super.markDirty(t,e,i)}containsPoint(t,e){return!0}computeBBox(){return this.computeTransformMatrix(),t.computeBBox(this.children)}computeTransformedBBox(){return this.computeBBox()}preRender(){var t,e;const i=super.preRender();return i.groups+=1,i.nonGroups-=1,!0!==(null==(t=this.opts)?void 0:t.layer)||null!=this.layer||(i.nonGroups>0&&this.initialiseLayer(),(null==(e=this.opts)?void 0:e.nonEmptyChildDerivedZIndex)&&i.nonGroups>0&&this.deriveZIndexFromChildren()),i}deriveZIndexFromChildren(){var t;const e=this.children.filter(t=>t._childNodeCounts.nonGroups>0);this.sortChildren(e);const i=e.at(-1);this.zIndex=null!=(t=null==i?void 0:i.zIndex)?t:-1/0,this.zIndexSubOrder=null==i?void 0:i.zIndexSubOrder}render(t){var e,i;const{opts:{name:s}={},_debug:n}=this,{dirty:a,dirtyZIndex:o,layer:r,children:l,clipRect:h,dirtyTransform:c}=this;let{ctx:d,forceRender:u,clipBBox:p}=t;const{resized:g,stats:f}=t,x=d.getTransform(),b=a>=2||o||g;let v=b,S=!1;for(const t of l)if(v||(v=null==t.layerManager&&t.dirty>=1),S||(S=null!=t.layerManager&&t.dirty>=1),v)break;if(s&&(null==n||n({name:s,group:this,isDirty:b,isChildDirty:v,dirtyTransform:c,renderCtx:t,forceRender:u})),c)u="dirtyTransform";else if(r){const t=this.computeBBox();void 0!==this.lastBBox&&this.lastBBox.equals(t)||(u="dirtyTransform",this.lastBBox=t)}if(!(b||v||S||u))return s&&f&&(null==n||n({name:s,result:"skipping",renderCtx:t,counts:this.nodeCount,group:this})),r&&f&&(f.layersSkipped++,f.nodesSkipped+=this.nodeCount.count),void this.markClean({recursive:!1});const M=this.visible;if(r){if(d=r.context,d.save(),d.setTransform(r.pixelRatio,0,0,r.pixelRatio,0,0),"dirtyTransform"!==u&&(u=v||o),u&&r.clear(),p){const{width:e,height:i,x:a,y:o}=p;null==n||n(()=>({name:s,clipBBox:p,ctxTransform:d.getTransform(),renderCtx:t,group:this})),d.beginPath(),d.rect(a,o,e,i),d.clip()}d.setTransform(x)}else d.globalAlpha*=this.opacity;if(this.computeTransformMatrix(),this.matrix.toContext(d),h){const{x:e,y:i,width:a,height:o}=h;d.save(),null==n||n(()=>({name:s,clipRect:h,ctxTransform:d.getTransform(),renderCtx:t,group:this})),d.beginPath(),d.rect(e,i,a,o),d.clip(),p=this.matrix.transformBBox(h)}const k=this.hasVirtualChildren();o?(this.sortChildren(l),"dirtyTransform"!==u&&(u=!0)):k&&this.sortChildren(l);const D=u!==t.forceRender||p!==t.clipBBox||d!==t.ctx?y(m({},t),{ctx:d,forceRender:u,clipBBox:p}):t;let w=0;for(const t of l)t.visible&&M?u||0!==t.dirty?(d.save(),t.render(D),d.restore()):f&&(w+=t.nodeCount.count):(t.markClean(),f&&(w+=t.nodeCount.count));if(f&&(f.nodesSkipped+=w),super.render(t),h&&d.restore(),k)for(const t of this.virtualChildren)t.markClean({recursive:"virtual"});r&&(f&&f.layersRendered++,d.restore(),u&&r.snapshot(),null==(i=(e=r.context).verifyDepthZero)||i.call(e)),s&&f&&(null==n||n({name:s,result:"rendered",skipped:w,renderCtx:t,counts:this.nodeCount,group:this}))}sortChildren(t){this.dirtyZIndex=!1,t.sort((t,e)=>{var i,s;return vo([t.zIndex,...null!=(i=t.zIndexSubOrder)?i:[void 0,void 0],t.serialNumber],[e.zIndex,...null!=(s=e.zIndexSubOrder)?s:[void 0,void 0],e.serialNumber],xo)})}static computeBBox(t){let e=1/0,i=-1/0,s=1/0,n=-1/0;for(const a of t){if(!a.visible)continue;const t=a.computeTransformedBBox();if(!t)continue;const{x:o,y:r,width:l,height:h}=t;o<e&&(e=o),r<s&&(s=r),o+l>i&&(i=o+l),r+h>n&&(n=r+h)}return new Qs(e,s,i-e,n-s)}setClipRectInGroupCoordinateSpace(t){this.clipRect=t?this.transformBBox(t):void 0}};So.className="Group",b([en({redraw:3,convertor:t=>Gs(0,t,1)})],So.prototype,"opacity",2);var Mo=So,ko=class{constructor(t=[]){this.stops=t}},Do=class extends ko{constructor(t,e=0){super(t),this.angle=e}createGradient(t,e){const{stops:i,angle:s}=this,n=Rn(Fn(s+90)),a=Math.cos(n),o=Math.sin(n),r=e.width,l=e.height,h=e.x+.5*r,c=e.y+.5*l;if(r>0&&l>0){const e=Math.sqrt(l*l+r*r)/2,s=Math.atan2(l,r);let d;d=n<Math.PI/2?n:n<Math.PI?Math.PI-n:n<1.5*Math.PI?n-Math.PI:2*Math.PI-n;const u=e*Math.abs(Math.cos(d-s)),p=t.createLinearGradient(h+a*u,c+o*u,h-a*u,c-o*u);for(const t of i)p.addColorStop(t.offset,t.color);return p}return"black"}},wo=/^linear-gradient\((.*?)deg,\s*(.*?)\s*\)$/i,Io=class t extends ln{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=t.defaultStyles.fill,this.stroke=t.defaultStyles.stroke,this.strokeWidth=t.defaultStyles.strokeWidth,this.lineDash=t.defaultStyles.lineDash,this.lineDashOffset=t.defaultStyles.lineDashOffset,this.lineCap=t.defaultStyles.lineCap,this.lineJoin=t.defaultStyles.lineJoin,this.opacity=t.defaultStyles.opacity,this.fillShadow=t.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:t}=this.constructor;Object.assign(this,t)}onFillChange(){const{fill:t}=this;let e;if((null==t?void 0:t.startsWith("linear-gradient"))&&(e=wo.exec(t))){const t=parseFloat(e[1]),i=[],s=e[2],n=/(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi;let a;for(;a=n.exec(s);)i.push(a[0]);this.gradient=new Do(i.map((t,e)=>({color:t,offset:e/(i.length-1)})),t)}else this.gradient=void 0}align(t,e){var i,s,n;const a=null!=(n=null==(s=null==(i=this.layerManager)?void 0:i.canvas)?void 0:s.pixelRatio)?n:1,o=Math.round(t*a)/a;return null==e?o:0===e?0:e<1?Math.ceil(e*a)/a:Math.round((e+t)*a)/a-o}fillStroke(t,e){this.renderFill(t,e),this.renderStroke(t,e)}renderFill(t,e){if(this.fill){const{globalAlpha:i}=t;this.applyFill(t),this.applyFillAlpha(t),this.applyShadow(t),this.executeFill(t,e),t.globalAlpha=i}t.shadowColor="rgba(0, 0, 0, 0)"}executeFill(t,e){e?t.fill(e):t.fill()}applyFill(t){var e,i;t.fillStyle=null!=(i=null==(e=this.gradient)?void 0:e.createGradient(t,this.computeBBox()))?i:this.fill}applyFillAlpha(t){t.globalAlpha*=this.opacity*this.fillOpacity}applyShadow(t){var e,i;const s=null!=(i=null==(e=this.layerManager)?void 0:e.canvas.pixelRatio)?i:1,n=this.fillShadow;(null==n?void 0:n.enabled)&&(t.shadowColor=n.color,t.shadowOffsetX=n.xOffset*s,t.shadowOffsetY=n.yOffset*s,t.shadowBlur=n.blur*s)}renderStroke(t,e){if(this.stroke&&this.strokeWidth){const{globalAlpha:i}=t;t.strokeStyle=this.stroke,t.globalAlpha*=this.opacity*this.strokeOpacity,t.lineWidth=this.strokeWidth,this.lineDash&&t.setLineDash(this.lineDash),this.lineDashOffset&&(t.lineDashOffset=this.lineDashOffset),this.lineCap&&(t.lineCap=this.lineCap),this.lineJoin&&(t.lineJoin=this.lineJoin),this.executeStroke(t,e),t.globalAlpha=i}}executeStroke(t,e){e?t.stroke(e):t.stroke()}containsPoint(t,e){return this.isPointInPath(t,e)}};Io.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},b([en({redraw:2})],Io.prototype,"fillOpacity",2),b([en({redraw:2})],Io.prototype,"strokeOpacity",2),b([en({redraw:2,changeCb:t=>t.onFillChange()})],Io.prototype,"fill",2),b([en({redraw:2})],Io.prototype,"stroke",2),b([en({redraw:2})],Io.prototype,"strokeWidth",2),b([en({redraw:2})],Io.prototype,"lineDash",2),b([en({redraw:2})],Io.prototype,"lineDashOffset",2),b([en({redraw:2})],Io.prototype,"lineCap",2),b([en({redraw:2})],Io.prototype,"lineJoin",2),b([en({redraw:2,convertor:t=>Gs(0,t,1)})],Io.prototype,"opacity",2),b([en({redraw:2,checkDirtyOnAssignment:!0})],Io.prototype,"fillShadow",2);var Co=Io,Lo=class extends Co{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.isRange=!1,this.restoreOwnStyles()}computeBBox(){return new Qs(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(t,e){return!1}render(t){var e;const{ctx:i,forceRender:s,stats:n}=t;if(0===this.dirty&&!s)return void(n&&(n.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(i);let{x1:a,y1:o,x2:r,y2:l}=this;a=this.align(a),o=this.align(o),r=this.align(r),l=this.align(l);const{fill:h,opacity:c,isRange:d}=this;if(d&&h){const{fillOpacity:t}=this;i.fillStyle=h,i.globalAlpha=c*t,i.beginPath(),i.moveTo(a,o),i.lineTo(r,o),i.lineTo(r,l),i.lineTo(a,l),i.closePath(),i.fill()}const{stroke:u,strokeWidth:p,startLine:g,endLine:m}=this;if((g||m)&&u&&p){const{strokeOpacity:t,lineDash:e,lineDashOffset:s,lineCap:n,lineJoin:h}=this;i.strokeStyle=u,i.globalAlpha=c*t,i.lineWidth=p,e&&i.setLineDash(e),s&&(i.lineDashOffset=s),n&&(i.lineCap=n),h&&(i.lineJoin=h),i.beginPath(),g&&(i.moveTo(a,o),i.lineTo(r,o)),m&&(i.moveTo(r,l),i.lineTo(a,l)),i.stroke()}null==(e=this.fillShadow)||e.markClean(),super.render(t)}};Lo.className="Range",Lo.defaultStyles=y(m({},Co.defaultStyles),{strokeWidth:1}),b([en({redraw:2})],Lo.prototype,"x1",2),b([en({redraw:2})],Lo.prototype,"y1",2),b([en({redraw:2})],Lo.prototype,"x2",2),b([en({redraw:2})],Lo.prototype,"y2",2),b([en({redraw:2})],Lo.prototype,"startLine",2),b([en({redraw:2})],Lo.prototype,"endLine",2),b([en({redraw:2})],Lo.prototype,"isRange",2);var Ao=new WeakMap,To=new WeakMap;function No(t,e){var i,s,n;const a=JSON.stringify(t,null,0);return Ao.has(e)||Ao.set(e,new Map),(null==(i=Ao.get(e))?void 0:i.has(a))||null==(s=Ao.get(e))||s.set(a,e(t)),null==(n=Ao.get(e))?void 0:n.get(a)}function Oo(t){return(e,...i)=>{var s,n,a;const o=JSON.stringify(e,null,0);return To.has(t)||To.set(t,new Map),(null==(s=To.get(t))?void 0:s.has(o))||null==(n=To.get(t))||n.set(o,t(e,...i)),null==(a=To.get(t))?void 0:a.get(o)}}function Ro(t){const{redraw:e=3,changeCb:i}=null!=t?t:{};return en({redraw:e,type:"font",changeCb:i})}var Eo=class t extends Co{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this._dirtyFont=!0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=t.defaultStyles.textAlign,this.textBaseline=t.defaultStyles.textBaseline}onTextChange(){var t,e;this.lines=null!=(e=null==(t=this.text)?void 0:t.split("\n").map(t=>t.trim()))?e:[]}get font(){return(null==this._font||this._dirtyFont)&&(this._dirtyFont=!1,this._font=Fo(this)),this._font}computeBBox(){const{x:e,y:i,lines:s,lineHeight:n,textBaseline:a,textAlign:o}=this,{top:r,left:l,width:h,height:c}=t.getTextSizeMultiline(s,Fo(this),a,o,n);return new Qs(e-l,i-r,h,c)}getLineHeight(e){var i,s;if(this.lineHeight)return this.lineHeight;const n=t.measureText(e,this.font,this.textBaseline,this.textAlign);return(null!=(i=n.fontBoundingBoxAscent)?i:n.emHeightAscent)+(null!=(s=n.fontBoundingBoxDescent)?s:n.emHeightDescent)}isPointInPath(t,e){const i=this.transformPoint(t,e),s=this.computeBBox();return!!s&&s.containsPoint(i.x,i.y)}render(t){const{ctx:e,forceRender:i,stats:s}=t;if(0===this.dirty&&!i)return void(s&&(s.nodesSkipped+=this.nodeCount.count));if(!this.lines.length||!this.layerManager)return void(s&&(s.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(e);const{fill:n,stroke:a,strokeWidth:o}=this;e.font=this.font,e.textAlign=this.textAlign,e.textBaseline=this.textBaseline;const r=this.layerManager.canvas.pixelRatio||1,{globalAlpha:l}=e;if(n){e.fillStyle=n,e.globalAlpha=l*this.opacity*this.fillOpacity;const{fillShadow:t}=this;(null==t?void 0:t.enabled)&&(e.shadowColor=t.color,e.shadowOffsetX=t.xOffset*r,e.shadowOffsetY=t.yOffset*r,e.shadowBlur=t.blur*r),this.renderLines((t,i,s)=>e.fillText(t,i,s))}if(a&&o){e.strokeStyle=a,e.lineWidth=o,e.globalAlpha=l*this.opacity*this.strokeOpacity;const{lineDash:t,lineDashOffset:i,lineCap:s,lineJoin:n}=this;t&&e.setLineDash(t),i&&(e.lineDashOffset=i),s&&(e.lineCap=s),n&&(e.lineJoin=n),this.renderLines((t,i,s)=>e.strokeText(t,i,s))}super.render(t)}renderLines(e){const{lines:i,x:s,y:n}=this,a=i.map(t=>this.getLineHeight(t)),o=a.reduce((t,e)=>t+e,0);let r=(a[0]-o)*t.getVerticalModifier(this.textBaseline);for(let t=0;t<i.length;t++)e(i[t],s,n+r),r+=a[t]}static wrapLines(e,i,s,n,a,o){const r="hide"!==o,l=new Bo(n),h=e.split(/\r?\n/g);if(0===h.length)return{lines:void 0,truncated:!1};if("never"===a){const{text:e,truncated:s}=t.truncateLine(h[0],i,l,r?"auto":"never");return{lines:null!=e?[e]:void 0,truncated:s}}const c=[];let d=0,u=!1;for(const e of h){const o=t.wrapLine(e,i,s,l,n,a,d,r);if(null==o)return{lines:void 0,truncated:!1};if(c.push(...o.result),d=o.cumulativeHeight,o.truncated){u=!0;break}}return{lines:c,truncated:u}}static wrap(e,i,s,n,a,o="ellipsis"){var r;const{lines:l,truncated:h}=t.wrapLines(e,i,s,n,a,o);return{text:null!=(r=null==l?void 0:l.join("\n").trim())?r:"",truncated:h}}static wrapLine(e,i,s,n,a,o,r,l){if(!(e=e.trim()))return{result:[],truncated:!1,cumulativeHeight:r};const h=n.size(e);if(h.width<=i)return{result:[e],truncated:!1,cumulativeHeight:r+h.height};if(h.height>s||n.width("W")>i)return l?{result:[],truncated:!0,cumulativeHeight:r}:void 0;const c=e.split(/\s+/g),d=t.wrapLineSequentially(c,i,s,n,a,o,r,l);if(null==d)return;r=d.cumulativeHeight;let{lines:u}=d;if(!d.wordsBrokenOrTruncated&&!d.linesTruncated){const e=d.lines.length,s=t.wrapLineBalanced(c,i,n,e);s.length===u.length&&(u=s)}return{result:u.map(t=>t.join(" ")),truncated:d.linesTruncated,cumulativeHeight:r}}static breakWord(e,i,s,n,a){const o=i=>t.punctuationMarks.includes(e[i]),r=n?a.width("-"):0,l=[];let h=0,c=0;for(let t=0;t<e.length;t++){const n=e[t],o=a.width(n);h+o+r>(0===c?i:s)&&(l.push(t),h=0,c++),h+=o}const d=[];let u=0;for(const t of l){let i=e.substring(u,t);n&&i.length>0&&!o(t-1)&&!o(t)&&(i+="-"),d.push(i),u=t}return d.push(e.substring(u)),d}static truncateLine(t,e,i,s){t=t.trimEnd();const n=i.width(t);if(n>e&&"never"===s)return{text:void 0,truncated:!1};if(n<=e&&"force"!==s)return{text:t,truncated:!1};const a=i.width("…");let o=t,r=n;for(;o.length>0&&r+a>e;)o=o.slice(0,-1).trimEnd(),r=i.width(o);return r+a<=e?{text:`${o}…`,truncated:!0}:{text:void 0,truncated:!1}}static wrapLineSequentially(e,i,s,n,a,o,r,l){const{fontSize:h=0,lineHeight:c=h*t.defaultLineHeightRatio}=a,d="always"===o||"hyphenate"===o,u="hyphenate"===o,p=n.width(" ");let g=!1,m=!1;const y=[];let f=[],x=0;const b=()=>({lines:y,linesTruncated:m,wordsBrokenOrTruncated:g,cumulativeHeight:r}),v=()=>{if(!l)return;const e=f.join(" "),{text:s}=t.truncateLine(e,i,n,"force");return null!=s?(f.splice(0,f.length,s),m=!0,b()):void 0},S=()=>{const t=r+c;return!(t>=s||(f=[],x=0,r=t,y.push(f),0))};if(!S())return v();for(let s=0;s<e.length;s++){const a=e[s],o=n.width(a),r=0===f.length?0:p,h=x+r+o;if(h<=i)f.push(a),x=h;else if(o<=i){if(!S())return v();f.push(a),x=o}else{if(g=!0,!d){if(l){if(!S())return v();const{text:o}=t.truncateLine(a,i,n,"force");if(null==o)return;f.push(o),s<e.length-1&&(m=!0);break}return}{const e=i-x-r,s=t.breakWord(a,e,i,u,n);for(let t=0;t<s.length;t++){const e=s[t];if(e&&f.push(e),t===s.length-1)x=n.width(e);else if(!S())return v()}}}}return b()}static wrapLineBalanced(t,e,i,s){const n=t.reduce((t,e)=>t+i.width(e),0),a=i.width(" "),o=(n+a*(t.length-s-2))/s,r=[];let l=[],h=i.width(t[0]),c=!0;for(const s of t){const t=i.width(s);if(c){l=[],l.push(s),h=t,c=!1,r.push(l);continue}const n=h+a+t;n<=o?(l.push(s),h=n):n<=e?(l.push(s),c=!0):(l=[s],h=t,r.push(l))}return r}setFont(t){this.fontFamily=t.fontFamily,this.fontSize=t.fontSize,this.fontStyle=t.fontStyle,this.fontWeight=t.fontWeight}setAlign(t){this.textAlign=t.textAlign,this.textBaseline=t.textBaseline}static getVerticalModifier(t){switch(t){case"top":case"hanging":return 0;case"bottom":case"alphabetic":case"ideographic":return 1;case"middle":return.5}}static get textContext(){if(!this._textContext){const t=Ss("canvas");t.width=0,t.height=0,this._textContext=t.getContext("2d")}return this._textContext}static measureText(t,e,i,s){return this._measureText({text:t,font:e,textBaseline:i,textAlign:s})}static getTextSize(t,e){return this._getTextSize({text:t,font:e})}static getTextSizeMultiline(e,i,s=t.defaultStyles.textBaseline,n=t.defaultStyles.textAlign,a){var o,r;let l=0,h=0,c=0,d=0,u=0;for(const[t,a]of e.entries()){const p=this._measureText({text:a,font:i,textBaseline:s,textAlign:n});h=Math.max(h,p.actualBoundingBoxLeft),c=Math.max(c,p.width),0==t?(l+=p.actualBoundingBoxAscent,d+=p.actualBoundingBoxAscent):u+=null!=(o=p.fontBoundingBoxAscent)?o:p.emHeightAscent,t==e.length-1?d+=p.actualBoundingBoxDescent:u+=null!=(r=p.fontBoundingBoxDescent)?r:p.emHeightDescent}return null!=a&&(u=(e.length-1)*a),d+=u,l+=u*t.getVerticalModifier(s),{top:l,left:h,width:c,height:d}}};Eo.className="Text",Eo.defaultLineHeightRatio=1.15,Eo.defaultStyles=Object.assign({},Co.defaultStyles,{textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"}),Eo.ellipsis="…",Eo.punctuationMarks=[".",",","-",":",";","!","?","'",'"',"(",")"],Eo._measureText=Oo(({text:t,font:e,textBaseline:i,textAlign:s})=>{const n=Eo.textContext;return n.font!==e&&(n.font=e),n.textBaseline!==i&&(n.textBaseline=i),n.textAlign!==s&&(n.textAlign=s),n.measureText(t)}),Eo._getTextSize=Oo(({text:t,font:e})=>{const i=Eo.textContext;i.font!==e&&(i.font=e);const s=i.measureText(t);return{width:s.width,height:s.actualBoundingBoxAscent+s.actualBoundingBoxDescent}}),b([en({redraw:3})],Eo.prototype,"x",2),b([en({redraw:3})],Eo.prototype,"y",2),b([en({redraw:3,changeCb:t=>t.onTextChange()})],Eo.prototype,"text",2),b([Ro()],Eo.prototype,"fontStyle",2),b([Ro()],Eo.prototype,"fontWeight",2),b([Ro()],Eo.prototype,"fontSize",2),b([Ro()],Eo.prototype,"fontFamily",2),b([en({redraw:3})],Eo.prototype,"textAlign",2),b([en({redraw:3})],Eo.prototype,"textBaseline",2),b([en({redraw:3})],Eo.prototype,"lineHeight",2);var Po=Eo,Bo=class{constructor(t){this.font=_t(t)?t:Fo(t)}size(t){return t.includes("\n")?Po.getTextSizeMultiline(t.split("\n").map(t=>t.trim()),this.font):Po.getTextSize(t,this.font)}width(t){const{width:e}=this.size(t);return e}};function Fo(t){const{fontFamily:e,fontSize:i,fontStyle:s,fontWeight:n}=t;return[null!=s?s:"",null!=n?n:"",i+"px",e].join(" ").trim()}var zo=class extends ye{constructor(){super(...arguments),this.enabled=!0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}getFont(){return Fo(this)}};function Go(t){const{parallelFlipRotation:e=0,regularFlipRotation:i=0}=t,s=t.rotation?Rn(Fn(t.rotation)):0,n=!s&&e>=0&&e<=Math.PI?-1:1,a=!s&&i>=0&&i<=Math.PI?-1:1;let o=0;return t.parallel?o=n*Math.PI/2:-1===a&&(o=Math.PI),{configuredRotation:s,defaultRotation:o,parallelFlipFlag:n,regularFlipFlag:a}}function _o(t,e,i,s,n){const a=e>0&&e<=Math.PI,o=i>0&&i<=Math.PI;if(t){if(!e&&!i)return"center";if(s*(a||o?-1:1)==-1)return"end"}else if(s*n===-1)return"end";return"start"}function jo(t,e,i,s,n){const{width:a,height:o}=e,r=new Qs(i,s,0,0);n.transformBBox(r,e);const{x:l,y:h}=e;return e.width=a,e.height=o,{point:{x:l,y:h},label:{text:t,width:a,height:o}}}b([Yn(qn)],zo.prototype,"enabled",2),b([Yn(ga,{optional:!0})],zo.prototype,"color",2),b([Yn(wa,{optional:!0})],zo.prototype,"fontStyle",2),b([Yn(Ia,{optional:!0})],zo.prototype,"fontWeight",2),b([Yn(ia)],zo.prototype,"fontSize",2),b([Yn(Jn)],zo.prototype,"fontFamily",2),b([Yn(Qn,{optional:!0})],zo.prototype,"formatter",2);var Wo=(t=>(t[t.SERIES_BACKGROUND_ZINDEX=0]="SERIES_BACKGROUND_ZINDEX",t[t.AXIS_GRID_ZINDEX=1]="AXIS_GRID_ZINDEX",t[t.AXIS_ZINDEX=2]="AXIS_ZINDEX",t[t.SERIES_CROSSLINE_RANGE_ZINDEX=3]="SERIES_CROSSLINE_RANGE_ZINDEX",t[t.SERIES_LAYER_ZINDEX=4]="SERIES_LAYER_ZINDEX",t[t.SERIES_HIGHLIGHT_ZINDEX=5]="SERIES_HIGHLIGHT_ZINDEX",t[t.AXIS_FOREGROUND_ZINDEX=6]="AXIS_FOREGROUND_ZINDEX",t[t.SERIES_CROSSHAIR_ZINDEX=7]="SERIES_CROSSHAIR_ZINDEX",t[t.SERIES_LABEL_ZINDEX=8]="SERIES_LABEL_ZINDEX",t[t.SERIES_CROSSLINE_LINE_ZINDEX=9]="SERIES_CROSSLINE_LINE_ZINDEX",t[t.SERIES_ANNOTATION_ZINDEX=10]="SERIES_ANNOTATION_ZINDEX",t[t.LEGEND_ZINDEX=11]="LEGEND_ZINDEX",t[t.NAVIGATOR_ZINDEX=12]="NAVIGATOR_ZINDEX",t))(Wo||{});function Vo(t){return null!=t&&Object.hasOwn(t,"toString")&&_t(t.toString())}function Ko(t){return null!=t&&Object.hasOwn(t,"valueOf")&&Wt(t.valueOf())}function Yo(t){return Wt(t)||Et(t)||Ko(t)}function $o(t,e){return null!=t&&(!e||Yo(t))}function Ho(t){return Vo(t)&&Object.hasOwn(t,"id")?t.id:t}var Uo=t=>"value"===t?za((t,e)=>"line"===e.target.type,t=>"range"===t.target.type?"crossLine type 'range' to have a 'range' property instead of 'value'":"crossLine property 'type' to be 'line'"):za((t,e)=>"range"===e.target.type,t=>"line"===t.target.type?"crossLine type 'line' to have a 'value' property instead of 'range'":"crossLine property 'type' to be 'range'"),Xo=(t,e,i,s)=>{const n="line"===t&&void 0!==e,a="range"===t&&void 0!==i;if(!n&&!a)return!0;const[o,r]=null!=i?i:[e,void 0],l=Ua.is(s)||fo.is(s),h=$o(o,l)&&!isNaN(s.convert(o)),c=$o(r,l)&&!isNaN(s.convert(r));if(n&&h||a&&h&&c)return!0;const d=["Expecting crossLine"];return a?(h||d.push(`range start ${ja(o)}`),c||d.push(`${h?"":"and "}range end ${ja(r)}`)):d.push(`value ${ja(o)}`),d.push("to match the axis scale domain."),R.warnOnce(d.join(" ")),!1},Zo={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},topLeft:{xTranslationDirection:1,yTranslationDirection:-1},topRight:{xTranslationDirection:-1,yTranslationDirection:-1},bottomLeft:{xTranslationDirection:1,yTranslationDirection:1},bottomRight:{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},insideLeft:{xTranslationDirection:1,yTranslationDirection:0},insideRight:{xTranslationDirection:-1,yTranslationDirection:0},insideTop:{xTranslationDirection:0,yTranslationDirection:1},insideBottom:{xTranslationDirection:0,yTranslationDirection:-1},insideTopLeft:{xTranslationDirection:1,yTranslationDirection:1},insideBottomLeft:{xTranslationDirection:1,yTranslationDirection:-1},insideTopRight:{xTranslationDirection:-1,yTranslationDirection:1},insideBottomRight:{xTranslationDirection:-1,yTranslationDirection:-1}},qo={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},topLeft:{xTranslationDirection:-1,yTranslationDirection:-1},topRight:{xTranslationDirection:-1,yTranslationDirection:1},bottomLeft:{xTranslationDirection:1,yTranslationDirection:-1},bottomRight:{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},insideLeft:{xTranslationDirection:0,yTranslationDirection:1},insideRight:{xTranslationDirection:0,yTranslationDirection:-1},insideTop:{xTranslationDirection:-1,yTranslationDirection:0},insideBottom:{xTranslationDirection:1,yTranslationDirection:0},insideTopLeft:{xTranslationDirection:-1,yTranslationDirection:1},insideBottomLeft:{xTranslationDirection:1,yTranslationDirection:1},insideTopRight:{xTranslationDirection:-1,yTranslationDirection:-1},insideBottomRight:{xTranslationDirection:1,yTranslationDirection:-1}};function Qo({yDirection:t,padding:e=0,position:i="top",bbox:s}){const n=t?Zo:qo,{xTranslationDirection:a,yTranslationDirection:o}=n[i];return{xTranslation:a*(e+(t?s.width:s.height)/2),yTranslation:o*(e+(t?s.height:s.width)/2)}}var Jo=({yDirection:t,xEnd:e,yStart:i,yEnd:s})=>t?{x:e/2,y:i}:{x:e,y:isNaN(s)?i:(i+s)/2},tr=({yDirection:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t?{x:e,y:isNaN(n)?s:(s+n)/2}:{x:i/2,y:s},er=({yDirection:t,xEnd:e,yStart:i,yEnd:s})=>t?{x:e,y:isNaN(s)?i:(i+s)/2}:{x:e/2,y:isNaN(s)?i:s},ir=({yDirection:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t?{x:i/2,y:isNaN(n)?s:n}:{x:e,y:isNaN(n)?s:(s+n)/2},sr=({yDirection:t,xStart:e,xEnd:i,yStart:s})=>t?{x:e/2,y:s}:{x:i,y:s},nr=({yDirection:t,xStart:e,yStart:i,yEnd:s})=>t?{x:e,y:isNaN(s)?i:s}:{x:e,y:i},ar=({yDirection:t,xEnd:e,yStart:i,yEnd:s})=>t?{x:e,y:i}:{x:e,y:isNaN(s)?i:s},or=({yDirection:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t?{x:i,y:isNaN(n)?s:n}:{x:e,y:isNaN(n)?s:n},rr={top:{c:Jo},bottom:{c:ir},left:{c:tr},right:{c:er},topLeft:{c:sr},topRight:{c:ar},bottomLeft:{c:nr},bottomRight:{c:or},inside:{c:({xEnd:t,yStart:e,yEnd:i})=>({x:t/2,y:isNaN(i)?e:(e+i)/2})},insideLeft:{c:tr},insideRight:{c:er},insideTop:{c:Jo},insideBottom:{c:ir},insideTopLeft:{c:sr},insideBottomLeft:{c:nr},insideTopRight:{c:ar},insideBottomRight:{c:or}},lr=Pa(["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","inside","insideLeft","insideRight","insideTop","insideBottom","insideTopLeft","insideBottomLeft","insideTopRight","insideBottomRight"],"crossLine label position"),hr=class{constructor(){this.enabled=void 0,this.text=void 0,this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)",this.position=void 0,this.rotation=void 0,this.parallel=void 0}};b([Yn(qn,{optional:!0})],hr.prototype,"enabled",2),b([Yn(Jn,{optional:!0})],hr.prototype,"text",2),b([Yn(wa,{optional:!0})],hr.prototype,"fontStyle",2),b([Yn(Ia,{optional:!0})],hr.prototype,"fontWeight",2),b([Yn(ia)],hr.prototype,"fontSize",2),b([Yn(Jn)],hr.prototype,"fontFamily",2),b([Yn(ta)],hr.prototype,"padding",2),b([Yn(ga,{optional:!0})],hr.prototype,"color",2),b([Yn(lr,{optional:!0})],hr.prototype,"position",2),b([Yn(na,{optional:!0})],hr.prototype,"rotation",2),b([Yn(qn,{optional:!0})],hr.prototype,"parallel",2);var cr=class t{constructor(){this.id=Bs(this),this.enabled=void 0,this.type=void 0,this.range=void 0,this.value=void 0,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=void 0,this.strokeOpacity=void 0,this.lineDash=void 0,this.label=new hr,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.group=new Mo({name:`${this.id}`,layer:!0,zIndex:t.LINE_LAYER_ZINDEX}),this.labelGroup=new Mo({name:`${this.id}`,layer:!0,zIndex:t.LABEL_LAYER_ZINDEX}),this.crossLineRange=new Lo,this.crossLineLabel=new Po,this.labelPoint=void 0,this.data=[],this.startLine=!1,this.endLine=!1,this.isRange=!1;const{group:e,labelGroup:i,crossLineRange:s,crossLineLabel:n}=this;e.append(s),i.append(n),s.pointerEvents=1}update(t){const{enabled:e,data:i,type:s,value:n,range:a,scale:o}=this;if(!(s&&o&&e&&t&&Xo(s,n,a,o)&&0!==i.length))return this.group.visible=!1,void(this.labelGroup.visible=!1);this.group.visible=t,this.labelGroup.visible=t,this.group.zIndex=this.getZIndex(this.isRange),this.updateNodes()}calculateLayout(t,e){if(!t)return;if(!this.createNodeData(e))return;const{sideFlag:i,gridLength:s,data:n}=this,a=[],o=i*s,r=n[0],l=n[1],h=new Qs(Math.min(0,o),Math.min(r,l),Math.abs(0-o),Math.abs(r-l));a.push(h);const c=this.computeLabelBBox();return c&&a.push(c),Qs.merge(a)}updateNodes(){this.updateRangeNode(),this.label.enabled&&(this.updateLabel(),this.positionLabel())}createNodeData(t){var e,i,s;const{scale:n,gridLength:a,sideFlag:o,direction:r,label:{position:l="top"},clippedRange:h,strokeWidth:c=0}=this;if(this.data=[],!n)return!1;const d=null!=(e=n.bandwidth)?e:0,u=null!=(i=n.step)?i:0,p=(t?-1:1)*(n instanceof Vn?(u-d)/2:0),[g,m]=[0,o*a];let[y,f]=this.getRange();const x=void 0===f&&fo.is(n)?d/2+p:0;let[b,v]=[Number(n.convert(y,{clampMode:"clamped"}))-p+x,n.convert(f,{clampMode:"clamped"})+d+p];b=_s(b,h),v=_s(v,h),[y,f]=[Number(n.convert(y))+x,n.convert(f)+d];const S=(y===b||f===v||b!==v)&&Math.abs(v-b)>0;if(S&&b>v&&([b,v]=[v,b],[y,f]=[f,y]),y-p>=b&&(y-=p),f+p<=v&&(f+=p),this.isRange=S,this.startLine=c>0&&y>=b&&y<=b+p,this.endLine=c>0&&f>=v-d-p&&f<=v,!S&&!this.startLine&&!this.endLine)return!1;if(this.data=[b,v],this.label.enabled){const t="y"===r,{c:e=Jo}=null!=(s=rr[l])?s:{},{x:i,y:n}=e({yDirection:t,xStart:g,xEnd:m,yStart:b,yEnd:v});this.labelPoint={x:i,y:n}}return!0}updateRangeNode(){var t;const{crossLineRange:e,sideFlag:i,gridLength:s,data:n,startLine:a,endLine:o,isRange:r,fill:l,fillOpacity:h,stroke:c,strokeWidth:d,lineDash:u}=this;e.x1=0,e.x2=i*s,e.y1=n[0],e.y2=n[1],e.startLine=a,e.endLine=o,e.isRange=r,e.fill=l,e.fillOpacity=null!=h?h:1,e.stroke=c,e.strokeWidth=null!=d?d:1,e.strokeOpacity=null!=(t=this.strokeOpacity)?t:1,e.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,y:i}={},label:{parallel:s,rotation:n,position:a="top",padding:o=0},direction:r,parallelFlipRotation:l,regularFlipRotation:h}=this;if(void 0===e||void 0===i)return;const{defaultRotation:c,configuredRotation:d}=Go({rotation:n,parallel:s,regularFlipRotation:h,parallelFlipRotation:l});t.rotation=c+d,t.textBaseline="middle",t.textAlign="center";const u=t.computeTransformedBBox();if(!u)return;const p="y"===r,{xTranslation:g,yTranslation:m}=Qo({yDirection:p,padding:o,position:a,bbox:u});t.translationX=e+g,t.translationY=i+m}getZIndex(e=!1){return e?t.RANGE_LAYER_ZINDEX:t.LINE_LAYER_ZINDEX}getRange(){var t;const{value:e,range:i,scale:s}=this,n=Ua.is(s)||fo.is(s),a=null!=(t=null==i?void 0:i[0])?t:e;let o=null==i?void 0:i[1];return n||void 0!==o||(o=a),n&&a===o&&(o=void 0),[a,o]}computeLabelBBox(){const{label:t}=this;if(!t.enabled)return;const e=new Po;e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text;const{labelPoint:{x:i,y:s}={},label:{parallel:n,rotation:a,position:o="top",padding:r=0},direction:l,parallelFlipRotation:h,regularFlipRotation:c}=this;if(void 0===i||void 0===s)return;const{configuredRotation:d}=Go({rotation:a,parallel:n,regularFlipRotation:c,parallelFlipRotation:h});e.rotation=d,e.textBaseline="middle",e.textAlign="center";const u=e.computeTransformedBBox();if(!u)return;const p="y"===l,{xTranslation:g,yTranslation:m}=Qo({yDirection:p,padding:r,position:o,bbox:u});return e.translationX=i+g,e.translationY=s+m,e.computeTransformedBBox()}calculatePadding(t){var e,i,s,n,a,o,r,l;const{isRange:h,startLine:c,endLine:d,direction:u,label:{padding:p=0,position:g="top"}}=this;if(!h&&!c&&!d)return;const m=this.computeLabelBBox();if(null==(null==m?void 0:m.x)||null==(null==m?void 0:m.y))return;const y=function({yDirection:t,bbox:e,padding:i=0,position:s="top"}){const n={};return s.startsWith("inside")||("top"!==s||t?"bottom"!==s||t?"left"===s&&t?n.left=i+e.width:"right"===s&&t&&(n.right=i+e.width):n.bottom=i+e.height:n.top=i+e.height),n}({yDirection:"y"===u,padding:p,position:g,bbox:m});t.left=Math.max(null!=(e=t.left)?e:0,null!=(i=y.left)?i:0),t.right=Math.max(null!=(s=t.right)?s:0,null!=(n=y.right)?n:0),t.top=Math.max(null!=(a=t.top)?a:0,null!=(o=y.top)?o:0),t.bottom=Math.max(null!=(r=t.bottom)?r:0,null!=(l=y.bottom)?l:0)}};cr.LINE_LAYER_ZINDEX=9,cr.RANGE_LAYER_ZINDEX=3,cr.LABEL_LAYER_ZINDEX=8,cr.className="CrossLine",b([Yn(qn,{optional:!0})],cr.prototype,"enabled",2),b([Yn(Pa(["range","line"],"a crossLine type"),{optional:!0})],cr.prototype,"type",2),b([Yn(Hn(Uo("range"),oa.restrict({length:2})),{optional:!0})],cr.prototype,"range",2),b([Yn(Uo("value"),{optional:!0})],cr.prototype,"value",2),b([Yn(ga,{optional:!0})],cr.prototype,"fill",2),b([Yn(sa,{optional:!0})],cr.prototype,"fillOpacity",2),b([Yn(ga,{optional:!0})],cr.prototype,"stroke",2),b([Yn(ta,{optional:!0})],cr.prototype,"strokeWidth",2),b([Yn(sa,{optional:!0})],cr.prototype,"strokeOpacity",2),b([Yn(ka,{optional:!0})],cr.prototype,"lineDash",2);var dr=cr,ur=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){var e;const i=_t(t)?t:t.optionsKey;null==(e=this.moduleMap.get(i))||e.moduleInstance.destroy(),this.moduleMap.delete(i)}getModule(t){var e;return null==(e=this.moduleMap.get(_t(t)?t:t.optionsKey))?void 0:e.moduleInstance}isEnabled(t){return this.moduleMap.has(_t(t)?t:t.optionsKey)}mapModules(t){return Array.from(this.moduleMap.values(),(e,i)=>t(e.moduleInstance,i))}destroy(){var t;for(const e of this.moduleMap.keys())null==(t=this.moduleMap.get(e))||t.moduleInstance.destroy();this.moduleMap.clear()}},pr={};function gr(t,e){const{nodes:i,selections:s}=In(t);for(const t of s){for(const i of t.nodes()){const t=e(i,i.datum);i.setProperties(t)}t.cleanup()}for(const t of i){const i=e(t,t.datum);t.setProperties(i)}}x(pr,{resetMotion:()=>gr});var mr=class{constructor(t,e,i){this.states=e,this.preTransitionCb=i,this.debug=Cs.create(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,"color: green")}transition(t,e){var i,s;const n=this.states[this.state],a=null==n?void 0:n[t];if(!a)return void this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.state}`,"color: grey");let o=this.state;return"string"==typeof a?o=a:"object"==typeof a&&(o=a.target),this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${o}`,"color: green"),null==(i=this.preTransitionCb)||i.call(this,this.state,o),this.state=o,"function"==typeof a?a(e):"object"==typeof a&&(null==(s=a.action)||s.call(a,e)),this.state}},yr=t=>`(${t})`,fr=t=>`${yr(t)}?`,xr=t=>fr(`?:${t}`),br=new RegExp(["^",xr(`${fr(".")}${yr("[<>=^]")}`),fr("[+\\-( ]"),fr("[$€£¥₣₹#]"),fr("0"),fr("\\d+"),fr(","),xr(`\\.${yr("\\d+")}`),fr("~"),fr("[%a-z]"),"$"].join(""),"i"),vr=new RegExp(["^",yr(".*?"),`#\\{${yr(".+?")}\\}`,yr(".*?"),"$"].join(""));function Sr(t){let e,i;const s=vr.exec(t);s&&([,e,t,i]=s);const n=br.exec(t);if(!n)throw new Error(`The number formatter is invalid: ${t}`);const[,a,o,r,l,h,c,d,u,p,g]=n;return{fill:a,align:o,sign:r,symbol:l,zero:h,width:parseInt(c),comma:d,precision:parseInt(u),trim:Boolean(p),type:g,prefix:e,suffix:i}}function Mr(t){const e="string"==typeof t?Sr(t):t,{fill:i,align:s,sign:n="-",symbol:a,zero:o,width:r,comma:l,type:h,prefix:c="",suffix:d="",precision:u}=e;let{trim:p}=e;const g=void 0===u||isNaN(u);let m,y;if(h)if(h in wr&&h in Dr)m=g?Dr[h]:wr[h];else if(h in wr)m=wr[h];else{if(!(h in Dr))throw new Error(`The number formatter type is invalid: ${h}`);m=Dr[h]}else m=wr.g,p=!0;return y=null==u||g?h?6:12:u,t=>{let e=m(t,y);return p&&(e=e.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")),l&&(e=function(t,e){let i=t.indexOf(".");i<0&&(i=t.length);const s=t.substring(0,i).split(""),n=t.substring(i);for(let t=s.length-3;t>0;t-=3)s.splice(t,0,e);return`${s.join("")}${n}`}(e,l)),e=function(t,e,i=""){if("("===i)return t>=0?e:`(${e})`;return`${t>=0?"+"===i?"+":"":"−"}${e}`}(t,e,n),a&&"#"!==a&&(e=`${a}${e}`),"#"===a&&"x"===h&&(e=`0x${e}`),"s"===h&&(e=`${e}${function(t){return Ar[Ir(t)]}(t)}`),"%"!==h&&"p"!==h||(e=`${e}%`),null==r||isNaN(r)||(e=function(t,e,i=" ",s=">"){let n=t;if(">"!==s&&s){if("<"===s)n=n.padEnd(e,i);else if("^"===s){const t=Math.max(0,e-n.length),s=Math.ceil(t/2),a=Math.floor(t/2);n=n.padStart(s+n.length,i),n=n.padEnd(a+n.length,i)}}else n=n.padStart(e,i);return n}(e,r,null!=i?i:o,s)),e=`${c}${e}${d}`,e}}var kr=t=>Math.floor(Math.abs(t)),Dr={b:t=>kr(t).toString(2),c:t=>String.fromCharCode(t),d:t=>Math.round(Math.abs(t)).toFixed(0),o:t=>kr(t).toString(8),x:t=>kr(t).toString(16),X:t=>Dr.x(t).toUpperCase(),n:t=>Dr.d(t),"%":t=>`${kr(100*t).toFixed(0)}`},wr={e:(t,e)=>Math.abs(t).toExponential(e),E:(t,e)=>wr.e(t,e).toUpperCase(),f:(t,e)=>Math.abs(t).toFixed(e),F:(t,e)=>wr.f(t,e).toUpperCase(),g:(t,e)=>{if(0===t)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i));return s>=-4&&s<e?i.toFixed(e-1-s):i.toExponential(e-1)},G:(t,e)=>wr.g(t,e).toUpperCase(),n:(t,e)=>wr.g(t,e),p:(t,e)=>wr.r(100*t,e),r:(t,e)=>{if(0===t)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i))-(e-1);if(s<=0)return i.toFixed(-s);const n=Math.pow(10,s);return(Math.round(i/n)*n).toFixed()},s:(t,e)=>{const i=Ir(t);return wr.r(t/Math.pow(10,i),e)},"%":(t,e)=>wr.f(100*t,e)};function Ir(t){return Gs(Cr,t?3*Math.floor(Math.log10(Math.abs(t))/3):0,Lr)}var Cr=-24,Lr=24,Ar={[Cr]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"µ",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[Lr]:"Y"};function Tr(t,e){const i=Sr(null!=e?e:",f"),{precision:s}=i;(null==s||isNaN(s))&&("f"===i.type||"%"===i.type?i.precision=Math.max(...t.map(t=>{if("number"!=typeof t||0===t)return 0;const e=Math.floor(Math.log10(Math.abs(t))),s=i.type?6:12,n=t.toExponential(s-1).replace(/\.?0+e/,"e"),a=n.indexOf(".");if(a<0)return e>=0?0:-e;const o=n.indexOf("e")-a;return Math.max(0,o-e-1)})):i.type&&!(i.type in wr)||(i.precision=Math.max(...t.map(t=>{if("number"!=typeof t)return 0;const e=t.toExponential((i.type?6:12)-1).replace(/\.?0+e/,"e");return e.substring(0,e.indexOf("e")).replace(".","").length}))));const n=Mr(i);return t=>n(Number(t))}var Nr=class t extends Ua{constructor(){super([1,10],[0,1]),this.type="log",this.base=10,this.baseLog=T,this.basePow=T,this.log=t=>Math.min(...this.domain)>=0?this.baseLog(t):-this.baseLog(-t),this.pow=t=>Math.min(...this.domain)>=0?this.basePow(t):-this.basePow(-t),this.defaultClampMode="clamped"}toDomain(t){return t}transform(t){return Math.min(...this.domain)>=0?Math.log(t):-Math.log(-t)}transformInvert(t){return Math.min(...this.domain)>=0?Math.exp(t):-Math.exp(-t)}refresh(){this.base<=0&&(this.base=0,R.warnOnce("expecting a finite Number greater than to 0")),super.refresh()}update(){!this.domain||this.domain.length<2||(this.baseLog=t.getBaseLogMethod(this.base),this.basePow=t.getBasePowerMethod(this.base),this.nice&&this.updateNiceDomain())}updateNiceDomain(){const[t,e]=this.domain,i=t>e?Math.ceil:Math.floor,s=t>e?Math.floor:Math.ceil,n=this.pow(i(this.log(t))),a=this.pow(s(this.log(e)));this.niceDomain=[n,a]}ticks(){var t;const e=null!=(t=this.tickCount)?t:10;if(!this.domain||this.domain.length<2||e<1)return[];this.refresh();const i=this.base,[s,n]=this.getDomain(),a=Math.min(s,n),o=Math.max(s,n);let r=this.log(a),l=this.log(o);if(this.interval){const t=Math.abs(this.interval),e=Math.abs(l-r);let i=uo(r,l,Math.min(e,t));i=ro(i.fractionDigits,i.map(t=>this.pow(t)).filter(t=>t>=a&&t<=o));const s=this.getPixelRange();if(!po({start:a,stop:o,interval:t,count:i.length,availableRange:s}))return i}if(i%1!=0||l-r>=e){let t=lo(r,l,Math.min(l-r,e));return t=ro(t.fractionDigits,t.map(t=>this.pow(t))),t}const h=[],c=a>0;r=Math.floor(r)-1,l=Math.round(l)+1;const d=Ws(this.range)/e;let u=1/0;for(let t=r;t<=l;t++){const e=this.convert(this.pow(t+1));for(let s=1;s<i;s++){const n=c?s:i-s+1,r=this.pow(t)*n,l=this.convert(r),p=Math.abs(u-l),g=Math.abs(l-e);r>=a&&r<=o&&(1===s||p>=d&&g>=d||0===h.length)&&(h.push(r),u=l)}}return h}tickFormat({count:t,ticks:e,specifier:i}){return t!==1/0&&null==e&&this.ticks(),null!=i||(i=10===this.base?".0e":","),_t(i)?Mr(i):i}static getBaseLogMethod(t){switch(t){case 10:return Math.log10;case Math.E:return Math.log;case 2:return Math.log2;default:const e=Math.log(t);return t=>Math.log(t)/e}}static getBasePowerMethod(t){switch(t){case 10:return t=>t>=0?p(10,t):1/p(10,-t);case Math.E:return Math.exp;default:return e=>p(t,e)}}};b([jn],Nr.prototype,"base",2);var Or=Nr,Rr=class t{constructor(t,e,i=!0){this.parentNode=t,this.autoCleanup=i,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=Cs.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(ln,e)?()=>new e:e}static select(e,i,s=!0){return new t(e,i,s)}static selectAll(t,e){const i=[],s=t=>{e(t)&&i.push(t),t.children.forEach(s)};return s(t),i}static selectByClass(e,i,...s){return t.selectAll(e,t=>t instanceof i||s.some(e=>t instanceof e))}static selectByTag(e,i){return t.selectAll(e,t=>t.tag===i)}createNode(t,e,i){const s=this.nodeFactory(t);return s.datum=t,null==e||e(s),null==i?this._nodes.push(s):this._nodes.splice(i,0,s),this.parentNode.appendChild(s),s}update(t,e,i){if(this.garbageBin.size>0&&this.debug(`Selection - update() called with pending garbage: ${t}`),i){const s=new Map(t.map((t,e)=>[i(t),[t,e]]));for(const[t,e]of this._nodesMap.entries())if(s.has(e)){const[i]=s.get(e);t.datum=i,this.garbageBin.delete(t),s.delete(e)}else this.garbageBin.add(t);for(const[t,[i,n]]of s.entries())this._nodesMap.set(this.createNode(i,e,n),t)}else{const i=Math.max(t.length,this.data.length);for(let s=0;s<i;s++)s>=t.length?this.garbageBin.add(this._nodes[s]):s>=this._nodes.length?this.createNode(t[s],e):(this._nodes[s].datum=t[s],this.garbageBin.delete(this._nodes[s]))}return this.data=t.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return 0===this.garbageBin.size||(this._nodes=this._nodes.filter(t=>!this.garbageBin.has(t)||(this._nodesMap.delete(t),this.garbageBin.delete(t),this.parentNode.removeChild(t),!1))),this}clear(){return this.update([]),this}isGarbage(t){return this.garbageBin.has(t)}hasGarbage(){return this.garbageBin.size>0}each(t){for(const e of this._nodes.entries())t(e[1],e[1].datum,e[0]);return this}*[Symbol.iterator](){for(let t=0;t<this._nodes.length;t++){const e=this._nodes[t],i=this._nodes[t].datum;yield{node:e,datum:i,index:t}}}select(e){return t.selectAll(this.parentNode,e)}selectByClass(e){return t.selectByClass(this.parentNode,e)}selectByTag(e){return t.selectByTag(this.parentNode,e)}nodes(){return this._nodes}};function Er(t,e,i,s){const n=t-i,a=e-s;return n*n+a*a}function Pr(t,e,i,s,n,a,o){if(i===n&&s===a)return Math.min(o,Er(t,e,i,s));const r=n-i,l=a-s,h=Math.max(0,Math.min(1,((t-i)*r+(e-s)*l)/(r*r+l*l))),c=i+h*r,d=s+h*l;return Math.min(o,Er(t,e,c,d))}function Br(t,e,i,s,n,a,o,r,l){if(r&&([o,a]=[a,o]),!Bn(Math.atan2(e-s,t-i),a,o)){const o=i+Math.cos(a)*n,r=s+Math.sin(a)*n,h=i+Math.cos(a)*n,c=s+Math.sin(a)*n;return Math.min(l,Er(t,e,o,r),Er(t,e,h,c))}const h=n-Math.sqrt(Er(t,e,i,s));return Math.min(l,h*h)}var Fr=class extends Co{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(t){this.x1=t,this.x2=t}set y(t){this.y1=t,this.y2=t}computeBBox(){return new Qs(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(t,e){if(this.x1===this.x2||this.y1===this.y2){const{x:i,y:s}=this.transformPoint(t,e);return this.computeBBox().grow(this.strokeWidth/2).containsPoint(i,s)}return!1}distanceSquared(t,e){const{x1:i,y1:s,x2:n,y2:a}=this;return Pr(t,e,i,s,n,a,1/0)}render(t){var e;const{ctx:i,forceRender:s,stats:n,devicePixelRatio:a}=t;if(0===this.dirty&&!s)return void(n&&(n.nodesSkipped+=this.nodeCount.count));this.computeTransformMatrix(),this.matrix.toContext(i);let{x1:o,y1:r,x2:l,y2:h}=this;if(o===l){const{strokeWidth:t}=this,e=Math.round(o*a)/a+Math.trunc(t*a)%2/(2*a);o=e,l=e}else if(r===h){const{strokeWidth:t}=this,e=Math.round(r*a)/a+Math.trunc(t*a)%2/(2*a);r=e,h=e}i.beginPath(),i.moveTo(o,r),i.lineTo(l,h),this.fillStroke(i),null==(e=this.fillShadow)||e.markClean(),super.render(t)}};function zr(t,e,i,s,n,a){if(0===t.size)return!1;let o=t.x,r=t.y;null!=e&&(o-=(e.x-.5)*t.size,r-=(e.y-.5)*t.size);let l=o;o<i?l=i:o>i+n&&(l=i+n);let h=r;r<s?h=s:r>s+a&&(h=s+a);const c=o-l,d=r-h;return Math.sqrt(c*c+d*d)<=.5*t.size}function Gr(t,e,i,s,n){const a=t.x+t.width>e&&t.x<e+s,o=t.y+t.height>i&&t.y<i+n;return a&&o}function _r(t,e,i,s,n){return e+s<t.x+t.width&&e>t.x&&i>t.y&&i+n<t.y+t.height}function jr(t){return null!=t&&"object"==typeof t.point&&"object"==typeof t.label}Fr.className="Line",Fr.defaultStyles=Object.assign({},Co.defaultStyles,{fill:void 0,strokeWidth:1}),b([en({redraw:3})],Fr.prototype,"x1",2),b([en({redraw:3})],Fr.prototype,"y1",2),b([en({redraw:3})],Fr.prototype,"x2",2),b([en({redraw:3})],Fr.prototype,"y2",2);var Wr={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0}};function Vr(t,e){return t.length===e.length&&t.every((t,i)=>{const s=e[i];return Array.isArray(t)&&Array.isArray(s)?Vr(t,s):t===s})}function Kr(t,e){return t.length===e.length&&t.every((t,i)=>Number(t)===Number(e[i]))}function Yr(t){const e=Nt(t)?t:t.split(".");if(1===e.length){const[t]=e;return It((e,i,s)=>e[t]=s,e=>e[t])}return It((t,i,s)=>te(t,e,s),t=>Qt(t,e))}function $r(t){return It((e,i,s)=>e[t]=s)}function Hr(t,e){return It((i,s,n)=>i[t][null!=e?e:s]=n)}function Ur(t){const{newValue:e,oldValue:i,changeValue:s}=t;return It((t,n,a,o)=>(a!==o&&(void 0!==o&&(null==i||i.call(t,o)),void 0!==a&&(null==e||e.call(t,a)),null==s||s.call(t,a,o)),a))}function Xr(t){return e=t,(t,i)=>{wt(t,i).observers.push(e)};var e}function Zr(t,e,i){void 0===i||""===i?null==t||t.removeAttribute(e):null==t||t.setAttribute(e,i.toString())}function qr(t,e,i,s,n){let{top:a,right:o,bottom:r,left:l,width:h,height:c}=n;return null!=l?null!=h?o=i-l+h:null!=o&&(h=i-l-o):null!=o&&null!=h&&(l=i-o-h),null!=a?null!=c?r=s-a-c:null!=r&&(c=s-r-a):null!=r&&null!=c&&(a=s-r-c),null==h?null==c?(h=t,c=e):h=Math.ceil(t*c/e):null==c&&(c=Math.ceil(e*h/t)),null==l&&(l=null==o?Math.floor((i-h)/2):i-o-h),null==a&&(a=null==r?Math.floor((s-c)/2):s-c-r),{x:l,y:a,width:h,height:c}}var Qr="ag-chart-tooltip",Jr="ag-chart-dark-tooltip",tl={html:"",ariaLabel:""};function el(t){const e=(t,e,i)=>0===e||"."!==i[e-1]?". ":" ";return t.replace(/<br\s*\/?>/g,e).replace(/<\/p\s+>/g,e).replace(/<\/li\s*\/>/g,e).replace(/<[^>]+>/g,"")}function il(t,e){var i,s,n;if("string"==typeof t)return{html:t,ariaLabel:t};const{content:a=(null!=(i=null==e?void 0:e.content)?i:""),title:o=(null==e?void 0:e.title),color:r=(null!=(s=null==e?void 0:e.color)?s:"white"),backgroundColor:l=(null!=(n=null==e?void 0:e.backgroundColor)?n:"#888")}=t;return{html:`${o?`<div class="${Qr}-title"\n        style="color: ${r}; background-color: ${l}">${o}</div>`:""}${a?`<div class="${Qr}-content">${a}</div>`:""}`,ariaLabel:el(`${o?`${o}: `:""}${a}`)}}var sl=class extends ye{constructor(){super(...arguments),this.type="pointer",this.xOffset=0,this.yOffset=0}};b([Yn(Pa(["pointer","node","top","right","bottom","left","top-left","top-right","bottom-right","bottom-left"],"a position type"))],sl.prototype,"type",2),b([Yn(ta)],sl.prototype,"xOffset",2),b([Yn(ta)],sl.prototype,"yOffset",2);var nl=class extends ye{constructor(){super(),this.enabled=!0,this.delay=0,this.range="nearest",this.wrapping="hyphenate",this.position=new sl,this.darkTheme=!1,this.enableInteraction=!1,this.lastVisibilityChange=Date.now(),this.wrapTypes=["always","hyphenate","on-space","never"],this.showTimeout=0,this._showArrow=!0,this.element=Ss("div",Qr),Zr(this.element,"aria-hidden",!0),this.root=bs("body"),this.root.appendChild(this.element)}destroy(){this.element.remove()}isVisible(){return!this.element.classList.contains(Qr+"-hidden")}show(t,e,i,s=!1){var n,a,o,r,l,h,c,d,u;const{element:p}=this;if(null!=i)p.innerHTML=i.html;else if(!p.innerHTML)return void this.toggle(!1);const g=null!=(a=null==(n=e.position)?void 0:n.type)?a:this.position.type,m=null!=(r=null==(o=e.position)?void 0:o.xOffset)?r:0,y=null!=(h=null==(l=e.position)?void 0:l.yOffset)?h:0,f=this.getTooltipBounds({positionType:g,meta:e,yOffset:y,xOffset:m,canvasRect:t}),x=this.getWindowSize(),b=qr(p.clientWidth,p.clientHeight,t.width,t.height,f);b.x+=t.x,b.y+=t.y;const v=Gs(0,b.x,x.width-p.clientWidth-1),S=Gs(0,b.y,x.height-p.clientHeight),M=v!==b.x||S!==b.y,k=!("node"!==g&&"pointer"!==g||M||m||y),D=null!=(d=null!=(c=e.showArrow)?c:this.showArrow)?d:k;this.updateShowArrow(D),p.style.transform=`translate(${Math.round(v)}px, ${Math.round(S)}px)`,this.enableInteraction=null!=(u=e.enableInteraction)&&u,this.delay>0&&!s?(this.toggle(!1),this.showTimeout=setTimeout(()=>{this.toggle(!0)},this.delay)):this.toggle(!0)}getWindowSize(){const{innerWidth:t,innerHeight:e}=vs();return{width:t,height:e}}toggle(t){const{classList:e}=this.element,i=(t,i)=>e.toggle(`${Qr}-${t}`,i),s=this.isVisible();let n=1/0;if(t||clearTimeout(this.showTimeout),s!==t){const t=Date.now();n=t-this.lastVisibilityChange,this.lastVisibilityChange=t}n>5&&i("no-animation",!s&&t&&n>100),i("no-interaction",!this.enableInteraction),i("hidden",!t),i("arrow",this._showArrow),e.toggle(Jr,this.darkTheme);for(const t of this.wrapTypes)e.toggle(`${Qr}-wrap-${t}`,t===this.wrapping)}pointerLeftOntoTooltip(t){var e;if(!this.enableInteraction)return!1;const i=null==(e=t.sourceEvent.relatedTarget)?void 0:e.classList,s=Boolean(["","-title","-content"].filter(t=>null==i?void 0:i.contains(`${Qr}${t}`)));return void 0!==i&&s}updateShowArrow(t){this._showArrow=t}getTooltipBounds({positionType:t,meta:e,yOffset:i,xOffset:s,canvasRect:n}){const{clientWidth:a,clientHeight:o}=this.element,r={width:a,height:o};switch(t){case"node":case"pointer":return r.top=e.offsetY+i-o-8,r.left=e.offsetX+s-a/2,r;case"top":return r.top=i,r.left=n.width/2-a/2+s,r;case"right":return r.top=n.height/2-o/2+i,r.left=n.width-a/2+s,r;case"left":return r.top=n.height/2-o/2+i,r.left=s,r;case"bottom":return r.top=n.height-o+i,r.left=n.width/2-a/2+s,r;case"top-left":return r.top=i,r.left=s,r;case"top-right":return r.top=i,r.left=n.width-a+s,r;case"bottom-right":return r.top=n.height-o+i,r.left=n.width-a+s,r;case"bottom-left":return r.top=n.height-o+i,r.left=s,r}}};b([Yn(qn)],nl.prototype,"enabled",2),b([Yn(qn,{optional:!0})],nl.prototype,"showArrow",2),b([Xr((t,e,i)=>{e&&t.element.classList.add(e),i&&t.element.classList.remove(i)}),Yn(Jn,{optional:!0})],nl.prototype,"class",2),b([Yn(ia)],nl.prototype,"delay",2),b([Yn(Ra)],nl.prototype,"range",2),b([Yn(Ca)],nl.prototype,"wrapping",2),b([Yn(Xn)],nl.prototype,"position",2),b([Yn(qn)],nl.prototype,"darkTheme",2);var al=class extends ye{constructor(){super(...arguments),this.id=Bs(this),this.node=new Po({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.truncated=!1}getOrAddRegion(t,e){return"root"===e?t.regionManager.getRegion("root"):t.regionManager.addRegionFromProperties({name:e,bboxproviders:[this.node],canInteraction:()=>this.enabled&&this.node.visible})}registerInteraction(t,e){const i=this.getOrAddRegion(t,e);return function(...t){return()=>{for(const e of t)e()}}(i.addListener("hover",e=>this.handleMouseMove(t,e)),i.addListener("leave",e=>this.handleMouseLeave(t,e)))}computeTextWrap(t,e){var i,s;const{text:n,wrapping:a}=this,o=Math.min(null!=(i=this.maxWidth)?i:1/0,t),r=null!=(s=this.maxHeight)?s:e;if(!isFinite(o)&&!isFinite(r))return void(this.node.text=n);const{text:l,truncated:h}=Po.wrap(null!=n?n:"",o,r,this,a);this.node.text=l,this.truncated=h}updateTooltip(t,e){if(void 0!==e&&this.enabled&&this.node.visible&&this.truncated){const{offsetX:i,offsetY:s}=e;return t.tooltipManager.updateTooltip(this.id,{offsetX:i,offsetY:s,lastPointerEvent:e,showArrow:!1},il({content:this.text})),!0}return!1}handleMouseMove(t,e){this.updateTooltip(t,e)&&e.consume()}handleMouseLeave(t,e){t.tooltipManager.removeTooltip(this.id)}};al.SMALL_PADDING=10,al.LARGE_PADDING=20,b([Yn(qn)],al.prototype,"enabled",2),b([Yn(Jn,{optional:!0}),Hr("node")],al.prototype,"text",2),b([Yn(La,{optional:!0}),Hr("node")],al.prototype,"textAlign",2),b([Yn(wa,{optional:!0}),Hr("node")],al.prototype,"fontStyle",2),b([Yn(Ia,{optional:!0}),Hr("node")],al.prototype,"fontWeight",2),b([Yn(ia),Hr("node")],al.prototype,"fontSize",2),b([Yn(Jn),Hr("node")],al.prototype,"fontFamily",2),b([Yn(ga,{optional:!0}),Hr("node","fill")],al.prototype,"color",2),b([Yn(ia,{optional:!0})],al.prototype,"spacing",2),b([Yn(ia,{optional:!0})],al.prototype,"lineHeight",2),b([Yn(ia,{optional:!0})],al.prototype,"maxWidth",2),b([Yn(ia,{optional:!0})],al.prototype,"maxHeight",2),b([Yn(Ca)],al.prototype,"wrapping",2);var ol=["stroke","lineDash"],rl=ra(t=>Ft(t)&&Object.keys(t).every(t=>ol.includes(t)),"objects with gridline style properties such as 'stroke' or 'lineDash'"),ll=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};b([Yn(qn)],ll.prototype,"enabled",2),b([Yn(ia)],ll.prototype,"width",2),b([Yn(rl)],ll.prototype,"style",2);var hl=class extends ye{constructor(){super(...arguments),this.enabled=!0,this.autoWrap=!1,this.fontSize=12,this.fontFamily="Verdana, sans-serif",this.padding=5,this.minSpacing=NaN,this.color="rgba(87, 87, 87, 1)",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}};b([Yn(qn)],hl.prototype,"enabled",2),b([Yn(qn,{optional:!0})],hl.prototype,"autoWrap",2),b([Yn(ia,{optional:!0})],hl.prototype,"maxWidth",2),b([Yn(ia,{optional:!0})],hl.prototype,"maxHeight",2),b([Yn(wa,{optional:!0})],hl.prototype,"fontStyle",2),b([Yn(Ia,{optional:!0})],hl.prototype,"fontWeight",2),b([Yn(ta.restrict({min:1}))],hl.prototype,"fontSize",2),b([Yn(Jn)],hl.prototype,"fontFamily",2),b([Yn(ia)],hl.prototype,"padding",2),b([Yn(aa),Kn(NaN)],hl.prototype,"minSpacing",2),b([Yn(ga,{optional:!0})],hl.prototype,"color",2),b([Yn(na,{optional:!0})],hl.prototype,"rotation",2),b([Yn(qn)],hl.prototype,"avoidCollisions",2),b([Yn(qn)],hl.prototype,"mirrored",2),b([Yn(qn)],hl.prototype,"parallel",2),b([Yn(Qn,{optional:!0})],hl.prototype,"formatter",2),b([Yn(Jn,{optional:!0})],hl.prototype,"format",2);var cl=class{constructor(){this.enabled=!0,this.width=1,this.color=void 0}};b([Yn(qn)],cl.prototype,"enabled",2),b([Yn(ia)],cl.prototype,"width",2),b([Yn(ga,{optional:!0})],cl.prototype,"color",2);var dl=class extends ye{constructor(){super(...arguments),this.enabled=!1,this.spacing=al.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};function ul(t){const[e,i]=js(t.range),s=Math.floor(e),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}b([Yn(qn)],dl.prototype,"enabled",2),b([Yn(Jn,{optional:!0})],dl.prototype,"text",2),b([Yn(ia,{optional:!0})],dl.prototype,"spacing",2),b([Yn(wa,{optional:!0})],dl.prototype,"fontStyle",2),b([Yn(Ia,{optional:!0})],dl.prototype,"fontWeight",2),b([Yn(ia)],dl.prototype,"fontSize",2),b([Yn(Jn)],dl.prototype,"fontFamily",2),b([Yn(ga,{optional:!0})],dl.prototype,"color",2),b([Yn(Ca)],dl.prototype,"wrapping",2),b([Yn(Qn,{optional:!0})],dl.prototype,"formatter",2);var pl=2*Math.PI,gl=pl/2;function ml(t){const e=(e,i)=>{const[s=t.min,n=t.max]=js(null!=i?i:[]);return e<s||e>n},i={fromFn(t,i,s){let n=t.y1+t.translationY,a=t.opacity;return("added"===s||e(t.datum.translationY,t.datum.range))&&(n=i.translationY,a=0),{y:0,translationY:n,opacity:a,phase:Ln[s]}},toFn(t,e,i){const s=e.translationY;let n=1;return"removed"===i&&(n=0),{y:0,translationY:s,opacity:n,finish:{y:s,translationY:0}}},intermediateFn:(t,i,s)=>({visible:!e(t.y)})},s={fromFn(t,i,s){var n;const a=null!=(n=t.previousDatum)?n:i,o=a.x,r=a.y,l=a.rotationCenterX;let h=Math.round(t.translationY),c=a.rotation,d=t.opacity;return"removed"===s||e(a.y,a.range)?c=i.rotation:("added"===s||e(t.datum.y,t.datum.range))&&(h=Math.round(a.translationY),d=0,c=i.rotation),{x:o,y:r,rotationCenterX:l,translationY:h,rotation:c,opacity:d,phase:Ln[s]}},toFn(t,e,i){var s,n;const a=e.x,o=e.y,r=e.rotationCenterX,l=Math.round(e.translationY);let h=0,c=1;var d,u;return"added"===i?(c=1,h=e.rotation):"removed"===i?(c=0,h=e.rotation):(d=null!=(n=null==(s=t.previousDatum)?void 0:s.rotation)?n:e.rotation,u=e.rotation,h=Math.abs(u-d)<gl?u:d>u?u+pl:u-pl),{x:a,y:o,rotationCenterX:r,translationY:l,rotation:h,opacity:c,finish:{rotation:e.rotation}}}};return{tick:i,line:{fromFn(t,e){var i;return y(m({},null!=(i=t.previousDatum)?i:e),{phase:Ln.updated})},toFn:(t,e)=>m({},e)},label:s,group:{fromFn(t,e){const{rotation:i,translationX:s,translationY:n}=t;return{rotation:i,translationX:s,translationY:n,phase:Ln.updated}},toFn(t,e){const{rotation:i,translationX:s,translationY:n}=e;return{rotation:i,translationX:s,translationY:n}}}}}function yl(){return(t,e)=>({rotation:e.rotation,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,translationX:e.translationX,translationY:e.translationY})}function fl(t){const{visible:e,min:i,max:s}=t;return(t,n)=>{const a=n.translationY;return{y:a,translationY:0,opacity:1,visible:e&&a>=i&&a<=s}}}function xl(){return(t,e)=>({x:e.x,y:e.y,translationY:e.translationY,rotation:e.rotation,rotationCenterX:e.rotationCenterX})}function bl(){return(t,e)=>m({},e)}var vl=class t{constructor(e,i,s){let n;this.moduleCtx=e,this.scale=i,this.id=Bs(this),this.nice=!0,this.reverse=!1,this.keys=[],this.dataDomain={domain:[],clipped:!1},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new Mo({name:`${this.id}-axis`,zIndex:2}),this.lineNode=this.axisGroup.appendChild(new Fr),this.tickLineGroup=this.axisGroup.appendChild(new Mo({name:`${this.id}-Axis-tick-lines`,zIndex:2})),this.tickLabelGroup=this.axisGroup.appendChild(new Mo({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.crossLineGroup=new Mo({name:`${this.id}-CrossLines`}),this.gridGroup=new Mo({name:`${this.id}-Axis-grid`}),this.gridLineGroup=this.gridGroup.appendChild(new Mo({name:`${this.id}-gridLines`,zIndex:1})),this.tickLineGroupSelection=Rr.select(this.tickLineGroup,Fr,!1),this.tickLabelGroupSelection=Rr.select(this.tickLabelGroup,Po,!1),this.gridLineGroupSelection=Rr.select(this.gridLineGroup,Fr,!1),this.line=new cl,this.tick=this.createTick(),this.gridLine=new ll,this.label=this.createLabel(),this.defaultTickMinSpacing=t.defaultTickMinSpacing,this.translation={x:0,y:0},this.rotation=0,this.layout={label:{fractionDigits:0,padding:this.label.padding,format:this.label.format}},this.destroyFns=[],this.range=[0,1],this.visibleRange=[0,1],this.title=new dl,this._titleCaption=new al,this.gridLength=0,this.fractionDigits=0,this.gridPadding=0,this.seriesAreaPadding=0,this.tickGenerationResult=void 0,this.maxThickness=1/0,this.moduleMap=new ur,this.refreshScale(),this.destroyFns.push(this._titleCaption.registerInteraction(this.moduleCtx,"root")),this._titleCaption.node.rotation=-Math.PI/2,this.axisGroup.appendChild(this._titleCaption.node),this.destroyFns.push(e.regionManager.getRegion("series").addListener("hover",t=>this.checkAxisHover(t))),this.animationManager=e.animationManager,this.animationState=new mr("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:t=>this.animateReadyUpdate(t),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this._crossLines=[],this.assignCrossLineArrayConstructor(this._crossLines),this.destroyFns.push(e.layoutService.addListener("layout-complete",t=>{null!=n&&null!=ve(t.chart,n)&&this.animationState.transition("resize"),n=m({},t.chart)})),!1!==(null==s?void 0:s.respondsToZoom)&&this.destroyFns.push(e.updateService.addListener("update-complete",t=>{this.minRect=t.minRect}))}get type(){var t;return null!=(t=this.constructor.type)?t:""}set crossLines(t){var e,i;null==(e=this._crossLines)||e.forEach(t=>this.detachCrossLine(t)),t&&this.assignCrossLineArrayConstructor(t),this._crossLines=t,null==(i=this._crossLines)||i.forEach(t=>{this.attachCrossLine(t),this.initCrossLine(t)})}get crossLines(){return this._crossLines}resetAnimation(t){"initial"===t&&this.animationState.transition("reset")}attachCrossLine(t){this.crossLineGroup.appendChild(t.group),this.crossLineGroup.appendChild(t.labelGroup)}detachCrossLine(t){this.crossLineGroup.removeChild(t.group),this.crossLineGroup.removeChild(t.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(t=>t())}refreshScale(){var t;this.range=this.scale.range.slice(),null==(t=this.crossLines)||t.forEach(this.initCrossLine,this)}updateRange(){var t;const{range:e,visibleRange:i,scale:s}=this,n=(e[1]-e[0])/(i[1]-i[0]),a=n*i[0],o=e[0]-a;s.range=[o,o+n],null==(t=this.crossLines)||t.forEach(t=>{t.clippedRange=[e[0],e[1]]})}setCrossLinesVisible(t){this.crossLineGroup.visible=t}attachAxis(t,e){e.appendChild(this.gridGroup),t.appendChild(this.axisGroup),t.appendChild(this.crossLineGroup)}detachAxis(t,e){e.removeChild(this.gridGroup),t.removeChild(this.axisGroup),t.removeChild(this.crossLineGroup)}inRange(t,e=0,i=0){const[s,n]=js(this.range);return t+e>=s-i&&t<=n+i}onLabelFormatChange(t,e,i){const{scale:s,fractionDigits:n}=this,a=!(s instanceof Or)&&n>0?t=>"number"==typeof t?t.toFixed(n):String(t):t=>String(t);if(i&&s&&s.tickFormat)try{this.labelFormatter=s.tickFormat({ticks:t,specifier:i})}catch(t){this.labelFormatter=a,R.warnOnce(`the axis label format string ${i} is invalid. No formatting will be applied`)}else this.labelFormatter=a}setTickInterval(t){var e;this.scale.interval=null!=(e=this.tick.interval)?e:t}setTickCount(t,e,i){const{scale:s}=this,n=Ua.is(s)||fo.is(s);if(t&&n)return"number"==typeof t?(s.tickCount=t,s.minTickCount=null!=e?e:0,void(s.maxTickCount=null!=i?i:1/0)):void(s instanceof mo&&this.setTickInterval(t))}onGridLengthChange(t,e){var i;(e&&!t||!e&&t)&&this.onGridVisibilityChange(),null==(i=this.crossLines)||i.forEach(this.initCrossLine,this)}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}createLabel(){return new hl}checkAxisHover(t){this.interactionEnabled&&this.computeBBox().containsPoint(t.offsetX,t.offsetY)&&this.moduleCtx.chartEventManager.axisHover(this.id,this.direction)}update(t=0,e=!0){if(!this.tickGenerationResult)return;const{rotation:i,parallelFlipRotation:s,regularFlipRotation:n}=this.calculateRotations(),a=this.label.getSideFlag();this.updatePosition();const o=this.getAxisLineCoordinates(),{tickData:r,combinedRotation:l,textBaseline:h,textAlign:c,primaryTickCount:d}=this.tickGenerationResult,u=this.tickLabelGroupSelection.nodes().map(t=>t.datum.tickId);if(this.updateSelections(o,r.ticks,{combinedRotation:l,textAlign:c,textBaseline:h,range:this.scale.range}),!e||this.animationManager.isSkipped())this.resetSelectionNodes();else{const t=this.calculateUpdateDiff(u,r);this.animationState.transition("update",t)}return this.updateAxisLine(),this.updateLabels(),this.updateVisibility(),this.updateGridLines(a),this.updateTickLines(),this.updateTitle({anyTickVisible:r.ticks.length>0}),this.updateCrossLines({rotation:i,parallelFlipRotation:s,regularFlipRotation:n}),this.updateLayoutState(),d}getAxisLineCoordinates(){const[t,e]=js(this.range);return{x:0,y1:t,y2:e}}getTickLineCoordinates(t){const e=this.label.getSideFlag()*this.getTickSize(),i=Math.min(0,e);return{x1:i,x2:i+Math.abs(e),y:t.translationY}}getTickLabelProps(t,e){const{label:i}=this,{combinedRotation:s,textBaseline:n,textAlign:a,range:o}=e,r=t.tickLabel,l=i.getSideFlag()*(this.getTickSize()+i.padding+this.seriesAreaPadding),h=""!==r&&null!=r;return{tickId:t.tickId,translationY:t.translationY,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,rotation:s,rotationCenterX:l,text:r,textAlign:a,textBaseline:n,visible:h,x:l,y:0,range:o}}getTickSize(){return this.tick.enabled?this.tick.size:this.createTick().size}setTitleProps(t,e){var i;const{title:s}=this;if(s.enabled){if(t.color=s.color,t.fontFamily=s.fontFamily,t.fontSize=s.fontSize,t.fontStyle=s.fontStyle,t.fontWeight=s.fontWeight,t.enabled=s.enabled,t.wrapping=s.wrapping,s.enabled){const n=t.node,a=(null!=(i=s.spacing)?i:0)+e.spacing,o=this.label.getSideFlag(),r=Rn(this.rotation),l=-1===o&&r>Math.PI&&r<2*Math.PI?-1:1,h=l*o*Math.PI/2,c=1===l?"bottom":"top",{range:d}=this,u=Math.floor(l*o*(d[0]+d[1])/2),p=-1===o?Math.floor(l*-a):Math.floor(-a),{callbackCache:g}=this.moduleCtx,{formatter:m=t=>t.defaultValue}=s,y=g.call(m,this.getTitleFormatterParams());n.setProperties({rotation:h,text:y,textBaseline:c,visible:!0,x:u,y:p})}}else t.enabled=!1}calculateLayout(t){var e,i;const{rotation:s,parallelFlipRotation:n,regularFlipRotation:a}=this.calculateRotations(),o=this.label.getSideFlag(),r=o*(this.getTickSize()+this.label.padding+this.seriesAreaPadding);this.updateScale(),this.tickGenerationResult=this.generateTicks({primaryTickCount:t,parallelFlipRotation:n,regularFlipRotation:a,labelX:r,sideFlag:o}),this.updateLayoutState();const l=this.tickGenerationResult,{tickData:h,combinedRotation:c,textBaseline:d,textAlign:u}=l,p=f(l,["tickData","combinedRotation","textBaseline","textAlign"]),g=[],{x,y1:b,y2:v}=this.getAxisLineCoordinates(),S=new Qs(x+Math.min(o*this.seriesAreaPadding,0),b,this.seriesAreaPadding,v-b);if(g.push(S),this.tick.enabled&&h.ticks.forEach(t=>{const{x1:e,x2:i,y:s}=this.getTickLineCoordinates(t),n=new Qs(e,s,i-e,0);g.push(n)}),this.label.enabled){const t=new Po;h.ticks.forEach(e=>{const i=this.getTickLabelProps(e,{combinedRotation:c,textAlign:u,textBaseline:d,range:this.scale.range});if(!i.visible)return;t.setProperties(y(m({},i),{translationY:Math.round(e.translationY)}));const s=t.computeTransformedBBox();s&&g.push(s)})}if(null==(e=this.title)?void 0:e.enabled){const t=new al,e=Qs.merge(g).width;this.setTitleProps(t,{spacing:e});const i=t.node.computeTransformedBBox();i&&g.push(i)}const M=(t=>{const e=new an,{rotation:i,translationX:s,translationY:n,rotationCenterX:a,rotationCenterY:o}=this.getAxisTransform();return an.updateTransformMatrix(e,1,1,i,s,n,{scalingCenterX:0,scalingCenterY:0,rotationCenterX:a,rotationCenterY:o}),e.transformBBox(t)})(Qs.merge(g)),k=this.isAnySeriesActive();return null==(i=this.crossLines)||i.forEach(t=>{var e;t.sideFlag=-o,t.direction=s===-Math.PI/2?"x":"y",t instanceof dr&&(t.label.parallel=null!=(e=t.label.parallel)?e:this.label.parallel),t.parallelFlipRotation=n,t.regularFlipRotation=a,t.calculateLayout(k,this.reverse)}),{primaryTickCount:t=p.primaryTickCount,bbox:M}}updateLayoutState(){this.layout.label={fractionDigits:this.fractionDigits,padding:this.label.padding,format:this.label.format}}setDomain(t){this.dataDomain=this.normaliseDataDomain(t),this.reverse&&this.dataDomain.domain.reverse(),this.scale.domain=this.dataDomain.domain}updateScale(){this.updateRange(),this.calculateDomain(),this.setTickInterval(this.tick.interval);const{scale:t,nice:e}=this;Ua.is(t)&&(t.nice=e,t.update())}calculateRotations(){const t=Fn(this.rotation);return{rotation:t,parallelFlipRotation:Rn(t),regularFlipRotation:Rn(t-Math.PI/2)}}generateTicks({primaryTickCount:t,parallelFlipRotation:e,regularFlipRotation:i,labelX:s,sideFlag:n}){var a;const{scale:o,tick:r,label:{parallel:l,rotation:h,fontFamily:c,fontSize:d,fontStyle:u,fontWeight:p}}=this,g=void 0!==t,{defaultRotation:f,configuredRotation:x,parallelFlipFlag:b,regularFlipFlag:v}=Go({rotation:h,parallel:l,regularFlipRotation:i,parallelFlipRotation:e}),S=x+f,M=new an,{maxTickCount:k}=this.estimateTickCount({minSpacing:r.minSpacing,maxSpacing:null!=(a=r.maxSpacing)?a:NaN}),D=!Ua.is(o)&&!fo.is(o)||isNaN(k)?10:k;let w=_o(l,x,0,n,v);const I=function(t,e,i,s){return t&&!e?i*s===-1?"hanging":"bottom":"middle"}(l,x,n,b),C={fontFamily:c,fontSize:d,fontStyle:u,fontWeight:p,textBaseline:I,textAlign:w};let L={rawTicks:[],ticks:[],labelCount:0},A=0,T=0,N=!0,O=!1;for(;N&&A<=D&&!O;){T=0,w=_o(l,x,0,n,v);const e=this.getTickStrategies({secondaryAxis:g,index:A});for(const i of e){({tickData:L,index:A,autoRotation:T,terminate:O}=i({index:A,tickData:L,textProps:C,labelOverlap:N,terminate:O,primaryTickCount:t}));const e=0!==x||0!==T,a=S+T;w=_o(l,x,T,n,v),N=!!this.label.avoidCollisions&&this.checkLabelOverlap(a,e,M,L.ticks,s,y(m({},C),{textAlign:w}))}}const R=f+x+T;return!g&&L.rawTicks.length>0&&(t=L.rawTicks.length),{tickData:L,primaryTickCount:t,combinedRotation:R,textBaseline:I,textAlign:w}}getTickStrategies({index:t,secondaryAxis:e}){const{scale:i,label:s,tick:n}=this,a=Ua.is(i)||fo.is(i),o=s.enabled&&s.avoidCollisions,r=!a&&0!==t&&o,l=!0===s.autoRotate&&void 0===s.rotation,h=[];let c;if(c=this.tick.values?3:e?1:r?2:0,h.push(({index:t,tickData:e,primaryTickCount:i,terminate:s})=>this.createTickData(c,t,e,s,i)),!a&&!isNaN(n.minSpacing)){const t=({index:t,tickData:e,primaryTickCount:i,terminate:s})=>this.createTickData(2,t,e,s,i);h.push(t)}if(!o)return h;if(s.autoWrap){const t=({index:t,tickData:e,textProps:i})=>this.wrapLabels(e,t,i);h.push(t)}else if(l){const t=({index:t,tickData:e,labelOverlap:i,terminate:s})=>({index:t,tickData:e,autoRotation:this.getAutoRotation(i),terminate:s});h.push(t)}return h}createTickData(t,e,i,s,n){var a;const{scale:o,tick:r}=this,{maxTickCount:l,minTickCount:h,defaultTickCount:c}=this.estimateTickCount({minSpacing:r.minSpacing,maxSpacing:null!=(a=r.maxSpacing)?a:NaN}),d=Ua.is(o)||fo.is(o),u=!d||isNaN(l)?10:l;let p=d?Math.max(c-e,h):l;const g=void 0===r.interval&&void 0===r.values&&p>h&&(d||2===t);let m=!0;for(;m&&e<=u;){const s=i.rawTicks;p=d?Math.max(c-e,h):l;const{rawTicks:a,ticks:o,labelCount:r}=this.getTicks({tickGenerationType:t,previousTicks:s,tickCount:p,minTickCount:h,maxTickCount:l,primaryTickCount:n});i.rawTicks=a,i.ticks=o,i.labelCount=r,m=!!g&&Kr(a,s),e++}const y=void 0!==r.interval||void 0!==r.values;return s||(s=y),{tickData:i,index:e,autoRotation:0,terminate:s}}checkLabelOverlap(t,e,i,s,n,a){an.updateTransformMatrix(i,1,1,t,0,0);const o=this.createLabelData(s,n,a,i),r=function(t,e){return isNaN(t)?e?0:10:t}(this.label.minSpacing,e);return function(t,e){const i=[];for(let s=0;s<t.length;s++){const n=t[s],{point:{x:a,y:o},label:{text:r}}=n;let{label:{width:l,height:h}}=n;if(l+=null!=e?e:0,h+=null!=e?e:0,i.some(t=>Gr(t,a,o,l,h)))return!0;i.push({index:s,text:r,x:a,y:o,width:l,height:h,datum:n})}return!1}(o,r)}createLabelData(t,e,i,s){const n=[],a=new Bo(i);for(const{tickLabel:i,translationY:o}of t){if(""===i||null==i)continue;const{width:t,height:r}=a.size(i),l=jo(i,new Qs(e,o,t,r),e,o,s);n.push(l)}return n}getAutoRotation(t){var e;return t?Rn(Fn(null!=(e=this.label.autoRotateAngle)?e:0)):0}getTicks({tickGenerationType:t,previousTicks:e,tickCount:i,minTickCount:s,maxTickCount:n,primaryTickCount:a}){var o;const{range:r,scale:l,visibleRange:h}=this;let c;switch(t){case 3:if(Ua.is(l)){const[t,e]=js(l.getDomain().map(Number));c=this.tick.values.filter(i=>i>=t&&i<=e).sort((t,e)=>t-e)}else c=this.tick.values;break;case 1:c=Ua.is(l)?this.updateSecondaryAxisTicks(a):this.createTicks(i,s,n);break;case 2:c=this.filterTicks(e,i);break;default:c=this.createTicks(i,s,n)}this.fractionDigits=c.fractionDigits>=0?c.fractionDigits:0;const d=(null!=(o=l.bandwidth)?o:0)/2,u=[];let p=0;const g=new Map,m=Math.max(0,Math.floor(h[0]*c.length)),y=Math.min(c.length,Math.ceil(h[1]*c.length)),f=c.slice(m,y);this.onLabelFormatChange(f,c,this.label.format);for(let t=0;t<f.length;t++){const e=f[t],i=l.convert(e)+d;if(r.length>0&&!this.inRange(i,0,.001))continue;const s=this.formatTick(e,m+t);let n=s;if(g.has(n)){const t=g.get(n);g.set(n,t+1),n=`${n}_${t}`}else g.set(n,1);u.push({tick:e,tickId:n,tickLabel:s,translationY:Math.floor(i)}),""!==s&&null!=s&&p++}return{rawTicks:c,ticks:u,labelCount:p}}filterTicks(t,e){var i;const s=isNaN(this.tick.minSpacing)&&isNaN(null!=(i=this.tick.maxSpacing)?i:NaN)?2:Math.ceil(t.length/e);return t.filter((t,e)=>e%s===0)}createTicks(t,e,i){var s,n,a;return this.setTickCount(t,e,i),null!=(a=null==(n=(s=this.scale).ticks)?void 0:n.call(s))?a:[]}estimateTickCount({minSpacing:t,maxSpacing:e}){const{minRect:i,label:{avoidCollisions:s}}=this;if(!s)return{minTickCount:Ua.defaultMaxTickCount,maxTickCount:Ua.defaultMaxTickCount,defaultTickCount:Ua.defaultMaxTickCount};const n=this.calculateRangeWithBleed(),a=Math.max(this.defaultTickMinSpacing,n/Ua.defaultMaxTickCount);let o=!isNaN(e);isNaN(t)&&(t=a),isNaN(e)&&(e=n),t>e&&(t===a?t=e:e=t);let r=1;i&&(r="x"===this.direction?i.width:i.height),o&&(o=r<a);const l=Gs(1,Math.floor(n/t),o?Math.min(Math.floor(n/r),100):100),h=Math.min(l,Math.ceil(n/e));return{minTickCount:h,maxTickCount:l,defaultTickCount:Gs(h,Ua.defaultTickCount,l)}}updateVisibility(){this.moduleCtx.animationManager.isSkipped()&&this.resetSelectionNodes(),this.tickLineGroup.visible=this.tick.enabled,this.gridLineGroup.visible=this.gridLine.enabled,this.tickLabelGroup.visible=this.label.enabled}updateCrossLines({rotation:t,parallelFlipRotation:e,regularFlipRotation:i}){var s;const n=this.label.getSideFlag(),a=this.isAnySeriesActive();null==(s=this.crossLines)||s.forEach(s=>{var o;s.sideFlag=-n,s.direction=t===-Math.PI/2?"x":"y",s instanceof dr&&(s.label.parallel=null!=(o=s.label.parallel)?o:this.label.parallel),s.parallelFlipRotation=e,s.regularFlipRotation=i,s.update(a)})}updateTickLines(){const{tick:t,label:e}=this,i=e.getSideFlag();this.tickLineGroupSelection.each(e=>{e.strokeWidth=t.width,e.stroke=t.color,e.x1=i*this.getTickSize(),e.x2=0})}calculateAvailableRange(){return Ws(this.range)}calculateRangeWithBleed(){const t=1/Ws(this.visibleRange);return Ys(this.calculateAvailableRange()*t,2)}calculateDomain(){const t=this.boundSeries.filter(t=>this.includeInvisibleDomains||t.isEnabled()).flatMap(t=>t.getDomain(this.direction));this.setDomain(t)}getAxisTransform(){return{rotation:Fn(this.rotation),rotationCenterX:0,rotationCenterY:0,translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){const{crossLineGroup:t,axisGroup:e,gridGroup:i,translation:s,gridLineGroupSelection:n,gridPadding:a,gridLength:o}=this,{rotation:r}=this.calculateRotations(),l=this.label.getSideFlag(),h=Math.floor(s.x),c=Math.floor(s.y);t.setProperties({rotation:r,translationX:h,translationY:c}),i.setProperties({rotation:r,translationX:h,translationY:c}),e.datum=this.getAxisTransform(),n.each(t=>{t.x1=a,t.x2=-l*o+a})}updateSecondaryAxisTicks(t){throw new Error("AG Charts - unexpected call to updateSecondaryAxisTicks() - check axes configuration.")}updateSelections(t,e,i){this.lineNode.datum=t,this.gridLineGroupSelection.update(this.gridLength?e:[],t=>t.append(new Fr),t=>t.tickId),this.tickLineGroupSelection.update(e,t=>t.appendChild(new Fr),t=>t.tickId),this.tickLabelGroupSelection.update(e.map(t=>this.getTickLabelProps(t,i)),t=>t.appendChild(new Po),t=>t.tickId)}updateAxisLine(){const{line:t}=this,e=t.enabled?t.width:0;this.lineNode.setProperties({stroke:t.color,strokeWidth:e})}updateGridLines(t){const{gridLine:{style:e,width:i},gridPadding:s,gridLength:n}=this;0!==n&&0!==e.length&&this.gridLineGroupSelection.each((a,o,r)=>{const{stroke:l,lineDash:h}=e[r%e.length];a.setProperties({x1:s,x2:-t*n+s,fill:void 0,stroke:l,strokeWidth:i,lineDash:h})})}updateLabels(){const{label:t}=this;t.enabled&&this.tickLabelGroupSelection.each((t,e)=>{t.setProperties(e,["fill","fontFamily","fontSize","fontStyle","fontWeight","text","textAlign","textBaseline"])})}wrapLabels(t,e,i){const{parallel:s,maxWidth:n,maxHeight:a}=this.label;let o=this.maxThickness,r=Math.round(this.calculateAvailableRange()/t.labelCount);return s&&([o,r]=[r,o]),t.ticks.forEach(t=>{const{text:e}=Po.wrap(t.tickLabel,null!=n?n:o,null!=a?a:r,i,"hyphenate");t.tickLabel=e}),{tickData:t,index:e,autoRotation:0,terminate:!0}}updateTitle(t){const{rotation:e,title:i,_titleCaption:s,lineNode:n,tickLineGroup:a,tickLabelGroup:o}=this;if(!i)return void(s.enabled=!1);let r=0;if(i.enabled&&t.anyTickVisible){const t=Mo.computeBBox([a,o,n]);r+=(0===e?t.width:t.height)+(this.tickLabelGroup.visible?0:this.seriesAreaPadding)}this.setTitleProps(s,{spacing:r})}formatTick(t,e){return this.datumFormatter(e)(t)}formatDatum(t){return String(t)}datumFormatter(t=0){const{label:e,labelFormatter:i,fractionDigits:s,moduleCtx:{callbackCache:n}}=this;return e.formatter?a=>{var o;return null!=(o=n.call(e.formatter,{value:s>0?a:String(a),index:t,fractionDigits:s,formatter:i}))?o:a}:i?t=>{var e;return null!=(e=n.call(i,t))?e:String(t)}:t=>String(t)}computeBBox(){return this.axisGroup.computeBBox()}initCrossLine(t){t.scale=this.scale,t.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(t=>this.includeInvisibleDomains||t.isEnabled())}clipTickLines(t,e,i,s){this.tickLineGroup.setClipRectInGroupCoordinateSpace(new Qs(t,e,i,s))}clipGrid(t,e,i,s){this.gridGroup.setClipRectInGroupCoordinateSpace(new Qs(t,e,i,s))}calculatePadding(t,e){const i=.01*Math.abs(this.reverse?e:t);return[i,i]}getTitleFormatterParams(){var t;const e=this.boundSeries.reduce((t,e)=>{const i=e.getKeys(this.direction),s=e.getNames(this.direction);for(let e=0;e<i.length;e++)t.push({key:i[e],name:s[e]});return t},[]);return{direction:this.direction,boundSeries:e,defaultValue:null==(t=this.title)?void 0:t.text}}normaliseDataDomain(t){return{domain:[...t],clipped:!1}}getLayoutState(){return m({rect:this.computeBBox(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale},this.layout)}getModuleMap(){return this.moduleMap}createModuleContext(){return null!=this.axisContext||(this.axisContext=this.createAxisContext()),y(m({},this.moduleCtx),{parent:this.axisContext})}createAxisContext(){return{axisId:this.id,direction:this.direction,continuous:Ua.is(this.scale),keys:()=>this.boundSeries.flatMap(t=>t.getKeys(this.direction)),seriesKeyProperties:()=>this.boundSeries.reduce((t,e)=>(e.getKeyProperties(this.direction).forEach(e=>{t.indexOf(e)<0&&t.push(e)}),t),[]),scaleValueFormatter:t=>{var e,i;return t?null==(i=(e=this.scale).tickFormat)?void 0:i.call(e,{specifier:t}):this.formatDatum},scaleBandwidth:()=>{var t;return null!=(t=this.scale.bandwidth)?t:0},scaleConvert:t=>this.scale.convert(t),scaleInvert:t=>{var e,i;return null==(i=(e=this.scale).invert)?void 0:i.call(e,t)}}}animateReadyUpdate(t){const{animationManager:e}=this.moduleCtx,i=ml(ul(this));An(this.id,"axis-group",e,[this.axisGroup],i.group),An(this.id,"line",e,[this.lineNode],i.line),An(this.id,"line-paths",e,[this.gridLineGroupSelection,this.tickLineGroupSelection],i.tick,(t,e)=>e.tickId,t),An(this.id,"tick-labels",e,[this.tickLabelGroupSelection],i.label,(t,e)=>e.tickId,t)}resetSelectionNodes(){const{gridLineGroupSelection:t,tickLineGroupSelection:e,tickLabelGroupSelection:i,lineNode:s}=this,n=ul(this);gr([this.axisGroup],(t,e)=>({rotation:e.rotation,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,translationX:e.translationX,translationY:e.translationY})),gr([t,e],fl(n)),gr([i],(t,e)=>({x:e.x,y:e.y,translationY:e.translationY,rotation:e.rotation,rotationCenterX:e.rotationCenterX})),gr([s],bl())}calculateUpdateDiff(t,e){const i=new Set,s=new Set,n={},a=Math.max(t.length,e.ticks.length);for(let o=0;o<a;o++){const a=e.ticks[o],r=t[o],l=null==a?void 0:a.tickId;n[null!=l?l:r]=a,r!==l&&(s.has(l)?s.delete(l):l&&i.add(l),i.has(r)?i.delete(r):r&&s.add(r))}return{changed:i.size>0||s.size>0,added:i,removed:s}}isReversed(){return this.reverse}};vl.defaultTickMinSpacing=50,b([Yn(qn)],vl.prototype,"nice",2),b([Yn(qn)],vl.prototype,"reverse",2),b([Yn(xa)],vl.prototype,"keys",2),b([Yn(Xn,{optional:!0})],vl.prototype,"title",2),b([Xr((t,e,i)=>t.onGridLengthChange(e,i))],vl.prototype,"gridLength",2);var Sl=vl,Ml=class extends hl{constructor(){super(...arguments),this.autoRotateAngle=335}};b([Yn(qn,{optional:!0})],Ml.prototype,"autoRotate",2),b([Yn(na)],Ml.prototype,"autoRotateAngle",2);var kl=class t extends Sl{constructor(){super(...arguments),this.thickness=0,this.position="left"}static is(e){return e instanceof t}get direction(){return["top","bottom"].includes(this.position)?"x":"y"}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}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}update(t,e){return this.updateDirection(),super.update(t,e)}calculateLayout(t){return this.updateDirection(),super.calculateLayout(t)}createAxisContext(){return y(m({},super.createAxisContext()),{position:this.position})}assignCrossLineArrayConstructor(t){$a(t,dr)}createLabel(){return new Ml}};b([Yn(ia)],kl.prototype,"thickness",2),b([Yn(Da)],kl.prototype,"position",2);var Dl=kl,wl=class extends Va{constructor(){super(...arguments),this.minSpacing=NaN}};b([Yn(Ba),Kn(NaN)],wl.prototype,"minSpacing",2);var Il=class extends Dl{constructor(t,e=new Vn){super(t,e),this._paddingOverrideEnabled=!1,this.groupPaddingInner=.1,this.includeInvisibleDomains=!0}set paddingInner(t){this._paddingOverrideEnabled=!0,this.scale.paddingInner=t}get paddingInner(){return this._paddingOverrideEnabled=!0,this.scale.paddingInner}set paddingOuter(t){this.scale.paddingOuter=t}get paddingOuter(){return this.scale.paddingOuter}createTick(){return new wl}normaliseDataDomain(t){const e=[],i=new Set;for(const s of t){const t=s instanceof Date?s.getTime():s;i.has(t)||(i.add(t),e.push(s))}return{domain:e,clipped:!1}}calculateDomain(){if(!this._paddingOverrideEnabled){const t=this.boundSeries.map(t=>{var e;return null==(e=t.getBandScalePadding)?void 0:e.call(t)}).filter(t=>null!=t);t.length>0&&(this.scale.paddingInner=Math.min(...t.map(t=>t.inner)),this.scale.paddingOuter=Math.max(...t.map(t=>t.outer)))}return super.calculateDomain()}};Il.className="CategoryAxis",Il.type="category",b([Yn(sa)],Il.prototype,"groupPaddingInner",2);var Cl=class{constructor(t="",e,i=0){this.x=0,this.y=0,this.subtreeLeft=NaN,this.subtreeRight=NaN,this.screenX=0,this.screenY=0,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.label=t,this.parent=e,this.depth=e?e.depth+1:0,this.number=i}getLeftSibling(){return this.number>0&&this.parent?this.parent.children[this.number-1]:void 0}getLeftmostSibling(){return this.number>0&&this.parent?this.parent.children[0]:void 0}nextLeft(){return this.children?this.children[0]:this.thread}nextRight(){return this.children?this.children[this.children.length-1]:this.thread}getSiblings(){return this.parent?this.parent.children.filter((t,e)=>e!==this.number):[]}};function Ll(t,e,i){const s=i/(e.number-t.number);e.change-=s,e.shift+=i,t.change+=s,e.prelim+=i,e.mod+=i}function Al(t,e,i){return e.getSiblings().indexOf(t.ancestor)>=0?t.ancestor:i}function Tl(t,e){const i=t.children;if(i.length){let s=i[0];i.forEach(t=>{Tl(t,e),s=function(t,e,i){const s=t.getLeftSibling();if(s){let n=t,a=t,o=s,r=a.getLeftmostSibling(),l=a.mod,h=n.mod,c=o.mod,d=r.mod;for(;o.nextRight()&&a.nextLeft();){o=o.nextRight(),a=a.nextLeft(),r=r.nextLeft(),n=n.nextRight(),n.ancestor=t;const s=o.prelim+c-(a.prelim+l)+i;s>0&&(Ll(Al(o,t,e),t,s),l+=s,h+=s),c+=o.mod,l+=a.mod,d+=r.mod,h+=n.mod}o.nextRight()&&!n.nextRight()?(n.thread=o.nextRight(),n.mod+=c-h):(a.nextLeft()&&!r.nextLeft()&&(r.thread=a.nextLeft(),r.mod+=l-d),e=t)}return e}(t,s,e)}),function(t){const e=t.children;if(e){let t=0,i=0;for(let s=e.length-1;s>=0;s--){const n=e[s];n.prelim+=t,n.mod+=t,i+=n.change,t+=n.shift+i}}}(t);const n=(i[0].prelim+i.at(-1).prelim)/2,a=t.getLeftSibling();a?(t.prelim=a.prelim+e,t.mod=t.prelim-n):t.prelim=n}else{const i=t.getLeftSibling();t.prelim=i?i.prelim+e:0}}var Nl=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(t,e){const{x:i,y:s}=e(t);i>this.right&&(this.right=i),i<this.left&&(this.left=i),s>this.bottom&&(this.bottom=s),s<this.top&&(this.top=s)}};function Ol(t,e,i){t.x=t.prelim+e,t.y=t.depth,i.update(t),t.children.forEach(s=>Ol(s,e+t.mod,i))}function Rl(t){const e=t.children;let i=0;e.forEach(t=>{Rl(t),t.children.length?i+=t.leafCount:i++}),t.leafCount=i,e.length?(t.subtreeLeft=e[0].subtreeLeft,t.subtreeRight=e[t.children.length-1].subtreeRight,t.x=(t.subtreeLeft+t.subtreeRight)/2):(t.subtreeLeft=t.x,t.subtreeRight=t.x)}function El(t){const e=new Pl;return Tl(t,1),Ol(t,-t.prelim,e),Rl(t),e}var Pl=class{constructor(){this.dimensions=new Nl,this.leafCount=0,this.nodes=[],this.leafNodes=[],this.nonLeafNodes=[],this.depth=0}update(t){this.dimensions.update(t,t=>({x:t.x,y:t.y})),t.children.length?this.nonLeafNodes.push(t):(this.leafCount++,this.leafNodes.push(t)),t.depth>this.depth&&(this.depth=t.depth),this.nodes.push(t)}resize(t,e,i=0,s=0,n=!1){const a=this.leafCount-1,o=this.depth,r=this.dimensions;let l=1,h=1;if(t>0&&a){const e=(r.right-r.left)/a;l=t/a/e,n&&(l=-l)}if(e>0&&o){const t=(r.bottom-r.top)/o;h=e/o/t}const c=new Nl;this.nodes.forEach(t=>{t.screenX=t.x*l,t.screenY=t.y*h,c.update(t,t=>({x:t.screenX,y:t.screenY}))});const d=-c.left,u=-c.top;this.nodes.forEach(t=>{t.screenX+=d+i,t.screenY+=u+s})}},Bl=class extends hl{constructor(){super(...arguments),this.grid=!1}};b([Yn(qn)],Bl.prototype,"grid",2);var Fl=class extends Dl{constructor(t){super(t,new Vn),this.tickScale=new Vn,this.line=new cl,this.label=new Bl,this.labelColor="rgba(87, 87, 87, 1)",this.includeInvisibleDomains=!0;const{tickLineGroup:e,tickLabelGroup:i,gridLineGroup:s,tickScale:n,scale:a}=this;a.paddingOuter=.1,a.paddingInner=2*a.paddingOuter,this.refreshScale(),n.paddingInner=1,n.paddingOuter=0,this.gridLineSelection=Rr.select(s,Fr),this.axisLineSelection=Rr.select(e,Fr),this.separatorSelection=Rr.select(e,Fr),this.labelSelection=Rr.select(i,Po)}updateRange(){const{range:t,visibleRange:e,scale:i}=this,s=(t[1]-t[0])/(e[1]-e[0]),n=s*e[0],a=t[0]-n;this.tickScale.range=i.range=[a,a+s],this.resizeTickTree()}resizeTickTree(){var t;const e=this.scale,i=e.domain.length?[e.convert(e.domain[0]),e.convert(e.domain[e.domain.length-1])]:e.range,s=this.tickTreeLayout,n=this.lineHeight;s&&s.resize(Math.abs(i[1]-i[0]),s.depth*n,(Math.min(i[0],i[1])||0)+(null!=(t=e.bandwidth)?t:0)/2,-s.depth*n,i[1]-i[0]<0)}get lineHeight(){return 1.5*this.label.fontSize}onGridVisibilityChange(){this.gridLineSelection.clear(),this.labelSelection.clear()}createTick(){return new wl}calculateDomain(){var t;const{direction:e}=this;let i=null;const s=this.boundSeries.filter(t=>t.visible).flatMap(t=>{if("y"===e||i)return t.getDomain(e);if(null===i){const s=t.getDomain(e);return i=jt(s[0]),s}return[]});this.setDomain(null!=(t=os(s))?t:ds(s));const{domain:n}=this.dataDomain;this.tickTreeLayout=El(function(t,e=!0){const i=new Cl;let s=0;return e&&t.forEach(t=>s=Math.max(s,t.labels.length)),t.forEach(t=>{if(e)for(;t.labels.length<s;)t.labels.unshift("");!function(t,e){const i=e.labels.slice().reverse(),s=i.length-1;i.forEach((e,i)=>{const n=t.children,a=n.find(t=>t.label===e),o=i!==s;if(a&&o)t=a;else{const i=new Cl(e,t);i.number=n.length,n.push(i),o&&(t=i)}})}(i,t)}),i}(n)),this.tickScale.domain=n.concat(""),this.resizeTickTree()}update(){this.computedLayout&&(this.updatePosition(),this.updateTitleCaption(),this.updateCategoryLabels(),this.updateSeparators(),this.updateAxisLines(),this.updateCategoryGridLines(),this.resetSelectionNodes())}updateTitleCaption(){const{_titleCaption:t}=this;t.node.visible=!1}updateCategoryLabels(){if(!this.computedLayout)return;const{tickLabelLayout:t}=this.computedLayout;this.labelSelection.update(t).each((t,e)=>{t.setProperties(e)})}updateSeparators(){if(!this.computedLayout)return;const{separatorLayout:t}=this.computedLayout,{range:e}=this;this.separatorSelection.update(t).each((t,i)=>{t.x1=i.x1,t.x2=i.x2,t.y1=i.y,t.y2=i.y,t.visible=i.y>=e[0]-1e-7&&i.y<=e[1]+1e-7,t.stroke=this.tick.color,t.fill=void 0,t.strokeWidth=1})}updateAxisLines(){if(!this.computedLayout)return;const{axisLineLayout:t}=this.computedLayout;this.axisLineSelection.update(t).each((t,e)=>{t.setProperties(y(m({},e),{stroke:this.line.color,strokeWidth:this.line.width})),t.x1=e.x,t.x2=e.x,t.y1=e.y1,t.y2=e.y2,t.strokeWidth=this.line.width,t.stroke=this.line.color})}updateCategoryGridLines(){const{gridLength:t,gridLine:e,label:i,range:s,tickScale:n}=this,a=n.ticks(),o=i.getSideFlag(),r=this.gridLineSelection.update(t?a:[]);if(t){const{width:i,style:a}=e,l=a.length;r.each((e,r,h)=>{const c=Math.round(n.convert(r));e.x1=0,e.x2=-o*t,e.y1=c,e.y2=c,e.visible=c>=s[0]&&c<=s[1];const{stroke:d,lineDash:u}=a[h%l];e.stroke=d,e.strokeWidth=i,e.lineDash=u,e.fill=void 0})}}computeLayout(){this.updateDirection(),this.calculateDomain(),this.updateRange();const{scale:t,label:e,label:{parallel:i},moduleCtx:{callbackCache:s},range:n,title:a,title:{formatter:o=t=>t.defaultValue}={}}=this,r=t.range[0],l=t.range[1],h=Math.abs(l-r)/t.domain.length||0,c=Math.ceil(e.fontSize/h),d=Fn(this.rotation),u=Math.abs(Math.cos(d))<1e-8,p=e.getSideFlag(),g=this.lineHeight,f=this.tickTreeLayout,x=t.ticks(),b=f?f.nodes:[],v=!!f&&f.depth>1,{defaultRotation:S,configuredRotation:M,parallelFlipFlag:k}=Go({rotation:e.rotation,parallel:i,regularFlipRotation:Rn(d-Math.PI/2),parallelFlipRotation:Rn(d)}),D=[],w=new Map;let I=0;const C=new Po,L=(t,i)=>{var r;if(C.setProperties({fill:e.color,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textAlign:"center",textBaseline:-1===k?"bottom":"hanging",translationX:t.screenY-.25*e.fontSize,translationY:t.screenX}),0===i){if(!((null==a?void 0:a.enabled)&&x.length>0))return!1;const i=s.call(o,this.getTitleFormatterParams());C.setProperties({fill:a.color,fontFamily:a.fontFamily,fontSize:a.fontSize,fontStyle:a.fontStyle,fontWeight:a.fontWeight,text:i,textBaseline:"hanging",translationX:t.screenY-.25*e.fontSize,translationY:t.screenX})}else{if(i%c!==0)return!1;if(!(t.screenX>=n[0]&&t.screenX<=n[1]))return!1;e.formatter?C.text=null!=(r=s.call(e.formatter,{value:String(t.label),index:i}))?r:String(t.label):C.text=String(t.label)}return!0};b.forEach((t,e)=>{if(!L(t,e))return;const i=C.computeTransformedBBox();i&&(w.set(e,i),!t.children.length&&i.width>I&&(I=i.width))});const A=p*e.padding,T=this.label.grid,N=[];b.forEach((t,e)=>{let i=L(t,e);const s=e;C.x=A,C.rotationCenterX=A;const n=!t.children.length;if(n)C.rotation=M,C.textAlign="end",C.textBaseline="middle";else{C.translationX-=I-g+this.label.padding;const e=t.leafCount*h,n=w.get(s);n&&n.width>e?(i=!1,w.delete(s)):C.rotation=u?S:-Math.PI/2}if(t.parent&&v){const e=n?t.screenX-h/2:t.screenX-t.leafCount*h/2;if(n)(t.number!==t.children.length-1||T)&&N.push({y:e,x1:0,x2:-I-2*this.label.padding});else{const i=-I-2*this.label.padding+t.screenY;N.push({y:e,x1:i+g,x2:i})}}let a;if(i){const t=C.computeTransformedBBox();t&&w.set(e,t),a=y(m({},{fill:(o=C).fill,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,rotation:o.rotation,rotationCenterX:o.rotationCenterX,rotationCenterY:o.rotationCenterY,text:o.text,textAlign:o.textAlign,textBaseline:o.textBaseline,translationX:o.translationX,translationY:o.translationY,visible:o.visible,x:o.x,y:o.y}),{visible:i})}else w.delete(e),a={visible:i};var o;D.push(a)});let O=0;N.forEach(t=>O=Math.min(O,t.x2)),N.push({y:Math.max(r,l),x1:0,x2:O});const R=[],E=[];N.forEach(t=>{if(t.y>=n[0]-1e-7&&t.y<=n[1]+1e-7){const{x1:e,x2:i,y:s}=t,n=new Qs(Math.min(e,i),s,Math.abs(e-i),0);E.push(n),R.push({x1:e,x2:i,y:s})}});const P=[],B=[],F=f?f.depth+1:1;for(let t=0;t<F;t++){const e=x.length>0&&(0===t||T&&v),i=t>0?-I-2*this.label.padding-(t-1)*g:0,s=new Qs(i,Math.min(...n),0,Math.abs(n[1]-n[0]));B.push(s),P.push({x:i,y1:n[0],y2:n[1],visible:e})}return{bbox:(t=>{const e=new an,{rotation:i,translationX:s,translationY:n,rotationCenterX:a,rotationCenterY:o}=this.getAxisTransform();return an.updateTransformMatrix(e,1,1,i,s,n,{scalingCenterX:0,scalingCenterY:0,rotationCenterX:a,rotationCenterY:o}),e.transformBBox(t)})(Qs.merge([...w.values(),...E,...B])),tickLabelLayout:D,separatorLayout:R,axisLineLayout:P}}calculateLayout(){const{axisLineLayout:t,separatorLayout:e,tickLabelLayout:i,bbox:s}=this.computeLayout();return this.computedLayout={axisLineLayout:t,separatorLayout:e,tickLabelLayout:i},{bbox:s,primaryTickCount:void 0}}};Fl.className="GroupedCategoryAxis",Fl.type="grouped-category",b([Yn(ga,{optional:!0})],Fl.prototype,"labelColor",2);var zl=class t{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:i,height:s,pixelRatio:n,position:a,insertAsFirstChild:o}=e;this.insertAsFirstChild=null!=o&&o,this.pixelRatio=function(){if("undefined"==typeof navigator)return!1;const t=navigator.userAgent.match(/\(iPhone; CPU iPhone OS (\d+_\d+_\d+) like Mac OS X\)/);if(null==t)return!1;const[e,i]=t[1].split("_").map(Number);return e<16||16===e&&i<6}()?1:null!=n?n:vs("devicePixelRatio"),this.element=Ss("canvas"),this.element.width=Math.round((null!=i?i:this.width)*this.pixelRatio),this.element.height=Math.round((null!=s?s:this.height)*this.pixelRatio),a&&(this.element.style.position=a),this.context=this.element.getContext("2d"),this.onEnabledChange(),this.resize(null!=i?i:0,null!=s?s:0),t.debugContext(this.context)}static is(e){return e instanceof t}drawImage(t,e=0,i=0){return t.drawImage(this.context.canvas,e,i)}toDataURL(t){return this.element.toDataURL(t)}resize(t,e){if(!(t>0&&e>0))return;const{element:i,context:s,pixelRatio:n}=this;i.width=Math.round(t*n),i.height=Math.round(e*n),s.setTransform(n,0,0,n,0,0),i.style.width=t+"px",i.style.height=e+"px",this.width=t,this.height=e}snapshot(){}clear(){this.context.save(),this.context.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.context.clearRect(0,0,this.width,this.height),this.context.restore()}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}onContainerChange(t,e){var i,s,n,a;t!==e&&(null==(i=this.element.parentNode)||i.removeChild(this.element),this.insertAsFirstChild&&(null==(s=this.container)?void 0:s.firstChild)?null==(n=this.container)||n.insertBefore(this.element,this.container.firstChild):null==(a=this.container)||a.appendChild(this.element))}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"block":"none")}static debugContext(t){if(Cs.check("canvas")){const e=t.save.bind(t),i=t.restore.bind(t);let s=0;Object.assign(t,{save(){e(),s++},restore(){if(0===s)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(0!==s)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}};b([Xr(t=>t.onEnabledChange())],zl.prototype,"enabled",2),b([Xr((t,e,i)=>t.onContainerChange(e,i))],zl.prototype,"container",2);var Gl=zl,_l=class t{constructor(t,e){this.canvas=t,this.markDirty=e,this.debug=Cs.create(!0,"scene"),this.layersMap=new Map,this.nextZIndex=0,this.nextLayerId=0}static sortLayers(t,e){var i,s;return vo([t.zIndex,...null!=(i=t.zIndexSubOrder)?i:[void 0,void 0],t.id],[e.zIndex,...null!=(s=e.zIndexSubOrder)?s:[void 0,void 0],e.id],xo)}get size(){return this.layersMap.size}forEach(e){Array.from(this.layersMap.values()).sort(t.sortLayers).forEach(e)}resize(t,e){this.canvas.resize(t,e),this.layersMap.forEach(({canvas:i})=>i.resize(t,e))}addLayer(t){const{width:e,height:i,pixelRatio:s}=this.canvas,{zIndex:n=this.nextZIndex++,name:a,zIndexSubOrder:o,getComputedOpacity:r,getVisibility:l}=t,h=new Gl({width:e,height:i,pixelRatio:s,position:"absolute"}),c={id:this.nextLayerId++,name:a,canvas:h,zIndex:n,zIndexSubOrder:o,getComputedOpacity:r,getVisibility:l};return n>=this.nextZIndex&&(this.nextZIndex=n+1),this.layersMap.set(h,c),this.debug("Scene.addLayer() - layers",this.layersMap),c.canvas}removeLayer(t){this.layersMap.has(t)&&(this.layersMap.delete(t),t.destroy(),this.markDirty(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}moveLayer(t,e,i){const s=this.layersMap.get(t);s&&(s.zIndex=e,s.zIndexSubOrder=i,this.markDirty(),this.debug("Scene.moveLayer() -  layers",this.layersMap))}clear(){this.layersMap.clear()}};function jl(t,e,i,s,n={}){if(!Cs.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:a=0,layersSkipped:o=0,nodesRendered:r=0,nodesSkipped:l=0}=null!=s?s:{},h=performance.now(),c=e,{start:d}=c,u=f(c,["start"]),p=Object.entries(u).map(([t,e])=>Yl(t,e)).filter(t=>null!=t).join(" + "),g=Object.entries(n).map(([t,e])=>`${t}: ${e}`).join(" ; "),m=Cs.check("scene:stats:verbose"),y=[`${Yl("⏱️",d,h)} (${p})`,`${g}`,`Layers: ${m?Kl(a,o):t.size}`,m?`Nodes: ${Kl(r,l)}`:null].filter(_t),x=new Map(y.map(t=>[t,Po.getTextSize(t,i.font)])),b=Math.max(...Array.from(x.values(),t=>t.width)),v=function(t,e){let i=0;for(const s of t)i+=e(s);return i}(x.values(),t=>t.height);i.save(),i.fillStyle="white",i.fillRect(0,0,b,v),i.fillStyle="black";let S=0;for(const[t,e]of x.entries())S+=e.height,i.fillText(t,2,S);i.restore()}function Wl(t){var e,i;return Cs.check(!0,"scene")?m(m({node:t,name:null!=(e=t instanceof Mo?t.name:null)?e:t.id,dirty:Js[t.dirty]},(null==(i=t.parent)?void 0:i.isVirtual)?{virtualParentDirty:Js[t.parent.dirty],virtualParent:t.parent}:{}),t.children.map(t=>Wl(t)).reduce((t,e)=>{let{name:i}=e;const{node:{visible:s,opacity:n,zIndex:a,zIndexSubOrder:o},node:r,virtualParent:l}=e;(!s||n<=0)&&(i=`(${i})`),r instanceof Mo&&r.isLayer()&&(i=`*${i}*`);const h=[`${null!=i?i:"<unknown>"}`,`z: ${a}`,o&&`zo: ${o.map(t=>"function"==typeof t?`${t()} (fn)`:t).join(" / ")}`,l&&"(virtual parent)"].filter(t=>!!t).join(" ");let c=h,d=1;for(;null!=t[c]&&d<100;)c=`${h} (${d++})`;return t[c]=e,t},{})):{}}function Vl(t){var e;if(0===t.dirty)return{dirtyTree:{},paths:[]};const i=t.children.map(t=>Vl(t)).filter(t=>t.paths.length>0),s=Mo.is(t)&&null!=(e=t.name)?e:t.id,n=i.length?i.flatMap(t=>t.paths).map(t=>`${s}.${t}`):[s];return{dirtyTree:m({name:s,node:t,dirty:Js[t.dirty]},i.map(t=>t.dirtyTree).filter(t=>null!=t.dirty).reduce((t,e)=>{var i;return t[null!=(i=e.name)?i:"<unknown>"]=e,t},{})),paths:n}}function Kl(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function Yl(t,e,i){const s=null!=i?i-e:e;return`${t}: ${Math.round(100*s)/100}ms`}var $l=class{constructor({width:t,height:e,pixelRatio:i,canvasPosition:s}){this.debug=Cs.create(!0,"scene"),this.id=Bs(this),this.root=null,this.isDirty=!1,this.canvas=new Gl({width:t,height:e,pixelRatio:i,position:s,insertAsFirstChild:"absolute"===s}),this.layersManager=new _l(this.canvas,()=>{this.isDirty=!0})}get width(){var t,e;return null!=(e=null==(t=this.pendingSize)?void 0:t[0])?e:this.canvas.width}get height(){var t,e;return null!=(e=null==(t=this.pendingSize)?void 0:t[1])?e:this.canvas.height}setContainer(t){return this.canvas.container=t,this}setRoot(t){var e;return this.root===t||(this.isDirty=!0,null==(e=this.root)||e._setLayerManager(),this.root=t,t&&(t.visible=!0,t._setLayerManager(this.layersManager))),this}attachNode(t){var e;return null==(e=this.root)||e.appendChild(t),()=>this.removeChild(t)}appendChild(t){var e;return null==(e=this.root)||e.appendChild(t),this}removeChild(t){var e;return null==(e=this.root)||e.removeChild(t),this}download(t,e){var i;Ms(this.canvas.toDataURL(e),null!=(i=null==t?void 0:t.trim())?i:"image")}getDataURL(t){return this.canvas.toDataURL(t)}resize(t,e){return t=Math.round(t),e=Math.round(e),t>0&&e>0&&(t!==this.width||e!==this.height)&&(this.pendingSize=[t,e],this.isDirty=!0,!0)}render(t){return S(this,null,function*(){var e,i;const{debugSplitTimes:s={start:performance.now()},extraDebugStats:n}=null!=t?t:{},{canvas:a,canvas:{context:o}={},root:r,pendingSize:l}=this;if(!o)return;const h=performance.now();if(l&&(this.layersManager.resize(...l),this.pendingSize=void 0),r&&!r.visible)return void(this.isDirty=!1);if(r&&!this.isDirty)return this.debug.check()&&this.debug("Scene.render() - no-op",{redrawType:Js[r.dirty],tree:Wl(r)}),void jl(this.layersManager,s,o,void 0,n);const c={ctx:o,devicePixelRatio:null!=(e=this.canvas.pixelRatio)?e:1,forceRender:!0,resized:Boolean(l),debugNodes:{}};Cs.check("scene:stats:verbose")&&(c.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0});let d=!1;if((!r||r.dirty>=1)&&(d=!0,a.clear()),r&&Cs.check("scene:dirtyTree")){const{dirtyTree:t,paths:e}=Vl(r);Cs.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:t,paths:e})}if(r&&d&&(this.debug("Scene.render() - before",{redrawType:Js[r.dirty],canvasCleared:d,tree:Wl(r)}),r.visible&&(r.preRender(),o.save(),r.render(c),o.restore())),s["✍️"]=performance.now()-h,this.layersManager.size&&d){const t=performance.now();o.save(),o.resetTransform(),this.layersManager.forEach(t=>{t.canvas.enabled&&t.getVisibility()&&(o.globalAlpha=t.getComputedOpacity(),t.canvas.drawImage(o))}),o.restore(),s["⛙"]=performance.now()-t}null==(i=o.verifyDepthZero)||i.call(o),this.isDirty=!1,jl(this.layersManager,s,o,c.stats,n),function(t,e){t.save();for(const[i,s]of Object.entries(e)){const e=s.computeTransformedBBox();e?(t.globalAlpha=.8,t.strokeStyle="red",t.lineWidth=1,t.strokeRect(e.x,e.y,e.width,e.height),t.fillStyle="red",t.strokeStyle="white",t.font="16px sans-serif",t.textBaseline="top",t.textAlign="left",t.lineWidth=2,t.strokeText(i,e.x,e.y,e.width),t.fillText(i,e.x,e.y,e.width)):R.log(`Scene.render() - no bbox for debugged node [${i}].`)}t.restore()}(o,c.debugNodes),r&&this.debug.check()&&this.debug("Scene.render() - after",{redrawType:Js[r.dirty],tree:Wl(r),canvasCleared:d})})}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.canvas.container=void 0,this.strip(),this.canvas.destroy(),Object.assign(this,{canvas:void 0})}};function Hl(t){return new Promise(e=>{setTimeout(()=>e(void 0),t)})}$l.className="Scene";var Ul=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise(e=>{this.acquireQueue.push([t,e]),this.available&&this.dispatchNext().catch(t=>R.errorOnce(t))})}acquireImmediately(t){return S(this,null,function*(){return!!this.available&&(yield this.acquire(t),!0)})}waitForClearAcquireQueue(){return S(this,null,function*(){return this.acquire(()=>S(this,null,function*(){}))})}dispatchNext(){return S(this,null,function*(){var t,e;this.available=!1;let[i,s]=null!=(t=this.acquireQueue.shift())?t:[];for(;i;){try{yield i(),null==s||s()}catch(t){R.error("mutex callback error",t),null==s||s()}[i,s]=null!=(e=this.acquireQueue.shift())?e:[]}this.available=!0})}},Xl=class{constructor(){this.eventListeners=new Map}addEventListener(t,e){if("function"!=typeof e)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){var i;null==(i=this.eventListeners.get(t))||i.delete(e),0===this.eventListeners.size&&this.eventListeners.delete(t)}hasEventListener(t){return this.eventListeners.has(t)}clearEventListeners(){this.eventListeners.clear()}fireEvent(t){var e;null==(e=this.eventListeners.get(t.type))||e.forEach(e=>e(t))}},Zl=class extends ye{constructor(t=0,e=t,i=t,s=e){super(),this.top=t,this.right=e,this.bottom=i,this.left=s}clear(){this.top=this.right=this.bottom=this.left=0}};function ql(t,e){let i,s,n=0,a=!1;const o=()=>a,r=()=>{a=!1,null==s||s(),s=void 0,i=void 0,n>0&&t(l)},l=()=>{const t=n;n=0,a=!0;const i=e({count:t});i?i.then(r,r):r()};return{schedule(e){0!==n||o()||t(l,e),n++},await(){return S(this,null,function*(){if(o())for(null==i&&(i=new Promise(t=>{s=t}));o();)yield i})}}}b([Yn(ia)],Zl.prototype,"top",2),b([Yn(ia)],Zl.prototype,"right",2),b([Yn(ia)],Zl.prototype,"bottom",2),b([Yn(ia)],Zl.prototype,"left",2);var Ql=class{constructor(){var t;this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([t,e])=>this.observe(t,e)),this.queuedObserveRequests=[]},"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(t=>{for(const{target:e,contentRect:i}of t){const{width:t,height:s}=i;this.checkSize(this.elements.get(e),e,t,s)}}),this.documentReady="complete"===bs("readyState"),this.documentReady||null==(t=vs())||t.addEventListener("load",this.onLoad))}destroy(){var t,e;null==(t=vs())||t.removeEventListener("load",this.onLoad),null==(e=this.resizeObserver)||e.disconnect(),this.resizeObserver=null}checkSize(t,e,i,s){var n,a;t&&(i===(null==(n=t.size)?void 0:n.width)&&s===(null==(a=t.size)?void 0:a.height)||(t.size={width:i,height:s},t.cb(t.size,e)))}observe(t,e){var i;this.documentReady?(this.elements.has(t)?this.removeFromQueue(t):null==(i=this.resizeObserver)||i.observe(t),this.elements.set(t,{cb:e})):this.queuedObserveRequests.push([t,e])}unobserve(t){var e;null==(e=this.resizeObserver)||e.unobserve(t),this.elements.delete(t),this.removeFromQueue(t),this.elements.size||this.destroy()}removeFromQueue(t){this.queuedObserveRequests=this.queuedObserveRequests.filter(([e])=>e!==t)}},Jl=class{constructor(){this.cache=new WeakMap}call(t,...e){let i,s=this.cache.get(t);const n=()=>{try{const n=t(...e);return s&&null!=i&&s.set(i,n),n}catch(t){return void R.warnOnce("User callback errored, ignoring",t)}};try{i=JSON.stringify(e)}catch(t){return n()}return null==s&&(s=new Map,this.cache.set(t,s)),s.has(i)?s.get(i):n()}invalidateCache(){this.cache=new WeakMap}},th=class{constructor(t){this.annotationRoot=t}attachNode(t){return this.annotationRoot.append(t),()=>{var e;return null==(e=this.annotationRoot)||e.removeChild(t),this}}setAnnotationStyles(t){this.styles=t}getAnnotationTypeStyles(t){var e;return null==(e=this.styles)?void 0:e[t]}},eh=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(e=>e.symbol===t);if(s>=0){i.splice(s,1),0===i.length&&this.registeredListeners.delete(e);break}}}dispatch(t,...e){for(const i of this.getListenersByType(t))try{i.handler(...e)}catch(t){R.errorOnce(t)}}dispatchWrapHandlers(t,e,...i){for(const s of this.getListenersByType(t))try{e(s.handler,...i)}catch(t){R.errorOnce(t)}}getListenersByType(t){var e;return null!=(e=this.registeredListeners.get(t))?e:[]}destroy(){this.registeredListeners.clear()}},ih=class extends eh{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=Cs.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(t){"function"==typeof t&&(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 null!=this.dataSourceCallback}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(t){return O(t=>this.fetch(t),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return O((t,e)=>{this.debug(`DataService - dispatching 'data-load' | ${t}`),this.dispatch("data-load",{type:"data-load",data:e})},t,{leading:!0,trailing:!0})}fetch(t){return S(this,null,function*(){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const e=performance.now(),i=this.requestCounter++;let s;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);try{s=yield this.dataSourceCallback(t),this.debug(`DataService - response | ${performance.now()-e}ms | ${i}`)}catch(t){this.debug(`DataService - request failed | ${i}`),R.errorOnce(`DataService - request failed | [${t}]`)}this.isLoadingInitialData=!1;const n=this.freshRequests.findIndex(t=>t===i);-1===n||this.dispatchOnlyLatest&&n!==this.freshRequests.length-1?this.debug(`DataService - discarding stale request | ${i}`):(this.freshRequests=this.freshRequests.slice(n+1),0===this.freshRequests.length&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(i,s):this.dispatch("data-error"))})}};b([Ur({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],ih.prototype,"dispatchThrottle",2),b([Ur({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],ih.prototype,"requestThrottle",2);var sh=class{constructor(t){this.maxAnimationTime=t,this.debug=Cs.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(kn.map(t=>[t,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){var t;return null!=(t=this.phases.get(kn[this.currentPhase]))?t:[]}checkOverlappingId(t){null!=t&&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){var e;if(!t.isComplete)return kn.indexOf(t.phase)<this.currentPhase?(this.debug("Skipping animation due to being for an earlier phase",t.id),void t.stop()):(this.controllers.set(t.id,t),void(null==(e=this.phases.get(t.phase))||e.push(t)))}removeAnimation(t){this.controllers.delete(t.id);const e=this.phases.get(t.phase),i=null==e?void 0:e.indexOf(t);null!=i&&i>=0&&(null==e||e.splice(i,1))}progress(t){if(!this.isReady)return;let e=0===t?.01:t;const i=()=>{const t=kn[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:t,phaseMeta:Dn[t]}};let{phase:s,phaseControllers:n,phaseMeta:a}=i();const o=()=>null==kn[this.currentPhase],r=()=>{for(({phase:s,phaseControllers:n,phaseMeta:a}=i());!o()&&0===n.length;)this.currentPhase++,({phase:s,phaseControllers:n,phaseMeta:a}=i()),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:e},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${t}ms; phase ${s} with ${null==n?void 0:n.length} of ${l}`);do{const t=e,i=a.skipIfNoEarlierAnimations&&0===this.animationTimeConsumed;let s=0;for(const a of n)i?a.stop():e=Math.min(a.update(t),e),a.isComplete&&(s++,this.removeAnimation(a));this.animationTimeConsumed+=t-e,this.debug(`AnimationBatch - updated ${n.length} controllers; ${s} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),r()}while(e>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(R.warnOnce("Animation batch exceeded max animation time, skipping.",new Map(this.controllers.entries())),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&&!0!==Dn[e.phase].skipIfNoEarlierAnimations){t=!1;break}if(!t)for(const[,t]of this.controllers)t.autoplay&&t.play(!0)}skip(t=!0){if(!1===this.skipAnimations&&!0===t){for(const t of this.controllers.values())t.stop();this.controllers.clear()}this.skipAnimations=t}play(){for(const t of this.controllers.values())t.play()}pause(){for(const t of this.controllers.values())t.pause()}stop(){for(const t of this.controllers.values())try{t.stop(),this.removeAnimation(t)}catch(t){R.error("Error during animation stop",t)}this.dispatchStopped()}stopByAnimationId(t){if(null!=t&&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()}},nh=class{constructor(){this.listeners=new eh,this.destroyFns=[]}addListener(t,e){return this.listeners.addListener(t,e)}removeListener(t){this.listeners.removeListener(t)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(t=>t())}};function ah(t){const e=y(m({},t),{consumed:!1,consume(){var i,s;e.consumed=!0,t.sourceEvent instanceof Event?null==(i=t.sourceEvent)||i.preventDefault():null==(s=t.sourceEvent)||s.consume()}});return e}function oh(t,e,i){t.dispatchWrapHandlers(e,(t,e)=>{e.consumed||t(e)},i)}var rh=["click","dblclick","contextmenu","hover","drag-start","drag","drag-end","leave","enter","page-left","wheel"],lh=["blur","focus"],hh=["keydown","keyup"],ch=["pagehide","mousemove","mouseup"],dh=["click","dblclick","contextmenu","mousedown","mouseout","mouseenter","touchstart","touchmove","touchend","touchcancel","wheel","blur","focus","keydown","keyup"],uh=(t=>(t[t.Default=16]="Default",t[t.ZoomDrag=8]="ZoomDrag",t[t.Annotations=4]="Annotations",t[t.ContextMenu=2]="ContextMenu",t[t.Animation=1]="Animation",t[t.All=31]="All",t))(uh||{}),ph=class t extends nh{constructor(t,e){super(),this.keyboardOptions=t,this.debug=Cs.create(!0,"interaction"),this.eventHandler=t=>this.processEvent(t),this.mouseDown=!1,this.touchDown=!1,this.clickHistory=[{offsetX:NaN,offsetY:NaN,type:"mousedown"}],this.dblclickHistory=[{offsetX:NaN,offsetY:NaN,type:"mousedown"},{offsetX:NaN,offsetY:NaN,type:"mouseup"},{offsetX:NaN,offsetY:NaN,type:"mousedown"}],this.stateQueue=17,this.rootElement=bs("body"),this.element=e;for(const t of dh)t.startsWith("touch")?e.addEventListener(t,this.eventHandler,{passive:!0}):"wheel"===t?e.addEventListener(t,this.eventHandler,{passive:!1}):e.addEventListener(t,this.eventHandler);for(const t of ch)vs().addEventListener(t,this.eventHandler);ks("\n.ag-chart-wrapper {\n    touch-action: none;\n}\n","interactionManager")}destroy(){super.destroy();for(const t of ch)vs().removeEventListener(t,this.eventHandler);for(const t of dh)this.element.removeEventListener(t,this.eventHandler)}addListener(t,e,i=16){return super.addListener(t,t=>{this.getState()&i&&e(t)})}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}getState(){return this.stateQueue&-this.stateQueue}processEvent(t){const e=this.decideInteractionEventTypes(t);e.length>0&&this.dispatchEvent(t,e).catch(t=>R.errorOnce(t))}dispatchEvent(t,e){return S(this,null,function*(){if(ys(rh,e))this.dispatchPointerEvent(t,e);else if(ys(lh,e))for(const i of e)oh(this.listeners,i,ah({type:i,sourceEvent:t}));else if(ys(hh,e))for(const i of e)oh(this.listeners,i,ah({type:i,sourceEvent:t}))})}dispatchPointerEvent(t,e){const i=this.calculateCoordinates(t);if(null!=i)for(const s of e)oh(this.listeners,s,this.buildPointerEvent(m({type:s,event:t},i)))}recordDown(t){t instanceof MouseEvent&&(ee(["offsetX","offsetY"],this.clickHistory[0],t),ee(["offsetX","offsetY"],this.dblclickHistory[2],this.dblclickHistory[0]),ee(["offsetX","offsetY"],this.dblclickHistory[0],t)),this.dragStartElement=t.target}recordUp(t){t instanceof MouseEvent&&ee(["offsetX","offsetY"],this.dblclickHistory[1],t),this.dragStartElement=void 0}decideInteractionEventTypes(t){const e="drag-start";switch(t.type){case"blur":case"focus":case"keydown":case"keyup":return this.keyboardOptions.enabled?[t.type]:[];case"click":case"dblclick":case"contextmenu":case"wheel":return[t.type];case"mousedown":return this.isEventOverElement(t)?(this.mouseDown=!0,this.recordDown(t),[e]):[];case"touchstart":return this.isEventOverElement(t)?(this.touchDown=!0,this.recordDown(t),[e]):[];case"touchmove":case"mousemove":return this.mouseDown||this.touchDown||this.isEventOverElement(t)?this.mouseDown||this.touchDown?["drag"]:["hover"]:[];case"mouseup":return this.mouseDown||this.isEventOverElement(t)?(this.mouseDown=!1,this.recordUp(t),["drag-end"]):[];case"touchend":return this.touchDown||this.isEventOverElement(t)?(this.touchDown=!1,this.recordUp(t),["drag-end"]):[];case"mouseout":case"touchcancel":return["leave"];case"mouseenter":const i=t instanceof MouseEvent&&!(1&~t.buttons);return this.mouseDown!==i?(this.mouseDown=i,[i?e:"drag-end"]):["enter"];case"pagehide":return["page-left"]}return[]}isEventOverElement(t){var e,i,s;return t.target===this.element||(null==(e=t.target)?void 0:e.parentElement)===this.element||(null==(s=null==(i=t.target)?void 0:i.parentElement)?void 0:s.parentElement)===this.element}calculateCoordinates(e){var i;if(e instanceof MouseEvent)return this.getMouseEventCoords(e);if("undefined"!=typeof TouchEvent&&e instanceof TouchEvent){const s=null!=(i=e.touches[0])?i:e.changedTouches[0],{clientX:n,clientY:a,pageX:o,pageY:r}=s;return y(m({},t.NULL_COORDS),{clientX:n,clientY:a,pageX:o,pageY:r})}if(e instanceof PageTransitionEvent){if(e.persisted)return;return t.NULL_COORDS}}getMouseEventCoords(t){const{clientX:e,clientY:i,pageX:s,pageY:n}=t;let{offsetX:a,offsetY:o}=t;const r=t=>{let e=0,i=0;for(;t;)e+=t.offsetLeft,i+=t.offsetTop,t=t.offsetParent;return{x:e,y:i}};if(null!=this.dragStartElement&&t.target!==this.dragStartElement){const e=r(this.dragStartElement),i=r(t.target);a-=e.x-i.x,o-=e.y-i.y}return{clientX:e,clientY:i,pageX:s,pageY:n,offsetX:a,offsetY:o}}isWheelEvent(t){return"wheel"===t.type}buildPointerEvent(t){const{type:e,event:i,clientX:s,clientY:n}=t;let{offsetX:a,offsetY:o,pageX:r,pageY:l}=t;if(!Wt(a)||!Wt(o)){const t=this.element.getBoundingClientRect();a=s-t.left,o=n-t.top}if(!Wt(r)||!Wt(l)){const t=this.rootElement.getBoundingClientRect();r=s-t.left,l=n-t.top}let[h,c]=[NaN,NaN];if(this.isWheelEvent(i)){const t=0===i.deltaMode?.01:1;h=i.deltaX*t,c=i.deltaY*t}let d=[];"click"===i.type?d=this.clickHistory:"dblclick"===i.type&&(d=this.dblclickHistory);const u=ah({type:e,offsetX:a,offsetY:o,pageX:r,pageY:l,deltaX:h,deltaY:c,pointerHistory:d,sourceEvent:i});return this.debug("InteractionManager - builtEvent: ",u),u}};ph.NULL_COORDS={clientX:-1/0,clientY:-1/0,pageX:-1/0,pageY:-1/0,offsetX:-1/0,offsetY:-1/0};var gh=ph;function mh(t){return null==t||!isNaN(t)&&t>=0&&t<=2}var yh=class extends nh{constructor(t,e){super(),this.interactionManager=t,this.chartUpdateMutex=e,this.defaultDuration=1e3,this.batch=new sh(1.5*this.defaultDuration),this.debug=Cs.create(!0,"animation"),this.rafAvailable="undefined"!=typeof requestAnimationFrame,this.isPlaying=!1,this.requestId=null,this.skipAnimations=!1}animate(t){var e,i=f(t,[]);const s=this.batch;try{s.checkOverlappingId(i.id)}catch(t){return void this.failsafeOnError(t)}const n=null!=(e=i.id)?e:Math.random().toString(),a=this.isSkipped()||"none"===i.phase;a&&this.debug("AnimationManager - skipping animation");const{delay:o,duration:r}=i;if(!mh(o))throw new Error(`Animation delay of ${o} is unsupported (${n})`);if(!mh(r))throw new Error(`Animation duration of ${r} is unsupported (${n})`);const l=new Cn(y(m({},i),{id:n,skip:a,autoplay:!!this.isPlaying&&i.autoplay,phase:i.phase,defaultDuration:this.defaultDuration}));if(!this.forceTimeJump(l,this.defaultDuration))return this.batch.addAnimation(l),l}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(t){this.failsafeOnError(t)}this.requestAnimation()}}pause(){if(this.isPlaying){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.pause()");try{this.batch.pause()}catch(t){this.failsafeOnError(t)}}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(t){try{this.batch.stopByAnimationId(t)}catch(t){this.failsafeOnError(t)}}stopByAnimationGroupId(t){try{this.batch.stopByAnimationGroupId(t)}catch(t){this.failsafeOnError(t)}}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=requestAnimationFrame(t)}forceTimeJump(t,e){return!1}requestAnimation(){if(!this.rafAvailable)return;if(!this.batch.isActive()||null!==this.requestId)return;let t;const e=i=>S(this,null,function*(){const s=()=>S(this,null,function*(){const e=i-(null!=t?t:i);t=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:e}),this.interactionManager.pushState(1);try{this.batch.progress(e)}catch(t){this.failsafeOnError(t)}this.listeners.dispatch("animation-frame",{type:"animation-frame",deltaMs:e})});this.isSkippingFrames()?yield this.chartUpdateMutex.acquireImmediately(s):yield this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(e):(this.batch.stop(),this.listeners.dispatch("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))});this.listeners.dispatch("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(e)}cancelAnimation(){null!==this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(t,e=!0){R.error("Error during animation, skipping animations",t),e&&this.cancelAnimation()}startBatch(t){this.debug(`AnimationManager - startBatch() with skipAnimations=${t}.`),this.reset(),this.batch.stop(),this.batch.destroy(),this.batch=new sh(1.5*this.defaultDuration),!0===t&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(1),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(t){this.batch.stoppedCbs.add(t)}},fh=class t{constructor(e){this.canvas=e,this.debug=Cs.create(!0,"aria"),this.canvas.appendChild(this.liveElem=t.createAnnouncer())}static createAnnouncer(){const t=bs().createElement("div");return t.classList.add("ag-charts-aria-announcer"),Zr(t,"role","status"),Zr(t,"aria-live","assertive"),t}destroy(){this.canvas.removeChild(this.liveElem)}announceValue(t){this.debug(`AriaAnnouncementService - announceValue: ${t}`),this.liveElem.textContent=t}},xh=class extends nh{legendItemClick(t,e,i,s){const n={type:"legend-item-click",series:t,itemId:e,enabled:i,legendItemName:s};this.listeners.dispatch("legend-item-click",n)}legendItemDoubleClick(t,e,i,s,n){const a={type:"legend-item-double-click",series:t,itemId:e,enabled:i,legendItemName:n,numVisibleItems:s};this.listeners.dispatch("legend-item-double-click",a)}axisHover(t,e){const i={type:"axis-hover",axisId:t,direction:e};this.listeners.dispatch("axis-hover",i)}},bh=class{constructor(){this.defaultActions=[],this.disabledActions=new Set}copyDefaultActions(){return[...this.defaultActions]}registerDefaultAction(t){t.id&&this.defaultActions.find(({id:e})=>e===t.id)||this.defaultActions.push(t)}enableAction(t){this.disabledActions.delete(t)}disableAction(t){this.disabledActions.add(t)}isDisabled(t){return this.disabledActions.has(t)}},vh=class extends Map{constructor(t,e){super(),this.defaultValue=t,this.defaultState=e}set(t,e){return this.delete(t),void 0!==e&&super.set(t,e),this}stateId(){var t;return null!=(t=Array.from(this.keys()).pop())?t:this.defaultState}stateValue(){var t;return null!=(t=Array.from(this.values()).pop())?t:this.defaultValue}},Sh=class{constructor(t){this.element=t,this.stateTracker=new vh("default")}updateCursor(t,e){this.stateTracker.set(t,e),this.element.style.cursor=this.stateTracker.stateValue()}getCursor(){return this.element.style.cursor}};function Mh(t,e){return Math.sqrt(function(t,e){const i=t.screenX-e.screenX,s=t.screenY-e.screenY;return i*i+s*s}(t,e))}var kh=class extends nh{constructor(t){super(),this.touchstart=t=>this.onTouchStart(t),this.touchmove=t=>this.onTouchMove(t),this.touchend=t=>this.onTouchEnd(t),this.touchcancel=t=>this.onTouchCancel(t),this.pinch={finger1:{identifier:NaN,screenX:NaN,screenY:NaN},finger2:{identifier:NaN,screenX:NaN,screenY:NaN},origin:{x:NaN,y:NaN},distance:NaN,status:0},this.element=t,t.addEventListener("touchstart",this.touchstart,{passive:!0}),t.addEventListener("touchmove",this.touchmove,{passive:!0}),t.addEventListener("touchend",this.touchend),t.addEventListener("touchcancel",this.touchcancel)}destroy(){const{element:t}=this;t.removeEventListener("touchstart",this.touchstart),t.removeEventListener("touchmove",this.touchmove),t.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.touchcancel)}findPinchTouches(t){const{touches:e}=t,{finger1:i,finger2:s}=this.pinch;if(0!==this.pinch.status&&2===e.length){if(e[0].identifier===i.identifier&&e[1].identifier===s.identifier)return[e[0],e[1]];if(e[0].identifier===s.identifier&&e[1].identifier===i.identifier)return[e[1],e[0]]}}copyTouchData(t){const e=["identifier","screenX","screenY"];ee(e,this.pinch.finger1,t.touches[0]),ee(e,this.pinch.finger2,t.touches[1]),this.pinch.distance=Mh(this.pinch.finger1,this.pinch.finger2)}dispatchPinchEvent(t,e){const{finger1:i,finger2:s,origin:n}=this.pinch,a={type:t,finger1:i,finger2:s,deltaDistance:e,origin:n};this.listeners.dispatch(t,a)}onTouchStart(t){this.stopPinchTracking();const{pinch:e}=this;2===t.touches.length&&(e.status=1,this.copyTouchData(t),e.origin.x=(t.touches[0].clientX+t.touches[1].clientX)/2,e.origin.y=(t.touches[0].clientY+t.touches[1].clientY)/2)}onTouchMove(t){const e=this.findPinchTouches(t);if(void 0!==e){const[i,s]=e,{pinch:n}=this,a=Mh(i,s),o=a-n.distance;1===n.status?Math.abs(o)>1&&(n.status=2,this.copyTouchData(t),this.dispatchPinchEvent("pinch-start",0)):2===n.status?(n.distance=a,this.copyTouchData(t),this.dispatchPinchEvent("pinch-move",o)):R.error(`unexpected pinch.status: ${n.status}`)}}onTouchEnd(t){this.stopPinchTracking()}onTouchCancel(t){this.stopPinchTracking()}stopPinchTracking(){const{pinch:t}=this;2===t.status&&this.dispatchPinchEvent("pinch-end",0),this.pinch.status=0}},Dh=class extends nh{constructor(){super(...arguments),this.highlightStates=new vh,this.pickedStates=new vh}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})}getActiveHighlight(){return this.activeHighlight}updatePicked(t,e){this.pickedStates.set(t,e),this.activePicked=this.pickedStates.stateValue()}getActivePicked(){return this.activePicked}isEqual(t,e){return t===e||(null==t?void 0:t.series)===(null==e?void 0:e.series)&&(null==t?void 0:t.itemId)===(null==e?void 0:e.itemId)&&(null==t?void 0:t.datum)===(null==e?void 0:e.datum)}},wh=class extends nh{constructor(t){super(),this.hasBrowserFocus=!1,this.isMouseBlurred=!1,this.isClicking=!1,this.destroyFns.push(t.addListener("drag-start",t=>this.onClickStart(t),31),t.addListener("click",t=>this.onClickStop(t),31),t.addListener("drag-end",t=>this.onClickStop(t),31),t.addListener("wheel",t=>this.mouseBlur(t)),t.addListener("hover",t=>this.mouseBlur(t)),t.addListener("drag",t=>this.mouseBlur(t)),t.addListener("blur",t=>this.onBlur(t),31),t.addListener("focus",t=>this.onFocus(t),31),t.addListener("keydown",t=>this.onKeyDown(t),31))}destroy(){super.destroy()}onClickStart(t){this.isClicking=!0,this.mouseBlur(t)}onClickStop(t){this.isClicking=!1,this.mouseBlur(t)}mouseBlur(t){this.hasBrowserFocus&&(this.isMouseBlurred||(this.dispatch("blur",0,t),this.isMouseBlurred=!0))}onBlur(t){this.hasBrowserFocus=!1,this.isMouseBlurred=!1,this.dispatch("blur",0,t)}onFocus(t){this.hasBrowserFocus=!0,this.isClicking?this.isMouseBlurred=!0:(this.dispatch("browserfocus",1,t),this.dispatch("tab",0,t))}onKeyDown(t){if(this.hasBrowserFocus&&!this.isClicking)switch(this.isMouseBlurred=!1,t.sourceEvent.code){case"Tab":return t.sourceEvent.shiftKey?this.dispatch("tab",-1,t):this.dispatch("tab",1,t);case"ArrowDown":return this.dispatch("nav-vert",1,t);case"ArrowUp":return this.dispatch("nav-vert",-1,t);case"ArrowLeft":return this.dispatch("nav-hori",-1,t);case"ArrowRight":return this.dispatch("nav-hori",1,t);case"Space":case"Enter":return this.dispatch("submit",0,t)}}dispatch(t,e,i){const s=ah({type:t,delta:e,sourceEvent:i});oh(this.listeners,t,s)}},Ih={};x(Ih,{block:()=>Ch,css:()=>Th,elements:()=>Lh,modifiers:()=>Ah});var Ch="ag-charts-focus",Lh={wrapper:`${Ch}__wrapper`,indicator:`${Ch}__indicator`},Ah={hidden:`${Ch}--hidden`},Th=`\n.${Ch}.${Lh.wrapper} {\n    position: relative;\n    display: block;\n    pointer-events: none;\n    user-select: none;\n    overflow: hidden;\n    top: 0;\n    left: 0;\n}\n\n.${Ch}.${Lh.indicator} {\n    position: absolute;\n    display: block;\n    pointer-events: none;\n    user-select: none;\n    border: var(--ag-charts-focus-border);\n    box-shadow: var(--ag-charts-focus-border-shadow);\n}\n\n.${Ah.hidden} {\n    visibility: hidden;\n}\n`,Nh=["series","legend"],Oh=class extends eh{},Rh=class{constructor(t,e,i,s){this.interactionManager=t,this.keyNavManager=e,this.canvasElement=i,this.currentTabIndex=0,this.isDragging=!1,this.leftCanvas=!1,this.regions=new Map,this.destroyFns=[],this.destroyFns.push(...rh.map(e=>t.addListener(e,this.processPointerEvent.bind(this),31)),this.keyNavManager.addListener("blur",this.onNav.bind(this)),this.keyNavManager.addListener("browserfocus",this.onFocus.bind(this)),this.keyNavManager.addListener("tab",this.onTab.bind(this)),this.keyNavManager.addListener("nav-vert",this.onNav.bind(this)),this.keyNavManager.addListener("nav-hori",this.onNav.bind(this)),this.keyNavManager.addListener("submit",this.onNav.bind(this))),ks(Th,Ch),this.focusWrapper=bs().createElement("div"),this.focusIndicator=bs().createElement("div"),this.focusWrapper.appendChild(this.focusIndicator),s.appendChild(this.focusWrapper);const{block:n,elements:a,modifiers:o}=Ih;this.focusWrapper.classList.add(n,a.wrapper),this.focusIndicator.classList.add(n,a.indicator,o.hidden)}destroy(){this.destroyFns.forEach(t=>t()),this.currentRegion=void 0;for(const t of this.regions.values())t.listeners.destroy();this.focusWrapper.remove(),this.regions.clear()}addRegionFromProperties(t){const e={properties:t,listeners:new Oh};return this.regions.set(t.name,e),this.makeObserver(e)}addRegion(t,e,...i){return this.addRegionFromProperties({name:t,bboxproviders:[e,...i],canInteraction:()=>!0})}getRegion(t){return this.makeObserver(this.regions.get(t))}find(t,e){const i=[];for(const[s,n]of this.regions.entries())for(const s of n.properties.bboxproviders){const a=s.getCachedBBox();a.containsPoint(t,e)&&i.push([n,a.width*a.height])}return i.sort((t,e)=>t[1]-e[1]).map(t=>t[0])}makeObserver(t){const{interactionManager:e}=this;return new class{addListener(i,s,n=16){var a;return null!=(a=null==t?void 0:t.listeners.addListener(i,t=>{t.consumed||e.getState()&n&&s(t)}))?a:()=>{}}}}checkPointerHistory(t,e){for(const i of e.pointerHistory){const e=this.pickRegion(i.offsetX,i.offsetY);if(t.properties.name!==(null==e?void 0:e.properties.name))return!1}return!0}dispatch(t,e){null==t||t.listeners.dispatch(e.type,e)}handleDragging(t){const{currentRegion:e}=this;switch(t.type){case"drag-start":this.isDragging=!0,this.leftCanvas=!1;break;case"leave":return this.leftCanvas=!0,this.isDragging;case"enter":return this.leftCanvas=!1,this.isDragging;case"drag":if(this.isDragging)return this.dispatch(e,t),!0;break;case"drag-end":if(this.isDragging)return this.isDragging=!1,this.dispatch(e,t),this.leftCanvas&&this.dispatch(e,y(m({},t),{type:"leave"})),!0}return!1}processPointerEvent(t){if(this.handleDragging(t))return;const{currentRegion:e}=this,i=this.pickRegion(t.offsetX,t.offsetY);void 0!==e&&(null==i?void 0:i.properties.name)!==e.properties.name&&this.dispatch(e,y(m({},t),{type:"leave"})),void 0!==i&&i.properties.name!==(null==e?void 0:e.properties.name)&&this.dispatch(i,y(m({},t),{type:"enter"})),void 0!==i&&this.checkPointerHistory(i,t)&&this.dispatch(i,t),this.currentRegion=i}pickRegion(t,e){const i=this.find(t,e);return i.length>0?i[0]:void 0}getTabRegion(t){if(void 0!==t&&t>=0&&t<Nh.length)return this.regions.get(Nh[t])}dispatchTabStart(t){const{delta:e,sourceEvent:i}=t,s=ah({type:"tab-start",delta:e,sourceEvent:i}),n=this.getTabRegion(this.currentTabIndex);return this.dispatch(n,s),!!s.consumed}getNextInteractableTabIndex(t,e){const i=e<0?-1:1;let s=t;for(;0!==e;){const t=this.getTabRegion(s+i);if(void 0===t)return;t.properties.canInteraction()&&(e-=i),s+=i}return s}validateCurrentTabIndex(){var t;const e=this.getTabRegion(this.currentTabIndex);void 0===e||e.properties.canInteraction()||(this.currentTabIndex=null!=(t=this.getNextInteractableTabIndex(-1,1))?t:0)}onFocus(t){const{delta:e,sourceEvent:i}=t,s=e>0?this.getNextInteractableTabIndex(-1,1):this.getNextInteractableTabIndex(Nh.length,-1);this.currentTabIndex=null!=s?s:0;const n=this.getTabRegion(this.currentTabIndex);n&&this.dispatch(n,ah({type:"tab",delta:e,sourceEvent:i}))}onTab(t){if(this.dispatchTabStart(t))return;this.validateCurrentTabIndex();const e=this.getNextInteractableTabIndex(this.currentTabIndex,t.delta),i=this.getTabRegion(e),s=this.getTabRegion(this.currentTabIndex);if(void 0!==e&&(this.currentTabIndex=e),void 0!==s&&(null==i?void 0:i.properties.name)!==s.properties.name){const{delta:e,sourceEvent:i}=t,n=ah({type:"blur",delta:e,sourceEvent:i});this.dispatch(s,n)}void 0!==i&&i.properties.canInteraction()?this.dispatch(i,t):this.updateFocusIndicatorRect(void 0)}onNav(t){const e=this.getTabRegion(this.currentTabIndex);this.dispatch(e,t)}updateFocusWrapperRect(){this.focusWrapper.style.width=this.canvasElement.style.width,this.focusWrapper.style.height=this.canvasElement.style.height}updateFocusIndicatorRect(t){null!=t?(this.updateFocusWrapperRect(),this.focusIndicator.classList.remove(Ah.hidden),this.focusIndicator.style.width=`${t.width}px`,this.focusIndicator.style.height=`${t.height}px`,this.focusIndicator.style.left=`${t.x}px`,this.focusIndicator.style.top=`${t.y}px`):this.focusIndicator.classList.add(Ah.hidden)}},Eh=class extends nh{constructor(t){super(),this.element=t}static isGroup(t,e){return e.group===t}pressButton(t,e){this.listeners.dispatch("button-pressed",{type:"button-pressed",group:t,value:e})}toggleGroup(t,e){this.listeners.dispatch("group-toggled",{type:"group-toggled",group:t,visible:e})}toggleButton(t,e,i){this.listeners.dispatch("button-toggled",{type:"button-toggled",group:t,value:e,enabled:i})}proxyGroupOptions(t,e){this.listeners.dispatch("proxy-group-options",{type:"proxy-group-options",group:t,options:e})}},Ph=`\n.${Qr} {\n    transition: transform 0.1s ease;\n    max-width: 100%;\n    position: fixed;\n    left: 0px;\n    top: 0px;\n    z-index: 99999;\n    font: 12px Verdana, sans-serif;\n    color: rgb(70, 70, 70);\n    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);\n}\n\n.${Qr}-wrap-always {\n    overflow-wrap: break-word;\n    word-break: break-word;\n    hyphens: none;\n}\n\n.${Qr}-wrap-hyphenate {\n    overflow-wrap: break-word;\n    word-break: break-word;\n    hyphens: auto;\n}\n\n.${Qr}-wrap-on-space {\n    overflow-wrap: normal;\n    word-break: normal;\n}\n\n.${Qr}-wrap-never {\n    white-space: pre;\n    text-overflow: ellipsis;\n}\n\n.${Qr}-no-interaction {\n    pointer-events: none;\n    user-select: none;\n}\n\n.${Qr}-no-animation {\n    transition: none !important;\n}\n\n.${Qr}-hidden {\n    visibility: hidden;\n}\n\n.${Qr}-title {\n    overflow: hidden;\n    position: relative;\n    padding: 8px 14px;\n    border-top-left-radius: 2px;\n    border-top-right-radius: 2px;\n    color: white;\n    background-color: #888888;\n    z-index: 1;\n    text-overflow: inherit;\n}\n\n.${Qr}-title:only-child {\n    border-bottom-left-radius: 2px;\n    border-bottom-right-radius: 2px;\n}\n\n.${Qr}-content {\n    overflow: hidden;\n    padding: 6px 14px;\n    line-height: 1.7em;\n    background: white;\n    border-bottom-left-radius: 2px;\n    border-bottom-right-radius: 2px;\n    border: 1px solid rgba(0, 0, 0, 0.15);\n    overflow: hidden;\n    text-overflow: inherit;\n}\n\n.${Qr}-arrow::before {\n    content: "";\n\n    position: absolute;\n    top: 100%;\n    left: 50%;\n    transform: translateX(-50%);\n\n    border: 5px solid #d9d9d9;\n\n    border-left-color: transparent;\n    border-right-color: transparent;\n    border-bottom-color: transparent;\n\n    width: 0;\n    height: 0;\n\n    margin: 0 auto;\n}\n\n.${Qr}-arrow::after {\n    content: "";\n\n    position: absolute;\n    top: calc(100% - 1px);\n    left: 50%;\n    transform: translateX(-50%);\n\n    border: 5px solid white;\n\n    border-left-color: transparent;\n    border-right-color: transparent;\n    border-bottom-color: transparent;\n\n    width: 0;\n    height: 0;\n\n    margin: 0 auto;\n}\n\n.ag-chart-wrapper {\n    box-sizing: border-box;\n    overflow: hidden;\n}\n`,Bh=class{constructor(t,e){if(this.canvasElement=t,this.tooltip=e,this.stateTracker=new vh,this.appliedState=null,"undefined"!=typeof IntersectionObserver){const t=new IntersectionObserver(t=>{for(const e of t)e.target===this.canvasElement&&0===e.intersectionRatio&&this.tooltip.toggle(!1)},{root:this.tooltip.root});t.observe(this.canvasElement),this.observer=t}ks(Ph,"tooltip")}updateTooltip(t,e,i){var s;this.tooltip.enabled&&(null!=i||(i=null==(s=this.stateTracker.get(t))?void 0:s.content),this.stateTracker.set(t,{content:i,meta:e}),this.applyStates())}removeTooltip(t){this.tooltip.enabled&&(this.stateTracker.delete(t),this.applyStates())}getTooltipMeta(t){var e;return null==(e=this.stateTracker.get(t))?void 0:e.meta}destroy(){var t;null==(t=this.observer)||t.unobserve(this.canvasElement)}applyStates(){var t;const e=this.stateTracker.stateId(),i=e?this.stateTracker.get(e):null;if(null==(null==i?void 0:i.meta)||null==(null==i?void 0:i.content))return this.appliedState=null,void this.tooltip.toggle(!1);const s=this.canvasElement.getBoundingClientRect();if((null==(t=this.appliedState)?void 0:t.content)===(null==i?void 0:i.content)){const t=this.tooltip.isVisible();this.tooltip.show(s,null==i?void 0:i.meta,null,t)}else this.tooltip.show(s,null==i?void 0:i.meta,null==i?void 0:i.content);this.appliedState=i}static makeTooltipMeta(t,e){var i,s,n,a,o,r,l;const{offsetX:h,offsetY:c}=t,{tooltip:d}=e.series.properties,u={offsetX:h,offsetY:c,enableInteraction:null!=(s=null==(i=d.interaction)?void 0:i.enabled)&&s,lastPointerEvent:{type:t.type,offsetX:h,offsetY:c},showArrow:d.showArrow,position:{type:d.position.type,xOffset:d.position.xOffset,yOffset:d.position.yOffset}},p=null!=(l=null!=(a=null==(n=e.yBar)?void 0:n.upperPoint)?a:e.midPoint)?l:null==(r=(o=e.series).datumMidPoint)?void 0:r.call(o,e);if("node"===d.position.type&&p){const{x:t,y:i}=p,s=e.series.contentGroup.inverseTransformPoint(t,i);return y(m({},u),{offsetX:Math.round(s.x),offsetY:Math.round(s.y)})}return u}},Fh=class extends eh{constructor(){super(...arguments),this.layoutComplete="layout-complete"}addListener(t,e){if(this.isLayoutStage(t)||this.isLayoutComplete(t))return super.addListener(t,e);throw new Error(`AG Charts - unsupported listener type: ${t}`)}dispatchPerformLayout(t,e){return this.isLayoutStage(t)?this.getListenersByType(t).reduce((t,e)=>{try{return e.handler(t)}catch(e){return R.errorOnce(e),t}},e):e}dispatchLayoutComplete(t){this.dispatch(this.layoutComplete,t)}isLayoutStage(t){return t!==this.layoutComplete}isLayoutComplete(t){return t===this.layoutComplete}},zh=class{constructor(){this.groups={}}registerSeries({id:t,seriesGrouping:e,visible:i,type:s}){var n;e&&(null!=(n=this.groups)[s]||(n[s]={}),this.groups[s][t]={grouping:e,visible:i})}deregisterSeries({id:t,type:e}){this.groups[e]&&delete this.groups[e][t],this.groups[e]&&0===Object.keys(this.groups[e]).length&&delete this.groups[e]}getVisiblePeerGroupIndex({type:t,seriesGrouping:e,visible:i}){var s;if(!e)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const n=new Set,a=new Set;for(const i of Object.values(null!=(s=this.groups[t])?s:{}))i.visible&&(n.add(i.grouping.groupIndex),i.grouping.groupIndex===e.groupIndex&&a.add(i.grouping.stackIndex));const o=Array.from(n);return o.sort((t,e)=>t-e),{visibleGroupCount:o.length,visibleSameStackCount:a.size,index:o.indexOf(e.groupIndex)}}},Gh=(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.TOOLTIP_RECALCULATION=5]="TOOLTIP_RECALCULATION",t[t.SCENE_RENDER=6]="SCENE_RENDER",t[t.NONE=7]="NONE",t))(Gh||{}),_h=class extends eh{constructor(t){super(),this.updateCallback=t}update(t=0,e){this.updateCallback(t,e)}dispatchUpdateComplete(t){this.dispatch("update-complete",{type:"update-complete",minRect:null==t?void 0:t.minRect,minVisibleRect:null==t?void 0:t.minVisibleRect})}},jh=class{constructor(t,e){const{scene:i,syncManager:s,element:n,updateCallback:a,updateMutex:o}=e;this.chartService=t,this.scene=i,this.syncManager=s,this.zoomManager=t.zoomManager,this.annotationManager=new th(t.annotationRoot),this.ariaAnnouncementService=new fh(i.canvas.element),this.chartEventManager=new xh,this.contextMenuRegistry=new bh,this.cursorManager=new Sh(n),this.highlightManager=new Dh,this.interactionManager=new gh(t.keyboard,n),this.keyNavManager=new wh(this.interactionManager),this.regionManager=new Rh(this.interactionManager,this.keyNavManager,this.scene.canvas.element,n),this.toolbarManager=new Eh(n),this.gestureDetector=new kh(n),this.layoutService=new Fh,this.updateService=new _h(a),this.seriesStateManager=new zh,this.callbackCache=new Jl,this.animationManager=new yh(this.interactionManager,o),this.animationManager.skip(),this.animationManager.play(),this.dataService=new ih(this.animationManager),this.tooltipManager=new Bh(this.scene.canvas.element,t.tooltip)}destroy(){this.tooltipManager.destroy(),this.regionManager.destroy(),this.keyNavManager.destroy(),this.interactionManager.destroy(),this.animationManager.stop(),this.animationManager.destroy(),this.ariaAnnouncementService.destroy(),this.chartEventManager.destroy(),this.highlightManager.destroy(),this.callbackCache.invalidateCache(),this.animationManager.reset(),this.syncManager.destroy()}},Wh=class extends ye{constructor(){super(...arguments),this.range="tooltip"}};b([Yn(Pa(["tooltip","node"],"a range"))],Wh.prototype,"range",2);var Vh=class t{constructor(){this.domain=new Set}static is(e){return e instanceof t}extend(t){this.domain.add(t)}getDomain(){return Array.from(this.domain)}},Kh=class t{constructor(){this.domain=[1/0,-1/0]}static is(e){return e instanceof t}static extendDomain(t,e=[1/0,-1/0]){for(const i of t)"number"==typeof i&&(e[0]>i&&(e[0]=i),e[1]<i&&(e[1]=i));return e}extend(t){this.domain[0]>t&&(this.domain[0]=t),this.domain[1]<t&&(this.domain[1]=t)}getDomain(){return[...this.domain]}};function Yh(t){return t.map(t=>Ft(t)?JSON.stringify(t):t).join("-")}function $h(t){const e=1e4;return Number.isInteger(t)?t:Math.abs(t)>e?Math.trunc(t):Math.round(t*e)/e}function Hh(t,e){var i;const s=function(t){if(null==t)return[];let[e,i]=t.map(Number);return 0===e&&0===i?[0,1]:e===1/0&&i===-1/0?[]:(e===1/0?e=0:i===-1/0&&(i=0),Wt(e)&&Wt(i)?[e,i]:[])}(t);if(0===s.length)return s;let[n,a]=s;if(n===a){const[t,s]=null!=(i=null==e?void 0:e.calculatePadding(n,a))?i:[1,1];n-=t,a+=s}return[n,a]}function Uh(t,e){var i;return null!=(i=null==e?void 0:e.get(t.id))?i:0}var Xh=Symbol("invalid"),Zh=class{constructor(t,e="standalone"){this.opts=t,this.mode=e,this.debug=Cs.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let i=!0;for(const e of t.props){if("key"===e.type&&!i)throw new Error("AG Charts - internal config error: keys must come before values.");"value"===e.type&&i&&(i=!1)}const s=({matchGroupIds:t=[]})=>{for(const e of t)if(this.values.every(t=>t.groupId!==e))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${e}).`)};for(const e of t.props)switch(e.type){case"key":this.keys.push(y(m({},e),{index:this.keys.length,missing:new Map}));break;case"value":if(null==e.property)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(e)}`);this.values.push(y(m({},e),{index:this.values.length,missing:new Map}));break;case"aggregate":s(e),this.aggregates.push(y(m({},e),{index:this.aggregates.length}));break;case"group-value-processor":s(e),this.groupProcessors.push(y(m({},e),{index:this.groupProcessors.length}));break;case"property-value-processor":this.propertyProcessors.push(y(m({},e),{index:this.propertyProcessors.length}));break;case"reducer":this.reducers.push(y(m({},e),{index:this.reducers.length}));break;case"processor":this.processors.push(y(m({},e),{index:this.processors.length}))}}resolveProcessedDataDefById(t,e){var i;const s=null==(i=this.scopeCache.get(t.id))?void 0:i.get(e);if(!s)throw new Error(`AG Charts - didn't find property definition for [${e}, ${t.id}]`);return{index:s.index,def:s}}resolveProcessedDataIndexById(t,e){return this.resolveProcessedDataDefById(t,e).index}resolveProcessedDataDefsByIds(t,e){return e.map(e=>[e,this.resolveProcessedDataDefById(t,e)])}resolveProcessedDataDefsValues(t,{keys:e,values:i}){const s={};for(const[n,{index:a,def:o}]of t){const t="key"===o.type?e:i;s[n]=t[a]}return s}getDomain(t,e,i="value",s){var n;const a=this.getDomainsByType(i,s);return null!=(n=null==a?void 0:a[this.resolveProcessedDataIndexById(t,e)])?n:[]}getDomainsByType(t,e){switch(t){case"key":return e.domain.keys;case"value":return e.domain.values;case"aggregate":return e.domain.aggValues;case"group-value-processor":return e.domain.groups;default:return null}}processData(t,e){var i;const{opts:{groupByKeys:s,groupByFn:n},aggregates:a,groupProcessors:o,reducers:r,processors:l,propertyProcessors:h}=this,c=performance.now();if(s&&0===this.keys.length)return;let d=this.extractData(t,e);if(s?d=this.groupData(d):n&&(d=this.groupData(d,n(d))),o.length>0&&this.postProcessGroups(d),a.length>0&&this.aggregateData(d),h.length>0&&this.postProcessProperties(d),r.length>0&&this.reduceData(d),l.length>0&&this.postProcessData(d),t.length>0)for(const e of N(this.keys,this.values))for(const[i,s]of e.missing)if(s>=t.length){const t=null==i?"":` for ${i}`;R.warnOnce(`the key '${e.property}' was not found in any data element${t}.`)}const u=performance.now();d.time=u-c,this.debug.check()&&function(t){var e,i;const s=(t,e)=>{e.length>0&&(R.log(`DataModel.processData() - ${t}`),R.table(e))};R.log("DataModel.processData() - processedData",t),s("Key Domains",t.domain.keys),s("Group Domains",null!=(e=t.domain.groups)?e:[]),s("Value Domains",t.domain.values),s("Aggregate Domains",null!=(i=t.domain.aggValues)?i:[]),"grouped"===t.type?s("Values",t.data.reduce((t,e)=>{var i,s;const n=null!=(i=e.keys)?i:[],a=null!=(s=e.aggValues)?s:[],o=e.keys.map(()=>{}),r=null==a?void 0:a.map(()=>{});return t.push(...e.values.map((t,e)=>[...0===e?n:o,...null!=t?t:[],...0==e?a:r])),t},[])):s("Values",t.data.reduce((t,e)=>{var i;const s=null!=(i=e.aggValues)?i:[];return t.push([...e.keys,...e.values,...s]),t},[]))}(d),this.scopeCache.clear();for(const t of N(this.keys,this.values,this.aggregates))if(t.idsMap)for(const[e,s]of t.idsMap)for(const n of s)if(this.scopeCache.has(e)){if(null==(i=this.scopeCache.get(e))?void 0:i.has(n))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(e).set(n,t)}else this.scopeCache.set(e,new Map([[n,t]]));return d}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=null==t||0===t.length,s="string"==typeof e?e:e.id,n=this.values.findIndex(e=>(null==e.scopes||i&&!e.scopes.length||e.scopes.some(e=>null==t?void 0:t.includes(e)))&&(e.property===s||e.id===s||(e=>{if(e.idsMap)for(const[i,n]of e.idsMap)if((null==t?void 0:t.includes(i))&&n.has(s))return!0;return!1})(e)));if(-1===n)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(e)} in scope(s) ${JSON.stringify(t)}`);return n}extractData(t,e){var i,s,n;const{dataDomain:a,processValue:o,scopes:r,allScopesHaveSameDefs:l}=this.initDataDomainProcessor(),h=new Map(null==e?void 0:e.map(t=>[t.id,t])),{keys:c,values:d}=this,u=new Array(t.length);let p=0,g=0;for(const[e,a]of t.entries()){const t={},y=r.size>0?new Set(r):void 0,f=new Array(c.length);let x,b=0;for(const t of c){if(x=o(t,a,x),x===Xh)break;f&&(f[b++]=x)}if(x===Xh)continue;const v=d.length>0?new Array(d.length):void 0;let S;for(const[c,u]of d.entries()){for(const n of null!=(i=u.scopes)?i:r){const i=h.get(n);if(S=o(u,null!=(s=null==i?void 0:i.data[e])?s:a,S,n),S!==Xh&&v){if(null!=i&&!1!==u.includeProperty){const e=u.includeProperty&&null!=u.id?u.id:u.property;null!=t[n]||(t[n]={}),t[n][e]=S}v[c]=S}}if(S===Xh){if(l)break;for(const t of null!=(n=u.scopes)?n:r)null==y||y.delete(t);if(0===(null==y?void 0:y.size))break}}if(S===Xh&&l)continue;if(0===(null==y?void 0:y.size))continue;const M={datum:m(m({},a),t),keys:f,values:v};!l&&y&&y.size<r.size&&(g++,M.validScopes=new Set(y)),u[p++]=M}u.length=p;const y=t=>{const e=a.get(t),i=e.getDomain();return Kh.is(e)&&i[0]>i[1]?[]:i};return{type:"ungrouped",input:{count:t.length},data:u,domain:{keys:c.map(y),values:d.map(y)},defs:{allScopesHaveSameDefs:l,keys:c,values:d},partialValidDataCount:g,time:0}}groupData(t,e){var i;const s=new Map;for(const n of t.data){const{keys:t,values:a,datum:o,validScopes:r}=n,l=null!=(i=null==e?void 0:e(n))?i:t,h=Yh(l);if(s.has(h)){const t=s.get(h);if(t.values.push(a),t.datum.push(o),null!=r&&null!=t.validScopes)for(const e of t.validScopes)r.has(e)||t.validScopes.delete(e)}else s.set(h,{keys:l,values:[a],datum:[o],validScopes:r})}const n=new Array(s.size),a=new Array(s.size);let o=0;for(const{keys:t,values:e,datum:i,validScopes:r}of s.values())0!==(null==r?void 0:r.size)&&(a[o]=t,n[o++]={keys:t,values:e,datum:i,validScopes:r});return y(m({},t),{type:"grouped",data:n,domain:y(m({},t.domain),{groups:a})})}aggregateData(t){var e,i,s,n,a,o;const r="ungrouped"===t.type;t.domain.aggValues=[];for(const[l,h]of this.aggregates.entries()){const c=this.valueGroupIdxLookup(h),d=[1/0,-1/0];for(const u of t.data){if(null!=u.aggValues||(u.aggValues=new Array(this.aggregates.length)),u.validScopes)continue;const t=r?[u.values]:u.values;let p=null!=(i=null==(e=h.groupAggregateFunction)?void 0:e.call(h))?i:[1/0,-1/0];for(const e of t){const t=c.map(t=>e[t]),i=h.aggregateFunction(t,u.keys);i&&(p=null!=(n=null==(s=h.groupAggregateFunction)?void 0:s.call(h,i,p))?n:Kh.extendDomain(i,p))}const g=(null!=(o=null==(a=h.finalFunction)?void 0:a.call(h,p))?o:p).map(t=>$h(t));u.aggValues[l]=g,Kh.extendDomain(g,d)}t.domain.aggValues.push(d)}}postProcessGroups(t){var e,i;const{groupProcessors:s}=this,n=new Set,a=new Map,o=new Map,r=new Map;for(const t of s){const e=this.valueGroupIdxLookup(t);o.set(t,e),r.set(t,t.adjust());for(const t of e){const e="category"===this.values[t].valueType;n.add(t),a.set(t,e?new Vh:new Kh)}}const l=t=>{var e;for(const i of n)null==(e=a.get(i))||e.extend(t[i])};for(const n of t.data){for(const a of s){if(n.validScopes)continue;const s=null!=(e=o.get(a))?e:[],l=null==(i=r.get(a))?void 0:i();if(l)if("grouped"===t.type)for(const t of n.values)t&&l(t,s);else n.values&&l(n.values,s)}if("grouped"===t.type)for(const t of n.values)l(t);else l(n.values)}for(const[e,i]of a)t.domain.values[e]=i.getDomain()}postProcessProperties(t){for(const{adjust:e,property:i,scopes:s}of this.propertyProcessors)e()(t,this.valueIdxLookup(s,i))}reduceData(t){var e;null!=t.reduced||(t.reduced={});for(const i of this.reducers){const s=i.reducer();let n=i.initialValue;for(const a of t.data)a.validScopes&&!(null==(e=i.scopes)?void 0:e.some(t=>{var e;return null==(e=a.validScopes)?void 0:e.has(t)}))||(n=s(n,a));t.reduced[i.property]=n}}postProcessData(t){null!=t.reduced||(t.reduced={});for(const e of this.processors)t.reduced[e.property]=e.calculate(t)}initDataDomainProcessor(){const{keys:t,values:e}=this,i=new Set;for(const t of e)if(t.scopes)for(const e of t.scopes)i.add(e);const s=new Map,n=new Map;let a=!0;const o=()=>{var n;for(const o of N(t,e))"category"===o.valueType?s.set(o,new Vh):(s.set(o,new Kh),a&&(a=(null!=(n=o.scopes)?n:[]).length===i.size))};o();const r=this.buildAccessors(N(t,e));return{dataDomain:s,processValue:(t,e,i,a)=>{var l,h,c,d,u;let p,g;if(r.has(t.property)){try{g=r.get(t.property)(e)}catch(t){}p=null!=g}else p=t.property in e,g=p?e[t.property]:t.missingValue;if(null!=t.forceValue&&(g=p&&Ks(g)?-1*t.forceValue:t.forceValue,p=!0),!p&&!("missingValue"in t)){const e=null!=(l=t.missing.get(a))?l:0;t.missing.set(a,e+1)}if(s.has(t)||o(),p&&null!=(c=null==(h=t.validation)?void 0:h.call(t,g,e))&&!c){if(!("invalidValue"in t))return"integrated"!==this.mode&&R.warnOnce(`invalid value of type [${typeof g}] ignored:`,`[${g}]`),Xh;g=t.invalidValue}return t.processor&&(n.has(t)||n.set(t,t.processor()),g=null==(d=n.get(t))?void 0:d(g,i===Xh?void 0:i)),null==(u=s.get(t))||u.extend(g),g},initDataDomain:o,scopes:i,allScopesHaveSameDefs:a}}buildAccessors(t){const e=new Map;if("integrated"===this.mode)return e;for(const i of t){if(!i.property.includes(".")&&!i.property.includes("["))continue;let t;t=i.property.startsWith("[")?`return datum${i.property};`:`return datum.${i.property};`,e.set(i.property,new Function("datum",t))}return e}},qh=class t{constructor(t){this.mode=t,this.debug=Cs.create(!0,"data-model"),this.requested=[],this.status="setup"}request(t,e,i){return S(this,null,function*(){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");return new Promise((s,n)=>{this.requested.push({id:t,opts:i,data:e,resolve:s,reject:n})})})}execute(){if("setup"!==this.status)throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const t=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",t);const e=this.mergeRequested(t);this.debug("DataController.execute() - merged",e),this.debug.check()&&(vs().processedData=[]);const i=this.requested.map(({id:t})=>t),s=this.hasMultipleDataSources(t);for(const{opts:n,data:a,resolves:o,rejects:r,ids:l}of e)try{const e=new Zh(n,this.mode),h=e.processData(a,t);this.debug.check()&&vs("processedData").push(h),0===(null==h?void 0:h.partialValidDataCount)?o.forEach((t,n)=>t({dataModel:e,processedData:this.processScopedData(l[n],h,i,s)})):h?this.splitResult(e,h,l,o):r.forEach(t=>t(new Error("AG Charts - no processed data generated")))}catch(t){r.forEach(e=>e(t))}}hasMultipleDataSources(t){if(t.length){const[{data:e},...i]=t;return i.some(t=>e!==t.data)}return!1}processScopedData(t,e,i,s){const n=e=>{if(Array.isArray(e))return e.map(n);const a=s?m(m({},e),e[t]):e;for(const t of i)delete a[t];return a},a=e=>{var i;return Array.isArray(e)?e.map(a):null!=(i=null==e?void 0:e[t])?i:e};return y(m({},e),{data:e.data.map(t=>{var e;return y(m({},t),{datum:n(t.datum),values:s?null==(e=t.values)?void 0:e.map(a):t.values})})})}validateRequests(t){const e=[];for(const[i,s]of t.entries())i>0&&s.data.length!==t[0].data.length&&!1===s.opts.groupByData?s.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):e.push(s);return e}mergeRequested(e){const i=[];for(const s of e){const e=i.find(t.groupMatch(s));e?e.push(s):i.push([s])}return i.map(t.mergeRequests)}splitResult(t,e,i,s){for(let n=0;n<i.length;n++){const a=i[n];(0,s[n])({dataModel:t,processedData:y(m({},e),{data:e.data.filter(({validScopes:t})=>{var e;return null==(e=null==t?void 0:t.has(a))||e})})})}}static groupMatch({data:t,opts:e}){function i(t){return t.filter(t=>"key"===t.type).map(t=>t.property).join(";")}return([s])=>(!1===e.groupByData||s.data===t)&&s.opts.groupByKeys===e.groupByKeys&&s.opts.groupByFn===e.groupByFn&&i(s.opts.props)===i(e.props)}static mergeRequests(e){return e.reduce((e,i)=>{var s,n,{id:a,data:o,resolve:r,reject:l,opts:h}=i,c=h,{props:d}=c,u=f(c,["props"]);e.ids.push(a),e.rejects.push(l),e.resolves.push(r),null!=e.data||(e.data=o),null!=e.opts||(e.opts=y(m({},u),{props:[]}));for(const i of d){const o=y(m({},i),{scopes:[a]});t.createIdsMap(a,o);const r=e.opts.props.find(e=>e.type===o.type&&t.deepEqual(e,o));r?(null!=r.scopes||(r.scopes=[]),r.scopes.push(...null!=(s=o.scopes)?s:[]),"key"!==r.type&&"value"!==r.type||!(null==(n=o.idsMap)?void 0:n.size)||t.mergeIdsMap(o.idsMap,r.idsMap)):e.opts.props.push(o)}return e},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(t,e){for(const[i,s]of t)if(e.has(i))for(const t of s)e.get(i).add(t);else e.set(i,new Set(s))}static createIdsMap(t,e){null!=e.id&&(null!=e.idsMap||(e.idsMap=new Map),e.idsMap.has(t)?e.idsMap.get(t).add(e.id):e.idsMap.set(t,new Set([e.id])))}static deepEqual(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){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(!t.deepEqual(e[s],i[s]))return!1;return!0}const a=Object.keys(e);if(n=a.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const n=a[s];if(!(t.skipKeys.has(n)||Object.hasOwn(i,n)&&t.deepEqual(e[n],i[n])))return!1}return!0}return!1}};qh.skipKeys=new Set(["id","idsMap","type","scopes"]);var Qh=qh,Jh=class t extends nh{constructor(t){super(),this.chart=t}subscribe(e=t.DEFAULT_GROUP){let i=this.get(e);return i||(i=new Set,t.chartsGroups.set(e,i)),i.add(this.chart),this}unsubscribe(e=t.DEFAULT_GROUP){var i;return null==(i=this.get(e))||i.delete(this.chart),this}getChart(){return this.chart}getGroup(e=t.DEFAULT_GROUP){const i=this.get(e);return i?Array.from(i):[]}getGroupSiblings(e=t.DEFAULT_GROUP){return this.getGroup(e).filter(t=>t!==this.chart)}get(e){return t.chartsGroups.get(e)}};Jh.chartsGroups=new Map,Jh.DEFAULT_GROUP=Symbol("sync-group-default");var tc=Jh,ec=class extends nh{constructor(){super(...arguments),this.axisZoomManagers=new Map,this.state=new vh(void 0,"initial"),this.rejectCallbacks=new Map}updateAxes(t){var e;const i=new Map(t.map(t=>[t.id,this.axisZoomManagers.get(t.id)]));this.axisZoomManagers.clear();for(const s of t)this.axisZoomManagers.set(s.id,null!=(e=i.get(s.id))?e:new ic(s));this.state.size>0&&t.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}updateZoom(t,e,i=!0,s){var n;if(s&&this.rejectCallbacks.set(t,s),0===this.axisZoomManagers.size){const a=this.state.stateId();return void("initial"===a||a===t||i?(this.state.set(t,e),a!==t&&(null==(n=this.rejectCallbacks.get(a))||n(t))):null==s||s(a))}this.state.set(t,e),this.axisZoomManagers.forEach(i=>{i.updateZoom(t,null==e?void 0:e[i.getDirection()])}),this.applyChanges(t)}updateAxisZoom(t,e,i){var s;null==(s=this.axisZoomManagers.get(e))||s.updateZoom(t,i),this.applyChanges(t)}fireZoomPanStartEvent(t){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:t})}getZoom(){let t,e;if(this.axisZoomManagers.forEach(i=>{"x"===i.getDirection()?null!=t||(t=i.getZoom()):"y"===i.getDirection()&&(null!=e||(e=i.getZoom()))}),t||e)return{x:t,y:e}}getAxisZoom(t){var e,i;return null!=(i=null==(e=this.axisZoomManagers.get(t))?void 0:e.getZoom())?i:{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}applyChanges(t){if(!Array.from(this.axisZoomManagers.values(),t=>t.applyChanges()).some(Boolean))return;const e={};for(const[t,i]of this.axisZoomManagers.entries())e[t]=i.getZoom();this.listeners.dispatch("zoom-change",y(m({type:"zoom-change"},this.getZoom()),{axes:e,callerId:t}))}},ic=class{constructor(t){this.axis=t;const[e=0,i=1]=t.visibleRange;this.state=new vh({min:e,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(t,e){this.state.set(t,e)}getZoom(){return Se(this.state.stateValue())}applyChanges(){const t=this.currentZoom;return this.currentZoom=this.state.stateValue(),t.min!==this.currentZoom.min||t.max!==this.currentZoom.max}},sc=class extends ye{constructor(){super(...arguments),this.enabled=!1}};function nc(t,e){const{bbox:i,showFocusBox:s}=e;if(s&&t.updateFocusIndicatorRect(e.bbox),void 0!==i){const{x:t,y:e}=i.computeCenter();return{type:"keyboard",offsetX:t,offsetY:e}}}b([Yn(qn)],sc.prototype,"enabled",2),b([Yn(ta)],sc.prototype,"tabIndex",2);var ac=["top","right","bottom","left"],oc=["category","grouped-category","ordinal-time","number","log","time"],rc=class{constructor(){this.result=[],this.valid=[],this.invalid=[]}push(t,e){const{result:i,valid:s,invalid:n}=this;var a;(function(t){return oc.includes(t.type)})(e)&&("string"==typeof(a=e.position)&&ac.includes(a)?s.push(t):n.push(t)),i.push(t)}guessInvalidPositions(){const t=this.valid.filter(t=>oc.includes(t.type)).map(t=>t.position).filter(t=>void 0!==t),e=["top","right","bottom","left"];for(const i of this.invalid){let s=e.pop();for(;t.includes(s)&&void 0!==s;)s=e.pop();if(void 0===s)break;i.position=s}return this.result}},lc=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo","stacked","grouped","stackGroup"],hc=class extends ur{applyOptions(t){for(const e of this.moduleMap.values())e.module.optionsKey in t&&xe(e.moduleInstance)&&e.moduleInstance.set(t[e.module.optionsKey])}*legends(){for(const{module:t,moduleInstance:e}of this.moduleMap.values())"legend"===t.type&&(yield{legendType:t.identifier,legend:e})}},cc="ag-chart-overlay",dc="ag-chart-dark-overlay",uc=class extends ye{constructor(t,e){super(),this.className=t,this.defaultText=e,this.darkTheme=!1}getText(){var t;return null!=(t=this.text)?t:this.defaultText}getElement(t,e){null!=this.element||(this.element=Ss("div",cc,{position:"absolute"})),this.element.classList.toggle(dc,this.darkTheme),this.focusBox=e;const i=this.element;if(i.style.left=`${e.x}px`,i.style.top=`${e.y}px`,i.style.width=`${e.width}px`,i.style.height=`${e.height}px`,this.renderer){const t=this.renderer();t instanceof HTMLElement?i.replaceChildren(t):i.innerHTML=t}else{const e=Ss("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",font:"12px Verdana, sans-serif"});e.innerText=this.getText(),i.replaceChildren(e),null==t||t.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(t){i.style.opacity=String(t)},onStop(){i.style.opacity="1"}})}return this.element}removeElement(t){if(this.element){if(t){const{element:e}=this;t.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(t){e.style.opacity=String(t)},onStop(){e.remove()}})}else this.element.remove();this.element=void 0,this.focusBox=void 0}}};b([Yn(Jn,{optional:!0})],uc.prototype,"text",2),b([Yn(Qn,{optional:!0})],uc.prototype,"renderer",2),b([Yn(qn)],uc.prototype,"darkTheme",2);var pc=class extends ye{constructor(){super(...arguments),this.loading=new uc("ag-chart-loading-overlay","Loading data..."),this.noData=new uc("ag-chart-no-data-overlay","No data to display"),this.noVisibleSeries=new uc("ag-chart-no-visible-series","No visible series")}getFocusInfo(){for(const t of[this.loading,this.noData,this.noVisibleSeries])if(void 0!==t.focusBox)return{text:t.getText(),rect:t.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement()}};b([Yn(Xn)],pc.prototype,"loading",2),b([Yn(Xn)],pc.prototype,"noData",2),b([Yn(Xn)],pc.prototype,"noVisibleSeries",2);var gc=`\n.${cc} {\n    color: #181d1f;\n}\n\n.${cc}.${dc} {\n    color: #ffffff;\n}\n\n.${cc}--loading {\n    color: rgb(140, 140, 140); /* DEFAULT_MUTED_LABEL_COLOUR */\n}\n\n.${cc}__loading-background {\n    background: white; /* DEFAULT_BACKGROUND_FILL */\n}\n\n.${cc}.${dc} .${cc}__loading-background {\n    background: #192232; /* DEFAULT_DARK_BACKGROUND_FILL */\n}\n`;function mc(t,e=[0,0]){for(const i of t)"number"==typeof i&&(i<0&&(e[0]+=i),i>0&&(e[1]+=i));return e}function yc(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:t=>mc(t)}}function fc(t,e){return{id:t,type:"aggregate",matchGroupIds:e?[e]:void 0,aggregateFunction:t=>mc(t),groupAggregateFunction:(t,e=[0,0])=>{var i,s;return e[0]+=null!=(i=null==t?void 0:t[0])?i:0,e[1]+=null!=(s=null==t?void 0:t[1])?s:0,e}}}function xc(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:t=>Kh.extendDomain(t)}}function bc(t){return{id:t,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(t,e=[0,0])=>{var i,s;return e[0]+=null!=(i=null==t?void 0:t[0])?i:0,e[1]+=null!=(s=null==t?void 0:t[1])?s:0,e}}}function vc(t,e){return{id:t,matchGroupIds:e?[e]:void 0,type:"aggregate",aggregateFunction:t=>mc(t),groupAggregateFunction:(t,e=[0,0,-1])=>{var i,s;return e[0]+=null!=(i=null==t?void 0:t[0])?i:0,e[1]+=null!=(s=null==t?void 0:t[1])?s:0,e[2]++,e},finalFunction:(t=[0,0,0])=>{const e=t[0]+t[1];return e>=0?[0,e/t[2]]:[e/t[2],0]}}}function Sc(t,e,i){const s={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(t,i=[])=>{const s=i[1]-i[0];return e.aggregateFunction(t).map(t=>t/s)}};return e.groupAggregateFunction&&(s.groupAggregateFunction=e.groupAggregateFunction),s}function Mc(t){return()=>{let e=0;return i=>Wt(i)?(e+=t?Math.max(0,i):i,e):i}}function kc(){return()=>{let t=0;return e=>{if(!Wt(e))return e;const i=t;return t+=e,i}}}var Dc={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let t=NaN;return(e=1/0,i)=>{const s=i.keys[0],n=Math.abs(s-t);return t=s,!isNaN(n)&&n>0&&n<e?n:e}}},wc={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:t}})=>null==t?void 0:t.slice().sort((t,e)=>{for(let i=0;i<t.length;i++){const s=t[i]-e[i];if(0!==s)return s}return 0})};function Ic({normaliseTo:t,mode:e}){const i=(e,i)=>{const s=e*t/i;return s>=0?Math.min(t,s):Math.max(-t,s)};return()=>()=>(t,s)=>{const n=[0,0];for(const i of s){const s=t[i],a=s<0?0:1;"sum"===e?n[a]+=s:n[a]=0===a?Math.min(n[a],s):Math.max(n[a],s)}const a=Math.max(Math.abs(n[0]),n[1]);for(const e of s)t[e]=i(t[e],a)}}function Cc(t,e,i="sum"){return{type:"group-value-processor",matchGroupIds:t,adjust:No({normaliseTo:e,mode:i},Ic)}}function Lc({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:s}){const n=t[1]-t[0],a=(i,s,a)=>{const o=t[0]+(i-s)/a*n;return 0===a?e:o>=t[1]?t[1]:o<t[0]?t[0]:o};return()=>(e,n)=>{let[o,r]=e.domain.values[n];null!=i&&(o=i),null!=s&&(r=s);const l=r-o;e.domain.values[n]=[t[0],t[1]];for(const t of e.data){let i=t.values;"ungrouped"===e.type&&(i=[i]);for(const t of i)t[n]=a(t[n],o,l)}}}function Ac(t,e,i,s,n){return{type:"property-value-processor",property:t,adjust:No({normaliseTo:e,rangeMin:s,rangeMax:n,zeroDomain:i},Lc)}}function Tc(t){return{type:"processor",property:"animationValidation",calculate(e){const{keys:i,values:s}=e.defs,{input:n,data:a}=e;let o=!0,r=!0;const l=[];for(let e=0;e<s.length;e++)(null==t?void 0:t.includes(s[e].id))&&l.push([e,s[e]]);const h=(t,i,s)=>{var l;if("category"===i.valueType){const i=e.domain[s][t];return void(o&&(o=i.length===n.count))}let h=null==(l=a[0])?void 0:l[s][t];for(let e=1;(o||r)&&e<a.length;e++){const i=a[e][s][t];r&&(r=h<=i),o&&(o=h!==i),h=i}};for(let t=0;(o||r)&&t<i.length;t++)h(t,i[t],"keys");for(let t=0;(o||r)&&t<l.length;t++){const[e,i]=l[t];h(e,i,"values")}return{uniqueKeys:o,orderedKeys:r}}}}function Nc({mode:t,separateNegative:e}){return()=>()=>(i,s)=>{const n=[0,0];for(const a of s){const s=i[a],o=Ks(s)&&e?0:1;Wt(s)&&("normal"===t&&(n[o]+=s),i[a]=n[o],"trailing"===t&&(n[o]+=s))}}}function Oc({mode:t,sum:e}){return()=>{const i=[];let s=!0;return()=>(n,a)=>{let o=0;for(const r of a){const a=n[r],l=s&&"current"===e?0:i[r];i[r]=a;const h="current"===e?a:l;Wt(a)&&Wt(l)?("normal"===t&&(o+=h),n[r]=o,"trailing"===t&&(o+=h)):n[r]=o}s=!1}}}function Rc(t,e,i,s=!1){let n;return n=e.startsWith("window")?No({mode:e.endsWith("-trailing")?"trailing":"normal",sum:i},Oc):No({mode:e,separateNegative:s},Nc),{type:"group-value-processor",matchGroupIds:[t],adjust:n}}function Ec(t,e=!0){return{type:"processor",property:"diff",calculate:i=>{const s=new Map,n=new Map,a=new Map,o=new Map,r=Math.max(t.data.length,i.data.length);for(let l=0;l<r;l++){const r=t.data[l],h=i.data[l],c=r?Pc(r.keys):"",d=h?Pc(h.keys):"";h&&r&&c===d?hs(r.values,h.values)||a.set(d,h):(o.has(d)?(!e&&hs(o.get(d).values,h.values)||(a.set(d,h),s.set(d,h)),o.delete(d)):h&&n.set(d,h),n.has(c)?(!e&&hs(n.get(c).values,r.values)||(a.set(c,r),s.set(c,r)),n.delete(c)):r&&(a.delete(c),o.set(c,r)))}return{changed:n.size>0||a.size>0||o.size>0,added:n,updated:a,removed:o,moved:s}}}}function Pc(t,...e){let i;return i=Nt(t)?t.map(t=>Ho(t)).join("___"):Ho(t),("string"==typeof i||"number"==typeof i||i instanceof Date)&&e.length>0&&(i+=`___${e.join("___")}`),i}var Bc=(t=>(t[t.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",t[t.NEAREST_BY_MAIN_AXIS_FIRST=1]="NEAREST_BY_MAIN_AXIS_FIRST",t[t.NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST=2]="NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST",t[t.NEAREST_NODE=3]="NEAREST_NODE",t))(Bc||{});function Fc(t){return null!=t&&Yo(t)}function zc(t){return null!=t}function Gc(t){switch(t){case"number":case"log":case"ordinal-time":case"time":case"color":return Fc;default:return zc}}function _c(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function jc(t,e,i={}){return m({property:t,type:"key",valueType:_c(e),validation:Gc(e)},i)}function Wc(t,e,i={}){return m({property:t,type:"value",valueType:_c(e),validation:Gc(e)},i)}function Vc(t,e={}){const i=e,{min:s=-1/0,max:n=1/0}=i,a=f(i,["min","max"]);return m({type:"value",property:t,valueType:"range",validation:Fc,processor:()=>t=>Wt(t)?Gs(s,t,n):t},a)}function Kc(t,e,i={}){const s=i,{onlyPositive:n}=s,a=f(s,["onlyPositive"]);return y(m({},Wc(t,e,a)),{processor:Mc(n)})}function Yc(t,e,i={}){return y(m({},Wc(t,e,i)),{processor:kc()})}function $c(t,e,i="current",s,n){return[Wc(t,n,s),Rc(s.groupId,e,i,s.separateNegative),...null!=s.rangeId?[xc(s.rangeId,s.groupId)]:[]]}var Hc=class{constructor(t,e,{datum:i},s){this.type=t,this.event=e,this.datum=i,this.seriesId=s.id}},Uc=class{constructor(t,e,i){this.series=t,this.seriesGrouping=e,this.oldGrouping=i,this.type="groupingChanged"}},Xc=class extends Xl{constructor(t){super(),this.destroyFns=[],this.seriesGrouping=void 0,this.NodeEvent=Hc,this.internalId=Bs(this),this.rootGroup=new Mo({name:"seriesRoot",isVirtual:!0}),this.axes={x:void 0,y:void 0},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new ur,this._declarationOrder=-1,this.seriesListeners=new eh;const{moduleCtx:e,pickModes:i=[1],directionKeys:s={},directionNames:n={},contentGroupVirtual:a=!0,canHaveAxes:o=!1}=t;this.ctx=e,this.directionKeys=s,this.directionNames=n,this.canHaveAxes=o,this.contentGroup=this.rootGroup.appendChild(new Mo({name:`${this.internalId}-content`,isVirtual:a,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("data")})),this.highlightGroup=new Mo({name:`${this.internalId}-highlight`,isVirtual:a,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("highlight")}),this.highlightNode=this.highlightGroup.appendChild(new Mo({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new Mo({name:"highlightLabel",zIndex:10})),this.pickModes=i,this.labelGroup=this.rootGroup.appendChild(new Mo({name:`${this.internalId}-series-labels`,zIndex:8})),this.annotationGroup=new Mo({name:`${this.id}-annotation`,isVirtual:a,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("annotation")})}get id(){var t,e;return null!=(e=null==(t=this.properties)?void 0:t.id)?e:this.internalId}get type(){var t;return null!=(t=this.constructor.type)?t:""}get data(){var t;return null!=(t=this._data)?t:this._chartData}set visible(t){this.properties.visible=t,this.visibleChanged()}get visible(){return this.properties.visible}get hasData(){return null!=this.data&&this.data.length>0}get tooltipEnabled(){var t,e;return null!=(e=null==(t=this.properties.tooltip)?void 0:t.enabled)&&e}onDataChange(){this.nodeDataRefresh=!0}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({id:i,type:s}),e&&this.ctx.seriesStateManager.registerSeries({id:i,type:s,visible:n,seriesGrouping:e}),this.fireEvent(new Uc(this,e,t))}getBandScalePadding(){return{inner:1,outer:0}}getGroupZIndexSubOrder(t,e=0){let i=0;switch(t){case"data":case"paths":break;case"labels":i+=2e4;break;case"marker":i+=1e4;break;case"highlight":e+=15e3;break;case"annotation":i+=15e3}return[()=>this._declarationOrder+i,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.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(t,e){const i=this.resolveKeyDirection(t),s=null==e?void 0:e[i],n=[];if(!s)return n;const a=(...t)=>{for(const e of t)Array.isArray(e)?a(...e):"object"==typeof e?a(...Object.values(e)):n.push(e)};return a(...s.map(t=>this.properties[t])),n}getKeys(t){return this.getDirectionValues(t,this.directionKeys)}getKeyProperties(t){var e;return null!=(e=this.directionKeys[this.resolveKeyDirection(t)])?e:[]}getNames(t){return this.getDirectionValues(t,this.directionNames)}resolveKeyDirection(t){return t}getDomain(t){const e=this.getSeriesDomain(t),i=this.moduleMap.mapModules(e=>e.getDomain(t));return e.concat(i.flat())}markNodeDataDirty(){this.nodeDataRefresh=!0}visibleChanged(){this.ctx.seriesStateManager.registerSeries(this)}getOpacity(){const{dimOpacity:t=1,enabled:e=!0}=this.properties.highlightStyle.series;if(!e||1===t)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;default:return t}}getStrokeWidth(t){const{strokeWidth:e,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||void 0===e)return t;switch(this.isItemIdHighlighted()){case 1:return e;case 0:case 2:return t}}isItemIdHighlighted(){var t,e;const i=null==(e=null==(t=this.ctx.highlightManager)?void 0:t.getActiveHighlight())?void 0:e.series;return null==i?0:i!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(t=>t.getTooltipParams()).reduce((t,e)=>Object.assign(t,e),{})}pickNode(t,e){const{pickModes:i,visible:s,rootGroup:n}=this;if(s&&n.visible)for(const s of i){if(e&&!e.includes(s))continue;let i;switch(s){case 0:i=this.pickNodeExactShape(t);break;case 1:case 2:i=this.pickNodeMainAxisFirst(t,2===s);break;case 3:i=this.pickNodeClosestDatum(t)}if(i)return{pickMode:s,match:i.datum,distance:i.distance}}}pickNodeExactShape(t){const e=this.contentGroup.pickNode(t.x,t.y);if(e&&!0!==e.datum.missing)return{datum:e.datum,distance:0}}pickNodeClosestDatum(t){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(t,e){const i=Xs(t.x,t.y,e);if(void 0!==i.nearest&&!0!==i.nearest.datum.missing)return{datum:i.nearest.datum,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(t,e){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}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)}toggleSeriesItem(t,e){this.visible=e,this.nodeDataRefresh=!0,this.dispatch("visibility-changed",{itemId:t,enabled:e})}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return y(m({},this.ctx),{series:this})}getLabelText(t,e,i=String){var s;return t.formatter&&null!=(s=this.ctx.callbackCache.call(t.formatter,m({seriesId:this.id},e)))?s:i(e.value)}getMarkerStyle(t,e,i=t.getStyle()){var s,n;const a=Ut({size:null!=(n=null==(s=e.datum.point)?void 0:s.size)?n:0},i);return t.formatter?Ut(this.ctx.callbackCache.call(t.formatter,y(m(m({seriesId:this.id},a),e),{datum:e.datum.datum})),a):a}updateMarkerStyle(t,e,i,s=e.getStyle(),{applyTranslation:n=!0}={}){const{point:a}=i.datum,o=this.getMarkerStyle(e,i,s),r=this.visible&&o.size>0&&a&&!isNaN(a.x)&&!isNaN(a.y);n?t.setProperties(y(m({visible:r},o),{translationX:null==a?void 0:a.x,translationY:null==a?void 0:a.y})):t.setProperties(m({visible:r},o)),"function"!=typeof e.shape||t.dirtyPath||(t.path.clear(!0),t.updatePath(),t.checkPathDirty())}getMinRects(t,e){}get nodeDataDependencies(){var t;return null!=(t=this._nodeDataDependencies)?t:{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(t){const{width:e,height:i}=null!=t?t:{width:NaN,height:NaN},s=t?{seriesRectWidth:e,seriesRectHeight:i}:void 0,n=null!=ve(this.nodeDataDependencies,s);return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(t){}};Xc.highlightedZIndex=1e12,b([Ur({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],Xc.prototype,"seriesGrouping",2);var Zc=class{constructor(t,e,i){this.seriesRoot=t,this.highlightRoot=e,this.annotationRoot=i,this.groups={},this.series={},this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(t){this.expectedSeriesCount=t}requestGroup(t){var e,i,s;const{internalId:n,type:a,rootGroup:o,highlightGroup:r,annotationGroup:l,seriesGrouping:h}=t,{groupIndex:c=n}=null!=h?h:{};if(null!=this.series[n])throw new Error(`AG Charts - series already has an allocated layer: ${this.series[n]}`);0===Object.keys(this.series).length&&(this.mode=this.expectedSeriesCount>=30?"aggressive-grouping":"normal"),null!=(e=this.groups)[a]||(e[a]={});const d=this.lookupIdx(c);let u=this.groups[a][d];return u||(u=null!=(s=(i=this.groups[a])[d])?s:i[d]={seriesIds:[],group:this.seriesRoot.appendChild(new Mo({name:`${a}-content`,layer:!0,zIndex:4,zIndexSubOrder:t.getGroupZIndexSubOrder("data")})),highlight:this.highlightRoot.appendChild(new Mo({name:`${a}-highlight`,zIndex:4,zIndexSubOrder:t.getGroupZIndexSubOrder("highlight")})),annotation:this.annotationRoot.appendChild(new Mo({name:`${a}-annotation`,zIndex:4,zIndexSubOrder:t.getGroupZIndexSubOrder("annotation")}))}),this.series[n]={layerState:u,seriesConfig:t},u.seriesIds.push(n),u.group.appendChild(o),u.highlight.appendChild(r),u.annotation.appendChild(l),u.group}changeGroup(t){var e,i;const{internalId:s,seriesGrouping:n,type:a,rootGroup:o,highlightGroup:r,annotationGroup:l,oldGrouping:h}=t,{groupIndex:c=s}=null!=n?n:{};(null==(i=null==(e=this.groups[a])?void 0:e[c])?void 0:i.seriesIds.includes(s))||(null!=this.series[s]&&this.releaseGroup({internalId:s,seriesGrouping:h,type:a,rootGroup:o,highlightGroup:r,annotationGroup:l}),this.requestGroup(t))}releaseGroup(t){var e,i,s,n,a;const{internalId:o,seriesGrouping:r,rootGroup:l,highlightGroup:h,annotationGroup:c,type:d}=t,{groupIndex:u=o}=null!=r?r:{};if(null==this.series[o])throw new Error(`AG Charts - series doesn't have an allocated layer: ${o}`);const p=this.lookupIdx(u),g=null!=(s=null==(e=this.groups[d])?void 0:e[p])?s:null==(i=this.series[o])?void 0:i.layerState;if(g&&(g.seriesIds=g.seriesIds.filter(t=>t!==o),g.group.removeChild(l),g.highlight.removeChild(h),g.annotation.removeChild(c)),0===(null==g?void 0:g.seriesIds.length))this.seriesRoot.removeChild(g.group),this.highlightRoot.removeChild(g.highlight),this.annotationRoot.removeChild(g.annotation),delete this.groups[d][p],delete this.groups[d][o];else if((null==g?void 0:g.seriesIds.length)>0){const t=null==(a=this.series[null==(n=null==g?void 0:g.seriesIds)?void 0:n[0]])?void 0:a.seriesConfig;g.group.zIndexSubOrder=null==t?void 0:t.getGroupZIndexSubOrder("data"),g.highlight.zIndexSubOrder=null==t?void 0:t.getGroupZIndexSubOrder("highlight"),g.annotation.zIndexSubOrder=null==t?void 0:t.getGroupZIndexSubOrder("annotation")}delete this.series[o]}lookupIdx(t){return"normal"===this.mode?t:"string"!=typeof t||(t=Number(t.split("-").slice(-1)[0]))?Math.floor(30*Gs(0,t/this.expectedSeriesCount,1)):0}destroy(){for(const t of Object.values(this.groups))for(const e of Object.values(t))this.seriesRoot.removeChild(e.group),this.highlightRoot.removeChild(e.highlight),this.annotationRoot.removeChild(e.annotation);this.groups={},this.series={}}},qc=class{constructor(t,e){this.chartLike=t,this.layoutService=e,this.destroyFns=[],this.destroyFns.push(this.layoutService.addListener("start-layout",t=>this.positionPadding(t.shrinkRect)),this.layoutService.addListener("start-layout",t=>this.positionCaptions(t.shrinkRect)))}destroy(){this.destroyFns.forEach(t=>t())}positionPadding(t){const{padding:e}=this.chartLike;return t.shrink(e.left,"left"),t.shrink(e.top,"top"),t.shrink(e.right,"right"),t.shrink(e.bottom,"bottom"),{shrinkRect:t}}positionCaptions(t){var e,i;const{title:s,subtitle:n,footnote:a}=this.chartLike,o=t.clone(),r=e=>{var i;const s=t.height/10,n=null!=(i=e.lineHeight)?i:e.fontSize*Po.defaultLineHeightRatio,a=t.width,o=Math.max(n,s);e.computeTextWrap(a,o)},l=t=>"left"===t?o.x:"right"===t?o.x+o.width:("center"!==t&&R.error(`invalid textAlign value: ${t}`),o.x+o.width/2),h=(t,e)=>{const i=o.y;t.node.x=l(t.textAlign),t.node.y=i,t.node.textBaseline="top",r(t);const s=t.node.computeBBox(),n=Math.ceil(s.y-i+s.height+e);o.shrink(n,"top")};if(s.node.visible=s.enabled,n.node.visible=n.enabled,a.node.visible=a.enabled,s.enabled){const{spacing:t=(n.enabled?al.SMALL_PADDING:al.LARGE_PADDING)}=s;h(s,t)}return n.enabled&&h(n,null!=(e=n.spacing)?e:0),a.enabled&&((t,e)=>{const i=o.y+o.height;t.node.x=l(t.textAlign),t.node.y=i,t.node.textBaseline="bottom",r(t);const s=t.node.computeBBox(),n=Math.ceil(i-s.y+e);o.shrink(n,"bottom")})(a,null!=(i=a.spacing)?i:0),{shrinkRect:o}}},Qc=class{constructor(t,e,i,s){this.chart=t,this.dataService=e,this.updateService=i,this.zoomManager=s,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.updateService.update(1)}onDataError(){this.updateService.update(3)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(){(this.dirtyZoom||this.dirtyDataSource)&&this.updateWindow().catch(t=>R.errorOnce(t))}onZoomChange(){this.dirtyZoom=!0}updateWindow(){return S(this,null,function*(){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:null==e?void 0:e.min,windowEnd:null==e?void 0:e.max})})}getValidAxis(){return this.chart.axes.find(t=>"time"===t.type)}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||(this.lastAxisZooms.set(t.id,e),0))}getAxisWindow(t,e){var i,s;const n=null==(s=(i=t.scale).getDomain)?void 0:s.call(i);if(!e||!n||0===n.length||isNaN(Number(n[0])))return;const a=Number(n[1])-Number(n[0]);return{min:new Date(Number(n[0])+a*e.min),max:new Date(Number(n[0])+a*e.max)}}},Jc=class{constructor(t,e,i,s,n){this.chartLike=t,this.overlays=e,this.dataService=i,this.layoutService=s,this.animationManager=n,this.destroyFns=[],this.destroyFns.push(this.layoutService.addListener("layout-complete",t=>this.onLayoutComplete(t)))}destroy(){this.destroyFns.forEach(t=>t())}onLayoutComplete({series:{rect:t}}){const e=this.dataService.isLoading(),i=this.chartLike.series.some(t=>t.hasData),s=this.chartLike.series.some(t=>t.visible);this.toggleOverlay(this.overlays.loading,t,e),this.toggleOverlay(this.overlays.noData,t,!e&&!i),this.toggleOverlay(this.overlays.noVisibleSeries,t,i&&!s)}toggleOverlay(t,e,i){if(i){const i=t.getElement(this.animationManager,e);this.chartLike.element.append(i)}else t.removeElement(this.animationManager)}},td=Cs.create(!0,"opts"),ed=class extends ye{constructor(){super(...arguments),this.padding=new Zl(0)}};b([Yn(qn,{optional:!0})],ed.prototype,"clip",2),b([Yn(Xn)],ed.prototype,"padding",2);var id=class t extends Xl{constructor(t,e){var i,s;super(),this.id=Bs(this),this.seriesRoot=new Mo({name:`${this.id}-series-root`}),this.highlightRoot=new Mo({name:`${this.id}-highlight-root`,layer:!0,zIndex:5,nonEmptyChildDerivedZIndex:!0}),this.annotationRoot=new Mo({name:`${this.id}-annotation-root`,layer:!0,zIndex:10}),this.debug=Cs.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this.padding=new Zl(20),this.seriesArea=new ed,this.title=new al,this.subtitle=new al,this.footnote=new al,this.keyboard=new sc,this.mode="standalone",this.destroyed=!1,this._skipSync=!1,this._destroyFns=[],this.chartAnimationPhase="initial",this.modulesManager=new hc,this.zoomManager=new ec,this.processors=[],this.processedOptions={},this.userOptions={},this.queuedUserOptions=[],this._pendingFactoryUpdatesCount=0,this._performUpdateNoRenderCount=0,this._performUpdateSkipAnimations=!1,this.performUpdateType=7,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new Ul,this.updateRequestors={},this.performUpdateTrigger=ql((t,e=0)=>setTimeout(t,e),t=>S(this,[t],function*({count:t}){this.destroyed||this.updateMutex.acquire(()=>S(this,null,function*(){try{yield this.performUpdate(t)}catch(t){R.error("update error",t)}})).catch(t=>R.errorOnce(t))})),this._performUpdateSplits={},this.axes=[],this.series=[],this.focus={hasFocus:!1,series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.pointerScheduler=ql((t,e)=>requestAnimationFrame(t),()=>{this.lastInteractionEvent&&(this.performUpdateType<=4?this.pointerScheduler.schedule():(this.handlePointer(this.lastInteractionEvent,!1),this.lastInteractionEvent=void 0))}),this.onSeriesNodeClick=t=>{const e=y(m({},t),{type:"seriesNodeClick"});Object.defineProperty(e,"series",{enumerable:!1,get:()=>t.series}),this.fireEvent(e)},this.onSeriesNodeDoubleClick=t=>{const e=y(m({},t),{type:"seriesNodeDoubleClick"});this.fireEvent(e)},this.seriesGroupingChanged=t=>{if(!(t instanceof Uc))return;const{series:e,seriesGrouping:i,oldGrouping:s}=t;null!=e.rootGroup.parent&&this.seriesLayerManager.changeGroup({internalId:e.internalId,type:e.type,rootGroup:e.rootGroup,highlightGroup:e.highlightGroup,annotationGroup:e.annotationGroup,getGroupZIndexSubOrder:t=>e.getGroupZIndexSubOrder(t),seriesGrouping:i,oldGrouping:s})},this.dataProcessListeners=new Set,this.chartOptions=t;let n=null==e?void 0:e.scene;const a=null!=(i=null==e?void 0:e.element)?i:Ss("div","ag-chart-wrapper",{position:"relative",userSelect:"none"}),o=null==e?void 0:e.container;this.element=a;const r=new Mo({name:"root"});r.visible=!1,r.append(this.seriesRoot),r.append(this.highlightRoot),r.append(this.annotationRoot),this.axisGridGroup=new Mo({name:"Axes-Grids",layer:!0,zIndex:1}),r.appendChild(this.axisGridGroup),this.axisGroup=new Mo({name:"Axes",layer:!0,zIndex:2}),r.appendChild(this.axisGroup),this.sizeMonitor=new Ql,this.sizeMonitor.observe(this.element,t=>this.rawResize(t));const{overrideDevicePixelRatio:l}=t.specialOverrides;null!=n||(n=new $l({pixelRatio:l,canvasPosition:"absolute"})),n.setRoot(r).setContainer(a),this.autoSize=!0,this.tooltip=new nl,this.seriesLayerManager=new Zc(this.seriesRoot,this.highlightRoot,this.annotationRoot);const h=this.ctx=new jh(this,{scene:n,syncManager:new tc(this),element:a,updateCallback:(t=0,e)=>this.update(t,e),updateMutex:this.updateMutex});this.overlays=new pc,null!=(s=this.overlays.loading).renderer||(s.renderer=()=>function(t,e){const{animationDuration:i}=Dn.add,s=Ss("div",`${cc}--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 ${i*e}ms linear 50ms both`}),n=Ss("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),a=Ss("p",{marginTop:"1em"});a.innerText=t;const o=Ss("div",`${cc}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),r=Ss("style");return r.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),s.replaceChildren(r,n,a,o),ks(gc,"chartOverlays"),s}(this.overlays.loading.getText(),h.animationManager.defaultDuration)),this.processors=[new qc(this,h.layoutService),new Qc(this,h.dataService,h.updateService,h.zoomManager),new Jc(this,this.overlays,h.dataService,h.layoutService,h.animationManager)],this.highlight=new Wh,this.container=o;const{All:c}=uh,d=this.getModuleContext(),u=h.regionManager.addRegion("series",this.seriesRoot,this.axisGroup);h.regionManager.addRegion("root",r),this._destroyFns.push(h.dataService.addListener("data-load",t=>{this.data=t.data}),h.scene.attachNode(this.title.node),h.scene.attachNode(this.subtitle.node),h.scene.attachNode(this.footnote.node),this.title.registerInteraction(d,"title"),this.subtitle.registerInteraction(d,"subtitle"),this.footnote.registerInteraction(d,"footnote"),h.interactionManager.addListener("click",t=>this.onClick(t)),h.interactionManager.addListener("dblclick",t=>this.onDoubleClick(t)),u.addListener("hover",t=>this.onMouseMove(t)),u.addListener("leave",t=>this.onLeave(t)),u.addListener("blur",()=>this.onBlur()),u.addListener("tab",t=>this.onTab(t)),u.addListener("nav-vert",t=>this.onNavVert(t)),u.addListener("nav-hori",t=>this.onNavHori(t)),u.addListener("submit",t=>this.onSubmit(t)),h.keyNavManager.addListener("browserfocus",t=>this.onBrowserFocus(t)),h.interactionManager.addListener("page-left",()=>this.destroy()),h.interactionManager.addListener("contextmenu",t=>this.onContextMenu(t),c),h.animationManager.addListener("animation-start",()=>this.onAnimationStart()),h.animationManager.addListener("animation-frame",()=>{this.update(6)}),h.highlightManager.addListener("highlight-change",t=>this.changeHighlightDatum(t)),h.zoomManager.addListener("zoom-pan-start",()=>this.resetPointer()),h.zoomManager.addListener("zoom-change",()=>{this.resetPointer(),this.series.map(t=>{var e;return null==(e=t.animationState)?void 0:e.transition("updateData")});const t="initial"!==this.chartAnimationPhase;this.update(3,{forceNodeDataRefresh:!0,skipAnimations:t})}))}static getInstance(e){return t.chartsInstances.get(e)}get canvasElement(){return this.ctx.scene.canvas.element}getCanvasDataURL(t){return this.ctx.scene.getDataURL(t)}onAutoSizeChange(t){const{style:e}=this.element;if(t){if(e.display="block",e.width="100%",e.height="100%",!this._lastAutoSize)return;this.resize(void 0,void 0,"autoSize option")}else e.display="inline-block",e.width="auto",e.height="auto"}download(t,e){this.ctx.scene.download(t,e)}getOptions(){var t;return null!=(t=this.queuedUserOptions.at(-1))?t:this.userOptions}getModuleContext(){return this.ctx}getAriaLabel(){var t;const e=[this.title,this.subtitle,this.footnote].filter(t=>t.enabled&&t.text).map(t=>t.text).join(". ");return`chart, ${null!=(t=this.series.length)?t:0} series, ${e}`}resetAnimations(){this.chartAnimationPhase="initial";for(const t of this.series)t.resetAnimation(this.chartAnimationPhase);for(const t of this.axes)t.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}destroy(t){if(this.destroyed)return;const e=null==t?void 0:t.keepTransferableResources;let i;return this.performUpdateType=7,this._destroyFns.forEach(t=>t()),this.processors.forEach(t=>t.destroy()),this.tooltip.destroy(),this.overlays.destroy(),this.sizeMonitor.unobserve(this.element),this.modulesManager.destroy(),e?(this.ctx.scene.strip(),i={container:this.container,scene:this.ctx.scene,element:this.element}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(t=>t.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.zoomManager.destroy(),this.destroyed=!0,Object.freeze(this),i}resetPointer(t=!1){t||this.ctx.tooltipManager.removeTooltip(this.id),this.ctx.highlightManager.updateHighlight(this.id),this.lastInteractionEvent=void 0}requestFactoryUpdate(t){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(()=>S(this,null,function*(){this.destroyed||(yield t(this),this.destroyed||this._pendingFactoryUpdatesCount--)})).catch(t=>R.errorOnce(t)))}update(t=0,e){var i,s;const{forceNodeDataRefresh:n=!1,skipAnimations:a,seriesToUpdate:o=this.series,newAnimationBatch:r}=null!=e?e:{};n&&this.series.forEach(t=>t.markNodeDataDirty());for(const t of o)this.seriesToUpdate.add(t);if(a&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),r&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this._skipSync=null!=(i=null==e?void 0:e.skipSync)&&i,this.debug.check()){let e=null!=(s=(new Error).stack)?s:"<unknown>";e=e.replace(/\([^)]*/g,""),this.updateRequestors[e]=t}t<this.performUpdateType&&(this.performUpdateType=t,this.performUpdateTrigger.schedule(null==e?void 0:e.backOffMs))}performUpdate(t){return S(this,null,function*(){const{performUpdateType:e,extraDebugStats:i,_performUpdateSplits:s,ctx:n}=this,a=[...this.seriesToUpdate];this.performUpdateType=7,this.seriesToUpdate.clear(),0===this.updateShortcutCount&&e<6&&(n.animationManager.startBatch(this._performUpdateSkipAnimations),n.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.debug("Chart.performUpdate() - start",Gh[e]);let o=performance.now();null!=s.start||(s.start=o);const r=t=>{null!=s[t]||(s[t]=0),s[t]+=performance.now()-o,o=performance.now()};let l=!1;switch(e){case 0:this.updateDOM();case 1:yield this.updateData(),r("⬇️");case 2:yield this.processData(),this.resetPointer(!0),r("🏭");case 3:if(this.checkUpdateShortcut(3))break;if(!this.checkFirstAutoSize(a)){l=!0;break}yield this.processLayout(),r("⌖");case 4:if(this.checkUpdateShortcut(4))break;const{seriesRect:t}=this;yield Promise.all(a.map(e=>e.update({seriesRect:t}))),r("🤔");case 5:if(this.checkUpdateShortcut(5))break;const o=n.tooltipManager.getTooltipMeta(this.id);e<=4&&null!=(null==o?void 0:o.lastPointerEvent)&&this.handlePointer(o.lastPointerEvent,!0),r("↖");case 6:if(this.checkUpdateShortcut(6))break;n.animationManager.endBatch(),i.updateShortcutCount=this.updateShortcutCount,yield n.scene.render({debugSplitTimes:s,extraDebugStats:i}),this.ctx.regionManager.updateFocusWrapperRect(),this.extraDebugStats={};for(const t in s)delete s[t];case 7:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,n.animationManager.endBatch()}l||n.updateService.dispatchUpdateComplete(this.getMinRects());const h=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round(100*(h-s.start))/100,count:t,performUpdateType:Gh[e]})})}updateThemeClassName(){const{element:t,processedOptions:{theme:e}}=this,i="ag-charts-theme-",s=[`${i}default`,`${i}default-dark`];let n=s[0],a=!1;"string"==typeof e?(n=e.replace("ag-",i),a=e.includes("-dark")):"string"==typeof(null==e?void 0:e.baseTheme)&&(n=e.baseTheme.replace("ag-",i),a=e.baseTheme.includes("-dark")),s.includes(n)||(n=a?s[1]:s[0]),t.classList.forEach(e=>{e.startsWith(i)&&e!==n&&t.classList.remove(e)}),t.classList.add(n)}updateDOM(){this.updateThemeClassName();const{enabled:t,tabIndex:e}=this.keyboard;this.element.tabIndex=t?null!=e?e:0:-1,Zr(this.ctx.scene.canvas.element,"role","figure"),Zr(this.ctx.scene.canvas.element,"aria-label",this.getAriaLabel())}checkUpdateShortcut(t){return this.updateShortcutCount>3?(R.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=t&&(this.updateShortcutCount++,!0)}checkFirstAutoSize(t){if(this.autoSize&&!this._lastAutoSize){const e=this._performUpdateNoRenderCount++,i=40*p(e+1,2);if(e<8)return this.update(3,{seriesToUpdate:t,backOffMs:i}),this.debug("Chart.checkFirstAutoSize() - backing off until first size update",i),!1;this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}return this._performUpdateNoRenderCount=0,!0}onAxisChange(t,e=[]){for(const i of e)t.includes(i)||(i.detachAxis(this.axisGroup,this.axisGridGroup),i.destroy());for(const i of t)(null==e?void 0:e.includes(i))||i.attachAxis(this.axisGroup,this.axisGridGroup)}onSeriesChange(t,e){var i,s;const n=null!=(i=null==e?void 0:e.filter(e=>!t.includes(e)))?i:[];this.destroySeries(n),null==(s=this.seriesLayerManager)||s.setSeriesCount(t.length);for(const i of t){if(null==e?void 0:e.includes(i))continue;null==i.rootGroup.parent&&this.seriesLayerManager.requestGroup(i);const t=this;i.chart={get mode(){return t.mode},get isMiniChart(){return!1},get seriesRect(){return t.seriesRect},placeLabels:()=>t.placeLabels()},i.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(i),i.addChartEventListeners()}}destroySeries(t){null==t||t.forEach(t=>{t.removeEventListener("nodeClick",this.onSeriesNodeClick),t.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),t.removeEventListener("groupingChanged",this.seriesGroupingChanged),t.destroy(),this.seriesLayerManager.releaseGroup(t),t.chart=void 0})}addSeriesListeners(t){this.hasEventListener("seriesNodeClick")&&t.addEventListener("nodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&t.addEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),t.addEventListener("groupingChanged",this.seriesGroupingChanged)}updateAllSeriesListeners(){this.series.forEach(t=>{t.removeEventListener("nodeClick",this.onSeriesNodeClick),t.removeEventListener("nodeDoubleClick",this.onSeriesNodeDoubleClick),this.addSeriesListeners(t)})}assignSeriesToAxes(){this.axes.forEach(t=>{t.boundSeries=this.series.filter(e=>e.axes[t.direction]===t)})}assignAxesToSeries(){const t=us(this.axes,t=>t.direction);this.series.forEach(e=>{e.directions.forEach(i=>{const s=t[i];if(!s)return void R.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);const n=e.getKeys(i),a=s.find(t=>!t.keys.length||n.some(e=>t.keys.includes(e)));a?e.axes[i]=a:R.warnOnce(`no matching axis for direction [${i}] and keys [${n}]; check series and axes configuration.`)})})}rawResize({width:t,height:e}){var i;if(!this.autoSize)return;if(t=Math.floor(t),e=Math.floor(e),0===t&&0===e)return;const[s=0,n=0]=null!=(i=this._lastAutoSize)?i:[];s===t&&n===e||(this._lastAutoSize=[t,e],this.resize(void 0,void 0,"SizeMonitor"))}resize(t,e,i){var s,n,a,o;const{scene:r,animationManager:l}=this.ctx;if(null!=t||(t=null!=(n=this.width)?n:this.autoSize?null==(s=this._lastAutoSize)?void 0:s[0]:r.canvas.width),null!=e||(e=null!=(o=this.height)?o:this.autoSize?null==(a=this._lastAutoSize)?void 0:a[1]:r.canvas.height),this.debug(`Chart.resize() from ${i}`,{width:t,height:e,stack:(new Error).stack}),t&&e&&Wt(t)&&Wt(e)&&r.resize(t,e)){this.resetPointer(),l.reset();let t=!0;this.autoSize&&this._firstAutoSize&&(t=!1,this._firstAutoSize=!1),this.update(3,{forceNodeDataRefresh:!0,skipAnimations:t})}}updateData(){return S(this,null,function*(){this.series.forEach(t=>t.setChartData(this.data));const t=this.modulesManager.mapModules(t=>{var e;return null==(e=t.updateData)?void 0:e.call(t,{data:this.data})});yield Promise.all(t)})}processData(){return S(this,null,function*(){if(this.series.some(t=>t.canHaveAxes)){this.assignAxesToSeries();const t=this.modulesManager.getModule("sync");(null==t?void 0:t.enabled)?t.syncAxes(this._skipSync):this.assignSeriesToAxes()}const t=new Qh(this.mode),e=this.series.map(e=>e.processData(t)),i=this.modulesManager.mapModules(e=>{var i;return null==(i=e.processData)?void 0:i.call(e,{dataController:t})});t.execute(),yield Promise.all([...e,...i]);for(const{legendType:t,legend:e}of this.modulesManager.legends())e.data=this.getLegendData(t,"integrated"!==this.mode);this.dataProcessListeners.forEach(t=>t()),this.dataProcessListeners.clear()})}placeLabels(){const t=[],e=[];for(const i of this.series){if(!i.visible)continue;const s=i.getLabelData();jr(null==s?void 0:s[0])&&(e.push(s),t.push(i))}const{seriesRect:i}=this,{top:s,right:n,bottom:a,left:o}=this.seriesArea.padding,r=i&&e.length>0?function(t,e,i=5){var s,n;const a=[];t=t.map(t=>t.slice().sort((t,e)=>e.point.size-t.point.size));for(let o=0;o<t.length;o++){const r=a[o]=[],l=t[o];if((null==l?void 0:l.length)&&l[0].label)for(let o=0,h=l.length;o<h;o++){const h=l[o],{point:c,label:d,marker:u}=h,{text:p,width:g,height:m}=d,y=.5*c.size;let f=0,x=0;if(y>0&&null!=h.placement){const t=Wr[h.placement];f=(.5*g+y+i)*t.x,x=(.5*m+y+i)*t.y}const b=c.x-.5*g+f-((null!=(s=null==u?void 0:u.center.x)?s:.5)-.5)*c.size,v=c.y-.5*m+x-((null!=(n=null==u?void 0:u.center.y)?n:.5)-.5)*c.size;e&&!_r(e,b,v,g,m)||t.some(t=>t.some(t=>{var e;return zr(t.point,null==(e=t.marker)?void 0:e.center,b,v,g,m)}))||a.some(t=>t.some(t=>Gr(t,b,v,g,m)))||r.push({index:o,text:p,x:b,y:v,width:g,height:m,datum:h})}}return a}(e,{x:-o,y:-s,width:i.width+o+n,height:i.height+s+a}):[];return new Map(r.map((e,i)=>[t[i],e]))}getLegendData(t,e){var i,s;const n=this.series.filter(t=>t.properties.showInLegend).flatMap(e=>e.getLegendData(t));if(e&&n.every(t=>"category"===t.legendType)){const t={},e=new Map(this.series.map(t=>[t.id,t.type]));for(const{seriesId:a,marker:o,label:r}of n){if(null==o.fill)continue;const n=e.get(a),l=null!=(i=t[n])?i:t[n]={};null!=l[s=r.text]||(l[s]=o.fill),l[r.text]!==o.fill&&R.warnOnce(`legend item '${r.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}return n}processLayout(){return S(this,null,function*(){var t;const e=this.animationRect;yield this.performLayout(),e&&!(null==(t=this.animationRect)?void 0:t.equals(e))&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)})}performLayout(){return S(this,null,function*(){const{width:t,height:e}=this.ctx.scene;let i={shrinkRect:new Qs(0,0,t,e)};i=this.ctx.layoutService.dispatchPerformLayout("start-layout",i),i=this.ctx.layoutService.dispatchPerformLayout("before-series",i);const s=this.modulesManager.mapModules(t=>S(this,null,function*(){null!=t.performLayout&&(i=yield t.performLayout(i))}));return yield Promise.all(s),i.shrinkRect})}pickSeriesNode(t,e,i){var s,n;const a=performance.now(),o=e?[0]:void 0,r=[...this.series].reverse();let l;for(const e of r){if(!e.visible||!e.rootGroup.visible)continue;const{match:n,distance:a}=null!=(s=e.pickNode(t,o))?s:{};if(n&&null!=a&&((!l||l.distance>a)&&a<=(null!=i?i:1/0)&&(l={series:e,distance:a,datum:n}),0===a))break}return this.extraDebugStats.pickSeriesNode=Math.round((null!=(n=this.extraDebugStats.pickSeriesNode)?n:0)+(performance.now()-a)),l}onMouseMove(t){this.lastInteractionEvent=t,this.pointerScheduler.schedule(),this.extraDebugStats.mouseX=t.offsetX,this.extraDebugStats.mouseY=t.offsetY,this.update(6)}onLeave(t){this.tooltip.pointerLeftOntoTooltip(t)||(this.resetPointer(),this.update(6),this.ctx.cursorManager.updateCursor("chart"))}onBrowserFocus(t){t.delta>0?(this.focus.datum=void 0,this.focus.series=void 0,this.focus.datumIndex=0,this.focus.seriesIndex=0):(this.focus.datum=void 0,this.focus.series=void 0,this.focus.datumIndex=1/0,this.focus.seriesIndex=1/0)}onAnimationStart(){this.focus.hasFocus&&this.onBlur()}onBlur(){this.ctx.regionManager.updateFocusIndicatorRect(void 0),this.resetPointer(),this.focus.hasFocus=!1}onTab(t){this.handleFocus(),t.consume(),this.focus.hasFocus=!0}onNavVert(t){this.focus.seriesIndex+=t.delta,this.handleFocus(),t.consume()}onNavHori(t){this.focus.datumIndex+=t.delta,this.handleFocus(t.delta),t.consume()}onSubmit(t){const{series:e,datum:i}=this.focus,s=t.sourceEvent.sourceEvent;void 0!==e&&void 0!==i?e.fireNodeClickEvent(s,i):this.fireEvent({type:"click",event:s})}onContextMenu(t){this.ctx.tooltipManager.removeTooltip(this.id);const{Default:e,ContextMenu:i}=uh;this.ctx.interactionManager.getState()&(e|i)&&this.checkSeriesNodeRange(t,()=>{this.ctx.highlightManager.updateHighlight(this.id)})}handleFocus(t){this.focus.hasFocus=!0;const e=this.overlays.getFocusInfo();null==e?this.handleSeriesFocus(null!=t?t:0):(this.ctx.regionManager.updateFocusIndicatorRect(e.rect),this.ctx.ariaAnnouncementService.announceValue(e.text))}handleSeriesFocus(t){const{series:e,seriesRect:i,focus:s}=this,n=e.filter(t=>t.visible);if(0===n.length)return;s.seriesIndex=Gs(0,s.seriesIndex,n.length-1),s.series=n[s.seriesIndex];const a=s.series.pickFocus({datumIndex:s.datumIndex,datumIndexDelta:t,seriesRect:i});if(void 0===a)return;const{datum:o,datumIndex:r}=a;s.datumIndex=r,s.datum=o;const l=nc(this.ctx.regionManager,a);if(void 0!==l){this.lastInteractionEvent=l;const t=s.series.getTooltipHtml(o),e=Bh.makeTooltipMeta(this.lastInteractionEvent,o);this.ctx.highlightManager.updateHighlight(this.id,o),this.ctx.tooltipManager.updateTooltip(this.id,e,t),this.ctx.ariaAnnouncementService.announceValue(t.ariaLabel)}}static isHoverEvent(t){return void 0!==t&&"hover"===t.type}handlePointer(e,i){if(16!==this.ctx.interactionManager.getState()||!t.isHoverEvent(e))return;const{lastPick:s,hoverRect:n}=this,{offsetX:a,offsetY:o}=e,r=(t=!1)=>{s&&this.resetPointer(t)};(i?!this.ctx.animationManager.isActive():null==n?void 0:n.containsPoint(a,o))?(this.handlePointerTooltip(e,r),this.handlePointerNode(e)):r()}handlePointerTooltip(t,e){const{lastPick:i,tooltip:s}=this,{range:n}=s,{offsetX:a,offsetY:o}=t;let r;Wt(n)&&(r=n);const l=this.pickSeriesNode({x:a,y:o},"exact"===n,r);if(!l)return this.ctx.tooltipManager.removeTooltip(this.id),void("tooltip"===this.highlight.range&&e(!0));const h="node"===this.highlight.range||!i||i!==l.datum;let c;h&&(c=l.series.getTooltipHtml(l.datum),"tooltip"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id,l.datum));const d=null!=r,u=this.tooltip.enabled&&l.series.tooltipEnabled,p="exact"===n&&0===l.distance,g=u&&("nearest"===n||d||p)&&(!h||void 0!==c),m=Bh.makeTooltipMeta(t,l.datum);g&&this.ctx.tooltipManager.updateTooltip(this.id,m,c)}handlePointerNode(t){this.checkSeriesNodeRange(t,(t,e)=>{(t.hasEventListener("nodeClick")||t.hasEventListener("nodeDoubleClick"))&&this.ctx.cursorManager.updateCursor("chart","pointer"),"node"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id,e)})||(this.ctx.cursorManager.updateCursor("chart"),"node"===this.highlight.range&&this.ctx.highlightManager.updateHighlight(this.id))}onClick(t){this.checkSeriesNodeClick(t)?this.update(4):this.fireEvent({type:"click",event:t.sourceEvent})}onDoubleClick(t){this.checkSeriesNodeDoubleClick(t)?this.update(4):this.fireEvent({type:"doubleClick",event:t.sourceEvent})}checkSeriesNodeClick(t){return this.checkSeriesNodeRange(t,(e,i)=>e.fireNodeClickEvent(t.sourceEvent,i))}checkSeriesNodeDoubleClick(t){return this.checkSeriesNodeRange(t,(e,i)=>e.fireNodeDoubleClickEvent(t.sourceEvent,i))}checkSeriesNodeRange(t,e){var i;const s=this.pickSeriesNode({x:t.offsetX,y:t.offsetY},!1),n=null==s?void 0:s.datum,a=null==n?void 0:n.series.properties.nodeClickRange;let o;Wt(a)&&(o=a);let r=this.pickSeriesNode({x:t.offsetX,y:t.offsetY},!0);if(r?this.ctx.highlightManager.updatePicked(this.id,r.datum):this.ctx.highlightManager.updatePicked(this.id),n&&"nearest"===a)return e(n.series,n),!0;if("exact"!==a&&(r=this.pickSeriesNode({x:t.offsetX,y:t.offsetY},!1,o)),!r)return!1;const l=null!=o,h="exact"===a&&0===r.distance;return!(!l&&!h||void 0!==t.pointerHistory&&!(null==(i=t.pointerHistory)?void 0:i.every(t=>{const e={x:t.offsetX,y:t.offsetY},i=this.pickSeriesNode(e,!1,o);return(null==i?void 0:i.datum)===(null==r?void 0:r.datum)})))&&(e(r.series,r.datum),!0)}changeHighlightDatum(t){var e,i;const s=new Set,{series:n,datum:a}=null!=(e=t.currentHighlight)?e:{},{series:o,datum:r}=null!=(i=t.previousHighlight)?i:{};o&&s.add(o),n&&s.add(n),(null==o?void 0:o.properties.cursor)&&r&&this.ctx.cursorManager.updateCursor(o.id),(null==n?void 0:n.properties.cursor)&&a&&this.ctx.cursorManager.updateCursor(n.id,n.properties.cursor),this.lastPick=t.currentHighlight,null==n||null==o?this.update(4):this.update(4,{seriesToUpdate:s})}waitForUpdate(t=1e4,e=!1){return S(this,null,function*(){const i=performance.now();for(this._pendingFactoryUpdatesCount>0&&(yield this.updateMutex.waitForClearAcquireQueue());7!==this.performUpdateType;){if(performance.now()-i>t){const i=`Chart.waitForUpdate() timeout of ${t} reached - first chart update taking too long.`;if(e)throw new Error(i);R.warnOnce(i)}yield Hl(50)}yield this.updateMutex.waitForClearAcquireQueue()})}waitForDataProcess(t){return new Promise(e=>{this.dataProcessListeners.add(e),jt(t)&&setTimeout(()=>{this.dataProcessListeners.has(e)&&(this.dataProcessListeners.delete(e),e())},t)})}getMinRects(){const{width:t,height:e}=this.ctx.scene,i=this.series.map(i=>i.getMinRects(t,e)).filter(Tt);if(0===i.length)return;let s=0,n=0,a=0,o=0;for(const{minRect:t,minVisibleRect:e}of i)s=Math.max(s,t.width),n=Math.max(n,t.height),a=Math.max(a,e.width),o=Math.max(o,e.height);const r=new Qs(0,0,s,n);let l=r.clone();return a>0&&o>0&&(l=new Qs(0,0,a,o)),{minRect:r,minVisibleRect:l}}filterMiniChartSeries(t){return null==t?void 0:t.filter(t=>!1!==t.showInMiniChart)}applyOptions(t){var e,i,s,n,a;const o=this.processedOptions,r=t.diffOptions(o),l=t.userOptions;if(null==r)return;td("AgChartV2.updateDelta() - applying delta",r);const h=Ut(r,o),c=this.applyModules(h);r.listeners&&this.registerListeners(this,r.listeners),De(this,r,{skip:["type","data","series","listeners","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","axes","topology"]});let d=!1,u="no-op";(null==(e=r.series)?void 0:e.length)&&(u=this.applySeries(this,r.series,null==o?void 0:o.series),d=!0),"replaced"===u&&this.resetAnimations(),this.applyAxes(this,h,o,u)&&(d=!0),r.data&&(this.data=r.data),(null==(i=r.legend)?void 0:i.listeners)&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,r.legend.listeners),r.listeners&&this.updateAllSeriesListeners(),this.chartOptions=t,this.processedOptions=h,this.userOptions=Ut(l,this.userOptions);const p=this.modulesManager.getModule("navigator"),g=this.modulesManager.getModule("zoom");(null==p?void 0:p.enabled)||(null==g?void 0:g.enabled)||this.ctx.zoomManager.updateZoom("chart");const m=null==p?void 0:p.miniChart,y=null!=(a=null==(n=null==(s=h.navigator)?void 0:s.miniChart)?void 0:n.series)?a:h.series;!0===(null==m?void 0:m.enabled)&&null!=y?this.applyMiniChartOptions(m,y,h,o):!1===(null==m?void 0:m.enabled)&&(m.series=[],m.axes=[]),ks("\n/* Reset */\n\n[class^='ag-charts'],\n[class^='ag-charts']:focus,\n[class^='ag-charts']:after,\n[class^='ag-charts']:before {\n    box-sizing: border-box;\n    outline: none;\n}\n\nbutton[class^='ag-charts'] {\n    background: none;\n    border: 0;\n}\n\n\n\n/* Icons */\n\n[class^='ag-charts-icon'] {\n    display: block;\n    /* speak: none; */\n    mask-size: contain;\n    mask-repeat: no-repeat;\n    background-color: currentColor;\n}\n\n.ag-charts-icon-zoom-in {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+);\n}\n\n.ag-charts-icon-zoom-out {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-reset {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXJvdGF0ZS1jY3ciPjxwYXRoIGQ9Ik0zIDEyYTkgOSAwIDEgMCA5LTkgOS43NSA5Ljc1IDAgMCAwLTYuNzQgMi43NEwzIDgiLz48cGF0aCBkPSJNMyAzdjVoNSIvPjwvc3ZnPg==);\n}\n\n.ag-charts-icon-pan-left {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tbGVmdCI+PHBhdGggZD0ibTE1IDE4LTYtNiA2LTYiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-pan-right {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQiPjxwYXRoIGQ9Im05IDE4IDYtNi02LTYiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-pan-start {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tZmlyc3QiPjxwYXRoIGQ9Im0xNyAxOC02LTYgNi02Ii8+PHBhdGggZD0iTTcgNnYxMiIvPjwvc3ZnPg==);\n}\n\n.ag-charts-icon-pan-end {\n    mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tbGFzdCI+PHBhdGggZD0ibTcgMTggNi02LTYtNiIvPjxwYXRoIGQ9Ik0xNyA2djEyIi8+PC9zdmc+);\n}\n\n\n\n/* AG Charts Theme Default */\n\n.ag-charts-theme-default,\n.ag-charts-theme-default-dark {\n    /* Colors */\n    --ag-charts-active-color: var(--ag-active-color, #2196f3);\n    --ag-charts-background-color: var(--ag-background-color, #fff);\n    --ag-charts-foreground-color: var(--ag-foreground-color, #181d1f);\n    --ag-charts-border-color: var(--ag-border-color, #dddddd);\n\n    /* Sizing */\n    --ag-charts-font-size: var(--ag-font-size, 14px);\n    --ag-charts-size: var(--ag-grid-size, 8px);\n\n    /* Borders */\n    --ag-charts-border: var(--ag-borders, solid 1px);\n    --ag-charts-border-critical: var(--ag-borders-critical, solid 1px);\n\n    /* Toolbar */\n    --ag-charts-toolbar-foreground-color: var(--ag-header-foreground-color, var(--ag-charts-foreground-color));\n    --ag-charts-toolbar-background-color: var(\n        --ag-header-background-color,\n        color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 2%)\n    );\n    --ag-charts-toolbar-size: var(--ag-header-height, 48px);\n    --ag-charts-toolbar-padding: calc(var(--ag-charts-size) * 2);\n    --ag-charts-toolbar-border: var(--ag-charts-border, solid 1px) var(--ag-charts-border-color);\n    --ag-charts-toolbar-border-critical: var(--ag-charts-border-critical, solid 1px) var(--ag-charts-border-color);\n    --ag-charts-toolbar-hover-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-active-color) 12%);\n    --ag-charts-toolbar-disabled-foreground-color: var(\n        --ag-disabled-foreground-color,\n        color-mix(in srgb, transparent, var(--ag-charts-toolbar-foreground-color) 50%)\n    );\n    --ag-charts-toolbar-disabled-background-color: var(\n        --ag-input-disabled-background-color,\n        color-mix(in srgb, var(--ag-charts-toolbar-background-color), var(--ag-charts-toolbar-foreground-color) 6%)\n    );\n    --ag-charts-toolbar-gap: var(--ag-charts-size);\n\n    /* Buttons */\n    --ag-charts-button-padding: var(--ag-charts-size);\n    --ag-charts-button-radius: var(--ag-border-radius, 4px);\n\n    /* Focus Indicator */\n    --ag-charts-focus-border: solid 2px var(--ag-input-focus-border-color, var(--ag-charts-active-color));\n    --ag-charts-focus-border-shadow: var(--ag-input-focus-box-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-focus-border) 47%));\n\n    /* Icons */\n    --ag-charts-icon-font-family: 'agChartsDefault';\n    --ag-charts-icon-font-weight: normal;\n    --ag-charts-icon-font-color: color-mix(in srgb, transparent, var(--ag-charts-foreground-color), 90%);\n}\n\n\n\n/* AG Charts Theme Default Dark */\n\n.ag-charts-theme-default-dark {\n    /* Colors */\n    --ag-charts-background-color: var(--ag-background-color, color-mix(in srgb, #fff, #182230 97%));\n    --ag-charts-foreground-color: var(--ag-foreground-color, #fff);\n    --ag-charts-border-color: var(--ag-border-color, rgba(255, 255, 255, 0.16));\n    --ag-charts-hover-color: var(\n        --ag-row-hover-color,\n        color-mix(in srgb, transparent, var(--ag-charts-active-color) 20%)\n    );\n\n    /* Toolbar */\n    --ag-charts-toolbar-background-color: var(--ag-header-background-color, color-mix(in srgb, #fff, #182230 93%));\n}\n\n\n","chart"),this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes),d||(d=this.shouldForceNodeDataRefresh(r,u));const f=d||c?0:3;this.maybeResetAnimations(u),td("AgChartV2.applyChartOptions() - update type",Gh[f],{seriesStatus:u,forceNodeDataRefresh:d}),this.update(f,{forceNodeDataRefresh:d,newAnimationBatch:!0})}maybeResetAnimations(t){if("standalone"===this.mode)switch(t){case"series-grouping-change":case"replaced":this.resetAnimations()}}shouldForceNodeDataRefresh(t,e){const i=!!t.data||"data-change"===e||"replaced"===e,s=Le.getKeys(),n=Object.values(s).some(e=>null!=t[e]),a=null!=t.title&&null!=t.subtitle;return i||n||a}applyMiniChartOptions(t,e,i,s){var n,a,o,r,l;const h=null!=(o=null==(a=null==(n=null==s?void 0:s.navigator)?void 0:n.miniChart)?void 0:a.series)?o:null==s?void 0:s.series,c=this.applySeries(t,this.filterMiniChartSeries(e),this.filterMiniChartSeries(h));this.applyAxes(t,i,s,c,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const d=t.axes,u=d.find(t=>"x"===t.direction);for(const t of d)t.gridLine.enabled=!1,t.label.enabled=t===u,t.tick.enabled=!1,t.interactionEnabled=!1;if(null!=u){const t=null==(r=i.navigator)?void 0:r.miniChart,e=null==t?void 0:t.label,s=null==(l=null==t?void 0:t.label)?void 0:l.interval;u.line.enabled=!1,u.label.set(qt(e,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),u.tick.set(qt(s,["enabled","width","size","color","interval","step"]));const n=null==s?void 0:s.step;null!=n&&(u.tick.interval=n)}}applyModules(t){var e;const{type:i}=this.constructor;let s=!1;for(const n of St.byType("root","legend")){const a=null!=t[n.optionsKey]&&n.chartTypes.includes(i);a!==this.modulesManager.isEnabled(n)&&(a?(this.modulesManager.addModule(n,t=>new t.instanceConstructor(this.getModuleContext())),"legend"===n.type&&(null==(e=this.modulesManager.getModule(n))||e.attachLegend(this.ctx.scene)),this[n.optionsKey]=this.modulesManager.getModule(n)):(this.modulesManager.removeModule(n),delete this[n.optionsKey]),s=!0)}return s}applySeries(t,e,i){var s;if(!e)return"no-change";const n=function(t,e,i){var s,n,a,o;const r=(t,e)=>{const i=[t];for(const t of lc)t in e&&null!=e[t]&&i.push(`${t}=${e[t]}`);return i.join(";")},l=new Map;let h=0;for(const e of t){const t=r(e.type,e.properties);l.has(t)||l.set(t,[]),null==(s=l.get(t))||s.push([e,h++])}const c=new Map;for(const t of e){const e=r(t.type,t);c.has(e)||c.set(e,[]),null==(n=c.get(e))||n.push(t)}if(![...l.keys()].some(t=>c.has(t)))return{status:"no-overlap",oldKeys:l.keys(),newKeys:c.keys()};const d=[];let u=-1;for(const[t,e]of c.entries())for(const s of e){u++;const e=l.get(t);if(null==e||e.length<1){d.push({opts:s,idx:u,status:"add"}),l.delete(t);continue}const[n,r]=e.shift(),h=ve(null!=(a=null==i?void 0:i[r])?a:{},null!=s?s:{}),{groupIndex:c,stackIndex:p}=null!=(o=null==h?void 0:h.seriesGrouping)?o:{};null!=c||null!=p?d.push({opts:s,series:n,diff:h,idx:r,status:"series-grouping"}):h?d.push({opts:s,series:n,diff:h,idx:r,status:"update"}):d.push({opts:s,series:n,idx:r,status:"no-op"}),0===e.length&&l.delete(t)}for(const t of l.values())for(const[e,i]of t)d.push({series:e,idx:i,status:"remove"});return{status:"overlap",changes:d}}(t.series,e,i);if("no-overlap"===n.status)return td(`AgChartV2.applySeries() - creating new series instances, status: ${n.status}`,n),t.series=e.map(t=>this.createSeries(t)),"replaced";td("AgChartV2.applySeries() - matchResult",n);const a=[];let o=!1,r=!1,l=!1;for(const t of n.changes)switch(r||(r="series-grouping"===t.status),o||(o=null!=(null==(s=t.diff)?void 0:s.data)),l||(l="no-op"!==t.status),t.status){case"add":const e=this.createSeries(t.opts);a.push(e),td("AgChartV2.applySeries() - created new series",e);break;case"remove":td(`AgChartV2.applySeries() - removing series at previous idx ${t.idx}`,t.series);break;case"no-op":a.push(t.series),td(`AgChartV2.applySeries() - no change to series at previous idx ${t.idx}`,t.series);break;default:const{series:i,diff:s,idx:n}=t;td(`AgChartV2.applySeries() - applying series diff previous idx ${n}`,s,i),this.applySeriesValues(i,s),i.markNodeDataDirty(),a.push(i)}for(let t=0;t<a.length;t++)a[t]._declarationOrder=t;return td("AgChartV2.applySeries() - final series instances",a),t.series=a,r?"series-grouping-change":o?"data-change":l?"updated":"no-op"}applyAxes(t,e,i,s,n=[]){if(!("axes"in e)||!e.axes)return!1;n=["axes[].type",...n];const{axes:a}=e;return"replaced"!==s&&t.axes.length===a.length&&t.axes.every((t,e)=>t.type===a[e].type)&&de(i)?(t.axes.forEach((t,e)=>{var s,o;const r=ve(null!=(o=null==(s=i.axes)?void 0:s[e])?o:{},a[e]);td(`AgChartV2.applyAxes() - applying axis diff idx ${e}`,r);const l=`axes[${e}]`;De(t,r,y(m({},Ya),{path:l,skip:n}))}),!0):(td(`AgChartV2.applyAxes() - creating new axes instances; seriesStatus: ${s}`),t.axes=this.createAxis(a,n),!0)}createSeries(t){const e=Ce.create(t.type,this.getModuleContext());return this.applySeriesOptionModules(e,t),this.applySeriesValues(e,t),e}applySeriesOptionModules(t,e){const i=t.createModuleContext(),s=t.getModuleMap();for(const n of St.byType("series-option"))n.optionsKey in e&&n.seriesTypes.includes(t.type)&&s.addModule(n,t=>new t.instanceConstructor(i))}applySeriesValues(t,e){const i=t.getModuleMap(),s=e,{type:n,data:a,listeners:o,seriesGrouping:r,showInMiniChart:l}=s,h=f(s,["type","data","listeners","seriesGrouping","showInMiniChart"]);for(const t of re)if("series-option"===t.type&&t.optionsKey in h){const e=i.getModule(t.optionsKey),s=h[t.optionsKey];delete h[t.optionsKey],e.properties.set(s)}t.properties.set(h),"data"in e&&t.setOptionsData(a),o&&this.registerListeners(t,o),"seriesGrouping"in e&&(t.seriesGrouping=null==r?void 0:m(m({},t.seriesGrouping),r))}createAxis(t,e){const i=new rc,s=this.getModuleContext();for(let n=0;n<t.length;n++){const a=t[n],o=Mt.create(a.type,s);this.applyAxisModules(o,a),De(o,a,y(m({},Ya),{path:`axes[${n}]`,skip:e})),i.push(o,a)}return i.guessInvalidPositions()}applyAxisModules(t,e){const i=t.createModuleContext(),s=t.getModuleMap();for(const n of St.byType("axis-option")){const a=null!=e[n.optionsKey];a!==s.isEnabled(n)&&(a?(s.addModule(n,t=>new t.instanceConstructor(i)),t[n.optionsKey]=s.getModule(n)):(s.removeModule(n),delete t[n.optionsKey]))}}registerListeners(t,e){t.clearEventListeners();for(const[i,s]of Object.entries(e))Bt(s)&&t.addEventListener(i,s)}};id.chartsInstances=new WeakMap,b([Ur({newValue(t){this.destroyed||(t.setAttribute("data-ag-charts",""),t.appendChild(this.element),id.chartsInstances.set(t,this))},oldValue(t){t.removeAttribute("data-ag-charts"),t.removeChild(this.element),id.chartsInstances.delete(t)}})],id.prototype,"container",2),b([Ur({newValue(t){this.resize(t,void 0,"width option")}})],id.prototype,"width",2),b([Ur({newValue(t){this.resize(void 0,t,"height option")}})],id.prototype,"height",2),b([Ur({newValue(t){this.onAutoSizeChange(t)}}),Yn(qn)],id.prototype,"autoSize",2),b([Yn(Xn)],id.prototype,"padding",2),b([Yn(Xn)],id.prototype,"seriesArea",2),b([Yn(Xn)],id.prototype,"title",2),b([Yn(Xn)],id.prototype,"subtitle",2),b([Yn(Xn)],id.prototype,"footnote",2),b([Yn(Xn)],id.prototype,"keyboard",2),b([Yn(Pa(["standalone","integrated"],"a chart mode"))],id.prototype,"mode",2),b([Ur({changeValue(t,e){this.onAxisChange(t,e)}})],id.prototype,"axes",2),b([Ur({changeValue(t,e){this.onSeriesChange(t,e)}})],id.prototype,"series",2);var sd=id;function nd(t,e,i,s,n,a,o,r){const l=(i-t)*(r-a)-(s-e)*(o-n);if(0===l)return 0;const h=((o-n)*(e-a)-(t-n)*(r-a))/l,c=((i-t)*(e-a)-(s-e)*(t-n))/l;return h>=0&&h<=1&&c>=0&&c<=1?1:0}function ad(t,e,i,s,n,a,o,r,l,h,c,d){let u=0;const p=h-d,g=c-l,m=l*(d-h)-h*(c-l),y=od(t,i,n,o),f=od(e,s,a,r),x=function(t,e,i,s){if(0===t)return function(t,e,i){if(0===t)return function(t,e){const i=-e/t;return 0!==t&&i>=0&&i<=1?[i]:[]}(e,i);const s=e*e-4*t*i,n=[];if(0===s){const i=-e/(2*t);i>=0&&i<=1&&n.push(i)}else if(s>0){const i=Math.sqrt(s),a=(-e-i)/(2*t),o=(-e+i)/(2*t);a>=0&&a<=1&&n.push(a),o>=0&&o<=1&&n.push(o)}return n}(e,i,s);const n=e/t,a=i/t,o=(3*a-n*n)/9,r=(9*n*a-s/t*27-2*n*n*n)/54,l=o*o*o+r*r,h=1/3,c=[];if(l>=0){const t=Math.sqrt(l),e=Math.sign(r+t)*Math.pow(Math.abs(r+t),h),i=Math.sign(r-t)*Math.pow(Math.abs(r-t),h),s=Math.abs(Math.sqrt(3)*(e-i)/2),a=-h*n+(e+i);if(a>=0&&a<=1&&c.push(a),0===s){const t=-h*n-(e+i)/2;t>=0&&t<=1&&c.push(t)}}else{const t=Math.acos(r/Math.sqrt(-o*o*o)),e=h*n,i=2*Math.sqrt(-o),s=i*Math.cos(h*t)-e,a=i*Math.cos(h*(t+2*Math.PI))-e,l=i*Math.cos(h*(t+4*Math.PI))-e;s>=0&&s<=1&&c.push(s),a>=0&&a<=1&&c.push(a),l>=0&&l<=1&&c.push(l)}return c}(p*y[0]+g*f[0],p*y[1]+g*f[1],p*y[2]+g*f[2],p*y[3]+g*f[3]+m);for(const t of x){const e=t*t,i=t*e,s=y[0]*i+y[1]*e+y[2]*t+y[3],n=f[0]*i+f[1]*e+f[2]*t+f[3];let a;a=l===c?(n-h)/(d-h):(s-l)/(c-l),a>=0&&a<=1&&u++}return u}function od(t,e,i,s){return[3*e-t-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function rd(t,e,i,s,n,a,o,r,l,h){if(isNaN(t)||isNaN(e))return 0;a&&([n,s]=[s,n]);const c=(h-r)/(l-o),d=r-c*o,u=Math.pow(c,2)+1,p=2*(c*(d-e)-t),g=Math.pow(t,2)+Math.pow(d-e,2)-Math.pow(i,2),m=Math.pow(p,2)-4*u*g;if(m<0)return 0;const y=(-p+Math.sqrt(m))/2/u,f=(-p-Math.sqrt(m))/2/u;let x=0;return[y,f].forEach(i=>{if(!(i>=Math.min(o,l)&&i<=Math.max(o,l)))return;const a=i-t,r=c*i+d-e;Bn(Math.atan2(r,a),s,n)&&x++}),x}var ld=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.openedPath=!1,this.closedPath=!1}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,a){this.openedPath=!0,this.path2d.arc(t,e,i,s,n,a),this.commands.push(2),this.params.push(t,e,i,s,n,a?1:0)}cubicCurveTo(t,e,i,s,n,a){this.openedPath||this.moveTo(t,e),this.path2d.bezierCurveTo(t,e,i,s,n,a),this.commands.push(3),this.params.push(t,e,i,s,n,a)}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,a=-1e4,o=-1e4;let r=NaN,l=NaN,h=0,c=0,d=0;for(let u=0,p=0;u<n;u++)switch(i[u]){case 0:d+=nd(r,l,h,c,a,o,t,e),h=s[p++],r=h,c=s[p++],l=c;break;case 1:d+=nd(h,c,s[p++],s[p++],a,o,t,e),h=s[p-2],c=s[p-1];break;case 3:d+=ad(h,c,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],a,o,t,e),h=s[p-2],c=s[p-1];break;case 2:const i=s[p++],n=s[p++],u=s[p++],g=s[p++],m=s[p++];d+=rd(i,n,u,g,m,Boolean(s[p++]),a,o,t,e),isNaN(r)||(d+=nd(h,c,i+Math.cos(g)*u,n+Math.sin(g)*u,a,o,t,e)),h=i+Math.cos(m)*u,c=n+Math.sin(m)*u;break;case 4:d+=nd(r,l,h,c,a,o,t,e)}return d%2==1}distanceSquared(t,e){let i=1/0;const s=this.commands,n=this.params,a=s.length;let o=NaN,r=NaN,l=0,h=0;for(let c=0,d=0;c<a;c++)switch(s[c]){case 0:l=o=n[d++],h=r=n[d++];break;case 1:i=Pr(t,e,l,h,n[d++],n[d++],i);break;case 3:R.error("Command.Curve distanceSquare not implemented");break;case 2:{const s=n[d++],a=n[d++],o=n[d++],r=n[d++],c=n[d++],u=s+Math.cos(r)*o,p=a+Math.sin(r)*o,g=Boolean(n[d++]);i=Pr(t,e,l,h,u,p,i),i=Br(t,e,s,a,o,r,c,g,i),l=s+Math.cos(c)*o,h=a+Math.sin(c)*o;break}case 4:i=Pr(t,e,l,h,o,r,i)}return i}getPoints(){const{commands:t,params:e}=this,i=[];let s=0;for(let n=0;n<t.length;n++)switch(t[n]){case 0:case 1:i.push({x:e[s++],y:e[s++]});break;case 3:s+=4,i.push({x:e[s++],y:e[s++]});break;case 2:i.push({x:e[s++],y:e[s++]}),s+=4}return i}};function hd(t){const{redraw:e=3,changeCb:i,convertor:s}=null!=t?t:{};return en({redraw:e,type:"path",convertor:s,changeCb:i})}var cd=class extends Co{constructor(){super(...arguments),this.path=new ld,this._clipX=NaN,this._clipY=NaN,this._dirtyPath=!0}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(this,3))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){var t,e,i,s;this._dirtyPath||(this.dirtyPath=this.path.isDirty()||null!=(e=null==(t=this.fillShadow)?void 0:t.isDirty())&&e||null!=(s=null==(i=this._clipPath)?void 0:i.isDirty())&&s)}isPointInPath(t,e){const i=this.transformPoint(t,e);return this.path.closedPath&&this.path.isPointInPath(i.x,i.y)}distanceSquared(t,e){const i=this.transformPoint(t,e);return this.path.distanceSquared(i.x,i.y)}isDirtyPath(){return!1}updatePath(){}render(t){var e,i,s,n;const{ctx:a,forceRender:o,stats:r}=t;if(0!==this.dirty||o){if(this.computeTransformMatrix(),this.matrix.toContext(a),(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),isNaN(this._clipX)||isNaN(this._clipY)||null==this.clipMode)this.drawPath(a);else{a.save();const t=this.strokeWidth/2;if(null!=this._clipPath||(this._clipPath=new ld),this._clipPath.clear(),this._clipPath.rect(-t,-t,this._clipX+t,this._clipY+t+t),"normal"===this.clipMode&&a.clip(null==(e=this._clipPath)?void 0:e.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(a),"punch-out"===this.clipMode){a.clip(null==(i=this._clipPath)?void 0:i.getPath2D());const{x:t=-1e4,y:e=-1e4,width:n=2e4,height:o=2e4}=null!=(s=this.computeBBox())?s:{};a.clearRect(t,e,n,o)}a.restore()}null==(n=this.fillShadow)||n.markClean(),super.render(t)}else r&&(r.nodesSkipped+=this.nodeCount.count)}drawPath(t){this.fillStroke(t,this.path.getPath2D())}};cd.className="Path",b([hd()],cd.prototype,"clipMode",2),b([hd()],cd.prototype,"clipX",1),b([hd()],cd.prototype,"clipY",1);var dd=class{constructor(t,e,i){this.root=new gd(t,e,i)}clear(t){this.root.clear(t)}addValue(t,e){const i={hitTester:t,value:e,distanceSquared:(e,i)=>t.distanceSquared(e,i)};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}},ud=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)}},pd=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=null!=i?i:Qs.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)&&(void 0===this.subdivisions?0===this.maxdepth||this.elems.length<this.capacity?this.elems.push(t):this.subdivide(t):this.subdivisions.addElem(t))}find(t,e,i){this.findCondition(t,e,i)&&(void 0===this.subdivisions?this.findAction(t,e,i):this.subdivisions.find(t,e,i))}subdivide(t){this.subdivisions=this.makeSubdivisions();for(const t of this.elems)this.subdivisions.addElem(t);this.subdivisions.addElem(t),this.elems.length=0}makeSubdivisions(){const{x:t,y:e,width:i,height:s}=this.boundary,{capacity:n}=this,a=this.maxdepth-1,o=i/2,r=s/2,l=new Qs(t,e,o,r),h=new Qs(t+o,e,o,r),c=new Qs(t,e+r,o,r),d=new Qs(t+o,e+r,o,r);return new ud(this.child(n,a,l),this.child(n,a,h),this.child(n,a,c),this.child(n,a,d))}},gd=class t extends pd{addCondition(t){const{x:e,y:i}=t.hitTester.midPoint;return this.boundary.containsPoint(e,i)}findCondition(t,e,i){const{best:s}=i;return 0!==s.distanceSquared&&this.boundary.distanceSquared(t,e)<s.distanceSquared}findAction(t,e,i){const s=Xs(t,e,this.elems,i.best.distanceSquared);void 0!==s.nearest&&s.distanceSquared<i.best.distanceSquared&&(i.best=s)}child(e,i,s){return new t(e,i,s)}},md=class extends cd{constructor(){super(...arguments),this.x=0,this.y=0,this.size=12}computeBBox(){const{x:t,y:e,size:i}=this,{center:s}=this.constructor;return new Qs(t-i*s.x,e-i*s.y,i,i)}applyPath(t,e){const{path:i}=this;let{x:s,y:n}=this;null!=this.repeat&&(s=0,n=0),i.clear();for(const{x:a,y:o,t:r}of e)s+=a*t,n+=o*t,"move"===r?i.moveTo(s,n):i.lineTo(s,n);i.closePath()}executeFill(t,e){if(!e)return;if(null==this.repeat)return super.executeFill(t,e);t.save();let i=this.translationX,s=this.translationY;for(const n of this.repeat)t.translate(n.x-i,n.y-s),t.fill(e),i=n.x,s=n.y;t.restore()}executeStroke(t,e){if(!e)return;if(null==this.repeat)return super.executeStroke(t,e);t.save();let i=this.translationX,s=this.translationY;for(const n of this.repeat)t.translate(n.x-i,n.y-s),t.stroke(e),i=n.x,s=n.y;t.restore()}};md.center={x:.5,y:.5},b([hd()],md.prototype,"x",2),b([hd()],md.prototype,"y",2),b([hd({convertor:Math.abs})],md.prototype,"size",2),b([hd()],md.prototype,"repeat",2);var yd=class extends md{updatePath(){const{x:t,y:e,path:i,size:s}=this,n=s/2;i.clear(),i.arc(t,e,n,0,2*Math.PI),i.closePath()}};yd.className="Circle";var fd=class t extends md{updatePath(){const e=this.size/4.2;super.applyPath(e,t.moves)}};fd.className="Cross",fd.moves=[{x:-1,y:0,t:"move"},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:-1,y:1},{x:-1,y:-1}];var xd=fd,bd=class t extends md{updatePath(){const e=this.size/2;super.applyPath(e,t.moves)}};bd.className="Diamond",bd.moves=[{x:0,y:-1,t:"move"},{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:1,y:-1}];var vd=bd,Sd=class extends md{rad(t){return t/180*Math.PI}updatePath(){const{x:t,path:e,size:i,rad:s}=this,n=i/4,a=this.y+n/2;e.clear(),e.arc(t-n,a-n,n,s(130),s(330)),e.arc(t+n,a-n,n,s(220),s(50)),e.lineTo(t,a+n),e.closePath()}};Sd.className="Heart";var Md=class extends md{updatePath(){const{path:t,x:e,y:i}=this,s=this.size,n=.5;t.clear(),t.moveTo(e+-.34375*s,i+-.65625*s),t.cubicCurveTo(e+-.34375*s,i+-.848509*s,e+-.192259*s,i+-1*s,e+0*s,i+-1*s),t.cubicCurveTo(e+(.692259-n)*s,i+-1*s,e+.34375*s,i+-.848509*s,e+.34375*s,i+-.65625*s),t.cubicCurveTo(e+.34375*s,i+-.506176*s,e+.284625*s,i+(.600181-1)*s,e+(.716461-n)*s,i+(.695393-1)*s),t.cubicCurveTo(e+.199009*s,i+-.280231*s,e+(.681271-n)*s,i+-.256896*s,e+(.663785-n)*s,i+(.766105-1)*s),t.cubicCurveTo(e+(.611893-n)*s,i+(.834367-1)*s,e+(.562228-n)*s,i+(.899699-1)*s,e+(.528896-n)*s,i+(.980648-1)*s),t.cubicCurveTo(e+(.524075-n)*s,i+(.992358-1)*s,e+(.512663-n)*s,i+0*s,e+0*s,i+0*s),t.cubicCurveTo(e+(.487337-n)*s,i+0*s,e+(.475925-n)*s,i+(.992358-1)*s,e+(.471104-n)*s,i+(.980648-1)*s),t.cubicCurveTo(e+(.487337-n)*s,i+0*s,e+(.475925-n)*s,i+(.992358-1)*s,e+(.471104-n)*s,i+(.980648-1)*s),t.cubicCurveTo(e+(.437772-n)*s,i+(.899699-1)*s,e+(.388107-n)*s,i+(.834367-1)*s,e+(.336215-n)*s,i+(.766105-1)*s),t.cubicCurveTo(e+(.318729-n)*s,i+-.256896*s,e+-.199009*s,i+-.280231*s,e+(.283539-n)*s,i+(.695393-1)*s),t.cubicCurveTo(e+-.284625*s,i+(.600181-1)*s,e+-.34375*s,i+-.506176*s,e+-.34375*s,i+-.65625*s),t.closePath()}};Md.className="MapPin",Md.center={x:.5,y:1};var kd=class t extends md{updatePath(){const e=this.size/3;super.applyPath(e,t.moves)}};kd.className="Plus",kd.moves=[{x:-.5,y:-.5,t:"move"},{x:0,y:-1},{x:1,y:0},{x:0,y:1},{x:1,y:0},{x:0,y:1},{x:-1,y:0},{x:0,y:1},{x:-1,y:0},{x:0,y:-1},{x:-1,y:0},{x:0,y:-1}];var Dd=kd,wd=class extends md{updatePath(){const{path:t,x:e,y:i}=this,s=this.size/2;t.clear(),t.moveTo(this.align(e-s),this.align(i-s)),t.lineTo(this.align(e+s),this.align(i-s)),t.lineTo(this.align(e+s),this.align(i+s)),t.lineTo(this.align(e-s),this.align(i+s)),t.closePath()}};wd.className="Square";var Id=class extends md{updatePath(){const{x:t,y:e,path:i,size:s}=this,n=s/2,a=Math.PI/2;i.clear();for(let o=0;o<10;o++){const r=o%2==0?s:n,l=o*Math.PI/5-a,h=t+Math.cos(l)*r,c=e+Math.sin(l)*r;i.lineTo(h,c)}i.closePath()}};Id.className="Star";var Cd=class t extends md{updatePath(){const e=1.1*this.size;super.applyPath(e,t.moves)}};Cd.className="Triangle",Cd.moves=[{x:0,y:-.48,t:"move"},{x:.5,y:.87},{x:-1,y:0}];var Ld=Cd,Ad={circle:yd,cross:xd,diamond:vd,heart:Sd,pin:Md,plus:Dd,square:wd,star:Id,triangle:Ld},Td=Object.keys(Ad);function Nd(t){return"string"==typeof t&&Td.includes(t)}function Od(t=wd){return Nd(t)?Ad[t]:"function"==typeof t?t:wd}var Rd=class extends Xc{constructor(){super(...arguments),this.showFocusBox=!0}getScaleInformation({xScale:t,yScale:e}){return{isContinuousX:Ua.is(t),isContinuousY:Ua.is(e),xScaleType:null==t?void 0:t.type,yScaleType:null==e?void 0:e.type}}getModulePropertyDefinitions(){var t,e;const i=null==(t=this.axes.x)?void 0:t.scale,s=null==(e=this.axes.y)?void 0:e.scale;return this.moduleMap.mapModules(t=>t.getPropertyDefinitions(this.getScaleInformation({xScale:i,yScale:s}))).flat()}requestDataModel(t,e,i){return S(this,null,function*(){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=yield t.request(this.id,null!=e?e:[],i);return this.dataModel=s,this.processedData=n,this.dispatch("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}})}isProcessedDataAnimatable(){var t,e;const i=null==(e=null==(t=this.processedData)?void 0:t.reduced)?void 0:e.animationValidation;if(!i)return!0;const{orderedKeys:s,uniqueKeys:n}=i;return s&&n}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(t){return this.doPickFocus(t,this)}doPickFocus(t,e){const i=this.getNodeData();if(void 0===i||0===i.length)return;const{datumIndexDelta:s,seriesRect:n}=t,a=this.computeFocusDatumIndex(t,i,e.seriesItemEnabled);if(void 0===a)return;const{showFocusBox:o}=this,r=i[a],l=this.computeFocusBounds({datumIndex:a,datumIndexDelta:s,seriesRect:n});return void 0!==l?{bbox:l,showFocusBox:o,datum:r,datumIndex:a}:void 0}computeFocusDatumIndex(t,e,i){i&&e.length!==i.length&&R.error(`invalid state: nodeData.length (${e.length} !== seriesItemEnabled.length (${null==i?void 0:i.length})`);const s=t=>{const s=e[t];return(void 0===s.missing||!1===s.missing)&&(void 0===i||i[t])},n=t=>{for(;t>=0&&!s(t);)t--;return-1===t?void 0:t},a=t=>{for(;t<e.length&&!s(t);)t++;return t===e.length?void 0:t};let o;const r=Gs(0,t.datumIndex,e.length-1);return t.datumIndexDelta<0?o=n(r):t.datumIndexDelta>0?o=a(r):(null!=o||(o=a(r)),null!=o||(o=n(r))),void 0===o?0===t.datumIndexDelta?void 0:t.datumIndex-t.datumIndexDelta:o}},Ed=class extends ye{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};b([Yn(ga,{optional:!0})],Ed.prototype,"fill",2),b([Yn(sa,{optional:!0})],Ed.prototype,"fillOpacity",2),b([Yn(ga,{optional:!0})],Ed.prototype,"stroke",2),b([Yn(ia,{optional:!0})],Ed.prototype,"strokeWidth",2),b([Yn(sa,{optional:!0})],Ed.prototype,"strokeOpacity",2),b([Yn(ka,{optional:!0})],Ed.prototype,"lineDash",2),b([Yn(ia,{optional:!0})],Ed.prototype,"lineDashOffset",2);var Pd=class extends ye{};b([Yn(ia,{optional:!0})],Pd.prototype,"strokeWidth",2),b([Yn(sa,{optional:!0})],Pd.prototype,"dimOpacity",2),b([Yn(qn,{optional:!0})],Pd.prototype,"enabled",2);var Bd=class extends ye{constructor(){super(...arguments),this.color="black"}};b([Yn(ga,{optional:!0})],Bd.prototype,"color",2);var Fd=class extends ye{constructor(){super(...arguments),this.item=new Ed,this.series=new Pd,this.text=new Bd}};b([Yn(Xn)],Fd.prototype,"item",2),b([Yn(Xn)],Fd.prototype,"series",2),b([Yn(Xn)],Fd.prototype,"text",2);var zd=class extends ye{constructor(){super(...arguments),this.visible=!0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlightStyle=new Fd}};b([Yn(Jn,{optional:!0})],zd.prototype,"id",2),b([Yn(qn)],zd.prototype,"visible",2),b([Yn(qn)],zd.prototype,"showInLegend",2),b([Yn(Jn)],zd.prototype,"cursor",2),b([Yn(Ra)],zd.prototype,"nodeClickRange",2),b([Yn(Xn)],zd.prototype,"highlightStyle",2);var Gd={x:["xKey"],y:["yKey"]},_d={x:["xName"],y:["yName"]},jd=class extends Hc{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},Wd=class extends zd{};b([Yn(Jn,{optional:!0})],Wd.prototype,"legendItemName",2);var Vd=class extends Rd{constructor(t){var e=t,{pathsPerSeries:i=1,hasMarkers:s=!1,hasHighlightedLabels:n=!1,pathsZIndexSubOrderOffset:a=[],datumSelectionGarbageCollection:o=!0,markerSelectionGarbageCollection:r=!0,animationAlwaysUpdateSelections:l=!1,animationResetFns:h,directionKeys:c,directionNames:d}=e,u=f(e,["pathsPerSeries","hasMarkers","hasHighlightedLabels","pathsZIndexSubOrderOffset","datumSelectionGarbageCollection","markerSelectionGarbageCollection","animationAlwaysUpdateSelections","animationResetFns","directionKeys","directionNames"]);if(super(m({directionKeys:c,directionNames:d,canHaveAxes:!0},u)),this.NodeEvent=jd,this.dataNodeGroup=this.contentGroup.appendChild(new Mo({name:`${this.id}-series-dataNodes`,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("data")})),this.markerGroup=this.contentGroup.appendChild(new Mo({name:`${this.id}-series-markers`,zIndex:4,zIndexSubOrder:this.getGroupZIndexSubOrder("marker")})),this.labelGroup=this.contentGroup.appendChild(new Mo({name:`${this.id}-series-labels`,zIndex:8,zIndexSubOrder:this.getGroupZIndexSubOrder("labels")})),this.labelSelection=Rr.select(this.labelGroup,Po),this.highlightSelection=Rr.select(this.highlightNode,()=>this.opts.hasMarkers?this.markerFactory():this.nodeFactory()),this.highlightLabelSelection=Rr.select(this.highlightLabel,Po),this.annotationSelections=new Set,this.minRectsCache={dirtyNodeData:!0},this.debug=Cs.create(),!c||!d)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:i,hasMarkers:s,hasHighlightedLabels:n,pathsZIndexSubOrderOffset:a,directionKeys:c,directionNames:d,animationResetFns:h,animationAlwaysUpdateSelections:l,datumSelectionGarbageCollection:o,markerSelectionGarbageCollection:r},this.paths=[];for(let t=0;t<i;t++)this.paths[t]=new cd,this.paths[t].zIndex=4,this.paths[t].zIndexSubOrder=this.getGroupZIndexSubOrder("paths",t),this.contentGroup.appendChild(this.paths[t]);this.datumSelection=Rr.select(this.dataNodeGroup,()=>this.nodeFactory(),o),this.markerSelection=Rr.select(this.markerGroup,()=>this.markerFactory(),r),this.animationState=new mr("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),highlightMarkers:t=>this.animateReadyHighlightMarkers(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:t=>this.resetAllAnimation(t),reset:"empty"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){var t;return null==(t=this.contextNodeData)?void 0:t.nodeData}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t?this.animationState.transition("skip"):"disabled"===t&&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(t){return S(this,arguments,function*({seriesRect:t}){var e,i;const{visible:s,_contextNodeData:n}=this,a=(null==(i=null==(e=this.ctx.highlightManager)?void 0:e.getActiveHighlight())?void 0:i.series)===this,o=this.checkResize(t),r=yield this.updateHighlightSelection(a);yield this.updateSelections(s),yield this.updateNodes(r,a,s);const l=this.getAnimationData(t,n);l&&(o&&this.animationState.transition("resize",l),this.animationState.transition("update",l))})}updateSelections(t){return S(this,null,function*(){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=yield this.createNodeData();const t=this.isProcessedDataAnimatable();this._contextNodeData&&(null!=(e=this._contextNodeData).animationValid||(e.animationValid=t)),this.minRectsCache.dirtyNodeData=!0;const{dataModel:i,processedData:s}=this;void 0!==i&&void 0!==s&&this.dispatch("data-update",{dataModel:i,processedData:s})}yield this.updateSeriesSelections()}})}updateSeriesSelections(t){return S(this,null,function*(){const{datumSelection:e,labelSelection:i,markerSelection:s,paths:n}=this,a=this._contextNodeData;if(!a)return;const{nodeData:o,labelData:r,itemId:l}=a;yield this.updatePaths({seriesHighlighted:t,itemId:l,contextData:a,paths:n}),this.datumSelection=yield this.updateDatumSelection({nodeData:o,datumSelection:e}),this.labelSelection=yield this.updateLabelSelection({labelData:r,labelSelection:i}),this.opts.hasMarkers&&(this.markerSelection=yield this.updateMarkerSelection({nodeData:o,markerSelection:s}))})}markerFactory(){return new(Od())}getGroupZIndexSubOrder(t,e=0){var i;const s=super.getGroupZIndexSubOrder(t,e);if("paths"===t){const[t]=s,n=null!=(i=this.opts.pathsZIndexSubOrderOffset[e])?i:0;s[0]=Bt(t)?()=>Number(t())+n:Number(t)+n}return s}updateNodes(t,e,i){return S(this,null,function*(){var s;const{highlightSelection:n,highlightLabelSelection:a,opts:{hasMarkers:o,hasHighlightedLabels:r}}=this,l=!this.ctx.animationManager.isSkipped(),h=this.visible&&null!=this._contextNodeData&&i;this.rootGroup.visible=l||h,this.contentGroup.visible=l||h,this.highlightGroup.visible=(l||h)&&e;const c=this.getOpacity();o?(yield this.updateMarkerNodes({markerSelection:n,isHighlight:!0}),this.animationState.transition("highlightMarkers",n)):(yield this.updateDatumNodes({datumSelection:n,isHighlight:!0}),this.animationState.transition("highlight",n)),r&&(yield this.updateLabelNodes({labelSelection:a}));const{dataNodeGroup:d,markerGroup:u,datumSelection:p,labelSelection:g,markerSelection:m,paths:y,labelGroup:f}=this,{itemId:x}=null!=(s=this.contextNodeData)?s:{};d.opacity=c,d.visible=l||h,f.visible=h,o&&(u.opacity=c,u.zIndex=d.zIndex>=4?d.zIndex:d.zIndex+1,u.visible=h),f&&(f.opacity=c),yield this.updatePathNodes({seriesHighlighted:e,itemId:x,paths:y,opacity:c,visible:h,animationEnabled:l}),d.visible&&(yield this.updateDatumNodes({datumSelection:p,highlightedItems:t,isHighlight:!1}),yield this.updateLabelNodes({labelSelection:g}),o&&(yield this.updateMarkerNodes({markerSelection:m,isHighlight:!1})))})}getHighlightLabelData(t,e){const i=t.filter(t=>t.datum===e.datum&&t.itemId===e.itemId);return 0===i.length?void 0:i}getHighlightData(t,e){return e?[e]:void 0}updateHighlightSelection(t){return S(this,null,function*(){var e;const{highlightSelection:i,highlightLabelSelection:s,_contextNodeData:n}=this;if(!n)return;const a=null==(e=this.ctx.highlightManager)?void 0:e.getActiveHighlight(),o=t&&(null==a?void 0:a.datum)?a:void 0;let r,l;if(null!=o){const t=this.isLabelEnabled(),{labelData:e,nodeData:i}=n;l=this.getHighlightData(i,o),r=t?this.getHighlightLabelData(e,o):void 0}return this.highlightSelection=yield this.updateHighlightSelectionItem({items:l,highlightSelection:i}),this.highlightLabelSelection=yield this.updateHighlightSelectionLabel({items:r,highlightLabelSelection:s}),l})}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:t}of this.datumSelection)!0!==t.datum.missing&&(yield t)}getQuadTree(){if(void 0===this.quadtree){const{width:t,height:e}=this.ctx.scene.canvas,i=new Qs(0,0,t,e);this.quadtree=new dd(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(t){}pickNodeExactShape(t){var e;const i=super.pickNodeExactShape(t);if(i)return i;const{x:s,y:n}=t,{opts:{hasMarkers:a}}=this;let o;const{dataNodeGroup:r,markerGroup:l}=this;if(o=r.pickNode(s,n),!o&&a&&(o=null==l?void 0:l.pickNode(s,n)),o&&!0!==o.datum.missing)return{datum:o.datum,distance:0};for(const i of this.moduleMap.modules()){const{datum:s}=null!=(e=i.pickNodeExact(t))?e:{};if(null!=s&&!0!==(null==s?void 0:s.missing))return{datum:s,distance:0}}}pickNodeClosestDatum(t){var e,i;const{x:s,y:n}=t,{axes:a,rootGroup:o,_contextNodeData:r}=this;if(!r)return;const l=a.x,h=a.y,c=o.transformPoint(s,n);let d,u=1/0;for(const t of r.nodeData){const{point:{x:e=NaN,y:i=NaN}={}}=t;if(isNaN(e)||isNaN(i))continue;if(!(null==l?void 0:l.inRange(e))||!(null==h?void 0:h.inRange(i)))continue;const s=Math.max(p(c.x-e,2)+p(c.y-i,2),0);s<u&&(u=s,d=t)}for(const e of this.moduleMap.modules()){const i=e.pickNodeNearest(t);if(void 0!==i&&i.distanceSquared<u){u=i.distanceSquared,d=i.datum;break}}return d?{datum:d,distance:Math.max(Math.sqrt(u)-(null!=(i=null==(e=d.point)?void 0:e.size)?i:0),0)}:void 0}pickNodeMainAxisFirst(t,e){var i,s,n,a;const{x:o,y:r}=t,{axes:l,rootGroup:h,_contextNodeData:c}=this;if(!c)return;const d=l.x,u=l.y,g=[d,u].filter(t=>t instanceof Il).map(t=>t.direction);if(e&&0===g.length)return;const[m="x"]=g,y=h.transformPoint(o,r),f="x"===m?[y.x,y.y]:[y.y,y.x],x=[1/0,1/0];let b;for(const t of c.nodeData){const{x:e=NaN,y:n=NaN}=null!=(s=null!=(i=t.point)?i:t.midPoint)?s:{};if(isNaN(e)||isNaN(n)||!0===t.missing)continue;if(!(null==d?void 0:d.inRange(e))||!(null==u?void 0:u.inRange(n)))continue;const a="x"===m?[e,n]:[n,e];let o=!0;for(let t=0;t<a.length;t++){const e=Math.abs(a[t]-f[t]);if(e>x[t]){o=!1;break}e<x[t]&&(x[t]=e,x.fill(1/0,t+1,x.length))}o&&(b=t)}if(b){let e=Math.max(p(x[0],2)+p(x[1],2)-(null!=(a=null==(n=b.point)?void 0:n.size)?a:0),0);for(const i of this.moduleMap.modules()){const s=i.pickNodeMainAxisFirst(t);if(void 0!==s&&s.distanceSquared<e){b=s.datum,e=s.distanceSquared;break}}return{datum:b,distance:Math.sqrt(e)}}}onLegendItemClick(t){const{legendItemName:e}=this.properties,{enabled:i,itemId:s,series:n}=t,a=null!=e&&e===t.legendItemName;(n.id===this.id||a)&&this.toggleSeriesItem(s,i)}onLegendItemDoubleClick(t){const{enabled:e,itemId:i,series:s,numVisibleItems:n}=t,{legendItemName:a}=this.properties,o=null!=a&&a===t.legendItemName;s.id===this.id||o||e&&1===n?this.toggleSeriesItem(i,!0):this.toggleSeriesItem(i,!1)}isPathOrSelectionDirty(){return!1}getLabelData(){return[]}shouldFlipXY(){return!1}getMinRects(t,e){const{dirtyNodeData:i,sizeCache:s,minRect:n,minVisibleRect:a}=this.minRectsCache,o=JSON.stringify({width:t,height:e});if(o===s&&!i&&n&&a)return{minRect:n,minVisibleRect:a};const r=this.computeMinRects(t,e);return this.minRectsCache={dirtyNodeData:!1,sizeCache:o,minRect:null==r?void 0:r.minRect,minVisibleRect:null==r?void 0:r.minVisibleRect},r}computeMinRects(t,e){var i,s;const n=this._contextNodeData;if(!(null==n?void 0:n.nodeData.length))return;const{nodeData:a}=n,o=Array(a.length),r=Array(a.length);for(const[t,{midPoint:e}]of a.entries())o[t]=null!=(i=null==e?void 0:e.x)?i:0,r[t]=null!=(s=null==e?void 0:e.y)?s:0;let l,h,c,d;o.sort((t,e)=>t-e),r.sort((t,e)=>t-e);let u=0,p=0;for(let i=1;i<a.length;i++)o[i]>=0&&(null!=l||(l=i)),o[i]>t&&(null!=h||(h=i)),r[i]>=0&&(null!=c||(c=i)),r[i]>e&&(null!=d||(d=i)),u=Math.max(u,o[i]-o[i-1]),p=Math.max(p,r[i]-r[i-1]);null!=h||(h=a.length),null!=d||(d=a.length);const g=null!=l&&null!=h?o.slice(l,h):[],m=null!=c&&null!=d?r.slice(c,d):[];let y=0,f=0;for(let t=1;t<Math.max(g.length,m.length);t++){const e=g[t],i=g[t-1],s=m[t],n=m[t-1];null!=e&&null!=i&&(y=Math.max(y,e-i)),null!=s&&null!=n&&(f=Math.max(f,s-n))}return{minRect:new Qs(0,0,u,p),minVisibleRect:new Qs(0,0,y,f)}}updateHighlightSelectionItem(t){const{opts:{hasMarkers:e}}=this,{items:i,highlightSelection:s}=t,n=null!=i?i:[];if(e){const t=s;return this.updateMarkerSelection({nodeData:n,markerSelection:t})}return this.updateDatumSelection({nodeData:n,datumSelection:s})}updateHighlightSelectionLabel(t){var e;return this.updateLabelSelection({labelData:null!=(e=t.items)?e:[],labelSelection:t.highlightLabelSelection})}updateDatumSelection(t){return S(this,null,function*(){return t.datumSelection})}updateDatumNodes(t){return S(this,null,function*(){})}updateMarkerSelection(t){return S(this,null,function*(){return t.markerSelection})}updateMarkerNodes(t){return S(this,null,function*(){})}updatePaths(t){return S(this,null,function*(){t.paths.forEach(t=>t.visible=!1)})}updatePathNodes(t){return S(this,null,function*(){const{paths:e,opacity:i,visible:s}=t;for(const t of e)t.opacity=i,t.visible=s})}resetAllAnimation(t){var e,i,s;const{path:n,datum:a,label:o,marker:r}=null!=(i=null==(e=this.opts)?void 0:e.animationResetFns)?i:{};this.ctx.animationManager.stopByAnimationGroupId(this.id),n&&t.paths.forEach(t=>{gr([t],n)}),a&&gr([t.datumSelection],a),o&&gr([t.labelSelection],o),r&&this.opts.hasMarkers&&gr([t.markerSelection],r),!1===(null==(s=t.contextData)?void 0:s.animationValid)&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){var e,i;const{datum:s}=null!=(i=null==(e=this.opts)?void 0:e.animationResetFns)?i:{};s&&gr([t],s)}animateReadyHighlightMarkers(t){var e,i;const{marker:s}=null!=(i=null==(e=this.opts)?void 0:e.animationResetFns)?i:{};s&&gr([t],s)}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animationTransitionClear(){const t=this.getAnimationData();t&&this.animationState.transition("clear",t)}getAnimationData(t,e){const{_contextNodeData:i}=this;if(i)return{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:e,paths:this.paths,seriesRect:t}}calculateScaling(){const t={};for(const e of Object.values(Ka)){const i=this.axes[e];if(i)if(i.scale instanceof Or){const{range:s,domain:n}=i.scale;t[e]={type:"log",convert:t=>i.scale.convert(t),domain:[n[0],n[1]],range:[s[0],s[1]]}}else if(i.scale instanceof Ua){const{range:s}=i.scale,n=i.scale.getDomain();t[e]={type:"continuous",domain:[n[0],n[1]],range:[s[0],s[1]]}}else if(i.scale){const{domain:s}=i.scale;t[e]={type:"category",domain:s,range:s.map(t=>i.scale.convert(t))}}}return t}},Kd=["top","right","bottom","left"],Yd=class t extends sd{constructor(t,e){super(t,e),this.paired=!0,this.firstSeriesTranslation=!0,this._lastCrossLineIds=void 0,this._lastAxisWidths={top:0,bottom:0,left:0,right:0},this._lastClipSeries=!1,this._lastVisibility={crossLines:!0,series:!0}}onAxisChange(t,e){super.onAxisChange(t,e),this.zoomManager.updateAxes(t)}destroySeries(t){super.destroySeries(t),this.firstSeriesTranslation=!0}performLayout(){return S(this,null,function*(){const e=yield v(t.prototype,this,"performLayout").call(this),{firstSeriesTranslation:i,seriesRoot:s,annotationRoot:n,highlightRoot:a}=this,{animationRect:o,seriesRect:r,visibility:l,clipSeries:h}=this.updateAxes(e);this.seriesRoot.visible=l.series,this.seriesRect=r,this.animationRect=o;const{x:c,y:d}=r;if(i){for(const t of[s,n,a])t.translationX=Math.floor(c),t.translationY=Math.floor(d);this.firstSeriesTranslation=!1}else{const{translationX:t,translationY:e}=s;Tn(this.id,"seriesRect",this.ctx.animationManager,[s,a,n],{translationX:t,translationY:e},{translationX:Math.floor(c),translationY:Math.floor(d)},{phase:"update"})}const u=r.clone().grow(this.seriesArea.padding);this.hoverRect=u;const p=this.seriesArea.clip||h?u:void 0;s.setClipRectInGroupCoordinateSpace(p),a.setClipRectInGroupCoordinateSpace(p),n.setClipRectInGroupCoordinateSpace(p),this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:h,series:{rect:r,paddedRect:u,visible:l.series,shouldFlipXY:this.shouldFlipXY()},axes:this.axes.map(t=>m({id:t.id},t.getLayoutState()))});const g=this.modulesManager.mapModules(t=>{var e;return null==(e=t.performCartesianLayout)?void 0:e.call(t,{seriesRect:r})});return yield Promise.all(g),e})}updateAxes(t){var e;const i=this.axes.flatMap(t=>{var e;return null!=(e=t.crossLines)?e:[]}).map(t=>t.id);let s,n,a;null!=this._lastCrossLineIds&&this._lastCrossLineIds.length===i.length&&this._lastCrossLineIds.every((t,e)=>i[e]===t)?(s=m({},this._lastAxisWidths),n=this._lastClipSeries,a=m({},this._lastVisibility)):(s={top:0,bottom:0,left:0,right:0},n=!1,a={crossLines:!0,series:!0},this._lastCrossLineIds=i);const o=new Set(this.axes.map(t=>t.position));for(const t of Object.keys(s))o.has(t)||delete s[t];const r=(t,e,i)=>!Object.keys(t).some(t=>null==s[t])&&a.crossLines===i.crossLines&&a.series===i.series&&Object.entries(s).every(([e,i])=>{const s=t[e];return null==i&&null==s||i===s})&&n===e,l=t=>Zt(t,t=>t&&Math.abs(t)===1/0?0:null!=t?Math.ceil(t):t);let h={},c={},d=!1,u=null==(e=this.seriesRect)?void 0:e.clone(),p=0,g={};do{Object.assign(s,h),n=d,Object.assign(a,c);const e=this.updateAxesPass(s,t.clone(),u);if(h=l(e.axisWidths),c=e.visibility,d=e.clipSeries,u=e.seriesRect,g=e.primaryTickCounts,p++>10){R.warn("unable to find stable axis layout.");break}}while(!r(h,d,c));return this.axes.forEach(t=>{t.update(g[t.direction])}),this.axes.forEach(e=>{if(e.setCrossLinesVisible(a.crossLines),u)switch(e.clipGrid(u.x,u.y,u.width+5,u.height+5),e.position){case"left":case"right":e.clipTickLines(t.x,u.y,t.width+5,u.height+5);break;case"top":case"bottom":e.clipTickLines(u.x,t.y,u.width+5,t.height+5)}}),this._lastAxisWidths=s,this._lastVisibility=a,{seriesRect:u,animationRect:t,visibility:a,clipSeries:n}}updateAxesPass(t,e,i){const s={},n={},a={series:!0,crossLines:!0};let o=!1;const r={},l=this.applySeriesPadding(e),h=i?this.buildCrossLinePadding(t):{},c=this.buildAxisBound(l,t,h,a),d=this.buildSeriesRect(c,t);return this.axes.forEach(e=>{var i,a;const{position:h="left"}=e,{clipSeries:u,axisThickness:p,axisOffset:g}=this.calculateAxisDimensions({axis:e,seriesRect:d,paddedBounds:l,axisWidths:t,newAxisWidths:n,primaryTickCounts:r,clipSeries:o,addInterAxisPadding:(null!=(i=s[h])?i:0)>0});s[h]=(null!=(a=s[h])?a:0)+1,o=o||u,this.positionAxis({axis:e,axisBound:c,axisOffset:g,axisThickness:p,axisWidths:t,primaryTickCounts:r,seriesRect:d})}),{clipSeries:o,seriesRect:d,axisWidths:n,visibility:a,primaryTickCounts:r}}buildCrossLinePadding(t){var e;const i={};this.axes.forEach(t=>{t.crossLines&&t.crossLines.forEach(t=>{var e;null==(e=t.calculatePadding)||e.call(t,i)})});for(const[s,n=0]of Object.entries(i))i[s]=Math.max(n-(null!=(e=t[s])?e:0),0);return i}applySeriesPadding(t){const e=t.clone(),i=this.axes.slice().reverse();return Kd.forEach(t=>{const s=this.seriesArea.padding[t],n=i.find(e=>e.position===t);n?n.seriesAreaPadding=s:e.shrink(s,t)}),e}buildAxisBound(t,e,i,s){var n,a,o,r;const l=t.clone(),{top:h=0,right:c=0,bottom:d=0,left:u=0}=i,p=u+c,g=h+d,m=(null!=(n=e.left)?n:0)+(null!=(a=e.right)?a:0)+p,y=(null!=(o=e.top)?o:0)+(null!=(r=e.bottom)?r:0)+g;return l.width<=m||l.height<=y?(s.crossLines=!1,s.series=!1,l):(l.x+=u,l.y+=h,l.width-=p,l.height-=g,l)}buildSeriesRect(t,e){const i=t.clone(),{top:s,bottom:n,left:a,right:o}=e;return i.x+=null!=a?a:0,i.y+=null!=s?s:0,i.width-=(null!=a?a:0)+(null!=o?o:0),i.height-=(null!=s?s:0)+(null!=n?n:0),i.width=Math.max(0,i.width),i.height=Math.max(0,i.height),i}clampToOutsideSeriesRect(t,e,i,s){const{x:n,y:a,width:o,height:r}=t,l=[n,a,n+o,a+r][("x"===i?0:1)+(1===s?0:2)];return(1===s?Math.min:Math.max)(e,l)}calculateAxisDimensions(t){var e,i,s;const{axis:n,seriesRect:a,paddedBounds:o,axisWidths:r,newAxisWidths:l,primaryTickCounts:h,addInterAxisPadding:c}=t;let{clipSeries:d}=t;const{position:u="left",direction:p}=n,g=n instanceof Il||n instanceof Fl,m="left"===u||"right"===u,y=null!=(e=l[u])?e:0,{min:f,max:x}=this.ctx.zoomManager.getAxisZoom(n.id);m?(g?(n.range=[0,a.height],n.visibleRange=[1-x,1-f]):(n.range=[a.height,0],n.visibleRange=[f,x]),n.gridLength=a.width):(n.range=[0,a.width],n.visibleRange=[f,x],n.gridLength=a.height);let b=n.nice?h[p]:void 0;const v="y"===p;n.thickness?n.maxThickness=n.thickness:n.maxThickness=.3*(v?o.width:o.height);const S=n.calculateLayout(b);let M;if(b=S.primaryTickCount,null!=h[p]||(h[p]=b),d||(d=n.dataDomain.clipped||n.visibleRange[0]>0||n.visibleRange[1]<1),null!=n.thickness&&n.thickness>0)M=n.thickness;else{const{bbox:t}=S;M=v?t.width:t.height}return c&&(M+=15),M=Math.ceil(M),l[u]=(null!=(i=l[u])?i:0)+M,n.gridPadding=(null!=(s=r[u])?s:0)-l[u],{clipSeries:d,axisThickness:M,axisOffset:y,primaryTickCount:b}}positionAxis(t){var e,i,s,n;const{axis:a,axisBound:o,axisWidths:r,seriesRect:l,axisOffset:h,axisThickness:c}=t,{position:d}=a;switch(d){case"top":a.translation.x=o.x+(null!=(e=r.left)?e:0),a.translation.y=this.clampToOutsideSeriesRect(l,o.y+1+h+c,"y",1);break;case"bottom":a.translation.x=o.x+(null!=(i=r.left)?i:0),a.translation.y=this.clampToOutsideSeriesRect(l,o.y+o.height+1-c-h,"y",-1);break;case"left":a.translation.y=o.y+(null!=(s=r.top)?s:0),a.translation.x=this.clampToOutsideSeriesRect(l,o.x+h+c,"x",1);break;case"right":a.translation.y=o.y+(null!=(n=r.top)?n:0),a.translation.x=this.clampToOutsideSeriesRect(l,o.x+o.width-c-h,"x",-1)}a.updatePosition({rotation:Fn(a.rotation),sideFlag:a.label.getSideFlag()})}shouldFlipXY(){return!this.series.some(t=>!(t instanceof Vd&&t.shouldFlipXY()))}};Yd.className="CartesianChart",Yd.type="cartesian";var $d=Yd,Hd=class t{static isInstance(e){var i;return e instanceof t||"AgChartInstanceProxy"===(null==(i=e.constructor)?void 0:i.name)&&null!=e.chart||null!=e.chart&&this.validateImplementation(e)}static validateImplementation(t){var e;const i=Object.keys(null!=(e=Object.getPrototypeOf(t))?e:{});return["getOptions","destroy"].every(t=>i.includes(t))}constructor(t){this.chart=t}getOptions(){return Se(this.chart.getOptions())}resetAnimations(){this.chart.resetAnimations()}skipAnimations(){this.chart.skipAnimations()}destroy(){this.chart.destroy()}};Hd.chartInstances=new WeakMap,b([Ur({oldValue(t){Hd.chartInstances.delete(t)},newValue(t){Hd.chartInstances.set(t,this)}})],Hd.prototype,"chart",2);var Ud=Hd,Xd=class extends Ua{constructor(){super([0,1],[0,1]),this.type="number"}toDomain(t){return t}ticks(){var t;const e=null!=(t=this.tickCount)?t:Ua.defaultTickCount;if(!this.domain||this.domain.length<2||e<1||this.domain.some(t=>!isFinite(t)))return[];this.refresh();const[i,s]=this.getDomain(),{interval:n}=this;if(n){const t=Math.abs(n);if(!po({start:i,stop:s,interval:t,availableRange:this.getPixelRange()}))return uo(i,s,t)}return lo(i,s,e,this.minTickCount,this.maxTickCount)}update(){!this.domain||this.domain.length<2||this.nice&&this.updateNiceDomain()}getTickStep(t,e){var i,s;const n=null!=(i=this.tickCount)?i:Ua.defaultTickCount;return null!=(s=this.interval)?s:co(t,e,n,this.minTickCount,this.maxTickCount)}updateNiceDomain(){var t;const e=null!=(t=this.tickCount)?t:Ua.defaultTickCount;if(e<1)return void(this.niceDomain=[...this.domain]);let[i,s]=this.domain;if(1===e)[i,s]=function(t,e){const i=Math.abs(e-t),s=Math.floor(Math.log10(i)),n=Math.pow(10,s),a=t>e?Math.ceil:Math.floor,o=e<t?Math.floor:Math.ceil;return ho.map(s=>{const r=s*n,l=a(t/r)*r,h=o(e/r)*r;return{error:1-i/Math.abs(h-l),domain:[l,h]}}).sort((t,e)=>t.error-e.error)[0].domain}(i,s);else{const t=i>s?Math.ceil:Math.floor,e=s<i?Math.floor:Math.ceil,n=4;for(let a=0;a<n;a++){const n=i,a=s,o=this.getTickStep(i,s),[r,l]=this.domain;if(o>=1)i=t(r/o)*o,s=e(l/o)*o;else{const n=1/o;i=t(r*n)/n,s=e(l*n)/n}if(i===n&&s===a)break}}this.niceDomain=[i,s]}tickFormat({ticks:t,specifier:e}){return Tr(null!=t?t:this.ticks(),e)}};var Zd=class extends Va{constructor(){super(...arguments),this.minSpacing=NaN,this.maxSpacing=NaN}};b([Yn(Ba),Kn(NaN)],Zd.prototype,"minSpacing",2),b([Yn(Fa),Kn(NaN)],Zd.prototype,"maxSpacing",2);var qd=class extends Dl{constructor(t,e=new Xd){super(t,e),this.min=NaN,this.max=NaN}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=ls(t,e,i);return{domain:s,clipped:n}}createTick(){return new Zd}updateSecondaryAxisTicks(t){if(null==this.dataDomain)throw new Error("AG Charts - dataDomain not calculated, cannot perform tick calculation.");if(0===this.dataDomain.domain.length)return[];const[e,i]=function(t,e,i){let[s,n]=js(t);s=function(t,e,i){const s=Math.abs(e-t)/(i-1),n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return Math.floor(t/a)*a}(Math.floor(s),n,e);const a=function(t,e,i){return function(t){const e=Math.floor(Math.log10(t)),i=Math.pow(10,e),s=t/i*10;return s>0&&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}((e-t)/(i-1))}(s,n,e);n=s+(e-1)*a;const o=i?[n,s]:[s,n],r=function(t,e,i){const s=Math.floor(Math.log10(e)),n=e>0&&e<1?Math.abs(s):0,a=Math.pow(10,n),o=ro(n);for(let s=0;s<i;s++){const i=t+e*s;o[s]=Math.round(i*a)/a}return o}(s,a,e);return[o,r]}(this.dataDomain.domain,null!=t?t:0,this.reverse);return this.scale.nice=!1,this.scale.domain=e,this.scale.update(),i}formatDatum(t){return"number"==typeof t?t.toFixed(2):String(t)}};qd.className="NumberAxis",qd.type="number",b([Yn(Hn(aa,ha("max"))),Kn(NaN)],qd.prototype,"min",2),b([Yn(Hn(aa,ca("min"))),Kn(NaN)],qd.prototype,"max",2);var Qd=za(t=>jt(t)&&0!==t,"a non-zero number"),Jd=class extends qd{constructor(t){super(t,new Or),this.min=NaN,this.max=NaN}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=ls(t,e,i),a=s[0]>s[1],o=s[0]<0&&s[1]>0,r=0===s[0]&&0===s[1];return(a||o||r)&&(o?R.warn("the data domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."):r&&R.warn("the data domain has 0 extent, no data is rendered.")),0===s[0]&&(s[0]=1),0===s[1]&&(s[1]=-1),{domain:s,clipped:n}}set base(t){this.scale.base=t}get base(){return this.scale.base}};Jd.className="LogAxis",Jd.type="log",b([Yn(Hn(aa,Qd,ha("max"))),Kn(NaN)],Jd.prototype,"min",2),b([Yn(Hn(aa,Qd,ca("min"))),Kn(NaN)],Jd.prototype,"max",2);var tu=class extends Va{constructor(){super(...arguments),this.minSpacing=NaN,this.maxSpacing=NaN}};b([Yn(Ba),Kn(NaN)],tu.prototype,"minSpacing",2),b([Yn(Fa),Kn(NaN)],tu.prototype,"maxSpacing",2);var eu=class extends Dl{constructor(t){super(t,new mo),this.min=void 0,this.max=void 0,this.refreshScale()}normaliseDataDomain(t){var e;let{min:i,max:s}=this,n=!1;return"number"==typeof i&&(i=new Date(i)),"number"==typeof s&&(s=new Date(s)),t.length>2&&(t=(null!=(e=os(t))?e:[0,1e3]).map(t=>new Date(t))),i instanceof Date&&(n||(n=i>t[0]),t=[i,t[1]]),s instanceof Date&&(n||(n=s<t[1]),t=[t[0],s]),t[0]>t[1]&&(t=[]),{domain:t,clipped:n}}createTick(){return new tu}onLabelFormatChange(t,e,i){i?super.onLabelFormatChange(t,e,i):this.labelFormatter=this.scale.tickFormat({ticks:t,domain:e})}calculatePadding(){return[0,0]}formatDatum(t){var e;const i=this.scale.tickFormat({specifier:"%m/%d/%y, %H:%M:%S"});return null!=(e=this.moduleCtx.callbackCache.call(i,t))?e:String(t)}};eu.className="TimeAxis",eu.type="time",b([Yn(Hn(ua,ha("max")),{optional:!0})],eu.prototype,"min",2),b([Yn(Hn(ua,ca("min")),{optional:!0})],eu.prototype,"max",2);var iu=1e-6,su=(t,e,i,s,n)=>{let a=!1,o=!1,r=s-Math.sqrt(Math.max(p(n,2)-p(i,2),0)),l=0,h=0,c=i-Math.sqrt(Math.max(p(n,2)-p(s,2),0));return r>t?(a=!0,r=t,l=i-Math.sqrt(Math.max(p(n,2)-p(s-t,2)))):r<iu&&(r=0),c>e?(o=!0,h=s-Math.sqrt(Math.max(p(n,2)-p(i-e,2))),c=e):c<iu&&(c=0),{leading0:r,leading1:l,trailing0:h,trailing1:c,leadingClipped:a,trailingClipped:o}},nu=(t,{x0:e,y0:i,x1:s,y1:n,cx:a,cy:o},r,l)=>{if(l&&t.moveTo(e,i),e!==s||i!==n){const l=Math.atan2(i-o,e-a),h=Math.atan2(n-o,s-a);t.arc(a,o,r,l,h)}else t.lineTo(e,i)},au=(t,e,i,s,n,a,o)=>{let{topLeft:r,topRight:l,bottomRight:h,bottomLeft:c}=a;const d=Math.max(r+c,l+h),u=Math.max(r+l,c+h);if(d<=0&&u<=0)return void(null==o?t.rect(e,i,s,n):t.rect(o.x,o.y,o.width,o.height));if(null==o&&r===l&&r===h&&r===c)return void t.roundRect(e,i,s,n,r);if(s<0&&(e+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(null==o)o=new Qs(e,i,s,n);else{const t=Math.max(e,o.x),a=Math.min(e+s,o.x+o.width),r=Math.max(i,o.y),l=Math.min(i+n,o.y+o.height);o=new Qs(t,r,a-t,l-r)}const p=Math.max(d/n,u/s,1);p>1&&(r/=p,l/=p,h/=p,c/=p);let g,m,y,f,x=!0,b=!0,v=!0,S=!0;if(x){const t=su(o.height,o.width,Math.max(e+r-o.x,0),Math.max(i+r-o.y,0),r);t.leadingClipped&&(S=!1),t.trailingClipped&&(b=!1),g={x0:Math.max(o.x+t.leading1,o.x),y0:Math.max(o.y+t.leading0,o.y),x1:Math.max(o.x+t.trailing1,o.x),y1:Math.max(o.y+t.trailing0,o.y),cx:e+r,cy:i+r}}if(b){const t=su(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(e+s-l),0),l);t.leadingClipped&&(x=!1),t.trailingClipped&&(v=!1),m={x0:Math.min(o.x+o.width-t.leading0,o.x+o.width),y0:Math.max(o.y+t.leading1,o.y),x1:Math.min(o.x+o.width-t.trailing0,o.x+o.width),y1:Math.max(o.y+t.trailing1,o.y),cx:e+s-l,cy:i+l}}if(v){const t=su(o.height,o.width,Math.max(o.x+o.width-(e+s-h),0),Math.max(o.y+o.height-(i+n-h),0),h);t.leadingClipped&&(b=!1),t.trailingClipped&&(S=!1),y={x0:Math.min(o.x+o.width-t.leading1,o.x+o.width),y0:Math.min(o.y+o.height-t.leading0,o.y+o.height),x1:Math.min(o.x+o.width-t.trailing1,o.x+o.width),y1:Math.min(o.y+o.height-t.trailing0,o.y+o.height),cx:e+s-h,cy:i+n-h}}if(S){const t=su(o.width,o.height,Math.max(o.y+o.height-(i+n-c),0),Math.max(e+c-o.x,0),c);t.leadingClipped&&(v=!1),t.trailingClipped&&(x=!1),f={x0:Math.max(o.x+t.leading0,o.x),y0:Math.min(o.y+o.height-t.leading1,o.y+o.height),x1:Math.max(o.x+t.trailing0,o.x),y1:Math.min(o.y+o.height-t.trailing1,o.y+o.height),cx:e+c,cy:i+n-c}}let M=!1;x&&null!=g&&(nu(t,g,r,!M),M||(M=!0)),b&&null!=m&&(nu(t,m,l,!M),M||(M=!0)),v&&null!=y&&(nu(t,y,h,!M),M||(M=!0)),S&&null!=f&&(nu(t,f,c,!M),M||(M=!0)),t.closePath()},ou=class extends cd{constructor(){super(...arguments),this.borderPath=new ld,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=Co.defaultStyles.strokeWidth,this.effectiveStrokeWidth=Co.defaultStyles.strokeWidth,this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquared,this.microPixelEffectOpacity=1}set cornerRadius(t){this.topLeftCornerRadius=t,this.topRightCornerRadius=t,this.bottomRightCornerRadius=t,this.bottomLeftCornerRadius=t}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||Boolean(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){var t,e,i;const{path:s,borderPath:n,crisp:a,topLeftCornerRadius:o,topRightCornerRadius:r,bottomRightCornerRadius:l,bottomLeftCornerRadius:h}=this;let{x:c,y:d,width:u,height:p,strokeWidth:g,clipBBox:m}=this;const y=1/(null!=(e=null==(t=this.layerManager)?void 0:t.canvas.pixelRatio)?e:1);let f=1;if(s.clear(!0),n.clear(!0),a&&(u<=y&&(f*=u/y),p<=y&&(f*=p/y),u=this.align(c,u),p=this.align(d,p),c=this.align(c),d=this.align(d),m=null!=m?new Qs(this.align(m.x),this.align(m.y),this.align(m.x,m.width),this.align(m.y,m.height)):void 0),g)if(u<y){const t=c+y/2;n.moveTo(t,d),n.lineTo(t,d+p),g=y,this.borderClipPath=void 0}else if(p<y){const t=d+y/2;n.moveTo(c,t),n.lineTo(c+u,t),g=y,this.borderClipPath=void 0}else if(g<u&&g<p){const t=g/2;c+=t,d+=t,u-=g,p-=g;const e=null==m?void 0:m.clone().shrink(t),i={topLeft:o>0?o-g:0,topRight:r>0?r-g:0,bottomRight:l>0?l-g:0,bottomLeft:h>0?h-g:0};this.borderClipPath=void 0,u>0&&p>0&&(null==e||(null==e?void 0:e.width)>0&&(null==e?void 0:e.height)>0)&&(au(s,c,d,u,p,i,e),au(n,c,d,u,p,i,e))}else this.borderClipPath=null!=(i=this.borderClipPath)?i:new ld,this.borderClipPath.clear(!0),this.borderClipPath.rect(c,d,u,p),n.rect(c,d,u,p);else{const t={topLeft:o,topRight:r,bottomRight:l,bottomLeft:h};this.borderClipPath=void 0,au(s,c,d,u,p,t,m)}[o,r,l,h].every(t=>0===t)?(this.hittester=(t,e)=>{const i=this.transformPoint(t,e);return this.getCachedBBox().containsPoint(i.x,i.y)},this.distanceSquared=(t,e)=>this.getCachedBBox().distanceSquared(t,e)):(this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquared),this.effectiveStrokeWidth=g,this.lastUpdatePathStrokeWidth=g,this.microPixelEffectOpacity=f}computeBBox(){var t;const{x:e,y:i,width:s,height:n,clipBBox:a}=this;return null!=(t=null==a?void 0:a.clone())?t:new Qs(e,i,s,n)}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:a,lineDashOffset:o,lineCap:r,lineJoin:l,borderPath:h,borderClipPath:c,opacity:d,microPixelEffectOpacity:u}=this;c&&t.clip(c.getPath2D()),t.strokeStyle=e,t.globalAlpha*=d*n*u,t.lineWidth=i,a&&t.setLineDash(a),o&&(t.lineDashOffset=o),r&&(t.lineCap=r),l&&(t.lineJoin=l),t.stroke(h.getPath2D()),t.globalAlpha=s}}};ou.className="Rect",b([hd()],ou.prototype,"x",2),b([hd()],ou.prototype,"y",2),b([hd()],ou.prototype,"width",2),b([hd()],ou.prototype,"height",2),b([hd()],ou.prototype,"topLeftCornerRadius",2),b([hd()],ou.prototype,"topRightCornerRadius",2),b([hd()],ou.prototype,"bottomRightCornerRadius",2),b([hd()],ou.prototype,"bottomLeftCornerRadius",2),b([hd()],ou.prototype,"clipBBox",2),b([hd()],ou.prototype,"crisp",2);var ru=class extends vt{constructor(t){super(),this.node=new Mo({name:"background",zIndex:0}),this.rectNode=new ou,this.visible=!0,this.fill="white",this.node.appendChild(this.rectNode),this.destroyFns.push(t.scene.attachNode(this.node),t.layoutService.addListener("layout-complete",t=>this.onLayoutComplete(t)))}onLayoutComplete(t){const{width:e,height:i}=t.chart;this.rectNode.width=e,this.rectNode.height=i}};b([Yn(qn),Hr("node","visible")],ru.prototype,"visible",2),b([Yn(ga,{optional:!0}),Hr("rectNode","fill")],ru.prototype,"fill",2),b([Yn(Xn,{optional:!0})],ru.prototype,"image",2);var lu={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology"],instanceConstructor:ru};function hu({orientation:t,bboxes:e,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:a=0,forceResult:o=!1}){const r="horizontal"===t,l={max:r?s:i,fn:r?t=>t.width:t=>t.height,padding:r?a:n},h={max:r?i:s,fn:r?t=>t.height:t=>t.width,padding:r?n:a};let c=0;const d=[];for(;c<e.length;){const t=cu(e.slice(c),c,l,h,o);if(!t)return;c+=t.processedBBoxCount,d.push(t.pageIndices)}return function(t,e,i,s,n){let a=0,o=0;return{pages:t.map(t=>{"horizontal"===e&&(t=function(t){const e=[];for(const i of t[0])e.push([]);return t.forEach((t,i)=>{t.forEach((t,s)=>{e[s][i]=t})}),e}(t));let r=0;const l=t.map(t=>{const e=t.map(t=>(r=Math.max(t,r),i[t]));let a=0,o=0;return e.forEach(t=>{a+=t.height+s,o=Math.max(o,t.width+n)}),{indices:t,bboxes:e,columnHeight:Math.ceil(a),columnWidth:Math.ceil(o)}});let h=0,c=0;return l.forEach(t=>{h+=t.columnWidth,c=Math.max(c,t.columnHeight)}),a=Math.max(h,a),o=Math.max(c,o),{columns:l,startIndex:t[0][0],endIndex:r,pageWidth:h,pageHeight:c}}),maxPageWidth:a,maxPageHeight:o}}(d,t,e,n,a)}function cu(t,e,i,s,n){let a=function(t,e){const i=t.length;let s=0;for(let n=0;n<i;n++)if(s+=e.fn(t[n])+e.padding,s>e.max)return i/n<2?Math.ceil(i/2):n;return i}(t,i);if(a<1){if(!n)return;a=1}let o=a;for(;o>=1;){const a=du(t,e,o,i,s,n);if(null==a&&o<=1)return;if(null!=a){if("number"!=typeof a)return{processedBBoxCount:a.length*a[0].length,pageIndices:a};if(a<=1)return;o=a<o&&a>1?a:o,o--}else o--}}function du(t,e,i,s,n,a){var o;const r=[];let l=0,h=0,c=[];const d=[];for(let u=0;u<t.length;u++){const p=(u+i)%i;0===p&&(l+=h,h=0,c.length>0&&r.push(c),c=[]);const g=s.fn(t[u])+s.padding;d[p]=Math.max(null!=(o=d[p])?o:0,g),h=Math.max(h,n.fn(t[u])+n.padding);const m=l+h,y=!a||r.length>0;if(m>n.max&&y){c=[];break}if(d.reduce((t,e)=>t+e,0)>s.max&&!a)return d.length<i?d.length:void 0;c.push(u+e)}return c.length>0&&r.push(c),r.length>0?r:void 0}var uu=class extends Mo{constructor(){super({name:"markerLabelGroup"}),this.label=new Po,this.line=new Fr,this._marker=new wd,this._markerSize=15,this._spacing=8;const{marker:t,label:e,line:i}=this;e.textBaseline="middle",e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.y=1,this.append([i,t,e]),this.update()}set marker(t){this._marker!==t&&(this.removeChild(this._marker),this._marker=t,this.appendChild(t),this.update())}get marker(){return this._marker}set markerSize(t){this._markerSize!==t&&(this._markerSize=t,this.update())}get markerSize(){return this._markerSize}set spacing(t){this._spacing!==t&&(this._spacing=t,this.update())}get spacing(){return this._spacing}setSeriesStrokeOffset(t){const e=this.marker.size/2+t;this.line.x1=-e,this.line.x2=e,this.line.y1=0,this.line.y2=0,this.line.markDirtyTransform(),this.update()}update(){const{markerSize:t}=this,e=this.marker.constructor.center;this.marker.size=t,this.marker.x=(e.x-.5)*t,this.marker.y=(e.y-.5)*t;const i=this.line.visible?this.line.x2:-1/0,s=t/2;this.label.x=Math.max(i,s)+this.spacing}render(t){this.marker.opacity=this.opacity,this.label.opacity=this.opacity,this.line.opacity=this.opacity,super.render(t)}};uu.className="MarkerLabel",b([Hr("label")],uu.prototype,"text",2),b([Hr("label")],uu.prototype,"fontStyle",2),b([Hr("label")],uu.prototype,"fontWeight",2),b([Hr("label")],uu.prototype,"fontSize",2),b([Hr("label")],uu.prototype,"fontFamily",2),b([Hr("label","fill")],uu.prototype,"color",2),b([Hr("marker","fill")],uu.prototype,"markerFill",2),b([Hr("marker","stroke")],uu.prototype,"markerStroke",2),b([Hr("marker","strokeWidth")],uu.prototype,"markerStrokeWidth",2),b([Hr("marker","fillOpacity")],uu.prototype,"markerFillOpacity",2),b([Hr("marker","strokeOpacity")],uu.prototype,"markerStrokeOpacity",2),b([Hr("marker","visible")],uu.prototype,"markerVisible",2),b([Hr("line","stroke")],uu.prototype,"lineStroke",2),b([Hr("line","strokeWidth")],uu.prototype,"lineStrokeWidth",2),b([Hr("line","strokeOpacity")],uu.prototype,"lineStrokeOpacity",2),b([Hr("line","lineDash")],uu.prototype,"lineLineDash",2),b([Hr("line","visible")],uu.prototype,"lineVisible",2);var pu=class extends ye{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};b([Yn(ga)],pu.prototype,"color",2),b([Yn(wa,{optional:!0})],pu.prototype,"fontStyle",2),b([Yn(Ia,{optional:!0})],pu.prototype,"fontWeight",2),b([Yn(ia)],pu.prototype,"fontSize",2),b([Yn(Jn)],pu.prototype,"fontFamily",2);var gu=class extends ye{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};b([Yn(ia)],gu.prototype,"size",2),b([Yn(ga,{optional:!0})],gu.prototype,"fill",2),b([Yn(sa,{optional:!0})],gu.prototype,"fillOpacity",2),b([Yn(ga,{optional:!0})],gu.prototype,"stroke",2),b([Yn(ia)],gu.prototype,"strokeWidth",2),b([Yn(sa)],gu.prototype,"strokeOpacity",2);var mu=class extends ye{constructor(t){super(),this.parent=t,this.shape=Ld,this.size=15,this.padding=8}};b([Ur({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],mu.prototype,"shape",2),b([Yn(ia)],mu.prototype,"size",2),b([Yn(ia)],mu.prototype,"padding",2);var yu=class extends ye{constructor(t,e,i,s){super(),this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.regionManager=i,this.cursorManager=s,this.id=Bs(this),this.marker=new mu(this),this.activeStyle=new gu,this.inactiveStyle=new gu,this.highlightStyle=new gu,this.label=new pu,this.group=new Mo({name:"pagination"}),this.labelNode=new Po,this.destroyFns=[],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 Ld,this._previousButton=new Ld,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]);const n=this.regionManager.addRegion("pagination",this.group);this.destroyFns.push(n.addListener("click",t=>this.onPaginationClick(t)),n.addListener("hover",t=>this.onPaginationMouseMove(t))),this.update(),this.updateMarkers()}destroy(){this.destroyFns.forEach(t=>t())}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){this._orientation=t,"horizontal"===t?(this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2):(this.previousButton.rotation=0,this.nextButton.rotation=Math.PI)}get orientation(){return this._orientation}set nextButton(t){this._nextButton!==t&&(this.group.removeChild(this._nextButton),this._nextButton=t,this.group.appendChild(t))}get nextButton(){return this._nextButton}set previousButton(t){this._previousButton!==t&&(this.group.removeChild(this._previousButton),this._previousButton=t,this.group.appendChild(t))}get previousButton(){return this._previousButton}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.computeBBox();this.nextButton.translationX=t.x+t.width+this.marker.size/2+this.marker.padding}updateLabel(){const{currentPage:t,totalPages:e,labelNode:i,label:{color:s,fontStyle:n,fontWeight:a,fontSize:o,fontFamily:r}}=this;i.text=`${t+1} / ${e}`,i.fill=s,i.fontStyle=n,i.fontWeight=a,i.fontSize=o,i.fontFamily=r}updateMarkers(){const{nextButton:t,previousButton:e,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:a,highlightStyle:o,highlightActive:r}=this,l=(t,e)=>e?a:t===r?o:n;this.updateMarker(t,l("next",i)),this.updateMarker(e,l("previous",s))}updateMarker(t,e){var i;const{size:s}=this.marker;t.size=s,t.fill=e.fill,t.fillOpacity=null!=(i=e.fillOpacity)?i:1,t.stroke=e.stroke,t.strokeWidth=e.strokeWidth,t.strokeOpacity=e.strokeOpacity}enableOrDisableButtons(){const{currentPage:t,totalPages:e}=this,i=0===e,s=t===e-1,n=0===t;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}nextButtonContainsPoint(t,e){return!this.nextButtonDisabled&&this.nextButton.containsPoint(t,e)}previousButtonContainsPoint(t,e){return!this.previousButtonDisabled&&this.previousButton.containsPoint(t,e)}clickNext(){this.incrementPage(),this.onPaginationChanged()}clickPrevious(){this.decrementPage(),this.onPaginationChanged()}setPage(t){t=Gs(0,t,this.totalPages-1),this.currentPage!==t&&(this.currentPage=t,this.onPaginationChanged())}onPaginationClick(t){const{offsetX:e,offsetY:i}=t;this.nextButtonContainsPoint(e,i)?(this.clickNext(),t.consume()):this.previousButtonContainsPoint(e,i)&&(this.clickPrevious(),t.consume())}onPaginationMouseMove(t){const{offsetX:e,offsetY:i}=t;this.nextButtonContainsPoint(e,i)?(this.cursorManager.updateCursor(this.id,"pointer"),this.highlightActive="next"):this.previousButtonContainsPoint(e,i)?(this.cursorManager.updateCursor(this.id,"pointer"),this.highlightActive="previous"):(this.cursorManager.updateCursor(this.id),this.highlightActive=void 0),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(){const t=Od(this.marker.shape||Ld);this.previousButton=new t,this.nextButton=new t,this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(6)}attachPagination(t){t.append(this.group)}computeBBox(){return this.group.computeBBox()}};yu.className="Pagination",b([Yn(Xn)],yu.prototype,"marker",2),b([Yn(Xn)],yu.prototype,"activeStyle",2),b([Yn(Xn)],yu.prototype,"inactiveStyle",2),b([Yn(Xn)],yu.prototype,"highlightStyle",2),b([Yn(Xn)],yu.prototype,"label",2);var fu=class extends ye{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",this.formatter=void 0}};b([Yn(ia,{optional:!0})],fu.prototype,"maxLength",2),b([Yn(ga)],fu.prototype,"color",2),b([Yn(wa,{optional:!0})],fu.prototype,"fontStyle",2),b([Yn(Ia,{optional:!0})],fu.prototype,"fontWeight",2),b([Yn(ia)],fu.prototype,"fontSize",2),b([Yn(Jn)],fu.prototype,"fontFamily",2),b([Yn(Qn,{optional:!0})],fu.prototype,"formatter",2);var xu=class extends ye{constructor(){super(...arguments),this.size=15,this.padding=8,this.enabled=!0}};b([Xr(t=>{var e;return null==(e=t.parent)?void 0:e.onMarkerShapeChange()})],xu.prototype,"shape",2),b([Yn(ia)],xu.prototype,"size",2),b([Yn(ia)],xu.prototype,"padding",2),b([Yn(ia,{optional:!0})],xu.prototype,"strokeWidth",2),b([Yn(qn)],xu.prototype,"enabled",2);var bu=class extends ye{};b([Yn(ia,{optional:!0})],bu.prototype,"strokeWidth",2),b([Yn(ia,{optional:!0})],bu.prototype,"length",2);var vu=class extends ye{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.toggleSeriesVisible=!0,this.showSeriesStroke=!1,this.marker=new xu,this.label=new fu,this.line=new bu}};b([Yn(ia,{optional:!0})],vu.prototype,"maxWidth",2),b([Yn(ia)],vu.prototype,"paddingX",2),b([Yn(ia)],vu.prototype,"paddingY",2),b([Yn(qn)],vu.prototype,"toggleSeriesVisible",2),b([Yn(qn)],vu.prototype,"showSeriesStroke",2),b([Yn(Xn)],vu.prototype,"marker",2),b([Yn(Xn)],vu.prototype,"label",2),b([Yn(Xn)],vu.prototype,"line",2);var Su=class extends ye{};b([Yn(Qn,{optional:!0})],Su.prototype,"legendItemClick",2),b([Yn(Qn,{optional:!0})],Su.prototype,"legendItemDoubleClick",2);var Mu=class extends ye{constructor(t){super(),this.ctx=t,this.id=Bs(this),this.group=new Mo({name:"legend",layer:!0,zIndex:11}),this.itemSelection=Rr.select(this.group,uu),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.item=new vu,this.listeners=new Su,this.enabled=!0,this.position="bottom",this.spacing=20,this.characterWidths=new Map,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.focus={mode:"item",index:0},this.item.marker.parent=this,this.pagination=new yu(e=>t.updateService.update(e),t=>this.updatePageNumber(t),t.regionManager,t.cursorManager),this.pagination.attachPagination(this.group),this.item.marker.parent=this;const e=t.regionManager.addRegionFromProperties({name:"legend",bboxproviders:[this.group],canInteraction:()=>this.enabled&&this.group.visible});this.destroyFns.push(e.addListener("click",t=>this.checkLegendClick(t),17),e.addListener("dblclick",t=>this.checkLegendDoubleClick(t),17),e.addListener("hover",t=>this.handleLegendMouseMove(t)),e.addListener("leave",t=>this.handleLegendMouseExit(t),17),e.addListener("enter",t=>this.handleLegendMouseEnter(t),17),e.addListener("blur",t=>this.onBlur(t)),e.addListener("tab",t=>this.onTab(t)),e.addListener("tab-start",t=>this.onTabStart(t)),e.addListener("nav-vert",t=>this.onNav(t)),e.addListener("nav-hori",t=>this.onNav(t)),e.addListener("submit",t=>this.onSubmit(t)),t.layoutService.addListener("start-layout",t=>this.positionLegend(t.shrinkRect)),()=>this.detachLegend())}set data(t){this._data=t,this.updateGroupVisibility()}get data(){return this._data}destroy(){this.destroyFns.forEach(t=>t()),this.pagination.destroy()}onMarkerShapeChange(){this.itemSelection.clear(),this.group.markDirty(this.group,2)}getOrientation(){if(void 0!==this.orientation)return this.orientation;switch(this.position){case"right":case"left":return"vertical";case"bottom":case"top":return"horizontal"}}getCharacterWidths(t){const{characterWidths:e}=this;if(e.has(t))return e.get(t);const i={"...":Po.getTextSize("...",t).width};return e.set(t,i),i}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)}detachLegend(){var t;null==(t=this.group.parent)||t.removeChild(this.group)}getItemLabel(t){const{ctx:{callbackCache:e}}=this,{formatter:i}=this.item.label;return i?e.call(i,{itemId:t.itemId,value:t.label.text,seriesId:t.seriesId}):t.label.text}calcLayout(t,e){const{paddingX:i,paddingY:s,label:n,maxWidth:a,marker:{size:o,padding:r,shape:l},label:{maxLength:h=1/0,fontStyle:c,fontWeight:d,fontSize:u,fontFamily:p},line:g,showSeriesStroke:m}=this.item,y=[...this.data];this.reverseOrder&&y.reverse(),this.itemSelection.update(y);const f=[],x=Fo(n),b=null!=a?a:.8*t,v=o+r+i;if(this.itemSelection.each((t,e)=>{var i,s,n;const a=Od(null!=l?l:e.marker.shape),y=null!=(i=e.marker.enabled)?i:this.item.marker.enabled;t.marker&&t.marker instanceof a||(t.marker=new a),t.markerSize=o,t.spacing=r,t.fontStyle=c,t.fontWeight=d,t.fontSize=u,t.fontFamily=p;const S=null!=(s=e.itemId)?s:e.id,M=this.getItemLabel(e),k=(null!=M?M:"<unknown>").replace(/\r?\n/g," ");t.text=this.truncate(k,h,b,v,x,S),m&&void 0!==e.line?(t.lineVisible=!0,t.markerVisible=y,t.setSeriesStrokeOffset(null!=(n=g.length)?n:5)):(t.lineVisible=!1,t.markerVisible=!0),f.push(t.computeBBox())}),t=Math.max(1,t),e=Math.max(1,e),!isFinite(t))return!1;const S=this.size,M=this.oldSize;S[0]=t,S[1]=e,S[0]===M[0]&&S[1]===M[1]||(M[0]=S[0],M[1]=S[1]);const{pages:k,maxPageHeight:D,maxPageWidth:w}=this.updatePagination(f,t,e);this.pages=k,this.maxPageSize=[w-i,D-s];const I=this.pagination.currentPage,C=this.pages[I];this.pages.length<1||!C?this.visible=!1:(this.visible=!0,this.updatePositions(I),this.update())}truncate(t,e,i,s,n,a){const o=t.split("");let r=!1;if(t.length>e&&(t=`${t.substring(0,e)}`,r=!0),Math.floor(s+Po.getTextSize(t,n).width)>i){let e="";const a=this.getCharacterWidths(n);let l=s+a["..."];for(const t of o){if(a[t]||(a[t]=Po.getTextSize(t,n).width),l+=a[t],l>i)break;e+=t}t=e,r=!0}return r?(t+="...",this.truncatedItems.add(a)):this.truncatedItems.delete(a),t}updatePagination(t,e,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,t.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:a,maxPageHeight:o,maxPageWidth:r,paginationBBox:l,paginationVertical:h}=this.calculatePagination(t,e,i),c=a.findIndex(t=>t.endIndex>=n);this.pagination.currentPage=Gs(0,c,a.length-1);const{paddingX:d,paddingY:u}=this.item,p=r-d,g=o-u;let m=0,y=-l.y-this.item.marker.size/2;return h?y+=g+8:(m+=-l.x+p+8,y+=(g-l.height)/2),this.pagination.translationX=m,this.pagination.translationY=y,this.pagination.update(),this.pagination.updateMarkers(),{maxPageHeight:o,maxPageWidth:r,pages:a}}calculatePagination(t,e,i){var s,n,a;const{paddingX:o,paddingY:r}=this.item,l=this.getOrientation(),h=["left","right"].includes(this.position);let c=this.pagination.computeBBox(),d=new Qs(0,0,0,0),u=[],p=0,g=0,m=0;const y=t=>t.width===c.width&&t.height===c.height,f=void 0!==this.maxWidth&&void 0!==this.maxHeight;do{if(m++>10){R.warn("unable to find stable legend layout.");break}c=d;const y=e-(h?0:c.width),x=hu({orientation:l,bboxes:t,maxHeight:i-(h?c.height:0),maxWidth:y,itemPaddingY:r,itemPaddingX:o,forceResult:f});u=null!=(s=null==x?void 0:x.pages)?s:[],p=null!=(n=null==x?void 0:x.maxPageWidth)?n:0,g=null!=(a=null==x?void 0:x.maxPageHeight)?a:0;const b=u.length;if(this.pagination.visible=b>1,this.pagination.totalPages=b,this.pagination.update(),d=this.pagination.computeBBox(),!this.pagination.visible)break}while(!y(d));return{maxPageWidth:p,maxPageHeight:g,pages:u,paginationBBox:c,paginationVertical:h}}getPageItemCount(t){let e=0;for(const i of this.pages[t].columns)e+=i.indices.length;return e}getNodeIndexFromFocusIndex(){const{index:t}=this.focus,e=this.pages[this.pagination.currentPage];let i=0;for(const s of e.columns){if(t<i+s.indices.length)return s.indices[t-i];i+=s.indices.length}return-1}updatePositions(t=0){const{item:{paddingY:e},itemSelection:i,pages:s}=this;if(s.length<1||!s[t])return;const{columns:n,startIndex:a,endIndex:o}=s[t];let r=0,l=0;const h=n.length,c=n[0].indices.length,d="horizontal"===this.getOrientation(),u=n[0].bboxes[0].height+e,p=[];i.each((t,e,i)=>{var s,g;if(i<a||i>o)return void(t.visible=!1);const m=i-a;let y=0,f=0;d?(y=m%h,f=Math.floor(m/h)):(y=Math.floor(m/c),f=m%c),t.visible=!0;const x=n[y];x&&(l=u*f,r=null!=(s=p[f])?s:0,p[f]=(null!=(g=p[f])?g:0)+x.columnWidth,t.translationX=Math.floor(r),t.translationY=Math.floor(l))})}updatePageNumber(t){const{pages:e}=this,{startIndex:i,endIndex:s}=e[t];0===i?this.paginationTrackingIndex=0:t===e.length-1?this.paginationTrackingIndex=s:this.paginationTrackingIndex=Math.floor((i+s)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(t),this.ctx.updateService.update(6)}update(){const{label:{color:t},marker:e,line:i,showSeriesStroke:s}=this.item;this.itemSelection.each((n,a)=>{var o,r;const l=a.marker;n.markerFill=l.fill,n.markerStroke=l.stroke,n.markerStrokeWidth=null!=(o=e.strokeWidth)?o:Math.min(2,l.strokeWidth),n.markerFillOpacity=l.fillOpacity,n.markerStrokeOpacity=l.strokeOpacity,n.opacity=a.enabled?1:.5,n.color=t;const{line:h}=a;s&&void 0!==h&&(n.lineStroke=h.stroke,n.lineStrokeOpacity=h.strokeOpacity,n.lineStrokeWidth=null!=(r=i.strokeWidth)?r:Math.min(2,h.strokeWidth),n.lineLineDash=h.lineDash)})}getDatumForPoint(t,e){const i=[],s={dist:1/0,datum:void 0};for(const n of this.group.children){if(!n.visible)continue;if(!(n instanceof uu))continue;const a=n.computeBBox();if(a.grow(this.item.paddingX/2,"horizontal"),a.grow(this.item.paddingY/2,"vertical"),a.containsPoint(t,e))return n.datum;const o=t-a.x-this.item.paddingX/2,r=e-a.y-this.item.paddingY/2,l=p(o,2)+p(r,2);o>=0&&r>=0&&l<s.dist&&(s.dist=l,s.datum=n.datum),i.push(a)}if(Qs.merge(i).containsPoint(t,e))return s.datum}computePagedBBox(){const t=this.group.computeBBox();if(this.pages.length<=1)return t;const[e,i]=this.maxPageSize;return t.height=Math.max(i,t.height),t.width=Math.max(e,t.width),t}checkLegendClick(t){const e=this.getDatumForPoint(t.offsetX,t.offsetY);this.doClick(e)&&t.consume()}doClick(t){const{listeners:{legendItemClick:e},ctx:{chartService:i,highlightManager:s},item:{toggleSeriesVisible:n},preventHidingAll:a}=this;if(!t)return!1;const{id:o,itemId:r,enabled:l}=t,h=i.series.find(t=>t.id===o);if(!h)return!1;let c=l;if(n){c=!l,a&&!c&&i.series.flatMap(t=>t.getLegendData("category")).filter(t=>t.enabled).length<2&&(c=!0);const e=c?"visible":"hidden";this.ctx.ariaAnnouncementService.announceValue(`${e}`),this.ctx.chartEventManager.legendItemClick(h,r,c,t.legendItemName)}return c?s.updateHighlight(this.id,{series:h,itemId:r,datum:void 0}):s.updateHighlight(this.id),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),null==e||e({type:"click",enabled:c,itemId:r,seriesId:h.id}),!0}checkLegendDoubleClick(t){var e;const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},item:{toggleSeriesVisible:n}}=this;if("integrated"===s.mode)return;const a=this.getDatumForPoint(t.offsetX,t.offsetY);if(!a)return;const{id:o,itemId:r,seriesId:l}=a,h=s.series.find(t=>t.id===o);if(h){if(t.consume(),n){const t=s.series.flatMap(t=>t.getLegendData("category")),i=t.filter(t=>t.enabled).length,n=t.find(t=>t.itemId===r&&t.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(h,r,null!=(e=null==n?void 0:n.enabled)&&e,i,null==n?void 0:n.legendItemName)}this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),null==i||i({type:"dblclick",enabled:!0,itemId:r,seriesId:h.id})}}handleLegendMouseMove(t){if(!this.enabled)return;const{offsetX:e,offsetY:i}=t;t.consume();const s=this.getDatumForPoint(e,i);this.doHover(t,s)}doHover(t,e){var i;const{item:{toggleSeriesVisible:s},listeners:n}=this;if(void 0===t||void 0===e)return this.ctx.cursorManager.updateCursor(this.id),void this.ctx.highlightManager.updateHighlight(this.id);const a=e?this.ctx.chartService.series.find(t=>t.id===(null==e?void 0:e.id)):void 0;if(e&&this.truncatedItems.has(null!=(i=e.itemId)?i:e.id)){const{offsetX:i,offsetY:s}=t;this.ctx.tooltipManager.updateTooltip(this.id,{offsetX:i,offsetY:s,lastPointerEvent:t,showArrow:!1},il({content:this.getItemLabel(e)}))}else this.ctx.tooltipManager.removeTooltip(this.id);(s||null!=n.legendItemClick||null!=n.legendItemDoubleClick)&&this.ctx.cursorManager.updateCursor(this.id,"pointer"),(null==e?void 0:e.enabled)&&a?this.ctx.highlightManager.updateHighlight(this.id,{series:a,itemId:null==e?void 0:e.itemId,datum:void 0}):this.ctx.highlightManager.updateHighlight(this.id)}handleLegendMouseExit(t){this.doMouseExit()}doMouseExit(){this.ctx.cursorManager.updateCursor(this.id),this.ctx.tooltipManager.removeTooltip(this.id),16===this.ctx.interactionManager.getState()&&this.ctx.highlightManager.updateHighlight(this.id)}handleLegendMouseEnter(t){const{enabled:e,item:{toggleSeriesVisible:i},listeners:{legendItemClick:s,legendItemDoubleClick:n}}=this,a=this.getDatumForPoint(t.offsetX,t.offsetY);e&&void 0!==a&&(i||null!=s||null!=n)&&this.ctx.cursorManager.updateCursor(this.id,"pointer")}onBlur(t){this.doMouseExit(),this.focus.mode="item",this.ctx.regionManager.updateFocusIndicatorRect(void 0)}onTab(t){this.updateFocus(),t.consume()}onTabStart(t){if(!this.pagination.visible||!this.pagination.enabled)return;const e=e=>{this.focus.mode=e,this.updateFocus(),t.consume()};"item"===this.focus.mode&&1===t.delta?(this.focus.index=0===this.pagination.currentPage?1:0,e("page")):"page"===this.focus.mode&&-1===t.delta&&(this.focus.index=0,e("item"))}onNav(t){if("item"===this.focus.mode){const e=this.focus.index+t.delta,i=this.getPageItemCount(this.pagination.currentPage);this.focus.index=Gs(-1,e,i),this.updateFocus(),t.consume()}else"page"===this.focus.mode&&(t.delta<0&&(this.focus.index=0),t.delta>0&&(this.focus.index=1),this.updateFocus(),t.consume())}onSubmit(t){"item"===this.focus.mode?this.doClick(this.getFocusedItem().datum):"page"===this.focus.mode&&(0===this.focus.index&&this.pagination.clickPrevious(),1===this.focus.index&&this.pagination.clickNext(),this.ctx.ariaAnnouncementService.announceValue(`Legend page ${this.pagination.currentPage+1} of ${this.pages.length}`))}maybeChangeFocusPage(){const t=this.pagination.currentPage,e=this.getPageItemCount(t);if(-1===this.focus.index)this.pagination.setPage(t-1);else{if(this.focus.index!==e)return;this.pagination.setPage(t+1)}const{currentPage:i}=this.pagination;t===i?this.focus.index=Gs(0,this.focus.index,e-1):-1===this.focus.index?this.focus.index=this.getPageItemCount(i)-1:this.focus.index=0}getFocusedItem(){if("item"!==this.focus.mode)return R.error("getFocusedItem() should be called only when focus.mode is 'item'"),{nodeIndex:-1,node:void 0,datum:void 0};this.maybeChangeFocusPage();const t=this.getNodeIndexFromFocusIndex();if(t<0)return R.error(`Cannot access negative nodeIndex ${t}`),{nodeIndex:-1,node:void 0,datum:void 0};const e=this.itemSelection.nodes()[t];let i;return t<this.data.length?i=this.data[t]:R.error(`Cannot access datum[${t}]`),{nodeIndex:t,node:e,datum:i}}updateFocus(){const{focus:t,pagination:e}=this;if("item"===t.mode){const{nodeIndex:t,node:e,datum:i}=this.getFocusedItem();if(void 0===i)return;const s=null==e?void 0:e.computeTransformedBBox();this.doHover(nc(this.ctx.regionManager,{bbox:s,showFocusBox:!0}),i);const n=i&&this.getItemLabel(i);if(n){const e=i.enabled?"visible":"hidden";this.ctx.ariaAnnouncementService.announceValue(`Legend item ${t+1} of ${this.data.length}, ${n}, ${e}`)}}else if("page"===t.mode){const i=0===t.index?e.previousButton:e.nextButton;this.ctx.regionManager.updateFocusIndicatorRect(i.computeTransformedBBox());const s=["Previous legend page","Next legend page"][t.index];this.ctx.ariaAnnouncementService.announceValue(`${s}, button`)}}positionLegend(t){const e=t.clone();if(!this.enabled||!this.data.length)return{shrinkRect:e};const[i,s]=this.calculateLegendDimensions(t);this.group.translationX=0,this.group.translationY=0,this.calcLayout(i,s);const n=this.computePagedBBox(),a=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return t.height-n.height;default:return t.width-n.width}};if(this.visible){let i,s;switch(this.position){case"top":case"bottom":i=(t.width-n.width)/2,s=a(),e.shrink(n.height,this.position);break;default:i=a(),s=(t.height-n.height)/2,e.shrink(n.width,this.position)}this.group.translationX=Math.floor(-n.x+t.x+i),this.group.translationY=Math.floor(-n.y+t.y+s)}if(this.visible&&this.enabled&&this.data.length){const t=this.spacing;e.shrink(t,this.position);const i=n.clone();i.x+=this.group.translationX,i.y+=this.group.translationY}return{shrinkRect:e}}calculateLegendDimensions(t){const{width:e,height:i}=t,s=e/i;let n,a;switch(this.position){case"top":case"bottom":const t=s<1?Math.min(.5,1/s*.2):.2;n=this.maxWidth?Math.min(this.maxWidth,e):e,a=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*t);break;default:const o=s>1?Math.min(.5,.25*s):.25;n=this.maxWidth?Math.min(this.maxWidth,e):Math.round(e*o),a=this.maxHeight?Math.min(this.maxHeight,i):i}return[n,a]}};Mu.className="Legend",b([Yn(Xn)],Mu.prototype,"pagination",2),b([Yn(Xn)],Mu.prototype,"item",2),b([Yn(Xn)],Mu.prototype,"listeners",2),b([Xr(t=>t.updateGroupVisibility()),Yn(qn)],Mu.prototype,"enabled",2),b([Yn(Da)],Mu.prototype,"position",2),b([Yn(ia,{optional:!0})],Mu.prototype,"maxWidth",2),b([Yn(ia,{optional:!0})],Mu.prototype,"maxHeight",2),b([Yn(qn,{optional:!0})],Mu.prototype,"reverseOrder",2),b([Yn(Pa(["horizontal","vertical"],"an orientation"),{optional:!0})],Mu.prototype,"orientation",2),b([Yn(qn,{optional:!0})],Mu.prototype,"preventHidingAll",2),b([Yn(ia)],Mu.prototype,"spacing",2);var ku={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology"],instanceConstructor:Mu,packageType:"community"},Du=class extends cd{constructor(){super(...arguments),this.zIndex=3,this._fill="#f2f2f2",this._stroke="#999999",this._strokeWidth=1,this._lineCap="square",this._centerX=0,this._centerY=0,this._width=8,this._gripLineGap=2,this._gripLineLength=8,this._height=16}set centerX(t){this._centerX!==t&&(this._centerX=t,this.dirtyPath=!0)}get centerX(){return this._centerX}set centerY(t){this._centerY!==t&&(this._centerY=t,this.dirtyPath=!0)}get centerY(){return this._centerY}set width(t){this._width!==t&&(this._width=t,this.dirtyPath=!0)}get width(){return this._width}set gripLineGap(t){this._gripLineGap!==t&&(this._gripLineGap=t,this.dirtyPath=!0)}get gripLineGap(){return this._gripLineGap}set gripLineLength(t){this._gripLineLength!==t&&(this._gripLineLength=t,this.dirtyPath=!0)}get gripLineLength(){return this._gripLineLength}set height(t){this._height!==t&&(this._height=t,this.dirtyPath=!0)}get height(){return this._height}layout(t,e){this.centerX=t,this.centerY=e}static align(t,e,i,s,n,a,o,r){const l=t.strokeWidth/2,h=t.align(i+n*o)+l,c=h+t.align(i+n*o,n*(r-o))-2*l,d=t.align(s+a/2)+l;t.layout(h,d),e.layout(c,d)}computeBBox(){const{centerX:t,centerY:e,width:i,height:s}=this;return new Qs(t-i/2,e-s/2,i,s)}isPointInPath(t,e){const i=this.transformPoint(t,e);return this.computeBBox().containsPoint(i.x,i.y)}updatePath(){var t,e,i;const{centerX:s,centerY:n,path:a,strokeWidth:o,gripLineGap:r,gripLineLength:l}=this,h=null!=(i=null==(e=null==(t=this.layerManager)?void 0:t.canvas)?void 0:e.pixelRatio)?i:1;a.clear();const c=Math.floor(this.width/2*h)/h,d=Math.floor(this.height/2*h)/h;a.moveTo(s-c,n-d),a.lineTo(s+c,n-d),a.lineTo(s+c,n+d),a.lineTo(s-c,n+d),a.closePath();const u=Math.floor((r+o)/2*h)/h,p=Math.floor(l/2*h)/h;a.moveTo(s-u,n-p),a.lineTo(s-u,n+p),a.moveTo(s+u,n-p),a.lineTo(s+u,n+p)}};Du.className="RangeHandle",b([Yn(ga)],Du.prototype,"_fill",2),b([Yn(ga)],Du.prototype,"_stroke",2),b([Yn(ia)],Du.prototype,"_strokeWidth",2),b([Yn(Sa)],Du.prototype,"_lineCap",2),b([Yn(ia)],Du.prototype,"_width",2),b([Yn(ia)],Du.prototype,"_gripLineGap",2),b([Yn(ia)],Du.prototype,"_gripLineLength",2),b([Yn(ia)],Du.prototype,"_height",2);var wu=class extends cd{constructor(){super(...arguments),this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1}layout(t,e,i,s){this.x=t,this.y=e,this.width=i,this.height=s,this.dirtyPath=!0}update(t,e){this.min=isNaN(t)?this.min:t,this.max=isNaN(e)?this.max:e,this.dirtyPath=!0}computeBBox(){const{x:t,y:e,width:i,height:s}=this;return new Qs(t,e,i,s)}computeVisibleRangeBBox(){const{x:t,y:e,width:i,height:s,min:n,max:a}=this,o=t+i*n;return new Qs(o,e,t+i*a-o,s)}updatePath(){const{path:t,x:e,y:i,width:s,height:n,min:a,max:o,strokeWidth:r}=this,l=r/2;t.clear();const h=this.align(e)+l,c=this.align(i)+l,d=h+this.align(e,s)-2*l,u=c+this.align(i,n)-2*l;t.moveTo(h,c),t.lineTo(d,c),t.lineTo(d,u),t.lineTo(h,u),t.closePath();const p=this.align(e+s*a)+l,g=p+this.align(e+s*a,s*(o-a))-2*l;t.moveTo(p,c),t.lineTo(p,u),t.lineTo(g,u),t.lineTo(g,c),t.closePath()}};wu.className="RangeMask";var Iu=class extends Mo{constructor(t){super({name:"rangeSelectorGroup",layer:!0,zIndex:12}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.isContainerNode=!0,this.background=new Mo({name:"navigator-background"}),this.background.zIndex=1,this.appendChild(this.background),this.append(t)}layout(t,e,i,s,n,a){this.x=t,this.y=e,this.width=i,this.height=s,this.lOffset=n,this.rOffset=a,this.background.translationX=t,this.background.translationY=e}updateBackground(t,e){null!=t&&this.background.removeChild(t),null!=e&&this.background.appendChild(e)}computeBBox(){const{x:t,y:e,width:i,height:s,lOffset:n,rOffset:a}=this;return new Qs(t-n,e,i+(n+a),s)}},Cu=class extends vt{constructor(t){super(),this.ctx=t,this.miniChart=void 0,this.enabled=!1,this.mask=new wu,this.minHandle=new Du,this.maxHandle=new Du,this.height=30,this.margin=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new Iu([this.mask,this.minHandle,this.maxHandle]),this._min=0,this._max=1,this.minRange=.001;const e=t.regionManager.addRegion("navigator",this.rangeSelector);this.destroyFns.push(t.scene.attachNode(this.rangeSelector),e.addListener("hover",t=>this.onHover(t),25),e.addListener("drag-start",t=>this.onDragStart(t),25),e.addListener("drag",t=>this.onDrag(t),25),e.addListener("drag-end",()=>this.onDragEnd(),25),e.addListener("leave",t=>this.onLeave(t),25),t.zoomManager.addListener("zoom-change",t=>this.onZoomChange(t))),this.updateGroupVisibility()}updateBackground(t,e){var i;null==(i=this.rangeSelector)||i.updateBackground(t,e)}updateGroupVisibility(){const{enabled:t}=this;null!=this.rangeSelector&&t!==this.rangeSelector.visible&&(this.rangeSelector.visible=t,t?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}performLayout(t){return S(this,arguments,function*({shrinkRect:t}){if(this.enabled){const e=this.height+this.margin;t.shrink(e,"bottom"),this.y=t.y+t.height+this.margin}else this.y=0;return{shrinkRect:t}})}performCartesianLayout(t){return S(this,null,function*(){const{x:e,width:i}=t.seriesRect;if(this.enabled){const{y:t,height:s}=this;this.layoutNodes(e,t,i,s)}this.x=e,this.width=i})}onHover(t){if(!this.enabled)return;const{mask:e,minHandle:i,maxHandle:s}=this,{offsetX:n,offsetY:a}=t;i.containsPoint(n,a)||s.containsPoint(n,a)?this.ctx.cursorManager.updateCursor("navigator","ew-resize"):e.computeVisibleRangeBBox().containsPoint(n,a)?this.ctx.cursorManager.updateCursor("navigator","grab"):this.ctx.cursorManager.updateCursor("navigator")}onDragStart(t){if(!this.enabled)return;const{mask:e,minHandle:i,maxHandle:s,x:n,width:a,_min:o}=this,{offsetX:r,offsetY:l}=t;i.zIndex<s.zIndex?s.containsPoint(r,l)?this.dragging="max":i.containsPoint(r,l)&&(this.dragging="min"):i.containsPoint(r,l)?this.dragging="min":s.containsPoint(r,l)&&(this.dragging="max"),null==this.dragging&&e.computeVisibleRangeBBox().containsPoint(r,l)&&(this.dragging="pan",this.panStart=(r-n)/a-o),null!=this.dragging&&this.ctx.zoomManager.fireZoomPanStartEvent("navigator")}onDrag(t){if(!this.enabled||null==this.dragging)return;const{dragging:e,minRange:i,panStart:s,x:n,width:a}=this;let{_min:o,_max:r}=this;const{offsetX:l}=t,h=(l-n)/a;if("min"===e)o=Gs(0,h,r-i);else if("max"===e)r=Gs(o+i,h,1);else if("pan"===e&&null!=s){const t=r-o;o=Gs(0,h-s,1-t),r=o+t}this._min=o,this._max=r,this.updateZoom()}onDragEnd(){this.dragging=void 0}onLeave(t){this.ctx.cursorManager.updateCursor("navigator")}onZoomChange(t){const{x:e}=t;e&&(this._min=e.min,this._max=e.max,this.updateNodes(e.min,e.max))}layoutNodes(t,e,i,s){const{rangeSelector:n,mask:a,minHandle:o,maxHandle:r,_min:l,_max:h}=this;n.layout(t,e,i,s,o.width/2,r.width/2),a.layout(t,e,i,s),Du.align(o,r,t,e,i,s,l,h),l+(h-l)/2<.5?(o.zIndex=3,r.zIndex=4):(o.zIndex=4,r.zIndex=3)}updateNodes(t,e){this.mask.update(t,e)}updateZoom(){if(!this.enabled)return;const{_min:t,_max:e}=this,i=this.ctx.zoomManager.getZoom();return null!=t&&null!=e?this.ctx.zoomManager.updateZoom("navigator",{x:{min:t,max:e},y:null==i?void 0:i.y},!1,t=>{null==this.min&&null==this.max||R.warnOnce(`Could not apply [navigator.min] or [navigator.max] as [${t}] has modified the initial zoom state.`)}):void 0}};b([Yn(Xn,{optional:!0})],Cu.prototype,"miniChart",2),b([Yn(qn),Xr(t=>t.updateGroupVisibility())],Cu.prototype,"enabled",2),b([Yn(ia)],Cu.prototype,"height",2),b([Yn(ia)],Cu.prototype,"margin",2),b([Ur({newValue(t){this._min=t,this.updateZoom()}}),Yn(Hn(sa,ha("max")),{optional:!0})],Cu.prototype,"min",2),b([Ur({newValue(t){this._max=t,this.updateZoom()}}),Yn(Hn(sa,ca("min")),{optional:!0})],Cu.prototype,"max",2);var Lu={type:"root",optionsKey:"navigator",packageType:"community",chartTypes:["cartesian"],instanceConstructor:Cu,themeTemplate:{navigator:{enabled:!1,height:30,mask:{fill:"#999999",stroke:"#999999",strokeWidth:1,fillOpacity:.2},minHandle:{fill:"#f2f2f2",stroke:"#999999",strokeWidth:1,width:9,height:16,gripLineGap:1,gripLineLength:8},maxHandle:{fill:"#f2f2f2",stroke:"#999999",strokeWidth:1,width:9,height:16,gripLineGap:1,gripLineLength:8}}}},Au=({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}},Tu=t=>{const{fill:e,stroke:i}=Au(t);return{marker:{fill:e,stroke:i}}};function Nu(t,e,i,s,n){const{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:r}=n,l=(s,n,a)=>{i.animate({id:`${t}_${e}_${n.id}_${s}`,groupId:t,from:0,to:1,ease:fn,collapsable:!1,onUpdate(t,e){e&&"removed"!==s||(n.path.clear(!0),a(t,n),n.checkPathDirty())},onStop(){"added"===s&&(n.path.clear(!0),a(1,n),n.checkPathDirty())},phase:Ln[s]})};for(const t of s)i.isSkipped()||(l("removed",t,r),l("updated",t,o)),l("added",t,a)}var Ou=null;function Ru(t){if(null!=t)return""===t?"":(null!=Ou||(Ou=Ss("div")),Ou.textContent=String(t),Ou.innerHTML)}function Eu({id:t},e,i,...s){Tn(t,e,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function Pu({id:t},e,i,...s){Tn(t,e,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function Bu(t){return{opacity:1}}var Fu=class extends ye{constructor(){super(...arguments),this._dirty=3}markDirty(t,e=1){this._dirty<e&&(this._dirty=e)}markClean(t){this._dirty=0}isDirty(){return this._dirty>0}},zu=class extends Fu{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};b([Yn(qn),en({redraw:3})],zu.prototype,"enabled",2),b([Yn(ga),en({redraw:3})],zu.prototype,"color",2),b([Yn(ta),en({redraw:3})],zu.prototype,"xOffset",2),b([Yn(ta),en({redraw:3})],zu.prototype,"yOffset",2),b([Yn(ia),en({redraw:3})],zu.prototype,"blur",2);var Gu=za(t=>Nd(t)||"function"==typeof md&&Object.create(t.prototype)instanceof md,"a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class"),_u=class extends Fu{constructor(){super(...arguments),this.enabled=!0,this.shape=yd,this.size=6,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1}getStyle(){const{size:t,fill:e,fillOpacity:i,stroke:s,strokeWidth:n,strokeOpacity:a}=this;return{size:t,fill:e,fillOpacity:i,stroke:s,strokeWidth:n,strokeOpacity:a}}getDiameter(){return this.size+this.strokeWidth}};b([Yn(qn),en({redraw:3})],_u.prototype,"enabled",2),b([Yn(Gu),en({redraw:3})],_u.prototype,"shape",2),b([Yn(ia),en({redraw:3})],_u.prototype,"size",2),b([Yn(ga,{optional:!0}),en({redraw:3})],_u.prototype,"fill",2),b([Yn(sa),en({redraw:3})],_u.prototype,"fillOpacity",2),b([Yn(ga,{optional:!0}),en({redraw:3})],_u.prototype,"stroke",2),b([Yn(ia),en({redraw:3})],_u.prototype,"strokeWidth",2),b([Yn(sa),en({redraw:3})],_u.prototype,"strokeOpacity",2),b([Yn(Qn,{optional:!0}),en({redraw:3})],_u.prototype,"formatter",2);var ju=class extends ye{constructor(){super(...arguments),this.enabled=!1}};b([Yn(qn)],ju.prototype,"enabled",2);var Wu=class extends ye{constructor(){super(...arguments),this.enabled=!0,this.interaction=new ju,this.position=new sl}toTooltipHtml(t,e){return this.renderer?il(this.renderer(e),t):il(t)}};b([Yn(qn)],Wu.prototype,"enabled",2),b([Yn(qn,{optional:!0})],Wu.prototype,"showArrow",2),b([Yn(Qn,{optional:!0})],Wu.prototype,"renderer",2),b([Yn(Xn)],Wu.prototype,"interaction",2),b([Yn(Xn)],Wu.prototype,"position",2);var Vu=class extends Wd{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.shadow=new zu,this.marker=new _u,this.label=new zo,this.tooltip=new Wu,this.connectMissingData=!1}};function Ku({id:t},e,i,...s){Tn(t,"markers",e,s,{opacity:0},{opacity:1},{phase:i?Ln[i]:"trailing"}),s.forEach(t=>t.cleanup())}function Yu({id:t},e,...i){Tn(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(t=>t.cleanup())}function $u({id:t,nodeDataDependencies:e},i,...s){const n=e.seriesRectWidth;An(t,"markers",i,s,{fromFn:(t,e)=>{var i,s;const a=null!=(s=null==(i=e.midPoint)?void 0:i.x)?s:n;let o=Gs(0,Mn(a/n),1);return isNaN(o)&&(o=0),{scalingX:0,scalingY:0,delay:o,duration:.2,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function Hu(t){return{opacity:1,scalingX:1,scalingY:1}}function Uu(t,e){var i,s,n,a;return{translationX:null!=(s=null==(i=e.point)?void 0:i.x)?s:NaN,translationY:null!=(a=null==(n=e.point)?void 0:n.y)?a:NaN}}function Xu(t,e){const i=(e,i)=>{const s=t[i][e];return Array.isArray(s)?s[0]:s},s=e=>{const{xValue:s}=e;return t.moved[s]?{point:i(s,"moved"),status:"updated"}:t.removed[s]?{point:i(s,"removed"),status:"removed"}:t.added[s]?{point:i(s,"added"),status:"added"}:{status:"unknown"}};return{fromFn:(t,i)=>{var n,a,o,r,l,h;const{status:c,point:d}=s(i);if("unknown"===c)return{opacity:0};const u={translationX:null!=(a=null==(n=null==d?void 0:d.from)?void 0:n.x)?a:t.translationX,translationY:null!=(r=null==(o=null==d?void 0:d.from)?void 0:o.y)?r:t.translationY,opacity:t.opacity,phase:Ln[c]};return"added"===e?y(m({},u),{opacity:0,translationX:null==(l=null==d?void 0:d.to)?void 0:l.x,translationY:null==(h=null==d?void 0:d.to)?void 0:h.y,phase:Ln.added}):("added"===c&&(u.opacity=0),u)},toFn:(t,i)=>{var n,a;const{status:o,point:r}=s(i);if("unknown"===o)return{opacity:0};const l={translationX:i.point.x,translationY:i.point.y,opacity:1,phase:Ln[o]};return"removed"===o||"removed"===e?y(m({},l),{translationX:null==(n=null==r?void 0:r.to)?void 0:n.x,translationY:null==(a=null==r?void 0:r.to)?void 0:a.y,opacity:0,phase:Ln.removed}):l}}}function Zu(t,{datumIndex:e}){const i=t.getNodeData();if(void 0===i)return;const s=i[e];if(void 0===s||void 0===s.point)return;const n=t.getFormattedMarkerStyle(s).size,a=n/2,{x:o,y:r}=t.contentGroup.inverseTransformPoint(s.point.x-a,s.point.y-a);return new Qs(o,r,n,n)}function qu(t){return t.reduce(({min:t,max:e},i)=>((null==t||t.point.x>i.point.x)&&(t=i),(null==e||e.point.x<i.point.x)&&(e=i),{min:t,max:e}),{})}function Qu(t,e,i){const s=(e.y-t.y)/(e.x-t.x);return{x:i,y:(i-t.x)*s+t.y}}function Ju(t,e,i,s){let n=-1,a=0;const o=[];for(;a<t.length;)t[a].change!==e?t[a].change!==i?(o.length>0&&(s(o,n,a),o.length=0),n=a,a++):a++:(o.push(t[a]),a++);o.length>0&&s(o,n,a)}function tp(t,e){Ju(t,"out","in",(i,s,n)=>{var a,o;-1===s&&t[n]?i.forEach(e=>e.to=t[n].from):n===t.length&&t[s]?i.forEach(e=>e.to=t[s].from):"intersect"===e&&(null==(a=t[s])?void 0:a.from)&&(null==(o=t[n])?void 0:o.from)?i.forEach(e=>e.to=Qu(t[s].from,t[n].from,e.from.x)):i.forEach(t=>t.to=t.from)}),Ju(t,"in","out",(i,s,n)=>{var a,o;-1===s&&t[n]?i.forEach(e=>e.from=t[n].to):n===t.length&&t[s]?i.forEach(e=>e.from=t[s].to):"intersect"===e&&(null==(a=t[s])?void 0:a.to)&&(null==(o=t[n])?void 0:o.to)?i.forEach(e=>e.from=Qu(t[s].to,t[n].to,e.to.x)):i.forEach(t=>t.from=t.to)})}function ep(t,e,i){const s=isNaN(t.x)?e.x:t.x,n=isNaN(t.y)?e.y:t.y,a=e.x-t.x,o=e.y-t.y;return{x:s+(isNaN(a)?0:a*i),y:n+(isNaN(o)?0:o*i)}}function ip(t,e,i){const{path:s}=i;let n;for(const i of t){const{from:t,to:a}=i,o=e[i.change];if(null==o||null==t||null==a)continue;const{x:r,y:l}=ep(t,a,o);if(!1===i.moveTo)s.lineTo(r,l);else if(!0!==i.moveTo&&n){if(n){const t="in"===i.moveTo?o:1-o,{x:e,y:a}=ep(n,{x:r,y:l},t);s.lineTo(e,a),s.moveTo(r,l)}}else s.moveTo(r,l);n={x:r,y:l}}}function sp({id:t,visible:e,nodeDataDependencies:i},s,...n){const{seriesRectWidth:a,seriesRectHeight:o}=i;Tn(t,"path_properties",s,n,{clipX:0},{clipX:a},{phase:"initial",start:{clipMode:"normal",clipY:o,visible:e},finish:{clipMode:void 0,visible:e}})}function np({id:t},e,i,s="add",...n){Tn(t,e,i,n,{opacity:0},{opacity:1},{phase:s})}function ap({id:t},e,i,...s){Tn(t,e,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function op(t){return e=>({opacity:t.getOpacity(),clipScalingX:1,clipMode:void 0})}function rp({nodeDataDependencies:t},e){const i=t=>isFinite(t)?t:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}function lp(t){return"continuous"===t.type||"log"===t.type}function hp(t){return"category"===t.type}function cp(t,e){return t.domain.length===e.domain.length&&t.range.length===e.range.length&&t.domain.every((t,i)=>t===e.domain[i])&&t.range.every((t,i)=>t===e.range[i])}function dp(t,e){return void 0===t||void 0===e?void 0!==t||void 0!==e:lp(t)&&lp(e)?t.type===e.type&&cp(t,e):!(!hp(t)||!hp(e))&&cp(t,e)}function up(t,e){if(!e)return NaN;if(t instanceof Date&&(t=t.getTime()),"continuous"===e.type&&"number"==typeof t)return(t-e.domain[0])/(e.domain[1]-e.domain[0])*(e.range[1]-e.range[0])+e.range[0];if("log"===e.type&&"number"==typeof t)return e.convert(t);const i=e.domain.findIndex(e=>e===t);return i>=0?e.range[i]:NaN}function pp(t,e){const i=Number(t),s=Number(e);return isNaN(i)||isNaN(s)?t===e:Math.abs(s-i)<.25}function gp(t=!1,e=!1){return t===e?Boolean(t):t?"in":"out"}function mp(t,e,i={}){var s,n,a,o;const{backfillSplitMode:r="intersect"}=i,l=e=>{var i,s;return{x:up(null!=(i=e.xValue)?i:NaN,t.scales.x),y:up(null!=(s=e.yValue)?s:NaN,t.scales.y)}},h=t=>{var i,s;return{x:up(null!=(i=t.xValue)?i:NaN,e.scales.x),y:up(null!=(s=t.yValue)?s:NaN,e.scales.y)}},c=[],d={added:{},moved:{},removed:{}},u=(t,e,i,s="move")=>{t&&(isNaN(t.point.x)||isNaN(t.point.y))&&(t=e);const n={from:null==t?void 0:t.point,to:null==e?void 0:e.point,moveTo:gp(null==t?void 0:t.point.moveTo,null==e?void 0:e.point.moveTo),change:s};"move"===s?(d.moved[i]=n,f++,x++):"in"===s?(d.added[i]=n,x++):"out"===s&&(d.removed[i]=n,f++),c.push(n)},{min:p,max:g}=qu(e.nodeData),{min:m,max:y}=qu(t.nodeData);let f=0,x=0;for(;f<e.nodeData.length||x<t.nodeData.length;){const i=e.nodeData[f],r=t.nodeData[x],c=i?l(i):void 0,d=r?h(r):void 0,b=void 0;if(c&&pp(c.x,null==r?void 0:r.point.x))u(i,r,r.xValue,"move");else if(c&&c.x<(null!=(s=null==m?void 0:m.point.x)?s:-1/0))u(i,b,i.xValue,"out");else if(c&&c.x>(null!=(n=null==y?void 0:y.point.x)?n:1/0))u(i,b,i.xValue,"out");else if(d&&d.x<(null!=(a=null==p?void 0:p.point.x)?a:-1/0))u(b,r,r.xValue,"in");else if(d&&d.x>(null!=(o=null==g?void 0:g.point.x)?o:1/0))u(b,r,r.xValue,"in");else if(c&&c.x<(null==r?void 0:r.point.x))u(i,b,i.xValue,"out");else if(d&&d.x<(null==i?void 0:i.point.x))u(b,r,r.xValue,"in");else if(i)u(i,b,i.xValue,"out");else{if(!r)throw new Error("Unable to process points");u(b,r,r.xValue,"in")}}return tp(c,r),{result:c,resultMap:d}}function yp(t,e,i,s={}){var n,a,o;const{backfillSplitMode:r="intersect",multiDatum:l=!1}=s,h=[],c={added:{},moved:{},removed:{}},d={added:{},moved:{},removed:{}},u={in:"added",move:"moved",out:"removed"};let p,g;const y=(t,e)=>{var i;const s=u[e.change];l?(null!=(i=d[s])[t]||(i[t]=[]),d[s][t].push(e)):c[s][t]=e,p=e,g=Ho(t)};let f=0,x=0,b=!1;for(;f<e.nodeData.length||x<t.nodeData.length;){const s=e.nodeData[f],r=t.nodeData[x],c=Ho(null==s?void 0:s.xValue),d=Ho(null==r?void 0:r.xValue);let u;if(c===d)u={change:"move",moveTo:gp(null!=(n=s.point.moveTo)&&n,r.point.moveTo),from:s.point,to:r.point},y(null==s?void 0:s.xValue,u),f++,x++;else if(null==i?void 0:i.removed.has(String(c)))u={change:"out",moveTo:null!=(a=s.point.moveTo)&&a,from:s.point},y(null==s?void 0:s.xValue,u),f++;else if(null==i?void 0:i.added.has(String(d)))u={change:"in",moveTo:null!=(o=r.point.moveTo)&&o,to:r.point},y(null==r?void 0:r.xValue,u),x++;else if(l&&p&&g===c)u=m({},p),y(null==s?void 0:s.xValue,u),f++;else{if(!l||!p||g!==d){b=!0;break}u=m({},p),y(null==r?void 0:r.xValue,u),x++}h.push(u)}let v=-1/0;return b||(b=h.some(t=>{const{change:e,to:{x:i=-1/0}={}}=t;if("out"===e)return;const s=i<v;return v=i,s})),b?{result:void 0,resultMap:void 0}:(tp(h,r),{result:h,resultMap:l?d:c})}function fp(t,e,i){var s,n,a,o;let r="updated";const l=t=>t.visible;if(!l(e)&&l(t))r="added";else if(l(e)&&!l(t))r="removed";else for(let t=0;t<i.length&&"move"===i[t].change&&(null==(s=i[t].from)?void 0:s.x)===(null==(n=i[t].to)?void 0:n.x)&&(null==(a=i[t].from)?void 0:a.y)===(null==(o=i[t].to)?void 0:o.y);t++)if(t===i.length-1)return"no-op";return r}function xp(t,e,i,s,n){const a=fp(t,e,i),o=function(t,e){const i="none"===e?"updated":t,s={fromFn:e=>{let s;return s="removed"===t?{finish:{visible:!1}}:"added"===t?{start:{visible:!0}}:{},m({phase:Ln[i]},s)},toFn:t=>({phase:Ln[i]})};return"fade"===e?{fromFn:e=>{const i="added"===t?0:e.opacity;return m({opacity:i},s.fromFn(e))},toFn:e=>m({opacity:"removed"===t?0:1},s.toFn(e))}:s}(a,s);return{status:a,path:{addPhaseFn:(t,e)=>{n(i,{move:1,in:t},e)},updatePhaseFn:(t,e)=>{n(i,{move:t},e)},removePhaseFn:(t,e)=>{n(i,{move:0,out:t},e)}},pathProperties:o}}function bp(t,e,i){var s,n,a;const o="category"===(null==(s=t.scales.x)?void 0:s.type);if(o!==("category"===(null==(n=e.scales.x)?void 0:n.type)))return;const{result:r,resultMap:l}=o?yp(t,e,i):mp(t,e);let h="updated";if(e.visible&&!t.visible?h="removed":!e.visible&&t.visible&&(h="added"),void 0===r||void 0===l)return;const c=null==(a=null==i?void 0:i.changed)||a||function(t,e){return!dp(t.scales.x,e.scales.x)||!dp(t.scales.y,e.scales.y)}(t,e)||"updated"!==h,d=xp(t,e,r,"fade",ip),u=Xu(l,h);return y(m({},d),{marker:u,hasMotion:c})}b([Yn(Jn)],Vu.prototype,"xKey",2),b([Yn(Jn,{optional:!0})],Vu.prototype,"xName",2),b([Yn(Jn)],Vu.prototype,"yKey",2),b([Yn(Jn,{optional:!0})],Vu.prototype,"yName",2),b([Yn(ia,{optional:!0})],Vu.prototype,"normalizedTo",2),b([Yn(ga)],Vu.prototype,"fill",2),b([Yn(sa)],Vu.prototype,"fillOpacity",2),b([Yn(ga)],Vu.prototype,"stroke",2),b([Yn(ia)],Vu.prototype,"strokeWidth",2),b([Yn(sa)],Vu.prototype,"strokeOpacity",2),b([Yn(ka)],Vu.prototype,"lineDash",2),b([Yn(ia)],Vu.prototype,"lineDashOffset",2),b([Yn(Xn)],Vu.prototype,"shadow",2),b([Yn(Xn)],Vu.prototype,"marker",2),b([Yn(Xn)],Vu.prototype,"label",2),b([Yn(Xn)],Vu.prototype,"tooltip",2),b([Yn(qn)],Vu.prototype,"connectMissingData",2);var vp=(t=>(t[t.Fill=0]="Fill",t[t.Stroke=1]="Stroke",t[t.Marker=2]="Marker",t[t.Label=3]="Label",t))(vp||{});function Sp(t){const{points:e,phantomPoints:i}=t.fillData;return{top:e,bottom:i}}function Mp(t,e,i){return{scales:e.scales,nodeData:i[t],visible:e.visible}}function kp(t,e,i){var s,n;const a="category"===(null==(s=t.scales.x)?void 0:s.type);if(a!==("category"===(null==(n=e.scales.x)?void 0:n.type)))return;let o="updated";e.visible&&!t.visible?o="removed":!e.visible&&t.visible&&(o="added");const{resultMap:r}=a?yp(t,e,i,{backfillSplitMode:"static",multiDatum:!0}):mp(t,e,{backfillSplitMode:"static"}),{top:l,bottom:h}=a?function(t,e,i){const s=Sp(e),n=Sp(t),a={multiDatum:!0};return{top:yp(Mp("top",t,n),Mp("top",e,s),i,a),bottom:yp(Mp("bottom",t,n),Mp("bottom",e,s),i,a)}}(t,e,i):function(t,e){const i=Sp(e),s=Sp(t);return{top:mp(Mp("top",t,s),Mp("top",e,i)),bottom:mp(Mp("bottom",t,s),Mp("bottom",e,i))}}(t,e);if(void 0===r||void 0===l.result||void 0===h.result)return;const c=xp(t,e,[...l.result,...h.result.reverse()],!!e.stackVisible&&t.stackVisible?"none":"fade",ip),d=Xu(r,o);return{status:c.status,fill:c,marker:d}}var Dp=class extends Vd{constructor(t){super({moduleCtx:t,directionKeys:Gd,directionNames:_d,pathsPerSeries:2,pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[1,0],animationResetFns:{path:op({getOpacity:()=>this.getOpacity()}),label:Bu,marker:(t,e)=>m(m({},{opacity:1,scalingX:1,scalingY:1}),Uu(0,e))}}),this.properties=new Vu}processData(t){return S(this,null,function*(){var e,i;if(null==this.data||!this.properties.isValid())return;const{data:s,visible:n,seriesGrouping:{groupIndex:a=this.id,stackCount:o=1}={}}=this,{xKey:r,yKey:l,connectMissingData:h,normalizedTo:c}=this.properties,d=!this.ctx.animationManager.isSkipped(),u=null==(e=this.axes.x)?void 0:e.scale,p=null==(i=this.axes.y)?void 0:i.scale,{isContinuousX:g,xScaleType:f,yScaleType:x}=this.getScaleInformation({xScale:u,yScale:p}),b=[`area-stack-${a}-yValues`,`area-stack-${a}-yValues-trailing`,`area-stack-${a}-yValues-prev`,`area-stack-${a}-yValues-trailing-prev`,`area-stack-${a}-yValues-marker`],v=[];Tt(c)&&(v.push(Cc([b[0],b[1],b[4]],c,"range")),v.push(Cc([b[2],b[3]],c,"range"))),!g&&d&&this.processedData&&v.push(Ec(this.processedData)),d&&v.push(Tc());const S={invalidValue:null};h&&o>1&&(S.invalidValue=0),n||(S.forceValue=0),yield this.requestDataModel(t,s,{props:[jc(r,f,{id:"xValue"}),Wc(l,x,m({id:"yValueRaw"},S)),...$c(l,"window","current",y(m({id:"yValueEnd"},S),{groupId:b[0]}),x),...$c(l,"window-trailing","current",y(m({id:"yValueStart"},S),{groupId:b[1]}),x),...$c(l,"window","last",y(m({id:"yValuePreviousEnd"},S),{groupId:b[2]}),x),...$c(l,"window-trailing","last",y(m({id:"yValuePreviousStart"},S),{groupId:b[3]}),x),...$c(l,"normal","current",y(m({id:"yValueCumulative"},S),{groupId:b[4]}),x),...v],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")})}getSeriesDomain(t){const{processedData:e,dataModel:i,axes:s}=this;if(!e||!i||0===e.data.length)return[];const n=s.x,a=s.y,o=i.resolveProcessedDataDefById(this,"xValue"),r=i.getDomain(this,"xValue","key",e),l=i.getDomain(this,"yValueEnd","value",e);return"x"===t?"key"===(null==o?void 0:o.def.type)&&"category"===o.def.valueType?r:Hh(os(r),n):Hh(a instanceof Jd||a instanceof eu?l:[l[0]>0?0:l[0],l[1]<0?0:l[1]],a)}createNodeData(){return S(this,null,function*(){var t;const{axes:e,data:i,processedData:{data:s}={},dataModel:n}=this,a=e.x,o=e.y;if(!(a&&o&&i&&n&&this.properties.isValid()))return;const{yKey:r,xKey:l,marker:h,label:c,fill:d,stroke:u,connectMissingData:p}=this.properties,{scale:g}=a,{scale:f}=o,{isContinuousY:x}=this.getScaleInformation({xScale:g,yScale:f}),b=(null!=(t=g.bandwidth)?t:0)/2,v=n.resolveProcessedDataDefsByIds(this,["yValueStart","yValueEnd","yValueRaw","yValuePreviousStart","yValuePreviousEnd","yValueCumulative"]),S=t=>y(m({},t),{point:y(m({},t.point),{moveTo:!0})}),M=(t,e,i)=>{const s=g.convert(t)+b,n=f.convert(e);return[{point:{x:s,y:f.convert(i)},yValue:i,xValue:t},{point:{x:s,y:n},yValue:e,xValue:t}]},k=(t,e,i)=>{let s;return(Tt(this.properties.normalizedTo)?x&&Yo(i):!isNaN(i))&&(s=e),{x:g.convert(t)+b,y:f.convert(s),size:h.size}},D=r,w=[],I=[],{visibleSameStackCount:C}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),L={itemId:D,fillData:{itemId:D,points:[],phantomPoints:[]},strokeData:{itemId:D,points:[]},labelData:w,nodeData:I,scales:this.calculateScaling(),visible:this.visible,stackVisible:C>0},A=L.fillData.points,T=L.fillData.phantomPoints,N=L.strokeData.points;let O,R=-1,E=-1/0;return null==s||s.forEach(t=>{const{keys:e,keys:[i],datum:s,values:a}=t;a.forEach((t,a)=>{var o,g,m;R++;const y=s[a],f=n.resolveProcessedDataDefsValues(v,{keys:e,values:t}),{yValueRaw:x,yValueCumulative:b}=f;let{yValueStart:C,yValueEnd:L,yValuePreviousStart:P,yValuePreviousEnd:B}=f;const F=null!=x,z=k(i,+b,x);if(F&&h&&I.push({index:R,series:this,itemId:D,datum:y,midPoint:{x:z.x,y:z.y},cumulativeValue:L,yValue:x,xValue:i,yKey:r,xKey:l,point:z,fill:null!=(o=h.fill)?o:d,stroke:null!=(g=h.stroke)?g:u,strokeWidth:null!=(m=h.strokeWidth)?m:this.getStrokeWidth(this.properties.strokeWidth)}),F&&c){const t=this.getLabelText(c,{value:x,datum:y,xKey:l,yKey:r,xName:this.properties.xName,yName:this.properties.yName},t=>Wt(t)?t.toFixed(2):String(t));w.push({index:R,series:this,itemId:r,datum:y,x:z.x,y:z.y,label:t?{text:t,fontStyle:c.fontStyle,fontWeight:c.fontWeight,fontSize:c.fontSize,fontFamily:c.fontFamily,textAlign:"center",textBaseline:"bottom",fill:c.color}:void 0})}const G=null!=O&&null!=i,_=null!=E&&F;_||(C=null!=C?C:0,L=null!=C?C:0,P=null!=P?P:0,B=null!=P?P:0);const[j,W]=M(O,P,B),[V,K]=M(i,C,L);!G||p&&!_||(A.push(j,V),T.push(W,K)),_&&R>0&&N.push(S(j),V),O=i,E=x})}),N.length>0&&(N[0]=S(N[0])),L})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}markerFactory(){const{shape:t}=this.properties.marker;return new(Od(t))}updatePathNodes(t){return S(this,null,function*(){const{opacity:e,visible:i,animationEnabled:s}=t,[n,a]=t.paths,o=this.getStrokeWidth(this.properties.strokeWidth);a.setProperties({tag:1,fill:void 0,lineJoin:a.lineCap="round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:o,strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i}),n.setProperties({tag:0,stroke:void 0,lineJoin:"round",pointerEvents:1,fill:this.properties.fill,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,strokeOpacity:this.properties.strokeOpacity,fillShadow:this.properties.shadow,opacity:e,visible:i||s,strokeWidth:o}),rp(this,a),rp(this,n)})}updatePaths(t){return S(this,null,function*(){this.updateAreaPaths(t.paths,t.contextData)})}updateAreaPaths(t,e){this.updateFillPath(t,e),this.updateStrokePath(t,e)}updateFillPath(t,e){const{fillData:i}=e,[s]=t,{path:n}=s;let a;n.clear(!0);for(const{point:t}of N(i.points,function*(t){for(let e=t.length-1;e>=0;e--)yield t[e]}(i.phantomPoints)))t.moveTo?n.moveTo(t.x,t.y):(null==a?void 0:a.y)!==t.y&&(a&&n.lineTo(a.x,a.y),n.lineTo(t.x,t.y)),a=t;a&&n.lineTo(a.x,a.y),n.closePath(),s.checkPathDirty()}updateStrokePath(t,e){const{strokeData:i}=e,[,s]=t,{path:n}=s;n.clear(!0);for(const{point:t}of i.points)t.moveTo?n.moveTo(t.x,t.y):n.lineTo(t.x,t.y);s.checkPathDirty()}updateMarkerSelection(t){return S(this,null,function*(){const{nodeData:e,markerSelection:i}=t;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?e:[])})}updateMarkerNodes(t){return S(this,null,function*(){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,marker:a,fill:o,stroke:r,strokeWidth:l,fillOpacity:h,strokeOpacity:c,highlightStyle:d}=this.properties,u=Ut(i&&d.item,a.getStyle(),{fill:o,stroke:r,strokeWidth:l,fillOpacity:h,strokeOpacity:c});e.each((t,e)=>{this.updateMarkerStyle(t,a,{datum:e,highlighted:i,xKey:s,yKey:n},u)}),i||this.properties.marker.markClean()})}updateLabelSelection(t){return S(this,null,function*(){const{labelData:e,labelSelection:i}=t;return i.update(e,t=>{t.tag=3})})}updateLabelNodes(t){return S(this,null,function*(){const{labelSelection:e}=t,{enabled:i,fontStyle:s,fontWeight:n,fontSize:a,fontFamily:o,color:r}=this.properties.label;e.each((t,e)=>{const{x:l,y:h,label:c}=e;c&&i&&this.visible?(t.fontStyle=s,t.fontWeight=n,t.fontSize=a,t.fontFamily=o,t.textAlign=c.textAlign,t.textBaseline=c.textBaseline,t.text=c.text,t.x=l,t.y=h-10,t.fill=r,t.visible=!0):t.visible=!1})})}getTooltipHtml(t){const{id:e,axes:i,dataModel:s}=this,{xKey:n,xName:a,yName:o,tooltip:r,marker:l}=this.properties,{yKey:h,xValue:c,yValue:d,datum:u,itemId:p}=t,g=i.x,m=i.y;if(!this.properties.isValid()||!(g&&m&&Wt(d))||!s)return tl;const y=g.formatDatum(c),f=m.formatDatum(d),x=Ru(o),b=Ru(y+": "+f),v=Ut({fill:this.properties.fill},l.getStyle(),{stroke:this.properties.stroke,strokeWidth:this.properties.strokeWidth}),{fill:S}=this.getMarkerStyle(l,{datum:t,xKey:n,yKey:h,highlighted:!1},v);return r.toTooltipHtml({title:x,content:b,backgroundColor:S},{datum:u,itemId:p,xKey:n,xName:a,yKey:h,yName:o,color:S,title:x,seriesId:e})}getLegendData(t){var e,i,s,n;if(!(null==(e=this.data)?void 0:e.length)||!this.properties.isValid()||"category"!==t)return[];const{yKey:a,yName:o,fill:r,stroke:l,fillOpacity:h,strokeOpacity:c,strokeWidth:d,lineDash:u,marker:p,visible:g}=this.properties,m=!p.enabled||void 0===p.fill;return[{legendType:t,id:this.id,itemId:a,seriesId:this.id,enabled:g,label:{text:null!=o?o:a},marker:{shape:p.shape,fill:m?r:p.fill,fillOpacity:m?h:p.fillOpacity,stroke:null!=(i=p.stroke)?i:l,strokeOpacity:null!=(s=p.strokeOpacity)?s:c,strokeWidth:null!=(n=p.strokeWidth)?n:0,enabled:p.enabled||d<=0},line:{stroke:l,strokeOpacity:c,strokeWidth:d,lineDash:u}}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:a}=this.ctx;this.updateAreaPaths(n,s),sp(this,a,...n),gr([e],Uu),$u(this,a,e),Eu(this,"labels",a,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){var e,i;const{animationManager:s}=this.ctx,{markerSelection:n,labelSelection:a,contextData:o,paths:r,previousContextData:l}=t,[h,c]=r;if(null==h&&null==c)return;super.resetAllAnimation(t);const d=()=>{this.updateAreaPaths(r,o),this.updateStrokePath(r,o)};if(null==o||null==l)return d(),Ku(this,s,"added",n),np(this,"fill_path_properties",s,"add",h),np(this,"stroke",s,"trailing",c),void Eu(this,"labels",s,a);const u=kp(o,l,null==(i=null==(e=this.processedData)?void 0:e.reduced)?void 0:i.diff);if(void 0===u)return s.skipCurrentBatch(),void d();"no-op"!==u.status&&(Ku(this,s,void 0,n),An(this.id,"fill_path_properties",s,[h],u.fill.pathProperties),Nu(this.id,"fill_path_update",s,[h],u.fill.path),this.updateStrokePath(r,o),np(this,"stroke",s,"trailing",c),Eu(this,"labels",s,a))}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Mo}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=t;return this.getMarkerStyle(this.properties.marker,{datum:t,xKey:e,yKey:i,highlighted:!0})}computeFocusBounds(t){return Zu(this,t)}};Dp.className="AreaSeries",Dp.type="area";var wp={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",instanceConstructor:Dp,stackable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{__extends__:We,nodeClickRange:"nearest",tooltip:{position:{type:"node"}},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Je,xOffset:3,yOffset:3,blur:5},marker:{__extends__:Ve,enabled:!1,fillOpacity:1,strokeOpacity:1,strokeWidth:0},label:{enabled:!1,fontSize:12,fontFamily:Ke,color:Ye}}},paletteFactory:t=>{const{marker:e}=Tu(t);return{fill:e.fill,stroke:e.stroke,marker:e}}};function*Ip(t){for(const e of t.children)yield e}function Cp(t,e){for(const i of e){const e=i.datum;void 0===e?R.error("undefined datum"):t.addValue(i,e)}}function Lp(t,e){const{x:i,y:s}=t.contentGroup.transformPoint(e.x,e.y),{nearest:n,distanceSquared:a}=t.getQuadTree().find(i,s);if(void 0!==n)return{datum:n.value,distance:Math.sqrt(a)}}var Ap=class extends Wd{constructor(){super(...arguments),this.direction="vertical"}};b([Yn(Na)],Ap.prototype,"direction",2);var Tp=class extends Vd{constructor(){super(...arguments),this.groupScale=new Vn,this.smallestDataInterval=void 0}getBandScalePadding(){return{inner:.2,outer:.1}}shouldFlipXY(){return!this.isVertical()}isVertical(){return"vertical"===this.properties.direction}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]}updateGroupScale(t){const{groupScale:e,smallestDataInterval:i,ctx:{seriesStateManager:s}}=this,n=t.scale,a=Ua.is(n)?n.calcBandwidth(i):n.bandwidth,o=[],{index:r,visibleGroupCount:l}=s.getVisiblePeerGroupIndex(this);for(let t=0;t<l;t++)o.push(String(t));return e.domain=o,e.range=[0,null!=a?a:0],t instanceof Il?e.paddingInner=t.groupPaddingInner:e.padding=t instanceof Fl?.1:0,e.round=0!==e.padding,{barWidth:e.bandwidth>=1?e.bandwidth:e.rawBandwidth,groupIndex:r}}resolveKeyDirection(t){return"x"===this.getBarDirection()?"x"===t?"y":"x":t}initQuadTree(t){Cp(t,this.datumNodesIter())}pickNodeClosestDatum(t){return Lp(this,t)}},Np=class extends zo{constructor(){super(...arguments),this.placement="inside"}};b([Yn(Oa)],Np.prototype,"placement",2);var Op=class extends Ap{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.shadow=new zu,this.label=new Np,this.tooltip=new Wu}};function Rp({rect:t,config:e}){const{crisp:i=!0,fill:s,stroke:n,strokeWidth:a,fillOpacity:o,strokeOpacity:r,lineDash:l,lineDashOffset:h,fillShadow:c,cornerRadius:d=0,topLeftCornerRadius:u=!0,topRightCornerRadius:p=!0,bottomRightCornerRadius:g=!0,bottomLeftCornerRadius:m=!0,visible:y=!0}=e;t.crisp=i,t.fill=s,t.stroke=n,t.strokeWidth=a,t.fillOpacity=o,t.strokeOpacity=r,t.lineDash=l,t.lineDashOffset=h,t.fillShadow=c,t.topLeftCornerRadius=u?d:0,t.topRightCornerRadius=p?d:0,t.bottomRightCornerRadius=g?d:0,t.bottomLeftCornerRadius=m?d:0,t.visible=y}function Ep(t){var e,i,s,n,a,o,r=t,{datum:l,isHighlighted:h,style:c,highlightStyle:d,formatter:u,seriesId:p,ctx:{callbackCache:g}}=r,y=f(r,["datum","isHighlighted","style","highlightStyle","formatter","seriesId","ctx"]);const{fill:x,fillOpacity:b,stroke:v,strokeWidth:S}=Ut(h&&d,c),{strokeOpacity:M,fillShadow:k,lineDash:D,lineDashOffset:w,cornerRadius:I=0,topLeftCornerRadius:C=!0,topRightCornerRadius:L=!0,bottomRightCornerRadius:A=!0,bottomLeftCornerRadius:T=!0}=c;let N;return u&&(N=g.call(u,m({datum:l.datum,xKey:l.xKey,fill:x,stroke:v,strokeWidth:S,cornerRadius:I,highlighted:h,seriesId:p},y))),{fill:null!=(e=null==N?void 0:N.fill)?e:x,stroke:null!=(i=null==N?void 0:N.stroke)?i:v,strokeWidth:null!=(s=null==N?void 0:N.strokeWidth)?s:S,fillOpacity:null!=(n=null==N?void 0:N.fillOpacity)?n:b,strokeOpacity:null!=(a=null==N?void 0:N.strokeOpacity)?a:M,lineDash:D,lineDashOffset:w,fillShadow:k,cornerRadius:null!=(o=null==N?void 0:N.cornerRadius)?o:I,topLeftCornerRadius:C,topRightCornerRadius:L,bottomRightCornerRadius:A,bottomLeftCornerRadius:T}}function Pp(t=[]){const[e,i]=t;return!(0!==e||1!==i)}b([Yn(Jn)],Op.prototype,"xKey",2),b([Yn(Jn,{optional:!0})],Op.prototype,"xName",2),b([Yn(Jn)],Op.prototype,"yKey",2),b([Yn(Jn,{optional:!0})],Op.prototype,"yName",2),b([Yn(Jn,{optional:!0})],Op.prototype,"stackGroup",2),b([Yn(ta,{optional:!0})],Op.prototype,"normalizedTo",2),b([Yn(ga)],Op.prototype,"fill",2),b([Yn(sa)],Op.prototype,"fillOpacity",2),b([Yn(ga)],Op.prototype,"stroke",2),b([Yn(ia)],Op.prototype,"strokeWidth",2),b([Yn(sa)],Op.prototype,"strokeOpacity",2),b([Yn(ka)],Op.prototype,"lineDash",2),b([Yn(ia)],Op.prototype,"lineDashOffset",2),b([Yn(ia)],Op.prototype,"cornerRadius",2),b([Yn(Qn,{optional:!0})],Op.prototype,"formatter",2),b([Yn(Xn,{optional:!0})],Op.prototype,"shadow",2),b([Yn(Xn)],Op.prototype,"label",2),b([Yn(Xn)],Op.prototype,"tooltip",2);var Bp=t=>{var e;return Ks(null!=(e=t.yValue)?e:0)};function Fp(t,e,i){const{startingX:s,startingY:n}=function(t,e){const i=e[t?"y":"x"];let s=1/0,n=0;return i?(t?n=i.scale.convert(Ua.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(Ua.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}(t,e);return{isVertical:t,calculate:(e,i)=>{let a=t?e.x:s,o=t?n:e.y,r=t?e.width:0,l=t?0:e.height;const{opacity:h}=e;let c;return i&&(isNaN(a)||isNaN(o))&&(({x:a,y:o}=i),r=t?i.width:0,l=t?0:i.height,t&&!Bp(i)?o+=i.height:!t&&Bp(i)&&(a+=i.width)),c=null==e.clipBBox?void 0:Bp(e)?t?new Qs(a,o-l,r,l):new Qs(a-r,o,r,l):new Qs(a,o,r,l),{x:a,y:o,width:r,height:l,clipBBox:c,opacity:h}},mode:i}}function zp(t,e){return{isVertical:t,calculate:e=>({x:t?e.x:e.x+e.width/2,y:t?e.y+e.height/2:e.y,width:t?e.width:0,height:t?0:e.height,clipBBox:e.clipBBox,opacity:e.opacity}),mode:e}}function Gp(t){const e=t=>null==t||isNaN(t.x)||isNaN(t.y);return{toFn:(i,s,n)=>{let a;return a="removed"===n&&null==i.datum&&"fade"===t.mode?y(m({},_p(0,s)),{opacity:0}):"removed"===n||e(s)?t.calculate(s,i.previousDatum):{x:s.x,y:s.y,width:s.width,height:s.height,clipBBox:s.clipBBox,opacity:s.opacity},a},fromFn:(i,s,n)=>{let a;"updated"===n&&e(s)?n="removed":"updated"===n&&e(i.previousDatum)&&(n="added"),a="added"===n&&null==i.previousDatum&&"fade"===t.mode?y(m({},_p(0,s)),{opacity:0}):"unknown"===n||"added"===n?t.calculate(s,i.previousDatum):{x:i.x,y:i.y,width:i.width,height:i.height,clipBBox:i.clipBBox,opacity:i.opacity};const o=Ln[n];return y(m({},a),{phase:o})}}}function _p(t,{x:e,y:i,width:s,height:n,clipBBox:a,opacity:o}){return{x:e,y:i,width:s,height:n,clipBBox:a,opacity:o}}function jp(t,e,i){if(void 0===t)return;const{x:s,y:n,width:a,height:o}=t;return e.inverseTransformBBox(new Qs(s,n,a,o)).clip(i)}function Wp(t,e,i){if(e.enabled&&i){const{x:s,y:n,text:a,textAlign:o,textBaseline:r}=i,{color:l,fontStyle:h,fontWeight:c,fontSize:d,fontFamily:u}=e;t.setProperties({visible:!0,x:s,y:n,text:a,fill:l,fontStyle:h,fontWeight:c,fontSize:d,fontFamily:u,textAlign:o,textBaseline:r})}else t.visible=!1}function Vp({isPositive:t,isVertical:e,placement:i,padding:s=0,rect:n}){let a=n.x+n.width/2,o=n.y+n.height/2,r="center",l="middle";switch(i){case"start":e?(o=t?n.y+n.height+s:n.y-s,l=t?"top":"bottom"):(a=t?n.x-s:n.x+n.width+s,r=t?"start":"end");break;case"outside":case"end":e?(o=t?n.y-s:n.y+n.height+s,l=t?"bottom":"top"):(a=t?n.x+n.width+s:n.x-s,r=t?"start":"end")}return{x:a,y:o,textAlign:r,textBaseline:l}}var Kp=class extends Tp{constructor(t){super({moduleCtx:t,directionKeys:Gd,directionNames:_d,pickModes:[0],pathsPerSeries:0,hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:_p,label:Bu}}),this.properties=new Op}processData(t){return S(this,null,function*(){var e,i,s;if(!this.properties.isValid()||!this.data)return;const{seriesGrouping:{groupIndex:n=this.id}={},data:a=[]}=this,{xKey:o,yKey:r,normalizedTo:l}=this.properties,h=!this.ctx.animationManager.isSkipped(),c=null==(e=this.getCategoryAxis())?void 0:e.scale,d=null==(i=this.getValueAxis())?void 0:i.scale,{isContinuousX:u,xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:c,yScale:d}),y=`bar-stack-${n}-yValues`,f=`${y}-trailing`,x=[];Wt(l)&&x.push(Cc([y,f],Math.abs(l),"range")),h&&this.processedData&&x.push(Ec(this.processedData)),h&&x.push(Tc());const b=this.visible?{}:{forceValue:0},{processedData:v}=yield this.requestDataModel(t,a,{props:[jc(o,p,{id:"xValue"}),Wc(r,g,m({id:"yValue-raw",invalidValue:null},b)),...$c(r,"normal","current",m({id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:y,separateNegative:!0},b),g),...$c(r,"trailing","current",m({id:"yValue-start",invalidValue:null,missingValue:0,groupId:f,separateNegative:!0},b),g),...u?[Dc]:[],...x],groupByKeys:!0,groupByData:!1});this.smallestDataInterval=null==(s=v.reduced)?void 0:s.smallestKeyInterval,this.animationState.transition("updateData")})}getSeriesDomain(t){var e;const{processedData:i,dataModel:s,smallestDataInterval:n}=this;if(!i||!s||0===i.data.length)return[];const a=this.getCategoryAxis(),o=this.getValueAxis(),r=s.resolveProcessedDataDefById(this,"xValue"),l=s.getDomain(this,"xValue","key",i),h=s.getDomain(this,"yValue-end","value",i);if(t===this.getCategoryDirection()){if("key"===(null==r?void 0:r.def.type)&&"category"===r.def.valueType)return l;const t=Wt(n)?.5*n:0,i=null!=(e=os(l))?e:[NaN,NaN];return Hh([i[0]+-t,i[1]+t],a)}return this.getValueAxis()instanceof Jd?Hh(h,o):Hh([Math.min(0,h[0]),Math.max(0,h[1])],o)}createNodeData(){return S(this,null,function*(){const{dataModel:t}=this,e=this.getCategoryAxis(),i=this.getValueAxis();if(!(t&&e&&i&&this.properties.isValid()))return;const s=e.scale,n=i.scale,{xKey:a,yKey:o,xName:r,yName:l,fill:h,stroke:c,strokeWidth:d,cornerRadius:u,legendItemName:p,label:g}=this.properties,y=i.isReversed(),{barWidth:f,groupIndex:x}=this.updateGroupScale(e),b=Ua.is(s)?-.5*f:0,v=t.resolveProcessedDataIndexById(this,"xValue"),S=t.resolveProcessedDataIndexById(this,"yValue-raw"),M=t.resolveProcessedDataIndexById(this,"yValue-start"),k=t.resolveProcessedDataIndexById(this,"yValue-end"),D=t.resolveProcessedDataIndexById(this,"yValue-range"),w=!this.ctx.animationManager.isSkipped(),I={itemId:o,nodeData:[],labelData:[],scales:this.calculateScaling(),visible:this.visible||w},{groupScale:C,processedData:L}=this;return null==L||L.data.forEach(({keys:t,datum:e,values:i,aggValues:w})=>{i.forEach((i,L)=>{var A;const T=t[v],N=s.convert(T),O=+i[k],R=+i[M],E=i[S],P=E>=0&&!Object.is(E,-0),B=P!==y,F=null!=(A=null==w?void 0:w[D][P?1:0])?A:0,z=N+C.convert(String(x))+b;if(isNaN(O))return;const G=n.convert(O),_=n.convert(R),j="x"===this.getBarDirection(),W=n.convert(F),V=n.convert(0),K={x:j?Math.min(G,_):z,y:j?z:Math.min(G,_),width:j?Math.abs(_-G):f,height:j?f:Math.abs(_-G)},Y=new Qs(K.x,K.y,K.width,K.height),$={x:j?Math.min(V,W):z,y:j?z:Math.min(V,W),width:j?Math.abs(V-W):f,height:j?f:Math.abs(V-W),clipBBox:Y},{fontStyle:H,fontWeight:U,fontSize:X,fontFamily:Z,color:q,placement:Q}=g,J=this.getLabelText(this.properties.label,{datum:e[L],value:E,xKey:a,yKey:o,xName:r,yName:l,legendItemName:p},t=>Wt(t)?t.toFixed(2):String(t)),tt=J?m({text:J,fill:q,fontStyle:H,fontWeight:U,fontSize:X,fontFamily:Z},Vp({isPositive:P,isVertical:!j,placement:Q,rect:K})):void 0,et=this.shouldFlipXY()?K.height:K.width,it={series:this,itemId:o,datum:e[L],valueIndex:L,cumulativeValue:O,xValue:T,yValue:E,yKey:o,xKey:a,capDefaults:{lengthRatioMultiplier:et,lengthMax:et},x:$.x,y:$.y,width:$.width,height:$.height,midPoint:{x:K.x+K.width/2,y:K.y+K.height/2},fill:h,stroke:c,opacity:1,strokeWidth:d,cornerRadius:u,topLeftCornerRadius:j!==B,topRightCornerRadius:B,bottomRightCornerRadius:j===B,bottomLeftCornerRadius:!B,clipBBox:Y,label:tt,missing:null==E};I.nodeData.push(it),I.labelData.push(it)})}),I})}nodeFactory(){return new ou}updateDatumSelection(t){return S(this,null,function*(){return t.datumSelection.update(t.nodeData,t=>{t.tag=0},t=>Pc(t.xValue,t.valueIndex))})}updateDatumNodes(t){return S(this,null,function*(){if(!this.properties.isValid())return;const{yKey:e,stackGroup:i,fill:s,fillOpacity:n,stroke:a,strokeWidth:o,strokeOpacity:r,lineDash:l,lineDashOffset:h,formatter:c,shadow:d,highlightStyle:{item:u}}=this.properties,p=this.axes.x,g=Pp(null==p?void 0:p.visibleRange),m="x"===this.getCategoryDirection();t.datumSelection.each((p,y)=>{var f,x,b,v;const S={fill:s,stroke:a,fillOpacity:n,strokeOpacity:r,lineDash:l,lineDashOffset:h,fillShadow:d,strokeWidth:this.getStrokeWidth(o),cornerRadius:y.cornerRadius,topLeftCornerRadius:y.topLeftCornerRadius,topRightCornerRadius:y.topRightCornerRadius,bottomRightCornerRadius:y.bottomRightCornerRadius,bottomLeftCornerRadius:y.bottomLeftCornerRadius},M=m?(null!=(x=null==(f=y.clipBBox)?void 0:f.width)?x:y.width)>0:(null!=(v=null==(b=y.clipBBox)?void 0:b.height)?v:y.height)>0,k=Ep({datum:y,ctx:this.ctx,seriesId:this.id,isHighlighted:t.isHighlight,highlightStyle:u,yKey:e,style:S,formatter:c,stackGroup:i});k.crisp=g,k.visible=M,Rp({rect:p,config:k})})})}updateLabelSelection(t){return S(this,null,function*(){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e,t=>{t.tag=1,t.pointerEvents=1})})}updateLabelNodes(t){return S(this,null,function*(){t.labelSelection.each((t,e)=>{Wp(t,this.properties.label,e.label)})})}getTooltipHtml(t){var e;const{id:i,processedData:s,ctx:{callbackCache:n}}=this,a=this.getCategoryAxis(),o=this.getValueAxis();if(!(s&&this.properties.isValid()&&a&&o))return tl;const{xKey:r,yKey:l,xName:h,yName:c,fill:d,stroke:u,strokeWidth:p,tooltip:g,formatter:y,stackGroup:f,legendItemName:x}=this.properties,{xValue:b,yValue:v,datum:S,itemId:M}=t,k=a.formatDatum(b),D=o.formatDatum(v),w=Ru(c),I=Ru(k+": "+D);let C;y&&(C=n.call(y,{seriesId:i,datum:S,xKey:r,yKey:l,stackGroup:f,fill:d,stroke:u,strokeWidth:this.getStrokeWidth(p),highlighted:!1}));const L=null!=(e=null==C?void 0:C.fill)?e:d;return g.toTooltipHtml({title:w,content:I,backgroundColor:L},m({seriesId:i,itemId:M,datum:S,xKey:r,yKey:l,xName:h,yName:c,stackGroup:f,title:w,color:L,legendItemName:x},this.getModuleTooltipParams()))}getLegendData(t){var e,i;const{showInLegend:s}=this.properties;if("category"!==t||!(null==(e=this.data)?void 0:e.length)||!this.properties.isValid()||!s)return[];const{yKey:n,yName:a,fill:o,stroke:r,strokeWidth:l,fillOpacity:h,strokeOpacity:c,legendItemName:d,visible:u}=this.properties;return[{legendType:"category",id:this.id,itemId:n,seriesId:this.id,enabled:u,label:{text:null!=(i=null!=d?d:a)?i:n},marker:{fill:o,fillOpacity:h,stroke:r,strokeWidth:l,strokeOpacity:c},legendItemName:d}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const s=Gp(Fp(this.isVertical(),this.axes,"normal"));An(this.id,"nodes",this.ctx.animationManager,[t],s),Eu(this,"labels",this.ctx.animationManager,e),Eu(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(t){var e,i,s;const{datumSelection:n,labelSelection:a,annotationSelections:o,previousContextData:r}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=null==(i=null==(e=this.processedData)?void 0:e.reduced)?void 0:i.diff,h=null==r?"fade":"normal",c=Gp(Fp(this.isVertical(),this.axes,h));An(this.id,"nodes",this.ctx.animationManager,[n],c,(t,e)=>Pc(e.xValue,e.valueIndex),l),(null==(s=null==l?void 0:l.changed)||s)&&(Eu(this,"labels",this.ctx.animationManager,a),Eu(this,"annotations",this.ctx.animationManager,...o))}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t,seriesRect:e}){var i;return jp(null==(i=this.contextNodeData)?void 0:i.nodeData[t].clipBBox,this.contentGroup,e)}};Kp.className="BarSeries",Kp.type="bar";var Yp={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",instanceConstructor:Kp,stackable:!0,groupable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],swapDefaultAxesCondition:t=>"horizontal"===(null==t?void 0:t.direction),themeTemplate:{series:{__extends__:We,direction:"vertical",fillOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontWeight:"normal",fontSize:12,fontFamily:Ke,color:He,placement:"inside"},shadow:{enabled:!1,color:Je,xOffset:3,yOffset:3,blur:5}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:.3}}}},paletteFactory:Au},$p=t=>{const e=un.fromString(t),[i,s,n]=un.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:s,h:n,a:e.a}},Hp=class{constructor(){this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map($p)}update(){const{domain:t,range:e}=this;t.length<2&&(R.warnOnce("`colorDomain` should have at least 2 values."),0===t.length?t.push(0,1):1===t.length&&t.push(t[0]+1));for(let e=1;e<t.length;e++)if(t[e-1]>=t[e]){R.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((t,e)=>t-e);break}if(e.length<t.length)for(let i=e.length;i<t.length;i++)e.push(e.length>0?e[0]:"black");this.parsedRange=this.range.map($p)}convert(t){this.refresh();const{domain:e,range:i,parsedRange:s}=this,n=e[0],a=e.at(-1),o=i[0],r=i[i.length-1];if(t<=n)return o;if(t>=a)return r;let l,h;if(2===e.length){const e=(t-n)/(a-n),s=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(e*(i.length-1)),i.length-2),h=(e-l*s)/s}else{for(l=0;l<e.length-2&&!(t<e[l+1]);l++);const i=e[l];h=(t-i)/(e[l+1]-i)}return((t,e,i)=>{let s,n;if(i=Gs(0,i,1),Number.isNaN(t.h)&&Number.isNaN(e.h))s=0,n=0;else if(Number.isNaN(t.h))s=e.h,n=e.c;else if(Number.isNaN(e.h))s=t.h,n=t.c;else{const a=t.h;let o=e.h;const r=e.h-t.h;r>180?o-=360:r<-180&&(o+=360),s=a*(1-i)+o*i,n=t.c*(1-i)+e.c*i}const a=t.l*(1-i)+e.l*i,o=t.a*(1-i)+e.a*i;return un.fromOKLCH(a,n,s,o)})(s[l],s[l+1],h).toRgbaString()}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&R.warnOnce("Expected update to not invalidate scale"))}};b([jn],Hp.prototype,"domain",2),b([jn],Hp.prototype,"range",2);var Up=class extends _u{constructor(){super(...arguments),this.maxSize=30}};b([Yn(ia),en({redraw:3})],Up.prototype,"maxSize",2),b([Yn(fa,{optional:!0}),en({redraw:3})],Up.prototype,"domain",2);var Xp=class extends zo{constructor(){super(...arguments),this.placement="top"}};b([Yn(Ea)],Xp.prototype,"placement",2);var Zp=class extends Wd{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.marker=new Up,this.label=new Xp,this.tooltip=new Wu}};b([Yn(Jn)],Zp.prototype,"xKey",2),b([Yn(Jn)],Zp.prototype,"yKey",2),b([Yn(Jn)],Zp.prototype,"sizeKey",2),b([Yn(Jn,{optional:!0})],Zp.prototype,"labelKey",2),b([Yn(Jn,{optional:!0})],Zp.prototype,"colorKey",2),b([Yn(Jn,{optional:!0})],Zp.prototype,"xName",2),b([Yn(Jn,{optional:!0})],Zp.prototype,"yName",2),b([Yn(Jn,{optional:!0})],Zp.prototype,"sizeName",2),b([Yn(Jn,{optional:!0})],Zp.prototype,"labelName",2),b([Yn(Jn,{optional:!0})],Zp.prototype,"colorName",2),b([Yn(fa,{optional:!0})],Zp.prototype,"colorDomain",2),b([Yn(ma)],Zp.prototype,"colorRange",2),b([Yn(Jn,{optional:!0})],Zp.prototype,"title",2),b([Yn(Xn)],Zp.prototype,"marker",2),b([Yn(Xn)],Zp.prototype,"label",2),b([Yn(Xn)],Zp.prototype,"tooltip",2);var qp=class extends jd{constructor(t,e,i,s){super(t,e,i,s),this.sizeKey=s.properties.sizeKey}},Qp=class extends Vd{constructor(t){super({moduleCtx:t,directionKeys:Gd,directionNames:_d,pickModes:[2,3,0],pathsPerSeries:0,hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:Bu,marker:Hu}}),this.NodeEvent=qp,this.properties=new Zp,this.sizeScale=new Xd,this.colorScale=new Hp}processData(t){return S(this,null,function*(){var e,i,s,n;if(!this.properties.isValid()||null==this.data||!this.visible)return;const a=null==(e=this.axes.x)?void 0:e.scale,o=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:r,yScaleType:l}=this.getScaleInformation({xScale:a,yScale:o}),h=this.colorScale.type,c=this.sizeScale.type,{xKey:d,yKey:u,sizeKey:p,labelKey:g,colorDomain:m,colorRange:y,colorKey:f,marker:x}=this.properties,{dataModel:b,processedData:v}=yield this.requestDataModel(t,this.data,{props:[jc(d,r,{id:"xKey-raw"}),jc(u,l,{id:"yKey-raw"}),...g?[jc(g,"band",{id:"labelKey-raw"})]:[],Wc(d,r,{id:"xValue"}),Wc(u,l,{id:"yValue"}),Wc(p,c,{id:"sizeValue"}),...f?[Wc(f,h,{id:"colorValue"})]:[],...g?[Wc(g,"band",{id:"labelValue"})]:[]]}),S=b.resolveProcessedDataIndexById(this,"sizeValue"),M=null!=(s=v.domain.values[S])?s:[];if(this.sizeScale.domain=x.domain?x.domain:M,f){const t=b.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=null!=(n=null!=m?m:v.domain.values[t])?n:[],this.colorScale.range=y,this.colorScale.update()}this.animationState.transition("updateData")})}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s="x"===t?"xValue":"yValue",n=e.resolveProcessedDataDefById(this,s),a=e.getDomain(this,s,"value",i);if("value"===(null==n?void 0:n.def.type)&&"category"===(null==n?void 0:n.def.valueType))return a;const o=this.axes[t];return Hh(os(a),o)}createNodeData(){return S(this,null,function*(){var t,e,i;const{axes:s,dataModel:n,processedData:a,colorScale:o,sizeScale:r}=this,{xKey:l,yKey:h,sizeKey:c,labelKey:d,xName:u,yName:p,sizeName:g,labelName:y,label:f,colorKey:x,marker:b,visible:v}=this.properties,S=Od(b.shape),{placement:M}=f,k=s.x,D=s.y;if(!(n&&a&&v&&k&&D))return;const w=n.resolveProcessedDataIndexById(this,"xValue"),I=n.resolveProcessedDataIndexById(this,"yValue"),C=c?n.resolveProcessedDataIndexById(this,"sizeValue"):-1,L=x?n.resolveProcessedDataIndexById(this,"colorValue"):-1,A=d?n.resolveProcessedDataIndexById(this,"labelValue"):-1,T=k.scale,N=D.scale,O=(null!=(t=T.bandwidth)?t:0)/2,R=(null!=(e=N.bandwidth)?e:0)/2,E=[];r.range=[b.size,b.maxSize];const P=f.getFont();for(const{values:t,datum:e}of null!=(i=a.data)?i:[]){const i=t[w],s=t[I],n=T.convert(i)+O,a=N.convert(s)+R,v=this.getLabelText(f,{value:d?t[A]:s,datum:e,xKey:l,yKey:h,sizeKey:c,labelKey:d,xName:u,yName:p,sizeName:g,labelName:y}),k=Po.getTextSize(String(v),P),D=c?r.convert(t[C]):b.size,B=x?o.convert(t[L]):void 0;E.push({series:this,itemId:h,yKey:h,xKey:l,datum:e,xValue:i,yValue:s,sizeValue:t[C],point:{x:n,y:a,size:D},midPoint:{x:n,y:a},fill:B,label:m({text:v},k),marker:S,placement:M})}return{itemId:h,nodeData:E,labelData:E,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){var t,e;return null!=(e=null==(t=this.contextNodeData)?void 0:t.labelData)?e:[]}markerFactory(){const{shape:t}=this.properties.marker;return new(Od(t))}updateMarkerSelection(t){return S(this,null,function*(){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,t=>Pc([t.xValue,t.yValue,t.label.text]))})}updateMarkerNodes(t){return S(this,null,function*(){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,sizeKey:a,labelKey:o,marker:r}=this.properties,l=Ut(i&&this.properties.highlightStyle.item,r.getStyle());this.sizeScale.range=[r.size,r.maxSize],e.each((t,e)=>{this.updateMarkerStyle(t,r,{datum:e,highlighted:i,xKey:s,yKey:n,sizeKey:a,labelKey:o},l)}),i||this.properties.marker.markClean()})}updateLabelSelection(t){return S(this,null,function*(){var e,i;const s=this.properties.label.enabled&&null!=(i=null==(e=this.chart)?void 0:e.placeLabels().get(this))?i:[];return t.labelSelection.update(s.map(t=>y(m({},t.datum),{point:{x:t.x,y:t.y,size:t.datum.point.size}})))})}updateLabelNodes(t){return S(this,null,function*(){const{label:e}=this.properties;t.labelSelection.each((t,i)=>{var s,n,a,o;t.text=i.label.text,t.fill=e.color,t.x=null!=(n=null==(s=i.point)?void 0:s.x)?n:0,t.y=null!=(o=null==(a=i.point)?void 0:a.y)?o:0,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.textAlign="left",t.textBaseline="top"})})}getTooltipHtml(t){var e;const i=this.axes.x,s=this.axes.y;if(!this.properties.isValid()||!i||!s)return tl;const{xKey:n,yKey:a,sizeKey:o,labelKey:r,xName:l,yName:h,sizeName:c,labelName:d,marker:u,tooltip:p}=this.properties,g=null!=(e=this.properties.title)?e:h,m=Ut({fill:t.fill,strokeWidth:this.getStrokeWidth(u.strokeWidth)},u.getStyle()),{fill:y="gray"}=this.getMarkerStyle(u,{datum:t,highlighted:!1,xKey:n,yKey:a,sizeKey:o,labelKey:r},m),{datum:f,xValue:x,yValue:b,sizeValue:v,label:{text:S},itemId:M}=t,k=Ru(i.formatDatum(x)),D=Ru(s.formatDatum(b));let w=`<b>${Ru(null!=l?l:n)}</b>: ${k}<br><b>${Ru(null!=h?h:a)}</b>: ${D}`;return o&&(w+=`<br><b>${Ru(null!=c?c:o)}</b>: ${Ru(String(v))}`),r&&(w=`<b>${Ru(null!=d?d:r)}</b>: ${Ru(S)}<br>`+w),p.toTooltipHtml({title:g,content:w,backgroundColor:y},{datum:f,itemId:M,xKey:n,xName:l,yKey:a,yName:h,sizeKey:o,sizeName:c,labelKey:r,labelName:d,title:g,color:y,seriesId:this.id})}getLegendData(){var t,e;if(!(null==(t=this.data)?void 0:t.length)||!this.properties.isValid())return[];const{yKey:i,yName:s,title:n,marker:a,visible:o}=this.properties,{shape:r,fill:l,stroke:h,fillOpacity:c,strokeOpacity:d,strokeWidth:u}=a;return[{legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:o,label:{text:null!=(e=null!=n?n:s)?e:i},marker:{shape:r,fill:null!=l?l:"rgba(0, 0, 0, 0)",stroke:null!=h?h:"rgba(0, 0, 0, 0)",fillOpacity:null!=c?c:1,strokeOpacity:null!=d?d:1,strokeWidth:null!=u?u:0}}]}animateEmptyUpdateReady({markerSelection:t,labelSelection:e}){Yu(this,this.ctx.animationManager,t),Eu(this,"labels",this.ctx.animationManager,e)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Mo}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 Zu(this,t)}};Qp.className="BubbleSeries",Qp.type="bubble";var Jp={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",instanceConstructor:Qp,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:We,tooltip:{position:{type:"node"}},marker:{__extends__:Ve,maxSize:30,fillOpacity:.8},label:{enabled:!1,fontSize:12,fontFamily:Ke,color:Ye}}},paletteFactory:Tu},tg=class extends Wd{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 zu,this.label=new zo,this.tooltip=new Wu}};b([Yn(Jn)],tg.prototype,"xKey",2),b([Yn(Jn,{optional:!0})],tg.prototype,"yKey",2),b([Yn(Jn,{optional:!0})],tg.prototype,"xName",2),b([Yn(Jn,{optional:!0})],tg.prototype,"yName",2),b([Yn(ga,{optional:!0})],tg.prototype,"fill",2),b([Yn(sa)],tg.prototype,"fillOpacity",2),b([Yn(ga,{optional:!0})],tg.prototype,"stroke",2),b([Yn(ia)],tg.prototype,"strokeWidth",2),b([Yn(sa)],tg.prototype,"strokeOpacity",2),b([Yn(ka)],tg.prototype,"lineDash",2),b([Yn(ia)],tg.prototype,"lineDashOffset",2),b([Yn(ia)],tg.prototype,"cornerRadius",2),b([Yn(qn)],tg.prototype,"areaPlot",2),b([Yn(oa,{optional:!0})],tg.prototype,"bins",2),b([Yn(Pa(["count","sum","mean"],"a histogram aggregation"))],tg.prototype,"aggregation",2),b([Yn(ia,{optional:!0})],tg.prototype,"binCount",2),b([Yn(Xn)],tg.prototype,"shadow",2),b([Yn(Xn)],tg.prototype,"label",2),b([Yn(Xn)],tg.prototype,"tooltip",2);var eg=class extends Vd{constructor(t){super({moduleCtx:t,directionKeys:Gd,directionNames:_d,pickModes:[0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:_p,label:Bu}}),this.properties=new tg,this.calculatedBins=[]}deriveBins(t){const e=lo(t[0],t[1],10),i=co(t[0],t[1],10),[s]=e;return[[s-i,s],...e.map(t=>[t,t+i])]}calculateNiceBins(t,e){const i=Math.floor(t[0]),s=t[1],n=e||1,{start:a,binSize:o}=this.calculateNiceStart(i,s,n);return this.getBins(a,s,o,n)}getBins(t,e,i,s){const n=[],a=this.calculatePrecision(i);for(let o=0;o<s;o++){const r=Math.round((t+o*i)*a)/a;let l=Math.round((t+(o+1)*i)*a)/a;o===s-1&&(l=Math.max(l,e)),n[o]=[r,l]}return n}calculatePrecision(t){let e=10;if(isFinite(t)&&t>0)for(;t<1;)e*=10,t*=10;return e}calculateNiceStart(t,e,i){const s=Math.abs(e-t)/i,n=Math.floor(Math.log10(s)),a=Math.pow(10,n);return{start:Math.floor(t/a)*a,binSize:s}}processData(t){return S(this,null,function*(){var e,i;this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:s,yKey:n,areaPlot:a,aggregation:o}=this.properties,r=null==(e=this.axes.x)?void 0:e.scale,l=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:h,yScaleType:c}=this.getScaleInformation({yScale:l,xScale:r}),d=[jc(s,h),wc];if(n){let t=bc("groupAgg");"count"===o||("sum"===o?t=fc("groupAgg"):"mean"===o&&(t=vc("groupAgg"))),a&&(t=Sc("groupAgg",t)),d.push(Wc(n,c,{invalidValue:void 0}),t)}else{let t=bc("groupAgg");a&&(t=Sc("groupAgg",t)),d.push(t)}!this.ctx.animationManager.isSkipped()&&this.processedData&&d.push(Ec(this.processedData,!1)),yield this.requestDataModel(t,this.data,{props:d,groupByFn:t=>{var e;const i=Hh(t.domain.keys[0]);if(0===i.length)return t.domain.groups=[],()=>[];const s=jt(this.properties.binCount)?this.calculateNiceBins(i,this.properties.binCount):null!=(e=this.properties.bins)?e:this.deriveBins(i),n=s.length;return this.calculatedBins=[...s],t=>{const e=t.keys[0];for(let t=0;t<n;t++){const i=s[t];if(e>=i[0]&&e<i[1])return i;if(t===n-1&&e<=i[1])return i}return[]}}}),this.animationState.transition("updateData")})}getSeriesDomain(t){var e,i,s,n;const{processedData:a,dataModel:o}=this;if(!a||!o||!this.calculatedBins.length)return[];const r=o.getDomain(this,"groupAgg","aggregate",a),l=null==(e=this.calculatedBins)?void 0:e[0][0],h=null==(n=this.calculatedBins)?void 0:n[(null!=(s=null==(i=this.calculatedBins)?void 0:i.length)?s:0)-1][1];return Hh("x"===t?[l,h]:r)}createNodeData(){return S(this,null,function*(){var t;const{id:e,axes:i,processedData:s,ctx:{callbackCache:n}}=this,a=i.x,o=i.y;if(!a||!o)return;const{scale:r}=a,{scale:l}=o,{xKey:h,yKey:c,xName:d,yName:u,fill:p,stroke:g,strokeWidth:m,cornerRadius:y}=this.properties,{formatter:f=t=>String(t.value),fontStyle:x,fontWeight:b,fontSize:v,fontFamily:S,color:M}=this.properties.label,k=[],D={itemId:null!=(t=this.properties.yKey)?t:this.id,nodeData:k,labelData:k,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return this.visible&&s&&"grouped"===s.type?(s.data.forEach(t=>{var i;const{aggValues:[[s,a]]=[[0,0]],datum:D,datum:{length:w},keys:I,keys:[C,L]}=t,A=r.convert(C),T=r.convert(L),N=s+a,O=l.convert(0),R=l.convert(N),E=Math.abs(T-A),P=Math.abs(R-O),B=Math.min(A,T),F=Math.min(O,R);let z;0!==N&&(z={text:null!=(i=n.call(f,{value:N,datum:D,seriesId:e,xKey:h,yKey:c,xName:d,yName:u}))?i:String(N),fontStyle:x,fontWeight:b,fontSize:v,fontFamily:S,fill:M,x:B+E/2,y:F+P/2});const G={x:B+E/2,y:F+P/2},_=o.isReversed();k.push({series:this,datum:D,aggregatedValue:N,frequency:w,domain:I,yKey:c,xKey:h,x:B,y:F,xValue:A,yValue:R,width:E,height:P,midPoint:G,fill:p,stroke:g,cornerRadius:y,topLeftCornerRadius:!_,topRightCornerRadius:!_,bottomRightCornerRadius:_,bottomLeftCornerRadius:_,opacity:1,strokeWidth:m,label:z})}),k.sort((t,e)=>t.x-e.x),D):D})}nodeFactory(){return new ou}updateDatumSelection(t){return S(this,null,function*(){const{nodeData:e,datumSelection:i}=t;return i.update(e,t=>{t.tag=0,t.crisp=!0},t=>t.domain.join("_"))})}updateDatumNodes(t){return S(this,null,function*(){const{isHighlight:e}=t,{fillOpacity:i,strokeOpacity:s,lineDash:n,lineDashOffset:a,shadow:o,highlightStyle:{item:{fill:r,fillOpacity:l=i,stroke:h,strokeWidth:c}}}=this.properties;t.datumSelection.each((t,d,u)=>{var p,g;const{cornerRadius:m,topLeftCornerRadius:y,topRightCornerRadius:f,bottomRightCornerRadius:x,bottomLeftCornerRadius:b}=d,v=e&&void 0!==c?c:d.strokeWidth,S=e?l:i;t.fill=null!=(p=e?r:void 0)?p:d.fill,t.stroke=null!=(g=e?h:void 0)?g:d.stroke,t.fillOpacity=S,t.strokeOpacity=s,t.strokeWidth=v,t.lineDash=n,t.lineDashOffset=a,t.topLeftCornerRadius=y?m:0,t.topRightCornerRadius=f?m:0,t.bottomRightCornerRadius=x?m:0,t.bottomLeftCornerRadius=b?m:0,t.fillShadow=o,t.zIndex=e?Xc.highlightedZIndex:u,t.visible=d.height>0})})}updateLabelSelection(t){return S(this,null,function*(){const{labelData:e,labelSelection:i}=t;return i.update(e,t=>{t.tag=1,t.pointerEvents=1,t.textAlign="center",t.textBaseline="middle"})})}updateLabelNodes(t){return S(this,null,function*(){const e=this.isLabelEnabled();t.labelSelection.each((t,i)=>{const s=i.label;s&&e?(t.text=s.text,t.x=s.x,t.y=s.y,t.fontStyle=s.fontStyle,t.fontWeight=s.fontWeight,t.fontSize=s.fontSize,t.fontFamily=s.fontFamily,t.fill=s.fill,t.visible=!0):t.visible=!1})})}initQuadTree(t){Cp(t,Ip(this.contentGroup.children[0]))}pickNodeClosestDatum(t){return Lp(this,t)}getTooltipHtml(t){const e=this.axes.x,i=this.axes.y;if(!this.properties.isValid()||!e||!i)return tl;const{xKey:s,yKey:n,xName:a,yName:o,fill:r,aggregation:l,tooltip:h}=this.properties,{aggregatedValue:c,frequency:d,domain:[u,p],itemId:g}=t,m=`${Ru(null!=a?a:s)}: ${e.formatDatum(u)} - ${e.formatDatum(p)}`;let y=n?`<b>${Ru(null!=o?o:n)} (${l})</b>: ${i.formatDatum(c)}<br>`:"";y+=`<b>Frequency</b>: ${d}`;const f={title:m,backgroundColor:r,content:y};return h.toTooltipHtml(f,{datum:{data:t.datum,aggregatedValue:t.aggregatedValue,domain:t.domain,frequency:t.frequency},itemId:g,xKey:s,xName:a,yKey:n,yName:o,color:r,title:m,seriesId:this.id})}getLegendData(t){var e,i;if(!(null==(e=this.data)?void 0:e.length)||"category"!==t)return[];const{xKey:s,yName:n,fill:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:h,visible:c}=this.properties;return[{legendType:"category",id:this.id,itemId:s,seriesId:this.id,enabled:c,label:{text:null!=(i=null!=n?n:s)?i:"Frequency"},marker:{fill:null!=a?a:"rgba(0, 0, 0, 0)",stroke:null!=r?r:"rgba(0, 0, 0, 0)",fillOpacity:o,strokeOpacity:h,strokeWidth:l}}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=Gp(Fp(!0,this.axes,"normal"));An(this.id,"datums",this.ctx.animationManager,[t],i),Eu(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){var e,i;const s=null==(i=null==(e=this.processedData)?void 0:e.reduced)?void 0:i.diff,n=Gp(Fp(!0,this.axes,"normal"));An(this.id,"datums",this.ctx.animationManager,[t.datumSelection],n,(t,e)=>Pc(e.domain),s),Eu(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t,seriesRect:e}){var i;return jp(null==(i=this.contextNodeData)?void 0:i.nodeData[t],this.contentGroup,e)}};eg.className="HistogramSeries",eg.type="histogram";var ig={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",instanceConstructor:eg,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:We,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:12,fontFamily:Ke,color:He},shadow:{enabled:!1,color:Je,xOffset:3,yOffset:3,blur:5}}},paletteFactory:({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}}},sg=class extends Wd{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.marker=new _u,this.label=new zo,this.tooltip=new Wu,this.connectMissingData=!1}};b([Yn(Jn)],sg.prototype,"xKey",2),b([Yn(Jn)],sg.prototype,"yKey",2),b([Yn(Jn,{optional:!0})],sg.prototype,"xName",2),b([Yn(Jn,{optional:!0})],sg.prototype,"yName",2),b([Yn(Jn,{optional:!0})],sg.prototype,"title",2),b([Yn(ga)],sg.prototype,"stroke",2),b([Yn(ia)],sg.prototype,"strokeWidth",2),b([Yn(sa)],sg.prototype,"strokeOpacity",2),b([Yn(ka)],sg.prototype,"lineDash",2),b([Yn(ia)],sg.prototype,"lineDashOffset",2),b([Yn(Xn)],sg.prototype,"marker",2),b([Yn(Xn)],sg.prototype,"label",2),b([Yn(Xn)],sg.prototype,"tooltip",2),b([Yn(qn)],sg.prototype,"connectMissingData",2);var ng=class extends Vd{constructor(t){super({moduleCtx:t,directionKeys:Gd,directionNames:_d,hasMarkers:!0,pickModes:[2,3,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:op({getOpacity:()=>this.getOpacity()}),label:Bu,marker:(t,e)=>m(m({},{opacity:1,scalingX:1,scalingY:1}),Uu(0,e))}}),this.properties=new sg}processData(t){return S(this,null,function*(){var e,i;if(!this.properties.isValid()||null==this.data)return;const{xKey:s,yKey:n}=this.properties,a=!this.ctx.animationManager.isSkipped(),o=null==(e=this.axes.x)?void 0:e.scale,r=null==(i=this.axes.y)?void 0:i.scale,{isContinuousX:l,xScaleType:h,yScaleType:c}=this.getScaleInformation({xScale:o,yScale:r}),d=[];l||d.push(jc(s,h,{id:"xKey"})),a&&(d.push(Tc(l?["xValue"]:void 0)),this.processedData&&d.push(Ec(this.processedData))),d.push(Wc(s,h,{id:"xValue"}),Wc(n,c,{id:"yValue",invalidValue:void 0})),yield this.requestDataModel(t,this.data,{props:d}),this.animationState.transition("updateData")})}getSeriesDomain(t){const{axes:e,dataModel:i,processedData:s}=this;if(!s||!i)return[];const n=e.x,a=e.y,o=i.resolveProcessedDataDefById(this,"xValue");if("x"===t){const t=i.getDomain(this,"xValue","value",s);return"value"===(null==o?void 0:o.def.type)&&"category"===o.def.valueType?t:Hh(os(t),n)}return Hh(i.getDomain(this,"yValue","value",s),a)}createNodeData(){return S(this,null,function*(){var t,e,i;const{processedData:s,dataModel:n,axes:a}=this,o=a.x,r=a.y;if(!(s&&n&&o&&r))return;const{xKey:l,yKey:h,xName:c,yName:d,marker:u,label:p,connectMissingData:g,legendItemName:m}=this.properties,y=o.scale,f=r.scale,x=(null!=(t=y.bandwidth)?t:0)/2,b=(null!=(e=f.bandwidth)?e:0)/2,v=[],S=u.enabled?u.size:0,M=n.resolveProcessedDataIndexById(this,"xValue"),k=n.resolveProcessedDataIndexById(this,"yValue");let D,w=!0;for(let t=0;t<s.data.length;t++){const{datum:e,values:n}=null!=D?D:s.data[t],a=n[M],o=n[k];if(void 0===o)w=!g;else{const n=y.convert(a)+x;if(isNaN(n)){w=!g,D=void 0;continue}D=void 0===(null==(i=s.data[t+1])?void 0:i.values[k])?void 0:s.data[t+1];const r=f.convert(o)+b,u=this.getLabelText(p,{value:o,datum:e,xKey:l,yKey:h,xName:c,yName:d,legendItemName:m},t=>Wt(t)?t.toFixed(2):String(t));v.push({series:this,datum:e,yKey:h,xKey:l,point:{x:n,y:r,moveTo:w,size:S},midPoint:{x:n,y:r},yValue:o,xValue:a,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},label:u?{text:u,fontStyle:p.fontStyle,fontWeight:p.fontWeight,fontSize:p.fontSize,fontFamily:p.fontFamily,textAlign:"center",textBaseline:"bottom",fill:p.color}:void 0}),w=!1}}return{itemId:h,nodeData:v,labelData:v,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}markerFactory(){const{shape:t}=this.properties.marker;return new(Od(t))}updatePathNodes(t){return S(this,null,function*(){const{paths:[e],opacity:i,visible:s,animationEnabled:n}=t;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,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),n||(e.visible=s),rp(this,e)})}updateMarkerSelection(t){return S(this,null,function*(){let{nodeData:e}=t;const{markerSelection:i}=t,{shape:s,enabled:n}=this.properties.marker;return e=s&&n?e:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(e,void 0,t=>Pc(t.xValue))})}updateMarkerNodes(t){return S(this,null,function*(){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,stroke:a,strokeWidth:o,strokeOpacity:r,marker:l,highlightStyle:h}=this.properties,c=Ut(i&&h.item,l.getStyle(),{stroke:a,strokeWidth:o,strokeOpacity:r}),d=this.ctx.animationManager.isSkipped();e.each((t,e)=>{this.updateMarkerStyle(t,l,{datum:e,highlighted:i,xKey:s,yKey:n},c,{applyTranslation:d})}),i||l.markClean()})}updateLabelSelection(t){return S(this,null,function*(){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])})}updateLabelNodes(t){return S(this,null,function*(){const{enabled:e,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:a,color:o}=this.properties.label;t.labelSelection.each((t,r)=>{const{point:l,label:h}=r;r&&h&&e?(t.fontStyle=i,t.fontWeight=s,t.fontSize=n,t.fontFamily=a,t.textAlign=h.textAlign,t.textBaseline=h.textBaseline,t.text=h.text,t.x=l.x,t.y=l.y-10,t.fill=o,t.visible=!0):t.visible=!1})})}getTooltipHtml(t){var e;const i=this.axes.x,s=this.axes.y;if(!this.properties.isValid()||!i||!s)return tl;const{xKey:n,yKey:a,xName:o,yName:r,strokeWidth:l,marker:h,tooltip:c}=this.properties,{datum:d,xValue:u,yValue:p,itemId:g}=t,y=i.formatDatum(u),f=s.formatDatum(p),x=Ru(null!=(e=this.properties.title)?e:r),b=Ru(y+": "+f),v=Ut({fill:h.stroke},h.getStyle(),{strokeWidth:l}),{fill:S}=this.getMarkerStyle(h,{datum:t,xKey:n,yKey:a,highlighted:!1},v);return c.toTooltipHtml({title:x,content:b,backgroundColor:S},m({datum:d,itemId:g,xKey:n,xName:o,yKey:a,yName:r,title:x,color:S,seriesId:this.id},this.getModuleTooltipParams()))}getLegendData(t){var e,i,s,n,a,o,r,l,h,c;if(!(null==(e=this.data)?void 0:e.length)||!this.properties.isValid()||"category"!==t)return[];const{yKey:d,yName:u,stroke:p,strokeOpacity:g,strokeWidth:m,lineDash:y,title:f,marker:x,visible:b,legendItemName:v}=this.properties,S="rgba(0, 0, 0, 0)";return[{legendType:"category",id:this.id,itemId:d,legendItemName:v,seriesId:this.id,enabled:b,label:{text:null!=(s=null!=(i=null!=v?v:f)?i:u)?s:d},marker:{shape:x.shape,fill:null!=(n=x.fill)?n:S,stroke:null!=(o=null!=(a=x.stroke)?a:p)?o:S,fillOpacity:null!=(r=x.fillOpacity)?r:1,strokeOpacity:null!=(h=null!=(l=x.strokeOpacity)?l:g)?h:1,strokeWidth:null!=(c=x.strokeWidth)?c:0,enabled:x.enabled},line:{stroke:null!=p?p:S,strokeOpacity:g,strokeWidth:m,lineDash:y}}]}updatePaths(t){return S(this,null,function*(){this.updateLinePaths(t.paths,t.contextData)})}updateLinePaths(t,e){const{nodeData:i}=e,[s]=t,{path:n}=s;n.clear(!0);for(const t of i)t.point.moveTo?n.moveTo(t.point.x,t.point.y):n.lineTo(t.point.x,t.point.y);s.checkPathDirty()}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s,contextData:n,paths:a}=t,{animationManager:o}=this.ctx;this.updateLinePaths(a,n),sp(this,o,...a),gr([e],Uu),$u(this,o,e),Eu(this,"labels",o,i),Eu(this,"annotations",o,...s)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateLinePaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){var e,i;const{animationManager:s}=this.ctx,{markerSelection:n,labelSelection:a,annotationSelections:o,contextData:r,paths:l,previousContextData:h}=t,[c]=l;super.resetAllAnimation(t);const d=()=>{this.updateLinePaths(l,r)};if(null==r||null==h)return d(),Ku(this,s,"added",n),np(this,"path_properties",s,"add",c),Eu(this,"labels",s,a),void Eu(this,"annotations",s,...o);const u=bp(r,h,null==(i=null==(e=this.processedData)?void 0:e.reduced)?void 0:i.diff);if(void 0===u)return s.skipCurrentBatch(),void d();"no-op"!==u.status&&(Ku(this,s,void 0,n),An(this.id,"path_properties",s,[c],u.pathProperties),Nu(this.id,"path_update",s,[c],u.path),u.hasMotion&&(Eu(this,"labels",s,a),Eu(this,"annotations",s,...o)))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Mo}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:t,xKey:e,yKey:i,highlighted:!0})}computeFocusBounds(t){return Zu(this,t)}};ng.className="LineSeries",ng.type="line";var ag={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",instanceConstructor:ng,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{__extends__:We,tooltip:{position:{type:"node"}},strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,marker:{__extends__:Ve,fillOpacity:1,strokeOpacity:1,strokeWidth:0},label:{enabled:!1,fontSize:12,fontFamily:Ke,color:Ye}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:1}}}},paletteFactory:t=>{const{marker:e}=Tu(t);return{stroke:e.fill,marker:e}}},og=class extends zo{constructor(){super(...arguments),this.placement="top"}};b([Yn(Ea)],og.prototype,"placement",2);var rg=class extends Wd{constructor(){super(...arguments),this.colorRange=["#ffff00","#00ff00","#0000ff"],this.marker=new _u,this.label=new og,this.tooltip=new Wu}};b([Yn(Jn)],rg.prototype,"xKey",2),b([Yn(Jn)],rg.prototype,"yKey",2),b([Yn(Jn,{optional:!0})],rg.prototype,"labelKey",2),b([Yn(Jn,{optional:!0})],rg.prototype,"colorKey",2),b([Yn(Jn,{optional:!0})],rg.prototype,"xName",2),b([Yn(Jn,{optional:!0})],rg.prototype,"yName",2),b([Yn(Jn,{optional:!0})],rg.prototype,"labelName",2),b([Yn(Jn,{optional:!0})],rg.prototype,"colorName",2),b([Yn(fa,{optional:!0})],rg.prototype,"colorDomain",2),b([Yn(ma)],rg.prototype,"colorRange",2),b([Yn(Jn,{optional:!0})],rg.prototype,"title",2),b([Yn(Xn)],rg.prototype,"marker",2),b([Yn(Xn)],rg.prototype,"label",2),b([Yn(Xn)],rg.prototype,"tooltip",2);var lg=class extends Vd{constructor(t){super({moduleCtx:t,directionKeys:Gd,directionNames:_d,pickModes:[2,3,0],pathsPerSeries:0,hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:Hu,label:Bu}}),this.properties=new rg,this.colorScale=new Hp}processData(t){return S(this,null,function*(){var e,i,s;if(!this.properties.isValid()||null==this.data||!this.visible)return;const n=null==(e=this.axes.x)?void 0:e.scale,a=null==(i=this.axes.y)?void 0:i.scale,{xScaleType:o,yScaleType:r}=this.getScaleInformation({xScale:n,yScale:a}),l=this.colorScale.type,{xKey:h,yKey:c,labelKey:d,colorKey:u,colorDomain:p,colorRange:g}=this.properties,{dataModel:m,processedData:y}=yield this.requestDataModel(t,this.data,{props:[jc(h,o,{id:"xKey-raw"}),jc(c,r,{id:"yKey-raw"}),...d?[jc(d,"band",{id:"labelKey-raw"})]:[],Wc(h,o,{id:"xValue"}),Wc(c,r,{id:"yValue"}),...u?[Wc(u,l,{id:"colorValue"})]:[],...d?[Wc(d,"band",{id:"labelValue"})]:[]]});if(u){const t=m.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=null!=(s=null!=p?p:y.domain.values[t])?s:[],this.colorScale.range=g,this.colorScale.update()}this.animationState.transition("updateData")})}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s="x"===t?"xValue":"yValue",n=e.resolveProcessedDataDefById(this,s),a=e.getDomain(this,s,"value",i);if("value"===(null==n?void 0:n.def.type)&&"category"===(null==n?void 0:n.def.valueType))return a;const o=this.axes[t];return Hh(os(a),o)}createNodeData(){return S(this,null,function*(){var t,e,i;const{axes:s,dataModel:n,processedData:a,colorScale:o}=this,{xKey:r,yKey:l,labelKey:h,colorKey:c,xName:d,yName:u,labelName:p,marker:g,label:y,visible:f}=this.properties,{placement:x}=y,b=Od(g.shape),v=s.x,S=s.y;if(!(n&&a&&f&&v&&S))return;const M=n.resolveProcessedDataIndexById(this,"xValue"),k=n.resolveProcessedDataIndexById(this,"yValue"),D=c?n.resolveProcessedDataIndexById(this,"colorValue"):-1,w=h?n.resolveProcessedDataIndexById(this,"labelValue"):-1,I=v.scale,C=S.scale,L=(null!=(t=I.bandwidth)?t:0)/2,A=(null!=(e=C.bandwidth)?e:0)/2,T=[],N=y.getFont();for(const{values:t,datum:e}of null!=(i=a.data)?i:[]){const i=t[M],s=t[k],n=I.convert(i)+L,a=C.convert(s)+A,f=this.getLabelText(y,{value:h?t[w]:s,datum:e,xKey:r,yKey:l,labelKey:h,xName:d,yName:u,labelName:p}),v=Po.getTextSize(f,N),S=c?o.convert(t[D]):void 0;T.push({series:this,itemId:l,yKey:l,xKey:r,datum:e,xValue:i,yValue:s,capDefaults:{lengthRatioMultiplier:g.getDiameter(),lengthMax:1/0},point:{x:n,y:a,size:g.size},midPoint:{x:n,y:a},fill:S,label:m({text:f},v),marker:b,placement:x})}return{itemId:l,nodeData:T,labelData:T,scales:this.calculateScaling(),visible:this.visible}})}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){var t,e;return null!=(e=null==(t=this.contextNodeData)?void 0:t.labelData)?e:[]}markerFactory(){const{shape:t}=this.properties.marker;return new(Od(t))}updateMarkerSelection(t){return S(this,null,function*(){const{nodeData:e,markerSelection:i}=t;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?e:[])})}updateMarkerNodes(t){return S(this,null,function*(){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,labelKey:a,marker:o,highlightStyle:r}=this.properties,l=Ut(i&&r.item,o.getStyle());e.each((t,e)=>{this.updateMarkerStyle(t,o,{datum:e,highlighted:i,xKey:s,yKey:n,labelKey:a},l)}),i||o.markClean()})}updateLabelSelection(t){return S(this,null,function*(){var e,i;const s=this.isLabelEnabled()&&null!=(i=null==(e=this.chart)?void 0:e.placeLabels().get(this))?i:[];return t.labelSelection.update(s.map(({datum:t,x:e,y:i})=>y(m({},t),{point:{x:e,y:i,size:t.point.size},placement:"top"})),t=>{t.pointerEvents=1})})}updateLabelNodes(t){return S(this,null,function*(){const{label:e}=this.properties;t.labelSelection.each((t,i)=>{var s,n,a,o;t.text=i.label.text,t.fill=e.color,t.x=null!=(n=null==(s=i.point)?void 0:s.x)?n:0,t.y=null!=(o=null==(a=i.point)?void 0:a.y)?o:0,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.textAlign="left",t.textBaseline="top"})})}getTooltipHtml(t){const e=this.axes.x,i=this.axes.y;if(!this.properties.isValid()||!e||!i)return tl;const{xKey:s,yKey:n,labelKey:a,xName:o,yName:r,labelName:l,title:h=r,marker:c,tooltip:d}=this.properties,{datum:u,xValue:p,yValue:g,label:y,itemId:f}=t,x=Ut({fill:t.fill,strokeWidth:this.getStrokeWidth(c.strokeWidth)},c.getStyle()),{fill:b="gray"}=this.getMarkerStyle(c,{datum:t,highlighted:!1,xKey:s,yKey:n,labelKey:a},x),v=Ru(e.formatDatum(p)),S=Ru(i.formatDatum(g));let M=`<b>${Ru(null!=o?o:s)}</b>: ${v}<br><b>${Ru(null!=r?r:n)}</b>: ${S}`;return a&&(M=`<b>${Ru(null!=l?l:a)}</b>: ${Ru(y.text)}<br>`+M),d.toTooltipHtml({title:h,content:M,backgroundColor:b},m({datum:u,itemId:f,xKey:s,xName:o,yKey:n,yName:r,labelKey:a,labelName:l,title:h,color:b,seriesId:this.id},this.getModuleTooltipParams()))}getLegendData(t){var e,i,s,n,a,o;const{yKey:r,yName:l,title:h,marker:c,visible:d}=this.properties,{fill:u,stroke:p,fillOpacity:g,strokeOpacity:m,strokeWidth:y}=c;return(null==(e=this.data)?void 0:e.length)&&this.properties.isValid()&&"category"===t?[{legendType:"category",id:this.id,itemId:r,seriesId:this.id,enabled:d,label:{text:null!=(i=null!=h?h:l)?i:r},marker:{shape:c.shape,fill:null!=(n=null!=(s=c.fill)?s:u)?n:"rgba(0, 0, 0, 0)",stroke:null!=(o=null!=(a=c.stroke)?a:p)?o:"rgba(0, 0, 0, 0)",fillOpacity:null!=g?g:1,strokeOpacity:null!=m?m:1,strokeWidth:null!=y?y:0}}]:[]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s}=t;Yu(this,this.ctx.animationManager,e),Eu(this,"labels",this.ctx.animationManager,i),Eu(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Mo}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 Zu(this,t)}};lg.className="ScatterSeries",lg.type="scatter";var hg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",instanceConstructor:lg,defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{__extends__:We,tooltip:{position:{type:"node"}},marker:{__extends__:Ve,fillOpacity:.8},label:{enabled:!1,fontSize:12,fontFamily:Ke,color:Ye}}},enterpriseThemeTemplate:{series:{errorBar:{cap:{lengthRatio:1}}}},paletteFactory:Tu},cg=class t{constructor(t,e,i,s){this.startAngle=t,this.endAngle=e,this.innerRadius=i,this.outerRadius=s}clone(){const{startAngle:e,endAngle:i,innerRadius:s,outerRadius:n}=this;return new t(e,i,s,n)}[Fs](e,i){return new t(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 dg(t,e,i){const s=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),{innerRadius:n,outerRadius:a}=i;if(i.startAngle===i.endAngle||s<Math.min(n,a)||s>Math.max(n,a))return!1;const o=Pn(i.startAngle),r=Pn(i.endAngle),l=Math.atan2(e,t);return o<r?l<=r&&l>=o:l<=r&&l>=-Math.PI||l>=o&&l<=Math.PI}function ug(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:a}=e,o={x:a*Math.cos(i),y:a*Math.sin(i)},r={x:a*Math.cos(s),y:a*Math.sin(s)},l=0===n?{x:0,y:0}:{x:n*Math.cos(i),y:n*Math.sin(i)},h=0===n?{x:0,y:0}:{x:n*Math.cos(s),y:n*Math.sin(s)};return nd(t.start.x,t.start.y,t.end.x,t.end.y,o.x,o.y,l.x,l.y)||nd(t.start.x,t.start.y,t.end.x,t.end.y,r.x,r.y,h.x,h.y)||rd(0,0,a,i,s,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function pg(t,e){const i={x:t.x,y:t.y},s={x:t.x+t.width,y:t.y},n={x:t.x,y:t.y+t.height},a={x:t.x+t.width,y:t.y+t.height};return ug({start:i,end:s},e)||ug({start:n,end:a},e)}function gg(t,e,i,s){if(0===i&&0===s)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 n=0,a=1;for(let o=0;o<8;o+=1){const o=(n+a)/2;Math.asin(Math.abs(o*i)/(t+o*i))+Math.asin(Math.abs(o*s)/(t+o*s))-e<0?n=o:a=o}return n}function mg(t,e){return Gn(t,e)<1e-6?e:Rn(t-e)+e}function yg(t,e,i=0){const s=Math.abs(e-t)>=2*Math.PI?2*Math.PI:Rn(e-t);return{startAngle:t=mg(t,i),endAngle:e=t+s}}function fg(t,e,i,s,n,a){const o=Math.sin(a),r=Math.cos(a),l=p(t,2)+p(e,2)-p(i,2);let h=NaN,c=NaN,d=NaN,u=NaN;if(r>.5){const i=o/r,s=1+p(i,2),n=-2*(t+e*i),a=p(n,2)-4*s*l;if(a<0)return;const g=(-n+Math.sqrt(a))/(2*s),m=(-n-Math.sqrt(a))/(2*s);h=g,c=g*i,d=m,u=m*i}else{const i=r/o,s=1+p(i,2),n=-2*(e+t*i),a=p(n,2)-4*s*l;if(a<0)return;const g=(-n+Math.sqrt(a))/(2*s),m=(-n-Math.sqrt(a))/(2*s);h=g*i,c=g,d=m*i,u=m}const g=d*r+u*o,m=h*r+c*o>0?mg(Math.atan2(c-e,h-t),s):NaN,y=g>0?mg(Math.atan2(u-e,d-t),s):NaN;return m>=s&&m<=n?m:y>=s&&y<=n?y:void 0}function xg(t,e,i,s,n,a){const o=Math.hypot(t,e),r=o-(p(o,2)-p(i,2)+p(a,2))/(2*o),l=Math.atan2(e,t),h=Math.acos(-r/i),c=mg(l+h,s),d=mg(l-h,s);return c>=s&&c<=n?c:d>=s&&d<=n?d:void 0}var bg=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){null==t||!this.isValid()||t<this.a0||(this.a0=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(t){null==t||!this.isValid()||t>this.a1||(this.a1=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},vg=class extends cd{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=2*Math.PI,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(){const t=this.outerRadius;return new Qs(this.centerX-t,this.centerY-t,2*t,2*t)}normalizedRadii(){const{concentricEdgeInset:t}=this;return{innerRadius:Math.max(Math.min(this.innerRadius,this.outerRadius)+t,0),outerRadius:Math.max(Math.max(this.innerRadius,this.outerRadius)-t,0)}}normalizedClipSector(){const{clipSector:t}=this;if(null==t)return;const{startAngle:e,endAngle:i}=yg(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),a=yg(t.startAngle,t.endAngle,e);return new cg(Math.max(e,a.startAngle),Math.min(i,a.endAngle),Math.max(s,t.innerRadius),Math.min(n,t.outerRadius))}getAngleOffset(t){return t>0?this.radialEdgeInset/t:0}arc(t,e,i,s,n,a,o,r){if(t<=0)return;const{startAngle:l,endAngle:h}=yg(this.startAngle,this.endAngle),{innerRadius:c,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(r&&c<=0)return;const p=this.getAngleOffset(c),g=this.getAngleOffset(d),m=r?this.getAngleOffset(c+t):this.getAngleOffset(d-t),y=o?l+m+e:h-m-e,f=r?c+t:d-t,x=f*Math.cos(y),b=f*Math.sin(y);if(null!=u){const t=1e-6;if(!(o||y>=l-t&&y<=u.endAngle-t))return;if(o&&!(y>=u.startAngle+t&&y<=h-t))return;if(r&&!(f>=u.innerRadius-t))return;if(!(r||f<=u.outerRadius+t))return}const v=new bg(x,b,t,i,s);if(null!=u){let e,h;if(r?(v.clipStart(fg(x,b,t,i,s,u.endAngle-p)),v.clipEnd(fg(x,b,t,i,s,u.startAngle+p))):(v.clipStart(fg(x,b,t,i,s,u.startAngle+g)),v.clipEnd(fg(x,b,t,i,s,u.endAngle-g))),o?(e=xg(x,b,t,i,s,u.innerRadius),h=xg(x,b,t,i,s,u.outerRadius)):(e=xg(x,b,t,i,s,u.outerRadius),h=xg(x,b,t,i,s,u.innerRadius)),v.clipStart(e),v.clipEnd(h),null!=e){const{x:t,y:i}=v.pointAt(e),s=mg(Math.atan2(i,t),l);o?null==a||a.clipStart(s):n.clipEnd(s)}if(null!=h){const{x:t,y:e}=v.pointAt(h),i=mg(Math.atan2(e,t),l);o?n.clipStart(i):null==a||a.clipEnd(i)}}if(null!=u){const{x:t,y:e}=v.pointAt((v.a0+v.a1)/2);if(!dg(t,e,u))return}const{x:S,y:M}=v.pointAt(o===r?v.a0:v.a1),k=mg(Math.atan2(M,S),l),D=r?a:n;return o?null==D||D.clipStart(k):null==D||D.clipEnd(k),v}updatePath(){var t,e,i,s,n;const{path:a,centerX:o,centerY:r,concentricEdgeInset:l,radialEdgeInset:h}=this;let{startOuterCornerRadius:c,endOuterCornerRadius:d,startInnerCornerRadius:u,endInnerCornerRadius:p}=this;const{startAngle:g,endAngle:m}=yg(this.startAngle,this.endAngle),{innerRadius:y,outerRadius:f}=this.normalizedRadii(),x=this.normalizedClipSector(),b=m-g,v=b>=2*Math.PI-1e-6;if(a.clear(),(null!=(t=null==x?void 0:x.startAngle)?t:g)===(null!=(e=null==x?void 0:x.endAngle)?e:m))return;if(v&&null==this.clipSector&&0===c&&0===d&&0===u&&0===p)return a.moveTo(o+f*Math.cos(g),r+f*Math.sin(g)),a.arc(o,r,f,g,m),y>l&&(a.moveTo(o+y*Math.cos(m),r+y*Math.sin(m)),a.arc(o,r,y,m,g,!0)),void a.closePath();const S=this.getAngleOffset(y),M=this.getAngleOffset(f);if(b<2*M)return;const k=(null!=(i=null==x?void 0:x.innerRadius)?i:y)>l,D=y<l||b<2*S,w=f-y,I=Math.max(c,u,d,p),C=I>0?Math.min(w/I,1):1;c*=C,d*=C,u*=C,p*=C;const L=gg(f,b-2*M,-c,-d);if(c*=L,d*=L,!D&&k){const t=gg(y,b-2*S,u,p);u*=t,p*=t}else u=0,p=0;const A=Math.max(c+u,d+p),T=A>0?Math.min(w/A,1):1;c*=T,d*=T,u*=T,p*=T;let N=0,O=0;const R=c/(f-c),E=d/(f-d);if(R>=0&&R<.999999)N=Math.asin(R);else{N=b/2;const t=f/(1/Math.sin(N)+1);c=Math.min(t,c)}if(E>=0&&E<.999999)O=Math.asin(E);else{O=b/2;const t=f/(1/Math.sin(O)+1);d=Math.min(t,d)}const P=Math.asin(u/(y+u)),B=Math.asin(p/(y+p)),F=null!=(s=null==x?void 0:x.outerRadius)?s:f,z=this.getAngleOffset(F),G=new bg(0,0,F,g+z,m-z),_=null!=(n=null==x?void 0:x.innerRadius)?n:y,j=this.getAngleOffset(_),W=k?new bg(0,0,_,g+j,m-j):void 0;null!=x&&(G.clipStart(x.startAngle),G.clipEnd(x.endAngle),null==W||W.clipStart(x.startAngle),null==W||W.clipEnd(x.endAngle));const V=this.arc(c,N,g-.5*Math.PI,g+N,G,W,!0,!1),K=this.arc(d,O,m-O,m+.5*Math.PI,G,W,!1,!1),Y=this.arc(p,B,m+.5*Math.PI,m+Math.PI-B,G,W,!1,!0),$=this.arc(u,P,g+Math.PI+P,g+1.5*Math.PI,G,W,!0,!0);if(D){const t=b<.5*Math.PI?h*(1+Math.cos(b))/Math.sin(b):NaN;let e;e=t>0&&t<f?Math.max(Math.hypot(h,t),y):y;const i=g+.5*b;a.moveTo(o+e*Math.cos(i),r+e*Math.sin(i))}else if(!0===(null==$?void 0:$.isValid())){const{x:t,y:e}=$.pointAt($.a1);a.moveTo(o+t,r+e)}else if(!0===(null==W?void 0:W.isValid())){const{x:t,y:e}=W.pointAt(W.a0);a.moveTo(o+t,r+e)}else{const t=g+b/2,e=y*Math.cos(t),i=y*Math.sin(t);a.moveTo(o+e,r+i)}if(!0===(null==V?void 0:V.isValid())){const{cx:t,cy:e,r:i,a0:s,a1:n}=V;a.arc(o+t,r+e,i,s,n)}if(G.isValid()){const{r:t,a0:e,a1:i}=G;a.arc(o,r,t,e,i)}if(!0===(null==K?void 0:K.isValid())){const{cx:t,cy:e,r:i,a0:s,a1:n}=K;a.arc(o+t,r+e,i,s,n)}if(!D){if(!0===(null==Y?void 0:Y.isValid())){const{cx:t,cy:e,r:i,a0:s,a1:n}=Y;a.arc(o+t,r+e,i,s,n)}if(!0===(null==W?void 0:W.isValid())){const{r:t,a0:e,a1:i}=W;a.arc(o,r,t,i,e,!0)}if(!0===(null==$?void 0:$.isValid())){const{cx:t,cy:e,r:i,a0:s,a1:n}=$;a.arc(o+t,r+e,i,s,n)}}a.closePath()}isPointInPath(t,e){var i;const s=this.transformPoint(t,e),{startAngle:n,endAngle:a,innerRadius:o,outerRadius:r}=null!=(i=this.clipSector)?i:this;return dg(s.x,s.y,{startAngle:n,endAngle:a,innerRadius:Math.min(o,r),outerRadius:Math.max(o,r)})}};vg.className="Sector",b([hd()],vg.prototype,"centerX",2),b([hd()],vg.prototype,"centerY",2),b([hd()],vg.prototype,"innerRadius",2),b([hd()],vg.prototype,"outerRadius",2),b([hd()],vg.prototype,"startAngle",2),b([hd()],vg.prototype,"endAngle",2),b([hd()],vg.prototype,"clipSector",2),b([hd()],vg.prototype,"concentricEdgeInset",2),b([hd()],vg.prototype,"radialEdgeInset",2),b([hd()],vg.prototype,"startOuterCornerRadius",2),b([hd()],vg.prototype,"endOuterCornerRadius",2),b([hd()],vg.prototype,"startInnerCornerRadius",2),b([hd()],vg.prototype,"endInnerCornerRadius",2);var Sg=class extends al{constructor(){super(...arguments),this.showInLegend=!1}};b([Yn(qn)],Sg.prototype,"showInLegend",2);var Mg=class extends zo{constructor(){super(...arguments),this.margin=2}set(t,e){return super.set(t)}};b([Yn(Jn)],Mg.prototype,"text",2),b([Yn(ta)],Mg.prototype,"margin",2);var kg=class extends ye{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};b([Yn(ga)],kg.prototype,"fill",2),b([Yn(sa)],kg.prototype,"fillOpacity",2);var Dg=class extends zo{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};b([Yn(ia)],Dg.prototype,"offset",2),b([Yn(na)],Dg.prototype,"minAngle",2),b([Yn(ia)],Dg.prototype,"minSpacing",2),b([Yn(ia)],Dg.prototype,"maxCollisionOffset",2),b([Yn(qn)],Dg.prototype,"avoidCollisions",2);var wg=class extends zo{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};b([Yn(ta)],wg.prototype,"positionOffset",2),b([Yn(sa)],wg.prototype,"positionRatio",2);var Ig=class extends ye{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};b([Yn(ma,{optional:!0})],Ig.prototype,"colors",2),b([Yn(ia)],Ig.prototype,"length",2),b([Yn(ia)],Ig.prototype,"strokeWidth",2);var Cg=class extends zd{constructor(){super(...arguments),this.fills=Object.values(Pe),this.strokes=Object.values(Be),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=void 0,this.innerLabels=new fe(Mg),this.title=new Sg,this.innerCircle=new kg,this.shadow=new zu,this.calloutLabel=new Dg,this.sectorLabel=new wg,this.calloutLine=new Ig,this.tooltip=new Wu,this.__BACKGROUND_COLOR_DO_NOT_USE=void 0}isValid(){const t=super.isValid();return null==this.innerRadiusRatio&&null==this.innerRadiusOffset?(R.warnOnce("Either an [innerRadiusRatio] or an [innerRadiusOffset] must be set to render a donut series."),!1):t}};function Lg(t,e,i,s){const n=[i.convert(0),i.convert(1)],a=[s.convert(0),s.convert(1)],o=Math.PI/-2+Fn(e),r=t?"initial":"update";return{nodes:{toFn:(t,e,i,{prevLive:s})=>{var a,r;let{startAngle:l,endAngle:h,innerRadius:c,outerRadius:d}=e;const{stroke:u,fill:p}=e.sectorFormat;if("removed"===i&&s?(l=null==(a=s.datum)?void 0:a.endAngle,h=null==(r=s.datum)?void 0:r.endAngle):"removed"!==i||s||(l=o,h=o),"removed"===i){const t=(({radius:t})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*t}))(e);c=t.innerRadius,d=t.outerRadius}return{startAngle:l,endAngle:h,outerRadius:d,innerRadius:c,stroke:u,fill:p}},fromFn:(e,i,s,{prevFromProps:n})=>{var l,h,c,d,u,p;let{startAngle:g,endAngle:m,innerRadius:y,outerRadius:f}=e,{fill:x,stroke:b}=i.sectorFormat;if("unknown"===s||"added"===s&&!n?(g=o,m=o,y=i.innerRadius,f=i.outerRadius):"added"===s&&n&&(g=null!=(l=n.endAngle)?l:o,m=null!=(h=n.endAngle)?h:o,y=null!=(c=n.innerRadius)?c:i.innerRadius,f=null!=(d=n.outerRadius)?d:i.outerRadius),"added"===s&&!t){const t=(({radius:t})=>({innerRadius:a[0],outerRadius:a[0]+(a[1]-a[0])*t}))(i);y=t.innerRadius,f=t.outerRadius}return"updated"===s&&(x=null!=(u=e.fill)?u:x,b=null!=(p=e.stroke)?p:b),{startAngle:g,endAngle:m,innerRadius:y,outerRadius:f,fill:x,stroke:b,phase:r}}},innerCircle:{fromFn:(t,e)=>{var i,s,n;return{size:null!=(n=null!=(s=null==(i=t.previousDatum)?void 0:i.radius)?s:t.size)?n:0,phase:r}},toFn:(t,e)=>{var i;return{size:null!=(i=e.radius)?i:0}}}}}function Ag(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,fill:e.sectorFormat.fill,stroke:e.sectorFormat.stroke}}function Tg(t,e){const i=e.y-t.centerY,s=e.x-t.centerX,n=Math.atan2(i,s),a=t.getItemNodes();for(const t of a)if(!0!==t.datum.missing&&Bn(n,t.startAngle,t.endAngle)){const e=Math.sqrt(s*s+i*i);let n=0;return e<t.innerRadius?n=t.innerRadius-e:e>t.outerRadius&&(n=e-t.outerRadius),{datum:t.datum,distance:n}}}function Ng(t,e){const i=t.getNodeData();if(void 0===i)return;const{centerX:s,centerY:n}=t,a=i[e.datumIndex],o=[{radius:a.innerRadius,angle:a.startAngle},{radius:a.innerRadius,angle:a.endAngle},{radius:a.outerRadius,angle:a.startAngle},{radius:a.outerRadius,angle:a.endAngle}],r=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const t of r)Bn(t,a.startAngle,a.endAngle)&&o.push({radius:a.outerRadius,angle:t});const l=o.map(({radius:t,angle:e})=>_n(s,n,t,e)),h=l.map(t=>t.x),c=l.map(t=>t.y),d=Math.min(...h),u=Math.min(...c),p=Math.max(...h)-d,g=Math.max(...c)-u;return new Qs(d,u,p,g)}b([Yn(Jn)],Cg.prototype,"angleKey",2),b([Yn(Jn,{optional:!0})],Cg.prototype,"angleName",2),b([Yn(Jn,{optional:!0})],Cg.prototype,"radiusKey",2),b([Yn(Jn,{optional:!0})],Cg.prototype,"radiusName",2),b([Yn(ia,{optional:!0})],Cg.prototype,"radiusMin",2),b([Yn(ia,{optional:!0})],Cg.prototype,"radiusMax",2),b([Yn(Jn,{optional:!0})],Cg.prototype,"calloutLabelKey",2),b([Yn(Jn,{optional:!0})],Cg.prototype,"calloutLabelName",2),b([Yn(Jn,{optional:!0})],Cg.prototype,"sectorLabelKey",2),b([Yn(Jn,{optional:!0})],Cg.prototype,"sectorLabelName",2),b([Yn(Jn,{optional:!0})],Cg.prototype,"legendItemKey",2),b([Yn(ma)],Cg.prototype,"fills",2),b([Yn(ma)],Cg.prototype,"strokes",2),b([Yn(sa)],Cg.prototype,"fillOpacity",2),b([Yn(sa)],Cg.prototype,"strokeOpacity",2),b([Yn(ka)],Cg.prototype,"lineDash",2),b([Yn(ia)],Cg.prototype,"lineDashOffset",2),b([Yn(ia)],Cg.prototype,"cornerRadius",2),b([Yn(Qn,{optional:!0})],Cg.prototype,"formatter",2),b([Yn(na)],Cg.prototype,"rotation",2),b([Yn(ta)],Cg.prototype,"outerRadiusOffset",2),b([Yn(sa)],Cg.prototype,"outerRadiusRatio",2),b([Yn(ta,{optional:!0})],Cg.prototype,"innerRadiusOffset",2),b([Yn(sa,{optional:!0})],Cg.prototype,"innerRadiusRatio",2),b([Yn(ia)],Cg.prototype,"strokeWidth",2),b([Yn(ia,{optional:!0})],Cg.prototype,"sectorSpacing",2),b([Yn(va)],Cg.prototype,"innerLabels",2),b([Yn(Xn)],Cg.prototype,"title",2),b([Yn(Xn)],Cg.prototype,"innerCircle",2),b([Yn(Xn)],Cg.prototype,"shadow",2),b([Yn(Xn)],Cg.prototype,"calloutLabel",2),b([Yn(Xn)],Cg.prototype,"sectorLabel",2),b([Yn(Xn)],Cg.prototype,"calloutLine",2),b([Yn(Xn)],Cg.prototype,"tooltip",2),b([Yn(Jn,{optional:!0})],Cg.prototype,"__BACKGROUND_COLOR_DO_NOT_USE",2);var Og=class extends Rd{constructor(t){var e=t,{useLabelLayer:i=!1,pickModes:s=[0],canHaveAxes:n=!1,animationResetFns:a}=e,o=f(e,["useLabelLayer","pickModes","canHaveAxes","animationResetFns"]);super(y(m({},o),{useLabelLayer:i,pickModes:s,contentGroupVirtual:!1,directionKeys:{x:["angleKey"],y:["radiusKey"]},directionNames:{x:["angleName"],y:["radiusName"]},canHaveAxes:n})),this.itemGroup=this.contentGroup.appendChild(new Mo),this.nodeData=[],this.itemSelection=Rr.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=Rr.select(this.labelGroup,Po,!1),this.highlightSelection=Rr.select(this.highlightGroup,()=>this.nodeFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.showFocusBox=!1,this.itemGroup.zIndexSubOrder=[()=>this._declarationOrder,1],this.animationResetFns=a,this.animationState=new mr("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),highlightMarkers:t=>this.animateReadyHighlightMarkers(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return this.itemGroup.children}getNodeData(){return this.nodeData}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t&&this.animationState.transition("skip")}getLabelData(){return[]}computeLabelsBBox(t,e){return null}resetAllAnimation(){var t;const{item:e,label:i}=null!=(t=this.animationResetFns)?t:{};this.ctx.animationManager.stopByAnimationGroupId(this.id),e&&gr([this.itemSelection,this.highlightSelection],e),i&&gr([this.labelSelection],i),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(t){var e;const{item:i}=null!=(e=this.animationResetFns)?e:{};i&&gr([this.highlightSelection],i)}animateReadyHighlightMarkers(t){}animateReadyResize(t){this.resetAllAnimation()}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animationTransitionClear(){this.animationState.transition("clear",this.getAnimationData())}getAnimationData(t){return{seriesRect:t}}},Rg=class extends Hc{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}},Eg=class extends Og{constructor(t){super({moduleCtx:t,pickModes:[0],useLabelLayer:!0,animationResetFns:{item:Ag,label:Bu}}),this.properties=new Cg,this.previousRadiusScale=new Xd,this.radiusScale=new Xd,this.backgroundGroup=this.rootGroup.appendChild(new Mo({name:`${this.id}-background`,layer:!0,zIndex:0})),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Mo({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new yd),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new yd),this.innerCircleGroup=this.backgroundGroup.appendChild(new Mo({name:`${this.id}-innerCircle`})),this.seriesItemEnabled=[],this.surroundingRadius=void 0,this.NodeEvent=Rg,this.angleScale=new Xd,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2);const e=new Mo({name:"pieCalloutLabels"}),i=new Mo({name:"pieSectorLabels"}),s=new Mo({name:"innerLabels"});this.labelGroup.append(e),this.labelGroup.append(i),this.labelGroup.append(s),this.calloutLabelSelection=Rr.select(e,Mo),this.sectorLabelSelection=Rr.select(i,Po),this.innerLabelsSelection=Rr.select(s,Po),this.innerCircleSelection=Rr.select(this.innerCircleGroup,yd)}addChartEventListeners(){var t;this.destroyFns.push(null==(t=this.ctx.chartEventManager)?void 0:t.addListener("legend-item-click",t=>this.onLegendItemClick(t)))}get visible(){return super.visible&&(0===this.seriesItemEnabled.length||this.seriesItemEnabled.some(t=>t))}nodeFactory(){return new vg}getSeriesDomain(t){return"x"===t?this.angleScale.domain:this.radiusScale.domain}processData(t){return S(this,null,function*(){var e,i,s,n,a;if(null==this.data||!this.properties.isValid())return;let{data:o}=this;const{visible:r,seriesItemEnabled:l}=this,{angleKey:h,radiusKey:c,calloutLabelKey:d,sectorLabelKey:u,legendItemKey:p}=this.properties,g=!this.ctx.animationManager.isSkipped(),f=[],x=[];p?f.push(jc(p,"band",{id:"legendItemKey"})):d?f.push(jc(d,"band",{id:"calloutLabelKey"})):u&&f.push(jc(u,"band",{id:"sectorLabelKey"}));const b=this.radiusScale.type,v=this.radiusScale.type;c&&x.push(Vc(c,{id:"radiusValue",min:null!=(e=this.properties.radiusMin)?e:0,max:this.properties.radiusMax}),Wc(c,b,{id:"radiusRaw"}),Ac({id:"radiusValue"},[0,1],1,null!=(i=this.properties.radiusMin)?i:0,this.properties.radiusMax)),d&&x.push(Wc(d,"band",{id:"calloutLabelValue"})),u&&x.push(Wc(u,"band",{id:"sectorLabelValue"})),p&&x.push(Wc(p,"band",{id:"legendItemValue"})),g&&this.processedData&&f.length>0&&x.push(Ec(this.processedData)),x.push(Tc()),o=o.map((t,e)=>r&&l[e]?t:y(m({},t),{[h]:0})),yield this.requestDataModel(t,o,{props:[...f,Kc(h,v,{id:"angleValue",onlyPositive:!0}),Wc(h,v,{id:"angleRaw"}),Ac({id:"angleValue"},[0,1],0,0),...x]});for(const t of null!=(a=null==(n=null==(s=this.processedData)?void 0:s.defs)?void 0:n.values)?a:[]){const{id:e,missing:i,property:s}=t,n=Uh(this,i);"angleRaw"!==e&&n>0&&R.warnOnce(`no value was found for the key '${String(s)}' on ${n} data element${n>1?"s":""}`)}this.animationState.transition("updateData")})}maybeRefreshNodeData(){return S(this,null,function*(){var t;if(!this.nodeDataRefresh)return;const{nodeData:e=[]}=null!=(t=yield this.createNodeData())?t:{};this.nodeData=e,this.nodeDataRefresh=!1})}getProcessedDataIndexes(t){return{angleIdx:t.resolveProcessedDataIndexById(this,"angleValue"),radiusIdx:this.properties.radiusKey?t.resolveProcessedDataIndexById(this,"radiusValue"):-1,calloutLabelIdx:this.properties.calloutLabelKey?t.resolveProcessedDataIndexById(this,"calloutLabelValue"):-1,sectorLabelIdx:this.properties.sectorLabelKey?t.resolveProcessedDataIndexById(this,"sectorLabelValue"):-1,legendItemIdx:this.properties.legendItemKey?t.resolveProcessedDataIndexById(this,"legendItemValue"):-1}}createNodeData(){return S(this,null,function*(){const{id:t,processedData:e,dataModel:i,angleScale:s}=this,{rotation:n,innerRadiusRatio:a}=this.properties;if(!this.properties.isValid())return this.zerosumOuterRing.visible=!0,this.zerosumInnerRing.visible=!0,{itemId:t,nodeData:[],labelData:[]};if(!e||!i||"ungrouped"!==e.type)return;const{angleIdx:o,radiusIdx:r,calloutLabelIdx:l,sectorLabelIdx:h,legendItemIdx:c}=this.getProcessedDataIndexes(i);let d=0,u=0;const p=e.data.map((t,e)=>{var i;const{datum:a,values:p}=t,g=p[o],y=s.convert(d)+Fn(n);d=g,u+=g;const f=s.convert(d)+Fn(n),x=Math.abs(f-y),b=y+x/2,v=p[o+1],S=r>=0&&null!=(i=p[r])?i:1,M=r>=0?p[r+1]:void 0,k=c>=0?p[c]:void 0,D=this.getLabels(a,b,x,!0,p[l],p[h],k),w=this.getSectorFormat(a,e,!1);return m({itemId:e,series:this,datum:a,index:e,angleValue:v,midAngle:b,midCos:Math.cos(b),midSin:Math.sin(b),startAngle:y,endAngle:f,sectorFormat:w,radiusValue:M,radius:S,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(S),0),legendItemValue:k},D)});return this.zerosumOuterRing.visible=0===u,this.zerosumInnerRing.visible=0===u&&null!=a&&1!==a&&a>0,{itemId:t,nodeData:p,labelData:p}})}getLabels(t,e,i,s,n,a,o){const{calloutLabel:r,sectorLabel:l,legendItemKey:h}=this.properties,c=!s||r.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!c&&!d&&!h)return{};const u={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 c&&i>Fn(r.minAngle)&&(p.calloutLabel=y(m({},this.getTextAlignment(e)),{text:this.getLabelText(r,y(m({},u),{value:n})),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0})),d&&(p.sectorLabel={text:this.getLabelText(l,y(m({},u),{value:a}))}),null!=h&&null!=o&&(p.legendItem={key:h,text:o}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Pn(t)- -.75*Math.PI;return e[Hs(Math.floor(i/(Math.PI/2)),e.length)]}getSectorFormat(t,e,i){var s,n,a,o,r;const{callbackCache:l,highlightManager:h}=this.ctx,{angleKey:c,radiusKey:d,fills:u,strokes:p,formatter:g,sectorSpacing:m,__BACKGROUND_COLOR_DO_NOT_USE:y}=this.properties,f=h.getActiveHighlight(),x=i&&(null==f?void 0:f.series)===this&&e===f.itemId;let b=p[e%p.length];null==m&&null==b&&(b=y);const{fill:v,fillOpacity:S,stroke:M,strokeWidth:k,strokeOpacity:D}=Ut(x&&this.properties.highlightStyle.item,{fill:u.length>0?u[e%u.length]:void 0,fillOpacity:this.properties.fillOpacity,stroke:b,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()});let w;return g&&(w=l.call(g,{datum:t,angleKey:c,radiusKey:d,fill:v,stroke:M,fills:u,strokes:p,strokeWidth:k,highlighted:x,seriesId:this.id})),{fill:null!=(s=null==w?void 0:w.fill)?s:v,fillOpacity:null!=(n=null==w?void 0:w.fillOpacity)?n:S,stroke:null!=(a=null==w?void 0:w.stroke)?a:M,strokeWidth:null!=(o=null==w?void 0:w.strokeWidth)?o:k,strokeOpacity:null!=(r=null==w?void 0:w.strokeOpacity)?r:D}}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),this.nodeData=this.nodeData.map(t=>{var e=t,{radius:i}=e,s=f(e,["radius"]);return y(m({},s),{radius:i,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(i),0)})})}getTitleTranslationY(){var t,e;const i=Math.max(0,this.radiusScale.range[1]);return 0===i?NaN:-i-(2+(null!=(e=null==(t=this.properties.title)?void 0:t.spacing)?e:0))-Math.max(0,-i)}update(t){return S(this,arguments,function*({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:null==t?void 0:t.width,seriesRectHeight:null==t?void 0:t.height},s=null!=ve(this.nodeDataDependencies,i);if(s&&(this._nodeDataDependencies=i),yield 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 t=this.getTitleTranslationY(),i=e.node.computeBBox();e.node.visible=e.enabled&&isFinite(t)&&!this.bboxIntersectsSurroundingSeries(i,0,t),e.node.translationY=isFinite(t)?t:0}for(const t of[this.zerosumInnerRing,this.zerosumOuterRing])t.fillOpacity=0,t.stroke=this.properties.calloutLabel.color,t.strokeWidth=1,t.strokeOpacity=1;this.updateNodeMidPoint(),yield this.updateSelections(),yield this.updateNodes(t)})}updateTitleNodes(){var t,e;const{oldTitle:i}=this,{title:s}=this.properties;i!==s&&(i&&(null==(t=this.labelGroup)||t.removeChild(i.node)),s&&(s.node.textBaseline="bottom",null==(e=this.labelGroup)||e.appendChild(s.node)),this.oldTitle=s)}updateNodeMidPoint(){this.nodeData.forEach(t=>{const e=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,e),y:t.midSin*Math.max(0,e)}})}updateSelections(){return S(this,null,function*(){yield this.updateGroupSelection(),this.updateInnerCircleSelection()})}updateGroupSelection(){return S(this,null,function*(){const{itemSelection:t,highlightSelection:e,calloutLabelSelection:i,sectorLabelSelection:s,innerLabelsSelection:n}=this,a=(t,e)=>{let i=this.nodeData;e&&(i=i.map(t=>y(m({},t),{sectorFormat:m({},t.sectorFormat)}))),t.update(i,void 0,t=>this.getDatumId(t)),this.ctx.animationManager.isSkipped()&&t.cleanup()};a(t,!1),a(e,!0),i.update(this.nodeData,t=>{const e=new Fr;e.tag=0,e.pointerEvents=1,t.appendChild(e);const i=new Po;i.tag=1,i.pointerEvents=1,t.appendChild(i)}),s.update(this.nodeData,t=>{t.pointerEvents=1}),n.update(this.properties.innerLabels,t=>{t.pointerEvents=1})})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const t=Math.min(i,this.getOuterRadius()),s=1;e=Math.ceil(2*t+s)}const s=t?[{radius:e}]:[];this.innerCircleSelection.update(s)}updateNodes(t){return S(this,null,function*(){const e=this.ctx.highlightManager.getActiveHighlight(),i=this.visible&&this.seriesItemEnabled.indexOf(!0)>=0;this.rootGroup.visible=i,this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&(null==e?void 0:e.series)===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((t,{radius:e})=>{var i,s;t.setProperties({fill:null==(i=this.properties.innerCircle)?void 0:i.fill,opacity:null==(s=this.properties.innerCircle)?void 0:s.fillOpacity,size:e})});const s=(t,e,i,s)=>{const n=this.getSectorFormat(e.datum,e.itemId,s);e.sectorFormat.fill=n.fill,e.sectorFormat.stroke=n.stroke;const a=this.ctx.animationManager.isSkipped();a&&(t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius),(s||a)&&(t.fill=n.fill,t.stroke=n.stroke),t.strokeWidth=n.strokeWidth,t.fillOpacity=n.fillOpacity,t.strokeOpacity=this.properties.strokeOpacity,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset,t.fillShadow=this.properties.shadow,t.cornerRadius=this.properties.cornerRadius,t.inset=null!=this.properties.sectorSpacing?(this.properties.sectorSpacing+(null!=n.stroke?n.strokeWidth:0))/2:0,t.lineJoin=null!=this.properties.sectorSpacing?"miter":"round"};this.itemSelection.each((t,e,i)=>s(t,e,0,!1)),this.highlightSelection.each((t,i,n)=>{const a=(null==e?void 0:e.series)===this&&t.datum.itemId===e.itemId;s(t,i,0,!0),t.visible=a}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")})}updateCalloutLineNodes(){var t;const{calloutLine:e}=this.properties,i=e.length,s=e.strokeWidth,n=null!=(t=e.colors)?t:this.properties.strokes,{offset:a}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((t,e)=>{var o;const r=t.datum,{calloutLabel:l,outerRadius:h}=r;if((null==l?void 0:l.text)&&!l.hidden&&0!==h){t.visible=!0,t.strokeWidth=s,t.stroke=n[e%n.length],t.fill=void 0;const c=r.midCos*h,d=r.midSin*h;let u=r.midCos*(h+i),p=r.midSin*(h+i);if((null!=(o=l.collisionTextAlign)?o:0!==l.collisionOffsetY)&&null!=l.box){const t=l.box;let e=u,i=p;u<t.x?e=t.x:u>t.x+t.width&&(e=t.x+t.width),p<t.y?i=t.y:p>t.y+t.height&&(i=t.y+t.height);const s=e-u,n=i-p,o=Math.sqrt(Math.pow(s,2)+Math.pow(n,2)),r=o-a;r>0&&(u+=s*r/o,p+=n*r/o)}t.x1=c,t.y1=d,t.x2=u,t.y2=p}else t.visible=!1})}getLabelOverflow(t,e,i){const s=i.x-this.centerX,n=i.x+i.width-this.centerX,a=i.y-this.centerY,o=i.y+i.height-this.centerY;let r=1;e.x+1<s?r=(e.x+e.width-s)/e.width:e.x+e.width-1>n&&(r=(n-e.x)/e.width);const l=e.y+1<a||e.y+e.height-1>o;return{textLength:1===r?t.length:Math.floor(t.length*r)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(e)}}bboxIntersectsSurroundingSeries(t,e=0,i=0){const{surroundingRadius:s}=this;if(null==s)return!1;const n=[{x:t.x+e,y:t.y+i},{x:t.x+t.width+e,y:t.y+i},{x:t.x+t.width+e,y:t.y+t.height+i},{x:t.x+e,y:t.y+t.height+i}],a=p(s,2);return n.some(t=>p(t.x,2)+p(t.y,2)>a)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,a=t.convert(0),o=this.nodeData,r=this.nodeData.filter(t=>{return!(!(e=t).calloutLabel||0===e.outerRadius);var e});if(r.forEach(t=>{const e=t.calloutLabel;null!=e&&(e.hidden=!1,e.collisionTextAlign=void 0,e.collisionOffsetY=0)}),r.length<=1)return;const l=r.filter(t=>t.midCos<0).sort((t,e)=>t.midSin-e.midSin),h=r.filter(t=>t.midCos>=0).sort((t,e)=>t.midSin-e.midSin),c=r.filter(t=>{var e;return t.midSin<0&&"center"===(null==(e=t.calloutLabel)?void 0:e.textAlign)}).sort((t,e)=>t.midCos-e.midCos),d=r.filter(t=>{var e;return t.midSin>=0&&"center"===(null==(e=t.calloutLabel)?void 0:e.textAlign)}).sort((t,e)=>t.midCos-e.midCos),u=new Po,p=t=>{var e;const n=t.calloutLabel;if(null==n)return new Qs(0,0,0,0);const a=t.outerRadius+i.length+s,o=t.midCos*a,r=t.midSin*a+n.collisionOffsetY;return u.text=n.text,u.x=o,u.y=r,u.setFont(this.properties.calloutLabel),u.setAlign({textAlign:null!=(e=n.collisionTextAlign)?e:n.textAlign,textBaseline:n.textBaseline}),u.computeBBox()},g=(t,e,i)=>{const s=p(t).grow(n/2),a=p(e).grow(n/2);if(s.x<a.x+a.width&&s.x+s.width>a.x&&("to-top"===i?s.y<a.y+a.height:s.y+s.height>a.y)){const t="to-top"===i?s.y-a.y-a.height:s.y+s.height-a.y;e.calloutLabel.collisionOffsetY=t}},m=t=>{const e=t.slice().sort((t,e)=>Math.abs(t.midSin)-Math.abs(e.midSin))[0],i=t.indexOf(e);for(let e=i-1;e>=0;e--){const i=t[e+1],s=t[e];g(i,s,"to-top")}for(let e=i+1;e<t.length;e++){const i=t[e-1],s=t[e];g(i,s,"to-bottom")}},y=t=>{const e=r.some(t=>0!==t.calloutLabel.collisionOffsetY),i=t.map(t=>p(t)),s=i.map(t=>t.clone().grow(n/2));let l=!1;for(let e=0;e<s.length&&!l;e++){const i=s[e];for(let n=e+1;n<t.length;n++){const t=s[n];if(i.collidesBBox(t)){l=!0;break}}}const h=o.map(t=>{const{startAngle:e,endAngle:i,outerRadius:s}=t;return{startAngle:e,endAngle:i,innerRadius:a,outerRadius:s}}),c=i.some(t=>h.some(e=>pg(t,e)));(l||e||c)&&t.filter(t=>"center"===t.calloutLabel.textAlign).forEach(t=>{const e=t.calloutLabel;t.midCos<0?e.collisionTextAlign="right":t.midCos>0?e.collisionTextAlign="left":e.collisionTextAlign="center"})};m(l),m(h),y(c),y(d)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,color:o}=i,r=new Po;this.calloutLabelSelection.selectByTag(1).forEach(s=>{var l;const{datum:h}=s,c=h.calloutLabel,d=e.convert(h.radius),u=Math.max(0,d);if(!(null==c?void 0:c.text)||0===u||c.hidden)return void(s.visible=!1);const p=u+n+a,g=h.midCos*p,m=h.midSin*p+c.collisionOffsetY,y={textAlign:null!=(l=c.collisionTextAlign)?l:c.textAlign,textBaseline:c.textBaseline};r.text=c.text,r.x=g,r.y=m,r.setFont(this.properties.calloutLabel),r.setAlign(y);const f=r.computeBBox();let x=c.text,b=!0;if(i.avoidCollisions){const{textLength:e,hasVerticalOverflow:i}=this.getLabelOverflow(c.text,f,t);x=c.text.length===e?c.text:`${c.text.substring(0,e)}…`,b=!i}s.text=x,s.x=g,s.y=m,s.setFont(this.properties.calloutLabel),s.setAlign(y),s.fill=o,s.visible=b})}computeLabelsBBox(t,e){return S(this,null,function*(){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,maxCollisionOffset:o,minSpacing:r}=i;if(!i.avoidCollisions)return null;yield this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],h=new Po;let c;const{title:d}=this.properties;if((null==d?void 0:d.text)&&d.enabled){const t=this.getTitleTranslationY();isFinite(t)&&(h.text=d.text,h.x=0,h.y=t,h.setFont(d),h.setAlign({textBaseline:"bottom",textAlign:"center"}),c=h.computeBBox(),l.push(c))}return this.nodeData.forEach(i=>{var s;const d=i.calloutLabel;if(!d||0===i.outerRadius)return null;const u=i.outerRadius+n+a,p=i.midCos*u,g=i.midSin*u+d.collisionOffsetY;h.text=d.text,h.x=p,h.y=g,h.setFont(this.properties.calloutLabel),h.setAlign({textAlign:null!=(s=d.collisionTextAlign)?s:d.textAlign,textBaseline:d.textBaseline});const m=h.computeBBox();if(d.box=m,Math.abs(d.collisionOffsetY)>o)d.hidden=!0;else{if(c){const t=e.y-this.centerY,i=new Qs(c.x-r,t,c.width+2*r,c.y+c.height+r-t);if(m.collidesBBox(i))return void(d.hidden=!0)}if(t.hideWhenNecessary){const{textLength:t,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:s}=this.getLabelOverflow(d.text,m,e),n=d.text.length>2&&t<2;if(i||n||s)return void(d.hidden=!0)}d.hidden=!1,l.push(m)}}),0===l.length?null:Qs.merge(l)})}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:a,positionOffset:o,positionRatio:r,color:l}=this.properties.sectorLabel;this.sectorLabelSelection.each((t,h)=>{const{sectorLabel:c,outerRadius:d}=h;let u=!1;if(c&&0!==d){const p=e*(1-r)+d*r+o;t.fill=l,t.fontStyle=s,t.fontWeight=n,t.fontSize=i,t.fontFamily=a,t.text=c.text,t.x=h.midCos*p,t.y=h.midSin*p,t.textAlign="center",t.textBaseline="middle";const g=t.computeBBox(),m=[[g.x,g.y],[g.x+g.width,g.y],[g.x+g.width,g.y+g.height],[g.x,g.y+g.height]],{startAngle:y,endAngle:f}=h,x={startAngle:y,endAngle:f,innerRadius:e,outerRadius:d};m.every(([t,e])=>dg(t,e,x))&&(u=!0)}t.visible=u})}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((i,s)=>{const{fontStyle:n,fontWeight:a,fontSize:o,fontFamily:r,color:l}=s;i.fontStyle=n,i.fontWeight=a,i.fontSize=o,i.fontFamily=r,i.text=s.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",t.push(i.computeBBox()),e.push(s.margin)});const i=t=>0===t?0:e[t],s=t=>t===e.length-1?0:e[t],n=t.reduce((t,e,n)=>t+e.height+i(n)+s(n),0),a=Math.max(...t.map(t=>t.width)),o=this.getInnerRadius(),r=Math.sqrt(Math.pow(a/2,2)+Math.pow(n/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let e=0,a=-n/2;e<t.length;e++){const n=t[e].height+a+i(e);l.push(n),a=n+s(e)}this.innerLabelsSelection.each((t,e,i)=>{t.y=l[i],t.visible=r})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}getDatumLegendName(t){const{angleKey:e,calloutLabelKey:i,sectorLabelKey:s,legendItemKey:n}=this.properties,{sectorLabel:a,calloutLabel:o,legendItem:r}=t;return n&&void 0!==r?r.text:i&&i!==e&&void 0!==(null==o?void 0:o.text)?o.text:s&&s!==e&&void 0!==(null==a?void 0:a.text)?a.text:void 0}pickNodeClosestDatum(t){return Tg(this,t)}getTooltipHtml(t){var e;if(!this.properties.isValid())return tl;const{datum:i,angleValue:s,sectorFormat:{fill:n},itemId:a}=t,o=Ru(null==(e=this.properties.title)?void 0:e.text),r=Wt(s)?$s(s):String(s),l=this.getDatumLegendName(t);return this.properties.tooltip.toTooltipHtml({title:null!=o?o:l,content:o&&l?`${l}: ${r}`:r,backgroundColor:n},{datum:i,itemId:a,title:o,color:n,seriesId:this.id,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})}getLegendData(t){var e,i,s,n,a;const{visible:o,processedData:r,dataModel:l}=this;if(!l||!(null==r?void 0:r.data.length)||!this.properties.isValid()||"category"!==t)return[];const{angleKey:h,calloutLabelKey:c,sectorLabelKey:d,legendItemKey:u}=this.properties;if(!(u||c&&c!==h||d&&d!==h))return[];const{calloutLabelIdx:p,sectorLabelIdx:g,legendItemIdx:m}=this.getProcessedDataIndexes(l),y=(null==(e=this.properties.title)?void 0:e.showInLegend)&&this.properties.title.text,f=[];for(let t=0;t<r.data.length;t++){const{datum:e,values:l}=r.data[t],x=[];y&&x.push(y);const b=this.getLabels(e,2*Math.PI,2*Math.PI,!1,l[p],l[g],l[m]);if(u&&void 0!==b.legendItem?x.push(b.legendItem.text):c&&c!==h&&void 0!==(null==(i=b.calloutLabel)?void 0:i.text)?x.push(null==(s=b.calloutLabel)?void 0:s.text):d&&d!==h&&void 0!==(null==(n=b.sectorLabel)?void 0:n.text)&&x.push(null==(a=b.sectorLabel)?void 0:a.text),0===x.length)continue;const v=this.getSectorFormat(e,t,!1);f.push({legendType:"category",id:this.id,itemId:t,seriesId:this.id,enabled:o&&this.seriesItemEnabled[t],label:{text:x.join(" - ")},marker:{fill:v.fill,stroke:v.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},legendItemName:null!=u?e[u]:void 0})}return f}onLegendItemClick(t){const{enabled:e,itemId:i,series:s,legendItemName:n}=t;s.id===this.id?this.toggleSeriesItem(i,e):null!=n&&this.toggleOtherSeriesItems(n,e)}toggleSeriesItem(t,e){this.seriesItemEnabled[t]=e,this.nodeDataRefresh=!0}toggleOtherSeriesItems(t,e){var i;if(!this.properties.legendItemKey||!this.dataModel)return;const s=this.dataModel.resolveProcessedDataIndexById(this,"legendItemValue");null==(i=this.processedData)||i.data.forEach(({values:i},n)=>{i[s]===t&&this.toggleSeriesItem(n,e)})}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=Lg(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);An(this.id,"nodes",e,[this.itemSelection,this.highlightSelection],i.nodes),An(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),Eu(this,"callout",e,this.calloutLabelSelection),Eu(this,"sector",e,this.sectorLabelSelection),Eu(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){var t,e,i,s,n,a;const{itemSelection:o,highlightSelection:r,processedData:l,radiusScale:h,previousRadiusScale:c}=this,{animationManager:d}=this.ctx,u=null==(t=null==l?void 0:l.reduced)?void 0:t.diff;this.ctx.animationManager.stopByAnimationGroupId(this.id);const p=0===(null!=(e=null==u?void 0:u.moved.size)?e:0),g=(null!=(i=null==l?void 0:l.defs.keys.length)?i:0)>0,m=null==(a=null==(n=null==(s=null==l?void 0:l.reduced)?void 0:s.animationValidation)?void 0:n.uniqueKeys)||a;p&&g&&m||this.ctx.animationManager.skipCurrentBatch();const y=Lg(!1,this.properties.rotation,h,c);An(this.id,"nodes",d,[o,r],y.nodes,(t,e)=>this.getDatumId(e),u),An(this.id,"innerCircle",d,[this.innerCircleSelection],y.innerCircle),Eu(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Eu(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Eu(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,radiusScale:i,previousRadiusScale:s}=this,{animationManager:n}=this.ctx,a=Lg(!1,this.properties.rotation,i,s);An(this.id,"nodes",n,[t,e],a.nodes),An(this.id,"innerCircle",n,[this.innerCircleSelection],a.innerCircle),Pu(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Pu(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Pu(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumIdFromData(t){var e,i,s;const{calloutLabelKey:n,sectorLabelKey:a,legendItemKey:o}=this.properties;if(null==(s=null==(i=null==(e=this.processedData)?void 0:e.reduced)?void 0:i.animationValidation)?void 0:s.uniqueKeys)return o?t[o]:n?t[n]:a?t[a]:void 0}getDatumId(t){const{index:e}=t,i=this.getDatumIdFromData(t.datum);return null!=i?String(i):`${e}`}onDataChange(){var t;const{data:e,seriesItemEnabled:i}=this;this.seriesItemEnabled=null!=(t=null==e?void 0:e.map((t,e)=>{var s;return null==(s=i[e])||s}))?t:[]}computeFocusBounds(t){return Ng(this,t)}};Eg.className="DonutSeries",Eg.type="donut";var Pg={series:{__extends__:We,title:{enabled:!0,fontStyle:void 0,fontWeight:"normal",fontSize:14,fontFamily:Ke,color:Ue,spacing:5},calloutLabel:{enabled:!0,fontStyle:void 0,fontWeight:void 0,fontSize:12,fontFamily:Ke,color:Ye,offset:3,minAngle:0},sectorLabel:{enabled:!0,fontStyle:void 0,fontWeight:"normal",fontSize:12,fontFamily:Ke,color:He,positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2},fillOpacity:1,strokeOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,rotation:0,shadow:{enabled:!1,color:Je,xOffset:3,yOffset:3,blur:5},innerLabels:{fontStyle:void 0,fontWeight:void 0,fontSize:12,fontFamily:Ke,color:Ye,margin:2},__BACKGROUND_COLOR_DO_NOT_USE:Qe}},Bg=({takeColors:t,colorsCount:e,userPalette:i})=>{const{fills:s,strokes:n}=t(e);return{fills:s,strokes:i?n:[],calloutLine:{colors:n}}},Fg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",instanceConstructor:Eg,themeTemplate:Pg,paletteFactory:Bg},zg=class extends al{constructor(){super(...arguments),this.showInLegend=!1}};b([Yn(qn)],zg.prototype,"showInLegend",2);var Gg=class extends zo{set(t,e){return super.set(t)}};b([Ns("Use a Donut Series instead"),Yn(Jn,{optional:!0})],Gg.prototype,"text",2),b([Ns("Use a Donut Series instead"),Yn(ta,{optional:!0})],Gg.prototype,"margin",2);var _g=class extends ye{};b([Ns("Use a Donut Series instead"),Yn(ga,{optional:!0})],_g.prototype,"fill",2),b([Ns("Use a Donut Series instead"),Yn(sa,{optional:!0})],_g.prototype,"fillOpacity",2);var jg=class extends zo{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};b([Yn(ia)],jg.prototype,"offset",2),b([Yn(na)],jg.prototype,"minAngle",2),b([Yn(ia)],jg.prototype,"minSpacing",2),b([Yn(ia)],jg.prototype,"maxCollisionOffset",2),b([Yn(qn)],jg.prototype,"avoidCollisions",2);var Wg=class extends zo{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};b([Yn(ta)],Wg.prototype,"positionOffset",2),b([Yn(sa)],Wg.prototype,"positionRatio",2);var Vg=class extends ye{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};b([Yn(ma,{optional:!0})],Vg.prototype,"colors",2),b([Yn(ia)],Vg.prototype,"length",2),b([Yn(ia)],Vg.prototype,"strokeWidth",2);var Kg=class extends zd{constructor(){super(...arguments),this.fills=Object.values(Pe),this.strokes=Object.values(Be),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=void 0,this.innerLabels=new fe(Gg),this.title=new zg,this.innerCircle=new _g,this.shadow=new zu,this.calloutLabel=new jg,this.sectorLabel=new Wg,this.calloutLine=new Vg,this.tooltip=new Wu,this.__BACKGROUND_COLOR_DO_NOT_USE=void 0}};b([Yn(Jn)],Kg.prototype,"angleKey",2),b([Yn(Jn,{optional:!0})],Kg.prototype,"angleName",2),b([Yn(Jn,{optional:!0})],Kg.prototype,"radiusKey",2),b([Yn(Jn,{optional:!0})],Kg.prototype,"radiusName",2),b([Yn(ia,{optional:!0})],Kg.prototype,"radiusMin",2),b([Yn(ia,{optional:!0})],Kg.prototype,"radiusMax",2),b([Yn(Jn,{optional:!0})],Kg.prototype,"calloutLabelKey",2),b([Yn(Jn,{optional:!0})],Kg.prototype,"calloutLabelName",2),b([Yn(Jn,{optional:!0})],Kg.prototype,"sectorLabelKey",2),b([Yn(Jn,{optional:!0})],Kg.prototype,"sectorLabelName",2),b([Yn(Jn,{optional:!0})],Kg.prototype,"legendItemKey",2),b([Yn(ma)],Kg.prototype,"fills",2),b([Yn(ma)],Kg.prototype,"strokes",2),b([Yn(sa)],Kg.prototype,"fillOpacity",2),b([Yn(sa)],Kg.prototype,"strokeOpacity",2),b([Yn(ka)],Kg.prototype,"lineDash",2),b([Yn(ia)],Kg.prototype,"lineDashOffset",2),b([Yn(ia)],Kg.prototype,"cornerRadius",2),b([Yn(Qn,{optional:!0})],Kg.prototype,"formatter",2),b([Yn(na)],Kg.prototype,"rotation",2),b([Yn(ta)],Kg.prototype,"outerRadiusOffset",2),b([Yn(sa)],Kg.prototype,"outerRadiusRatio",2),b([Ns("Use a Donut Series instead"),Yn(ta,{optional:!0})],Kg.prototype,"innerRadiusOffset",2),b([Ns("Use a Donut Series instead"),Yn(sa,{optional:!0})],Kg.prototype,"innerRadiusRatio",2),b([Yn(ia)],Kg.prototype,"strokeWidth",2),b([Yn(ia,{optional:!0})],Kg.prototype,"sectorSpacing",2),b([Yn(va)],Kg.prototype,"innerLabels",2),b([Yn(Xn)],Kg.prototype,"title",2),b([Yn(Xn)],Kg.prototype,"innerCircle",2),b([Yn(Xn)],Kg.prototype,"shadow",2),b([Yn(Xn)],Kg.prototype,"calloutLabel",2),b([Yn(Xn)],Kg.prototype,"sectorLabel",2),b([Yn(Xn)],Kg.prototype,"calloutLine",2),b([Yn(Xn)],Kg.prototype,"tooltip",2),b([Yn(Jn,{optional:!0})],Kg.prototype,"__BACKGROUND_COLOR_DO_NOT_USE",2);var Yg=class extends Hc{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}},$g=class extends Og{constructor(t){super({moduleCtx:t,pickModes:[0],useLabelLayer:!0,animationResetFns:{item:Ag,label:Bu}}),this.properties=new Kg,this.previousRadiusScale=new Xd,this.radiusScale=new Xd,this.backgroundGroup=this.rootGroup.appendChild(new Mo({name:`${this.id}-background`,layer:!0,zIndex:0})),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Mo({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new yd),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new yd),this.innerCircleGroup=this.backgroundGroup.appendChild(new Mo({name:`${this.id}-innerCircle`})),this.seriesItemEnabled=[],this.surroundingRadius=void 0,this.NodeEvent=Yg,this.angleScale=new Xd,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2);const e=new Mo({name:"pieCalloutLabels"}),i=new Mo({name:"pieSectorLabels"}),s=new Mo({name:"innerLabels"});this.labelGroup.append(e),this.labelGroup.append(i),this.labelGroup.append(s),this.calloutLabelSelection=Rr.select(e,Mo),this.sectorLabelSelection=Rr.select(i,Po),this.innerLabelsSelection=Rr.select(s,Po),this.innerCircleSelection=Rr.select(this.innerCircleGroup,yd)}addChartEventListeners(){var t;this.destroyFns.push(null==(t=this.ctx.chartEventManager)?void 0:t.addListener("legend-item-click",t=>this.onLegendItemClick(t)))}get visible(){return super.visible&&(0===this.seriesItemEnabled.length||this.seriesItemEnabled.some(t=>t))}nodeFactory(){return new vg}getSeriesDomain(t){return"x"===t?this.angleScale.domain:this.radiusScale.domain}processData(t){return S(this,null,function*(){var e,i,s,n,a;if(null==this.data||!this.properties.isValid())return;let{data:o}=this;const{visible:r,seriesItemEnabled:l}=this,{angleKey:h,radiusKey:c,calloutLabelKey:d,sectorLabelKey:u,legendItemKey:p}=this.properties,g=!this.ctx.animationManager.isSkipped(),f=[],x=[];p?f.push(jc(p,"band",{id:"legendItemKey"})):d?f.push(jc(d,"band",{id:"calloutLabelKey"})):u&&f.push(jc(u,"band",{id:"sectorLabelKey"}));const b=this.radiusScale.type,v=this.radiusScale.type;c&&x.push(Vc(c,{id:"radiusValue",min:null!=(e=this.properties.radiusMin)?e:0,max:this.properties.radiusMax}),Wc(c,b,{id:"radiusRaw"}),Ac({id:"radiusValue"},[0,1],1,null!=(i=this.properties.radiusMin)?i:0,this.properties.radiusMax)),d&&x.push(Wc(d,"band",{id:"calloutLabelValue"})),u&&x.push(Wc(u,"band",{id:"sectorLabelValue"})),p&&x.push(Wc(p,"band",{id:"legendItemValue"})),g&&this.processedData&&f.length>0&&x.push(Ec(this.processedData)),x.push(Tc()),o=o.map((t,e)=>r&&l[e]?t:y(m({},t),{[h]:0})),yield this.requestDataModel(t,o,{props:[...f,Kc(h,v,{id:"angleValue",onlyPositive:!0}),Wc(h,v,{id:"angleRaw"}),Ac({id:"angleValue"},[0,1],0,0),...x]});for(const t of null!=(a=null==(n=null==(s=this.processedData)?void 0:s.defs)?void 0:n.values)?a:[]){const{id:e,missing:i,property:s}=t,n=Uh(this,i);"angleRaw"!==e&&n>0&&R.warnOnce(`no value was found for the key '${String(s)}' on ${n} data element${n>1?"s":""}`)}this.animationState.transition("updateData")})}maybeRefreshNodeData(){return S(this,null,function*(){var t;if(!this.nodeDataRefresh)return;const{nodeData:e=[]}=null!=(t=yield this.createNodeData())?t:{};this.nodeData=e,this.nodeDataRefresh=!1})}getProcessedDataIndexes(t){return{angleIdx:t.resolveProcessedDataIndexById(this,"angleValue"),radiusIdx:this.properties.radiusKey?t.resolveProcessedDataIndexById(this,"radiusValue"):-1,calloutLabelIdx:this.properties.calloutLabelKey?t.resolveProcessedDataIndexById(this,"calloutLabelValue"):-1,sectorLabelIdx:this.properties.sectorLabelKey?t.resolveProcessedDataIndexById(this,"sectorLabelValue"):-1,legendItemIdx:this.properties.legendItemKey?t.resolveProcessedDataIndexById(this,"legendItemValue"):-1}}createNodeData(){return S(this,null,function*(){const{id:t,processedData:e,dataModel:i,angleScale:s}=this,{rotation:n}=this.properties;if(!e||!i||"ungrouped"!==e.type)return;const{angleIdx:a,radiusIdx:o,calloutLabelIdx:r,sectorLabelIdx:l,legendItemIdx:h}=this.getProcessedDataIndexes(i);let c=0,d=0;const u=e.data.map((t,e)=>{var i;const{datum:u,values:p}=t,g=p[a],y=s.convert(c)+Fn(n);c=g,d+=g;const f=s.convert(c)+Fn(n),x=Math.abs(f-y),b=y+x/2,v=p[a+1],S=o>=0&&null!=(i=p[o])?i:1,M=o>=0?p[o+1]:void 0,k=h>=0?p[h]:void 0,D=this.getLabels(u,b,x,!0,p[r],p[l],k),w=this.getSectorFormat(u,e,!1);return m({itemId:e,series:this,datum:u,index:e,angleValue:v,midAngle:b,midCos:Math.cos(b),midSin:Math.sin(b),startAngle:y,endAngle:f,sectorFormat:w,radiusValue:M,radius:S,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(S),0),legendItemValue:k},D)});this.zerosumOuterRing.visible=0===d;const{innerRadiusRatio:p=1}=this.properties;return this.zerosumInnerRing.visible=0===d&&1!==p&&p>0,{itemId:t,nodeData:u,labelData:u}})}getLabels(t,e,i,s,n,a,o){const{calloutLabel:r,sectorLabel:l,legendItemKey:h}=this.properties,c=!s||r.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!c&&!d&&!h)return{};const u={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 c&&i>Fn(r.minAngle)&&(p.calloutLabel=y(m({},this.getTextAlignment(e)),{text:this.getLabelText(r,y(m({},u),{value:n})),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0})),d&&(p.sectorLabel={text:this.getLabelText(l,y(m({},u),{value:a}))}),null!=h&&null!=o&&(p.legendItem={key:h,text:o}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=Pn(t)- -.75*Math.PI;return e[Hs(Math.floor(i/(Math.PI/2)),e.length)]}getSectorFormat(t,e,i){var s,n,a,o,r;const{callbackCache:l,highlightManager:h}=this.ctx,{angleKey:c,radiusKey:d,fills:u,strokes:p,formatter:g,sectorSpacing:m,__BACKGROUND_COLOR_DO_NOT_USE:y}=this.properties,f=h.getActiveHighlight(),x=i&&(null==f?void 0:f.series)===this&&e===f.itemId;let b=p[e%p.length];null!=m&&(null!=b||(b=y));const{fill:v,fillOpacity:S,stroke:M,strokeWidth:k,strokeOpacity:D}=Ut(x&&this.properties.highlightStyle.item,{fill:u.length>0?u[e%u.length]:void 0,fillOpacity:this.properties.fillOpacity,stroke:b,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()});let w;return g&&(w=l.call(g,{datum:t,angleKey:c,radiusKey:d,fill:v,stroke:M,fills:u,strokes:p,strokeWidth:k,highlighted:x,seriesId:this.id})),{fill:null!=(s=null==w?void 0:w.fill)?s:v,fillOpacity:null!=(n=null==w?void 0:w.fillOpacity)?n:S,stroke:null!=(a=null==w?void 0:w.stroke)?a:M,strokeWidth:null!=(o=null==w?void 0:w.strokeWidth)?o:k,strokeOpacity:null!=(r=null==w?void 0:w.strokeOpacity)?r:D}}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(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(t){const e=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e),this.nodeData=this.nodeData.map(t=>{var e=t,{radius:i}=e,s=f(e,["radius"]);return y(m({},s),{radius:i,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(i),0)})})}getTitleTranslationY(){var t,e;const i=Math.max(0,this.radiusScale.range[1]);return 0===i?NaN:-i-(2+(null!=(e=null==(t=this.properties.title)?void 0:t.spacing)?e:0))-Math.max(0,-i)}update(t){return S(this,arguments,function*({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:null==t?void 0:t.width,seriesRectHeight:null==t?void 0:t.height},s=null!=ve(this.nodeDataDependencies,i);if(s&&(this._nodeDataDependencies=i),yield 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 t=this.getTitleTranslationY(),i=e.node.computeBBox();e.node.visible=e.enabled&&isFinite(t)&&!this.bboxIntersectsSurroundingSeries(i,0,t),e.node.translationY=isFinite(t)?t:0}for(const t of[this.zerosumInnerRing,this.zerosumOuterRing])t.fillOpacity=0,t.stroke=this.properties.calloutLabel.color,t.strokeWidth=1,t.strokeOpacity=1;this.updateNodeMidPoint(),yield this.updateSelections(),yield this.updateNodes(t)})}updateTitleNodes(){var t,e;const{oldTitle:i}=this,{title:s}=this.properties;i!==s&&(i&&(null==(t=this.labelGroup)||t.removeChild(i.node)),s&&(s.node.textBaseline="bottom",null==(e=this.labelGroup)||e.appendChild(s.node)),this.oldTitle=s)}updateNodeMidPoint(){this.nodeData.forEach(t=>{const e=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,e),y:t.midSin*Math.max(0,e)}})}updateSelections(){return S(this,null,function*(){yield this.updateGroupSelection(),this.updateInnerCircleSelection()})}updateGroupSelection(){return S(this,null,function*(){const{itemSelection:t,highlightSelection:e,calloutLabelSelection:i,sectorLabelSelection:s,innerLabelsSelection:n}=this,a=(t,e)=>{let i=this.nodeData;e&&(i=i.map(t=>y(m({},t),{sectorFormat:m({},t.sectorFormat)}))),t.update(i,void 0,t=>this.getDatumId(t)),this.ctx.animationManager.isSkipped()&&t.cleanup()};a(t,!1),a(e,!0),i.update(this.nodeData,t=>{const e=new Fr;e.tag=0,e.pointerEvents=1,t.appendChild(e);const i=new Po;i.tag=1,i.pointerEvents=1,t.appendChild(i)}),s.update(this.nodeData,t=>{t.pointerEvents=1}),n.update(this.properties.innerLabels,t=>{t.pointerEvents=1})})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const t=Math.min(i,this.getOuterRadius()),s=1;e=Math.ceil(2*t+s)}const s=t?[{radius:e}]:[];this.innerCircleSelection.update(s)}updateNodes(t){return S(this,null,function*(){const e=this.ctx.highlightManager.getActiveHighlight(),i=this.visible&&this.seriesItemEnabled.indexOf(!0)>=0;this.rootGroup.visible=i,this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&(null==e?void 0:e.series)===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((t,{radius:e})=>{var i,s;t.setProperties({fill:null==(i=this.properties.innerCircle)?void 0:i.fill,opacity:null==(s=this.properties.innerCircle)?void 0:s.fillOpacity,size:e})});const s=(t,e,i,s)=>{const n=this.getSectorFormat(e.datum,e.itemId,s);e.sectorFormat.fill=n.fill,e.sectorFormat.stroke=n.stroke;const a=this.ctx.animationManager.isSkipped();a&&(t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius),(s||a)&&(t.fill=n.fill,t.stroke=n.stroke),t.strokeWidth=n.strokeWidth,t.fillOpacity=n.fillOpacity,t.strokeOpacity=this.properties.strokeOpacity,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset,t.fillShadow=this.properties.shadow,t.cornerRadius=this.properties.cornerRadius,t.inset=null!=this.properties.sectorSpacing?(this.properties.sectorSpacing+(null!=n.stroke?n.strokeWidth:0))/2:0,t.lineJoin=null!=this.properties.sectorSpacing?"miter":"round"};this.itemSelection.each((t,e,i)=>s(t,e,0,!1)),this.highlightSelection.each((t,i,n)=>{const a=(null==e?void 0:e.series)===this&&t.datum.itemId===e.itemId;s(t,i,0,!0),t.visible=a}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")})}updateCalloutLineNodes(){var t;const{calloutLine:e}=this.properties,i=e.length,s=e.strokeWidth,n=null!=(t=e.colors)?t:this.properties.strokes,{offset:a}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((t,e)=>{var o;const r=t.datum,{calloutLabel:l,outerRadius:h}=r;if((null==l?void 0:l.text)&&!l.hidden&&0!==h){t.visible=!0,t.strokeWidth=s,t.stroke=n[e%n.length],t.fill=void 0;const c=r.midCos*h,d=r.midSin*h;let u=r.midCos*(h+i),p=r.midSin*(h+i);if((null!=(o=l.collisionTextAlign)?o:0!==l.collisionOffsetY)&&null!=l.box){const t=l.box;let e=u,i=p;u<t.x?e=t.x:u>t.x+t.width&&(e=t.x+t.width),p<t.y?i=t.y:p>t.y+t.height&&(i=t.y+t.height);const s=e-u,n=i-p,o=Math.sqrt(Math.pow(s,2)+Math.pow(n,2)),r=o-a;r>0&&(u+=s*r/o,p+=n*r/o)}t.x1=c,t.y1=d,t.x2=u,t.y2=p}else t.visible=!1})}getLabelOverflow(t,e,i){const s=i.x-this.centerX,n=i.x+i.width-this.centerX,a=i.y-this.centerY,o=i.y+i.height-this.centerY;let r=1;e.x+1<s?r=(e.x+e.width-s)/e.width:e.x+e.width-1>n&&(r=(n-e.x)/e.width);const l=e.y+1<a||e.y+e.height-1>o;return{textLength:1===r?t.length:Math.floor(t.length*r)-1,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:this.bboxIntersectsSurroundingSeries(e)}}bboxIntersectsSurroundingSeries(t,e=0,i=0){const{surroundingRadius:s}=this;if(null==s)return!1;const n=[{x:t.x+e,y:t.y+i},{x:t.x+t.width+e,y:t.y+i},{x:t.x+t.width+e,y:t.y+t.height+i},{x:t.x+e,y:t.y+t.height+i}],a=p(s,2);return n.some(t=>p(t.x,2)+p(t.y,2)>a)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,a=t.convert(0),o=this.nodeData,r=this.nodeData.filter(t=>{return!(!(e=t).calloutLabel||0===e.outerRadius);var e});if(r.forEach(t=>{const e=t.calloutLabel;null!=e&&(e.hidden=!1,e.collisionTextAlign=void 0,e.collisionOffsetY=0)}),r.length<=1)return;const l=r.filter(t=>t.midCos<0).sort((t,e)=>t.midSin-e.midSin),h=r.filter(t=>t.midCos>=0).sort((t,e)=>t.midSin-e.midSin),c=r.filter(t=>{var e;return t.midSin<0&&"center"===(null==(e=t.calloutLabel)?void 0:e.textAlign)}).sort((t,e)=>t.midCos-e.midCos),d=r.filter(t=>{var e;return t.midSin>=0&&"center"===(null==(e=t.calloutLabel)?void 0:e.textAlign)}).sort((t,e)=>t.midCos-e.midCos),u=new Po,p=t=>{var e;const n=t.calloutLabel;if(null==n)return new Qs(0,0,0,0);const a=t.outerRadius+i.length+s,o=t.midCos*a,r=t.midSin*a+n.collisionOffsetY;return u.text=n.text,u.x=o,u.y=r,u.setFont(this.properties.calloutLabel),u.setAlign({textAlign:null!=(e=n.collisionTextAlign)?e:n.textAlign,textBaseline:n.textBaseline}),u.computeBBox()},g=(t,e,i)=>{const s=p(t).grow(n/2),a=p(e).grow(n/2);if(s.x<a.x+a.width&&s.x+s.width>a.x&&("to-top"===i?s.y<a.y+a.height:s.y+s.height>a.y)){const t="to-top"===i?s.y-a.y-a.height:s.y+s.height-a.y;e.calloutLabel.collisionOffsetY=t}},m=t=>{const e=t.slice().sort((t,e)=>Math.abs(t.midSin)-Math.abs(e.midSin))[0],i=t.indexOf(e);for(let e=i-1;e>=0;e--){const i=t[e+1],s=t[e];g(i,s,"to-top")}for(let e=i+1;e<t.length;e++){const i=t[e-1],s=t[e];g(i,s,"to-bottom")}},y=t=>{const e=r.some(t=>0!==t.calloutLabel.collisionOffsetY),i=t.map(t=>p(t)),s=i.map(t=>t.clone().grow(n/2));let l=!1;for(let e=0;e<s.length&&!l;e++){const i=s[e];for(let n=e+1;n<t.length;n++){const t=s[n];if(i.collidesBBox(t)){l=!0;break}}}const h=o.map(t=>{const{startAngle:e,endAngle:i,outerRadius:s}=t;return{startAngle:e,endAngle:i,innerRadius:a,outerRadius:s}}),c=i.some(t=>h.some(e=>pg(t,e)));(l||e||c)&&t.filter(t=>"center"===t.calloutLabel.textAlign).forEach(t=>{const e=t.calloutLabel;t.midCos<0?e.collisionTextAlign="right":t.midCos>0?e.collisionTextAlign="left":e.collisionTextAlign="center"})};m(l),m(h),y(c),y(d)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,color:o}=i,r=new Po;this.calloutLabelSelection.selectByTag(1).forEach(s=>{var l;const{datum:h}=s,c=h.calloutLabel,d=e.convert(h.radius),u=Math.max(0,d);if(!(null==c?void 0:c.text)||0===u||c.hidden)return void(s.visible=!1);const p=u+n+a,g=h.midCos*p,m=h.midSin*p+c.collisionOffsetY,y={textAlign:null!=(l=c.collisionTextAlign)?l:c.textAlign,textBaseline:c.textBaseline};r.text=c.text,r.x=g,r.y=m,r.setFont(this.properties.calloutLabel),r.setAlign(y);const f=r.computeBBox();let x=c.text,b=!0;if(i.avoidCollisions){const{textLength:e,hasVerticalOverflow:i}=this.getLabelOverflow(c.text,f,t);x=c.text.length===e?c.text:`${c.text.substring(0,e)}…`,b=!i}s.text=x,s.x=g,s.y=m,s.setFont(this.properties.calloutLabel),s.setAlign(y),s.fill=o,s.visible=b})}computeLabelsBBox(t,e){return S(this,null,function*(){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:a,maxCollisionOffset:o,minSpacing:r}=i;if(!i.avoidCollisions)return null;yield this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],h=new Po;let c;const{title:d}=this.properties;if((null==d?void 0:d.text)&&d.enabled){const t=this.getTitleTranslationY();isFinite(t)&&(h.text=d.text,h.x=0,h.y=t,h.setFont(d),h.setAlign({textBaseline:"bottom",textAlign:"center"}),c=h.computeBBox(),l.push(c))}return this.nodeData.forEach(i=>{var s;const d=i.calloutLabel;if(!d||0===i.outerRadius)return null;const u=i.outerRadius+n+a,p=i.midCos*u,g=i.midSin*u+d.collisionOffsetY;h.text=d.text,h.x=p,h.y=g,h.setFont(this.properties.calloutLabel),h.setAlign({textAlign:null!=(s=d.collisionTextAlign)?s:d.textAlign,textBaseline:d.textBaseline});const m=h.computeBBox();if(d.box=m,Math.abs(d.collisionOffsetY)>o)d.hidden=!0;else{if(c){const t=e.y-this.centerY,i=new Qs(c.x-r,t,c.width+2*r,c.y+c.height+r-t);if(m.collidesBBox(i))return void(d.hidden=!0)}if(t.hideWhenNecessary){const{textLength:t,hasVerticalOverflow:i,hasSurroundingSeriesOverflow:s}=this.getLabelOverflow(d.text,m,e),n=d.text.length>2&&t<2;if(i||n||s)return void(d.hidden=!0)}d.hidden=!1,l.push(m)}}),0===l.length?null:Qs.merge(l)})}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:a,positionOffset:o,positionRatio:r,color:l}=this.properties.sectorLabel,h=e>0,c=1===this.seriesItemEnabled.filter(Boolean).length;this.sectorLabelSelection.each((t,d)=>{const{sectorLabel:u,outerRadius:p}=d;let g=!1;if(u&&0!==p){const m=e*(1-r)+p*r+o;t.fill=l,t.fontStyle=s,t.fontWeight=n,t.fontSize=i,t.fontFamily=a,t.text=u.text,!h&&c?(t.x=0,t.y=0):(t.x=d.midCos*m,t.y=d.midSin*m),t.textAlign="center",t.textBaseline="middle";const y=t.computeBBox(),f=[[y.x,y.y],[y.x+y.width,y.y],[y.x+y.width,y.y+y.height],[y.x,y.y+y.height]],{startAngle:x,endAngle:b}=d,v={startAngle:x,endAngle:b,innerRadius:e,outerRadius:p};f.every(([t,e])=>dg(t,e,v))&&(g=!0)}t.visible=g})}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((i,s)=>{const{fontStyle:n,fontWeight:a,fontSize:o,fontFamily:r,color:l,margin:h=2}=s;i.fontStyle=n,i.fontWeight=a,i.fontSize=o,i.fontFamily=r,i.text=s.text,i.x=0,i.y=0,i.fill=l,i.textAlign="center",i.textBaseline="alphabetic",t.push(i.computeBBox()),e.push(h)});const i=t=>0===t?0:e[t],s=t=>t===e.length-1?0:e[t],n=t.reduce((t,e,n)=>t+e.height+i(n)+s(n),0),a=Math.max(...t.map(t=>t.width)),o=this.getInnerRadius(),r=Math.sqrt(Math.pow(a/2,2)+Math.pow(n/2,2))<=(o>0?o:this.getOuterRadius()),l=[];for(let e=0,a=-n/2;e<t.length;e++){const n=t[e].height+a+i(e);l.push(n),a=n+s(e)}this.innerLabelsSelection.each((t,e,i)=>{t.y=l[i],t.visible=r})}updateZerosumRings(){this.zerosumOuterRing.size=2*this.getOuterRadius(),this.zerosumInnerRing.size=2*this.getInnerRadius()}getDatumLegendName(t){const{angleKey:e,calloutLabelKey:i,sectorLabelKey:s,legendItemKey:n}=this.properties,{sectorLabel:a,calloutLabel:o,legendItem:r}=t;return n&&void 0!==r?r.text:i&&i!==e&&void 0!==(null==o?void 0:o.text)?o.text:s&&s!==e&&void 0!==(null==a?void 0:a.text)?a.text:void 0}pickNodeClosestDatum(t){return Tg(this,t)}getTooltipHtml(t){var e;if(!this.properties.isValid())return tl;const{datum:i,angleValue:s,sectorFormat:{fill:n},itemId:a}=t,o=Ru(null==(e=this.properties.title)?void 0:e.text),r=Wt(s)?$s(s):String(s),l=this.getDatumLegendName(t);return this.properties.tooltip.toTooltipHtml({title:null!=o?o:l,content:o&&l?`${l}: ${r}`:r,backgroundColor:n},{datum:i,itemId:a,title:o,color:n,seriesId:this.id,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})}getLegendData(t){var e,i,s,n,a;const{visible:o,processedData:r,dataModel:l}=this;if(!l||!(null==r?void 0:r.data.length)||"category"!==t)return[];const{angleKey:h,calloutLabelKey:c,sectorLabelKey:d,legendItemKey:u}=this.properties;if(!(u||c&&c!==h||d&&d!==h))return[];const{calloutLabelIdx:p,sectorLabelIdx:g,legendItemIdx:m}=this.getProcessedDataIndexes(l),y=(null==(e=this.properties.title)?void 0:e.showInLegend)&&this.properties.title.text,f=[];for(let t=0;t<r.data.length;t++){const{datum:e,values:l}=r.data[t],x=[];y&&x.push(y);const b=this.getLabels(e,2*Math.PI,2*Math.PI,!1,l[p],l[g],l[m]);if(u&&void 0!==b.legendItem?x.push(b.legendItem.text):c&&c!==h&&void 0!==(null==(i=b.calloutLabel)?void 0:i.text)?x.push(null==(s=b.calloutLabel)?void 0:s.text):d&&d!==h&&void 0!==(null==(n=b.sectorLabel)?void 0:n.text)&&x.push(null==(a=b.sectorLabel)?void 0:a.text),0===x.length)continue;const v=this.getSectorFormat(e,t,!1);f.push({legendType:"category",id:this.id,itemId:t,seriesId:this.id,enabled:o&&this.seriesItemEnabled[t],label:{text:x.join(" - ")},marker:{fill:v.fill,stroke:v.stroke,fillOpacity:this.properties.fillOpacity,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},legendItemName:null!=u?e[u]:void 0})}return f}onLegendItemClick(t){const{enabled:e,itemId:i,series:s,legendItemName:n}=t;s.id===this.id?this.toggleSeriesItem(i,e):null!=n&&this.toggleOtherSeriesItems(n,e)}toggleSeriesItem(t,e){this.seriesItemEnabled[t]=e,this.nodeDataRefresh=!0}toggleOtherSeriesItems(t,e){var i;if(!this.properties.legendItemKey||!this.dataModel)return;const s=this.dataModel.resolveProcessedDataIndexById(this,"legendItemValue");null==(i=this.processedData)||i.data.forEach(({values:i},n)=>{i[s]===t&&this.toggleSeriesItem(n,e)})}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=Lg(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);An(this.id,"nodes",e,[this.itemSelection,this.highlightSelection],i.nodes),An(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),Eu(this,"callout",e,this.calloutLabelSelection),Eu(this,"sector",e,this.sectorLabelSelection),Eu(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){var t,e,i,s,n,a;const{itemSelection:o,highlightSelection:r,processedData:l,radiusScale:h,previousRadiusScale:c}=this,{animationManager:d}=this.ctx,u=null==(t=null==l?void 0:l.reduced)?void 0:t.diff;this.ctx.animationManager.stopByAnimationGroupId(this.id);const p=0===(null!=(e=null==u?void 0:u.moved.size)?e:0),g=(null!=(i=null==l?void 0:l.defs.keys.length)?i:0)>0,m=null==(a=null==(n=null==(s=null==l?void 0:l.reduced)?void 0:s.animationValidation)?void 0:n.uniqueKeys)||a;p&&g&&m||this.ctx.animationManager.skipCurrentBatch();const y=Lg(!1,this.properties.rotation,h,c);An(this.id,"nodes",d,[o,r],y.nodes,(t,e)=>this.getDatumId(e),u),An(this.id,"innerCircle",d,[this.innerCircleSelection],y.innerCircle),Eu(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Eu(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Eu(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,radiusScale:i,previousRadiusScale:s}=this,{animationManager:n}=this.ctx,a=Lg(!1,this.properties.rotation,i,s);An(this.id,"nodes",n,[t,e],a.nodes),An(this.id,"innerCircle",n,[this.innerCircleSelection],a.innerCircle),Pu(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Pu(this,"sector",this.ctx.animationManager,this.sectorLabelSelection),Pu(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumIdFromData(t){var e,i,s;const{calloutLabelKey:n,sectorLabelKey:a,legendItemKey:o}=this.properties;if(null==(s=null==(i=null==(e=this.processedData)?void 0:e.reduced)?void 0:i.animationValidation)?void 0:s.uniqueKeys)return o?t[o]:n?t[n]:a?t[a]:void 0}getDatumId(t){const{index:e}=t,i=this.getDatumIdFromData(t.datum);return null!=i?String(i):`${e}`}onDataChange(){var t;const{data:e,seriesItemEnabled:i}=this;this.seriesItemEnabled=null!=(t=null==e?void 0:e.map((t,e)=>{var s;return null==(s=i[e])||s}))?t:[]}computeFocusBounds(t){return Ng(this,t)}};$g.className="PieSeries",$g.type="pie";var Hg={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",instanceConstructor:$g,themeTemplate:Pg,paletteFactory:Bg},Ug=["start","center","end"],Xg=["annotations","ranges","zoom"],Zg=(t=>(t.Top="top",t.Right="right",t.Bottom="bottom",t.Left="left",t.FloatingTop="floating-top",t.FloatingBottom="floating-bottom",t))(Zg||{}),qg=Object.values(Zg),Qg=class extends ye{constructor(t,e){super(),this.onChange=t,this.onButtonsChange=e,this.align="start",this.position="top"}};b([Xr(t=>{t.onChange(t.enabled)}),Yn(qn)],Qg.prototype,"enabled",2),b([Xr(t=>{t.onChange(t.enabled)}),Yn(Pa(["start","center","end"]),{optional:!0})],Qg.prototype,"align",2),b([Xr(t=>{t.onChange(t.enabled)}),Yn(Pa(["top","right","bottom","left","floating-top","floating-bottom"]),{optional:!0})],Qg.prototype,"position",2),b([Xr(t=>{t.onButtonsChange(t.buttons)}),Yn(oa,{optional:!0})],Qg.prototype,"buttons",2);var Jg="ag-charts-toolbar",tm={align:`${Jg}__align`,button:`${Jg}__button`,icon:`${Jg}__icon`,label:`${Jg}__label`},em={top:`${Jg}--top`,right:`${Jg}--right`,bottom:`${Jg}--bottom`,left:`${Jg}--left`,"floating-top":`${Jg}--floating-top`,"floating-bottom":`${Jg}--floating-bottom`,hidden:`${Jg}--hidden`,preventFlash:`${Jg}--prevent-flash`,floatingHidden:`${Jg}--floating-hidden`,align:{start:`${tm.align}--start`,center:`${tm.align}--center`,end:`${tm.align}--end`},button:{hidden:`${tm.button}--hidden`}},im=`\n.${Jg} {\n    align-items: center;\n    background: var(--ag-charts-toolbar-background-color);\n    border-bottom: var(--ag-charts-toolbar-border-critical);\n    border-top: var(--ag-charts-toolbar-border-critical);\n    border-left: var(--ag-charts-toolbar-border);\n    border-right: var(--ag-charts-toolbar-border);\n    display: flex;\n    flex-wrap: nowrap;\n    opacity: 1;\n    position: absolute;\n    transform: translateY(0);\n    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;\n}\n\n.${em.hidden},\n.${em.preventFlash} {\n    visibility: hidden;\n}\n\n.${em.floatingHidden} {\n    opacity: 0;\n    transition: opacity 0.4s ease-in-out;\n}\n\n.${em.top},\n.${em.bottom} {\n    flex-direction: row;\n    height: var(--ag-charts-toolbar-size);\n    padding: 0 var(--ag-charts-toolbar-padding);\n    width: 100%;\n}\n\n.${em.left},\n.${em.right} {\n    flex-direction: column;\n    padding: var(--ag-charts-toolbar-padding) 0;\n    width: var(--ag-charts-toolbar-size);\n}\n\n.${em["floating-top"]},\n.${em["floating-bottom"]} {\n    background: none;\n    border: none;\n    flex-direction: row;\n    height: var(--ag-charts-toolbar-size);\n    overflow: hidden;\n    padding: 0 var(--ag-charts-toolbar-padding);\n    pointer-events: none;\n    width: 100%;\n}\n\n.${tm.align} {\n    display: flex;\n    flex-direction: inherit;\n    flex-wrap: inherit;\n    max-width: 100%;\n}\n\n.${em.align.center},\n.${em.align.end} {\n    margin-left: auto;\n}\n\n.${em.left} .${em.align.center},\n.${em.left} .${em.align.end},\n.${em.right} .${em.align.center},\n.${em.right} .${em.align.end} {\n    margin-left: 0;\n    margin-top: auto;\n}\n\n.${em["floating-top"]} .${tm.align},\n.${em["floating-bottom"]} .${tm.align} {\n    gap: var(--ag-charts-toolbar-gap);\n    transition: transform 0.4s ease-in-out;\n}\n\n.${tm.button} {\n    align-items: center;\n    border-radius: var(--ag-charts-button-radius);\n    color: var(--ag-charts-toolbar-foreground-color);\n    display: flex;\n    font-size: 14px;\n    font-weight: 500;\n    justify-content: center;\n    margin: 0;\n    padding: var(--ag-charts-button-padding);\n    pointer-events: all;\n    transition: background-color .25s ease-in-out;\n}\n\n.${em.left} .${tm.button},\n.${em.right} .${tm.button} {\n    height: var(--ag-charts-toolbar-size);\n    max-width: 100%;\n    overflow: hidden;\n}\n\n.${em["floating-top"]} .${tm.button},\n.${em["floating-bottom"]} .${tm.button} {\n    background: var(--ag-charts-toolbar-background-color);\n    border: var(--ag-charts-toolbar-border-critical);\n}\n\n.${em.button.hidden} {\n    display: none;\n}\n\n.${tm.button}:hover {\n    background: var(--ag-charts-toolbar-hover-color);\n}\n\n.${tm.button}:disabled {\n    background: var(--ag-charts-toolbar-disabled-background-color);\n    color: var(--ag-charts-toolbar-disabled-foreground-color);\n}\n\n.${tm.button}:not([disabled]) {\n    cursor: pointer;\n}\n\n.${tm.icon} {\n    height: 1.2em;\n    width: 1.2em;\n}\n\n.${tm.icon} + .${tm.label} {\n    margin-left: var(--ag-charts-size);\n}\n\n.${tm.icon},\n.${tm.label} {\n    pointer-events: none;\n}\n\n`,sm=class extends vt{constructor(t){super(),this.ctx=t,this.enabled=!0,this.annotations=new Qg(this.onGroupChanged.bind(this,"annotations"),this.onGroupButtonsChanged.bind(this,"annotations")),this.ranges=new Qg(this.onGroupChanged.bind(this,"ranges"),this.onGroupButtonsChanged.bind(this,"ranges")),this.zoom=new Qg(this.onGroupChanged.bind(this,"zoom"),this.onGroupButtonsChanged.bind(this,"zoom")),this.margin=10,this.floatingDetectionRange=28,this.positions={top:new Set,right:new Set,bottom:new Set,left:new Set,"floating-top":new Set,"floating-bottom":new Set},this.positionAlignments={top:{},right:{},bottom:{},left:{},"floating-top":{},"floating-bottom":{}},this.groupCallers={annotations:0,ranges:0,zoom:0},this.groupButtons={annotations:[],ranges:[],zoom:[]},this.pendingButtonToggledEvents=[],this.groupProxied=new Set,this.container=t.toolbarManager.element,this.elements={top:this.container.appendChild(Ss("div")),right:this.container.appendChild(Ss("div")),bottom:this.container.appendChild(Ss("div")),left:this.container.appendChild(Ss("div")),"floating-top":this.container.appendChild(Ss("div")),"floating-bottom":this.container.appendChild(Ss("div"))},ks(im,Jg),this.renderToolbar("top"),this.renderToolbar("right"),this.renderToolbar("bottom"),this.renderToolbar("left"),this.renderToolbar("floating-top"),this.renderToolbar("floating-bottom"),this.toggleVisibilities(),this.destroyFns.push(t.interactionManager.addListener("hover",this.onHover.bind(this),31),t.interactionManager.addListener("leave",this.onLeave.bind(this),31),t.toolbarManager.addListener("button-toggled",this.onButtonToggled.bind(this)),t.toolbarManager.addListener("group-toggled",this.onGroupToggled.bind(this)),t.toolbarManager.addListener("proxy-group-options",this.onProxyGroupOptions.bind(this)),t.layoutService.addListener("layout-complete",this.onLayoutComplete.bind(this)),()=>this.destroyElements())}destroyElements(){for(const t of Object.values(this.elements))t.remove()}onHover(t){const{enabled:e,elements:i,floatingDetectionRange:s,ctx:{scene:n}}=this,{offsetY:a,sourceEvent:{target:o}}=t,{FloatingBottom:r,FloatingTop:l}=Zg;if(!e)return;const h=i[r],c=i[l],d=a>h.offsetTop-s&&a<n.canvas.element.offsetHeight||o===h,u=c.offsetTop+c.offsetHeight+s,p=a>0&&a<u||o===c;h.classList.toggle(em.floatingHidden,!d),c.classList.toggle(em.floatingHidden,!p),this.translateFloatingElements(r,d),this.translateFloatingElements(l,p)}onLeave(t){const{enabled:e,elements:i,ctx:{scene:s}}=this,{relatedTarget:n,target:a}=t.sourceEvent,{FloatingBottom:o,FloatingTop:r}=Zg;e&&a===s.canvas.element&&(Xg.some(t=>this.groupButtons[t].some(t=>t===n))||(i[o].classList.add(em.floatingHidden),i[r].classList.add(em.floatingHidden),this.translateFloatingElements(o,!1),this.translateFloatingElements(r,!1)))}onGroupChanged(t){null==this[t]||this.groupProxied.has(t)||(this.createGroup(t),this.toggleVisibilities())}onGroupButtonsChanged(t,e){this.enabled&&!this.groupProxied.has(t)&&(this.createGroupButtons(t,e),this.toggleVisibilities())}onLayoutComplete(){for(const t of qg)this.elements[t].classList.remove(em.preventFlash)}onButtonToggled(t){const{group:e,value:i,enabled:s}=t;if(0!==this.groupButtons[e].length)for(const t of this.groupButtons[e])t.dataset.toolbarValue===`${i}`&&(t.disabled=!s);else this.pendingButtonToggledEvents.push(t)}onGroupToggled(t){const{group:e,visible:i}=t;this.toggleGroup(e,i),this.toggleVisibilities()}onProxyGroupOptions(t){const{group:e,options:i}=t;this.groupProxied.add(e),this.createGroup(e,i.enabled,i.position),this.createGroupButtons(e,i.buttons),this.toggleGroup(e,i.enabled),this[e].set(i)}createGroup(t,e,i){null!=e||(e=this[t].enabled),null!=i||(i=this[t].position);for(const s of qg)e&&i===s?this.positions[s].add(t):this.positions[s].delete(t)}createGroupButtons(t,e){var i,s;for(const e of this.groupButtons[t])e.remove();this.groupButtons[t]=[];const n=null!=(i=this[t].align)?i:"start",a=null!=(s=this[t].position)?s:"top",o=this.positionAlignments[a][n];for(const i of null!=e?e:[]){const e=this.createButtonElement(t,i);null==o||o.appendChild(e),this.groupButtons[t].push(e)}}toggleGroup(t,e){e?this.groupCallers[t]+=1:this.groupCallers[t]=Math.max(0,this.groupCallers[t]-1)}processPendingEvents(){var t;const e=(null!=(t=this.pendingButtonToggledEvents)?t:[]).slice();for(const t of e)this.onButtonToggled(t);this.pendingButtonToggledEvents=[]}performLayout(t){return S(this,arguments,function*({shrinkRect:t}){const{elements:e,margin:i}=this;return e.top.classList.contains(em.hidden)||t.shrink(e.top.offsetHeight+2*i,"top"),e.right.classList.contains(em.hidden)||t.shrink(e.right.offsetWidth+i,"right"),e.bottom.classList.contains(em.hidden)||t.shrink(e.bottom.offsetHeight+2*i,"bottom"),e.left.classList.contains(em.hidden)||t.shrink(e.left.offsetWidth+i,"left"),{shrinkRect:t}})}performCartesianLayout(t){return S(this,null,function*(){const{elements:e,margin:i}=this,{seriesRect:s}=t,{FloatingBottom:n,FloatingTop:a}=Zg;e.top.style.top=s.y-e.top.offsetHeight-2*i+"px",e.top.style.left=`${i}px`,e.top.style.width=`calc(100% - ${2*i}px)`,e.right.style.top=`${s.y+i}px`,e.right.style.right=`${i}px`,e.right.style.height=`calc(100% - ${s.y+2*i}px)`,e.bottom.style.bottom=`${i}px`,e.bottom.style.left=`${i}px`,e.bottom.style.width=`calc(100% - ${2*i}px)`,e.left.style.top=`${s.y}px`,e.left.style.left=`${i}px`,e.left.style.height=`calc(100% - ${s.y+2*i}px)`,e[a].style.top=`${s.y}px`,e[a].style.paddingTop=`${i}px`,e[n].style.top=s.y+s.height-e[n].offsetHeight+"px",e[n].style.paddingBottom=`${i}px`})}toggleVisibilities(){var t;if(null==this.elements)return;const e=t=>this[t].enabled&&this.groupCallers[t]>0,i=t=>e=>"string"!=typeof e.value&&"number"!=typeof e.value||`${e.value}`===t.dataset.toolbarValue;for(const t of qg){const i=this.enabled&&Array.from(this.positions[t].values()).some(e);this.elements[t].classList.toggle(em.hidden,!i)}for(const s of Xg){if(null==this[s])continue;const n=e(s);for(const e of this.groupButtons[s]){const a=n&&(null==(t=this[s].buttons)?void 0:t.some(i(e)));e.classList.toggle(em.button.hidden,!a)}}}translateFloatingElements(t,e){const{elements:i,margin:s,positionAlignments:n}=this,a=i[t],o=Object.values(n[t]);for(const t of o)t.style.transform=e&&""!==t.style.transform?"translateY(0)":`translateY(${a.offsetHeight+s}px)`}renderToolbar(t="top"){const e=this.elements[t];e.classList.add(Jg,em[t],em.preventFlash),"floating-top"!==t&&"floating-bottom"!==t||e.classList.add(em.floatingHidden);for(const i of Ug){const s=Ss("div");s.classList.add(tm.align,em.align[i]),e.appendChild(s),this.positionAlignments[t][i]=s}}createButtonElement(t,e){const i=Ss("button");i.classList.add(tm.button),i.dataset.toolbarGroup=t,i.tabIndex=-1,"string"!=typeof e.value&&"number"!=typeof e.value||(i.dataset.toolbarValue=`${e.value}`),e.tooltip&&(i.title=e.tooltip);let s="";return null!=e.icon&&(s=`<span class="ag-charts-icon-${e.icon} ${tm.icon}"></span>`),null!=e.label&&(s=`${s}<span class="${tm.label}">${e.label}</span>`),i.innerHTML=s,i.onclick=this.onButtonPress.bind(this,t,e.value),this.destroyFns.push(()=>i.remove()),i}onButtonPress(t,e){this.ctx.toolbarManager.pressButton(t,e)}};b([Xr(t=>{t.processPendingEvents(),t.toggleVisibilities()}),Yn(qn)],sm.prototype,"enabled",2);var nm=864e5,am=30*nm,om={type:"root",optionsKey:"toolbar",packageType:"community",chartTypes:["cartesian"],instanceConstructor:sm,themeTemplate:{toolbar:{enabled:!0,annotations:{enabled:!1,position:"left",align:"start",buttons:[{label:"Li",value:"line"},{label:"PCh",value:"parallel-channel"}]},ranges:{enabled:!1,position:"top",align:"start",buttons:[{label:"1m",value:am},{label:"3m",value:3*am},{label:"6m",value:6*am},{label:"YTD",value:(t,e)=>[new Date(`${new Date(e).getFullYear()}-01-01`).getTime(),e]},{label:"1y",value:365*nm},{label:"All",value:(t,e)=>[t,e]}]},zoom:{enabled:!1,position:"top",align:"end",buttons:[{icon:"zoom-out",tooltip:"Zoom out",value:"zoom-out"},{icon:"zoom-in",tooltip:"Zoom in",value:"zoom-in"},{icon:"pan-left",tooltip:"Pan left",value:"pan-left"},{icon:"pan-right",tooltip:"Pan right",value:"pan-right"},{icon:"pan-start",tooltip:"Pan to the start",value:"pan-start"},{icon:"pan-end",tooltip:"Pan to the end",value:"pan-end"},{icon:"reset",tooltip:"Reset the zoom",value:"reset"}]}}}};var rm=class t extends sd{constructor(t,e){super(t,e)}performLayout(){return S(this,null,function*(){const e=yield v(t.prototype,this,"performLayout").call(this),{seriesArea:{padding:i},seriesRoot:s,annotationRoot:n,highlightRoot:a}=this,o=e.clone();e.shrink(i.left,"left"),e.shrink(i.top,"top"),e.shrink(i.right,"right"),e.shrink(i.bottom,"bottom"),this.seriesRect=e,this.animationRect=e,this.hoverRect=e;for(const t of[s,n,a])t.translationX=Math.floor(e.x),t.translationY=Math.floor(e.y);return yield Promise.all(this.series.map(t=>S(this,null,function*(){yield t.update({seriesRect:e})}))),s.visible=this.series[0].visible,s.setClipRectInGroupCoordinateSpace(new Qs(e.x,e.y,e.width,e.height)),this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:o,paddedRect:e,visible:!0},axes:[]}),e})}};rm.className="HierarchyChart",rm.type="hierarchy";var lm=rm,hm=class extends Sl{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}computeLabelsBBox(t,e){return null}};b([Yn(Pa(["polygon","circle"],"a polar axis shape"))],hm.prototype,"shape",2),b([Yn(sa)],hm.prototype,"innerRadiusRatio",2);var cm=class t extends sd{constructor(t,e){super(t,e),this.padding=new Zl(40),this.axisGroup.zIndex=6}performLayout(){return S(this,null,function*(){const e=yield v(t.prototype,this,"performLayout").call(this),i=e.clone();return this.computeSeriesRect(e),yield this.computeCircle(e),this.axes.forEach(t=>t.update()),this.hoverRect=e,this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:i,paddedRect:e,visible:!0},axes:[]}),e})}updateAxes(t,e,i){var s,n;const a=this.axes.find(t=>"x"===t.direction),o=this.axes.find(t=>"y"===t.direction);if(!(a instanceof hm&&o instanceof hm))return;const r=a.scale,l=null==(s=r.ticks)?void 0:s.call(r).map(t=>r.convert(t)),h=o.innerRadiusRatio;a.innerRadiusRatio=h,null==(n=a.computeRange)||n.call(a),a.gridLength=i,o.gridAngles=l,o.gridRange=a.range,o.range=[i,i*h],[a,o].forEach(i=>{i.translation.x=t,i.translation.y=e,i.calculateLayout()})}computeSeriesRect(t){const{seriesArea:{padding:e}}=this;t.shrink(e.left,"left"),t.shrink(e.top,"top"),t.shrink(e.right,"right"),t.shrink(e.bottom,"bottom"),this.seriesRect=t,this.animationRect=t}computeCircle(t){return S(this,null,function*(){const e=this.series.filter(t=>t instanceof Og),i=this.axes.filter(t=>t instanceof hm),s=(t,i,s)=>{this.updateAxes(t,i,s),e.forEach(e=>{e.centerX=t,e.centerY=i,e.radius=s});const n=e.filter(t=>t instanceof $g||t instanceof Eg);if(n.length>1){const t=n.map(t=>{const e=t.getInnerRadius();return{series:t,innerRadius:e}}).sort((t,e)=>t.innerRadius-e.innerRadius);t.at(-1).series.surroundingRadius=void 0;for(let e=0;e<t.length-1;e++)t[e].series.surroundingRadius=t[e+1].innerRadius}},n=t.x+t.width/2,a=t.y+t.height/2,o=Math.max(0,Math.min(t.width,t.height)/2);let r=o;s(n,a,r);const l=(...l)=>S(this,[...l],function*({hideWhenNecessary:l=!1}={}){const h=[];for(const s of[...i,...e]){const e=yield s.computeLabelsBBox({hideWhenNecessary:l},t);e&&h.push(e)}if(0===h.length)return void s(n,a,o);const c=Qs.merge(h),d=this.refineCircle(c,r,t);s(d.centerX,d.centerY,d.radius),d.radius!==r&&(r=d.radius)});return yield l(),yield l(),yield l(),yield l({hideWhenNecessary:!0}),yield l({hideWhenNecessary:!0}),{radius:r,centerX:n,centerY:a}})}refineCircle(t,e,i){const s=-e,n=-e,a=e,o=e;let r=Math.max(0,s-t.x),l=Math.max(0,n-t.y),h=Math.max(0,t.x+t.width-a),c=Math.max(0,t.y+t.height-o);r=h=Math.max(r,h),l=c=Math.max(l,c);const d=i.width-r-h,u=i.height-l-c;let p=Math.min(d,u)/2;const g=.5*i.width/2,m=.5*i.height/2,y=Math.min(g,m);if(p<y){p=y;const t=r+h;if(2*p+(l+c)>i.height){const t=i.height-2*p;2*Math.min(l,c)>t?(l=t/2,c=t/2):l>c?l=t-c:c=t-l}if(2*p+t>i.width){const t=i.width-2*p;2*Math.min(r,h)>t?(r=t/2,h=t/2):r>h?r=t-h:h=t-r}}const f=r+2*p+h,x=l+2*p+c;return{centerX:i.x+(i.width-f)/2+r+p,centerY:i.y+(i.height-x)/2+l+p,radius:p}}};cm.className="PolarChart",cm.type="polar";var dm=cm,um=Math.PI/180,pm=t=>t*um,gm=t=>-Math.log(Math.tan(.25*Math.PI+t*um*.5)),mm=t=>t/um,ym=t=>(Math.atan(Math.exp(-t))-.25*Math.PI)/(.5*um),fm=class t{constructor(e,i){this.domain=e,this.range=i,this.type="mercator",this.bounds=t.bounds(e)}static bounds(t){const[[e,i],[s,n]]=t,a=pm(e),o=gm(i),r=pm(s),l=gm(n);return new Qs(Math.min(a,r),Math.min(o,l),Math.abs(r-a),Math.abs(l-o))}static fixedScale(){return new t([[mm(0),ym(0)],[mm(1),ym(1)]],[[0,0],[1,1]])}convert([t,e]){const[[i,s],[n,a]]=this.range,o=(n-i)/this.bounds.width,r=(a-s)/this.bounds.height;return[(pm(t)-this.bounds.x)*o+i,(gm(e)-this.bounds.y)*r+s]}invert([t,e]){const[[i,s],[n,a]]=this.range,o=(n-i)/this.bounds.width,r=(a-s)/this.bounds.height;return[mm((t-i)/o+this.bounds.x),ym((e-s)/r+this.bounds.y)]}};function xm(t){return"map-shape"===t.type||"map-line"===t.type||"map-marker"===t.type||"map-shape-background"===t.type||"map-line-background"===t.type}var bm=class t extends sd{constructor(t,e){super(t,e),this.xAxis=new qd(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new qd(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}updateData(){return S(this,null,function*(){yield v(t.prototype,this,"updateData").call(this);const{topology:e}=this.getOptions();this.series.forEach(t=>{xm(t)&&t.setChartTopology(e)})})}performLayout(){return S(this,null,function*(){const e=yield v(t.prototype,this,"performLayout").call(this),{seriesArea:{padding:i},seriesRoot:s,annotationRoot:n,highlightRoot:a}=this,o=e.clone();e.shrink(i.left,"left"),e.shrink(i.top,"top"),e.shrink(i.right,"right"),e.shrink(i.bottom,"bottom"),this.seriesRect=e,this.animationRect=e,this.hoverRect=e;const r=this.series.filter(xm),l=r.reduce((t,e)=>{if(!e.visible)return t;const i=e.topologyBounds;return null==i?t:null==t?i:(t.merge(i),t)},void 0);let h;if(null!=l){const{lon0:t,lat0:i,lon1:s,lat1:n}=l,a=[[t,i],[s,n]],o=fm.bounds(a),{width:r,height:c}=e,d=Math.min(r/o.width,c/o.height),u=o.width*d,p=o.height*d,g=(r-u)/2,m=(c-p)/2,y=g,f=m,x=g+u,b=m+p,v=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),S=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),M=(x-y)/(v.max-v.min),k=y-M*v.min,D=(b-f)/(1-S.min-(1-S.max)),w=f-D*(1-S.max);h=new fm(a,[[k,w],[k+M,w+D]])}r.forEach(t=>{t.scale=h});const c=this.series.some(t=>t.visible);s.visible=c;for(const t of[s,n,a])t.translationX=Math.floor(e.x),t.translationY=Math.floor(e.y),t.setClipRectInGroupCoordinateSpace(new Qs(e.x,e.y,e.width,e.height));return this.ctx.layoutService.dispatchLayoutComplete({type:"layout-complete",chart:{width:this.ctx.scene.width,height:this.ctx.scene.height},clipSeries:!1,series:{rect:o,paddedRect:e,visible:c},axes:[]}),e})}};bm.className="TopologyChart",bm.type="topology";var vm=bm,Sm=Cs.create(!0,"opts");function Mm(t){if(de(t))return"cartesian";if(ue(t))return"polar";if(pe(t))return"hierarchy";if(ge(t))return"topology";throw new Error(`AG Chart - unknown type of chart for options with type: ${t.type}`)}var km=class t{static licenseCheck(t){var e,i,s,n;this.licenseChecked||(this.licenseManager=null==(i=(e=bt).licenseManager)?void 0:i.call(e,t),null==(s=this.licenseManager)||s.setLicenseKey(this.licenseKey,this.gridContext),null==(n=this.licenseManager)||n.validateLicense(),this.licenseChecked=!0)}static setLicenseKey(t){this.licenseKey=t}static setGridContext(t){this.gridContext=t}static getLicenseDetails(t){var e,i;return null==(i=(e=bt).licenseManager)?void 0:i.call(e,{}).getLicenseDetails(t)}static getInstance(t){return Cm.getInstance(t)}static create(t){var e,i,s;this.licenseCheck(t);const n=Cm.createOrUpdate(t);return(null==(e=this.licenseManager)?void 0:e.isDisplayWatermark())&&(null==(s=(i=bt).injectWatermark)||s.call(i,n.chart.element,this.licenseManager.getWatermarkMessage())),n}static update(e,i){if(!Ud.isInstance(e))throw new Error(t.INVALID_CHART_REF_MESSAGE);Cm.createOrUpdate(i,e)}static updateDelta(e,i){if(!Ud.isInstance(e))throw new Error(t.INVALID_CHART_REF_MESSAGE);Cm.updateUserDelta(e,i)}static download(e,i){if(!(e instanceof Ud))throw new Error(t.INVALID_CHART_REF_MESSAGE);Cm.download(e,i).catch(t=>R.errorOnce(t))}static getImageDataURL(e,i){if(!(e instanceof Ud))throw new Error(t.INVALID_CHART_REF_MESSAGE);return Cm.getImageDataURL(e,i)}};km.INVALID_CHART_REF_MESSAGE="AG Charts - invalid chart reference passed",km.licenseChecked=!1,km.gridContext=!1;var Dm=km,wm=class{static warnDeprecated(t){Ts()(`AgChart.${t}`,`Use AgCharts.${t} instead`)}static create(t){return this.warnDeprecated("create"),Dm.create(t)}static update(t,e){return this.warnDeprecated("update"),Dm.update(t,e)}static updateDelta(t,e){return this.warnDeprecated("updateDelta"),Dm.updateDelta(t,e)}static download(t,e){return this.warnDeprecated("download"),Dm.download(t,e)}static getImageDataURL(t,e){return this.warnDeprecated("getImageDataURL"),Dm.getImageDataURL(t,e)}},Im=class t{static getInstance(t){const e=sd.getInstance(t);return e?Ud.chartInstances.get(e):void 0}static initialiseModules(){t.initialised||(function(){St.register(lu,ku,Lu,om,wp,Yp,Jp,ag,hg,Fg,Hg,ig);for(const t of[qd,Il,eu,Fl,Jd])Mt.register(t.type,{instanceConstructor:t,hidden:t===Fl})}(),function(){for(const t of St.modules){if("enterprise"!==t.packageType||he(t)||R.errorOnce("Unexpected enterprise module registered: "+t.identifier),"root"===t.type&&t.themeTemplate)for(const e of t.chartTypes)oe.set(e,t.themeTemplate);if("series"===t.type){if(t.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${t.identifier}`);Ce.register(t.identifier,t)}if("series-option"===t.type&&t.themeTemplate)for(const e of t.seriesTypes)Ce.setThemeTemplate(e,t.themeTemplate);if("axis-option"===t.type&&t.themeTemplate)for(const e of t.axisTypes){const i=t.themeTemplate[e],s=m(m({},t.themeTemplate),i);for(const e of t.axisTypes)delete s[e];Mt.setThemeTemplate(e,s)}"axis"===t.type&&Mt.register(t.identifier,t),"legend"===t.type&&Le.register(t.identifier,t)}if(St.hasEnterpriseModules()){const t=re.filter(({useCount:t})=>null==t||0===t);t.length>0&&R.errorOnce("Enterprise modules expected but not registered: ",t)}}(),t.initialised=!0)}static createOrUpdate(e,i){t.initialiseModules(),Sm(">>> AgChartV2.createOrUpdate() user options",e);const s=e,{overrideDevicePixelRatio:n,document:a,window:o}=s,r=f(s,["overrideDevicePixelRatio","document","window"]),l=new As(r,{overrideDevicePixelRatio:n,document:a,window:o});let h=null==i?void 0:i.chart;return null!=h&&Mm(r)===Mm(h.processedOptions)||(h=t.createChartInstance(l,h)),null==i?i=new Ud(h):i.chart=h,Sm.check()&&"undefined"!=typeof window&&(null!=window.agChartInstances||(window.agChartInstances={}),window.agChartInstances[h.id]=h),h.queuedUserOptions.push(r),h.requestFactoryUpdate(t=>{t.applyOptions(l),t.queuedUserOptions.splice(0,t.queuedUserOptions.indexOf(r))}),i}static updateUserDelta(e,i){ke(i=Se(i,{shallow:["data"]}),t=>{if("object"==typeof t)for(const[e,i]of Object.entries(t))void 0===i&&Object.assign(t,{[e]:Symbol("UNSET")})},{skip:["data"]});const{chart:s}=e,n=s.getOptions(),a=Ut(i,n);Sm(">>> AgChartV2.updateUserDelta() user delta",i),Sm("AgChartV2.updateUserDelta() - base options",n),t.createOrUpdate(a,e)}static download(e,i){return S(this,null,function*(){try{const s=yield t.prepareResizedChart(e,i);s.chart.ctx.scene.download(null==i?void 0:i.fileName,null==i?void 0:i.fileFormat),s.destroy()}catch(t){R.errorOnce(t)}})}static getImageDataURL(e,i){return S(this,null,function*(){const s=yield t.prepareResizedChart(e,i),n=s.chart.ctx.scene.getDataURL(null==i?void 0:i.fileFormat);return s.destroy(),n})}static prepareResizedChart(e){return S(this,arguments,function*({chart:e},i={}){var s,n,a,o;const r=null!=(n=null!=(s=i.width)?s:e.width)?n:e.ctx.scene.canvas.width,l=null!=(o=null!=(a=i.height)?a:e.height)?o:e.ctx.scene.canvas.height,h=Ut({container:document.createElement("div"),overrideDevicePixelRatio:1,autoSize:!1,width:r,height:l},St.hasEnterpriseModules()&&{animation:{enabled:!1}},e.userOptions),c=t.createOrUpdate(h);return c.chart.ctx.zoomManager.updateZoom("agChartV2",e.ctx.zoomManager.getZoom()),e.series.forEach((t,e)=>{t.visible||(c.chart.series[e].visible=!1)}),e.update(0,{forceNodeDataRefresh:!0}),yield c.chart.waitForUpdate(),c})}static createChartInstance(e,i){const s=null==i?void 0:i.destroy({keepTransferableResources:!0});return new(t.getChartByOptions(e.processedOptions))(e,s)}static getChartByOptions(t){if(de(t))return $d;if(pe(t))return lm;if(ue(t))return dm;if(ge(t))return vm;throw new Error("AG Charts - couldn't apply configuration, check options are correctly structured and series types are specified")}};Im.initialised=!1;var Cm=Im,Lm="9.3.2",Am={};x(Am,{Arc:()=>Tm,BBox:()=>Qs,BandScale:()=>Vn,Caption:()=>al,ChangeDetectableProperties:()=>Fu,Circle:()=>yd,ContinuousScale:()=>Ua,Diamond:()=>vd,DropShadow:()=>zu,ExtendedPath2D:()=>ld,Group:()=>Mo,HdpiCanvas:()=>Gl,Image:()=>Pm,Label:()=>zo,Line:()=>Fr,LinearGradientFill:()=>Nm,LinearScale:()=>Xd,Marker:()=>md,Node:()=>ln,OrdinalTimeScale:()=>fo,Path:()=>cd,PointerEvents:()=>on,RadialColumnShape:()=>Rm,Rect:()=>ou,RedrawType:()=>Js,Scene:()=>$l,SceneChangeDetection:()=>en,ScenePathChangeDetection:()=>hd,Sector:()=>vg,SectorBox:()=>cg,Selection:()=>Rr,Shape:()=>Co,Square:()=>wd,Text:()=>Po,Tooltip:()=>nl,Triangle:()=>Ld,easing:()=>gn,getFont:()=>Fo,getMarker:()=>Od,getRadialColumnWidth:()=>Em,motion:()=>Bm,nearestSquared:()=>Xs,nearestSquaredInContainer:()=>Zs,toRadians:()=>Fn,toTooltipHtml:()=>il});var Tm=class extends cd{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return Vs(Rn(this.startAngle),Rn(this.endAngle))}updatePath(){const t=this.path;t.clear(),t.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),1===this.type?t.closePath():2!==this.type||this.fullPie||(t.lineTo(this.centerX,this.centerY),t.closePath())}computeBBox(){return new Qs(this.centerX-this.radius,this.centerY-this.radius,2*this.radius,2*this.radius)}isPointInPath(t,e){const i=this.transformPoint(t,e),s=this.computeBBox();return 0!==this.type&&s.containsPoint(i.x,i.y)&&this.path.isPointInPath(i.x,i.y)}};Tm.className="Arc",Tm.defaultStyles=Object.assign({},Co.defaultStyles,{lineWidth:1,fillStyle:null}),b([hd()],Tm.prototype,"centerX",2),b([hd()],Tm.prototype,"centerY",2),b([hd()],Tm.prototype,"radius",2),b([hd()],Tm.prototype,"startAngle",2),b([hd()],Tm.prototype,"endAngle",2),b([hd()],Tm.prototype,"counterClockwise",2),b([hd()],Tm.prototype,"type",2);var Nm=class extends Co{constructor(){super(...arguments),this.direction="to-right",this.stops=void 0,this._mask=void 0}get mask(){return this._mask}set mask(t){null!=this._mask&&this.removeChild(this._mask),null!=t&&this.appendChild(t),this._mask=t}isPointInPath(t,e){var i,s;return null!=(s=null==(i=this.mask)?void 0:i.isPointInPath(t,e))&&s}computeBBox(){var t;return null==(t=this.mask)?void 0:t.computeBBox()}render(t){const{mask:e,stops:i}=this,{ctx:s,devicePixelRatio:n}=t,a=1/n,o=null==e?void 0:e.computeTransformedBBox();if(null==e||null==i||null==o)return;e.dirtyPath&&(e.updatePath(),e.dirtyPath=!1),s.save(),s.clip(e.path.getPath2D()),s.setTransform(n,0,0,n,0,0);const r=Math.floor(o.x),l=Math.ceil(o.x+o.width),h=Math.floor(o.y),c=Math.ceil(o.y+o.height),d=new Hp,[u,p]="to-right"===this.direction?[r,l]:[h,c];if(d.domain=i.map((t,e)=>u+(p-u)*e/(i.length-1)),d.range=i,d.update(),"to-right"===this.direction){const t=c-h;for(let e=r;e<=l;e+=a)s.fillStyle=d.convert(e),s.fillRect(e,h,a,t)}else{const t=l-r;for(let e=h;e<=c;e+=a)s.fillStyle=d.convert(e),s.fillRect(r,e,t,a)}s.restore()}};function Om(t,e,i){const s=Math.sqrt(p(t,2)+p(e,2)),n=Math.atan2(e,t)+i;return{x:Math.cos(n)*s,y:Math.sin(n)*s}}b([en({redraw:3})],Nm.prototype,"direction",2),b([en({redraw:3})],Nm.prototype,"stops",2),b([en({redraw:3})],Nm.prototype,"_mask",2);var Rm=class extends cd{constructor(){super(...arguments),this.borderPath=new ld,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}getRotation(){const{startAngle:t,endAngle:e}=this;return Rn(t+Gn(t,e)/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,a=t/2,o=-i,r=-e,l=this.getRotation(),h=[[n,r],[n,o],[a,o],[a,r],[n,r]].map(([t,e])=>Om(t,e,l));s.clear(!0),s.moveTo(h[0].x,h[0].y),s.lineTo(h[1].x,h[1].y),s.lineTo(h[2].x,h[2].y),s.lineTo(h[3].x,h[3].y),s.lineTo(h[0].x,h[0].y),s.closePath()}updateBeveledPath(){const{columnWidth:t,path:e,outerRadius:i,innerRadius:s,axisInnerRadius:n,axisOuterRadius:a,isRadiusAxisReversed:o}=this,r=Vs(s,n),l=Math.asin(t/2/s),h=this.getRotation(),c=(t,e)=>Om(t,e,h),d=(t,e)=>Math.sqrt(p(t,2)+p(e,2)),u=(t,e)=>e>t?0:Math.sqrt(p(t,2)-p(e,2)),g=(t,e,i)=>i?t<e:t>e,m=r&&!isNaN(l)&&l<Math.PI/6;let y=-t/2,f=t/2;const x=-i,b=-s*(m?Math.cos(l):1),v=g(a,d(s,t/2),!o);if(v){const t=u(a,s);y=-t,f=t}e.clear(!0);const S=c(y,b);e.moveTo(S.x,S.y);const M=Vs(s,i),k=g(a,d(i,t/2),!o);if(M&&m)e.arc(0,0,s,Rn(-l-Math.PI/2)+h,Rn(l-Math.PI/2)+h,!1);else if(k){const s=-u(a,t/2),n=u(a,i);if(!v){const t=c(y,s);e.lineTo(t.x,t.y)}if(e.arc(0,0,a,Math.atan2(s,y)+h,Math.atan2(x,-n)+h,!1),!Vs(n,0)){const t=c(n,x);e.lineTo(t.x,t.y)}e.arc(0,0,a,Math.atan2(x,n)+h,Math.atan2(s,f)+h,!1)}else{const t=c(y,x),i=c(f,x);e.lineTo(t.x,t.y),e.lineTo(i.x,i.y)}const D=c(f,b);if(e.lineTo(D.x,D.y),m)e.arc(0,0,s,Rn(l-Math.PI/2)+h,Rn(-l-Math.PI/2)+h,!0);else{const t=c(y,b);e.lineTo(t.x,t.y)}e.closePath()}};function Em(t,e,i,s,n){const a=Gn(t,e),o=a*(1-s)/2;if(t+=o,e-=o,a<.001)return 2*i*n;if(a>=2*Math.PI){const i=t+a/2;t=i-Math.PI,e=i+Math.PI}const r=i*Math.cos(t),l=i*Math.sin(t),h=i*Math.cos(e),c=i*Math.sin(e),d=Math.floor(Math.sqrt(p(r-h,2)+p(l-c,2))),u=2*i*n;return Math.max(1,Math.min(u,d))}Rm.className="RadialColumnShape",b([hd()],Rm.prototype,"isBeveled",2),b([hd()],Rm.prototype,"columnWidth",2),b([hd()],Rm.prototype,"startAngle",2),b([hd()],Rm.prototype,"endAngle",2),b([hd()],Rm.prototype,"outerRadius",2),b([hd()],Rm.prototype,"innerRadius",2),b([hd()],Rm.prototype,"axisInnerRadius",2),b([hd()],Rm.prototype,"axisOuterRadius",2),b([hd()],Rm.prototype,"isRadiusAxisReversed",2);var Pm=class extends ln{constructor(t){super(),this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1,this.sourceImage=t}render(t){const{ctx:e,forceRender:i,stats:s}=t;if(0===this.dirty&&!i)return void(s&&s.nodesSkipped++);this.computeTransformMatrix(),this.matrix.toContext(e);const n=this.sourceImage;e.globalAlpha=this.opacity,e.drawImage(n,0,0,n.width,n.height,this.x,this.y,this.width,this.height),super.render(t)}};b([en({redraw:3})],Pm.prototype,"x",2),b([en({redraw:3})],Pm.prototype,"y",2),b([en({redraw:3})],Pm.prototype,"width",2),b([en({redraw:3})],Pm.prototype,"height",2),b([en({redraw:3})],Pm.prototype,"opacity",2);var Bm=m(m({},Rs),pr),Fm={};x(Fm,{CARTESIAN_AXIS_TYPE:()=>Oe,ChartTheme:()=>fi,DEFAULT_ANNOTATION_BACKGROUND_FILL:()=>ci,DEFAULT_ANNOTATION_HANDLE_FILL:()=>di,DEFAULT_ANNOTATION_STROKE:()=>hi,DEFAULT_AXIS_GRID_COLOUR:()=>Xe,DEFAULT_AXIS_LINE_COLOUR:()=>Ze,DEFAULT_BACKGROUND_COLOUR:()=>Qe,DEFAULT_COLOURS:()=>ti,DEFAULT_CROSS_LINES_COLOUR:()=>qe,DEFAULT_DIVERGING_SERIES_COLOUR_RANGE:()=>oi,DEFAULT_FONT_FAMILY:()=>Ke,DEFAULT_HIERARCHY_FILLS:()=>ri,DEFAULT_HIERARCHY_STROKES:()=>li,DEFAULT_INSIDE_SERIES_LABEL_COLOUR:()=>He,DEFAULT_INVERTED_LABEL_COLOUR:()=>$e,DEFAULT_LABEL_COLOUR:()=>Ye,DEFAULT_MUTED_LABEL_COLOUR:()=>Ue,DEFAULT_POLAR_SERIES_STROKE:()=>ai,DEFAULT_SHADOW_COLOUR:()=>Je,DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE:()=>ni,DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS:()=>ii,DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS:()=>ei,DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS:()=>si,EXTENDS_AXES_DEFAULTS:()=>ze,EXTENDS_AXES_GRID_LINE_DEFAULTS:()=>je,EXTENDS_AXES_LINE_DEFAULTS:()=>Ge,EXTENDS_AXES_TICK_DEFAULTS:()=>_e,EXTENDS_CARTESIAN_MARKER_DEFAULTS:()=>Ve,EXTENDS_SERIES_DEFAULTS:()=>We,FONT_SIZE:()=>Ae,FONT_WEIGHT:()=>Te,IS_DARK_THEME:()=>Fe,POLAR_AXIS_SHAPE:()=>Ee,POLAR_AXIS_TYPE:()=>Re,POSITION:()=>Ne,getChartTheme:()=>as,markerPaletteFactory:()=>Tu,singleSeriesPaletteFactory:()=>Au,themes:()=>zm});var zm=Zt(ns,t=>null==t?void 0:t()),Gm={};x(Gm,{BandScale:()=>Vn,ColorScale:()=>Hp,ContinuousScale:()=>Ua,Invalidating:()=>jn,LinearScale:()=>Xd,OrdinalTimeScale:()=>fo,TimeScale:()=>mo});var _m={};function jm(t,e){const i={};if(Array.isArray(e))for(let s=0;s<t.length;s++)i[`${t[s]}`]=e[s];else for(let s=0;s<t.length;s++)i[`${t[s]}`]=e;return i}x(_m,{Color:()=>un,Logger:()=>R,Padding:()=>Zl,angleBetween:()=>Gn,areArrayItemsStrictlyEqual:()=>Vr,areArrayNumbersEqual:()=>Kr,bifurcate:()=>gs,checkDatum:()=>$o,clamp:()=>Gs,clampArray:()=>_s,countFractionDigits:()=>Us,createId:()=>Bs,deepClone:()=>Se,displacePointFromVector:()=>_n,extent:()=>os,findMinMax:()=>js,findRangeExtent:()=>Ws,isBetweenAngles:()=>Bn,isContinuous:()=>Yo,isDate:()=>Et,isDenseInterval:()=>po,isEqual:()=>Vs,isNegative:()=>Ks,isNumber:()=>Wt,isNumberEqual:()=>Vs,isNumberObject:()=>Ko,isString:()=>_t,isStringObject:()=>Vo,jsonApply:()=>De,jsonDiff:()=>ve,jsonWalk:()=>ke,mod:()=>Hs,normalisedExtent:()=>rs,normalisedExtentWithMetadata:()=>ls,normalizeAngle180:()=>Pn,normalizeAngle360:()=>Rn,normalizeAngle360Inclusive:()=>En,range:()=>uo,resetIds:()=>Ps,round:()=>Ys,sanitizeHtml:()=>Ru,setAttribute:()=>Zr,shallowClone:()=>Me,tickFormat:()=>Tr,tickStep:()=>co,ticks:()=>lo,toDegrees:()=>zn,toFixed:()=>$s,toRadians:()=>Fn,transformIntegratedCategoryValue:()=>Ho,zipObject:()=>jm});var Wm={};function Vm({defs:t,values:e,xAxis:i,yAxis:s}){if(!i||!s)throw new Error("Axes must be defined");const n={};for(const[a,{def:o}]of t)if(Object.hasOwn(e,a)){const{scale:t}="key"===o.type?i:s;n[a]=Math.round(t.convert(e[a]))}return n}x(Wm,{AND:()=>Hn,ARRAY:()=>oa,ARRAY_OF:()=>ra,AbstractBarSeries:()=>Tp,AbstractBarSeriesProperties:()=>Ap,ActionOnSet:()=>Ur,Animation:()=>Cn,AnimationManager:()=>yh,AreaSeriesTag:()=>vp,Axis:()=>Sl,AxisLabel:()=>hl,AxisTick:()=>Va,BOOLEAN:()=>qn,BOOLEAN_ARRAY:()=>ya,Background:()=>ru,BackgroundModule:()=>lu,BaseModuleInstance:()=>vt,BaseProperties:()=>ye,COLOR_STRING:()=>ga,COLOR_STRING_ARRAY:()=>ma,CartesianAxis:()=>Dl,CartesianSeries:()=>Vd,CartesianSeriesNodeEvent:()=>jd,CartesianSeriesProperties:()=>Wd,CategoryAxis:()=>Il,CategoryAxisTick:()=>wl,ChartAxisDirection:()=>Ka,ChartEventManager:()=>xh,ChartOptions:()=>As,ChartUpdateType:()=>Gh,ContextMenuRegistry:()=>bh,CursorManager:()=>Sh,DATE:()=>da,DATE_ARRAY:()=>ba,DATE_OR_DATETIME_MS:()=>ua,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>Gd,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>_d,DEFAULT_TOOLTIP_CLASS:()=>Qr,DEFAULT_TOOLTIP_DARK_CLASS:()=>Jr,DEGREE:()=>na,DIRECTION:()=>Na,DataController:()=>Qh,DataModel:()=>Zh,DataModelSeries:()=>Rd,DataService:()=>ih,Default:()=>Kn,Deprecated:()=>Ns,DeprecatedAndRenamedTo:()=>Os,EMPTY_TOOLTIP_CONTENT:()=>tl,FONT_STYLE:()=>wa,FONT_WEIGHT:()=>Ia,FUNCTION:()=>Qn,GREATER_THAN:()=>ca,GestureDetector:()=>kh,GroupedCategoryAxis:()=>Fl,HierarchyNode:()=>Ym,HierarchySeries:()=>$m,HierarchySeriesProperties:()=>Hm,HighlightManager:()=>Dh,HighlightStyle:()=>Fd,INTERACTION_RANGE:()=>Ra,InteractionManager:()=>gh,InteractionState:()=>uh,LABEL_PLACEMENT:()=>Ea,LESS_THAN:()=>ha,LINE_CAP:()=>Sa,LINE_DASH:()=>ka,LINE_JOIN:()=>Ma,Layers:()=>Wo,LayoutService:()=>Fh,LonLatBBox:()=>Um,MARKER_SHAPE:()=>Gu,MATCHING_CROSSLINE_TYPE:()=>Uo,MAX_SPACING:()=>Fa,MIN_SPACING:()=>Ba,MercatorScale:()=>fm,Motion:()=>gn,NAN:()=>ea,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Ln,NUMBER:()=>ta,NUMBER_ARRAY:()=>fa,NUMBER_OR_NAN:()=>aa,Navigator:()=>Cu,NavigatorModule:()=>Lu,OBJECT:()=>Xn,OBJECT_ARRAY:()=>va,OR:()=>Un,OVERFLOW_STRATEGY:()=>Ta,ObserveChanges:()=>Xr,PHASE_METADATA:()=>Dn,PHASE_ORDER:()=>kn,PLACEMENT:()=>Oa,PLAIN_OBJECT:()=>Zn,POINTER_INTERACTION_TYPES:()=>rh,POSITION:()=>Da,POSITIVE_NUMBER:()=>ia,PolarAxis:()=>hm,PolarSeries:()=>Og,PropertiesArray:()=>fe,ProxyOnWrite:()=>$r,ProxyProperty:()=>Yr,ProxyPropertyOnWrite:()=>Hr,QUICK_TRANSITION:()=>.2,RATIO:()=>sa,RepeatType:()=>wn,SKIP_JS_BUILTINS:()=>Jt,SMALLEST_KEY_INTERVAL:()=>Dc,SORT_DOMAIN_GROUPS:()=>wc,STRING:()=>Jn,STRING_ARRAY:()=>xa,Series:()=>Xc,SeriesGroupingChangedEvent:()=>Uc,SeriesItemHighlightStyle:()=>Ed,SeriesMarker:()=>_u,SeriesNodeEvent:()=>Hc,SeriesNodePickMode:()=>Bc,SeriesProperties:()=>zd,SeriesTooltip:()=>Wu,StateMachine:()=>mr,TEXT_ALIGN:()=>La,TEXT_WRAP:()=>Ca,ToolbarManager:()=>Eh,Tooltip:()=>nl,TooltipManager:()=>Bh,TooltipPosition:()=>sl,UNION:()=>Pa,UpdateService:()=>_h,VERTICAL_ALIGN:()=>Aa,Validate:()=>Yn,ZoomManager:()=>ec,__FORCE_MODULE_DETECTION:()=>Xm,accumulateGroup:()=>Rc,accumulatedValue:()=>Mc,accumulativeValueProperty:()=>Kc,addHitTestersToQuadtree:()=>Cp,adjustLabelPlacement:()=>Vp,allInStringUnion:()=>ys,animationValidation:()=>Tc,area:()=>Sc,arraysEqual:()=>hs,assignJsonApplyConstructedArray:()=>$a,backfillPathPointData:()=>tp,basicContinuousCheckDatumValidation:()=>Fc,bifurcate:()=>gs,buildFormatter:()=>io,buildResetPathFn:()=>op,calculateDefaultTimeTickFormat:()=>ao,calculatePlacement:()=>qr,checkCrisp:()=>Pp,childrenIter:()=>Ip,circularSliceArray:()=>ps,clamp:()=>Gs,clampArray:()=>_s,collapsedStartingBarPosition:()=>Fp,computeBarFocusBounds:()=>jp,computeMarkerFocusBounds:()=>Zu,computeSectorFocusBounds:()=>Ng,convertValuesToScaleByDefs:()=>Vm,countFractionDigits:()=>Us,createDatumId:()=>Pc,createDeprecationWarning:()=>Ts,createElement:()=>Ss,dateToNumber:()=>so,deconstructSelectionsOrNodes:()=>In,deepClone:()=>Se,deepMerge:()=>Ht,defaultTimeTickFormat:()=>no,determinePathStatus:()=>fp,diff:()=>Ec,downloadUrl:()=>Ms,enterpriseModule:()=>bt,extent:()=>os,extractDecoratedProperties:()=>At,findMinMax:()=>js,findQuadtreeMatch:()=>Lp,findRangeExtent:()=>Ws,fixNumericExtent:()=>Hh,fromToMotion:()=>An,getDocument:()=>bs,getMissCount:()=>Uh,getPath:()=>Qt,getRectConfig:()=>Ep,getWindow:()=>vs,groupAccumulativeValueProperty:()=>$c,groupAverage:()=>vc,groupBy:()=>us,groupCount:()=>bc,groupSum:()=>fc,injectStyle:()=>ks,isArray:()=>Nt,isBoolean:()=>Ot,isDate:()=>Rt,isDecoratedObject:()=>Ct,isDefined:()=>Tt,isEnumKey:()=>Kt,isEnumValue:()=>Yt,isEqual:()=>Vs,isFiniteNumber:()=>Wt,isFunction:()=>Bt,isHtmlElement:()=>Vt,isNegative:()=>Ks,isNumber:()=>jt,isObject:()=>Ft,isObjectLike:()=>zt,isPlainObject:()=>Gt,isProperties:()=>xe,isRegExp:()=>Pt,isString:()=>_t,isSymbol:()=>$t,isValidDate:()=>Et,jsonApply:()=>De,jsonDiff:()=>ve,jsonWalk:()=>ke,keyProperty:()=>jc,listDecoratedProperties:()=>Lt,mapIterable:()=>ms,mapValues:()=>Zt,markerFadeInAnimation:()=>Ku,markerPaletteFactory:()=>Tu,markerScaleInAnimation:()=>Yu,markerSwipeScaleInAnimation:()=>$u,mergeArrayDefaults:()=>Xt,mergeDefaults:()=>Ut,midpointStartingBarPosition:()=>zp,minMax:()=>qu,mod:()=>Hs,moduleRegistry:()=>St,normaliseGroupTo:()=>Cc,normalisePropertyTo:()=>Ac,normalisedExtent:()=>rs,normalisedExtentWithMetadata:()=>ls,pairCategoryData:()=>yp,pairContinuousData:()=>mp,partialAssign:()=>ee,pathFadeInAnimation:()=>np,pathFadeOutAnimation:()=>ap,pathSwipeInAnimation:()=>sp,pickByMatchingAngle:()=>Tg,predicateWithMessage:()=>za,prepareAreaPathAnimation:()=>kp,prepareAxisAnimationContext:()=>ul,prepareAxisAnimationFunctions:()=>ml,prepareBarAnimationFunctions:()=>Gp,prepareLinePathAnimation:()=>bp,prepareLinePathAnimationFns:()=>xp,prepareMarkerAnimation:()=>Xu,preparePieSeriesAnimationFunctions:()=>Lg,range:()=>xc,rangedValueProperty:()=>Vc,renderPartialPath:()=>ip,resetAxisGroupFn:()=>yl,resetAxisLabelSelectionFn:()=>xl,resetAxisLineSelectionFn:()=>bl,resetAxisSelectionFn:()=>fl,resetBarSelectionsFn:()=>_p,resetIds:()=>Ps,resetLabelFn:()=>Bu,resetMarkerFn:()=>Hu,resetMarkerPositionFn:()=>Uu,resetMotion:()=>gr,resetPieSelectionsFn:()=>Ag,round:()=>Ys,seriesLabelFadeInAnimation:()=>Eu,seriesLabelFadeOutAnimation:()=>Pu,setDocument:()=>Ds,setPath:()=>te,setWindow:()=>ws,shallowClone:()=>Me,singleSeriesPaletteFactory:()=>Au,staticFromToMotion:()=>Tn,stringify:()=>ja,sum:()=>yc,sumValues:()=>mc,toArray:()=>cs,toFixed:()=>$s,toTooltipHtml:()=>il,trailingAccumulatedValue:()=>kc,trailingAccumulatedValueProperty:()=>Yc,unique:()=>ds,updateClipPath:()=>rp,updateLabelNode:()=>Wp,updateRect:()=>Rp,validateCrossLineValues:()=>Xo,valueProperty:()=>Wc,without:()=>qt});var Km=class t{constructor(t,e,i,s,n,a,o,r,l,h,c){this.series=t,this.index=e,this.datum=i,this.size=s,this.colorValue=n,this.fill=a,this.stroke=o,this.sumSize=r,this.depth=l,this.parent=h,this.children=c,this.midPoint={x:0,y:0}}contains(t){let e=t;for(;null!=e&&e.index>=this.index;){if(e===this)return!0;e=e.parent}return!1}walk(e,i=t.Walk.PreOrder){i===t.Walk.PreOrder&&e(this),this.children.forEach(t=>{t.walk(e,i)}),i===t.Walk.PostOrder&&e(this)}*[Symbol.iterator](){yield this;for(const t of this.children)yield*k(t)}};Km.Walk={PreOrder:0,PostOrder:1};var Ym=Km,$m=class extends Xc{constructor(t){super({moduleCtx:t,pickModes:[0],contentGroupVirtual:!1}),this.rootNode=new Ym(this,0,void 0,0,void 0,void 0,void 0,0,void 0,void 0,[]),this.colorDomain=[0,0],this.maxDepth=0,this.animationState=new mr("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t&&this.animationState.transition("skip")}processData(){return S(this,null,function*(){var t,e;const{childrenKey:i,sizeKey:s,colorKey:n,fills:a,strokes:o,colorRange:r}=this.properties;let l=0,h=0,c=1/0,d=-1/0;const u=new Array((null!=(e=null==(t=this.data)?void 0:t.length)?e:0)+1).fill(void 0),p=(t,e)=>{const a=(l+=1,l),o=null!=e.depth?e.depth+1:0,r=null!=i?t[i]:void 0,p=null==r||0===r.length;let m=null!=s?t[s]:void 0;m=Number.isFinite(m)?Math.max(m,0):p?1:0;const y=m;h=Math.max(h,o);const f=null!=n?t[n]:void 0;return"number"==typeof f&&(u[a]=f,c=Math.min(c,f),d=Math.max(d,f)),g(new Ym(this,a,t,m,f,void 0,void 0,y,o,e,[]),r)},g=(t,e)=>(null==e||e.forEach(e=>{const i=p(e,t);t.children.push(i),t.sumSize+=i.sumSize}),t),m=g(new Ym(this,0,void 0,0,void 0,void 0,void 0,0,void 0,void 0,[]),this.data),y=[c,d];let f;null!=r&&Number.isFinite(c)&&Number.isFinite(d)&&(f=new Hp,f.domain=y,f.range=r,f.update()),m.children.forEach((t,e)=>{t.walk(t=>{let i;const s=u[t.index];null!=s&&(i=null==f?void 0:f.convert(s)),null!=i||(i=null==a?void 0:a[e%a.length]),t.fill=i,t.stroke=null==f?null==o?void 0:o[e%o.length]:"rgba(0, 0, 0, 0.2)"})}),this.rootNode=m,this.maxDepth=h,this.colorDomain=y})}update(t){return S(this,arguments,function*({seriesRect:t}){yield this.updateSelections(),yield this.updateNodes();const e=this.getAnimationData();this.checkResize(t)&&this.animationState.transition("resize",e),this.animationState.transition("update",e)})}resetAllAnimation(t){var e;const i=null==(e=this.animationResetFns)?void 0:e.datum;this.ctx.animationManager.stopByAnimationGroupId(this.id),null!=i&&gr(t.datumSelections,i)}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){var e;const i=null==(e=this.animationResetFns)?void 0:e.datum;null!=i&&gr([t],i)}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animationTransitionClear(){this.animationState.transition("clear",this.getAnimationData())}getAnimationData(){return{datumSelections:[this.groupSelection]}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}getLabelData(){return[]}getSeriesDomain(){return[NaN,NaN]}getLegendData(t){const{colorKey:e,colorName:i,colorRange:s,visible:n}=this.properties;return"gradient"===t&&null!=e&&null!=s?[{legendType:"gradient",enabled:n,seriesId:this.id,colorName:i,colorRange:s,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(t){return`${t.index}`}getDatumId(t){return this.getDatumIdFromData(t)}},Hm=class extends zd{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(Pe),this.strokes=Object.values(Be)}};b([Yn(Jn)],Hm.prototype,"childrenKey",2),b([Yn(Jn,{optional:!0})],Hm.prototype,"sizeKey",2),b([Yn(Jn,{optional:!0})],Hm.prototype,"colorKey",2),b([Yn(Jn,{optional:!0})],Hm.prototype,"colorName",2),b([Yn(ma)],Hm.prototype,"fills",2),b([Yn(ma)],Hm.prototype,"strokes",2),b([Yn(ma,{optional:!0})],Hm.prototype,"colorRange",2);var Um=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)}},Xm=0},26203(t,e,i){"use strict";i.d(e,{$1:()=>Le,$P:()=>_,$r:()=>ye,$z:()=>xe,AF:()=>ae,Am:()=>fe,Bf:()=>U,Bk:()=>mt,Bm:()=>q,Bq:()=>Re,By:()=>ut,CG:()=>jt,D$:()=>Pe,E2:()=>Ct,E3:()=>je,EG:()=>Se,EM:()=>Be,Et:()=>H,F4:()=>_e,FJ:()=>B,Fq:()=>$e,Fu:()=>de,GB:()=>He,GT:()=>Ue,GY:()=>re,Gv:()=>K,Hs:()=>Fe,I5:()=>ze,I_:()=>Jt,Ik:()=>Ot,Is:()=>F,J$:()=>Ut,Jp:()=>ce,KC:()=>Kt,Kg:()=>$,LV:()=>me,Ly:()=>Gt,MM:()=>Vt,MP:()=>ne,MX:()=>_t,O9:()=>Pt,OR:()=>ui,Qd:()=>Y,R3:()=>Xt,Rp:()=>Ce,S3:()=>Ge,Sc:()=>Et,Tn:()=>V,Uo:()=>Mt,Vy:()=>a,W$:()=>ft,Wp:()=>Ee,XK:()=>ve,Xe:()=>Wt,Xl:()=>Z,YE:()=>N,YI:()=>Zt,YO:()=>wt,YX:()=>Ke,Yj:()=>Rt,Zd:()=>le,_9:()=>R,_L:()=>bt,ai:()=>Nt,bX:()=>Q,bk:()=>A,cI:()=>Ye,cy:()=>G,d1:()=>E,dY:()=>Yt,eW:()=>ii,eh:()=>qt,fN:()=>zt,fd:()=>vt,gd:()=>W,hR:()=>$t,hz:()=>ee,iN:()=>De,ie:()=>ct,is:()=>St,jO:()=>Ae,jj:()=>ge,jk:()=>Ht,lk:()=>ri,lp:()=>it,lt:()=>nt,mL:()=>ue,mw:()=>xt,n:()=>P,nF:()=>tt,nR:()=>f,nl:()=>Ie,nm:()=>Me,o3:()=>Xe,or:()=>kt,p6:()=>At,qE:()=>We,r1:()=>be,r4:()=>Ve,sA:()=>di,sX:()=>ai,sg:()=>J,sw:()=>Tt,sy:()=>y,t$:()=>ci,tf:()=>yt,uE:()=>X,v7:()=>we,vM:()=>z,vd:()=>j,wW:()=>oi,wi:()=>oe,xA:()=>ke,yI:()=>gt,yW:()=>Lt,zM:()=>It,zk:()=>O});var s=Object.defineProperty,n=(t,e)=>{for(var i in e)s(t,i,{get:e[i],enumerable:!0})},a={};n(a,{error:()=>h,errorOnce:()=>p,log:()=>r,logGroup:()=>m,reset:()=>g,table:()=>c,warn:()=>l,warnOnce:()=>u});var o=new Set;function r(...t){console.log(...t)}function l(t,...e){console.warn(`AG Charts - ${t}`,...e)}function h(t,...e){"object"==typeof t?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)}function c(...t){console.table(...t)}function d(t,e,i){let s;s=t instanceof Error?t.message:"string"==typeof t?t:"object"==typeof t?JSON.stringify(t):String(t);const n=`${e}: ${s}`;o.has(n)||(i(t),o.add(n))}function u(t,...e){d(t,"Logger.warn",t=>l(t,...e))}function p(t,...e){d(t,"Logger.error",t=>h(t,...e))}function g(){o.clear()}function m(t,e){console.groupCollapsed(t);try{return e()}finally{console.groupEnd()}}var y={};n(y,{detectChartDefinition:()=>D,getAxisModule:()=>w,getPresetModule:()=>I,getSeriesModule:()=>C,hasModule:()=>M,listModulesByType:()=>k,register:()=>b,registerMany:()=>v,reset:()=>S});var f=(t=>(t.Axis="axis",t.Chart="chart",t.Preset="preset",t.Plugin="plugin",t.Series="series",t))(f||{}),x=new Map;function b(t){const e=x.get(t.name);if(e&&(e.enterprise||!t.enterprise))throw new Error(`AG Charts - Module '${t.name}' already registered`);x.set(t.name,t)}function v(t){for(const e of t)b(e)}function S(){x.clear()}function M(t){return x.has(t)}function*k(t){for(const e of x.values())L(t,e)&&(yield e)}function D(t){for(const e of x.values())if(L("chart",e)&&e.detect(t))return e;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function w(t){const e=x.get(t);if(L("axis",e))return e}function I(t){const e=x.get(t);if(L("preset",e))return e}function C(t){const e=x.get(t);if(L("series",e))return e}function L(t,e){return e?.type===t}var A=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),0===i.size&&this.events.delete(t))}emit(t,e){this.events.get(t)?.forEach(t=>t(e))}clear(t){t?this.events.delete(t):this.events.clear()}},T={};function N(t){return t?T.document?.[t]:T.document}function O(t){return t?T.window?.[t]:T.window}function R(t){T.document=t}function E(t){T.window=t}function P(t,e,i){const s=N().createElement(t);if("object"==typeof e&&(i=e,e=void 0),e)for(const t of e.split(" "))s.classList.add(t);return i&&Object.assign(s.style,i),s}function B(t){return N().createElementNS("http://www.w3.org/2000/svg",t)}function F(t,e){const i=N("body"),s=P("a",{display:"none"});s.href=t,s.download=e,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}function z(t){return null!=t}function G(t){return Array.isArray(t)}function _(t){return t instanceof Date}function j(t){return _(t)&&!isNaN(Number(t))}function W(t){return t instanceof RegExp}function V(t){return"function"==typeof t}function K(t){return"object"==typeof t&&null!==t&&!G(t)}function Y(t){return"object"==typeof t&&null!==t&&"Object"===t.constructor?.name}function $(t){return"string"==typeof t}function H(t){return"number"==typeof t}function U(t){return Number.isFinite(t)}function X(t){return"undefined"!=typeof window&&t instanceof HTMLElement}function Z(t,e){return Object.values(t).includes(e)}function q(t){return"symbol"==typeof t}function Q(t,e){return t in e}function J(t,e=0,i){const{leading:s=!1,trailing:n=!0,maxWait:a=1/0}=i??{};let o,r;if(a<e)throw new Error("Value of maxWait cannot be lower than waitMs.");return Object.assign(function(...i){if(s&&!r)return r=Date.now(),o=setTimeout(()=>r=null,e),void t(...i);let l=e;if(a!==1/0&&r){const t=Date.now()-r;e>a-t&&(l=a-t)}clearTimeout(o),r??(r=Date.now()),o=setTimeout(()=>{r=null,n&&t(...i)},l)},{cancel(){clearTimeout(o),r=null}})}function tt(t,e,i){const{leading:s=!0,trailing:n=!0}=i??{};let a,o,r=!1;function l(){n&&o?(a=setTimeout(l,e),t(...o)):r=!1,o=null}return Object.assign(function(...i){r?o=i:(r=!0,a=setTimeout(l,e),s?t(...i):o=i)},{cancel(){clearTimeout(a),r=!1,o=null}})}function et(t,e,i=""){try{return t(...e)}catch(t){u("Uncaught exception in user callback"+(i?` \`${i}\``:""),t)}}function it(t,e="and",i=String,s=1/0){if(0===t.length)return"";if(1===t.length)return i(t[0]);const n=(t=t.map(i)).pop();if(t.length>=s){const i=t.length-(s-1);return`${t.slice(0,s-1).join(", ")}, and ${i} more ${e} ${n}`}return`${t.join(", ")} ${e} ${n}`}function st(t,e=1/0){if("number"==typeof t){if(isNaN(t))return"NaN";if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity"}const i=JSON.stringify(t)??typeof t;return i.length>e?`${i.slice(0,e)}... (+${i.length-e} characters)`:i}function nt(t){let e=1;for(let i=0;i<t.length;i++)10===t.charCodeAt(i)&&e++;return e}function at(t,e){if(t===e)return 0;const[i,s]=t.length<e.length?[t,e]:[e,t],n=i.length,a=s.length;let o=new Array(n+1).fill(0).map((t,e)=>e),r=new Array(n+1);for(let t=1;t<=a;t++){r[0]=t;for(let e=1;e<=n;e++){const n=s[t-1]===i[e-1]?0:1;r[e]=Math.min(o[e]+1,r[e-1]+1,o[e-1]+n)}[o,r]=[r,o]}return o[n]}"undefined"!=typeof window?T.window=window:"undefined"!=typeof globalThis&&(T.window=globalThis.window),"undefined"!=typeof document?T.document=document:"undefined"!=typeof globalThis&&(T.document=globalThis.document);var ot=Symbol("description"),rt=Symbol("required"),lt=Symbol("marked"),ht=Symbol("undocumented"),ct=Symbol("union"),dt=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["nodeClick","seriesNodeClick"],["nodeDoubleClick","seriesNodeDoubleClick"],["src","url"]].reduce((t,e)=>{for(const i of e)t.set(i.toLowerCase(),new Set(e.filter(t=>t!==i)));return t},new Map),ut=(t=>(t.Invalid="invalid",t.Required="required",t.Unknown="unknown",t))(ut||{});function pt(t,e){return U(e)?`${t}[${e}]`:t?`${t}.${e}`:e}var gt=class{constructor(t,e,i,s,n){this.type=t,this.description=e,this.value=i,this.path=s,this.key=n}setUnionType(t,e){if(this.path.startsWith(e)){const i=this.path.slice(e.length);this.altPath=`${e}[type=${t}]${i}`}}getPrefix(){const{altPath:t=this.path,key:e}=this;return t||e?`Option \`${e?pt(t,e):t}\``:"Value"}toString(){const{description:t="unknown",type:e,value:i}=this;return"required"===e&&null==i?`${this.getPrefix()} is required and has not been provided; expecting ${t}, ignoring.`:`${this.getPrefix()} cannot be set to \`${st(i,50)}\`; expecting ${t}, ignoring.`}},mt=class extends gt{constructor(t,e,i,s){super("unknown",void 0,e,i,s),this.suggestions=t,this.key=s}getPrefix(){return`Unknown option \`${pt(this.path,this.key)}\``}getPostfix(){const t=it(function(t,e,i=2){const s=[],n=t.toLowerCase(),a=dt.get(n);for(const t of e){const e=t.toLowerCase();(a?.has(t)||e.includes(n)||at(n,e)<=i)&&s.push(t)}return s}(this.key,this.suggestions),"or",t=>`\`${t}\``);return t?`; Did you mean ${t}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function yt(t,e,i=""){if(!K(t))return{cleared:null,invalid:[new gt("required","an object",t,i)]};const s={},n=[],a=new Set(Object.keys(t)),o=[];if(ct in e){const a=Object.keys(e),o=e[ct];if(null!=t.type&&a.includes(t.type)||null==t.type&&null!=o){const{type:a=o,...r}=t,l=yt(r,e[a],i);Object.assign(s,{type:a},l.cleared);for(const t of l.invalid)t.setUnionType(a,i);n.push(...l.invalid)}else{const e=it(a,"or",t=>`'${t}'`);n.push(new gt("required",`a keyword such as ${e}`,t.type,i,"type"))}return{cleared:s,invalid:n}}for(const r of Object.keys(e)){const l=e[r],h=l[rt],c=t[r];if(a.delete(r),void 0===c&&(l[ht]||o.push(r),!h))continue;const d=pt(i,r);if(V(l)){const e=l(c,{options:t,path:d});if("object"==typeof e){if(n.push(...e.invalid),e.valid){s[r]=e.cleared;continue}if(qt(e.invalid,d))continue}else if(e){s[r]=c;continue}n.push(new gt(h?"required":"invalid",l[ot],c,i,r))}else{const t=yt(c,l,d);null!=t.cleared&&(s[r]=t.cleared),n.push(...t.invalid)}}for(const e of a){const s=t[e];void 0!==s&&n.push(new mt(o,s,i,e))}return{cleared:s,invalid:n}}function ft(t,e){return Object.assign(V(t)?(e,i)=>t(e,i):{...t},{[ot]:e})}function xt(t){return Object.assign(V(t)?(e,i)=>t(e,i):vt(t),{[rt]:!0,[ot]:t[ot]})}function bt(t){return Object.assign(V(t)?(e,i)=>t(e,i):vt(t),{[ht]:!0,[ot]:t[ot]})}var vt=(t,e="an object")=>ft((e,i)=>{const s=yt(e,t,i.path);return{valid:!qt(s.invalid,i.path),cleared:s.cleared,invalid:s.invalid}},e),St=(t,e,i)=>({...t,[ot]:e,[ct]:i}),Mt=(...t)=>ft((e,i)=>{const s=[];for(const n of t){const t=n(e,i);if("object"==typeof t){if(s.push(...t.invalid),!t.valid)return{valid:!1,cleared:e,invalid:s};e=t.cleared}else if(!t)return!1}return{valid:!0,cleared:e,invalid:s}},t.map(t=>t[ot]).filter(Boolean).join(" and ")),kt=(...t)=>ft((e,i)=>{for(const s of t){const t=s(e,i);if("object"==typeof t?t.valid:t)return t}return!1},t.map(t=>t[ot]).filter(Boolean).join(" or ")),Dt=t=>U(t)||j(t),wt=ft(G,"an array"),It=ft(function(t){return"boolean"==typeof t},"a boolean"),Ct=ft(V,"a function"),Lt=ft(function(t){return $(t)&&("none"===t||null!=function(t){const e=O("Option"),{style:i}=new e;return i.color=t,i.color||null}(t))},"a color string"),At=ft(t=>_(t)||(U(t)||$(t))&&j(new Date(t)),"a date"),Tt=ft(z,"a defined value"),Nt=ft(U,"a number"),Ot=ft(K,"an object"),Rt=ft($,"a string"),Et=ft(t=>"undefined"==typeof HTMLElement||t instanceof HTMLElement,"an html element"),Pt=(t,e=1/0)=>{let i;return i=e===1/0?`an array of at least ${t} items`:t===e?`an array of exactly ${t} items`:0===t?`an array of no more than ${e} items`:`an array of at least ${t} and no more than ${e} items`,ft(i=>G(i)&&i.length>=t&&i.length<=e,i)},Bt=(t,e=1/0)=>{let i;return i=e===1/0?`a string of at least ${t} characters`:t===e?`an string of exactly ${t} characters`:0===t?`an string of no more than ${e} characters`:`an string of at least ${t} and no more than ${e} characters`,ft(i=>$(i)&&i.length>=t&&i.length<=e,i)},Ft=(t,e=!0)=>ft(i=>U(i)&&(i>t||e&&i===t),`a number greater than ${e?"or equal to ":""}${t}`),zt=(t,e)=>ft(i=>U(i)&&i>=t&&i<=e,`a number between ${t} and ${e} inclusive`),Gt=Ft(0),_t=Ft(0,!1),jt=zt(0,1),Wt=t=>ft((e,{options:i})=>!Dt(e)||!Dt(i[t])||e<i[t],`the value to be less than \`${t}\``),Vt=t=>ft((e,{options:i})=>!Dt(e)||!Dt(i[t])||e>i[t],`the value to be greater than \`${t}\``);function Kt(...t){return K(t[0])&&(t=Object.values(t[0])),ft(e=>t.includes(e),`a keyword such as ${it(t,"or",t=>`'${t}'`)}`)}var Yt=t=>ft(e=>t===e,`the value ${JSON.stringify(t)}`),$t=(t,e)=>ft(e=>e instanceof t,e??`an instance of ${t.name}`),Ht=(t,e,i=!0)=>ft((e,s)=>{if(!G(e))return!1;let n=i;const a=[],o=[],r=t=>n=i?n&&t:n||t;if(0===e.length)return{valid:!0,cleared:a,invalid:o};for(let i=0;i<e.length;i++){const l=e[i],h=t(l,{options:l,path:`${s.path}[${i}]`});"object"==typeof h?(n=r(h.valid),o.push(...h.invalid),null!=h.cleared&&a.push(h.cleared)):(n=r(h),h&&a.push(l))}return{valid:n,cleared:n||!i?a:null,invalid:o}},e??`${t[ot]} array`),Ut=(t,e="an object array")=>ft((e,i)=>{if(!G(e))return!1;const s=[],n=[];for(let a=0;a<e.length;a++){const o=`${i.path}[${a}]`,r=yt(e[a],t,o);qt(r.invalid,o)||s.push(r.cleared),n.push(...r.invalid)}return{valid:!0,cleared:s,invalid:n}},e),Xt=(t,e)=>ft((i,s)=>!!V(i)&&(lt in i||{valid:!0,cleared:Object.assign((...n)=>{const a=et(i,n);if(null==a)return;const o=t(a,{options:a,path:""});if("object"==typeof o){if(o.invalid.forEach(Qt(s,e??t[ot])),o.valid)return o.cleared}else{if(o)return a;u(`Callback \`${s.path}\` returned an invalid value \`${st(a,50)}\`; expecting ${e??t[ot]}, ignoring.`)}},{[lt]:!0}),invalid:[]}),"a function"),Zt=(t,e="an object")=>ft((i,s)=>!!V(i)&&(lt in i||{valid:!0,cleared:Object.assign((...n)=>{const a=et(i,n,s.path);if(null==a)return;const o=yt(a,t);return o.invalid.forEach(Qt(s,e)),o.cleared},{[lt]:!0}),invalid:[]}),"a function");function qt(t,e){return t.some(t=>"required"===t.type&&t.path===e)}function Qt(t,e){return i=>{if(i instanceof mt)return u(`Callback \`${t.path}\` returned an unknown property \`${pt(i.path,i.key)}\`${i.getPostfix()}`);const s=st(i.value,50);u(i.key?`Callback \`${t.path}\` returned an invalid property \`${pt(i.path,i.key)}\`: \`${s}\`; expecting ${i.description}, ignoring.`:`Callback \`${t.path}\` returned an invalid value \`${s}\`; expecting ${e??i.description}, ignoring.`)}}var Jt=t=>{if(!K(t))return!1;const e=Object.keys(t);return 1===e.length&&e[0].startsWith("$")},te=vt({color:Lt,stop:jt},""),ee=ft(t=>{let e=-1/0;for(const i of t)if(null!=i?.stop){if(i.stop<e)return!1;e=i.stop}return!0},"color stops to be defined in ascending order"),ie=Mt(Pt(2),Ht(te),ee),se=Kt("axis","item","series"),ne=vt({type:xt(Yt("gradient")),colorStops:xt(ie),rotation:Nt,gradient:bt(Kt("linear","radial","conic")),bounds:bt(se),reverse:bt(It)},"a gradient object with color stops"),ae={stroke:Lt,strokeWidth:Gt,strokeOpacity:jt},oe=vt({type:xt(Yt("gradient")),gradient:xt(Kt("linear","radial","conic")),bounds:xt(se),colorStops:xt(kt(ie,Mt(Pt(2),Ht(Lt)))),rotation:xt(Nt),reverse:xt(It)}),re=vt({type:xt(Yt("pattern")),pattern:xt(Kt("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:Bt(2),width:xt(Gt),height:xt(Gt),fill:xt(Lt),fillOpacity:xt(jt),backgroundFill:xt(Lt),backgroundFillOpacity:xt(jt),padding:xt(Gt),rotation:xt(Nt),scale:xt(Gt),stroke:xt(Lt),strokeWidth:xt(Gt),strokeOpacity:xt(jt)}),le=vt({type:xt(Yt("image")),url:Rt,width:Gt,height:Gt,rotation:xt(Nt),backgroundFill:xt(Lt),backgroundFillOpacity:jt,fit:xt(Kt("stretch","contain","cover")),repeat:xt(Kt("repeat","repeat-x","repeat-y","no-repeat"))}),he=St({gradient:{colorStops:ie,rotation:Nt,gradient:bt(Kt("linear","radial","conic")),bounds:bt(se),reverse:bt(It)},pattern:{pattern:Kt("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:Bt(2),width:Gt,height:Gt,rotation:Nt,scale:Gt,fill:Lt,fillOpacity:jt,backgroundFill:Lt,backgroundFillOpacity:jt,...ae,padding:bt(Gt)},image:{url:xt(Rt),backgroundFill:Lt,backgroundFillOpacity:jt,width:Gt,height:Gt,fit:Kt("stretch","contain","cover","none"),repeat:Kt("repeat","repeat-x","repeat-y","no-repeat"),rotation:Nt}},"a color object"),ce=kt(Lt,vt(he,"a color object")),de={fill:ce,fillOpacity:jt};de.fillGradientDefaults=bt(oe),de.fillPatternDefaults=bt(re),de.fillImageDefaults=bt(le);var ue={lineDash:Ht(Gt),lineDashOffset:Nt},pe=vt({googleFont:Rt},"google font"),ge=kt(Rt,Jt,pe,Ht(kt(Rt,pe))),me={color:Lt,fontFamily:ge,fontSize:Gt,fontStyle:Kt("normal","italic","oblique"),fontWeight:kt(Gt,Kt("normal","bold","bolder","lighter"))};function ye(t){return void 0===t?[]:Array.isArray(t)?t:[t]}function fe(t){return Array.from(new Set(t))}function xe(t,e){return t.reduce((t,i)=>{const s=e(i);return t[s]??(t[s]=[]),t[s].push(i),t},{})}function be(t,e){if(null==t||null==e||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(Array.isArray(t[i])&&Array.isArray(e[i])){if(!be(t[i],e[i]))return!1}else if(t[i]!==e[i])return!1;return!0}function ve(t,e,i=0){if(0===t.length)return[];const s=[];for(let n=0;n<e;n++)s.push(t.at((n+i)%t.length));return s}function Se(t,e){const i=new Map;return e.forEach((t,e)=>{i.set(t,e)}),t.sort((t,e)=>(i.get(t)??1/0)-(i.get(e)??1/0))}function Me(t,e){let i=0;for(;i<t.length&&e(t[i]);)i+=1;const s=i;0!==s&&t.splice(0,s)}function ke(t,e){let i=t.length-1;for(;i>=0&&e(t[i]);)i-=1;const s=t.length-1-i;0!==s&&t.splice(t.length-s,s)}var De=class{constructor(){this.queue=[]}await(t=50){return new Promise(e=>{const i=()=>{clearTimeout(s),e(!0)},s=setTimeout(()=>{const t=this.queue.indexOf(i);t<0||(this.queue.splice(t,1),e(!1))},t);this.queue.push(i)})}notify(){this.queue.splice(0).forEach(t=>t())}};function we(t=0){return new Promise(e=>{setTimeout(e,t)})}function*Ie(...t){for(const e of t)yield*e}function Ce(t){return null!=t&&"object"==typeof t&&Symbol.iterator in t?t:[t]}function Le(t){for(const e of t)return e;throw new Error("AG Charts - no first() value found")}function*Ae(t){const e=[void 0,void 0];for(const i of Object.keys(t))e[0]=i,e[1]=t[i],yield e}function Te(t){return"true"===t}function Ne(t){return t}var Oe={role:Ne,"aria-checked":Te,"aria-controls":Ne,"aria-describedby":Ne,"aria-disabled":Te,"aria-expanded":Te,"aria-haspopup":Ne,"aria-hidden":Te,"aria-label":Ne,"aria-labelledby":Ne,"aria-live":Ne,"aria-orientation":Ne,"aria-selected":Te,"data-focus-override":Te,"data-focus-visible-override":Te,"data-preventdefault":Te,class:Ne,for:Ne,id:Ne,tabindex:function(t){return Number(t)},title:Ne,placeholder:Ne};function Re(t,e,i){null==i||""===i||""===i?t?.removeAttribute(e):t?.setAttribute(e,i.toString())}function Ee(t,e){if(null!=e)for(const[i,s]of Ae(e))"class"!==i&&Re(t,i,s)}function Pe(t,e,i){if(!(t instanceof HTMLElement))return;const s=t.getAttribute(e);return null===s?i:Oe[e]?.(s)??void 0}function Be(t,e,i){null!=t&&(null==i?t.style.removeProperty(e):t.style.setProperty(e,i.toString()))}function Fe(t,e){for(const[i,s]of Ae(e))Be(t,i,s)}function ze(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 Ge(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 _e(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2),a=i(n);null==a?e=n-1:(s=a,t=n+1)}return s}function je(t,e){const i=Math.max(t.length,e.length),s=new Set,n=new Set;for(let a=0;a<i;a++){const i=t[a],o=e[a];i!==o&&(n.has(o)?n.delete(o):o&&s.add(o),s.has(i)?s.delete(i):i&&n.add(i))}return{changed:s.size>0||n.size>0,added:s,removed:n}}function We(t,e,i){return Math.min(i,Math.max(t,e))}function Ve(t,e,i=1e-10){return t>=e[0]-i&&t<=e[1]+i}function Ke(t,e,i=1e-10){return t===e||Math.abs(t-e)<i}function Ye(t){return-1===Math.sign(t)||Object.is(t,-0)}function $e(t){return t%1==0}function He(t,e=2){const i=10**e;return Math.round(t*i)/i}function Ue(t,e){return Math.floor(t%e+(t<0?Math.abs(e):0))}function Xe(t){if(Math.floor(t)===t)return 0;let e=String(t),i=0;if(t<1e-6||t>=1e21){let t;[e,t]=e.split("e"),null!=t&&(i=Number(t))}const s=e.split(".")[1]?.length??0;return Math.max(s-i,0)}function Ze(t){return Array.isArray(t)&&t.length>=2&&t.every(U)}function qe(t){return Array.isArray(t)&&t.length>=2&&t.every(Ze)}function Qe(t){const e=t[0],i=t[t.length-1];return Ke(e[0],i[0],.001)&&Ke(e[1],i[1],.001)}function Je(t){return Array.isArray(t)&&t.every(qe)&&t.every(Qe)}function ti(t){if(null===t)return!0;if(!K(t)||null==t.type)return!1;const{type:e,coordinates:i}=t;switch(e){case"GeometryCollection":return Array.isArray(t.geometries)&&t.geometries.every(ti);case"MultiPolygon":return Array.isArray(i)&&i.every(Je);case"Polygon":return Je(i);case"MultiLineString":return Array.isArray(i)&&i.every(qe);case"LineString":case"MultiPoint":return qe(i);case"Point":return Ze(i);default:return!1}}function ei(t){return K(t)&&"Feature"===t.type&&ti(t.geometry)}var ii=ft(function(t){return K(t)&&"FeatureCollection"===t.type&&Array.isArray(t.features)&&t.features.every(ei)},"a GeoJSON object"),si=new Map,ni=(Symbol("ElementID"),1);function ai(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=(si.get(i)??0)+1;return si.set(i,s),`${i}-${s}`}function oi(){return"ag-charts-"+ni++}function ri(){return crypto.randomUUID?.()??function(){const t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=15&t[6]|64,t[8]=63&t[8]|128;let e="";for(let i=0;i<t.length;i++)4!==i&&6!==i&&8!==i&&10!==i||(e+="-"),e+=t[i].toString(16).padStart(2,"0");return e}()}var li=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,hi=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function ci(t){if(!$(t))return!1;const e=hi.exec(t);return li.test(e?e[2]:t)}function di(t){let e,i;const s=hi.exec(t);s&&([,e,t,i]=s);const n=li.exec(t);if(!n)throw new Error(`The number formatter is invalid: ${t}`);const[,a,o,r,l,h,c,d,u,p,g]=n;return{fill:a,align:o,sign:r,symbol:l,zero:h,width:parseInt(c),comma:d,precision:parseInt(u),trim:Boolean(p),type:g,prefix:e,suffix:i}}function ui(t){const e="string"==typeof t?di(t):t,{fill:i,align:s,sign:n="-",symbol:a,zero:o,width:r,comma:l,type:h,prefix:c="",suffix:d="",precision:u}=e;let{trim:p}=e;const g=null==u||isNaN(u);let m,y;if(h)if(h in gi&&h in pi)m=g?pi[h]:gi[h];else if(h in gi)m=gi[h];else{if(!(h in pi))throw new Error(`The number formatter type is invalid: ${h}`);m=pi[h]}else m=gi.g,p=!0;return y=g?h?6:12:u,t=>{let e=m(t,y);return p&&(e=e.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")),l&&(e=function(t,e){let i=t.indexOf(".");i<0&&(i=t.length);const s=t.substring(0,i).split(""),n=t.substring(i);for(let t=s.length-3;t>0;t-=3)s.splice(t,0,e);return`${s.join("")}${n}`}(e,l)),e=function(t,e,i=""){if("("===i)return t>=0?e:`(${e})`;return`${t>=0?"+"===i?"+":"":"−"}${e}`}(t,e,n),a&&"#"!==a&&(e=`${a}${e}`),"#"===a&&"x"===h&&(e=`0x${e}`),"s"===h&&(e=`${e}${function(t){return fi[bi(t)]}(t)}`),"%"!==h&&"p"!==h||(e=`${e}%`),null==r||isNaN(r)||(e=function(t,e,i=" ",s=">"){let n=t;if(">"!==s&&s){if("<"===s)n=n.padEnd(e,i);else if("^"===s){const t=Math.max(0,e-n.length),s=Math.ceil(t/2),a=Math.floor(t/2);n=n.padStart(s+n.length,i),n=n.padEnd(a+n.length,i)}}else n=n.padStart(e,i);return n}(e,r,i??o,s)),e=`${c}${e}${d}`,e}}var pi={b:t=>xi(t).toString(2),c:t=>String.fromCharCode(t),d:t=>Math.round(Math.abs(t)).toFixed(0),o:t=>xi(t).toString(8),x:t=>xi(t).toString(16),X:t=>pi.x(t).toUpperCase(),n:t=>pi.d(t),"%":t=>`${xi(100*t).toFixed(0)}`},gi={e:(t,e)=>Math.abs(t).toExponential(e),E:(t,e)=>gi.e(t,e).toUpperCase(),f:(t,e)=>Math.abs(t).toFixed(e),F:(t,e)=>gi.f(t,e).toUpperCase(),g:(t,e)=>{if(0===t)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i));return s>=-4&&s<e?i.toFixed(e-1-s):i.toExponential(e-1)},G:(t,e)=>gi.g(t,e).toUpperCase(),n:(t,e)=>gi.g(t,e),p:(t,e)=>gi.r(100*t,e),r:(t,e)=>{if(0===t)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i))-(e-1);if(s<=0)return i.toFixed(-s);const n=10**s;return(Math.round(i/n)*n).toFixed()},s:(t,e)=>{const i=bi(t);return gi.r(t/10**i,e)},"%":(t,e)=>gi.f(100*t,e)},mi=-24,yi=24,fi={[mi]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"µ",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[yi]:"Y"};function xi(t){return Math.floor(Math.abs(t))}function bi(t){return We(-24,t?3*Math.floor(Math.log10(Math.abs(t))/3):0,24)}},85255(t,e,i){"use strict";i.d(e,{hF:()=>ZR});var s=i(45401),n=i(26203),a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,r=(t,e,i,s)=>{for(var n,r=s>1?void 0:s?o(e,i):e,l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s?n(e,i,r):n(r))||r);return s&&r&&a(e,i,r),r},l=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility="5d41402abc4b2a76b9719d911017c592"!=this.md5("hello")}md5cycle(t,e){let i=t[0],s=t[1],n=t[2],a=t[3];i=this.ff(i,s,n,a,e[0],7,-680876936),a=this.ff(a,i,s,n,e[1],12,-389564586),n=this.ff(n,a,i,s,e[2],17,606105819),s=this.ff(s,n,a,i,e[3],22,-1044525330),i=this.ff(i,s,n,a,e[4],7,-176418897),a=this.ff(a,i,s,n,e[5],12,1200080426),n=this.ff(n,a,i,s,e[6],17,-1473231341),s=this.ff(s,n,a,i,e[7],22,-45705983),i=this.ff(i,s,n,a,e[8],7,1770035416),a=this.ff(a,i,s,n,e[9],12,-1958414417),n=this.ff(n,a,i,s,e[10],17,-42063),s=this.ff(s,n,a,i,e[11],22,-1990404162),i=this.ff(i,s,n,a,e[12],7,1804603682),a=this.ff(a,i,s,n,e[13],12,-40341101),n=this.ff(n,a,i,s,e[14],17,-1502002290),s=this.ff(s,n,a,i,e[15],22,1236535329),i=this.gg(i,s,n,a,e[1],5,-165796510),a=this.gg(a,i,s,n,e[6],9,-1069501632),n=this.gg(n,a,i,s,e[11],14,643717713),s=this.gg(s,n,a,i,e[0],20,-373897302),i=this.gg(i,s,n,a,e[5],5,-701558691),a=this.gg(a,i,s,n,e[10],9,38016083),n=this.gg(n,a,i,s,e[15],14,-660478335),s=this.gg(s,n,a,i,e[4],20,-405537848),i=this.gg(i,s,n,a,e[9],5,568446438),a=this.gg(a,i,s,n,e[14],9,-1019803690),n=this.gg(n,a,i,s,e[3],14,-187363961),s=this.gg(s,n,a,i,e[8],20,1163531501),i=this.gg(i,s,n,a,e[13],5,-1444681467),a=this.gg(a,i,s,n,e[2],9,-51403784),n=this.gg(n,a,i,s,e[7],14,1735328473),s=this.gg(s,n,a,i,e[12],20,-1926607734),i=this.hh(i,s,n,a,e[5],4,-378558),a=this.hh(a,i,s,n,e[8],11,-2022574463),n=this.hh(n,a,i,s,e[11],16,1839030562),s=this.hh(s,n,a,i,e[14],23,-35309556),i=this.hh(i,s,n,a,e[1],4,-1530992060),a=this.hh(a,i,s,n,e[4],11,1272893353),n=this.hh(n,a,i,s,e[7],16,-155497632),s=this.hh(s,n,a,i,e[10],23,-1094730640),i=this.hh(i,s,n,a,e[13],4,681279174),a=this.hh(a,i,s,n,e[0],11,-358537222),n=this.hh(n,a,i,s,e[3],16,-722521979),s=this.hh(s,n,a,i,e[6],23,76029189),i=this.hh(i,s,n,a,e[9],4,-640364487),a=this.hh(a,i,s,n,e[12],11,-421815835),n=this.hh(n,a,i,s,e[15],16,530742520),s=this.hh(s,n,a,i,e[2],23,-995338651),i=this.ii(i,s,n,a,e[0],6,-198630844),a=this.ii(a,i,s,n,e[7],10,1126891415),n=this.ii(n,a,i,s,e[14],15,-1416354905),s=this.ii(s,n,a,i,e[5],21,-57434055),i=this.ii(i,s,n,a,e[12],6,1700485571),a=this.ii(a,i,s,n,e[3],10,-1894986606),n=this.ii(n,a,i,s,e[10],15,-1051523),s=this.ii(s,n,a,i,e[1],21,-2054922799),i=this.ii(i,s,n,a,e[8],6,1873313359),a=this.ii(a,i,s,n,e[15],10,-30611744),n=this.ii(n,a,i,s,e[6],15,-1560198380),s=this.ii(s,n,a,i,e[13],21,1309151649),i=this.ii(i,s,n,a,e[4],6,-145523070),a=this.ii(a,i,s,n,e[11],10,-1120210379),n=this.ii(n,a,i,s,e[2],15,718787259),s=this.ii(s,n,a,i,e[9],21,-343485551),t[0]=this.add32(i,t[0]),t[1]=this.add32(s,t[1]),t[2]=this.add32(n,t[2]),t[3]=this.add32(a,t[3])}cmn(t,e,i,s,n,a){return e=this.add32(this.add32(e,t),this.add32(s,a)),this.add32(e<<n|e>>>32-n,i)}ff(t,e,i,s,n,a,o){return this.cmn(e&i|~e&s,t,e,n,a,o)}gg(t,e,i,s,n,a,o){return this.cmn(e&s|i&~s,t,e,n,a,o)}hh(t,e,i,s,n,a,o){return this.cmn(e^i^s,t,e,n,a,o)}ii(t,e,i,s,n,a,o){return this.cmn(i^(e|~s),t,e,n,a,o)}md51(t){const e=t.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=t.length;s+=64)this.md5cycle(i,this.md5blk(t.substring(s-64,s)));t=t.substring(s-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s<t.length;s++)n[s>>2]|=t.charCodeAt(s)<<(s%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,n),s=0;s<16;s++)n[s]=0;return n[14]=8*e,this.md5cycle(i,n),i}md5blk(t){const e=[];for(let i=0;i<64;i+=4)e[i>>2]=t.charCodeAt(i)+(t.charCodeAt(i+1)<<8)+(t.charCodeAt(i+2)<<16)+(t.charCodeAt(i+3)<<24);return e}rhex(t){const e="0123456789abcdef".split("");let i="",s=0;for(;s<4;s++)i+=e[t>>8*s+4&15]+e[t>>8*s&15];return i}hex(t){for(let e=0;e<t.length;e++)t[e]=this.rhex(t[e]);return t.join("")}md5(t){return this.hex(this.md51(t))}add32(t,e){return this.ieCompatibility?this.add32Compat(t,e):this.add32Std(t,e)}add32Std(t,e){return t+e&4294967295}add32Compat(t,e){const i=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(i>>16)<<16|65535&i}};function h(t){return null==t||0===t.length}var c={"01":"GRID","02":"CHARTS","0102":"BOTH"},d="https://www.ag-grid.com/charts/licensing/",u=class t{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new l,this.md5.init()}validateLicense(){const e=this.getLicenseDetails(t.licenseKey,t.gridContext),i=`AG ${"BOTH"===e.currentLicenseType?"Grid and ":""}Charts Enterprise`;let s="";if("BOTH"===e.suppliedLicenseType?s="AG Grid and AG Charts Enterprise":"GRID"===e.suppliedLicenseType?s="AG Grid Enterprise":void 0!==e.suppliedLicenseType&&(s="AG Charts Enterprise"),e.missing)this.isWebsiteUrl()&&!this.isForceWatermark()||this.outputMissingLicenseKey(i);else if(e.expired){const i=t.getChartsReleaseDate(),n=t.formatDate(i);this.outputExpiredKey(e.expiry,n,s)}else e.valid?e.isTrial&&e.trialExpired&&this.outputExpiredTrialKey(e.expiry,i,s):this.outputInvalidLicenseKey(!!e.incorrectLicenseType,i,s)}static extractExpiry(e){const i=e.substring(e.lastIndexOf("_")+1,e.length);return new Date(parseInt(t.decode(i),10))}static extractLicenseComponents(e){let i=e.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),e.length<=32)return{md5:null,license:e,version:null,isTrial:null};const s=i.length-32,n=i.substring(s),a=i.substring(0,s),[o,r,l]=t.extractBracketedInformation(i);return{md5:n,license:a,version:o,isTrial:r,type:l}}getLicenseDetails(e,i=!1){const s="CHARTS";if(h(e))return{licenseKey:e,valid:!1,missing:!0,currentLicenseType:s};const n=t.getChartsReleaseDate(),{md5:a,license:o,version:r,isTrial:l,type:d}=t.extractLicenseComponents(e);let u,p,g,m=a===this.md5.md5(o)&&-1===e.indexOf("For_Trialing_ag-Grid_Only"),y=null,f=!1;if(m&&(y=t.extractExpiry(o),m=!isNaN(y.getTime()),m))switch(p=n>y,r){case"legacy":case"2":m=!1;break;case"3":h(d)?m=!1:(g=d,d!==c["02"]&&d!==c["0102"]?(m=!1,f=!0):l&&(u=y<new Date,p=void 0))}return m?{licenseKey:e,valid:m,expiry:t.formatDate(y),expired:p,version:r,isTrial:l,trialExpired:u,invalidLicenseTypeForCombo:i?"BOTH"!==g:void 0,incorrectLicenseType:f,currentLicenseType:s,suppliedLicenseType:g}:{licenseKey:e,valid:m,incorrectLicenseType:f,currentLicenseType:s,suppliedLicenseType:g}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isE2ETest()&&!this.isWebsiteUrl()&&!h(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getHostname(){if(!this.document)return"localhost";const t=this.document.defaultView??window;if(!t)return"localhost";const e=t.location,{hostname:i=""}=e;return i}isForceWatermark(){if(!this.document)return!1;const t=this.document?.defaultView??"undefined"!=typeof window?window:void 0;if(!t)return!1;const{pathname:e}=t.location;return!!e&&-1!==e.indexOf("forceWatermark")}isWebsiteUrl(){const t=this.getHostname();return null!==/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(t)}isLocalhost(){const t=this.getHostname();return null!==/^(?:127\.0\.0\.1|localhost)$/.exec(t)}isE2ETest(){const t=this.getHostname();return null!==/^(?:172\.17\.0\.1|host\.docker\.internal)$/.exec(t)}static formatDate(t){const e=t.getDate(),i=t.getMonth(),s=t.getFullYear();return e+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][i]+" "+s}static getChartsReleaseDate(){return new Date(parseInt(t.decode(t.RELEASE_INFORMATION),10))}static decode(e){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s,n,a,o,r,l,h,c="",d=0;const u=e.replace(/[^A-Za-z0-9+/=]/g,"");for(;d<u.length;)o=i.indexOf(u.charAt(d++)),r=i.indexOf(u.charAt(d++)),l=i.indexOf(u.charAt(d++)),h=i.indexOf(u.charAt(d++)),s=o<<2|r>>4,n=(15&r)<<4|l>>2,a=(3&l)<<6|h,c+=String.fromCharCode(s),64!=l&&(c+=String.fromCharCode(n)),64!=h&&(c+=String.fromCharCode(a));return c=t.utf8_decode(c),c}static utf8_decode(t){t=t.replace(/rn/g,"n");let e="";for(let i=0;i<t.length;i++){const s=t.charCodeAt(i);s<128?e+=String.fromCharCode(s):s>127&&s<2048?(e+=String.fromCharCode(s>>6|192),e+=String.fromCharCode(63&s|128)):(e+=String.fromCharCode(s>>12|224),e+=String.fromCharCode(s>>6&63|128),e+=String.fromCharCode(63&s|128))}return e}static setGridContext(e=!1){t.gridContext=e}static setLicenseKey(e){t.licenseKey=e}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const e=t.match(/\[(.*?)\]/g).map(t=>t.replace("[","").replace("]",""));if(!e||0===e.length)return["legacy",!1,void 0];const i=1===e.filter(t=>"TRIAL"===t).length,s=e.filter(t=>t.startsWith("v"))[0];return[s?s.replace("v",""):"legacy",i,c[e.filter(t=>c[t])[0]]]}centerPadAndOutput(t){const e=this.totalMessageLength-t.length;console.error(t.padStart(e/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,e="*",i=""){console.error(t.padEnd(this.totalMessageLength-i.length,e)+i)}outputInvalidLicenseKey(e,i,s){t.gridContext||(e?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${s} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${d}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${d}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(e,i,s){t.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${s} expired on ${e}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(e){t.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${e} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${e} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(e,i,s){t.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${s} released before ${e}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};u.RELEASE_INFORMATION="MTc0OTAyMzU3MDQyNA==",u.gridContext=!1;var p=u;function g(t,e,i){const s=(e,i,s,n)=>{let a=t[0];for(let o=e;s>0?o<=i:o>i;o+=s){const e=t[o];if(n(a,e))return!0;a=e}return!1},n=Math.floor(t.length/2);return!!s(e,n,e,i)||s(t.length-e,n,-e,i)}var{AxisInterval:m,Property:y}=s.n1,f=class extends m{};r([y],f.prototype,"minSpacing",2);var{BaseProperties:x,ChartAxisDirection:b,Property:v,Group:S}=s.n1,M=class extends x{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};r([v],M.prototype,"enabled",2),r([v],M.prototype,"text",2),r([v],M.prototype,"fontStyle",2),r([v],M.prototype,"fontWeight",2),r([v],M.prototype,"fontSize",2),r([v],M.prototype,"fontFamily",2),r([v],M.prototype,"padding",2),r([v],M.prototype,"color",2),r([v],M.prototype,"parallel",2);var k=class extends x{constructor(){super(...arguments),this.id=(0,n.sX)(this),this.defaultColorRange=[],this.shape="polygon",this.label=new M,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=b.Angle,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new S({name:this.id}),this.rangeGroup=new S({name:this.id}),this.labelGroup=new S({name:this.id}),this._isRange=void 0}assignCrossLineGroup(t,e){t!==this._isRange&&(t?this.rangeGroup.appendChild(e):this.lineGroup.appendChild(e)),this._isRange=t}setSectorNodeProps(t){t.fill=this.fill,t.fillOpacity=this.fillOpacity??1,t.stroke=this.stroke,t.strokeOpacity=this.strokeOpacity??1,t.strokeWidth=this.strokeWidth??1,t.lineDash=this.lineDash}setLabelNodeProps(t,e,i,s,n){const{label:a}=this;t.x=e,t.y=i,t.text=a.text,t.textAlign="center",t.textBaseline=s,t.rotation=n,t.rotationCenterX=e,t.rotationCenterY=i,t.fill=a.color,t.fontFamily=a.fontFamily,t.fontSize=a.fontSize,t.fontStyle=a.fontStyle,t.visible=!0}};r([v],k.prototype,"enabled",2),r([v],k.prototype,"type",2),r([v],k.prototype,"range",2),r([v],k.prototype,"value",2),r([v],k.prototype,"defaultColorRange",2),r([v],k.prototype,"fill",2),r([v],k.prototype,"fillOpacity",2),r([v],k.prototype,"stroke",2),r([v],k.prototype,"strokeWidth",2),r([v],k.prototype,"strokeOpacity",2),r([v],k.prototype,"lineDash",2),r([v],k.prototype,"shape",2),r([v],k.prototype,"label",2);var{ChartAxisDirection:D,getCrossLineValue:w,validateCrossLineValue:I,normalizeAngle360:C,Group:L,Path:A,Sector:T,RotatableText:N,ContinuousScale:O}=s.n1,R=class extends k{constructor(){super(),this.direction=D.Angle,this.polygonNode=new A,this.sectorNode=new T,this.lineNode=new A,this.crossLineRange=new L,this.labelNode=new N,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!O.is(this.scale))return!0;const[t,e]=this.scale.domain,i=w(this);if((0,n.cy)(i)){const[s,n]=i;return s>=t&&s<=e&&n>=s&&n<=e}return i>=t&&i<=e}update(t){const{scale:e}=this;if(!e||!I(w(this),e)||!this.visibilityCheck())return this.rangeGroup.visible=!1,this.lineGroup.visible=!1,void(this.labelGroup.visible=!1);this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateLineNode(t),this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t)}updateLineNode(t){const{scale:e,type:i,value:s,lineNode:n}=this;if(!t||"line"!==i||!e)return void(n.visible=!1);const a=e.convert(s);if(isNaN(a))return void(n.visible=!1);const{axisInnerRadius:o,axisOuterRadius:r}=this;n.visible=!0,n.stroke=this.stroke,n.strokeOpacity=this.strokeOpacity??1,n.strokeWidth=this.strokeWidth??1,n.fill=void 0,n.lineDash=this.lineDash;const l=r*Math.cos(a),h=r*Math.sin(a),c=o*Math.cos(a),d=o*Math.sin(a);n.path.clear(!0),n.path.moveTo(c,d),n.path.lineTo(l,h),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(t){const{polygonNode:e,range:i,scale:s,shape:n,type:a,ticks:o}=this;if(!t||"range"!==a||"polygon"!==n||!s||!i)return void(e.visible=!1);const{axisInnerRadius:r,axisOuterRadius:l}=this,h=o.indexOf(i[0]),c=o.indexOf(i[1]),d=(h<=c?o.slice(h,c+1):o.slice(h).concat(o.slice(0,c+1))).map(t=>s.convert(t));e.visible=!0,this.setSectorNodeProps(e);const{path:u}=e;u.clear(!0),d.forEach((t,e)=>{const i=l*Math.cos(t),s=l*Math.sin(t);0===e?u.moveTo(i,s):u.lineTo(i,s)}),0===r?u.lineTo(0,0):d.slice().reverse().forEach(t=>{const e=r*Math.cos(t),i=r*Math.sin(t);u.lineTo(e,i)}),e.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(t){const{sectorNode:e,range:i,scale:n,shape:a,type:o}=this;if(!t||"range"!==o||"circle"!==a||!n||!i)return void(e.visible=!1);const{axisInnerRadius:r,axisOuterRadius:l}=this,h=i.map(t=>n.convert(t)),c=n.step??0,d=n instanceof s.n1.BandScale?c/2:0;e.visible=!0,this.setSectorNodeProps(e),e.centerX=0,e.centerY=0,e.innerRadius=r,e.outerRadius=l,e.startAngle=h[0]-d,e.endAngle=h[1]+d,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(t){const{label:e,labelNode:i,range:s,scale:a,type:o,ticks:r}=this;if(!t||!1===e.enabled||!e.text||!a||"range"===o&&!s)return void(i.visible=!1);i.visible=!0;const{axisInnerRadius:l,axisOuterRadius:h}=this;let c,d,u,p;if("line"===o){const t=C(a.convert(this.value)),i=1.5*Math.PI,s=(0,n.YX)(t,i)||t>i||t<Math.PI/2,o=(l+h)/2*Math.cos(t),r=(l+h)/2*Math.sin(t);c=o+e.padding*Math.cos(t+Math.PI/2),d=r+e.padding*Math.sin(t+Math.PI/2),p=s?"top":"bottom",u=s?t:t-Math.PI}else{const[t,i]=s.map(t=>C(a.convert(t)));let o=(t+i)/2;t>i&&(o-=Math.PI),o=C(o);const l=((0,n.YX)(o,0)||o>0)&&o<Math.PI;let g;g="circle"===this.shape||r.length<3?h-e.padding:h*Math.cos(Math.PI/r.length)-e.padding,c=g*Math.cos(o),d=g*Math.sin(o),p=l?"bottom":"top",u=l?o-Math.PI/2:o+Math.PI/2}this.setLabelNodeProps(i,c,d,p,u)}};R.className="AngleCrossLine";var{ChartAxisDirection:E,TextWrapper:P,TextUtils:B,Property:F,toRadians:z,normalizeAngle360:G,normalizeAngle360Inclusive:_,Path:j,RotatableText:W,Transformable:V,BBox:K,Selection:Y,Line:$}=s.n1,H=class extends s.n1.AxisLabel{constructor(){super(...arguments),this.orientation="fixed"}};r([F],H.prototype,"orientation",2);var U=class extends s.n1.PolarAxis{constructor(t,e){super(t,e),this.startAngle=0,this.endAngle=void 0,this.tickLineGroupSelection=Y.select(this.tickLineGroup,$,!1),this.gridLineGroupSelection=Y.select(this.gridLineGroup,$,!1),this.labelData=[],this.tickData=[],this.radiusLineGroup=this.axisGroup.appendChild(new s.n1.TransformableGroup),this.radiusLine=this.radiusLineGroup.appendChild(new j),this.includeInvisibleDomains=!0}get direction(){return E.Angle}createLabel(){return new H}calculateRotations(){const t=z(this.startAngle);return{rotation:t,parallelFlipRotation:G(t),regularFlipRotation:G(t-Math.PI/2)}}calculateTickLayout(t){const{nice:e,scale:i}=this,s={nice:e,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},a=e?i.niceDomain(s,t):t,o=this.generateAngleTicks(a);this.tickData=o;const r=o.map(t=>t.value),l=r.reduce((t,e)=>Math.max("number"==typeof e?(0,n.o3)(e):0,t),0);return{niceDomain:a,tickDomain:a,ticks:r,rawTickCount:void 0,fractionDigits:l,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const t=G(-Math.PI/2+z(this.startAngle));return[t,t+(null!=this.endAngle?_(z(this.endAngle)-z(this.startAngle)):2*Math.PI)]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const t=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?t:[]),this.tickLineGroupSelection.update(this.tick.enabled?t:[]),this.tickLabelGroupSelection.update(this.label.enabled?t:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:t,radiusLineGroup:e}=this,i=Math.floor(t.x),s=Math.floor(t.y);e.translationX=i,e.translationY=s}updateRadiusLine(){const t=this.radiusLine,{path:e}=t;e.clear(!0);const{points:i,closePath:s}=this.getAxisLinePoints();i.forEach(({x:t,y:i,moveTo:s,arc:n,radius:a=0,startAngle:o=0,endAngle:r=0})=>{n?e.arc(t,i,a,o,r):s?e.moveTo(t,i):e.lineTo(t,i)}),s&&e.closePath(),t.visible=this.line.enabled,t.stroke=this.line.stroke,t.strokeWidth=this.line.width,t.fill=void 0}getAxisLinePoints(){const{scale:t,shape:e,gridLength:i}=this,[s,a]=this.range,o=(0,n.YX)(a-s,2*Math.PI),r=[];if("circle"===e)o?r.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):r.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:G(s),endAngle:G(a),arc:!0,moveTo:!1});else if("polygon"===e){const e=t.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(e=>t.convert(e));e&&e.length>2&&e.forEach((t,e)=>{const s=i*Math.cos(t),n=i*Math.sin(t),a=0===e;r.push({x:s,y:n,moveTo:a})})}return{points:r,closePath:o}}updateGridLines(){const{scale:t,gridLength:e,gridLine:{style:i,width:s},innerRadiusRatio:n}=this;if(!(i&&e>0))return;const a=e*n,o=i.length;this.gridLineGroupSelection.each((n,r,l)=>{const{value:h}=r,{stroke:c,lineDash:d}=i[l%o],u=t.convert(h);n.x1=a*Math.cos(u),n.y1=a*Math.sin(u),n.x2=e*Math.cos(u),n.y2=e*Math.sin(u),n.stroke=c,n.strokeWidth=s,n.lineDash=d,n.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:t,tickLabelGroupSelection:e}=this;e.each((e,i,s)=>{const n=this.labelData[s];n&&!n.hidden?(e.text=n.text,e.setFont(t),e.fill=t.color,e.x=n.x,e.y=n.y,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline,e.visible=!0,n.rotation?(e.rotation=n.rotation,e.rotationCenterX=n.x,e.rotationCenterY=n.y):e.rotation=0):e.visible=!1})}updateTickLines(){const{scale:t,gridLength:e,tick:i,tickLineGroupSelection:s}=this;s.each((s,n)=>{const{value:a}=n,o=t.convert(a),r=Math.cos(o),l=Math.sin(o);s.x1=e*r,s.y1=e*l,s.x2=(e+i.size)*r,s.y2=(e+i.size)*l,s.stroke=i.stroke,s.strokeWidth=i.width})}createLabelNodeData(t,e,i){const{label:s,gridLength:a,scale:o,tick:r}=this;if(!s.enabled)return[];const l=new W,h=i.x-this.translation.x,c=i.x+i.width-this.translation.x,d=t.map((i,d)=>{const{value:u}=i,p=a+s.spacing+r.size,g=o.convert(u),m=p*Math.cos(g),y=p*Math.sin(g),{textAlign:f,textBaseline:x}=this.getLabelAlign(g),b=d===t.length-1&&u!==t[0]&&(0,n.YX)(G(g),G(o.convert(t[0]))),v=this.getLabelRotation(g);let S=this.formatTick(u,d,o.domain);l.text=S,l.x=m,l.y=y,l.setFont(s),l.textAlign=f,l.textBaseline=x,l.rotation=v,v&&(l.rotationCenterX=m,l.rotationCenterY=y);let M=v?V.toCanvas(l):l.getBBox();if(M&&e.hideWhenNecessary&&!v){const t=h-M.x,e=M.x+M.width-c,i=1;if(t>i||e>i){const i=M.width-Math.max(t,e);S=P.wrapText(S,{maxWidth:i,font:s,textWrap:"never"}),S===B.EllipsisChar&&(S=""),l.text=S,M=l.getBBox()}}return{text:S,x:m,y,textAlign:f,textBaseline:x,hidden:""===S||i.hidden||b,rotation:v,box:M}});return s.avoidCollisions&&this.avoidLabelCollisions(d),d}computeLabelsBBox(t,e){this.labelData=this.createLabelNodeData(this.tickData,t,e);const i=this.labelData.map(({box:t})=>t).filter(t=>null!=t);return this.label.enabled&&0!==i.length?K.merge(i):null}getLabelOrientation(){const{label:t}=this;return t instanceof H?t.orientation:"fixed"}getLabelRotation(t){let e=z(this.label.rotation??0);t=G(t);const i=this.getLabelOrientation();return"parallel"===i?(e+=t,t>=0&&t<Math.PI?e-=Math.PI/2:e+=Math.PI/2):"perpendicular"===i&&(e+=t,t>=Math.PI/2&&t<1.5*Math.PI&&(e+=Math.PI)),e}getLabelAlign(t){const e=Math.cos(t),i=Math.sin(t);let s,a;const o=this.getLabelOrientation(),r=(0,n.YX)(e,0),l=(0,n.YX)(i,0),h=(0,n.YX)(e,1),c=(0,n.YX)(i,-1),d=e>0&&!r,u=i>0&&!l;return"parallel"===o?(s="center",a=h&&l||u?"top":"bottom"):"perpendicular"===o?(s=c||d?"left":"right",a="middle"):(s="right",r?s="center":d&&(s="left"),a="bottom",l?a="middle":u&&(a="top")),{textAlign:s,textBaseline:a}}updateCrossLines(){const{shape:t,gridLength:e,innerRadiusRatio:i}=this;this.crossLines.forEach(s=>{s instanceof R&&(s.ticks=this.tickData.map(t=>t.value),s.shape=t,s.axisOuterRadius=e,s.axisInnerRadius=e*i)}),super.updateCrossLines()}};U.CrossLineConstructor=R,r([F],U.prototype,"startAngle",2),r([F],U.prototype,"endAngle",2);var{Property:X,CategoryScale:Z}=s.n1,q=class extends U{constructor(t){super(t,new Z),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new f}generateAngleTicks(){const{scale:t,gridLength:e}=this,{values:i,minSpacing:s}=this.interval,n=i??t.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks??[];if(n.length<2||null==s)return n.map(t=>({value:t,visible:!0}));const a=n[0],o=t.convert(a),r=e*Math.cos(o),l=e*Math.sin(o);for(let i=1;i<n.length-1;i++){const h=n[i],c=t.convert(h);if(c-o>Math.PI)break;const d=e*Math.cos(c),u=e*Math.sin(c);if(Math.sqrt((d-r)**2+(u-l)**2)>s){const t=new Set([a]);return g(n,i,(e,i)=>{t.add(i)}),n.map(e=>({value:e,visible:t.has(e)}))}}return[{value:a,visible:!0}]}avoidLabelCollisions(t){const{minSpacing:e}=this.label;if(t.length<3)return;const i=(t,i)=>{if(t.hidden||i.hidden)return!1;if(null==e)return t.box.collidesBBox(i.box);const s=t.box.clone().grow(e/2),n=i.box.clone().grow(e/2);return s.collidesBBox(n)},s=t[0],a=t.at(-1),o=new Set([s]),r=(0,n.YX)(s.x,a.x)&&(0,n.YX)(s.y,a.y),l=Math.floor(t.length/2);for(let e=1;e<=l;e++){const s=r?t.slice(0,-1):t;if(!g(s,e,i)){g(s,e,(t,e)=>{o.add(e)});break}}t.forEach(t=>{o.has(t)||(t.hidden=!0,t.box=void 0)})}};q.className="AngleCategoryAxis",q.type="angle-category",r([X],q.prototype,"groupPaddingInner",2),r([X],q.prototype,"paddingInner",2),r([X],q.prototype,"interval",2);var Q={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-category",moduleFactory:t=>new q(t)},{range:J,isDenseInterval:tt,LinearScale:et}=s.n1,it=class t extends et{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(t,e){const[i,s]=e;let n=et.getTickStep(i,s,t);const a=isNaN(t.maxTickCount)?1/0:t.maxTickCount,o=Math.abs(s-i)/n;let r=Math.pow(2,Math.ceil(Math.log(o)/Math.log(2)));return r>a&&(r/=2,n*=2),{count:r,step:n}}ticks(e,i=this.domain){const{arcLength:s}=this;if(!i||i.length<2||i.some(t=>!isFinite(t))||s<=0)return{ticks:[],count:0};const{nice:n,interval:a}=e,[o,r]=i;if(a){const t=Math.abs(a),e=this.getPixelRange();if(!tt((r-o)/t,e))return J(o,r,t)}let l;if(n&&this.hasNiceRange()){const s=super.niceDomain(e,i);l=t.getNiceStepAndTickCount(e,s).step}else l=et.getTickStep(o,r,e);return J(o,r,l)}hasNiceRange(){const t=this.range.slice().sort((t,e)=>t-e);return[Math.PI,2*Math.PI].some(e=>(0,n.YX)(e,t[1]-t[0]))}niceDomain(e,i=this.domain){const s=super.niceDomain(e,i);if(!this.hasNiceRange())return s;const n=s[0]>s[1],a=n?s[1]:s[0],{step:o,count:r}=t.getNiceStepAndTickCount(e,s),l=1/o,h=o>=1?Math.ceil(a/o+r)*o:Math.ceil((a+r*o)*l)/l;return n?[h,a]:[a,h]}getPixelRange(){return this.arcLength}},{Property:st,angleBetween:nt,normalisedExtentWithMetadata:at,findMinMax:ot}=s.n1,rt=class extends U{constructor(t){super(t,new it),this.shape="circle",this.interval=new f}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=at(t,e,i);return{domain:s,clipped:n}}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:t}=this,e=Math.min(...t),i=Math.max(...t);return(nt(e,i)||2*Math.PI)*this.gridLength}generateAngleTicks(t){const{scale:e,range:i,nice:s}=this,{values:n,step:a,minSpacing:o,maxSpacing:r}=this.interval;let l;if(null==n){const{arcLength:n}=e,h=r?Math.floor(n/r):1,c=o?Math.floor(n/o):1/0,d=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),u={nice:s,interval:a,tickCount:Math.max(h,Math.min(c,d)),minTickCount:h,maxTickCount:c};l=e.ticks(u,t)?.ticks??[]}else{const[e,i]=ot(t.map(Number));l=n.filter(t=>t>=e&&t<=i).sort((t,e)=>t-e)}return l.map(t=>({value:t,visible:!0}))}avoidLabelCollisions(t){const{minSpacing:e}=this.label,i=(t,i)=>{if(t.hidden||i.hidden)return!1;if(null==e)return t.box.collidesBBox(i.box);const s=t.box.clone().grow(e/2),n=i.box.clone().grow(e/2);return s.collidesBBox(n)},s=t[0],a=t.at(-1);s!==a&&(0,n.YX)(s.x,a.x)&&(0,n.YX)(s.y,a.y)&&(a.hidden=!0);for(let e=1;e<t.length;e*=2){let s=!1;for(let n=e;n<t.length;n+=e){const a=t[n];if(i(t[n-e],a)){s=!0;break}}if(!s)return void t.forEach((t,i)=>{i%e>0&&(t.hidden=!0,t.box=void 0)})}t.forEach((t,e)=>{e>0&&(t.hidden=!0,t.box=void 0)})}};rt.className="AngleNumberAxis",rt.type="angle-number",r([st],rt.prototype,"min",2),r([st],rt.prototype,"max",2),r([st],rt.prototype,"interval",2);var lt={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-number",moduleFactory:t=>new rt(t)},{OrdinalTimeScale:ht,Property:ct,TimeAxisParentLevel:dt}=s.n1,ut=class extends s.n1.CategoryAxis{constructor(t){super(t,new ht),this.parentLevel=new dt}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}};ut.className="OrdinalTimeAxis",ut.type="ordinal-time",r([ct],ut.prototype,"parentLevel",2);var pt={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ordinal-time",moduleFactory:t=>new ut(t)},{ChartAxisDirection:gt,Property:mt,getCrossLineValue:yt,validateCrossLineValue:ft,normalizeAngle360FromDegrees:xt,Group:bt,Path:vt,Sector:St,RotatableText:Mt}=s.n1,kt=class extends M{constructor(){super(...arguments),this.positionAngle=void 0}};r([mt],kt.prototype,"positionAngle",2);var Dt=class extends k{constructor(){super(),this.direction=gt.Radius,this.label=new kt,this.polygonNode=new vt,this.sectorNode=new St,this.crossLineRange=new bt,this.labelNode=new Mt,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(t){const{scale:e}=this;if(!e||!ft(yt(this),e))return this.rangeGroup.visible=!1,this.lineGroup.visible=!1,void(this.labelGroup.visible=!1);this.updateRadii();const{innerRadius:i,outerRadius:s}=this;t&&(t=i>=this.axisInnerRadius&&s<=this.axisOuterRadius),this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t),this.assignCrossLineGroup("range"===this.type,this.crossLineRange)}updateRadii(){const{range:t,scale:e,type:i,axisInnerRadius:s,axisOuterRadius:n}=this;if(!e)return{innerRadius:0,outerRadius:0};const a=t=>n+s-t;let o,r;if("line"===i)o=a(e.convert(this.value)),r=o;else{const i=Math.abs(e?.bandwidth??0),s=t.map(t=>e.convert(t));o=a(Math.max(...s)),r=a(Math.min(...s))+i}this.outerRadius=o,this.innerRadius=r}drawPolygon(t,e,i){e.forEach((e,s)=>{const n=t*Math.cos(e),a=t*Math.sin(e);0===s?i.path.moveTo(n,a):i.path.lineTo(n,a)}),i.path.closePath()}updatePolygonNode(t){const{gridAngles:e,polygonNode:i,scale:s,shape:n,type:a,innerRadius:o,outerRadius:r}=this;if(!t||"polygon"!==n||!s||!e)return void(i.visible=!1);i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,e,i);const h=e.slice().reverse(),c="line"===a?r-l:o+l;this.drawPolygon(c,h,i),this.setSectorNodeProps(i)}updateSectorNode(t){const{axisInnerRadius:e,axisOuterRadius:i,scale:s,sectorNode:a,shape:o,innerRadius:r,outerRadius:l}=this;if(!t||"circle"!==o||!s)return void(a.visible=!1);a.visible=!0,a.startAngle=0,a.endAngle=2*Math.PI;const h=this.getPadding(),c=(0,n.qE)(e,r+h,i),d=(0,n.qE)(e,l-h,i);a.innerRadius=Math.min(c,d),a.outerRadius=Math.max(c,d),this.setSectorNodeProps(a)}updateLabelNode(t){const{innerRadius:e,label:i,labelNode:s,scale:a,shape:o,type:r}=this;if(!t||!1===i.enabled||!i.text||!a)return void(s.visible=!1);const l=xt((i.positionAngle??0)-90),h=((0,n.YX)(l,0)||l>0)&&l<Math.PI,c=h?l-Math.PI/2:l+Math.PI/2;let d;const u=this.gridAngles??[];d="line"===r?e+i.padding:"circle"===o||u.length<3?e-i.padding:e*Math.cos(Math.PI/u.length)-i.padding;const p=d*Math.cos(l),g=d*Math.sin(l);let m;m="line"===r?h?"top":"bottom":h?"bottom":"top",this.setLabelNodeProps(s,p,g,m,c)}getPadding(){const{scale:t}=this;if(!t)return 0;const e=Math.abs(t.bandwidth??0),i=Math.abs(t.step??0);return t instanceof s.n1.BandScale?(i-e)/2:0}};Dt.className="RadiusCrossLine";var{ChartAxisDirection:wt,ZIndexMap:It,Property:Ct,normalizeAngle360:Lt,toRadians:At,Caption:Tt,Group:Nt,TransformableGroup:Ot,Path:Rt,Line:Et,Selection:Pt,AxisTickGenerator:Bt,AxisGroupZIndexMap:Ft}=s.n1,zt=class extends s.n1.AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};r([Ct],zt.prototype,"autoRotate",2),r([Ct],zt.prototype,"autoRotateAngle",2);var Gt=class extends s.n1.PolarAxis{constructor(t,e){super(t,e),this.positionAngle=0,this.gridLineGroupSelection=Pt.select(this.gridLineGroup,Et,!1),this.tickGenerator=new Bt(this),this.generatedTicks=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new Ot({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new Ot({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new Et({name:`${this.id}-Axis-line`,zIndex:Ft.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new Nt({name:`${this.id}-gridPaths`,zIndex:It.AXIS_GRID})),this.gridPathSelection=Pt.select(this.gridPathGroup,Rt),this.headingLabelGroup.appendChild(this.title.caption.node),this.destroyFns.push(this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}get direction(){return wt.Radius}getAxisTransform(){const t=this.scale.range[0],{translation:e,positionAngle:i,innerRadiusRatio:s}=this,n=t*s,a=At(i);return{translationX:e.x,translationY:e.y-t-n,rotation:a,rotationCenterX:0,rotationCenterY:t+n}}update(){super.update(),this.updateTitle(),this.updateGridLines();const{enabled:t,stroke:e,width:i}=this.line;this.lineNode.setProperties({stroke:e,strokeWidth:t?i:0,x1:0,y1:this.range[0],x2:0,y2:this.range[1]})}updatePosition(){super.updatePosition();const t=this.getAxisTransform();this.tickLineGroup.setProperties(t),this.tickLabelGroup.setProperties(t),this.lineNodeGroup.setProperties(t),this.headingLabelGroup.setProperties(t)}calculateRotations(){return{rotation:0,parallelFlipRotation:0,regularFlipRotation:-Math.PI/2}}calculateTickLayout(t,e,i){const s=-Math.PI/2,n=this.label.getSideFlag(),a=n*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),o=this.tickGenerator.generateTicks({domain:t,niceMode:e,visibleRange:[0,1],primaryTickCount:void 0,parallelFlipRotation:0,regularFlipRotation:s,labelX:a,sideFlag:n,removeOverflowLabels:!1}),{tickData:r}=o,{ticks:l,rawTicks:h,rawTickCount:c,tickDomain:d,fractionDigits:u,niceDomain:p=t}=r,g=l.map(t=>this.getTickLabelProps(t,o));return this.generatedTicks={ticks:l,labels:g},{ticks:h,tickDomain:d,niceDomain:p,rawTickCount:c,fractionDigits:u,timeInterval:void 0}}updateSelections(){const{generatedTicks:t}=this;if(!t)return;const{ticks:e,labels:i}=t;this.gridLineGroupSelection.update(this.gridLength?e:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(e):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const t=s.n1.resetAxisLabelSelectionFn();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",e.setProperties(t(e,i))})}updateGridLines(){const{gridLine:{style:t,width:e},shape:i,generatedTicks:s}=this;if(!t||!s)return;const a=t.length,[o,r]=this.gridRange??[0,2*Math.PI],l=(0,n.YX)(r-o,2*Math.PI),h="circle"===i?(t,e)=>{const{path:i}=t;i.clear(!0);const s=this.getTickRadius(e);l?(i.moveTo(s,0),i.arc(0,0,s,0,2*Math.PI)):(i.moveTo(s*Math.cos(o),s*Math.sin(o)),i.arc(0,0,s,Lt(o),Lt(r))),l&&i.closePath()}:(t,e)=>{const{path:i}=t,s=this.gridAngles;if(i.clear(!0),!s||s.length<3)return;const n=this.getTickRadius(e);s.forEach((t,e)=>{const a=n*Math.cos(t),o=n*Math.sin(t);0===e?i.moveTo(a,o):i.lineTo(a,o),s.forEach((t,e)=>{const s=n*Math.cos(t),a=n*Math.sin(t);0===e?i.moveTo(s,a):i.lineTo(s,a)}),i.closePath()}),i.closePath()};this.gridPathSelection.each((i,s,n)=>{((i,s)=>{const{stroke:n,lineDash:o}=t[s%a];i.stroke=n,i.strokeWidth=e,i.lineDash=o,i.fill=void 0})(i,n),h(i,s)})}updateTitle(){const t=t=>t.defaultValue,{title:e,range:i}=this,{formatter:s=t}=this.title;e.caption.enabled=e.enabled,e.caption.fontFamily=e.fontFamily,e.caption.fontSize=e.fontSize,e.caption.fontStyle=e.fontStyle,e.caption.fontWeight=e.fontWeight,e.caption.color=e.color,e.caption.wrapping=e.wrapping;let n=!1;const a=e.caption.node;e.enabled&&(n=!0,a.rotation=Math.PI/2,a.x=Math.floor((i[0]+i[1])/2),a.y=-Tt.SMALL_PADDING,a.textAlign="center",a.textBaseline="bottom",a.text=this.callWithContext(s,this.getTitleFormatterParams(this.scale.domain))),a.visible=n}updateCrossLines(){this.crossLines.forEach(t=>{if(t instanceof Dt){const{shape:e,gridAngles:i,range:s,innerRadiusRatio:n}=this,a=s[0];t.shape=e,t.gridAngles=i,t.axisOuterRadius=a,t.axisInnerRadius=a*n}}),super.updateCrossLines()}createLabel(){return new zt}getTickLabelProps(t,e){const{label:i}=this,{rotation:s,textBaseline:n,textAlign:a}=e,o=this.scale.range,r=t.tickLabel??"",l=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),h=""!==r&&null!=r,c=s;return{...this.getLabelStyles({value:t.tickLabel}),tickId:t.tickId,rotation:c,text:r,textAlign:a,textBaseline:n,visible:h,x:l,y:t.translationY,rotationCenterX:l,rotationCenterY:t.translationY,range:o}}};Gt.CrossLineConstructor=Dt,r([Ct],Gt.prototype,"positionAngle",2);var{ProxyPropertyOnWrite:_t,Property:jt,CategoryScale:Wt}=s.n1,Vt=class extends Gt{constructor(t){super(t,new Wt),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}normaliseDataDomain(t){return{domain:t,clipped:!1}}prepareGridPathTickData(t){return t.slice().reverse()}getTickRadius(t){const{scale:e,innerRadiusRatio:i}=this,s=e.range[0],n=s*i;if(Wt.is(e)){const i=e.domain,s=i.length-1-i.indexOf(t.tick);return 0===s?n:e.inset+e.step*(s-.5)+e.bandwidth/2}{const i=(s-n)/e.domain.length;return s-t.translationY+n-i/2}}};Vt.className="RadiusCategoryAxis",Vt.type="radius-category",r([jt],Vt.prototype,"groupPaddingInner",2),r([_t("scale","paddingInner"),jt],Vt.prototype,"paddingInner",2),r([_t("scale","paddingOuter"),jt],Vt.prototype,"paddingOuter",2);var Kt={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-category",moduleFactory:t=>new Vt(t)},{Property:Yt,normalisedExtentWithMetadata:$t,LinearScale:Ht}=s.n1,Ut=class extends Gt{constructor(t){super(t,new Ht),this.shape="polygon"}prepareGridPathTickData(t){const{scale:e}=this,i=e.domain[1];return t.filter(({tick:t})=>t!==i).sort((t,e)=>e.tick-t.tick)}getTickRadius(t){const{scale:e}=this,i=e.range[0],s=i*this.innerRadiusRatio;return i-t.translationY+s}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=$t(t,e,i);return{domain:s,clipped:n}}};Ut.className="RadiusNumberAxis",Ut.type="radius-number",r([Yt],Ut.prototype,"min",2),r([Yt],Ut.prototype,"max",2);var Xt={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-number",moduleFactory:t=>new Ut(t)},{ObserveChanges:Zt,Property:qt}=s.n1,Qt=class extends s.n1.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!0,t.animationManager.skip(!1),this.destroyFns.push(()=>{t.animationManager.skip(!0)})}};r([Zt((t,e)=>{t.ctx.animationManager.skip(!e)}),qt],Qt.prototype,"enabled",2),r([Zt((t,e)=>{t.ctx.animationManager.defaultDuration=e}),qt],Qt.prototype,"duration",2);var Jt={type:"root",optionsKey:"animation",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Qt(t),themeTemplate:{animation:{enabled:!0}}},{focusCursorAtEnd:te}=s.n1,ee="text-input",ie="canvas-overlay",se=class extends s.n1.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=t.domManager.addChild(ie,ee),this.element.classList.add("ag-charts-text-input"),this.destroyFns.push(()=>t.domManager.removeChild(ie,ee))}setKeyDownHandler(t){this.element.addEventListener("keydown",t),this.destroyFns.push(()=>this.element.removeEventListener("keydown",t))}show(t){this.element.innerHTML='<div contenteditable="plaintext-only" class="ag-charts-text-input__textarea" tabindex="0"></div>';const e=this.element.firstElementChild;(0,n.Bq)(e,"data-preventdefault",!1),e.isContentEditable||(e.contentEditable="true"),e.setAttribute("placeholder",this.ctx.localeManager.t(t.placeholderText??"inputTextareaPlaceholder")),t.styles?.placeholderColor&&e.style.setProperty("--placeholder-text-color",t.styles?.placeholderColor),e.innerText=t.text??"",e.style.color=t.styles?.color??"inherit",e.style.fontFamily=t.styles?.fontFamily??"inherit",e.style.fontSize=t.styles?.fontSize?`${t.styles.fontSize}px`:"inherit",e.style.fontStyle=t.styles?.fontStyle??"inherit",e.style.fontWeight="number"==typeof t.styles?.fontWeight?`${t.styles.fontWeight}`:t.styles?.fontWeight??"inherit",te(e),e.addEventListener("input",()=>{this.updatePosition(),t.onChange?.(this.getValue(),this.getBBox())}),e.addEventListener("click",t=>{t.stopPropagation()}),t.layout&&(this.layout=t.layout,this.updatePosition()),t.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(t){this.element.firstElementChild&&(this.element.firstElementChild.style.color=t)}updateFontSize(t){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${t}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:t}=this,e=t.firstElementChild;if(!e)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:s,getTextInputCoords:n,getTextPosition:a,alignment:o,textAlign:r}=this.layout;t.style.setProperty("width",s?`${s}px`:"unset");const l=e.getBoundingClientRect(),h=n(l.height);let c=h.x;"center"===o?c-=(s??l.width)/2:"right"===o&&(c-=s??l.width);const d=a();let u=h.y;"center"===d?u-=l.height/2:"bottom"===d&&(u-=l.height),t.style.setProperty("top",`${u}px`),t.style.setProperty("left",`${c}px`),t.style.setProperty("max-width",i.width-c+"px"),t.style.setProperty("text-align",o),e.style.setProperty("text-align",r)}getBBox(){const{left:t,top:e,width:i,height:n}=this.element.getBoundingClientRect();return new s.n1.BBox(t,e,i,n)}},{BaseProperties:ne,Property:ae}=s.n1,oe=class extends ne{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};r([ae],oe.prototype,"enabled",2),r([ae],oe.prototype,"axes",2);var re=(t=>(t.Line="line",t.HorizontalLine="horizontal-line",t.VerticalLine="vertical-line",t.DisjointChannel="disjoint-channel",t.ParallelChannel="parallel-channel",t.FibonacciRetracement="fibonacci-retracement",t.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",t.Callout="callout",t.Comment="comment",t.Note="note",t.Text="text",t.Arrow="arrow",t.ArrowUp="arrow-up",t.ArrowDown="arrow-down",t.DateRange="date-range",t.PriceRange="price-range",t.DatePriceRange="date-price-range",t.QuickDatePriceRange="quick-date-price-range",t))(re||{}),le=Object.values(re),{BaseProperties:he,Property:ce}=s.n1,de=class extends he{};r([ce],de.prototype,"x",2),r([ce],de.prototype,"y",2);var ue=class extends(Ne(Oe(Ae(he)))){},pe=class extends(Ne(Oe(Te(Ie(Re(he)))))){constructor(){super(...arguments),this.cornerRadius=2}};r([ce],pe.prototype,"enabled",2),r([ce],pe.prototype,"cornerRadius",2);var ge=class extends(Te(he)){},me=class extends(Ne(Oe(Te(he)))){},ye=class extends(Re(he)){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};r([ce],ye.prototype,"label",2),r([ce],ye.prototype,"position",2),r([ce],ye.prototype,"alignment",2);var fe=class extends(Re(he)){},xe=class extends(Re(he)){constructor(){super(...arguments),this.label=""}};function be(t){class e extends(function(t){class e extends t{}return r([ce],e.prototype,"locked",2),e}(Ae(t))){constructor(){super(...arguments),this.id=(0,n.lk)()}}return e}function ve(t){class e extends t{constructor(){super(...arguments),this.start=new de,this.end=new de}}return r([ce],e.prototype,"start",2),r([ce],e.prototype,"end",2),e}function Se(t){class e extends t{}return r([ce],e.prototype,"x",2),r([ce],e.prototype,"y",2),e}function Me(t){class e extends t{}return r([ce],e.prototype,"value",2),e}function ke(t){class e extends t{constructor(){super(...arguments),this.background=new ge}}return r([ce],e.prototype,"background",2),e}function De(t){class e extends t{constructor(){super(...arguments),this.handle=new me}}return r([ce],e.prototype,"handle",2),e}function we(t){class e extends t{constructor(){super(...arguments),this.axisLabel=new pe}}return r([ce],e.prototype,"axisLabel",2),e}function Ie(t){class e extends t{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return r([ce],e.prototype,"padding",2),r([ce],e.prototype,"textAlign",2),r([ce],e.prototype,"formatter",2),e}function Ce(t){class e extends t{}return r([ce],e.prototype,"extendStart",2),r([ce],e.prototype,"extendEnd",2),e}function Le(t){return class extends t{setLocaleManager(t){this.localeManager??(this.localeManager=t)}}}function Ae(t){class e extends t{}return r([ce],e.prototype,"visible",2),e}function Te(t){class e extends t{}return r([ce],e.prototype,"fill",2),r([ce],e.prototype,"fillOpacity",2),e}function Ne(t){class e extends t{}return r([ce],e.prototype,"stroke",2),r([ce],e.prototype,"strokeOpacity",2),r([ce],e.prototype,"strokeWidth",2),e}function Oe(t){class e extends t{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return r([ce],e.prototype,"lineDash",2),r([ce],e.prototype,"lineDashOffset",2),r([ce],e.prototype,"lineStyle",2),e}function Re(t){class e extends t{constructor(){super(...arguments),this.fontSize=12,this.fontFamily="Verdana, sans-serif"}}return r([ce],e.prototype,"fontStyle",2),r([ce],e.prototype,"fontWeight",2),r([ce],e.prototype,"fontSize",2),r([ce],e.prototype,"fontFamily",2),r([ce],e.prototype,"color",2),e}function Ee(t){return(0,n.Et)(t)||(0,n.Kg)(t)||(0,n.$P)(t)?{value:t,groupPercentage:0}:t??{value:void 0,groupPercentage:0}}function Pe(t){return Ee(t)?.value}r([ce],xe.prototype,"label",2),r([ce],xe.prototype,"position",2),r([ce],xe.prototype,"alignment",2);var{clampArray:Be}=s.n1;function Fe(t,e){if(null==t.start||null==t.end)return;const i=ze(t.start,e),s=ze(t.end,e);return null!=i&&null!=s?{x1:i.x,y1:i.y,x2:s.x,y2:s.y}:void 0}function ze(t,e){return{x:Ge(t.x,e.xAxis),y:Ge(t.y,e.yAxis)}}function Ge(t,e){if(null==t)return 0;const{value:i,groupPercentage:s}=Ee(t),{scale:n,snapToGroup:a}=e,o=0===n.bandwidth?n.step??0:n.bandwidth??0,r=a?o/2:o*s;return n.convert(i)+r}function _e(t,e){return{x:je(t.x,e.xAxis),y:je(t.y,e.yAxis)}}function je(t,e){const{scale:i}=e;if(e.continuous&&null==i.step)return e.scaleInvert(t);const s=e.scaleInvertNearest(t),n=0===i.bandwidth?i.step:i.bandwidth??0,a=i.convert(s),o=a+n,r=Be(t,i.range);return{value:s,groupPercentage:a===o?0:(r-a)/(o-a)}}var{BaseProperties:We}=s.n1,Ve=class extends(be(ve(De(We)))){constructor(){super(...arguments),this.snapToAngle=45}getDefaultColor(t){}getDefaultOpacity(t){}},{Property:Ke}=s.n1,Ye=class extends(Le(Ie(Re(Ve)))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(t){return this.color}getDefaultOpacity(t){}getPlaceholderColor(){}getPadding(){const{padding:t=0}=this;return{top:t,right:t,bottom:t,left:t}}getText(){const t=0==this.text.length;let e=this.text;return t&&(e=this.placeholderText??"",this.localeManager&&(e=this.localeManager.t(e))),{text:e,isPlaceholder:t}}getTextInputCoords(t,e){return ze(this.end,t)}getTextPosition(){return this.position}};r([Ke],Ye.prototype,"text",2);var{Property:$e,Color:He}=s.n1,Ue={top:6,right:12,bottom:9,left:12},Xe=class extends(Te(Ne(Ye))){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(t){return(0,n.Gv)(t)&&"callout"===t.type}getDefaultColor(t){switch(t){case"fill-color":return this.fill;case"line-color":return this.stroke;default:return this.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;default:return}}getPlaceholderColor(){const{r:t,g:e,b:i}=He.fromString(this.color??"#888888");return new He(t,e,i,.66).toString()}getPadding(){const{padding:t}=this;return null==t?{...Ue}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),s=this.getPadding(),n=s.left??0,a=s.bottom??0;return{x:i.x+n,y:i.y-a}}};r([$e],Xe.prototype,"type",2);var{BaseProperties:Ze,Property:qe}=s.n1,Qe=class extends(be(Se(De(Ie(Re(Ze)))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(t){return this.color}getDefaultOpacity(t){}getPlaceholderColor(){}getPadding(){const{padding:t=0}=this;return{top:t,right:t,bottom:t,left:t}}getText(){const t=0==this.text.length;return{text:t?this.placeholderText??"":this.text,isPlaceholder:t}}getTextInputCoords(t,e){return ze(this,t)}getTextPosition(){return this.position}};r([qe],Qe.prototype,"text",2);var{Property:Je,Color:ti}=s.n1,ei=class extends(Te(Ne(Qe))){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(t){return(0,n.Gv)(t)&&"comment"===t.type}getDefaultColor(t){switch(t){case"fill-color":return this.fill;case"line-color":return this.stroke;default:return this.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;default:return}}getPlaceholderColor(){const{r:t,g:e,b:i}=ti.fromString(this.color??"#888888");return new ti(t,e,i,.66).toString()}getPadding(){const{padding:t,fontSize:e}=this;return null==t?{top:Math.max(.4*e,8),bottom:Math.max(.4*e,8),left:Math.max(.8*e,14),right:Math.max(.8*e,14)}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),s=this.getPadding();return{x:i.x+s.left,y:i.y-s.bottom}}};r([Je],ei.prototype,"type",2);var{Vec2:ii}=s.n1;function si(t,e){return t?"dashed":e??"solid"}function ni(t,e){switch(e){case"solid":return[];case"dashed":return[4*t,2*t];case"dotted":return[0,2*t]}}function ai(t,e,i,s){const n=si(t,i);return e??t??ni(s??1,n)}function oi(t,e,i){const s=si(e,i);return t??"dotted"===s?"round":void 0}var{BaseProperties:ri,Property:li}=s.n1,hi=class extends(Ne(ri)){},ci=class extends(Re(Te(Ne(ri)))){constructor(){super(...arguments),this.divider=new hi}};r([li],ci.prototype,"divider",2);var di=class extends(Te(Ne(De(ri)))){constructor(){super(...arguments),this.statistics=new ci}};r([li],di.prototype,"statistics",2);var ui=class extends(Le(ke(Ne(Oe(Ve))))){constructor(){super(...arguments),this.direction="both",this.hasDateRange=!1,this.hasPriceRange=!1,this.statistics=new ci,this.getVolume=()=>{},this.text=new ye}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return ai(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};function pi(t){return class extends t{constructor(){super(...arguments),this.hasDateRange=!0}}}function gi(t){return class extends t{constructor(){super(...arguments),this.hasPriceRange=!0}}}r([li],ui.prototype,"statistics",2),r([li],ui.prototype,"text",2);var mi=class extends(pi(ui)){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(t){return(0,n.Gv)(t)&&"date-range"===t.type}};r([li],mi.prototype,"type",2),r([li],mi.prototype,"extendAbove",2),r([li],mi.prototype,"extendBelow",2);var yi=class extends(gi(ui)){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(t){return(0,n.Gv)(t)&&"price-range"===t.type}};r([li],yi.prototype,"type",2),r([li],yi.prototype,"extendLeft",2),r([li],yi.prototype,"extendRight",2);var fi=class extends(pi(gi(ui))){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(t){return(0,n.Gv)(t)&&"date-price-range"===t.type}};r([li],fi.prototype,"type",2);var xi=class extends(pi(gi(ui))){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new di,this.down=new di,this.direction="both"}static is(t){return(0,n.Gv)(t)&&"quick-date-price-range"===t.type}};r([li],xi.prototype,"type",2),r([li],xi.prototype,"up",2),r([li],xi.prototype,"down",2);var{TextWrapper:bi,CachedTextMeasurerPool:vi,BBox:Si}=s.n1,Mi=1.38;function ki(t){return{font:{fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},textAlign:t.textAlign,textBaseline:"center"==t.position?"middle":t.position,lineHeight:Mi,avoidOrphans:!1,textWrap:"always"}}function Di(t,e,i){return i?bi.wrapText(e,{...ki(t),maxWidth:i}):e}function wi(t,e,i,s){let n=s?.width??0,a=s?.height??0;if(!s){const i=null!=t.width?Di(t,e,t.width):e;({width:n,height:a}=function(t,e){const i=ki(t),{lineMetrics:s,width:n}=vi.measureLines(e,i);return{width:n,height:s.length*(t.fontSize??14)*Mi}}(t,i))}return new Si(i.x,i.y,n,a)}function Ii(t,e,i,s,{x:n,y:a},o){const{visible:r=!0,fontFamily:l,fontSize:h=14,fontStyle:c,fontWeight:d,textAlign:u}=s,p=h*Mi;o??(o="center"==s.position?"middle":s.position);const g=i?s.getPlaceholderColor():s.color;t.setProperties({x:n,y:a,visible:r,text:e,fill:g,fontFamily:l,fontSize:h,fontStyle:c,fontWeight:d,textAlign:u,lineHeight:p,textBaseline:o})}var{BaseProperties:Ci,Property:Li}=s.n1,Ai=class extends(Te(Ne(Ci))){},Ti=class extends(Te(Ne(Qe))){constructor(){super(...arguments),this.type="note",this.background=new Ai,this.position="bottom",this.alignment="center",this.width=200}static is(t){return(0,n.Gv)(t)&&"note"===t.type}getDefaultColor(t){switch(t){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(t){switch(t){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const t=this.padding??10;return{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const{width:i,text:s}=this,a=super.getTextInputCoords(t,e),o=this.getPadding().top,r=wi(this,s,a);r.x=(0,n.qE)(i/2,r.x,t.seriesRect.width-i/2);const l=r.y-30-2*o,h=r.y+11+2*o;return l-Math.max(r.height,e)-34<0?(r.y=h,this.position="top"):(r.y=l+o,this.position="bottom"),{x:r.x,y:r.y}}};r([Li],Ti.prototype,"type",2),r([Li],Ti.prototype,"background",2);var{BaseProperties:Ni}=s.n1,Oi=class extends(be(Se(De(Ni)))){getDefaultColor(t){}getDefaultOpacity(t){}},Ri=class t extends(Te(Oi)){constructor(){super(...arguments),this.size=32}static is(e){return e instanceof t}getDefaultColor(t){return"fill-color"===t?this.fill:void 0}getDefaultOpacity(t){return"fill-color"===t?this.fillOpacity:void 0}},{BaseProperties:Ei,Property:Pi}=s.n1,Bi=class extends(be(Me(De(we(Ne(Oe(Ei))))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new ye}static is(t){return(0,n.Gv)(t)&&"horizontal-line"===t.type}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return ai(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};r([Pi],Bi.prototype,"type",2),r([Pi],Bi.prototype,"text",2);var Fi=class extends(be(Me(De(we(Ne(Oe(Ei))))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new ye}static is(t){return(0,n.Gv)(t)&&"vertical-line"===t.type}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return ai(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};r([Pi],Fi.prototype,"type",2),r([Pi],Fi.prototype,"text",2);var{BaseProperties:zi,Property:Gi}=s.n1,_i=class extends(be(ke(ve(De(Ce(Ne(Oe(zi)))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new xe,this.snapToAngle=45}static is(t){return(0,n.Gv)(t)&&"disjoint-channel"===t.type}get bottom(){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return"number"==typeof t.start.y&&"number"==typeof t.end.y?(t.start.y-=this.startHeight,t.end.y-=this.endHeight):n.Vy.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return ai(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};r([Gi],_i.prototype,"type",2),r([Gi],_i.prototype,"startHeight",2),r([Gi],_i.prototype,"endHeight",2),r([Gi],_i.prototype,"text",2);var{Property:ji}=s.n1,Wi=class extends(Le(function(t){return class extends t{}}(Ce(Ne(Oe(Ve)))))){constructor(){super(...arguments),this.text=new ye}getDefaultColor(t){switch(t){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return ai(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};r([ji],Wi.prototype,"text",2);var Vi=class extends Wi{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(t){return(0,n.Gv)(t)&&"arrow"===t.type}};r([ji],Vi.prototype,"type",2);var Ki=class extends Wi{constructor(){super(...arguments),this.type="line"}static is(t){return(0,n.Gv)(t)&&"line"===t.type}};r([ji],Ki.prototype,"type",2);var{Property:Yi}=s.n1,$i=class extends Wi{constructor(){super(...arguments),this.label=new fe,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(t){switch(t){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};r([Yi],$i.prototype,"label",2),r([Yi],$i.prototype,"reverse",2),r([Yi],$i.prototype,"showFill",2),r([Yi],$i.prototype,"isMultiColor",2),r([Yi],$i.prototype,"strokes",2),r([Yi],$i.prototype,"rangeStroke",2),r([Yi],$i.prototype,"bands",2);var{Property:Hi}=s.n1,Ui=class extends $i{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new de}static is(t){return(0,n.Gv)(t)&&"fibonacci-retracement-trend-based"===t.type}};r([Hi],Ui.prototype,"type",2),r([Hi],Ui.prototype,"endRetracement",2);var{Property:Xi}=s.n1,Zi=class extends $i{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(t){return(0,n.Gv)(t)&&"fibonacci-retracement"===t.type}};r([Xi],Zi.prototype,"type",2);var{BaseProperties:qi,Property:Qi}=s.n1,Ji=class extends(be(ke(ve(De(Ce(Ne(Oe(qi)))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new ue,this.text=new xe,this.snapToAngle=45}static is(t){return(0,n.Gv)(t)&&"parallel-channel"===t.type}get bottom(){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return"number"==typeof t.start.y&&"number"==typeof t.end.y?(t.start.y-=this.height,t.end.y-=this.height):n.Vy.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return ai(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return oi(this.lineCap,this.lineDash,this.lineStyle)}};r([Qi],Ji.prototype,"type",2),r([Qi],Ji.prototype,"height",2),r([Qi],Ji.prototype,"middle",2),r([Qi],Ji.prototype,"text",2);var{Property:ts}=s.n1,es=class extends Qe{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(t){return(0,n.Gv)(t)&&"text"===t.type}};function is(t){return xi.is(t)}function ss(t){return Ki.is(t)||Bi.is(t)||Fi.is(t)||Vi.is(t)||as(t)}function ns(t){return _i.is(t)||Ji.is(t)}function as(t){return Zi.is(t)||Ui.is(t)}function os(t){return Xe.is(t)||ei.is(t)||Ti.is(t)||es.is(t)}function rs(t){return mi.is(t)||yi.is(t)||fi.is(t)||xi.is(t)}function ls(t){return os(t)&&!Ti.is(t)}function hs(t){return ss(t)||ns(t)||rs(t)&&!xi.is(t)}function cs(t){return ss(t)||ns(t)||rs(t)||Xe.is(t)||Ti.is(t)}function ds(t){return ns(t)||rs(t)||Xe.is(t)||ei.is(t)||Ri.is(t)}function us(t){return os(t)&&!Ti.is(t)}function ps(t){return(ss(t)||ns(t)||rs(t))&&!is(t)&&(0,n.Gv)(t.text)}function gs(t,e){"fontSize"in t&&(t.fontSize=e),ps(t)&&(t.text.fontSize=e)}function ms(t,e){const i=e?.strokeWidth??t.strokeWidth??1,s=e?.type??t.lineStyle,n=s??si(t.lineDash,s),a=ni(i,n);t.strokeWidth=i,t.computedLineDash=a,t.lineStyle=n,t.lineCap="dotted"===n?"round":void 0}function ys(t,e,i,s,n,a){switch(e){case"fill-color":"fill"in t&&(t.fill=s),"fillOpacity"in t&&(t.fillOpacity=n),"background"in t&&(t.background.fill=s,t.background.fillOpacity=n);break;case"line-color":"axisLabel"in t&&(t.axisLabel.fill=s,t.axisLabel.fillOpacity=n,t.axisLabel.stroke=s,t.axisLabel.strokeOpacity=n),"fill"in t&&"fillOpacity"in t&&function(t){return Ti.is(t)}(t)?(t.fill=s,t.fillOpacity=n):("strokeOpacity"in t&&(t.strokeOpacity=n),"isMultiColor"in t&&"rangeStroke"in t?(t.isMultiColor=a,t.rangeStroke=s):"stroke"in t&&(t.stroke=s));break;case"text-color":"color"in t&&(t.color=i),ps(t)&&(t.text.color=s)}}r([ts],es.prototype,"type",2);var{deepClone:fs}=s.n1,xs=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(re).map(t=>[t,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:fs(this.colors),fontSizes:fs(this.fontSizes),lineStyles:fs(this.lineStyles),lineTextAlignments:fs(this.lineTextAlignments),lineTextPositions:fs(this.lineTextPositions),fibonacciOptions:fs(this.fibonacciOptions)}}guardMemento(t){return!0}restoreMemento(t,e,i){this.colors=fs(i.colors),this.fontSizes=fs(i.fontSizes),this.lineStyles=fs(i.lineStyles),this.lineTextAlignments=fs(i.lineTextAlignments),this.lineTextPositions=fs(i.lineTextPositions),this.fibonacciOptions=fs(i.fibonacciOptions)}setDefaultColor(t,e,i,s,n,a){this.colors.get(t)?.set(e,[i,s,n,a])}setDefaultFontSize(t,e){this.fontSizes.set(t,e)}setDefaultLineStyleType(t,e){const i=this.lineStyles.get(t);i?i.type=e:this.lineStyles.set(t,{type:e})}setDefaultLineStyleWidth(t,e){const i=this.lineStyles.get(t);i?i.strokeWidth=e:this.lineStyles.set(t,{strokeWidth:e})}setDefaultLineTextAlignment(t,e){this.lineTextAlignments.set(t,e)}setDefaultLineTextPosition(t,e){this.lineTextPositions.set(t,e)}setDefaultFibonacciOptions(t,e,i){if("fibonacci-retracement"!=t&&"fibonacci-retracement-trend-based"!=t)return;const s=this.fibonacciOptions.get(t);s[e]=i,this.fibonacciOptions.set(t,s)}applyDefaults(t){for(const[e,i]of this.colors)if(t.type===e)for(const[e,[s,n,a,o]=[]]of i)s&&n&&null!=a&&null!=o&&ys(t,e,s,n,a,o);for(const[e,i]of this.fontSizes)t.type===e&&null!=i&&gs(t,i);for(const[e,i]of this.lineStyles)t.type===e&&null!=i&&ms(t,i);for(const[e,i]of this.lineTextPositions)t.type===e&&null!=i&&(t.text.position=i);for(const[e,i]of this.lineTextAlignments)t.type===e&&null!=i&&(t.text.alignment=i);for(const[e,i]of this.fibonacciOptions)t.type===e&&null!=i&&Object.keys(i).forEach(e=>{const s=i[e];null!=s&&t.set({[e]:s})})}},{Color:bs}=s.n1,vs=t=>{try{const e=bs.fromString(t),[i,s,n]=e.toHSB();return[i,s,n,e.a]}catch{return}},Ss=class extends s.n1.AnchoredPopover{constructor(t,e){super(t,"color-picker",e),this.hasChanged=!1,this.hideFns.push(()=>{this.hasChanged&&this.onChangeHide?.()})}show(t){this.hasChanged=!1,this.onChangeHide=t.onChangeHide;const{element:e,initialFocus:i}=this.createColorPicker(t),s=this.showWithChildren([e],{initialFocus:i,...t});s.classList.add("ag-charts-color-picker"),s.setAttribute("role","dialog")}createColorPicker(t){let e=t.isMultiColor??!1,[i,s,a,o]=vs(t.color??"#f00")??[0,1,.5,1];o=t.opacity??o;const r=(0,n.n)("div","ag-charts-color-picker__content");r.innerHTML='<div class="ag-charts-color-picker__palette" tabindex="0"></div><div class="ag-charts-color-picker__color-row"><button class="ag-charts-color-picker__multi-color-button" tabindex="0" type="button"></button> <input class="ag-charts-color-picker__hue-input" tabindex="0" type="range" min="0" max="360" value="0"></div><input class="ag-charts-color-picker__alpha-input" tabindex="0" type="range" min="0" max="1" value="1" step="0.01"> <label class="ag-charts-color-picker__color-field"><span class="ag-charts-color-picker__color-label">Color</span> <input class="ag-charts-color-picker__color-input" tabindex="0" value="#000"></label>',r.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const l=r.querySelector(".ag-charts-color-picker__palette"),h=r.querySelector(".ag-charts-color-picker__hue-input"),c=r.querySelector(".ag-charts-color-picker__multi-color-button"),d=r.querySelector(".ag-charts-color-picker__alpha-input"),u=r.querySelector(".ag-charts-color-picker__color-input"),p=r.querySelector(".ag-charts-color-picker__color-label");c.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!t.hasMultiColorOption);const g=(n=!0)=>{const l=bs.fromHSB(i,s,a,o).toHexString();if(r.style.setProperty("--h",`${i}`),r.style.setProperty("--s",`${s}`),r.style.setProperty("--v",`${a}`),r.style.setProperty("--a",`${o}`),r.style.setProperty("--color",l.slice(0,7)),r.style.setProperty("--color-a",l),h.value=`${i}`,d.value=`${o}`,d.classList.toggle("ag-charts-color-picker__alpha-input--opaque",1===o),c.classList.toggle("ag-charts-color-picker__multi-color-button--active",e),p.classList.toggle("ag-charts-color-picker__color-label--multi-color",e),document.activeElement!==u&&(u.value=e?"Multi Colour":l.toUpperCase()),n||null==t.color){const n=bs.fromHSB(i,s,a,1).toHexString();t.onChange?.(l,n,o,e)}n&&(this.hasChanged=!0)};g(!1);const m=t=>t.preventDefault(),y=t=>t.stopPropagation();return r.addEventListener("mousedown",y),r.addEventListener("touchstart",y),r.addEventListener("touchmove",y),r.addEventListener("keydown",t=>{switch(t.stopPropagation(),t.key){case"Enter":case"Escape":this.hide();break;default:return}t.preventDefault()}),l.addEventListener("pointerdown",t=>{t.preventDefault();const i=t.currentTarget;i.focus();const n=i.getBoundingClientRect(),o=({clientX:t,clientY:i})=>{e=!1,s=Math.min(Math.max((t-n.left)/n.width,0),1),a=1-Math.min(Math.max((i-n.top)/n.height,0),1),g()};o(t),window.addEventListener("pointermove",o),window.addEventListener("pointerup",()=>{window.removeEventListener("pointermove",o)},{once:!0})}),l.addEventListener("touchstart",m,{passive:!1}),l.addEventListener("touchmove",m,{passive:!1}),l.addEventListener("keydown",t=>{if("ArrowLeft"===t.key)s=(0,n.qE)(0,s-.01,1);else if("ArrowRight"===t.key)s=(0,n.qE)(0,s+.01,1);else if("ArrowUp"===t.key)a=(0,n.qE)(0,a+.01,1);else{if("ArrowDown"!==t.key)return;a=(0,n.qE)(0,a-.01,1)}t.preventDefault(),g()}),c.addEventListener("click",()=>{e=!e,g()}),h.addEventListener("input",t=>{e=!1,i=t.currentTarget.valueAsNumber??0,g()}),d.addEventListener("input",t=>{e=!1,o=t.currentTarget.valueAsNumber??0,g()}),u.addEventListener("input",t=>{e=!1;const n=vs(t.currentTarget.value);null!=n&&([i,s,a,o]=n,g())}),u.addEventListener("blur",()=>g()),u.addEventListener("keydown",t=>{"Enter"===t.key&&(t.currentTarget.blur(),g())}),{element:r,initialFocus:l}}};function Ms(t){return!(t instanceof s.n1.LogScale||t instanceof s.n1.BandScale)}var ks=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:Ms},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:Ms}],Ds=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],ws=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],Is=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],Cs=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],Ls=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],As=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],Ts=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],Ns=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{Color:Os,FloatingToolbar:Rs,Listeners:Es,Menu:Ps,PropertiesArray:Bs,ToolbarButtonProperties:Fs,ToolbarButtonWidget:zs,Property:Gs}=s.n1,_s=class extends Fs{constructor(){super(...arguments),this.checkedOverrides=new Fs}};r([Gs],_s.prototype,"value",2),r([Gs],_s.prototype,"checkedOverrides",2),r([Gs],_s.prototype,"color",2),r([Gs],_s.prototype,"strokeWidth",2),r([Gs],_s.prototype,"isMultiColor",2);var js=class extends zs{update(t){super.update(t),"line-stroke-width"===t.value&&this.updateLineStrokeWidth(t),"fill-color"!==t.value&&"line-color"!==t.value&&"text-color"!==t.value||this.updateFillColor(t)}updateFillColor(t){const e=this.getElement();e.classList.add("ag-charts-annotations__color-picker-button"),e.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",t.isMultiColor),e.style.setProperty("--color",t.color??null)}updateLineStrokeWidth(t){const e=this.getElement();e.classList.add("ag-charts-annotations__stroke-width-button"),e.style.setProperty("--stroke-width",`${t.strokeWidth}px`)}},Ws=class extends Rs{createButtonWidget(){return new js(this.localeManager)}},Vs=class extends s.n1.BaseProperties{constructor(t,e){super(),this.ctx=t,this.getActiveDatum=e,this.enabled=!0,this.buttons=new Bs(_s),this.destroyFns=[],this.events=new Es,this.visibleButtons=[],this.toolbar=new Ws(this.ctx,"annotation-options"),this.colorPicker=new Ss(this.ctx),this.textSizeMenu=new Ps(this.ctx,"text-size"),this.lineStyleTypeMenu=new Ps(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new Ps(this.ctx,"annotations-line-stroke-width"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),t.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),t.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>this.colorPicker.destroy())}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){for(const t of this.destroyFns)t()}addListener(t,e){return this.events.addListener(t,e)}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(t){if(!this.enabled)return;const e={"line-style-type":hs(t),"line-stroke-width":hs(t),"line-color":cs(t),"text-color":us(t),"fill-color":ds(t),"text-size":ls(t),settings:ps(t),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(t=>e[t.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(t)}setAnchorScene(t){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(t.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.dispatch("hid-overlays")}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(t){this.updateColorPickerColor("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),"isMultiColor"in t&&t?.isMultiColor),this.updateColorPickerColor("fill-color",t.getDefaultColor("fill-color"),t.getDefaultOpacity("fill-color"),"isMultiColor"in t&&t?.isMultiColor),this.updateColorPickerColor("text-color",t.getDefaultColor("text-color"),t.getDefaultOpacity("text-color"),"isMultiColor"in t&&t?.isMultiColor)}updateColorPickerColor(t,e,i,s){if(null!=e&&null!=i){const{r:t,g:s,b:n}=Os.fromString(e);e=Os.fromArray([t,s,n,i]).toHexString()}this.updateButtonByValue(t,{color:e,isMultiColor:s})}updateFontSize(t){this.updateButtonByValue("text-size",{label:null!=t?String(t):void 0})}updateLineStyleType(t){this.updateButtonByValue("line-style-type",{icon:t.icon})}updateStrokeWidth(t){this.updateButtonByValue("line-stroke-width",{label:t.label,strokeWidth:t.value})}dispatch(t,e){this.events.dispatch(t,e)}onButtonPress({event:t,button:e}){const i=this.getActiveDatum();if(i)switch(this.hideOverlays(),e.value){case"line-style-type":{const e=hs(i)?si(i.lineDash,i.lineStyle):void 0;this.lineStyleTypeMenu.show({items:Ts,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:e,sourceEvent:t.sourceEvent,onPress:t=>this.onLineStyleTypeMenuPress(t,i),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const e=hs(i)?i.strokeWidth:void 0;this.lineStrokeWidthMenu.show({items:As,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:e,sourceEvent:t.sourceEvent,onPress:t=>this.onLineStrokeWidthMenuPress(t,i),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":this.toolbar.toggleActiveButtonByIndex(e.index),this.colorPicker.show({color:i?.getDefaultColor(e.value),opacity:i?.getDefaultOpacity(e.value),sourceEvent:t.sourceEvent,hasMultiColorOption:"isMultiColor"in i,isMultiColor:"isMultiColor"in i&&i?.isMultiColor,onChange:null!=i?this.onColorPickerChange.bind(this,e.value,i):void 0,onChangeHide:(t=>{this.dispatch("saved-color",{type:i.type,colorPickerType:e.value,color:i.getDefaultColor(t)})}).bind(this,e.value)});break;case"text-size":{const e=os(i)?i.fontSize:void 0;this.textSizeMenu.show({items:Ns,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:e,sourceEvent:t.sourceEvent,onPress:t=>this.onTextSizeMenuPress(t,i),class:"ag-charts-annotations__text-size-menu"});break}case"delete":this.dispatch("pressed-delete");break;case"lock":i.locked=!i.locked,this.refreshButtons(i),this.dispatch("pressed-lock");break;case"settings":this.toolbar.toggleActiveButtonByIndex(e.index),this.dispatch("pressed-settings",t)}}onToolbarMoved(t){const{buttonBounds:e,popoverBounds:i}=t,s={x:i.x,y:i.y+i.height+4},n={y:i.y-4};this.colorPicker.setAnchor(s,n);for(const[t,i]of e.entries()){const e=this.visibleButtons.at(t);if(!e)continue;const s={x:i.x,y:i.y+i.height-1},n={y:i.y};switch(e.value){case"line-stroke-width":this.lineStrokeWidthMenu.setAnchor(s,n);break;case"line-style-type":this.lineStyleTypeMenu.setAnchor(s,n);break;case"text-size":this.textSizeMenu.setAnchor(s,n)}}}onColorPickerChange(t,e,i,s,n,a){this.dispatch("updated-color",{type:e.type,colorPickerType:t,colorOpacity:i,color:s,opacity:n,isMultiColor:a}),this.updateColorPickerColor(t,i,n,a)}onTextSizeMenuPress(t,e){if(!ls(e))return;const i=t.value;this.dispatch("updated-font-size",{type:e.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(t,e){if(!hs(e))return;const i=t.value;this.dispatch("updated-line-style",{type:e.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(t)}onLineStrokeWidthMenuPress(t,e){if(!hs(e))return;const i=t.value;this.dispatch("updated-line-width",{type:e.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(t)}refreshButtons(t){const e=t.locked??!1;for(const[t,i]of this.visibleButtons.entries())i&&("lock"===i.value?(this.toolbar.toggleSwitchCheckedByIndex(t,e),this.updateButtonByIndex(t,e?i.checkedOverrides.toJson():i.toJson())):this.toolbar.toggleButtonEnabledByIndex(t,!e));ls(t)&&this.updateFontSize(t.fontSize),this.updateColors(t),this.updateLineStyles(t)}updateLineStyles(t){if(!hs(t))return;const e=t.strokeWidth??1,i=si(t.lineDash,t.lineStyle);this.updateStrokeWidth({strokeWidth:e,value:e,label:String(e)}),this.updateLineStyleType(Ts.find(t=>t.value===i)??Ts[0])}updateButtonByValue(t,e){const i=this.visibleButtons.findIndex(e=>e.value===t);-1!==i&&this.updateButtonByIndex(i,e)}updateButtonByIndex(t,e){const i=this.visibleButtons.at(t);i&&this.toolbar.updateButtonByIndex(t,{...i.toJson(),...e,value:e.value??i.value})}};r([Gs],Vs.prototype,"enabled",2),r([Gs],Vs.prototype,"buttons",2);var{StateMachine:Ks,StateMachineProperty:Ys,Vec2:$s,Debug:Hs}=s.n1,Us=class extends Ks{constructor(t){const e=({context:e})=>{this.node?.drag(this.datum,this.offset,e,this.snapping),t.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:t,context:e})=>{this.hasMoved=!1,this.dragStart=t,this.offset=t,this.node?.dragStart(this.datum,t,e)}}},dragging:{keyDown:e,keyUp:e,drag:({offset:e,context:i})=>{this.hasMoved=$s.lengthSquared($s.sub(e,this.dragStart))>0,this.offset=e,this.node?.drag(this.datum,e,i,this.snapping),t.update()},dragEnd:{target:Ks.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&t.recordAction("Move annotation"),t.update()}}}}),this.debug=Hs.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};r([Ys()],Us.prototype,"snapping",2),r([Ys()],Us.prototype,"datum",2),r([Ys()],Us.prototype,"node",2);var{Property:Xs}=s.n1,Zs=class extends Ri{constructor(){super(...arguments),this.type="arrow-down"}static is(t){return(0,n.Gv)(t)&&"arrow-down"===t.type}};r([Xs],Zs.prototype,"type",2);var qs=class t extends s.n1.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(t){const{handle:e,locked:i}=this;return i?{point:{x:e.x,y:e.y},offset:{x:0,y:0}}:{point:t,offset:{x:t.x-e.x,y:t.y-e.y}}}toggleActive(e){this.active=e,e||(this.handle.strokeWidth=t.INACTIVE_STROKE_WIDTH)}toggleHovered(t){this.glow.visible=!this.locked&&t,this.glow.dirtyPath=!0}toggleDragging(t){this.locked||(this.handle.visible=!t,this.glow.visible=this.glow.visible&&!t,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(t){this.locked=t}getCursor(){}containsPoint(t,e){return this.handle.containsPoint(t,e)}};qs.INACTIVE_STROKE_WIDTH=2;var Qs=qs,Js=class t extends Qs{constructor(){super(),this.handle=new s.n1.Marker({shape:"circle"}),this.glow=new s.n1.Marker({shape:"circle"}),this.append([this.handle]),this.handle.size=t.HANDLE_SIZE,this.handle.strokeWidth=Qs.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(t){this.handle.setProperties({...t,strokeWidth:Qs.INACTIVE_STROKE_WIDTH})}drag(t){return{point:t,offset:{x:0,y:0}}}};Js.HANDLE_SIZE=7,Js.GLOW_SIZE=9;var tn=Js,en=class t extends Qs{constructor(){super(),this.handle=new s.n1.Rect,this.glow=new s.n1.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=t.CORNER_RADIUS,this.handle.width=t.HANDLE_SIZE,this.handle.height=t.HANDLE_SIZE,this.handle.strokeWidth=Qs.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=t.CORNER_RADIUS,this.glow.width=t.GLOW_SIZE,this.glow.height=t.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(e){if(super.toggleLocked(e),e){const e=(t.HANDLE_SIZE-tn.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=e,this.handle.y+=e,this.handle.width=tn.HANDLE_SIZE,this.handle.height=tn.HANDLE_SIZE,this.glow.width=tn.GLOW_SIZE,this.glow.height=tn.GLOW_SIZE}else this.handle.cornerRadius=t.CORNER_RADIUS,this.handle.width=t.HANDLE_SIZE,this.handle.height=t.HANDLE_SIZE,this.glow.width=t.GLOW_SIZE,this.glow.height=t.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(e){if(this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked){delete e.fill,delete e.strokeWidth;const i=(t.HANDLE_SIZE-tn.HANDLE_SIZE)/2;e.x-=i,e.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(e),this.glow.setProperties({...e,x:(e.x??this.glow.x)-2,y:(e.y??this.glow.y)-2,strokeWidth:0,fill:e.stroke})}drag(t){return this.locked?{point:t,offset:{x:0,y:0}}:"vertical"===this.gradient?{point:{x:t.x,y:this.handle.y},offset:{x:t.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:t.y},offset:{x:0,y:t.y-this.handle.y}}}getCursor(){if(!this.locked)return"vertical"===this.gradient?"col-resize":"row-resize"}};en.HANDLE_SIZE=12,en.GLOW_SIZE=16,en.CORNER_RADIUS=4;var sn=en,nn=class t extends Qs{constructor(){super(),this.handle=new s.n1.Marker({shape:"circle"}),this.glow=new s.n1.Marker({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=t.HANDLE_SIZE,this.handle.strokeWidth=Qs.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=t.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(e){super.toggleLocked(e),e?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=tn.HANDLE_SIZE,this.glow.size=tn.GLOW_SIZE):(this.handle.size=t.HANDLE_SIZE,this.glow.size=t.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(t){this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked&&(delete t.fill,delete t.strokeWidth),this.handle.setProperties(t),this.glow.setProperties({...t,strokeWidth:0,fill:t.stroke})}getCursor(){return"pointer"}};nn.HANDLE_SIZE=11,nn.GLOW_SIZE=17;var an=nn,{ZIndexMap:on}=s.n1,rn=class extends s.n1.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=on.CHART_ANNOTATION}static isCheck(t,e){return(0,n.Gv)(t)&&Object.hasOwn(t,"type")&&t.type===e}toggleHovered(t){this.toggleHandles(t)}*nonHandleChildren(){for(const t of this.children())t instanceof Qs||(yield t)}computeBBoxWithoutHandles(){return s.n1.Transformable.toCanvas(this,s.n1.Group.computeChildrenBBox(this.nonHandleChildren()))}updateNode(t,e,i){if(i||!e)return i&&null==e&&(e=new t,this.appendChild(e)),e;this.removeChild(e)}},{ContinuousScale:ln,Vec2:hn,toRadians:cn}=s.n1;function dn(t,e,i=!1,s,n=1){return _e(i?un(t,s?ze(s,e):hn.origin(),n):t,e)}function un(t,e,i){const s=hn.sub(t,e),n=cn(i),a=Math.round(hn.angle(s)/n)*n;return hn.rotate(s,a,e)}function pn(t,e){const i={};for(const[s,a]of(0,n.jO)(t))i[s]=ze(a,e);return i}function gn(t,e,i,s={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:n,yAxis:a}=i,o=Object.keys(t),r=[],l=[],h=new Set(s.translateVectors??o),c=new Set(s.invertYVectors??[]),d=new Set([...h,...c]),u=hn.multiply(e,hn.from(1,-1));for(const i of o)d.has(i)&&(t[i]=hn.add(t[i],c.has(i)?u:e),s.snap&&(t[i]=un(t[i],s.snap.vectors[i],s.snap.angle))),r.push(n.getRangeOverflow(t[i].x)),l.push(a.getRangeOverflow(t[i].y));const p=(t,e)=>Math.abs(t)-Math.abs(e),g=(t,e,i)=>0!==s.overflowContinuous&&ln.is(t)?o.length===d.size?i.toSorted(p).at(-s.overflowContinuous-1)??0:i.filter(t=>0!==t).length<=s.overflowContinuous?0:i.filter((t,i)=>0!==t&&Math.abs(t)<=Math.abs(e)&&d.has(o[i])).toSorted(p).at(-1)??0:i.toSorted(p).at(-1)??0,m=hn.from(g(n.scale,e.x,r),g(a.scale,e.y,l));if(!hn.equal(m,hn.origin()))for(const e of o)d.has(e)&&(t[e]=hn.round(hn.sub(t[e],m),4));const y={};for(const e of o)y[e]=_e(t[e],i);return y}var{Vec2:mn}=s.n1,yn=class extends rn{constructor(){super(...arguments),this.handle=new an,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=ze(t,e);this.updateHandle(t,i),this.anchor=this.updateAnchor(t,i,e)}dragStart(t,e,i){this.dragState={offset:e,...pn({handle:t},i)}}drag(t,e,i){const{dragState:s}=this;if(t.locked||!s)return;const{point:n}=gn({point:s.handle},mn.sub(e,s.offset),i);t.x=n.x,t.y=n.y}translate(t,e,i){if(t.locked)return;const{point:s}=gn({point:ze(t,i)},e,i);t.x=s.x,t.y=s.y}toggleHandles(t){this.handle.visible=Boolean(t),this.handle.toggleHovered("handle"===this.activeHandle)}toggleActive(t){this.toggleHandles(t),this.handle.toggleActive(t)}stopDragging(){this.handle.toggleDragging(!1)}copy(t,e,i){const s=ze(t,i),n=_e({x:s.x-30,y:s.y-30},i);return e.x=n.x,e.y=n.y,e}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{handle:i}=this;return this.activeHandle=void 0,!!i.containsPoint(t,e)&&(this.activeHandle="handle",!0)}getNodeAtCoords(t,e){if(this.handle.containsPoint(t,e))return"handle"}updateHandle(t,e,i){const{x:s,y:n}=this.getHandleCoords(t,e,i),a=this.getHandleStyles(t);this.handle.update({...a,x:s,y:n}),this.handle.toggleLocked(t.locked??!1)}updateAnchor(t,e,i){const s=this.getHandleCoords(t,e);return{x:s.x+i.seriesRect.x,y:s.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i){return{x:e.x,y:e.y}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},fn=class extends yn{constructor(){super(),this.append([this.handle])}update(t,e){super.update(t,e);const i=ze(t,e);this.updateShape(t,i)}updateShape(t,e){this.updateShapeStyles(t),this.updateShapePath(t,e)}updateShapeStyles(t){const{shape:e}=this;e.fill=t.fill,e.fillOpacity=t.fillOpacity??1}updateShapePath(t,e){const{shape:i}=this;i.x=e.x,i.y=e.y,i.size=t.size}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}getNodeAtCoords(t,e){return this.shape.containsPoint(t,e)?"shape":super.getNodeAtCoords(t,e)}},xn=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function bn(t){s.n1.drawMarkerUnitPolygon(t,xn)}bn.anchor={x:.5,y:0};var vn=class extends fn{constructor(){super(),this.type="arrow-up",this.shape=new s.n1.Marker({shape:bn}),this.append([this.shape])}static is(t){return rn.isCheck(t,"arrow-up")}getHandleCoords(t,e){const i=an.HANDLE_SIZE/2,s=super.getHandleCoords(t,e);return s.y-=i,s}},Sn=xn.map(([t,e])=>[t,1-e]);function Mn(t){s.n1.drawMarkerUnitPolygon(t,Sn)}Mn.anchor={x:.5,y:1};var kn=class extends fn{constructor(){super(),this.type="arrow-down",this.shape=new s.n1.Marker({shape:Mn}),this.append([this.shape])}static is(t){return rn.isCheck(t,"arrow-down")}updateAnchor(t,e,i){const s=super.updateAnchor(t,e,i);return s.y-=t.size,s}getHandleCoords(t,e){const i=an.HANDLE_SIZE/2,s=super.getHandleCoords(t,e);return s.y+=i,s}},{StateMachine:Dn,StateMachineProperty:wn,Debug:In}=s.n1,Cn=class extends Dn{constructor(t){const e=({point:e})=>{const i=this.createDatum();i.set({x:e.x,y:e.y}),t.create(i)};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},cancel:Dn.parent,reset:Dn.parent},"waiting-first-render":{render:{target:Dn.parent,action:()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()}}}}),this.debug=In.create(!0,"annotations")}};r([wn()],Cn.prototype,"node",2);var Ln=class extends Cn{createDatum(){return new Zs}},An={type:"arrow-down",datum:Zs,scene:kn,isDatum:Zs.is,translate:(t,e,i,s)=>{Zs.is(e)&&kn.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Zs.is(e)&&Zs.is(i)&&kn.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Zs.is(e)&&kn.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Ln({...t,create:e("arrow-down")}),dragState:t=>new Us(t)},{Property:Tn}=s.n1,Nn=class extends Ri{constructor(){super(...arguments),this.type="arrow-up"}static is(t){return(0,n.Gv)(t)&&"arrow-up"===t.type}};r([Tn],Nn.prototype,"type",2);var On=class extends Cn{createDatum(){return new Nn}},Rn={type:"arrow-up",datum:Nn,scene:vn,isDatum:Nn.is,translate:(t,e,i,s)=>{Nn.is(e)&&vn.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Nn.is(e)&&Nn.is(i)&&vn.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Nn.is(e)&&vn.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new On({...t,create:e("arrow-up")}),dragState:t=>new Us(t)},{Vec2:En,Vec4:Pn}=s.n1,Bn=class extends rn{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:t,y1:e,x2:i,y2:s},n,a){const o={x1:t,y1:e,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return o;const[r,l]=function(t,e){const[i,s]=ii.from(t),n=e.height,a=ii.gradient(s,i,n),o=ii.intercept(s,a,n),r=[{x:i.x,y:n??0},{x:i.x,y:null==n?e.height:n-e.height}];if(a===1/0)return r;let l=[ii.intersectAtY(a,o,0,n),ii.intersectAtY(a,o,e.height,n),ii.intersectAtX(a,o,0,n),ii.intersectAtX(a,o,e.width,n)];return l=l.filter(t=>t.x>=e.x&&t.x<=e.width&&t.y>=e.y&&t.y<=e.height).sort((t,e)=>t.x===e.x?0:t.x<e.x?-1:1),2!==l.length?r:l}(o,a.yAxis.bounds),h=o.x2<o.x1,c=o.y1>=o.y2,d=o.x2===o.x1;return n.extendEnd&&(d?o.y2=c?l.y:r.y:(o.x2=h?r.x:l.x,o.y2=h?r.y:l.y)),n.extendStart&&(d?o.y1=c?r.y:l.y:(o.x1=h?l.x:r.x,o.y1=h?l.y:r.y)),o}dragStart(t,e,i){this.dragState={offset:e,...pn({start:t.start,end:t.end},i)}}drag(t,e,i,s){t.locked||(this.activeHandle?this.dragHandle(t,e,i,s):this.dragAll(t,e,i))}dragAll(t,e,i){const{dragState:s}=this;s&&this.translatePoints(t,s.start,s.end,En.sub(e,s.offset),i)}translate(t,e,i){t.locked||this.translatePoints(t,ze(t.start,i),ze(t.end,i),e,i)}copy(t,e,i){const s=Fe(t,i);if(!s)return;const n=this.computeBBoxWithoutHandles(),a={x:-n.width/2,y:-n.height/2};return this.translatePoints(e,Pn.start(s),Pn.end(s),a,i),e}translatePoints(t,e,i,s,n){const a=gn(this.getTranslatePointsVectors(e,i),s,n,{overflowContinuous:this.overflowContinuous});t.start.x=a.start.x,t.end.x=a.end.x,t.start.y=a.start.y,t.end.y=a.end.y}getTranslatePointsVectors(t,e){return{start:t,end:e}}},{Vec2:Fn,Vec4:zn}=s.n1,Gn=class extends Bn{constructor(){super(...arguments),this.start=new an,this.end=new an,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=Fe(t,e);null!=i&&(this.updateHandles(t,i),this.updateAnchor(t,i,e))}toggleHandles(t){if("boolean"==typeof t)this.start.visible=t,this.end.visible=t;else for(const[e,i]of(0,n.jO)(t))this[e].visible=i;this.start.toggleHovered("start"===this.activeHandle),this.end.toggleHovered("end"===this.activeHandle)}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t)}dragHandle(t,e,i,s){const{activeHandle:n,dragState:a}=this;if(!n||!a)return;this[n].toggleDragging(!0);const o="start"===n?"end":"start",r=s?{vectors:{[n]:ze(t[o],i)},angle:t.snapToAngle}:void 0,{[n]:l}=gn({[n]:a[n]},Fn.sub(e,a.offset),i,{overflowContinuous:0,snap:r});t[n].x=l.x,t[n].y=l.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):!!s.containsPoint(t,e)&&(this.activeHandle="end",!0)}getNodeAtCoords(t,e){if(this.start.containsPoint(t,e)||this.end.containsPoint(t,e))return"handle"}updateHandles(t,e,i){this.start.update({...this.getHandleStyles(t,"start"),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t,"end"),...this.getHandleCoords(t,e,"end",i)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}updateAnchor(t,e,i,s){this.anchor={x:e.x1+i.seriesRect.x,y:e.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i,s){return"start"===i?zn.start(e):zn.end(e)}getHandleStyles(t,e){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},{Vec4:_n}=s.n1,jn=class extends Gn{constructor(){super(...arguments),this.label=new s.n1.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty("TextualStartEndScene")}update(t,e){const i=Fe(t,e);if(null==i)return;const s=this.getTextBBox(t,i);this.updateLabel(t,s,i),this.updateHandles(t,i,s),this.updateShape(t,s,i),this.updateAnchor(t,i,e,s)}containsPoint(t,e){return super.containsPoint(t,e)||this.label.containsPoint(t,e)}getNodeAtCoords(t,e){return this.label.containsPoint(t,e)?"text":super.getNodeAtCoords(t,e)}getTextBBox(t,e){const{text:i}=t.getText();return wi(t,i,_n.end(e),this.textInputBBox)}updateLabel(t,e,i){const{text:s,isPlaceholder:n}=t.getText();Ii(this.label,s,n,t,this.getLabelCoords(t,e,i))}updateShape(t,e,i){}getLabelCoords(t,e,i){return _n.end(i)}getHandleStyles(t,e){return{...super.getHandleStyles(t,e),stroke:t.handle.stroke??t.color}}},{drawCorner:Wn,Path:Vn}=s.n1,Kn=class extends jn{constructor(){super(),this.type="callout",this.shape=new Vn,this.append([this.shape,this.label,this.start,this.end])}static is(t){return rn.isCheck(t,"callout")}drag(t,e,i,s){t.locked||("end"===this.activeHandle?this.dragHandle(t,e,i,s):this.dragAll(t,e,i))}getLabelCoords(t,e,i){const s=t.getPadding(),{bodyBounds:n={x:0,y:0,width:0,height:0}}=this.getDimensions(t,e,i)??{};return{x:n.x+s.left,y:n.y-s.bottom}}getHandleStyles(t,e){return"start"===e?{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(t,e,i,s){const{bodyBounds:n}=this.getDimensions(t,s,e)??{},a=n??s;this.anchor={x:a.x+i.seriesRect.x,y:a.y+i.seriesRect.y-a.height,position:this.anchor.position}}updateShape(t,e,i){const{shape:s}=this;s.fill=t.fill,s.fillOpacity=t.fillOpacity??1,s.stroke=t.stroke,s.strokeWidth=t.strokeWidth??1,s.strokeOpacity=t.strokeOpacity??1;const{tailPoint:n,bodyBounds:a}=this.getDimensions(t,e,i)??{};n&&a&&this.updatePath(n,a)}updatePath(t,e){const{x:i,y:s}=t,{x:n,y:a,width:o,height:r}=e,l=a-r,h=n+o,c=this.calculateCalloutPlacement({x:i,y:s},e),d=[{coordinates:{x0:n,x1:n+8,y0:l+8,y1:l,cx:"topLeft"===c?i:n+8,cy:"topLeft"===c?s:l+8},type:"topLeft"===c?"calloutCorner":"corner"},{coordinates:{x0:n+8,x1:h-8,y0:l,y1:l,cx:i,cy:s},type:"top"===c?"calloutSide":"side"},{coordinates:{x0:h-8,x1:h,y0:l,y1:l+8,cx:"topRight"===c?i:h-8,cy:"topRight"===c?s:l+8},type:"topRight"===c?"calloutCorner":"corner"},{coordinates:{x0:h,x1:h,y0:l+8,y1:a-8,cx:i,cy:s},type:"right"===c?"calloutSide":"side"},{coordinates:{x0:h,x1:h-8,y0:a-8,y1:a,cx:"bottomRight"===c?i:h-8,cy:"bottomRight"===c?s:a-8},type:"bottomRight"===c?"calloutCorner":"corner"},{coordinates:{x0:h-8,x1:n+8,y0:a,y1:a,cx:i,cy:s},type:"bottom"===c?"calloutSide":"side"},{coordinates:{x0:n+8,x1:n,y0:a,y1:a-8,cx:"bottomLeft"===c?i:n+8,cy:"bottomLeft"===c?s:a-8},type:"bottomLeft"===c?"calloutCorner":"corner"},{coordinates:{x0:n,x1:n,y0:a-8,y1:l+8,cx:i,cy:s},type:"left"===c?"calloutSide":"side"}],{path:u}=this.shape;u.clear(),u.moveTo(n,l+8),d.forEach(({coordinates:t,type:e})=>{this.drawPath(u,t,8,e)}),u.closePath()}drawPath(t,{x0:e,y0:i,x1:s,y1:n,cx:a,cy:o},r,l){switch(l){case"calloutCorner":t.lineTo(a,o),t.lineTo(s,n);break;case"corner":Wn(t,{x0:e,x1:s,y0:i,y1:n,cx:a,cy:o},r,!1);break;case"calloutSide":if(e!==s){const r=e>s?-1:1,l=Math.min(e,s)+Math.abs(s-e)/2;t.lineTo(l-6*r,i),t.lineTo(a,o),t.lineTo(l+6*r,i),t.lineTo(s,n)}else{const r=i>n?-1:1,l=Math.min(i,n)+Math.abs(i-n)/2;t.lineTo(e,l-6*r),t.lineTo(a,o),t.lineTo(e,l+6*r),t.lineTo(s,n)}break;default:t.lineTo(s,n)}}calculateCalloutPlacement(t,e){const i=e.x+e.width,s=e.y-e.height;let n,a;return t.x>i?n="right":t.x<e.x&&(n="left"),t.y>e.y?a="bottom":t.y<s&&(a="top"),n&&a?`${a}${n[0].toUpperCase()}${n.substring(1)}`:a??n}getDimensions(t,e,i){const{fontSize:s}=t,n=t.getPadding(),a=n.left+n.right,o=n.top+n.bottom,r=e.width+a,l=Math.max(e.height+o,s+o);return{tailPoint:{x:i.x1,y:i.y1},bodyBounds:{x:e.x,y:e.y,width:r,height:l}}}containsPoint(t,e){const{start:i,end:s,shape:n}=this;if(this.activeHandle=void 0,i.containsPoint(t,e))return this.activeHandle="start",!0;const a=s.containsPoint(t,e)||n.containsPoint(t,e);return a&&(this.activeHandle="end"),a}};function Yn({key:t}){return"Escape"===t}function $n({key:t,shiftKey:e}){return!e&&"Enter"===t}var{StateMachine:Hn,StateMachineProperty:Un,Debug:Xn}=s.n1,Zn=class extends Hn{constructor(t){const e=({point:e})=>{const i=this.createDatum();i.set({start:e,end:e,visible:!0}),t.create(i)},i=({point:e})=>{const{datum:i,node:s}=this;i?.set({end:e}),s?.toggleActive(!0),s?.toggleHandles({end:!1}),t.update()},s=()=>{t.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},n=()=>{t.delete()},a=({textInputValue:e,bbox:i})=>{const{datum:s}=this;if(null!=i&&null!=e&&e.length>0){if(!os(s))return;const n=Di(s,e,i.width);s?.set({text:n}),t.update(),t.recordAction(`Create ${s?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:Hn.parent,reset:Hn.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:t}=this;t?.toggleActive(!0),t?.toggleHandles({start:!0})}}},end:{hover:i,drag:i,click:{target:"edit",action:s},dragEnd:{target:"edit",action:s},reset:{target:Hn.parent,action:n},cancel:{target:Hn.parent,action:n}},edit:{onEnter:()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},updateTextInputBBox:e=>{this.node?.setTextInputBBox(e),t.update()},color:({colorPickerType:e,colorOpacity:i,color:s,opacity:n,isMultiColor:a})=>{const{datum:o}=this;o&&("text-color"===e&&t.updateTextInputColor(s),ys(o,e,i,s,n,a),t.update())},fontSize:e=>{const{datum:i,node:s}=this;i&&s&&os(i)&&(i.fontSize=e,t.updateTextInputFontSize(e),t.update())},textInput:[{guard:Yn,target:Hn.parent,action:n},{guard:$n,target:Hn.parent,action:a}],click:{target:Hn.parent,action:a},dragStart:{target:Hn.parent,action:a},resize:{target:Hn.parent,action:a},onExit:()=>{t.hideTextInput(),this.datum&&(this.datum.visible=!0),t.deselect()},cancel:{target:Hn.parent,action:n}}}),this.debug=Xn.create(!0,"annotations")}};r([Un()],Zn.prototype,"datum",2),r([Un()],Zn.prototype,"node",2);var qn=class extends Zn{createDatum(){return new Xe}},Qn={type:"callout",datum:Xe,scene:Kn,isDatum:Xe.is,translate:(t,e,i,s)=>{if(Xe.is(e)&&Kn.is(t))return t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Xe.is(e)&&Xe.is(i)&&Kn.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Xe.is(e)&&Kn.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new qn({...t,create:e("callout")}),dragState:t=>new Us(t)},Jn=class extends yn{constructor(){super(...arguments),this.label=new s.n1.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty("TextualPointScene")}update(t,e){const i=ze(t,e),s=this.getTextBBox(t,i,e);this.updateLabel(t,s),this.updateHandle(t,i,s),this.updateShape(t,s),this.anchor=this.updateAnchor(t,s,e)}copy(t,e,i){const s=ze(t,i),n=this.getTextBBox(t,s,i),a=t.getPadding(),o=a.left+a.right,r=a.top+a.bottom,l=(n.width+o)/2,h=n.height+r,c=_e({x:s.x-l,y:s.y-h},i);return e.x=c.x,e.y=c.y,e}containsPoint(t,e){const{label:i}=this;return super.containsPoint(t,e)||i.visible&&i.containsPoint(t,e)}getNodeAtCoords(t,e){return this.label.visible&&this.label.containsPoint(t,e)?"text":super.getNodeAtCoords(t,e)}getTextBBox(t,e,i){const{text:s}=t.getText();return wi(t,s,{x:e.x,y:e.y},this.textInputBBox)}updateLabel(t,e){const{text:i,isPlaceholder:s}=t.getText();Ii(this.label,i,s,t,this.getLabelCoords(t,e),this.getTextBaseline(t))}updateShape(t,e){}updateAnchor(t,e,i){return{x:e.x+i.seriesRect.x,y:e.y+i.seriesRect.y-e.height,position:this.anchor.position}}getLabelCoords(t,e){return e}getTextBaseline(t){return"center"==t.position?"middle":t.position}getHandleCoords(t,e,i){return i}getHandleStyles(t){const e=super.getHandleStyles(t);return e.stroke=t.handle.stroke??t.color,e}},{drawCorner:ta}=s.n1,ea=class extends Jn{constructor(){super(),this.type="comment",this.shape=new s.n1.Path,this.append([this.shape,this.label,this.handle])}static is(t){return rn.isCheck(t,"comment")}updateShape(t,e){const{shape:i}=this;i.fill=t.fill,i.fillOpacity=t.fillOpacity??1,i.stroke=t.stroke??"transparent",i.strokeWidth=t.strokeWidth??1,i.strokeOpacity=t.strokeOpacity??1,this.updatePath(t,e)}getLabelCoords(t,e){const i=t.getPadding();return{x:e.x+i.left,y:e.y-i.bottom}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke??t.fill,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}updateAnchor(t,e,i){const s=super.updateAnchor(t,e,i),n=t.getPadding();return s.y-=n.bottom+n.top,s}updatePath(t,e){const i=t.getPadding(),{x:s,y:n}=e;let{width:a,height:o}=e;const{fontSize:r}=t,l=i.left+i.right,h=i.top+i.bottom;a+=l,o=Math.max(o+h,r+h);const c=n-o,d=s+a,u=(r*Mi+h)/2,{path:p}=this.shape;p.clear(),p.moveTo(s,n),p.lineTo(s,c+u),ta(p,{x0:s,x1:s+u,y0:c+u,y1:c,cx:s+u,cy:c+u},u,!1),p.lineTo(d-u,c),ta(p,{x0:d-u,x1:d,y0:c,y1:c+u,cx:d-u,cy:c+u},u,!1),p.lineTo(d,n-u),ta(p,{x0:d,x1:d-u,y0:n-u,y1:n,cx:d-u,cy:n-u},u,!1),p.closePath()}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}},{StateMachine:ia,StateMachineProperty:sa,Debug:na}=s.n1,aa=class extends ia{constructor(t){const e=({point:e})=>{const i=this.createDatum();i.set({x:e.x,y:e.y}),t.create(i)},i=()=>{t.delete()},s=({textInputValue:e,bbox:i})=>{if(null!=i&&null!=e&&e.length>0){const{datum:s}=this;if(!os(s))return;const n=Di(s,e,i.width);s?.set({text:n}),t.update(),t.recordAction(`Create ${s?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:ia.parent,reset:ia.parent},"waiting-first-render":{render:{target:"edit",action:()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()}}},edit:{onEnter:()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},updateTextInputBBox:e=>{this.node?.setTextInputBBox(e),t.update()},color:({colorPickerType:e,colorOpacity:i,color:s,opacity:n,isMultiColor:a})=>{this.datum&&("text-color"===e&&t.updateTextInputColor(s),ys(this.datum,e,i,s,n,a),t.update())},fontSize:e=>{const{datum:i,node:s}=this;i&&s&&os(i)&&(i.fontSize=e,t.updateTextInputFontSize(e),t.update())},textInput:[{guard:Yn,target:ia.parent,action:i},{guard:$n,target:ia.parent,action:s}],click:{target:ia.parent,action:s},dragStart:{target:ia.parent,action:s},resize:{target:ia.parent,action:s},onExit:()=>{t.hideTextInput(),this.datum&&(this.datum.visible=!0),t.deselect()},cancel:{target:ia.parent,action:i}}}),this.debug=na.create(!0,"annotations")}};r([sa()],aa.prototype,"datum",2),r([sa()],aa.prototype,"node",2);var oa=class extends aa{createDatum(){return new ei}},ra={type:"comment",datum:ei,scene:ea,isDatum:ei.is,translate:(t,e,i,s)=>{ei.is(e)&&ea.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(ei.is(e)&&ei.is(i)&&ea.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{ei.is(e)&&ea.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new oa({...t,create:e("comment")}),dragState:t=>new Us(t)},{calculateLabelTranslation:la,ChartAxisDirection:ha}=s.n1,ca=class extends s.n1.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new s.n1.Text({zIndex:1}),this.rect=new s.n1.Rect;const{label:t}=this;t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.textBaseline="middle",t.textAlign="center",this.append([this.rect,this.label])}update(t){this.updateLabel(t),this.updateRect(t),this.updatePosition(t)}updateLabel({value:t,styles:e,context:i}){const{fontWeight:s,fontSize:n,fontStyle:a,fontFamily:o,textAlign:r,color:l="white",formatter:h}=e,c=h?h({value:t}):i.scaleValueFormatter()(t);this.label.setProperties({fontWeight:s,fontSize:n,fontStyle:a,fontFamily:o,textAlign:r,fill:l,text:c})}updateRect({styles:t}){const{rect:e}=this,{cornerRadius:i,fill:s,fillOpacity:n,stroke:a,strokeOpacity:o}=t;e.setProperties({cornerRadius:i,fill:s,fillOpacity:n,stroke:a,strokeOpacity:o})}updatePosition({x:t,y:e,context:i,styles:{padding:s}}){const{label:n,rect:a}=this,o=n.getBBox()?.clone(),r=s??8,l=s??5;o.grow(r,"horizontal"),o.grow(l,"vertical");const h=i.direction===ha.X?Math.round(l/2):r,{xTranslation:c,yTranslation:d}=la({yDirection:!0,padding:i.labelPadding-h,position:i.position??"left",bbox:o}),u=t+c,p=e+d;n.x=u,n.y=p,a.y=p-Math.round(o.height/2),a.x=u-Math.round(o.width/2),a.height=o.height,a.width=o.width}};ca.className="AxisLabel";var{Vec2:da}=s.n1,ua=class extends s.n1.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(t,e){return super.setProperties(t,e),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:t,strokeWidth:e,x1:i,y1:n,x2:a,y2:o}=this;let r=e+t;r%2==0&&(r+=1);const l=da.from(i,n-Math.floor(r/2)),h=da.from(a,o),c=da.distance(l,h);this.collisionBBox=new s.n1.BBox(l.x,l.y,c,r)}isPointInPath(t,e){const{collisionBBox:i,x1:s,y1:n,x2:a,y2:o}=this;if(!i)return!1;const r=da.from(s,n),l=da.from(a,o),h=da.sub(da.from(t,e),r),c=da.sub(l,r),d=da.rotate(h,da.angle(h,c),r);return i.containsPoint(d.x,d.y)??!1}render(t){this.applyClipMask(t.ctx),super.render(t),this.closeClipMask(t.ctx)}setClipMask(t,e){const i=this.clipMask.get(t);null!=s.n1.jsonDiff(i,e)&&this.markDirty("CollidableLine"),e?this.clipMask.set(t,e):this.clipMask.delete(t)}applyClipMask(t){const{clipMask:e}=this;0!==e.size&&this.clipMask.forEach(e=>{const{x:i,y:s,radius:n}=e;t.save(),t.beginPath(),t.rect(0,0,t.canvas.width,t.canvas.height),t.ellipse(i,s,n,n,0,2*Math.PI,0,!0),t.clip()})}closeClipMask(t){0!==this.clipMask.size&&t.restore()}},pa=class extends s.n1.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(t,e){const i=this.fromParentPoint(t,e),s=this.computeBBoxWithoutTransforms();return!!s&&s.grow(this.growCollisionBox).containsPoint(i.x,i.y)}},{Vec2:ga}=s.n1;function ma(t,e,i,s,n,a,o){if(!a||!n||!s)return void e.setClipMask(t);const{alignment:r,position:l}=s,h=fa(i,s.fontSize,o),{point:c,textBaseline:d}=xa(h,l,r);ba(n,a,s,c,h.angle,d);const{x:u,y:p,width:g,height:m}=n.getBBox(),y={x:u+g/2,y:p+m/2,radius:ga.length(ga.from(g,m))/2+ga.length(h.offset)};return"center"===l?e.setClipMask(t,y):e.setClipMask(t),{clipMask:y,numbers:h}}function ya(t,e,i,s,n,a,o){if(!o||!a)return;const{alignment:r,position:l}=s,[h,c]=e.y1<=i.y1?[e,i]:[i,e];let d=h;"bottom"===l?d=c:"inside"===l&&(d={x1:(h.x1+c.x1)/2,y1:(h.y1+c.y1)/2,x2:(h.x2+c.x2)/2,y2:(h.y2+c.y2)/2});const u=fa(d,s.fontSize,n),{point:p,textBaseline:g}=xa(u,"inside"===l?"center":l,r,t);ba(a,o,s,p,u.angle,g)}function fa(t,e,i){let[s,n]=ga.from(t);s.x>n.x&&([s,n]=[n,s]);const a=ga.normalized(ga.sub(n,s));return{left:s,right:n,normal:a,angle:ga.angle(a),inset:ga.multiply(a,an.HANDLE_SIZE/2+(e??14)/2),offset:ga.multiply(a,(i??2)/2+(e??14)/3)}}function xa({left:t,right:e,normal:i,angle:s,inset:n,offset:a},o,r,l){let h;h="right"===r?ga.sub(e,n):"center"===r?ga.add(t,ga.multiply(i,ga.distance(t,e)/2)):ga.add(t,n);let c="bottom";return"bottom"===o?(h=ga.rotate(a,s+Math.PI/2,h),c="top"):"center"!==o||l?h=ga.rotate(a,s-Math.PI/2,h):c="middle",{point:h,textBaseline:c}}function ba(t,e,i,s,n,a){t.setProperties({text:e,x:s.x,y:s.y,rotation:n,rotationCenterX:s.x,rotationCenterY:s.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:a})}var{ChartAxisDirection:va,Vec2:Sa,Vec4:Ma}=s.n1,ka=class extends rn{constructor(){super(),this.type="cross-line",this.line=new ua,this.middle=new sn,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(t){return rn.isCheck(t,"cross-line")}update(t,e){const{seriesRect:i}=e;this.seriesRect=i,this.isHorizontal=Bi.is(t);const s=this.isHorizontal?e.yAxis:e.xAxis,n=this.convertCrossLine(t,s);null!=n?(this.visible=t.visible??!0,this.visible&&(this.updateLine(t,n),this.updateHandle(t,n),this.updateText(t,n),this.updateAxisLabel(t,s,n))):this.visible=!1}updateLine(t,e){const{line:i}=this,{lineDashOffset:s,stroke:n,strokeWidth:a,strokeOpacity:o}=t,{x1:r,y1:l,x2:h,y2:c}=e;i.setProperties({x1:r,y1:l,x2:h,y2:c,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:s,stroke:n,strokeWidth:a,strokeOpacity:o,fillOpacity:0})}updateHandle(t,e){const{middle:i}=this,{locked:s,stroke:n,strokeWidth:a,strokeOpacity:o}=t,r={fill:t.handle.fill,stroke:t.handle.stroke??n,strokeOpacity:t.handle.strokeOpacity??o,strokeWidth:t.handle.strokeWidth??a},l=Sa.sub(Ma.center(e),Sa.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...r,...l}),i.toggleLocked(s??!1)}updateText(t,e){this.text=this.updateNode(pa,this.text,!!t.text.label),ma(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}createAxisLabel(t){const e=new ca;return t.attachLabel(e),e}updateAxisLabel(t,e,i){this.axisLabel||(this.axisLabel=this.createAxisLabel(e));const{axisLabel:s,seriesRect:n}=this,{direction:a,position:o}=e;if(t.axisLabel.enabled){s.visible=this.visible;const r="left"===o||"top"===o?Ma.start(i):Ma.end(i),l=a===va.X?r.x:r.y;if(!e.inRange(l))return void(s.visible=!1);const h=Pe(t.value);s.update({...Sa.add(r,Sa.required(n)),value:h,styles:t.axisLabel,context:e})}else s.visible=!1}setAxisLabelOpacity(t){this.axisLabel&&(this.axisLabel.opacity=t)}setAxisLabelVisible(t){this.axisLabel&&(this.axisLabel.visible=t)}toggleHandles(t){this.middle.visible=t,this.middle.toggleHovered("middle"===this.activeHandle)}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(t){this.toggleHandles(t),this.middle.toggleActive(t)}dragStart(t,e,i){const s=Bi.is(t)?{x:e.x,y:Ge(t.value,i.yAxis)}:{x:Ge(t.value,i.xAxis),y:e.y};this.dragState={offset:e,middle:s}}drag(t,e,i){const{activeHandle:s,dragState:n}=this;!t.locked&&n&&(s&&this[s].toggleDragging(!0),this.translatePoint(t,n.middle,Sa.sub(e,n.offset),i))}translate(t,e,i){if(t.locked)return;const s=Bi.is(t)?Sa.from(0,Ge(t.value,i.yAxis)):Sa.from(Ge(t.value,i.xAxis),0);this.translatePoint(t,s,e,i)}translatePoint(t,e,i,s){const n=Bi.is(t);n?i.x=0:i.y=0;const{point:a}=gn({point:e},i,s);t.value=n?a.y:a.x}stopDragging(){this.middle.toggleDragging(!1)}copy(t,e,i){const s=Bi.is(t),n=this.isHorizontal?i.yAxis:i.xAxis,a=this.convertCrossLine(t,n);if(!a)return;const o=s?-30:0,r=s?0:-30,l=_e({x:a.x1+r,y:a.y1+o},i);return e.set({value:s?l.y:l.x}),e}getCursor(){return null==this.activeHandle?"pointer":this[this.activeHandle].getCursor()}containsPoint(t,e){const{middle:i,line:s,text:n}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="middle",!0):s.isPointInPath(t,e)||Boolean(n?.containsPoint(t,e))}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.line.isPointInPath(t,e)?"line":this.middle.containsPoint(t,e)?"handle":void 0}getAnchor(){const t=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:t.x+t.width/2,y:t.y}:{x:t.x+t.width,y:t.y+t.height/2,position:"right"}}convertCrossLine(t,e){if(null==t.value)return;let i,s,n=0,a=0;const{bounds:o}=e,r=Ge(t.value,e);return Bi.is(t)?(i=o.width,a=r,s=r):(n=r,i=r,s=o.height),{x1:n,y1:a,x2:i,y2:s}}},{StateMachine:Da,StateMachineProperty:wa,Debug:Ia}=s.n1,Ca=class extends Da{constructor(t,e){const i=({point:i})=>{const s="horizontal"===t,n=s?new Bi:new Fi;n.set({value:s?i.y:i.x}),e.create(n),e.recordAction(`Create ${s?"horizontal-line":"vertical-line"} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:Da.parent,cancel:Da.parent},"waiting-first-render":{render:{target:Da.parent,action:()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()}}}}),this.debug=Ia.create(!0,"annotations")}};r([wa()],Ca.prototype,"node",2);var La={type:"horizontal-line",datum:Bi,scene:ka,isDatum:Bi.is,translate:(t,e,i,s)=>{Bi.is(e)&&ka.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Bi.is(e)&&Bi.is(i)&&ka.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Bi.is(e)&&ka.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Ca("horizontal",{...t,create:e("horizontal-line")}),dragState:t=>new Us(t)},Aa={type:"vertical-line",datum:Fi,scene:ka,isDatum:Fi.is,translate:(t,e,i,s)=>{Fi.is(e)&&ka.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Fi.is(e)&&Fi.is(i)&&ka.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Fi.is(e)&&ka.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Ca("vertical",{...t,create:e("vertical-line")}),dragState:t=>new Us(t)},{Vec4:Ta}=s.n1,Na=class{static updateBackground(t,e,i,s){const{background:n}=this,{seriesRect:a}=s;n.path.clear(!0);const o=Ta.from(0,0,a.width,a.height),r=this.getBackgroundPoints(t,e,i,o);for(let t=0;t<r.length;t++){const e=r[t];0===t?n.path.moveTo(e.x,e.y):n.path.lineTo(e.x,e.y)}n.path.closePath(),n.checkPathDirty();const l=this.getBackgroundStyles?.(t)??t.background;n.setProperties({fill:l.fill,fillOpacity:l.fillOpacity})}},Oa=class extends Bn{constructor(){super(...arguments),this.handles={},this.overflowContinuous=2,this.topLine=new ua,this.bottomLine=new ua,this.background=new s.n1.Path({zIndex:-1}),this.anchor={x:0,y:0},this.updateBackground=Na.updateBackground.bind(this)}update(t,e){const{locked:i,visible:s}=t,n=Fe(t,e),a=Fe(t.bottom,e);if(null==n||null==a)return void(this.visible=!1);this.visible=s??!0;const o=this.extendLine(n,t,e),r=this.extendLine(a,t,e);this.updateLines(t,o,r,e,n,a),this.updateHandles(t,n,a),this.updateText(t,n,a),this.updateBackground(t,o,r,e),this.updateAnchor(n,a);for(const t of Object.values(this.handles))t.toggleLocked(i??!1)}toggleHandles(t){const{handles:e}=this;if("boolean"!=typeof t)for(const[i,s]of Object.entries(t)){const t=e[i];t.visible=s??!0,t.toggleHovered(this.activeHandle===i)}else for(const[i,s]of Object.entries(e))s.visible=t,s.toggleHovered(this.activeHandle===i)}toggleActive(t){this.toggleHandles(t);for(const e of Object.values(this.handles))e.toggleActive(t)}stopDragging(){const{activeHandle:t,handles:e}=this;null!=t&&e[t].toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return null==this.activeHandle?"pointer":this.handles[this.activeHandle].getCursor()}containsPoint(t,e){const{handles:i,topLine:s,bottomLine:n,text:a}=this;this.activeHandle=void 0;for(const[s,n]of Object.entries(i))if(n.containsPoint(t,e))return this.activeHandle=s,!0;return s.containsPoint(t,e)||n.containsPoint(t,e)||Boolean(a?.containsPoint(t,e))}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.topLine.containsPoint(t,e)||this.bottomLine.containsPoint(t,e))return"line";for(const[i,s]of Object.entries(this.handles))if(s.containsPoint(t,e))return"handle"}updateAnchor(t,e){const{x:i,y:n}=s.n1.Transformable.toCanvasPoint(this.topLine,(t.x1+t.x2)/2,Math.min(t.y1,t.y2,e.y1,e.y2));this.anchor.x=i,this.anchor.y=n}},{Vec2:Ra,Vec4:Ea}=s.n1,Pa=class extends Oa{constructor(){super(),this.type="disjoint-channel",this.handles={topLeft:new an,topRight:new an,bottomLeft:new an,bottomRight:new sn},this.append([this.background,this.topLine,this.bottomLine,...Object.values(this.handles)])}static is(t){return rn.isCheck(t,"disjoint-channel")}dragHandle(t,e,i,s){const{activeHandle:n,handles:a}=this;if(null==n)return;const{offset:o}=a[n].drag(e);a[n].toggleDragging(!0),"bottomRight"===n&&(o.x=0);let r=[],l=[],h=s;switch(n){case"topLeft":r=["topLeft"],l=["bottomLeft"];break;case"bottomLeft":r=["bottomLeft"],l=["topLeft"];break;case"topRight":r=["topRight"],l=["bottomRight"];break;case"bottomRight":r=["bottomLeft","bottomRight"],h=!1}const c=Fe(t,i),d=Fe(t.bottom,i);if(!c||!d)return;const u={topLeft:Ea.start(c),topRight:Ea.end(c),bottomLeft:Ea.start(d),bottomRight:Ea.end(d)},p={vectors:{topLeft:u.topRight,bottomLeft:u.bottomRight,topRight:u.topLeft,bottomRight:u.bottomLeft},angle:t.snapToAngle},g=gn(u,o,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,invertYVectors:l,snap:h?p:void 0});t.start.x=g.topLeft.x,t.start.y=g.topLeft.y,t.end.x=g.topRight.x,t.end.y=g.topRight.y,t.startHeight=g.topLeft.y-g.bottomLeft.y,t.endHeight=g.topRight.y-g.bottomRight.y}getTranslatePointsVectors(t,e){const{bottomLeft:i,bottomRight:s,topLeft:n,topRight:a}=this.handles,o=i.getBBox().y-n.getBBox().y,r=s.getBBox().y-a.getBBox().y;return{start:t,end:e,bottomStart:Ra.add(t,Ra.from(0,o)),bottomEnd:Ra.add(e,Ra.from(0,r))}}updateLines(t,e,i){const{topLine:s,bottomLine:n}=this,{lineDashOffset:a,stroke:o,strokeOpacity:r,strokeWidth:l}=t,h={lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:a,stroke:o,strokeOpacity:r,strokeWidth:l};s.setProperties({...e,...h}),n.setProperties({...i,...h})}updateHandles(t,e,i){const{handles:{topLeft:s,topRight:n,bottomLeft:a,bottomRight:o}}=this,r={fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth};s.update({...r,...Ea.start(e)}),n.update({...r,...Ea.end(e)}),a.update({...r,...Ea.start(i)}),o.update({...r,...Ra.sub(Ea.end(i),Ra.from(o.handle.width/2,o.handle.height/2))})}updateText(t,e,i){this.text=this.updateNode(pa,this.text,!!t.text.label),ya(!1,e,i,t.text,t.strokeWidth,this.text,t.text.label)}getBackgroundPoints(t,e,i,s){const n=e.x1>e.x2,a=e.y1>e.y2,o=a?s.y2:s.y1,r=a?s.y1:s.y2,l=Ra.from(e);return t.extendEnd&&e.y2===r&&l.push(Ra.from(n?s.x1:s.x2,a?s.y1:s.y2)),t.extendEnd&&i.y2===o&&l.push(Ra.from(n?s.x1:s.x2,a?s.y2:s.y1)),l.push(...Ra.from(i).reverse()),t.extendStart&&i.y1===r&&l.push(Ra.from(n?s.x2:s.x1,a?s.y1:s.y2)),t.extendStart&&e.y1===o&&l.push(Ra.from(n?s.x2:s.x1,a?s.y2:s.y1)),l}},{StateMachine:Ba,StateMachineProperty:Fa,Debug:za}=s.n1,Ga=class extends Ba{constructor(t){const e=({point:e})=>{const i=new _i;i.set({start:e,end:e,startHeight:0,endHeight:0}),t.create(i)},i=({offset:e,context:i})=>{const{datum:s,snapping:n}=this;s&&(s.set({end:dn(e,i,n,s.start,s.snapToAngle)}),t.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},a=({point:e})=>{const{datum:i,node:s}=this,a=Pe(i?.end.y),o=Pe(i?.start.y),{y:r}=e;if(null==i||!(0,n.Et)(o)||!(0,n.Et)(a)||!(0,n.Et)(r))return;const l=a-(r??0),h=2*(o-a)+l,c={x:i.start.x,y:o-l},d={x:i.end.x,y:e.y};s?.toggleHandles(!0),t.validatePoint(c,{overflowContinuous:!0})&&t.validatePoint(d,{overflowContinuous:!0})&&(i.set({startHeight:h,endHeight:l}),t.recordAction("Create disjoint-channel annotation"),t.showAnnotationOptions(),t.update())},o=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Ba.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:t}=this;t?.toggleActive(!0),t?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})}}},end:{hover:i,drag:i,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:Ba.parent,action:o},cancel:{target:Ba.parent,action:o}},height:{hover:({point:e})=>{const{datum:i,node:s}=this,a=Pe(i?.end.y),o=Pe(i?.start.y),{y:r}=e;if(null==i||!(0,n.Et)(o)||!(0,n.Et)(a)||!(0,n.Et)(r))return;const l=a-(r??0),h=2*(o-a)+l,c={x:i?.start.x,y:o-h},d={x:i?.end.x,y:e.y};s?.toggleHandles({bottomLeft:!0,bottomRight:!0}),t.validatePoint(c,{overflowContinuous:!0})&&t.validatePoint(d,{overflowContinuous:!0})&&(i.set({startHeight:h,endHeight:l}),t.update())},click:{target:Ba.parent,action:a},drag:{target:Ba.parent,action:a},reset:{target:Ba.parent,action:o},cancel:{target:Ba.parent,action:o}}}),this.debug=za.create(!0,"annotations"),this.snapping=!1}};r([Fa()],Ga.prototype,"datum",2),r([Fa()],Ga.prototype,"node",2),r([Fa()],Ga.prototype,"snapping",2);var _a={type:"disjoint-channel",datum:_i,scene:Pa,isDatum:_i.is,translate:(t,e,i,s)=>{_i.is(e)&&Pa.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(_i.is(e)&&_i.is(i)&&Pa.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{_i.is(e)&&Pa.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Ga({...t,create:e("disjoint-channel")}),dragState:t=>new Us(t)},ja=[0,23.6,38.2,50,61.8,78.6,100],Wa={10:[...ja,161.8,261.8,361.8,423.6],6:ja,4:ja.filter(t=>78.6!==t&&23.6!==t)};function Va({x1:t,y1:e,x2:i,y2:s},n,a,o,r=10){const l=e-s,h=a?-1:1;let c=o;const d=[];return Wa[r].forEach((e,s)=>{const a=o+l*(e/100)*h,r=n.yAxis.scaleInvert(a);d.push({id:s,x1:t,x2:i,y1:c,y2:a,tag:100==e?0:1,label:{x1:Math.min(t,i)-10,x2:i,y1:a,y2:a,text:`${(e/100).toFixed(3)} (${r.toFixed(2)})`}}),c=a}),d}var{Vec2:Ka,Vec4:Ya}=s.n1,$a=class extends rn{constructor(){super(),this.trendLine=new ua,this.rangeFillsGroup=new s.n1.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=s.n1.Selection.select(this.rangeFillsGroup,s.n1.Range),this.rangeStrokesGroup=new s.n1.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=s.n1.Selection.select(this.rangeStrokesGroup,ua),this.labelsGroup=new s.n1.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=s.n1.Selection.select(this.labelsGroup,pa),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(t,e){let i=Fe(t,e);if(null==i)return void(this.visible=!1);if(i=Ya.round(i),this.visible=t.visible??!0,!this.visible)return;this.updateLine(t,i,this.trendLine),this.updateHandles(t,i),this.updateAnchor(t,i,e);const{reverse:s}=t,n=this.extendLine(i,t,e),a=s?n.y1:n.y2,o=s?n.y2:n.y1,r=Va(n,e,t.reverse,a,t.bands);this.updateRanges(t,r,e);const l={...n,y1:o,y2:o};this.updateText(t,l)}extendLine({x1:t,y1:e,x2:i,y2:s},n,a){const o={x1:t,y1:e,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return o;const{x:r,width:l}=a.xAxis.bounds;return n.extendEnd&&(o[t>i?"x1":"x2"]=r+l),n.extendStart&&(o[t>i?"x2":"x1"]=r),o}updateLine(t,e,i){if(!e||!i)return;const{lineDashOffset:s,strokeWidth:n,strokeOpacity:a,stroke:o}=t;i.setProperties({...e,lineCap:t.getLineCap(),lineDash:[3,4],lineDashOffset:s,strokeWidth:n,strokeOpacity:a,fillOpacity:0,stroke:o})}updateRangeStrokes(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:a,isMultiColor:o}=t;this.rangeStrokesGroupSelection.each((r,{x1:l,x2:h,y2:c,tag:d},u)=>{const p=c,g=o?n[u%n.length]:a;r.setProperties({x1:l,x2:h,y1:p,y2:p,stroke:g,strokeOpacity:s,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,tag:d})})}updateRanges(t,e,i){const s=t=>t.id;this.rangeFillsGroupSelection.update(e,void 0,s),this.rangeStrokesGroupSelection.update(e,void 0,s),this.labelsGroupSelection.update(e,void 0,s),this.updateRangeFills(t),this.updateRangeStrokes(t),this.updateRangeLabels(t,i)}updateRangeFills(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:a,showFill:o,isMultiColor:r}=t;this.rangeFillsGroupSelection.each((l,{x1:h,x2:c,y1:d,y2:u},p)=>{const g=r?n[p%n.length]:a;o?l.setProperties({x1:h,x2:c,y1:d,y2:u,startLine:!1,endLine:!1,stroke:g,strokeOpacity:s,fill:g,fillOpacity:.15*(s??1),strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,visible:!0}):l.visible=!1})}updateRangeLabels(t,{xAxis:e}){const{rangeStrokesGroupSelection:i}=this,{strokes:s,strokeWidth:n,rangeStroke:a,isMultiColor:o,label:{fontFamily:r,fontSize:l,fontStyle:h,fontWeight:c,color:d}}=t,u={fontFamily:r,fontSize:l,fontStyle:h,fontWeight:c},p=this.checkWithinBounds(e,u,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((t,e,r)=>{const l=d??(o?s[r%s.length]:a),h=i.at(r);if(!h)return;const{text:c,...g}=e.label;if(p)t.setProperties({...u,text:c,x:g.x1,y:g.y1,textBaseline:"middle",textAlign:"end",fill:l}),ma(t.id,h,g);else{const e={...u,label:c,position:"center",alignment:"left",color:l};ma(t.id,h,g,e,t,c,n)}})}checkWithinBounds(t,e,i){if(!i)return!1;const{text:s,...n}=i.datum.label;i.setProperties({...e,text:s,x:n.x1,y:n.y1,textBaseline:"middle",textAlign:"end"});const{x:a}=i.getBBox();return a>=t.bounds.x&&a<=t.bounds.x+t.bounds.width}updateText(t,e){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:s,strokeWidth:n}=t;this.text=this.updateNode(pa,this.text,!!s.label),ma(i.id,i,e,s,this.text,s.label,n)}updateAnchor(t,e,i,n){const a=Ya.topCenter(e);Ka.apply(this.anchor,s.n1.Transformable.toCanvasPoint(this.trendLine,a.x,a.y))}containsPoint(t,e){const{trendLine:i,rangeStrokesGroupSelection:s,text:n}=this;let a=!1;return s.each(i=>a||(a=i.isPointInPath(t,e))),a||i.isPointInPath(t,e)||Boolean(n?.containsPoint(t,e))}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.trendLine.isPointInPath(t,e)?"line":void 0}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}drag(t,e,i,s){t.locked||(this.activeHandle?this.dragHandle(t,e,i,s):this.dragAll(t,e,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{ContinuousScale:Ha}=s.n1;function Ua(t,e,i={overflowContinuous:!1},s){if(null==e.x||null==e.y)return s&&n.Vy.warnOnce(`${s}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:a,yAxis:o}=t,r=i.overflowContinuous&&Ha.is(a.scale),l=i.overflowContinuous&&Ha.is(o.scale),h=r||Xa(e.x,a),c=l||Xa(e.y,o);if(h&&c)return!0;if(s){let t="x & y domains";h&&(t="y domain"),c&&(t="x domain");const i=Pe(e.x),a=Pe(e.y);n.Vy.warnOnce(`${s}is outside the ${t}, ignoring. - x: [${i}], y: ${a}]`)}return!1}function Xa(t,e){const{domain:i}=e.scale,s=Pe(t);return!i||null==s||!e.continuous||s>=i[0]&&s<=i.at(-1)}var{Vec2:Za,Vec4:qa}=s.n1,Qa=class extends $a{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new ua,this.start=new an,this.end=new an,this.endRetracement=new an,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(t){return rn.isCheck(t,"fibonacci-retracement-trend-based")}update(t,e){let{coords1:i,coords2:s}=this.getCoords(t,e);if(null==i||null==s)return void(this.visible=!1);if(i=qa.round(i),s=qa.round(s),this.visible=t.visible??!0,!this.visible)return;null!=t.endRetracement.x&&null!=t.endRetracement.y||(s=void 0),this.updateLine(t,i,this.trendLine),this.updateLine(t,s,this.endRetracementLine),this.updateHandles(t,i,s),this.updateAnchor(t,s??i,e);const{reverse:n,bands:a}=t,o=function(t,e){const{x2:i,y1:s,y2:n}=t,a=s-n;return null==e?{x1:i,x2:i,y1:n-a,y2:n}:{x1:e.x1,x2:e.x2,y1:e.y2-a,y2:e.y2}}(i,s),r=this.extendLine(o,t,e),l=r.y2,h=r.y1,c=s?Va(r,e,n,l,a):[];this.updateRanges(t,c,e);const d={...r,y1:h,y2:h};this.updateText(t,d)}containsPoint(t,e){const{start:i,end:s,endRetracement:n,endRetracementLine:a}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):s.containsPoint(t,e)?(this.activeHandle="end",!0):n.containsPoint(t,e)?(this.activeHandle="endRetracement",!0):a.isPointInPath(t,e)||super.containsPoint(t,e)}getNodeAtCoords(t,e){return this.start.containsPoint(t,e)||this.end.containsPoint(t,e)||this.endRetracement.containsPoint(t,e)?"handle":this.endRetracementLine.isPointInPath(t,e)?"line":super.getNodeAtCoords(t,e)}dragStart(t,e,i){this.dragState={offset:e,...pn({start:t.start,end:t.end,endRetracement:t.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(t,e,i){const{dragState:s}=this;s&&this.translatePoints({datum:t,start:s.start,end:s.end,endRetracement:s.endRetracement,translation:Za.sub(e,s.offset),context:i})}dragHandle(t,e,i,s){const{activeHandle:n,dragState:a}=this;if(!n||!a)return;this[n].toggleDragging(!0);const o=s?this.snapToAngle(t,e,i):_e(this[n].drag(e).point,i);o&&Ua(i,o)&&(t[n].x=o.x,t[n].y=o.y)}snapToAngle(t,e,i){const{activeHandle:s}=this,n=["start","end","endRetracement"];if(!s)return;const a=(n.indexOf(s)+1)%n.length,o=n[a];return this[s].toggleDragging(!0),_e(un(e,ze(t[o],i),t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,endRetracement:s,translation:n,context:a}){const o=gn({start:e,end:i,endRetracement:s},n,a,{overflowContinuous:2});t.start.x=o.start.x,t.end.x=o.end.x,t.endRetracement.x=o.endRetracement.x,t.start.y=o.start.y,t.end.y=o.end.y,t.endRetracement.y=o.endRetracement.y}translate(t,e,i){this.translatePoints({datum:t,start:ze(t.start,i),end:ze(t.end,i),endRetracement:ze(t.endRetracement,i),translation:e,context:i})}copy(t,e,i){const{coords1:s,coords2:n}=this.getCoords(t,i);if(!s||!n)return;const a=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:qa.start(s),end:qa.end(s),endRetracement:qa.end(n),translation:{x:-a.width/2,y:-a.height/2},context:i}),e}getCoords(t,e){return{coords1:Fe(t,e),coords2:Fe({start:t.end,end:t.endRetracement},e)}}toggleHandles(t){if("boolean"==typeof t)this.start.visible=t,this.end.visible=t,this.endRetracement.visible=t;else for(const[e,i]of(0,n.jO)(t))this[e].visible=i;this.start.toggleHovered("start"===this.activeHandle),this.end.toggleHovered("end"===this.activeHandle),this.endRetracement.toggleHovered("endRetracement"===this.activeHandle)}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t),this.endRetracement.toggleActive(t)}updateHandles(t,e,i,s){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",s)}),i&&this.endRetracement.update({...this.getHandleStyles(t),...this.getHandleCoords(t,i,"endRetracement",s)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1),this.endRetracement.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,s){return"start"===i?qa.start(e):qa.end(e)}},{StateMachine:Ja,StateMachineProperty:to,Debug:eo}=s.n1,io=class extends Ja{constructor(t){const e=({point:e})=>{const i=this.createDatum();i.set({start:e,end:e}),t.create(i)},i=({offset:e,context:i})=>{const{datum:s,snapping:n}=this;s&&(s.set({end:dn(e,i,n,s.start,s.snapToAngle)}),t.update())},s=()=>{const{datum:e}=this;e&&(e.endRetracement.x=e.end.x,e.endRetracement.y=e.end.y,this.node?.toggleHandles({end:!0}),t.update())},n=()=>{this.node?.toggleHandles({endRetracement:!0}),t.update()},a=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Ja.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:t}=this;t?.toggleActive(!0),t?.toggleHandles({start:!0,end:!1,endRetracement:!1})}}},end:{hover:i,click:{target:"endRetracement",action:s},drag:i,dragEnd:{target:"endRetracement",action:s},reset:{target:Ja.parent,action:a},cancel:{target:Ja.parent,action:a},onExit:()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.datum?.type} annotation`)}},endRetracement:{hover:({offset:e,context:i})=>{const{datum:s,snapping:n}=this;s&&(s.set({endRetracement:dn(e,i,n,s.end,s.snapToAngle)}),t.update())},click:{target:Ja.parent,action:n},drag:{target:Ja.parent,action:n},reset:{target:Ja.parent,action:a},cancel:{target:Ja.parent,action:a}}}),this.debug=eo.create(!0,"annotations"),this.snapping=!1}createDatum(){return new Ui}};r([to()],io.prototype,"datum",2),r([to()],io.prototype,"node",2),r([to()],io.prototype,"snapping",2);var so={type:"fibonacci-retracement-trend-based",datum:Ui,scene:Qa,isDatum:Ui.is,translate:(t,e,i,s)=>{Ui.is(e)&&Qa.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Ui.is(e)&&Ui.is(i)&&Qa.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Ui.is(e)&&Qa.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new io({...t,create:e("fibonacci-retracement-trend-based")}),dragState:t=>new Us(t)},{Vec2:no,Vec4:ao}=s.n1,oo=class extends $a{constructor(){super(),this.type="fibonacci-retracement",this.start=new an,this.end=new an,this.append([this.start,this.end])}static is(t){return rn.isCheck(t,"fibonacci-retracement")}containsPoint(t,e){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):s.containsPoint(t,e)?(this.activeHandle="end",!0):super.containsPoint(t,e)}getNodeAtCoords(t,e){return this.start.containsPoint(t,e)||this.end.containsPoint(t,e)?"handle":super.getNodeAtCoords(t,e)}dragStart(t,e,i){this.dragState={offset:e,...pn({start:t.start,end:t.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(t,e,i){const{dragState:s}=this;s&&this.translatePoints({datum:t,start:s.start,end:s.end,translation:no.sub(e,s.offset),context:i})}dragHandle(t,e,i,s){const{activeHandle:n,dragState:a}=this;if(!n||!a)return;this[n].toggleDragging(!0);const o=s?this.snapToAngle(t,e,i):_e(this[n].drag(e).point,i);o&&Ua(i,o)&&(t[n].x=o.x,t[n].y=o.y)}snapToAngle(t,e,i){const{activeHandle:s}=this,n=["start","end"].find(t=>t!==s);if(s&&n)return this[s].toggleDragging(!0),_e(un(e,ze(t[n],i),t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,translation:s,context:n}){const a=gn({start:e,end:i},s,n,{overflowContinuous:1});t.start.x=a.start.x,t.end.x=a.end.x,t.start.y=a.start.y,t.end.y=a.end.y}translate(t,e,i){this.translatePoints({datum:t,start:ze(t.start,i),end:ze(t.end,i),translation:e,context:i})}copy(t,e,i){const s=Fe(t,i);if(!s)return;const n=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:{x:s.x1,y:s.y1},end:{x:s.x2,y:s.y2},translation:{x:-n.width/2,y:-n.height/2},context:i}),e}toggleHandles(t){if("boolean"==typeof t)this.start.visible=t,this.end.visible=t;else for(const[e,i]of(0,n.jO)(t))this[e].visible=i;this.start.toggleHovered("start"===this.activeHandle),this.end.toggleHovered("end"===this.activeHandle)}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t)}updateHandles(t,e,i,s){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",s)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,s){return"start"===i?ao.start(e):ao.end(e)}},{StateMachine:ro,StateMachineProperty:lo,Debug:ho}=s.n1,co=class extends ro{constructor(t){const e=({point:e})=>{const i=this.createDatum();i.set({start:e,end:e}),t.create(i)},i=({offset:e,context:i})=>{const{datum:s,snapping:n}=this;s&&(s.set({end:dn(e,i,n,s.start,s.snapToAngle)}),t.update())},s=()=>{this.node?.toggleHandles({end:!0}),t.update()},n=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:ro.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:t}=this;t?.toggleActive(!0),t?.toggleHandles({start:!0,end:!1})}}},end:{hover:i,click:{target:ro.parent,action:s},drag:i,dragEnd:{target:ro.parent,action:s},reset:{target:ro.parent,action:n},cancel:{target:ro.parent,action:n},onExit:()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.datum?.type} annotation`)}}}),this.debug=ho.create(!0,"annotations"),this.snapping=!1}};r([lo()],co.prototype,"datum",2),r([lo()],co.prototype,"node",2),r([lo()],co.prototype,"snapping",2);var uo=class extends co{createDatum(){return new Vi}},po=class extends co{createDatum(){return new Ki}},go=class extends co{createDatum(){return new Zi}},mo={type:"fibonacci-retracement",datum:Zi,scene:oo,isDatum:Zi.is,translate:(t,e,i,s)=>{Zi.is(e)&&oo.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Zi.is(e)&&Zi.is(i)&&oo.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Zi.is(e)&&oo.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new go({...t,create:e("fibonacci-retracement")}),dragState:t=>new Us(t)},{Vec2:yo}=s.n1,fo=class extends s.n1.Group{},xo=class extends fo{constructor(){super(),this.type="arrow",this.path=new s.n1.Path,this.armLength=6,this.append([this.path])}update(t){const{path:e}=this,{x:i,y:s,angle:n,...a}=t,o=yo.from(i,s),r=3*Math.PI/4,l=this.armLength+2*(t.strokeWidth??0),h=yo.rotate(yo.from(0,l),n+r,o),c=yo.rotate(yo.from(l,0),n-r,o);e.setProperties(a),e.fillOpacity=0,e.path.clear(),e.path.moveTo(h.x,h.y),e.path.lineTo(o.x,o.y),e.path.lineTo(c.x,c.y)}},{Vec2:bo,Vec4:vo}=s.n1,So=class extends Gn{constructor(){super(),this.type="line",this.line=new ua,this.append([this.line,this.start,this.end])}static is(t){return rn.isCheck(t,"line")}update(t,e){let i=Fe(t,e);null!=i?(i=vo.round(i),this.visible=t.visible??!0,this.visible&&(this.updateLine(t,i,e),this.updateHandles(t,i),this.updateText(t,i),this.updateCaps(t,i),this.updateAnchor(t,i,e))):this.visible=!1}updateLine(t,e,i){const{line:s}=this,{lineDashOffset:n,stroke:a,strokeWidth:o,strokeOpacity:r}=t,l=this.extendLine(e,t,i);s.setProperties({...l,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:n,stroke:a,strokeWidth:o,strokeOpacity:r,fillOpacity:0})}updateText(t,e){this.text=this.updateNode(pa,this.text,!!t.text.label),ma(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}updateCaps(t,e){if(!t.startCap&&this.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),!t.endCap&&this.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),!t.startCap&&!t.endCap)return;const{stroke:i,strokeWidth:s,strokeOpacity:n}=t,[a,o]=bo.from(e),r=bo.angle(bo.sub(o,a));t.startCap&&(this.startCap&&this.startCap.type!==t.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),null==this.startCap&&(this.startCap=new xo,this.append([this.startCap])),this.startCap.update({x:a.x,y:a.y,angle:r-Math.PI,stroke:i,strokeWidth:s,strokeOpacity:n})),t.endCap&&(this.endCap&&this.endCap.type!==t.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),null==this.endCap&&(this.endCap=new xo,this.append([this.endCap])),this.endCap.update({x:o.x,y:o.y,angle:r,stroke:i,strokeWidth:s,strokeOpacity:n}))}updateAnchor(t,e,i,n){const a=vo.topCenter(e);bo.apply(this.anchor,s.n1.Transformable.toCanvasPoint(this.line,a.x,a.y))}containsPoint(t,e){const{line:i,text:s}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||Boolean(s?.containsPoint(t,e))}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.line.isPointInPath(t,e)?"line":super.getNodeAtCoords(t,e)}getHandleCoords(t,e,i,s){const{startCap:n,endCap:a}=this;let[o,r]=bo.from(e);const l=bo.angle(bo.sub(r,o));return n&&(o=bo.rotate(bo.from(0,-an.HANDLE_SIZE/2),l,o)),a&&(r=bo.rotate(bo.from(0,an.HANDLE_SIZE/2),l,r)),"start"===i?o:r}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},Mo={type:"line",datum:Ki,scene:So,isDatum:Ki.is,translate:(t,e,i,s)=>{Ki.is(e)&&So.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Ki.is(e)&&Ki.is(i)&&So.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Ki.is(e)&&So.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new po({...t,create:e("line")}),dragState:t=>new Us(t)},ko={type:"arrow",datum:Vi,scene:So,isDatum:Vi.is,translate:(t,e,i,s)=>{Vi.is(e)&&So.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Vi.is(e)&&Vi.is(i)&&So.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Vi.is(e)&&So.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new uo({...t,create:e("arrow")}),dragState:t=>new Us(t)};function Do(t,e=0,i=0){let n=e;for(const e of t)if(Array.isArray(e)){for(const t of e)wo(t,n);n+=s.n1.Group.computeChildrenBBox(e).width+i}else wo(e,n),n+=e.getBBox().width+i}function wo(t,e){"x1"in t?(t.x2=e+(t.x2-t.x1),t.x1=e):t.x=e}function Io(t,e){"y1"in t?(t.y2=e+(t.y2-t.y1),t.y1=e):t.y=e}function Co(t,e){"x1"in t?(t.x1+=e,t.x2+=e):t.x+=e}function Lo(t,e){"y1"in t?(t.y1+=e,t.y2+=e):t.y+=e}var{Vec4:Ao}=s.n1,To=class extends s.n1.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new s.n1.Rect,this.dateRangeBarsText=new s.n1.Text,this.dateRangeDivider=new s.n1.Line,this.dateRangeValueText=new s.n1.Text,this.priceRangeValueText=new s.n1.Text,this.priceRangeDivider=new s.n1.Line,this.priceRangePercentageText=new s.n1.Text,this.volumeText=new s.n1.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(t,e,i,n,a,o,r){this.verticalDirection=o;const l=this.updateStatistics(t,e,i,r),h=s.n1.Group.computeChildrenBBox(l.flat());h.grow(10),this.updateBackground(t,h,10),this.reposition(l,10,a),this.checkVisibility(t,a,n)}checkVisibility(t,e,i){const n=Ao.from(new s.n1.BBox(0,0,e.seriesRect.width,e.seriesRect.height));Ao.collides(i,n)?this.visible=t.visible??!0:this.visible=!1}updateStatistics(t,e,i,n){const{dateRangeBarsText:a,dateRangeDivider:o,dateRangeValueText:r,priceRangeValueText:l,priceRangeDivider:h,priceRangePercentageText:c,volumeText:d}=this,u=t.statistics.fontSize+3,p=this.getTextStyles(t),g={...this.getDividerStyles(t),x1:0,y1:0,x2:0,y2:u},m=[a,o,r],y=[l,h,c],f=[];return e.priceRange&&(l.setProperties({...p,text:this.formatPriceRangeValue(e.priceRange.value,n)}),h.setProperties(g),c.setProperties({...p,text:this.formatPriceRangePercentage(e.priceRange.percentage,n)}),Do(y,i.x,8),f.push(y)),e.dateRange&&(a.setProperties({...p,text:this.formatDateRangeBars(e.dateRange.bars,n)}),o.setProperties(g),r.setProperties({...p,text:this.formatDateRangeValue(e.dateRange.value)}),Do(m,i.x,8),f.push(m)),null!=e.volume?(d.setProperties({...p,x:i.x,text:this.formatVolume(e.volume,n),visible:!0}),f.push(d)):d.visible=!1,function(t,e=0,i=0){let n=e;for(const e of t)if(Array.isArray(e)){for(const t of e)Io(t,n);n+=s.n1.Group.computeChildrenBBox(e).height+i}else Io(e,n),n+=e.getBBox().height+i}(f,i.y,6),h.y1+=-2,h.y2+=-2,o.y1+=-2,o.y2+=-2,f}updateBackground(t,e,i){const s=this.getBackgroundStyles(t);this.background.setProperties({...s,...e,x:e.x-e.width/2+i,y:e.y})}reposition(t,e,i){const{width:n,height:a}=i.seriesRect,o=Ao.from(this.background.getBBox());let r=0;o.x1<0&&(r=-o.x1),o.x2>n&&(r=n-o.x2);const l=Math.min(e,a-o.y2);for(const e of t)if(Array.isArray(e)){const t=s.n1.Group.computeChildrenBBox(e).width;for(const i of e)Co(i,r-t/2),Lo(i,l)}else Co(e,r-e.getBBox().width/2),Lo(e,l);this.background.x+=r,this.background.y+=l}getTextStyles(t){return{fill:t.statistics.color,fontFamily:t.statistics.fontFamily,fontSize:t.statistics.fontSize,fontStyle:t.statistics.fontStyle,fontWeight:t.statistics.fontWeight,textBaseline:"top"}}getDividerStyles(t){return{stroke:t.statistics.divider.stroke,strokeOpacity:t.statistics.divider.strokeOpacity,strokeWidth:t.statistics.divider.strokeWidth}}getBackgroundStyles(t){return{fill:t.statistics.fill,stroke:t.statistics.stroke,strokeOpacity:t.statistics.strokeOpacity,strokeWidth:t.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(t,e){return e?.t("measurerDateRangeBars",{value:t})??`${t}`}formatDateRangeValue(t){const e=[],i=t>=0?"":"-";t=Math.abs(t);const s=36e5,n=24*s,a=Math.floor(t/6e4),o=Math.floor(t/s),r=Math.floor(t/n),l=o%24,h=a%60;return r>=1&&e.push(`${r}d`),o>=1&&(t<n||0!==l)&&e.push(`${l}h`),(t<s||0!==h)&&e.push(`${h}m`),e[0]=`${i}${e[0]}`,e.join(" ")}formatPriceRangeValue(t,e){return e?.t("measurerPriceRangeValue",{value:Number(t.toFixed(2))})??`${t}`}formatPriceRangePercentage(t,e){return e?.t("measurerPriceRangePercent",{value:t})??`${t}`}formatVolume(t,e){const i=isNaN(t)?"":this.volumeFormatter.format(t);return e?.t("measurerVolume",{value:i})??i}},No=class extends To{getDirectionStyles(t){return"down"===this.verticalDirection?t.down.statistics:t.up.statistics}getTextStyles(t){const e=this.getDirectionStyles(t);return{...super.getTextStyles(t),fill:e.color,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight}}getDividerStyles(t){const e=this.getDirectionStyles(t);return{stroke:e.divider.stroke,strokeOpacity:e.divider.strokeOpacity,strokeWidth:e.divider.strokeWidth}}getBackgroundStyles(t){const e=this.getDirectionStyles(t);return{...super.getBackgroundStyles(t),fill:e.fill,stroke:e.stroke,strokeOpacity:e.strokeOpacity,strokeWidth:e.strokeWidth}}},{Vec2:Oo,Vec4:Ro}=s.n1,Eo=class extends Gn{constructor(){super(),this.type="measurer",this.horizontalLine=new ua,this.verticalLine=new ua,this.horizontalStartLine=new ua,this.horizontalEndLine=new ua,this.verticalStartLine=new ua,this.verticalEndLine=new ua,this.horizontalEndCap=new xo,this.verticalEndCap=new xo,this.background=new s.n1.Path({zIndex:-1}),this.updateBackground=Na.updateBackground.bind(this),this.statistics=this.createStatisticsScene(),this.statistics.zIndex=1,this.append([this.background,this.verticalStartLine,this.verticalEndLine,this.horizontalStartLine,this.horizontalEndLine,this.horizontalLine,this.verticalLine,this.horizontalEndCap,this.verticalEndCap,this.start,this.end,this.statistics])}static is(t){return rn.isCheck(t,"measurer")}createStatisticsScene(){return new To}update(t,e){const i=Fe(t,e);if(null==i)return void(this.visible=!1);if(this.visible=t.visible??!0,!this.visible)return;const s=this.extendPerpendicular(i,t,e),n={...s,y2:s.y1},a={...s,y1:s.y2};this.verticalDirection=i.y1<i.y2?"down":"up",this.updateVisibilities(t),this.updateLines(t,i),this.updateHandles(t,i),this.updateText(t,i),this.updateCaps(t,i),this.updateBoundingLines(t,s),this.updateBackground(t,n,a,e),this.updateStatistics(t,i,e),this.updateAnchor(t,i,e)}extendPerpendicular(t,e,i){const s={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)},[n,a]=Oo.from(i.yAxis.bounds);return mi.is(e)?(e.extendAbove&&(s.y1=n.y),e.extendBelow&&(s.y2=a.y)):yi.is(e)&&(e.extendLeft&&(s.x1=n.x),e.extendRight&&(s.x2=a.x)),s}updateVisibilities(t){const{horizontalStartLine:e,horizontalEndLine:i,horizontalEndCap:s,verticalStartLine:n,verticalEndLine:a,verticalEndCap:o}=this,{direction:r}=t;n.visible="vertical"!==r,a.visible="vertical"!==r,s.visible="vertical"!==r,e.visible="horizontal"!==r,i.visible="horizontal"!==r,o.visible="horizontal"!==r}updateLines(t,e){const{horizontalLine:i,verticalLine:s}=this,{direction:n}=t,{x1:a,y1:o,x2:r,y2:l}=e,h=Oo.round(Ro.center(e),0),c=this.getLineStyles(t);"vertical"!==n&&i.setProperties({...c,x1:a,x2:r,y1:h.y,y2:h.y}),"horizontal"!==n&&s.setProperties({...c,x1:h.x,x2:h.x,y1:o,y2:l})}updateText(t,e){const{direction:i}=t,s=Oo.round(Ro.center(e),0);let n;const a={...e};"vertical"===i?(n=this.verticalLine,a.x1=s.x,a.x2=s.x):(n=this.horizontalLine,a.y1=s.y,a.y2=s.y),this.text=this.updateNode(pa,this.text,!!t.text.label);const{id:o}=n,r=ma(o,n,a,t.text,this.text,t.text.label,t.strokeWidth);let l;if("both"===i&&r&&this.text){const t=Ro.from(this.text.getBBox()),{offset:e}=r.numbers;t.x1<=s.x+e.x&&t.x2>=s.x-e.x&&(l={x:s.x,y:r.clipMask.y,radius:this.text.getBBox().height/2+Oo.length(e)})}this.verticalLine.setClipMask(o,l)}updateCaps(t,e){const{horizontalEndCap:i,verticalEndCap:s}=this,{direction:n}=t,{x1:a,y1:o,x2:r,y2:l}=e,h=Oo.round(Ro.center(e),0),{stroke:c,strokeWidth:d,strokeOpacity:u}=this.getLineStyles(t),p={stroke:c,strokeWidth:d,strokeOpacity:u};if("vertical"!==n){const t=a<=r?0:Math.PI;let e=r;"horizontal"===n&&(e+=a<=r?-2:2),i.update({...p,x:e,y:h.y,angle:t})}if("horizontal"!==n){const t=o<=l?Math.PI/2:Math.PI/-2;let e=l;"vertical"===n&&(e+=o<=l?-2:2),s.update({...p,x:h.x,y:e,angle:t})}}updateBoundingLines(t,e){const{verticalStartLine:i,verticalEndLine:s,horizontalStartLine:n,horizontalEndLine:a}=this,{direction:o}=t,{x1:r,y1:l,x2:h,y2:c}=e,d=this.getLineStyles(t);"horizontal"===o&&(i.setProperties({...d,x1:r,y1:l,x2:r,y2:c}),s.setProperties({...d,x1:h,y1:l,x2:h,y2:c})),"vertical"===o&&(n.setProperties({...d,x1:r,y1:l,x2:h,y2:l}),a.setProperties({...d,x1:r,y1:c,x2:h,y2:c}))}updateStatistics(t,e,i){const s=Oo.add(Ro.bottomCenter(e),Oo.from(0,10)),n={volume:this.getVolume(t)};t.hasPriceRange&&(n.priceRange={percentage:this.getPriceRangePercentage(t),value:this.getPriceRangeValue(t)}),t.hasDateRange&&(n.dateRange={bars:this.getDateRangeBars(e,i),value:this.getDateRangeValue(t)}),this.statistics.update(t,n,s,e,i,this.verticalDirection,t.localeManager)}updateAnchor(t,e,i,n){const a=Ro.topCenter(e);Oo.apply(this.anchor,s.n1.Transformable.toCanvasPoint(this.horizontalLine,a.x,a.y))}getBackgroundPoints(t,e,i,s){const[n,a]=Oo.from(e),[o,r]=Oo.from(i);return[n,a,r,o]}getLineStyles(t){const{lineDashOffset:e,stroke:i,strokeWidth:s,strokeOpacity:n}=t;return{lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,stroke:i,strokeWidth:s,strokeOpacity:n,fillOpacity:0}}getBackgroundStyles(t){const{background:e}=t;return{fill:e.fill,fillOpacity:e.fillOpacity}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}containsPoint(t,e){const{horizontalLine:i,text:s,verticalLine:n,horizontalStartLine:a,horizontalEndLine:o,verticalStartLine:r,verticalEndLine:l}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||n.isPointInPath(t,e)||a.visible&&a.isPointInPath(t,e)||o.visible&&o.isPointInPath(t,e)||r.visible&&r.isPointInPath(t,e)||l.visible&&l.isPointInPath(t,e)||Boolean(s?.containsPoint(t,e))}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.start.containsPoint(t,e)||this.end.containsPoint(t,e)?"handle":"line"}getDateRangeBars(t,e){const{step:i}=e.xAxis.scale,s=t.x1<=t.x2?1:-1;return i?Math.round(Ro.width(t)/i)*s:0}getDateRangeValue(t){const e=Pe(t.start.x),i=Pe(t.end.x);if(!(0,n.$P)(e)||!(0,n.$P)(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-e.getTime()}getPriceRangePercentage(t){if(null==t.start.y||null==t.end.y)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const e=Pe(t.end.y),i=Pe(t.start.y);if(!(0,n.Et)(e)||!(0,n.Et)(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(e-i)/i}getPriceRangeValue(t){if(null==t.start.y||null==t.end.y)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const e=Pe(t.end.y),i=Pe(t.start.y);if(!(0,n.Et)(e)||!(0,n.Et)(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return e-i}getVolume(t){return t.getVolume(t.start.x,t.end.x)}},Po=class extends Eo{constructor(){super(...arguments),this.type="quick-measurer"}static is(t){return rn.isCheck(t,"quick-measurer")}createStatisticsScene(){return new No}getDirectionStyles(t){return"down"===this.verticalDirection?t.down:t.up}getLineStyles(t){const e=this.getDirectionStyles(t);return{...super.getLineStyles(t),stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity}}getBackgroundStyles(t){const e=this.getDirectionStyles(t);return{fill:e.fill,fillOpacity:e.fillOpacity}}getHandleStyles(t){const e=this.getDirectionStyles(t);return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},{StateMachine:Bo,StateMachineProperty:Fo,Debug:zo}=s.n1,Go=class extends Bo{constructor(t){const e=({point:e})=>{const i=this.createDatum();i.set({start:e,end:e}),t.create(i)},i=({point:e})=>{const{datum:i,node:s}=this;i?.set({end:e}),s?.toggleActive(!0),s?.toggleHandles({end:!1}),t.update()},s=()=>{this.node?.toggleHandles({end:!0})},n=()=>t.delete();super("start",{start:{reset:Bo.parent,click:{target:"end",action:e},drag:{target:"end",action:e}},end:{hover:i,drag:i,click:{target:Bo.parent,action:s},dragEnd:{target:Bo.parent,action:s},reset:{target:Bo.parent,action:n},cancel:{target:Bo.parent,action:n},onExit:()=>{t.showAnnotationOptions(),is(this.datum)||t.recordAction(`Create ${this.node?.type} annotation`)}}}),this.debug=zo.create(!0,"annotations")}};r([Fo()],Go.prototype,"datum",2),r([Fo()],Go.prototype,"node",2);var _o=class extends Go{createDatum(){return new mi}},jo=class extends Go{createDatum(){return new yi}},Wo=class extends Go{createDatum(){return new fi}},Vo=class extends Go{createDatum(){return new xi}},Ko={type:"date-range",datum:mi,scene:Eo,isDatum:mi.is,translate:(t,e,i,s)=>{mi.is(e)&&Eo.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(mi.is(e)&&mi.is(i)&&Eo.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{mi.is(e)&&Eo.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new _o({...t,create:e("date-range")}),dragState:t=>new Us(t)},Yo={type:"price-range",datum:yi,scene:Eo,isDatum:yi.is,translate:(t,e,i,s)=>{yi.is(e)&&Eo.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(yi.is(e)&&yi.is(i)&&Eo.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{yi.is(e)&&Eo.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new jo({...t,create:e("date-range")}),dragState:t=>new Us(t)},$o={type:"date-price-range",datum:fi,scene:Eo,isDatum:fi.is,translate:(t,e,i,s)=>{fi.is(e)&&Eo.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(fi.is(e)&&fi.is(i)&&Eo.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{fi.is(e)&&Eo.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Wo({...t,create:e("date-range")}),dragState:t=>new Us(t)},Ho={type:"quick-date-price-range",datum:xi,scene:Po,isDatum:xi.is,translate:(t,e,i,s)=>{xi.is(e)&&Po.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(xi.is(e)&&xi.is(i)&&Po.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{xi.is(e)&&Po.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Vo({...t,create:e("quick-date-price-range")}),dragState:t=>new Us(t)},{ZIndexMap:Uo,TextWrapper:Xo}=s.n1,Zo=class extends Jn{constructor(){super(),this.type="note",this.shape=new s.n1.Rect,this.iconBackground=new s.n1.SvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new s.n1.SvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new s.n1.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(t){return rn.isCheck(t,"note")}update(t,e){this.updateIcon(t,e),super.update(t,e)}getTextBBox(t,e,i){const s=super.getTextBBox(t,e,i);s.x-=t.width/2,s.x=(0,n.qE)(0,s.x,i.seriesRect.width-t.width);const a=t.getPadding().top,o=s.y-30-2*a,r=s.y+an.HANDLE_SIZE+2*a;return o-s.height-34<0?(s.y=r,t.position="top"):(s.y=o+a,t.position="bottom"),s}updateLabel(t,e){const i=!1!==t.visible&&this.label.visible;super.updateLabel(t,e),this.label.visible=i,this.label.text=Xo.wrapText(t.text,{font:{fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},avoidOrphans:!1,textAlign:t.textAlign,textBaseline:"hanging",textWrap:"always",maxWidth:200})}updateShape(t,e){const{shape:i}=this;i.fill=t.background.fill,i.fillOpacity=t.background.fillOpacity??1,i.stroke=t.background.stroke,i.strokeOpacity=t.background.strokeOpacity??1,i.strokeWidth=t.background.strokeWidth??1,i.cornerRadius=4;const s=t.getPadding().top,n="top"===t.position;i.x=e.x-s,i.width=t.width+2*s,i.height=e.height+2*s,i.y=e.y+(n?0:-e.height)-s}updateIcon(t,e){const{active:i,iconBackground:s,iconLines:n}=this,{x:a,y:o}=ze(t,e);s.x=a-11,s.y=o-20,n.x=s.x,n.y=s.y,s.fill=t.fill,s.fillOpacity=t.fillOpacity??1,s.stroke=t.stroke,s.strokeOpacity=t.strokeOpacity??1,s.strokeWidth=t.strokeWidth??1,n.fill=t.stroke,s.fillShadow.color=i?t.fill??"rgba(0, 0, 0, 0.22)":"rgba(0, 0, 0, 0.22)"}updateAnchor(t,e,i){const s=t.getPadding().top,n="top"===t.position,a=n?1:-1;return{x:e.x+i.seriesRect.x+t.width/2,y:e.y+i.seriesRect.y+a*(e.height+s),position:n?"below":"above"}}getLabelCoords(t,e){const i="top"===t.position,s=t.getPadding().top+t.fontSize*Mi/2;return{x:e.x,y:e.y+(i?s/2:0)}}getTextBaseline(t){return"top"===t.position?"middle":t.position}getHandleCoords(t,e,i){return{x:e.x,y:e.y+an.HANDLE_SIZE/2+4}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.fill,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}toggleHovered(t){super.toggleHovered(t),this.label.visible=t,this.shape.visible=t,this.zIndex=t?Uo.CHART_ANNOTATION_FOCUSED:Uo.CHART_ANNOTATION}toggleActive(t){super.toggleActive(t),this.label.visible=t,this.shape.visible=t,this.active=t}containsPoint(t,e){return!(!this.shape.visible||!this.shape.containsPoint(t,e))||!!this.iconBackground.containsPoint(t,e)||super.containsPoint(t,e)}},qo=class extends aa{createDatum(){return new Ti}},Qo={type:"note",datum:Ti,scene:Zo,isDatum:Ti.is,translate:(t,e,i,s)=>{Ti.is(e)&&Zo.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Ti.is(e)&&Ti.is(i)&&Zo.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Ti.is(e)&&Zo.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new qo({...t,create:e("note")}),dragState:t=>new Us(t)},{Vec2:Jo,Vec4:tr}=s.n1,er=class extends Oa{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new an,topMiddle:new sn,topRight:new an,bottomLeft:new an,bottomMiddle:new sn,bottomRight:new an},this.middleLine=new ua,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(t){return rn.isCheck(t,"parallel-channel")}dragHandle(t,e,i,s){const{activeHandle:n,handles:a}=this;if(null==n)return;const{offset:o}=a[n].drag(e);a[n].toggleDragging(!0),"topMiddle"!==n&&"bottomMiddle"!==n||(o.x=0);let r=[],l=s;switch(n){case"topLeft":case"bottomLeft":r=["topLeft","bottomLeft"];break;case"topMiddle":r=["topLeft","topRight"],o.y-=sn.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":r=["topRight","bottomRight"];break;case"bottomMiddle":r=["bottomLeft","bottomRight"],o.y-=sn.HANDLE_SIZE/2,l=!1}const h=Fe(t,i),c=Fe(t.bottom,i);if(!h||!c)return;const d={topLeft:tr.start(h),topRight:tr.end(h),bottomLeft:tr.start(c),bottomRight:tr.end(c)},u={vectors:{topLeft:d.topRight,bottomLeft:d.bottomRight,topRight:d.topLeft,bottomRight:d.bottomLeft},angle:t.snapToAngle},p=gn(d,o,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,snap:l?u:void 0});t.start.x=p.topLeft.x,t.start.y=p.topLeft.y,t.end.x=p.topRight.x,t.end.y=p.topRight.y,t.height=p.topLeft.y-p.bottomLeft.y}getTranslatePointsVectors(t,e){const{bottomLeft:i,topLeft:s}=this.handles,n=i.getBBox().y-s.getBBox().y;return{start:t,end:e,bottomStart:Jo.add(t,Jo.from(0,n)),bottomEnd:Jo.add(e,Jo.from(0,n))}}containsPoint(t,e){return super.containsPoint(t,e)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(t,e)}getNodeAtCoords(t,e){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(t,e)?"line":super.getNodeAtCoords(t,e)}updateLines(t,e,i,s,n,a){const{topLine:o,middleLine:r,bottomLine:l}=this,{lineDashOffset:h,stroke:c,strokeOpacity:d,strokeWidth:u}=t,p=t.getLineDash(),g={lineCap:t.getLineCap(),lineDash:p,lineDashOffset:h,stroke:c,strokeOpacity:d,strokeWidth:u};o.setProperties({...e,...g}),l.setProperties({...i,...g});const m=this.extendLine({x1:n.x1,y1:a.y1+(n.y1-a.y1)/2,x2:n.x2,y2:a.y2+(n.y2-a.y2)/2},t,s);r.setProperties({...m,lineDash:t.middle.lineDash??p,lineDashOffset:t.middle.lineDashOffset??h,stroke:t.middle.stroke??c,strokeOpacity:t.middle.strokeOpacity??d,strokeWidth:t.middle.strokeWidth??u,visible:t.middle.visible??!0})}updateHandles(t,e,i){const{handles:{topLeft:s,topMiddle:n,topRight:a,bottomLeft:o,bottomMiddle:r,bottomRight:l}}=this,h={fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth};s.update({...h,...tr.start(e)}),a.update({...h,...tr.end(e)}),o.update({...h,...tr.start(i)}),l.update({...h,...tr.end(i)}),n.update({...h,...Jo.sub(tr.center(e),Jo.from(n.handle.width/2,n.handle.height/2))}),r.update({...h,...Jo.sub(tr.center(i),Jo.from(r.handle.width/2,r.handle.height/2))})}updateText(t,e,i){this.text=this.updateNode(pa,this.text,!!t.text.label),ya(!0,e,i,t.text,t.strokeWidth,this.text,t.text.label)}getBackgroundPoints(t,e,i,s){const n=e.x1>e.x2,a=e.y1>e.y2,o=e.x1!==i.x1&&e.y1!==i.y1,r=e.x2!==i.x2&&e.y2!==i.y2,l=Jo.from(e);return t.extendEnd&&r&&l.push(Jo.from(n?s.x1:s.x2,a?s.y1:s.y2)),l.push(...Jo.from(i).reverse()),t.extendStart&&o&&l.push(Jo.from(n?s.x2:s.x1,a?s.y2:s.y1)),l}},{StateMachine:ir,StateMachineProperty:sr,Debug:nr}=s.n1,ar=class extends ir{constructor(t){const e=({point:e})=>{const i=new Ji;i.set({start:e,end:e,height:0}),t.create(i)},i=({offset:e,context:i})=>{const{datum:s,snapping:n}=this;s&&(s.set({end:dn(e,i,n,s.start,s.snapToAngle)}),t.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},a=({point:e})=>{const{datum:i,node:s}=this,a=Pe(i?.end.y),o=Pe(i?.start.y),{y:r}=e;if(null==i||!(0,n.Et)(o)||!(0,n.Et)(a)||!(0,n.Et)(r))return;const l=a-(r??0),h=o-l;s?.toggleHandles(!0),t.validatePoint({x:i.start.x,y:h},{overflowContinuous:!0})&&t.validatePoint({x:i.end.x,y:e.y},{overflowContinuous:!0})&&(i.set({height:l}),t.recordAction("Create parallel-channel annotation"),t.showAnnotationOptions(),t.update())},o=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:ir.parent},"waiting-first-render":{render:{target:"end",action:()=>{const{node:t}=this;t?.toggleActive(!0),t?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})}}},end:{hover:i,drag:i,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:ir.parent,action:o},cancel:{target:ir.parent,action:o}},height:{hover:({point:e})=>{const{datum:i,node:s}=this,a=Pe(i?.end.y),o=Pe(i?.start.y),{y:r}=e;if(null==i||!(0,n.Et)(o)||!(0,n.Et)(a)||!(0,n.Et)(r))return;const l=a-(r??0),h=o-l;s?.toggleHandles({bottomLeft:!0,bottomRight:!0}),t.validatePoint({x:i.start.x,y:h},{overflowContinuous:!0})&&t.validatePoint({x:i.end.x,y:e.y},{overflowContinuous:!0})&&(i.set({height:l}),t.update())},click:{target:ir.parent,action:a},drag:{target:ir.parent,action:a},reset:{target:ir.parent,action:o},cancel:{target:ir.parent,action:o}}}),this.debug=nr.create(!0,"annotations"),this.snapping=!1}};r([sr()],ar.prototype,"datum",2),r([sr()],ar.prototype,"node",2),r([sr()],ar.prototype,"snapping",2);var or={type:"parallel-channel",datum:Ji,scene:er,isDatum:Ji.is,translate:(t,e,i,s)=>{Ji.is(e)&&er.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(Ji.is(e)&&Ji.is(i)&&er.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{Ji.is(e)&&er.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ar({...t,create:e("parallel-channel")}),dragState:t=>new Us(t)},rr=class extends Jn{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(t){return rn.isCheck(t,"text")}getHandleCoords(t,e){const i=an.HANDLE_SIZE/2;return{x:e.x+i,y:e.y+2+i}}},lr=class extends aa{createDatum(){return new es}},hr={type:"text",datum:es,scene:rr,isDatum:es.is,translate:(t,e,i,s)=>{es.is(e)&&rr.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(es.is(e)&&es.is(i)&&rr.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{es.is(e)&&rr.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new lr({...t,create:e("text")}),dragState:t=>new Us(t)},cr={[Mo.type]:Mo,[La.type]:La,[Aa.type]:Aa,[or.type]:or,[_a.type]:_a,[mo.type]:mo,[so.type]:so,[Qn.type]:Qn,[ra.type]:ra,[Qo.type]:Qo,[hr.type]:hr,[ko.type]:ko,[Rn.type]:Rn,[An.type]:An,[Ko.type]:Ko,[Yo.type]:Yo,[$o.type]:$o,[Ho.type]:Ho};function dr(t){for(const{isDatum:e}of Object.values(cr))if(e(t))return t}var{ActionOnSet:ur,ParallelStateMachine:pr,StateMachine:gr,StateMachineProperty:mr,Debug:yr}=s.n1,fr=class extends pr{constructor(t){super(new xr(t=>{this.snapping=t}),new br(()=>{this.node=null==this.active?void 0:t.node(this.active)}),new vr(t,e=>{this.active=e,this.datum=null==this.active?void 0:t.datum(this.active),this.node=null==this.active?void 0:t.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(t){return t===this.active}};r([mr()],fr.prototype,"snapping",2),r([mr()],fr.prototype,"datum",2),r([mr()],fr.prototype,"node",2);var xr=class extends gr{constructor(t){super("idle",{idle:{hover:({shiftKey:e})=>t(e),keyDown:({shiftKey:e})=>t(e),keyUp:({shiftKey:e})=>t(e),click:({shiftKey:e})=>t(e),drag:({shiftKey:e})=>t(e)},dragging:{},translating:{},"text-input":{}})}},br=class extends gr{constructor(t){super("idle",{idle:{onEnter:t,render:t},dragging:{onEnter:t,render:t},translating:{onEnter:t,render:t},"text-input":{render:t}})}},vr=class extends gr{constructor(t,e){const i=()=>{null!=this.active&&t.delete(this.active),this.active=void 0,t.select()},s={createDatum:e=>i=>{t.create(e,i),this.active=t.selectLast()}},n={...t,delete:i,showTextInput:()=>{null!=this.active&&t.showTextInput(this.active)},deselect:()=>{const e=this.active;this.active=void 0,this.hovered=void 0,t.select(this.active,e)},showAnnotationOptions:()=>{null!=this.active&&t.showAnnotationOptions(this.active)}},a=({colorPickerType:e,colorOpacity:i,color:s,opacity:n,isMultiColor:a})=>{this.datum&&("text-color"===e&&t.updateTextInputColor(s),ys(this.datum,e,i,s,n,a),t.update())},o=e=>{const{datum:i,node:s}=this;i&&s&&(os(i)?(i.fontSize=e,t.updateTextInputFontSize(e)):ps(i)&&(i.text.fontSize=e),t.update())},r=e=>{const{node:i}=this;i&&"setTextInputBBox"in i&&(i.setTextInputBBox(e),t.update())},l=({textInputValue:e,bbox:i})=>{const{datum:s}=this;if(null!=i&&null!=e&&e.length>0){if(!os(s))return;const n=Di(s,e,i.width);s.set({text:n}),t.update(),t.recordAction(`Change ${s.type} annotation text`)}else t.delete(this.active),t.recordAction(`Delete ${s?.type} annotation`)},h=()=>{t.updateTextInputBBox(void 0)},c=()=>null!=this.active,d=()=>{const{active:t,datum:e}=this;return null!=t&&!!e&&ps(e)&&!e.locked},u=()=>null!=this.active&&!is(this.datum);super("idle",{idle:{onEnter:()=>{t.select(this.active,this.active),this.hoverCoords&&(this.hovered=t.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:e})=>{this.hovered=t.hoverAtCoords(e,this.active,this.hovered),this.hoverCoords=e},translate:{guard:c,target:"translating",action:({translation:e})=>{t.startInteracting(),t.translate(this.active,e),t.update()}},copy:{guard:u,action:()=>{this.copied=t.copy(this.active)}},cut:{guard:u,action:()=>{this.copied=t.copy(this.active),i()}},paste:{guard:()=>null!=this.copied,action:()=>{t.paste(this.copied)}},selectLast:()=>{const e=this.active;this.active=t.selectLast(),t.select(this.active,e)},click:[{guard:()=>{const{active:t,hovered:e,datum:i}=this;return null!=t&&e===t&&!!i&&os(i)&&!i.locked},target:"text-input"},{action:()=>{const e=this.active;this.active=this.hovered,t.select(this.active,e)}}],dblclick:{guard:d,action:({offset:e})=>{const i="text"===t.getNodeAtCoords(e,this.active)?"text":"line";t.showAnnotationSettings(this.active,void 0,i)}},dragStart:[{guard:()=>null!=this.hovered,target:"dragging",action:()=>{const e=this.active;this.active=this.hovered,t.select(this.active,e),t.startInteracting()}},{action:()=>{const e=this.active;this.active=this.hovered,t.select(this.active,e)}}],color:{guard:c,action:a},fontSize:{guard:c,action:o},lineProps:{guard:c,action:e=>{const i=dr(this.datum);i?.set(e),t.update(),t.recordAction(`Change ${i?.type} ${Object.entries(e).map(([t,e])=>`${t} to ${e}`).join(", ")}`)}},lineStyle:{guard:c,action:e=>{const{datum:i,node:s}=this;i&&s&&hs(i)&&(ms(i,e),t.update())}},lineText:{guard:c,action:e=>{const i=dr(this.datum);ps(i)&&(ns(i)&&"center"===e.position&&(e.position="inside"),i.text.set(e),t.update())}},updateTextInputBBox:{guard:c,action:r},toolbarPressSettings:{guard:d,action:e=>{t.showAnnotationSettings(this.active,e)}},reset:()=>{null!=this.active&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,t.select(this.active,this.active),t.resetToIdle()},delete:()=>{null!=this.active&&(t.delete(this.active),is(this.datum)||t.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{t.deleteAll()},...Object.fromEntries(Object.entries(cr).map(([t,e])=>[t,e.createState(n,s)]))},dragging:{onEnter:(e,i)=>{if(null==this.active)return;const s=t.getAnnotationType(this.active);s&&(this.transitionRoot(s),this.transitionRoot("dragStart",i))},...Object.fromEntries(Object.entries(cr).map(([e,i])=>[e,i.dragState(t,s)]))},translating:{onEnter:()=>{},translate:{guard:c,target:"translating",action:({translation:e})=>{t.startInteracting(),t.translate(this.active,e),t.update()}},translateEnd:{guard:c,target:"idle"},onExit:()=>{t.stopInteracting(),t.update(),t.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(null==this.active)return;const e=dr(this.datum);e&&"getTextInputCoords"in e&&(t.startInteracting(),t.showTextInput(this.active),e.visible=!1,t.update())},updateTextInputBBox:{guard:c,action:r},resize:{target:"idle",action:l},click:{target:"idle",action:l},drag:{target:"idle",action:l},textInput:[{guard:Yn,target:"idle",action:h},{guard:$n,target:"idle",action:l}],color:{guard:c,action:a},fontSize:{guard:c,action:o},cancel:{target:"idle",action:h},onExit:()=>{t.stopInteracting(),t.hideTextInput();const e=this.active;if(this.active=this.hovered=void 0,t.select(this.active,e),null==e)return;const i=t.datum(e),s=t.node(e);i&&s&&(i.visible=!0)}}}),this.setActive=e,this.debug=yr.create(!0,"annotations"),this.snapping=!1}};r([ur({changeValue(t){this.setActive(t)}}),mr()],vr.prototype,"active",2),r([mr()],vr.prototype,"hovered",2),r([mr()],vr.prototype,"hoverCoords",2),r([mr()],vr.prototype,"copied",2),r([mr()],vr.prototype,"snapping",2),r([mr()],vr.prototype,"datum",2),r([mr()],vr.prototype,"node",2);var{ActionOnSet:Sr,LayoutElement:Mr,Menu:kr,PropertiesArray:Dr,ToolbarButtonProperties:wr,Property:Ir,ChartAxisDirection:Cr}=s.n1,Lr=class extends wr{};r([Ir],Lr.prototype,"value",2);var Ar=class extends s.n1.BaseProperties{constructor(t){super(),this.ctx=t,this.enabled=!0,this.padding=20,this.buttons=new Dr(Lr),this.events=new s.n1.Listeners,this.annotationMenu=new kr(this.ctx,"annotations"),this.destroyFns=[],this.toolbar=t.sharedToolbar.getSharedToolbar("annotations");const e=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",e),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),t.layoutManager.registerElement(Mr.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",e),this.toolbar.destroy()})}destroy(){for(const t of this.destroyFns)t()}addListener(t,e){return this.events.addListener(t,e)}toggleVisibility(t){this.toolbar.setHidden(!t)}toggleClearButtonEnabled(t){const e=this.buttons.findIndex(t=>"clear"===t.value);this.toolbar.toggleButtonEnabledByIndex(e,t)}resetButtonIcons(){for(const[t,e]of this.buttons.entries())switch(e.value){case"line-menu":this.updateButtonByIndex(t,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(t,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(t,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(t,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(t,{icon:"measurer-drawing",value:"measurer-menu"})}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}dispatch(t,e){this.events.dispatch(t,e)}onLayoutStart(t){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(t.layoutBox,this.padding))}refreshButtonsEnabled(t){for(const[e,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(e,t)}onToolbarButtonPress({event:t,button:e,buttonBounds:i}){const s=this.ctx.axisManager.getAxisContext(Cr.Y)[0].scale;switch(e.value){case"clear":this.dispatch("pressed-clear");break;case"line-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsLineAnnotations",ks.filter(t=>!t.visible||t.visible(s)));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsFibonacciAnnotations",Ds);break;case"text-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsTextAnnotations",Is);break;case"shape-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsShapeAnnotations",Cs);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsMeasurerAnnotations",Ls)}}onToolbarButtonPressShowMenu(t,e,i,s,n){this.dispatch("pressed-show-menu");const a=this.buttons.findIndex(t=>t.value===i);this.toolbar.toggleActiveButtonByIndex(a),this.annotationMenu.setAnchor({x:e.x+e.width+6,y:e.y}),this.annotationMenu.show({items:n,ariaLabel:this.ctx.localeManager.t(s),class:"ag-charts-annotations__toolbar-menu",sourceEvent:t.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,i)})}onButtonPressMenuCreateAnnotation(t,e){const i=this.buttons.findIndex(e=>e.value===t);this.updateButtonByIndex(i,{icon:e.icon}),this.dispatch("pressed-create-annotation",{annotation:e.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:t}){"Escape"===t.key&&this.dispatch("cancel-create-annotation")}updateButtonByIndex(t,e){const i=this.buttons.at(t);i&&(i.set({...i.toJson(),...e,value:e.value??i.value}),this.toolbar.updateButtonByIndex(t,{...i.toJson()}))}};r([Ir,Sr({changeValue(t){this.toolbar?.setHidden(!t)}})],Ar.prototype,"enabled",2),r([Ir],Ar.prototype,"padding",2),r([Ir],Ar.prototype,"buttons",2);var{BaseModuleInstance:Tr,InteractionState:Nr,Property:Or,ChartAxisDirection:Rr,getIconClassNames:Er}=s.n1,Pr="ag-charts-annotations__axis-button",Br=class extends Tr{constructor(t,e,i,s){super(),this.ctx=t,this.axisCtx=e,this.onButtonClick=i,this.seriesRect=s,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=Boolean(e.scale.bandwidth),t.domManager.addEventListener("focusin",({target:e})=>{const i=e instanceof HTMLElement?e:void 0;i&&t.domManager.contains(i,"series-area")||i===this.button.getElement()||this.hide()}),this.destroyFns.push(t.widgets.seriesWidget.addListener("drag-move",t=>this.onMouseDrag(t)),t.widgets.seriesWidget.addListener("mousemove",t=>this.onMouseMove(t)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),t.widgets.seriesDragInterpreter.addListener("click",t=>this.onClick(t)),t.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),t.zoomManager.addListener("zoom-pan-start",()=>this.hide()),t.zoomManager.addListener("zoom-change",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(t,e){this.seriesRect=t,this.padding=e}setup(){const t=new s.uB.ButtonWidget;return t.addClass(Pr),t.setTabIndex(-1),t.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(t.getElement()),t}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",Pr)}onMouseMove(t){this.ctx.interactionManager.isState(Nr.Clickable)&&this.show(t)}onMouseDrag(t){this.ctx.interactionManager.isState(Nr.AnnotationsMoveable)&&this.show(t)}onMouseLeave(){this.ctx.interactionManager.isState(Nr.Clickable)&&this.hide()}onClick(t){this.ctx.interactionManager.isState(Nr.Clickable)&&"touch"===t.device&&this.show(t)}show(t){const{sourceEvent:e,currentX:i,currentY:s}=t;if(!this.enabled||!this.ctx.widgets.seriesWidget.getElement().contains(e.target))return void this.hide();this.toggleVisibility(!0);const n=this.getButtonCoordinates({x:i,y:s});this.coords={x:n.x+this.button.clientWidth/2,y:n.y+this.button.clientHeight/2},this.updatePosition(n)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(Nr.Default)||this.hide()}getButtonCoordinates({x:t,y:e}){const{axisCtx:{direction:i,position:s},seriesRect:n,snap:a,axisCtx:o,padding:r}=this,{clientWidth:l,clientHeight:h}=this.button,[c,d]=[0,n.height],[u,p]=[0,n.width];if(a&&(t=Ge(je(t-n.x,o),o)+n.x,e=Ge(je(e-n.y,o),o)+n.y),i===Rr.X){const i=5,n=h-Math.max(0,r-i);t-=l/2,e="top"===s?c-h+n:d-n}else{const i=9,n=l-Math.max(0,r-i);t="left"===s?u-l+n:p-n,e-=h/2}return{x:t,y:e}}toggleVisibility(t){const{button:e}=this;if(null==e)return;const i=this.enabled&&t;this.toggleClass("-hidden",!i)}toggleClass(t,e){this.button.toggleClass(`${Pr}-${t}`,e)}updatePosition({x:t,y:e}){this.button.getElement().style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`}updateButtonElement(){const{button:t}=this;t.addListener("click",()=>this.onButtonClick(this.coords)),t.addListener("touchend",()=>this.onButtonClick(this.coords)),t.addListener("drag-start",()=>{}),t.setInnerHTML(`<span class="${Er("zoom-in")} ${Pr}-icon"></span>`)}};r([Or],Br.prototype,"enabled",2);var{Color:Fr,DraggablePopover:zr,NativeWidget:Gr,Vec2:_r,createButton:jr,createCheckbox:Wr,createSelect:Vr,createTextArea:Kr,initRovingTabIndex:Yr,getIconClassNames:$r,mapValues:Hr}=s.n1,Ur=class t extends zr{constructor(t,e){super(t,e),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new Ss(this.ctx,{detached:!0}),this.destroyFns.push(t.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(t,e){const i=super.showWithChildren(t,e);return i.classList.add("ag-charts-dialog"),i.setAttribute("role","dialog"),i.addEventListener("mousedown",t=>{t.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),i.addEventListener("keydown",this.onKeyDown.bind(this)),(0,n.zk)().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),i}updatePosition(t){super.updatePosition(t);const{anchor:e,fallbackAnchor:i}=this.getColorPickerAnchors()??{};e&&this.colorPicker.setAnchor(e,i)}createTabs(t,e,i){const s=(0,n.n)("div","ag-charts-dialog__tabs"),a=Hr(i,()=>(0,n.wW)()),o=Hr(i,()=>(0,n.wW)());for(const[t,e]of(0,n.jO)(i))(0,n.Wp)(e.panel,{id:o[t],role:"tabpanel","aria-labelledby":a[t]});const r=t=>{for(const[e,s]of(0,n.jO)(i))s.panel.classList.toggle("ag-charts-dialog__tab-panel--active",e===t),c[e].classList.toggle("ag-charts-dialog__tab-button--active",e===t),(0,n.Bq)(c[e],"aria-selected",e===t),e===t&&s.onShow?.()},l=new Gr((0,n.n)("div","ag-charts-dialog__header"));l.addListener("drag-start",t=>{const{sourceEvent:e}=t;e.target instanceof Element&&e.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(t)}),l.addListener("drag-move",t=>this.onDragMove(t)),l.addListener("drag-end",()=>this.onDragEnd());const h=new Zr;this.setDragHandle(h);const c=Hr(i,(t,e)=>jr({label:this.ctx.localeManager.t(t.label),onPress:()=>r(e)},{id:a[e],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":o[e]})),d=(0,n.n)("div","ag-charts-dialog__tab-list");(0,n.Wp)(d,{role:"tablist","aria-label":this.ctx.localeManager.t(t)}),d.append(...Object.values(c));const u=this.createHeaderCloseButton();return l.getElement().append(h.getElement(),d,u),s.append(l.getElement(),...Object.values(i).map(t=>t.panel)),r(e),Yr({orientation:"horizontal",buttons:Object.values(c)}),{tabs:s,initialFocus:c[e]}}createTabPanel(){return(0,n.n)("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return(0,n.n)("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:t,options:e,value:i,onChange:s}){const a=this.createInputGroup(t);(0,n.Wp)(a,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(t)});const o="ag-charts-dialog__button--active",r=[];for(const t of e){const{icon:e,altText:n}=t,l=this.ctx.localeManager.t(n),h=jr({icon:e,altText:l,onPress:()=>{for(const t of Array.from(a.children))t.classList.remove(o),t.ariaChecked="false";h.classList.add(o),h.ariaChecked="true",s(t.value)}},{"aria-checked":t.value===i,class:"ag-charts-dialog__button",role:"radio",title:l});t.value===i&&h.classList.add(o),a.appendChild(h),r.push(h)}return Yr({orientation:"horizontal",buttons:r}),a}createSelect({altText:t,label:e,options:i,value:s,onChange:n}){const a=this.createInputGroup(e),o=this.ctx.localeManager.t(t),r=Vr({value:s,options:i,onChange:n},{class:"ag-charts-dialog__select","aria-label":o,title:o});return a.append(r),a}createTextArea({placeholder:t,value:e,onChange:i}){const s=t?this.ctx.localeManager.t(t):void 0;return Kr({value:e,onChange:i},{placeholder:s})}createCheckbox({label:t,checked:e,onChange:i}){const s=(0,n.wW)(),a=this.createInputGroup(t,{for:s}),o=Wr({checked:e,onChange:i},{class:"ag-charts-dialog__checkbox",role:"switch",id:s});return a.append(o),a}createColorPicker({color:t,opacity:e,label:i,altText:s,onChange:n,onChangeHide:a,isMultiColor:o,hasMultiColorOption:r}){const l=this.createInputGroup(i),h=this.ctx.localeManager.t(s),c=jr({label:h,onPress:i=>{const{anchor:s,fallbackAnchor:l}=this.getColorPickerAnchors(c)??{};this.colorPicker.show({anchor:s,fallbackAnchor:l,color:t,opacity:e,isMultiColor:o,hasMultiColorOption:r,sourceEvent:i,onChange:(t,e,i,s)=>{c.style.setProperty("--color",t),c.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",s),n(t,e,i,s)},onChangeHide:a})}},{"aria-label":h,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:h});if(o)c.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(t){const i=Fr.fromString(t),s=new Fr(i.r,i.g,i.b,e);c.style.setProperty("--color",s.toHexString())}return l.append(c),this.hideFns.push(()=>{this.colorPicker.hide()}),l}createHeaderCloseButton(){return jr({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(t,e){const i=(0,n.n)("div","ag-charts-dialog__input-group"),s=(0,n.n)("label","ag-charts-dialog__input-group-label");return s.innerText=this.ctx.localeManager.t(t),(0,n.Bq)(s,"for",e?.for),i.appendChild(s),i}onLayoutComplete(t){this.seriesRect=t.series.paddedRect,this.reposition()}onKeyDown(t){t.altKey||t.ctrlKey||t.metaKey||t.isComposing||"Escape"!==t.key||this.hide()}reposition(){const{seriesRect:e,ctx:i}=this,s=i.domManager.getBoundingClientRect(),n=this.getPopoverElement();if(!e||!n)return;const a=_r.from(0,e.y),o=_r.from(s.width,e.height),r=_r.from(n),l=_r.from(.5,1);let h;if(e.width>1e3){const e=_r.sub(_r.add(a,_r.multiply(o,l)),_r.multiply(r,l));h=_r.sub(e,_r.from(0,t.offset))}else{const e=_r.sub(_r.add(a,o),r);h=_r.sub(e,t.offset)}this.updatePosition(h)}getColorPickerAnchors(t){if(t&&(this.colorPickerAnchorElement=t),!this.colorPickerAnchorElement)return;const e=this.colorPickerAnchorElement.getBoundingClientRect(),i=this.ctx.domManager.getBoundingClientRect(),s=_r.sub(_r.from(e.x,e.y),_r.from(i.left,i.top));return{anchor:_r.add(s,_r.from(0,e.height+5)),fallbackAnchor:_r.sub(s,_r.from(0,5))}}};Ur.offset=60;var Xr=Ur,Zr=class extends Gr{constructor(){super((0,n.n)("div","ag-charts-dialog__drag-handle"));const t=new Gr((0,n.n)("span",$r("drag-handle")));t.setAriaHidden(!0),this.addChild(t)}},{Listeners:qr,focusCursorAtEnd:Qr}=s.n1,Jr=class extends Xr{constructor(t){super(t,"settings"),this.events=new qr,this.hideFns.push(()=>this.events.dispatch("hidden"))}addListener(t,e){return this.events.addListener(t,e)}show(t,e){const i=this.createLinearLineTab(t,e),s=this.createLinearTextTab(t,e);let n="dialogHeaderLine";ns(t)?n="dialogHeaderChannel":as(t)?n="dialogHeaderFibonacciRange":"date-range"===t.type?n="dialogHeaderDateRange":"price-range"===t.type?n="dialogHeaderPriceRange":"date-price-range"===t.type&&(n="dialogHeaderDatePriceRange");const{tabs:a,initialFocus:o}=this.createTabs("ariaLabelSettingsTabBar",e.initialSelectedTab,{line:{label:n,panel:i},text:{label:"dialogHeaderText",panel:s.panel,onShow:s.onShow}});e.initialFocus=o,this.showWithChildren([a],e).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(t,e){const i=this.createTabPanel(),s=this.createInputGroupLine(),n=this.createInputGroupLine(),a="isMultiColor"in t,o=this.createColorPickerInput("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),!!a&&t.isMultiColor,a,e.onChangeLineColor,e.onChangeHideLineColor),r=this.createStrokeWidthSelect(t.strokeWidth??2,e.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(t.lineStyle??"solid",e.onChangeLineStyleType);if(s.append(o),"background"in t){const i=this.createColorPickerInput("fill-color",t.getDefaultColor("fill-color"),t.getDefaultOpacity("fill-color"),!1,!1,e.onChangeFillColor,e.onChangeHideFillColor);s.append(i),n.append(r)}else"showFill"in t?(s.append(this.createCheckbox({label:"dialogInputShowFill",checked:t.showFill??!0,onChange:t=>e.onChangeLine({showFill:t})})),n.append(r)):s.append(r);return n.append(l),i.append(s,n),"bands"in t&&i.append(this.createFibonacciRatioSelect(t.bands??10,t=>e.onChangeLine({bands:t}))),"extendStart"in t&&"extendEnd"in t&&i.append(this.createCheckbox({label:ns(t)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:t.extendStart??!1,onChange:t=>e.onChangeLine({extendStart:t})}),this.createCheckbox({label:ns(t)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:t.extendEnd??!1,onChange:t=>e.onChangeLine({extendEnd:t})})),"extendAbove"in t&&"extendBelow"in t&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:t.extendAbove??!1,onChange:t=>e.onChangeLine({extendAbove:t})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:t.extendBelow??!1,onChange:t=>e.onChangeLine({extendBelow:t})})),"extendLeft"in t&&"extendRight"in t&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:t.extendLeft??!1,onChange:t=>e.onChangeLine({extendLeft:t})}),this.createCheckbox({label:"dialogInputExtendRight",checked:t.extendRight??!1,onChange:t=>e.onChangeLine({extendRight:t})})),"reverse"in t&&"showFill"in t&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:t.reverse??!1,onChange:t=>e.onChangeLine({reverse:t})})),i}createLinearTextTab(t,e){const i=this.createTabPanel(),s=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:t.text.label,onChange:t=>e.onChangeText({label:t})}),n=this.createFontSizeSelect(t.text.fontSize,e.onChangeTextFontSize),a=this.createColorPickerInput("text-color",t.text.color,1,!1,!1,e.onChangeTextColor,e.onChangeHideTextColor),o="inside"===t.text.position?"center":t.text.position,r=this.createPositionRadioGroup(o??"top",t=>e.onChangeText({position:t})),l=this.createAlignmentRadioGroup(t.text.alignment??"center",t=>e.onChangeText({alignment:t})),h=this.createInputGroupLine();return h.append(n,a,r,l),i.append(s,h),{panel:i,onShow:()=>Qr(s)}}createColorPickerInput(t,e,i,s,n,a,o){const r="fill-color"===t?"dialogInputFillColorPicker":"dialogInputColorPicker",l="fill-color"===t?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:r,altText:l,color:e,opacity:i,isMultiColor:s,hasMultiColorOption:n,onChange:a,onChangeHide:o})}createStrokeWidthSelect(t,e){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:As.map(({label:t,value:e})=>({label:t,value:`${e}`})),value:String(t),onChange:t=>e(Number(t))})}createFibonacciRatioSelect(t,e){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:ws.map(({label:t,value:e})=>({label:t,value:`${e}`})),value:String(t),onChange:t=>e(Number(t))})}createLineStyleRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:t,onChange:e})}createFontSizeSelect(t,e){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:Ns.map(({label:t,value:e})=>({label:t,value:String(e)})),value:String(t),onChange:t=>e(Number(t))})}createPositionRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:t,onChange:e})}createAlignmentRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:"iconAltTextAlignLeft",value:"left"},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:"iconAltTextAlignRight",value:"right"}],value:t,onChange:e})}};function tl(t){return t.gridPadding+t.seriesAreaPadding+t.tickSize+t.label.spacing}var{ChartUpdateType:el,InteractionState:il,ObserveChanges:sl,PropertiesArray:nl,Property:al,ChartAxisDirection:ol,Vec2:rl,keyProperty:ll,valueProperty:hl,Selection:cl,BBox:dl}=s.n1,ul=class t extends s.n1.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,this.toolbar=new Ar(this.ctx),this.optionsToolbar=new Vs(this.ctx,()=>{const t=this.state.getActive();if(null!=t)return dr(this.annotationData.at(t))}),this.axesButtons=new oe,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new nl(t.createAnnotationDatum),this.defaults=new xs,this.container=new s.n1.Group({name:"static-annotations"}),this.annotations=new cl(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new Jr(this.ctx),this.textInput=new se(this.ctx),this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(e.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this))}setupStateMachine(){const{ctx:t}=this;return new fr({resetToIdle:()=>{t.domManager.updateCursor("annotations"),this.popAnnotationState(il.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(e,i,s)=>{let n;return this.annotations.each((t,s,a)=>{const o=t.containsPoint(e.x,e.y);o&&(n??(n=a)),t.toggleHovered(o||i===a)}),null!=n?t.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||t.tooltipManager.unsuppressTooltip("annotations"),this.ctx.domManager.updateCursor("annotations",null==n?void 0:this.annotations.at(n)?.getCursor()),n!==s&&this.update(),n},getNodeAtCoords:(t,e)=>{const i=this.annotations.at(e);if(i)return i.getNodeAtCoords(t.x,t.y)},translate:(t,e)=>{const i=this.annotations.at(t),s=dr(this.annotationData.at(t));if(i&&s)return this.translateNode(i,s,e)},copy:t=>{const e=this.annotations.at(t),i=dr(this.annotationData.at(t));if(e&&i)return this.createAnnotationDatumCopy(e,i)},paste:t=>{this.createAnnotation(t.type,t,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(t,e)=>{const{annotations:i,optionsToolbar:s,toolbar:n}=this;this.hideOverlays(),n.clearActiveButton(),n.resetButtonIcons();const a=null!=t?i.at(t):null,o=null!=e?i.at(e):null;o===a&&null!=a||(o?.toggleActive(!1),s.hide(),a?(this.pushAnnotationState(il.AnnotationsSelected),a.toggleActive(!0),s.updateButtons(this.annotationData.at(t)),this.postUpdateFns.push(()=>{s.show(),s.setAnchorScene(a)})):(this.popAnnotationState(il.AnnotationsSelected),this.popAnnotationState(il.Annotations)),this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(il.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(il.Annotations)},stopInteracting:()=>{this.popAnnotationState(il.Annotations)},create:(t,e)=>{this.createAnnotation(t,e)},delete:t=>{this.annotationData.splice(t,1)},deleteAll:()=>{this.annotationData.splice(0,this.annotationData.length)},validatePoint:(t,e)=>{const i=this.getAnnotationContext();return!i||Ua(i,t,e)},getAnnotationType:t=>function(t){for(const e of le)if(e===t)return e}(this.annotationData[t].type),datum:t=>this.annotationData.at(t),node:t=>this.annotations.at(t),recordAction:t=>{this.recordActionAfterNextUpdate(t)},update:()=>{this.postUpdateFns.push(()=>{const t=this.state.getActive(),e=null!=t?this.annotations.at(t):null;null!=e&&this.optionsToolbar.setAnchorScene(e)}),this.update()},showTextInput:t=>{const e=dr(this.annotationData.at(t));if(!(this.annotations.at(t)&&e&&"getTextInputCoords"in e&&"getTextPosition"in e))return;const i={color:e.color,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight,placeholderColor:e.getPlaceholderColor()},s=this.getAnnotationContext();this.textInput.show({styles:i,layout:{getTextInputCoords:t=>rl.add(e.getTextInputCoords(s,t),rl.required(this.seriesRect)),getTextPosition:()=>e.getTextPosition(),alignment:e.alignment,textAlign:e.textAlign,width:e.width},text:e.text,placeholderText:e.placeholderText,onChange:(t,e)=>{this.state.transition("updateTextInputBBox",e)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:t=>{this.textInput.updateColor(t)},updateTextInputFontSize:t=>{const e=this.textInput.updateFontSize(t);this.state.transition("updateTextInputBBox",e)},updateTextInputBBox:t=>{this.state.transition("updateTextInputBBox",t)},showAnnotationOptions:t=>{const e=this.annotations.at(t);e&&!is(this.annotationData.at(t))&&(this.optionsToolbar.updateButtons(this.annotationData.at(t)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(e))},showAnnotationSettings:(t,e,i="line")=>{const s=this.annotationData.at(t);if(!ss(s)&&!ns(s)&&!rs(s))return;if(is(s))return;const n=t=>(e,i,n,a)=>{this.setColorAndDefault(s.type,t,e,i,n,a),this.optionsToolbar.updateColorPickerColor(t,i,n,a)},a=t=>()=>{this.recordActionAfterNextUpdate(`Change ${s.type} ${t} to ${s.getDefaultColor(t)}`,["annotations","defaults"]),this.update()},o={initialSelectedTab:i,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:e,onChangeLine:t=>{this.state.transition("lineProps",t),null!=t.bands&&this.defaults.setDefaultFibonacciOptions(s.type,"bands",t.bands),null!=t.reverse&&this.defaults.setDefaultFibonacciOptions(s.type,"reverse",t.reverse),null!=t.showFill&&this.defaults.setDefaultFibonacciOptions(s.type,"showFill",t.showFill)},onChangeText:t=>{this.state.transition("lineText",t),t.alignment&&this.defaults.setDefaultLineTextAlignment(s.type,t.alignment),t.position&&this.defaults.setDefaultLineTextPosition(s.type,t.position),this.recordActionAfterNextUpdate(`Change ${s.type} text ${Object.keys(t).map(e=>`${e} to ${t[e]}`).join(", ")}`)},onChangeFillColor:n("fill-color"),onChangeHideFillColor:a("fill-color"),onChangeLineColor:n("line-color"),onChangeHideLineColor:a("line-color"),onChangeLineStyleType:t=>{this.setLineStyleTypeAndDefault(s.type,t),this.optionsToolbar.updateLineStyleType(Ts.find(e=>e.value===t)??Ts[0])},onChangeLineStyleWidth:t=>{this.setLineStyleWidthAndDefault(s.type,t),this.optionsToolbar.updateStrokeWidth({strokeWidth:t,value:t,label:String(t)})},onChangeTextColor:n("text-color"),onChangeHideTextColor:a("text-color"),onChangeTextFontSize:t=>{this.setFontSizeAndDefault(s.type,t)}};this.settingsDialog.show(s,o)}})}setupListeners(){const{ctx:t,optionsToolbar:e,settingsDialog:i,toolbar:s}=this,{seriesWidget:n,seriesDragInterpreter:a,chartWidget:o}=t.widgets;this.destroyFns.push(a.addListener("click",this.hoverTouchPreHandler.bind(this)),a.addListener("drag-start",this.hoverTouchPreHandler.bind(this)),a.addListener("drag-move",this.dragMoveTouchPreHandler.bind(this)),a.addListener("mousemove",this.onHover.bind(this)),a.addListener("click",this.onClick.bind(this)),a.addListener("dblclick",this.onDoubleClick.bind(this)),a.addListener("drag-start",this.onDragStart.bind(this)),a.addListener("drag-move",this.onDrag.bind(this)),a.addListener("drag-end",this.onDragEnd.bind(this)),n.addListener("keydown",this.onKeyDown.bind(this)),n.addListener("keyup",this.onKeyUp.bind(this)),o.addListener("click",this.onCancel.bind(this)),t.annotationManager.addListener("restore-annotations",this.onRestoreAnnotations.bind(this)),t.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),t.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),t.zoomManager.addListener("zoom-change",()=>this.onResize()),t.domManager.addListener("resize",()=>this.onResize()),s.addListener("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),s.addListener("pressed-create-annotation",({annotation:t})=>{this.cancel(),this.pushAnnotationState(il.Annotations),this.state.transition(t),this.update()}),s.addListener("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),s.addListener("pressed-show-menu",()=>{this.cancel(),this.reset()}),s.addListener("pressed-unrelated",()=>{this.reset()}),e.addListener("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),e.addListener("pressed-settings",({sourceEvent:t})=>{this.state.transition("toolbarPressSettings",t)}),e.addListener("pressed-lock",()=>{this.update()}),e.addListener("hid-overlays",()=>{this.settingsDialog.hide()}),e.addListener("saved-color",({type:t,colorPickerType:e,color:i})=>{this.recordActionAfterNextUpdate(`Change ${t} ${e} to ${i}`,["annotations","defaults"])}),e.addListener("updated-color",({type:t,colorPickerType:e,colorOpacity:i,color:s,opacity:n,isMultiColor:a})=>{this.setColorAndDefault(t,e,i,s,n,a)}),e.addListener("updated-font-size",({type:t,fontSize:e})=>{this.setFontSizeAndDefault(t,e)}),e.addListener("updated-line-style",({type:t,lineStyleType:e})=>{this.setLineStyleTypeAndDefault(t,e)}),e.addListener("updated-line-width",({type:t,strokeWidth:e})=>{this.setLineStyleWidthAndDefault(t,e)}),i.addListener("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:t,toolbar:e}=this;this.destroyFns.push(t.annotationManager.attachNode(this.container),()=>t.domManager.removeStyles(Pr),()=>e.destroy())}async processData(t){if(!this.enabled||null==this.data||null==this.xKey||null==this.volumeKey)return;const e=[ll(this.xKey,void 0,{id:"date"}),hl(this.volumeKey,"number",{id:"volume"})],{dataModel:i,processedData:s}=await t.request("annotations",this.data,{props:e});this.dataModel=i,this.processedData=s}createAnnotationScene(t){if(t.type in cr)return new cr[t.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${t.type}], expected one of [${Object.keys(cr)}], ignoring.`)}static createAnnotationDatum(t){if(t.type in cr)return(new cr[t.type].datum).set(t);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${t.type}], expected one of [${Object.keys(cr)}], ignoring.`)}createAnnotation(t,e,i=!0){if(this.annotationData.push(e),i){const i=this.ctx.annotationManager.getAnnotationTypeStyles(t);i&&e.set(i),this.defaults.applyDefaults(e)}this.injectDatumDependencies(e),this.update()}injectDatumDependencies(t){"setLocaleManager"in t&&t.setLocaleManager(this.ctx.localeManager),"getVolume"in t&&(t.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(t,e){const{dataModel:i,processedData:s}=this;let a=Pe(t),o=Pe(e);if(!((0,n.vd)(a)&&(0,n.vd)(o)&&i&&s&&null!=this.volumeKey))return;a>o&&([a,o]=[o,a]);const r=i.resolveKeysById({id:"annotations"},"date",s),l=i.resolveColumnById({id:"annotations"},"volume",s);let h=0;for(let t=0;t<s.input.count;t++){const e=r[t];(0,n.vd)(e)&&e>=a&&e<=o&&(h+=l[t])}return h}translateNode(t,e,i){const s=this.getAnnotationConfig(e),n=this.getAnnotationContext();n&&s.translate(t,e,i,n)}createAnnotationDatumCopy(t,e){const i=this.getAnnotationConfig(e),s=new i.datum;s.set(e.toJson());const n=this.getAnnotationContext();if(n)return i.copy(t,e,s,n)}getAnnotationConfig(t){if(t.type in cr)return cr[t.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${t.type}], expected one of [${Object.keys(cr)}], ignoring.`)}onRestoreAnnotations(t){this.enabled&&(this.clear(),this.annotationData.set(t.annotations),this.postUpdateFns.push(()=>{this.ctx.annotationManager.fireChangedEvent()}),this.update())}onLayoutComplete(t){const e=t.series.paddedRect;this.seriesRect=e,this.container.setClipRect(e);for(const i of t.axes??[])i.direction===s.n1.ChartAxisDirection.X?this.xAxis=this.getAxis(i,e,this.xAxis?.button):this.yAxis=this.getAxis(i,e,this.yAxis?.button);this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const t=this.ctx.chartService.series.some(t=>t.hasData),e=this.yAxis.context.seriesIds().some(t=>{const e=this.ctx.chartService.series.find(e=>e.id===t);return e?.visible});return t&&e}animateAnnotations({from:t,to:e,phase:i}){const{annotations:s}=this;this.ctx.animationManager?.animate({from:t,to:e,id:"chart-annotations",phase:i,groupId:"opacity",onUpdate(t){s.each(e=>{e.opacity=t,"setAxisLabelOpacity"in e&&e.setAxisLabelOpacity(t)})},onStop(){s.each(t=>{t.opacity=e,"setAxisLabelOpacity"in t&&t.setAxisLabelOpacity(e)})}})}onPreRender(){this.updateAnnotations(),this.state.transition("render")}getAxis(t,e,i){const s=this.ctx.axisManager.getAxisContext(t.direction)[0],{position:n="bottom",direction:a}=s,o=t.gridPadding+t.seriesAreaPadding,r=new dl(0,0,e.width,e.height).grow(o,n),l=s.direction===ol.X?"vertical":"horizontal",{axesButtons:h,snap:c}=this;if(this.enabled&&h.enabled&&("xy"===h.axes||h.axes===a)){i??(i=new Br(this.ctx,{...s,snapToGroup:c},t=>this.onAxisButtonClick(t,l),e));const n=tl(t);i.update(e,n)}else i?.destroy(),i=void 0;return{layout:t,context:s,bounds:r,button:i}}recordActionAfterNextUpdate(t,e=["annotations"]){const{defaults:i,ctx:{annotationManager:s,historyManager:n}}=this,a=e.map(t=>"defaults"===t?i:s);this.postUpdateFns.push(()=>{n.record(t,...a),s.fireChangedEvent()})}setColorAndDefault(t,e,i,s,n,a){this.state.transition("color",{colorPickerType:e,colorOpacity:i,color:s,opacity:n,isMultiColor:a}),this.defaults.setDefaultColor(t,e,i,s,n,a)}setFontSizeAndDefault(t,e){this.state.transition("fontSize",e),this.defaults.setDefaultFontSize(t,e),this.recordActionAfterNextUpdate(`Change ${t} font size to ${e}`,["annotations","defaults"])}setLineStyleTypeAndDefault(t,e){this.state.transition("lineStyle",{type:e}),this.defaults.setDefaultLineStyleType(t,e),this.recordActionAfterNextUpdate(`Change ${t} line style to ${e}`,["annotations","defaults"])}setLineStyleWidthAndDefault(t,e){this.state.transition("lineStyle",{strokeWidth:e}),this.defaults.setDefaultLineStyleWidth(t,e),this.recordActionAfterNextUpdate(`Change ${t} stroke width to ${e}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:t,annotations:e,seriesRect:i,ctx:{annotationManager:s}}=this,n=this.getAnnotationContext();if(!i||!n)return;s.updateData(t.toJson().filter(t=>!is(t)));const a=this.showAnnotations();this.toolbar.refreshButtonsEnabled(a),this.toolbar.toggleClearButtonEnabled(t.length>0&&a),e.update(t??[],void 0,t=>t.id).each((t,e)=>{if(!a)return t.visible=!1,void("setAxisLabelVisible"in t&&t.setAxisLabelVisible(!1));"setAxisLabelVisible"in t&&t.setAxisLabelVisible(!0),this.injectDatumDependencies(e),function(t,e,i){for(const{update:s}of Object.values(cr))s(t,e,i)}(t,e,n)}),this.postUpdateFns.forEach(t=>t()),this.postUpdateFns=[]}getAnnotationContext(){const{seriesRect:t,xAxis:e,yAxis:i,snap:s}=this;if(t&&e&&i)return{seriesRect:t,xAxis:{...e.context,bounds:e.bounds,labelPadding:tl(e.layout),snapToGroup:s},yAxis:{...i.context,bounds:i.bounds,labelPadding:tl(e.layout),snapToGroup:s}}}onHover(t){const{state:e}=this,i=this.getAnnotationContext();if(!i)return;const s=t.sourceEvent.shiftKey,n=rl.from(t),a=_e(n,i);e.transition("hover",{offset:n,point:a,shiftKey:s,context:i})}onClick(t){const{state:e}=this,i=this.getAnnotationContext();if(!i)return;const s=t.sourceEvent.shiftKey,n=_e(rl.from(t),i),a=this.textInput.getValue(),o=this.textInput.getBBox();e.transition("click",{point:n,shiftKey:s,textInputValue:a,bbox:o})}onDoubleClick(t){const{state:e}=this;if(!this.getAnnotationContext())return;const i=rl.from(t);e.transition("dblclick",{offset:i})}onAxisButtonClick(t,e){this.cancel(),this.reset();const i=this.getAnnotationContext();if(!this.annotationData||!i)return;const{state:s}=this;this.pushAnnotationState(il.Annotations);const n="horizontal"===e;if(s.transition(n?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!t)return;const a=_e(t,i);Ua(i,a)&&(s.transition("click",{point:a,shiftKey:!1}),this.update())}onResize(){const t=this.textInput.getValue(),e=this.textInput.getBBox();this.state.transition("resize",{textInputValue:t,bbox:e})}hoverTouchPreHandler(t){"touch"===t.device&&this.onHover(t)}dragMoveTouchPreHandler(t){"touch"===t.device&&this.ctx.interactionManager.isState(il.AnnotationsSelected)&&t.sourceEvent.preventDefault()}onDragStart(t){if(!this.ctx.interactionManager.isState(il.AnnotationsDraggable))return;const e=this.getAnnotationContext();if(!e)return;const i=rl.from(t),s=_e(i,e),n=this.textInput.getValue(),a=this.textInput.getBBox();this.state.transition("dragStart",{context:e,offset:i,point:s,textInputValue:n,bbox:a})}onDrag(t){if(!this.ctx.interactionManager.isState(il.AnnotationsDraggable))return;const e=this.getAnnotationContext();if(!e)return;const i=rl.from(t),s=_e(i,e),n=t.sourceEvent.shiftKey,a=this.textInput.getValue(),o=this.textInput.getBBox();this.state.transition("drag",{context:e,offset:i,point:s,shiftKey:n,textInputValue:a,bbox:o})}onDragEnd(){this.state.transition("dragEnd")}onCancel(t){const{sourceEvent:e}=t??{};e?.currentTarget===e?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(t){const{state:e}=this,i=this.getAnnotationContext();if(!i)return;const{key:s,shiftKey:n}=t,a=this.textInput.getValue(),o=this.textInput.getBBox();e.transition("textInput",{key:s,shiftKey:n,textInputValue:a,bbox:o,context:i})}onKeyDown(t){const{state:e}=this,i=this.getAnnotationContext();if(!i)return;const{sourceEvent:s}=t,{shiftKey:n,ctrlKey:a,metaKey:o}=s,r=a||o,l=a||n;e.transition("keyDown",{shiftKey:n,context:i});const h={x:0,y:0},c=Math.max(i?.xAxis.scale.bandwidth??0,l?10:1),d=Math.max(i?.yAxis.scale.bandwidth??0,l?10:1);switch(s.key){case"ArrowDown":h.y=d;break;case"ArrowUp":h.y=-d;break;case"ArrowLeft":h.x=-c;break;case"ArrowRight":h.x=c;break;case"Escape":return void this.onCancel();case"Backspace":case"Delete":return void this.onDelete()}if((h.x||h.y)&&(e.transition("translate",{translation:h}),s.stopPropagation(),s.preventDefault()),r)switch(s.key){case"c":return void e.transition("copy");case"x":return e.transition("cut"),void this.recordActionAfterNextUpdate("Cut annotation");case"v":return e.transition("paste"),void this.recordActionAfterNextUpdate("Paste annotation")}}onKeyUp(t){const{shiftKey:e}=t.sourceEvent,i=this.getAnnotationContext();i&&(this.state.transition("keyUp",{shiftKey:e,context:i}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){for(const[t,e]of this.annotationData.entries())is(e)&&this.annotationData.splice(t,1)}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(t){this.ctx.interactionManager.pushState(t),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(t){this.ctx.interactionManager.popState(t),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(il.Annotations)||this.ctx.interactionManager.isState(il.AnnotationsSelected)}update(t=el.PRE_SCENE_RENDER){this.ctx.updateService.update(t)}};r([sl((t,e,i)=>{const{ctx:{annotationManager:s,stateManager:n}}=t;e!==i&&(t.toolbar?.toggleVisibility(Boolean(e)),!1===i&&!0===e?n.restoreState(s):!1===e&&t.clear())}),al],ul.prototype,"enabled",2),r([al],ul.prototype,"toolbar",2),r([al],ul.prototype,"optionsToolbar",2),r([al],ul.prototype,"axesButtons",2),r([al],ul.prototype,"snap",2);var pl=ul,{FONT_SIZE_RATIO:gl,ThemeSymbols:ml}=s.n1,yl={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},fl={fill:ml.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},xl={color:{$ref:"backgroundColor"},fontSize:{$rem:[gl.LARGE]},fontFamily:{$ref:"fontFamily"}},bl={...xl,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},vl={...xl,textAlign:"left"},Sl={...xl,position:"top",alignment:"center",color:{$ref:"textColor"}},Ml={...xl,position:"top",alignment:"center",color:{$ref:"textColor"}},kl={...xl,fontSize:{$ref:"fontSize"},color:ml.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:ml.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:ml.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:ml.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},Dl={...yl,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...fl},text:{...Sl},statistics:{...kl}},wl={type:"root",optionsKey:"annotations",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new pl(t),themeTemplate:{annotations:{enabled:!1,line:{...yl,handle:{...fl},text:{...Sl}},"horizontal-line":{...yl,handle:{...fl},axisLabel:{...bl},text:{...Sl}},"vertical-line":{...yl,handle:{...fl},axisLabel:{...bl},text:{...Sl}},"disjoint-channel":{...yl,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...fl},text:{...Ml}},"parallel-channel":{...yl,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...fl},text:{...Ml}},"fibonacci-retracement":{...yl,strokes:ml.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...fl},text:{...Sl,position:"center"},label:{...xl,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...yl,strokes:ml.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...fl},text:{...Sl,position:"center"},label:{...xl,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...yl,...vl,color:{$ref:"textColor"},handle:{...fl},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...vl,fontWeight:700,handle:{...fl},fill:{$ref:"foregroundColor"}},note:{...vl,color:ml.DEFAULT_TEXTBOX_COLOR,fill:ml.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...fl},background:{fill:ml.DEFAULT_TEXTBOX_FILL,stroke:ml.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...vl,color:{$ref:"textColor"},handle:{...fl}},arrow:{...yl,handle:{...fl},text:{...Sl}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...fl,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...fl,stroke:{$ref:"foregroundColor"}}},"date-range":{...Dl},"price-range":{...Dl},"date-price-range":{...Dl},"quick-date-price-range":{up:{...yl,fill:ml.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...fl},statistics:{...kl,color:"#fff",fill:ml.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...yl,stroke:ml.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:ml.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...fl,stroke:ml.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...kl,color:"#fff",fill:ml.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:{buttons:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}],padding:{$ref:"padding"}},optionsToolbar:{buttons:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]}}}},{BaseProperties:Il,ObserveChanges:Cl,ProxyProperty:Ll,Property:Al,calculatePlacement:Tl}=s.n1,Nl=class extends Il{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=(0,n.n)("img"),this.imageElement.onload=this.onImageLoad,this.node=new s.n1.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(t,e){this.containerWidth=t,this.containerHeight=e;const i={width:t,height:e},s=Tl(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...s}:{visible:!1}),s}};r([Al],Nl.prototype,"top",2),r([Al],Nl.prototype,"right",2),r([Al],Nl.prototype,"bottom",2),r([Al],Nl.prototype,"left",2),r([Al],Nl.prototype,"width",2),r([Al],Nl.prototype,"height",2),r([Al],Nl.prototype,"opacity",2),r([Ll("imageElement.src"),Cl(t=>t.loadedSynchronously=t.complete)],Nl.prototype,"url",2);var{ActionOnSet:Ol,Property:Rl}=s.n1,El=class extends s.n1.Background{constructor(){super(...arguments),this.image=new Nl}onLayoutComplete(t){if(super.onLayoutComplete(t),this.image){const{width:e,height:i}=t.chart;this.image.performLayout(e,i)}}onImageLoad(){this.ctx.updateService.update(s.n1.ChartUpdateType.SCENE_RENDER)}};r([Rl,Ol({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){this.node.removeChild(t.node),t.onLoad=void 0}})],El.prototype,"image",2);var Pl={type:"root",optionsKey:"background",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new El(t)},{ActionOnSet:Bl,LayoutElement:Fl,Menu:zl,Property:Gl}=s.n1,_l=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],jl=class extends s.n1.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.menu=new zl(this.ctx,"chart-toolbar"),this.toolbar=t.sharedToolbar.getSharedToolbar("chartToolbar"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),t.layoutManager.registerElement(Fl.ToolbarLeft,this.onLayoutStart.bind(this)),()=>this.toolbar.destroy())}onLayoutStart(t){this.enabled&&(this.updateButton(),this.toolbar.layout(t.layoutBox))}onButtonPressed({event:t,buttonBounds:e}){this.menu.setAnchor({x:e.x+e.width+6,y:e.y}),this.menu.show({items:_l,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:t.sourceEvent,onPress:t=>{this.setChartType(t.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton()}}),this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const t=this.getChartType(),e=_l.find(e=>e.value===t)?.icon;null!=e&&this.toolbar.updateButtons([{icon:e,tooltip:"toolbarSeriesTypeDropdown"}])}hidePopover(){this.toolbar.clearActiveButton(),this.menu.hide()}setChartType(t){const e={chartType:t};this.ctx.chartService.publicApi?.updateDelta(e).catch(t=>n.Vy.error(t))}getChartType(){const t=this.ctx.chartService.publicApi?.getOptions()?.chartType;return null!=t&&_l.some(e=>e.value===t)?t:"candlestick"}};r([Gl,Bl({changeValue(t){this.toolbar?.setHidden(!t)}})],jl.prototype,"enabled",2);var Wl={type:"root",optionsKey:"chartToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new jl(t)};function Vl(t,e,i){let s=!0;if("separator"===e.type){const t=i.at(i.length-1);s=void 0!==t&&"separator"!==t.type}if(s&&(s=function(t,e){return"always"===t||("series-area"===t?"series-area"===e||"series-node"===e:t===e)}(e.showOn??"always",t)),s){const t=new Hl(e);return i.push(t),t}}function Kl(t,e,i,s){e.isVisible(i)&&Vl(t,e.builtins.items[i],s)}function Yl(t,e,i,s){const{builtins:a}=e;if((0,n.bX)(i,a.lists))for(const n of a.lists[i])Kl(t,e,n,s);else Kl(t,e,i,s)}function $l(t,e,i,s){for(const n of i)if("string"==typeof n)Yl(t,e,n,s);else{const i=Vl(t,n,s);n.items&&i&&n.items.length>0&&$l(t,e,n.items,i.items)}"separator"===s[s.length-1]?.type&&s.pop()}var Hl=class{constructor(t){this.type="action",this.showOn="always",this.label="",this.iconUrl=void 0,this.enabled=!0,this.items=[],this.action=void 0,t&&this.setOptions(t),this.items=[]}setField(t,e,i){e[t]=i}setOptions(t){let e;for(e in t)void 0!==t[e]&&this.setField(e,this,t[e])}},Ul="ag-charts-context-menu",Xl="ag-charts-dark-context-menu",{Deprecated:Zl,Property:ql,ContextMenuRegistry:Ql}=s.n1,Jl="context-menu",th="Use [items] instead",eh=class extends s.n1.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!0,this.darkTheme=!1,this.items=["defaults"],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.closingSubMenus=0,this.menuWidget=new s.uB.MenuWidget;const e=this;if(this.deprecationMap={extraActions:{get items(){return e.extraActions??[]},showOn:"always"},extraSeriesAreaActions:{get items(){return e.extraSeriesAreaActions??[]},showOn:"series-area"},extraNodeActions:{get items(){return e.extraNodeActions??[]},showOn:"series-node"},extraLegendItemActions:{get items(){return e.extraLegendItemActions??[]},showOn:"legend-item"}},this.interactionManager=t.interactionManager,this.registry=t.contextMenuRegistry,this.element=t.domManager.addChild("canvas-overlay",Jl),this.element.classList.add(Ul),this.element.style.display="none",this.element.addEventListener("contextmenu",t=>t.preventDefault()),this.element.addEventListener("focusout",({relatedTarget:t})=>{this.closingSubMenus>0||(null==t||t instanceof Node&&!this.element.contains(t))&&this.hide()}),this.destroyFns.push(()=>this.element.parentNode?.removeChild(this.element),()=>this.menuWidget.destroy(),t.domManager.addListener("hidden",()=>this.hide()),this.menuWidget.addListener("close-widget",()=>this.onClose())),this.menuWidget.addClass(`${Ul}__menu`),"undefined"!=typeof MutationObserver){const t=new MutationObserver(()=>{this.element.contains(this.menuWidget.getElement())&&this.reposition()});t.observe(this.element,{childList:!0}),this.mutationObserver=t,this.destroyFns.push(()=>t.disconnect())}this.ctx.contextMenuRegistry.builtins.items.download.action=()=>{const e=t.chartService.title;let i="image";e?.enabled&&void 0!==e?.text&&(i=e.text.replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(t=>{n.Vy.error("Unable to download chart",t)})},this.destroyFns.push(this.registry.addListener("context-complete",t=>this.onContext(t)))}createDeprecatedAdaptorItems(){const t=[];for(const e of Object.keys(this.deprecationMap)){const{items:i,showOn:s}=this.deprecationMap[e];t.push("separator");for(const{action:e,label:n}of i){const i="action",a=!0;t.push({type:i,showOn:s,enabled:a,label:n,action:e})}}return t}expandItemsOptions(t){const e=[],i=this.createDeprecatedAdaptorItems();return $l(t,this.ctx.contextMenuRegistry,this.items,e),$l(t,this.ctx.contextMenuRegistry,i,e),e}onContext(t){if(!this.enabled)return;t.widgetEvent.sourceEvent.preventDefault(),this.showEvent=t.widgetEvent.sourceEvent,this.x=t.x,this.y=t.y,this.pickedNode=void 0,this.pickedLegendItem=void 0,Ql.check("series-node",t)?this.pickedNode=t.context.pickedNode:Ql.check("legend-item",t)&&(this.pickedLegendItem=t.context.legendItem);const e=this.expandItemsOptions(t.showOn);0!==e.length&&this.show(t.widgetEvent,e)}show(t,e){this.interactionManager.pushState(s.n1.InteractionState.ContextMenu),this.element.classList.toggle(Xl,this.darkTheme),this.element.style.display="block";const i="touch"!==t.sourceEvent.pointerType&&void 0;void 0!==i&&this.ctx.chartService.overrideFocusVisible(i),this.createMenu(e),this.element.appendChild(this.menuWidget.getElement()),this.menuWidget.open(t,{overrideFocusVisible:i})}hide(){this.menuWidget.close()}onClose(){this.interactionManager.popState(s.n1.InteractionState.ContextMenu),this.element.removeChild(this.menuWidget.getElement()),this.element.style.display="none"}onSubMenuOpen(t,e){const i=t.getBounds();t.setFocusOverride(!0),t.getElement().insertAdjacentElement("afterend",e.getElement()),e.getElement().style.position="absolute";const s=this.ctx.domManager.getBoundingClientRect(),n=t.getBoundingClientRect(),a=s.right-n.right,o=n.left-s.left,{offsetWidth:r,offsetHeight:l}=e.getElement();let h=i.y;if(s.height>l){const t=s.bottom-n.top;t<l&&(h-=l-t)}if(a>=r)e.setBounds({x:i.x+i.width,y:h});else{const t=i.x-r,s=o+t;s>=0?e.setBounds({x:t,y:h}):e.setBounds({x:t-s,y:h})}}onSubMenuClose(t,e){t.setFocusOverride(void 0),this.closingSubMenus++,e.remove(),this.closingSubMenus--}createMenu(t){const{menuWidget:e}=this;e.clear(),e.toggleClass(Xl,this.darkTheme),e.setTabIndex(-1),this.createMenuItems(e,t)}createMenuItems(t,e){for(const i of e)switch(i.type){case"separator":const e=t.addSeparator();e.classList.add(`${Ul}__divider`),e.classList.toggle(Xl,this.darkTheme),this.initTableCells(e);break;case"action":if(0===i.items.length){const e=new s.uB.MenuItemWidget;this.initButtonElement(e,i),t.addChild(e)}else{const{subMenuButton:e,subMenu:s}=t.addSubMenu();s.addClass(`${Ul}__menu`),s.addListener("open-widget",()=>this.onSubMenuOpen(e,s)),s.addListener("close-widget",()=>this.onSubMenuClose(e,s)),this.initButtonElement(e,i),this.createMenuItems(s,i.items)}break;default:throw new Error("unhandled case")}}createButtonOnClick(t,e){return Ql.checkCallback("legend-item",t,e)?t=>{const i=t.sourceEvent;if(this.pickedLegendItem){const{seriesId:t,itemId:s}=this.pickedLegendItem;e({type:"contextmenu",seriesId:t,itemId:s,event:i}),this.hide()}else n.Vy.error("legend item not found")}:Ql.checkCallback("series-area",t,e)?()=>{e({type:"seriesContextMenuAction",event:this.showEvent}),this.hide()}:Ql.checkCallback("series-node",t,e)?()=>{const{pickedNode:t,showEvent:i}=this,s=t?.series.createNodeContextMenuActionEvent(i,t);s?e(s):n.Vy.error("series node not found"),this.hide()}:()=>{e({type:"contextMenuEvent",event:this.showEvent}),this.hide()}}initTableCells(t){const e=(0,n.n)("div"),i=(0,n.n)("div"),s=(0,n.n)("div");return e.classList.toggle("ag-charts-context-menu__icon",!0),i.classList.toggle("ag-charts-context-menu__label",!0),s.classList.toggle("ag-charts-context-menu__rightarrowhead",!0),e.ariaHidden="true",i.role="presentation",s.ariaHidden="true",t.append(e,i,s),{cellIcon:e,cellLabel:i,cellArrow:s}}initButtonElement(t,e){t.addClass(`${Ul}__item`),t.toggleClass(Xl,this.darkTheme),t.setEnabled(e.enabled);const i=this.ctx.localeManager.t(e.label),a=`${Ul}__cellpadding`,{cellIcon:o,cellLabel:r,cellArrow:l}=this.initTableCells(t.getElement());if(r.textContent=i,r.classList.add(a),null!=e.iconUrl){const t=(0,n.n)("img");t.src=e.iconUrl,o.append(t),o.classList.add(a)}e.items.length>0&&(l.textContent="❯",l.classList.add(a));const{showOn:h,action:c}=e;if(null!=c){const e=this.createButtonOnClick(h,c);t.addListener("click",e),t.addListener("keydown",t=>{s.n1.isButtonClickEvent(t.sourceEvent)&&(t.sourceEvent.preventDefault(),e(t))})}t.addListener("mousemove",()=>t.focus({preventScroll:!0}))}reposition(){let{x:t,y:e}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:s,offsetHeight:a}=this.element;t=(0,n.qE)(0,t,i.width-s),e=(0,n.qE)(0,e,i.height-a),this.element.style.left=`${t}px`,this.element.style.top=`calc(${e}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(Jl),this.ctx.domManager.removeChild("canvas-overlay",Jl)}};r([ql],eh.prototype,"enabled",2),r([ql],eh.prototype,"darkTheme",2),r([ql],eh.prototype,"items",2),r([Zl(th)],eh.prototype,"extraActions",2),r([Zl(th)],eh.prototype,"extraNodeActions",2),r([Zl(th)],eh.prototype,"extraSeriesAreaActions",2),r([Zl(th)],eh.prototype,"extraLegendItemActions",2);var ih={type:"root",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsKey:"contextMenu",moduleFactory:t=>new eh(t),themeTemplate:{contextMenu:{enabled:!0,darkTheme:s.n1.ThemeSymbols.IS_DARK_THEME}}},{BaseProperties:sh,Property:nh}=s.n1,ah=class extends s.n1.ChangeDetectableProperties{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0}};r([nh],ah.prototype,"enabled",2),r([nh],ah.prototype,"xOffset",2),r([nh],ah.prototype,"yOffset",2),r([nh],ah.prototype,"format",2),r([nh],ah.prototype,"renderer",2);var oh=class extends sh{constructor(t,e,i){super(),this.domManager=t,this.id=(0,n.sX)(this),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.renderer=void 0,this.element=t.addChild("canvas-overlay",`crosshair-label-${this.id}`),this.element.classList.add("ag-charts-crosshair-label"),(0,n.Bq)(this.element,"aria-hidden",!0),this.element.setAttribute("data-key",e),this.element.setAttribute("data-axis-id",i)}show(t){const{element:e}=this,i=t.x+this.xOffset,s=t.y+this.yOffset;e.style.top=`${Math.round(s)}px`,e.style.left=`${Math.round(i)}px`,this.toggle(!0)}setLabelHtml({html:t,styles:e}){void 0!==t&&(this.element.innerHTML=t),void 0!==e&&Object.assign(this.element.style,e)}getBBox(){const{element:t}=this;return new s.n1.BBox(t.clientLeft,t.clientTop,t.clientWidth,t.clientHeight)}toggle(t){this.element.classList.toggle("ag-charts-crosshair-label--hidden",!t)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(t,e){if("string"==typeof t)return{html:t,styles:{}};e=e??{};const{text:i=e.text??"",color:s=e.color,backgroundColor:n=e.backgroundColor,opacity:a=e.opacity??1}=t;return{html:`<div class="ag-charts-crosshair-label-content">\n                    <span>${i}</span>\n                </div>`,styles:{opacity:a,"background-color":n?.toLowerCase(),color:s}}}};r([nh],oh.prototype,"enabled",2),r([nh],oh.prototype,"xOffset",2),r([nh],oh.prototype,"yOffset",2),r([nh],oh.prototype,"format",2),r([nh],oh.prototype,"renderer",2);var{Group:rh,TranslatableGroup:lh,Line:hh,BBox:ch,InteractionState:dh,Property:uh,ZIndexMap:ph,formatNumber:gh,ChartAxisDirection:mh}=s.n1,yh=class extends s.n1.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.id=(0,n.sX)(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new ah,this.seriesRect=new ch(0,0,0,0),this.bounds=new ch(0,0,0,0),this.crosshairGroup=new lh({name:"crosshairs",zIndex:ph.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new rh({name:`${this.id}-crosshair-lines`,zIndex:ph.SERIES_CROSSHAIR})),this.lineGroupSelection=s.n1.Selection.select(this.lineGroup,hh,!1),this.activeHighlight=void 0,this.axisCtx=t.parent,this.labels={},this.hideCrosshairs(),t.domManager.addEventListener("focusin",({target:e})=>{const i=e instanceof HTMLElement&&t.domManager.contains(e,"series-area");this.crosshairGroup.visible&&!i&&(this.hideCrosshairs(),this.ctx.updateService.update(s.n1.ChartUpdateType.PERFORM_LAYOUT))}),this.destroyFns.push(t.scene.attachNode(this.crosshairGroup),t.widgets.seriesWidget.addListener("mousemove",t=>this.onMouseHoverLike(t)),t.widgets.seriesWidget.addListener("drag-move",t=>this.onMouseHoverLike(t)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),t.widgets.seriesDragInterpreter.addListener("click",t=>this.onClick(t)),t.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),t.zoomManager.addListener("zoom-pan-start",()=>this.onMouseOut()),t.zoomManager.addListener("zoom-change",()=>this.onMouseOut()),t.highlightManager.addListener("highlight-change",t=>this.onHighlightChange(t)),t.layoutManager.addListener("layout:complete",t=>this.layout(t)),()=>Object.values(this.labels).forEach(t=>t.destroy()))}layout({series:{rect:t,visible:e},axes:i}){if(!e||!i||!this.enabled)return;this.seriesRect=t;const{position:s="left",axisId:n}=this.axisCtx,a=i.find(t=>t.id===n);if(!a)return;this.axisLayout=a,this.bounds=t.clone().grow(a.gridPadding+a.seriesAreaPadding,s);const{crosshairGroup:o,bounds:r}=this;o.translationX=Math.round(r.x),o.translationY=Math.round(r.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l)}updateSelections(t){this.lineGroupSelection.update(t,t=>t.append(new hh),t=>t)}updateLabels(t){const{labels:e,ctx:i}=this;for(const s of t)this.label.enabled&&(e[s]??(e[s]=new oh(i.domManager,s,this.axisCtx.axisId))),e[s]&&this.updateLabel(e[s]);this.labelFormatter=this.axisCtx.scaleValueFormatter(this.label.format)}updateLabel(t){const{enabled:e,xOffset:i,yOffset:s,format:n,renderer:a}=this.label;t.enabled=e,t.xOffset=i,t.yOffset=s,t.format=n,t.renderer=a}updateLines(){const{lineGroupSelection:t,bounds:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,axisLayout:r}=this;if(!r)return;const l=this.isVertical();t.each(t=>{t.stroke=i,t.strokeWidth=s,t.strokeOpacity=n,t.lineDash=a,t.lineDashOffset=o,t.y1=0,t.y2=l?e.height:0,t.x1=0,t.x2=l?0:e.width})}isVertical(){return this.axisCtx.direction===mh.X}isHover(t){return"mousemove"===t.type||"click"===t.type||"touch"===t.device&&"hover"===this.ctx.chartService.touch.dragAction}formatValue(t){const{labelFormatter:e,axisLayout:i}=this;if(e){const i=this.cachedCallWithContext(e,t);if(null!=i)return i}if("number"==typeof t){const e=(i?.label.fractionDigits??0)+((0,n.Fq)(t)?0:1);return gh(t,e)}return String(t??"")}onClick(t){"touch"===t.device&&this.onMouseHoverLike(t)}onMouseHoverLike(t){if(!this.enabled||this.snap)return;const e=this.isHover(t)?dh.Clickable:dh.AnnotationsMoveable;this.ctx.interactionManager.isState(e)&&(this.updatePositions(this.getData(t)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(s.n1.ChartUpdateType.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(dh.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(s.n1.ChartUpdateType.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(dh.Default)&&this.hideCrosshairs()}onHighlightChange(t){if(!this.enabled)return;const{crosshairGroup:e,axisCtx:i}=this,{datum:s,series:n}=t.currentHighlight??{},a=s&&(n?.axes.x?.id===i.axisId||n?.axes.y?.id===i.axisId);if(this.activeHighlight=a?t.currentHighlight:void 0,this.activeHighlight){if(this.snap){const t=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(t),e.visible=!0}}else this.hideCrosshairs()}isInRange(t){return this.axisCtx.inRange(t)}updatePositions(t){const{seriesRect:e,lineGroupSelection:i}=this;i.each((i,s)=>{const n=t[s];if(!n)return i.visible=!1,void this.hideLabel(s);i.visible=!0;const{value:a,position:o}=n;let r=0,l=0;this.isVertical()?(r=o,i.x=Math.round(r)):(l=o,i.y=Math.round(l)),this.label.enabled?this.showLabel(r+e.x,l+e.y,a,s):this.hideLabel(s)})}getData(t){const{axisCtx:e}=this,i="pointer",{datum:s,xKey:n="",yKey:a=""}=this.activeHighlight??{},{currentX:o,currentY:r}=t,l=this.isVertical(),h=l?o:r;let c=s?.[l?n:a]??"";return e.continuous&&(c=e.scaleInvert(h)),{[i]:{position:h,value:c}}}getActiveHighlightData(t){const{axisCtx:e}=this,{datum:i,series:s,xKey:n="",aggregatedValue:a,cumulativeValue:o,midPoint:r}=t,l=s.getKeyProperties(e.direction),h=(e.scale.bandwidth??0)/2,c=s.axes[e.direction]?.id===e.axisId,d=l.indexOf("yKey")>-1&&c,u=l.indexOf("xKey")>-1&&c,p=a??o;if(d&&void 0!==p){const t=e.scale.convert(p)+h;return this.isInRange(t)?{yKey:{value:p,position:t}}:{}}if(u){const t=(this.isVertical()?r?.x:r?.y)??0,s=e.continuous?e.scaleInvert(t):i[n];return this.isInRange(t)?{xKey:{value:s,position:t}}:{}}const g={};return l.forEach(t=>{const n=s.properties[t],a=i[n],o=e.scale.convert(a)+h;this.isInRange(o)&&(g[t]={value:a,position:o})}),g}getLabelHtml(t,e){const i=this.axisLayout?.label?.fractionDigits??0,s={text:this.formatValue(t)};return this.label.renderer?e.toLabelHtml(this.label.renderer({value:t,fractionDigits:i}),s):e.toLabelHtml(s)}showLabel(t,e,i,s){if(!this.axisLayout)return;const{bounds:n}=this,a=this.labels[s],o=this.getLabelHtml(i,a);a.setLabelHtml(o);const{width:r,height:l}=a.getBBox(),h=this.axisCtx.position;let c=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===mh.X?(c-=4,a.show({x:t-r/2,y:"bottom"===h?n.y+n.height+c:n.y-l-c})):(c-=8,a.show({x:"right"===h?n.x+n.width+c:n.x-r-c,y:e-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const t of Object.keys(this.labels))this.hideLabel(t)}hideLabel(t){this.labels[t]?.toggle(!1)}cachedCallWithContext(t,...e){const{callbackCache:i,chartService:s}=this.ctx;return i.call(this.axisCtx,s,t,...e)}};r([uh],yh.prototype,"enabled",2),r([uh],yh.prototype,"stroke",2),r([uh],yh.prototype,"lineDash",2),r([uh],yh.prototype,"lineDashOffset",2),r([uh],yh.prototype,"strokeWidth",2),r([uh],yh.prototype,"strokeOpacity",2),r([uh],yh.prototype,"snap",2),r([uh],yh.prototype,"label",2);var fh={type:"axis-option",optionsKey:"crosshair",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","ordinal-time","unit-time","number","log","time"],moduleFactory:t=>new yh(t),themeTemplate:{crosshair:{snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}}}},{ActionOnSet:xh,Property:bh}=s.n1,vh=class extends s.n1.BaseModuleInstance{constructor(t){super(),this.enabled=!1,this.getData=()=>Promise.resolve(),this.dataService=t.dataService}updateCallback(t,e){this.dataService&&(t&&null!=e?this.dataService.updateCallback(e):this.dataService.clearCallback())}};r([xh({newValue(t){this.updateCallback(t,this.getData)}}),bh],vh.prototype,"enabled",2),r([xh({newValue(t){this.updateCallback(this.enabled,t)}}),bh],vh.prototype,"getData",2),r([xh({newValue(t){this.dataService.requestThrottle=t}})],vh.prototype,"requestThrottle",2),r([xh({newValue(t){this.dataService.dispatchThrottle=t}})],vh.prototype,"updateThrottle",2),r([xh({newValue(t){this.dataService.dispatchOnlyLatest=!t}})],vh.prototype,"updateDuringInteraction",2);var Sh={type:"root",optionsKey:"dataSource",packageType:"enterprise",chartTypes:["cartesian","hierarchy","polar","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new vh(t),themeTemplate:{dataSource:{enabled:!1}}},{nearestSquaredInContainer:Mh,partialAssign:kh,mergeDefaults:Dh,BBox:wh}=s.n1,Ih=class{constructor(t){this.components=t,this.union=wh.merge(t)}containsPoint(t,e){if(!this.union.containsPoint(t,e))return!1;for(const i of this.components)if(i.containsPoint(t,e))return!0;return!1}},Ch=class extends s.n1.Group{constructor(){super(),this.capLength=NaN,this._datum=void 0,this.whiskerPath=new s.n1.Path,this.capsPath=new s.n1.Path,this.bboxes=new Ih([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(t){this._datum=t}calculateCapLength(t,e){const{lengthRatio:i=1,length:s}=t,{lengthRatioMultiplier:n,lengthMax:a}=e,o=s??i*n;return Math.min(o,a)}getItemStylerParams(t,e,i){const{datum:s}=this;if(null==s||null==t.itemStyler)return;const{xLowerKey:n,xUpperKey:a,yLowerKey:o,yUpperKey:r}=t;return{...e,datum:s.datum,seriesId:s.datum.seriesId,xKey:s.xKey,yKey:s.yKey,xLowerKey:n,xUpperKey:a,yLowerKey:o,yUpperKey:r,highlighted:i}}formatStyles(t,e,i,s){let{cap:n,...a}=t;const o=this.getItemStylerParams(e,t,s);if(null!=o&&null!=e.itemStyler){const t=i.callWithContext(e.itemStyler,o);a=Dh(t,a),n=Dh(t?.cap,t,n)}return{whiskerStyle:a,capsStyle:n}}applyStyling(t,e){kh(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],t,e)}update(t,e,i,s){if(void 0===this.datum)return;const{whiskerStyle:n,capsStyle:a}=this.formatStyles(t,e,i,s),{xBar:o,yBar:r,capDefaults:l}=this.datum,h=this.whiskerPath;this.applyStyling(h,n),h.path.clear(!0),void 0!==r&&(h.path.moveTo(r.lowerPoint.x,r.lowerPoint.y),h.path.lineTo(r.upperPoint.x,r.upperPoint.y)),void 0!==o&&(h.path.moveTo(o.lowerPoint.x,o.lowerPoint.y),h.path.lineTo(o.upperPoint.x,o.upperPoint.y)),h.path.closePath(),this.capLength=this.calculateCapLength(a??{},l);const c=this.capLength/2,d=this.capsPath;this.applyStyling(d,a),d.path.clear(!0),void 0!==r&&(d.path.moveTo(r.lowerPoint.x-c,r.lowerPoint.y),d.path.lineTo(r.lowerPoint.x+c,r.lowerPoint.y),d.path.moveTo(r.upperPoint.x-c,r.upperPoint.y),d.path.lineTo(r.upperPoint.x+c,r.upperPoint.y)),void 0!==o&&(d.path.moveTo(o.lowerPoint.x,o.lowerPoint.y-c),d.path.lineTo(o.lowerPoint.x,o.lowerPoint.y+c),d.path.moveTo(o.upperPoint.x,o.upperPoint.y-c),d.path.lineTo(o.upperPoint.x,o.upperPoint.y+c)),d.path.closePath()}updateBBoxes(){const{capLength:t,whiskerPath:e,capsPath:i}=this,{yBar:s,xBar:n}=this.datum??{},a=t/2,o=[];if(void 0!==s){const n=s.lowerPoint.y-s.upperPoint.y;o.push(new wh(s.lowerPoint.x,s.upperPoint.y,e.strokeWidth,n),new wh(s.lowerPoint.x-a,s.lowerPoint.y,t,i.strokeWidth),new wh(s.upperPoint.x-a,s.upperPoint.y,t,i.strokeWidth))}if(void 0!==n){const s=n.upperPoint.x-n.lowerPoint.x;o.push(new wh(n.lowerPoint.x,n.upperPoint.y,s,e.strokeWidth),new wh(n.lowerPoint.x,n.lowerPoint.y-a,i.strokeWidth,t),new wh(n.upperPoint.x,n.upperPoint.y-a,i.strokeWidth,t))}this.bboxes.components=o,this.bboxes.union=wh.merge(o)}containsPoint(t,e){return this.bboxes.containsPoint(t,e)}pickNode(t,e){return this.containsPoint(t,e)?this:void 0}nearestSquared(t,e,i){const{bboxes:s}=this;if(s.union.distanceSquared(t,e)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:n}=wh.nearestBox(t,e,s.components);return{nearest:this,distanceSquared:n}}},Lh=class extends s.n1.Group{nearestSquared(t,e){const{nearest:i,distanceSquared:s}=Mh(t,e,{children:this.children()});if(void 0!==i&&!isNaN(s))return{datum:i.datum,distanceSquared:s}}},{BaseProperties:Ah,Property:Th}=s.n1,Nh=class extends Ah{};r([Th],Nh.prototype,"visible",2),r([Th],Nh.prototype,"stroke",2),r([Th],Nh.prototype,"strokeWidth",2),r([Th],Nh.prototype,"strokeOpacity",2),r([Th],Nh.prototype,"lineDash",2),r([Th],Nh.prototype,"lineDashOffset",2),r([Th],Nh.prototype,"length",2),r([Th],Nh.prototype,"lengthRatio",2);var Oh=class extends Ah{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new Nh}};r([Th],Oh.prototype,"yLowerKey",2),r([Th],Oh.prototype,"yLowerName",2),r([Th],Oh.prototype,"yUpperKey",2),r([Th],Oh.prototype,"yUpperName",2),r([Th],Oh.prototype,"xLowerKey",2),r([Th],Oh.prototype,"xLowerName",2),r([Th],Oh.prototype,"xUpperKey",2),r([Th],Oh.prototype,"xUpperName",2),r([Th],Oh.prototype,"visible",2),r([Th],Oh.prototype,"stroke",2),r([Th],Oh.prototype,"strokeWidth",2),r([Th],Oh.prototype,"strokeOpacity",2),r([Th],Oh.prototype,"lineDash",2),r([Th],Oh.prototype,"lineDashOffset",2),r([Th],Oh.prototype,"itemStyler",2),r([Th],Oh.prototype,"cap",2);var{fixNumericExtent:Rh,groupAccumulativeValueProperty:Eh,mergeDefaults:Ph,valueProperty:Bh,ChartAxisDirection:Fh}=s.n1,zh=class t extends s.n1.BaseModuleInstance{constructor(t){super(),this.properties=new Oh;const e=function(t){for(const e of s.On)if(e===t.series.type)return t.series;throw new Error(`AG Charts - unsupported series type '${t.series.type}', error bars supported series types: ${s.On.join(", ")}`)}(t),{annotationGroup:i,annotationSelections:n}=e;this.cartesianSeries=e,this.groupNode=new Lh({name:`${i.id}-errorBars`}),i.appendChild(this.groupNode),this.selection=s.n1.Selection.select(this.groupNode,()=>this.errorBarFactory()),n.add(this.selection),e.addEventListener("seriesVisibilityChange",t=>this.onToggleSeriesItem(t)),this.destroyFns.push(e.addListener("data-processed",t=>this.onDataProcessed(t)),e.addListener("data-update",t=>this.onDataUpdate(t)),t.highlightManager.addListener("highlight-change",t=>this.onHighlightChange(t)),()=>i.removeChild(this.groupNode),()=>n.delete(this.selection))}hasErrorBars(){const{xLowerKey:t,xUpperKey:e,yLowerKey:i,yUpperKey:s}=this.properties;return(0,n.vM)(t)&&(0,n.vM)(e)||(0,n.vM)(i)&&(0,n.vM)(s)}isStacked(){const t=this.cartesianSeries.seriesGrouping?.stackCount;return null!=t&&t>0}getUnstackPropertyDefinition(t){const e=[],{xLowerKey:i,xUpperKey:s,yLowerKey:n,yUpperKey:a,xErrorsID:o,yErrorsID:r}=this.getMaybeFlippedKeys(),{xScaleType:l,yScaleType:h}=t;return null!=n&&null!=a&&e.push(Bh(n,h,{id:`${r}-lower`}),Bh(a,h,{id:`${r}-upper`})),null!=i&&null!=s&&e.push(Bh(i,l,{id:`${o}-lower`}),Bh(s,l,{id:`${o}-upper`})),e}getStackPropertyDefinition(t){const e=[],{cartesianSeries:i}=this,{xLowerKey:s,xUpperKey:n,yLowerKey:a,yUpperKey:o,xErrorsID:r,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:h,yScaleType:c}=t,d=i.seriesGrouping?.groupIndex??i.id,u={invalidValue:null,missingValue:0,separateNegative:!0,...i.visible?{}:{forceValue:0}},p=(t,e,i,s)=>Eh(t,"normal","current",{id:`${e}-${i}`,groupId:`errorGroup-${d}-${i}`,...u},s),g=(t,i,s,n)=>{e.push(...p(t,s,"lower",n),...p(i,s,"upper",n))};return null!=a&&null!=o&&g(a,o,l,c),null!=s&&null!=n&&g(s,n,r,h),e}getPropertyDefinitions(t){return this.isStacked()?this.getStackPropertyDefinition(t):this.getUnstackPropertyDefinition(t)}onDataProcessed(t){this.dataModel=t.dataModel,this.processedData=t.processedData}getDomain(t){const{xLowerKey:e,xUpperKey:i,xErrorsID:s,yLowerKey:a,yUpperKey:o,yErrorsID:r}=this.getMaybeFlippedKeys();if(t===Fh.X?(0,n.vM)(e)&&(0,n.vM)(i):(0,n.vM)(a)&&(0,n.vM)(o)){const{dataModel:e,processedData:i,cartesianSeries:n}=this;if(null!=e&&null!=i){const a={x:s,y:r}[t],o=e.getDomain(n,`${a}-lower`,"value",i),l=e.getDomain(n,`${a}-upper`,"value",i),h=[Math.min(...o,...l),Math.max(...o,...l)];return Rh(h)}}return[]}onDataUpdate(t){this.dataModel=t.dataModel,this.processedData=t.processedData,(0,n.vM)(t.dataModel)&&(0,n.vM)(t.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const t=this.getNodeData(),e=this.cartesianSeries.axes[Fh.X]?.scale,i=this.cartesianSeries.axes[Fh.Y]?.scale;if(e&&i&&t)for(let s=0;s<t.length;s++){const{midPoint:a,xLower:o,xUpper:r,yLower:l,yUpper:h}=this.getDatum(t,s);if(null!=a){let c,d;(0,n.vM)(o)&&(0,n.vM)(r)&&(c={lowerPoint:{x:this.convert(e,o),y:a.y},upperPoint:{x:this.convert(e,r),y:a.y}}),(0,n.vM)(l)&&(0,n.vM)(h)&&(d={lowerPoint:{x:a.x,y:this.convert(i,l)},upperPoint:{x:a.x,y:this.convert(i,h)}}),t[s].xBar=c,t[s].yBar=d}}}getMaybeFlippedKeys(){let{xLowerKey:t,xUpperKey:e,yLowerKey:i,yUpperKey:s}=this.properties,[n,a]=["xValue-errors","yValue-errors"];return this.cartesianSeries.shouldFlipXY()&&([t,i]=[i,t],[e,s]=[s,e],[n,a]=[a,n]),{xLowerKey:t,xUpperKey:e,xErrorsID:n,yLowerKey:i,yUpperKey:s,yErrorsID:a}}static getDatumKey(t,e,i){if(null==e)return;const s=t.datum[e];if(null!=s){if("number"==typeof s)return s+i;n.Vy.warnOnce(`Found [${e}] error value of type ${typeof s}. Expected number type`)}}getDatum(e,i){const{xLowerKey:s,xUpperKey:n,yLowerKey:a,yUpperKey:o}=this.getMaybeFlippedKeys(),r=e[i],l=null!=r.cumulativeValue&&this.isStacked()?r.cumulativeValue-r.yValue:0,[h,c]=this.cartesianSeries.shouldFlipXY()?[l,0]:[0,l];return{midPoint:r.midPoint,xLower:t.getDatumKey(r,s,h),xUpper:t.getDatumKey(r,n,h),yLower:t.getDatumKey(r,a,c),yUpper:t.getDatumKey(r,o,c)}}convert(t,e){const i=(t.bandwidth??0)/2;return t.convert(e)+i}update(){const t=this.getNodeData();null!=t&&(this.selection.update(t),this.selection.each((t,e,i)=>this.updateNode(t,e,i)))}updateNode(t,e,i){t.datum=e,t.update(this.getDefaultStyle(),this.properties,this.cartesianSeries,!1),t.updateBBoxes()}pickNodeExact(t){const{x:e,y:i}=t,s=this.groupNode.pickNode(e,i);if(null!=s)return{datum:s.datum,distanceSquared:0}}pickNodeNearest(t){return this.groupNode.nearestSquared(t.x,t.y)}pickNodeMainAxisFirst(t){return this.groupNode.nearestSquared(t.x,t.y)}getTooltipParams(){const{xLowerKey:t,xUpperKey:e,yLowerKey:i,yUpperKey:s,xLowerName:n=t,xUpperName:a=e,yLowerName:o=i,yUpperName:r=s}=this.properties;return{xLowerKey:t,xLowerName:n,xUpperKey:e,xUpperName:a,yLowerKey:i,yLowerName:o,yUpperKey:s,yUpperName:r}}onToggleSeriesItem(t){this.groupNode.visible=t.visible}makeStyle(t){return{visible:t.visible,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity,cap:Ph(this.properties.cap,t)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(t,e,i){const s=this.getNodeData();if(null!=s)for(let n=0;n<s.length;n++)if(t===s[n]){this.selection.at(n)?.update(e,this.properties,this.cartesianSeries,i);break}}onHighlightChange(t){const{previousHighlight:e,currentHighlight:i}=t;i?.series===this.cartesianSeries&&this.restyleHighlightChange(i,this.getHighlightStyle(),!0),e?.series===this.cartesianSeries&&this.restyleHighlightChange(e,this.getDefaultStyle(),!1),this.groupNode.opacity=this.cartesianSeries.getOpacity()}errorBarFactory(){return new Ch}getWhiskerProperties(){const{stroke:t,strokeWidth:e,visible:i,strokeOpacity:s,lineDash:n,lineDashOffset:a}=this.properties;return{stroke:t,strokeWidth:e,visible:i,strokeOpacity:s,lineDash:n,lineDashOffset:a}}},Gh={type:"series-option",identifier:"error-bars",optionsKey:"errorBar",packageType:"enterprise",chartTypes:["cartesian"],seriesTypes:s.On,moduleFactory:t=>new zh(t),themeTemplate:{series:{errorBar:{visible:!0,stroke:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1,cap:{length:void 0,lengthRatio:void 0}}}}},{ZIndexMap:_h,ActionOnSet:jh,Property:Wh,ProxyPropertyOnWrite:Vh}=s.n1,Kh=class extends s.n1.Background{constructor(){super(...arguments),this.image=new Nl,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new s.n1.Group({name:"foreground",zIndex:_h.FOREGROUND})}onLayoutComplete(t){super.onLayoutComplete(t);const{width:e,height:i}=t.chart;let s={x:0,y:0,width:e,height:i};this.image&&(s=this.image.performLayout(e,i)),this.text&&this.updateTextNode(s)}onImageLoad(){this.ctx.updateService.update(s.n1.ChartUpdateType.SCENE_RENDER)}updateTextNode(t){const{textNode:e}=this;e.fontWeight="bold",e.fontFamily="Impact, sans-serif",e.fontSize=19,e.opacity=.7,e.fill="#9b9b9b",e.textBaseline="top";const i=this.textNode.getBBox();e.x=t.x+t.width/2-i.width/2,e.y=t.y+t.height+10}};r([Wh,jh({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){this.node.removeChild(t.node),t.onLoad=void 0}})],Kh.prototype,"image",2),r([Wh,Vh("rectNode","fill")],Kh.prototype,"fill",2),r([Wh,Vh("rectNode","fillOpacity")],Kh.prototype,"fillOpacity",2);var Yh={type:"root",optionsKey:"foreground",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Kh(t)},{TranslatableGroup:$h,SceneChangeDetection:Hh}=s.n1,Uh=class extends $h{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(t,e){const{cornerRadius:i,inset:s}=this,{x:n,y:a,width:o,height:r}=e;t.beginPath(),t.roundRect(n+s,a+s,o-2*s,r-2*s,i),t.clip()}};r([Hh()],Uh.prototype,"inset",2),r([Hh()],Uh.prototype,"cornerRadius",2);var{Property:Xh,ZIndexMap:Zh,ActionOnSet:qh,CategoryAxis:Qh,TextUtils:Jh,Padding:tc,Group:ec,BBox:ic,ProxyProperty:sc}=s.n1,nc=class{constructor(){this.top=0,this.bottom=0}};r([Xh],nc.prototype,"top",2),r([Xh],nc.prototype,"bottom",2);var ac=class extends s.n1.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.padding=new nc,this.root=new ec({name:"root"}),this.seriesRoot=this.root.appendChild(new Uh({name:"Series-root",zIndex:Zh.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new ec({name:"Axes-Grids",zIndex:Zh.AXIS_GRID})),this.axisGroup=this.root.appendChild(new ec({name:"Axes-Grids",zIndex:Zh.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new ec({name:"Axes-Labels",zIndex:Zh.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new ec({name:"Axes-Crosslines-Range",zIndex:Zh.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new ec({name:"Axes-Crosslines-Line",zIndex:Zh.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new ec({name:"Axes-Crosslines-Label",zIndex:Zh.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.axes=[],this.series=[]}destroy(){this._destroyed||(this.destroySeries(this.series),this.axes.forEach(t=>t.destroy()),this.axes=[],this._destroyed=!0)}onSeriesChange(t,e){const i=e?.filter(e=>!t.includes(e))??[];this.destroySeries(i);for(const i of t){if(e?.includes(i))continue;i.attachSeries(this.seriesRoot,this.seriesRoot,void 0);const t=this;i.chart={get mode(){return"standalone"},get isMiniChart(){return!0},get seriesRect(){return t.seriesRect}},i.resetAnimation("initial"===this.miniChartAnimationPhase?"initial":"disabled")}}destroySeries(t){t?.forEach(t=>{t.destroy(),t.detachSeries(this.seriesRoot,this.seriesRoot,void 0),t.chart=void 0})}assignSeriesToAxes(){this.axes.forEach(t=>{t.boundSeries=this.series.filter(e=>e.axes[t.direction]===t)})}assignAxesToSeries(){const t={};this.axes.forEach(e=>{const i=e.direction;(t[i]??(t[i]=[])).push(e)}),this.series.forEach(e=>{e.directions.forEach(i=>{const s=t[i];if(!s)return void n.Vy.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);const a=e.getKeys(i),o=this.findMatchingAxis(s,a);o?e.axes[i]=o:n.Vy.warnOnce(`no matching axis for direction [${i}] and keys [${a}]; check series and axes configuration.`)})})}findMatchingAxis(t,e){for(const i of t){if(!i.keys.length)return i;if(e)for(const t of e)if(i.keys.includes(t))return i}}updateData(t){this.series.forEach(e=>e.setChartData(t)),"initial"===this.miniChartAnimationPhase&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready",this.series.forEach(t=>t.resetAnimation("disabled"))})}async processData(t){this.series.some(t=>t.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(e=>(e.resetDatumCallbackCache(),e.processData(t))));for(const t of this.axes)t.processData()}computeAxisPadding(){const t=new tc;return this.enabled?(this.axes.forEach(({position:e,thickness:i,line:s,label:n})=>{if(null==e)return;let a;a=i||(s.enabled?s.width:0)+(n.enabled?Jh.getLineHeight(n.fontSize??0)+n.spacing:0),t[e]=Math.ceil(a)}),t):t}async layout(t,e){const{padding:i}=this,s=null!=this.seriesRect,n=new ic(0,0,t,e-(i.top+i.bottom));this.seriesRect=n,this.seriesRoot.translationY=i.top,this.seriesRoot.setClipRectCanvasSpace(new ic(0,-i.top,t,e)),this.axes.forEach(i=>{const{position:a="left"}=i;switch(a){case"top":case"bottom":i.range=[0,n.width],i.gridLength=n.height;break;case"right":case"left":{const t=i instanceof Qh;i.range=t?[0,n.height]:[n.height,0],i.gridLength=n.width;break}}i.gridPadding=0,i.translation.x=0,i.translation.y=0,"right"===a?i.translation.x=t:"bottom"===a&&(i.translation.y=e),s||i.resetAnimation("initial"),i.calculateLayout(),i.update()}),await Promise.all(this.series.map(t=>t.update({seriesRect:n})))}};r([Xh],ac.prototype,"enabled",2),r([sc(["seriesRoot","inset"])],ac.prototype,"inset",2),r([sc(["seriesRoot","cornerRadius"])],ac.prototype,"cornerRadius",2),r([qh({changeValue(t,e=[]){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of e)t.includes(s)||(s.detachAxis(i),s.destroy());for(const s of t)e?.includes(s)||s.attachAxis(i)}})],ac.prototype,"axes",2),r([qh({changeValue(t,e){this.onSeriesChange(t,e)}})],ac.prototype,"series",2);var{SliderWidget:oc}=s.n1,rc=class{constructor(t,e){this.ctx=t,this.sliderHandlers=e,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=t,this.toolbar=t.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[t.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),t.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),t.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[t,e]of["min","pan","max"].entries()){const i=this.sliders[t];i.step=oc.STEP_HUNDRETH,i.keyboardStep=oc.STEP_ONE,i.orientation="horizontal",i.setPreventsDefault(!1),i.addListener("drag-start",i=>this.onDragStart(t,i,e)),i.addListener("drag-move",t=>this.onDrag(i,t,e)),i.addListener("drag-end",()=>this.updateSliderRatios()),i.addListener("contextmenu",t=>this.onContextMenu(i,t))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(t){this.toolbar.setHidden(!t)}updateZoom(){const{_min:t,_max:e}=this;if(null!=t&&null!=e)return this.ctx.zoomManager.updateZoom("navigator",{x:{min:t,max:e}})}updateBounds(t){this.toolbar.setBounds(t)}updateSliderBounds(t,e){this.sliders[t].setBounds(e)}updateMinMax(t,e){this._min=t,this._max=e,this.updateSliderRatios()}updateSliderRatios(){let{_min:t,_max:e}=this;t=Math.round(100*t)/100,e=Math.round(100*e)/100;const i=this.ctx.localeManager.t("ariaValuePanRange",{min:t,max:e});this.sliders[0].setValueRatio(t),this.sliders[1].setValueRatio(t,{ariaValueText:i}),this.sliders[2].setValueRatio(e)}toCanvasOffsets(t){return{offsetX:this.dragStartX+t.originDeltaX}}moveToFront(t){if(1===t)return;const e=this.sliders[t],i=this.sliders[2-t];this.toolbar.moveChild(i,e.domIndex-1)}onDragStart(t,e,i){const s=this.sliders[t],n=this.toolbar.cssLeft(),a=s.cssLeft();this.dragStartX=n+a+e.offsetX,this.moveToFront(t),"touch"===e.device&&e.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(e))}onDrag(t,e,i){"touch"===e.device&&e.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(e))}onContextMenu(t,e){const{offsetX:i,offsetY:s}=e,{x:n,y:a}=this.toolbar.getBounds(),{x:o,y:r}=t.getBounds(),l=i+n+o,h=s+a+r;this.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:e,canvasX:l,canvasY:h},void 0)}onPanSliderChange(){const t=this.sliders[1].getValueRatio(),e=this._max-this._min;this._min=(0,n.qE)(0,t,1-e),this._max=this._min+e,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}},{Property:lc,SceneChangeDetection:hc,BBox:cc,ExtendedPath2D:dc}=s.n1,uc=class extends s.n1.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new dc}setCenter(t,e){this.dirtyPath=!0,this.centerX===t&&this.centerY===e||(this.centerX=t,this.centerY=e,this.markDirty("center"))}static align(t,e,i,s,n,a,o,r,l){const h=t.align(i+n*o)+l,c=h+t.align(i+n*o,n*(r-o))-2*l,d=t.align(s+a/2);t.setCenter(h,d),e.setCenter(c,d)}computeBBox(){const{centerX:t,centerY:e,width:i,height:s}=this;return new cc(t-i/2,e-s/2,i,s)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}updatePath(){const{centerX:t,centerY:e,path:i,gripPath:s,strokeWidth:n,cornerRadius:a,grip:o}=this,r=n/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),s.clear();const h=Math.floor(this.width/2*l)/l,c=Math.floor(this.height/2*l)/l;if(i.roundRect(t-h+r,e-c+r,2*(h-r),2*(c-r),a),o)for(let i=-.5;i<=.5;i+=1)for(let n=-1;n<=1;n+=1)s.arc(t+3*i,e+3*n,1,0,2*Math.PI),s.closePath()}renderFill(t,e){const{stroke:i}=this;super.renderFill(t,e),t.fillStyle="string"==typeof i?i:"black",t.fill(this.gripPath.getPath2D())}};uc.className="RangeHandle",r([lc,hc()],uc.prototype,"width",2),r([lc,hc()],uc.prototype,"height",2),r([lc,hc()],uc.prototype,"cornerRadius",2),r([lc,hc()],uc.prototype,"grip",2);var{Path:pc,BBox:gc,ExtendedPath2D:mc,clippedRoundRect:yc,Property:fc,SceneChangeDetection:xc}=s.n1,bc=class extends pc{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new mc}layout(t,e,i,s,n,a){n=isNaN(n)?this.min:n,a=isNaN(a)?this.max:a,t===this.x&&e===this.y&&i===this.width&&this.height===s&&n===this.min&&a===this.max||(this.x=t,this.y=e,this.width=i,this.height=s,this.min=n,this.max=a,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:t,y:e,width:i,height:s}=this;return new gc(t,e,i,s)}computeVisibleRangeBBox(){const{x:t,y:e,width:i,height:s,min:n,max:a}=this,o=t+i*n;return new gc(o,e,t+i*a-o,s)}updatePath(){const{path:t,visiblePath:e,x:i,y:s,width:n,height:a,min:o,max:r,strokeWidth:l,cornerRadius:h}=this,c=l/2;t.clear(),e.clear();const d=this.align(i)+c,u=this.align(s)+c,p=this.align(i,n)-2*c,g=this.align(s,a)-2*c,m=this.align(i+n*o)+c,y=m+this.align(i+n*o,n*(r-o))-2*c,f={topLeft:h,topRight:h,bottomRight:h,bottomLeft:h};yc(t,d,u,p,g,f,new gc(d,u,m-d,g)),yc(t,d,u,p,g,f,new gc(y,u,p+d-y,g)),y-m>1&&yc(e,d,u,p,g,f,new gc(m,u,y-m,g))}renderStroke(t,e){super.renderStroke(t,e),super.renderStroke(t,this.visiblePath.getPath2D())}};bc.className="RangeMask",r([fc,xc()],bc.prototype,"cornerRadius",2);var vc=class extends s.n1.Group{constructor(t){super({name:"rangeSelectorGroup",zIndex:s.n1.ZIndexMap.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new s.n1.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(t)}layout(t,e,i,s,n,a){this.x=t,this.y=e,this.width=i,this.height=s,this.lOffset=n,this.rOffset=a,this.background.translationX=t,this.background.translationY=e,this.markDirty("RangeSelector")}updateBackground(t,e){null!=t&&this.background.removeChild(t),null!=e&&this.background.appendChild(e),this.markDirty("RangeSelector")}computeBBox(){const{x:t,y:e,width:i,height:n,lOffset:a,rOffset:o}=this;return new s.n1.BBox(t-a,e,i+(a+o),n)}},{BaseModuleInstance:Sc,ObserveChanges:Mc,Property:kc}=s.n1,Dc=class extends Sc{constructor(t){super(),this.ctx=t,this.enabled=!1,this.mask=new bc,this.minHandle=new uc,this.maxHandle=new uc,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(t,e)=>({x:t,y:e})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new vc([this.mask,this.minHandle,this.maxHandle]),this.destroyFns.push(t.scene.attachNode(this.rangeSelector),this.ctx.localeManager.addListener("locale-changed",()=>this.updateZoom()),this.ctx.layoutManager.registerElement(s.n1.LayoutElement.Navigator,t=>this.onLayoutStart(t)),this.ctx.layoutManager.addListener("layout:complete",t=>this.onLayoutComplete(t)),t.zoomManager.addListener("zoom-change",t=>this.onZoomChange(t))),this.domProxy=new rc(t,this),this.updateGroupVisibility(),this.miniChart=new ac(t)}updateBackground(t,e){this.rangeSelector?.updateBackground(t,e)}updateGroupVisibility(){const{enabled:t}=this;null!=this.rangeSelector&&t!==this.rangeSelector.visible&&(this.rangeSelector.visible=t,this.domProxy.updateVisibility(t),t?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}onLayoutStart(t){if(this.enabled){const{layoutBox:e}=t,i=this.height+this.spacing;e.shrink(i,"bottom"),this.y=e.y+e.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:e,bottom:i}=this.miniChart.computeAxisPadding();t.layoutBox.shrink(e+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(t){const{x:e,width:i}=t.series.rect,{y:s,height:a}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:t,_max:n}=this.domProxy;this.layoutNodes(e,s,i,a,t,n),this.domProxy.updateBounds({x:e,y:s,width:i,height:a})}this.x=e,this.width=i,this.miniChart?.layout(i,a).catch(t=>n.Vy.error(t))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(s.n1.InteractionState.ZoomDraggable)}onDragStart(t,{offsetX:e}){this.canDrag()&&("pan"===t&&(this.panStart=(e-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(t,{offsetX:e}){if(!this.canDrag())return;const{panStart:i,x:s,width:a}=this,{minRange:o}=this.domProxy;let{_min:r,_max:l}=this.domProxy;const h=(e-s)/a;if("min"===t)r=(0,n.qE)(0,h,l-o);else if("max"===t)l=(0,n.qE)(r+o,h,1);else if("pan"===t&&null!=i){const t=l-r;r=(0,n.qE)(0,h-i,1-t),l=r+t}this.domProxy._min=r,this.domProxy._max=l,this.updateZoom()}onZoomChange(t){const{x:e}=t;if(!e)return;const{x:i,y:s,width:n,height:a}=this,{min:o,max:r}=e;this.domProxy.updateMinMax(o,r),this.layoutNodes(i,s,n,a,o,r)}layoutNodes(t,e,i,s,n,a){const{rangeSelector:o,mask:r,minHandle:l,maxHandle:h}=this;r.layout(t,e,i,s,n,a),o.layout(t,e,i,s,l.width/2,h.width/2),uc.align(l,h,t,e,i,s,n,a,r.strokeWidth/2),n+(a-n)/2<.5?(l.zIndex=3,h.zIndex=4):(l.zIndex=4,h.zIndex=3),[l,this.maskVisibleRange,h].forEach((i,s)=>{const n=i.getBBox(),a={x:n.x-t,y:n.y-e,height:n.height,width:n.width};this.domProxy.updateSliderBounds(s,a)})}updateZoom(){this.enabled&&this.domProxy.updateZoom()}updateData(t){return this.miniChart?.updateData(t)}async processData(t){if(this.miniChart)return this.miniChart?.processData(t)}};r([Mc((t,e,i)=>{t.updateBackground(i?.root,e?.root)})],Dc.prototype,"miniChart",2),r([kc,Mc((t,e)=>{t.ctx.zoomManager.setNavigatorEnabled(Boolean(e)),t.updateGroupVisibility()})],Dc.prototype,"enabled",2),r([kc],Dc.prototype,"height",2),r([kc,Mc((t,e)=>{t.mask.cornerRadius=e})],Dc.prototype,"cornerRadius",2),r([kc],Dc.prototype,"spacing",2);var wc={type:"root",optionsKey:"navigator",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Dc(t),removable:!1,themeTemplate:{navigator:{enabled:!1,height:18,cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:[s.n1.FONT_SIZE_RATIO.SMALLER]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0}}}}},{ToolbarButtonProperties:Ic,Property:Cc}=s.n1,Lc=class extends Ic{};r([Cc],Lc.prototype,"value",2);var{ChartAxisDirection:Ac,LayoutElement:Tc,PropertiesArray:Nc,Toolbar:Oc,Property:Rc}=s.n1,Ec=class extends s.n1.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.buttons=new Nc(Lc),this.verticalSpacing=10,this.container=t.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new Oc(this.ctx.localeManager),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),t.layoutManager.registerElement(Tc.ToolbarBottom,this.onLayoutStart.bind(this)),t.zoomManager.addListener("zoom-change",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.container.removeChild(this.toolbar.getElement()),this.toolbar.destroy()}onLayoutStart(t){const{buttons:e,ctx:i,enabled:s,toolbar:n,verticalSpacing:a}=this,{layoutBox:o}=t;if(!s||!i.zoomManager.isZoomEnabled())return void n.setHidden(!0);n.setHidden(!1),n.updateButtons(e);const r=n.getBounds().height;n.setBounds({x:o.x,y:o.y+o.height-r,width:o.width,height:r}),o.shrink({bottom:r+a})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:t}}){const{zoomManager:e}=this.ctx,i=this.buttons.at(t);if(!i)return;const{value:s}=i;"number"==typeof s?e.extendToEnd("zoom-buttons",Ac.X,s):Array.isArray(s)?e.updateWith("zoom-buttons",Ac.X,()=>s):"function"==typeof s&&e.updateWith("zoom-buttons",Ac.X,s),this.toolbar.toggleActiveButtonByIndex(t)}};r([Rc],Ec.prototype,"enabled",2),r([Rc],Ec.prototype,"buttons",2);var Pc=864e5,Bc=30*Pc,Fc={type:"root",optionsKey:"ranges",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Ec(t),themeTemplate:{ranges:{enabled:!1,buttons:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:Bc},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*Bc},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*Bc},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(t,e)=>[new Date(`${new Date(e).getFullYear()}-01-01`).getTime(),e]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:365*Pc},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:(t,e)=>[t,e]}]}}},zc=class t extends s.n1.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(t){return this.sharedToolbar||this.createSharedToolbar(),this.toolbarWithSection(t)}createSharedToolbar(){this.sharedToolbar=new s.n1.Toolbar(this.ctx.localeManager,"vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.destroyFns.push(()=>{this.sharedToolbar&&(this.container.removeChild(this.sharedToolbar.getElement()),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(e){const i=this.sharedToolbar,s={layout:(t,s)=>{if(null!=this.firstLayoutSection&&this.firstLayoutSection!==e&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=e;const n=i.getBounds().width;i.setBounds({x:t.x,y:t.y,width:n}),t.shrink({left:n+i.horizontalSpacing+(s??0)})},addToolbarListener:(t,s)=>i.addToolbarListener(t,t=>{const i=this.getSectionIndex(e,t.button.index);if(i<0)return;const n={...t,button:this.sectionButtons[e][i]};s(n)}),updateButtons:s=>{this.sectionButtons[e]=s;const n=t.SECTION_ORDER.flatMap(t=>this.sectionButtons[t]);i.updateButtons(n)},updateButtonByIndex:(t,s)=>{i.updateButtonByIndex(this.getIndex(e,t),s)},toggleActiveButtonByIndex:t=>{i.toggleActiveButtonByIndex(this.getIndex(e,t))},toggleButtonEnabledByIndex:(t,s)=>{i.toggleButtonEnabledByIndex(this.getIndex(e,t),s)},setHidden:s=>{s?this.activeSections.delete(e):this.activeSections.add(e);let n=0;for(const a of t.SECTION_ORDER)if(a===e)for(const t of this.sectionButtons[e].keys())i.setButtonHiddenByIndex(n+t,s);else n+=this.sectionButtons[a].length},destroy:()=>{s.setHidden(!0),0===this.activeSections.size&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return s.setHidden(!1),s}getIndex(e,i){let s=0;for(const n of t.SECTION_ORDER){if(n===e)return s+i;s+=this.sectionButtons[n].length}return-1}getSectionIndex(e,i){let s=0;for(const n of t.SECTION_ORDER){if(n===e)return i>=s+this.sectionButtons[e].length?-1:i-s;s+=this.sectionButtons[n].length}return-1}};zc.SECTION_ORDER=["chartToolbar","annotations"];var Gc=zc,_c={type:"context",contextKey:"sharedToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Gc(t)},{CachedTextMeasurerPool:jc,ZIndexMap:Wc,LayoutElement:Vc,Property:Kc,BaseProperties:Yc,valueProperty:$c,TextUtils:Hc,Group:Uc,Label:Xc,Rect:Zc,Text:qc}=s.n1,Qc={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},Jc={up:"positive",down:"negative"},td={hlc:"altNeutral"},ed=class extends Yc{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};r([Kc],ed.prototype,"fill",2),r([Kc],ed.prototype,"fillOpacity",2);var id=class extends s.n1.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new Xc,this.positive=new Xc,this.negative=new Xc,this.neutral=new Xc,this.altNeutral=new Xc,this.background=new ed,this.layoutStyle="block",this.id="status-bar",this.data=void 0,this.layer=new Uc({name:"StatusBar",zIndex:Wc.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new s.n1.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new Zc),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new qc),value:this.labelGroup.appendChild(new qc),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new qc),value:this.labelGroup.appendChild(new qc),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new qc),value:this.labelGroup.appendChild(new qc),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new qc),value:this.labelGroup.appendChild(new qc),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new qc),value:this.labelGroup.appendChild(new qc),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new qc),value:this.labelGroup.appendChild(new qc),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new qc),value:this.labelGroup.appendChild(new qc),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new qc),value:this.labelGroup.appendChild(new qc),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new qc),value:this.labelGroup.appendChild(new qc),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=t.highlightManager,this.labelGroup.visible=!1,this.destroyFns.push(t.scene.attachNode(this.layer),t.layoutManager.registerElement(Vc.Overlay,t=>this.startPerformLayout(t)),t.layoutManager.addListener("layout:complete",t=>this.onLayoutComplete(t)),t.highlightManager.addListener("highlight-change",()=>this.updateHighlight()))}async processData(t){if(!this.enabled||null==this.data)return;const e=[];for(const t of this.labels){const{id:i,key:s}=t,n=this[s];null==n?t.domain=void 0:e.push($c(n,"number",{id:i}))}if(0===e.length)return;const{processedData:i,dataModel:s}=await t.request(this.id,this.data,{props:e});for(const t of this.labels){const{id:e,key:n}=t;null!=this[n]&&(t.domain=s.getDomain(this,e,"value",i))}}startPerformLayout(t){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled)return;const{layoutBox:e}=t;this.labelGroup.translationY=e.y+0;const i=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),s=Hc.getLineHeight(i),n=Qc[this.getChartType()]??0;let a,o=0,r="alphabetic";if("block"===this.layoutStyle)e.shrink(0+s+8,"top"),a=i+(s-i)/2;else{const{title:t}=this.ctx.chartService;if(r="top",a=0+t.padding,t.enabled){const e=t.node.getBBox();o=e.x+e.width+12}else o=t.padding}for(const{label:t,configuration:e,title:i,value:s,domain:l,formatter:h}of this.labels){if(null==l||0===(n&e)){i.visible=!1,s.visible=!1;continue}const c=Math.max(jc.measureText(h.format(l[0]),{font:this.positive.getFont(),textBaseline:r,textAlign:"left"}).width,jc.measureText(h.format(l[1]),{font:this.positive.getFont(),textBaseline:r,textAlign:"left"}).width,jc.measureText(h.format(l[0]),{font:this.negative.getFont(),textBaseline:r,textAlign:"left"}).width,jc.measureText(h.format(l[1]),{font:this.negative.getFont(),textBaseline:r,textAlign:"left"}).width);i.visible=!0,s.visible=!0;const d=jc.measureText(t,{font:this.title.getFont(),textBaseline:r,textAlign:"left"});i.setFont(this.title),i.fill=this.title.color,i.text=t,i.textBaseline=r,i.y=a,i.x=o,o+=d.width+4,s.textBaseline=r,s.y=a,s.x=o,o+=c+12}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=o-12,this.backgroundNode.height=s+0+8,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(t){this.labelGroup.translationX=t.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const t=this.highlightManager.getActiveHighlight(),e=t?.datum??this.data?.at(-1);if(null==e)return void(this.labelGroup.visible=!1);this.labelGroup.visible=!0;const i=t?.itemId;let s=null!=i?Jc[i]:void 0;null==s&&null!=this.openKey&&null!=this.closeKey&&(s=e[this.openKey]<e[this.closeKey]?"positive":"negative");for(const{domain:t,value:i,key:n,formatter:a,style:o}of this.labels){if(null==t)continue;let r=o??s??"neutral";"neutral"===r&&(r=td[this.getChartType()]??r);const l=this[n],h=null!=l?e?.[l]:void 0;i.setFont(this[r]),i.fill=this[r].color,i.text="number"==typeof h?a.format(h):""}}getChartType(){let t=this.ctx.chartService.publicApi?.getOptions()?.chartType;return null!=t&&null!=Qc[t]||(t="candlestick"),t}};r([Kc],id.prototype,"enabled",2),r([Kc],id.prototype,"openKey",2),r([Kc],id.prototype,"highKey",2),r([Kc],id.prototype,"lowKey",2),r([Kc],id.prototype,"closeKey",2),r([Kc],id.prototype,"volumeKey",2),r([Kc],id.prototype,"title",2),r([Kc],id.prototype,"positive",2),r([Kc],id.prototype,"negative",2),r([Kc],id.prototype,"neutral",2),r([Kc],id.prototype,"altNeutral",2),r([Kc],id.prototype,"background",2),r([Kc],id.prototype,"layoutStyle",2);var sd={type:"root",identifier:"status-bar",optionsKey:"statusBar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new id(t),themeTemplate:{statusBar:{enabled:!1,layoutStyle:s.n1.ThemeSymbols.DEFAULT_CAPTION_LAYOUT_STYLE,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:{$palette:"up.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:{$palette:"down.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:{$palette:"neutral.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"backgroundColor"},fillOpacity:.5},altNeutral:{color:"gray",fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}}}}},{BaseProperties:nd,CartesianAxis:ad,ChartAxisDirection:od,ContinuousScale:rd,ChartUpdateType:ld,ObserveChanges:hd,TooltipManager:cd,Property:dd,findMinMax:ud,isObjectWithStringProperty:pd}=s.n1,gd=s.n1.Debug.create("sync");function md(t,e,i){const s=t.getKeys(e),n=t.getKeys(i);return t.shouldFlipXY?.()?[n,s]:[s,n]}function yd(t="x"){switch(t){case"x":return[od.X];case"y":return[od.Y];case"xy":return[od.X,od.Y]}}var fd=class extends nd{constructor(t){super(),this.moduleContext=t,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0,this.domainMode="key",this.domainSync=new n.iN}updateSiblings(t){const{syncManager:e}=this.moduleContext;for(const i of e.getGroupSiblings(t??this.groupId))gd("ChartSync.updateSiblings()",i.id,i),this.updateChart(i)}updateChart(t,e=ld.PROCESS_DOMAIN){gd("ChartSync.updateChart()",t.id,ld[e],t),e===ld.PROCESS_DOMAIN?t.ctx.updateService.update(e,{forceNodeDataRefresh:!0}):t.ctx.updateService.update(e)}enabledZoomSync(){const{syncManager:t,zoomManager:e}=this.moduleContext;this.disableZoomSync?.(),this.disableZoomSync=e.addListener("zoom-change",()=>{for(const e of t.getGroupSiblings(this.groupId))e.modulesManager.getModule("sync")?.zoom&&e.ctx.zoomManager.updateZoom("sync",this.mergeZoom(e))})}enabledNodeInteractionSync(){const{highlightManager:t}=this.moduleContext;this.disableNodeInteractionSync?.(),this.disableNodeInteractionSync=t.addListener("highlight-change",this.onHighlightChange.bind(this))}onHighlightChange(t){const{syncManager:e}=this.moduleContext;if(t.callerId.endsWith("-sync"))return;gd("ChartSync.onHighlightChange()",t);const i=t.currentHighlight?.series,[s]=yd(this.axes),a=s===od.X?od.Y:od.X,[o,r]=i?md(i,s,a):[];let l=o?.[0]?t.currentHighlight?.datum?.[o[0]]:void 0;const h=(0,n.$P)(l);if(h&&(l=l.getTime()),!t.currentHighlight?.datum){for(const t of e.getGroupSiblings(this.groupId))t.modulesManager.getModule("sync")?.nodeInteraction&&(t.ctx.highlightManager.updateHighlight(`${t.id}-sync`),t.ctx.tooltipManager.removeTooltip(`${t.id}-sync`));return}const c="multi-series"===e.getGroupSyncMode(this.groupId);this.findMatchingHighlightNodes(s,a,c?r:[],h,l,t)}findMatchingHighlightNodes(t,e,i,s,a,o){const{syncManager:r}=this.moduleContext;gd("ChartSync.findMatchingHighlightNodes()",{mainDirection:t,secondaryKeys:i});for(const l of r.getGroupSiblings(this.groupId)){if(!l.modulesManager.getModule("sync")?.nodeInteraction)continue;let r=!1;for(const o of l.axes){if(!ad.is(o)||o.direction!==t)continue;const h=l.series.filter(s=>{if(!s.visible)return!1;if(i.length>0){const[,n]=md(s,t,e);return i.every(t=>n.includes(t))}return!0}).map(this.findMatchingNodes(o,t,s,a)).filter(n.vM);if(1===h.length&&h[0]?.nodeDatum!==l.ctx.highlightManager.getActiveHighlight()){this.dispatchHighlightUpdate(l,h[0].nodeDatum),r=!0;break}}r||(gd("ChartSync.findMatchingHighlightNodes() - no matching nodes",l.id,o),this.dispatchHighlightUpdate(l))}}findMatchingNodes(t,e,i,s){return n=>{const a=n.getKeys(t.direction);if(t.keys.length&&!t.keys.some(t=>a.includes(t)))return;const o=n.contextNodeData?.nodeData??[];if(!o?.length)return;const r=o[0],l=`${e}Key`;if(!pd(r,l))return;const h=r[l],c=o.find(t=>{const e=t.datum[h];return i?e.getTime()===s:e===s});return c?{series:n,nodeDatum:c}:null}}dispatchHighlightUpdate(t,e){gd("ChartSync.dispatchHighlightUpdate()",t.id,e),t.ctx.highlightManager.updateHighlight(`${t.id}-sync`,e);const i=e?.series.tooltipEnabled??t.tooltip.enabled;if(e&&i){const i=t.seriesAreaBoundingBox,s=i.x+(e.midPoint?.x??e.point?.x??0),n=i.y+(e.midPoint?.y??e.point?.y??0),a=cd.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:n},e.series,e,void 0);t.ctx.tooltipManager.updateTooltip(`${t.id}-sync`,a,t.getTooltipContent(e.series,e.datumIndex,e))}else t.ctx.tooltipManager.removeTooltip(`${t.id}-sync`);this.updateChart(t,ld.SERIES_UPDATE)}async getSyncedDomain(t){if(!ad.is(t)||"xy"!==this.axes&&this.axes!==t.direction)return;const{groupState:e,directionDomains:i,domainsByKey:s,positionDomains:n}=this.updateDomainState(t);return this.validateAxis(t,e),await this.waitForDomainsToBeReady(),"position"===this.domainMode?this.calculateDerivedDomain(t,n):"direction"===this.domainMode||0===t.keys.length?this.calculateDerivedDomain(t,i):this.calculateKeyDerivedDomain(t,s)}updateDomainState(t){var e,i,s,n,a;const{syncManager:o}=this.moduleContext,r=o.getChart().id,l=t.id,h=o.getGroupState(this.groupId);if(!h)throw new Error("AG Charts - no GroupState for groupId: "+this.groupId);const c=h.domains??(h.domains={}),d=c[e=t.direction]??(c[e]={derived:[],sources:{},dirty:!0});((i=d.sources)[r]??(i[r]={}))[l]=t.dataDomain.domain,d.dirty=!0;const u=h.domainsByKey??(h.domainsByKey={});for(const e of t.keys??[]){const i=u[e]??(u[e]={derived:[],sources:{},dirty:!0});((s=i.sources)[r]??(s[r]={}))[l]=t.dataDomain.domain,i.dirty=!0}const p=h.domainsByPosition??(h.domainsByPosition={}),g=p[n=t.position]??(p[n]={derived:[],sources:{},dirty:!0});return((a=g.sources)[r]??(a[r]={}))[l]=t.dataDomain.domain,g.dirty=!0,{groupState:h,directionDomains:d,domainsByKey:u,positionDomains:g}}validateAxis(t,e){const i="multi-series"===this.moduleContext.syncManager.getGroupSyncMode(this.groupId);yd(this.axes).includes(t.direction)&&(i?this.validateMultiSeries(t,e):this.validateSingleSeries(t,e))}validateMultiSeries(t,e){const{min:i,max:s,nice:a,reverse:o}=t,r=new Set(t.boundSeries.flatMap(e=>e.getKeys(t.direction)));for(const t of e.members){const{axes:e,modulesManager:l}=t,h=yd(l.getModule("sync")?.axes),c=e.filter(t=>h.includes(t.direction)).filter(t=>t.boundSeries.some(e=>e.getKeys(t.direction).some(t=>r.has(t))));if(0===c.length)continue;const[d]=c;if(d.min!==i||d.max!==s||d.nice!==a||d.reverse!==o)return n.Vy.warnOnce("To allow synchronization, ensure that all synchronized axes with matching keys have matching min, max, nice, and reverse properties."),void(this.enabled=!1)}}validateSingleSeries(t,e){const i=e.members,[{axes:s}]=i,{direction:a,min:o,max:r,nice:l,reverse:h}=t;for(const t of s)if(a===t.direction&&(l!==t.nice||h!==t.reverse||o!==t.min&&((0,n.Bf)(o)||(0,n.Bf)(t.min))||r!==t.max&&((0,n.Bf)(r)||(0,n.Bf)(t.max))))return n.Vy.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),void(this.enabled=!1)}calculateDerivedDomain(t,e){if(!e.dirty)return e.derived;const i=e.derived;return e.derived=(0,n.Am)(Object.values(e.sources).map(t=>Object.values(t)).flat(2)),rd.is(t.scale)&&(e.derived=ud(e.derived)),e.dirty=!1,(0,n.r1)(i,e.derived)||(gd(t.id,"updated",t.keys,{before:i,after:e.derived}),this.updateSiblings()),e.derived}calculateKeyDerivedDomain(t,e){let i=[],s=[],a=!1;for(const o of t.keys??[]){const r=e[o],l=r.derived;i.push(...l),r.dirty?(r.derived=(0,n.Am)(Object.values(r.sources).map(t=>Object.values(t)).flat(2)),rd.is(t.scale)&&(r.derived=ud(r.derived)),s.push(...r.derived),r.dirty=!1,a||(a=!(0,n.r1)(l,r.derived))):s.push(...r.derived)}return rd.is(t.scale)&&(i=ud(i),s=ud(s)),a&&!(0,n.r1)(i,s)&&(gd(t.id,"updated",t.keys,{before:i,after:s}),this.updateSiblings()),s}removeAxis(t){if(!ad.is(t)||"xy"!==this.axes&&this.axes!==t.direction)return;const{syncManager:e}=this.moduleContext,i=e.getGroupState(this.groupId),s=e.getChart().id,n=t.id;delete i?.domains?.[t.direction]?.sources?.[s]?.[n];for(const e of t.keys??[])delete i?.domainsByKey?.[e]?.sources?.[s]?.[n];delete i?.domainsByPosition?.[t.position]?.sources?.[s]?.[n]}async waitForDomainsToBeReady(){const{syncManager:t}=this.moduleContext;let e=0;for(;t.getGroupMembers(this.groupId).some(t=>"init"===t.syncStatus);)gd("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated",this.groupId),await this.domainSync.await(),e++;e>0&&gd("ChartSync.waitForDomainsToBeReady() - waited for",e,"iterations"),this.domainSync.notify()}mergeZoom(t){const{zoomManager:e}=this.moduleContext;if("xy"===this.axes)return e.getZoom();const i=t.ctx.zoomManager.getZoom()??{};return i[this.axes]=e.getZoom()?.[this.axes],i}onEnabledChange(){const{syncManager:t}=this.moduleContext;this.enabled?t.subscribe(this.groupId):t.unsubscribe(this.groupId),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(t,e){if(!this.enabled||t===e)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(e),i.subscribe(t),this.updateSiblings(e),this.updateSiblings(t)}onAxesChange(){if(!this.enabled)return;const{syncManager:t}=this.moduleContext;this.updateChart(t.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:t}=this.moduleContext;t.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};fd.className="Sync",r([dd,hd(t=>t.onEnabledChange())],fd.prototype,"enabled",2),r([dd,hd((t,e,i)=>t.onGroupIdChange(e,i))],fd.prototype,"groupId",2),r([dd,hd(t=>t.onAxesChange())],fd.prototype,"axes",2),r([dd,hd(t=>t.onNodeInteractionChange())],fd.prototype,"nodeInteraction",2),r([dd,hd(t=>t.onZoomChange())],fd.prototype,"zoom",2),r([dd,hd(t=>t.onAxesChange())],fd.prototype,"domainMode",2);var xd={type:"root",optionsKey:"sync",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new fd(t),themeTemplate:{sync:{enabled:!1}}},{Property:bd}=s.n1,vd="#2196f3",Sd=class extends s.n1.Rect{constructor(){super(...arguments),this.fill=vd,this.fillOpacity=.2,this.zIndex=s.n1.ZIndexMap.ZOOM_SELECTION}updateValid(){this.fill=vd}updateInvalid(){this.fill="#8a8a8a"}};Sd.className="ZoomRect",r([bd],Sd.prototype,"fill",2),r([bd],Sd.prototype,"fillOpacity",2);var Md={min:0,max:1},kd=Md.max-Md.min,Dd="middle",wd=(t,e=Md.min,i=Md.max)=>(0,n.qE)(e,t,i);function Id(){return{x:{...Md},y:{...Md}}}function Cd(t){return t.x.max-t.x.min}function Ld(t){return t.y.max-t.y.min}function Ad(t,e,i=1e-10){return(0,n.YX)(t.min,e.min,i)&&(0,n.YX)(t.max,e.max,i)}function Td(t,e,i){return Ad(t.x,e.x,i)&&Ad(t.y,e.y,i)}function Nd(t){return{x:{min:t?.x?.min??Md.min,max:t?.x?.max??Md.max},y:{min:t?.y?.min??Md.min,max:t?.y?.max??Md.max}}}function Od(t,e,i){if(!t)return{x:0,y:0};const s=wd(e-t.x,0,t.x+t.width),n=wd(i-t.y,0,t.y+t.height),a=1/t.width*s,o=1-1/t.height*n;return{x:wd(a),y:wd(o)}}function Rd(t,e,i){return{x:{min:t.x.min+e,max:t.x.max+e},y:{min:t.y.min+i,max:t.y.max+i}}}function Ed(t,e,i){return{x:{min:t.x.min,max:t.x.min+Cd(t)*e},y:{min:t.y.min,max:t.y.min+Ld(t)*i}}}function Pd(t,e,i){const s=Cd(t),n=Ld(t),a=t.x.min+s/2,o=t.y.min+n/2;return{x:{min:a-s*e/2,max:a+s*e/2},y:{min:o-n*i/2,max:o+n*i/2}}}function Bd(t,e,i,s){const{min:n,max:a}=e,o=n+(a-n)/2,r=t.max-t.min;switch(i){case"start":return{min:n,max:e.min+r};case"end":return{min:e.max-r,max:a};case"middle":return{min:o-r/2,max:o+r/2};case"pointer":return function(t,e,i){const s=t.max-t.min,n=i-i*(1-(e.max-e.min-s));return{min:t.min+n,max:t.max+n}}(t,e,s??o);default:return{min:n,max:a}}}function Fd(t){return{x:zd(t.x),y:zd(t.y)}}function zd(t){const e=t.max-t.min;let i=t.max>Md.max?Md.max-e:t.min,s=t.min<Md.min?e:t.max;return i=Math.max(Md.min,i),s=Math.min(Md.max,s),{min:i,max:s}}var Gd=class{update(t,e,i,n,a,o){return this.oldZoom??(this.oldZoom=Nd(e===s.n1.ChartAxisDirection.X?{...a,x:o}:{...a,y:o})),this.updateCoords(t.currentX,t.currentY),this.updateZoom(e,i,n)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(t,e){this.coords?(this.coords.x2=t,this.coords.y2=e):this.coords={x1:t,y1:e,x2:t,y2:e}}updateZoom(t,e,i){const{coords:n,oldZoom:a}=this;let o=Nd(a);if(!n||!a)return t===s.n1.ChartAxisDirection.X?o.x:o.y;const r=Od(i,n.x1,n.y1),l=Od(i,n.x2,n.y2);if(t===s.n1.ChartAxisDirection.X){const t=(l.x-r.x)*Cd(a);return o.x.max+=t,o.x=Bd(o.x,a.x,e,r.x),o=Fd(o),o.x}const h=(l.y-r.y)*Ld(a);return o.y.max-=h,o.y=Bd(o.y,a.y,e,r.y),o=Fd(o),o.y}},_d=class{constructor(t,e,i,s,n,a){this.contextMenuRegistry=t,this.zoomManager=e,this.getModuleProperties=i,this.getRect=s,this.updateZoom=n,this.isZoomValid=a}registerActions(t){const{contextMenuRegistry:e}=this;if(!t)return e.setVisible("zoom-to-cursor",!1),void e.setVisible("pan-to-cursor",!1);e.setVisible("zoom-to-cursor",!0),e.setVisible("pan-to-cursor",!0),e.builtins.items["zoom-to-cursor"].action=this.onZoomToHere.bind(this),e.builtins.items["pan-to-cursor"].action=this.onPanToHere.bind(this);const i=t=>{const e=this.getRect();if(!e)return!0;const i=Od(e,t.x,t.y);return null!=this.iterateFindNextZoomAtPoint(i)},s=()=>!Td(Nd(this.zoomManager.getZoom()),Id()),n=e.addListener("context-setup",t=>{e.builtins.items["zoom-to-cursor"].enabled=i(t),e.builtins.items["pan-to-cursor"].enabled=s()});return()=>{n(),e.setVisible("zoom-to-cursor",!1),e.setVisible("pan-to-cursor",!1)}}computeOrigin(t){const e=this.getRect(),{enabled:i}=this.getModuleProperties();if(i&&e&&t?.target&&t instanceof MouseEvent)return Od({x:0,y:0,width:e.width,height:e.height},t.offsetX,t.offsetY)}onZoomToHere({event:t}){const e=this.computeOrigin(t);if(!e)return;const i=this.iterateFindNextZoomAtPoint(e);null!=i&&this.updateZoom(i)}onPanToHere({event:t}){const e=this.computeOrigin(t);if(!e)return;const i=Nd(this.zoomManager.getZoom()),s=Cd(i),n=Ld(i),a=e.x*s,o=e.y*n,r=kd/2;let l={x:{min:e.x-r,max:e.x+r},y:{min:e.y-r,max:e.y+r}};l=Pd(l,s,n),l=Rd(l,i.x.min-e.x+a,i.y.min-e.y+o),this.updateZoom(Fd(l))}iterateFindNextZoomAtPoint(t){const{scrollingStep:e}=this.getModuleProperties();for(let i=e;i<=1-e;i+=e){const e=this.getNextZoomAtPoint(t,i);if(this.isZoomValid(e))return e}}getNextZoomAtPoint(t,e){const{isScalingX:i,isScalingY:s}=this.getModuleProperties(),n=Nd(this.zoomManager.getZoom()),a=t.x*Cd(n),o=t.y*Ld(n),r=kd/2;let l={x:{min:t.x-r,max:t.x+r},y:{min:t.y-r,max:t.y+r}};return l=Pd(l,i?Cd(n)*e:kd,s?Ld(n)*e:kd),l=Rd(l,n.x.min-t.x+a,n.y.min-t.y+o),Fd(l)}},{BBoxValues:jd,ChartAxisDirection:Wd}=s.n1,Vd=class{constructor(t){this.axesHandlers=t,this.axes=[]}destroy(){this.axes.forEach(t=>t.div.destroy())}update(t,e){if(this.axes.forEach(e=>e.div.setHidden(!t)),!t)return;const{X:i,Y:n}=s.n1.ChartAxisDirection,a=[...e.axisManager.getAxisContext(i),...e.axisManager.getAxisContext(n)],{removed:o,added:r}=this.diffAxisIds(a);o.length>0&&(this.axes=this.axes.filter(t=>!o.includes(t.axisId)||(t.div.destroy(),!1)));for(const t of r){const{axisId:i,direction:s}=t;this.axes.push(this.initAxis(e,i,this.axesHandlers,s))}for(const t of this.axes){const e=a.find(e=>e.axisId===t.axisId).getCanvasBounds();t.div.setHidden(jd.isEmpty(e)),void 0!==e&&t.div.setBounds(e)}}toggleAxisDraggingCursor(t,e){for(const i of this.axes)i.direction===t&&i.div.setCursor(e?this.getCursor(t):void 0)}getCursor(t){return t===Wd.X?"ew-resize":"ns-resize"}initAxis(t,e,i,s){const n=t.proxyInteractionService.createProxyElement({type:"region",domManagerId:e,where:"afterend"});return n.setCursor(this.getCursor(s)),n.addListener("drag-start",t=>{"touch"===t.device&&t.sourceEvent.preventDefault(),i.onDragStart(e,s)}),n.addListener("drag-move",t=>i.onDrag(t)),n.addListener("drag-end",i.onDragEnd),n.addListener("dblclick",()=>i.onDoubleClick(e,s)),{axisId:e,div:n,direction:s}}diffAxisIds(t){const e=this.axes.map(t=>t.axisId),i=t.map(t=>t.axisId);return{removed:e.filter(t=>!i.includes(t)),added:t.filter(t=>!e.includes(t.axisId))}}},Kd={off:1,short:.01,long:.002},Yd=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:t}=this;return Math.max("number"==typeof t?t:Kd[t]??1,1e-4)}addListener(t,e){return this.onUpdate=e,()=>{this.onUpdate=void 0}}stopInteractions(){null!=this.inertiaHandle&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(t){this.updateCoords(t.currentX,t.currentY);const{x1:e=0,y1:i=0,x2:s=0,y2:n=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:e-s,deltaY:i-n})}start(){this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:t}=this;let e=0,i=0,s=0;if(t.length>0){const n=this.zoomCoordsHistoryIndex%16;let a=n-1;a<0&&(a=t.length-1);let o=n;o>=t.length&&(o=0);const r=t[a],l=t[o];e=r.x-l.x,i=r.y-l.y,s=r.t-l.t}if(this.coords=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,s>0&&this.decelerationValue<1){const t=e/s,a=i/s,o=Math.hypot(t,a),r=Math.atan2(a,t),l=performance.now();this.inertiaHandle=(0,n.zk)().requestAnimationFrame(t=>{this.animateInertia(t,t,l,o,r)})}}recordCurrentZoomCoords(){const{coords:t,coordsHistory:e,zoomCoordsHistoryIndex:i}=this;if(!t)return;const{x2:s,y2:n}=t,a=Date.now();e[i%16]={x:s,y:n,t:a},this.zoomCoordsHistoryIndex+=1}animateInertia(t,e,i,s,n){const a=1-this.decelerationValue,o=-s/Math.log(a),r=s*(a**(e-i)-1)/Math.log(a),l=s*(a**(t-i)-1)/Math.log(a);this.onUpdate?.({type:"update",deltaX:-Math.cos(n)*(l-r),deltaY:-Math.sin(n)*(l-r)}),l>=o-1||(this.inertiaHandle=requestAnimationFrame(e=>{this.animateInertia(e,t,i,s,n)}))}updateCoords(t,e){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:t,y2:e}:this.coords={x1:t,y1:e,x2:t,y2:e}}translateZooms(t,e,i,s){const a=Od(t,t.x+Math.abs(i),t.y+t.height-Math.abs(s)),o=Math.sign(i)*a.x,r=-Math.sign(s)*a.y,l={};for(const[t,{direction:i,zoom:s}]of(0,n.jO)(e)){if(s&&s.min===Md.min&&s.max===Md.max)continue;let e=Nd({[i]:s});e=Fd(Rd(e,o*Cd(e),r*Ld(e))),l[t]={direction:i,zoom:e[i]}}return l}},$d=class{update(t,e,i,s){const n=t.deltaX*e*200;return this.translateZooms(i,s,n)}translateZooms(t,e,i){const a={},o=Od(t,t.x+Math.abs(i),0),r=i<0?-o.x:o.x;for(const[t,{direction:i,zoom:o}]of(0,n.jO)(e)){if(i!==s.n1.ChartAxisDirection.X)continue;let e=Nd({x:o});e=Fd(Rd(e,r*Cd(e),0)),a[t]={direction:i,zoom:e.x}}return a}},Hd=class{updateAxes(t,e,i,a){const o=t.sourceEvent,r={},{anchorPointX:l,anchorPointY:h,isScalingX:c,isScalingY:d,scrollingStep:u}=e,p=Od(i,o.offsetX??o.clientX,o.offsetY??o.clientY);for(const[e,{direction:i,zoom:o}]of(0,n.jO)(a)){if(null==o)continue;let n={...o};const a=u*t.deltaY*(o.max-o.min);if(i===s.n1.ChartAxisDirection.X&&c)n.max+=a,n=Bd(n,o,l,p.x);else{if(i!==s.n1.ChartAxisDirection.Y||!d)continue;n.max+=a,n=Bd(n,o,h,p.y)}r[e]={direction:i,zoom:zd(n)}}return r}update(t,e,i,s){const{anchorPointX:n,anchorPointY:a,isScalingX:o,isScalingY:r,scrollingStep:l}=e,h=Od(i,t.offsetX+i.x,t.offsetY+i.y),c=t.deltaY;let d=Nd(s);return d.x.max+=o?l*c*Cd(s):0,d.y.max+=r?l*c*Ld(s):0,o&&(d.x=Bd(d.x,s.x,n,h.x)),r&&(d.y=Bd(d.y,s.y,a,h.y)),d=Fd(d),d}updateDelta(t,e,i){const{anchorPointX:s,anchorPointY:n,isScalingX:a,isScalingY:o,scrollingStep:r}=e;let l=Nd(i);return l.x.max+=a?r*-t*Cd(i):0,l.y.max+=o?r*-t*Ld(i):0,a&&(l.x=Bd(l.x,i.x,s)),o&&(l.y=Bd(l.y,i.y,n)),l=Fd(l),l}},Ud=class{constructor(t,e,i){this.rect=t,this.getZoom=e,this.isZoomValid=i,this.rect.visible=!1}update(t,e,i){const s=t.currentX+(i?.x??0),n=t.currentY+(i?.y??0);this.rect.visible=!0,this.updateCoords(s,n,e,i),this.updateRect(i)}stop(t,e,i){let s=Nd();return t&&e?(this.coords&&(s=this.createZoomFromCoords(e,i)),s=Fd(function(t,e,i){return{x:{min:t.x.min*e,max:t.x.max*e},y:{min:t.y.min*i,max:t.y.max*i}}}(s,e.width/t.width,e.height/t.height)),this.reset(),s):s}reset(){this.coords=void 0,this.rect.visible=!1}didUpdate(){return this.rect.visible&&this.rect.width>0&&this.rect.height>0}updateCoords(t,e,i,s){if(!this.coords)return void(this.coords={x1:t,y1:e,x2:t,y2:e});const{coords:n}=this;if(n.x2=t,n.y2=e,!s)return;const{isScalingX:a,isScalingY:o,keepAspectRatio:r}=i,l=this.getNormalisedDimensions();if(r&&a&&o){const t=s.width/s.height;n.y2<n.y1?n.y2=Math.min(n.y1-l.width/t,n.y1):n.y2=Math.max(n.y1+l.width/t,n.y1)}a||(n.x1=s.x,n.x2=s.x+s.width),o||(n.y1=s.y,n.y2=s.y+s.height)}updateRect(t){if(!t)return;const{rect:e}=this,i=this.getNormalisedDimensions(),{width:s,height:n}=i;let{x:a,y:o}=i;a=Math.max(a,t.x),a-=Math.max(0,a+s-(t.x+t.width)),o=Math.max(o,t.y),o-=Math.max(0,o+n-(t.y+t.height)),e.x=a,e.y=o,e.width=s,e.height=n;const r=this.createZoomFromCoords(t,this.getZoom());this.isZoomValid(r)?e.updateValid():e.updateInvalid()}createZoomFromCoords(t,e){const i=Nd(e),s=this.getNormalisedDimensions(),n=Od(t,s.x,s.y+s.height);let a=Ed(i,s.width/t.width,s.height/t.height);return a=Rd(a,n.x*Cd(i),n.y*Ld(i)),a=Fd(a),a}getNormalisedDimensions(){const{x1:t=0,y1:e=0,x2:i=0,y2:s=0}=this.coords??{};return{x:t<=i?t:i,y:e<=s?e:s,width:t<=i?i-t:t-i,height:e<=s?s-e:e-s}}},{ActionOnSet:Xd,BaseProperties:Zd,ChartAxisDirection:qd,NativeWidget:Qd,PropertiesArray:Jd,Toolbar:tu,ToolbarButtonProperties:eu,Property:iu}=s.n1,su=class extends eu{};r([iu],su.prototype,"value",2),r([iu],su.prototype,"section",2);var nu=class extends Zd{constructor(t,e,i,s,a,o,r){super(),this.ctx=t,this.getModuleProperties=e,this.getResetZoom=i,this.updateZoom=s,this.updateAxisZoom=a,this.resetZoom=o,this.isZoomValid=r,this.enabled=!1,this.buttons=new Jd(su),this.visible="hover",this.verticalSpacing=10,this.detectionRange=38,this.destroyFns=[],this.container=new Qd((0,n.n)("div")),this.container.addClass("ag-charts-zoom-buttons"),t.domManager.addChild("canvas-overlay","zoom-buttons",this.container.getElement()),this.toolbar=new tu(t.localeManager),this.container.addChild(this.toolbar),this.toolbar.getElement().style.transform="translateY(54px)",this.toggleVisibility("always"===this.visible),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("button-focused",this.onButtonFocus.bind(this)),t.widgets.containerWidget.addListener("mousemove",this.onHover.bind(this)),t.widgets.containerWidget.addListener("mouseleave",this.onLeave.bind(this)),t.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),this.teardown.bind(this))}destroy(){for(const t of this.destroyFns)t()}toggleVisibleZoomed(t){"zoomed"===this.visible&&this.toggleVisibility(!t)}teardown(){this.ctx.domManager.removeChild("canvas-overlay","zoom-buttons"),this.container.destroy()}onLayoutComplete(t){const{buttons:e,container:i}=this,{rect:s}=t.series;this.toolbar.updateButtons(e),this.toggleButtons();const n=i.getBounds().height;i.setBounds({y:s.y+s.height-n})}onHover(t){if(!this.enabled||"hover"!==this.visible||this.toolbar.isHidden())return;const{container:e,detectionRange:i,ctx:{scene:s}}=this,{currentY:n,sourceEvent:{target:a}}=t,o=e.getElement(),r=n>o.offsetTop-i&&n<s.canvas.element.offsetHeight||a===o;this.toggleVisibility(r)}onLeave(){"hover"===this.visible&&this.toggleVisibility(!1)}toggleVisibility(t,e=!1){const{container:i,toolbar:s,verticalSpacing:n}=this;s.toggleClass("ag-charts-zoom-buttons__toolbar--hidden",!t);const a=s.getElement();a.style.transitionDuration=e?"0s":"",a.style.transform=t?"translateY(0)":`translateY(${i.getBounds().height+n}px)`}toggleButtons(){const t=Nd(this.ctx.zoomManager.getZoom());if(!this.previousZoom||!Td(this.previousZoom,t)){this.previousZoom=t;for(const[e,i]of this.buttons.entries()){let s=!0;switch(i?.value){case"pan-start":case"pan-left":s=t.x.min>Md.min;break;case"pan-end":case"pan-right":s=t.x.max<Md.max;break;case"zoom-out":s=!Td(t,Id());break;case"zoom-in":s=this.isZoomValid(this.getNextZoomStateUnified("zoom-in",t,this.getModuleProperties()));break;case"reset":s=!Td(t,this.getResetZoom())}this.toolbar.toggleButtonEnabledByIndex(e,s)}}}onButtonPress({button:t}){if(!this.enabled||this.toolbar.isHidden())return;const e=this.getModuleProperties();if(e.independentAxes&&"reset"!==t.value){const i=this.ctx.zoomManager.getAxisZooms();for(const[s,{direction:a,zoom:o}]of(0,n.jO)(i))null!=o&&this.onButtonPressAxis(t,e,s,a,o)}else this.onButtonPressUnified(t,e)}onButtonFocus(t){this.toggleVisibility(!0,!0)}onButtonPressAxis(t,e,i,s,n){const{isScalingX:a,isScalingY:o,scrollingStep:r}=e;let l={...n};const h=n.max-n.min;switch(t.value){case"pan-start":l.max=h,l.min=0;break;case"pan-end":l.min=l.max-h,l.max=Md.max;break;case"pan-left":l.min-=h*r,l.max-=h*r;break;case"pan-right":l.min+=h*r,l.max+=h*r;break;case"zoom-in":case"zoom-out":{const i=s===qd.X,h=i&&a||!i&&o;let c="zoom-in"===t.value?1-r:1+r;h||(c=1);const d=i?this.getAnchorPointX(e):this.getAnchorPointY(e);l.max=l.min+(l.max-l.min)*c,l=Bd(l,n,d);break}}this.updateAxisZoom(i,s,zd(l))}onButtonPressUnified(t,e){const{scrollingStep:i}=e,s=Nd(this.ctx.zoomManager.getZoom());let n=Nd(s);switch(t.value){case"reset":return void this.resetZoom();case"pan-start":n.x.max=Cd(n),n.x.min=0;break;case"pan-end":n.x.min=Md.max-Cd(n),n.x.max=Md.max;break;case"pan-left":n=Rd(n,-Cd(n)*i,0);break;case"pan-right":n=Rd(n,Cd(n)*i,0);break;case"zoom-in":case"zoom-out":n=this.getNextZoomStateUnified(t.value,s,e)}this.updateZoom(Fd(n))}getNextZoomStateUnified(t,e,i){const{isScalingX:s,isScalingY:n,scrollingStep:a}=i,o="zoom-in"===t?1-a:1+a,r=Ed(e,s?o:1,n?o:1);return r.x=Bd(r.x,e.x,this.getAnchorPointX(i)),r.y=Bd(r.y,e.y,this.getAnchorPointY(i)),r}getAnchorPointX(t){const e=this.anchorPointX??t.anchorPointX;return"pointer"===e?"end":e}getAnchorPointY(t){const e=this.anchorPointY??t.anchorPointY;return"pointer"===e?Dd:e}};r([iu,Xd({changeValue(t){this.toolbar?.setHidden(!t)}})],nu.prototype,"enabled",2),r([iu],nu.prototype,"buttons",2),r([iu,Xd({changeValue(t,e){null!=e&&this.toggleVisibility("always"===t)}})],nu.prototype,"visible",2),r([iu],nu.prototype,"anchorPointX",2),r([iu],nu.prototype,"anchorPointY",2);var au=1e6;function ou({min:t,max:e},i,s,n){return 0===n?0:au*((i-s)/n*(e-t)+t)}function ru(t,e,i,s){return 0===e&&(e=30),0===s&&(s=30),!(t+e<i-s||i+s<t-e)}var lu=class{constructor(){this.touchStart={origins:[{identifier:0,normalX:NaN,normalY:NaN},{identifier:0,normalX:NaN,normalY:NaN}]},this.initialZoom={x:{min:0,max:1},y:{min:0,max:1}},this.previous={a1:NaN,a2:NaN,b1:NaN,b2:NaN}}start(t,e,i){if(2!==t.sourceEvent.targetTouches.length)return!1;t.sourceEvent.preventDefault();const s=Array.from(t.sourceEvent.targetTouches),{x:n,y:a,width:o,height:r}=e.getBoundingClientRect();this.initialZoom.x.min=i.x?.min??0,this.initialZoom.x.max=i.x?.max??1,this.initialZoom.y.min=i.y?.min??0,this.initialZoom.y.max=i.y?.max??1,this.touchStart.origins.forEach(t=>t.identifier=0),this.previous.a1=NaN,this.previous.a2=NaN,this.previous.b1=NaN,this.previous.b2=NaN;for(const t of[0,1]){const e=s[t].clientX,i=a+r-s[t].clientY;this.touchStart.origins[t].identifier=s[t].identifier,this.touchStart.origins[t].normalX=ou(this.initialZoom.x,e,n,o),this.touchStart.origins[t].normalY=ou(this.initialZoom.y,i,a,r)}const[l,h]=s,[c,d]=this.touchStart.origins,u=ru(l.clientX,l.radiusX,h.clientX,h.radiusX);return ru(l.clientY,l.radiusY,h.clientY,h.radiusY)&&(c.normalY=d.normalY=(c.normalY+d.normalY)/2),u&&(c.normalX=d.normalX=(c.normalX+d.normalX)/2),!0}update(t,e){t.sourceEvent.preventDefault();const i=Array.from(t.sourceEvent.targetTouches),{x:s,y:n,width:a,height:o}=e.getBoundingClientRect(),{origins:r}=this.touchStart,l=[0,1].map(t=>i.find(e=>e.identifier===r[t].identifier)),h=r[0].normalX,c=r[1].normalX,d=l[0].clientX,u=l[1].clientX,p=r[0].normalY,g=r[1].normalY,m=n+o-l[0].clientY,y=n+o-l[1].clientY;return this.twitchTolerantZoomPan4(h,c,d,u,p,g,m,y,s,n,a,o)}end(t){const e=Array.from(t.sourceEvent.targetTouches).map(t=>t.identifier);return!e.includes(this.touchStart.origins[0].identifier)||!e.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(t,e,i,s,n,a,o,r,l,h,c,d){const{initialZoom:u,previous:p}=this;return{x:hu(t,e,i,s,p,"a1","a2",l,c,u.x),y:hu(n,a,o,r,p,"b1","b2",h,d,u.y)}}};function hu(t,e,i,s,n,a,o,r,l,h){if(t!=e){const h=n[a],c=n[o];return Math.abs(i-h)+Math.abs(s-c)<=1?(i=h,s=c):(n[a]=i,n[o]=s),function(t,e,i,s,n,a){[t,e]=[Math.min(t,e),Math.max(t,e)],[i,s]=[Math.min(i,s),Math.max(i,s)];const o=au*(s-n)/a,r=(i-n)/(s-n),l=(t-r*e)/(au-au*(i-n)/a+r*(o-au));return{min:l,max:(e+(o-au)*l)/o}}(t,e,i,s,r,l)}{const e=(t-(ou(h,i,r,l)+ou(h,s,r,l))/2)/au;return{min:h.min+e,max:h.max+e}}}var{ActionOnSet:cu,ChartAxisDirection:du,ChartUpdateType:uu,Deprecated:pu,Property:gu,InteractionState:mu,ProxyProperty:yu}=s.n1,fu=t=>(0,n.GB)(t,10),xu="zoom-cursor",bu="zoom-tooltip",vu=class extends s.n1.BaseProperties{constructor(t){super(),this.onChange=t,this.enabled=!1,this.padding=0}};r([gu,cu({changeValue(t){this.onChange({enabled:t,padding:this.padding})}})],vu.prototype,"enabled",2),r([gu,cu({changeValue(t){this.onChange({enabled:this.enabled,padding:t})}})],vu.prototype,"padding",2);var Su=class extends s.n1.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.enableAxisDragging=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=kd/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX="end",this.anchorPointY=Dd,this.autoScaling=new vu(t=>{this.ctx.zoomManager.setAutoScaleYAxis(t.enabled,t.padding)}),this.buttons=new nu(this.ctx,this.getModuleProperties.bind(this),this.getResetZoom.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.axisDragger=new Gd,this.panner=new Yd,this.scroller=new Hd,this.scrollPanner=new $d,this.twoFingers=new lu,this.deceleration="short",this.dragState=0,this.isState=t=>this.ctx.interactionManager.isState(t),this.destroyContextMenuActions=void 0,this.isFirstWheelEvent=!0,this.debouncedWheelReset=(0,n.sg)(()=>{this.isFirstWheelEvent=!0},100);const e=new Sd;this.selector=new Ud(e,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new _d(t.contextMenuRegistry,t.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this)),this.domProxy=new Vd({onDragStart:(t,e)=>this.onAxisDragStart(t,e),onDrag:t=>{this.onDragMove({...t,currentX:t.offsetX,currentY:t.offsetY})},onDragEnd:()=>this.onDragEnd(),onDoubleClick:(t,e)=>{this.hoveredAxis={id:t,direction:e},this.onDoubleClick(),this.hoveredAxis=void 0}}),this.destroyFns.push(t.scene.attachNode(e),t.chartEventManager.addListener("series-keynav-zoom",t=>this.onNavZoom(t)),t.widgets.seriesDragInterpreter.addListener("dblclick",t=>this.onDoubleClick(t)),t.widgets.seriesDragInterpreter.addListener("drag-move",t=>this.onDragMove(t)),t.widgets.seriesDragInterpreter.addListener("drag-start",t=>this.onDragStart(t)),t.widgets.seriesDragInterpreter.addListener("drag-end",()=>this.onDragEnd()),t.widgets.seriesWidget.addListener("wheel",t=>this.onWheel(t)),t.widgets.seriesWidget.addListener("touchstart",(t,e)=>this.onTouchStart(t,e)),t.widgets.seriesWidget.addListener("touchmove",(t,e)=>this.onTouchMove(t,e)),t.widgets.seriesWidget.addListener("touchend",t=>this.onTouchEnd(t)),t.widgets.seriesWidget.addListener("touchcancel",t=>this.onTouchEnd(t)),t.updateService.addListener("process-data",t=>this.onProcessData(t)),t.layoutManager.addListener("layout:complete",t=>this.onLayoutComplete(t)),t.zoomManager.addListener("zoom-change",t=>this.onZoomChange(t)),t.zoomManager.addListener("zoom-pan-start",t=>this.onZoomPanStart(t)),this.panner.addListener("update",t=>this.onPanUpdate(t)),()=>this.teardown())}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.()}onEnabledChange(t){this.ctx.zoomManager.setZoomModuleEnabled(t),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(t))}isIgnoredTouch(t){if("touch"!==t?.device)return!1;if("drag"!==this.ctx.chartService.touch.dragAction)return!0;if(this.enableSelecting)return!1;if(!this.enablePanning)return!0;const{x:e,y:i}=this.getZoom();return 0===e.min&&1===e.max&&0===i.min&&1===i.max}onDoubleClick(t){const{enabled:e,enableDoubleClickToReset:i,hoveredAxis:s,ctx:{zoomManager:n}}=this;e&&i&&this.isState(mu.ZoomClickable)&&(s?n.resetAxisZoom("zoom",s.id):t?.preventZoomDblClick||this.resetZoom())}onDragStart(t){const{enabled:e,enableAxisDragging:i,enablePanning:s,enableSelecting:n,hoveredAxis:a,ctx:{domManager:o,zoomManager:r}}=this;if(!e)return;if(!this.hoveredAxis&&(!this.isState(mu.ZoomDraggable)||0!==this.dragState||this.isIgnoredTouch(t)))return;this.panner.stopInteractions();let l=0;if(i&&a)l=1;else if(null!=t){const e=this.isPanningKeyPressed(t.sourceEvent);!s||n&&!e?n&&!e&&(l=3):(o.updateCursor(xu,"grabbing"),l=2,this.panner.start())}0!==(this.dragState=l)&&r.fireZoomPanStartEvent("zoom")}onDragMove(t){const{anchorPointX:e,anchorPointY:i,axisDragger:n,dragState:a,enabled:o,paddedRect:r,panner:l,selector:h,seriesRect:c,shouldFlipXY:d,hoveredAxis:u,ctx:{interactionManager:p,tooltipManager:g,updateService:m,zoomManager:y}}=this;if(!o||!r||!c)return;if(!u&&(!this.isState(mu.ZoomDraggable)||this.isIgnoredTouch(t)))return;p.pushState(s.n1.InteractionState.ZoomDrag),"touch"===t.device&&t.sourceEvent.preventDefault();const f=this.getZoom();switch(a){case 1:{if(!u)break;const{id:s,direction:a}=u;let o=a===du.X?e:i;d&&(o=a===du.X?i:e);const r=y.getAxisZoom(s),l=n.update(t,a,o,c,f,r);y.setAxisManuallyAdjusted("zoom",s),this.updateAxisZoom(s,a,l);break}case 2:l.update(t);break;case 3:h.update(t,this.getModuleProperties(),r);break;case 0:return}g.updateTooltip(bu),m.update(uu.PERFORM_LAYOUT,{skipAnimations:!0})}onDragEnd(){const{axisDragger:t,dragState:e,enabled:i,panner:n,selector:a,ctx:{domManager:o,interactionManager:r,tooltipManager:l}}=this;if(r.popState(s.n1.InteractionState.ZoomDrag),i&&0!==e){switch(e){case 1:this.hoveredAxis=void 0,t.stop();break;case 2:n.stop();break;case 3:{if(!a.didUpdate())break;const t=this.getZoom(),e=a.stop(this.seriesRect,this.paddedRect,t);this.updateZoom(e);break}}this.dragState=0,o.updateCursor(xu),l.removeTooltip(bu)}}onNavZoom(t){const{enabled:e,enableScrolling:i,scroller:n}=this;this.ctx.interactionManager.isState(s.n1.InteractionState.Default)&&e&&i&&(t.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(n.updateDelta(t.delta,this.getModuleProperties(),this.getZoom())))}onWheel(t){const{enabled:e,enablePanning:i,enableScrolling:s,paddedRect:n}=this;if(!(e&&s&&n&&this.isState(mu.ZoomWheelable)))return;const{deltaX:a,deltaY:o}=t.sourceEvent,r=null!=a&&null!=o&&Math.abs(a)>Math.abs(o);i&&r?this.onWheelPanning(t):this.onWheelScrolling(t)}onWheelPanning(t){const{scrollingStep:e,scrollPanner:i,seriesRect:s,ctx:{zoomManager:a}}=this;if(!s)return;t.sourceEvent.preventDefault();const o=i.update(t,e,s,a.getAxisZooms());for(const[t,{direction:e,zoom:i}]of(0,n.jO)(o))this.updateAxisZoom(t,e,i)}onWheelScrolling(t){const{enableAxisDragging:e,enableIndependentAxes:i,hoveredAxis:a,scroller:o,seriesRect:r,ctx:{zoomManager:l}}=this;if(!r)return;const h=this.getZoom();let c=t.deltaY>0&&this.isMaxZoom(h);const d=e&&null!=a;let u=this.isScalingX(),p=this.isScalingY();d&&(u=a.direction===s.n1.ChartAxisDirection.X,p=!u);const g=this.getModuleProperties({isScalingX:u,isScalingY:p});let m=!0;if(!0===i){const e=o.updateAxes(t,g,r,l.getAxisZooms());for(const[t,{direction:i,zoom:s}]of(0,n.jO)(e))d&&a.id!==t||m&&(m=this.updateAxisZoom(t,i,s))}else{const e=o.update(t,g,r,this.getZoom());m=this.updateUnifiedZoom(e)}c||(c=t.deltaY<0&&!m),this.isFirstWheelEvent&&c||t.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}onAxisDragStart(t,e){this.hoveredAxis={id:t,direction:e},this.onDragStart(void 0)}onTouchStart(t,e){this.enableTwoFingerZoom&&0===this.dragState&&this.twoFingers.start(t,e,this.getZoom())&&(this.dragState=4)}onTouchMove(t,e){if(!this.enableTwoFingerZoom||4!==this.dragState)return;const i=this.twoFingers.update(t,e);this.updateZoom(Fd(i))}onTouchEnd(t){this.enableTwoFingerZoom&&4===this.dragState&&(t.sourceEvent.preventDefault(),this.twoFingers.end(t)&&(this.dragState=0))}onProcessData(t){this.shouldFlipXY=t.series.shouldFlipXY}onLayoutComplete(t){this.domProxy.update(this.enableAxisDragging,this.ctx),this.enabled&&(this.seriesRect=t.series.rect,this.paddedRect=t.series.paddedRect,this.enableAxisDragging&&this.toggleAxisDraggingCursors())}onZoomChange(t){"zoom"!==t.callerId&&this.panner.stopInteractions();const e=this.getZoom();this.buttons.toggleVisibleZoomed(this.isMaxZoom(e))}onZoomPanStart(t){"zoom"===t.callerId&&this.panner.stopInteractions()}onPanUpdate(t){const{panner:e,seriesRect:i,ctx:{tooltipManager:s,zoomManager:a}}=this;if(!i)return;const o=e.translateZooms(i,a.getAxisZooms(),t.deltaX,t.deltaY);for(const[t,{direction:e,zoom:i}]of(0,n.jO)(o))this.updateAxisZoom(t,e,i);s.updateTooltip(bu)}isPanningKeyPressed(t){switch(this.panKey){case"alt":return t.altKey;case"ctrl":return t.ctrlKey;case"shift":return t.shiftKey;case"meta":return t.metaKey}}isScalingX(){return"xy"===this.axes||(this.shouldFlipXY?"y"===this.axes:"x"===this.axes)}isScalingY(){return"xy"===this.axes||(this.shouldFlipXY?"x"===this.axes:"y"===this.axes)}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}isMaxZoom(t){return Td(t,Id())}isZoomValid(t){const{minVisibleItems:e,minVisibleItemsX:i,minVisibleItemsY:s,ctx:{zoomManager:n}}=this;if(0===e)return!0;const a=this.getZoom(),o=fu(Cd(t))<fu(Cd(a)),r=fu(Ld(t))<fu(Ld(a));return!o&&!r||(null!=i&&o?n.isVisibleItemsCountAtLeast(t,i):null!=s&&r?n.isVisibleItemsCountAtLeast(t,s):n.isVisibleItemsCountAtLeast(t,e))}isAxisZoomValid(t,e){const{minVisibleItems:i,minVisibleItemsX:s,minVisibleItemsY:n,ctx:{zoomManager:a}}=this,o=this.getZoom(),r=e.max-e.min,l=o[t].max-o[t].min,h={...o,[t]:e},c=t===du.X?s:n;return r>=l||a.isVisibleItemsCountAtLeast(h,c??i)}resetZoom(){this.ctx.zoomManager.resetZoom("zoom")}updateZoom(t){this.enableIndependentAxes?this.updatePrimaryAxisZooms(t):this.updateUnifiedZoom(t)}updateUnifiedZoom(t){return this.isZoomValid(t)?(this.ctx.zoomManager.updateZoom("zoom",t),!0):(this.ctx.updateService.update(uu.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(t){this.updatePrimaryAxisZoom(t,du.X),this.updatePrimaryAxisZoom(t,du.Y)}updatePrimaryAxisZoom(t,e){const i=this.ctx.zoomManager.getPrimaryAxisId(e);null!=i&&this.updateAxisZoom(i,e,t[e])}updateAxisZoom(t,e,i){const{enableIndependentAxes:s,ctx:{zoomManager:n}}=this;if(!i)return!1;const a=this.getZoom();return!0!==s?(a[e]=i,this.updateUnifiedZoom(a)):!!this.isAxisZoomValid(e,i)&&(n.updateAxisZoom("zoom",t,i),!0)}toggleAxisDraggingCursors(){const{anchorPointX:t,anchorPointY:e,domProxy:i}=this,s=this.getZoom();let n=Cd(s)!==kd,a=Ld(s)!==kd;if(!n){const e=Ed(s,.999,1);e.x=Bd(e.x,s.x,t),n=this.isZoomValid(e)}if(!a){const t=Ed(s,1,.999);t.y=Bd(t.y,s.y,e),a=this.isZoomValid(t)}i.toggleAxisDraggingCursor(du.X,n),i.toggleAxisDraggingCursor(du.Y,a)}getZoom(){return Nd(this.ctx.zoomManager.getZoom())}getResetZoom(){return Nd(this.ctx.zoomManager.getRestoredZoom())}getModuleProperties(t){return{anchorPointX:t?.anchorPointX??this.getAnchorPointX(),anchorPointY:t?.anchorPointY??this.getAnchorPointY(),enabled:t?.enabled??this.enabled,independentAxes:t?.independentAxes??!0===this.enableIndependentAxes,isScalingX:t?.isScalingX??this.isScalingX(),isScalingY:t?.isScalingY??this.isScalingY(),keepAspectRatio:t?.keepAspectRatio??this.keepAspectRatio,scrollingStep:t?.scrollingStep??this.scrollingStep}}};r([cu({newValue(t){this.onEnabledChange(t)}}),gu],Su.prototype,"enabled",2),r([gu],Su.prototype,"enableAxisDragging",2),r([gu],Su.prototype,"enableDoubleClickToReset",2),r([cu({changeValue(t){this.ctx.zoomManager.setIndependentAxes(Boolean(t))}}),gu],Su.prototype,"enableIndependentAxes",2),r([gu],Su.prototype,"enablePanning",2),r([gu],Su.prototype,"enableScrolling",2),r([gu],Su.prototype,"enableSelecting",2),r([gu],Su.prototype,"enableTwoFingerZoom",2),r([gu],Su.prototype,"panKey",2),r([gu],Su.prototype,"axes",2),r([gu],Su.prototype,"scrollingStep",2),r([gu],Su.prototype,"keepAspectRatio",2),r([gu],Su.prototype,"minVisibleItems",2),r([pu("Use [minVisibleItems] instead."),gu],Su.prototype,"minVisibleItemsX",2),r([pu("Use [minVisibleItems] instead."),gu],Su.prototype,"minVisibleItemsY",2),r([gu],Su.prototype,"anchorPointX",2),r([gu],Su.prototype,"anchorPointY",2),r([gu],Su.prototype,"autoScaling",2),r([gu],Su.prototype,"buttons",2),r([yu("panner.deceleration"),gu],Su.prototype,"deceleration",2);var Mu={type:"root",optionsKey:"zoom",packageType:"enterprise",chartTypes:["cartesian","topology"],moduleFactory:t=>new Su(t),themeTemplate:{zoom:{anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:{enabled:!0,visible:"hover",buttons:[{icon:"zoom-out",tooltip:"toolbarZoomZoomOut",value:"zoom-out",section:"scale"},{icon:"zoom-in",tooltip:"toolbarZoomZoomIn",value:"zoom-in",section:"scale"},{icon:"pan-left",tooltip:"toolbarZoomPanLeft",value:"pan-left",section:"pan"},{icon:"pan-right",tooltip:"toolbarZoomPanRight",value:"pan-right",section:"pan"},{icon:"reset",tooltip:"toolbarZoomReset",value:"reset",section:"reset"}]},enabled:!1,enableAxisDragging:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:!1,padding:.05}}}},{BaseProperties:ku,AxisTicks:Du,ZIndexMap:wu,ProxyProperty:Iu,Property:Cu,LayoutElement:Lu,Group:Au,Rect:Tu,Marker:Nu,TranslatableGroup:Ou,BBox:Ru}=s.n1,Eu=class extends ku{constructor(){super(...arguments),this.thickness=16,this.preferredLength=100}};r([Cu],Eu.prototype,"thickness",2),r([Cu],Eu.prototype,"preferredLength",2);var Pu=class{constructor(t){this.axisTicks=t}};r([Iu("axisTicks.label")],Pu.prototype,"label",2),r([Iu("axisTicks.interval")],Pu.prototype,"interval",2),r([Iu("axisTicks.padding")],Pu.prototype,"padding",2);var Bu=class{constructor(t){this.ctx=t,this.id=(0,n.sX)(this),this.legendGroup=new Ou({name:"legend",zIndex:wu.LEGEND}),this.gradientRect=new Tu,this.arrow=new Nu({shape:"triangle"}),this.ticksGroup=new Au({name:"legend-axis-group"}),this.destroyFns=[],this.enabled=!1,this.position="bottom",this.reverseOrder=!1,this.gradient=new Eu,this.spacing=20,this.data=[],this.highlightManager=t.highlightManager,this.axisTicks=new Du,this.axisTicks.attachAxis(this.ticksGroup),this.scale=new Pu(this.axisTicks),this.legendGroup.append([this.gradientRect,this.arrow,this.ticksGroup]),this.destroyFns.push(t.highlightManager.addListener("highlight-change",()=>this.onChartHoverChange()),t.layoutManager.registerElement(Lu.Legend,t=>this.onStartLayout(t)),()=>this.legendGroup.remove())}isVertical(){return"right"===this.position||"left"===this.position}destroy(){this.destroyFns.forEach(t=>t())}attachLegend(t){t.appendChild(this.legendGroup)}onStartLayout(t){const[e]=this.data;if(!this.enabled||!e?.enabled||"gradient"!==e.legendType)return void(this.legendGroup.visible=!1);const{colorRange:i}=this.normalizeColorArrays(e);this.updateGradientRect(t.layoutBox,i);const s=this.updateAxis(e)??new Ru(0,0,0,0),{left:n,top:a}=this.getMeasurements(t.layoutBox,s);this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=n,this.legendGroup.translationY=a}normalizeColorArrays(t){let e=t.colorDomain.slice();const i=t.colorRange.slice();if(e.length===i.length)return{colorDomain:e,colorRange:i};e.length>i.length&&i.splice(e.length);const[s,n]=e,a=i.length;return e=i.map((t,e)=>0===e?s:e===a-1?n:s+(n-s)*e/(a-1)),{colorDomain:e,colorRange:i}}updateGradientRect(t,e){const{gradientRect:i}=this,{preferredLength:s,thickness:n}=this.gradient;let a;this.isVertical()?(a=0,i.width=n,i.height=Math.min(t.height,s)):(a=90,i.width=Math.min(t.width,s),i.height=n),i.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:e.map((t,i)=>({stop:i/(e.length-1),color:t})),rotation:a}}updateAxis(t){const{axisTicks:e}=this,i=this.isVertical(),s=this.reverseOrder!==i;return e.position=this.position,e.translationX=i?this.gradient.thickness:0,e.translationY=i?0:this.gradient.thickness,e.scale.domain=s?t.colorDomain.slice().reverse():t.colorDomain,e.scale.range=i?[0,this.gradientRect.height]:[0,this.gradientRect.width],e.calculateLayout()}updateArrow(){const t=this.highlightManager.getActiveHighlight(),{arrow:e}=this;if(null==t?.colorValue)return void(e.visible=!1);const{scale:i,label:s}=this.axisTicks,n=s.fontSize??0,a=i.convert(t.colorValue);let{x:o,y:r}=this.gradientRect,l=Math.PI;this.isVertical()?(o-=n/2,r+=a,l/=2):(o+=a,r-=n/2),e.visible=!0,e.fill=s.color,e.rotation=l,e.size=n,e.translationX=o,e.translationY=r}getMeasurements(t,e){let{x:i,y:s}=t,{width:n,height:a}=this.gradientRect;switch(this.isVertical()?n+=e.width+5:a+=e.height+5,this.position){case"left":s+=t.height/2-a/2,t.shrink(n+this.spacing,"left");break;case"right":i+=t.width-n,s+=t.height/2-a/2,t.shrink(n+this.spacing,"right");break;case"top":i+=t.width/2-n/2,t.shrink(a+this.spacing,"top");break;case"bottom":i+=t.width/2-n/2,s+=t.height-a,t.shrink(a+this.spacing,"bottom")}return{top:s,left:i}}onChartHoverChange(){this.enabled&&this.updateArrow()}};Bu.className="GradientLegend",r([Cu],Bu.prototype,"enabled",2),r([Cu],Bu.prototype,"position",2),r([Cu],Bu.prototype,"reverseOrder",2),r([Cu],Bu.prototype,"gradient",2),r([Cu],Bu.prototype,"spacing",2);var Fu={type:"legend",optionsKey:"gradientLegend",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient",moduleFactory:t=>new Bu(t),themeTemplate:{enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1},removable:"standalone-only"};function zu(t,e){const i=t.addChild("canvas-overlay","watermark"),s=(0,n.n)("span");s.innerText=e,i.addEventListener("animationend",()=>{t.removeChild("canvas-overlay","watermark"),t.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(s)}var{ordinalTimeAxisOptionsDefs:Gu,angleNumberAxisOptionsDefs:_u,angleCategoryAxisOptionsDefs:ju,radiusNumberAxisOptionsDefs:Wu,radiusCategoryAxisOptionsDefs:Vu}=s.n1,Ku={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,options:Gu,create:t=>new ut(t)},Yu={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,options:_u,create:t=>new rt(t)},$u={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,options:ju,create:t=>new q(t)},Hu={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,options:Wu,create:t=>new Ut(t)},Uu={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,options:Vu,create:t=>new Vt(t)},{Chart:Xu,Property:Zu}=s.n1,qu=class extends Xu{getChartType(){return"flow-proportion"}async updateData(){await super.updateData();const t=this.getOptions();this.nodes!==t.nodes&&(this.nodes=t.nodes);const{nodes:e}=this;this.series.forEach(t=>{(function(t){return"sankey"===t.type||"chord"===t.type})(t)&&t.setChartNodes(e)})}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n,e.visible=this.series.some(t=>t.visible);for(const t of[e,i])t.translationX=Math.floor(n.x),t.translationY=Math.floor(n.y);this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:e.visible,rect:n,paddedRect:n}})}};qu.className="FlowProportionChart",qu.type="flow-proportion",r([Zu],qu.prototype,"nodes",2);var{isAgFlowProportionChartOptions:Qu,flowProportionChartOptionsDefs:Ju}=s.n1,tp={type:"chart",name:"flow-proportion",enterprise:!0,options:Ju,detect:Qu,create:(t,e)=>new qu(t,e)},{Chart:ep}=s.n1,ip=class extends ep{getChartType(){return"gauge"}performLayout(t){const{seriesRoot:e,annotationRoot:i,series:s,seriesArea:n}=this,{layoutBox:a}=t,o=a.clone();a.shrink(n.padding.toJson()),this.seriesRect=o.clone().translate(o.x-a.x,o.y-a.y),this.animationRect=a,e.visible=s.some(t=>t.visible);for(const t of[e,i])t.translationX=Math.floor(a.x),t.translationY=Math.floor(a.y);this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:e.visible,rect:o,paddedRect:a}})}getAriaLabel(){const t=[],e=this.getCaptionText();0!==e.length&&t.push(e);for(const e of this.series)t.push(e.getCaptionText());const i=t.join(". ");return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i})}};ip.className="GaugeChart",ip.type="gauge";var{isAgGaugeChartOptions:sp,gaugeChartOptionsDefs:np}=s.n1,ap={type:"chart",name:"gauge",enterprise:!0,options:np,detect:sp,create:(t,e)=>new ip(t,e)},{Chart:op}=s.n1,rp=class extends op{getChartType(){return"hierarchy"}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n;for(const t of[e,i])t.translationX=Math.floor(n.x),t.translationY=Math.floor(n.y);e.visible=this.series[0].visible,e.setClipRect(n.clone()),this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:n,paddedRect:n}})}getAriaLabel(){const t=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t})}};rp.className="HierarchyChart",rp.type="hierarchy";var{isAgHierarchyChartOptions:lp,hierarchyChartOptionsDefs:hp}=s.n1,cp={type:"chart",name:"hierarchy",enterprise:!0,options:hp,detect:lp,create:(t,e)=>new rp(t,e)},{Chart:dp}=s.n1,up=class extends dp{getChartType(){return"standalone"}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n;for(const t of[e,i])t.translationX=Math.floor(s.x),t.translationY=Math.floor(s.y);e.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:n,paddedRect:s}})}getAriaLabel(){const t=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t})}};up.className="StandaloneChart",up.type="standalone";var{isAgStandaloneChartOptions:pp,standaloneChartOptionsDefs:gp}=s.n1,mp={type:"chart",name:"standalone",enterprise:!0,options:gp,detect:pp,create:(t,e)=>new up(t,e)},{Chart:yp,MercatorScale:fp,NumberAxis:xp,Property:bp}=s.n1;function vp(t){return"map-shape"===t.type||"map-line"===t.type||"map-marker"===t.type||"map-shape-background"===t.type||"map-line-background"===t.type}var Sp=class extends yp{constructor(t,e){super(t,e),this.xAxis=new xp(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new xp(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}async updateData(){await super.updateData();const t=this.getOptions();this.topology!==t.topology&&(this.topology=t.topology);const{topology:e}=this;this.series.forEach(t=>{vp(t)&&t.setChartTopology(e)})}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n;const a=this.series.filter(vp),o=a.reduce((t,e)=>{if(!e.visible)return t;const i=e.topologyBounds;return null==i?t:null==t?i:(t.merge(i),t)},void 0);let r;if(null!=o){const{lon0:t,lat0:e,lon1:i,lat1:s}=o,a=[[t,e],[i,s]],l=fp.bounds(a),{width:h,height:c}=n,d=Math.min(h/l.width,c/l.height),u=l.width*d,p=l.height*d,g=(h-u)/2,m=(c-p)/2,y=g,f=m,x=g+u,b=m+p,v=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),S=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),M=(x-y)/(v.max-v.min),k=y-M*v.min,D=(b-f)/(1-S.min-(1-S.max)),w=f-D*(1-S.max);r=new fp(a,[[k,w],[k+M,w+D]])}a.forEach(t=>{t.scale=r});const l=this.series.some(t=>t.visible);e.visible=l;for(const t of[e,i])t.translationX=Math.floor(n.x),t.translationY=Math.floor(n.y),t.setClipRect(n.clone());this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:l,rect:n,paddedRect:n}})}};Sp.className="TopologyChart",Sp.type="topology",r([bp],Sp.prototype,"topology",2);var{isAgTopologyChartOptions:Mp,topologyChartOptionsDefs:kp}=s.n1,Dp={type:"chart",name:"topology",enterprise:!0,options:kp,detect:Mp,create:(t,e)=>new Sp(t,e)},{annotationCalloutStylesDefs:wp,annotationNoteStylesDefs:Ip,annotationTextStylesDef:Cp,annotationCommentStylesDefs:Lp,annotationMeasurerStylesDefs:Ap,annotationShapeStylesDefs:Tp,annotationChannelTextDefs:Np,annotationCrossLineStyleDefs:Op,annotationFibonacciStylesDefs:Rp,annotationLineStyleDefs:Ep,annotationLineTextDefs:Pp,annotationDisjointChannelStyleDefs:Bp,annotationParallelChannelStyleDefs:Fp}=s.n1,zp=(0,n.fd)({__type:(0,n.mw)((0,n.dY)("date")),value:(0,n.or)(n.Yj,n.ai)},"a serializable date object"),Gp=(0,n.or)(n.Yj,n.ai,zp),_p=(0,n.or)(Gp,(0,n.fd)({value:Gp,groupPercentage:(0,n.fN)(-1,1)})),jp={...Np,label:n.Yj},Wp={...Pp,label:n.Yj},Vp={x:_p,y:n.ai},Kp=(0,n.is)({line:{...Ep,start:Vp,end:Vp,text:Wp},"horizontal-line":{...Op,value:_p,text:Wp},"vertical-line":{...Op,value:_p,text:Wp},"disjoint-channel":{...Bp,startHeight:n.Ly,endHeight:n.Ly,start:Vp,end:Vp,text:jp},"parallel-channel":{...Fp,height:n.Ly,start:Vp,end:Vp,text:jp},"fibonacci-retracement":{...Rp,start:Vp,end:Vp,text:Wp,reverse:n.zM},"fibonacci-retracement-trend-based":{...Rp,start:Vp,end:Vp,endRetracement:Vp,text:Wp,reverse:n.zM},callout:{...wp,start:Vp,end:Vp,text:n.Yj},comment:{...Lp,...Vp,text:n.Yj},note:{...Ip,...Vp,text:n.Yj},text:{...Cp,...Vp,text:n.Yj},arrow:{...Ep,text:Wp,start:Vp,end:Vp},"arrow-up":{...Tp,...Vp},"arrow-down":{...Tp,...Vp},"date-range":{...Ap,extendAbove:n.zM,extendBelow:n.zM,text:Wp,start:Vp,end:Vp},"price-range":{...Ap,extendLeft:n.zM,extendRight:n.zM,text:Wp,start:Vp,end:Vp},"date-price-range":{...Ap,text:Wp,start:Vp,end:Vp}},"an annotation initial state object"),Yp={chartType:(0,n.KC)("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),annotations:(0,n.J$)(Kp),legend:(0,n.J$)({visible:n.zM,seriesId:n.Yj,itemId:n.Yj,legendItemName:n.Yj},"legend state array"),zoom:{rangeX:{start:(0,n.or)(n.ai,zp),end:(0,n.or)(n.ai,zp)},rangeY:{start:(0,n.or)(n.ai,zp),end:(0,n.or)(n.ai,zp)},ratioX:{start:n.CG,end:n.CG},ratioY:{start:n.CG,end:n.CG},autoScaledAxes:(0,n.jk)((0,n.dY)("y"))}},{ScalableGroup:$p,Rect:Hp,Line:Up,BBox:Xp,Selection:Zp,applyShapeFillBBox:qp}=s.n1,Qp=class extends $p{constructor(){super(),this.append([new Hp({tag:0}),new Hp({tag:2}),new Hp({tag:1}),new Up({tag:3}),new Up({tag:3}),new Up({tag:4}),new Up({tag:4})])}updateDatumStyles(t,e,i,s,n){const{bandwidth:a,scaledValues:{xValue:o,medianValue:r}}=t;let{minValue:l,q1Value:h,q3Value:c,maxValue:d}=t.scaledValues;(i&&!s||!i&&s)&&([d,c,h,l]=[l,h,c,d]);const u=(t,e,s,n)=>i?{y:t,x:e,width:n,height:s}:{x:t,y:e,width:s,height:n},p=(t,e,s)=>i?{y1:t,y2:e,x:s}:{x1:t,x2:e,y:s},g=(t,e,s)=>i?{x1:e,x2:s,y:t}:{x:t,y1:e,y2:s},{fill:m,fillOpacity:y,stroke:f,strokeWidth:x,strokeOpacity:b,lineDash:v,lineDashOffset:S,cornerRadius:M,cap:k,whisker:D}=e,w=Zp.select(this,Hp),[I]=w.selectByTag(0),[C]=w.selectByTag(2),[L]=w.selectByTag(1),A=w.selectByTag(3),T=w.selectByTag(4);D.strokeWidth>a&&(D.strokeWidth=a);const N=u(h,o,c-h,a);C.setProperties(N),I.setProperties(N),I.setProperties({cornerRadius:M});const O=Math.max(Math.round(r-x/2),h+x),R=Math.min(Math.round(r+x/2),c-x);var E,P,B,F;L.setProperties(N),L.setProperties({visible:O<R,cornerRadius:M,clipBBox:(E=O,P=o+x,B=R-O,F=Math.max(0,a-2*x),({x:E,y:P,width:B,height:F}=u(E,P,B,F)),new Xp(E,P,B,F))});const z=Math.floor(o+a*(1-k.lengthRatio)/2),G=Math.ceil(o+a*(1+k.lengthRatio)/2);T[0].setProperties(g(l,z,G)),T[1].setProperties(g(d,z,G)),A[0].setProperties(p(Math.round(l+D.strokeWidth/2),h,Math.floor(o+a/2))),A[1].setProperties(p(c,Math.round(d-D.strokeWidth/2),Math.floor(o+a/2))),qp(I,m,n),I.setProperties({fill:m,fillOpacity:y,strokeWidth:2*x,strokeOpacity:0}),L.setProperties({fill:f,fillOpacity:b,strokeWidth:0});for(const t of[...A,...T])t.setProperties(D);C.setProperties({stroke:f,strokeWidth:x,strokeOpacity:b,lineDash:v,lineDashOffset:S,cornerRadius:M,fillOpacity:0})}distanceSquared(t,e){const i=Zp.selectByClass(this,Hp,Up);return s.n1.nearestSquared(t,e,i).distanceSquared}get midPoint(){const t=this.datum;return void 0===t.midPoint?(n.Vy.error("BoxPlotGroup.datum.midPoint is undefined"),{x:NaN,y:NaN}):t.midPoint}},{BaseProperties:Jp,FillGradientDefaults:tg,FillPatternDefaults:eg,FillImageDefaults:ig,AbstractBarSeriesProperties:sg,SeriesTooltip:ng,Property:ag,mergeDefaults:og}=s.n1,rg=class extends Jp{constructor(){super(...arguments),this.lengthRatio=.5}};r([ag],rg.prototype,"lengthRatio",2);var lg=class extends Jp{};r([ag],lg.prototype,"stroke",2),r([ag],lg.prototype,"strokeWidth",2),r([ag],lg.prototype,"strokeOpacity",2),r([ag],lg.prototype,"lineDash",2),r([ag],lg.prototype,"lineDashOffset",2);var hg=class extends sg{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new tg,this.fillPatternDefaults=new eg,this.fillImageDefaults=new ig,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new rg,this.whisker=new lg,this.tooltip=new ng}toJson(){const{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:s,lineDashOffset:n}=this,a=super.toJson();return a.whisker=og(a.whisker,{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:s,lineDashOffset:n}),a}};r([ag],hg.prototype,"xKey",2),r([ag],hg.prototype,"minKey",2),r([ag],hg.prototype,"q1Key",2),r([ag],hg.prototype,"medianKey",2),r([ag],hg.prototype,"q3Key",2),r([ag],hg.prototype,"maxKey",2),r([ag],hg.prototype,"xName",2),r([ag],hg.prototype,"yName",2),r([ag],hg.prototype,"minName",2),r([ag],hg.prototype,"q1Name",2),r([ag],hg.prototype,"medianName",2),r([ag],hg.prototype,"q3Name",2),r([ag],hg.prototype,"maxName",2),r([ag],hg.prototype,"fill",2),r([ag],hg.prototype,"fillGradientDefaults",2),r([ag],hg.prototype,"fillPatternDefaults",2),r([ag],hg.prototype,"fillImageDefaults",2),r([ag],hg.prototype,"fillOpacity",2),r([ag],hg.prototype,"stroke",2),r([ag],hg.prototype,"strokeWidth",2),r([ag],hg.prototype,"strokeOpacity",2),r([ag],hg.prototype,"lineDash",2),r([ag],hg.prototype,"lineDashOffset",2),r([ag],hg.prototype,"cornerRadius",2),r([ag],hg.prototype,"itemStyler",2),r([ag],hg.prototype,"cap",2),r([ag],hg.prototype,"whisker",2),r([ag],hg.prototype,"tooltip",2);var{extractDecoratedProperties:cg,fixNumericExtent:dg,keyProperty:ug,mergeDefaults:pg,SeriesNodePickMode:gg,SMALLEST_KEY_INTERVAL:mg,valueProperty:yg,diff:fg,animationValidation:xg,computeBarFocusBounds:bg,createDatumId:vg,ContinuousScale:Sg,ChartAxisDirection:Mg,motion:kg,isGradientFill:Dg,getShapeStyle:wg}=s.n1,Ig=class extends s.n1.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.minKey=s.properties.minKey,this.q1Key=s.properties.q1Key,this.medianKey=s.properties.medianKey,this.q3Key=s.properties.q3Key,this.maxKey=s.properties.maxKey}},Cg=class extends s.n1.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[gg.NEAREST_NODE,gg.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},directionNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[],hasHighlightedLabels:!0}),this.properties=new hg,this.NodeEvent=Ig}async processData(t){if(!this.visible)return;const{xKey:e,minKey:i,q1Key:s,medianKey:n,q3Key:a,maxKey:o}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,h=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:d,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:h}),p=[];r&&this.processedData&&p.push(fg(this.id,this.processedData)),r&&p.push(xg());const{processedData:g}=await this.requestDataModel(t,this.data,{props:[ug(e,d,{id:"xValue"}),yg(i,u,{id:"minValue"}),yg(s,u,{id:"q1Value"}),yg(n,u,{id:"medianValue"}),yg(a,u,{id:"q3Value"}),yg(o,u,{id:"maxValue"}),...c?[mg]:[],...p]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];if(t!==this.getBarDirection()){const{index:t,def:s}=i.resolveProcessedDataDefById(this,"xValue"),n=e.domain.keys[t];return"key"===s.type&&"category"===s.valueType?n:this.padBandExtent(n)}const s=this.domainForClippedRange(t,["minValue","maxValue"],"xValue",!0);return dg(s)}getSeriesRange(t,e){return this.domainForVisibleRange(Mg.Y,["maxValue","minValue"],"xValue",e,!0)}createNodeData(){const{visible:t,dataModel:e,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!(e&&i&&s&&n))return;const{xKey:a,fill:o,fillOpacity:r,stroke:l,strokeWidth:h,strokeOpacity:c,lineDash:d,lineDashOffset:u,cap:p,whisker:g}=this.properties,m=[],y=e.resolveKeysById(this,"xValue",i),f=e.resolveColumnById(this,"minValue",i),x=e.resolveColumnById(this,"q1Value",i),b=e.resolveColumnById(this,"medianValue",i),v=e.resolveColumnById(this,"q3Value",i),S=e.resolveColumnById(this,"maxValue",i),{barWidth:M,groupIndex:k}=this.updateGroupScale(s),D=Sg.is(s.scale)?-.5*M:0,{groupScale:w}=this,I=this.isVertical(),C={itemId:a,nodeData:m,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};return t?((i.dataSources.get(this.id)??[]).forEach((t,e)=>{const i=y[e];if(null==i)return;const C=f[e],L=x[e],A=b[e],T=v[e],N=S[e];if([C,L,A,T,N].some(t=>"number"!=typeof t)||C>L||L>A||A>T||T>N)return;const O={xValue:Math.round(s.scale.convert(i)),minValue:Math.round(n.scale.convert(C)),q1Value:Math.round(n.scale.convert(L)),medianValue:Math.round(n.scale.convert(A)),q3Value:Math.round(n.scale.convert(T)),maxValue:Math.round(n.scale.convert(N))};O.xValue+=Math.round(w.convert(String(k)))+D;const R=Math.round(M),E=Math.abs(O.q3Value-O.q1Value),P=O.xValue+R/2,B=Math.min(O.q3Value,O.q1Value)+E/2,F={x:I?P:B,y:I?B:P};let z;z=I?{x:F.x-R/2,y:O.minValue,width:R,height:O.maxValue-O.minValue}:{x:O.minValue,y:F.y-R/2,width:O.maxValue-O.minValue,height:R},m.push({series:this,itemId:i,datum:t,datumIndex:e,xKey:a,bandwidth:R,scaledValues:O,cap:p,whisker:g,fill:o,fillOpacity:r,stroke:l,strokeWidth:h,strokeOpacity:c,lineDash:d,lineDashOffset:u,midPoint:F,focusRect:z})}),C):C}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:h}=this.properties;return{marker:wg({fill:t,fillOpacity:e,stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:a,lineDashOffset:o},r,l,h)}}getLegendData(t){const{id:e,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:a,showInLegend:o,legendItemName:r}=this.properties;return n&&"category"===t?[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:e}),label:{text:r??a??e},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!o}]:[]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yName:r,medianKey:l,medianName:h,q1Key:c,q1Name:d,q3Key:u,q3Name:p,minKey:g,minName:m,maxKey:y,maxName:f,legendItemName:x,tooltip:b}=n,v=this.getCategoryAxis(),S=this.getValueAxis();if(!(i&&s&&v&&S))return;const M=s.dataSources.get(this.id)?.[t],k=i.resolveKeysById(this,"xValue",s)[t],D=i.resolveColumnById(this,"minValue",s)[t],w=i.resolveColumnById(this,"q1Value",s)[t],I=i.resolveColumnById(this,"medianValue",s)[t],C=i.resolveColumnById(this,"q3Value",s)[t],L=i.resolveColumnById(this,"maxValue",s)[t];if(null==k)return;const A=this.getItemBaseStyle(!1);return Object.assign(A,this.getItemStyleOverrides(String(t),M,A,!1)),this.formatTooltipWithContext(b,{heading:v.formatDatum(k),title:x??r,symbol:this.legendItemSymbol(),data:[{label:m,fallbackLabel:g,value:S.formatDatum(D)},{label:d,fallbackLabel:c,value:S.formatDatum(w)},{label:h,fallbackLabel:l,value:S.formatDatum(I)},{label:p,fallbackLabel:u,value:S.formatDatum(C)},{label:f,fallbackLabel:y,value:S.formatDatum(L)}]},{seriesId:e,datum:M,title:r,xKey:a,xName:o,yName:r,medianKey:l,medianName:h,q1Key:c,q1Name:d,q3Key:u,q3Name:p,minKey:g,minName:m,maxKey:y,maxName:f,...A})}animateEmptyUpdateReady({datumSelection:t}){const e=this.isVertical(),{from:i,to:s}=function(t){return{from:t?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}(e);kg.resetMotion([t],function(t){return(e,i)=>t?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}(e)),kg.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[t],i,s,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(t){const e=t.nodeData??[];return t.datumSelection.update(e)}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i,cap:s,whisker:n,fillGradientDefaults:a,fillPatternDefaults:o,fillImageDefaults:r}=e,l=t?e.highlightStyle.item:void 0,h=this.getStrokeWidth(e.strokeWidth);return wg({fill:l?.fill??e.fill,fillOpacity:l?.fillOpacity??e.fillOpacity,stroke:l?.stroke??e.stroke,strokeWidth:l?.strokeWidth??h,strokeOpacity:l?.strokeOpacity??e.strokeOpacity,lineDash:l?.lineDash??e.lineDash??[],lineDashOffset:l?.lineDashOffset??e.lineDashOffset,cornerRadius:i,cap:s,whisker:n},a,o,r)}getItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{xKey:o,minKey:r,q1Key:l,medianKey:h,q3Key:c,maxKey:d,fillGradientDefaults:u,fillPatternDefaults:p,fillImageDefaults:g,itemStyler:m}=a;if(null==m)return;const y=this.cachedDatumCallback(vg(t,s?"highlight":"node"),()=>this.callWithContext(m,{seriesId:n,datum:e,xKey:o,minKey:r,q1Key:l,medianKey:h,q3Key:c,maxKey:d,highlighted:s,...i}));return wg(y,u,p,g)}updateDatumNodes({datumSelection:t,isHighlight:e}){const i=this.isVertical(),s=this.getValueAxis()?.isReversed(),{highlightStyle:n}=this.properties;t.each((t,a)=>{let o=this.getFormattedStyles(a,e?"highlight":"node");e&&(o=pg(n.item,o));const{stroke:r,strokeWidth:l,strokeOpacity:h,lineDash:c,lineDashOffset:d}=o;o.whisker=pg(o.whisker,{stroke:r,strokeWidth:l,strokeOpacity:h,lineDash:c,lineDashOffset:d});const u=this.getShapeFillBBox();t.updateDatumStyles(a,o,i,s,u)})}updateLabelNodes(){}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}nodeFactory(){return new Qp}getFormattedStyles(t,e){const{id:i,properties:s}=this,{xKey:n,minKey:a,q1Key:o,medianKey:r,q3Key:l,maxKey:h,itemStyler:c,cornerRadius:d,fillGradientDefaults:u,fillPatternDefaults:p,fillImageDefaults:g}=s,{datum:m,stroke:y,strokeWidth:f,strokeOpacity:x,lineDash:b,lineDashOffset:v,cap:S,whisker:M}=t;let k,D=1;Dg(t.fill)?k=t.fill:(k=t.fill,D=s.fillOpacity);let w=wg({fill:k,fillOpacity:D,stroke:y,strokeWidth:f,strokeOpacity:x,lineDash:b,lineDashOffset:v,cornerRadius:d,cap:cg(S),whisker:cg(M)},u,p,g);if(c){const t=this.cachedDatumCallback(vg(m.index,e),()=>this.callWithContext(c,{datum:m,seriesId:i,highlighted:"highlight"===e,...w,xKey:n,minKey:a,q1Key:o,medianKey:r,q3Key:l,maxKey:h}));t&&(w=wg(pg(t,w),u,p,g))}return w}computeFocusBounds({datumIndex:t}){return bg(this,this.contextNodeData?.nodeData[t].focusRect)}};Cg.className="BoxPlotSeries",Cg.type="box-plot";var{boxPlotSeriesThemeableOptionsDef:Lg,commonSeriesOptionsDefs:Ag}=s.n1,Tg={...Lg,...Ag,type:(0,n.mw)((0,n.dY)("box-plot")),xKey:(0,n.mw)(n.Yj),minKey:(0,n.mw)(n.Yj),q1Key:(0,n.mw)(n.Yj),medianKey:(0,n.mw)(n.Yj),q3Key:(0,n.mw)(n.Yj),maxKey:(0,n.mw)(n.Yj),xName:n.Yj,yName:n.Yj,minName:n.Yj,q1Name:n.Yj,medianName:n.Yj,q3Name:n.Yj,maxName:n.Yj,grouped:n.zM,legendItemName:n.Yj},{CARTESIAN_AXIS_TYPE:Ng}=s.n1.ThemeConstants,Og={series:{direction:"vertical",fill:{$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]},{$isImage:[{$palette:"fill"}]}]},{$palette:"fill"},{$mix:[s.n1.SAFE_FILL_OPERATION,{$ref:"backgroundColor"},.7]}]},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,strokeWidth:2},axes:{[Ng.NUMBER]:{crosshair:{snap:!1}},[Ng.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},Rg={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:t=>new Cg(t),tooltipDefaults:{range:"exact"},defaultAxes:s.n1.DIRECTION_SWAP_AXES,themeTemplate:Og,groupable:!0},Eg={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,options:Tg,create:t=>new Cg(t)},{findMinMax:Pg}=s.n1;function Bg(t,e=1){let i=Math.ceil(Math.log2(t.length/e))-1;return i=Math.min(Math.max(i,0),16),2**i|0}function Fg(t){return Pg(t.map(t=>Number(t)))}function zg(t,e,i){return(t.valueOf()-e)/(i-e)}function Gg(t,e){return 4*Math.min(Math.floor(t*e),e-1)|0}function _g(t,e,i,s,n,a){const o=new Int32Array(4*a).fill(-1),r=new Float64Array(4*a).fill(NaN);for(let l=0;l<t.length;l+=1){const h=t[l],c=e[l],d=i[l];if(null==h||null==c||null==d)continue;const u=zg(h,s,n),p=c.valueOf(),g=d.valueOf(),m=Gg(u,a),y=-1===o[m+0];(y||u<r[m+0])&&(o[m+0]=l,r[m+0]=u),(y||u>r[m+1])&&(o[m+1]=l,r[m+1]=u),(y||g<r[m+2])&&(o[m+2]=l,r[m+2]=g),(y||p>r[m+3])&&(o[m+3]=l,r[m+3]=p)}return{indexData:o,valueData:r}}function jg(t,e,i,{inPlace:s=!1}={}){const n=i/2|0,a=s?t:new Int32Array(4*n),o=s?e:new Float64Array(4*n);for(let i=0;i<n;i+=1){const s=4*i|0,n=2*s|0,r=n+4|0,l=-1===t[r+0],h=l||e[n+0]<e[r+0]?n:r;a[s+0]=t[h+0],o[s+0]=e[h+0];const c=l||e[n+1]>e[r+1]?n:r;a[s+1]=t[c+1],o[s+1]=e[c+1];const d=l||e[n+2]<e[r+2]?n:r;a[s+2]=t[d+2],o[s+2]=e[d+2];const u=l||e[n+3]>e[r+3]?n:r;a[s+3]=t[u+3],o[s+3]=e[u+3]}return{maxRange:n,indexData:a,valueData:o}}var{fixNumericExtent:Wg,keyProperty:Vg,createDatumId:Kg,SeriesNodePickMode:Yg,ChartAxisDirection:$g,SMALLEST_KEY_INTERVAL:Hg,valueProperty:Ug,diff:Xg,animationValidation:Zg,computeBarFocusBounds:qg,visibleRangeIndices:Qg,ContinuousScale:Jg,DiscreteTimeScale:tm,BandScale:em,getShapeStyle:im}=s.n1,sm=class extends s.n1.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.openKey=s.properties.openKey,this.closeKey=s.properties.closeKey,this.highKey=s.properties.highKey,this.lowKey=s.properties.lowKey}},nm=class extends s.n1.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[Yg.AXIS_ALIGNED,Yg.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},directionNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=sm,this.dataAggregationFilters=void 0}async processData(t){if(!this.visible)return;const{xKey:e,openKey:i,closeKey:s,highKey:n,lowKey:a}=this.properties,o=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:c,yScaleType:d}=this.getScaleInformation({xScale:r,yScale:l}),u=[];o&&(this.processedData&&u.push(Xg(this.id,this.processedData)),u.push(Zg())),i&&u.push(Ug(i,d,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:p,processedData:g}=await this.requestDataModel(t,this.data,{props:[Vg(e,c,{id:"xValue"}),Ug(s,d,{id:"closeValue"}),Ug(n,d,{id:"highValue"}),Ug(a,d,{id:"lowValue"}),...h?[Hg]:[],...u]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(t,e){const i=this.axes[$g.X];if(null==i||!Jg.is(i.scale)&&!tm.is(i.scale))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"highValue",e),a=t.resolveColumnById(this,"lowValue",e),{index:o}=t.resolveProcessedDataDefById(this,"xValue");return function(t,e,i,s){if(t.length<1e3)return;const[n,a]=Fg(s);let o=Bg(t),{indexData:r,valueData:l}=_g(t,e,i,n,a,o);const h=[{maxRange:o,indexData:r}];for(;o>64;)({indexData:r,valueData:l,maxRange:o}=jg(r,l,o)),h.push({maxRange:o,indexData:r});return h.reverse(),h}(s,n,a,e.domain.keys[o])}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];if(t!==this.getBarDirection()){const{index:t,def:s}=i.resolveProcessedDataDefById(this,"xValue"),n=e.domain.keys[t];return"key"===s.type&&"category"===s.valueType?n:this.padBandExtent(n)}const s=this.domainForClippedRange(t,["highValue","lowValue"],"xValue",!0);return Wg(s)}getSeriesRange(t,e){return this.domainForVisibleRange($g.Y,["highValue","lowValue"],"xValue",e,!0)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["highValue","lowValue"],t,e,i)}createNodeData(){const{visible:t,dataModel:e,processedData:i}=this,s=this.getCategoryAxis(),a=this.getValueAxis();if(!(e&&i&&s&&a))return;const o=[],{xKey:r,highKey:l,lowKey:h}=this.properties,c=i.dataSources.get(this.id)??[],d=e.resolveKeysById(this,"xValue",i),u=e.resolveColumnById(this,"openValue",i),p=e.resolveColumnById(this,"closeValue",i),g=e.resolveColumnById(this,"highValue",i),m=e.resolveColumnById(this,"lowValue",i),{groupScale:y}=this,{barWidth:f,groupIndex:x}=this.updateGroupScale(s),b=y.convert(String(x)),v=f>=1?f:y.rawBandwidth,S=em.is(s.scale),M={itemId:r,nodeData:o,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};if(!t)return M;const k=(t,e,i,n,l,h,d,u)=>{const p=c[t],g=S?d/2:0,m=s.scale.convert(e)+b+g,y=a.scale.convert(i),f=a.scale.convert(n),x=a.scale.convert(l),v=a.scale.convert(h),M=n>i,k=M?"up":"down",D=Math.min(x,v),w=Math.max(x,v)-D,I={x:m,y:D+w/2};o.push({series:this,itemId:k,datum:p,datumIndex:t,xKey:r,xValue:e,openValue:i,closeValue:n,highValue:l,lowValue:h,midPoint:I,aggregatedValue:n,isRising:M,centerX:m,width:d,y:D,height:w,yOpen:y,yClose:f,crisp:u})},{dataAggregationFilters:D}=this,w=s.scale,[I,C]=w.range,L=C-I,A=t=>w.convert(d[t])+b,T=D?.find(t=>t.maxRange>L);if(null==T){let[t,e]=Qg(c.length,s.range,t=>{const e=A(t);return[e,e+v]});i.input.count<1e3&&(t=0,e=i.input.count);for(let i=t;i<e;i+=1){const t=d[i];if(null==t)continue;const e=u[i],s=p[i],a=g[i],o=m[i];null!=o&&o<=e&&o<=s?null!=a&&a>=e&&a>=s?k(i,t,e,s,a,o,v,!0):n.Vy.warnOnce(`invalid high value for key [${l}] in data element, high value cannot be lower than datum open or close values.`):n.Vy.warnOnce(`invalid low value for key [${h}] in data element, low value cannot be higher than datum open or close values`)}}else{const{maxRange:t,indexData:e}=T,[i,n]=Qg(t,s.range,t=>{const i=4*t,s=e[i+0],n=e[i+1];if(-1!==s)return[A(s),A(n)+v]});for(let t=i;t<n;t+=1){const i=4*t,s=e[i+0],n=e[i+1],a=e[i+3],o=e[i+2];if(-1===s)continue;const r=(s+n)/2|0,l=d[r];null!=l&&k(r,l,u[s],p[n],g[a],m[o],Math.abs(A(n)-A(s))+v,!1)}}return M}isVertical(){return!0}isLabelEnabled(){return!1}updateDatumSelection(t){const e=t.nodeData??[];return t.datumSelection.update(e)}updateLabelNodes(t){}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}getItemBaseStyle(t,e){const{properties:i}=this,s=i.item[t],n=e?i.highlightStyle.item:void 0,a={fill:n?.fill??s.fill,fillOpacity:n?.fillOpacity??s.fillOpacity,stroke:n?.stroke??s.stroke,strokeWidth:n?.strokeWidth??s.strokeWidth,strokeOpacity:n?.strokeOpacity??s.strokeOpacity,lineDash:n?.lineDash??s.lineDash,lineDashOffset:n?.lineDashOffset??s.lineDashOffset};return s.fillGradientDefaults&&s.fillPatternDefaults&&s.fillImageDefaults?im(a,s.fillGradientDefaults,s.fillPatternDefaults,s.fillImageDefaults):a}getItemStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,r=o.item[i],{itemStyler:l}=o;if(null==l)return;const{xKey:h,openKey:c,closeKey:d,highKey:u,lowKey:p}=o,g=this.cachedDatumCallback(Kg(t,n?"highlight":"node"),()=>this.callWithContext(l,{seriesId:a,datum:e,itemId:i,xKey:h,openKey:c,closeKey:d,highKey:u,lowKey:p,highlighted:n,...s}));return r.fillGradientDefaults&&r.fillPatternDefaults&&r.fillImageDefaults?im(g,r.fillGradientDefaults,r.fillPatternDefaults,r.fillImageDefaults):g}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yName:r,openKey:l,openName:h,highKey:c,highName:d,lowKey:u,lowName:p,closeKey:g,closeName:m,legendItemName:y,tooltip:f}=n,x=this.getCategoryAxis(),b=this.getValueAxis();if(!(i&&s&&x&&b))return;const v=s.dataSources.get(this.id)?.[t],S=i.resolveKeysById(this,"xValue",s)[t],M=i.resolveColumnById(this,"openValue",s)[t],k=i.resolveColumnById(this,"highValue",s)[t],D=i.resolveColumnById(this,"lowValue",s)[t],w=i.resolveColumnById(this,"closeValue",s)[t];if(null==S)return;const I=w>=M?"up":"down",C=this.properties.item[I],L=this.getItemBaseStyle(I,!1);Object.assign(L,this.getItemStyleOverrides(String(t),v,I,L,!1));let A={fill:C.fill??C.stroke,fillOpacity:C.fillOpacity??C.strokeOpacity??1,stroke:C.stroke,strokeWidth:C.strokeWidth??1,strokeOpacity:C.strokeOpacity??1,lineDash:C.lineDash??[0],lineDashOffset:C.lineDashOffset??0};return C.fillGradientDefaults&&C.fillPatternDefaults&&C.fillImageDefaults&&(A=im(A,C.fillGradientDefaults,C.fillPatternDefaults,C.fillImageDefaults)),this.formatTooltipWithContext(f,{heading:x.formatDatum(S),title:y,symbol:{marker:A},data:[{label:h,fallbackLabel:l,value:b.formatDatum(M)},{label:d,fallbackLabel:c,value:b.formatDatum(k)},{label:p,fallbackLabel:u,value:b.formatDatum(D)},{label:m,fallbackLabel:g,value:b.formatDatum(w)}]},{seriesId:e,datum:v,title:r,itemId:I,xKey:a,xName:o,yName:r,openKey:l,openName:h,highKey:c,highName:d,lowKey:u,lowName:p,closeKey:g,closeName:m,...L})}getDatumId(t){return Kg(t.xValue)}computeFocusBounds(t){const e=this.getNodeData()?.at(t.datumIndex);if(null==e)return;const{centerX:i,y:s,width:n,height:a}=e;return qg(this,{x:i-n/2,y:s,width:n,height:a})}},{Path:am,SceneChangeDetection:om,BBox:rm}=s.n1,lm=class extends am{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1,this.strokeAlignment=0}computeBBox(){const{centerX:t,y:e,width:i,height:s}=this;return new rm(t-i/2,e,i,s)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}get midPoint(){return{x:this.centerX,y:this.y+this.height/2}}alignedCoordinates(){const{y:t,width:e,height:i,crisp:s,strokeAlignment:n}=this;let{centerX:a,yOpen:o,yClose:r}=this,l=a-e/2,h=a+e/2,c=t,d=t+i;if(s&&e>1){a=this.align(a),o=this.align(o),r=this.align(r);const s=this.align(e/2);l=a-s,h=a+s,c=this.align(t),d=c+this.align(c,i)}const u=(c+d)/2;return a+=n,l+=n,h+=n,c-=n,d+=n,o+=o<u?n:-n,r+=r<u?n:-n,{centerX:a,x0:l,x1:h,y0:c,y1:d,yOpen:o,yClose:r}}executeStroke(t,e){const{width:i,strokeWidth:s}=this;i<s&&(t.lineWidth=i),super.executeStroke(t,e)}};r([om()],lm.prototype,"centerX",2),r([om()],lm.prototype,"y",2),r([om()],lm.prototype,"width",2),r([om()],lm.prototype,"height",2),r([om()],lm.prototype,"yOpen",2),r([om()],lm.prototype,"yClose",2),r([om()],lm.prototype,"crisp",2),r([om()],lm.prototype,"strokeAlignment",2);var hm=class extends lm{updatePath(){const{path:t}=this,{centerX:e,x0:i,x1:s,y0:n,y1:a,yOpen:o,yClose:r}=this.alignedCoordinates();t.clear(),t.moveTo(e,n),t.lineTo(e,a),Math.abs(s-i)>1&&(t.moveTo(i,o),t.lineTo(e,o),t.moveTo(e,r),t.lineTo(s,r))}},{SceneArrayChangeDetection:cm,SceneChangeDetection:dm,ExtendedPath2D:um,BBox:pm}=s.n1,gm=class extends lm{constructor(){super(...arguments),this.wickPath=new um,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0}computeDefaultGradientFillBBox(){const{width:t,centerX:e,yOpen:i,yClose:s}=this,n=Math.min(i,s),a=Math.max(i,s),o=e-t/2;return new pm(o,n,e+t/2-o,a-n)}updatePath(){const{path:t,stroke:e,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:a,wickStroke:o,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:h,wickLineDashOffset:c,strokeAlignment:d}=this,{centerX:u,x0:p,x1:g,y0:m,y1:y,yOpen:f,yClose:x}=this.alignedCoordinates();this.path.clear(),this.wickPath.clear();const b=null!=o&&o!==e||null!=r&&r!==i||null!=l&&l!==s||null!=h&&h!==n||null!=c&&c!==a?this.wickPath:t;if(Math.abs(g-p)<=3)return b.moveTo(u,m),void b.lineTo(u,y);const v=Math.min(f,x),S=Math.max(f,x);b.moveTo(u,m),b.lineTo(u,v+i/2),b.moveTo(u,y),b.lineTo(u,S-i/2);const M=d+i/2,k=S-v-2*M;if(k>0)t.rect(p+M,v+M,g-p-2*M,k);else{const e=(v+S)/2;t.moveTo(p,e),t.lineTo(g,e)}}drawPath(t){super.drawPath(t);const{wickPath:e}=this;if(e.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,wickStroke:r=i,wickStrokeWidth:l=s,wickStrokeOpacity:h=n,wickLineDash:c=a,wickLineDashOffset:d=o}=this;0!==l&&(t.globalAlpha*=h,"string"==typeof r&&(t.strokeStyle=r),t.lineWidth=l,null!=c&&t.setLineDash([...c]),t.lineDashOffset=d,t.stroke(e.getPath2D()))}};r([dm()],gm.prototype,"wickStroke",2),r([dm()],gm.prototype,"wickStrokeWidth",2),r([dm()],gm.prototype,"wickStrokeOpacity",2),r([cm()],gm.prototype,"wickLineDash",2),r([dm()],gm.prototype,"wickLineDashOffset",2);var{BaseProperties:mm,Property:ym,AbstractBarSeriesProperties:fm,SeriesTooltip:xm}=s.n1,bm=class extends mm{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};r([ym],bm.prototype,"stroke",2),r([ym],bm.prototype,"strokeWidth",2),r([ym],bm.prototype,"strokeOpacity",2),r([ym],bm.prototype,"lineDash",2),r([ym],bm.prototype,"lineDashOffset",2);var vm=class extends mm{constructor(){super(...arguments),this.up=new bm,this.down=new bm}};r([ym],vm.prototype,"up",2),r([ym],vm.prototype,"down",2);var Sm=class extends fm{};r([ym],Sm.prototype,"xKey",2),r([ym],Sm.prototype,"openKey",2),r([ym],Sm.prototype,"closeKey",2),r([ym],Sm.prototype,"highKey",2),r([ym],Sm.prototype,"lowKey",2),r([ym],Sm.prototype,"xName",2),r([ym],Sm.prototype,"yName",2),r([ym],Sm.prototype,"openName",2),r([ym],Sm.prototype,"closeName",2),r([ym],Sm.prototype,"highName",2),r([ym],Sm.prototype,"lowName",2);var Mm=class extends Sm{constructor(){super(...arguments),this.tooltip=new xm,this.item=new vm}};r([ym],Mm.prototype,"tooltip",2),r([ym],Mm.prototype,"item",2),r([ym],Mm.prototype,"itemStyler",2);var{FillGradientDefaults:km,FillPatternDefaults:Dm,FillImageDefaults:wm,BaseProperties:Im,SeriesTooltip:Cm,Property:Lm}=s.n1,Am=class extends Im{};r([Lm],Am.prototype,"stroke",2),r([Lm],Am.prototype,"strokeWidth",2),r([Lm],Am.prototype,"strokeOpacity",2),r([Lm],Am.prototype,"lineDash",2),r([Lm],Am.prototype,"lineDashOffset",2);var Tm=class extends Im{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new km,this.fillPatternDefaults=new Dm,this.fillImageDefaults=new wm,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Am}};r([Lm],Tm.prototype,"fill",2),r([Lm],Tm.prototype,"fillGradientDefaults",2),r([Lm],Tm.prototype,"fillPatternDefaults",2),r([Lm],Tm.prototype,"fillImageDefaults",2),r([Lm],Tm.prototype,"fillOpacity",2),r([Lm],Tm.prototype,"stroke",2),r([Lm],Tm.prototype,"strokeWidth",2),r([Lm],Tm.prototype,"strokeOpacity",2),r([Lm],Tm.prototype,"lineDash",2),r([Lm],Tm.prototype,"lineDashOffset",2),r([Lm],Tm.prototype,"cornerRadius",2),r([Lm],Tm.prototype,"wick",2);var Nm=class extends Im{constructor(){super(...arguments),this.up=new Tm,this.down=new Tm}};r([Lm],Nm.prototype,"up",2),r([Lm],Nm.prototype,"down",2);var Om=class extends Sm{constructor(){super(...arguments),this.item=new Nm,this.tooltip=new Cm}};r([Lm],Om.prototype,"item",2),r([Lm],Om.prototype,"tooltip",2),r([Lm],Om.prototype,"itemStyler",2);var{createDatumId:Rm,isGradientFill:Em,isPatternFill:Pm,isImageFill:Bm,getShapeFill:Fm,applyShapeStyle:zm,getShapeStyle:Gm}=s.n1,_m=class extends nm{constructor(){super(...arguments),this.properties=new Om}nodeFactory(){return new gm}updateDatumNodes({datumSelection:t,isHighlight:e}){const{id:i,properties:s}=this,{xKey:n,highKey:a,lowKey:o,openKey:r,closeKey:l,item:h,itemStyler:c}=s,{up:d,down:u}=h,p=Gm({fill:d.fill,fillOpacity:d.fillOpacity,stroke:d.stroke,strokeWidth:d.strokeWidth,strokeOpacity:d.strokeOpacity,lineDash:d.lineDash,lineDashOffset:d.lineDashOffset},d.fillGradientDefaults,d.fillPatternDefaults,d.fillImageDefaults),g=Gm({fill:u.fill,fillOpacity:u.fillOpacity,stroke:u.stroke,strokeWidth:u.strokeWidth,strokeOpacity:u.strokeOpacity,lineDash:u.lineDash,lineDashOffset:u.lineDashOffset},u.fillGradientDefaults,u.fillPatternDefaults,u.fillImageDefaults),m=e?s.highlightStyle.item:void 0;t.each((t,s)=>{const{isRising:h,centerX:y,width:f,y:x,height:b,yOpen:v,yClose:S,crisp:M}=s;let k;if(null!=c){const{fill:t,fillOpacity:m,stroke:y,strokeWidth:f,strokeOpacity:x,lineDash:b,lineDashOffset:v}=h?p:g;k=Gm(this.cachedDatumCallback(Rm(this.getDatumId(s),e?"highlight":"node"),()=>this.callWithContext(c,{seriesId:i,itemId:s.itemId,xKey:n,highKey:a,lowKey:o,openKey:r,closeKey:l,datum:s.datum,fill:t,fillOpacity:m,strokeOpacity:x,stroke:y,strokeWidth:f,lineDash:b,lineDashOffset:v,highlighted:e})),h?d.fillGradientDefaults:u.fillGradientDefaults,h?d.fillPatternDefaults:u.fillPatternDefaults,h?d.fillImageDefaults:u.fillImageDefaults)}t.centerX=y,t.width=f,t.y=x,t.height=b,t.yOpen=v,t.yClose=S,t.crisp=M;const D=h?p:g,w=h?d.wick:u.wick;zm(t,{fill:m?.fill??k?.fill??D.fill,fillOpacity:m?.fillOpacity??k?.fillOpacity??D.fillOpacity,stroke:m?.stroke??k?.stroke??D.stroke,strokeWidth:m?.strokeWidth??k?.strokeWidth??D.strokeWidth,strokeOpacity:m?.strokeOpacity??k?.strokeOpacity??D.strokeOpacity,lineDash:m?.lineDash??k?.lineDash??D.lineDash,lineDashOffset:m?.lineDashOffset??k?.lineDashOffset??D.lineDashOffset},void 0,this.getShapeFillBBox());const I=k?.wick;t.wickStroke=m?.stroke??I?.stroke??w.stroke,t.wickStrokeWidth=m?.strokeWidth??I?.strokeWidth??w.strokeWidth,t.wickStrokeOpacity=m?.strokeOpacity??I?.strokeOpacity??w.strokeOpacity,t.wickLineDash=m?.lineDash??I?.lineDash??w.lineDash,t.wickLineDashOffset=m?.lineDashOffset??I?.lineDashOffset??w.lineDashOffset,t.strokeAlignment=(k?.strokeWidth??D.strokeWidth)/2})}legendItemSymbol(){const{up:t,down:e}=this.properties.item,i=Fm(t.fill,t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults),s=Em(i)?i.colorStops.map(t=>"string"==typeof t?t:{color:t.color,stop:null!=t.stop?.5*t.stop:void 0}):[{color:Pm(i)||Bm(i)?t.stroke:i,stop:0},{color:Pm(i)||Bm(i)?t.stroke:i,stop:.5}],n=Fm(e.fill,e.fillGradientDefaults,e.fillPatternDefaults,e.fillImageDefaults),a={type:"gradient",gradient:"linear",rotation:90,colorStops:[...s,...Em(n)?n.colorStops.map(t=>"string"==typeof t?t:{color:t.color,stop:null!=t.stop?.5*t.stop:void 0}):[{color:Pm(n)||Bm(n)?e.stroke:n,stop:.5}]],reverse:!1},o={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:t.stroke,stop:0},{color:t.stroke,stop:.5},{color:e.stroke,stop:.5}],reverse:!1};return{marker:{fill:a,fillOpacity:t.fillOpacity,stroke:o,strokeWidth:t.strokeWidth??1,strokeOpacity:t.strokeOpacity??1,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset}}}getLegendData(t){const{id:e,data:i,visible:s,ctx:{legendManager:n}}=this,{xKey:a,yName:o,showInLegend:r,legendItemName:l}=this.properties;return i?.length&&a&&"category"===t?[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:s&&n.getItemEnabled({seriesId:e,itemId:e}),label:{text:l??o??e},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]:[]}};_m.className="CandleStickSeries",_m.type="candlestick";var{commonSeriesOptionsDefs:jm,candlestickSeriesThemeableOptionsDef:Wm}=s.n1,Vm={...Wm,...jm,type:(0,n.mw)((0,n.dY)("candlestick")),xKey:(0,n.mw)(n.Yj),openKey:(0,n.mw)(n.Yj),highKey:(0,n.mw)(n.Yj),lowKey:(0,n.mw)(n.Yj),closeKey:(0,n.mw)(n.Yj),xName:n.Yj,yName:n.Yj,openName:n.Yj,highName:n.Yj,lowName:n.Yj,closeName:n.Yj};Vm.pickOutsideVisibleMinorAxis=(0,n._L)(n.zM),Vm.focusPriority=(0,n._L)(n.ai);var{CARTESIAN_AXIS_TYPE:Km}=s.n1.ThemeConstants;function Ym(t){return{fill:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},"up"===t?"transparent":{$palette:"fill"},{$palette:`${t}.fill`}]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${t}.stroke`}]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$if:[{$or:[{$isGradient:[{$palette:`${t}.fill`}]},{$isPattern:[{$palette:`${t}.fill`}]},{$isImage:[{$palette:`${t}.fill`}]}]},{$map:[{$path:["./color",void 0,{$value:"$1"}]},{$path:["./colorStops",void 0,{$palette:`${t}.fill`}]}]},[{$mix:[{$palette:`${t}.fill`},"black",.15]},{$mix:[{$palette:`${t}.fill`},"white",.15]}]]},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS}}var $m={series:{item:{up:Ym("up"),down:Ym("down")},highlightStyle:{item:{strokeWidth:3}}},animation:{enabled:!1},axes:{[Km.NUMBER]:{crosshair:{snap:!1}},[Km.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:Hm,CARTESIAN_POSITION:Um}=s.n1.ThemeConstants,Xm={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:t=>new _m(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:Hm.NUMBER,position:Um.LEFT},{type:Hm.ORDINAL_TIME,position:Um.BOTTOM}],themeTemplate:$m,groupable:!1},Zm={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,options:Vm,create:t=>new _m(t)},{CachedTextMeasurerPool:qm,TextUtils:Qm,TextWrapper:Jm}=s.n1;function ty(t,e){return null!=t.lineHeight&&null!=t.fontSize?t.lineHeight*e/t.fontSize:Qm.getLineHeight(e)}function ey(t,e,i,s,{padding:a},o){const{spacing:r=0}=e,l=2*a,h=2*a+r,c=(e.minimumFontSize??e.fontSize)+(s.minimumFontSize??s.fontSize);if(c>o(c+h,!1).height-h)return;const d=function(t,e){const{fontSize:i,minimumFontSize:s=i}=t,{fontSize:n,minimumFontSize:a=n}=e,o=i-s,r=n-a;let l=t.fontSize,h=e.fontSize;const c=[{labelFontSize:i,secondaryLabelFontSize:n}];for(;l>s||h>a;)(o>0?(l-s)/o:-1)>(r>0?(h-a)/r:-1)?l--:h--,c.push({labelFontSize:l,secondaryLabelFontSize:h});return c.reverse(),c}(e,s),u={fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},p={fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let g,m;return(0,n.F4)(0,d.length-1,n=>{const{labelFontSize:a,secondaryLabelFontSize:c}=d[n],y=0===n,f=ty(e,a),x=ty(s,c),b=o(f+x+h,y),v=b.width-l,S=b.height-h;if(f+x>S)return;if(null!=g&&g.fontSize===a||(u.fontSize=a,g=ay(e,t,v,S,u,e.wrapping,y?e.overflowStrategy:"hide")),null==g||g.width>v||g.height>S)return;if(null!=m&&m.fontSize===c||(p.fontSize=c,m=ay(s,i,v,S,p,s.wrapping,y?s.overflowStrategy:"hide")),null==m)return;const M=g.height+m.height;return m.width>v||M>S?void 0:{width:Math.max(g.width,m.width),height:M+r,meta:b.meta,label:g,secondaryLabel:m}})}function iy(t,e,{padding:i},s){const a=2*i,o=Math.min(e.minimumFontSize??e.fontSize,e.fontSize),r={fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight};return(0,n.F4)(o,e.fontSize,i=>{const n=ty(e,i),l=i===o,h=s(n+a,l),c=h.width-a,d=h.height-a;if(n>d)return;r.fontSize=i;const u=Jm.wrapLines(t,{maxWidth:c,maxHeight:d,font:r,textWrap:e.wrapping,overflow:(l?e.overflowStrategy:void 0)??"hide"});if(!u.length)return;const p=function(t,{font:e,lineHeight:i=Qm.defaultLineHeight,maxWidth:s,maxHeight:n=1/0}){let a=i*t.length;for(;a>n;){if(1===t.length)return;t.pop(),t[t.length-1]=Jm.appendEllipsis(t.at(-1)),a=i*t.length}const o=qm.measureLines(t,{font:e});let r,l;if(o.width>s){const t=[];l=0;for(const e of o.lineMetrics){if(e.width>s){if(!t.length)return;break}t.push(e.text),l=Math.max(l,e.width)}r=Jm.appendEllipsis(t.join("\n"))}else r=t.join("\n"),l=o.width;return{text:r,width:l,height:a}}(u,{lineHeight:n,font:r,maxWidth:c,maxHeight:d});return p?[{fontSize:i,lineHeight:n,...p},h.meta]:void 0})}function sy(t){return null!=t?.minimumFontSize&&null!=t?.fontSize&&t?.minimumFontSize>t?.fontSize}function ny(t,e,i,s,a,o){const r=e.enabled?t:void 0,l=s.enabled?i:void 0;let h,c,d;if((sy(e)||sy(s))&&n.Vy.warnOnce("minimumFontSize should be set to a value less than or equal to the font size"),null!=r&&null!=l&&(h=ey(r,e,l,s,a,o)),null==h&&null!=r&&(c=iy(r,e,a,o)),null!=c){const[t,e]=c;h={width:t.width,height:t.height,meta:e,label:t,secondaryLabel:void 0}}if(null==h&&null==r&&null!=l&&(d=iy(l,s,a,o)),null!=d){const[t,e]=d;h={width:t.width,height:t.height,meta:e,label:void 0,secondaryLabel:t}}return h}function ay(t,e,i,s,n,a,o){const r=Jm.wrapLines(e,{maxWidth:i,maxHeight:s,font:n,textWrap:a,overflow:o});if(!r.length)return;const l=ty(t,n.fontSize),{width:h}=qm.measureLines(r,{font:n});return{width:h,lineHeight:l,text:r.join("\n"),height:r.length*l,fontSize:n.fontSize}}var{Property:oy}=s.n1,ry=class extends s.n1.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};r([oy],ry.prototype,"wrapping",2),r([oy],ry.prototype,"overflowStrategy",2),r([oy],ry.prototype,"lineHeight",2),r([oy],ry.prototype,"minimumFontSize",2);var ly=class extends ry{constructor(){super(...arguments),this.spacing=0}};r([oy],ly.prototype,"spacing",2);var hy=class extends ry{},{CartesianSeriesProperties:cy,SeriesTooltip:dy,Property:uy}=s.n1,py=class extends cy{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new ly,this.tooltip=new dy}};r([uy],py.prototype,"title",2),r([uy],py.prototype,"xKey",2),r([uy],py.prototype,"yKey",2),r([uy],py.prototype,"colorKey",2),r([uy],py.prototype,"xName",2),r([uy],py.prototype,"yName",2),r([uy],py.prototype,"colorName",2),r([uy],py.prototype,"colorRange",2),r([uy],py.prototype,"stroke",2),r([uy],py.prototype,"strokeOpacity",2),r([uy],py.prototype,"strokeWidth",2),r([uy],py.prototype,"textAlign",2),r([uy],py.prototype,"verticalAlign",2),r([uy],py.prototype,"itemPadding",2),r([uy],py.prototype,"itemStyler",2),r([uy],py.prototype,"label",2),r([uy],py.prototype,"tooltip",2);var{SeriesNodePickMode:gy,computeBarFocusBounds:my,getMissCount:yy,valueProperty:fy,ChartAxisDirection:xy,DEFAULT_CARTESIAN_DIRECTION_KEYS:by,DEFAULT_CARTESIAN_DIRECTION_NAMES:vy,createDatumId:Sy,ColorScale:My,Rect:ky,PointerEvents:Dy,applyShapeStyle:wy}=s.n1,Iy=class extends s.n1.CartesianSeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.colorKey=s.properties.colorKey}},Cy={left:-.5,center:0,right:-.5},Ly={top:-.5,middle:0,bottom:-.5},Ay=class extends s.n1.CartesianSeries{constructor(t){super({moduleCtx:t,directionKeys:by,directionNames:vy,categoryKey:void 0,pickModes:[gy.NEAREST_NODE,gy.EXACT_SHAPE_MATCH],pathsPerSeries:[],hasMarkers:!1,hasHighlightedLabels:!0}),this.properties=new py,this.NodeEvent=Iy,this.colorScale=new My}async processData(t){const e=this.axes[xy.X],i=this.axes[xy.Y];if(!e||!i||!this.data?.length)return;const{xKey:s,yKey:n,colorRange:a,colorKey:o}=this.properties,r=this.axes[xy.X]?.scale,l=this.axes[xy.Y]?.scale,{xScaleType:h,yScaleType:c}=this.getScaleInformation({xScale:r,yScale:l}),d=this.colorScale.type,{dataModel:u,processedData:p}=await this.requestDataModel(t,this.data,{props:[fy(s,h,{id:"xValue"}),fy(n,c,{id:"yValue"}),...o?[fy(o,d,{id:"colorValue",invalidValue:null})]:[]]});if(this.isColorScaleValid()){const t=u.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=p.domain.values[t],this.colorScale.range=a,this.colorScale.update()}}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,a=yy(this,i.defs.values[s].missing);return!(0===n||n===a)}xCoordinateRange(t,e){const i=this.axes[xy.X].scale,s=e*(i.bandwidth??0)/2,n=i.convert(t)+s;return[n,n+e*(i.bandwidth??10)]}yCoordinateRange(t,e){const i=this.axes[xy.Y].scale,s=e*(i.bandwidth??0)/2,n=i.convert(t[0])+s;return[n,n+e*(i.bandwidth??10)]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;return e&&i?t===xy.X?e.getDomain(this,"xValue","value",i):e.getDomain(this,"yValue","value",i):[]}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{data:t,visible:e,axes:i,dataModel:s,processedData:a}=this,o=i[xy.X],r=i[xy.Y];if(!(t&&s&&a&&e&&o&&r))return;if("category"!==o.type||"category"!==r.type)return void n.Vy.warnOnce(`Heatmap series expected axes to have "category" type, but received "${o.type}" and "${r.type}" instead.`);const{xKey:l,xName:h,yKey:c,yName:d,colorKey:u,colorName:p,textAlign:g,verticalAlign:m,itemPadding:y,label:f}=this.properties,x=s.resolveColumnById(this,"xValue",a),b=s.resolveColumnById(this,"yValue",a),v=u?s.resolveColumnById(this,"colorValue",a):void 0,S=o.scale,M=r.scale,k=(S.bandwidth??0)/2,D=(M.bandwidth??0)/2,w=[],I=[],C=S.bandwidth??10,L=M.bandwidth??10,A=(C-2*y)*Cy[g],T=(L-2*y)*Ly[m],N=()=>({width:C,height:L,meta:null});return(a.dataSources.get(this.id)??[]).forEach((t,e)=>{const i=x[e],s=b[e],n=S.convert(i)+k,a=M.convert(s)+D,o=v?.[e],r=ny(null==o?void 0:this.getLabelText(f,{value:o,datum:t,colorKey:u,colorName:p,xKey:l,yKey:c,xName:h,yName:d}),this.properties.label,void 0,this.properties.label,{padding:y},N),O={x:n,y:a,size:0};if(w.push({series:this,itemId:c,datumIndex:e,yKey:c,xKey:l,xValue:i,yValue:s,colorValue:o,datum:t,point:O,width:C,height:L,midPoint:{x:n,y:a},missing:null!=v&&null==o}),null!=r?.label){const{text:i,fontSize:s,lineHeight:n,height:a}=r.label,{fontStyle:o,fontFamily:l,fontWeight:h,color:d}=this.properties.label,u=O.x+A*(C-2*y),p=O.y+T*(L-2*y)-.5*(r.height-a);I.push({series:this,itemId:c,datum:t,datumIndex:e,text:i,fontSize:s,lineHeight:n,fontStyle:o,fontFamily:l,fontWeight:h,color:d,textAlign:g,verticalAlign:m,x:u,y:p})}}),{itemId:this.properties.yKey??this.id,nodeData:w,labelData:I,scales:this.calculateScaling(),visible:this.visible}}nodeFactory(){return new ky}update(t){return this.ctx.animationManager.skipCurrentBatch(),super.update(t)}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s)}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??1,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity}}getItemStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,{xKey:r,yKey:l,itemStyler:h}=o,c=this.isColorScaleValid()&&null!=i?this.colorScale.convert(i):"transparent";let d=null==s.fill?{fill:c}:void 0;if(null!=h){d??(d={});const i=this.cachedDatumCallback(Sy(t,n?"highlight":"node"),()=>this.callWithContext(h,{seriesId:a,datum:e,xKey:r,yKey:l,highlighted:n,...s,fill:c}));Object.assign(d,i)}return d}updateDatumNodes(t){const{isHighlight:e}=t,i=this.axes[xy.X],[s,n]=i?.visibleRange??[],a=!(0!==s||1!==n),o=this.getItemBaseStyle(e);t.datumSelection.each((t,i)=>{const{datumIndex:s,colorValue:n,datum:r,point:l,width:h,height:c}=i,d=this.getItemStyleOverrides(String(s),r,n,o,e);t.crisp=a,t.x=Math.floor(l.x-h/2),t.y=Math.floor(l.y-c/2),t.width=Math.ceil(h),t.height=Math.ceil(c),wy(t,o,d)})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t,{enabled:s}=this.properties.label,n=s?e:[];return i.update(n)}updateLabelNodes(t){t.labelSelection.each((t,e)=>{t.text=e.text,t.fontSize=e.fontSize,t.lineHeight=e.lineHeight,t.fontStyle=e.fontStyle,t.fontFamily=e.fontFamily,t.fontWeight=e.fontWeight,t.fill=e.color,t.textAlign=e.textAlign,t.textBaseline=e.verticalAlign,t.x=e.x,t.y=e.y,t.pointerEvents=Dy.None})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a,colorScale:o}=this,{xKey:r,xName:l,yKey:h,yName:c,colorKey:d,colorName:u,colorRange:p,title:g,legendItemName:m,tooltip:y}=a,f=n[xy.X],x=n[xy.Y];if(!(i&&s&&f&&x))return;const b=s.dataSources.get(this.id)?.[t],v=i.resolveColumnById(this,"xValue",s)[t],S=i.resolveColumnById(this,"yValue",s)[t],M=null!=d&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",s)[t]:void 0;if(null==v)return;const k=[];let D;null==M?D=p[0]:(D=o.convert(M),k.push({label:u,fallbackLabel:d,value:String(M)})),k.push({label:l,fallbackLabel:r,value:f.formatDatum(v)},{label:c,fallbackLabel:h,value:x.formatDatum(S)});const w=this.getItemBaseStyle(!1);Object.assign(w,this.getItemStyleOverrides(String(t),b,M,w,!1)),null!=w.fill&&(D=w.fill);const I=null!=D?{marker:{shape:"square",fill:D,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}}:void 0;return this.formatTooltipWithContext(y,{title:g??m,symbol:I,data:k},{seriesId:e,datum:b,title:g,xKey:r,xName:l,yKey:h,yName:c,colorKey:d,colorName:u,...w})}getLegendData(t){return"gradient"===t&&this.isColorScaleValid()&&this.dataModel?[{legendType:"gradient",enabled:this.visible,seriesId:this.id,colorName:this.properties.colorName,colorDomain:this.processedData.domain.values[this.dataModel.resolveProcessedDataIndexById(this,"colorValue")],colorRange:this.properties.colorRange}]:[]}isLabelEnabled(){return this.properties.label.enabled&&Boolean(this.properties.colorKey)}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t];if(void 0===e)return;const{width:i,height:s,midPoint:n}=e,a={x:n.x-i/2,y:n.y-s/2,width:i,height:s};return my(this,a)}};Ay.className="HeatmapSeries",Ay.type="heatmap";var{commonSeriesOptionsDefs:Ty,heatmapSeriesThemeableOptionsDef:Ny}=s.n1,Oy={...Ny,...Ty,type:(0,n.mw)((0,n.dY)("heatmap")),xKey:(0,n.mw)(n.Yj),yKey:(0,n.mw)(n.Yj),colorKey:n.Yj,xName:n.Yj,yName:n.Yj,colorName:n.Yj,colorRange:(0,n.jk)(n.yW)},Ry={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"backgroundColor"},{$path:["./0",{$palette:"stroke"},{$palette:"strokes"}]}]},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},s.n1.SAFE_RANGE2_OPERATION]},label:{enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3},gradientLegend:{enabled:!0}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:Ey,CARTESIAN_POSITION:Py}}=s.n1,By={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"heatmap",moduleFactory:t=>new Ay(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:Ey.CATEGORY,position:Py.LEFT},{type:Ey.CATEGORY,position:Py.BOTTOM}],themeTemplate:Ry},Fy={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,options:Oy,create:t=>new Ay(t)},{createDatumId:zy}=s.n1,Gy=class extends nm{constructor(){super(...arguments),this.properties=new Mm}nodeFactory(){return new hm}updateDatumNodes({datumSelection:t,isHighlight:e}){const{id:i,properties:s}=this,{xKey:n,highKey:a,lowKey:o,openKey:r,closeKey:l,item:h,itemStyler:c}=s,{up:d,down:u}=h,{stroke:p,strokeWidth:g,strokeOpacity:m,lineDash:y,lineDashOffset:f}=d,{stroke:x,strokeWidth:b,strokeOpacity:v,lineDash:S,lineDashOffset:M}=u,k=e?s.highlightStyle.item:void 0;t.each((t,s)=>{const{isRising:h,centerX:D,width:w,y:I,height:C,yOpen:L,yClose:A,crisp:T}=s;let N;if(null!=c){const{stroke:t,strokeWidth:p,strokeOpacity:g,lineDash:m,lineDashOffset:y}=h?d:u;N=this.cachedDatumCallback(zy(this.getDatumId(s),e?"highlight":"node"),()=>this.callWithContext(c,{seriesId:i,itemId:s.itemId,xKey:n,highKey:a,lowKey:o,openKey:r,closeKey:l,datum:s.datum,strokeOpacity:g,stroke:t,strokeWidth:p,lineDash:m,lineDashOffset:y,highlighted:e}))}t.centerX=D,t.width=w,t.y=I,t.height=C,t.yOpen=L,t.yClose=A,t.crisp=T,t.stroke=k?.stroke??N?.stroke??(h?p:x),t.strokeWidth=k?.strokeWidth??N?.strokeWidth??(h?g:b),t.strokeOpacity=k?.strokeOpacity??N?.strokeOpacity??(h?m:v),t.lineDash=k?.lineDash??N?.lineDash??(h?y:S),t.lineDashOffset=k?.lineDashOffset??N?.lineDashOffset??(h?f:M),t.strokeAlignment=(N?.strokeWidth??(h?g:b))/2})}getLegendData(t){const{id:e,data:i,ctx:{legendManager:s},visible:n}=this,{xKey:a,yName:o,item:{up:r,down:l},showInLegend:h,legendItemName:c}=this.properties;if(!i?.length||!a||"category"!==t)return[];const d={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:r.stroke,stop:0},{color:r.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:n&&s.getItemEnabled({seriesId:e,itemId:e}),label:{text:c??o??e},symbol:{marker:{fill:d,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:c,hideInLegend:!h}]}};Gy.className="ohlc",Gy.type="ohlc";var{commonSeriesOptionsDefs:_y,ohlcSeriesThemeableOptionsDef:jy}=s.n1,Wy={...jy,..._y,type:(0,n.mw)((0,n.dY)("ohlc")),xKey:(0,n.mw)(n.Yj),openKey:(0,n.mw)(n.Yj),highKey:(0,n.mw)(n.Yj),lowKey:(0,n.mw)(n.Yj),closeKey:(0,n.mw)(n.Yj),xName:n.Yj,yName:n.Yj,openName:n.Yj,highName:n.Yj,lowName:n.Yj,closeName:n.Yj};Wy.pickOutsideVisibleMinorAxis=(0,n._L)(n.zM),Wy.focusPriority=(0,n._L)(n.ai);var{CARTESIAN_AXIS_TYPE:Vy,CARTESIAN_POSITION:Ky}=s.n1.ThemeConstants,Yy={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ohlc",moduleFactory:t=>new Gy(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:Vy.NUMBER,position:Ky.LEFT},{type:Vy.ORDINAL_TIME,position:Ky.BOTTOM}],themeTemplate:{animation:{enabled:!1},series:{item:{up:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"up.stroke"}]}},down:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"down.stroke"}]}}}},axes:{[Vy.NUMBER]:{crosshair:{snap:!1}},[Vy.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},groupable:!1},$y={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,options:Wy,create:t=>new Gy(t)};function Hy(t,e,i,s,n,a){const o=t[a];return null!=o&&a===s[Gg(zg(o,e,i),n)+3]}function Uy(t,e,i,s,n,a){const o=t[a];return null!=o&&a===s[Gg(zg(o,e,i),n)+2]}var{CartesianSeriesProperties:Xy,FillGradientDefaults:Zy,FillPatternDefaults:qy,FillImageDefaults:Qy,InterpolationProperties:Jy,SeriesMarker:tf,SeriesTooltip:ef,Property:sf,DropShadow:nf,Label:af}=s.n1,of=class extends af{constructor(){super(...arguments),this.placement="outside",this.padding=6}};r([sf],of.prototype,"placement",2),r([sf],of.prototype,"padding",2);var rf=class extends Xy{constructor(){super(...arguments),this.fill="#99CCFF",this.fillGradientDefaults=new Zy,this.fillPatternDefaults=new qy,this.fillImageDefaults=new Qy,this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Jy,this.shadow=(new nf).set({enabled:!1}),this.marker=new tf,this.label=new of,this.tooltip=new ef,this.connectMissingData=!1}};r([sf],rf.prototype,"xKey",2),r([sf],rf.prototype,"yLowKey",2),r([sf],rf.prototype,"yHighKey",2),r([sf],rf.prototype,"xName",2),r([sf],rf.prototype,"yName",2),r([sf],rf.prototype,"yLowName",2),r([sf],rf.prototype,"yHighName",2),r([sf],rf.prototype,"fill",2),r([sf],rf.prototype,"fillGradientDefaults",2),r([sf],rf.prototype,"fillPatternDefaults",2),r([sf],rf.prototype,"fillImageDefaults",2),r([sf],rf.prototype,"fillOpacity",2),r([sf],rf.prototype,"stroke",2),r([sf],rf.prototype,"strokeWidth",2),r([sf],rf.prototype,"strokeOpacity",2),r([sf],rf.prototype,"lineDash",2),r([sf],rf.prototype,"lineDashOffset",2),r([sf],rf.prototype,"interpolation",2),r([sf],rf.prototype,"shadow",2),r([sf],rf.prototype,"marker",2),r([sf],rf.prototype,"label",2),r([sf],rf.prototype,"tooltip",2),r([sf],rf.prototype,"connectMissingData",2);var{CollapseMode:lf,isScaleValid:hf,pairUpSpans:cf,prepareAreaFillAnimationFns:df,plotInterpolatedLinePathStroke:uf,prepareLinePathPropertyAnimation:pf,areScalingEqual:gf}=s.n1;var{valueProperty:mf,keyProperty:yf,ChartAxisDirection:ff,mergeDefaults:xf,updateLabelNode:bf,fixNumericExtent:vf,buildResetPathFn:Sf,resetLabelFn:Mf,resetMarkerFn:kf,resetMarkerPositionFn:Df,pathSwipeInAnimation:wf,resetMotion:If,markerSwipeScaleInAnimation:Cf,seriesLabelFadeInAnimation:Lf,animationValidation:Af,diff:Tf,updateClipPath:Nf,computeMarkerFocusBounds:Of,plotAreaPathFill:Rf,plotLinePathStroke:Ef,interpolatePoints:Pf,pathFadeInAnimation:Bf,markerFadeInAnimation:Ff,fromToMotion:zf,pathMotion:Gf,extent:_f,createDatumId:jf,applyShapeFillBBox:Wf,PointerEvents:Vf,Group:Kf,BBox:Yf,ContinuousScale:$f,DiscreteTimeScale:Hf,findMinMax:Uf,getShapeStyle:Xf,getShapeFill:Zf,applyShapeStyle:qf}=s.n1,Qf=class extends s.n1.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},Jf=class extends s.n1.CartesianSeries{constructor(t){super({moduleCtx:t,hasMarkers:!0,pathsPerSeries:["fill","stroke"],pickModes:[s.n1.SeriesNodePickMode.AXIS_ALIGNED],directionKeys:{[ff.X]:["xKey"],[ff.Y]:["yLowKey","yHighKey"]},directionNames:{[ff.X]:["xName"],[ff.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:Sf({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Mf,marker:(t,e)=>({...kf(t),...Df(t,e)})},clipFocusBox:!1}),this.properties=new rf,this.NodeEvent=Qf,this.dataAggregationFilters=void 0}async processData(t){const{xKey:e,yLowKey:i,yHighKey:s}=this.properties,n=this.axes[ff.X]?.scale,a=this.axes[ff.Y]?.scale,{xScaleType:o,yScaleType:r}=this.getScaleInformation({xScale:n,yScale:a}),l=[],h=!this.ctx.animationManager.isSkipped();!this.ctx.animationManager.isSkipped()&&this.processedData&&l.push(Tf(this.id,this.processedData)),h&&l.push(Af());const{dataModel:c,processedData:d}=await this.requestDataModel(t,this.data,{props:[yf(e,o,{id:"xValue"}),mf(i,r,{id:"yLowValue"}),mf(s,r,{id:"yHighValue"}),...l]});this.dataAggregationFilters=this.aggregateData(c,d),this.animationState.transition("updateData")}aggregateData(t,e){const i=this.axes[ff.X];if(null==i||!$f.is(i.scale)&&!Hf.is(i.scale))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"yHighValue",e),a=t.resolveColumnById(this,"yLowValue",e),{index:o}=t.resolveProcessedDataDefById(this,"xValue");return function(t,e,i,s){if(t.length<1e3)return;const[n,a]=Fg(s);let o=Bg(t);const{indexData:r,valueData:l}=_g(t,e,i,n,a,o);let h=[],c=[];for(let e=0;e<t.length;e+=1)Hy(t,n,a,r,o,e)&&h.push(e),Uy(t,n,a,r,o,e)&&c.push(e);const d=[{maxRange:o,topIndices:h,bottomIndices:c}];for(;o>64;)({maxRange:o}=jg(r,l,o,{inPlace:!0})),h=h.filter(Hy.bind(null,t,n,a,r,o)),c=c.filter(Uy.bind(null,t,n,a,r,o)),d.push({maxRange:o,topIndices:h,bottomIndices:c});return d.reverse(),d}(s,n,a,e.domain.keys[o])}xCoordinateRange(t){const e=this.axes[ff.X].scale.convert(t);return[e,e]}yCoordinateRange(t){const e=this.axes[ff.Y].scale.convert(t[0]);return[e,e]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{domain:{keys:[s]}}=e;if(t===ff.X){const t=i.resolveProcessedDataDefById(this,"xValue");return"key"===t?.def.type&&"category"===t.def.valueType?s:vf(_f(s))}{const t=this.domainForClippedRange(ff.Y,["yHighValue","yLowValue"],"xValue",!0),e=Uf(t);return vf(e)}}getSeriesRange(t,e){return this.domainForVisibleRange(ff.Y,["yHighValue","yLowValue"],"xValue",e,!0)}createNodeData(){const{data:t,dataModel:e,processedData:i,axes:s}=this,n=s[ff.X],a=s[ff.Y];if(!(t&&n&&a&&e&&i))return;const o=n.scale,r=a.scale,{xKey:l,yLowKey:h,yHighKey:c,connectMissingData:d,marker:u,interpolation:p}=this.properties,g=i.dataSources.get(this.id)??[],m=(o.bandwidth??0)/2,y=e.resolveKeysById(this,"xValue",i),f=e.resolveColumnById(this,"yHighValue",i),x=e.resolveColumnById(this,"yLowValue",i),b=[],v=[],S=[],M=(t,e,i)=>{const s=g[t],n=y[t];if(null==n)return;const a=S[S.length-1];if(Number.isFinite(e)&&Number.isFinite(i)){const d=(a,o,r)=>{v.push({index:t,series:this,itemId:a,datum:s,datumIndex:t,midPoint:{x:f,y:r},yHighValue:e,yLowValue:i,xValue:n,xKey:l,yLowKey:h,yHighKey:c,point:{x:f,y:r,size:k},enabled:!0});const d=this.createLabelData({datumIndex:t,point:{x:f,y:r},value:o,yLowValue:i,yHighValue:e,itemId:a,inverted:g,datum:s,series:this});b.push(d)},g=i>e,f=(p=t,o.convert(y[p])+m),x=r.convert(e),M=r.convert(i),{size:k}=u;d("high",e,x),d("low",i,M);const D={high:{point:{x:f,y:x},xDatum:n,yDatum:e},low:{point:{x:f,y:M},xDatum:n,yDatum:i}};Array.isArray(a)?a.push(D):null!=a?(a.skip+=1,S.push([D])):S.push([D])}else d||(Array.isArray(a)||null==a?S.push({skip:0}):a.skip+=1);var p},{dataAggregationFilters:k}=this,[D,w]=o.range,I=w-D,C=k?.find(t=>t.maxRange>I),L=C?.topIndices,A=C?.bottomIndices;let[T,N]=this.visibleRange("xValue",n.range,L);T=Math.max(T-1,0),N=Math.min(N+1,L?.length??y.length),i.input.count<1e3&&(T=0,N=i.input.count);for(let t=T;t<N;t+=1){const e=L?.[t]??t,i=A?.[t]??t;M(e,f[e],x[i])}const O=S.flatMap(t=>{if(!Array.isArray(t))return[];const e=t.map(t=>t.high);return Pf(e,p)}),R=S.flatMap(t=>{if(!Array.isArray(t))return[];const e=t.map(t=>t.low);return Pf(e,p)});return{itemId:`${h}-${c}`,labelData:b,nodeData:v,fillData:{itemId:"high",spans:O,phantomSpans:R},highStrokeData:{itemId:"high",spans:O},lowStrokeData:{itemId:"low",spans:R},scales:this.calculateScaling(),visible:this.visible}}createLabelData({datumIndex:t,point:e,value:i,itemId:s,inverted:n,datum:a,series:o}){const{xKey:r,yLowKey:l,yHighKey:h,xName:c,yName:d,yLowName:u,yHighName:p,label:g}=this.properties,{placement:m,padding:y=10}=g;let f=s;n&&(f="low"===s?"high":"low");const x="outside"===m&&"high"===f||"inside"===m&&"low"===f?-1:1;return{x:e.x,y:e.y+y*x,series:o,itemId:s,datum:a,datumIndex:t,text:this.getLabelText(g,{value:i,datum:a,itemId:s,xKey:r,yLowKey:l,yHighKey:h,xName:c,yLowName:u,yHighName:p,yName:d}),textAlign:"center",textBaseline:-1===x?"bottom":"top"}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{opacity:e,visible:i}=t,[s,n]=t.paths,a=this.getStrokeWidth(this.properties.strokeWidth);n.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:Vf.None,stroke:this.properties.stroke,strokeWidth:a,strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i});const o=Zf(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults),r=this.getShapeFillBBox();Wf(s,o,r),qf(s,{stroke:void 0,fill:o,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,strokeOpacity:this.properties.strokeOpacity,strokeWidth:a},void 0,r),s.setProperties({pointerEvents:Vf.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:e,visible:i}),Nf(this,n),Nf(this,s)}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 e of t)e.path.clear(),e.markDirty("RangeArea")}updateFillPath(t,e){const[i]=t;i.path.clear(),Rf(i,e.fillData),i.markDirty("RangeArea")}updateStrokePath(t,e){const[,i]=t;i.path.clear(),Ef(i,e.highStrokeData.spans),Ef(i,e.lowStrokeData.spans),i.markDirty("RangeArea")}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{shape:i.shape,size:i.size,fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??this.getStrokeWidth(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:a}=this,{xKey:o,yHighKey:r,yLowKey:l,marker:h}=a,{itemStyler:c}=h;if(null!=c)return this.cachedDatumCallback(jf(t,s?"highlight":"node"),()=>this.callWithContext(c,{seriesId:n,datum:e,xKey:o,yHighKey:r,yLowKey:l,highlighted:s,...i}))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yLowKey:n,yHighKey:a,marker:o,fill:r,stroke:l,strokeWidth:h,fillOpacity:c,strokeOpacity:d}=this.properties,u=xf(i&&this.properties.highlightStyle.item,o.getStyle(),{fill:r,fillOpacity:c,stroke:l,strokeWidth:h,strokeOpacity:d}),p=this.getShapeFillBBox();e.each((t,e)=>{this.updateMarkerStyle(o,t,e.datum,e.point,{xKey:s,yHighKey:a,yLowKey:n},i,u,p)}),i||this.properties.marker.markClean()}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,t=>{t.pointerEvents=Vf.None})}updateLabelNodes(t){t.labelSelection.each((t,e)=>{bf(t,this.properties.label,e)})}getHighlightLabelData(t,e){const i=t.filter(t=>t.datum===e.datum);return i.length>0?i:void 0}getHighlightData(t,e){const i=t.filter(t=>t.datum===e.datum);return i.length>0?i:void 0}getTooltipContent(t,e){const{id:i,dataModel:s,processedData:n,axes:a,properties:o}=this,{xName:r,yName:l,yLowKey:h,yLowName:c,xKey:d,yHighKey:u,yHighName:p,tooltip:g}=o,m=a[ff.X],y=a[ff.Y];if(!(s&&n&&m&&y))return;const f=n.dataSources.get(this.id)?.[t],x=s.resolveKeysById(this,"xValue",n)[t],b=s.resolveColumnById(this,"yHighValue",n)[t],v=s.resolveColumnById(this,"yLowValue",n)[t];if(null==x)return;const S=this.getMarkerItemBaseStyle(!1);Object.assign(S,this.getMarkerItemStyleOverrides(String(t),t,S,!1));const M=`${y.formatDatum(v)} - ${y.formatDatum(b)}`;return this.formatTooltipWithContext(g,{heading:m.formatDatum(x),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:`${c??h} - ${p??u}`,value:M}]},{seriesId:i,datum:f,title:l,itemId:e?.itemId??"unknown",xName:r,yName:l,yLowKey:h,yLowName:c,xKey:d,yHighKey:u,yHighName:p,...S})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,strokeOpacity:s,lineDash:n,marker:a}=this.properties;return{marker:Xf({shape:a.shape,fill:a.fill??t,stroke:a.stroke??e,fillOpacity:a.fillOpacity,strokeOpacity:a.strokeOpacity,strokeWidth:a.strokeWidth,lineDash:a.lineDash,lineDashOffset:a.lineDashOffset},a.fillGradientDefaults,a.fillPatternDefaults,a.fillImageDefaults),line:{stroke:e,strokeOpacity:s,strokeWidth:i,lineDash:n}}}getLegendData(t){if("category"!==t)return[];const{id:e,visible:i}=this,{yLowKey:s,yHighKey:n,yName:a,yLowName:o,yHighName:r,showInLegend:l}=this.properties;return[{legendType:"category",id:e,itemId:`${s}-${n}`,seriesId:e,enabled:i,label:{text:`${a??`${o??s} - ${r??n}`}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}nodeFactory(){return new Kf}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:a}=this.ctx;this.updateAreaPaths(n,s),wf(this,a,...n),If([e],Df),Cf(this,a,e),Lf(this,"labels",a,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{markerSelection:i,labelSelection:s,contextData:n,paths:a,previousContextData:o}=t,[r,l]=a;if(null==r&&null==l)return;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const h=()=>{this.resetPathAnimation(t),this.updateAreaPaths(a,n)};if(null==n||null==o)return h(),Ff(this,e,"added",i),Bf(this,"fill_path_properties",e,"add",r),Bf(this,"stroke_path_properties",e,"add",l),void Lf(this,"labels",e,s);const c=function(t,e,i){if("category"===t.scales.x?.type!=("category"===e.scales.x?.type)||!hf(t.scales.x)||!hf(e.scales.x))return;let s="updated";e.visible&&!t.visible?s="removed":!e.visible&&t.visible&&(s="added");const n=cf({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},lf.Split);if(null==n)return;const a=cf({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},lf.Split);if(null==a)return;const o=cf({scales:t.scales,data:t.highStrokeData.spans},{scales:e.scales,data:e.highStrokeData.spans},lf.Split);if(null==o)return;const r=cf({scales:t.scales,data:t.lowStrokeData.spans},{scales:e.scales,data:e.lowStrokeData.spans},lf.Split);if(null==r)return;const l="fade",h=df(s,n,a,l),c=function(t,e,i,s){return{status:t,path:{addPhaseFn:(t,s)=>{uf(t,s,e.added),uf(t,s,i.added)},updatePhaseFn:(t,s)=>{uf(t,s,e.moved),uf(t,s,i.moved)},removePhaseFn:(t,s)=>{uf(t,s,e.removed),uf(t,s,i.removed)}},pathProperties:pf(t,s)}}(s,o,r,l);return{status:s,fill:h,stroke:c,hasMotion:(i?.changed??!0)||!gf(t.scales.x,e.scales.x)||!gf(t.scales.y,e.scales.y)||"updated"!==s}}(n,o,this.processedData?.reduced?.diff?.[this.id]);if(void 0===c)return e.skipCurrentBatch(),void h();"no-op"!==c.status&&(zf(this.id,"fill_path_properties",e,[r],c.fill.pathProperties),zf(this.id,"stroke_path_properties",e,[l],c.stroke.pathProperties),"added"===c.status?this.updateAreaPaths(a,n):"removed"===c.status?this.updateAreaPaths(a,o):(Gf(this.id,"fill_path_update",e,[r],c.fill.path),Gf(this.id,"stroke_path_update",e,[l],c.stroke.path)),c.hasMotion&&(Ff(this,e,void 0,i),Lf(this,"labels",e,s)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,n)}))}getFormattedMarkerStyle(t){const{xKey:e,yLowKey:i,yHighKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,t.datum,{xKey:e,yLowKey:i,yHighKey:s},!0)}computeFocusBounds(t){const e=Of(this,t),i=Of(this,{...t,datumIndex:t.datumIndex+1});if(e&&i)return Yf.merge([e,i])}isDatumEnabled(t,e){return e%2==0&&super.isDatumEnabled(t,e)}};Jf.className="RangeAreaSeries",Jf.type="range-area";var{commonSeriesOptionsDefs:tx,rangeAreaSeriesThemeableOptionsDef:ex}=s.n1,ix={...ex,...tx,type:(0,n.mw)((0,n.dY)("range-area")),xKey:(0,n.mw)(n.Yj),yLowKey:(0,n.mw)(n.Yj),yHighKey:(0,n.mw)(n.Yj),xName:n.Yj,yName:n.Yj,yLowName:n.Yj,yHighName:n.Yj};ix.pickOutsideVisibleMinorAxis=(0,n._L)(n.zM),ix.focusPriority=(0,n._L)(n.ai);var sx={series:{fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,stroke:{$palette:"stroke"},fillOpacity:.7,nodeClickRange:"nearest",marker:{enabled:!1,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,size:6,strokeWidth:2},label:{enabled:!1,placement:"outside",padding:10,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear"}},axes:{[s.n1.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:nx,CARTESIAN_POSITION:ax}}=s.n1,ox={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-area",moduleFactory:t=>new Jf(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:nx.NUMBER,position:ax.LEFT},{type:nx.CATEGORY,position:ax.BOTTOM}],themeTemplate:sx},rx={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,options:ix,create:t=>new Jf(t)},{AbstractBarSeriesProperties:lx,FillGradientDefaults:hx,FillPatternDefaults:cx,FillImageDefaults:dx,SeriesTooltip:ux,Property:px,DropShadow:gx,Label:mx}=s.n1,yx=class extends mx{constructor(){super(...arguments),this.placement="inside",this.padding=6}};r([px],yx.prototype,"placement",2),r([px],yx.prototype,"padding",2);var fx=class extends lx{constructor(){super(...arguments),this.fill="#99CCFF",this.fillGradientDefaults=new hx,this.fillPatternDefaults=new cx,this.fillImageDefaults=new dx,this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=(new gx).set({enabled:!1}),this.label=new yx,this.tooltip=new ux,this.fastDataProcessing=!1}};r([px],fx.prototype,"xKey",2),r([px],fx.prototype,"yLowKey",2),r([px],fx.prototype,"yHighKey",2),r([px],fx.prototype,"xName",2),r([px],fx.prototype,"yName",2),r([px],fx.prototype,"yLowName",2),r([px],fx.prototype,"yHighName",2),r([px],fx.prototype,"fill",2),r([px],fx.prototype,"fillGradientDefaults",2),r([px],fx.prototype,"fillPatternDefaults",2),r([px],fx.prototype,"fillImageDefaults",2),r([px],fx.prototype,"fillOpacity",2),r([px],fx.prototype,"stroke",2),r([px],fx.prototype,"strokeWidth",2),r([px],fx.prototype,"strokeOpacity",2),r([px],fx.prototype,"lineDash",2),r([px],fx.prototype,"lineDashOffset",2),r([px],fx.prototype,"cornerRadius",2),r([px],fx.prototype,"itemStyler",2),r([px],fx.prototype,"shadow",2),r([px],fx.prototype,"label",2),r([px],fx.prototype,"tooltip",2),r([px],fx.prototype,"fastDataProcessing",2);var{SeriesNodePickMode:xx,valueProperty:bx,keyProperty:vx,ChartAxisDirection:Sx,checkCrisp:Mx,updateLabelNode:kx,SMALLEST_KEY_INTERVAL:Dx,LARGEST_KEY_INTERVAL:wx,diff:Ix,prepareBarAnimationFunctions:Cx,midpointStartingBarPosition:Lx,resetBarSelectionsFn:Ax,fixNumericExtent:Tx,seriesLabelFadeInAnimation:Nx,resetLabelFn:Ox,animationValidation:Rx,computeBarFocusBounds:Ex,visibleRangeIndices:Px,createDatumId:Bx,ContinuousScale:Fx,DiscreteTimeScale:zx,Rect:Gx,PointerEvents:_x,motion:jx,applyShapeStyle:Wx,findMinMax:Vx,getShapeStyle:Kx,areScalingEqual:Yx}=s.n1,$x=class extends s.n1.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},Hx=class extends s.n1.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[xx.AXIS_ALIGNED,xx.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},directionNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:Ax,label:Ox}}),this.properties=new fx,this.dataAggregationFilters=void 0,this.NodeEvent=$x}async processData(t){const{xKey:e,yLowKey:i,yHighKey:s,fastDataProcessing:n}=this.properties,a=!n,o=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:h,yScaleType:c}=this.getScaleInformation({xScale:o,yScale:r}),d=[];this.ctx.animationManager.isSkipped()||(this.processedData&&d.push(Ix(this.id,this.processedData)),d.push(Rx()));const u=this.visible?{}:{forceValue:0},{dataModel:p,processedData:g}=await this.requestDataModel(t,this.data,{props:[vx(e,h,{id:"xValue"}),bx(i,c,{id:"yLowValue",invalidValue:null,...u}),bx(s,c,{id:"yHighValue",invalidValue:null,...u}),...l?[Dx,wx]:[],...d],groupByKeys:a});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.largestDataInterval=g.reduced?.largestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(t,e){if("grouped"!==e.type)return;const i=this.axes[Sx.X];if(null==i||!Fx.is(i.scale)&&!zx.is(i.scale))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"yHighValue",e),a=t.resolveColumnById(this,"yLowValue",e),{index:o}=t.resolveProcessedDataDefById(this,"xValue");return function(t,e,i,s){if(t.length<1e3)return;const[n,a]=Fg(s);let o=Bg(t,5),{indexData:r,valueData:l}=_g(t,e,i,n,a,o);const h=[{maxRange:o,indexData:r}];for(;o>64;)({indexData:r,valueData:l,maxRange:o}=jg(r,l,o)),h.push({maxRange:o,indexData:r});return h.reverse(),h}(s,n,a,e.domain.keys[o])}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{keys:[s]}=e.domain;if(t===this.getCategoryDirection()){const t=i.resolveProcessedDataDefById(this,"xValue");return"key"===t?.def.type&&"category"===t?.def.valueType?s:this.padBandExtent(s)}{const e=this.domainForClippedRange(t,["yHighValue","yLowValue"],"xValue",!0),i=Vx(e);return Tx(i)}}getSeriesRange(t,e){return this.domainForVisibleRange(Sx.Y,["yHighValue","yLowValue"],"xValue",e,!0)}createNodeData(){const{data:t,dataModel:e,groupScale:i,processedData:s,visible:n}=this,a=this.getCategoryAxis(),o=this.getValueAxis();if(!(t&&a&&o&&e&&s?.dataSources))return;const r=a.scale,l=o.scale,h=this.getBarDirection()===Sx.X,{xKey:c,yLowKey:d,yHighKey:u,strokeWidth:p}=this.properties,g=`${d}-${u}`,m={itemId:g,nodeData:[],labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};if(!n)return m;const y=s.dataSources.get(this.id)??[],f=e.resolveKeysById(this,"xValue",s),x=e.resolveColumnById(this,"yLowValue",s),b=e.resolveColumnById(this,"yHighValue",s),{barWidth:v,groupIndex:S}=this.updateGroupScale(a),M=Fx.is(r)?-.5*v:0,k=i.convert(String(S)),D=Mx(a?.scale,a?.visibleRange,this.smallestDataInterval,this.largestDataInterval),w=t=>Math.round(r.convert(f[t]))+k+M,I=(t,e,i,s,n,a,o)=>{const r=y[t],v=f[t];if(null==v)return;const S=x[t],M=b[t];if(!Number.isFinite(S?.valueOf())||!Number.isFinite(M?.valueOf()))return;const[k,D]=S<M?[S,M]:[M,S],w=Math.round(l.convert(a)),I=Math.round(l.convert(n)),C=Math.max(p,Math.abs(I-w)),L={x:h?Math.min(w,I):i,y:h?i:Math.min(w,I),width:h?C:s,height:h?s:C},A={x:L.x+L.width/2,y:L.y+L.height/2},T=this.createLabelData({datumIndex:t,rect:L,barAlongX:h,yLowValue:k,yHighValue:D,datum:r,series:this}),N={index:e,valueIndex:t,series:this,itemId:g,datum:r,datumIndex:t,xValue:v,yLowValue:S,yHighValue:M,yLowKey:d,yHighKey:u,xKey:c,x:L.x,y:L.y,width:L.width,height:L.height,midPoint:A,crisp:o,labels:T};m.nodeData.push(N),m.labelData.push(...T)},{dataAggregationFilters:C}=this,[L,A]=r.range,T=A-L,N=C?.find(t=>t.maxRange>T);if(null!=N){const{maxRange:t,indexData:e}=N,[i,s]=Px(t,a.range,t=>{const i=4*t,s=e[i+0],n=e[i+1];if(-1!==s)return[w((s+n)/2|0),w(n)+v]});for(let t=i;t<s;t+=1){const i=4*t,s=e[i+0],n=e[i+1],a=e[i+2],o=e[i+3];if(-1===s)continue;const r=(s+n)/2|0;null!=f[r]&&I(r,0,w(r),Math.abs(w(s)-w(n))+v,x[a],b[o],!1)}}else if("ungrouped"===s.type){let[t,e]=Px(y.length,a.range,t=>[w(t),v]);s.input.count<1e3&&(t=0,e=s.input.count);for(let i=t;i<e;i+=1)I(i,0,w(i),v,x[i],b[i],D)}else for(const{datumIndex:t,groupIndex:i}of e.forEachGroupDatum(this,s))I(t,i,w(t),v,x[t],b[t],D);return m}createLabelData({datumIndex:t,rect:e,barAlongX:i,yLowValue:s,yHighValue:n,datum:a,series:o}){const{xKey:r,yLowKey:l,yHighKey:h,xName:c,yLowName:d,yHighName:u,yName:p,label:g}=this.properties,m={datum:a,xKey:r,yLowKey:l,yHighKey:h,xName:c,yLowName:d,yHighName:u,yName:p},{placement:y,padding:f}=g,x=f*("outside"===y?1:-1),b={datumIndex:t,x:e.x+(i?-x:e.width/2),y:e.y+(i?e.height/2:e.height+x),textAlign:i?"left":"center",textBaseline:i?"middle":"bottom",text:this.getLabelText(g,{itemId:"low",value:s,...m}),itemId:"low",datum:a,series:o},v={datumIndex:t,x:e.x+(i?e.width+x:e.width/2),y:e.y+(i?e.height/2:-x),textAlign:i?"right":"center",textBaseline:i?"middle":"top",text:this.getLabelText(g,{itemId:"high",value:n,...m}),itemId:"high",datum:a,series:o};return"outside"===y&&(b.textAlign=i?"right":"center",b.textBaseline=i?"middle":"top",v.textAlign=i?"left":"center",v.textBaseline=i?"middle":"bottom"),[b,v]}nodeFactory(){return new Gx}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s,void 0,t=>this.getDatumId(t))}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i,fillGradientDefaults:s,fillPatternDefaults:n,fillImageDefaults:a}=e,o=t?e.highlightStyle.item:void 0;return Kx({fill:o?.fill??e.fill,fillOpacity:o?.fillOpacity??e.fillOpacity,stroke:o?.stroke??e.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:o?.strokeOpacity??e.strokeOpacity,lineDash:o?.lineDash??e.lineDash??[],lineDashOffset:o?.lineDashOffset??e.lineDashOffset,cornerRadius:i},s,n,a)}getItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{xKey:o,yHighKey:r,yLowKey:l,itemStyler:h,fillGradientDefaults:c,fillPatternDefaults:d,fillImageDefaults:u}=a;if(null==h)return;const p=this.cachedDatumCallback(Bx(t,s?"highlight":"node"),()=>this.callWithContext(h,{seriesId:n,datum:e,xKey:o,yHighKey:r,yLowKey:l,highlighted:s,...i}));return Kx(p,c,d,u)}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getCategoryDirection()===Sx.X,n=this.getItemBaseStyle(i),a=this.getShapeFillBBox();e.each((t,e)=>{const o=this.getItemStyleOverrides(String(e.datumIndex),e.datum,n,i);Wx(t,n,o,a),t.cornerRadius=o?.cornerRadius??n.cornerRadius,t.visible=s?e.width>0:e.height>0,t.crisp=e.crisp})}getHighlightLabelData(t,e){const i=t.filter(t=>t.datum===e.datum);return i.length>0?i:void 0}updateLabelSelection(t){const e=this.properties.label.enabled?t.labelData:[];return t.labelSelection.update(e,t=>{t.pointerEvents=_x.None})}updateLabelNodes(t){t.labelSelection.each((t,e)=>{kx(t,this.properties.label,e)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yName:r,yLowKey:l,yHighKey:h,yLowName:c,yHighName:d,tooltip:u}=n,p=this.getCategoryAxis(),g=this.getValueAxis();if(!(i&&s&&p&&g))return;const m=s.dataSources.get(this.id)?.[t],y=i.resolveKeysById(this,"xValue",s)[t],f=i.resolveColumnById(this,"yHighValue",s)[t],x=i.resolveColumnById(this,"yLowValue",s)[t];if(null==y)return;const b=this.getItemBaseStyle(!1);Object.assign(b,this.getItemStyleOverrides(String(t),m,b,!1));const v=`${g.formatDatum(x)} - ${g.formatDatum(f)}`;return this.formatTooltipWithContext(u,{heading:p.formatDatum(y),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${c??l} - ${d??h}`,value:v}]},{seriesId:e,datum:m,title:r,xKey:a,xName:o,yName:r,yLowKey:l,yHighKey:h,yLowName:c,yHighName:d,...b})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:a,lineDashOffset:o,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:h}=this.properties;return{marker:Kx({fill:t,stroke:e,fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:a,lineDashOffset:o},r,l,h)}}getLegendData(t){if("category"!==t)return[];const{id:e,visible:i}=this,{yName:s,yLowName:n,yHighName:a,yLowKey:o,yHighKey:r,showInLegend:l}=this.properties;return[{legendType:"category",id:e,itemId:`${o}-${r}`,seriesId:e,enabled:i,label:{text:`${s??`${n??o} - ${a??r}`}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=Cx(Lx(this.isVertical(),"normal"));jx.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],i),Nx(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:n,previousContextData:a}=t,o=s.n1.calculateDataDiff(this.id,e,this.getDatumId.bind(this),n,a,this.processedData);this.ctx.animationManager.stopByAnimationGroupId(this.id);const r=null==a?"fade":"normal",l=Cx(Lx(this.isVertical(),r));jx.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],l,(t,e)=>this.getDatumId(e),o),!o?.changed&&Yx(n.groupScale,a?.groupScale)||Nx(this,"labels",this.ctx.animationManager,i)}getDatumId(t){return`${t.xValue}-${t.valueIndex}`}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:t}){return Ex(this,this.contextNodeData?.nodeData[t])}};Hx.className="RangeBarSeries",Hx.type="range-bar";var{commonSeriesOptionsDefs:Ux,rangeBarSeriesThemeableOptionsDef:Xx}=s.n1,Zx={...Xx,...Ux,type:(0,n.mw)((0,n.dY)("range-bar")),xKey:(0,n.mw)(n.Yj),yLowKey:(0,n.mw)(n.Yj),yHighKey:(0,n.mw)(n.Yj),xName:n.Yj,yName:n.Yj,yLowName:n.Yj,yHighName:n.Yj};Zx.pickOutsideVisibleMinorAxis=(0,n._L)(n.zM),Zx.fastDataProcessing=(0,n._L)(n.zM),Zx.focusPriority=(0,n._L)(n.ai);var qx={series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},placement:"inside"}},axes:{[s.n1.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},Qx={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-bar",moduleFactory:t=>new Hx(t),tooltipDefaults:{range:"exact"},defaultAxes:s.n1.DIRECTION_SWAP_AXES,themeTemplate:qx,groupable:!0},Jx={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,options:Zx,create:t=>new Hx(t)},{AbstractBarSeriesProperties:tb,BaseProperties:eb,FillGradientDefaults:ib,FillPatternDefaults:sb,FillImageDefaults:nb,PropertiesArray:ab,SeriesTooltip:ob,Property:rb,DropShadow:lb,Label:hb}=s.n1,cb=class extends eb{};r([rb],cb.prototype,"totalType",2),r([rb],cb.prototype,"index",2),r([rb],cb.prototype,"axisLabel",2);var db=class extends eb{};r([rb],db.prototype,"renderer",2);var ub=class extends hb{constructor(){super(...arguments),this.placement="outside-end",this.padding=6}};r([rb],ub.prototype,"placement",2),r([rb],ub.prototype,"padding",2);var pb=class extends eb{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new ib,this.fillPatternDefaults=new sb,this.fillImageDefaults=new nb,this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=(new lb).set({enabled:!1}),this.label=new ub,this.tooltip=new db}};r([rb],pb.prototype,"name",2),r([rb],pb.prototype,"fill",2),r([rb],pb.prototype,"fillGradientDefaults",2),r([rb],pb.prototype,"fillPatternDefaults",2),r([rb],pb.prototype,"fillImageDefaults",2),r([rb],pb.prototype,"stroke",2),r([rb],pb.prototype,"fillOpacity",2),r([rb],pb.prototype,"strokeOpacity",2),r([rb],pb.prototype,"lineDash",2),r([rb],pb.prototype,"lineDashOffset",2),r([rb],pb.prototype,"strokeWidth",2),r([rb],pb.prototype,"cornerRadius",2),r([rb],pb.prototype,"itemStyler",2),r([rb],pb.prototype,"shadow",2),r([rb],pb.prototype,"label",2),r([rb],pb.prototype,"tooltip",2);var gb=class extends eb{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};r([rb],gb.prototype,"enabled",2),r([rb],gb.prototype,"stroke",2),r([rb],gb.prototype,"strokeOpacity",2),r([rb],gb.prototype,"lineDash",2),r([rb],gb.prototype,"lineDashOffset",2),r([rb],gb.prototype,"strokeWidth",2);var mb=class extends eb{constructor(){super(...arguments),this.positive=new pb,this.negative=new pb,this.total=new pb}};r([rb],mb.prototype,"positive",2),r([rb],mb.prototype,"negative",2),r([rb],mb.prototype,"total",2);var yb=class extends tb{constructor(){super(...arguments),this.item=new mb,this.totals=new ab(cb),this.line=new gb,this.tooltip=new ob}};r([rb],yb.prototype,"xKey",2),r([rb],yb.prototype,"yKey",2),r([rb],yb.prototype,"xName",2),r([rb],yb.prototype,"yName",2),r([rb],yb.prototype,"item",2),r([rb],yb.prototype,"totals",2),r([rb],yb.prototype,"line",2),r([rb],yb.prototype,"tooltip",2);var{adjustLabelPlacement:fb,SeriesNodePickMode:xb,fixNumericExtent:bb,valueProperty:vb,keyProperty:Sb,accumulativeValueProperty:Mb,trailingAccumulatedValueProperty:kb,ChartAxisDirection:Db,createDatumId:wb,checkCrisp:Ib,updateLabelNode:Cb,prepareBarAnimationFunctions:Lb,collapsedStartingBarPosition:Ab,resetBarSelectionsFn:Tb,seriesLabelFadeInAnimation:Nb,resetLabelFn:Ob,animationValidation:Rb,DEFAULT_CARTESIAN_DIRECTION_KEYS:Eb,DEFAULT_CARTESIAN_DIRECTION_NAMES:Pb,computeBarFocusBounds:Bb,isContinuous:Fb,Rect:zb,motion:Gb,applyShapeStyle:_b,getShapeStyle:jb}=s.n1,Wb=class extends s.n1.AbstractBarSeries{constructor(t){super({moduleCtx:t,directionKeys:Eb,directionNames:Pb,categoryKey:void 0,pickModes:[xb.NEAREST_NODE,xb.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],hasHighlightedLabels:!0,pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:Tb,label:Ob}}),this.properties=new yb,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(t){const{xKey:e,yKey:i,totals:n}=this.properties,{data:a=[]}=this;if(!this.visible)return;const o={missingValue:void 0,invalidValue:void 0},r=[],l=n.reduce((t,e)=>{const i=t.get(e.index);return i?i.push(e):t.set(e.index,[e]),t},new Map);a.forEach((t,i)=>{r.push(t),l.get(i)?.forEach(t=>r.push({...t.toJson(),[e]:t.axisLabel}))});const h=[];this.ctx.animationManager.isSkipped()||h.push(Rb());const c=this.getCategoryAxis()?.scale,d=this.getValueAxis()?.scale,{isContinuousX:u,xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:c,yScale:d}),{processedData:m}=await this.requestDataModel(t,r,{props:[Sb(e,p,{id:"xValue"}),Mb(i,g,{...o,id:"yCurrent"}),Mb(i,g,{...o,missingValue:0,id:"yCurrentTotal"}),Mb(i,g,{...o,id:"yCurrentPositive",validation:t=>Fb(t)&&Number(t)>=0}),Mb(i,g,{...o,id:"yCurrentNegative",validation:t=>Fb(t)&&Number(t)>=0}),kb(i,g,{...o,id:"yPrevious"}),vb(i,g,{id:"yRaw"}),vb("totalType","band",{id:"totalTypeValue",missingValue:void 0,validation:t=>"total"===t||"subtotal"===t}),...u?[s.n1.SMALLEST_KEY_INTERVAL,s.n1.LARGEST_KEY_INTERVAL]:[],...h]});this.smallestDataInterval=m.reduced?.smallestKeyInterval,this.largestDataInterval=m.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{keys:[s],values:n}=e.domain;if(t===this.getCategoryDirection()){const e=i.resolveProcessedDataDefById(this,"xValue");if("key"===e?.def.type&&"category"===e?.def.valueType)return s;const n=t===Db.Y,a=this.getCategoryAxis().isReversed();return this.padBandExtent(s,a!==n)}{const t=n[i.resolveProcessedDataIndexById(this,"yCurrent")],e=[Math.min(0,t[0]),Math.max(0,t[1])];return bb(e)}}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{data:t,dataModel:e,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!(t&&s&&n&&e&&i))return;const{line:a}=this.properties,o=s.scale,r=n.scale,l=this.getBarDirection()===Db.X,h=this.getBandwidth(s)??10,c=s.isReversed(),d=n.isReversed();if("ungrouped"!==i.type)return;const u={itemId:this.properties.yKey,nodeData:[],labelData:[],pointData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};if(!this.visible)return u;const p=[],g=e.resolveKeysById(this,"xValue",i),m=e.resolveColumnById(this,"yRaw",i),y=e.resolveColumnById(this,"totalTypeValue",i),f=e.resolveColumnById(this,"yCurrent",i),x=e.resolveColumnById(this,"yPrevious",i),b=e.resolveColumnById(this,"yCurrentTotal",i),v=Ib(s?.scale,s?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let S=0;const{xKey:M,yKey:k,xName:D,yName:w}=this.properties;(i.dataSources.get(this.id)??[]).forEach((t,e)=>{const i=y[e],s=this.isSubtotal(i),n=this.isTotal(i),I=n||s,C=g[e];if(null==C)return;const L=Math.round(o.convert(C)),A=m[e],{cumulativeValue:T,trailingValue:N}=function(t,e,i){return t||e?{cumulativeValue:b[i],trailingValue:e?S:0}:{cumulativeValue:f[i],trailingValue:x[i]}}(n,s,e);I&&(S=T??0);const O=Math.round(r.convert(T)),R=Math.round(r.convert(N)),E=function(t,e,i,s,n){return t?s:e?(s??0)-(n??0):i}(n,s,A,T,N),P=(E??0)>=0,B=this.getSeriesItemType(P,i),{strokeWidth:F,label:z}=this.getItemConfig(B),G=P?O:R,_=P?R:O,j=Math.max(F,Math.abs(_-G)),W={x:l?Math.min(G,_):L,y:l?L:Math.min(G,_),width:l?j:h,height:l?h:j},V={x:W.x+W.width/2,y:W.y+W.height/2},K=I?O:R,Y=Math.floor(a.strokeWidth)%2/2,$=c?O:K,H=c?K:O;let U,X;l?(U={x:$+Y,y:W.y},X={x:H+Y,y:W.y+W.height}):(U={x:W.x,y:$+Y},X={x:W.x+W.width,y:H+Y});const Z={x:c?X.x:U.x,y:c?X.y:U.y,x2:c?U.x:X.x,y2:c?U.y:X.y,size:0};p.push(Z);const q="subtotal"===B?"total":B,Q=this.getLabelText(z,{itemId:q,value:E,datum:t,xKey:M,yKey:k,xName:D,yName:w}),J={index:e,series:this,itemId:B,datum:t,datumIndex:e,cumulativeValue:T??0,xValue:C,yValue:E,yKey:k,xKey:M,x:W.x,y:W.y,width:W.width,height:W.height,midPoint:V,crisp:v,label:{text:Q,...fb({isUpward:(E??-1)>=0!==d,isVertical:!l,placement:z.placement,padding:z.padding,rect:W})}};u.nodeData.push(J),u.labelData.push(J)});const I=this.properties.line.enabled;return null!=f&&I&&(u.pointData=p),u}updateSeriesItemTypes(){const{dataModel:t,seriesItemTypes:e,processedData:i}=this;if(!t||!i)return;e.clear();const s=t.resolveProcessedDataIndexById(this,"yCurrentPositive"),n=t.resolveProcessedDataIndexById(this,"yCurrentNegative"),a=t.resolveProcessedDataIndexById(this,"totalTypeValue"),o=i.domain.values[s]??[],r=i.domain.values[n]??[];o.length>0&&e.add("positive"),r.length>0&&e.add("negative");const l=i?.domain.values[a];l&&l.forEach(t=>{"total"!==t&&"subtotal"!==t||e.add("total")})}isSubtotal(t){return"subtotal"===t}isTotal(t){return"total"===t}nodeFactory(){return new zb}getSeriesItemType(t,e){return e??(t?"positive":"negative")}getItemConfig(t){switch(t){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s)}getItemStyle(t,e,i,s){const{id:n,properties:a}=this,o=a.item["subtotal"===i?"total":i],r=s?a.highlightStyle.item:void 0,{itemStyler:l,fillGradientDefaults:h,fillPatternDefaults:c,fillImageDefaults:d}=o,{xKey:u,yKey:p}=a,g=jb({fill:r?.fill??o.fill,fillOpacity:r?.fillOpacity??o.fillOpacity,stroke:r?.stroke??o.stroke,strokeWidth:r?.strokeWidth??o.strokeWidth,strokeOpacity:r?.strokeOpacity??o.strokeOpacity,lineDash:r?.lineDash??o.lineDash??[],lineDashOffset:r?.lineDashOffset??o.lineDashOffset,cornerRadius:o.cornerRadius},h,c,d);if(null!=l){let a=this.cachedDatumCallback(wb(t,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:n,itemId:i,datum:e,xKey:u,yKey:p,highlighted:s,...g}));a=jb(a,h,c,d),Object.assign(g,a)}return g}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getCategoryDirection()===Db.X,n=this.getShapeFillBBox();e.each((t,e)=>{const a=e.itemId,o=this.getItemStyle(String(e.datumIndex),e.datum,a,i);_b(t,o,void 0,n),t.visible=s?e.width>0:e.height>0,t.crisp=e.crisp})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;if(0===e.length)return i.update([]);const s=e.filter(t=>{const{label:e}=this.getItemConfig(t.itemId);return e.enabled});return i.update(s)}updateLabelNodes(t){t.labelSelection.each((t,e)=>{Cb(t,this.getItemConfig(e.itemId).label,e.label)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:a,xName:o,yKey:r,yName:l,tooltip:h}=n,c=this.getCategoryAxis(),d=this.getValueAxis();if(!(i&&s&&c&&d))return;const u=s.dataSources.get(this.id)?.[t],p=i.resolveKeysById(this,"xValue",s)[t],g=i.resolveColumnById(this,"yRaw",s)[t],m=i.resolveColumnById(this,"yCurrentTotal",s),y=i.resolveColumnById(this,"totalTypeValue",s);if(null==p)return;const f=y[t],x=(g??0)>=0,b=this.getSeriesItemType(x,f);let v;if(this.isTotal(f))v=m[t];else if(this.isSubtotal(f)){v=m[t];for(let e=t-1;e>=0;e-=1)if(this.isSubtotal(y[e])){v-=m[e];break}}else v=g;const S=this.getItemStyle(String(t),u,b,!1);return this.formatTooltipWithContext(h,{heading:c.formatDatum(p),symbol:this.legendItemSymbol(b),data:[{label:l,fallbackLabel:r,value:d.formatDatum(v)}]},{seriesId:e,datum:u,title:l,itemId:b,xKey:a,xName:o,yKey:r,yName:l,...S})}legendItemSymbol(t){const{fill:e,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r,fillGradientDefaults:l,fillPatternDefaults:h,fillImageDefaults:c}=this.getItemConfig(t);return{marker:jb({fill:e,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r},l,h,c)}}getLegendData(t){if("category"!==t)return[];const{id:e,seriesItemTypes:i}=this,s=[],{showInLegend:n}=this.properties;return i.forEach(t=>{const{name:i}=this.getItemConfig(t);var a;s.push({legendType:"category",id:e,itemId:t,seriesId:e,enabled:!0,label:{text:i??(a=t,a.charAt(0).toUpperCase()+a.substring(1))},symbol:this.legendItemSymbol(t),hideInLegend:!n,isFixed:!0})}),s}toggleSeriesItem(){}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:s}=t,n=Lb(Ab(this.isVertical(),this.axes,"normal"));Gb.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],n),Nb(this,"labels",this.ctx.animationManager,i);const{pointData:a}=s;a&&(this.isVertical()?this.animateConnectorLinesVertical(t):this.animateConnectorLinesHorizontal(t))}animateConnectorLinesHorizontal(t){const{pointData:e=[]}=t.contextData,[i]=t.paths,{path:n}=i;this.updateLineNode(i);const a=this.getValueAxis(),o=a?.isReversed(),r=o?(t,e)=>t<e:(t,e)=>t>e,l=a?.scale.convert(0),h=e.reduce((t,e)=>(r(e.x,t)&&(t=e.x),t),o?1/0:0),c=(t,e,i,s,n)=>(t-e)/(i-e)*(n-s)+s;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:l,to:h,ease:s.n1.Motion.easeOut,collapsable:!1,onUpdate(t){n.clear(!0),e.forEach((e,i)=>{const s=c(t,l,h,l,e.x),a=c(t,l,h,l,e.x2);0!==i&&n.lineTo(s,e.y),n.moveTo(a,e.y2)}),i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(t)})}animateConnectorLinesVertical(t){const{pointData:e=[]}=t.contextData,[i]=t.paths,{path:n}=i;this.updateLineNode(i);const a=this.getValueAxis(),o=a?.isReversed(),r=o?(t,e)=>t>e:(t,e)=>t<e,l=a?.scale.convert(0),h=e.reduce((t,e)=>(r(e.y,t)&&(t=e.y),t),o?0:1/0),c=(t,e,i,s,n)=>(t-e)/(i-e)*(n-s)+s;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:l,to:h,ease:s.n1.Motion.easeOut,collapsable:!1,onUpdate(t){n.clear(!0),e.forEach((e,i)=>{const s=c(t,l,h,l,e.y),a=c(t,l,h,l,e.y2);0!==i&&n.lineTo(e.x,s),n.moveTo(e.x2,a)}),i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(t)})}animateReadyResize(t){super.animateReadyResize(t),this.resetConnectorLinesPath(t)}updatePaths(t){this.resetConnectorLinesPath({contextData:t.contextData,paths:t.paths})}resetConnectorLinesPath({contextData:t,paths:e}){if(0===e.length)return;const[i]=e;this.updateLineNode(i);const{path:s}=i;s.clear(!0);const{pointData:n}=t;n&&(n.forEach((t,e)=>{0!==e&&s.lineTo(t.x,t.y),s.moveTo(t.x2,t.y2)}),i.checkPathDirty())}updateLineNode(t){const{stroke:e,strokeWidth:i,strokeOpacity:n,lineDash:a,lineDashOffset:o}=this.properties.line;t.setProperties({fill:void 0,stroke:e,strokeWidth:this.getStrokeWidth(i),strokeOpacity:n,lineDash:a,lineDashOffset:o,lineJoin:"round",pointerEvents:s.n1.PointerEvents.None})}isLabelEnabled(){const{positive:t,negative:e,total:i}=this.properties.item;return t.label.enabled||e.label.enabled||i.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:t}){return Bb(this,this.contextNodeData?.nodeData[t])}};Wb.className="WaterfallSeries",Wb.type="waterfall";var{commonSeriesOptionsDefs:Vb,waterfallSeriesThemeableOptionsDef:Kb}=s.n1,Yb={...Kb,...Vb,type:(0,n.mw)((0,n.dY)("waterfall")),xKey:(0,n.mw)(n.Yj),yKey:(0,n.mw)(n.Yj),xName:n.Yj,yName:n.Yj,totals:(0,n.J$)({totalType:(0,n.mw)((0,n.KC)("total","subtotal")),index:(0,n.mw)(n.Ly),axisLabel:(0,n.mw)(n.Yj)},"a total definition options array")};function $b(t,e){return{fill:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`./${e}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${t}.fill`}]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$if:[{$or:[{$isGradient:[{$palette:`${t}.fill`}]},{$isPattern:[{$palette:`${t}.fill`}]},{$isImage:[{$palette:`${t}.fill`}]}]},{$map:[{$path:["./color",void 0,{$value:"$1"}]},{$path:["./colorStops",void 0,{$palette:`${t}.fill`}]}]},[{$mix:[{$palette:`${t}.fill`},"black",.15]},{$mix:[{$palette:`${t}.fill`},"white",.15]}]]},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,stroke:{$palette:`${t}.stroke`},strokeWidth:0,label:{enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end"}}}var Hb={series:{item:{positive:$b("altUp",0),negative:$b("altDown",1),total:$b("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2}},legend:{enabled:!0,toggleSeries:!1}},Ub={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"waterfall",solo:!0,moduleFactory:t=>new Wb(t),tooltipDefaults:{range:"exact"},defaultAxes:s.n1.DIRECTION_SWAP_AXES,themeTemplate:Hb},Xb={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,options:Yb,create:t=>new Wb(t)},{NewAreaSeriesModule:Zb,NewBarSeriesModule:qb,NewBubbleSeriesModule:Qb,NewHistogramSeriesModule:Jb,NewLineSeriesModule:tv,NewScatterSeriesModule:ev,numberFormatValidator:iv,without:sv}=s.n1,nv={width:n.Ly,height:n.Ly,grip:n.zM,fill:n.yW,stroke:n.yW,strokeWidth:n.Ly,cornerRadius:n.Ly},av=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],ov={enabled:n.zM,height:n.Ly,spacing:n.Ly,cornerRadius:n.ai,mask:{fill:n.yW,fillOpacity:n.CG,stroke:n.yW,strokeWidth:n.Ly},minHandle:nv,maxHandle:nv,miniChart:{enabled:n.zM,padding:{top:n.Ly,bottom:n.Ly},label:{enabled:n.zM,avoidCollisions:n.zM,spacing:n.Ly,format:iv,formatter:n.E2,interval:{minSpacing:n.Ly,maxSpacing:n.Ly,values:n.YO,step:n.ai},...n.LV},series:(0,n.J$)((0,n.is)({area:sv(Zb.options,av),bar:sv(qb.options,[...av,"errorBar","label","legendItemName","direction"]),"box-plot":sv(Eg.options,[...av,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"]),bubble:sv(Qb.options,[...av,"title","label","labelKey","labelName","sizeName"]),candlestick:sv(Zm.options,av),heatmap:sv(Fy.options,[...av,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"]),histogram:sv(Jb.options,[...av,"label"]),line:sv(tv.options,[...av,"errorBar","title","label"]),ohlc:sv($y.options,av),"range-area":sv(rx.options,[...av,"label","yLowName","yHighName"]),"range-bar":sv(Jx.options,[...av,"direction","label","yLowName","yHighName"]),scatter:sv(ev.options,[...av,"errorBar","title","label","labelKey","labelName"]),waterfall:sv(Xb.options,[...av,"direction"])},"miniChart series options"))}},{annotationOptionsDef:rv}=s.n1,lv={type:"plugin",name:"annotations",chartType:"cartesian",options:rv,create:()=>null},hv={type:"plugin",name:"navigator",chartType:"cartesian",options:ov,create:()=>null},cv={type:"plugin",name:"initialState",options:Yp,create:()=>null};function dv(t,e,i){i||(e=function(t){const e=new Set;for(const i of t)uv(t,i,e,[]);return 0!==e.size&&n.Vy.warnOnce("Some links formed circular references. These will be removed from the output."),0===e.size?t:t.filter(t=>!e.has(t))}(e));const s=new Map;for(const e of t)s.set(e.id,{datum:e,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let a=0;return s.forEach((t,i)=>{a=Math.max(a,pv(s,e,t,i,-1,[])+pv(s,e,t,i,1,[])+1)}),{links:e,nodeGraph:s,maxPathLength:a}}function uv(t,e,i,s){const n=s.indexOf(e);if(-1!==n){for(let t=n;t<s.length;t+=1)i.add(s[t]);return}s.push(e);const{toNode:a}=e;for(const e of t)e.fromNode===a&&uv(t,e,i,s);s.pop()}function pv(t,e,i,s,n,a){if(a.includes(s))return 1/0;let o=-1===n?i.maxPathLengthBefore:i.maxPathLengthAfter;if(-1===o){o=0;const r=-1===n?i.linksBefore:i.linksAfter;for(const i of e){const{fromNode:l,toNode:h}=i,c=-1===n?h.id:l.id,d=-1===n?l.id:h.id,u=s===c?t.get(d):void 0;null!=u&&(r.push({node:u,link:i}),a?.push(s),o=Math.max(o,pv(t,e,u,d,n,a)+1),a?.pop())}-1===n?i.maxPathLengthBefore=o:i.maxPathLengthAfter=o}return o}var{Series:gv,DataController:mv,keyProperty:yv,valueProperty:fv,Selection:xv,Group:bv,TransformableText:vv}=s.n1,Sv=class extends s.n1.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s);const{datumIndex:n}=i,a=s.contextNodeData?.nodeData.find(t=>t.datumIndex.type===n.type&&t.datumIndex.index===n.index);this.size=a?.size,this.label=1===a?.type?a?.label:void 0}},Mv=class extends gv{constructor(){super(...arguments),this.NodeEvent=Sv,this._chartNodes=void 0,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new bv({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new bv({name:"nodeGroup"})),this.focusLinkGroup=this.highlightNode.appendChild(new bv({name:"linkGroup"})),this.focusNodeGroup=this.highlightNode.appendChild(new bv({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightNode.appendChild(new bv({name:"linkGroup"})),this.highlightNodeGroup=this.highlightNode.appendChild(new bv({name:"nodeGroup"})),this.labelSelection=xv.select(this.labelGroup,vv),this.linkSelection=xv.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=xv.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=xv.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=xv.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=xv.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=xv.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes??this._chartNodes}setChartNodes(t){this._chartNodes=t,this.nodes===t&&(this.nodeDataRefresh=!0)}async processData(t){const{data:e,nodes:i}=this;if(null==e)return;const{fromKey:s,toKey:n,sizeKey:a,idKey:o,labelKey:r}=this.properties,l=new mv("standalone",t.suppressFieldDotNotation),h=null!=i?l.request(this.id,i,{props:[yv(o,void 0,{id:"idValue",includeProperty:!1}),...null!=r?[fv(r,void 0,{id:"labelValue",includeProperty:!1})]:[]],groupByKeys:!0}):null,c=t.request(this.id,e,{props:[fv(s,void 0,{id:"fromValue",includeProperty:!1}),fv(n,void 0,{id:"toValue",includeProperty:!1}),...null!=a?[fv(a,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]:[]],groupByKeys:!1});null!=i&&l.execute();const[d,u]=await Promise.all([h,c]);this.nodesDataModel=d?.dataModel,this.nodesProcessedData=d?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const p=new Map;if(null==d){const t=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),e=u.dataModel.resolveColumnById(this,"toValue",u.processedData),i=t=>{const e=p.size;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:e},type:1,index:e,linksBefore:[],linksAfter:[],id:t,size:0,label:t}};u.processedData.dataSources.get(this.id)?.forEach((s,n)=>{const a=t[n],o=e[n];null!=a&&null!=o&&(p.has(a)||p.set(a,i(a)),p.has(o)||p.set(o,i(o)))})}else{const t=d.dataModel.resolveColumnById(this,"idValue",d.processedData),e=null!=r?d.dataModel.resolveColumnById(this,"labelValue",d.processedData):void 0;d.processedData.dataSources.get(this.id)?.forEach((i,s)=>{const n=t[s],a=e?.[s];p.set(n,{series:this,itemId:void 0,datum:i,datumIndex:{type:1,index:s},type:1,index:s,linksBefore:[],linksAfter:[],id:n,size:0,label:a})})}this.processedNodes=p}getNodeGraph(t,e,{includeCircularReferences:i}){const{linksDataModel:s,linksProcessedData:n}=this;if(null==s||null==n){const{links:t,nodeGraph:e,maxPathLength:s}=dv((new Map).values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:e,links:t,maxPathLength:s}}const{sizeKey:a}=this.properties,o=s.resolveColumnById(this,"fromValue",n),r=s.resolveColumnById(this,"toValue",n),l=null!=a?s.resolveColumnById(this,"sizeValue",n):void 0,h=new Map;this.processedNodes.forEach(e=>{const i=t(e);h.set(e.id,i)});const c=[];n.dataSources.get(this.id)?.forEach((t,i)=>{const s=o[i],n=r[i],a=null!=l?l[i]:1,d=h.get(s),u=h.get(n);if(a<=0||null==d||null==u)return;const p=e({series:this,itemId:void 0,datum:t,datumIndex:{type:0,index:i},type:0,index:i,fromNode:d,toNode:u,size:a});c.push(p)});const{links:d,nodeGraph:u,maxPathLength:p}=dv(h.values(),c,i);return u.forEach(t=>{t.datum.linksBefore=t.linksBefore.map(t=>t.link),t.datum.linksAfter=t.linksAfter.map(t=>t.link)}),this.nodeCount=u.size,this.linkCount=d.length,{nodeGraph:u,links:d,maxPathLength:p}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(t){const{seriesRect:e}=t,i={seriesRectWidth:e?.width??0,seriesRectHeight:e?.height??0};null!=this._nodeDataDependencies&&this._nodeDataDependencies.seriesRectWidth===i.seriesRectWidth&&this._nodeDataDependencies.seriesRectHeight===i.seriesRectHeight||(this._nodeDataDependencies=i),this.updateSelections();const s=this.contextNodeData?.nodeData??[],n=this.contextNodeData?.labelData??[];let a,o,r,l,h=this.ctx.highlightManager?.getActiveHighlight();if(h?.series===this&&null==h.type){const{itemId:t}=h;h=null!=t?s.find(e=>1===e.type&&e.id===t):void 0}else h?.series!==this&&(h=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=null!=h?this.properties.highlightStyle.series.dimOpacity??1:1,this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:s.filter(t=>0===t.type),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:s.filter(t=>1===t.type),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1}),1===h?.type?(a=s.filter(t=>0===t.type&&(t.toNode===h||t.fromNode===h)),o=a.map(t=>t.fromNode===h?t.toNode:t.fromNode),o.push(h),r=[],l=[h]):0===h?.type?(a=[h],o=[h.fromNode,h.toNode],r=[h],l=[]):(a=[],o=[],r=[],l=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:a,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:o,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:r,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:l,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}resetAnimation(t){}getSeriesDomain(t){return[]}getSeriesRange(t,e){return[NaN,NaN]}legendItemSymbol(t,e,i={}){const{fills:s,strokes:n}=this.properties,{fill:a=s[e%s.length],fillOpacity:o=1,stroke:r=n[e%n.length],strokeWidth:l=0,strokeOpacity:h=1,lineDash:c=[0],lineDashOffset:d=0}=i;return{marker:{fill:a,fillOpacity:o,stroke:r,strokeWidth:l,strokeOpacity:h,lineDash:c,lineDashOffset:d}}}getLegendData(t){if("category"!==t)return[];const{showInLegend:e}=this.properties;return Array.from(this.processedNodes.values(),({id:t,label:i},s)=>({legendType:"category",id:this.id,itemId:t,seriesId:this.id,enabled:!0,label:{text:i??t},symbol:this.legendItemSymbol(1,s),hideInLegend:!e,isFixed:!0}))}pickNodeClosestDatum({x:t,y:e}){let i,s=1/0;return this.linkSelection.each((n,a)=>{const o=n.containsPoint(t,e)?0:1/0;o<s&&(s=o,i=a)}),this.nodeSelection.each((n,a)=>{const o=n.distanceSquared(t,e);o<s&&(s=o,i=a)}),null!=i?{datum:i,distance:Math.sqrt(s)}:void 0}getDatumAriaText(t,e){return 0===t.type?this.ctx.localeManager.t("ariaAnnounceFlowProportionLink",{index:t.index+1,count:this.linkCount,from:t.fromNode.id,to:t.toNode.id,size:t.size,sizeName:this.properties.sizeName??this.properties.sizeKey}):1===t.type?this.ctx.localeManager.t("ariaAnnounceFlowProportionNode",{index:t.index+1,count:this.nodeCount,description:e}):void 0}pickFocus(t){const{datumIndexDelta:e,otherIndexDelta:i}=t,s=this.contextNodeData?.nodeData[t.datumIndex-t.datumIndexDelta];let n=s;if(0!==i||0===e)return;if(0===s?.type){const t=Array.from(this.linkSelection,t=>t.datum),i=t.indexOf(s)+e;if(i>=0&&i<t.length)n=t[i];else if(i>0)n=t[t.length-1];else{const t=Array.from(this.nodeSelection,t=>t.datum);n=t[t.length-1]}}else if(1===s?.type){const t=Array.from(this.nodeSelection,t=>t.datum),i=t.indexOf(s)+e;if(i>=0&&i<t.length)n=t[i];else if(i<0)n=t[0];else{const t=Array.from(this.linkSelection,t=>t.datum);n=t[0]}}if(null==n)return;const a=1===n.type?Array.from(this.nodeSelection).find(t=>t.datum===n):Array.from(this.linkSelection).find(t=>t.datum===n);if(null==a)return;const o=this.computeFocusBounds(a.node);return null!=o?{datum:a.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(a.datum)??0,otherIndex:0,bounds:o,clipFocusBox:!0}:void 0}getCategoryValue(t){}datumIndexForCategoryValue(t){}},{Path:kv,SceneChangeDetection:Dv}=s.n1;function wv({radius:t,startAngle:e,endAngle:i,tension:s}){const n=t*Math.cos(e),a=t*Math.sin(e),o=t*Math.cos(i),r=t*Math.sin(i);return{x:[n,n*s,o*s,o],y:[a,a*s,r*s,r]}}var Iv=class extends kv{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}tensionedCurveTo(t,e,i,s,n,a,o,r){const{path:l,tension:h}=this,c=1-h;l.cubicCurveTo((i-t)*c+t,(s-e)*c+e,(n-o)*c+o,(a-r)*c+r,o,r)}updatePath(){const{path:t,centerX:e,centerY:i,radius:s}=this;let{startAngle1:n,endAngle1:a,startAngle2:o,endAngle2:r}=this;n>o&&([n,o]=[o,n],[a,r]=[r,a]),t.clear();const l=e+s*Math.cos(n),h=i+s*Math.sin(n);t.moveTo(l,h),this.tensionedCurveTo(l,h,e,i,e,i,e+s*Math.cos(r),i+s*Math.sin(r)),t.arc(e,i,s,r,o,!0),this.tensionedCurveTo(e+s*Math.cos(o),i+s*Math.sin(o),e,i,e,i,e+s*Math.cos(a),i+s*Math.sin(a)),t.arc(e,i,s,a,n,!0),t.closePath()}};r([Dv()],Iv.prototype,"centerX",2),r([Dv()],Iv.prototype,"centerY",2),r([Dv()],Iv.prototype,"radius",2),r([Dv()],Iv.prototype,"startAngle1",2),r([Dv()],Iv.prototype,"endAngle1",2),r([Dv()],Iv.prototype,"startAngle2",2),r([Dv()],Iv.prototype,"endAngle2",2),r([Dv()],Iv.prototype,"tension",2);var{FillGradientDefaults:Cv,FillPatternDefaults:Lv,FillImageDefaults:Av,BaseProperties:Tv,SeriesTooltip:Nv,SeriesProperties:Ov,Property:Rv,Label:Ev}=s.n1,Pv=class extends Ev{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};r([Rv],Pv.prototype,"spacing",2),r([Rv],Pv.prototype,"maxWidth",2);var Bv=class extends Tv{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}};r([Rv],Bv.prototype,"fill",2),r([Rv],Bv.prototype,"fillOpacity",2),r([Rv],Bv.prototype,"stroke",2),r([Rv],Bv.prototype,"strokeOpacity",2),r([Rv],Bv.prototype,"strokeWidth",2),r([Rv],Bv.prototype,"lineDash",2),r([Rv],Bv.prototype,"lineDashOffset",2),r([Rv],Bv.prototype,"tension",2),r([Rv],Bv.prototype,"itemStyler",2);var Fv=class extends Tv{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};r([Rv],Fv.prototype,"spacing",2),r([Rv],Fv.prototype,"width",2),r([Rv],Fv.prototype,"fill",2),r([Rv],Fv.prototype,"fillOpacity",2),r([Rv],Fv.prototype,"stroke",2),r([Rv],Fv.prototype,"strokeOpacity",2),r([Rv],Fv.prototype,"strokeWidth",2),r([Rv],Fv.prototype,"lineDash",2),r([Rv],Fv.prototype,"lineDashOffset",2),r([Rv],Fv.prototype,"itemStyler",2);var zv=class extends Ov{constructor(){super(...arguments),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fillGradientDefaults=new Cv,this.fillPatternDefaults=new Lv,this.fillImageDefaults=new Av,this.fills=[],this.strokes=[],this.label=new Pv,this.link=new Bv,this.node=new Fv,this.tooltip=new Nv}};r([Rv],zv.prototype,"fromKey",2),r([Rv],zv.prototype,"toKey",2),r([Rv],zv.prototype,"idKey",2),r([Rv],zv.prototype,"idName",2),r([Rv],zv.prototype,"labelKey",2),r([Rv],zv.prototype,"labelName",2),r([Rv],zv.prototype,"sizeKey",2),r([Rv],zv.prototype,"sizeName",2),r([Rv],zv.prototype,"nodes",2),r([Rv],zv.prototype,"fillGradientDefaults",2),r([Rv],zv.prototype,"fillPatternDefaults",2),r([Rv],zv.prototype,"fillImageDefaults",2),r([Rv],zv.prototype,"fills",2),r([Rv],zv.prototype,"strokes",2),r([Rv],zv.prototype,"label",2),r([Rv],zv.prototype,"link",2),r([Rv],zv.prototype,"node",2),r([Rv],zv.prototype,"tooltip",2);var{SeriesNodePickMode:Gv,CachedTextMeasurerPool:_v,TextWrapper:jv,TextUtils:Wv,createDatumId:Vv,angleBetween:Kv,normalizeAngle360:Yv,isBetweenAngles:$v,Sector:Hv,evaluateBezier:Uv,applyShapeStyle:Xv,getShapeStyle:Zv,BBox:qv}=s.n1,Qv=t=>t.startAngle+Kv(t.startAngle,t.endAngle)/2,Jv=class extends Mv{constructor(t){super({moduleCtx:t,pickModes:[Gv.NEAREST_NODE,Gv.EXACT_SHAPE_MATCH]}),this.properties=new zv}isLabelEnabled(){return(null!=this.properties.labelKey||null==this.nodes)&&this.properties.label.enabled}linkFactory(){return new Iv}nodeFactory(){return new Hv}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:a,sizeKey:o,label:{spacing:r,maxWidth:l,fontSize:h},node:{width:c,spacing:d}}=this.properties,u=e/2,p=i/2;let g=[];const{nodeGraph:m,links:y}=this.getNodeGraph(t=>({...t,centerX:u,centerY:p,innerRadius:NaN,outerRadius:NaN,startAngle:NaN,endAngle:NaN}),t=>({...t,centerX:u,centerY:p,radius:NaN,startAngle1:NaN,endAngle1:NaN,startAngle2:NaN,endAngle2:NaN}),{includeCircularReferences:!0});let f=0;m.forEach(({datum:t,linksBefore:e,linksAfter:i},n)=>{const r=e.reduce((t,{link:e})=>t+e.size,0)+i.reduce((t,{link:e})=>t+e.size,0);if(0===r)m.delete(n);else{t.size=r,f+=t.size;const e=this.getLabelText(this.properties.label,{datum:t.datum,value:t.label,fromKey:s,toKey:a,sizeKey:o,size:t.size});t.label=String(e)}});let x=0;if(this.isLabelEnabled()){const t=this.properties.label.getFont();let e=0;m.forEach(({datum:i})=>{const{id:s,label:n}=i;if(null==n)return;const a=jv.wrapText(n,{maxWidth:l,font:this.properties.label,textWrap:"never"}),{width:o}=_v.measureText(a,{font:t,textAlign:"left",textBaseline:"middle"});e=Math.max(o,e),g.push({id:s,text:a,centerX:u,centerY:p,angle:NaN,radius:NaN})}),x=e+r}const b=m.size;let v=Math.min(e,i)/2-c-x,S=d/v;if(0!==x&&(b*S>=1.5*Math.PI||v<=0)&&(g=[],v=Math.min(e,i)/2-c,S=d/v),b*S>=2*Math.PI||v<=0)return void n.Vy.warnOnce("There was insufficient space to display the Chord Series.");const M=v,k=v+c,D=Math.max((2*Math.PI-b*S)/f,0);let w=0;m.forEach(({datum:t})=>{t.innerRadius=M,t.outerRadius=k,t.startAngle=w,t.endAngle=w+t.size*D,w=t.endAngle+S;const e=(t.innerRadius+t.outerRadius)/2,i=Qv(t);t.midPoint={x:t.centerX+e*Math.cos(i),y:t.centerY+e*Math.sin(i)}});const I=[];m.forEach(({datum:t,linksBefore:e,linksAfter:i})=>{const s=Qv(t),n=[...e.map(t=>({link:t.link,distance:Kv(Qv(t.node.datum),s),after:!1})),...i.map(t=>({link:t.link,distance:Kv(Qv(t.node.datum),s),after:!0}))];let a=t.startAngle;n.toSorted((t,e)=>t.distance-e.distance).forEach(({link:t,after:e})=>{const i=t.size*D;e?(t.startAngle1=a,t.endAngle1=a+i):(t.startAngle2=a,t.endAngle2=a+i),a+=t.size*D}),I.push(t)});const{tension:C}=this.properties.link;y.forEach(t=>{t.radius=v;const e=wv({radius:v,startAngle:t.startAngle1,endAngle:t.endAngle2,tension:C}),i=wv({radius:v,startAngle:t.startAngle2,endAngle:t.endAngle1,tension:C}),s=Uv(...e.x,.5),n=Uv(...e.y,.5),a=Uv(...i.x,.5),o=Uv(...i.y,.5);t.midPoint={x:t.centerX+(s+a)/2,y:t.centerY+(n+o)/2},I.push(t)}),g.forEach(t=>{const e=m.get(t.id)?.datum;null!=e&&(t.radius=k+r,t.angle=Yv(e.startAngle+Kv(e.startAngle,e.endAngle)/2))}),g.sort((t,e)=>t.angle-e.angle);let L=1/0,A=-1/0;return g=g.filter(t=>{const e=Wv.getLineHeight(h),i=Math.atan2(e/2,t.radius),s=t.angle-i,n=t.angle+i;return!$v(L,s,n)&&!$v(A,s,n)&&(L=Math.min(s,L),A=Math.max(n,A),!0)}),{itemId:t,nodeData:I,labelData:g}}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:a,fontFamily:o}=this.properties.label;e.each((t,{text:e,centerX:r,centerY:l,radius:h,angle:c})=>{t.visible=!0,t.translationX=r+h*Math.cos(c),t.translationY=l+h*Math.sin(c),t.text=e,t.fill=i,t.fontStyle=s,t.fontWeight=n,t.fontSize=a,t.fontFamily=o,t.textBaseline="middle",Math.cos(c)>=0?(t.textAlign="left",t.rotation=c):(t.textAlign="right",t.rotation=c-Math.PI)})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,t=>Vv([t.type,t.id]))}getBaseNodeStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}=e.node,l=t?e.highlightStyle.item:void 0;return Zv({fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??n,strokeOpacity:l?.strokeOpacity??a,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.node.strokeWidth),lineDash:l?.lineDash??o,lineDashOffset:l?.lineDashOffset??r},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getNodeStyleOverrides(t,e,i,s,n,a,o){const{id:r,properties:l}=this,{fills:h,strokes:c}=l,{itemStyler:d}=l.node,u=a.fill??h[i%h.length],p=a.stroke??c[i%c.length];let g;if(o||(g??(g={}),g.fill=u,g.stroke=p),null!=d){const i=this.cachedDatumCallback(Vv(t,"node",o?"highlight":"node"),()=>{const{fillOpacity:t=1,strokeOpacity:i=1,strokeWidth:l=0,lineDash:h=[],lineDashOffset:c=0}=a;return this.callWithContext(d,{seriesId:r,datum:e,highlighted:o,label:n,size:s,fill:u,fillOpacity:t,stroke:p,strokeOpacity:i,strokeWidth:l,lineDash:h,lineDashOffset:c})});g??(g={}),Object.assign(g,i)}return Zv(g,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseNodeStyle(i),n=this.getShapeFillBBox();e.each((t,e)=>{const{datumIndex:a,size:o,label:r}=e,l=this.getNodeStyleOverrides(String(a.index),e.datum,a.index,o,r,s,i);Xv(t,s,l,n),t.centerX=e.centerX,t.centerY=e.centerY,t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius,t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.inset=t.strokeWidth/2})}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,t=>Vv([t.type,t.index,t.fromNode.id,t.toNode.id]))}getBaseLinkStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,lineDash:o,lineDashOffset:r,tension:l}=e.link,h=t?e.highlightStyle.item:void 0;return Zv({fill:h?.fill??i,fillOpacity:h?.fillOpacity??s,stroke:h?.stroke??n,strokeOpacity:h?.strokeOpacity??a,strokeWidth:h?.strokeWidth??this.getStrokeWidth(e.link.strokeWidth),lineDash:h?.lineDash??o,lineDashOffset:h?.lineDashOffset??r,tension:l},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getLinkStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,{fills:r,strokes:l}=o,{itemStyler:h}=o.link,c=s.fill??r[i%r.length],d=s.stroke??l[i%l.length];let u;if(n||(u??(u={}),u.fill=c,u.stroke=d),null!=h){const i=this.cachedDatumCallback(Vv(t,"link",n?"highlight":"node"),()=>{const{fillOpacity:t=1,strokeOpacity:i=1,strokeWidth:o=0,lineDash:r=[],lineDashOffset:l=0,tension:u}=s;return this.callWithContext(h,{seriesId:a,datum:e,highlighted:n,tension:u,fill:c,fillOpacity:t,stroke:d,strokeOpacity:i,strokeWidth:o,lineDash:r,lineDashOffset:l})});u??(u={}),Object.assign(u,i)}return Zv(u,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseLinkStyle(i),n=this.getShapeFillBBox();e.each((t,e)=>{const{datumIndex:a}=e,o=e.fromNode.datumIndex,r=this.getLinkStyleOverrides(String(a.index),e.datum,o.index,s,i);t.centerX=e.centerX,t.centerY=e.centerY,t.radius=e.radius,t.startAngle1=e.startAngle1,t.endAngle1=e.endAngle1,t.startAngle2=e.startAngle2,t.endAngle2=e.endAngle2,Xv(t,s,r,n),t.tension=r?.tension??s.tension})}getShapeFillBBox(){const t=this._nodeDataDependencies?.seriesRectWidth??0,e=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(t,e),s=new qv((t-i)/2,(e-i)/2,t,e);return{series:s,axis:s}}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:s,properties:n}=this,{fromKey:a,toKey:o,sizeKey:r,sizeName:l,tooltip:h}=n,c=this.contextNodeData?.nodeData.find(e=>e.datumIndex.type===t.type&&e.datumIndex.index===t.index);if(null==c)return;const d=0===c.type?c.fromNode.index:c.index,u=0===c.type?`${c.fromNode.label} - ${c.toNode.label}`:c.label,p=0===t.type?i?.dataSources.get(this.id)?.[t.index]:s?.dataSources.get(this.id)?.[t.index],g=c.size;let m;if(0===c.type){const e=c.fromNode.datumIndex,i=this.getBaseLinkStyle(!1);Object.assign(i,this.getLinkStyleOverrides(String(t.index),p,e.index,i,!1)),m=i}else{const e=c.label,i=this.getBaseNodeStyle(!1);Object.assign(i,this.getNodeStyleOverrides(String(t.index),p,t.index,g,e,i,!1)),m=i}return this.formatTooltipWithContext(h,{title:u,symbol:this.legendItemSymbol(c.type,d,m),data:null!=r?[{label:l,fallbackLabel:r,value:String(g)}]:[]},{seriesId:e,datum:p,title:u,fromKey:a,toKey:o,sizeKey:r,sizeName:l,size:g,...m})}computeFocusBounds(t){return t}};Jv.className="ChordSeries",Jv.type="chord";var{commonSeriesOptionsDefs:tS,chordSeriesThemeableOptionsDef:eS}=s.n1,iS={...eS,...tS,type:(0,n.mw)((0,n.dY)("chord")),fromKey:(0,n.mw)(n.Yj),toKey:(0,n.mw)(n.Yj),sizeKey:n.Yj,sizeName:n.Yj};iS.fillGradientDefaults=(0,n._L)(n.wi),iS.fillPatternDefaults=(0,n._L)(n.GY),iS.fillImageDefaults=(0,n._L)(n.Zd);var sS={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"chord",tooltipDefaults:{range:"exact"},moduleFactory:t=>new Jv(t),themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0,tension:.4}},legend:{enabled:!1,toggleSeries:!1}}},nS={type:"series",name:"chord",chartType:"flow-proportion",enterprise:!0,options:iS,create:t=>new Jv(t)},{ThemeConstants:{CARTESIAN_AXIS_TYPE:aS,CARTESIAN_POSITION:oS},ThemeSymbols:{DEFAULT_SHADOW_COLOUR:rS}}=s.n1,lS={$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},[{type:aS.NUMBER,position:oS.LEFT},{type:aS.CATEGORY,position:{$if:[{$eq:[{$path:["/stageLabel/placement",void 0]},"before"]},oS.TOP,oS.BOTTOM]},label:{$omit:[["placement"],{$path:["/stageLabel",void 0]}]}}],[{type:aS.CATEGORY,position:{$if:[{$eq:[{$path:["/stageLabel/placement",void 0]},"after"]},oS.RIGHT,oS.LEFT]},label:{$omit:[["placement"],{$path:["/stageLabel",void 0]}]}},{type:aS.NUMBER,position:oS.BOTTOM}]]},hS={series:{direction:"vertical",strokeWidth:0,spacingRatio:.25,fills:[{$palette:"fill"}],strokes:[{$palette:"stroke"}],fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:0},shadow:{enabled:!1,color:rS,xOffset:3,yOffset:3,blur:5}},axes:{[aS.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter:t=>Math.abs(t.value).toFixed(t.fractionDigits??0)}},[aS.CATEGORY]:{line:{enabled:!1}}}},{lineDistanceSquared:cS,BBox:dS,Path:uS,SceneChangeDetection:pS}=s.n1,gS=1e-6;function mS([t,e],[i,s]){return Math.abs(t-i)<=gS&&Math.abs(e-s)<=gS}var yS=class extends uS{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:t,y0:e,x1:i,y1:s,x2:n,y2:a,x3:o,y3:r}=this;return{x:(t+i+n+o)/4,y:(e+s+a+r)/4}}distanceSquared(t,e){if(this.containsPoint(t,e))return 0;const{x0:i,y0:s,x1:n,y1:a,x2:o,y2:r,x3:l,y3:h}=this;return Math.min(cS(t,e,i,s,n,a,1/0),cS(t,e,n,a,o,r,1/0),cS(t,e,o,r,l,h,1/0),cS(t,e,l,h,i,s,1/0))}computeBBox(){const{x0:t,y0:e,x1:i,y1:s,x2:n,y2:a,x3:o,y3:r}=this,l=Math.min(t,i,n,o),h=Math.max(t,i,n,o)-l,c=Math.min(e,s,a,r),d=Math.max(e,s,a,r)-c;return new dS(l,c,h,d)}updatePath(){const{path:t,x0:e,y0:i,x1:s,y1:n,x2:a,y2:o,x3:r,y3:l}=this,h=[[e,i],[s,n],[a,o],[r,l]];let c,d;t.clear(),h.forEach(e=>{if(null!=c&&mS(c,e)||null!=d&&mS(d,e))return;const[i,s]=e;null==c?t.moveTo(i,s):t.lineTo(i,s),c??(c=e),d=e}),t.closePath()}};r([pS()],yS.prototype,"x0",2),r([pS()],yS.prototype,"y0",2),r([pS()],yS.prototype,"x1",2),r([pS()],yS.prototype,"y1",2),r([pS()],yS.prototype,"x2",2),r([pS()],yS.prototype,"y2",2),r([pS()],yS.prototype,"x3",2),r([pS()],yS.prototype,"y3",2);var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:fS}=s.n1;function xS(t,e,i,s){const{x0:n,y0:a,x1:o,y1:r,x2:l,y2:h,x3:c,y3:d,opacity:u}=t;return i?{x0:(n+c)/2,y0:(a+d)/2,x1:(o+l)/2,y1:(r+h)/2,x2:(o+l)/2,y2:(r+h)/2,x3:(n+c)/2,y3:(a+d)/2,opacity:u}:{x0:(n+o)/2,y0:(a+r)/2,x1:(n+o)/2,y1:(a+r)/2,x2:(l+c)/2,y2:(h+d)/2,x3:(l+c)/2,y3:(h+d)/2,opacity:u}}function bS(t,e){const{x0:i,y0:s,x1:n,y1:a,x2:o,y2:r,x3:l,y3:h,opacity:c}=e;return{x0:i,y0:s,x1:n,y1:a,x2:o,y2:r,x3:l,y3:h,opacity:c}}var{SeriesNodePickMode:vS,SeriesZIndexMap:SS,valueProperty:MS,keyProperty:kS,ChartAxisDirection:DS,updateLabelNode:wS,SMALLEST_KEY_INTERVAL:IS,LARGEST_KEY_INTERVAL:CS,diff:LS,fixNumericExtent:AS,seriesLabelFadeInAnimation:TS,resetMotion:NS,resetLabelFn:OS,animationValidation:RS,computeBarFocusBounds:ES,ContinuousScale:PS,Group:BS,Selection:FS,PointerEvents:zS,motion:GS,checkCrisp:_S,createDatumId:jS,applyShapeStyle:WS,getShapeStyle:VS,getShapeFill:KS}=s.n1,YS=class extends s.n1.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.stageKey,this.yKey=s.properties.valueKey}},$S=class extends s.n1.AbstractBarSeries{constructor({moduleCtx:t,animationResetFns:e}){super({moduleCtx:t,pickModes:[vS.AXIS_ALIGNED,vS.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["stageKey"],y:["valueKey"]},directionNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:e.datum,label:OS}}),this.NodeEvent=YS,this.connectorNodeGroup=this.contentGroup.appendChild(new BS({name:`${this.id}-series-connectorNodes`,zIndex:SS.BACKGROUND})),this.connectorSelection=FS.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=zS.None}get pickModeAxis(){return"main-category"}setSeriesIndex(t){return!!super.setSeriesIndex(t)&&(this.connectorNodeGroup.zIndex=[SS.BACKGROUND,t],!0)}isVertical(){return!super.isVertical()}connectionFactory(){return new yS}async processData(t){const{stageKey:e,valueKey:i}=this.properties,{visible:s,id:n}=this,a=this.getCategoryAxis()?.scale,o=this.getValueAxis()?.scale,{isContinuousX:r,xScaleType:l,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:o}),c=[];this.ctx.animationManager.isSkipped()||(this.processedData&&c.push(LS(this.id,this.processedData)),c.push(RS()));const d=this.visible?{}:{forceValue:0},{processedData:u}=await this.requestDataModel(t,this.data,{props:[kS(e,l,{id:"xValue"}),MS(i,h,{id:"yValue",...d,validation:(t,e,i)=>s&&this.ctx.legendManager.getItemEnabled({seriesId:n,itemId:i}),invalidValue:0}),...r?[IS,CS]:[],...c],groupByKeys:!1});this.smallestDataInterval=u.reduced?.smallestKeyInterval,this.largestDataInterval=u.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i,id:s,ctx:{legendManager:n}}=this;if(!e||!i)return[];const{keys:[a]}=e.domain;if(t===this.getCategoryDirection()){const t=i.resolveProcessedDataDefById(this,"xValue");return"key"===t?.def.type&&"category"===t?.def.valueType?this.hasData?a.filter((t,e)=>n.getItemEnabled({seriesId:s,itemId:e})):[]:this.padBandExtent(a)}{const e=this.domainForClippedRange(t,["yValue"],"xValue",!0),i=Math.max(...e);return AS([-i,i])}}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{hasData:t,data:e,dataModel:i,groupScale:s,processedData:n,id:a,ctx:{legendManager:o}}=this,r=this.getCategoryAxis(),l=this.getValueAxis();if(!(t&&e&&r&&l&&i&&"ungrouped"===n?.type))return;const h=r.scale,c=l.scale,d=this.getBarDirection()===DS.X,{stageKey:u,valueKey:p}=this.properties,{strokeWidth:g}=this.barStyle(),m=`${p}`,y={itemId:m,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible},f=this.visible;if(!f)return y;const x=i.resolveKeysById(this,"xValue",n),b=i.resolveColumnById(this,"yValue",n),{barWidth:v,groupIndex:S}=this.updateGroupScale(r),M=PS.is(h)?-.5*v:0,k=_S(r?.scale,r?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let D;return(n.dataSources.get(this.id)??[]).forEach((t,e)=>{const i=f&&o.getItemEnabled({seriesId:a,itemId:e}),n=x[e];if(null==n)return;const r=Math.round(h.convert(n))+s.convert(String(S))+M,l=b[e],w=Math.round(c.convert(-l)),I=Math.round(c.convert(l)),C=Math.max(g,Math.abs(I-w)),L={x:d?Math.min(I,w):r,y:d?r:Math.min(I,w),width:d?C:v,height:d?v:C},A={x:L.x+L.width/2,y:L.y+L.height/2},T=this.createLabelData({datumIndex:e,rect:L,barAlongX:d,yDatum:l,datum:t,visible:i}),N={index:e,series:this,itemId:m,datum:t,datumIndex:e,xValue:n,yValue:l,xKey:u,yKey:p,x:L.x,y:L.y,width:L.width,height:L.height,midPoint:A,strokeWidth:g,crisp:k,label:T,visible:i};if(y.nodeData.push(N),null!=T&&y.labelData.push(T),null!=D){const t=D.rect,e=D.nodeDatum,i=D.datumIndex;d?y.connectorData.push({datum:e,datumIndex:i,x0:t.x,y0:t.y+t.height,x1:t.x+t.width,y1:t.y+t.height,x2:L.x+L.width,y2:L.y,x3:L.x,y3:L.y,opacity:1}):y.connectorData.push({datum:e,datumIndex:i,x0:t.x+t.width,y0:t.y,x1:L.x,y1:L.y,x2:L.x,y2:L.y+L.height,x3:t.x+t.width,y3:t.y+t.height,opacity:1})}i&&(D={itemId:m,rect:L,nodeDatum:N,datumIndex:e})}),y}updateNodes(t,e,i){super.updateNodes(t,e,i);const{connectorSelection:s}=this,n=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:s,connectorData:n}),this.updateConnectorNodes({connectorSelection:s})}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s,void 0,t=>this.getDatumId(t))}updateConnectorSelection(t){const{connectorData:e,connectorSelection:i}=t;return i.update(this.connectorEnabled()?e:[],void 0,t=>this.getDatumId(t.datum))}updateConnectorNodes(t){const{fills:e,strokes:i,fillGradientDefaults:s,fillPatternDefaults:n,fillImageDefaults:a}=this.properties,{fill:o,fillOpacity:r,stroke:l,strokeOpacity:h,strokeWidth:c,lineDash:d,lineDashOffset:u}=this.connectorStyle(),p=this.getShapeFillBBox();t.connectorSelection.each((t,g)=>{const{datumIndex:m}=g;t.setProperties(bS(0,g));const y=KS(o??e[m%e.length],s,n,a);WS(t,{fill:y,stroke:l??i[m%i.length],fillOpacity:r,strokeOpacity:h,strokeWidth:c,lineDash:d,lineDashOffset:u},void 0,p)})}getHighlightLabelData(t,e){const i=t.filter(t=>t.datum===e.datum);return i.length>0?i:void 0}updateLabelSelection(t){const e=this.properties.label.enabled?t.labelData:[];return t.labelSelection.update(e,t=>{t.pointerEvents=zS.None})}updateLabelNodes(t){t.labelSelection.each((t,e)=>{wS(t,this.properties.label,e)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{stageKey:a,valueKey:o,tooltip:r}=n,l=this.getCategoryAxis(),h=this.getValueAxis();if(!(i&&s&&l&&h))return;const c=s.dataSources.get(this.id)?.[t],d=i.resolveKeysById(this,"xValue",s)[t],u=i.resolveColumnById(this,"yValue",s)[t];return null!=d?this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(t),data:[{label:l.formatDatum(d),value:h.formatDatum(u)}]},{seriesId:e,datum:c,title:a,stageKey:a,valueKey:o,...this.tooltipStyle(c,t)}):void 0}resetAllAnimation(t){super.resetAllAnimation(t),NS([this.connectorSelection],bS)}animateEmptyUpdateReady({labelSelection:t}){const{connectorSelection:e}=this,i=function(t){const e=t=>null==t;return{fromFn:(i,s,n)=>{let a;"updated"===n&&e(s)?n="removed":"updated"===n&&e(i.previousDatum)&&(n="added"),"added"===n&&i.previousDatum,a="unknown"===n||"added"===n?xS(s,i.previousDatum,t):{x0:i.x0,y0:i.y0,x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,x3:i.x3,y3:i.y3,opacity:i.opacity};const o=fS[n];return{...a,phase:o}},toFn:(i,s,n)=>{let a;return"removed"===n&&i.datum,a="removed"===n||e(s)?xS(s,i.previousDatum,t):bS(0,s),a}}}(this.isVertical());GS.fromToMotion(this.id,"connectors",this.ctx.animationManager,[e],i),TS(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(t){const{labelSelection:e}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id),TS(this,"labels",this.ctx.animationManager,e)}getDatumId(t){return jS(t.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return ES(this,this.contextNodeData?.nodeData[t])}legendItemSymbol(t){const{strokeWidth:e,fillOpacity:i,strokeOpacity:s,lineDash:n,lineDashOffset:a,fillGradientDefaults:o,fillPatternDefaults:r,fillImageDefaults:l}=this.barStyle(),{fills:h,strokes:c}=this.properties,d=h[t%h.length]??"black",u=c[t%c.length]??"black";return{marker:VS({fill:d,fillOpacity:i,stroke:u,strokeWidth:e,strokeOpacity:s,lineDash:n,lineDashOffset:a},o,r,l)}}getLegendData(t){const{id:e,processedData:i,dataModel:s,ctx:{legendManager:n},visible:a}=this;if(!s||!i||"category"!==t)return[];const{showInLegend:o}=this.properties,r=s.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)??[]).map((t,i)=>{const s=r[i];if(null!=s)return{legendType:"category",id:e,datum:t,itemId:i,seriesId:e,enabled:a&&n.getItemEnabled({seriesId:e,itemId:i}),label:{text:String(s)},symbol:this.legendItemSymbol(i),skipAnimations:!0,hideInLegend:!o}}).filter(t=>null!=t)}},{FillGradientDefaults:HS,FillPatternDefaults:US,FillImageDefaults:XS,Label:ZS,AbstractBarSeriesProperties:qS,SeriesTooltip:QS,AxisLabel:JS,Property:tM}=s.n1,eM=class extends ZS{constructor(){super(...arguments),this.spacing=0}};r([tM],eM.prototype,"placement",2),r([tM],eM.prototype,"spacing",2);var iM=class extends JS{};r([tM],iM.prototype,"placement",2);var sM=class extends qS{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new HS,this.fillPatternDefaults=new US,this.fillImageDefaults=new XS,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new eM,this.stageLabel=new iM,this.tooltip=new QS}};function nM(t,{x:e,y:i,width:s,height:n,opacity:a}){return{x1:e,y1:i,x2:e+s,y2:i+n,opacity:a}}r([tM],sM.prototype,"stageKey",2),r([tM],sM.prototype,"valueKey",2),r([tM],sM.prototype,"fills",2),r([tM],sM.prototype,"fillGradientDefaults",2),r([tM],sM.prototype,"fillPatternDefaults",2),r([tM],sM.prototype,"fillImageDefaults",2),r([tM],sM.prototype,"fillOpacity",2),r([tM],sM.prototype,"strokes",2),r([tM],sM.prototype,"strokeWidth",2),r([tM],sM.prototype,"strokeOpacity",2),r([tM],sM.prototype,"lineDash",2),r([tM],sM.prototype,"lineDashOffset",2),r([tM],sM.prototype,"label",2),r([tM],sM.prototype,"stageLabel",2),r([tM],sM.prototype,"tooltip",2);var{formatValue:aM,Line:oM}=s.n1,rM=class extends $S{constructor(t){super({moduleCtx:t,animationResetFns:{datum:nM}}),this.properties=new sM}get hasData(){const{id:t,ctx:{legendManager:e}}=this,i=this.data?.reduce((i,s,n)=>i+(e.getItemEnabled({seriesId:t,itemId:n})?1:0),0);return null!=i&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}barStyle(){return{fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[],lineDashOffset:0,fillGradientDefaults:this.properties.fillGradientDefaults,fillPatternDefaults:this.properties.fillPatternDefaults,fillImageDefaults:this.properties.fillImageDefaults}}connectorStyle(){const{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:a,fillPatternDefaults:o,fillImageDefaults:r}=this.properties;return{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:a,fillPatternDefaults:o,fillImageDefaults:r}}nodeFactory(){return new oM}createLabelData({datumIndex:t,rect:e,barAlongX:i,yDatum:s,datum:n,visible:a}){const{stageKey:o,valueKey:r,label:l}=this.properties,{spacing:h,placement:c}=l;let d,u,p,g;if(i)switch(d=e.x+e.width/2,p="center",c){case"before":u=e.y-h,g="bottom";break;case"after":u=e.y+e.height+h,g="top";break;default:u=e.y+e.height/2,g="middle"}else switch(u=e.y+e.height/2,g="middle",c){case"before":d=e.x-h,p="right";break;case"after":d=e.x+e.width+h,p="left";break;default:d=e.x+e.width/2,p="center"}return{x:d,y:u,textAlign:p,textBaseline:g,text:this.getLabelText(l,{itemId:r,value:s,datum:n,stageKey:o,valueKey:r},t=>aM(t,0)),itemId:r,datum:n,datumIndex:t,series:this,visible:a}}updateDatumNodes(t){const e=t.isHighlight?this.properties.highlightStyle.item:void 0;t.datumSelection.each((t,i)=>{t.setProperties(nM(0,i)),t.stroke=e?.stroke,t.strokeWidth=e?.strokeWidth??0,t.strokeOpacity=e?.strokeOpacity??1,t.lineDash=e?.lineDash,t.lineDashOffset=e?.lineDashOffset??0})}tooltipStyle(t,e){const{fills:i,strokes:s}=this.properties,n=i[e%i.length]??"black",a=s[e%s.length]??"black",{fillOpacity:o,strokeOpacity:r,strokeWidth:l,lineDash:h,lineDashOffset:c}=this.barStyle();return{fill:n,fillOpacity:o,stroke:a,strokeOpacity:r,strokeWidth:l,lineDash:h,lineDashOffset:c}}};rM.className="ConeFunnelSeries",rM.type="cone-funnel";var{commonSeriesOptionsDefs:lM,coneFunnelSeriesThemeableOptionsDef:hM}=s.n1,cM={...hM,...lM,type:(0,n.mw)((0,n.dY)("cone-funnel")),stageKey:(0,n.mw)(n.Yj),valueKey:(0,n.mw)(n.Yj)},{ThemeConstants:{CARTESIAN_AXIS_TYPE:dM}}=s.n1,uM={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"cone-funnel",moduleFactory:t=>new rM(t),solo:!0,tooltipDefaults:{range:"nearest"},defaultAxes:lS,themeTemplate:{series:{direction:"vertical",fills:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},s.n1.SAFE_RANGE2_OPERATION]},strokes:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},s.n1.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,strokeWidth:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4}},seriesArea:{padding:{top:20,bottom:20}},axes:{[dM.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter:t=>Math.abs(t.value).toFixed(t.fractionDigits??0)}},[dM.CATEGORY]:{line:{enabled:!1}}}}},pM={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,options:cM,create:t=>new rM(t)},{FillGradientDefaults:gM,FillPatternDefaults:mM,FillImageDefaults:yM,Label:fM,DropShadow:xM,AbstractBarSeriesProperties:bM,BaseProperties:vM,SeriesTooltip:SM,AxisLabel:MM,Property:kM}=s.n1,DM=class extends fM{},wM=class extends MM{};r([kM],wM.prototype,"placement",2);var IM=class extends vM{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};r([kM],IM.prototype,"enabled",2),r([kM],IM.prototype,"fill",2),r([kM],IM.prototype,"fillOpacity",2),r([kM],IM.prototype,"stroke",2),r([kM],IM.prototype,"strokeWidth",2),r([kM],IM.prototype,"strokeOpacity",2),r([kM],IM.prototype,"lineDash",2),r([kM],IM.prototype,"lineDashOffset",2);var CM=class extends bM{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new gM,this.fillPatternDefaults=new mM,this.fillImageDefaults=new yM,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new IM,this.shadow=(new xM).set({enabled:!1}),this.label=new DM,this.stageLabel=new wM,this.tooltip=new SM}};r([kM],CM.prototype,"stageKey",2),r([kM],CM.prototype,"valueKey",2),r([kM],CM.prototype,"fills",2),r([kM],CM.prototype,"fillGradientDefaults",2),r([kM],CM.prototype,"fillPatternDefaults",2),r([kM],CM.prototype,"fillImageDefaults",2),r([kM],CM.prototype,"fillOpacity",2),r([kM],CM.prototype,"strokes",2),r([kM],CM.prototype,"strokeWidth",2),r([kM],CM.prototype,"strokeOpacity",2),r([kM],CM.prototype,"lineDash",2),r([kM],CM.prototype,"lineDashOffset",2),r([kM],CM.prototype,"spacingRatio",2),r([kM],CM.prototype,"itemStyler",2),r([kM],CM.prototype,"dropOff",2),r([kM],CM.prototype,"shadow",2),r([kM],CM.prototype,"label",2),r([kM],CM.prototype,"stageLabel",2),r([kM],CM.prototype,"tooltip",2);var{ChartAxisDirection:LM,resetBarSelectionsFn:AM,prepareBarAnimationFunctions:TM,midpointStartingBarPosition:NM,createDatumId:OM,formatValue:RM,Rect:EM,motion:PM,applyShapeStyle:BM,getShapeStyle:FM}=s.n1,zM=class extends $S{constructor(t){super({moduleCtx:t,animationResetFns:{datum:AM}}),this.properties=new CM}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}barStyle(){const{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:a,fillPatternDefaults:o,fillImageDefaults:r}=this.properties;return{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:a,fillPatternDefaults:o,fillImageDefaults:r}}connectorStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o}=this.properties.dropOff;return{fill:t,fillOpacity:e,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o,fillGradientDefaults:this.properties.fillGradientDefaults,fillPatternDefaults:this.properties.fillPatternDefaults,fillImageDefaults:this.properties.fillImageDefaults}}nodeFactory(){return new EM}createLabelData({datumIndex:t,rect:e,yDatum:i,datum:s,visible:n}){const{valueKey:a,stageKey:o,label:r}=this.properties;return{x:e.x+e.width/2,y:e.y+e.height/2,textAlign:"center",textBaseline:"middle",text:this.getLabelText(r,{itemId:o,value:i,datum:s,valueKey:a,stageKey:o},t=>RM(t,0)),itemId:o,datum:s,datumIndex:t,series:this,visible:n}}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return FM({fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset},e.fillGradientDefaults,e.fillPatternDefaults,e.fillImageDefaults)}getItemStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,{stageKey:r,valueKey:l,fills:h,strokes:c,itemStyler:d}=o,u=s.fill??h[i%h.length]??"black",p=s.stroke??c[i%c.length]??"black",g={};if(n||(g.fill=u,g.stroke=p),null!=d){const i=this.cachedDatumCallback(OM(t,n?"highlight":"node"),()=>{const{fillOpacity:t,strokeOpacity:i,strokeWidth:o,lineDash:h,lineDashOffset:c}=s;return this.callWithContext(d,{seriesId:a,datum:e,highlighted:n,stageKey:r,valueKey:l,fill:u,fillOpacity:t,stroke:p,strokeOpacity:i,strokeWidth:o,lineDash:h,lineDashOffset:c})});Object.assign(g,i)}return FM(g,o.fillGradientDefaults,o.fillPatternDefaults,o.fillImageDefaults)}updateDatumNodes(t){const{shadow:e}=this.properties,{datumSelection:i,isHighlight:s}=t,n=this.getCategoryDirection()===LM.X,a=this.getItemBaseStyle(s),o=this.getShapeFillBBox();i.each((t,i)=>{const{datumIndex:r}=i,l=this.getItemStyleOverrides(String(i.datumIndex),i.datum,r,a,s);BM(t,a,l,o),t.visible=n?i.width>0:i.height>0,t.crisp=i.crisp,t.fillShadow=e})}tooltipStyle(t,e){const i=this.getItemBaseStyle(!1);return Object.assign(i,this.getItemStyleOverrides(String(e),t,e,i,!1)),i}animateEmptyUpdateReady(t){super.animateEmptyUpdateReady(t);const{datumSelection:e}=t,i=this.isVertical(),s=TM(NM(i,"normal"));PM.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],s)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t);const{datumSelection:e}=t,{processedData:i}=this,s=i?.reduced?.diff?.[this.id],n=TM(NM(this.isVertical(),"fade"));PM.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],n,(t,e)=>e.xValue,s)}};zM.className="FunnelSeries",zM.type="funnel";var{commonSeriesOptionsDefs:GM,funnelSeriesThemeableOptionsDef:_M}=s.n1,jM={..._M,...GM,type:(0,n.mw)((0,n.dY)("funnel")),stageKey:(0,n.mw)(n.Yj),valueKey:(0,n.mw)(n.Yj)},WM={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"funnel",moduleFactory:t=>new zM(t),solo:!0,tooltipDefaults:{range:"exact"},defaultAxes:lS,themeTemplate:hS},VM={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,options:jM,create:t=>new zM(t)},KM=class{*[Symbol.iterator](){const{node:t,datum:e}=this;t&&e&&(yield{node:t,datum:e})}nodes(){return this.node?[this.node]:[]}update(t,e,i,s){const n=t.nodes();if(0===n.length)this.node?.remove(),this.node=void 0;else{void 0===this.node&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,e.appendChild(this.node));const t=n[0],a=n.toReversed().find(t=>t.datum.datum.value>t.datum.datum.segmentStart)??n[n.length-1];this.node.datum=this.datum=t.datum,s(this.node,t,a)}}},YM={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function $M(t,e){if(null==t)return"";const{min:i,max:s}=e,n=0!==i?Math.ceil(Math.log10(Math.abs(i))):0,a=0!==s?Math.ceil(Math.log10(Math.abs(s))):0,o=Math.max(2-Math.max(n,a),0);return t.toFixed(o)}function HM(t,e,i,s){if(null!=i.text)return i.text;const n=s??i.value;let a;return null!=i?.formatter&&(a=UM(e,i.formatter,{seriesId:t,datum:void 0,value:n})),null!=a?String(a):void 0}function UM(t,e,i){return s.n1.callWithContext(t.chartService,void 0,e,[i])}function XM({path:t,x:e,y:i,size:s}){t.moveTo(e,i-s/2),t.lineTo(e,i+s/2)}function ZM(t,e){const i=(0,n.nl)(t.datumUnion.nodes(),t.targetSelection.nodes());return t.pickNodeNearestDistantObject(e,i)}function qM(t,e){const i=[{data:t.contextNodeData?.nodeData,selection:t.datumUnion},{data:t.contextNodeData?.targetData,selection:t.targetSelection}].filter(t=>t.data&&t.data.length>0),s=(0,n.qE)(0,e.otherIndex+e.otherIndexDelta,i.length-1);if(0===i.length)return;const{data:a,selection:o}=i[s];if(null==a||0===a.length)return;const r=(0,n.qE)(0,e.datumIndex,a.length-1),l=a[r];for(const t of o)if(t.datum===l)return{bounds:t.node,clipFocusBox:!0,datum:l,datumIndex:r,otherIndex:s}}var{BaseProperties:QM,Property:JM}=s.n1,tk=class extends QM{getSegments(t,e){const{values:i,step:s,count:a}=this,o=Math.min(...t.domain),r=Math.max(...t.domain);let l;if(null!=i){const t=i.filter(t=>t>o&&t<r).sort((t,e)=>t-e);l=[o,...t,r]}else if(null!=s){const t=[];for(let e=o;e<r;e+=s)t.push(e);t.push(r),l=t}else if(null!=a){const t=a+1;l=Array.from({length:t+1},(e,i)=>i/t*(r-o)+o)}else{const e=t.ticks({nice:!0,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.filter(t=>t>o&&t<r);l=null!=e?[o,...e,r]:void 0}return null!=l&&l.length>e&&(n.Vy.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),l=void 0),l??(l=[o,r]),l}};r([JM],tk.prototype,"values",2),r([JM],tk.prototype,"step",2),r([JM],tk.prototype,"count",2);var ek=class extends QM{constructor(){super(...arguments),this.enabled=!1,this.interval=new tk,this.spacing=0}};r([JM],ek.prototype,"enabled",2),r([JM],ek.prototype,"interval",2),r([JM],ek.prototype,"spacing",2);var{BaseProperties:ik,SeriesTooltip:sk,SeriesProperties:nk,PropertiesArray:ak,Property:ok,Label:rk,AxisLabel:lk}=s.n1,hk=class extends rk{};r([ok],hk.prototype,"spacing",2);var ck=class extends ik{constructor(){super(...arguments),this.value=0,this.label=new hk}};r([ok],ck.prototype,"text",2),r([ok],ck.prototype,"value",2),r([ok],ck.prototype,"shape",2),r([ok],ck.prototype,"placement",2),r([ok],ck.prototype,"spacing",2),r([ok],ck.prototype,"size",2),r([ok],ck.prototype,"rotation",2),r([ok],ck.prototype,"fill",2),r([ok],ck.prototype,"fillOpacity",2),r([ok],ck.prototype,"stroke",2),r([ok],ck.prototype,"strokeWidth",2),r([ok],ck.prototype,"strokeOpacity",2),r([ok],ck.prototype,"lineDash",2),r([ok],ck.prototype,"lineDashOffset",2),r([ok],ck.prototype,"label",2);var dk=class extends ik{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new ak(s.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};r([ok],dk.prototype,"enabled",2),r([ok],dk.prototype,"thickness",2),r([ok],dk.prototype,"thicknessRatio",2),r([ok],dk.prototype,"fills",2),r([ok],dk.prototype,"fillMode",2),r([ok],dk.prototype,"fill",2),r([ok],dk.prototype,"fillOpacity",2),r([ok],dk.prototype,"stroke",2),r([ok],dk.prototype,"strokeWidth",2),r([ok],dk.prototype,"strokeOpacity",2),r([ok],dk.prototype,"lineDash",2),r([ok],dk.prototype,"lineDashOffset",2);var uk=class extends ik{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};r([ok],uk.prototype,"values",2),r([ok],uk.prototype,"step",2),r([ok],uk.prototype,"minSpacing",2),r([ok],uk.prototype,"maxSpacing",2);var pk=class extends lk{constructor(){super(...arguments),this.placement=void 0}};r([ok],pk.prototype,"placement",2);var gk=class extends ik{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new ak(s.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new uk,this.label=new pk}};r([ok],gk.prototype,"min",2),r([ok],gk.prototype,"max",2),r([ok],gk.prototype,"fills",2),r([ok],gk.prototype,"fillMode",2),r([ok],gk.prototype,"fill",2),r([ok],gk.prototype,"fillOpacity",2),r([ok],gk.prototype,"stroke",2),r([ok],gk.prototype,"strokeWidth",2),r([ok],gk.prototype,"strokeOpacity",2),r([ok],gk.prototype,"lineDash",2),r([ok],gk.prototype,"lineDashOffset",2),r([ok],gk.prototype,"defaultFill",2),r([ok],gk.prototype,"interval",2),r([ok],gk.prototype,"label",2);var mk=class extends ly{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};r([ok],mk.prototype,"text",2),r([ok],mk.prototype,"placement",2),r([ok],mk.prototype,"avoidCollisions",2);var yk=class extends nk{constructor(){super(...arguments),this.value=0,this.segmentation=new ek,this.defaultColorRange=[],this.targets=new ak(ck),this.defaultTarget=new ck,this.defaultScale=new gk,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new gk,this.bar=new dk,this.label=new mk,this.tooltip=new sk}};r([ok],yk.prototype,"value",2),r([ok],yk.prototype,"segmentation",2),r([ok],yk.prototype,"defaultColorRange",2),r([ok],yk.prototype,"targets",2),r([ok],yk.prototype,"defaultTarget",2),r([ok],yk.prototype,"defaultScale",2),r([ok],yk.prototype,"direction",2),r([ok],yk.prototype,"thickness",2),r([ok],yk.prototype,"cornerRadius",2),r([ok],yk.prototype,"cornerMode",2),r([ok],yk.prototype,"margin",2),r([ok],yk.prototype,"scale",2),r([ok],yk.prototype,"bar",2),r([ok],yk.prototype,"label",2),r([ok],yk.prototype,"tooltip",2);var{CachedTextMeasurerPool:fk,BBox:xk}=s.n1;function bk(t){const{x0:e,y0:i,x1:s,y1:n,horizontalInset:a,verticalInset:o}=t;return{x:Math.min(e,s)+a,y:Math.min(i,n)+o,width:Math.max(Math.abs(s-e)-2*a,0),height:Math.max(Math.abs(n-i)-2*o,0)}}function vk(t){const{clipX0:e,clipX1:i,clipY0:s,clipY1:n}=t;return null!=e&&null!=i||null!=s&&null!=n}function Sk(t,e){const i=t?"initial":"update";return{node:{fromFn(s,n){const a=s.previousDatum;let{x0:o,y0:r,x1:l,y1:h,clipX0:c,clipY0:d,clipX1:u,clipY1:p}=a??n;const{horizontalInset:g,verticalInset:m}=n,y=null!=a&&vk(a),f=vk(n);return y&&f||(!y&&f?(({x0:o,y0:r,x1:l,y1:h,clipX0:c,clipY0:d,clipX1:u,clipY1:p}=n),t&&(e?u=n.clipX0:p=n.clipY0)):y&&!f?(({x0:o,y0:r,x1:l,y1:h}=n),c=void 0,d=void 0,u=void 0,p=void 0):t&&(e?l=o:h=r)),{x0:o,y0:r,x1:l,y1:h,clipX0:c,clipY0:d,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:m,phase:i}},toFn(t,e){const{x0:i,y0:s,x1:n,y1:a,clipX0:o,clipY0:r,clipX1:l,clipY1:h,horizontalInset:c,verticalInset:d}=e;return{x0:i,y0:s,x1:n,y1:a,clipX0:o,clipY0:r,clipX1:l,clipY1:h,horizontalInset:c,verticalInset:d}},applyFn(t,e){t.setProperties(Mk(0,e))}}}}function Mk(t,e){const{x:i,y:s,width:n,height:a}=bk(e),o=function(t){if(!vk(t))return;const{x0:e,y0:i,x1:s,y1:n}=t,{x:a,y:o,width:r,height:l}=bk(t);let{clipX0:h,clipX1:c,clipY0:d,clipY1:u}=t;null!=h&&null!=c||(h=e,c=s),null!=d&&null!=u||(d=i,u=n);const p=Math.min(h,c),g=Math.min(d,u),m=Math.abs(c-h),y=Math.abs(u-d);return h=Math.max(a,p),d=Math.max(o,g),c=Math.min(a+r,p+m),u=Math.min(o+l,g+y),new xk(Math.min(h,c),Math.min(d,u),Math.abs(c-h),Math.abs(u-d))}(e),r=function(t,e){if(null==e)return!0;const i=bk(t),s=1e-6,n=i.x+s,a=i.y+s,o=i.x+i.width-s,r=i.y+i.height-s,l=e.x,h=e.x+e.width,c=e.y,d=e.y+e.height;return Math.max(n,l)<=Math.min(o,h)&&Math.max(a,c)<=Math.min(r,d)}(e,o);return{x:i,y:s,width:n,height:a,clipBBox:o,visible:r}}var kk={Before:"right",Center:"center",After:"left"},Dk={Before:"top",Center:"middle",After:"bottom"},wk={Before:-1,Center:-.5,After:0},Ik={Before:0,Center:-.5,After:-1},{fromToMotion:Ck,resetMotion:Lk,SeriesNodePickMode:Ak,StateMachine:Tk,createDatumId:Nk,CachedTextMeasurerPool:Ok,toRadians:Rk,BBox:Ek,Group:Pk,PointerEvents:Bk,Selection:Fk,Rect:zk,Text:Gk,TransformableText:_k,Marker:jk,LinearScale:Wk,AxisTickGenerator:Vk,NiceMode:Kk,easing:Yk,getColorStops:$k,findRangeExtent:Hk}=s.n1,Uk={before:180,middle:0,after:0},Xk={before:90,middle:0,after:-90},Zk=class{constructor(t,e){this.gauge=t,this.ctx=e}get defaultTickMinSpacing(){return 0}get range(){return this.gauge.range}get reverse(){return!1}get scale(){return this.gauge.scale}get label(){return this.gauge.properties.scale.label}get interval(){return this.gauge.properties.scale.interval}formatTick(t,e,i,s,n,a){const{label:o}=this;return this.formatWithContext(t,e,i)??(null!=o.format?a?.(t):void 0)??this.gauge.formatLabel(t)}formatWithContext(t,e,i){let s;return this.label.formatter&&(s=UM(this.ctx,this.label.formatter,{value:t,index:e,domain:i,boundSeries:void 0})),s}inRange(){return!0}},qk=class extends s.n1.Series{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[Ak.EXACT_SHAPE_MATCH,Ak.NEAREST_NODE]}),this.properties=new yk,this.seriesRect=Ek.NaN,this.gaugeRect=Ek.NaN,this.scale=new Wk,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new Pk({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Pk({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Pk({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Pk({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Pk({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Pk({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Pk({name:"tickGroup"})),this.scaleSelection=Fk.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Fk.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=Fk.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Fk.select(this.itemTargetLabelGroup,Gk),this.labelSelection=Fk.select(this.itemLabelGroup,Gk),this.highlightTargetSelection=Fk.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Fk.select(this.tickGroup,_k),this.datumUnion=new KM,this.axis=new Zk(this,t),this.tickGenerator=new Vk(this.axis),this.animationState=new Tk("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=Bk.None,this.tickGroup.pointerEvents=Bk.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return"horizontal"===this.properties.direction}get hasData(){return!0}nodeFactory(){const t=new zk;return t.crisp=!0,t}markerFactory(){return new jk}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){return $M(t,this.properties.scale)}createLinearGradient(t,e,i){const{properties:s,horizontal:n}=this,{defaultColorRange:a}=s;return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:$k(e,a,t.domain,i),rotation:n?90:0}}getShapeFillBBox(){const{properties:t,originX:e,originY:i,horizontal:s,scale:n}=this,{thickness:a}=t,o=Hk(n.range);return new Ek(e,i,s?o:a,s?a:o)}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(t=>{const{text:i=e.text,value:s=e.value??0,shape:n=e.shape??"triangle",rotation:a=e.rotation??0,strokeWidth:o=e.strokeWidth??0,placement:r=e.placement??"middle",spacing:l=e.spacing??0,size:h=e.size??0,fill:c=e.fill??"black",fillOpacity:d=e.fillOpacity??1,stroke:u=e.stroke??"black",strokeOpacity:p=e.strokeOpacity??1,lineDash:g=e.lineDash??[0],lineDashOffset:m=e.lineDashOffset??0}=t,{enabled:y=e.label.enabled,color:f=e.label.color??"black",fontStyle:x=e.label.fontStyle??"normal",fontWeight:b=e.label.fontWeight??"normal",fontSize:v=e.label.fontSize,fontFamily:S=e.label.fontFamily,spacing:M=e.label.spacing??0}=t.label;return{text:i,value:s,shape:n,placement:r,spacing:l,size:h,rotation:a,fill:c,fillOpacity:d,stroke:u,strokeWidth:o,strokeOpacity:p,lineDash:g,lineDashOffset:m,label:{enabled:y,color:f,fontStyle:x,fontWeight:b,fontSize:v,fontFamily:S,spacing:M}}})}getTargetPoint(t){const{properties:e,originX:i,originY:s,horizontal:n,scale:a,gaugeRect:o}=this,{thickness:r}=e,{value:l,placement:h,spacing:c,size:d}=t,u=a.convert(l);let p;switch(h){case"before":p=-(c+d/2);break;case"after":p=r+c+d/2;break;default:p=r/2}return{x:i+o.x+(n?u:p),y:s+o.y+(n?p:u)}}getTargetLabel(t){const{size:e,placement:i,label:s}=t,{spacing:n,color:a,fontStyle:o,fontWeight:r,fontSize:l,fontFamily:h}=s,c=e/2+n;let d,u,p=0,g=0;return this.horizontal?(d="center","after"===i?(u="top",g=c):(u="bottom",g=-c)):(u="middle","before"===i?(d="right",p=-c):(d="left",p=c)),{offsetX:p,offsetY:g,fill:a,textAlign:d,textBaseline:u,fontStyle:o,fontWeight:r,fontSize:l,fontFamily:h,lineHeight:void 0}}labelDatum(t,e){const{placement:i,avoidCollisions:s,spacing:n,text:a,color:o,fontSize:r,minimumFontSize:l,fontStyle:h,fontWeight:c,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:m=t=>this.formatLabel(t.value)}=t;return{placement:i,avoidCollisions:s,spacing:n,text:a,value:e,fill:o,fontSize:r,minimumFontSize:l,fontStyle:h,fontWeight:c,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:m}}verticalLabelInset(){const{properties:t}=this,{label:e}=t,i=e.text?.split("\n"),s=ty(e,e.fontSize)*(i?.length??1);return e.spacing+s}horizontalLabelInset(){const{scale:t,properties:e}=this,{scale:i,label:s}=e,n=s.text?.split("\n"),a=s.getFont(),o=i.interval.values??t.ticks({nice:!1,interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5})?.ticks??[],r=(n??o?.map(t=>HM(this.id,this.ctx,this.labelDatum(s,t))??"")).reduce((t,e)=>{const{width:i}=Ok.measureText(e,{font:a});return Math.max(t,i)},0);return s.spacing+r}createNodeData(){const{id:t,properties:e,horizontal:i,scale:s,seriesRect:n}=this,{value:a,segmentation:o,thickness:r,cornerRadius:l,cornerMode:h,bar:c,scale:d,label:u}=e;let p,g;s.domain=[d.min,d.max],s.range=i?[0,n.width]:[n.height,0],i?(g=1,p=Math.PI/2):"before"===d.label.placement?(g=1,p=0):(g=-1,p=0);const m=p-Math.PI/2;let y,f,x,b;i?(y=0,f=n.width,x=(n.height-r)/2,b=x+r,"outside-start"===u.placement?y+=this.horizontalLabelInset():"outside-end"===u.placement&&(f-=this.horizontalLabelInset())):(y=(n.width-r)/2,f=y+r,b=0,x=n.height,"outside-start"===u.placement?x-=this.verticalLabelInset():"outside-end"===u.placement&&(b+=this.verticalLabelInset())),this.gaugeRect=new Ek(Math.min(y,f),Math.min(x,b),Math.abs(f-y),Math.abs(b-x)),s.domain=[d.min,d.max],s.range=i?[y,f]:[x,b];const{ticks:v}=this.tickGenerator.generateTicks({domain:s.domain,primaryTickCount:void 0,visibleRange:[0,1],niceMode:Kk.Off,labelX:0,parallelFlipRotation:p,regularFlipRotation:m,sideFlag:g,removeOverflowLabels:!1}).tickData,S=this.getTargets(),M=[],k=[],D=[],w=[],[I,C]=s.range,L=Math.abs(C-I),A=i?s.convert(a):f,T=i?b:s.convert(a),N=o.enabled?o.spacing/2:0,O=i?N:0,R=i?0:N,E=Math.min(c.thickness??Math.round(c.thicknessRatio*r),r),P=-(r-E)/2,B=i?0:P,F=i?P:0,z="item"===h,G=Math.ceil(L);let _=o.enabled?o.interval.getSegments(s,G):void 0;const j=c.fill??this.createLinearGradient(s,c.fills,c.fillMode),W=d.fill??(c.enabled&&0===d.fills.length?d.defaultFill:void 0)??this.createLinearGradient(s,d.fills,d.fillMode);if(null==_&&z){const t={value:a,segmentStart:Math.min(...s.domain),segmentEnd:Math.max(...s.domain)};if(c.enabled){const e=1*Math.min(l,E/2,L/2),s=i?e:0,n=i?0:e;M.push({series:this,itemId:"value",datum:t,datumIndex:{type:0},type:0,x0:0+y-s-B,y0:0+x-n-F,x1:0+A+s+B,y1:0+T+n+F,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:j,horizontalInset:O,verticalInset:R})}const e=1*Math.min(l,r/2,L/2),n=i?e:0,o=i?0:e;w.push({series:this,itemId:"scale",datum:t,datumIndex:{type:0},type:0,x0:0+y-n,y0:0+x-o,x1:0+f+n,y1:0+b+o,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:W,horizontalInset:O,verticalInset:R})}else{_??(_=s.domain);const t=0+y-B,e=0+x-F,n=0+A+B,o=0+T+F;for(let r=0;r<_.length-1;r+=1){const h=_[r+0],d=_[r+1],u={value:a,segmentStart:h,segmentEnd:d},p=0===r,g=r===_.length-2,m=s.convert(h),v=s.convert(d),S=z||p?l:0,k=z||g?l:0,D=i?S:k,I=k,C=i?k:S,L=S;c.enabled&&M.push({series:this,itemId:`value-${r}`,datum:u,datumIndex:{type:0},type:0,x0:0+(i?m:y),y0:0+(i?x:m),x1:0+(i?v:f),y1:0+(i?b:v),clipX0:t,clipY0:e,clipX1:n,clipY1:o,topLeftCornerRadius:D,topRightCornerRadius:I,bottomRightCornerRadius:C,bottomLeftCornerRadius:L,fill:j,horizontalInset:O,verticalInset:R}),w.push({series:this,itemId:`scale-${r}`,datum:u,datumIndex:{type:0},type:0,x0:0+(i?m:y),y0:0+(i?x:m),x1:0+(i?v:f),y1:0+(i?b:v),clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:D,topRightCornerRadius:I,bottomRightCornerRadius:C,bottomLeftCornerRadius:L,fill:W,horizontalInset:O,verticalInset:R})}}u.enabled&&D.push(this.labelDatum(u,a));const V=i?Uk:Xk;for(let t=0;t<S.length;t+=1){const e=S[t],{value:i,text:s,shape:n,size:a,fill:o,fillOpacity:r,stroke:l,strokeWidth:h,strokeOpacity:c,lineDash:d,lineDashOffset:u}=e,p=this.getTargetPoint(e),g=Rk(e.rotation+V[e.placement]);k.push({series:this,itemId:`target-${t}`,midPoint:p,datum:{value:i},datumIndex:{type:1,index:t},type:1,value:i,text:s,x:p.x,y:p.y,shape:n,size:a,rotation:g,fill:o,fillOpacity:r,stroke:l,strokeOpacity:c,strokeWidth:h,lineDash:d,lineDashOffset:u,label:this.getTargetLabel(e)})}return{itemId:t,nodeData:M,tickData:v,targetData:k,labelData:D,scaleData:w}}updateSelections(t){(this.nodeDataRefresh||t)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(t){if(null!=t&&t.series===this&&1===t.type)return t}update({seriesRect:t}){const{datumSelection:e,labelSelection:i,targetSelection:s,targetLabelSelection:n,scaleSelection:a,highlightTargetSelection:o,tickSelection:r}=this;this.seriesRect=t??Ek.NaN;const l=this.checkResize(t);this.updateSelections(l),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const h=this.contextNodeData?.nodeData??[],c=this.contextNodeData?.labelData??[],d=this.contextNodeData?.targetData??[],u=this.contextNodeData?.scaleData??[],p=this.contextNodeData?.tickData??[],g=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:u,scaleSelection:a}),this.updateScaleNodes({scaleSelection:a}),this.targetSelection=this.updateTargetSelection({targetData:d,targetSelection:s}),this.updateTargetNodes({targetSelection:s,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:d,targetLabelSelection:n}),this.updateTargetLabelNodes({targetLabelSelection:n}),this.datumSelection=this.updateDatumSelection({nodeData:h,datumSelection:e}),this.updateDatumNodes({datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:c,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:null!=g?[g]:[],targetSelection:o}),this.updateTargetNodes({targetSelection:o,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:p,tickSelection:r}),this.updateTickNodes({tickSelection:r}),l&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>Nk(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i,properties:n}=this,{bar:a}=n,{fillOpacity:o,stroke:r,strokeOpacity:l,lineDash:h,lineDashOffset:c}=a,d=this.getStrokeWidth(a.strokeWidth),u=i.animationManager.isSkipped(),p=this.getShapeFillBBox();e.each((t,e)=>{const{topLeftCornerRadius:i,topRightCornerRadius:n,bottomRightCornerRadius:a,bottomLeftCornerRadius:g,fill:m}=e;t.fill=m,t.fillBBox=p,t.fillOpacity=o,t.stroke=r,t.strokeOpacity=l,t.strokeWidth=d,t.lineDash=h,t.lineDashOffset=c,t.topLeftCornerRadius=i,t.topRightCornerRadius=n,t.bottomRightCornerRadius=a,t.bottomLeftCornerRadius=g,t.pointerEvents=this.properties.bar.enabled?s.n1.PointerEvents.All:s.n1.PointerEvents.None,(u||null==t.previousDatum)&&t.setProperties(Mk(0,e))}),this.datumUnion.update(e,this.itemGroup,s.n1.Rect,(t,e,i)=>{t.pointerEvents=s.n1.PointerEvents.None,t.clipBBox??(t.clipBBox=new Ek(NaN,NaN,NaN,NaN)),t.x=e.x,t.y=e.y,t.clipBBox.x=e.clipBBox?.x??e.x,t.clipBBox.y=e.clipBBox?.y??e.y,this.horizontal?(t.height=t.clipBBox.height=i.height,t.width=i===e?i.width:i.x+i.width,t.clipBBox.width=t.width-(i.width-(i.clipBBox?.width??i.width)),t.topLeftCornerRadius=e.topLeftCornerRadius,t.bottomLeftCornerRadius=e.bottomLeftCornerRadius,t.topRightCornerRadius=i.topRightCornerRadius,t.bottomRightCornerRadius=i.bottomRightCornerRadius):(t.width=t.clipBBox.width=i.width,t.height=i===e?i.height:i.x+i.height,t.clipBBox.height=t.height-(i.height-(i.clipBBox?.height??i.height)),t.topLeftCornerRadius=e.topLeftCornerRadius,t.topRightCornerRadius=e.topRightCornerRadius,t.bottomLeftCornerRadius=i.bottomLeftCornerRadius,t.bottomRightCornerRadius=i.bottomRightCornerRadius)})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>Nk(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,{scale:i}=this.properties,{fillOpacity:s,stroke:n,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=i,h=this.getShapeFillBBox();e.each((t,e)=>{const{topLeftCornerRadius:i,topRightCornerRadius:c,bottomRightCornerRadius:d,bottomLeftCornerRadius:u,fill:p}=e;t.fill=p,t.fillBBox=h,t.fillOpacity=s,t.stroke=n,t.strokeOpacity=a,t.strokeWidth=o,t.lineDash=r,t.lineDashOffset=l,t.topLeftCornerRadius=i,t.topRightCornerRadius=c,t.bottomRightCornerRadius=d,t.bottomLeftCornerRadius=u,t.setProperties(Mk(0,e))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,t=>t.itemId)}updateTargetNodes(t){const{targetSelection:e,isHighlight:i}=t,s=i?this.properties.highlightStyle.item:void 0;e.each((t,e)=>{const{x:i,y:n,shape:a,size:o,rotation:r,fill:l,fillOpacity:h,stroke:c,strokeOpacity:d,strokeWidth:u,lineDash:p,lineDashOffset:g}=e;t.size=o,t.shape="line"===a?XM:a,t.fill=s?.fill??l,t.fillOpacity=s?.fillOpacity??h,t.stroke=s?.stroke??c,t.strokeOpacity=s?.strokeOpacity??d,t.strokeWidth=s?.strokeWidth??u,t.lineDash=s?.lineDash??p,t.lineDashOffset=s?.lineDashOffset??g,t.translationX=i,t.translationY=n,t.rotation=r})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((t,e)=>{const{x:i,y:s,text:n}=e,{offsetX:a,offsetY:o,fill:r,fontStyle:l,fontWeight:h,fontSize:c,fontFamily:d,textAlign:u,textBaseline:p}=e.label;t.visible=!0,t.x=i+a,t.y=s+o,t.text=n,t.fill=r,t.fontStyle=l,t.fontWeight=h,t.fontSize=c,t.fontFamily=d,t.textAlign=u,t.textBaseline=p})}updateTickSelection(t){return t.tickSelection.update(t.tickData,void 0,t=>t.tickId)}updateTickNodes(t){const{gaugeRect:e,properties:i}=this,s=i.defaultScale,{enabled:n,color:a,fontFamily:o=s.label.fontFamily,fontSize:r=s.label.fontSize,fontStyle:l,fontWeight:h=s.label.fontWeight,spacing:c}=i.scale.label;let{placement:d}=i.scale.label;const u=Rk(i.scale.label.rotation??0);let p,g,m,y;this.horizontal?(d??(d="after"),p="center",g="before"===d?"bottom":"top",y=this.originY+e.y+("before"===d?-c:e.height+c)):(d??(d="before"),p="before"===d?"end":"start",g="middle",m=this.originX+e.x+("before"===d?-c:e.width+c)),t.tickSelection.each((t,e)=>{if(!n)return void(t.visible=!1);const i=m??e.translationY,s=y??e.translationY;t.visible=!0,t.text=e.tickLabel,t.fill=a,t.fontFamily=o,t.fontSize=r,t.fontStyle=l,t.fontWeight=h,t.textBaseline=g,t.textAlign=p,t.x=i,t.y=s,t.rotationCenterX=i,t.rotationCenterY=s,t.rotation=u})}updateLabelSelection(t){return t.labelSelection.update(t.labelData,void 0,t=>"primary")}updateLabelNodes(t){const{labelSelection:e}=t,i=this.ctx.animationManager.isSkipped();e.each((t,e)=>{t.fill=e.fill,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontFamily=e.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(null==t.text)return!1;return!0}formatLabelText(t){const{labelSelection:e,horizontal:i,scale:s,seriesRect:n,gaugeRect:a}=this,{x:o,y:r,width:l,height:h}=a,c=t?.label??this.properties.value;let d;if(i){const t=s.convert(c);d=new Ek(o,r,t-o,h)}else{const t=s.convert(c);d=new Ek(o,t,l,h-t)}const u={seriesRect:n,gaugeRect:a,barRect:d},{margin:p}=this.properties;!function(t,e,i,s,n,a){const{seriesRect:o,gaugeRect:r,barRect:l}=n,{padding:h,horizontal:c}=s;i.each((i,s)=>{const n=HM(t.id,e,s,a?.label);let d,u,p;if("outside-start"===s.placement?c?(d=r.x,u=o.height):(d=o.width,u=o.height-(r.y+r.height)):"outside-end"===s.placement?c?(d=o.width-(r.x+r.width),u=o.height):(d=o.width,u=r.y):s.avoidCollisions&&(d=r.width,u=r.height),null==n)return;if(null!=d&&null!=u){const t=iy(n,s,{padding:h},()=>({width:d,height:u,meta:null}));p=t?.[0]}else{const t={fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,fontFamily:s.fontFamily,lineHeight:s.lineHeight},{width:e,height:i}=fk.measureText(n,{font:t});p={text:n,fontSize:s.fontSize,lineHeight:ty(s,s.fontSize),width:e,height:i}}if(null==p)return void(i.visible=!1);const g=c?r.x:r.y+r.height,m=c?r.x+r.width:r.y,y=c?l.x:l.y+l.height,f=c?l.x+l.width:l.y,x=s.spacing*(c?1:-1);let b,v,S,M;switch(s.placement){case"outside-start":b=-1/0,v=1/0,S=g-x,M="Before";break;case"outside-end":b=-1/0,v=1/0,S=m+x,M="After";break;case"inside-start":b=g,v=f,S=g+x,M="After";break;case"inside-end":b=f,v=m,S=m-x,M="Before";break;case"inside-center":b=g,v=m,S=(g+m)/2,M="Center";break;case"bar-inside":b=y,v=f,S=(y+f)/2,M="Center";break;case"bar-inside-end":b=y,v=f,S=f-x,M="Before";break;case"bar-outside-end":b=f,v=m,S=f+x,M="After";break;case"bar-end":b=-1/0,v=1/0,S=f,M="Center"}const k=c?S:r.x+r.width/2,D=c?r.y+r.height/2:S;let w,I;c?(w=k+wk[M]*p.width,I=w+p.width):(w=D+Ik[M]*p.height,I=w+p.height);const C=Math.min(w,I)>=Math.min(b,v)&&Math.max(w,I)<=Math.max(b,v);!s.avoidCollisions||C?(i.visible=!0,i.text=p.text,i.fontSize=p.fontSize,i.lineHeight=p.lineHeight,i.textAlign=c?kk[M]:"center",i.textBaseline=c?"middle":Dk[M],i.x=k,i.y=D):i.visible=!1})}(this,this.ctx,e,{padding:p,horizontal:i},u,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),Lk([this.datumSelection],Mk),this.formatLabelText()}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t&&this.animationState.transition("skip")}animateLabelText(t={}){const{animationManager:e}=this.ctx;let i=0,s=0;if(this.labelSelection.each((e,n)=>{e.opacity=1,i=e.previousDatum?.value??t.from??n.value,s=n.value}),this.labelsHaveExplicitText());else if(i===s)this.formatLabelText({label:s});else{const n=`${this.id}_labels`;e.animate({id:n,groupId:"label",from:{label:i},to:{label:s},phase:t.phase??"update",ease:Yk.easeOut,onUpdate:t=>this.formatLabelText(t)})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=Sk(!0,this.horizontal);Ck(this.id,"node",t,[this.datumSelection],e,(t,e)=>e.itemId),Ck(this.id,"label",t,[this.labelSelection],YM,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=Sk(!1,this.horizontal);Ck(this.id,"node",t,[this.datumSelection],e,(t,e)=>e.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[0,1]}getSeriesRange(t,e){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(t){const{id:e,properties:i}=this,{tooltip:s}=i;let n,a;if(0===t.type?(n=i.value,a=i.label.text):({value:n,text:a}=i.targets[t.index]),null!=n)return this.formatTooltipWithContext(s,{data:[{label:a,fallbackLabel:"Value",value:this.formatLabel(n)}]},{seriesId:e,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(t){return ZM(this,t)}pickFocus(t){return qM(this,t)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(t){}datumIndexForCategoryValue(t){}};qk.className="LinearGaugeSeries",qk.type="linear-gauge";var Qk={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"linear-gauge",moduleFactory:t=>new qk(t),tooltipDefaults:{range:10},themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},s.n1.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./2",s.n1.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},label:{spacing:11}},bar:{strokeWidth:0},segmentation:{enabled:!1,interval:{},spacing:1},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},label:{enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[2]},minimumFontSize:12,spacing:18,color:{$ref:"backgroundColor"}},margin:4}}},Jk={type:"series",name:"linear-gauge",chartType:"gauge",enterprise:!0,options:s.n1.linearGaugeSeriesOptionsDef,create:t=>new qk(t)},tD={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1},gradientLegend:{enabled:!1}};function eD(t,e,i,s){const[n,a]=t,[o,r]=e,l=o-n,h=r-a,c=l*l+h*h;let d,u;if(Math.abs(c)<1e-9)d=n,u=a;else{let t=((i-n)*l+(s-a)*h)/c;t=Math.max(0,Math.min(1,t)),d=n+t*(o-n),u=a+t*(r-a)}const p=i-d,g=s-u;return p*p+g*g}function iD(t,e,i){let s=1/0,n=t[t.length-1];for(const a of t)s=Math.min(s,eD(n,a,e,i)),n=a;return Math.sqrt(s)}function sD(t){let[e,i]=t[0],s=0;for(let n=1;n<t.length;n+=1){const[a,o]=t[n];s+=Math.hypot(a-e,o-i),e=a,i=o}return s}function nD(t){if(0===t.length)return;const e=sD(t)/2;let[i,s]=t[0],n=0;for(let a=1;a<t.length;a+=1){const[o,r]=t[a],l=Math.hypot(o-i,r-s),h=n+l;if(h>e){const t=(e-n)/l;return{point:[i+(o-i)*t,s+(r-s)*t],angle:Math.atan2(r-s,o-i)}}n=h,i=o,s=r}}var{LonLatBBox:aD}=s.n1;function oD(t,e,i,s,n){return null==t?t=new aD(e,i,s,n):(t.lon0=Math.min(t.lon0,e),t.lat0=Math.min(t.lat0,i),t.lon1=Math.max(t.lon1,s),t.lat1=Math.max(t.lat1,n)),t}function rD(t,e){return t.forEach(t=>{const[i,s]=t;e=oD(e,i,s,i,s)}),e}function lD(t,e,i){let s=!1,n=1/0;for(const a of t){let t=a[a.length-1],[o,r]=t;for(const l of a){const[a,h]=l;h>i!=r>i&&e<(o-a)*(i-h)/(r-h)+a&&(s=!s),n=Math.min(n,eD(t,l,e,i)),t=l,o=a,r=h}}return(s?-1:1)*Math.sqrt(n)}var{Path:hD,ExtendedPath2D:cD,BBox:dD,SceneChangeDetection:uD,SceneObjectChangeDetection:pD,objectsEqual:gD}=s.n1,mD=class extends hD{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new cD}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:t}=this;this.strokePath.clear(),this.path.clear(),this.bbox=null!=t?this.drawGeometry(t,void 0):void 0}drawPath(t){super.drawPath(t),this.renderStroke(t,this.strokePath.getPath2D())}containsPoint(t,e){const{projectedGeometry:i}=this;return null!=i&&!!this.getBBox().containsPoint(t,e)&&this.geometryDistance(i,t,e)<=0}distanceSquared(t,e){const{projectedGeometry:i}=this;if(null==i)return 1/0;const s=this.geometryDistance(i,t,e);return s>0?s*s:0}geometryDistance(t,e,i){const{renderMode:s,strokeWidth:n}=this,a=!!(1&s),o=!!(2&s),r=Math.max(n/2,1)+1;switch(t.type){case"GeometryCollection":return t.geometries.reduce((t,s)=>Math.min(t,this.geometryDistance(s,e,i)),1/0);case"MultiPolygon":return a?t.coordinates.reduce((t,s)=>Math.min(t,Math.max(lD(s,e,i),0)),1/0):1/0;case"Polygon":return a?Math.max(lD(t.coordinates,e,i),0):1/0;case"MultiLineString":return o?t.coordinates.reduce((t,s)=>Math.min(t,Math.max(iD(s,e,i)-r,0)),1/0):1/0;case"LineString":return o?Math.max(iD(t.coordinates,e,i)-r,0):1/0;default:return 1/0}}drawGeometry(t,e){const{renderMode:i,path:s,strokePath:n}=this,a=!!(1&i),o=!!(2&i);switch(t.type){case"GeometryCollection":t.geometries.forEach(t=>{e=this.drawGeometry(t,e)});break;case"MultiPolygon":a&&t.coordinates.forEach(t=>{e=this.drawPolygon(s,t,e)});break;case"Polygon":a&&(e=this.drawPolygon(s,t.coordinates,e));break;case"LineString":o&&(e=this.drawLineString(n,t.coordinates,e,!1));break;case"MultiLineString":o&&t.coordinates.forEach(t=>{e=this.drawLineString(n,t,e,!1)})}return e}drawPolygon(t,e,i){if(e.length<1)return i;i=this.drawLineString(t,e[0],i,!0);for(let i=1;i<e.length;i+=1){const s=e[i];this.drawLineString(t,s,void 0,!0)}return i}drawLineString(t,e,i,s){if(e.length<2)return i;const n=s?e.length-1:e.length;for(let s=0;s<n;s+=1){const[n,a]=e[s];if(0===s?t.moveTo(n,a):t.lineTo(n,a),null==i)i=new dD(n,a,0,0);else{const{x:t,y:e}=i,s=t+i.width,o=e+i.height;i.x=Math.min(t,n),i.y=Math.min(e,a),i.width=Math.max(s,n)-i.x,i.height=Math.max(o,a)-i.y}}return s&&t.closePath(),i}};function yD(t,e){if(null!=t.bbox){const[i,s,n,a]=t.bbox;return e=oD(e,i,s,n,a)}switch(t.type){case"GeometryCollection":t.geometries.forEach(t=>{e=yD(t,e)});break;case"MultiPolygon":t.coordinates.forEach(t=>{t.length>0&&(e=rD(t[0],e))});break;case"Polygon":t.coordinates.length>0&&(e=rD(t.coordinates[0],e));break;case"MultiLineString":t.coordinates.forEach(t=>{e=rD(t,e)});break;case"LineString":e=rD(t.coordinates,e);break;case"MultiPoint":t.coordinates.forEach(t=>{const[i,s]=t;e=oD(e,i,s,i,s)});break;case"Point":{const[i,s]=t.coordinates;e=oD(e,i,s,i,s);break}}return e}function fD(t){switch(t.type){case"GeometryCollection":{let e,i;return t.geometries.forEach(t=>{const s=fD(t);if(null==s)return;const n=rD(s[0],void 0);if(null==n)return;const a=Math.abs(n.lat1-n.lat0)*Math.abs(n.lon1-n.lon0);(null==e||a>e)&&(e=a,i=s)}),i}case"MultiPolygon":{let e,i;return t.coordinates.forEach(t=>{const s=rD(t[0],void 0);if(null==s)return;const n=Math.abs(s.lat1-s.lat0)*Math.abs(s.lon1-s.lon0);(null==e||n>e)&&(e=n,i=t)}),i}case"Polygon":return t.coordinates;case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function xD(t){switch(t.type){case"GeometryCollection":{let e,i;return t.geometries.forEach(t=>{const s=xD(t);if(null==s)return;const n=sD(s);null!=n&&(null==e||n>e)&&(e=n,i=s)}),i}case"MultiLineString":{let e,i=0;return t.coordinates.forEach(t=>{const s=sD(t);s>i&&(i=s,e=t)}),e}case"LineString":return t.coordinates;case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function bD(t,e){if(null==t)return!1;switch(t.type){case"GeometryCollection":return t.geometries.some(t=>bD(t,e));case"MultiPolygon":case"Polygon":return!!(1&e);case"MultiLineString":case"LineString":return!!(2&e);case"MultiPoint":case"Point":return!!(4&e)}}function vD(t,e){switch(t.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:t.geometries.map(t=>vD(t,e))};case"Polygon":return{type:"Polygon",coordinates:MD(t.coordinates,e)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:SD(t.coordinates,e)};case"MultiLineString":return{type:"MultiLineString",coordinates:MD(t.coordinates,e)};case"LineString":return{type:"LineString",coordinates:kD(t.coordinates,e)};case"MultiPoint":return{type:"MultiPoint",coordinates:kD(t.coordinates,e)};case"Point":return{type:"Point",coordinates:e.convert(t.coordinates)}}}function SD(t,e){return t.map(t=>MD(t,e))}function MD(t,e){return t.map(t=>kD(t,e))}function kD(t,e){return t.map(t=>e.convert(t))}function DD(t,e){const i=t.contextNodeData?.nodeData[e.datumIndex];if(void 0!==i)for(const e of t.datumSelection.nodes())if(e.datum===i)return e}r([pD({equals:gD})],mD.prototype,"projectedGeometry",2),r([uD()],mD.prototype,"renderMode",2),s.n1.SeriesProperties;var wD=class extends s.n1.DataModelSeries{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)}))}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}},{Property:ID,SeriesProperties:CD,SeriesTooltip:LD,Label:AD}=s.n1,TD=class extends CD{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new AD,this.tooltip=new LD}};r([ID],TD.prototype,"topology",2),r([ID],TD.prototype,"title",2),r([ID],TD.prototype,"legendItemName",2),r([ID],TD.prototype,"idKey",2),r([ID],TD.prototype,"topologyIdKey",2),r([ID],TD.prototype,"idName",2),r([ID],TD.prototype,"labelKey",2),r([ID],TD.prototype,"labelName",2),r([ID],TD.prototype,"sizeKey",2),r([ID],TD.prototype,"sizeName",2),r([ID],TD.prototype,"colorKey",2),r([ID],TD.prototype,"colorName",2),r([ID],TD.prototype,"sizeDomain",2),r([ID],TD.prototype,"colorRange",2),r([ID],TD.prototype,"maxStrokeWidth",2),r([ID],TD.prototype,"stroke",2),r([ID],TD.prototype,"strokeOpacity",2),r([ID],TD.prototype,"strokeWidth",2),r([ID],TD.prototype,"lineDash",2),r([ID],TD.prototype,"lineDashOffset",2),r([ID],TD.prototype,"itemStyler",2),r([ID],TD.prototype,"label",2),r([ID],TD.prototype,"tooltip",2);var{getMissCount:ND,createDatumId:OD,SeriesNodePickMode:RD,valueProperty:ED,CachedTextMeasurerPool:PD,ColorScale:BD,LinearScale:FD,Selection:zD,Text:GD,Transformable:_D}=s.n1,jD=class extends wD{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[RD.EXACT_SHAPE_MATCH,RD.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new TD,this._chartTopology=void 0,this.colorScale=new BD,this.sizeScale=new FD,this.datumSelection=zD.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=zD.select(this.labelGroup,GD),this.highlightDatumSelection=zD.select(this.highlightNode,()=>this.nodeFactory()),this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&null!=this.topology}renderToOffscreenCanvas(){return!0}setSeriesIndex(t){return!!super.setSeriesIndex(t)&&(this.contentGroup.zIndex=[1,t],this.highlightGroup.zIndex=[2,t],!0)}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return null!=this.properties.labelKey&&this.properties.label.enabled}nodeFactory(){const t=new mD;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t}async processData(t){if(null==this.data)return;const{data:e,topology:i,sizeScale:s,colorScale:a}=this,{topologyIdKey:o,idKey:r,sizeKey:l,colorKey:h,labelKey:c,sizeDomain:d,colorRange:u}=this.properties,p=new Map;i?.features.forEach(t=>{const e=t.properties?.[o];null!=e&&bD(t.geometry,2)&&p.set(e,t)});const g=this.sizeScale.type,m=this.colorScale.type,y=this.scale?.type,{dataModel:f,processedData:x}=await this.requestDataModel(t,e,{props:[ED(r,y,{id:"idValue",includeProperty:!1}),ED(r,y,{id:"featureValue",includeProperty:!1,processor:()=>t=>p.get(t)}),...null!=c?[ED(c,"band",{id:"labelValue"})]:[],...null!=l?[ED(l,g,{id:"sizeValue"})]:[],...null!=h?[ED(h,m,{id:"colorValue"})]:[]]}),b=f.resolveColumnById(this,"featureValue",x);if(this.topologyBounds=b.reduce((t,e)=>{const i=e?.geometry;return null==i?t:yD(i,t)},void 0),null!=l){const t=f.resolveProcessedDataIndexById(this,"sizeValue"),e=x.domain.values[t]??[];s.domain=d??e}if(null!=u&&this.isColorScaleValid()){const t=f.resolveProcessedDataIndexById(this,"colorValue");a.domain=x.domain.values[t],a.range=u,a.update()}null==i&&n.Vy.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,a=ND(this,i.defs.values[s].missing);return!(0===n||n===a)}getLabelDatum(t,e,i,s){if(null==e||null==i)return;const n=xD(i);if(null==n)return;const{idKey:a,idName:o,sizeKey:r,sizeName:l,colorKey:h,colorName:c,labelKey:d,labelName:u,label:p}=this.properties,g=this.getLabelText(p,{value:e,datum:t,idKey:a,idName:o,sizeKey:r,sizeName:l,colorKey:h,colorName:c,labelKey:d,labelName:u});if(null==g)return;const m=PD.measureText(String(g),{font:s}),y=nD(n);if(null==y)return;const[f,x]=y.point,{width:b,height:v}=m;return{point:{x:f,y:x,size:0},label:{width:b,height:v,text:g},anchor:void 0,placement:void 0}}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:s,properties:a,scale:o}=this,{idKey:r,sizeKey:l,colorKey:h,labelKey:c,label:d}=a;if(null==e||null==i)return;const u=e.resolveColumnById(this,"idValue",i),p=e.resolveColumnById(this,"featureValue",i),g=null!=c?e.resolveColumnById(this,"labelValue",i):void 0,m=null!=l?e.resolveColumnById(this,"sizeValue",i):void 0,y=null!=h?e.resolveColumnById(this,"colorValue",i):void 0,f=a.maxStrokeWidth??a.strokeWidth;s.range=[Math.min(a.strokeWidth,f),f];const x=d.getFont(),b=new Map;i.dataSources.get(this.id)?.forEach((t,e)=>{const i=u[e],s=p[e]?.geometry??void 0,n=null!=s&&null!=o?vD(s,o):void 0;null!=i&&null!=n&&b.set(i,n)});const v=[],S=[],M=[];if((i.dataSources.get(this.id)??[]).forEach((t,e)=>{const i=u[e],s=y?.[e],n=m?.[e],a=g?.[e],o=b.get(i);null==o&&M.push(i);const l=this.getLabelDatum(t,a,o,x);null!=l&&S.push(l),v.push({series:this,itemId:r,datum:t,datumIndex:e,idValue:i,labelValue:a,colorValue:s,sizeValue:n,projectedGeometry:o})}),M.length>10){const t=M.length-10;M.length=10,M.push(`(+${t} more)`)}return M.length>0&&n.Vy.warnOnce("some data items do not have matches in the provided topology",M),{itemId:t,nodeData:v,labelData:S}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t,highlightDatumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let i=this.ctx.highlightManager?.getActiveHighlight();null==i||i.series===this&&null!=i.datum||(i=void 0);const s=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:null!=i?[i]:[],datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!0})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,t=>OD(t.idValue))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{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}}getItemStyleOverrides(t,e,i,s,n,a){const{id:o,properties:r,colorScale:l,sizeScale:h}=this,{colorRange:c,itemStyler:d}=r;let u;if(a||null==i||(u??(u={}),u.stroke=this.isColorScaleValid()?l.convert(i):c?.[0]??r.stroke),null!=s&&(u??(u={}),u.strokeWidth=h.convert(s,{clamp:!0})),null!=d){const i=this.cachedDatumCallback(OD(t,a?"highlight":"node"),()=>this.callWithContext(d,{seriesId:o,datum:e,highlighted:a,...n,...u}));u??(u={}),Object.assign(u,i)}return u}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getItemBaseStyle(i);e.each((t,e)=>{const{datum:n,datumIndex:a,colorValue:o,sizeValue:r,projectedGeometry:l}=e;if(null==l)return t.visible=!1,void(t.projectedGeometry=void 0);const h=this.getItemStyleOverrides(String(a),n,o,r,s,i);t.visible=!0,t.projectedGeometry=l,t.stroke=h?.stroke??s.stroke,t.strokeWidth=h?.strokeWidth??s.strokeWidth,t.strokeOpacity=h?.strokeOpacity??s.strokeOpacity,t.lineDash=h?.lineDash??s.lineDash,t.lineDashOffset=h?.lineDashOffset??s.lineDashOffset})}updatePlacedLabelData(t){this.labelSelection=this.labelSelection.update(t,t=>{t.pointerEvents=s.n1.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:a,fontFamily:o}=this.properties.label;e.each((t,{x:e,y:r,width:l,height:h,text:c})=>{t.visible=!0,t.x=e+l/2,t.y=r+h/2,t.text=c,t.fill=i,t.fontStyle=s,t.fontWeight=n,t.fontSize=a,t.fontFamily=o,t.textAlign="center",t.textBaseline="middle"})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:t,y:e}){let i,s=1/0;return this.datumSelection.each((n,a)=>{const o=n.distanceSquared(t,e);o<s&&(s=o,i=a)}),null!=i?{datum:i,distance:Math.sqrt(s)}:void 0}datumMidPoint(t){const{_previousDatumMidPoint:e}=this;if(e?.datum===t)return e.point;const i=t.projectedGeometry,s=null!=i?xD(i):void 0,n=null!=s?nD(s)?.point:void 0,a=null!=n?{x:n[0],y:n[1]}:void 0;return this._previousDatumMidPoint={datum:t,point:a},a}legendItemSymbol(t){const{dataModel:e,processedData:i,properties:s}=this,{strokeWidth:n,strokeOpacity:a,lineDash:o}=s;let{stroke:r}=s;if(null!=t&&this.isColorScaleValid()){const s=e.resolveColumnById(this,"colorValue",i)[t];r=this.colorScale.convert(s)}return{marker:{fill:void 0,fillOpacity:0,stroke:void 0,strokeWidth:0,strokeOpacity:0,lineDash:[0],lineDashOffset:0,enabled:!1},line:{stroke:r,strokeWidth:n,strokeOpacity:a,lineDash:o}}}getLegendData(t){const{processedData:e,dataModel:i}=this;if(null==e||null==i)return[];const{id:s,visible:n}=this,{title:a,legendItemName:o,idKey:r,idName:l,colorKey:h,colorName:c,colorRange:d,showInLegend:u}=this.properties;return"gradient"===t&&null!=h&&null!=d?[{legendType:"gradient",enabled:n,seriesId:s,colorName:c,colorRange:d,colorDomain:e.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")]}]:"category"===t?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:o??a??l??r},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!u}]:[]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{idKey:a,idName:o,colorKey:r,colorName:l,sizeKey:h,sizeName:c,labelKey:d,labelName:u,title:p,legendItemName:g,tooltip:m}=n;if(!i||!s)return;const y=s.dataSources.get(this.id)?.[t],f=i.resolveColumnById(this,"idValue",s),x=[],b=null!=h?i.resolveColumnById(this,"sizeValue",s)[t]:void 0,v=null!=r?i.resolveColumnById(this,"colorValue",s)[t]:void 0;if(null!=h&&x.push({label:c,fallbackLabel:h,value:String(b)}),null!=r&&x.push({label:l,fallbackLabel:r,value:String(v)}),null!=d&&d!==a){const e=i.resolveColumnById(this,"labelValue",s)[t];x.push({label:u,fallbackLabel:d,value:e})}const S=this.getItemBaseStyle(!1);return Object.assign(S,this.getItemStyleOverrides(String(t),t,v,b,S,!1)),this.formatTooltipWithContext(m,{heading:f[t],title:p??g,symbol:this.legendItemSymbol(t),data:x},{seriesId:e,datum:y,title:p,idKey:a,idName:o,colorKey:r,colorName:l,sizeKey:h,sizeName:c,labelKey:d,labelName:u,...S})}computeFocusBounds(t){const e=DD(this,t);return e?_D.toCanvas(this.contentGroup,e.getBBox()):void 0}};jD.className="MapLineSeries",jD.type="map-line";var{commonSeriesOptionsDefs:WD,mapLineSeriesThemeableOptionsDef:VD,without:KD}=s.n1,YD={...VD,...KD(WD,["highlightStyle"]),type:(0,n.mw)((0,n.dY)("map-line")),idKey:(0,n.mw)(n.Yj),sizeKey:n.Yj,colorKey:n.Yj,labelKey:n.Yj,idName:n.Yj,sizeName:n.Yj,colorName:n.Yj,labelName:n.Yj,topology:n.eW,topologyIdKey:n.Yj,legendItemName:n.Yj,title:n.Yj};YD.colorRange=(0,n._L)((0,n.Uo)((0,n.jk)(n.yW),(0,n.O9)(1)));var $D={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line",moduleFactory:t=>new jD(t),tooltipDefaults:{range:"exact"},themeTemplate:{...tD,series:{stroke:s.n1.SAFE_STROKE_FILL_OPERATION,colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},s.n1.SAFE_RANGE2_OPERATION]},strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},tooltip:{range:"exact"}}},HD={type:"series",name:"map-line",chartType:"topology",enterprise:!0,options:YD,create:t=>new jD(t)},{Property:UD,SeriesProperties:XD,SeriesTooltip:ZD}=s.n1,qD=class extends XD{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=new ZD}};r([UD],qD.prototype,"topology",2),r([UD],qD.prototype,"stroke",2),r([UD],qD.prototype,"strokeOpacity",2),r([UD],qD.prototype,"strokeWidth",2),r([UD],qD.prototype,"lineDash",2),r([UD],qD.prototype,"lineDashOffset",2),r([UD],qD.prototype,"tooltip",2);var{createDatumId:QD,SeriesNodePickMode:JD,Group:tw,Selection:ew,PointerEvents:iw}=s.n1,sw=class extends wD{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[JD.EXACT_SHAPE_MATCH]}),this.properties=new qD,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new tw({name:"itemGroup"})),this.datumSelection=ew.select(this.itemGroup,()=>this.nodeFactory())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return!!super.setSeriesIndex(t)&&(this.contentGroup.zIndex=[0,t,0],this.highlightGroup.zIndex=[0,t,1],!0)}nodeFactory(){const t=new mD;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t.pointerEvents=iw.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((t,e)=>{const i=e.geometry;return null==i?t:yD(i,t)},void 0),null==t&&n.Vy.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:t,topology:e,scale:i}=this;if(null==e)return;const s=[];return e.features.forEach((t,e)=>{const{geometry:n}=t,a=null!=n&&null!=i?vD(n,i):void 0;null!=a&&s.push({series:this,itemId:e,datum:t,datumIndex:0,index:e,projectedGeometry:a})}),{itemId:t,nodeData:s,labelData:[]}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible;const{nodeData:e=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:e,datumSelection:t}),this.updateDatumNodes({datumSelection:t})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,t=>QD(t.index))}updateDatumNodes(t){const{properties:e}=this,{datumSelection:i}=t,{stroke:s,strokeOpacity:n,lineDash:a,lineDashOffset:o}=e,r=this.getStrokeWidth(e.strokeWidth);i.each((t,e)=>{const{projectedGeometry:i}=e;if(null==i)return t.visible=!1,void(t.projectedGeometry=void 0);t.visible=!0,t.projectedGeometry=i,t.stroke=s,t.strokeWidth=r,t.strokeOpacity=n,t.lineDash=a,t.lineDashOffset=o})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}computeFocusBounds(t){}};sw.className="MapLineBackgroundSeries",sw.type="map-line-background";var{mapLineBackgroundSeriesThemeableOptionsDef:nw}=s.n1,aw={...nw,type:(0,n.mw)((0,n.dY)("map-line-background")),topology:n.eW},ow={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line-background",moduleFactory:t=>new sw(t),tooltipDefaults:{range:"exact"},themeTemplate:{...tD,series:{stroke:{$path:["./1",{$palette:"stroke"},{$palette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}}},rw={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,options:aw,create:t=>new sw(t)},lw=(t,e,i)=>{let s=t,n=s;for(const t of e)if(null==s||i(s.value,t)>0)s={value:t,next:s},n=s;else{for(;null!=n.next&&i(n.next.value,t)<=0;)n=n.next;n.next={value:t,next:n.next}}return s};function hw(t,e,i){const s=rD(t[0],void 0);if(null==s)return;const n=(s.lon0+s.lon1)/2,a=(s.lat0+s.lat1)/2,o=Math.abs(s.lon1-s.lon0),r=Math.abs(s.lat1-s.lat0),l=function(t){if(0===t.length)return;let e=0,i=0,s=0,[n,a]=t[t.length-1];for(const[o,r]of t){const t=n*r-o*a;s+=t,e+=(n+o)*t,i+=(a+r)*t,n=o,a=r}return s*=3,[e/s,i/s]}(t[0]),[h,c]=l,d=-lD(t,h,c);let u;const p=(t,e)=>t-.5*Math.max(e-d,0),g=(e,s,n)=>{const{distance:a,maxDistance:o}=i(t,e,s,n),r=Math.hypot(h-e,c-s),l=Math.min(Math.max(h,e-n/2),e+n/2),d=Math.min(Math.max(c,s-n/2),s+n/2),u=Math.hypot(h-l,c-d);return{distance:a,maxDistance:o,value:p(a,r),maxValue:p(o,u),x:e,y:s,stride:n}},m=(t,e,i,s)=>{const n=g(e,i,s);n.maxDistance>=0&&t.push(n)},y=Math.min(o,r)/2;let f={value:g(n,a,y),next:null};for(;null!=f;){const t=f.value,{distance:i,value:s,maxValue:n,x:a,y:o,stride:r}=t;if(f=f.next,i>0&&(null==u||s>u.value)&&(u=t),null!=u&&n-u.value<=e)continue;const l=r/2,h=[];m(h,a-l,o-l,l),m(h,a+l,o-l,l),m(h,a-l,o+l,l),m(h,a+l,o+l,l),h.sort(cw),f=lw(f,h,cw)}if(null==u)return;const{distance:x,x:b,y:v}=u;return{x:b,y:v,distance:x}}var cw=(t,e)=>e.maxValue-t.maxValue;function dw(t,e){const i=hw(t,e,(t,e,i,s)=>{const n=-lD(t,e,i);return{distance:n,maxDistance:n+s*Math.SQRT2}});if(null==i)return;const{x:s,y:n}=i;return[s,n]}function uw(t,e){let i;switch(t.type){case"GeometryCollection":return t.geometries.flatMap(t=>uw(t,e));case"MultiPoint":return t.coordinates;case"Point":return[t.coordinates];case"MultiPolygon":{const s=fD(t);i=null!=s?dw(s,e):void 0;break}case"Polygon":{const s=t.coordinates;i=null!=s?dw(s,e):void 0;break}case"MultiLineString":{const e=xD(t);i=null!=e?nD(e)?.point:void 0;break}case"LineString":{const e=t.coordinates;i=nD(e)?.point;break}}return null!=i?[i]:[]}var{BBox:pw}=s.n1;function gw(t){if(!t)return;const{range:e}=t,i=e[0][0],s=e[0][1],n=e[1][0]-i,a=e[1][1]-s,o=new pw(i,s,n,a);return{series:o,axis:o}}var{FillGradientDefaults:mw,FillPatternDefaults:yw,FillImageDefaults:fw,Property:xw,SeriesProperties:bw,SeriesTooltip:vw,Label:Sw}=s.n1,Mw=class extends Sw{constructor(){super(...arguments),this.placement="bottom"}};r([xw],Mw.prototype,"placement",2);var kw=class extends bw{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.shape="circle",this.size=6,this.fill="black",this.fillGradientDefaults=new mw,this.fillPatternDefaults=new yw,this.fillImageDefaults=new fw,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new Mw,this.tooltip=new vw}};r([xw],kw.prototype,"topology",2),r([xw],kw.prototype,"title",2),r([xw],kw.prototype,"legendItemName",2),r([xw],kw.prototype,"idKey",2),r([xw],kw.prototype,"topologyIdKey",2),r([xw],kw.prototype,"idName",2),r([xw],kw.prototype,"latitudeKey",2),r([xw],kw.prototype,"latitudeName",2),r([xw],kw.prototype,"longitudeKey",2),r([xw],kw.prototype,"longitudeName",2),r([xw],kw.prototype,"labelKey",2),r([xw],kw.prototype,"labelName",2),r([xw],kw.prototype,"sizeKey",2),r([xw],kw.prototype,"sizeName",2),r([xw],kw.prototype,"colorKey",2),r([xw],kw.prototype,"colorName",2),r([xw],kw.prototype,"colorRange",2),r([xw],kw.prototype,"shape",2),r([xw],kw.prototype,"size",2),r([xw],kw.prototype,"maxSize",2),r([xw],kw.prototype,"sizeDomain",2),r([xw],kw.prototype,"fill",2),r([xw],kw.prototype,"fillGradientDefaults",2),r([xw],kw.prototype,"fillPatternDefaults",2),r([xw],kw.prototype,"fillImageDefaults",2),r([xw],kw.prototype,"fillOpacity",2),r([xw],kw.prototype,"stroke",2),r([xw],kw.prototype,"strokeWidth",2),r([xw],kw.prototype,"strokeOpacity",2),r([xw],kw.prototype,"lineDash",2),r([xw],kw.prototype,"lineDashOffset",2),r([xw],kw.prototype,"itemStyler",2),r([xw],kw.prototype,"label",2),r([xw],kw.prototype,"tooltip",2);var{CachedTextMeasurerPool:Dw,fromToMotion:ww,StateMachine:Iw,getMissCount:Cw,createDatumId:Lw,SeriesNodePickMode:Aw,valueProperty:Tw,computeMarkerFocusBounds:Nw,ColorScale:Ow,LinearScale:Rw,Group:Ew,Selection:Pw,Text:Bw,Marker:Fw,applyShapeStyle:zw,getShapeStyle:Gw}=s.n1,_w=class extends wD{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[Aw.EXACT_SHAPE_MATCH,Aw.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new kw,this._chartTopology=void 0,this.colorScale=new Ow,this.sizeScale=new Rw,this.markerGroup=this.contentGroup.appendChild(new Ew({name:"markerGroup"})),this.labelSelection=Pw.select(this.labelGroup,Bw,!1),this.markerSelection=Pw.select(this.markerGroup,Fw,!1),this.highlightMarkerSelection=Pw.select(this.highlightNode,Fw),this.animationState=new Iw("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const t=null!=this.properties.latitudeKey&&null!=this.properties.longitudeKey;return super.hasData&&(null!=this.topology||t)}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return!!super.setSeriesIndex(t)&&(this.contentGroup.zIndex=[3,t],this.highlightGroup.zIndex=[4,t],!0)}isLabelEnabled(){return null!=this.properties.labelKey&&this.properties.label.enabled}async processData(t){if(null==this.data)return;const{data:e,topology:i,sizeScale:s,colorScale:n}=this,{topologyIdKey:a,idKey:o,latitudeKey:r,longitudeKey:l,sizeKey:h,colorKey:c,labelKey:d,sizeDomain:u,colorRange:p}=this.properties,g=new Map;i?.features.forEach(t=>{const e=t.properties?.[a];null!=e&&g.set(e,t)});const m=this.sizeScale.type,y=this.colorScale.type,f=this.scale?.type,x=null!=r&&null!=l,{dataModel:b,processedData:v}=await this.requestDataModel(t,e,{props:[...null!=o?[Tw(o,f,{id:"idValue",includeProperty:!1}),Tw(o,f,{id:"featureValue",includeProperty:!1,processor:()=>t=>g.get(t)})]:[],...x?[Tw(r,f,{id:"latValue"}),Tw(l,f,{id:"lonValue"})]:[],...d?[Tw(d,"band",{id:"labelValue"})]:[],...h?[Tw(h,m,{id:"sizeValue"})]:[],...c?[Tw(c,y,{id:"colorValue"})]:[]]}),S=null!=o?b.resolveColumnById(this,"featureValue",v):void 0,M=x?b.resolveColumnById(this,"latValue",v):void 0,k=x?b.resolveColumnById(this,"lonValue",v):void 0;if(this.topologyBounds=v.dataSources.get(this.id)?.reduce((t,e,i)=>{const s=S?.[i],n=s?.geometry;if(null!=n&&(t=yD(n,t)),null!=M&&null!=k){const e=k[i],s=M[i];t=oD(t,e,s,e,s)}return t},void 0),null!=h){const t=b.resolveProcessedDataIndexById(this,"sizeValue"),e=v.domain.values[t]??[];s.domain=u??e}if(null!=p&&this.isColorScaleValid()){const t=b.resolveProcessedDataIndexById(this,"colorValue");n.domain=v.domain.values[t],n.range=p,n.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,a=Cw(this,i.defs.values[s].missing);return!(0===n||n===a)}getLabelDatum(t,e,i,s,n,a){if(null==e)return;const{idKey:o,idName:r,latitudeKey:l,latitudeName:h,longitudeKey:c,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:m,labelKey:y,labelName:f,label:x,shape:b}=this.properties,{placement:v}=x,S=this.getLabelText(x,{value:e,datum:t,idKey:o,idName:r,latitudeKey:l,latitudeName:h,longitudeKey:c,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:m,labelKey:y,labelName:f});if(null==S)return;const{width:M,height:k}=Dw.measureText(String(S),{font:a});return{point:{x:i,y:s,size:n},label:{width:M,height:k,text:S},anchor:Fw.anchor(b),placement:v}}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:s,properties:a,scale:o}=this,{idKey:r,latitudeKey:l,longitudeKey:h,sizeKey:c,colorKey:d,labelKey:u,label:p}=a;if(null==e||null==i||null==o)return;const g=null!=l&&null!=h,m=null!=r?e.resolveColumnById(this,"idValue",i):void 0,y=null!=r?e.resolveColumnById(this,"featureValue",i):void 0,f=g?e.resolveColumnById(this,"latValue",i):void 0,x=g?e.resolveColumnById(this,"lonValue",i):void 0,b=null!=u?e.resolveColumnById(this,"labelValue",i):void 0,v=null!=c?e.resolveColumnById(this,"sizeValue",i):void 0,S=null!=d?e.resolveColumnById(this,"colorValue",i):void 0,M=a.maxSize??a.size;s.range=[Math.min(a.size,M),M];const k=p.getFont();let D;null!=m&&null!=y&&(D=new Map,i.dataSources.get(this.id)?.forEach((t,e)=>{const i=m[e],s=y[e]?.geometry??void 0,n=null!=s&&null!=o?vD(s,o):void 0;null!=i&&null!=n&&D.set(i,n)}));const w=[],I=[],C=[];if((i.dataSources.get(this.id)??[]).forEach((t,e)=>{const i=m?.[e],n=x?.[e],r=f?.[e],h=S?.[e],c=v?.[e],d=b?.[e],u=null!=c?s.convert(c,{clamp:!0}):a.size,p=null!=i?D?.get(i):void 0;if(null!=i&&null==vD&&C.push(i),null!=n&&null!=r){const[s,a]=o.convert([n,r]),p=this.getLabelDatum(t,d,s,a,u,k);p&&I.push(p),w.push({series:this,itemId:l,datum:t,datumIndex:e,index:-1,idValue:i,lonValue:n,latValue:r,labelValue:d,sizeValue:c,colorValue:h,point:{x:s,y:a,size:u},midPoint:{x:s,y:a}})}else null!=p&&uw(p,1).forEach(([s,a],o)=>{const p=this.getLabelDatum(t,d,s,a,u,k);p&&I.push(p),w.push({series:this,itemId:l,datum:t,datumIndex:e,index:o,idValue:i,lonValue:n,latValue:r,labelValue:d,sizeValue:c,colorValue:h,point:{x:s,y:a,size:u},midPoint:{x:s,y:a}})})}),C.length>10){const t=C.length-10;C.length=10,C.push(`(+${t} more)`)}return C.length>0&&n.Vy.warnOnce("some data items do not have matches in the provided topology",C),{itemId:t,nodeData:w,labelData:I}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale!==this.scale&&(this.previousScale=this.scale,!0)}update({seriesRect:t}){const e=this.checkResize(t),i=this.checkScaleChange(),{markerSelection:s,highlightMarkerSelection:n}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let a=this.ctx.highlightManager?.getActiveHighlight();null==a||a.series===this&&null!=a.datum||(a=void 0);const o=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:o,markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!1,highlightedDatum:a}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:null!=a?[a]:[],markerSelection:n}),this.updateMarkerNodes({markerSelection:n,isHighlight:!0,highlightedDatum:a}),(i||e)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(t){this.labelSelection=this.labelSelection.update(t,t=>{t.pointerEvents=s.n1.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:a,fontFamily:o}=this.properties.label;e.each((t,{x:e,y:r,width:l,height:h,text:c})=>{t.visible=!0,t.x=e+l/2,t.y=r+h/2,t.text=c,t.fill=i,t.fontStyle=s,t.fontWeight=n,t.fontSize=a,t.fontFamily=o,t.textAlign="center",t.textBaseline="middle"})}updateMarkerSelection(t){const{markerData:e,markerSelection:i}=t;return i.update(e,void 0,t=>Lw([t.index,t.idValue,t.lonValue,t.latValue]))}getMarkerItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return Gw({shape:e.shape,size:e.size,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},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getMarkerItemStyleOverrides(t,e,i,s,n,a){const{id:o,properties:r,colorScale:l,sizeScale:h}=this,{colorRange:c,itemStyler:d}=r;let u;if(u??(u={}),a||null==i||(u.fill=this.isColorScaleValid()?l.convert(i):c?.[0]??r.fill),null!=s&&(u.size=h.convert(s,{clamp:!0})),null!=d){const i=this.cachedDatumCallback(Lw(t,a?"highlight":"node"),()=>this.callWithContext(d,{seriesId:o,datum:e,highlighted:a,...n,...u}));u??(u={}),Object.assign(u,i)}return u}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i,highlightedDatum:s}=t,n=this.getMarkerItemBaseStyle(i),a=gw(this.scale);e.each((t,e)=>{const{datumIndex:o,datum:r,point:l,colorValue:h,sizeValue:c}=e,d=this.getMarkerItemStyleOverrides(String(o),r,h,c,n,i);t.shape=d?.shape??n.shape,t.size=d?.size??n.size,zw(t,n,d,a),t.x=l.x,t.y=l.y,t.scalingCenterX=l.x,t.scalingCenterY=l.y,t.zIndex=i||null==s||r!==s.datum?0:1})}isProcessedDataAnimatable(){return!0}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup()}animateMarkers(){const{animationManager:t}=this.ctx;ww(this.id,"markers",t,[this.markerSelection,this.highlightMarkerSelection],{fromFn:(t,e,i)=>"removed"===i?{scalingX:1,scalingY:1}:null==t.previousDatum?{scalingX:0,scalingY:0}:{scalingX:t.scalingX,scalingY:t.scalingY},toFn:(t,e,i)=>"removed"===i?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}})}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(t){const{x:e,y:i}=t;let s,n=1/0;return this.contextNodeData?.nodeData.forEach(t=>{const{x:a,y:o,size:r}=t.point,l=Math.max(Math.abs(a-e)-r,0),h=Math.max(Math.abs(o-i)-r,0),c=l*l+h*h;c<n&&(n=c,s=t)}),null!=s?{datum:s,distance:Math.sqrt(n)}:void 0}legendItemSymbol(t){const{dataModel:e,processedData:i,properties:s}=this,{shape:n,fillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,lineDash:h,lineDashOffset:c}=s;let{fill:d}=s;if(null!=t&&this.isColorScaleValid()){const s=e.resolveColumnById(this,"colorValue",i)[t];d=this.colorScale.convert(s)}return{marker:Gw({shape:n,fill:d,fillOpacity:a,stroke:o,strokeWidth:r,strokeOpacity:l,lineDash:h,lineDashOffset:c},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}}getLegendData(t){const{processedData:e,dataModel:i}=this;if(null==e||null==i)return[];const{id:s,visible:n}=this,{title:a,legendItemName:o,idName:r,idKey:l,colorKey:h,colorName:c,colorRange:d,showInLegend:u}=this.properties;return"gradient"===t&&null!=h&&null!=d?[{legendType:"gradient",enabled:n,seriesId:s,colorName:c,colorRange:d,colorDomain:e.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")]}]:"category"===t?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:o??a??r??l??s},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!u}]:[]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{idKey:a,idName:o,latitudeKey:r,latitudeName:l,longitudeKey:h,longitudeName:c,colorKey:d,colorName:u,sizeKey:p,sizeName:g,labelKey:m,labelName:y,title:f,legendItemName:x,tooltip:b}=n;if(!i||!s)return;const v=s.dataSources.get(this.id)?.[t],S=null!=p?i.resolveColumnById(this,"sizeValue",s)[t]:void 0,M=null!=d?i.resolveColumnById(this,"colorValue",s)[t]:void 0,k=[];if(null!=S&&k.push({label:g,fallbackLabel:p,value:String(S)}),null!=M&&k.push({label:u,fallbackLabel:d,value:String(M)}),null!=m&&m!==a){const e=i.resolveColumnById(this,"labelValue",s)[t];k.push({label:y,fallbackLabel:m,value:e})}let D;if(null!=a)D=i.resolveColumnById(this,"idValue",s)[t];else if(null!=r&&null!=h){const e=i.resolveColumnById(this,"latValue",s)[t],n=i.resolveColumnById(this,"lonValue",s)[t];D=`${Math.abs(e).toFixed(4)}° ${e>=0?"N":"S"}, ${Math.abs(n).toFixed(4)}° ${n>=0?"W":"E"}`}const w=this.getMarkerItemBaseStyle(!1);return Object.assign(w,this.getMarkerItemStyleOverrides(String(t),t,M,S,w,!1)),this.formatTooltipWithContext(b,{heading:D,title:f??x,symbol:this.legendItemSymbol(t),data:k},{seriesId:e,datum:v,title:f,idKey:a,idName:o,latitudeKey:r,latitudeName:l,longitudeKey:h,longitudeName:c,colorKey:d,colorName:u,sizeKey:p,sizeName:g,labelKey:m,labelName:y,...w})}getFormattedMarkerStyle(t){const{datumIndex:e,colorValue:i,sizeValue:s}=t,n=this.getMarkerItemBaseStyle(!1);return Object.assign(n,this.getMarkerItemStyleOverrides(String(e),e,i,s,n,!1)),{size:n.size}}computeFocusBounds(t){return Nw(this,t)}};_w.className="MapMarkerSeries",_w.type="map-marker";var{commonSeriesOptionsDefs:jw,mapMarkerSeriesThemeableOptionsDef:Ww,without:Vw}=s.n1,Kw={...Ww,...Vw(jw,["highlightStyle"]),type:(0,n.mw)((0,n.dY)("map-marker")),idKey:n.Yj,latitudeKey:n.Yj,longitudeKey:n.Yj,sizeKey:n.Yj,colorKey:n.Yj,labelKey:n.Yj,idName:n.Yj,latitudeName:n.Yj,longitudeName:n.Yj,sizeName:n.Yj,colorName:n.Yj,labelName:n.Yj,topology:n.eW,topologyIdKey:n.Yj,legendItemName:n.Yj,title:n.Yj},Yw={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-marker",moduleFactory:t=>new _w(t),tooltipDefaults:{range:"exact"},themeTemplate:{...tD,series:{shape:"circle",maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},s.n1.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,fillOpacity:.5,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},tooltip:{range:"exact"}}},$w={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,options:Kw,create:t=>new _w(t),validate(t,e,i){const s=(0,n.tf)(t,e,i),{cleared:a,invalid:o}=s;if(null==a?.idKey&&(null==a?.latitudeKey||null==a?.longitudeKey)){const t=t=>i?`${i}.${t}`:t,e=`Either \`${t("idKey")}\` or both \`${t("latitudeKey")}\` and \`${t("longitudeKey")}\` are required.`;o.push(new n.yI("required",e,null,i))}return s}};function Hw(t,e,i,s,n){const[a,o]=t,[r,l]=e,h=1/n,c=r-a,d=l-o,[u,p]=o<=l?t:e,[g,m]=a<=r?t:e,[y,f]=o<=l?e:t,[x,b]=a<=r?e:t;let v=1/0;if(0!==c){const t=d/c;for(let e=0;e<=1;e+=1){const n=0===e?h:-h,r=(t*a-o-n*i+s)/(t-n);if(r>=g&&r<=x){const t=2*Math.abs(i-r);v=Math.min(v,t)}}}else for(let t=0;t<=1;t+=1){const e=(0===t?h:-h)*(a-i)+s;if(e>=p&&e<=f){const t=2*Math.abs(s-e)*n;v=Math.min(v,t)}}const S=n,M=Math.abs((u-i)/(p-s)),k=Math.abs((y-i)/(f-s));if(f<s&&k<S){const t=2*Math.abs(s-f)*n;v=Math.min(v,t)}else if(p>s&&M<S){const t=2*Math.abs(s-p)*n;v=Math.min(v,t)}const D=Math.abs((m-s)/(g-i)),w=Math.abs((b-s)/(x-i));if(x<i&&w<h){const t=2*Math.abs(i-x);v=Math.min(v,t)}else if(g>i&&D<h){const t=2*Math.abs(i-g);v=Math.min(v,t)}return v}function Uw(t,e,i){i>=e&&(t.maxX=Math.min(t.maxX,i-e)),i<=e&&(t.minX=Math.max(t.minX,i-e))}function Xw(t,e,i,s,n,a){const o=n-a/2,r=n+a/2,[l,h]=e,[c,d]=i,u=c-l,p=d-h,[g,m]=l<=c?e:i,[y,f]=l<=c?i:e;if(0!==u){const e=p/u;for(let i=0;i<=1;i+=1){const n=((0===i?o:r)-h)/e+l;n>=g&&n<=y&&Uw(t,s,n)}}else Math.max(o,Math.min(h,d))<=Math.min(r,Math.max(h,d))&&Uw(t,s,l);return y<s&&f>=o&&f<=r?Uw(t,s,y):g>s&&m>=o&&m<=r&&Uw(t,s,g),t}var{Property:Zw,SeriesProperties:qw,SeriesTooltip:Qw,FillGradientDefaults:Jw,FillPatternDefaults:tI,FillImageDefaults:eI}=s.n1,iI=class extends qw{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.idName=void 0,this.topologyIdKey="name",this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.fill="black",this.fillGradientDefaults=new Jw,this.fillPatternDefaults=new tI,this.fillImageDefaults=new eI,this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new hy,this.tooltip=new Qw}};r([Zw],iI.prototype,"topology",2),r([Zw],iI.prototype,"title",2),r([Zw],iI.prototype,"legendItemName",2),r([Zw],iI.prototype,"idKey",2),r([Zw],iI.prototype,"idName",2),r([Zw],iI.prototype,"topologyIdKey",2),r([Zw],iI.prototype,"labelKey",2),r([Zw],iI.prototype,"labelName",2),r([Zw],iI.prototype,"colorKey",2),r([Zw],iI.prototype,"colorName",2),r([Zw],iI.prototype,"colorRange",2),r([Zw],iI.prototype,"fill",2),r([Zw],iI.prototype,"fillGradientDefaults",2),r([Zw],iI.prototype,"fillPatternDefaults",2),r([Zw],iI.prototype,"fillImageDefaults",2),r([Zw],iI.prototype,"fillOpacity",2),r([Zw],iI.prototype,"stroke",2),r([Zw],iI.prototype,"strokeOpacity",2),r([Zw],iI.prototype,"strokeWidth",2),r([Zw],iI.prototype,"lineDash",2),r([Zw],iI.prototype,"lineDashOffset",2),r([Zw],iI.prototype,"padding",2),r([Zw],iI.prototype,"itemStyler",2),r([Zw],iI.prototype,"label",2),r([Zw],iI.prototype,"tooltip",2);var{getMissCount:sI,createDatumId:nI,SeriesNodePickMode:aI,valueProperty:oI,CachedTextMeasurerPool:rI,TextUtils:lI,ColorScale:hI,Group:cI,Selection:dI,Text:uI,PointerEvents:pI,applyShapeStyle:gI,getShapeStyle:mI}=s.n1,yI=s.n1.MercatorScale.fixedScale(),fI=class extends wD{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[aI.EXACT_SHAPE_MATCH,aI.NEAREST_NODE]}),this.properties=new iI,this._chartTopology=void 0,this.colorScale=new hI,this.itemGroup=this.contentGroup.appendChild(new cI({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new cI({name:"itemLabelGroup"})),this.datumSelection=dI.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=dI.select(this.itemLabelGroup,uI),this.highlightDatumSelection=dI.select(this.highlightNode,()=>this.nodeFactory()),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=pI.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&null!=this.topology}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return!!super.setSeriesIndex(t)&&(this.contentGroup.zIndex=[1,t],this.highlightGroup.zIndex=[2,t],!0)}isLabelEnabled(){return null!=this.properties.labelKey&&this.properties.label.enabled}nodeFactory(){const t=new mD;return t.renderMode=1,t.lineJoin="round",t}async processData(t){if(null==this.data)return;const{data:e,topology:i,colorScale:s}=this,{topologyIdKey:a,idKey:o,colorKey:r,labelKey:l,colorRange:h}=this.properties,c=new Map;i?.features.forEach(t=>{const e=t.properties?.[a];null!=e&&bD(t.geometry,1)&&c.set(e,t)});const d=this.colorScale.type,u=this.scale?.type,{dataModel:p,processedData:g}=await this.requestDataModel(t,e,{props:[oI(o,u,{id:"idValue",includeProperty:!1}),oI(o,u,{id:"featureValue",includeProperty:!1,processor:()=>t=>c.get(t)}),...l?[oI(l,"band",{id:"labelValue"})]:[],...r?[oI(r,d,{id:"colorValue"})]:[]]}),m=p.resolveColumnById(this,"featureValue",g);if(this.topologyBounds=m.reduce((t,e)=>{const i=e?.geometry;return null==i?t:yD(i,t)},void 0),null!=h&&this.isColorScaleValid()){const t=p.resolveProcessedDataIndexById(this,"colorValue");s.domain=g.domain.values[t],s.range=h,s.update()}null==i&&n.Vy.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,a=sI(this,i.defs.values[s].missing);return!(0===n||n===a)}getLabelLayout(t,e,i,s,n){if(null==e||null==s)return;const{idKey:a,idName:o,colorKey:r,colorName:l,labelKey:h,labelName:c,padding:d,label:u}=this.properties,p=this.getLabelText(u,{value:e,datum:t,idKey:a,idName:o,colorKey:r,colorName:l,labelKey:h,labelName:c});if(null==p)return;const g=rI.measureText(String(p),{font:i}),m=p.split("\n").length,y=(g.width+2*d)/(m*lI.getLineHeight(u.fontSize)+2*d);if(n?.geometry===s&&n?.labelText===p&&n?.aspectRatio===y)return n;const f=fD(vD(s,yI));if(null==f)return;const x=function(t,{aspectRatio:e,precision:i}){const s=hw(t,i,(t,i,s,n)=>{const a=function(t,e,i,s){let n=!1,a=1/0;for(const o of t){let t=o[o.length-1],[r,l]=t;for(const h of o){const[o,c]=h;c>i!=l>i&&e<(r-o)*(i-c)/(l-c)+o&&(n=!n);const d=Hw(t,h,e,i,s);a=Math.min(a,d),t=h,r=o,l=c}}return(n?1:-1)*a}(t,i,s,e),o=a+2*n*e;return{distance:a*Math.SQRT2,maxDistance:o*Math.SQRT2}});if(null==s)return;const{x:n,y:a,distance:o}=s;return{x:n,y:a,maxWidth:o/Math.SQRT2}}(f,{aspectRatio:y,precision:.001});if(null==x)return;const{x:b,y:v,maxWidth:S}=x;return{geometry:s,labelText:p,aspectRatio:y,x:b,y:v,maxWidth:S,fixedPolygon:f}}getLabelDatum(t,e){const{scale:i}=this;if(null==i)return;const{padding:s,label:n}=this.properties,{labelText:a,aspectRatio:o,x:r,y:l,maxWidth:h,fixedPolygon:c}=t,d={width:Math.ceil(h*e),height:Math.ceil(h*e/o),meta:r},u=iy(a,n,{padding:s},(t,i)=>{if(!i)return d;const s=function(t,e,i,s){const n={minX:-1/0,maxX:1/0};for(const a of t){let t=a[a.length-1];for(const o of a)Xw(n,t,o,e,i,s),t=o}const{minX:a,maxX:o}=n;return Number.isFinite(a)&&Number.isFinite(o)?{x:e+(a+o)/2,width:o-a}:{x:e,width:0}}(c,r,l,t/e);return{width:s.width*e,height:t,meta:s.x}});if(null==u)return;const[{text:p,fontSize:g,lineHeight:m,width:y},f]=u;if(p===lI.EllipsisChar)return;const x=y<d.width?r:f,b=this.scale.convert(yI.invert([x,l]));return{x:b[0],y:b[1],text:p,fontSize:g,lineHeight:m}}createNodeData(){const{id:t,dataModel:e,processedData:i,properties:s,scale:a,previousLabelLayouts:o}=this,{idKey:r,colorKey:l,labelKey:h,label:c}=s;if(null==e||null==i)return;const d=null!=a?(a.range[1][0]-a.range[0][0])/a.bounds.width:NaN,u=e.resolveColumnById(this,"idValue",i),p=e.resolveColumnById(this,"featureValue",i),g=null!=h?e.resolveColumnById(this,"labelValue",i):void 0,m=null!=l?e.resolveColumnById(this,"colorValue",i):void 0,y=c.getFont(),f=new Map;this.previousLabelLayouts=f;const x=[],b=[],v=[];if((i.dataSources.get(this.id)??[]).forEach((t,e)=>{const i=u[e],s=m?.[e],n=g?.[e],l=p[e]?.geometry??void 0;null==l&&v.push(i);const h=this.getLabelLayout(t,n,y,l,o?.get(i));null!=h&&f.set(i,h);const c=null!=h&&null!=a?this.getLabelDatum(h,d):void 0;null!=c&&b.push(c);const S=null!=l&&null!=a?vD(l,a):void 0;x.push({series:this,itemId:r,datum:t,datumIndex:e,idValue:i,colorValue:s,labelValue:n,projectedGeometry:S})}),v.length>10){const t=v.length-10;v.length=10,v.push(`(+${t} more)`)}return v.length>0&&n.Vy.warnOnce("some data items do not have matches in the provided topology",v),{itemId:t,nodeData:x,labelData:b}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t,labelSelection:e,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let s=this.ctx.highlightManager?.getActiveHighlight();null==s||s.series===this&&null!=s.datum||(s=void 0);const n=this.contextNodeData?.nodeData??[],a=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:e}),this.updateLabelNodes({labelSelection:e}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:null!=s?[s]:[],datumSelection:i}),this.updateDatumNodes({datumSelection:i,isHighlight:!0})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,t=>nI(t.idValue))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return mI({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},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getItemStyleOverrides(t,e,i,s,n){const{id:a,properties:o,colorScale:r}=this,{colorRange:l,itemStyler:h}=o;let c;if(n||null==i||(c??(c={}),c.fill=this.isColorScaleValid()?r.convert(i):l?.[0]??o.fill),null!=h){const i=this.cachedDatumCallback(nI(t,n?"highlight":"node"),()=>this.callWithContext(h,{seriesId:a,datum:e,highlighted:n,...s,...c}));c??(c={}),Object.assign(c,i)}return mI(c,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getItemBaseStyle(i),n=gw(this.scale);e.each((t,e)=>{const{datum:a,datumIndex:o,colorValue:r,projectedGeometry:l}=e;if(null==l)return t.visible=!1,void(t.projectedGeometry=void 0);const h=this.getItemStyleOverrides(String(o),a,r,s,i);t.visible=!0,t.projectedGeometry=l,gI(t,s,h,n)})}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontFamily:a}=this.properties.label;e.each((t,{x:e,y:o,text:r,fontSize:l,lineHeight:h})=>{t.visible=!0,t.x=e,t.y=o,t.text=r,t.fill=i,t.fontStyle=s,t.fontWeight=n,t.fontSize=l,t.lineHeight=h,t.fontFamily=a,t.textAlign="center",t.textBaseline="middle"})}resetAnimation(){}pickNodeClosestDatum({x:t,y:e}){let i,s=1/0;return this.datumSelection.each((n,a)=>{const o=n.distanceSquared(t,e);o<s&&(s=o,i=a)}),null!=i?{datum:i,distance:Math.sqrt(s)}:void 0}datumMidPoint(t){const{_previousDatumMidPoint:e}=this;if(e?.datum===t)return e.point;const i=t.projectedGeometry,s=null!=i?fD(i):void 0,n=null!=s?dw(s,2):void 0,a=null!=n?{x:n[0],y:n[1]}:void 0;return this._previousDatumMidPoint={datum:t,point:a},a}legendItemSymbol(t){const{dataModel:e,processedData:i,properties:s}=this,{fillOpacity:n,stroke:a,strokeWidth:o,strokeOpacity:r,lineDash:l,lineDashOffset:h}=s;let{fill:c}=s;if(null!=t&&this.isColorScaleValid()){const s=e.resolveColumnById(this,"colorValue",i)[t];c=this.colorScale.convert(s)}return{marker:mI({fill:c,fillOpacity:n,stroke:a,strokeWidth:o,strokeOpacity:r,lineDash:l,lineDashOffset:h},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}}getLegendData(t){const{processedData:e,dataModel:i}=this;if(null==e||null==i)return[];const{id:s,visible:n}=this,{title:a,legendItemName:o,idKey:r,idName:l,colorKey:h,colorName:c,colorRange:d,showInLegend:u}=this.properties;return"gradient"===t&&null!=h&&null!=d?[{legendType:"gradient",enabled:n,seriesId:s,colorName:c,colorRange:d,colorDomain:e.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")]}]:"category"===t?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:o??a??l??r},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!u}]:[]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{idKey:a,idName:o,colorKey:r,colorName:l,labelKey:h,labelName:c,legendItemName:d,title:u,tooltip:p}=n;if(!i||!s)return;const g=s.dataSources.get(this.id)?.[t],m=i.resolveColumnById(this,"idValue",s)[t],y=null!=r?i.resolveColumnById(this,"colorValue",s)[t]:void 0,f=[];if(null!=y&&f.push({label:l,fallbackLabel:r,value:String(y)}),null!=h&&h!==a){const e=i.resolveColumnById(this,"labelValue",s)[t];f.push({label:c,fallbackLabel:h,value:e})}const x=this.getItemBaseStyle(!1);return Object.assign(x,this.getItemStyleOverrides(String(t),t,y,x,!1)),this.formatTooltipWithContext(p,{heading:m,title:u??d,symbol:this.legendItemSymbol(t),data:f},{seriesId:e,datum:g,title:u,idKey:a,idName:o,colorKey:r,colorName:l,labelKey:h,labelName:c,...x})}computeFocusBounds(t){return DD(this,t)}};fI.className="MapShapeSeries",fI.type="map-shape";var{commonSeriesOptionsDefs:xI,mapShapeSeriesThemeableOptionsDef:bI,without:vI}=s.n1,SI={...bI,...vI(xI,["highlightStyle"]),type:(0,n.mw)((0,n.dY)("map-shape")),idKey:(0,n.mw)(n.Yj),colorKey:n.Yj,labelKey:n.Yj,idName:n.Yj,colorName:n.Yj,labelName:n.Yj,topology:n.eW,topologyIdKey:n.Yj,legendItemName:n.Yj,title:n.Yj},MI={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape",moduleFactory:t=>new fI(t),tooltipDefaults:{range:"exact"},themeTemplate:{...tD,series:{fill:{$palette:"fill"},stroke:{$ref:"backgroundColor"},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},s.n1.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{color:{$ref:"backgroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"}},tooltip:{range:"exact"}}},kI={type:"series",name:"map-shape",chartType:"topology",enterprise:!0,options:SI,create:t=>new fI(t)},{FillGradientDefaults:DI,FillPatternDefaults:wI,FillImageDefaults:II,Property:CI,SeriesProperties:LI,SeriesTooltip:AI}=s.n1,TI=class extends LI{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillGradientDefaults=new DI,this.fillPatternDefaults=new wI,this.fillImageDefaults=new II,this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=new AI}};r([CI],TI.prototype,"topology",2),r([CI],TI.prototype,"fill",2),r([CI],TI.prototype,"fillGradientDefaults",2),r([CI],TI.prototype,"fillPatternDefaults",2),r([CI],TI.prototype,"fillImageDefaults",2),r([CI],TI.prototype,"fillOpacity",2),r([CI],TI.prototype,"stroke",2),r([CI],TI.prototype,"strokeOpacity",2),r([CI],TI.prototype,"strokeWidth",2),r([CI],TI.prototype,"lineDash",2),r([CI],TI.prototype,"lineDashOffset",2),r([CI],TI.prototype,"tooltip",2);var{createDatumId:NI,SeriesNodePickMode:OI,Selection:RI,Group:EI,PointerEvents:PI,getShapeStyle:BI}=s.n1,FI=class extends wD{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[OI.EXACT_SHAPE_MATCH]}),this.properties=new TI,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new EI({name:"itemGroup"})),this.datumSelection=RI.select(this.itemGroup,()=>this.nodeFactory())}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return!!super.setSeriesIndex(t)&&(this.contentGroup.zIndex=[0,t,0],this.highlightGroup.zIndex=[0,t,1],!0)}nodeFactory(){const t=new mD;return t.renderMode=1,t.lineJoin="round",t.pointerEvents=PI.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((t,e)=>{const i=e.geometry;return null==i?t:yD(i,t)},void 0),null==t&&n.Vy.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:t,topology:e,scale:i}=this;if(null==e)return;const s=[];return e.features.forEach((t,e)=>{const{geometry:n}=t,a=null!=n&&null!=i?vD(n,i):void 0;null!=a&&s.push({series:this,itemId:e,datum:t,datumIndex:0,index:e,projectedGeometry:a})}),{itemId:t,nodeData:s,labelData:[]}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible;const{nodeData:e=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:e,datumSelection:t}),this.updateDatumNodes({datumSelection:t})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,t=>NI(t.index))}updateDatumNodes(t){const{properties:e}=this,{datumSelection:i}=t,{fill:s,fillOpacity:n,stroke:a,strokeOpacity:o,lineDash:r,lineDashOffset:l}=e,h=this.getStrokeWidth(e.strokeWidth);i.each((t,e)=>{const{projectedGeometry:i}=e;if(null==i)return t.visible=!1,void(t.projectedGeometry=void 0);t.visible=!0,t.projectedGeometry=i;const c=BI({fill:s,fillOpacity:n,stroke:a,strokeWidth:h,strokeOpacity:o,lineDash:r,lineDashOffset:l},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);t.setProperties(c)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}pickFocus(){}computeFocusBounds(t){}};FI.className="MapShapeBackgroundSeries",FI.type="map-shape-background";var{commonSeriesOptionsDefs:zI,mapShapeBackgroundSeriesThemeableOptionsDef:GI}=s.n1,_I={...GI,...zI,type:(0,n.mw)((0,n.dY)("map-shape-background")),topology:n.eW},jI={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape-background",moduleFactory:t=>new FI(t),tooltipDefaults:{range:"exact"},themeTemplate:{...tD,series:{fill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$ref:"backgroundColor"},strokeWidth:1,fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:[{$mix:[{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]},{$mix:[{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}],rotation:0,reverse:!1},fillPatternDefaults:{...s.n1.FILL_PATTERN_DEFAULTS,fill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS}}},WI={type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,options:_I,create:t=>new FI(t)},{ChartAxisDirection:VI,PolarAxis:KI,diff:YI,fixNumericExtent:$I,groupAccumulativeValueProperty:HI,keyProperty:UI,normaliseGroupTo:XI,resetLabelFn:ZI,seriesLabelFadeInAnimation:qI,seriesLabelFadeOutAnimation:QI,valueProperty:JI,animationValidation:tC,createDatumId:eC,SeriesNodePickMode:iC,normalizeAngle360:sC,CategoryScale:nC,motion:aC,applyShapeStyle:oC,isGradientFill:rC,getShapeStyle:lC}=s.n1,hC=class extends s.n1.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},cC=class extends s.n1.PolarSeries{constructor(t,{animationResetFns:e}){super({moduleCtx:t,categoryKey:"angleValue",useLabelLayer:!0,canHaveAxes:!0,pickModes:[iC.NEAREST_NODE,iC.EXACT_SHAPE_MATCH],animationResetFns:{...e,label:ZI}}),this.NodeEvent=hC,this.groupScale=new nC,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===VI.Angle)return e.getDomain(this,"angleValue","key",i);{const t=e.getDomain(this,"radiusValue-end","value",i),s=Number.isFinite(t[1]-t[0])?[t[0]>0?0:t[0],t[1]<0?0:t[1]]:[];return $I(s)}}async processData(t){const{angleKey:e,radiusKey:i,normalizedTo:s}=this.properties,a=!this.ctx.animationManager.isSkipped(),o=this.getStackId(),r=`${o}-trailing`,l=[];(0,n.vM)(s)&&l.push(XI([o,r],Math.abs(s))),a&&this.processedData&&l.push(YI(this.id,this.processedData)),a&&l.push(tC());const h=this.visible?{}:{forceValue:0},c=this.axes[VI.Radius]?.scale.type,d=this.axes[VI.Angle]?.scale.type;await this.requestDataModel(t,this.data,{props:[UI(e,d,{id:"angleValue"}),JI(i,c,{id:"radiusValue-raw",invalidValue:null,...h}),...HI(i,"normal","current",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:o,separateNegative:!0,...h},c),...HI(i,"trailing","current",{id:"radiusValue-start",invalidValue:null,groupId:r,separateNegative:!0,...h},c),...l],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,s=this.circleCache;return(t!==s.r||e!==s.cx||i!==s.cy)&&(this.circleCache={r:t,cx:e,cy:i},!0)}isRadiusAxisReversed(){return this.axes[VI.Radius]?.isReversed()}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:t=[]}=this.createNodeData()??{};this.nodeData=t,this.nodeDataRefresh=!1}getAxisInnerRadius(){const t=this.axes[VI.Radius];return t instanceof KI?this.radius*t.innerRadiusRatio:0}createNodeData(){const{processedData:t,dataModel:e,groupScale:i}=this;if(!e||!t||"grouped"!==t.type)return;const s=this.axes[VI.Angle],n=this.axes[VI.Radius],a=s?.scale,o=n?.scale;if(!a||!o)return;const r=e.resolveKeysById(this,"angleValue",t),l=e.resolveColumnById(this,"radiusValue-start",t),h=e.resolveColumnById(this,"radiusValue-end",t),c=e.resolveColumnById(this,"radiusValue-raw",t),d=e.resolveProcessedDataIndexById(this,"radiusValue-range");let u=0,p=0;s instanceof q&&(u=s.groupPaddingInner,p=s.paddingInner);const g=(a.bandwidth??0)*(1-p),{index:m,visibleGroupCount:y}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:y}).map((t,e)=>String(e)),i.range=[-g/2,g/2],i.paddingInner=y>1?u:0;const f=this.isRadiusAxisReversed(),x=f?this.radius:this.getAxisInnerRadius(),b=f?this.getAxisInnerRadius():this.radius,v=b+x,{angleKey:S,radiusKey:M,angleName:k,radiusName:D,label:w}=this.properties,I=(t,e,i,s)=>{const n=this.getLabelText(w,{value:e,datum:t,angleKey:S,radiusKey:M,angleName:k,radiusName:D});if(n)return{x:i,y:s,text:n,textAlign:"center",textBaseline:"middle"}},C=[],L={itemId:M,nodeData:C,labelData:C};if(!this.visible)return L;const{dataSources:A}=t,T=A.get(this.id)??[];for(const{datumIndex:s,group:n}of e.forEachGroupDatum(this,t)){const t=T[s],e=r[s];if(null==e)return;const u=c[s],p=u>=0&&!Object.is(u,-0),g=l[s],y=h[s],S=n.aggregation[d][p?1:0]??0,M=p===f;if(void 0===g||void 0===y)return;let k,D;if(1===T.length)k=-.5*Math.PI,D=1.5*Math.PI;else{const t=a.convert(e);k=sC(t+i.convert(String(m))),D=sC(k+i.bandwidth)}const w=k+i.bandwidth/2,L=v-o.convert(g),A=v-o.convert(y),N=(L+A)/2,O=v-o.convert(0),R=v-o.convert(S),E=Math.cos(w)*N,P=Math.sin(w)*N,B=this.properties.label.enabled?I(t,u,E,P):void 0,F=this.getColumnWidth(k,D);C.push({series:this,datum:t,datumIndex:s,point:{x:E,y:P,size:0},midPoint:{x:E,y:P},label:B,angleValue:e,radiusValue:u,negative:M,innerRadius:L,outerRadius:A,stackInnerRadius:O,stackOuterRadius:R,startAngle:k,endAngle:D,midAngle:w,axisInnerRadius:x,axisOuterRadius:b,columnWidth:F,index:s})}return{itemId:M,nodeData:C,labelData:C}}getColumnWidth(t,e){return NaN}update({seriesRect:t}){const e=this.checkResize(t);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return lC({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},e.fillGradientDefaults,e.fillPatternDefaults,e.fillImageDefaults)}getItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{angleKey:o,radiusKey:r,itemStyler:l,fillGradientDefaults:h,fillPatternDefaults:c,fillImageDefaults:d}=a;if(null==l)return;const u=this.cachedDatumCallback(eC(t,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:n,datum:e,highlighted:s,angleKey:o,radiusKey:r,...i}));return lC(u,h,c,d)}updateSectorSelection(t,e){let i=[];if(e){const t=this.ctx.highlightManager?.getActiveHighlight();t?.datum&&t.series===this&&i.push(t)}else i=this.nodeData;const s=this.isRadiusAxisReversed(),n=s?this.radius:this.getAxisInnerRadius(),a=s?this.getAxisInnerRadius():this.radius,o=this.getShapeFillBBox(),r=this.getItemBaseStyle(e);t.update(i,void 0,t=>this.getDatumId(t)).each((t,i)=>{const{datum:s,datumIndex:l,midPoint:h}=i,c=this.getItemStyleOverrides(String(l),s,r,e),d=c?.fill??r.fill,u=rC(d)&&"item"===d.bounds?{centerX:h?.x??0,centerY:h?.y??0}:{centerX:0,centerY:0,innerRadius:n,outerRadius:a};this.updateItemPath(t,i,e),oC(t,r,c,o,u),t.cornerRadius=c?.cornerRadius??r.cornerRadius,t.lineJoin="round"})}updateLabels(){const{label:t}=this.properties;this.labelSelection.update(this.nodeData).each((e,i)=>{t.enabled&&i.label?(e.x=i.label.x,e.y=i.label.y,e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=i.label.text,e.textAlign=i.label.textAlign,e.textBaseline=i.label.textBaseline,e.visible=!0):e.visible=!1})}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getColumnTransitionFunctions();aC.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),qI(this,"labels",this.ctx.animationManager,t)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getColumnTransitionFunctions();aC.fromToMotion(this.id,"datums",e,[t],i),QI(this,"labels",e,this.labelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{angleKey:o,angleName:r,radiusKey:l,radiusName:h,tooltip:c}=a,d=n[VI.Angle],u=n[VI.Radius];if(!(i&&s&&d&&u))return;const p=s.dataSources.get(this.id)?.[t],g=i.resolveKeysById(this,"angleValue",s)[t],m=i.resolveColumnById(this,"radiusValue-raw",s)[t];if(null==g)return;const y=this.getItemBaseStyle(!1);return Object.assign(y,this.getItemStyleOverrides(String(t),t,y,!1)),this.formatTooltipWithContext(c,{heading:d.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:h,fallbackLabel:l,value:u.formatDatum(m)}]},{seriesId:e,datum:p,title:r,angleKey:o,angleName:r,radiusKey:l,radiusName:h,...y})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r,fillGradientDefaults:l,fillPatternDefaults:h,fillImageDefaults:c}=this.properties,d=lC({fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:n,strokeWidth:a,lineDash:o,lineDashOffset:r},l,h,c);return s.n1.isGradientFill(d.fill)&&(d.fill={...d.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:d}}getLegendData(t){if("category"!==t)return[];const{id:e,visible:i}=this,{radiusKey:s,radiusName:n,showInLegend:a}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i,label:{text:n??s},symbol:this.legendItemSymbol(),hideInLegend:!a}]}getDatumId(t){return eC(t.angleValue)}computeLabelsBBox(){return null}},{SeriesProperties:dC,FillGradientDefaults:uC,FillPatternDefaults:pC,FillImageDefaults:gC,SeriesTooltip:mC,Property:yC,Label:fC}=s.n1,xC=class extends dC{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new uC,this.fillPatternDefaults=new pC,this.fillImageDefaults=new gC,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new fC,this.tooltip=new mC}};r([yC],xC.prototype,"angleKey",2),r([yC],xC.prototype,"angleName",2),r([yC],xC.prototype,"radiusKey",2),r([yC],xC.prototype,"radiusName",2),r([yC],xC.prototype,"fill",2),r([yC],xC.prototype,"fillGradientDefaults",2),r([yC],xC.prototype,"fillPatternDefaults",2),r([yC],xC.prototype,"fillImageDefaults",2),r([yC],xC.prototype,"fillOpacity",2),r([yC],xC.prototype,"stroke",2),r([yC],xC.prototype,"strokeWidth",2),r([yC],xC.prototype,"strokeOpacity",2),r([yC],xC.prototype,"lineDash",2),r([yC],xC.prototype,"lineDashOffset",2),r([yC],xC.prototype,"cornerRadius",2),r([yC],xC.prototype,"itemStyler",2),r([yC],xC.prototype,"rotation",2),r([yC],xC.prototype,"stackGroup",2),r([yC],xC.prototype,"normalizedTo",2),r([yC],xC.prototype,"label",2),r([yC],xC.prototype,"tooltip",2);var{motion:bC}=s.n1;function vC(){const t={startAngle:new Map,endAngle:new Map},e=["startAngle","endAngle"],i=(e,i)=>({startAngle:t.startAngle.get(e)[i],endAngle:t.endAngle.get(e)[i]});return{calculate:(i,s,n)=>{e.forEach(e=>{const a=t[e];let o=("removed"===n||"updated"===n?i:s)[e],r=("removed"===n?i:s)[e];isNaN(r)&&(r=i.previousDatum?.[e]??NaN);const l=o-r;Math.abs(l)>Math.PI&&(o-=2*Math.sign(l)*Math.PI),a.set(s,{from:o,to:r})})},from:t=>i(t,"from"),to:t=>i(t,"to")}}function SC(t,e,i){if("updated"===i){if(null==t.previousDatum||isNaN(t.previousDatum.startAngle)||isNaN(t.previousDatum.endAngle))return"added";if(isNaN(e.startAngle)||isNaN(e.endAngle))return"removed"}return"added"===i&&null!=t.previousDatum?"updated":i}function MC(t,{innerRadius:e,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:a,startAngle:o,endAngle:r}){return{innerRadius:e,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:a,startAngle:o,endAngle:r}}var{SectorBox:kC,motion:DC}=s.n1;function wC(t){const{negative:e,innerRadius:i,outerRadius:s,stackInnerRadius:n,stackOuterRadius:a}=t;return{innerRadius:e?a:n,outerRadius:e?n:a,clipInnerRadius:e?s:i,clipOuterRadius:e?i:s}}function IC(t,e){const{startAngle:i,endAngle:s}=e,{innerRadius:n,outerRadius:a,clipInnerRadius:o,clipOuterRadius:r}=wC(e);return{innerRadius:n,outerRadius:a,startAngle:i,endAngle:s,clipSector:new kC(i,s,o,r)}}var{Sector:CC,SectorBox:LC,PolarZIndexMap:AC}=s.n1,TC=class extends cC{constructor(t){super(t,{animationResetFns:{item:IC}}),this.properties=new xC}setSeriesIndex(t){return!!super.setSeriesIndex(t)&&(this.contentGroup.zIndex=[0,AC.FOREGROUND,t],this.highlightGroup.zIndex=[0,AC.HIGHLIGHT,t],this.labelGroup.zIndex=[0,AC.LABEL,t],!0)}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new CC}updateItemPath(t,e,i){const{negative:s}=e;if(t.centerX=0,t.centerY=0,t.startOuterCornerRadius=s?0:this.properties.cornerRadius,t.endOuterCornerRadius=s?0:this.properties.cornerRadius,t.startInnerCornerRadius=s?this.properties.cornerRadius:0,t.endInnerCornerRadius=s?this.properties.cornerRadius:0,i){const{startAngle:i,endAngle:s}=e,{innerRadius:n,outerRadius:a,clipInnerRadius:o,clipOuterRadius:r}=wC(e);t.innerRadius=n,t.outerRadius=a,t.startAngle=i,t.endAngle=s,t.clipSector=new LC(i,s,o,r)}}getColumnTransitionFunctions(){return function(t){const e=vC();return{toFn:(i,s,n)=>{const{startAngle:a,endAngle:o}=e.to(s);let r,l,h;if("removed"===n)r=t,l=t,h=new kC(a,o,r,l);else{let e,i;({innerRadius:r,outerRadius:l,clipInnerRadius:e,clipOuterRadius:i}=wC(s)),isNaN(r)&&(r=t),isNaN(l)&&(l=t),isNaN(e)&&(e=t),isNaN(i)&&(i=t),h=new kC(a,o,e,i)}return{innerRadius:r,outerRadius:l,startAngle:a,endAngle:o,clipSector:h}},fromFn:(i,s,n)=>{n=SC(i,s,n),e.calculate(i,s,n);const{startAngle:a,endAngle:o}=e.from(s);let r,l,h;return"removed"===n||"updated"===n?(r=i.innerRadius,l=i.outerRadius,h=i.clipSector):(r=t,l=t),h??(h=new kC(a,o,r,l)),{innerRadius:r,outerRadius:l,startAngle:a,endAngle:o,clipSector:h,phase:DC.NODE_UPDATE_STATE_TO_PHASE_MAPPING[n]}}}}(this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius())}};TC.className="NightingaleSeries",TC.type="nightingale";var{commonSeriesOptionsDefs:NC,nightingaleSeriesThemeableOptionsDef:OC}=s.n1,RC={...OC,...NC,type:(0,n.mw)((0,n.dY)("nightingale")),angleKey:(0,n.mw)(n.Yj),radiusKey:(0,n.mw)(n.Yj),angleName:n.Yj,radiusName:n.Yj,grouped:n.zM,stacked:n.zM,stackGroup:n.Yj,normalizedTo:n.ai},{ThemeConstants:{POLAR_AXIS_TYPE:EC,POLAR_AXIS_SHAPE:PC}}=s.n1,BC={$path:["./shape",PC.CIRCLE,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]},FC={series:{fill:{$palette:"fill"},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"backgroundColor"},{$palette:"stroke"}]},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,strokeWidth:1,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[EC.ANGLE_CATEGORY]:{shape:BC,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[EC.RADIUS_NUMBER]:{shape:BC}}},{ThemeConstants:{POLAR_AXIS_TYPE:zC}}=s.n1,GC={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"nightingale",moduleFactory:t=>new TC(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:zC.ANGLE_CATEGORY},{type:zC.RADIUS_NUMBER}],themeTemplate:FC,stackable:!0,groupable:!0,stackedByDefault:!0},_C={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,options:RC,create:t=>new TC(t)},{SeriesProperties:jC,FillGradientDefaults:WC,FillPatternDefaults:VC,FillImageDefaults:KC,SeriesTooltip:YC,Property:$C,Label:HC,DropShadow:UC}=s.n1,XC=class extends HC{},ZC=class extends HC{constructor(){super(...arguments),this.spacing=0}};r([$C],ZC.prototype,"spacing",2),r([$C],ZC.prototype,"placement",2);var qC=class extends jC{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new WC,this.fillPatternDefaults=new VC,this.fillImageDefaults=new KC,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.direction="vertical",this.reverse=void 0,this.spacing=0,this.aspectRatio=void 0,this.shadow=(new UC).set({enabled:!1}),this.label=new XC,this.stageLabel=new ZC,this.tooltip=new YC}};function QC(t,{x:e,y:i,top:s,right:n,bottom:a,left:o}){t.x0=e-s/2,t.x1=e+s/2,t.x2=e+a/2,t.x3=e-a/2,t.y0=i-o/2,t.y1=i-n/2,t.y2=i+n/2,t.y3=i+o/2}r([$C],qC.prototype,"stageKey",2),r([$C],qC.prototype,"valueKey",2),r([$C],qC.prototype,"fills",2),r([$C],qC.prototype,"fillGradientDefaults",2),r([$C],qC.prototype,"fillPatternDefaults",2),r([$C],qC.prototype,"fillImageDefaults",2),r([$C],qC.prototype,"fillOpacity",2),r([$C],qC.prototype,"strokes",2),r([$C],qC.prototype,"strokeWidth",2),r([$C],qC.prototype,"strokeOpacity",2),r([$C],qC.prototype,"lineDash",2),r([$C],qC.prototype,"lineDashOffset",2),r([$C],qC.prototype,"direction",2),r([$C],qC.prototype,"reverse",2),r([$C],qC.prototype,"spacing",2),r([$C],qC.prototype,"aspectRatio",2),r([$C],qC.prototype,"itemStyler",2),r([$C],qC.prototype,"shadow",2),r([$C],qC.prototype,"label",2),r([$C],qC.prototype,"stageLabel",2),r([$C],qC.prototype,"tooltip",2);var{StateMachine:JC,valueProperty:tL,SeriesNodePickMode:eL,CachedTextMeasurerPool:iL,TextUtils:sL,createDatumId:nL,BBox:aL,Group:oL,Selection:rL,Text:lL,PointerEvents:hL,applyShapeStyle:cL,fromToMotion:dL,seriesLabelFadeInAnimation:uL,getShapeStyle:pL}=s.n1,gL=class extends s.n1.DataModelSeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[eL.EXACT_SHAPE_MATCH,eL.NEAREST_NODE]}),this.properties=new qC,this.itemGroup=this.contentGroup.appendChild(new oL({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new oL({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new oL({name:"stageLabelGroup"})),this.datumSelection=rL.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=rL.select(this.itemLabelGroup,lL),this.stageLabelSelection=rL.select(this.stageLabelGroup,lL),this.highlightDatumSelection=rL.select(this.highlightNode,()=>this.nodeFactory()),this.animationState=new JC("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=hL.None,this.stageLabelGroup.pointerEvents=hL.None}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",t=>this.onLegendItemClick(t)))}nodeFactory(){return new yS}getNodeData(){return this.contextNodeData?.nodeData}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t&&this.animationState.transition("skip")}async processData(t){if(null==this.data)return;const{id:e,visible:i,ctx:{legendManager:s}}=this,{stageKey:n,valueKey:a}=this.properties,o=this.visible?{}:{forceValue:0};await this.requestDataModel(t,this.data,{props:[tL(n,"band",{id:"xValue"}),tL(a,"number",{id:"yValue",...o,validation:(t,n,a)=>i&&s.getItemEnabled({seriesId:e,itemId:a}),invalidValue:0})]})}createNodeData(){const{id:t,dataModel:e,processedData:i,properties:s,visible:n,ctx:{legendManager:a}}=this,{stageKey:o,valueKey:r,direction:l,reverse:h="horizontal"===l,spacing:c,aspectRatio:d,label:u,stageLabel:p}=s;if(null==e||null==i)return;const g="horizontal"===l,m=e.resolveColumnById(this,"xValue",i),y=e.resolveColumnById(this,"yValue",i),f=iL.getMeasurer({font:p.getFont()});let x,b;g?(x="center",b="before"===p.placement?"bottom":"top"):(x="after"===p.placement?"left":"right",b="middle");const v=p.enabled?[]:void 0;let S=0,M=0,k=0;const D=i.dataSources.get(this.id)??[];D.forEach((e,i)=>{const s=m[i],l=y[i],h=n&&a.getItemEnabled({seriesId:t,itemId:i});if(k+=l,null==v)return;const c=this.getLabelText(this.properties.stageLabel,{datum:e,value:s,stageKey:o,valueKey:r}),{width:d}=f.measureText(c),p=c.split("\n").length*sL.getLineHeight(u.fontSize);S=Math.max(S,d),M=Math.max(M,p),v.push({x:NaN,y:NaN,text:c,textAlign:x,textBaseline:b,visible:h})});const w=this._nodeDataDependencies?.seriesRectWidth??0,I=this._nodeDataDependencies?.seriesRectHeight??0,C=c*(i.input.count-1);let L,A,T;if(g){const t=M+p.spacing;L=new aL(0,"before"===p.placement?t:0,w,I-t)}else{const t=S+p.spacing;L=new aL("after"===p.placement?0:t,0,w-t,I)}if(null!=d&&0!==d){const t="horizontal"===l?1/d:d,e=Math.min(L.width,L.height*t),i=e/t;L=new aL(L.x+(L.width-e)/2,L.y+(L.height-i)/2,e,i)}g?T="before"===p.placement?L.y-p.spacing:L.y+L.height+p.spacing:A="after"===p.placement?L.x+L.width+p.spacing:L.x-p.spacing;const N=L.width-(g?C:0),O=L.height-(g?0:C);if(N<0||O<0)return;const R=[],E=[];let P=0;return D.forEach((e,i)=>{const s=m[i],l=y[i],d=n&&a.getItemEnabled({seriesId:t,itemId:i}),p=P+l,f=(P+p)/(2*k),x=(p-P)/k,b=g?N*f+c*i:.5*N,S=g?.5*O:O*f+c*i,M=L.x+b,D=L.y+S;if(null!=v){const t=v[i];t.x=A??M,t.y=T??D}let w,I,C,B;if(g){const t=N*x;w=t,C=t;const e=(b+t/2)*(O/L.width),i=(b-t/2)*(O/L.width);I=h?L.height-e:e,B=h?L.height-i:i}else{const t=O*x;I=t,B=t;const e=(S-t/2)*(N/L.height),i=(S+t/2)*(N/L.height);w=h?L.width-e:e,C=h?L.width-i:i}const F={x:M,y:D,text:this.getLabelText(u,{datum:e,value:l,stageKey:o,valueKey:r}),textAlign:"center",textBaseline:"middle",visible:d};E.push(F),R.push({series:this,itemId:r,datum:e,datumIndex:i,index:i,xValue:s,yValue:l,x:M,y:D,top:w,right:I,bottom:C,left:B,label:F,enabled:d,midPoint:{x:M,y:D}}),P=p}),{itemId:t,nodeData:R,labelData:E,stageLabelData:v,bounds:L}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:t}){this.checkResize(t);const{datumSelection:e,labelSelection:i,stageLabelSelection:s,highlightDatumSelection:n}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let a=this.ctx.highlightManager?.getActiveHighlight();null==a||a.series===this&&null!=a.datum||(a=void 0);const o=this.contextNodeData?.nodeData??[],r=this.contextNodeData?.labelData??[],l=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:l,stageLabelSelection:s}),this.updateLabelNodes({labelSelection:s,labelProperties:this.properties.stageLabel}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:null!=a?[a]:[],datumSelection:n}),this.updateDatumNodes({datumSelection:n,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData)}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return pL({fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getItemStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,{fills:r,strokes:l,stageKey:h,valueKey:c,itemStyler:d}=o,u=s.fill??r[i%r.length],p=s.stroke??l[i%l.length],g={};if(n||(g.fill=u,g.stroke=p),null!=d){const i=this.cachedDatumCallback(nL(t,n?"highlight":"node"),()=>this.callWithContext(d,{seriesId:a,datum:e,stageKey:h,valueKey:c,highlighted:n,fill:u,stroke:p,...s}));Object.assign(g,i)}return pL(g,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,{properties:s}=this,{shadow:n}=s,a=this.getItemBaseStyle(i),o=this.contextNodeData?.bounds,r=o?{series:o,axis:o}:void 0;e.each((t,e)=>{const{datumIndex:s,datum:o}=e,l=this.getItemStyleOverrides(String(s),o,s,a,i);cL(t,a,l,r),QC(t,e),t.fillShadow=n})}updateLabelSelection(t){return t.labelSelection.update(this.properties.label.enabled?t.labelData:[])}updateStageLabelSelection(t){return t.stageLabelSelection.update(t.stageLabelData)}updateLabelNodes(t){const{labelSelection:e,labelProperties:i}=t,{color:s,fontSize:n,fontStyle:a,fontWeight:o,fontFamily:r}=i;e.each((t,{visible:e,x:i,y:l,text:h,textAlign:c,textBaseline:d})=>{t.visible=e,t.x=i,t.y=l,t.text=h,t.fill=s,t.fontStyle=a,t.fontWeight=o,t.fontSize=n,t.fontFamily=r,t.textAlign=c,t.textBaseline=d})}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(void 0!==e)for(const t of this.datumSelection)if(t.datum===e)return t.node}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{stageKey:a,valueKey:o,tooltip:r}=n;if(!i||!s)return;const l=s.dataSources.get(this.id)?.[t],h=i.resolveColumnById(this,"xValue",s)[t],c=i.resolveColumnById(this,"yValue",s)[t];if(null==h)return;const d=this.getLabelText(this.properties.stageLabel,{datum:s.dataSources.get(this.id)?.[t],value:c,stageKey:a,valueKey:o}),u=this.getItemBaseStyle(!1);return Object.assign(u,this.getItemStyleOverrides(String(t),t,t,u,!1)),this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(t),data:[{label:String(h),value:d}]},{seriesId:e,datum:l,title:void 0,stageKey:a,valueKey:o,...u})}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}pickNodeClosestDatum({x:t,y:e}){let i,s=1/0;return this.datumSelection.each((n,a)=>{const o=n.distanceSquared(t,e);o<s&&(s=o,i=a)}),null!=i?{datum:i,distance:Math.sqrt(s)}:void 0}legendItemSymbol(t){const{fills:e,strokes:i,strokeWidth:s,fillOpacity:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}=this.properties,l=e[t%e.length]??"black",h=i[t%i.length]??"black";return{marker:pL({fill:l,fillOpacity:n,stroke:h,strokeWidth:s,strokeOpacity:a,lineDash:o,lineDashOffset:r},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}}getLegendData(t){const{processedData:e,dataModel:i,id:s,ctx:{legendManager:n},visible:a}=this;if(!i||!e||"category"!==t)return[];const{showInLegend:o}=this.properties,r=[],l=i.resolveColumnById(this,"xValue",e);return(e.dataSources.get(this.id)??[]).forEach((t,e)=>{const i=l[e];r.push({legendType:"category",id:s,itemId:e,seriesId:s,enabled:a&&n.getItemEnabled({seriesId:s,itemId:e}),label:{text:i},symbol:this.legendItemSymbol(e),hideInLegend:!o})}),r}animateReset(){this.ctx.animationManager.skipCurrentBatch(),this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(){const{datumSelection:t,labelSelection:e,properties:i}=this,s=(n=i.direction,{fromFn:(t,e)=>{const{x:i,y:s}=e;let{top:a,right:o,bottom:r,left:l}=e;return"vertical"===n?(a=0,r=0):(l=0,o=0),{x:i,y:s,top:a,right:o,bottom:r,left:l}},toFn:(t,e)=>{const{x:i,y:s,top:n,right:a,bottom:o,left:r}=e;return{x:i,y:s,top:n,right:a,bottom:o,left:r}},applyFn:QC});var n;dL(this.id,"nodes",this.ctx.animationManager,[t],s),uL(this,"labels",this.ctx.animationManager,e)}};gL.className="PyramidSeries",gL.type="pyramid";var{commonSeriesOptionsDefs:mL,pyramidSeriesThemeableOptionsDef:yL}=s.n1,fL={...yL,...mL,type:(0,n.mw)((0,n.dY)("pyramid")),stageKey:(0,n.mw)(n.Yj),valueKey:(0,n.mw)(n.Yj)},{ThemeSymbols:{DEFAULT_SHADOW_COLOUR:xL}}=s.n1,bL={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"pyramid",moduleFactory:t=>new gL(t),solo:!0,tooltipDefaults:{range:"exact"},themeTemplate:{series:{direction:"vertical",strokeWidth:0,spacing:2,fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},stageLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:12},shadow:{enabled:!1,color:xL,xOffset:3,yOffset:3,blur:5}}}},vL={type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,options:fL,create:t=>new gL(t)},{ThemeConstants:{POLAR_AXIS_TYPE:SL}}=s.n1,ML={series:{stroke:{$palette:"stroke"},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:0}},axes:{[SL.ANGLE_CATEGORY]:{label:{spacing:10}}}},kL=s.n1.mergeDefaults({series:{stroke:s.n1.SAFE_STROKE_FILL_OPERATION,strokeWidth:2}},ML),DL=s.n1.mergeDefaults({series:{fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,fillOpacity:.8,strokeWidth:2,marker:{enabled:!1,fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS}}},ML),{Label:wL,SeriesMarker:IL,SeriesProperties:CL,SeriesTooltip:LL,Property:AL}=s.n1,TL=class extends CL{constructor(){super(...arguments),this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new IL,this.label=new wL,this.tooltip=new LL,this.connectMissingData=!1}};r([AL],TL.prototype,"angleKey",2),r([AL],TL.prototype,"radiusKey",2),r([AL],TL.prototype,"angleName",2),r([AL],TL.prototype,"radiusName",2),r([AL],TL.prototype,"stroke",2),r([AL],TL.prototype,"strokeWidth",2),r([AL],TL.prototype,"strokeOpacity",2),r([AL],TL.prototype,"lineDash",2),r([AL],TL.prototype,"lineDashOffset",2),r([AL],TL.prototype,"rotation",2),r([AL],TL.prototype,"marker",2),r([AL],TL.prototype,"label",2),r([AL],TL.prototype,"tooltip",2),r([AL],TL.prototype,"connectMissingData",2);var{ChartAxisDirection:NL,PolarAxis:OL,SeriesNodePickMode:RL,valueProperty:EL,fixNumericExtent:PL,seriesLabelFadeInAnimation:BL,markerFadeInAnimation:FL,resetMarkerFn:zL,animationValidation:GL,computeMarkerFocusBounds:_L,extent:jL,BBox:WL,Group:VL,Path:KL,PointerEvents:YL,Selection:$L,Text:HL,Marker:UL,mergeDefaults:XL,getShapeStyle:ZL}=s.n1,qL=class extends s.n1.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},QL=class extends s.n1.PolarSeries{constructor(t){super({moduleCtx:t,categoryKey:"angleValue",useLabelLayer:!0,pickModes:[RL.NEAREST_NODE,RL.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:zL},clipFocusBox:!1}),this.properties=new TL,this.NodeEvent=qL,this.lineGroup=this.contentGroup.appendChild(new VL({name:"radar-line"})),this.lineSelection=$L.select(this.lineGroup,KL),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}nodeFactory(){return new UL}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===NL.Angle)return e.getDomain(this,"angleValue","value",i);{const t=e.getDomain(this,"radiusValue","value",i),s=jL(0===t.length?t:[0].concat(t));return PL(s)}}async processData(t){const{angleKey:e,radiusKey:i}=this.properties,s=[];this.ctx.animationManager.isSkipped()||s.push(GL());const n=this.axes[NL.Radius]?.scale.type,a=this.axes[NL.Angle]?.scale.type;await this.requestDataModel(t,this.data,{props:[EL(e,a,{id:"angleValue"}),EL(i,n,{id:"radiusValue",invalidValue:void 0}),...s]}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,s=this.circleCache;return(t!==s.r||e!==s.cx||i!==s.cy)&&(this.circleCache={r:t,cx:e,cy:i},!0)}getAxisInnerRadius(){const t=this.axes[NL.Radius];return t instanceof OL?this.radius*t.innerRadiusRatio:0}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:t=[]}=this.createNodeData()??{};this.nodeData=t,this.nodeDataRefresh=!1}createNodeData(){const{processedData:t,dataModel:e}=this;if(!t||!e)return;const{angleKey:i,radiusKey:s,angleName:a,radiusName:o,marker:r,label:l}=this.properties,h=this.axes[NL.Angle]?.scale,c=this.axes[NL.Radius]?.scale;if(!h||!c)return;const d=e.resolveColumnById(this,"angleValue",t),u=e.resolveColumnById(this,"radiusValue",t),p=this.getAxisInnerRadius(),g=(t.dataSources.get(this.id)??[]).map((t,e)=>{const g=d[e],m=u[e],y=h.convert(g),f=this.radius+p-c.convert(m),x=Math.cos(y),b=Math.sin(y),v=x*f,S=b*f;let M;if(l.enabled){const e=this.getLabelText(l,{value:m,datum:t,angleKey:i,radiusKey:s,angleName:a,radiusName:o});if(e){let t="right";(0,n.YX)(x,0)?t="center":x>0&&(t="left");let i="bottom";(0,n.YX)(b,0)?i="middle":b>0&&(i="top"),M={x:v+x*r.size,y:S+b*r.size,text:e,textAlign:t,textBaseline:i}}}return{series:this,datum:t,datumIndex:e,index:e,point:{x:v,y:S,size:r.size},midPoint:{x:v,y:S},label:M,angleValue:g,radiusValue:m,missing:!(0,n.Bf)(y)||!(0,n.Bf)(f)}});return{itemId:s,nodeData:g,labelData:g}}update({seriesRect:t}){const e=this.checkResize(t),i=!this.ctx.animationManager.isSkipped(),{series:s}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&s===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updateMarkers(this.itemSelection,!1),this.updateMarkers(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const t=this.visible?[!0]:[];this.lineSelection.update(t)}updateMarkerSelection(){this.properties.marker.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=$L.select(this.itemGroup,()=>this.nodeFactory(),!1)),this.itemSelection.update(this.properties.marker.enabled?this.nodeData:[])}getMarkerFill(t){return t?.fill??this.properties.marker.fill}getDatumStylerProperties(t){const{id:e,properties:i}=this,{angleKey:s,radiusKey:n}=i;return{seriesId:e,datum:t,angleKey:s,radiusKey:n}}updateMarkers(t,e){const{visible:i}=this,{marker:s,stroke:n,strokeWidth:a,strokeOpacity:o,highlightStyle:r}=this.properties;let l=[];if(i&&s.shape&&s.enabled)if(e){const t=this.ctx.highlightManager?.getActiveHighlight();t?.datum&&(l=[t])}else l=this.nodeData;const h=XL(e&&r.item,s.getStyle(),{stroke:n,strokeWidth:a,strokeOpacity:o}),c=this.getShapeFillBBox();t.update(l).each((t,i)=>{this.updateMarkerStyle(s,t,i.datum,i.point,this.getDatumStylerProperties(i),e,h,c)})}updateLabels(){const{label:t}=this.properties;this.labelSelection.update(this.nodeData).each((e,i)=>{t.enabled&&i.label?(e.x=i.label.x,e.y=i.label.y,e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=i.label.text,e.textAlign=i.label.textAlign,e.textBaseline=i.label.textBaseline,e.visible=!0):e.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{angleKey:o,angleName:r,radiusKey:l,radiusName:h,tooltip:c,marker:d}=a,u=n[NL.Angle],p=n[NL.Radius];if(!(i&&s&&u&&p))return;const g=s.dataSources.get(this.id)?.[t],m=i.resolveColumnById(this,"angleValue",s)[t],y=i.resolveColumnById(this,"radiusValue",s)[t];if(null==m)return;const f=this.getMarkerStyle(d,g,this.getDatumStylerProperties(g),!1);return this.formatTooltipWithContext(c,{heading:u.formatDatum(m),symbol:this.legendItemSymbol(),data:[{label:h,fallbackLabel:l,value:p.formatDatum(y)}]},{seriesId:e,datum:g,title:r,angleKey:o,radiusKey:l,angleName:r,radiusName:h,...f})}legendItemSymbol(){const{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:s,marker:n}=this.properties;return{marker:ZL({shape:n.shape,enabled:n.enabled||e<=0,fill:this.getMarkerFill()??n.stroke??t??"rgba(0, 0, 0, 0)",stroke:n.stroke??t??"rgba(0, 0, 0, 0)",fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},n.fillGradientDefaults,n.fillPatternDefaults,n.fillImageDefaults),line:{stroke:t,strokeOpacity:i,strokeWidth:e,lineDash:s}}}getLegendData(t){if("category"!==t)return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{radiusKey:n,radiusName:a,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:a??n},symbol:this.legendItemSymbol(),hideInLegend:!o}]}pickNodeClosestDatum(t){const{nodeData:e,centerX:i,centerY:s}=this,{x:n,y:a}=t,o=this.radius;if(Math.sqrt((n-i)**2+(a-s)**2)>o+this.properties.marker.size)return;let r,l=1/0;for(const n of e){const{point:{x:e=NaN,y:a=NaN}={}}=n;if(isNaN(e)||isNaN(a))continue;const o=Math.sqrt((t.x-e-i)**2+(t.y-a-s)**2);o<l&&(l=o,r=n)}return r?{datum:r,distance:Math.max(l-(r.point?.size??0),0)}:void 0}computeLabelsBBox(){const{label:t}=this.properties;this.maybeRefreshNodeData();const e=[],i=new HL;return this.nodeData.forEach(s=>{if(!t.enabled||!s.label)return;i.text=s.label.text,i.x=s.label.x,i.y=s.label.y,i.setFont(t),i.setAlign(s.label);const n=i.getBBox();e.push(n)}),0===e.length?null:WL.merge(e)}getLineNode(){return this.lineSelection?.at(0)}beforePathAnimation(){const t=this.getLineNode();t&&(t.fill=void 0,t.lineJoin="round",t.lineCap="round",t.pointerEvents=YL.None,t.stroke=this.properties.stroke,t.strokeWidth=this.getStrokeWidth(this.properties.strokeWidth),t.strokeOpacity=this.properties.strokeOpacity,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset)}getLinePoints(){const{nodeData:t,resetInvalidToZero:e}=this,{connectMissingData:i}=this.properties;if(0===t.length)return[];const s=this.axes[NL.Radius],n=this.axes[NL.Angle],a=n?.isReversed(),o=s?.isReversed(),r=o&&!a?[...t].reverse():t,l=[];let h,c=!1;return r.forEach((t,s)=>{let{x:n,y:a}=t.point;const o=isNaN(n)||isNaN(a);o||(h??(h=t)),o&&!i&&(n=0,a=0);const r=0===s||!e&&!i&&(o||c);l.push({x:n,y:a,moveTo:r}),c=o}),void 0!==h&&l.push({x:h.point.x,y:h.point.y,moveTo:!1}),l}animateSinglePath(t,e,i){const{path:s}=t;s.clear(!0);const n=this.getAxisInnerRadius(),a=this.axes[NL.Radius],o=a?.isReversed(),r=o?this.radius+n-a?.scale.convert(0):n;e.forEach(t=>{const{x:e,y:n,arc:a,radius:o=0,startAngle:l=0,endAngle:h=0,moveTo:c}=t,d=Math.atan2(n,e),u=r*Math.cos(d),p=r*Math.sin(d),g=u*(1-i)+e*i,m=p*(1-i)+n*i;a?s.arc(e,n,o,l,h):c?s.moveTo(g,m):s.lineTo(g,m)}),t.checkPathDirty()}animatePaths(t){const e=this.getLinePoints(),i=this.getLineNode();i&&this.animateSinglePath(i,e,t)}animateEmptyUpdateReady(){const{itemSelection:t,labelSelection:e}=this,{animationManager:i}=this.ctx;this.beforePathAnimation(),i.animate({id:`${this.id}_'path`,groupId:this.id,from:0,to:1,phase:"initial",collapsable:!1,onUpdate:t=>this.animatePaths(t),onStop:()=>this.animatePaths(1)}),FL(this,i,"added",t),BL(this,"labels",i,e)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t),this.resetPaths()}animateReadyResize(t){super.animateReadyResize(t),this.resetPaths()}resetPaths(){const t=this.getLineNode();if(t){const{path:e}=t,i=this.getLinePoints();t.fill=void 0,t.stroke=this.properties.stroke,t.strokeWidth=this.getStrokeWidth(this.properties.strokeWidth),t.strokeOpacity=this.properties.strokeOpacity,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset,e.clear(!0);for(const{x:t,y:s,moveTo:n}of i)n?e.moveTo(t,s):e.lineTo(t,s);t.checkPathDirty()}}getFormattedMarkerStyle(t){const{angleKey:e,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,t.datum,{angleKey:e,radiusKey:i},!0)}computeFocusBounds(t){return _L(this,t)}};QL.className="RadarSeries";var{FillGradientDefaults:JL,FillPatternDefaults:tA,FillImageDefaults:eA,Property:iA}=s.n1,sA=class extends TL{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new JL,this.fillPatternDefaults=new tA,this.fillImageDefaults=new eA,this.fillOpacity=1}};r([iA],sA.prototype,"fill",2),r([iA],sA.prototype,"fillGradientDefaults",2),r([iA],sA.prototype,"fillPatternDefaults",2),r([iA],sA.prototype,"fillImageDefaults",2),r([iA],sA.prototype,"fillOpacity",2);var{Group:nA,Path:aA,PointerEvents:oA,Selection:rA,ChartAxisDirection:lA,applyShapeStyle:hA,getShapeFill:cA,getShapeStyle:dA}=s.n1,uA=class extends QL{constructor(t){super(t),this.properties=new sA,this.areaGroup=this.contentGroup.appendChild(new nA({name:"radar-area"})),this.areaSelection=rA.select(this.areaGroup,aA),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}updatePathSelections(){const t=this.visible?[!0]:[];this.areaSelection.update(t),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(t){return t?.fill??this.properties.marker.fill??this.properties.fill}beforePathAnimation(){super.beforePathAnimation();const t=this.getAreaNode(),{fillOpacity:e,fill:i}=this.properties,s=dA({fill:i,fillOpacity:e},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);hA(t,s,void 0,this.getShapeFillBBox()),t.pointerEvents=oA.None,t.stroke=void 0}animatePaths(t){super.animatePaths(t),this.animateSinglePath(this.getAreaNode(),this.getAreaPoints(),t)}getAreaPoints(){const t=this.getLinePoints(),e=t=>{const e=this.axes[t];return e instanceof s.n1.PolarAxis?e:void 0},i=e(lA.Radius),n=e(lA.Angle),a=i?.isReversed();if(!a)return t;const o=n?.getAxisLinePoints()?.points??[];return t.concat(...o)}resetPaths(){super.resetPaths();const t=this.getAreaNode();if(t){const{path:e}=t,i=this.getAreaPoints(),s=cA(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults),n=this.getShapeFillBBox();hA(t,{fill:s,stroke:void 0,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset},void 0,n),t.lineJoin=t.lineCap="round",e.clear(!0),i.forEach(({x:t,y:i,moveTo:s,arc:n,radius:a=0,startAngle:o=0,endAngle:r=0})=>{n?e.arc(t,i,a,o,r):s?e.moveTo(t,i):e.lineTo(t,i)}),e.closePath(),t.checkPathDirty()}}};uA.className="RadarAreaSeries",uA.type="radar-area";var{commonSeriesOptionsDefs:pA,radarAreaSeriesThemeableOptionsDef:gA}=s.n1,mA={...gA,...pA,type:(0,n.mw)((0,n.dY)("radar-area")),angleKey:(0,n.mw)(n.Yj),radiusKey:(0,n.mw)(n.Yj),angleName:n.Yj,radiusName:n.Yj},{ThemeConstants:{POLAR_AXIS_TYPE:yA}}=s.n1,fA={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-area",moduleFactory:t=>new uA(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:yA.ANGLE_CATEGORY},{type:yA.RADIUS_NUMBER}],themeTemplate:DL},xA={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,options:mA,create:t=>new uA(t)},bA=class extends QL{updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}};bA.className="RadarLineSeries",bA.type="radar-line";var{commonSeriesOptionsDefs:vA,radarLineSeriesThemeableOptionsDef:SA}=s.n1,MA={...SA,...vA,type:(0,n.mw)((0,n.dY)("radar-line")),angleKey:(0,n.mw)(n.Yj),radiusKey:(0,n.mw)(n.Yj),angleName:n.Yj,radiusName:n.Yj},{POLAR_AXIS_TYPE:kA}=s.n1.ThemeConstants,DA={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-line",moduleFactory:t=>new bA(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:kA.ANGLE_CATEGORY},{type:kA.RADIUS_NUMBER}],themeTemplate:kL},wA={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,options:MA,create:t=>new bA(t)},{SeriesProperties:IA,FillGradientDefaults:CA,FillPatternDefaults:LA,FillImageDefaults:AA,SeriesTooltip:TA,Property:NA,Label:OA}=s.n1,RA=class extends IA{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new CA,this.fillPatternDefaults=new LA,this.fillImageDefaults=new AA,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new OA,this.tooltip=new TA}};r([NA],RA.prototype,"angleKey",2),r([NA],RA.prototype,"radiusKey",2),r([NA],RA.prototype,"angleName",2),r([NA],RA.prototype,"radiusName",2),r([NA],RA.prototype,"fill",2),r([NA],RA.prototype,"fillGradientDefaults",2),r([NA],RA.prototype,"fillPatternDefaults",2),r([NA],RA.prototype,"fillImageDefaults",2),r([NA],RA.prototype,"fillOpacity",2),r([NA],RA.prototype,"stroke",2),r([NA],RA.prototype,"strokeWidth",2),r([NA],RA.prototype,"strokeOpacity",2),r([NA],RA.prototype,"lineDash",2),r([NA],RA.prototype,"lineDashOffset",2),r([NA],RA.prototype,"cornerRadius",2),r([NA],RA.prototype,"itemStyler",2),r([NA],RA.prototype,"rotation",2),r([NA],RA.prototype,"stackGroup",2),r([NA],RA.prototype,"normalizedTo",2),r([NA],RA.prototype,"label",2),r([NA],RA.prototype,"tooltip",2);var{SectorBox:EA,motion:PA}=s.n1;function BA(t){return{toFn:(e,i,s)=>{let n,a,o,r,l;return"removed"===s?(n=t,a=t,o=i.innerRadius,r=i.outerRadius,l=new EA(n,a,o,r)):(n=i.startAngle,a=i.endAngle,o=isNaN(i.innerRadius)?e.innerRadius:i.innerRadius,r=isNaN(i.outerRadius)?e.outerRadius:i.outerRadius,l=i.clipSector),{startAngle:n,endAngle:a,innerRadius:o,outerRadius:r,clipSector:l}},fromFn:(e,i,s)=>{let n,a,o,r,l;return s=function(t,e,i){if("updated"===i){if(null==t.previousDatum||isNaN(t.previousDatum.innerRadius)||isNaN(t.previousDatum.outerRadius))return"added";if(isNaN(e.innerRadius)||isNaN(e.outerRadius))return"removed"}return"added"===i&&null!=t.previousDatum?"updated":i}(e,i,s),"removed"===s||"updated"===s?(n=e.startAngle,a=e.endAngle,o=e.innerRadius,r=e.outerRadius,l=e.clipSector):(n=t,a=t,o=i.innerRadius,r=i.outerRadius),l??(l=new EA(n,a,o,r)),{startAngle:n,endAngle:a,innerRadius:o,outerRadius:r,clipSector:l,phase:PA.NODE_UPDATE_STATE_TO_PHASE_MAPPING[s]}}}}function FA(t,e){return{centerX:0,centerY:0,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clipSector:e.clipSector}}var{ChartAxisDirection:zA,PolarAxis:GA,diff:_A,groupAccumulativeValueProperty:jA,keyProperty:WA,normaliseGroupTo:VA,valueProperty:KA,fixNumericExtent:YA,resetLabelFn:$A,seriesLabelFadeInAnimation:HA,seriesLabelFadeOutAnimation:UA,animationValidation:XA,angleBetween:ZA,createDatumId:qA,CategoryScale:QA,Sector:JA,SectorBox:tT,motion:eT,isGradientFill:iT,applyShapeStyle:sT,getShapeStyle:nT}=s.n1,aT=class extends s.n1.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},oT=class extends s.n1.PolarSeries{constructor(t){super({moduleCtx:t,categoryKey:"radiusValue",useLabelLayer:!0,canHaveAxes:!0,animationResetFns:{item:FA,label:$A}}),this.properties=new RA,this.NodeEvent=aT,this.groupScale=new QA,this.circleCache={r:0,cx:0,cy:0}}get defaultShapeStyle(){const t=this.axes[zA.Angle]?.scale;return{...this.properties.fillGradientDefaults.toJson(),rotation:s.n1.toDegrees(t.range[0])+90}}nodeFactory(){return new JA}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===zA.Angle){const t=e.getDomain(this,"angleValue-end","value",i),s=[t[0]>0?0:t[0],t[1]<0?0:t[1]];return YA(s)}return e.getDomain(this,"radiusValue","key",i)}async processData(t){const{angleKey:e,radiusKey:i,normalizedTo:s}=this.properties,a=!this.ctx.animationManager.isSkipped(),o=this.getStackId(),r=`${o}-trailing`,l=[];(0,n.vM)(s)&&l.push(VA([o,r],Math.abs(s))),a&&(this.processedData&&l.push(_A(this.id,this.processedData)),l.push(XA()));const h=this.visible?{}:{forceValue:0},c=this.axes[zA.Radius]?.scale.type,d=this.axes[zA.Angle]?.scale.type;await this.requestDataModel(t,this.data,{props:[WA(i,c,{id:"radiusValue"}),KA(e,d,{id:"angleValue-raw",invalidValue:null,...h}),...jA(e,"normal","current",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:o,separateNegative:!0,...h},d),...jA(e,"trailing","current",{id:"angleValue-start",invalidValue:null,groupId:r,separateNegative:!0,...h},d),...l],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,s=this.circleCache;return(t!==s.r||e!==s.cx||i!==s.cy)&&(this.circleCache={r:t,cx:e,cy:i},!0)}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:t=[]}=this.createNodeData()??{};this.nodeData=t,this.nodeDataRefresh=!1}getAxisInnerRadius(){const t=this.axes[zA.Radius];return t instanceof GA?this.radius*t.innerRadiusRatio:0}createNodeData(){const{processedData:t,dataModel:e}=this;if(!e||!t||"grouped"!==t.type)return;const i=this.axes[zA.Angle],s=this.axes[zA.Radius],n=i?.scale,a=s?.scale;if(!n||!a)return;const o=e.resolveKeysById(this,"radiusValue",t),r=e.resolveColumnById(this,"angleValue-start",t),l=e.resolveColumnById(this,"angleValue-end",t),h=e.resolveColumnById(this,"angleValue-raw",t),c=e.resolveProcessedDataIndexById(this,"angleValue-range");let d=0;s instanceof Vt&&(d=s.groupPaddingInner);const{groupScale:u}=this,{index:p,visibleGroupCount:g}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);u.domain=Array.from({length:g}).map((t,e)=>String(e)),u.range=[0,Math.abs(a.bandwidth??0)],u.paddingInner=g>1?d:0;const m=u.bandwidth>=1?u.bandwidth:u.rawBandwidth,y=i.isReversed(),f=s.isReversed(),x=f?this.radius:this.getAxisInnerRadius(),b=(f?this.getAxisInnerRadius():this.radius)+x,{angleKey:v,radiusKey:S,angleName:M,radiusName:k,label:D}=this.properties,w=(t,e,i,s)=>{const n=this.getLabelText(D,{value:e,datum:t,angleKey:v,radiusKey:S,angleName:M,radiusName:k});if(n)return{x:i,y:s,text:n,textAlign:"center",textBaseline:"middle"}},I=[],C={itemId:S,nodeData:I,labelData:I};if(!this.visible)return C;const{dataSources:L}=t,A=L.get(this.id)??[];for(const{datumIndex:i,group:s}of e.forEachGroupDatum(this,t)){const t=A[i],e=o[i];if(null==e)return;const d=h[i],g=r[i],f=l[i],x=d>=0&&!Object.is(d,-0),v=s.aggregation[c][x?1:0],S=x===y;let M=n.convert(g,{clamp:!0}),k=n.convert(f,{clamp:!0}),D=n.convert(0,{clamp:!0}),C=n.convert(v,{clamp:!0});S&&([D,C]=[C,D],[M,k]=[k,M]);const L=b-a.convert(e)+u.convert(String(p)),T=L+m,N=(L+T)/2,O=M+ZA(M,k)/2,R=Math.cos(O)*N,E=Math.sin(O)*N,P=this.properties.label.enabled?w(t,d,R,E):void 0,B=new tT(M,k,L,T);I.push({series:this,datum:t,datumIndex:i,point:{x:R,y:E,size:0},midPoint:{x:R,y:E},label:P,angleValue:d,radiusValue:e,innerRadius:L,outerRadius:T,startAngle:D,endAngle:C,clipSector:B,reversed:S,index:i})}return C}update({seriesRect:t}){const e=this.checkResize(t);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return nT({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},this.defaultShapeStyle,e.fillPatternDefaults,e.fillImageDefaults)}getItemStyleOverrides(t,e,i,s){const{id:n,properties:a}=this,{angleKey:o,radiusKey:r,itemStyler:l}=a;let h;return null!=l&&(h=this.cachedDatumCallback(qA(t,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:n,datum:e,highlighted:s,angleKey:o,radiusKey:r,...i}))),nT(h,this.defaultShapeStyle,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateSectorSelection(t,e){let i=[];if(e){const t=this.ctx.highlightManager?.getActiveHighlight();t?.datum&&t.series===this&&i.push(t)}else i=this.nodeData;const n=this.getItemBaseStyle(e),a=this.getShapeFillBBox();t.update(i,void 0,t=>this.getDatumId(t)).each((t,i)=>{const{datum:o,datumIndex:r}=i,l=this.getItemStyleOverrides(String(r),o,n,e),h=l?.cornerRadius??n.cornerRadius,c=l?.fill??n.fill,d=s.n1.isGradientFill(c)&&"item"!==c.bounds?{centerX:0,centerY:0}:void 0;sT(t,n,l,a,d),t.lineJoin="round",t.inset=null!=t.stroke?t.strokeWidth/2:0,t.startInnerCornerRadius=o.reversed?h:0,t.startOuterCornerRadius=o.reversed?h:0,t.endInnerCornerRadius=o.reversed?0:h,t.endOuterCornerRadius=o.reversed?0:h,e&&(t.startAngle=i.startAngle,t.endAngle=i.endAngle,t.clipSector=i.clipSector,t.innerRadius=i.innerRadius,t.outerRadius=i.outerRadius)})}updateLabels(){const{label:t}=this.properties;this.labelSelection.update(this.nodeData).each((e,i)=>{t.enabled&&i.label?(e.x=i.label.x,e.y=i.label.y,e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=i.label.text,e.textAlign=i.label.textAlign,e.textBaseline=i.label.textBaseline,e.visible=!0):e.visible=!1})}getBarTransitionFunctions(){const t=this.axes[zA.Angle]?.scale;let e=0;if(!t)return BA(e);const i=Math.min(t.domain[0],t.domain[1]),s=Math.max(t.domain[0],t.domain[1]);return i<=0&&s>=0&&(e=t.convert(0)),BA(e)}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getBarTransitionFunctions();eT.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),HA(this,"labels",this.ctx.animationManager,t)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getBarTransitionFunctions();eT.fromToMotion(this.id,"datums",e,[t],i),UA(this,"labels",e,this.labelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:a}=this,{angleKey:o,angleName:r,radiusKey:l,radiusName:h,tooltip:c}=a,d=n[zA.Angle],u=n[zA.Radius];if(!(i&&s&&d&&u))return;const p=s.dataSources.get(this.id)?.[t],g=i.resolveKeysById(this,"radiusValue",s)[t],m=i.resolveColumnById(this,"angleValue-raw",s)[t];if(null==g)return;const y=this.getItemBaseStyle(!1);return Object.assign(y,this.getItemStyleOverrides(String(t),t,y,!1)),this.formatTooltipWithContext(c,{heading:u.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:o,value:d.formatDatum(m)}]},{seriesId:e,datum:p,title:r,angleKey:o,angleName:r,radiusKey:l,radiusName:h,...y})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o,fillPatternDefaults:r,fillImageDefaults:l}=this.properties,h=nT({fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:o},this.defaultShapeStyle,r,l);return iT(h.fill)&&(h.fill={...h.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:h}}getLegendData(t){if("category"!==t)return[];const{id:e,visible:i}=this,{angleKey:s,angleName:n,showInLegend:a}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i,label:{text:n??s},symbol:this.legendItemSymbol(),hideInLegend:!a}]}getDatumId(t){return qA(t.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}};oT.className="RadialBarSeries",oT.type="radial-bar";var{commonSeriesOptionsDefs:rT,radialBarSeriesThemeableOptionsDef:lT}=s.n1,hT={...lT,...rT,type:(0,n.mw)((0,n.dY)("radial-bar")),angleKey:(0,n.mw)(n.Yj),radiusKey:(0,n.mw)(n.Yj),angleName:n.Yj,radiusName:n.Yj,grouped:n.zM,stacked:n.zM,stackGroup:n.Yj,normalizedTo:n.ai},{ThemeConstants:{POLAR_AXIS_TYPE:cT}}=s.n1,dT={series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"conic",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}}},axes:{[cT.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},{POLAR_AXIS_TYPE:uT}=s.n1.ThemeConstants,pT={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-bar",moduleFactory:t=>new oT(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:uT.ANGLE_NUMBER},{type:uT.RADIUS_CATEGORY}],themeTemplate:dT,stackable:!0,groupable:!0},gT={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,options:hT,create:t=>new oT(t)},{Property:mT}=s.n1,yT=class extends xC{};r([mT],yT.prototype,"columnWidthRatio",2),r([mT],yT.prototype,"maxColumnWidthRatio",2);var{ChartAxisDirection:fT,PolarAxis:xT,RadialColumnShape:bT,getRadialColumnWidth:vT}=s.n1,ST=class extends cC{constructor(t){super(t,{animationResetFns:{item:MC}}),this.properties=new yT}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new bT}getColumnTransitionFunctions(){return function(t){const e=vC();return{toFn:(i,s,n)=>{const{startAngle:a,endAngle:o}=e.to(s);let r,l,h,c,d;return"removed"===n?(r=i.innerRadius,l=i.innerRadius,h=i.columnWidth,c=i.axisInnerRadius,d=i.axisOuterRadius):(r=isNaN(s.innerRadius)?t:s.innerRadius,l=isNaN(s.outerRadius)?t:s.outerRadius,h=isNaN(s.columnWidth)?i.columnWidth:s.columnWidth,c=s.axisInnerRadius,d=s.axisOuterRadius),{innerRadius:r,outerRadius:l,columnWidth:h,axisInnerRadius:c,axisOuterRadius:d,startAngle:a,endAngle:o}},fromFn:(i,s,n)=>{n=SC(i,s,n),e.calculate(i,s,n);const{startAngle:a,endAngle:o}=e.from(s);let r,l,h,c,d;return"removed"===n||"updated"===n?(r=i.innerRadius,l=i.outerRadius,h=i.columnWidth,c=i.axisInnerRadius,d=i.axisOuterRadius):(r=t,l=t,h=s.columnWidth,c=s.axisInnerRadius,d=s.axisOuterRadius),{innerRadius:r,outerRadius:l,columnWidth:h,axisInnerRadius:c,axisOuterRadius:d,startAngle:a,endAngle:o,phase:bC.NODE_UPDATE_STATE_TO_PHASE_MAPPING[n]}}}}(this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius())}isRadiusAxisCircle(){const t=this.axes[fT.Radius];return t instanceof xT&&"circle"===t.shape}updateItemPath(t,e,i){t.isBeveled=this.isRadiusAxisCircle(),t.isRadiusAxisReversed=this.isRadiusAxisReversed(),i&&(t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius,t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.columnWidth=e.columnWidth,t.axisInnerRadius=e.axisInnerRadius,t.axisOuterRadius=e.axisOuterRadius)}getColumnWidth(t,e){const{columnWidthRatio:i=.5,maxColumnWidthRatio:s=.5}=this.properties;return vT(t,e,this.radius,i,s)}};ST.className="RadialColumnSeries",ST.type="radial-column";var{commonSeriesOptionsDefs:MT,radialColumnSeriesThemeableOptionsDef:kT}=s.n1,DT={...kT,...MT,type:(0,n.mw)((0,n.dY)("radial-column")),angleKey:(0,n.mw)(n.Yj),radiusKey:(0,n.mw)(n.Yj),angleName:n.Yj,radiusName:n.Yj,grouped:n.zM,stacked:n.zM,stackGroup:n.Yj,normalizedTo:n.ai},{ThemeConstants:{POLAR_AXIS_TYPE:wT,POLAR_AXIS_SHAPE:IT}}=s.n1,CT={$path:["./shape",IT.CIRCLE,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]},LT={series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[wT.ANGLE_CATEGORY]:{shape:CT,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[wT.RADIUS_NUMBER]:{shape:CT,innerRadiusRatio:.5}}},{POLAR_AXIS_TYPE:AT}=s.n1.ThemeConstants,TT={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-column",moduleFactory:t=>new ST(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:AT.ANGLE_CATEGORY},{type:AT.RADIUS_NUMBER}],themeTemplate:LT,stackable:!0,groupable:!0},NT={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,options:DT,create:t=>new ST(t)},{SvgPath:OT,Rotatable:RT,Translatable:ET,Scalable:PT}=s.n1,BT=class extends(RT(PT(ET(OT)))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};BT.defaultPathData="M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";var{BaseProperties:FT,SeriesTooltip:zT,SeriesProperties:GT,PropertiesArray:_T,AxisLabel:jT,Property:WT,Label:VT}=s.n1,KT=class extends VT{};r([WT],KT.prototype,"spacing",2);var YT=class extends FT{constructor(){super(...arguments),this.label=new KT}};r([WT],YT.prototype,"text",2),r([WT],YT.prototype,"value",2),r([WT],YT.prototype,"shape",2),r([WT],YT.prototype,"placement",2),r([WT],YT.prototype,"spacing",2),r([WT],YT.prototype,"size",2),r([WT],YT.prototype,"rotation",2),r([WT],YT.prototype,"fill",2),r([WT],YT.prototype,"fillOpacity",2),r([WT],YT.prototype,"stroke",2),r([WT],YT.prototype,"strokeWidth",2),r([WT],YT.prototype,"strokeOpacity",2),r([WT],YT.prototype,"lineDash",2),r([WT],YT.prototype,"lineDashOffset",2),r([WT],YT.prototype,"label",2);var $T=class extends FT{constructor(){super(...arguments),this.enabled=!0,this.fills=new _T(s.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};r([WT],$T.prototype,"enabled",2),r([WT],$T.prototype,"fills",2),r([WT],$T.prototype,"fillMode",2),r([WT],$T.prototype,"fill",2),r([WT],$T.prototype,"fillOpacity",2),r([WT],$T.prototype,"stroke",2),r([WT],$T.prototype,"strokeWidth",2),r([WT],$T.prototype,"strokeOpacity",2),r([WT],$T.prototype,"lineDash",2),r([WT],$T.prototype,"lineDashOffset",2);var HT=class extends FT{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};r([WT],HT.prototype,"values",2),r([WT],HT.prototype,"step",2),r([WT],HT.prototype,"minSpacing",2),r([WT],HT.prototype,"maxSpacing",2);var UT=class extends jT{},XT=class extends FT{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new _T(s.n1.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new HT,this.label=new UT}};r([WT],XT.prototype,"min",2),r([WT],XT.prototype,"max",2),r([WT],XT.prototype,"fills",2),r([WT],XT.prototype,"fillMode",2),r([WT],XT.prototype,"fill",2),r([WT],XT.prototype,"fillOpacity",2),r([WT],XT.prototype,"stroke",2),r([WT],XT.prototype,"strokeWidth",2),r([WT],XT.prototype,"strokeOpacity",2),r([WT],XT.prototype,"lineDash",2),r([WT],XT.prototype,"lineDashOffset",2),r([WT],XT.prototype,"defaultFill",2),r([WT],XT.prototype,"interval",2),r([WT],XT.prototype,"label",2);var ZT=class extends FT{constructor(){super(...arguments),this.enabled=!0,this.spacing=0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};r([WT],ZT.prototype,"enabled",2),r([WT],ZT.prototype,"radiusRatio",2),r([WT],ZT.prototype,"spacing",2),r([WT],ZT.prototype,"fill",2),r([WT],ZT.prototype,"fillOpacity",2),r([WT],ZT.prototype,"stroke",2),r([WT],ZT.prototype,"strokeWidth",2),r([WT],ZT.prototype,"strokeOpacity",2),r([WT],ZT.prototype,"lineDash",2),r([WT],ZT.prototype,"lineDashOffset",2);var qT=class extends ly{};r([WT],qT.prototype,"text",2);var QT=class extends hy{};r([WT],QT.prototype,"text",2);var JT=class extends GT{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new ek,this.defaultColorRange=[],this.targets=new _T(YT),this.defaultTarget=new YT,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new XT,this.bar=new $T,this.needle=new ZT,this.label=new qT,this.secondaryLabel=new QT,this.tooltip=new zT}};r([WT],JT.prototype,"value",2),r([WT],JT.prototype,"startAngle",2),r([WT],JT.prototype,"endAngle",2),r([WT],JT.prototype,"segmentation",2),r([WT],JT.prototype,"defaultColorRange",2),r([WT],JT.prototype,"targets",2),r([WT],JT.prototype,"defaultTarget",2),r([WT],JT.prototype,"outerRadiusRatio",2),r([WT],JT.prototype,"innerRadiusRatio",2),r([WT],JT.prototype,"outerRadius",2),r([WT],JT.prototype,"innerRadius",2),r([WT],JT.prototype,"cornerRadius",2),r([WT],JT.prototype,"cornerMode",2),r([WT],JT.prototype,"spacing",2),r([WT],JT.prototype,"scale",2),r([WT],JT.prototype,"bar",2),r([WT],JT.prototype,"needle",2),r([WT],JT.prototype,"label",2),r([WT],JT.prototype,"secondaryLabel",2),r([WT],JT.prototype,"tooltip",2);var{SectorBox:tN}=s.n1;function eN(t,e,i){return Math.max(t,i.startAngle)<=Math.min(e,i.endAngle)}function iN(t){return null!=t.clipStartAngle&&null!=t.clipEndAngle}function sN(t,e){const{clipStartAngle:i,clipEndAngle:s,innerRadius:n,outerRadius:a}=t;return new tN(i,e?i:s,n,a)}function nN(t,e){const i=t?"initial":"update";return{node:{fromFn(e,s){const n=e.previousDatum;let{startAngle:a,endAngle:o}=n??s;const r=null!=n&&iN(n)?sN(n,t):void 0,l=iN(s)?sN(s,t):void 0;let h;return null!=r&&null!=l?h=r:null==r&&null!=l?(h=l,a=s.startAngle,o=s.endAngle):null!=r&&null==l?(h=void 0,a=s.startAngle,o=s.endAngle):t&&(o=a),{startAngle:a,endAngle:o,clipSector:h,phase:i}},toFn(t,e){const{startAngle:i,endAngle:s}=e;let n;return iN(e)&&(n=sN(e,!1)),{startAngle:i,endAngle:s,clipSector:n}},applyFn(t,e){const{startAngle:i,endAngle:s}=e;let{clipSector:n}=e;null!=n&&(n=new tN(Math.max(i,n.startAngle),Math.min(s,n.endAngle),n.innerRadius,n.outerRadius));const a=null==n||eN(i,s,n);t.startAngle=i,t.endAngle=s,t.clipSector=n,t.visible=a}},needle:{fromFn(s){let{angle:n}=s.previousDatum??s.datum;return t&&(n=e),{rotation:n,phase:i}},toFn(t,e){const{angle:i}=e;return{rotation:i}}}}}function aN(t,e){const{startAngle:i,endAngle:s}=e,n=function(t){const{startAngle:e,endAngle:i,clipStartAngle:s,clipEndAngle:n,innerRadius:a,outerRadius:o}=t;if(null!=s&&null!=n)return new tN(Math.max(s,e),Math.min(n,i),a,o)}(e);return{startAngle:i,endAngle:s,clipSector:n,visible:null==n||eN(i,s,n)}}function oN(t,e){const{angle:i}=e;return{rotation:i}}var rN={top:0,middle:.5,bottom:1},{fromToMotion:lN,resetMotion:hN,CachedTextMeasurerPool:cN,SeriesNodePickMode:dN,StateMachine:uN,createDatumId:pN,normalizeAngle360:gN,normalizeAngle360Inclusive:mN,isBetweenAngles:yN,sectorBox:fN,toDegrees:xN,toRadians:bN,BBox:vN,Group:SN,PointerEvents:MN,Selection:kN,Sector:DN,SectorBox:wN,Text:IN,Marker:CN,getColorStops:LN}=s.n1,AN={inside:90,middle:0,outside:-90},TN=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],NN=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],ON=class extends s.n1.Series{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[dN.EXACT_SHAPE_MATCH,dN.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new JT,this.scale=new it,this.scaleGroup=this.contentGroup.appendChild(new SN({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new SN({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new SN({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new SN({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new SN({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new SN({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new SN({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new SN({name:"tickGroup"})),this.scaleSelection=kN.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=kN.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=kN.select(this.itemNeedleGroup,BT),this.targetSelection=kN.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=kN.select(this.itemTargetLabelGroup,IN),this.labelSelection=kN.select(this.itemLabelGroup,IN),this.highlightTargetSelection=kN.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=kN.select(this.tickGroup,s.n1.TransformableText),this.datumUnion=new KM,this.animationState=new uN("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=MN.None,this.tickGroup.pointerEvents=MN.None,this.itemNeedleGroup.pointerEvents=MN.None,this.itemLabelGroup.pointerEvents=MN.None}get hasData(){return null!=this.properties.value}nodeFactory(){return new DN}markerFactory(){const t=new CN;return t.size=1,t}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){const{min:e,max:i}=this.properties.scale;return $M(t,{min:e,max:i})}layoutScale(){const{scale:t,properties:e}=this,{seriesRectWidth:i,seriesRectHeight:s}=this.nodeDataDependencies,{scale:a,outerRadius:o}=this.properties,{min:r,max:l,label:h,interval:c}=a,d=bN(e.startAngle-90),u=bN(e.endAngle-90),p=mN(u-d)>Math.PI,g=p||yN(1.5*Math.PI,d,u),m=p||yN(0*Math.PI,d,u),y=p||yN(.5*Math.PI,d,u),f=p||yN(1*Math.PI,d,u);let x,b;x=f&&!m?"right":!f&&m?"left":"center",b=g&&!y?"bottom":!g&&y?"top":"middle";const v=fN({startAngle:d,endAngle:u,innerRadius:0,outerRadius:.5}),S=2*-(v.x+v.width/2),M=2*-(v.y+v.height/2),k=Math.min(i/v.width,s/v.height);t.domain=[r,l],t.range=[d,u],t.arcLength=k/2;const{maxSpacing:D,minSpacing:w}=c,{arcLength:I}=t,C=D?Math.floor(I/D):1,L=w?Math.floor(I/w):1/0,A=Math.floor(4/Math.PI*Math.abs(t.range[0]-t.range[1])),T=Math.max(C,Math.min(L,A)),N=c.values??t.ticks({nice:!1,interval:c.step,minTickCount:C,maxTickCount:L,tickCount:T})?.ticks??[],O=N.reduce((t,e)=>Math.max(t,"number"==typeof e?(0,n.o3)(e):0),0),R=t.tickFormatter({domain:t.domain,ticks:N,fractionDigits:O,specifier:"string"==typeof h.format?h.format:void 0}),E=h.getFont(),P=N.map((e,i)=>{let s;h.formatter&&(s=UM(this.ctx,h.formatter,{value:e,index:i,domain:t.domain,boundSeries:void 0})),void 0===s&&(s=R(e));const{width:n,height:a}=cN.measureText(s,{font:E});return{index:i,value:e,text:s,width:n,height:a}}),B=P.reduce((t,e)=>Math.max(t,e.width),0),F=P.reduce((t,e)=>Math.max(t,e.height),0),z=h.enabled?Math.max(B,F)+h.spacing:0,G=Math.max(.5*k-z,0),_=o??G;return this.centerX=i/2+S*_,this.centerY=s/2+M*_,this.radius=_,this.textAlign=x,this.verticalAlign=b,P}createConicGradient(t,e){const{scale:i}=this,{domain:s,range:n}=i,[a,o]=n,{defaultColorRange:r}=this.properties,l=gN((a+o)/2+Math.PI),h=mN(o-a);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:LN(t,r,s,e).map(({color:t,stop:e})=>(e=Math.min(Math.max(e,0),1),{stop:e=((e=(a+h*e-l)/(2*Math.PI))%1+1)%1,color:t})),rotation:xN(l)+90}}getShapeFillBBox(){const{centerX:t,centerY:e,radius:i}=this;return new vN(t-i,e-i,2*i,2*i)}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(t=>{const{text:i=e.text,value:s=e.value??0,shape:n=e.shape??"triangle",rotation:a=e.rotation??0,strokeWidth:o=e.strokeWidth??0,placement:r=e.placement??"middle",spacing:l=e.spacing??0,size:h=e.size??0,fill:c=e.fill??"black",fillOpacity:d=e.fillOpacity??1,stroke:u=e.stroke??"black",strokeOpacity:p=e.strokeOpacity??1,lineDash:g=e.lineDash??[0],lineDashOffset:m=e.lineDashOffset??0}=t,{enabled:y=e.label.enabled,color:f=e.label.color??"black",fontStyle:x=e.label.fontStyle??"normal",fontWeight:b=e.label.fontWeight??"normal",fontSize:v=e.label.fontSize,fontFamily:S=e.label.fontFamily,spacing:M=e.label.spacing??0}=t.label;return{text:i,value:s,shape:n,placement:r,spacing:l,size:h,rotation:a,fill:c,fillOpacity:d,stroke:u,strokeWidth:o,strokeOpacity:p,lineDash:g,lineDashOffset:m,label:{enabled:y,color:f,fontStyle:x,fontWeight:b,fontSize:v,fontFamily:S,spacing:M}}})}getTargetRadius(t){const{radius:e,properties:i}=this,{innerRadiusRatio:s,outerRadiusRatio:n}=i,{placement:a,spacing:o,size:r}=t,l=e*n,h=e*s;switch(a){case"inside":return Math.max(h-o-r/2,0);case"outside":return l+o+r/2;default:return(h+l)/2}}getTargetLabel(t){const{scale:e}=this,{value:i,size:s,placement:n,label:a}=t,{spacing:o,color:r,fontStyle:l,fontWeight:h,fontSize:c,fontFamily:d}=a,u=e.convert(i),p=gN(u)/(Math.PI/2)|0,g=s/2+o;let m,y,f,x;switch(n){case"outside":({textAlign:m,textBaseline:y}=TN[p]),f=g*Math.cos(u),x=g*Math.sin(u);break;case"inside":({textAlign:m,textBaseline:y}=NN[p]),f=-g*Math.cos(u),x=-g*Math.sin(u);break;default:m="center",y="bottom",f=0,x=-g}return{offsetX:f,offsetY:x,fill:r,textAlign:m,textBaseline:y,fontStyle:l,fontWeight:h,fontSize:c,fontFamily:d,lineHeight:void 0}}createNodeData(){const t=this.layoutScale(),{id:e,scale:i,properties:s,radius:n,centerX:a,centerY:o}=this,{value:r,innerRadiusRatio:l,outerRadiusRatio:h,segmentation:c,cornerRadius:d,cornerMode:u,needle:p,bar:g,scale:m,label:y,secondaryLabel:f}=s,{outerRadius:x=n*h,innerRadius:b=n*l}=s,v=this.getTargets(),S=[],M=[],k=[],D=[],w=[],I="item"===u,C=i.convert(i.domain[0]),L=i.convert(r),A=Math.ceil(mN(L-C)*n);let T=c.enabled?c.interval.getSegments(i,A):void 0;const N=g.enabled?g.fill??this.createConicGradient(g.fills,g.fillMode):"rgba(0,0,0,0)",O=m.fill??(g.enabled&&0===m.fills.length?m.defaultFill:void 0)??this.createConicGradient(m.fills,m.fillMode);if(null==T&&I){const t={value:r,segmentStart:Math.min(...i.domain),segmentEnd:Math.max(...i.domain)},e=Math.min(d,(x-b)/2)/((b+x)/2);S.push({series:this,itemId:"value",datum:t,datumIndex:{type:0},type:0,centerX:a,centerY:o,outerRadius:x,innerRadius:b,startAngle:C-e,endAngle:L+e,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,fill:N}),w.push({series:this,itemId:"scale",datum:t,datumIndex:{type:0},type:0,centerX:a,centerY:o,outerRadius:x,innerRadius:b,startAngle:i.range[0]-e,endAngle:i.range[1]+e,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,fill:O})}else{T??(T=i.domain);for(let t=0;t<T.length-1;t++){const e=T[t],s=T[t+1],n={value:r,segmentStart:e,segmentEnd:s},l=0===t,h=t===T.length-2,c=i.convert(e),u=i.convert(s);S.push({series:this,itemId:`value-${t}`,datum:n,datumIndex:{type:0},type:0,centerX:a,centerY:o,outerRadius:x,innerRadius:b,startAngle:c,endAngle:u,clipStartAngle:C,clipEndAngle:L,startCornerRadius:I||l?d:0,endCornerRadius:I||h?d:0,fill:N}),w.push({series:this,itemId:`scale-${t}`,datum:n,datumIndex:{type:0},type:0,centerX:a,centerY:o,outerRadius:x,innerRadius:b,startAngle:c,endAngle:u,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:I||l?d:0,endCornerRadius:I||h?d:0,fill:O})}}if(!p.enabled&&y.enabled){const{text:t,color:e,fontSize:i,minimumFontSize:s,fontStyle:n,fontWeight:l,fontFamily:h,lineHeight:c,formatter:d=t=>this.formatLabel(t.value)}=y;D.push({label:"primary",centerX:a,centerY:o,text:t,value:r,fill:e,fontSize:i,minimumFontSize:s,fontStyle:n,fontWeight:l,fontFamily:h,lineHeight:c,formatter:d})}if(!p.enabled&&f.enabled){const{text:t,color:e,fontSize:i,minimumFontSize:s,fontStyle:n,fontWeight:l,fontFamily:h,lineHeight:c,formatter:d}=f;D.push({label:"secondary",centerX:a,centerY:o,text:t,value:r,fill:e,fontSize:i,minimumFontSize:s,fontStyle:n,fontWeight:l,fontFamily:h,lineHeight:c,formatter:d})}if(p.enabled){let t=null!=p.radiusRatio?n*p.radiusRatio:b;t=Math.max(t-p.spacing,0);const e=i.convert(r);k.push({centerX:a,centerY:o,radius:t,angle:e,series:this})}for(let t=0;t<v.length;t+=1){const e=v[t],{value:s,text:n,size:r,shape:l,fill:h,fillOpacity:c,stroke:d,strokeWidth:u,strokeOpacity:p,lineDash:g,lineDashOffset:m}=e;if(s<Math.min(...i.domain)||s>Math.max(...i.domain))continue;const y=this.getTargetRadius(e),f=i.convert(s),x=bN(e.rotation+AN[e.placement]);M.push({series:this,itemId:`target-${t}`,midPoint:{x:y*Math.cos(f)+a,y:y*Math.sin(f)+o},datum:{value:s},datumIndex:{type:1,index:t},type:1,value:s,text:n,centerX:a,centerY:o,shape:l,radius:y,angle:f,rotation:x,size:r,fill:h,fillOpacity:c,stroke:d,strokeOpacity:p,strokeWidth:u,lineDash:g,lineDashOffset:m,label:this.getTargetLabel(e)})}return{itemId:e,nodeData:S,needleData:k,targetData:M,labelData:D,scaleData:w,tickData:t}}updateSelections(t){(this.nodeDataRefresh||t)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(t){if(null!=t&&t.series===this&&1===t.type)return t}update({seriesRect:t}){const{datumSelection:e,labelSelection:i,needleSelection:s,targetSelection:n,targetLabelSelection:a,scaleSelection:o,highlightTargetSelection:r,tickSelection:l}=this,h=this.checkResize(t);this.updateSelections(h),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const c=this.contextNodeData?.nodeData??[],d=this.contextNodeData?.labelData??[],u=this.contextNodeData?.needleData??[],p=this.contextNodeData?.targetData??[],g=this.contextNodeData?.scaleData??[],m=this.contextNodeData?.tickData??[],y=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:g,scaleSelection:o}),this.updateScaleNodes({scaleSelection:o}),this.needleSelection=this.updateNeedleSelection({needleData:u,needleSelection:s}),this.updateNeedleNodes({needleSelection:s}),this.targetSelection=this.updateTargetSelection({targetData:p,targetSelection:n}),this.updateTargetNodes({targetSelection:n,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:p,targetLabelSelection:a}),this.updateTargetLabelNodes({targetLabelSelection:a}),this.datumSelection=this.updateDatumSelection({nodeData:c,datumSelection:e}),this.updateDatumNodes({datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:d,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:null!=y?[y]:[],targetSelection:r}),this.updateTargetNodes({targetSelection:r,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:m,tickSelection:l}),this.updateTickNodes({tickSelection:l}),h&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>pN(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i,properties:n}=this,{bar:a,segmentation:o}=n,r=o.spacing??0,{fillOpacity:l,stroke:h,strokeOpacity:c,lineDash:d,lineDashOffset:u}=a,p=this.getStrokeWidth(a.strokeWidth),g=i.animationManager.isSkipped(),m=this.getShapeFillBBox();e.each((t,e)=>{const{centerX:i,centerY:n,innerRadius:a,outerRadius:o,startCornerRadius:y,endCornerRadius:f,fill:x}=e;t.centerX=i,t.centerY=n,t.innerRadius=a,t.outerRadius=o,t.pointerEvents=this.properties.bar.enabled?s.n1.PointerEvents.All:s.n1.PointerEvents.None,t.fill=x,t.fillBBox=m,t.fillOpacity=l,t.stroke=h,t.strokeOpacity=c,t.strokeWidth=p,t.lineDash=d,t.lineDashOffset=u,t.startOuterCornerRadius=y,t.startInnerCornerRadius=y,t.endOuterCornerRadius=f,t.endInnerCornerRadius=f,t.radialEdgeInset=(r+t.strokeWidth)/2,t.concentricEdgeInset=t.strokeWidth/2,(g||null==t.previousDatum)&&t.setProperties(aN(0,e))}),this.datumUnion.update(e,this.itemGroup,s.n1.Sector,(t,e,i)=>{t.clipSector??(t.clipSector=new wN(NaN,NaN,NaN,NaN)),t.centerX=e.centerX,t.centerY=e.centerY,t.outerRadius=t.clipSector.outerRadius=e.outerRadius,t.innerRadius=t.clipSector.innerRadius=e.innerRadius,t.startAngle=t.clipSector.startAngle=e.startAngle,t.startInnerCornerRadius=e.startInnerCornerRadius,t.startOuterCornerRadius=e.startOuterCornerRadius,t.endAngle=i.endAngle,t.clipSector.endAngle=i.clipSector?.endAngle??i.endAngle,t.endInnerCornerRadius=i.endInnerCornerRadius,t.endOuterCornerRadius=i.endOuterCornerRadius,t.pointerEvents=s.n1.PointerEvents.None})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>pN(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,{scale:i,segmentation:s}=this.properties,n=s.spacing??0,{fillOpacity:a,stroke:o,strokeOpacity:r,strokeWidth:l,lineDash:h,lineDashOffset:c}=i,d=this.getShapeFillBBox();e.each((t,e)=>{const{centerX:i,centerY:s,innerRadius:u,outerRadius:p,startCornerRadius:g,endCornerRadius:m,fill:y}=e;t.centerX=i,t.centerY=s,t.innerRadius=u,t.outerRadius=p,t.fill=y,t.fillBBox=d,t.fillOpacity=a,t.stroke=o,t.strokeOpacity=r,t.strokeWidth=l,t.lineDash=h,t.lineDashOffset=c,t.startOuterCornerRadius=g,t.startInnerCornerRadius=g,t.endOuterCornerRadius=m,t.endInnerCornerRadius=m,t.radialEdgeInset=(n+t.strokeWidth)/2,t.concentricEdgeInset=t.strokeWidth/2,t.setProperties(aN(0,e))})}updateNeedleSelection(t){return t.needleSelection.update(t.needleData,void 0,()=>pN([]))}updateNeedleNodes(t){const{needleSelection:e}=t,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,strokeWidth:o,lineDash:r,lineDashOffset:l}=this.properties.needle,h=this.ctx.animationManager.isSkipped();e.each((t,e)=>{const{centerX:c,centerY:d,radius:u}=e,p=2*u;t.d=BT.defaultPathData,t.fill=i,t.fillOpacity=s,t.stroke=n,t.strokeOpacity=a,t.strokeWidth=o/p,t.lineDash=r.map(t=>t/p),t.lineDashOffset=l/p,t.translationX=c,t.translationY=d,t.scalingX=p,t.scalingY=p,h&&t.setProperties(oN(0,e))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,t=>t.itemId)}updateTargetNodes(t){const{targetSelection:e,isHighlight:i}=t,s=i?this.properties.highlightStyle.item:void 0;e.each((t,e)=>{const{centerX:i,centerY:n,angle:a,radius:o,shape:r,size:l,rotation:h,fill:c,fillOpacity:d,stroke:u,strokeOpacity:p,strokeWidth:g,lineDash:m,lineDashOffset:y}=e;t.shape="line"===r?XM:r,t.size=l,t.fill=s?.fill??c,t.fillOpacity=s?.fillOpacity??d,t.stroke=s?.stroke??u,t.strokeOpacity=s?.strokeOpacity??p,t.strokeWidth=s?.strokeWidth??g,t.lineDash=s?.lineDash??m,t.lineDashOffset=s?.lineDashOffset??y,t.translationX=i+o*Math.cos(a),t.translationY=n+o*Math.sin(a),t.rotation=a+h})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData,void 0,t=>t.itemId)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((t,e)=>{const{centerX:i,centerY:s,radius:n,angle:a,text:o}=e,{offsetX:r,offsetY:l,fill:h,fontStyle:c,fontWeight:d,fontSize:u,fontFamily:p,textAlign:g,textBaseline:m}=e.label;null!=o?(t.visible=!0,t.x=i+n*Math.cos(a)+r,t.y=s+n*Math.sin(a)+l,t.text=o,t.fill=h,t.fontStyle=c,t.fontWeight=d,t.fontSize=u,t.fontFamily=p,t.textAlign=g,t.textBaseline=m):t.visible=!1})}updateLabelSelection(t){return t.labelSelection.update(t.labelData,void 0,t=>t.label)}updateLabelNodes(t){const{labelSelection:e}=t,i=this.ctx.animationManager.isSkipped();e.each((t,e)=>{t.fill=e.fill,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontFamily=e.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(t){return t.tickSelection.update(t.tickData,void 0,t=>t.index)}updateTickNodes(t){const{scale:e,radius:i,centerX:s,centerY:n,properties:a}=this,{enabled:o,color:r,fontFamily:l,fontSize:h,fontStyle:c,fontWeight:d,spacing:u}=a.scale.label,p=bN(a.scale.label.rotation??0);t.tickSelection.each((t,a)=>{if(!o)return void(t.visible=!1);t.visible=!0,t.text=a.text,t.fill=r,t.fontFamily=l,t.fontSize=h,t.fontStyle=c,t.fontWeight=d,t.textAlign="center",t.textBaseline="middle";const g=e.convert(a.value),{width:m,height:y}=a,f=Math.abs(i*Math.cos(g)),x=Math.abs(i*Math.sin(g)),b=Math.min(Math.max(Math.abs(i/Math.tan(g)),f-m/2),f+m/2),v=Math.min(Math.max(Math.abs(i*Math.tan(g)),x-y/2),x+y/2),S=Math.hypot(b,v),M=s+(S+u)*Math.cos(g),k=n+(S+u)*Math.sin(g);t.x=M,t.y=k,t.rotationCenterX=M,t.rotationCenterY=k,t.rotation=p})}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(null==t.text)return!1;return!0}formatLabelText(t){const{labelSelection:e,radius:i,textAlign:s,verticalAlign:n}=this,{spacing:a,innerRadiusRatio:o}=this.properties;!function(t,e,i,s,n,a){const{padding:o,textAlign:r,verticalAlign:l}=s;let h,c;if(i.each((t,e)=>{"primary"===e.label?h=e:"secondary"===e.label&&(c=e)}),null==h)return;const d=HM(t.id,e,h,a?.label);if(null==d)return;const u=null!=c?HM(t.id,e,c,a?.secondaryLabel):void 0,p={padding:o},g="center"===r?2:1,m="middle"===l?2:1,y=t=>({width:Math.sqrt(Math.max(n**2-(t/m)**2,0))*g,height:Math.min(t,m*n),meta:null});let f,x,b;if(null!=c&&null!=u){const t=ey(d,h,u,c,p,y);f=t?.label,x=t?.secondaryLabel,b=t?.height??0}else{const t=iy(d,h,p,y);f=t?.[0],x=void 0,b=t?.[0].height??0}const v=b*rN[l];i.each((t,e)=>{let i;if("primary"===e.label?i=f:"secondary"===e.label&&(i=x),null==i)return void(t.visible=!1);t.visible=!0,t.text=i.text,t.fontSize=i.fontSize,t.lineHeight=i.lineHeight,t.textAlign=r,t.textBaseline="middle";const s="primary"===e.label?i.height/2:b-i.height/2;t.y=e.centerY+s-v,t.x=e.centerX})}(this,this.ctx,e,{padding:a,textAlign:s,verticalAlign:n},i*o,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),hN([this.datumSelection],aN),hN([this.needleSelection],oN),this.formatLabelText()}resetAnimation(t){"initial"===t?this.animationState.transition("reset"):"ready"===t&&this.animationState.transition("skip")}animateLabelText(t={}){const{animationManager:e}=this.ctx;let i,s,n,a;if(this.labelSelection.each((e,o)=>{e.opacity=1,"primary"===o.label?(i=e.previousDatum?.value??t.from??o.value,s=o.value):"secondary"===o.label&&(n=e.previousDatum?.value??t.from??o.value,a=o.value)}),this.labelsHaveExplicitText());else if(null==s||null==a)this.formatLabelText();else if(i===s&&n===a)this.formatLabelText({label:s,secondaryLabel:a});else{const o=`${this.id}_labels`;e.animate({id:o,groupId:"label",from:{label:i,secondaryLabel:n},to:{label:s,secondaryLabel:a},phase:t.phase??"update",onUpdate:t=>this.formatLabelText(t)})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=nN(!0,this.scale.range[0]);lN(this.id,"node",t,[this.datumSelection],e,(t,e)=>e.itemId),lN(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),lN(this.id,"label",t,[this.labelSelection],YM,(t,e)=>e.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=nN(!1,this.scale.range[0]);lN(this.id,"node",t,[this.datumSelection],e,(t,e)=>e.itemId),lN(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(t){const{id:e,properties:i}=this,{tooltip:s}=i;let n,a;if(0===t.type?(n=i.value,a=i.label.text):({value:n,text:a}=i.targets[t.index]),null!=n)return this.formatTooltipWithContext(s,{data:[{label:a,fallbackLabel:"Value",value:this.formatLabel(n)}]},{seriesId:e,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(t){return ZM(this,t)}pickFocus(t){return qM(this,t)}getCaptionText(){const{value:t}=this.properties,e=[];return e.push(this.formatLabel(t)),this.labelSelection.each((t,i)=>{const s=HM(this.id,this.ctx,i);null!=s&&e.push(s)}),e.join(". ")}getCategoryValue(t){}datumIndexForCategoryValue(t){}};ON.className="RadialGaugeSeries",ON.type="radial-gauge";var{FONT_SIZE_RATIO:RN}=s.n1,EN={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"radial-gauge",moduleFactory:t=>new ON(t),tooltipDefaults:{range:10},themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,startAngle:270,endAngle:450,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},s.n1.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./2",s.n1.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:12}},bar:{strokeWidth:0},segmentation:{enabled:!1,interval:{},spacing:2},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"outside",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},needle:{enabled:!1,fill:{$ref:"foregroundColor"},spacing:10},label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[RN.LARGE]},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}}}}},PN={type:"series",name:"radial-gauge",chartType:"gauge",enterprise:!0,options:s.n1.radialGaugeSeriesOptionsDef,create:t=>new ON(t)};function BN(t){t.nodes.sort((t,e)=>Math.round(100*(t.datum.y-e.datum.y))/100||-(t.datum.size-e.datum.size))}function FN(t,e,i,s,n,a,o,r){const l=(i-t)/(s-e),h=(o-n)/(r-a),c=(l*h*(a-e)+t*h-n*l)/(h-l);return t<i?c>t&&c<Math.min(i,o):c<t&&c>Math.max(i,o)}function zN(t,e){let i=!1;const s=t.nodes.filter(t=>1===e(t).length);let n=!0;for(let t=0;n&&t<s.length;t+=1){n=!1;for(let t=0;t<s.length-1;t+=1){const{datum:a}=s[t],o=e(s[t])[0].node.datum,{datum:r}=s[t+1],l=e(s[t+1])[0].node.datum;if(!(FN(a.x,a.y,o.x,o.y,r.x,r.y,l.x,l.y)||FN(a.x,a.y+a.height/2,o.x,o.y+o.height/2,r.x,r.y+r.height/2,l.x,l.y+l.height/2)||FN(a.x,a.y+a.height,o.x,o.y+o.height,r.x,r.y+r.height,l.x,l.y+l.height)))continue;const h=s[t];s[t]=s[t+1],s[t+1]=h;const c=a.y;a.y=r.y+r.height-a.height,r.y=c,i=!0,n=!0}}return i}function GN(t){let e=!1;return BN(t),e=zN(t,t=>t.linksBefore)||e,e=zN(t,t=>t.linksAfter)||e,e}function _N(t,e,i,s){return t.nodes.forEach(({datum:t,linksBefore:e,linksAfter:n})=>{const a=1===s?n:e,o=function(t){if(0===t.length)return;let e=0,i=0;for(const{node:{datum:s}}of t)e+=s.y*s.size,i+=s.size;return e/i}(1===s?e:n);if(null!=o){const e=0!==a.length?i:1;t.y=t.y+(o-t.y)*e}}),function(t,e){const{nodes:i}=t,{seriesRectHeight:s,nodeSpacing:n}=e;BN(t);let a=0,o=0;for(const{datum:t}of i){const e=Math.max(o-t.y,0);t.y+=e,a+=e,o=t.y+t.height+n}if(o-n<s)return a>0;let r=s;for(let t=i.length-1;t>=0;t-=1){const{datum:e}=i[t],s=e.y+e.height,o=Math.min(r-s,0);e.y+=o,a+=o,r=e.y-n}return!0}(t,e)}function jN(t,e,i){let s=!1;for(const n of t)s=_N(n,e,i,1)||s;return s}function WN(t,e,i){let s=!1;for(let n=t.length-1;n>=0;n-=1)s=_N(t[n],e,i,-1)||s;return s}function VN(t){let e=!1;for(let i=t.length-1;i>=0;i-=1)e=GN(t[i])||e;return e}var{BBox:KN,Path:YN,SceneChangeDetection:$N,splitBezier:HN}=s.n1;function UN(t,e,i,s,n,a,o,r,l,h){let c,d;if(n!==i&&l!==o){const t=-(s-e)/(n-i),h=-(r-a)/(l-o);c=(o-i+t*e-h*a)/(t-h),d=t*(c-e)+i}else if(n===i&&l!==o)c=e,d=-(r-a)/(l-o)*(c-r)+l;else{if(n===i||l!==o)throw new Error("Offsetting flat bezier curve");c=r,d=-(s-e)/(n-i)*(c-e)+i}const u=Math.hypot(i-d,e-c),p=(u+h)/u,g=Math.hypot(l-d,r-c),m=(g+h)/g,y=c+(s-c)*p,f=d+(n-d)*p,x=c+(a-c)*m,b=d+(o-d)*m,v=c+(r-c)*m,S=d+(l-d)*m;t.cubicCurveTo(y,f,x,b,v,S)}var XN=class extends YN{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0}computeBBox(){const t=Math.min(this.x1,this.x2),e=Math.max(this.x1,this.x2)-t,i=Math.min(this.y1,this.y2),s=Math.max(this.y1,this.y2)-i+this.height;return new KN(t,i,e,s)}updatePath(){const{path:t,inset:e}=this;t.clear();const i=this.x1+e,s=this.x2-e,n=this.y1+e,a=this.y2+e,o=this.height-2*e;if(o<0||i>s)return;const r=i,l=n+o/2,h=(i+s)/2,c=n+o/2,d=(i+s)/2,u=a+o/2,p=s,g=a+o/2;if(t.moveTo(r,l-o/2),Math.abs(this.y2-this.y1)<1||this.x2-this.x1<this.height*Math.SQRT2)t.cubicCurveTo(h,c-o/2,d,u-o/2,p,g-o/2),t.lineTo(p,g+o/2),t.cubicCurveTo(d,u+o/2,h,c+o/2,r,l+o/2);else{const[e,i]=HN(r,l,h,c,d,u,p,g,.5),s=(a>n?1:-1)*o/2;UN(t,e[0].x,e[0].y,e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y,s),UN(t,i[0].x,i[0].y,i[1].x,i[1].y,i[2].x,i[2].y,i[3].x,i[3].y,-s),t.lineTo(p,g+o/2),UN(t,i[3].x,i[3].y,i[2].x,i[2].y,i[1].x,i[1].y,i[0].x,i[0].y,s),UN(t,e[3].x,e[3].y,e[2].x,e[2].y,e[1].x,e[1].y,e[0].x,e[0].y,-s)}t.closePath()}};r([$N()],XN.prototype,"x1",2),r([$N()],XN.prototype,"x2",2),r([$N()],XN.prototype,"y1",2),r([$N()],XN.prototype,"y2",2),r([$N()],XN.prototype,"height",2),r([$N()],XN.prototype,"inset",2);var{BaseProperties:ZN,FillGradientDefaults:qN,FillPatternDefaults:QN,FillImageDefaults:JN,SeriesTooltip:tO,SeriesProperties:eO,Property:iO,Label:sO}=s.n1,nO=class extends sO{constructor(){super(...arguments),this.spacing=1}};r([iO],nO.prototype,"spacing",2);var aO=class extends ZN{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};r([iO],aO.prototype,"fill",2),r([iO],aO.prototype,"fillOpacity",2),r([iO],aO.prototype,"stroke",2),r([iO],aO.prototype,"strokeOpacity",2),r([iO],aO.prototype,"strokeWidth",2),r([iO],aO.prototype,"lineDash",2),r([iO],aO.prototype,"lineDashOffset",2),r([iO],aO.prototype,"itemStyler",2);var oO=class extends ZN{constructor(){super(...arguments),this.spacing=1,this.width=1,this.alignment="justify",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};r([iO],oO.prototype,"spacing",2),r([iO],oO.prototype,"width",2),r([iO],oO.prototype,"alignment",2),r([iO],oO.prototype,"fill",2),r([iO],oO.prototype,"fillOpacity",2),r([iO],oO.prototype,"stroke",2),r([iO],oO.prototype,"strokeOpacity",2),r([iO],oO.prototype,"strokeWidth",2),r([iO],oO.prototype,"lineDash",2),r([iO],oO.prototype,"lineDashOffset",2),r([iO],oO.prototype,"itemStyler",2);var rO=class extends eO{constructor(){super(...arguments),this.nodes=void 0,this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.fillGradientDefaults=new qN,this.fillPatternDefaults=new QN,this.fillImageDefaults=new JN,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new nO,this.link=new aO,this.node=new oO,this.tooltip=new tO}};r([iO],rO.prototype,"nodes",2),r([iO],rO.prototype,"fromKey",2),r([iO],rO.prototype,"toKey",2),r([iO],rO.prototype,"idKey",2),r([iO],rO.prototype,"idName",2),r([iO],rO.prototype,"labelKey",2),r([iO],rO.prototype,"labelName",2),r([iO],rO.prototype,"sizeKey",2),r([iO],rO.prototype,"sizeName",2),r([iO],rO.prototype,"fillGradientDefaults",2),r([iO],rO.prototype,"fillPatternDefaults",2),r([iO],rO.prototype,"fillImageDefaults",2),r([iO],rO.prototype,"defaultColorRange",2),r([iO],rO.prototype,"defaultPatternFills",2),r([iO],rO.prototype,"fills",2),r([iO],rO.prototype,"strokes",2),r([iO],rO.prototype,"label",2),r([iO],rO.prototype,"link",2),r([iO],rO.prototype,"node",2),r([iO],rO.prototype,"tooltip",2);var{Transformable:lO,applyShapeStyle:hO,SeriesNodePickMode:cO,CachedTextMeasurerPool:dO,TextWrapper:uO,TextUtils:pO,createDatumId:gO,getShapeStyle:mO,Rect:yO,BBox:fO}=s.n1,xO=class extends Mv{constructor(t){super({moduleCtx:t,pickModes:[cO.NEAREST_NODE,cO.EXACT_SHAPE_MATCH]}),this.properties=new rO}isLabelEnabled(){return(null!=this.properties.labelKey||null==this.nodes)&&this.properties.label.enabled}linkFactory(){return new XN}nodeFactory(){return new yO}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:a,sizeKey:o,label:{spacing:r},node:{spacing:l,width:h,alignment:c}}=this.properties,{nodeGraph:d,links:u,maxPathLength:p}=this.getNodeGraph(t=>({...t,x:NaN,y:NaN,width:h,height:NaN}),t=>({...t,x1:NaN,x2:NaN,y1:NaN,y2:NaN,height:NaN}),{includeCircularReferences:!1}),g=d,m=this.isLabelEnabled()?(e-h)*(1-p/(p+1)):0,y=(e-h-2*m)/(p-1),f=[];for(let t=0;t<p;t+=1){const e=m+t*y;f.push({index:t,size:0,nodes:[],x:e})}g.forEach(t=>{const{datum:e,linksBefore:i,linksAfter:n,maxPathLengthBefore:r,maxPathLengthAfter:l}=t,h=Math.max(i.reduce((t,{link:e})=>t+e.size,0),n.reduce((t,{link:e})=>t+e.size,0));if(0===i.length&&0===n.length||0===h)return void(t.columnIndex=-1);let d;switch(c){case"left":d=f[r];break;case"right":d=f[p-1-l];break;case"center":if(0!==i.length)d=f[r];else if(0!==n.length){const t=n.reduce((t,e)=>Math.min(t,e.node.maxPathLengthBefore),p)-1;d=f[t]}else d=f[0];break;case"justify":d=0===n.length?f[p-1]:f[r]}e.x=d.x,e.size=h;const u=this.getLabelText(this.properties.label,{datum:e.datum,value:e.label,fromKey:s,toKey:a,sizeKey:o,size:h});e.label=String(u),d.nodes.push(t),d.size+=h,t.columnIndex=d.index}),g.forEach(t=>{let e=1/0,i=0;t.linksAfter.forEach(t=>{const s=t.node,{columnIndex:n}=s;n<e?(e=n,i=s.datum.size):n===e&&(i=Math.max(i,s.datum.size))}),t.closestColumnIndex=e,t.maxSizeOfClosestNodesAfter=i});const x=f.reduce((t,{size:e,nodes:s})=>{const n=(1-(s.length-1)*(l/i))/e;return Math.min(t,n)},1/0);for(let t=f.length-1;t>=0;t-=1)f[t].nodes.sort((t,e)=>t.closestColumnIndex-e.closestColumnIndex||t.maxSizeOfClosestNodesAfter-e.maxSizeOfClosestNodesAfter||t.datum.size-e.datum.size);!function(t,e){t.forEach(t=>{!function({nodes:t,size:e},{seriesRectHeight:i,nodeSpacing:s,sizeScale:n}){let a=(i-(i*e*n+s*(t.length-1)))/2;t.forEach(({datum:t})=>{const e=i*t.size*n;t.y=a,t.height=e,a+=e+s})}(t,e)});let i=!1;for(let s=0;s<6;s+=1){const s=jN(t,e,1);i=WN(t,e,.5);const n=VN(t);if(!s&&!i&&!n)break}i&&(jN(t,e,1),VN(t))}(f,{seriesRectHeight:i,nodeSpacing:l,sizeScale:x});let b=!1;if(g.forEach(({datum:t,linksBefore:e,linksAfter:s})=>{b||(b=t.height<0);const n=t.y+t.height,a=e=>e.sort((e,i)=>{const s=e.node.datum,a=i.node.datum,o=s.y+s.height,r=a.y+a.height;return Math.atan2(s.y-t.y,Math.abs(s.x-t.x))-Math.atan2(a.y-t.y,Math.abs(a.x-t.x))+(Math.atan2(o-n,Math.abs(s.x-t.x))-Math.atan2(r-n,Math.abs(a.x-t.x)))});let o=t.y;a(e).forEach(({link:t})=>{t.y2=o,o+=t.size*i*x});let r=t.y;a(s).forEach(({link:t})=>{t.y1=r,r+=t.size*i*x})}),b)return void n.Vy.warnOnce("There was insufficient space to display the Sankey Series. Reduce the node spacing, or provide a larger container.");const v=[],S=[],{fontSize:M}=this.properties.label,k=this.properties.label.getFont();return f.forEach((t,i)=>{const s=0===i,n=i===f.length-1;let a=-1/0;t.nodes.sort((t,e)=>t.datum.y-e.datum.y),t.nodes.forEach(({datum:t})=>{if(t.midPoint={x:t.x+t.width/2,y:t.y+t.height/2},v.push(t),null==t.label)return;const i=s?t.x-r:t.x+t.width+r,o=t.y+t.height/2;let l;if(!s&&!n){const i=o-pO.getLineHeight(M),s=o+pO.getLineHeight(M);let n=e;g.forEach(({datum:e})=>{e.x>t.x&&Math.max(e.y,i)<=Math.min(e.y+e.height,s)&&(n=Math.min(n,e.x-r))});const a=n-t.x-2*r;l=uO.wrapText(t.label,{maxWidth:a,maxHeight:t.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(null==l||""===l){const e=s||n?r:2*r;l=uO.wrapText(t.label,{maxWidth:y-e,maxHeight:t.height,font:this.properties.label,textWrap:"never"})}if(""===l)return;const{height:h}=dO.measureText(l,{font:k,textAlign:"left",textBaseline:"middle"}),c=o+h/2;o-h/2>=a&&(S.push({x:i,y:o,leading:s,text:l}),a=c)})}),u.forEach(t=>{const{fromNode:e,toNode:s,size:n}=t;t.height=i*n*x,t.x1=e.x+h,t.x2=s.x,t.midPoint={x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2+t.height/2},v.push(t)}),{itemId:t,nodeData:v,labelData:S}}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:a,fontFamily:o}=this.properties.label;e.each((t,{x:e,y:r,leading:l,text:h})=>{t.visible=!0,t.x=e,t.y=r,t.text=h,t.fill=i,t.fontStyle=s,t.fontWeight=n,t.fontSize=a,t.fontFamily=o,t.textAlign=l?"right":"left",t.textBaseline="middle"})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,t=>gO([t.type,t.id]))}getBaseNodeStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}=e.node,l=t?e.highlightStyle.item:void 0;return mO({fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??n,strokeOpacity:l?.strokeOpacity??a,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.node.strokeWidth),lineDash:l?.lineDash??o,lineDashOffset:l?.lineDashOffset??r},e.fillGradientDefaults,e.fillPatternDefaults,e.fillImageDefaults)}getNodeStyleOverrides(t,e,i,s,n,a,o){const{id:r,properties:l}=this,{fills:h,strokes:c,defaultColorRange:d,defaultPatternFills:u}=l,{itemStyler:p}=l.node,g=a.fill??h[i%h.length],m=a.stroke??c[i%c.length],y=d[i%d.length].map(t=>({color:t})),f=u[i%u.length];let x;if(o||(x??(x={}),x.fill=g,x.stroke=m),null!=p){const i=this.cachedDatumCallback(gO(t,"node",o?"highlight":"node"),()=>{const{fillOpacity:t=1,strokeOpacity:i=1,strokeWidth:l=0,lineDash:h=[],lineDashOffset:c=0}=a;return this.callWithContext(p,{seriesId:r,datum:e,highlighted:o,label:n,size:s,fill:g,fillOpacity:t,stroke:m,strokeOpacity:i,strokeWidth:l,lineDash:h,lineDashOffset:c})});x??(x={}),Object.assign(x,i)}return mO(x,{...this.properties.fillGradientDefaults.toJson(),colorStops:y},{...this.properties.fillPatternDefaults.toJson(),fill:f,stroke:f},this.properties.fillImageDefaults)}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseNodeStyle(i),n=this.getShapeFillBBox();e.each((t,e)=>{const{datumIndex:a,size:o,label:r}=e,l=this.getNodeStyleOverrides(String(a.index),e.datum,a.index,o,r,s,i);t.x=e.x,t.y=e.y,t.width=Math.max(e.width,0),t.height=Math.max(e.height,0),hO(t,s,l,n)})}getShapeFillBBox(){const t=this._nodeDataDependencies?.seriesRectWidth??0,e=this._nodeDataDependencies?.seriesRectHeight??0,i=new fO(0,0,t,e);return{series:i,axis:i}}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,t=>gO([t.type,t.index,t.fromNode.id,t.toNode.id]))}getBaseLinkStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:a,lineDash:o,lineDashOffset:r}=e.link,l=t?e.highlightStyle.item:void 0;return mO({fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??n,strokeOpacity:l?.strokeOpacity??a,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.link.strokeWidth),lineDash:l?.lineDash??o,lineDashOffset:l?.lineDashOffset??r},e.fillGradientDefaults,e.fillPatternDefaults,e.fillImageDefaults)}getLinkStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,{fills:r,strokes:l,defaultColorRange:h,defaultPatternFills:c}=o,{itemStyler:d}=o.link,u=s.fill??r[i%r.length],p=s.stroke??l[i%l.length],g=h[i%h.length].map(t=>({color:t})),m=c[i%c.length];let y;if(n||(y??(y={}),y.fill=u,y.stroke=p),null!=d){const i=this.cachedDatumCallback(gO(t,"link",n?"highlight":"node"),()=>{const{fillOpacity:t=1,strokeOpacity:i=1,strokeWidth:o=0,lineDash:r=[],lineDashOffset:l=0}=s;return this.callWithContext(d,{seriesId:a,datum:e,highlighted:n,fill:u,fillOpacity:t,stroke:p,strokeOpacity:i,strokeWidth:o,lineDash:r,lineDashOffset:l})});y??(y={}),Object.assign(y,i)}return mO(y,{...this.properties.fillGradientDefaults.toJson(),colorStops:g},{...this.properties.fillPatternDefaults.toJson(),fill:m,stroke:m},this.properties.fillImageDefaults)}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseLinkStyle(i),n=this.getShapeFillBBox();e.each((t,e)=>{const{datumIndex:a}=e,o=e.fromNode.datumIndex,r=this.getLinkStyleOverrides(String(a.index),e.datum,o.index,s,i);t.x1=e.x1,t.y1=e.y1,t.x2=e.x2,t.y2=e.y2,t.height=e.height,hO(t,s,r,n),t.inset=t.strokeWidth/2})}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:s,properties:n}=this,{fromKey:a,toKey:o,sizeKey:r,sizeName:l,tooltip:h}=n,c=this.contextNodeData?.nodeData.find(e=>e.datumIndex.type===t.type&&e.datumIndex.index===t.index);if(null==c)return;const d=0===c.type?c.fromNode.index:c.index,u=0===c.type?`${c.fromNode.label} - ${c.toNode.label}`:c.label,p=0===t.type?i?.dataSources.get(this.id)?.[t.index]:s?.dataSources.get(this.id)?.[t.index],g=c.size;let m;if(0===c.type){const e=c.fromNode.datumIndex,i=this.getBaseLinkStyle(!1);Object.assign(i,this.getLinkStyleOverrides(String(t.index),p,e.index,i,!1)),m=i}else{const e=c.label,i=this.getBaseNodeStyle(!1);Object.assign(i,this.getNodeStyleOverrides(String(t.index),p,t.index,g,e,i,!1)),m=i}return this.formatTooltipWithContext(h,{title:u,symbol:this.legendItemSymbol(c.type,d,m),data:null!=r?[{label:l,fallbackLabel:r,value:String(g)}]:[]},{seriesId:e,datum:p,title:u,fromKey:a,toKey:o,sizeKey:r,sizeName:l,size:g,...m})}computeFocusBounds(t){if(t instanceof yO){const{x:e,y:i,width:s,height:n}=t,a=new fO(e,i,s,n);return lO.toCanvas(this.contentGroup,a)}return t}};xO.className="SankeySeries",xO.type="sankey";var{commonSeriesOptionsDefs:bO,sankeySeriesThemeableOptionsDef:vO}=s.n1,SO={...vO,...bO,type:(0,n.mw)((0,n.dY)("sankey")),fromKey:(0,n.mw)(n.Yj),toKey:(0,n.mw)(n.Yj),sizeKey:n.Yj,sizeName:n.Yj};SO.fillGradientDefaults=(0,n._L)(n.wi),SO.fillPatternDefaults=(0,n._L)(n.GY),SO.fillImageDefaults=(0,n._L)(n.Zd),SO.defaultColorRange=(0,n._L)((0,n.jk)((0,n.jk)(n.yW))),SO.defaultPatternFills=(0,n._L)((0,n.jk)(n.yW));var MO={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"sankey",moduleFactory:t=>new xO(t),tooltipDefaults:{range:"exact"},themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,defaultColorRange:{$palette:"gradients"},defaultPatternFills:s.n1.SAFE_FILLS_OPERATION,highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:20,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0}},legend:{enabled:!1,toggleSeries:!1}}},kO={type:"series",name:"sankey",chartType:"flow-proportion",enterprise:!0,options:SO,create:t=>new xO(t)},{HierarchySeriesProperties:DO,HighlightStyle:wO,SeriesTooltip:IO,Property:CO}=s.n1,LO=class extends wO{constructor(){super(...arguments),this.label=new ly,this.secondaryLabel=new ly}};r([CO],LO.prototype,"fill",2),r([CO],LO.prototype,"fillOpacity",2),r([CO],LO.prototype,"stroke",2),r([CO],LO.prototype,"strokeWidth",2),r([CO],LO.prototype,"strokeOpacity",2),r([CO],LO.prototype,"label",2),r([CO],LO.prototype,"secondaryLabel",2);var AO=class extends DO{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlightStyle=new LO,this.label=new ly,this.secondaryLabel=new hy,this.tooltip=new IO}};r([CO],AO.prototype,"sizeName",2),r([CO],AO.prototype,"labelKey",2),r([CO],AO.prototype,"secondaryLabelKey",2),r([CO],AO.prototype,"fillOpacity",2),r([CO],AO.prototype,"strokeWidth",2),r([CO],AO.prototype,"strokeOpacity",2),r([CO],AO.prototype,"cornerRadius",2),r([CO],AO.prototype,"sectorSpacing",2),r([CO],AO.prototype,"padding",2),r([CO],AO.prototype,"itemStyler",2),r([CO],AO.prototype,"highlightStyle",2),r([CO],AO.prototype,"label",2),r([CO],AO.prototype,"secondaryLabel",2),r([CO],AO.prototype,"tooltip",2);var{fromToMotion:TO,normalizeAngle360:NO,createDatumId:OO,Sector:RO,Group:EO,ScalableGroup:PO,Selection:BO,TransformableText:FO,BBox:zO,applyShapeStyle:GO,getShapeStyle:_O}=s.n1,jO=class extends s.n1.HierarchyNode{constructor(){super(...arguments),this.label=void 0,this.secondaryLabel=void 0,this.contentHeight=0,this.bbox=void 0,this.startAngle=0,this.endAngle=0}};function WO(t,e=0,i=2*Math.PI/t.sumSize){for(const s of t.children){const t=e+s.sumSize*i;s.startAngle=e,s.endAngle=t,WO(s,e,i),e=t}}var VO=class extends s.n1.HierarchySeries{constructor(){super(...arguments),this.NodeClass=jO,this.properties=new AO,this.scalingGroup=this.contentGroup.appendChild(new PO),this.sectorGroup=this.scalingGroup.appendChild(new EO),this.sectorLabelGroup=this.scalingGroup.appendChild(new EO),this.highlightSectorGroup=this.scalingGroup.appendChild(new EO),this.datumSelection=BO.select(this.sectorGroup,RO),this.labelSelection=BO.select(this.sectorLabelGroup,EO),this.highlightSelection=BO.select(this.highlightSectorGroup,RO)}processData(){super.processData(),WO(this.rootNode)}updateSelections(){const t=this.ctx.highlightManager?.getActiveHighlight();if(this.highlightSelection.update(null!=t?[t]:[],void 0,t=>this.getDatumId(t)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:e}=this;if(null==e)return;if(null==e.seriesRect)return;const i=Array.from(this.rootNode);this.datumSelection.update(i,void 0,t=>this.getDatumId(t)),this.labelSelection.update(i,t=>{t.append([new FO({tag:0}),new FO({tag:1})])},t=>this.getDatumId(t))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle:void 0;return _O({fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity},e.fillGradientDefaults,e.fillPatternDefaults,e.fillImageDefaults)}getItemStyleOverrides(t,e,i,s,n,a){const{id:o,properties:r,colorScale:l}=this,{fills:h,strokes:c,itemStyler:d}=r,u=t[0],p=n.fill??h[u%h.length],g=n.stroke??c[u%c.length],m={};if(a||(m.fill=null!=s?l.convert(s):p,m.stroke=g),null!=d){const s=this.cachedDatumCallback(OO(t.join(":"),a?"highlight":"node"),()=>this.callWithContext(d,{seriesId:o,datum:e,depth:i,highlighted:a,fill:p,stroke:g,...n}));Object.assign(m,s)}return _O(m,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateNodes(){const{chart:t,data:e,maxDepth:i}=this;if(null==t||null==e)return;const{width:n,height:a}=t.seriesRect,{sectorSpacing:o=0,padding:r=0,cornerRadius:l,childrenKey:h,colorKey:c,colorName:d,labelKey:u,secondaryLabelKey:p,sizeKey:g,sizeName:m}=this.properties;this.contentGroup.translationX=n/2,this.contentGroup.translationY=a/2;const y=.5*o,f=Math.min(n,a)/2,x=f/(i+1),b=-Math.PI/2,v={series:new zO(-f,-f,2*f,2*f),axis:new zO(-f,-f,2*f,2*f)};this.rootNode?.walk(t=>{const{startAngle:e,endAngle:i}=t;if(null!=t.depth){const s=(e+i)/2+b,n=(t.depth+.5)*x;t.midPoint.x=Math.cos(s)*n,t.midPoint.y=Math.sin(s)*n}}),this.rootNode?.walk(t=>{const{datum:e,depth:i,startAngle:s,endAngle:n,parent:a,sumSize:o}=t;let l,f;if(t.label=void 0,t.secondaryLabel=void 0,t.contentHeight=0,null!=e&&null!=i&&null!=u){const t=e[u];l=this.getLabelText(this.properties.label,{depth:i,datum:e,childrenKey:h,colorKey:c,colorName:d,labelKey:u,secondaryLabelKey:p,sizeKey:g,sizeName:m,value:t})}if(""===l&&(l=void 0),null!=e&&null!=i&&null!=p){const t=e[p];f=this.getLabelText(this.properties.secondaryLabel,{depth:i,datum:e,childrenKey:h,colorKey:c,colorName:d,labelKey:u,secondaryLabelKey:p,sizeKey:g,sizeName:m,value:t})}if(""===f&&(f=void 0),null==i)return;const v=i*x+y,S=(i+1)*x-y,M=v>y?y/v:y,k=S>y?y/S:y,D=n+M-(s+M),w=n+k-(s+k),I=ny(l,this.properties.label,f,this.properties.secondaryLabel,{padding:r},t=>{if(0===i&&a?.sumSize===o)return{width:2*Math.sqrt(S**2-(.5*t)**2),height:t,meta:0};const e=t,s=2*Math.sqrt(S**2-(v+e)**2),n=D<Math.PI?2*v*Math.tan(.5*D):1/0,r=Math.min(s,n),l=Math.PI/4;let h,c;return 0===i?(h=t,c=Math.sqrt(S**2-(h/2)**2)-t/(2*Math.tan(.5*w))):NO(D)<l?(h=2*v*Math.tan(.5*D),c=Math.sqrt(S**2-(h/2)**2)-v):(c=0,h=0),r>=c?{width:r,height:e,meta:1}:{width:c,height:h,meta:2}});if(null==I)return;const{width:C,height:L,meta:A,label:T,secondaryLabel:N}=I,O=b+(s+n)/2,R=(Math.sin(O)>=0?3:12)&(Math.cos(O)>=0?6:9);let E;switch(A){case 0:E=0;break;case 1:{const t=S-.58*(x-L),e=Math.sqrt((S-r)**2-(C/2)**2);E=Math.min(t,e);break}case 2:E=0===i?.5*(L/(2*Math.tan(.5*D))+.5*C+(Math.sqrt(S**2-(.5*L)**2)-.5*C)):.5*(v+S)}if(null!=T){const{fontStyle:e="normal",fontFamily:i,fontWeight:s="normal",color:n="black"}=this.properties.label;t.label={...T,fontStyle:e,fontFamily:i,fontWeight:s,color:n,labelPlacement:A,circleQuarter:R,radius:E,theta:O}}if(null!=N){const{fontStyle:e="normal",fontFamily:i,fontWeight:s="normal",color:n="black"}=this.properties.secondaryLabel;t.secondaryLabel={...N,fontStyle:e,fontFamily:i,fontWeight:s,color:n,labelPlacement:A,circleQuarter:R,radius:E,theta:O}}t.contentHeight=I.height});const S=(t,e,i,n)=>{const{datum:a,datumIndex:o,depth:r,colorValue:h,startAngle:c,endAngle:d}=t;if(null==r)return void(e.visible=!1);e.visible=!0;const u=this.getItemStyleOverrides(o,a,r,h,i,n),p=u.fill??i.fill,g=u.strokeWidth??i.strokeWidth,m=s.n1.isGradientFill(p)&&"item"!==p.bounds?v:void 0;GO(e,i,u,m),e.centerX=0,e.centerY=0,e.innerRadius=r*x,e.outerRadius=(r+1)*x,e.startAngle=c+b,e.endAngle=d+b,e.inset=y+.5*g,e.cornerRadius=l},M=this.getItemBaseStyle(!1);this.datumSelection.each((t,e)=>{S(e,t,M,!1)});const k=this.getItemBaseStyle(!0);this.highlightSelection.each((t,e)=>{S(e,t,k,!0)});const D=(t,e,i,s)=>{const{depth:n,contentHeight:a}=t,o=0===i,r=o?t.label:t.secondaryLabel;if(null==n||null==r)return void(e.visible=!1);const{labelPlacement:l,circleQuarter:h,radius:c,theta:d}=r;let u;switch(s&&(u=(o?this.properties.highlightStyle.label:this.properties.highlightStyle.secondaryLabel).color),e.text=r.text,e.fontSize=r.fontSize,e.lineHeight=r.lineHeight,e.fontStyle=r.fontStyle,e.fontFamily=r.fontFamily,e.fontWeight=r.fontWeight,e.fill=u??r.color,l){case 0:e.textAlign="center",e.textBaseline="top",e.translationX=0,e.translationY=(o?0:a-r.height)-.5*a,e.rotation=0;break;case 1:{const t=!!(3&h),i=o===!t?c:c-(a-r.height);e.textAlign="center",e.textBaseline=t?"bottom":"top",e.translationX=Math.cos(d)*i,e.translationY=Math.sin(d)*i,e.rotation=t?d-.5*Math.PI:d+.5*Math.PI;break}case 2:{const t=!!(6&h),i=o===!t?.5*(a-r.height):.5*(r.height-a);e.textAlign="center",e.textBaseline="middle",e.translationX=Math.cos(d)*c+Math.cos(d+Math.PI/2)*i,e.translationY=Math.sin(d)*c+Math.sin(d+Math.PI/2)*i,e.rotation=t?d:d+Math.PI;break}}e.visible=!0},w=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(FO).forEach(t=>{const e=t.closestDatum();D(e,t,t.tag,e===w)})}getTooltipContent(t){const{id:e,properties:i}=this,{labelKey:n,secondaryLabelKey:a,childrenKey:o,sizeKey:r,sizeName:l,colorKey:h,colorName:c,tooltip:d}=i,u=t.reduce((t,e)=>t?.children[e],this.rootNode);if(null==u)return;const{datum:p,depth:g}=u;if(null==p||null==g)return;const m=[],y=null!=r?p[r]:void 0;null!=y&&m.push({label:l,fallbackLabel:r,value:y});const f=null!=h?p[h]:void 0;null!=f&&m.push({label:c,fallbackLabel:h,value:f});const x=this.getItemBaseStyle(!1);Object.assign(x,this.getItemStyleOverrides(t,p,g,f,x,!1));const b=x.fill,v=_O({shape:"square",fill:b,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0},i.fillGradientDefaults,i.fillPatternDefaults,i.fillImageDefaults);return s.n1.isGradientFill(v.fill)&&(v.fill={...v.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(d,{title:null!=n?p[n]:void 0,symbol:{marker:v},data:m},{seriesId:e,datum:p,title:void 0,depth:g,labelKey:n,secondaryLabelKey:a,childrenKey:o,sizeKey:r,sizeName:l,colorKey:h,colorName:c,...x})}createNodeData(){}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.datumSelection.selectByClass(RO))}animateEmptyUpdateReady(){TO(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn:()=>({scalingX:1,scalingY:1}),fromFn:()=>({scalingX:0,scalingY:0})})}computeFocusBounds(t){return t}};VO.className="SunburstSeries",VO.type="sunburst";var{commonSeriesOptionsDefs:KO,sunburstSeriesThemeableOptionsDef:YO,without:$O}=s.n1,HO={...YO,...$O(KO,["highlightStyle"]),type:(0,n.mw)((0,n.dY)("sunburst")),labelKey:n.Yj,secondaryLabelKey:n.Yj,childrenKey:n.Yj,sizeKey:n.Yj,colorKey:n.Yj,sizeName:n.Yj,colorName:n.Yj},{FONT_SIZE_RATIO:UO}=s.n1,XO={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"sunburst",moduleFactory:t=>new VO(t),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},colorRange:{$palette:"divergingColors"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,label:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[UO.LARGE]},minimumFontSize:{$round:[{$mul:[{$ref:"fontSize"},.75]}]},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[UO.SMALLEST]},minimumFontSize:{$round:[{$mul:[{$ref:"fontSize"},7/12]}]},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlightStyle:{label:{color:{$ref:"backgroundColor"}},secondaryLabel:{color:{$ref:"backgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}},gradientLegend:{enabled:!0}}},ZO={type:"series",name:"sunburst",chartType:"hierarchy",enterprise:!0,options:HO,create:t=>new VO(t)},{BaseProperties:qO,HierarchySeriesProperties:QO,HighlightStyle:JO,SeriesTooltip:tR,Property:eR,Label:iR}=s.n1,sR=class extends iR{constructor(){super(...arguments),this.spacing=0}};r([eR],sR.prototype,"spacing",2);var nR=class extends qO{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new sR}};r([eR],nR.prototype,"fill",2),r([eR],nR.prototype,"fillOpacity",2),r([eR],nR.prototype,"stroke",2),r([eR],nR.prototype,"strokeWidth",2),r([eR],nR.prototype,"strokeOpacity",2),r([eR],nR.prototype,"cornerRadius",2),r([eR],nR.prototype,"textAlign",2),r([eR],nR.prototype,"gap",2),r([eR],nR.prototype,"padding",2),r([eR],nR.prototype,"interactive",2),r([eR],nR.prototype,"label",2);var aR=class extends qO{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new ly,this.secondaryLabel=new hy}};r([eR],aR.prototype,"fill",2),r([eR],aR.prototype,"fillOpacity",2),r([eR],aR.prototype,"stroke",2),r([eR],aR.prototype,"strokeWidth",2),r([eR],aR.prototype,"strokeOpacity",2),r([eR],aR.prototype,"cornerRadius",2),r([eR],aR.prototype,"textAlign",2),r([eR],aR.prototype,"verticalAlign",2),r([eR],aR.prototype,"gap",2),r([eR],aR.prototype,"padding",2),r([eR],aR.prototype,"label",2),r([eR],aR.prototype,"secondaryLabel",2);var oR=class extends qO{constructor(){super(...arguments),this.label=new ly}};r([eR],oR.prototype,"fill",2),r([eR],oR.prototype,"fillOpacity",2),r([eR],oR.prototype,"stroke",2),r([eR],oR.prototype,"strokeWidth",2),r([eR],oR.prototype,"strokeOpacity",2),r([eR],oR.prototype,"label",2);var rR=class extends qO{constructor(){super(...arguments),this.label=new ly,this.secondaryLabel=new hy}};r([eR],rR.prototype,"fill",2),r([eR],rR.prototype,"fillOpacity",2),r([eR],rR.prototype,"stroke",2),r([eR],rR.prototype,"strokeWidth",2),r([eR],rR.prototype,"strokeOpacity",2),r([eR],rR.prototype,"label",2),r([eR],rR.prototype,"secondaryLabel",2);var lR=class extends JO{constructor(){super(...arguments),this.group=new oR,this.tile=new rR}};r([eR],lR.prototype,"group",2),r([eR],lR.prototype,"tile",2);var hR=class extends QO{constructor(){super(...arguments),this.highlightStyle=new lR,this.tooltip=new tR,this.group=new nR,this.tile=new aR,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}};r([eR],hR.prototype,"sizeName",2),r([eR],hR.prototype,"labelKey",2),r([eR],hR.prototype,"secondaryLabelKey",2),r([eR],hR.prototype,"itemStyler",2),r([eR],hR.prototype,"highlightStyle",2),r([eR],hR.prototype,"tooltip",2),r([eR],hR.prototype,"group",2),r([eR],hR.prototype,"tile",2),r([eR],hR.prototype,"undocumentedGroupFills",2),r([eR],hR.prototype,"undocumentedGroupStrokes",2);var{TextUtils:cR,TextWrapper:dR,createDatumId:uR,Rect:pR,Group:gR,BBox:mR,Selection:yR,Text:fR,Transformable:xR,applyShapeStyle:bR,getShapeStyle:vR}=s.n1,SR=class extends s.n1.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}},MR=new fR;function kR(t){return t.children.length>0?t.sumSize-t.sizeValue:t.sizeValue}var DR={left:0,center:.5,right:1},wR={top:0,middle:.5,bottom:1},IR=(s.n1.Group,class extends s.n1.HierarchySeries{constructor(){super(...arguments),this.NodeClass=SR,this.properties=new hR,this.rectGroup=this.contentGroup.appendChild(new gR),this.datumSelection=yR.select(this.rectGroup,pR),this.labelSelection=yR.select(this.labelGroup,gR),this.highlightSelection=yR.select(this.rectGroup,pR)}groupTitleHeight(t,e){const{labelValue:i}=t,{label:s}=this.properties.group;if(null!=i&&!(s.fontSize>e.width/3||s.fontSize>e.height/3)){const{height:t}=function(t,e){const{fontStyle:i,fontWeight:s,fontSize:n,fontFamily:a}=e;MR.setProperties({text:t,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:a,textAlign:"left",textBaseline:"top"});const{width:o,height:r}=MR.getBBox();return{width:o,height:r}}(i,s);return Math.max(t,s.fontSize)}}getNodePadding(t,e){if(null==t.parent)return{top:0,right:0,bottom:0,left:0};if(0===t.children.length){const{padding:t}=this.properties.tile;return{top:t,right:t,bottom:t,left:t}}const{label:{spacing:i},padding:s}=this.properties.group,n=this.groupTitleHeight(t,e);return{top:s+(null!=n?n+i:0),right:s,bottom:s,left:s}}sortChildren({children:t}){const e=Array.from(t,(t,e)=>e).filter(e=>kR(t[e])>0).sort((e,i)=>kR(t[i])-kR(t[e]));return{sortedChildrenIndices:e,childAt:i=>{const s=e[i];return t[s]}}}squarify(t,e){const{datum:i,children:s}=t;if(e.width<=0||e.height<=0)return t.bbox=void 0,t.padding=void 0,t.midPoint.x=NaN,void(t.midPoint.y=NaN);const n=null!=i?this.getNodePadding(t,e):{top:0,right:0,bottom:0,left:0};null==t.parent?(t.bbox=void 0,t.padding=void 0,t.midPoint.x=NaN,t.midPoint.y=NaN):(t.bbox=e,t.padding=n,t.midPoint.x=e.x+e.width/2,t.midPoint.y=e.y);const{sortedChildrenIndices:a,childAt:o}=this.sortChildren(t),r=a.every(t=>0===s[t].children.length),l=e.width-n.left-n.right,h=e.height-n.top-n.bottom;if(l<=0||h<=0)return;const c=a.length;let d=0,u=0,p=1/0,g=a.reduce((t,e)=>t+kR(s[e]),0);const m=new mR(e.x+n.left,e.y+n.top,l,h),y=m.clone();let f=0;for(;f<c;){const t=kR(o(f)),e=kR(o(u)),i=y.width<y.height;d+=t;const s=i?y.height:y.width,n=i?y.width:y.height,a=n*e/d;let l=s*d/g;const h=Math.max(a,l)/Math.min(a,l),c=Math.abs(1-h);if(c<p){p=c,f++;continue}d-=t,l=s*d/g;let x=i?y.x:y.y;for(let t=u;t<f;t++){const e=o(t),s=kR(e),a=i?x:y.x,h=i?y.y:x,c=n*s/d,u=new mR(a,h,i?c:l,i?l:c);this.applyGap(m,u,r),this.squarify(e,u),g-=s,x+=c}i?(y.y+=l,y.height-=l):(y.x+=l,y.width-=l),u=f,d=0,p=1/0}const x=y.width<y.height;let b=x?y.x:y.y;for(let t=u;t<c;t++){const e=o(t),i=x?b:y.x,s=x?y.y:b,n=kR(e)/g,a=y.width*(x?n:1),l=y.height*(x?1:n),h=new mR(i,s,a,l);this.applyGap(m,h,r),this.squarify(e,h),b+=x?a:l}}applyGap(t,e,i){const s=i?.5*this.properties.tile.gap:.5*this.properties.group.gap,a=t=>({left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height}),o=a(t),r=a(e);["top","right","bottom","left"].forEach(t=>{(0,n.YX)(o[t],r[t])||e.shrink(s,t)})}createNodeData(){}getGroupBaseStyle(t){const{properties:e}=this,{group:i}=e,s=t?e.highlightStyle.group:void 0;return vR({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},e.fillGradientDefaults,e.fillPatternDefaults,e.fillImageDefaults)}getGroupStyleOverrides(t,e,i,s,n){const{id:a,properties:o}=this,{undocumentedGroupFills:r,undocumentedGroupStrokes:l,itemStyler:h}=o,c=s.fill??r[Math.min(i??0,r.length)],d=s.stroke??l[Math.min(i??0,l.length)],u={};if(n||(u.fill=c,u.stroke=d),null!=h){const o=this.cachedDatumCallback(uR(t.join(":"),n?"highlight":"node"),()=>this.callWithContext(h,{seriesId:a,datum:e,depth:i,highlighted:n,fill:c,stroke:d,...s}));Object.assign(u,o)}return vR(u,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}getTileBaseStyle(t){const{properties:e}=this,{tile:i}=e,s=t?e.highlightStyle.tile:void 0;return vR({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},e.fillGradientDefaults,e.fillPatternDefaults,e.fillImageDefaults)}getTileStyleOverrides(t,e,i,s,n,a){const{id:o,properties:r,colorScale:l}=this,{fills:h,strokes:c,itemStyler:d}=r,u=t[0],p=n.fill??h[u%h.length],g=n.stroke??c[u%c.length],m={};if(a||(m.fill=null!=s?l.convert(s):p,m.stroke=g),null!=d){const s=this.cachedDatumCallback(uR(t.join(":"),a?"highlight":"node"),()=>this.callWithContext(d,{seriesId:o,datum:e,depth:i,highlighted:a,fill:p,stroke:g,...n}));Object.assign(m,s)}return vR(m,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}updateSelections(){let t=this.ctx.highlightManager?.getActiveHighlight();if(null==t||this.properties.group.interactive||0===t.children.length||(t=void 0),this.highlightSelection.update(null!=t?[t]:[],void 0,t=>this.getDatumId(t)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:e}=this.chart??{};if(!e)return;const i=Array.from(this.rootNode);this.datumSelection.update(i,void 0,t=>this.getDatumId(t)),this.labelSelection.update(i,t=>{t.append([new fR({tag:0}),new fR({tag:1})])},t=>this.getDatumId(t))}updateNodes(){const{rootNode:t,data:e}=this,{childrenKey:i,colorKey:s,colorName:n,labelKey:a,secondaryLabelKey:o,sizeKey:r,sizeName:l,highlightStyle:h,tile:c,group:d}=this.properties,{seriesRect:u}=this.chart??{};if(!u||!e)return;this.rootNode?.walk(t=>{const{datum:e,depth:h,children:u}=t,p=0===u.length,g=p?c.label:d.label;let m,y;if(null!=e&&null!=h&&null!=a){const t=e[a];m=this.getLabelText(g,{depth:h,datum:e,childrenKey:i,colorKey:s,colorName:n,labelKey:a,secondaryLabelKey:o,sizeKey:r,sizeName:l,value:t})}if(""===m&&(m=void 0),p&&null!=e&&null!=h&&null!=o){const t=e[o];y=this.getLabelText(c.secondaryLabel,{depth:h,datum:e,childrenKey:i,colorKey:s,colorName:n,labelKey:a,secondaryLabelKey:o,sizeKey:r,sizeName:l,value:t})}""===y&&(y=void 0),t.labelValue=m,t.secondaryLabelValue=y});const{width:p,height:g}=u;this.squarify(t,new mR(0,0,p,g)),this.rootNode?.walk(t=>{const{bbox:e,children:i,labelValue:s,secondaryLabelValue:n}=t;if(t.label=void 0,t.secondaryLabel=void 0,null!=e)if(0===i.length){const i={width:e.width,height:e.height,meta:null},a=ny(s,this.properties.tile.label,n,this.properties.tile.secondaryLabel,{padding:c.padding},()=>i);if(null==a)return;const{height:o,label:r,secondaryLabel:l}=a,{textAlign:h,verticalAlign:d,padding:u}=c,p=DR[h]??.5,g=e.x+u+(e.width-2*u)*p,m=wR[d]??.5,y=e.y+u+.5*o+(e.height-2*u-o)*m;if(null!=r){const{fontStyle:e="normal",fontFamily:i,fontWeight:s="normal",color:n="black"}=this.properties.tile.label;t.label={text:r.text,fontSize:r.fontSize,lineHeight:r.lineHeight,fontStyle:e,fontFamily:i,fontWeight:s,color:n,textAlign:h,verticalAlign:"middle",x:g,y:y-.5*(o-r.height)}}if(null!=l){const{fontStyle:e="normal",fontFamily:i,fontWeight:s="normal",color:n="black"}=this.properties.tile.secondaryLabel;t.secondaryLabel={text:l.text,fontSize:l.fontSize,lineHeight:l.fontSize,fontStyle:e,fontFamily:i,fontWeight:s,color:n,textAlign:h,verticalAlign:"middle",x:g,y:y+.5*(o-l.height)}}}else{if(null==s)return;{const{padding:i,textAlign:n}=d,a=this.groupTitleHeight(t,e);if(null==a)return;const o=e.width-2*i,r=dR.wrapText(s,{maxWidth:e.width-2*i,font:d.label,textWrap:"never"}),l=DR[n]??.5,{fontStyle:h="normal",fontFamily:c,fontWeight:u="normal",color:p="black"}=this.properties.group.label;t.label={text:r,fontSize:d.label.fontSize,lineHeight:cR.getLineHeight(d.label.fontSize),fontStyle:h,fontFamily:c,fontWeight:u,color:p,textAlign:n,verticalAlign:"middle",x:e.x+i+o*l,y:e.y+i+.5*a}}}});const m={series:new mR(0,0,p,g),axis:new mR(0,0,p,g)},y=(t,e,i,s,n)=>{const{bbox:a}=t;if(null==a)return void(e.visible=!1);const{datum:o,depth:r=-1,datumIndex:l,colorValue:h}=t,u=0===t.children.length,p=u?s:i,g=u?this.getTileStyleOverrides(l,o,r,h,p,n):this.getGroupStyleOverrides(l,o,r,p,n);e.crisp=!0,bR(e,p,g,m),e.cornerRadius=u?c.cornerRadius:d.cornerRadius,e.zIndex=[0,r,n?1:0];const y=t.parent?.children.every(t=>0===t.children.length),f=null!=t.parent?t.parent.bbox:void 0,x=null!=t.parent?t.parent.padding:void 0;!0===y&&null!=f&&null!=x?(e.clipBBox=a,e.x=f.x+x.left,e.y=f.y+x.top,e.width=f.width-(x.left+x.right),e.height=f.height-(x.top+x.bottom)):(e.clipBBox=void 0,e.x=a.x,e.y=a.y,e.width=a.width,e.height=a.height),e.visible=!0},f=this.getGroupBaseStyle(!1),x=this.getTileBaseStyle(!1);this.datumSelection.each((t,e)=>y(e,t,f,x,!1));const b=this.getGroupBaseStyle(!0),v=this.getTileBaseStyle(!0);this.highlightSelection.each((t,e)=>{y(e,t,b,v,!0)});const S=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(fR).forEach(t=>{const e=t.closestDatum();((t,e,i,s)=>{const n=0===t.children.length,a=0===i?t.label:t.secondaryLabel;if(null==a)return void(e.visible=!1);let o;if(s){const{tile:t,group:e}=h;o=t.secondaryLabel.color,n?0===i&&(o=t.label.color):o=e.label.color}e.text=a.text,e.fontSize=a.fontSize,e.lineHeight=a.lineHeight,e.fontStyle=a.fontStyle,e.fontFamily=a.fontFamily,e.fontWeight=a.fontWeight,e.fill=o??a.color,e.textAlign=a.textAlign,e.textBaseline=a.verticalAlign,e.x=a.x,e.y=a.y,e.visible=!0,e.zIndex=1})(e,t,t.tag,e===S)})}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.sort((t,e)=>e.datumIndex.length-t.datumIndex.length),e}pickNodeClosestDatum(t){const e=this.pickNodesExactShape(t);return 0!==e.length?{datum:e[0],distance:0}:this.pickNodeNearestDistantObject(t,this.datumSelection.nodes())}getTooltipContent(t){const{id:e,properties:i}=this,{labelKey:n,secondaryLabelKey:a,childrenKey:o,sizeKey:r,sizeName:l,colorKey:h,colorName:c,tooltip:d}=i,u=t.reduce((t,e)=>t?.children[e],this.rootNode);if(null==u)return;const{datum:p,depth:g,children:m}=u;if(null==p||null==g)return;const y=0===m.length,f=[],x=null!=r?p[r]:void 0;null!=x&&f.push({label:l,fallbackLabel:r,value:x});const b=null!=h?p[h]:void 0;let v;null!=b&&f.push({label:c,fallbackLabel:h,value:b}),y?(v=this.getTileBaseStyle(!1),Object.assign(v,this.getTileStyleOverrides(t,p,g,b,v,!1))):(v=this.getGroupBaseStyle(!1),Object.assign(v,this.getGroupStyleOverrides(t,p,g,v,!1)));const S=v.fill,M=vR({shape:"square",fill:S,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);s.n1.isGradientFill(M.fill)&&(M.fill={...M.fill,gradient:"linear",rotation:0,reverse:!1});const k=y?{marker:M}:void 0;return this.formatTooltipWithContext(d,{title:null!=n?p[n]:void 0,symbol:k,data:f},{seriesId:e,datum:p,title:void 0,depth:g,labelKey:n,secondaryLabelKey:a,childrenKey:o,sizeKey:r,sizeName:l,colorKey:h,colorName:c,...v})}computeFocusBounds(t){return xR.toCanvas(this.contentGroup,t.getBBox())}});IR.className="TreemapSeries",IR.type="treemap";var{commonSeriesOptionsDefs:CR,treemapSeriesThemeableOptionsDef:LR,without:AR}=s.n1,TR={...LR,...AR(CR,["highlightStyle"]),type:(0,n.mw)((0,n.dY)("treemap")),labelKey:n.Yj,secondaryLabelKey:n.Yj,childrenKey:n.Yj,sizeKey:n.Yj,colorKey:n.Yj,sizeName:n.Yj,colorName:n.Yj};TR.fillGradientDefaults=(0,n._L)(n.wi),TR.fillPatternDefaults=(0,n._L)(n.GY),TR.fillImageDefaults=(0,n._L)(n.Zd),TR.undocumentedGroupFills=(0,n._L)((0,n.jk)(n.yW)),TR.undocumentedGroupStrokes=(0,n._L)((0,n.jk)(n.yW));var{FONT_SIZE_RATIO:NR}=s.n1,OR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"treemap",moduleFactory:t=>new IR(t),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},colorRange:{$palette:"divergingColors"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:s.n1.FILL_PATTERN_DEFAULTS,fillImageDefaults:s.n1.FILL_IMAGE_DEFAULTS,undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},group:{label:{enabled:!0,color:{$ref:"textColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:4},fill:void 0,stroke:void 0,strokeWidth:1,padding:4,gap:2,textAlign:"left"},tile:{label:{enabled:!0,color:{$ref:"backgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.5]},minimumFontSize:{$rem:[NR.SMALLER]},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{enabled:!0,color:{$ref:"backgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:[NR.SMALLER]},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:0,padding:3,gap:1},highlightStyle:{group:{label:{color:{$ref:"textColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2},tile:{label:{color:{$ref:"backgroundColor"}},secondaryLabel:{color:{$ref:"backgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},gradientLegend:{enabled:!0}}},RR={type:"series",name:"treemap",chartType:"hierarchy",enterprise:!0,options:TR,create:t=>new IR(t)},ER=(s.n1.ModuleRegistry,[Ku,Eg,Zm,pM,VM,Fy,$y,rx,Jx,Xb,Yu,$u,Hu,Uu,_C,xA,wA,gT,NT,tp,nS,kO,ap,Jk,PN,cp,ZO,RR,mp,vL,Dp,HD,rw,$w,kI,WI,lv,hv,cv]),PR={xMin:0,xMax:1,yMin:2,yMax:3,span:4};function BR(t,e){return Array.from({length:t},(t,i)=>{const s=4*i;return(e[s+0]+e[s+1])/2|0})}var{ChartAxisDirection:FR,ContinuousScale:zR,DiscreteTimeScale:GR}=s.n1,_R=class extends s.n1.BarSeries{aggregateData(t,e){if("ungrouped"!==e?.type)return;const i=this.axes[FR.X];if(null==i||!zR.is(i.scale)&&!GR.is(i.scale))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"yValue-raw",e),{index:a}=t.resolveProcessedDataDefById(this,"xValue");return function(t,e,i){if(t.length<1e3)return;const[s,n]=Fg(i);let a=Bg(t,5),{indexData:o,valueData:r}=_g(t,e,e,s,n,a),l=BR(a,o);const h=[{maxRange:a,indexData:o,indices:l,indexes:PR}];for(;a>64;)({indexData:o,valueData:r,maxRange:a}=jg(o,r,a)),l=BR(a,o),h.push({maxRange:a,indexData:o,indices:l,indexes:PR});return h.reverse(),h}(s,n,e.domain.keys[a])}},{BarSeriesModule:jR}=s.n1,WR={...jR,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"bar",moduleFactory:t=>new _R(t)};function VR(t,e,i,s,n,a){const o=t[a];if(null==o)return!1;const r=Gg(zg(o,e,i),n);return a===s[r+0]||a===s[r+1]||a===s[r+2]||a===s[r+3]}var{ChartAxisDirection:KR,ContinuousScale:YR,DiscreteTimeScale:$R}=s.n1,HR=class extends s.n1.LineSeries{aggregateData(t,e){const i=this.axes[KR.X];if(null!=i&&(YR.is(i.scale)||$R.is(i.scale)))return function(t,e,i){if(t.length<1e3)return;const[s,n]=Fg(i);let a=Bg(t,10);const{indexData:o,valueData:r}=_g(t,e,e,s,n,a);let l=[];for(let e=0;e<t.length;e+=1)VR(t,s,n,o,a,e)&&l.push(e);const h=[{maxRange:a,indices:l}];for(;l.length>10&&a>64;)({maxRange:a}=jg(o,r,a,{inPlace:!0})),l=l.filter(VR.bind(null,t,s,n,o,a)),h.push({maxRange:a,indices:l});return h.reverse(),h}(t.resolveColumnById(this,"xValue",e),t.resolveColumnById(this,"yValueRaw",e),t.getDomain(this,"xValue","value",e))}},{LineSeriesModule:UR}=s.n1,XR={...UR,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"line",moduleFactory:t=>new HR(t)};s.n1.ModuleRegistry.registerMany(ER),s.n1.moduleRegistry.register(Q,lt,Jt,wl,Pl,WR,Yh,Rg,Xm,sS,uM,WM,Yy,Wl,ih,fh,Sh,Gh,Qk,XR,$D,ow,Yw,MI,jI,wc,sd,Fu,By,GC,pt,fA,DA,pT,TT,Kt,EN,Xt,Qx,ox,Fc,bL,MO,_c,XO,xd,OR,Ub,Mu),s.n1.enterpriseModule.isEnterprise=!0,s.n1.enterpriseModule.styles='.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-chrome-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-left:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-left:auto;padding:1px 6px}.ag-charts-dialog__close-button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-chrome-subtle-text-color);margin-right:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-right:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-bottom-left-radius:var(--ag-charts-input-border-radius);border-top-left-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-bottom-right-radius:var(--ag-charts-input-border-radius);border-top-right-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red 0%,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red 100%)}.ag-charts-color-picker{width:190px;padding:8px;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>\');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0 7px 7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-right:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{font-family:var(--ag-charts-chrome-font-family);font-size:calc(var(--ag-charts-chrome-font-size) * (13 / 12));font-weight:var(--ag-charts-chrome-font-weight);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{background:var(--ag-charts-chrome-background-color);border-radius:var(--ag-charts-border-radius);border:var(--ag-charts-border);box-shadow:var(--ag-charts-shadow);color:var(--ag-charts-chrome-text-color);display:table;flex-direction:column;padding:.5em 0;transition:transform .1s ease;white-space:nowrap}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{align-items:center;background:none;border:none;box-sizing:border-box;color:inherit;display:table-row;font:inherit;justify-content:space-between;text-align:left;width:100%;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__icon>img{width:var(--ag-charts-icon-size);height:var(--ag-charts-icon-size)}.ag-charts-context-menu__icon,.ag-charts-context-menu__label,.ag-charts-context-menu__rightarrowhead{display:table-cell;vertical-align:middle}.ag-charts-context-menu__cellpadding{padding:.5em 1em}.ag-charts-context-menu__icon{padding-right:0}.ag-charts-context-menu__item[data-focus-override=true],.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;color:color-mix(in srgb,var(--ag-charts-input-text-color) 50%,transparent);text-align:left}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-context-menu__divider{display:table-row}.ag-charts-context-menu__divider>div{padding:5px 0}.ag-charts-context-menu__divider>div:after{content:"";display:block;border-top:1px solid #babfc7}.ag-charts-context-menu__divider.ag-charts-dark-context-menu{background:#2196f31a}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons .ag-charts-toolbar__button{padding:var(--toolbar-button-padding) calc(var(--toolbar-button-padding) * 1.5)}.ag-charts-zoom-buttons{align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-left:var(--ag-charts-spacing);padding-right:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-left:0}.ag-charts-toolbar__button--gap{margin-left:var(--toolbar-gap)}&.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{gap:var(--toolbar-gap);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}}\n',s.n1.enterpriseModule.licenseManager=t=>new p(t.container?.ownerDocument??("undefined"==typeof document?void 0:document)),s.n1.enterpriseModule.injectWatermark=zu;var ZR={setLicenseKey(t){p.setLicenseKey(t)}};s.xv,s.Mo,s.LW,s.a9,s.ui.create.bind(s.ui),s.ui.__createSparkline.bind(s.ui),p.setGridContext.bind(p),p.setLicenseKey.bind(p)},25573(t,e,i){"use strict";i.d(e,{ui:()=>r});var s=i(22155),n=i(45401);function a(t,e){return{...t,container:e.current}}function o(t,e){const i=(0,s.forwardRef)(function(e,i){const{options:n,style:o,className:r}=e,l=(0,s.useRef)(null),h=(0,s.useRef)();(0,s.useLayoutEffect)(()=>{const e=t(a(n,l));return h.current=e,()=>{e.destroy()}},[]);const c=void 0===h.current;return(0,s.useEffect)(()=>{c||h.current?.update(a(n,l)).catch(t=>console.error(t))},[n]),(0,s.useImperativeHandle)(i,()=>h.current,[]),(0,s.useMemo)(()=>(0,s.createElement)("div",{ref:l,style:o,className:r}),[o,r])});return i.displayName=e,i}var r=o(t=>n.ui.create(t),"AgCharts")}}]);
//# sourceMappingURL=903.e25731dc2d5fb7b5c09d.js.map