ag-charts-enterprise
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
26 lines • 1.68 MB
JavaScript
(function(Ou,ia){typeof exports=="object"&&typeof module=="object"?module.exports=ia():typeof define=="function"&&define.amd?define("agCharts",[],ia):typeof exports=="object"?exports.agCharts=ia():Ou.agCharts=ia()})(this,()=>{var Ou={},ia={exports:Ou};if(typeof Ece>"u")var Ece=function(t){throw new Error("Unknown module: "+t)};var kf=Object.defineProperty,Nk=Object.getOwnPropertyDescriptor,L_=Object.getOwnPropertyNames,w_=Object.prototype.hasOwnProperty,gn=(e,t)=>{for(var i in t)kf(e,i,{get:t[i],enumerable:!0})},N_=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of L_(t))!w_.call(e,n)&&n!==i&&kf(e,n,{get:()=>t[n],enumerable:!(s=Nk(t,n))||s.enumerable});return e},E_=e=>N_(kf({},"__esModule",{value:!0}),e),M=(e,t,i,s)=>{for(var n=s>1?void 0:s?Nk(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(n=(s?a(t,i,n):a(n))||n);return s&&n&&kf(t,i,n),n},Ek={};gn(Ek,{AG_CHARTS_LOCALE_EN_US:()=>CT,AgCharts:()=>oo,AgChartsCommunityModule:()=>LY,AgChartsEnterpriseModule:()=>wce,AgErrorBarSupportedSeriesTypes:()=>my,AgTooltipAnchorToType:()=>LT,AgTooltipPlacementType:()=>wT,LicenseManager:()=>Lce,VERSION:()=>Ja,_ModuleSupport:()=>A,_Scene:()=>nx,_Theme:()=>ox,_Util:()=>ax,_Widget:()=>Dg,setupCommunityModules:()=>ex,setupEnterpriseModules:()=>s_,time:()=>W5}),ia.exports=E_(Ek);var X={};gn(X,{error:()=>Ok,errorOnce:()=>R_,log:()=>O_,logGroup:()=>F_,reset:()=>B_,table:()=>P_,warn:()=>Nv,warnOnce:()=>Pu});var wv=new Set;function O_(...e){console.log(...e)}function Nv(e,...t){console.warn(`AG Charts - ${e}`,...t)}function Ok(e,...t){typeof e=="object"?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function P_(...e){console.table(...e)}function Pk(e,t,i){let s;e instanceof Error?s=e.message:typeof e=="string"?s=e:typeof e=="object"?s=JSON.stringify(e):s=String(e);const n=`${t}: ${s}`;wv.has(n)||(i(e),wv.add(n))}function Pu(e,...t){Pk(e,"Logger.warn",i=>Nv(i,...t))}function R_(e,...t){Pk(e,"Logger.error",i=>Ok(i,...t))}function B_(){wv.clear()}function F_(e,t){console.groupCollapsed(e);try{return t()}finally{console.groupEnd()}}var Vs={};gn(Vs,{detectChartDefinition:()=>j_,getAxisModule:()=>H_,getPresetModule:()=>W_,getSeriesModule:()=>$_,hasModule:()=>G_,listModulesByType:()=>V_,register:()=>Rk,registerMany:()=>z_,reset:()=>__});var sa=new Map;function Rk(e,t){const{def:i,version:s}=sa.get(e.name)??{};if(!i){sa.set(e.name,{def:e,version:t});return}if(!i.enterprise&&e.enterprise&&t===s){sa.set(e.name,{def:e,version:t});return}if(s===t){Nv([`AG Charts - Module '${e.name}' already registered,',
'ignoring (version: ${s}).`,"Check your code for duplicate loading of charts NPM modules."].join(" "));return}throw new Error([`AG Charts - Module '${e.name}' already registered with different version:`,`${s} vs ${t}`,"","Check your package.json for conflicting dependencies - depending on your package manager","one of these commands may help:","- npm ls ag-charts-community","- yarn why ag-charts-community"].join(`
`))}function z_(e,t){for(const i of e)Rk(i,t)}function __(){sa.clear()}function G_(e){return sa.has(e)}function*V_(e){for(const t of sa.values())Ru(e,t.def)&&(yield t.def)}function j_(e){for(const t of sa.values())if(Ru("chart",t.def)&&t.def.detect(e))return t.def;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function H_(e){const t=sa.get(e);if(Ru("axis",t?.def))return t?.def}function W_(e){const t=sa.get(e);if(Ru("preset",t?.def))return t?.def}function $_(e){const t=sa.get(e);if(Ru("series",t?.def))return t?.def}function Ru(e,t){return t?.type===e}var Io=class{constructor(){this.events=new Map}on(e,t){return this.events.has(e)||this.events.set(e,new Set),this.events.get(e)?.add(t),()=>this.off(e,t)}off(e,t){const i=this.events.get(e);i&&(i.delete(t),i.size===0&&this.events.delete(e))}emit(e,t){this.events.get(e)?.forEach(i=>i(t))}clear(e){e?this.events.delete(e):this.events.clear()}},na={};typeof window<"u"?na.window=window:typeof global<"u"&&(na.window=global.window),typeof document<"u"?na.document=document:typeof global<"u"&&(na.document=global.document);function oa(e){return e?na.document?.[e]:na.document}function Ze(e){return e?na.window?.[e]:na.window}function U_(e){na.document=e}function Y_(e){na.window=e}function ke(e,t,i){const s=oa().createElement(e);if(typeof t=="object"&&(i=t,t=void 0),t)for(const n of t.split(" "))s.classList.add(n);return i&&Object.assign(s.style,i),s}function ti(e){return oa().createElementNS("http://www.w3.org/2000/svg",e)}function K_(e,t){const i=oa("body"),s=ke("a",{display:"none"});s.href=e,s.download=t,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}function ot(e,t,i,s){return e.addEventListener(t,i,s),()=>e.removeEventListener(t,i,s)}var Cf;function Z_(e){if(Cf==null){const t=Ze("Option");Cf=new t().style}return Cf.color=e,Cf.color||null}function ii(e){return e!=null}function Ue(e){return Array.isArray(e)}function X_(e){return typeof e=="boolean"}function aa(e){return e instanceof Date}function Ph(e){return aa(e)&&!isNaN(Number(e))}function q_(e){return e instanceof RegExp}function $a(e){return typeof e=="function"}function Fe(e){return typeof e=="object"&&e!==null&&!Ue(e)}function Tf(e){return Ue(e)||Je(e)}function Je(e){return typeof e=="object"&&e!==null&&e.constructor?.name==="Object"}function Ev(e){if(typeof e!="object"||e===null)return!1;for(const t in e)return!1;return!0}function ki(e){return typeof e=="string"}function di(e){return typeof e=="number"}function Ye(e){return Number.isFinite(e)}function Q_(e){return typeof window<"u"&&e instanceof HTMLElement}function Lf(e){return typeof e=="symbol"}function J_(e){return ki(e)&&(e==="none"||Z_(e)!=null)}function eG(e,t){return e in t}function tG(e,t=0,i){const{leading:s=!1,trailing:n=!0,maxWait:o=1/0}=i??{};let a,r;if(o<t)throw new Error("Value of maxWait cannot be lower than waitMs.");function l(...c){if(s&&!r){r=Date.now(),a=setTimeout(()=>r=null,t),e(...c);return}let h=t;if(o!==1/0&&r){const d=Date.now()-r;t>o-d&&(h=o-d)}clearTimeout(a),r??(r=Date.now()),a=setTimeout(()=>{r=null,n&&e(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(a),r=null}})}function Bk(e,t,i){const{leading:s=!0,trailing:n=!0}=i??{};let o,a,r=!1;function l(){n&&a?(o=setTimeout(l,t),e(...a)):r=!1,a=null}function c(...h){r?a=h:(r=!0,o=setTimeout(l,t),s?e(...h):a=h)}return Object.assign(c,{cancel(){clearTimeout(o),r=!1,a=null}})}function Fk(e,t,i=""){try{return e(...t)}catch(s){const n=i?` \`${i}\``:"";Pu(`Uncaught exception in user callback${n}`,s)}}function Bu(e,t="and",i=String,s=1/0){if(e.length===0)return"";if(e.length===1)return i(e[0]);e=e.map(i);const n=e.pop();if(e.length>=s){const o=e.length-(s-1);return`${e.slice(0,s-1).join(", ")}, and ${o} more ${t} ${n}`}return`${e.join(", ")} ${t} ${n}`}function Ov(e,t=1/0){if(typeof e=="number"){if(isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}const i=JSON.stringify(e)??typeof e;return i.length>t?`${i.slice(0,t)}... (+${i.length-t} characters)`:i}function iG(e){let t=1;for(let i=0;i<e.length;i++)e.charCodeAt(i)===10&&t++;return t}function sG(e,t){if(e===t)return 0;const[i,s]=e.length<t.length?[e,t]:[t,e],n=i.length,o=s.length;let a=new Array(n+1).fill(0).map((l,c)=>c),r=new Array(n+1);for(let l=1;l<=o;l++){r[0]=l;for(let c=1;c<=n;c++){const h=s[l-1]===i[c-1]?0:1;r[c]=Math.min(a[c]+1,r[c-1]+1,a[c-1]+h)}[a,r]=[r,a]}return a[n]}function nG(e){return e.replace(oG,(t,i)=>(i>0?"-":"")+t.toLowerCase())}var oG=/[A-Z]+(?![a-z])|[A-Z]/g;function Pv(e){return Ue(e)?e.map(t=>t.text).join(""):e??""}var fn=Symbol("description"),zk=Symbol("required"),wf=Symbol("marked"),_k=Symbol("undocumented"),Nf=Symbol("union"),aG=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["nodeClick","seriesNodeClick"],["nodeDoubleClick","seriesNodeDoubleClick"],["src","url"]].reduce((e,t)=>{for(const i of t)e.set(i.toLowerCase(),new Set(t.filter(s=>s!==i)));return e},new Map);function Fu(e,t){return Ye(t)?`${e}[${t}]`:e?`${e}.${t}`:t}var jr=class{constructor(e,t,i,s,n){this.type=e,this.description=t,this.value=i,this.path=s,this.key=n}setUnionType(e,t){if(this.path.startsWith(t)){const i=this.path.slice(t.length);this.altPath=`${t}[type=${e}]${i}`}}getPrefix(){const{altPath:e=this.path,key:t}=this;return!e&&!t?"Value":`Option \`${t?Fu(e,t):e}\``}toString(){const{description:e="unknown",type:t,value:i}=this;return t==="required"&&i==null?`${this.getPrefix()} is required and has not been provided; expecting ${e}, ignoring.`:`${this.getPrefix()} cannot be set to \`${Ov(i,50)}\`; expecting ${e}, ignoring.`}},Rv=class extends jr{constructor(e,t,i,s){super("unknown",void 0,t,i,s),this.suggestions=e,this.key=s}getPrefix(){return`Unknown option \`${Fu(this.altPath??this.path,this.key)}\``}getPostfix(){const e=Bu(rG(this.key,this.suggestions),"or",t=>`\`${t}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function ss(e,t,i=""){if(!Fe(e))return{cleared:null,invalid:[new jr("required","an object",e,i)]};const s={},n=[],o=new Set(Object.keys(e)),a=[];if(Nf in t){const r=Object.keys(t),l=t[Nf];if(e.type!=null&&r.includes(e.type)||e.type==null&&l!=null){const{type:c=l,...h}=e,d=ss(h,t[c],i);Object.assign(s,{type:c},d.cleared);for(const u of d.invalid)u.setUnionType(c,i);n.push(...d.invalid)}else{const c=Bu(r,"or",h=>`'${h}'`);n.push(new jr("required",`a keyword such as ${c}`,e.type,i,"type"))}return{cleared:s,invalid:n}}for(const r of Object.keys(t)){const l=t[r],c=l[zk],h=e[r];if(o.delete(r),typeof h>"u"&&(l[_k]||a.push(r),!c))continue;const d=Fu(i,r);if($a(l)){const p=l(h,{options:e,path:d});if(typeof p=="object"){if(n.push(...p.invalid),p.valid){s[r]=p.cleared;continue}else if(Rh(p.invalid,d))continue}else if(p){s[r]=h;continue}n.push(new jr(c?"required":"invalid",l[fn],h,i,r))}else{const u=ss(h,l,d);u.cleared!=null&&(s[r]=u.cleared),n.push(...u.invalid)}}for(const r of o){const l=e[r];typeof l>"u"||n.push(new Rv(a,l,i,r))}return{cleared:s,invalid:n}}function rG(e,t,i=2){const s=[],n=e.toLowerCase(),o=aG.get(n);for(const a of t){const r=a.toLowerCase();(o?.has(a)||r.includes(n)||sG(n,r)<=i)&&s.push(a)}return s}function Xe(e,t){if($a(e)){let s=function(n,o){return e(n,o)};var i=s;return s[fn]=t,s}else return{...e,[fn]:t}}function Y(e){return Object.assign($a(e)?(t,i)=>e(t,i):_t(e),{[zk]:!0,[fn]:e[fn]})}function me(e){return Object.assign($a(e)?(t,i)=>e(t,i):_t(e),{[_k]:!0,[fn]:e[fn]})}var _t=(e,t="an object")=>Xe((i,s)=>{const n=ss(i,e,s.path);return{valid:!Rh(n.invalid,s.path),cleared:n.cleared,invalid:n.invalid}},t),nc=(e,t,i)=>({...e,[fn]:t,[Nf]:i}),at=(...e)=>Xe((t,i)=>{const s=[];for(const n of e){const o=n(t,i);if(typeof o=="object"){if(s.push(...o.invalid),!o.valid)return{valid:!1,cleared:t,invalid:s};t=o.cleared}else if(!o)return!1}return{valid:!0,cleared:t,invalid:s}},e.map(t=>t[fn]).filter(Boolean).join(" and ")),Ce=(...e)=>Xe((t,i)=>{for(const s of e){const n=s(t,i);if(typeof n=="object"?n.valid:n)return n}return!1},e.map(t=>t[fn]).filter(Boolean).join(" or ")),Ef=e=>Ye(e)||Ph(e),lG=e=>aa(e)||(Ye(e)||ki(e))&&Ph(new Date(e)),ko=Xe(Ue,"an array"),z=Xe(X_,"a boolean"),rt=Xe($a,"a function"),ae=Xe(J_,"a color string"),Hr=Xe(lG,"a date"),Te=Xe(ii,"a defined value"),K=Xe(Ye,"a number"),Of=Xe(Fe,"an object"),E=Xe(ki,"a string"),Gk=Xe(e=>typeof HTMLElement>"u"||e instanceof HTMLElement,"an html element"),Wr=(e,t=1/0)=>{let i;return t===1/0?i=`an array of at least ${e} items`:e===t?i=`an array of exactly ${e} items`:e===0?i=`an array of no more than ${t} items`:i=`an array of at least ${e} and no more than ${t} items`,Xe(s=>Ue(s)&&s.length>=e&&s.length<=t,i)},Vk=(e,t=1/0)=>{let i;return t===1/0?i=`a string of at least ${e} characters`:e===t?i=`an string of exactly ${e} characters`:e===0?i=`an string of no more than ${t} characters`:i=`an string of at least ${e} and no more than ${t} characters`,Xe(s=>ki(s)&&s.length>=e&&s.length<=t,i)},jk=(e,t=!0)=>Xe(i=>Ye(i)&&(i>e||t&&i===e),`a number greater than ${t?"or equal to ":""}${e}`),Hk=(e,t)=>Xe(i=>Ye(i)&&i>=e&&i<=t,`a number between ${e} and ${t} inclusive`),G=jk(0),zu=jk(0,!1),pe=Hk(0,1),_n=e=>Xe((t,{options:i})=>!Ef(t)||!Ef(i[e])||t<i[e],`the value to be less than \`${e}\``),Gn=e=>Xe((t,{options:i})=>!Ef(t)||!Ef(i[e])||t>i[e],`the value to be greater than \`${e}\``);function J(...e){Fe(e[0])&&(e=Object.values(e[0]));const t=Bu(e,"or",i=>`'${i}'`);return Xe(i=>e.includes(i),`a keyword such as ${t}`)}var Le=e=>Xe(t=>e===t,`the value ${JSON.stringify(e)}`),Ae=(e,t,i=!0)=>Xe((s,n)=>{if(!Ue(s))return!1;let o=i;const a=[],r=[],l=c=>o=i?o&&c:o||c;if(s.length===0)return{valid:!0,cleared:a,invalid:r};for(let c=0;c<s.length;c++){const h=s[c],d=e(h,{options:h,path:`${n.path}[${c}]`});typeof d=="object"?(o=l(d.valid),r.push(...d.invalid),d.cleared!=null&&a.push(d.cleared)):(o=l(d),d&&a.push(h))}return{valid:o,cleared:o||!i?a:null,invalid:r}},t??`${e[fn]} array`),ui=(e,t="an object array")=>Xe((i,s)=>{if(!Ue(i))return!1;const n=[],o=[];for(let a=0;a<i.length;a++){const r=`${s.path}[${a}]`,l=ss(i[a],e,r);Rh(l.invalid,r)||n.push(l.cleared),o.push(...l.invalid)}return{valid:!0,cleared:n,invalid:o}},t),oc=(e,t)=>Xe((i,s)=>$a(i)?wf in i?!0:{valid:!0,cleared:Object.assign((...o)=>{const a=Fk(i,o);if(a==null)return;const r=e(a,{options:a,path:""});if(typeof r=="object"){if(r.invalid.forEach(Wk(s,t??e[fn])),r.valid)return r.cleared}else{if(r)return a;Pu(`Callback \`${s.path}\` returned an invalid value \`${Ov(a,50)}\`; expecting ${t??e[fn]}, ignoring.`)}},{[wf]:!0}),invalid:[]}:!1,"a function"),bt=(e,t="an object")=>Xe((i,s)=>$a(i)?wf in i?!0:{valid:!0,cleared:Object.assign((...o)=>{const a=Fk(i,o,s.path);if(a==null)return;const r=ss(a,e);return r.invalid.forEach(Wk(s,t)),r.cleared},{[wf]:!0}),invalid:[]}:!1,"a function");function Rh(e,t){return e.some(i=>i.type==="required"&&i.path===t)}function Wk(e,t){return i=>{if(i instanceof Rv)return Pu(`Callback \`${e.path}\` returned an unknown property \`${Fu(i.path,i.key)}\`${i.getPostfix()}`);const s=Ov(i.value,50);Pu(i.key?`Callback \`${e.path}\` returned an invalid property \`${Fu(i.path,i.key)}\`: \`${s}\`; expecting ${i.description}, ignoring.`:`Callback \`${e.path}\` returned an invalid value \`${s}\`; expecting ${t??i.description}, ignoring.`)}}var Pf=e=>{if(!Fe(e))return!1;const t=Object.keys(e);return t.length===1&&t[0].startsWith("$")},cG=_t({color:ae,stop:pe},""),$k=Xe(e=>{let t=-1/0;for(const i of e)if(i?.stop!=null){if(i.stop<t)return!1;t=i.stop}return!0},"color stops to be defined in ascending order"),Bv=at(Wr(2),Ae(cG),$k),Fv=J("axis","item","series"),zv=_t({type:Y(Le("gradient")),colorStops:Y(Bv),rotation:K,gradient:me(J("linear","radial","conic")),bounds:me(Fv),reverse:me(z)},"a gradient object with color stops"),se={stroke:ae,strokeWidth:G,strokeOpacity:pe},Rf=_t({type:Y(Le("gradient")),gradient:Y(J("linear","radial","conic")),bounds:Y(Fv),colorStops:Y(Ce(Bv,at(Wr(2),Ae(ae)))),rotation:Y(K),reverse:Y(z)}),Bf=_t({type:Y(Le("pattern")),pattern:Y(J("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:Vk(2),width:Y(G),height:Y(G),fill:Y(ae),fillOpacity:Y(pe),backgroundFill:Y(ae),backgroundFillOpacity:Y(pe),padding:Y(G),rotation:Y(K),scale:Y(G),stroke:Y(ae),strokeWidth:Y(G),strokeOpacity:Y(pe)}),Ff=_t({type:Y(Le("image")),url:E,width:G,height:G,rotation:Y(K),backgroundFill:Y(ae),backgroundFillOpacity:pe,fit:Y(J("stretch","contain","cover")),repeat:Y(J("repeat","repeat-x","repeat-y","no-repeat"))}),hG=nc({gradient:{colorStops:Bv,rotation:K,gradient:me(J("linear","radial","conic")),bounds:me(Fv),reverse:me(z)},pattern:{pattern:J("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:Vk(2),width:G,height:G,rotation:K,scale:G,fill:ae,fillOpacity:pe,backgroundFill:ae,backgroundFillOpacity:pe,...se,padding:me(G)},image:{url:Y(E),backgroundFill:ae,backgroundFillOpacity:pe,width:G,height:G,fit:J("stretch","contain","cover","none"),repeat:J("repeat","repeat-x","repeat-y","no-repeat"),rotation:K}},"a color object"),Vn=Ce(ae,_t(hG,"a color object")),ue={fill:Vn,fillOpacity:pe};ue.fillGradientDefaults=me(Rf),ue.fillPatternDefaults=me(Bf),ue.fillImageDefaults=me(Ff);var fe={lineDash:Ae(G),lineDashOffset:K},ra={...ue,...se,...fe,opacity:pe,cornerRadius:G},ac={...se,...fe,opacity:pe},Ct={...ue,...se,...fe,opacity:pe};function Uk(e){return{enabled:z,range:J("tooltip","node"),highlightedItem:e,unhighlightedItem:e}}function si(e,t){return{enabled:z,range:J("tooltip","node"),highlightedItem:e,unhighlightedItem:e,highlightedSeries:t,unhighlightedSeries:t,bringToFront:z}}var Yk=_t({googleFont:E},"google font"),_v=Ce(E,Pf,Yk,Ae(Ce(E,Yk))),ht={color:ae,fontFamily:_v,fontSize:G,fontStyle:J("normal","italic","oblique"),fontWeight:Ce(G,J("normal","bold","bolder","lighter"))},dG=_t({top:K,right:K,bottom:K,left:K},"padding object"),zf=Ce(K,dG),_f={enabled:z,stroke:ae,strokeWidth:G,strokeOpacity:pe},Co={border:{..._f},cornerRadius:K,padding:zf,...ue};function uG(e,t,i=1/0){const s=t,n=i,o=e%180*(Math.PI/180),a=Math.abs(Math.sin(o)),r=Math.abs(Math.cos(o));if(a===0)return{width:s,height:n};if(r===0)return{width:n,height:s};if(!isFinite(n)){const c=r/a,h=s/(r+c*a);return{width:h,height:c*h}}const l=r*r-a*a;if(l===0){const c=Math.min(s,n)/Math.SQRT2;return{width:c,height:c}}return{width:Math.abs((s*r-n*a)/l),height:Math.abs((n*r-s*a)/l)}}function Gf(e){return typeof e>"u"?[]:Array.isArray(e)?e:[e]}function Gv(e){return Array.from(new Set(e))}function Vv(e,t){return e.reduce((i,s)=>{const n=t(s);return i[n]??(i[n]=[]),i[n].push(s),i},{})}function jn(e,t){if(e==null||t==null||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(Array.isArray(e[i])&&Array.isArray(t[i])){if(!jn(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}function la(e,t,i=0){if(e.length===0)return[];const s=[];for(let n=0;n<t;n++)s.push(e.at((n+i)%e.length));return s}function pG(e,t){const i=new Map;return t.forEach((s,n)=>{i.set(s,n)}),e.sort((s,n)=>{const o=i.get(s)??1/0,a=i.get(n)??1/0;return o-a})}function gG(e,t){let i=0;for(;i<e.length&&t(e[i]);)i+=1;const s=i;s!==0&&e.splice(0,s)}function fG(e,t){let i=e.length-1;for(;i>=0&&t(e[i]);)i-=1;const s=e.length-1-i;s!==0&&e.splice(e.length-s,s)}var jv=class{constructor(){this.queue=[]}await(e=50){return new Promise(t=>{const i=()=>{clearTimeout(n),t(!0)},n=setTimeout(()=>{const o=this.queue.indexOf(i);o<0||(this.queue.splice(o,1),t(!1))},e);this.queue.push(i)})}notify(){this.queue.splice(0).forEach(e=>e())}};function Kk(e=0){return new Promise(t=>{setTimeout(t,e)})}function*rc(...e){for(const t of e)yield*t}function yG(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e?e:[e]}function _u(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*Et(e){const t=[void 0,void 0];for(const i of Object.keys(e))t[0]=i,t[1]=e[i],yield t}function $r(e){return e==="true"}function mG(e){return Number(e)}function yn(e){return e}var xG={role:yn,"aria-checked":$r,"aria-controls":yn,"aria-describedby":yn,"aria-disabled":$r,"aria-expanded":$r,"aria-haspopup":yn,"aria-hidden":$r,"aria-label":yn,"aria-labelledby":yn,"aria-live":yn,"aria-orientation":yn,"aria-selected":$r,"data-focus-override":$r,"data-focus-visible-override":$r,"data-preventdefault":$r,class:yn,for:yn,id:yn,tabindex:mG,title:yn,placeholder:yn};function Ge(e,t,i){i==null||i===""||i===""?e?.removeAttribute(t):e?.setAttribute(t,i.toString())}function ca(e,t){if(t!=null)for(const[i,s]of Et(t))i!=="class"&&Ge(e,i,s)}function Bh(e,t,i){if(!(e instanceof HTMLElement))return;const s=e.getAttribute(t);return s===null?i:xG[t]?.(s)??void 0}function ha(e,t,i){e!=null&&(i==null?e.style.removeProperty(t):e.style.setProperty(t,i.toString()))}function bG(e,t){for(const[i,s]of Et(t))ha(e,i,s)}function Zk(e,t,i,s,n){return t<e.x+e.width&&t+s>e.x&&i<e.y+e.height&&i+n>e.y}function Hv(e,t,i,s=0,n=0){return t>=e.x&&t+s<=e.x+e.width&&i>=e.y&&i+n<=e.y+e.height}function vG(e){return e==null||e.height===0||e.width===0||isNaN(e.height)||isNaN(e.width)}function Wv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lc(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2);i(n)?(s=n,e=n+1):t=n-1}return s}function Gu(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2);i(n)?(s=n,t=n-1):e=n+1}return s}function Xk(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2),o=i(n);o==null?t=n-1:(s=o,e=n+1)}return s}var SG=class{constructor(e){this.getter=e}get(){let e=this.result?.deref();return e||(e=this.getter(),this.result=new WeakRef(e),e)}clear(){this.result=void 0}},mt=class{constructor(){this.callbacks=new Set}flush(){for(const e of this.callbacks)e();this.callbacks.clear()}merge(e){for(const t of e.callbacks)this.callbacks.add(t)}register(...e){for(const t of e)t&&this.callbacks.add(t)}};function MG(e,t){const i=Math.max(e.length,t.length),s=new Set,n=new Set;for(let o=0;o<i;o++){const a=e[o],r=t[o];a!==r&&(n.has(r)?n.delete(r):r&&s.add(r),s.has(a)?s.delete(a):a&&n.add(a))}return{changed:s.size>0||n.size>0,added:s,removed:n}}function ve(e,t,i){return Math.min(i,Math.max(e,t))}function DG(e,t,i=1e-10){return e>=t[0]-i&&e<=t[1]+i}function lt(e,t,i=1e-10){return e===t||Math.abs(e-t)<i}function $v(e){return Math.sign(e)===-1||Object.is(e,-0)}function AG(e){return e%1===0}function Uv(e,t=2){const i=10**t;return Math.round(e*i)/i}function IG(e,t){return Math.floor(e%t+(e<0?Math.abs(t):0))}function Vu(e){if(Math.floor(e)===e)return 0;let t=String(e),i=0;if(e<1e-6||e>=1e21){let n;[t,n]=t.split("e"),n!=null&&(i=Number(n))}const s=t.split(".")[1]?.length??0;return Math.max(s-i,0)}function qk(e){return Array.isArray(e)&&e.length>=2&&e.every(Ye)}function Vf(e){return Array.isArray(e)&&e.length>=2&&e.every(qk)}function kG(e){const t=e[0],i=e[e.length-1];return lt(t[0],i[0],.001)&<(t[1],i[1],.001)}function Qk(e){return Array.isArray(e)&&e.every(Vf)&&e.every(kG)}function Jk(e){if(e===null)return!0;if(!Fe(e)||e.type==null)return!1;const{type:t,coordinates:i}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(Jk);case"MultiPolygon":return Array.isArray(i)&&i.every(Qk);case"Polygon":return Qk(i);case"MultiLineString":return Array.isArray(i)&&i.every(Vf);case"LineString":return Vf(i);case"MultiPoint":return Vf(i);case"Point":return qk(i);default:return!1}}function CG(e){return Fe(e)&&e.type==="Feature"&&Jk(e.geometry)}function TG(e){return Fe(e)&&e.type==="FeatureCollection"&&Array.isArray(e.features)&&e.features.every(CG)}var Fh=Xe(TG,"a GeoJSON object"),LG=class{constructor(e,t){this._vertexCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.cachedNeighboursEdge=e,this.processedEdge=t}clear(){this._vertexCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[]}addVertex(e){const t=new wG(e);return this._vertexCount++,t}addEdge(e,t,i){i===this.cachedNeighboursEdge?e.updateCachedNeighbours().set(t.value,t):i===this.processedEdge&&(this.pendingProcessingEdgesFrom.push(e),this.pendingProcessingEdgesTo.push(t));const{edges:s}=e,n=s.get(i);n?n.indexOf(t)===-1&&n.push(t):s.set(i,[t])}removeVertex(e){this._vertexCount--;const t=e.edges;if(t){for(const[i,s]of t)this._vertexCount-=s.length;e.clear()}}removeEdge(e,t){for(const[i,s]of e.edges){const n=s.indexOf(t);s.splice(n,1),s.length===0&&e.edges.delete(i)}}removeEdges(e,t){e.edges.delete(t)}getVertexValue(e){return e.value}*neighbours(e){for(const[t,i]of e.edges)for(const s of i)yield s}*neighboursAndEdges(e){for(const[t,i]of e.edges)for(const s of i)yield[s,t]}neighboursWithEdgeValue(e,t){return e.edges.get(t)}findNeighbour(e,t){return e.edges.get(t)?.[0]}findNeighbourValue(e,t){const i=this.findNeighbour(e,t);if(i)return this.getVertexValue(i)}findNeighbourWithValue(e,t,i){const s=i==null?this.neighbours(e):this.neighboursWithEdgeValue(e,i);if(s){for(const n of s)if(this.getVertexValue(n)===t)return n}}findVertexAlongEdge(e,t,i){if(i===this.cachedNeighboursEdge){let n;for(const o of t)if(n=(n??e).readCachedNeighbours()?.get(o),!n)return;return n}if(t.length===0)return;let s=e;for(const n of t){const o=s?this.neighboursWithEdgeValue(s,i):void 0;if(!o)return;s=o.find(a=>a.value===n)}return s}adjacent(e,t){for(const[i,s]of e.edges)if(s.includes(t))return!0;return!1}},wG=class{constructor(e){this.value=e,this.edges=new Map}readCachedNeighbours(){return this._cachedNeighbours}updateCachedNeighbours(){return this._cachedNeighbours??(this._cachedNeighbours=new Map),this._cachedNeighbours}clear(){this.edges.clear(),this._cachedNeighbours?.clear()}},eC=new Map,Rce=Symbol("ElementID"),NG=1;function ns(e){const t=e.constructor,i=Object.hasOwn(t,"className")?t.className:t.name;if(!i)throw new Error(`The ${t} is missing the 'className' property.`);const s=(eC.get(i)??0)+1;return eC.set(i,s),`${i}-${s}`}function cc(){return`ag-charts-${NG++}`}function jf(){return crypto.randomUUID?.()??EG()}function EG(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let i=0;i<e.length;i++)(i===4||i===6||i===8||i===10)&&(t+="-"),t+=e[i].toString(16).padStart(2,"0");return t}var tC=(e,t,i)=>{let s=e,n=s;for(const o of t)if(s==null||i(s.value,o)>0)s={value:o,next:s},n=s;else{for(n=n;n.next!=null&&i(n.next.value,o)<=0;)n=n.next;n.next={value:o,next:n.next}}return s},iC=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,sC=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function OG(e){if(!ki(e))return!1;const t=sC.exec(e);return iC.test(t?t[2]:e)}function Yv(e){let t,i;const s=sC.exec(e);s&&([,t,e,i]=s);const n=iC.exec(e);if(!n){X.warnOnce(`The number formatter is invalid: ${e}`);return}const[,o,a,r,l,c,h,d,u,p,g]=n;return{fill:o,align:a,sign:r,symbol:l,zero:c,width:parseInt(h),comma:d,precision:parseInt(u),trim:!!p,type:g,prefix:t,suffix:i}}function nC(e){const t=typeof e=="string"?Yv(e):e;if(t==null)return;const{fill:i,align:s,sign:n="-",symbol:o,zero:a,width:r,comma:l,type:c,prefix:h="",suffix:d="",precision:u}=t;let{trim:p}=t;const g=u==null||isNaN(u);let f;if(!c)f=Hn.g,p=!0;else if(c in Hn&&c in zh)f=g?zh[c]:Hn[c];else if(c in Hn)f=Hn[c];else if(c in zh)f=zh[c];else throw new Error(`The number formatter type is invalid: ${c}`);const x=c?6:12;let m;return g||(m=u),(b,v)=>{let S=f(b,m??v??x);return p&&(S=BG(S)),l&&(S=FG(S,l)),S=_G(b,S,n),o&&o!=="#"&&(S=`${o}${S}`),o==="#"&&c==="x"&&(S=`0x${S}`),c==="s"&&(S=`${S}${zG(b)}`),(c==="%"||c==="p")&&(S=`${S}%`),r!=null&&!isNaN(r)&&(S=GG(S,r,i??a,s)),S=`${h}${S}${d}`,S}}var zh={b:e=>Hf(e).toString(2),c:e=>String.fromCharCode(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>Hf(e).toString(8),x:e=>Hf(e).toString(16),X:e=>zh.x(e).toUpperCase(),n:e=>zh.d(e),"%":e=>`${Hf(e*100).toFixed(0)}`},Hn={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>Hn.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>Hn.f(e,t).toUpperCase(),g:(e,t)=>{if(e===0)return"0";const i=Math.abs(e),s=Math.floor(Math.log10(i));return s>=-4&&s<t?i.toFixed(t-1-s):i.toExponential(t-1)},G:(e,t)=>Hn.g(e,t).toUpperCase(),n:(e,t)=>Hn.g(e,t),p:(e,t)=>Hn.r(e*100,t),r:(e,t)=>{if(e===0)return"0";const i=Math.abs(e),n=Math.floor(Math.log10(i))-(t-1);if(n<=0)return i.toFixed(-n);const o=10**n;return(Math.round(i/o)*o).toFixed()},s:(e,t)=>{const i=rC(e);return Hn.r(e/10**i,t)},"%":(e,t)=>Hn.f(e*100,t)},oC=-24,aC=24,PG={[oC]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"\xB5",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[aC]:"Y"},RG="\u2212";function Hf(e){return Math.floor(Math.abs(e))}function BG(e){if(!e.endsWith("0")||e.indexOf(".")===-1)return e;let t=e.length-1;for(;t>0;)if(e[t]=="0")t-=1;else if(e[t]=="."){t-=1;break}else break;return e.substring(0,t+1)}function FG(e,t){let i=e.indexOf(".");i<0&&(i=e.length);const s=e.substring(0,i).split(""),n=e.substring(i);for(let o=s.length-3;o>0;o-=3)s.splice(o,0,t);return`${s.join("")}${n}`}function zG(e){return PG[rC(e)]}function rC(e){return ve(oC,e?Math.floor(Math.log10(Math.abs(e))/3)*3:0,aC)}function _G(e,t,i=""){if(i==="(")return e>=0?t:`(${t})`;const s=i==="+"?"+":"";return`${e>=0?s:RG}${t}`}function GG(e,t,i=" ",s=">"){let n=e;if(s===">"||!s)n=n.padStart(t,i);else if(s==="<")n=n.padEnd(t,i);else if(s==="^"){const o=Math.max(0,t-n.length),a=Math.ceil(o/2),r=Math.floor(o/2);n=n.padStart(a+n.length,i),n=n.padEnd(r+n.length,i)}return n}var Wf=class{constructor(){this.cleanup=new mt}destroy(){this.cleanup.flush()}},VG=class{constructor(){this.modules=[],this.dependencies=new Map,this.modulesByOptionKey=new Map}register(...e){for(const t of e){this.registerDependencies(t);const i=this.modules.find(s=>t.type===s.type&&("optionsKey"in t&&"optionsKey"in s?t.optionsKey===s.optionsKey:!0)&&t.identifier===s.identifier);if(i){if(t.packageType==="enterprise"&&i.packageType==="community"){const s=this.modules.indexOf(i);this.modules.splice(s,1,t),"optionsKey"in t&&this.modulesByOptionKey.set(t.optionsKey,t)}}else this.modules.push(t),"optionsKey"in t&&this.modulesByOptionKey.set(t.optionsKey,t)}}hasEnterpriseModules(){return this.modules.some(e=>e.packageType==="enterprise")}*byType(...e){const t=new Set,i=this.modules.filter(o=>e.includes(o.type)),s=o=>{const a=this.dependencies.get(o);return a?.flatMap(s).concat(a)??[]},n=[];for(const o of i){const a="optionsKey"in o?o.optionsKey:o.contextKey;if(!t.has(a)){for(const r of s(a)){if(t.has(r))continue;const l=this.modulesByOptionKey.get(r);if(!l){n.push(r);continue}e.includes(l.type)&&(yield l,t.add(r))}yield o,t.add(a)}}if(n.length>0)throw new Error(`Could not resolve module dependencies: ${n}`)}registerDependencies(e){if(e.dependencies==null||e.dependencies.length===0)return;const t="optionsKey"in e?e.optionsKey:e.contextKey;this.dependencies.set(t,e.dependencies)}},da=new VG,$f=Symbol("interpolate"),Uf=e=>e[$f]!=null;function Yf(e,t,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const o of i){const a=o.distanceSquared(e,t);if(a===0)return{nearest:o,distanceSquared:0};a<n.distanceSquared&&(n.nearest=o,n.distanceSquared=a)}return n}function jG(e,t,i,s=1/0){const{x:n=e,y:o=t}=i.transformPoint?.(e,t)??{},a={nearest:void 0,distanceSquared:s};for(const r of i.children){const{nearest:l,distanceSquared:c}=r.nearestSquared(n,o,a.distanceSquared);if(c===0)return{nearest:l,distanceSquared:c};c<a.distanceSquared&&(a.nearest=l,a.distanceSquared=c)}return a}var ju=class Nu{constructor(t,i,s,n){this.x=t,this.y=i,this.width=s,this.height=n}static fromDOMRect({x:t,y:i,width:s,height:n}){return new Nu(t,i,s,n)}static merge(t){let i=1/0,s=1/0,n=-1/0,o=-1/0;for(const a of t)a.x<i&&(i=a.x),a.y<s&&(s=a.y),a.x+a.width>n&&(n=a.x+a.width),a.y+a.height>o&&(o=a.y+a.height);return new Nu(i,s,n-i,o-s)}static nearestBox(t,i,s){return Yf(t,i,s)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:this.x+this.width,bottom:this.y+this.height,toJSON(){return{}}}}clone(){const{x:t,y:i,width:s,height:n}=this;return new Nu(t,i,s,n)}equals(t){return Wv(this,t)}containsPoint(t,i){return Hv(this,t,i)}intersection(t){if(!this.collidesBBox(t))return;const i=ve(t.x,this.x,t.x+t.width),s=ve(t.y,this.y,t.y+t.height),n=ve(t.x,this.x+this.width,t.x+t.width),o=ve(t.y,this.y+this.height,t.y+t.height);return new Nu(i,s,n-i,o-s)}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,i){if(this.containsPoint(t,i))return 0;const s=t-ve(this.x,t,this.x+this.width),n=i-ve(this.y,i,this.y+this.height);return s*s+n*n}shrink(t,i){if(typeof t=="number")this.applyMargin(t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(n,s)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(t,i){if(typeof t=="number")this.applyMargin(-t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(-n,s)}return this}applyMargin(t,i){switch(i){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=t*2;break;case"horizontal":this.x+=t,this.width-=t*2;break;case void 0:this.x+=t,this.y+=t,this.width-=t*2,this.height-=t*2;break}}translate(t,i){return this.x+=t,this.y+=i,this}[$f](t,i){return new Nu(this.x*(1-i)+t.x*i,this.y*(1-i)+t.y*i,this.width*(1-i)+t.width*i,this.height*(1-i)+t.height*i)}};ju.zero=Object.freeze(new ju(0,0,0,0)),ju.NaN=Object.freeze(new ju(NaN,NaN,NaN,NaN));var de=ju,HG=2e3,lC=Date.now(),WG=()=>{const e=Date.now()-lC;if(e>HG){const t=(Math.floor(e/100)/10).toFixed(1);X.log(`**** ${t}s since last log message ****`)}lC=Date.now()},Be={create(...e){return Object.assign((...i)=>{Be.check(...e)&&(typeof i[0]=="function"&&(i=Gf(i[0]())),WG(),X.log(...i))},{check:()=>Be.check(...e),group:(i,s)=>Be.check(...e)?X.logGroup(i,s):s()})},check(...e){return e.length===0&&e.push(!0),Gf(Ze("agChartsDebug")).some(i=>e.includes(i))},inDevelopmentMode(e){if(Be.check("dev"))return e()}};function cC({context:e,pixelRatio:t,width:i,height:s}){e.save();try{e.resetTransform(),e.clearRect(0,0,Math.ceil(i*t),Math.ceil(s*t))}finally{e.restore()}}function hC(e){if(Be.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let s=0;Object.assign(e,{save(){t(),s++},restore(){if(s===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(s!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function dC(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var Kv=class{constructor(e){const{width:t,height:i,pixelRatio:s,willReadFrequently:n=!1}=e;this.width=t,this.height=i,this.pixelRatio=s;const[o,a]=dC(t,i,s);this.canvas=new OffscreenCanvas(o,a),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),hC(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.canvas,t,i)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(e,t,i){if(!(e>0&&t>0))return;const{canvas:s,context:n}=this;if(e!==this.width||t!==this.height||i!==this.pixelRatio){const[o,a]=dC(e,t,i);s.width=o,s.height=a}n.setTransform(i,0,0,i,0,0),this.width=e,this.height=t,this.pixelRatio=i}clear(){cC(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)}},Zv=Symbol("BREAK"),Hu="__decorator_config",Kf="__decorator_accessors";function $G(e,t){Xv(e,t).optional=!0}function Xv(e,t){if(Object.getOwnPropertyDescriptor(e,Hu)==null&&Object.defineProperty(e,Hu,{value:{}}),Object.getOwnPropertyDescriptor(e,Kf)==null){const h=Object.getPrototypeOf(e)?.[Kf]?.slice()??[];Object.defineProperty(e,Kf,{value:h})}const i=e[Hu],s=t.toString();if(i[s]!=null)return i[s];i[s]={setters:[],getters:[],observers:[]};const n=Object.getOwnPropertyDescriptor(e,t);let o=n?.get,a=n?.set;if(o==null||a==null){const c=e[Kf];let h=c.indexOf(t);h===-1&&(h=c.push(t)-1),o??(o=function(){let d=this.__accessors;return d==null&&(d=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:d})),d[h]}),a??(a=function(d){let u=this.__accessors;u==null&&(u=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:u})),u[h]=d})}return Object.defineProperty(e,t,{set:function(c){const{setters:h,observers:d}=i[s];let u;h.some(p=>p.length>2)&&(u=o.call(this));for(const p of h)if(c=p(this,t,c,u),c===Zv)return;a.call(this,c);for(const p of d)p(this,c,u)},get:function(){let c=o.call(this);for(const h of i[s].getters)if(c=h(this,t,c),c===Zv)return;return c},enumerable:!0,configurable:!1}),i[s]}function hc(e,t,i){return(s,n)=>{const o=Xv(s,n);o.setters.push(e),t&&o.getters.unshift(t),i&&Object.assign(o,i)}}function uC(e){return(t,i)=>{Xv(t,i).observers.push(e)}}function Zf(e){return typeof e<"u"&&Hu in e}function Ur(e){const t=new Set;for(;Zf(e);)t.add(e?.[Hu]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(i=>Object.keys(i))}function pC(e){return Ur(e).reduce((t,i)=>(t[String(i)]=e[i]??null,t),{})}function Ci(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((i,s)=>Ci(i,t[s])):Je(e)?Je(t)?qv(e,t,Ci):!1:e===t}function qv(e,t,i){if(Object.is(e,t))return!0;for(const s of Object.keys(t))if(!(s in e))return!1;for(const s of Object.keys(e))if(!(s in t)||!i(e[s],t[s]))return!1;return!0}function et(...e){const t={};for(const i of e){if(!Fe(i))continue;const s=Zf(i)?Ur(i):Object.keys(i);for(const n of s)Je(t[n])&&Je(i[n])?t[n]=et(t[n],i[n]):t[n]??(t[n]=i[n])}return t}function Wu(...e){const t={};for(const i of e){if(!Fe(i))continue;const s=Zf(i)?Ur(i):Object.keys(i);for(const n of s)Je(t[n])&&Je(i[n])?t[n]=Wu(t[n],i[n]):n in t||(t[n]??(t[n]=i[n]))}return t}function gC(e,...t){return t&&Ue(e)?e.map(i=>et(i,...t)):e}function fC(e,t){const i={};for(const[s,n]of Et(e))i[s]=t(n,s,e);return i}function ce(e,t){const i={...e};for(const s of t)delete i[s];return i}function Qv(e,t){if(e==null)return;const i={};for(const s of t)Object.hasOwn(e,s)&&(i[s]=e[s]);return i}function Jv(e,t){return(Ue(t)?t:t.split(".")).reduce((s,n)=>s[n],e)}var eS=new Set(["__proto__","constructor","prototype"]);function tS(e,t,i){const s=Ue(t)?t.slice():t.split("."),n=s.pop();if(s.some(a=>eS.has(a)))return;const o=s.reduce((a,r)=>a[r],e);return o[n]=i,o[n]}function iS(e,t,i){if(i===void 0)return t;for(const s of e){const n=i[s];n!==void 0&&(t[s]=n)}return t}function Ua(e){return e==null||typeof e!="object"||!Je(e)||(Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const i=e[t];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&Ua(i)})),e}function yC(e,t){return Je(e)&&t in e}function UG(e,t){return yC(e,t)&&typeof e[t]=="string"}var _h=(e,t)=>e===t;function te(e){return function(t,i){const s=`__${i}`;t[i]||YG(t,i,s,e)}}function mC(e){return te(e)}function mn(e){return te(e)}function sS(e){const t=e??{};return t.equals=jn,te(e)}function YG(e,t,i,s){const{changeCb:n,convertor:o,checkDirtyOnAssignment:a=!1}=s??{},r={changeCb:n,checkDirtyOnAssignment:a,convertor:o},l=XG(i,ZG(KG(qG(i,r),r),r),r);Object.defineProperty(e,t,{set:l,get:function(){return this[i]},enumerable:!0,configurable:!0})}function KG(e,t){const{convertor:i}=t;return i?function(s){e.call(this,i(s))}:e}var xC=Symbol("no-change");function ZG(e,t){const{changeCb:i}=t;return i?function(s){const n=e.call(this,s);return n!==xC&&i.call(this,this),n}:e}function XG(e,t,i){const{checkDirtyOnAssignment:s}=i;return s?function(n){const o=t.call(this,n);return n?._dirty===!0&&this.markDirty(e),o}:t}function qG(e,t){const{equals:i=_h}=t;return function(s){const n=this[e];return i(s,n)?xC:(this[e]=s,this.onChangeDetection(e),s)}}var nS=(e,t)=>Math.sign(e-t);function bC(e,t){if(typeof e=="number"&&typeof t=="number")return nS(e,t);const i=typeof e=="number"?[e]:e,s=typeof t=="number"?[t]:t,n=Math.min(i.length,s.length);for(let o=0;o<n;o+=1){const a=nS(i[o],s[o]);if(a!==0)return a}return nS(i.length,s.length)}var vC=(e=>(e[e.All=0]="All",e[e.None=1]="None",e))(vC||{}),QG=5,$u=class Mk{constructor(t){this.serialNumber=Mk._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=ns(this),this.name=void 0,this.transitionOut=void 0,this.pointerEvents=0,this._datum=void 0,this._previousDatum=void 0,this.scene=void 0,this._debugDirtyProperties=void 0,this.parentNode=void 0,this.cachedBBox=void 0,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.batchLevel=0,this.batchDirty=!1,this.name=t?.name,this.tag=t?.tag??NaN,this.zIndex=t?.zIndex??0,this.scene=t?.scene,(t?.debugDirty??Mk._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(t,i,s){const n=t?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const o=ti("svg");if(o.setAttribute("width",String(i)),o.setAttribute("height",String(s)),o.setAttribute("viewBox",`0 0 ${i} ${s}`),o.setAttribute("overflow","visible"),n.defs?.length){const a=ti("defs");a.append(...n.defs),o.append(a)}return o.append(...n.elements),o.outerHTML}static*extractBBoxes(t,i){for(const s of t)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum}set datum(t){this._datum!==t&&(this._previousDatum=this._datum,this._datum=t)}get previousDatum(){return this._previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}closestDatum(){for(const{datum:t}of this.traverseUp(!0))if(t!=null)return t}preRender(t,i=1){if(this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i,this.batchLevel>0||this.batchDirty)throw new Error("AG Charts - illegal rendering state; batched update in progress");return this.childNodeCounts}isolatedRender(t){t.ctx.save();try{this.render(t)}catch(i){const s=i.errorCount??1;if(s>=QG)throw i.errorCount=s,i;X.warnOnce("Error during rendering",i,i.stack)}finally{t.ctx.restore()}}render(t){const{stats:i}=t;if(this.debugDirtyProperties(),t.debugNodeSearch){const s=this.name??this.id;t.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(t.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(t){this.scene=t}*traverseUp(t){let i=this;for(t&&(yield i);i=i.parentNode;)yield i}isRoot(){return!this.parentNode}removeChild(t){throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode?.removeChild(this)}batchedUpdate(t){this.batchLevel++,t(),this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}setProperties(t){return this.batchLevel++,Object.assign(this,t),this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1),this}containsPoint(t,i){return!1}pickNode(t,i){if(this.containsPoint(t,i))return this}pickNodes(t,i,s=[]){return this.containsPoint(t,i)&&s.push(this),s}getBBox(){return this.cachedBBox??(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(t){this.markDirty(t)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(t){if(this.batchLevel>0){this.batchDirty=!0;return}t!=null&&this._debugDirtyProperties&&this.markDebugProperties(t),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(t){const i=this._debugDirtyProperties?.get(t)??[],s=new Error().stack?.split(`
`).filter(n=>n!=="Error"&&!n.includes(".markDebugProperties")&&!n.includes(".markDirty")&&!n.includes("Object.assign ")&&!n.includes(`${this.constructor.name}.`))??"unknown";i.push(s[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(t,i)}debugDirtyProperties(){this._debugDirtyProperties!=null&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((t,i)=>{t.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${i} (${t.length}x)`),t.forEach(s=>console.log(s)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}toSVG(){}};$u._nextSerialNumber=0,$u._debugEnabled=!1,M([te()],$u.prototype,"visible",2),M([mn({equals:Ci,changeCb:e=>e.onZIndexChange()})],$u.prototype,"zIndex",2);var Ya=$u,Wn=Math.PI*2,Uu=Math.PI/2;function pi(e){return e%=Wn,e+=Wn,e%=Wn,e}function JG(e){return e%=Wn,e+=Wn,e!==Wn&&(e%=Wn),e}function Xf(e){return e%=Wn,e<-Math.PI?e+=Wn:e>=Math.PI&&(e-=Wn),e}function dc(e,t,i){const s=pi(e),n=pi(t),o=pi(i);return n<o?n<=s&&s<=o:n>o?n<=s||s<=o:t!==i}function os(e){return e/180*Math.PI}function eV(e){return e/Math.PI*180}function qf(e,t){return e=pi(e),t=pi(t),t-e+(e>t?Wn:0)}function SC(e){const t=pi(e);return t<=Uu?t/Uu:t<=Math.PI?(Math.PI-t)/Uu:t<=1.5*Math.PI?(t-Math.PI)/Uu:(Wn-t)/Uu}function oS(e,t,i){const s=SC(i);return e*s+t*Math.abs(1-s)}function Ka(e){return e?pi(os(e)):0}var uc=(e,t,i)=>e*(1-i)+t*i,aS=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},rS=e=>{const t=e<0?-1:1,i=Math.abs(e);return i>.0031308?t*(1.055*i**(1/2.4)-.055):12.92*e},MC=class nt{constructor(t,i,s,n=1){this.r=ve(0,t||0,1),this.g=ve(0,i||0,1),this.b=ve(0,s||0,1),this.a=ve(0,n||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!nt.parseHex(t):t.indexOf("rgb")>=0?!!nt.stringToRgba(t):nt.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.indexOf("#")>=0)return nt.fromHexString(t);const i=nt.nameToHex.get(t.toLowerCase());if(i)return nt.fromHexString(i);if(t.indexOf("rgb")>=0)return nt.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(t){t=t.replace(/ /g,"").slice(1);let i;switch(t.length){case 6:case 8:i=[];for(let s=0;s<t.length;s+=2)i.push(parseInt(`${t[s]}${t[s+1]}`,16));break;case 3:case 4:i=t.split("").map(s=>parseInt(s,16)).map(s=>s+s*16);break}if(i?.length>=3&&i.every(s=>s>=0))return i.length===3&&i.push(255),i}static fromHexString(t){const i=nt.parseHex(t);if(i){const[s,n,o,a]=i;return new nt(s/255,n/255,o/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let i=-1,s=-1;for(let r=0;r<t.length;r++){const l=t[r];if(i===-1&&l==="(")i=r;else if(l===")"){s=r;break}}if(i===-1||s===-1)return;const o=t.substring(i+1,s).split(","),a=[];for(let r=0;r<o.length;r++){const l=o[r];let c=parseFloat(l);if(!Number.isFinite(c))return;l.indexOf("%")>=0?(c=ve(0,c,100),c/=100):r===3?c=ve(0,c,1):(c=ve(0,c,255),c/=255),a.push(c)}return a}static fromRgbaString(t){const i=nt.stringToRgba(t);if(i){if(i.length===3)return new nt(i[0],i[1],i[2]);if(i.length===4)return new nt(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(t.length===4)return new nt(t[0],t[1],t[2],t[3]);if(t.length===3)return new nt(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,s,n=1){const o=nt.HSBtoRGB(t,i,s);return new nt(o[0],o[1],o[2],n)}static fromHSL(t,i,s,n=1){const o=nt.HSLtoRGB(t,i,s);return new nt(o[0],o[1],o[2],n)}static fromOKLCH(t,i,s,n=1){const o=nt.OKLCHtoRGB(t,i,s);return new nt(o[0],o[1],o[2],n)}static padHex(t){return t.length===1?"0"+t:t}toHexString(){let t="#"+nt.padHex(Math.round(this.r*255).toString(16))+nt.padHex(Math.round(this.g*255).toString(16))+nt.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(t+=nt.padHex(Math.round(this.a*255).toString(16))),t}toRgbaString(t=3){const i=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],s=Math.pow(10,t);return this.a!==1?(i.push(Math.round(this.a*s)/s),`rgba(${i.join(", ")})`):`rgb(${i.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return nt.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,i,s){const n=aS(t),o=aS(i),a=aS(s),r=Math.cbrt(.4122214708*n+.5363325363*o+.0514459929*a),l=Math.cbrt(.2119034982*n+.6806995451*o+.1073969566*a),c=Math.cbrt(.0883024619*n+.2817188376*o+.6299787005*a),h=.2104542553*r+.793617785*l-.0040720468*c,d=1.9779984951*r-2.428592205*l+.4505937099*c,u=.0259040371*r+.7827717662*l-.808675766*c,p=Math.atan2(u,d)*180/Math.PI,g=h,f=Math.hypot(d,u),x=p>=0?p:p+360;return[g,f,x]}static OKLCHtoRGB(t,i,s){const n=t,o=i*Math.cos(s*Math.PI/180),a=i*Math.sin(s*Math.PI/180),r=(n+.3963377774*o+.2158037573*a)**3,l=(n-.1055613458*o-.0638541728*a)**3,c=(n-.0894841775*o-1.291485548*a)**3,h=4.0767416621*r-3.3077115913*l+.2309699292*c,d=-1.2684380046*r+2.6097574011*l-.3413193965*c,u=-.0041960863*r-.7034186147*l+1.707614701*c,p=rS(h),g=rS(d),f=rS(u);return[p,g,f]}static RGBtoHSL(t,i,s){const n=Math.min(t,i,s),o=Math.max(t,i,s),a=(o+n)/2;let r,l;if(o===n)r=0,l=0;else{const c=o-n;l=a>.5?c/(2-o-n):c/(o+n),o===t?r=(i-s)/c+(i<s?6:0):o===i?r=(s-t)/c+2:r=(t-i)/c+4,r*=360/6}return[r,l,a]}static HSLtoRGB(t,i,s){if(t=(t%360+360)%360,i===0)return[s,s,s];const n=s<.5?s*(1+i):s+i-s*i,o=2*s-n;function a(h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?o+(n-o)*6*h:h<1/2?n:h<2/3?o+(n-o)*(2/3-h)*6:o}const r=a(t/360+1/3),l=a(t/360),c=a(t/360-1/3);return[r,l,c]}static RGBtoHSB(t,i,s){const n=Math.min(t,i,s),o=Math.max(t,i,s),a=o===0?0:(o-n)/o;let r=0;if(n!==o){const l=o-n,c=(o-t)/l,h=(o-i)/l,d=(o-s)/l;t===o?r=d-h:i===o?r=2+c-d:r=4+h-c,r/=6,r<0&&(r=r+1)}return[r*360,a,o]}static HSBtoRGB(t,i,s){t=(t%360+360)%360/360;let n=0,o=0,a=0;if(i===0)n=o=a=s;else{const r=(t-Math.floor(t))*6,l=r-Math.floor(r),c=s*(1-i),h=s*(1-i*l),d=s*(1-i*(1-l));switch(r>>0){case 0:n=s,o=d,a=c;break;case 1:n=h,o=s,a=c;break;case 2:n=c,o=s,a=d;break;case 3:n=c,o=h,a=s;break;case 4:n=d,o=c,a=s;break;case 5:n=s,o=c,a=h;break}}return[n,o,a]}static mix(t,i,s){return new nt(uc(t.r,i.r,s),uc(t.g,i.g,s),uc(t.b,i.b,s),uc(t.a,i.a,s))}static lighten(t,i){const s=nt.RGBtoOKLCH(t.r,t.g,t.b);return nt.fromOKLCH(ve(0,s[0]+i,1),s[1],s[2])}static darken(t,i){const s=nt.RGBtoOKLCH(t.r,t.g,t.b);return nt.fromOKLCH(ve(0,s[0]-i,1),s[1],s[2])}static interpolate(t,i){const s=1/(t.length-1),n=t.map(o=>nt.RGBtoOKLCH(o.r,o.g,o.b));return Array.from({length:i},(o,a)=>{const r=a/(i-1),l=t.length<=2?0:Math.min(Math.floor(r*(t.length-1)),t.length-2),c=(r-l*s)/s,h=n[l],d=n[l+1];return nt.fromOKLCH(uc(h[0],d[0],c),uc(h[1],d[1],c),uc(h[2],d[2],c))})}};MC.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 gt=MC,DC=(e=>(e[e.Leading=0]="Leading",e[e.Trailing=1]="Trailing",e[e.Interpolate=2]="Interpolate",e))(DC||{}),Qf=class{ticks(e,t,i){}niceDomain(e,t=this.domain){return t}get bandwidth(){}get step(){}get inset(){}},Yu=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})},AC=e=>{const t=gt.fromString(e),[i,s,n]=gt.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:n,a:t.a}},lS=1e-6,IC=e=>e.c<lS||e.l<lS||e.l>1-lS,tV=(e,t,i)=>{i=ve(0,i,1);let s;if(IC(e))s=t.h;else if(IC(t))s=e.h;else{const r=e.h;let l=t.h;const c=t.h-e.h;c>180?l-=360:c<-180&&(l+=360),s=r*(1-i)+l*i}const n=e.c*(1-i)+t.c*i,o=e.l*(1-i)+t.l*i,a=e.a*(1-i)+t.a*i;return gt.fromOKLCH(o,n,s,a)},Gh=class extends Qf{constructor(){super(...arguments),this.type="color",this.defaultTickCount=0,this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(AC)}update(){const{domain:e,range:t}=this;e.length<2&&(X.warnOnce("`colorDomain` should have at least 2 values."),e.length===0?e.push(0,1):e.length===1&&e.push(e[0]+1));for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i];if(s>n){X.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((o,a)=>o-a);break}}if(t.length<e.length)for(let i=t.length;i<e.length;i++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(AC)}normalizeDomains(...e){return{domain:e.flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:t,range:i,parsedRange:s}=this,n=t[0],o=t.at(-1),a=i[0],r=i[i.length-1];if(e<=n)return a;if(e>=o)return r;let l,c;if(t.length===2){const u=(e-n)/(o-n),p=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(u*(i.length-1)),i.length-2),c=(u-l*p)/p}else{for(l=0;l<t.length-2&&!(e<t[l+1]);l++);const u=t[l],p=t[l+1];c=(e-u)/(p-u)}const h=s[l],d=s[l+1];return tV(h,d,c).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&X.warnOnce("Expected update to not invalidate scale"))}};M([Yu],Gh.prototype,"domain",2),M([Yu],Gh.prototype,"range",2);var Jf=class{constructor(e,t=[],i){this.colorSpace=e,this.stops=t,this.bbox=i,this._cache=void 0}createGradient(e,t,i){const s=this.bbox??t;if(!s.isFinite())return;if(this._cache!=null&&this._cache.ctx===e&&this._cache.bbox.equals(s))return this._cache.gradient;const{stops:n,colorSpace:o}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let a=this.createCanvasGradient(e,s,i);if(a==null)return;const r=o==="oklch",l=.05;let c=n[0];a.addColorStop(c.stop,c.color);for(let h=1;h<n.length;h+=1){const d=n[h];if(r){const u=new Gh;u.domain=[c.stop,d.stop],u.range=[c.color,d.color];for(let p=c.stop+l;p<d.stop;p+=l)a.addColorStop(p,u.convert(p))}a.addColorStop(d.stop,d.color),c=d}return"createPattern"in a&&(a=a.createPattern()),this._cache={ctx:e,bbox:s,gradient:a},a}toSvg(e){const t=this.bbox??e,i=this.createSvgGradient(t);return this.stops.forEach(({stop:s,color:n})=>{const o=ti("stop");o.setAttribute("offset",`${s}`),o.setAttribute("stop-color",`${n}`),i.appendChild(o)}),i}},kC=class extends Jf{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}createCanvasGradient(e,t,i){const{angle:n}=this,o=Ka(n+-90),a=i?.centerX??t.x+t.width*.5,r=i?.centerY??t.y+t.height*.5;return e.createConicGradient(o,a,r)}createSvgGradient(e){return ti("linearGradient")}},CC=class extends Jf{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}getGradientPoints(e){const{angle:i}=this,s=Ka(i+90),n=Math.cos(s),o=Math.sin(s),a=e.width,r=e.height,l=e.x+a*.5,c=e.y+r*.5,h=Math.sqrt(r*r+a*a)/2,d=Math.atan2(r,a);let u;s<Math.PI/2?u=s:s<Math.PI?u=Math.PI-s:s<1.5*Math.PI?u=s-Math.PI:u=2*Math.PI-s;const p=h*Math.abs(Math.cos(u-d));return{x0:l+n*p,y0:c+o*p,x1:l-n*p,y1:c-o*p}}createCanvasGradient(e,t){const{x0:i,y0:s,x1:n,y1:o}=this.getGradientPoints(t);if(!(isNaN(i)||isNaN(s)||isNaN(n)||isNaN(o)))return e.createLinearGradient(i,s,n,o)}createSvgGradient(e){const{x0:t,y0:i,x1:s,y1:n}=this.getGradientPoints(e),o=ti("linearGradient");return o.setAttribute("x1",String(t)),o.setAttribute("y1",String(i)),o.setAttribute("x2",String(s)),o.setAttribute("y2",String(n)),o.setAttribute("gradientUnits","userSpaceOnUse"),o}},iV=class extends Jf{constructor(e,t,i){super(e,t,i)}createCanvasGradient(e,t,i){const s=i?.centerX??t.x+t.width*.5,n=i?.centerY??t.y+t.height*.5,o=i?.innerRadius??0,a=i?.outerRadius??Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2;return e.createRadialGradient(s,n,o,s,n,a)}createSvgGradient(e){const t=e.x+e.width*.5,i=e.y+e.height*.5,s=ti("radialGradient");return s.setAttribute("cx",String(t)),s.setAttribute("cy",String(i)),s.setAttribute("r",String(Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}},I=$G,we=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if(e==null)return this.clear(),this;if(typeof e!="object")return X.warn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const s of Ur(this))if(i.has(s)){const n=e[s],o=this;if(pc(o[s]))if(o[s]instanceof Ku){const a=o[s].reset(n);a==null?X.warn(`unable to set [${String(s)}] - expecting a properties array`):o[s]=a}else o[s].set(n);else Je(n)?o[s]=Wu(n,o[s]??{}):o[s]=n;i.delete(s)}this.handleUnknownProperties(i,e);for(const s of i)X.warn(`unable to set [${String(s)}] in ${t} - property is unknown`);return this}clear(){for(const e of Ur(this)){const t=this[e];pc(t)?t.clear():this[e]=void 0}return this}toJson(){return Ur(this).reduce((e,t)=>{const i=this[t];return e[String(t)]=pc(i)?i.toJson():i,e},{})}},Ku=class o_ extends Array{constructor(t,...i){super(i.length);const n=(o=>!!o?.prototype?.constructor?.name)(t)?o=>new t().set(o):t;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(t){if(Ue(t)){this.length=t.length;for(let i=0;i<t.length;i++)this[i]=this.itemFactory(t[i])}return this}reset(t){if(Array.isArray(t))return new o_(this.itemFactory,...t)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function pc(e){return e instanceof we||e instanceof Ku}var cS=class extends we{constructor(){super(...arguments),this.color="black"}};M([I],cS.prototype,"stop",2),M([I],cS.prototype,"color",2);function sV(e){let t;for(const i of e)if(i?.stop!=null){if(t!=null&&i.stop<t)return!1;t=i.stop}return!0}function TC(e){return e.flatMap((t,i)=>{const{stop:s}=t,n=e.at(i+1)?.color;return n!=null?[t,{stop:s,color:n}]:[t]})}function nV(e,t){const i=t==="discrete"?1:0,s=e.map((n,o,{length:a})=>({stop:(o+i)/(a-1+i),color:n}));return t==="discrete"?TC(s):s}function LC(e,t,i,s="continuous"){const n=e.map(g=>typeof g=="string"?{color:g}:g);if(n.length===0)return nV(t,s);if(!sV(n))return X.warnOnce("[fills] must have the stops defined in ascending order"),[];const o=Math.min(...i),a=Math.max(...i),r=s==="discrete",l=new Float64Array(n.length);let c=0,h=-1;for(let g=0;g<n.length;g+=1){const f=n[g];if(g>=h){h=n.length-1;for(let m=g+1;m<n.length;m+=1)if(n[m]?.stop!=null){h=m;break}}let x=f?.stop;if(x==null){const m=n[c]?.stop,b=n[h]?.stop,v=m??o,S=b??a,D=r&&m==null?1:0;x=v+(S-v)*(g-c+D)/(h-c+D)}else c=g;l[g]=Math.max(0,Math.min(1,(x-o)/(a-o)))}let d=n.find(g=>g.color!=null)?.color,u;const p=n.map((g,f)=>{let x=g?.color;const m=l[f];return x!=null?d=x:d!=null?x=d:(u==null&&(u=new Gh,u.domain=[0,1],u.range=t),x=u.convert(m)),{stop:m,color:x}});return s==="discrete"?TC(p):p}var oV=class{constructor(e,t){this.imageLoader=e,this._cache=void 0,this.url=t.url,this.backgroundFill=t.backgroundFill??"black",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.repeat=t.repeat??"no-repeat",this.width=t.width,this.height=t.height,this.fit=t.fit??"stretch",this.rotation=t.rotation??0}createCanvasImage(e,t,i,s){if(!t)return null;const[n,o]=this.getSize(t.width,t.height,i,s);return n<1||o<1?(X.warnOnce("Image fill is too small to render, ignoring."),null):e.createPattern(t,this.repeat)}getSize(e,t,i,s){const{fit:n}=this;let o=e,a=t,r=1;const l=i/s,c=e/t;return n==="stretch"||e===0||t===0?(o=i,a=s):n==="contain"?r=c>l?i/e:s/t:n==="cover"&&(r=c>l?s/t:i/e),[Math.max(1,o*r),Math.max(1,a*r)]}setImageTransform(e,t){if(typeof e=="string")return;const{url:i,rotation:s,width:n,height:o}=this,a=this.imageLoader?.loadImage(i);if(!a)return;const r=Ka(s),l=Math.cos(r),c=Math.sin(r),[h,d]=this.getSize(a.width,a.height,n??t.width,o??t.height),u=h/a.width,p=d/a.height,g=t.x+t.width/2,f=t.y+t.height/2,x=l*h-c*d,m=c*h+l*d,b=x/2,v=m/2;e?.setTransform(new DOMMatrix([l*u,c*p,-c*u,l*p,g-b,f-v]))}createPattern(e,t,i,s){const n=this.width??t,o=this.height??i,a=this._cache;if(a!=null&&a.ctx===e&&a.width===n&&a.height===o)return a.pattern;const r=this.imageLoader?.loadImage(this.url,s),l=this.createCanvasImage(e,r,n,o);if(l!=null)return this._cache={ctx:e,pattern:l,width:n,height:o},l}toSvg(e,t){const{url:i,rotation:s,backgroundFill:n,backgroundFillOpacity:o}=this,{x:a,y:r,width:l,height:c}=e,h=ti("pattern");h.setAttribute("viewBox",`0 0 ${l} ${c}`),h.setAttribute("x",String(a)),h.setAttribute("y",String(r)),h.setAttribute("width",String(l)),h.setAttribute("height",String(c)),h.setAttribute("patternUnits","userSpaceOnUse");const d=ti("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(l)),d.setAttribute("height",String(c)),d.setAttribute("fill",n),d.setAttribute("fill-opacity",String(o)),h.appendChild(d);const u=ti("image");return u.setAttribute("href",i),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(l)),u.setAttribute("height",String(c)),u.setAttribute("preserveAspectRatio","none"),u.setAttribute("transform",`scale(${1/t}) rotate(${s}, ${l/2}, ${c/2})`),h.appendChild(u),h}};function wC(e,t,i,s){const n=e-i,o=t-s;return n*n+o*o}function ey(e,t,i,s,n,o,a){if(i===n&&s===o)return Math.min(a,wC(e,t,i,s));const r=n-i,l=o-s,c=Math.max(0,Math.min(1,((e-i)*r+(t-s)*l)/(r*r+l*l))),h=i+c*r,d=s+c*l;return Math.min(a,wC(e,t,h,d))}var aV=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,vt=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,rV=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,NC=/^[01]/,lV={z:[],h:[vt],v:[vt],m:[vt,vt],l:[vt,vt],t:[vt,vt],s:[vt,vt,vt,vt],q:[vt,vt,vt,vt],c:[vt,vt,vt,vt,vt,vt],a:[vt,vt,vt,NC,NC,vt,vt]};function cV(e){if(!e)return;const t=[];let i=0,s;for(;i<e.length;){const n=aV.exec(e.slice(i));let o;if(n==null){if(!s){X.warnOnce(`Invalid SVG path, error at index ${i}: Missing command.`);return}o=s}else o=n[1],i+=n[0].length;const a=hV(o,e,i);if(!a)return;i=a[0],s=o,t.push(a[1])}return t}function hV(e,t,i){const s=lV[e.toLocaleLowerCase()],n={command:e,params:[]};for(const o of s){const a=t.slice(i),r=o.exec(a);if(r!=null){n.params.push(parseFloat(r[0])),i+=r[0].length;const l=rV.exec(a.slice(r[0].length));l!=null&&(i+=l[0].length)}else{if(n.params.length===1)return[i,n];X.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${e}]`);return}}return[i,n]}function dV(e,t){const i=-t/e;return e!==0&&i>=0&&i<=1?[i]:[]}function uV(e,t,i,s=1e-6){if(Math.abs(e)<s)return dV(t,i);const n=t*t-4*e*i,o=[];if(Math.abs(n)<s){const a=-t/(2*e);a>=0&&a<=1&&o.push(a)}else if(n>0){const a=Math.sqrt(n),r=(-t-a)/(2*e),l=(-t+a)/(2*e);r>=0&&r<=1&&o.push(r),l>=0&&l<=1&&o.push(l)}return o}function pV(e,t,i,s,n=1e-6){if(Math.abs(e)<n)return uV(t,i,s,n);const o=t/e,a=i/e,r=s/e,l=(3*a-o*o)/9,c=(9*o*a-27*r-2*o*o*o)/54,h=l*l*l+c*c,d=1/3,u=[];if(h>=0){const p=Math.sqrt(h),g=Math.sign(c+p)*Math.pow(Math.abs(c+p),d),f=Math.sign(c-p)*Math.pow(Math.abs(c-p),d),x=Math.abs(Math.sqrt(3)*(g-f)/2),m=-d*o+(g+f);if(m>=0&&m<=1&&u.push(m),Math.abs(x)<n){const b=-d*o-(g+f)/2;b>=0&&b<=1&&u.push(b)}}else{const p=Math.acos(c/Math.sqrt(-l*l*l)),g=d*o,f=2*Math.sqrt(-l),x=f*Math.cos(d*p)-g,m=f*Math.cos(d*(p+2*Math.PI))-g,b=f*Math.cos(d*(p+4*Math.PI))-g;x>=0&&x<=1&&u.push(x),m>=0&&m<=1&&u.push(m),b>=0&&b<=1&&u.push(b)}return u}function Zu(e,t,i,s,n,o,a,r){const l=(i-e)*(r-o)-(s-t)*(a-n);if(l===0)return 0;const c=((a-n)*(t-o)-(e-n)*(r-o))/l,h=((i-e)*(t-o)-(s-t)*(e-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function gV(e,t,i,s,n,o,a,r,l,c,h,d){let u=0;const p=c-d,g=h-l,f=l*(d-c)-c*(h-l),x=EC(e,i,n,a),m=EC(t,s,o,r),b=p*x[0]+g*m[0],v=p*x[1]+g*m[1],S=p*x[2]+g*m[2],D=p*x[3]+g*m[3]+f,C=pV(b,v,S,D);for(const T of C){const k=T*T,L=T*k,N=x[0]*L+x[1]*k+x[2]*T+x[3],w=m[0]*L+m[1]*k+m[2]*T+m[3];let O;l===h?O=(w-c)/(d-c):O=(N-l)/(h-l),O>=0&&O<=1&&u++}return u}function EC(e,t,i,s){return[-e+3*t-3*i+s,3*e-6*t+3*i,-3*e+3*t,e]}function Vh(e,t,i,s,n){return(1-n)**3*e+3*(1-n)**2*n*t+3*(1-n)*n**2*i+n**3*s}function ty(e,t,i,s,n){if(n<=Math.min(e,s))return e<s?0:1;if(n>=Math.max(e,s))return e<s?1:0;let o=0,a=1,r=NaN;for(let l=0;l<12;l+=1)r=(o+a)/2,Vh(e,t,i,s,r)<n?o=r:a=r;return r}function Xu(e,t,i,s,n,o,a,r,l){const c=(1-l)*e+l*i,h=(1-l)*t+l*s,d=(1-l)*i+l*n,u=(1-l)*s+l*o,p=(1-l)*n+l*a,g=(1-l)*o+l*r,f=(1-l)*c+l*d,x=(1-l)*h+l*u,m=(1-l)*d+l*p,b=(1-l)*u+l*g,v=(1-l)*f+l*m,S=(1-l)*x+l*b;return[[{x:e,y:t},{x:c,y:h},{x:f,y:x},{x:v,y:S}],[{x:v,y:S},{x:m,y:b},{x:p,y:g},{x:a,y:r}]]}function OC(e,t,i,s){const n=-e+3*t-3*i+s,o=2*(e-2*t+i),a=-e+t;if(n===0){if(o!==0){const l=-a/o;if(l>0&&l<1)return[l]}return[]}const r=o*o-4*n*a;if(r>=0){const l=Math.sqrt(r),c=(-o+l)/(2*n),h=(-o-l)/(2*n);return[c,h].filter(d=>d>0&&d<1)}return[]}function PC(e,t,i,s,n,o,a,r){const l=OC(e,i,n,a),c=OC(t,s,o,r);return[...l,...c]}function hS(e,t,i){const s=Vh(e[0].x,e[1].x,e[2].x,e[3].x,.5),n=Vh(e[0].y,e[1].y,e[2].y,e[3].y,.5),o=Math.hypot(s-t,n-i),a=Math.min(Math.hypot(e[0].x-t,e[0].y-i),Math.hypot(e[1].x-t,e[1].y-i),Math.hypot(e[2].x-t,e[2].y-i),Math.hypot(e[3].x-t,e[3].y-i));return{points:e,distance:o,minDistance:a}}function RC(e,t,i,s,n,o,a,r,l,c,h=1){let u={value:hS([{x:e,y:t},{x:i,y:s},{x:n,y:o},{x:a,y:r}],l,c),next:null},p;for(;u!=null;){const{points:g,distance:f,minDistance:x}=u.value;if(u=u.next,(p==null||f<p.distance)&&(p={distance:f,minDistance:x}),p!=null&&p.distance-x<=h)continue;const[m,b]=Xu(g[0].x,g[0].y,g[1].x,g[1].y,g[2].x,g[2].y,g[3].x,g[3].y,.5),v=[hS(m,l,c),hS(b,l,c)].sort(BC);u=tC(u,v,BC)}return p?.distance??1/0}var BC=(e,t)=>t.minDistance-e.minDistance,jh=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.cx=NaN,this.cy=NaN,this.sx=NaN,this.sy=NaN,this.openedPath=!1,this.closedPath=!1}isEmpty(){return this.commands.length===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(e,t){this.openedPath=!0,this.sx=e,this.sy=t,this.cx=e,this.cy=t,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.cx=e,this.cy=t,this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}cubicCurveTo(e,t,i,s,n,o){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,s,n,o),this.commands.push(2),this.params.push(e,t,i,s,n,o)}closePath(){this.openedPath&&(this.cx=this.sx,this.cy=this.sy,this.sx=NaN,this.sy=NaN,this.path2d.closePath(),this.commands.push(3),this.openedPath=!1,this.closedPath=!0)}rect(e,t,i,s){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+s),this.lineTo(e,t+s),this.closePath()}roundRect(e,t,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(e,t+n),this.arc(e+n,t+n,n,Math.PI,1.5*Math.PI),this.lineTo(e+n,t),this.lineTo(e+i-n,t),this.arc(e+i-n,t+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+n),this.lineTo(e+i,t+s-n),this.arc(e+i-n,t+s-n,n,0,Math.PI/2),this.lineTo(e+i-n,t+s),this.lineTo(e+n,t+s),this.arc(e+ +n,t+s-n,n,Math.PI/2,Math.PI),this.lineTo(e,t+s-n),this.closePath()}ellipse(e,t,i,s,n,o,a,r=!1){const l=i,c=s/i,h=Math.cos(n),d=Math.sin(n),u=-c*d,p=c*h,g=l*Math.cos(o),f=l*Math.sin(o),x=e+h*g+u*f,m=t+d*g+p*f,b=(x-this.cx)**2+(m-this.cy)**2;this.openedPath?b>1e-6&&this.lineTo(x,m):this.moveTo(x,m);let v=r?-pi(o-a):pi(a-o);Math.abs(Math.abs(a-o)-2*Math.PI)<1e-6&&v<2*Math.PI&&(v+=2*Math.PI*(r?-1:1));const S=Math.max(Math.ceil(Math.abs(v)/(Math.PI/2)),1),D=v/S,C=4/3*Math.tan(D/4);for(let T=0;T<S;T+=1){const k=o+D*(T+0),L=o+D*(T+1),N=l*Math.sin(k),w=l*Math.cos(k),O=l*Math.sin(L),R=l*Math.cos(L),B=w-C*N,P=N+C*w,_=R+C*O,F=O-C*R,W=R,H=O;this.cubicCurveTo(e+h*B+u*P,t+d*B+p*P,e+h*_+u*F,t+d*_+p*F,e+h*W+u*H,t+d*W+p*H)}}arc(e,t,i,s,n,o){this.ellipse(e,t,i,i,0,s,n,o)}appendSvg(e){const t=cV(e);if(t==null)return!1;let i=0,s=0,n,o,a=0,r=0;for(const{command:l,params:c}of t){n??(n=c[0]),o??(o=c[1]);const h=l===l.toLowerCase(),d=h?n:0,u=h?o:0;switch(l.toLowerCase()){case"m":this.moveTo(d+c[0],u+c[1]),n=d+c[0],o=u+c[1],i=n,s=o;break;case"c":this.cubicCurveTo(d+c[0],u+c[1],d+c[2],u+c[3],d+c[4],u+c[5]),a=d+c[2],r=u+c[3],n=d+c[4],o=u+c[5];break;case"s":this.cubicCurveTo(n+n-a,o+o-r,d+c[0],u+c[1],d+c[2],u+c[3]),a=d+c[0],r=u+c[1],n=d+c[2],o=u+c[3];break;case"q":this.cubicCurveTo((d+2*c[0])/3,(u+2*c[1])/3,(2*c[0]+c[2])/3,(2*c[1]+c[3])/3,c[2],c[3]),a=c[0],r=c[1],n=c[2],o=c[3];break;case"t":this.cubicCurveTo((n+2*(n+n-a))/3,(o+2*(o+o-r))/3,(2*(n+n-a)+c[0])/3,(2*(o+o-r)+c[1])/3,c[0],c[1]),a=n+n-a,r=o+o-r,n=c[0],o=c[1];break;case"a":this.svgEllipse(n,o,c[0],c[1],c[2]*Math.PI/180,c[3],c[4],d+c[5],u+c[6]),n=d+c[5],o=u+c[6];break;case"h":this.lineTo(d+c[0],o),n=d+c[0];break;case"l":this.lineTo(d+c[0],u+c[1]),n=d+c[0],o=u+c[1];break;case"v":this.lineTo(n,u+c[0]),o=u+c[0];break;case"z":this.closePath(),n=i,o=s;break;default:throw new Error(`Could not translate command '${l}' with '${c.join(" ")}'`)}}return!0}svgEllipse(e,t,i,s,n,o,a,r,l){i=Math.abs(i),s=Math.abs(s);const c=(e-r)/2,h=(t-l)/2,d=Math.sin(n),u=Math.cos(n),p=u*c+d*h,g=-d*c+u*h,f=p/i,x=g/s;let m=f*f+x*x,b=(e+r)/2,v=(t+l)/2,S=0,D=0;m>=1?(m=Math.sqrt(m),i*=m,s*=m):(m=Math.sqrt(1/m-1),o===a&&(m=-m),S=m*i*x,D=-m*s*f,b+=u*S-d*D,v+=d*S+u*D);const C=Math.atan2((g-D)/s,(p-S)/i),T=Math.atan2((-g-D)/s,(-p-S)/i)-C,k=C+T,L=!!(1-a);this.ellipse(b,v,i,s,n,C,k,L)}clear(e){e&&(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(e,t){const i=this.commands,s=this.params,n=i.length,o=-1e4,a=-1e4;let r=NaN,l=NaN,c=0,h=0,d=0;for(let u=0,p=0;u<n;u++)switch(i[u]){case 0:d+=Zu(r,l,c,h,o,a,e,t),c=s[p++],r=c,h=s[p++],l=h;break;case 1:d+=Zu(c,h,s[p++],s[p++],o,a,e,t),c=s[p-2],h=s[p-1];break;case 2:d+=gV(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],o,a,e,t),c=s[p-2],h=s[p-1];break;case 3:d+=Zu(r,l,c,h,o,a,e,t);break}return d%2===1}distanceSquared(e,t){let i=1/0;const s=this.commands,n=this.params,o=s.length;let a=NaN,r=NaN,l=0,c=0;for(let h=0,d=0;h<o;h++)switch(s[h]){case 0:l=a=n[d++],c=r=n[d++];break;case 1:{const b=l,v=c;l=n[d++],c=n[d++],i=ey(e,t,b,v,l,c,i);break}case 2:const u=l,p=c,g=n[d++],f=n[d++],x=n[d++],m=n[d++];l=n[d++],c=n[d++],i=RC(u,p,g,f,x,m,l,c,e,t)**2;break;case 3:i=ey(e,t,l,c,a,r,i);break}return i}toSVG(e=(t,i)=>({x:t,y:i})){const t=[],{commands:i,params:s}=this,n=(a,r)=>{t.push(a);for(let l=0;l<r;l+=2){const{x:c,y:h}=e(s[o++],s[o++]);t.push(c,h)}};let o=0;for(const a of i)switch(a){case 0:n("M",2);break;case 1:n("L",2);break;case 2:n("C",6);break;case 3:n("Z",0);break}return t.join(" ")}computeBBox(){const{commands:e,params:t}=this;let[i,s,n,o]=[1/0,1/0,-1/0,-1/0],[a,r]=[NaN,NaN],[l,c]=[NaN,NaN];const h=(u,p)=>{i=Math.min(p,i),s=Math.min(u,s),n=Math.max(u,n),o=Math.max(p,o),a=u,r=p};let d=0;for(const u of e)switch(u){case 0:h(t[d++],t[d++]),l=a,c=r;break;case 1:h(t[d++],t[d++]);break;case 2:{const p=a,g=r,f=t[d++],x=t[d++],m=t[d++],b=t[d++],v=t[d++],S=t[d++];PC(p,g,f,x,m,b,v,S).forEach(C=>{const T=Vh(p,f,m,v,C),k=Vh(g,x,b,S,C);h(T,k)}),h(v,S);break}case 3:h(l,c),l=NaN,c=NaN;break}return new de(s,i,n-s,o-i)}};function _i(e,t,i){const s=Math.round(t*e)/e;return i==null?s:i===0?0:i<1?Math.ceil(i*e)/e:Math.round((i+t)*e)/e-s}function FC(e,t){return Math.floor(t*e)/e}function dS(e,t,i){const{width:s,height:n,padding:o,strokeWidth:a}=t,r=s/2,l=n/2,c=Math.max(1,s-o-a/2),h=Math.max(1,n-o-a/2);let d=!1;for(const[u,p]of i){const g=r+(u-.5)*c,f=l+(p-.5)*h;d?e.lineTo(g,f):e.moveTo(g,f),d=!0}e.closePath()}var zC={circles(e,{width:t,strokeWidth:i,padding:s}){const n=t/2,o=Math.max(1,n-s-i/2);e.arc(n,n,o,0,Math.PI*2)},squares(e,{width:t,height:i,pixelRatio:s,padding:n,strokeWidth:o}){const a=n+o/2;e.moveTo(_i(s,a),_i(s,a)),e.lineTo(_i(s,t-a),_i(s,a)),e.lineTo(_i(s,t-a),_i(s,i-a)),e.lineTo(_i(s,a),_i(s,i-a)),e.closePath()},triangles(e,t){dS(e,t,[[.5,0],[1,1],[0,1]])},diamonds(e,t){dS(e,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(e,{width:t,height:i,padding:s}){const o=Math.max(1,(t-s)/2),a=o/2,r=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?o:a,h=l*Math.PI/5-r,d=t/2+Math.cos(h)*c,u=i/2+Math.sin(h)*c;e.lineTo(d,u)}e.closePath()},hearts(e,{width:t,height:i,padding:s}){const n=Math.max(1,t/4-s/2),o=t/2,a=i/2+n/2;e.arc(o-n,a-n,n,os(130),os(330)),e.arc(o+n,a-n,n,os(220),os(50)),e.lineTo(o,a+n),e.closePath()},crosses(e,t){dS(e,t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},"vertical-lines"(e,{width:t,height:i,pixelRatio:s,strokeWidth:n}){const o=_i(s,t/2)-n%2/2;e.moveTo(o,0),e.lineTo(o,i)},"horizontal-lines"(e,{width:t,height:i,pixelRatio:s,strokeWidth:n}){const o=_i(s,i/2)-n%2/2;e.moveTo(0,o),e.lineTo(t,o)},"forward-slanted-lines"(e,{width:t,height:i,strokeWidth:s}){const n=Math.atan2(i,t),o=s*Math.cos(n),a=s*Math.sin(n);e.moveTo(-o,a),e.lineTo(o,-a),e.moveTo(-o,i+a),e.lineTo(t+o,-a),e.moveTo(t-o,i+a),e.lineTo(t+o,i-a)},"backward-slanted-lines"(e,{width:t,height:i,strokeWidth:s}){const n=Math.atan2(i,t),o=s*Math.cos(n),a=s*Math.sin(n);e.moveTo(t-o,-a),e.lineTo(t+o,a),e.moveTo(-o,-a),e.lineTo(t+o,i+a),e.moveTo(-o,i-a),e.lineTo(o,i+a)}},fV=class{constructor(e){this._cache=void 0,this.width=Math.max(e?.width??10,1),this.height=Math.max(e?.height??10,1),this.fill=e.fill??"none",this.fillOpacity=e.fillOpacity??1,this.backgroundFill=e.backgroundFill??"none",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.stroke=e.stroke??"black",this.strokeOpacity=e.strokeOpacity??1,this.strokeWidth=e.strokeWidth??1,this.padding=e.padding??1,this.pattern=e.pattern??"forward-slanted-lines",this.rotation=e.rotation??0,this.scale=e.scale??1,this.path=e.path}getPath(e){const{pattern:t,width:i,height:s,padding:n,strokeWidth:o,path:a}=this,r=new jh;let l=zC[t]!=null;return a&&l&&(l=!r.appendSvg(a)),l&&zC[t](r,{width:i,height:s,pixelRatio:e,strokeWidth:o,padding:n}),r}renderStroke(e,t){const{stroke:i,strokeWidth:s,strokeOpacity:n}=this;s&&(t.strokeStyle=i,t.lineWidth=s,t.globalAlpha=n,t.stroke(e))}renderFill(e,t){const{fill:i,fillOpacity:s}=this;i!=="none"&&(t.fillStyle=i,t.globalAlpha=s,t.fill(e))}createCanvasPattern(e,t){const{width:i,height:s,scale:n,backgroundFill:o,backgroundFillOpacity:a}=this;if(i*n<1||s*n<1)return X.warnOnce("Pattern fill is too small to render, ignoring."),null;const r=new Kv({width:i,height:s,pixelRatio:t*n}),l=r.context;o!=="none"&&(l.fillStyle=o,l.globalAlpha=a,l.fillRect(0,0,i,s));const c=this.getPath(t).getPath2D();this.renderFill(c,l),this.renderStroke(c,l);const h=e.createPattern(r.canvas,"repeat");return this.setPatternTransform(h,t),r.destroy(),h}setPatternTransform(e,t,i=0,s=0){if(e==null)return;const n=Ka(this.rotation),o=1/t,a=Math.cos(n)*o,r=Math.sin(n)*o;e.setTransform(new DOMMatrix([a,r,-r,a,i,s]))}createPattern(e,t){if(this._cache!=null&&this._cache.ctx===e&&this._cache.pixelRatio===t)return this._cache.pattern;const i=this.createCanvasPattern(e,t);if(i!=null)return this._cache={ctx:e,pattern:i,pixelRatio:t},i}toSvg(){const{width:e,height:t,fill:i,fillOpacity:s,backgroundFill:n,backgroundFillOpacity:o,stroke:a,strokeWidth:r,strokeOpacity:l,rotation:c,scale:h}=this,d=ti("pattern");d.setAttribute("viewBox",`0 0 ${e} ${t}`),d.setAttribute("width",String(e)),d.setAttribute("height",String(t)),d.setAttribute("patternUnits","userSpaceOnUse");const u=ti("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(e)),u.setAttribute("height",String(t)),u.setAttribute("fill",n),u.setAttribute("fill-opacity",String(o)),d.appendChild(u);const p=ti("path");return p.setAttribute("fill",i),p.setAttribute("fill-opacity",String(s)),p.setAttribute("stroke-opacity",String(l)),p.setAttribute("stroke",a),p.setAttribute("stroke-width",String(r)),p.setAttribute("transform",`rotate(${c}) scale(${h})`),p.setAttribute("d",this.getPath(1).toSVG()),d.appendChild(p),d}};function To(e){return Fe(e)&&e.type=="gradient"}function yV(e){return Ue(e)&&e.every(t=>typeof t=="string")}function Yr(e){return e!==null&&Fe(e)&&e.type=="pattern"}function gc(e){return e!==null&&Fe(e)&&e.type=="image"}function mV(e){return To(e)||Yr(e)}function _C(e,t){const{fontStyle:i,fontWeight:s,fontSize:n,fontFamily:o}=t;i&&e.setAttribute("font-style",i),s&&e.setAttribute("font-weight",String(s)),n!=null&&e.setAttribute("font-size",String(n)),o&&e.setAttribute("font-family",o)}function xV(e,t){const{stroke:i,strokeWidth:s,strokeOpacity:n}=t;i&&e.setAttribute("stroke",i),s!=null&&e.setAttribute("stroke-width",String(s)),n!=null&&e.setAttribute("stroke-opacity",String(n))}function bV(e,t){const{lineDash:i,lineDashOffset:s}=t;if(i?.some(n=>n!==0)){const n=i.length%2===1?[...i,...i]:i;e.setAttribute("stroke-dasharray",n.join(" ")),s!=null&&e.setAttribute("stroke-dashoffset",String(s))}}var gi=class extends Ya{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill="black",this.strokeWidth=0,this.lineDashOffset=0,this.opacity=1}getGradient(e){if(To(e))return this.createGradient(e)}createGradient(e){const{colorSpace:t="rgb",gradient:i="linear",colorStops:s,rotation:n=0,reverse:o=!1}=e;if(s==null)return;let a=LC(s,["black"],[0,1]);switch(o&&(a=a.map(r=>({color:r.color,stop:1-r.stop})).reverse()),i){case"linear":return new CC(t,a,n);case"radial":return new iV(t,a);case"conic":return new kC(t,a,n)}}getPattern(e){if(Yr(e))return this.createPattern(e)}createPattern(e){return new fV(e)}getImage(e){if(gc(e))return this.createImage(e)}createImage(e){return new oV(this.imageLoader,e)}onFillChange(){typeof this.fill=="object"&&Ci(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(e,t){return _i(this.layerManager?.canvas?.pixelRatio??1,e,t)}markDirty(e){super.markDirty(e),this.cachedDefaultGradientFillBBox=void 0}fillStroke(e,t){this.renderFill(e,t),this.renderStroke(e,t)}renderFill(e,t){const{fill:i,fillOpacity:s,fillImage:n}=this;if(i!=null&&i!=="none"&&s>0){const{globalAlpha:o}=e;n&&(e.globalAlpha=n.backgroundFillOpacity,e.fillStyle=n.backgroundFill,this.executeFill(e,t),e.globalAlpha=o),this.applyFillAndAlpha(e),this.applyShadow(e),this.executeFill(e,t),e.globalAlpha=o,e.shadowColor="rgba(0, 0, 0, 0)"}}executeFill(e,t){t?e.fill(t):e.fill()}applyFillAndAlpha(e){const{fill:t,fillGradient:i,fillPattern:s,fillImage:n,fillOpacity:o=1,opacity:a=1}=this;if(e.globalAlpha*=a*o,i){const{fillBBox:r=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:l}=this;e.fillStyle=i.createGradient(e,r,l)??"black"}else if(s){const{x:r,y:l}=this.getBBox(),c=this.layerManager?.canvas?.pixelRatio??1,h=s.createPattern(e,c);s.setPatternTransform(h,c,r,l),h?e.fillStyle=h:(e.fillStyle=s.fill,e.globalAlpha*=s.fillOpacity)}else if(n){const r=this.getBBox(),l=n.createPattern(e,r.width,r.height,this);n.setImageTransform(l,r),e.fillStyle=l??"transparent"}else e.fillStyle=typeof t=="string"?t:"black"}applyStrokeAndAlpha(e){const{stroke:t,strokeOpacity:i=1,strokeGradient:s,opacity:n=1}=this;e.strokeStyle=s?.createGradient(e,this.getBBox())??(typeof t=="string"?t:void 0)??"black",e.globalAlpha*=n*i}applyShadow(e){const t=this.layerManager?.canvas.pixelRatio??1,i=this.fillShadow;i?.enabled&&(e.shadowColor=i.color,e.shadowOffsetX=i.xOffset*t,e.shadowOffsetY=i.yOffset*t,e.shadowBlur=i.blur*t)}renderStroke(e,t){const{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,lineCap:r,lineJoin:l,miterLimit:c}=this;if(i!=null&&i!=="none"&&s>0&&n>0){const{globalAlpha:h}=e;this.applyStrokeAndAlpha(e),e.lineWidth=s,o&&e.setLineDash(o),a&&(e.lineDashOffset=a),r&&(e.lineCap=r),l&&(e.lineJoin=l),c!=null&&(e.miterLimit=c),this.executeStroke(e,t),e.globalAlpha=h}}executeStroke(e,t){t?e.stroke(t):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox??(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,t){return this.isPointInPath(e,t)}applySvgFillAttributes(e,t){const{fill:i,fillOpacity:s}=this;if(typeof i=="string")e.setAttribute("fill",i);else if(To(i)&&this.fillGradient){t??(t=[]);const n=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),o=jf();n.setAttribute("id",o),t.push(n),e.setAttribute("fill",`url(#${o})`)}else if(Yr(i)&&this.fillPattern){t??(t=[]);const n=this.fillPattern.toSvg(),o=jf();n.setAttribute("id",o),t.push(n),e.setAttribute("fill",`url(#${o})`)}else if(gc(i)&&this.fillImage){t??(t=[]);const n=this.layerManager?.canvas?.pixelRatio??1,o=this.fillImage.toSvg(this.getBBox(),n),a=jf();o.setAttribute("id",a),t.push(o),e.setAttribute("fill",`url(#${a})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(s)),t}applySvgStrokeAttributes(e){const{stroke:t,strokeOpacity:i,strokeWidth:s,lineDash:n,lineDashOffset:o}=this;xV(e,{stroke:ki(t)?t:void 0,strokeOpacity:i,strokeWidth:s}),bV(e,{lineDash:n,lineDashOffset:o})}};M([te()],gi.prototype,"fillOpacity",2),M([te()],gi.prototype,"strokeOpacity",2),M([mn({equals:Ci,changeCb:e=>e.onFillChange()})],gi.prototype,"fill",2),M([mn({equals:Ci,changeCb:e=>e.onStrokeChange()})],gi.prototype,"stroke",2),M([te()],gi.prototype,"strokeWidth",2),M([sS()],gi.prototype,"lineDash",2),M([te()],gi.prototype,"lineDashOffset",2),M([te()],gi.prototype,"lineCap",2),M([te()],gi.prototype,"lineJoin",2),M([te()],gi.prototype,"miterLimit",2),M([te({convertor:e=>ve(0,e??1,1)})],gi.prototype,"opacity",2),M([mn({equals:_h,checkDirtyOnAssignment:!0})],gi.prototype,"fillShadow",2),M([mn({equals:Wv,changeCb:e=>e.onFillChange()})],gi.prototype,"fillBBox",2),M([mn({equals:Ci,changeCb:e=>e.onFillChange()})],gi.prototype,"fillParams",2);var GC=[1,0,0,1,0,0],Za=class kv{get e(){return[...this.elements]}constructor(t=GC){this.elements=[...t]}setElements(t){const i=this.elements;return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],this}get identity(){const t=this.elements;return lt(t[0],1)&<(t[1],0)&<(t[2],0)&<(t[3],1)&<(t[4],0)&<(t[5],0)}AxB(t,i,s){const n=t[0]*i[0]+t[2]*i[1],o=t[1]*i[0]+t[3]*i[1],a=t[0]*i[2]+t[2]*i[3],r=t[1]*i[2]+t[3]*i[3],l=t[0]*i[4]+t[2]*i[5]+t[4],c=t[1]*i[4]+t[3]*i[5]+t[5];s=s??t,s[0]=n,s[1]=o,s[2]=a,s[3]=r,s[4]=l,s[5]=c}multiplySelf(t){return this.AxB(this.elements,t.elements),this}multiply(t){const i=new Array(6);return t instanceof kv?this.AxB(this.elements,t.elements,i):this.AxB(this.elements,[t.a,t.b,t.c,t.d,t.e,t.f],i),new kv(i)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],s=t[1],n=t[2],o=t[3];const a=t[4],r=t[5],l=1/(i*o-s*n);return i*=l,s*=l,n*=l,o*=l,new kv([o,-s,-n,i,n*r-o*a,s*a-i*r])}invertSelf(){const t=this.elements;let i=t[0],s=t[1],n=t[2],o=t[3];const a=t[4],r=t[5],l=1/(i*o-s*n);return i*=l,s*=l,n*=l,o*=l,t[0]=o,t[1]=-s,t[2]=-n,t[3]=i,t[4]=n*r-o*a,t[5]=s*a-i*r,this}transformPoint(t,i){const s=this.elements;return{x:t*s[0]+i*s[2]+s[4],y:t*s[1]+i*s[3]+s[5]}}transformBBox(t,i){const s=this.elements,n=s[0],o=s[1],a=s[2],r=s[3],l=t.width*.5,c=t.height*.5,h=t.x+l,d=t.y+c,u=Math.abs(l*n)+Math.abs(c*a),p=Math.abs(l*o)+Math.abs(c*r);return i??(i=new de(0,0,0,0)),i.x=h*n+d*a+s[4]-u,i.y=h*o+d*r+s[5]-p,i.width=u+u,i.height=p+p,i}toContext(t){if(this.identity)return;const i=this.elements;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(t,i,s,n,o,a,r){const l=i,c=s;let h,d;l===1&&c===1?(h=0,d=0):(h=r?.scalingCenterX??0,d=r?.scalingCenterY??0);const u=n,p=Math.cos(u),g=Math.sin(u);let f,x;u===0?(f=0,x=0):(f=r?.rotationCenterX??0,x=r?.rotationCenterY??0);const m=o,b=a,v=h*(1-l)-f,S=d*(1-c)-x;return t.setElements([p*l,g*l,-g*c,p*c,p*v-g*S+f+m,g*v+p*S+x+b]),t}};function Kr(e){return jC(e.constructor)}var VC=Symbol("isMatrixTransform");function jC(e){return e[VC]===!0}function uS(e){var t,i;const s=e;if(jC(e))return e;const n=Symbol("matrix_combined_transform");class o extends s{constructor(){super(...arguments),this[i]=new Za,this._dirtyTransform=!0}onChangeDetection(r){super.onChangeDetection(r),this._dirtyTransform=!0,!(this.batchLevel>0)&&this.markDirty("transform")}updateMatrix(r){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(GC),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(r){return this.computeTransformMatrix(),this[n].identity?r.clone():this[n].transformBBox(r)}toParentPoint(r,l){return this.computeTransformMatrix(),this[n].identity?{x:r,y:l}:this[n].transformPoint(r,l)}fromParent(r){return this.computeTransformMatrix(),this[n].identity?r.clone():this[n].inverse().transformBBox(r)}fromParentPoint(r,l){return this.computeTransformMatrix(),this[n].identity?{x:r,y:l}:this[n].inverse().transformPoint(r,l)}computeBBox(){const r=super.computeBBox();return r&&this.toParent(r)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(r,l){return{x:r,y:l}=this.fromParentPoint(r,l),super.pickNode(r,l)}pickNodes(r,l,c){return{x:r,y:l}=this.fromParentPoint(r,l),super.pickNodes(r,l,c)}render(r){this.computeTransformMatrix();const{ctx:l}=r,c=this[n];let h=!1;try{c.identity||(l.save(),h=!0,c.toContext(l)),super.render(r)}finally{h&&l.restore()}}toSVG(){this.computeTransformMatrix();const r=super.toSVG(),l=this[n];if(l.identity||r==null)return r;const c=ti("g");c.append(...r.elements);const[h,d,u,p,g,f]=l.e;return c.setAttribute("transform",`matrix(${h} ${d} ${u} ${p} ${g} ${f})`),{elements:[c],defs:r.defs}}}return t=VC,i=n,o[t]=!0,o}function Hh(e){var t;const i=e,s=Symbol("matrix_rotation");class n extends uS(i){constructor(){super(...arguments),this[t]=new Za,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(a){super.updateMatrix(a);const{rotation:r,rotationCenterX:l,rotationCenterY:c}=this;r!==0&&(Za.updateTransformMatrix(this[s],1,1,r,0,0,{rotationCenterX:l,rotationCenterY:c}),a.multiplySelf(this[s]))}}return t=s,M([te()],n.prototype,"rotationCenterX",2),M([te()],n.prototype,"rotationCenterY",2),M([te()],n.prototype,"rotation",2),n}function pS(e){var t;const i=e,s=Symbol("matrix_scale");class n extends uS(i){constructor(){super(...arguments),this[t]=new Za,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(a){super.updateMatrix(a);const{scalingX:r,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;r===1&&l===1||(Za.updateTransformMatrix(this[s],r,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),a.multiplySelf(this[s]))}}return t=s,M([te()],n.prototype,"scalingX",2),M([te()],n.prototype,"scalingY",2),M([te()],n.prototype,"scalingCenterX",2),M([te()],n.prototype,"scalingCenterY",2),n}function Wh(e){var t;const i=e,s=Symbol("matrix_translation");class n extends uS(i){constructor(){super(...arguments),this[t]=new Za,this.translationX=0,this.translationY=0}updateMatrix(a){super.updateMatrix(a);const{translationX:r,translationY:l}=this;r===0&&l===0||(Za.updateTransformMatrix(this[s],1,1,0,r,l),a.multiplySelf(this[s]))}}return t=s,M([te()],n.prototype,"translationX",2),M([te()],n.prototype,"translationY",2),n}var Gt=class{static fromCanvas(e,t){const i=[];for(const s of e.traverseUp())Kr(s)&&i.unshift(s);for(const s of i)t=s.fromParent(t);return Kr(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){t==null?t=e.getBBox():Kr(e)&&(t=e.toParent(t));for(const i of e.traverseUp())Kr(i)&&(t=i.toParent(t));return t}static fromCanvasPoint(e,t,i){const s=[];for(const n of e.traverseUp())Kr(n)&&s.unshift(n);for(const n of s)({x:t,y:i}=n.fromParentPoint(t,i));return Kr(e)&&({x:t,y:i}=e.fromParentPoint(t,i)),{x:t,y:i}}static toCanvasPoint(e,t,i){Kr(e)&&({x:t,y:i}=e.toParentPoint(t,i));for(const s of e.traverseUp())Kr(s)&&({x:t,y:i}=s.toParentPoint(t,i));return{x:t,y:i}}},qu,gS=class vf extends Ya{constructor(t){super(t),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,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=t?.renderToOffscreenCanvas===!0}static is(t){return t instanceof vf}static computeChildrenBBox(t,i=!0){return de.merge(Ya.extractBBoxes(t,i))}static compareChildren(t,i){return bC(t.zIndex,i.zIndex)||t.serialNumber-i.serialNumber}containsPoint(t,i){return!0}computeBBox(){return vf.computeChildrenBBox(this.children())}computeSafeClippingBBox(t){const i=this.computeBBox();if(i?.isFinite()!==!0)return;let s=0;const n=4;for(const u of this.descendants())u instanceof gi&&(s=Math.max(s,u.strokeWidth));const o=Math.max(1,s/2*n),{x:a,y:r}=Gt.toCanvasPoint(this,0,0),l=FC(t,a+i.x-o)-a,c=FC(t,r+i.y-o)-r,h=Math.ceil(i.x+i.width-l+o),d=Math.ceil(i.y+i.height-c+o);return new de(l,c,h,d)}prepareSharedCanvas(t,i,s){return qu==null||qu.pixelRatio!==s?qu=new Kv({width:t,height:i,pixelRatio:s}):qu.resize(t,i,s),qu}setScene(t){super.setScene(t),this.layer&&(this.scene?.layersManager.removeLayer(this.layer),this.layer=void 0);for(const i of this.children())i.setScene(t)}markDirty(t){this.dirty=!0,super.markDirty(t)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(t){for(const i of yG(t))i.parentNode?.removeChild(i),this.childNodes.add(i),i.parentNode=this,i.setScene(this.scene);this.markDirtyChildrenOrder(),this.markDirty()}appendChild(t){return this.append(t),t}removeChild(t){if(!this.childNodes?.delete(t))throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`);t.parentNode=void 0,t.setScene(),this.markDirtyChildrenOrder(),this.markDirty()}clear(){for(const t of this.children())delete t.parentNode,t.setScene();this.childNodes?.clear(),this.markDirty()}pickNode(t,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const s=[...this.children()];for(let n=s.length-1;n>=0;n--){const a=s[n].pickNode(t,i);if(a!=null)return a}}else if(!this.isContainerNode)return this}}pickNodes(t,i,s=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))return s;this.isContainerNode||s.push(this);for(const n of this.children())n.pickNodes(t,i,s);return s}isDirty(t){const{width:i,height:s,devicePixelRatio:n}=t,{dirty:o,layer:a}=this,r=a!=null&&(this._lastWidth!==i||this._lastHeight!==s),l=this._lastDevicePixelRatio!==n;return this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,o||r||l}preRender(t){let i;if(this.dirty){i=super.preRender(t,0);for(const s of this.children()){const n=s.preRender(t);i.groups+=n.groups,i.nonGroups+=n.nonGroups,i.complexity+=n.complexity}i.groups+=1,i.nonGroups-=1}else i=this.childNodeCounts;return this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&i.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this.layerManager?.addLayer({name:this.name})):this.layer!=null&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),i}render(t){const{layer:i,renderToOffscreenCanvas:s}=this,n={...t},o=this.isDirty(t);if(this.dirty=!1,!s){this.renderInContext(n),super.render(n);return}const{ctx:a,stats:r,devicePixelRatio:l}=t;let{image:c}=this;if(o){c?.bitmap.close(),c=void 0;const d=i?void 0:this.computeSafeClippingBBox(l),u=(p,...g)=>{const f=p.context;n.ctx=f,p.clear(),f.save();try{f.setTransform(...g),f.globalAlpha=1,this.renderInContext(n)}finally{f.restore(),f.verifyDepthZero?.()}};if(i)u(i,a.getTransform());else if(d){const{x:p,y:g,width:f,height:x}=d,m=this.prepareSharedCanvas(f,x,l);u(m,l,0,0,l,-p*l,-g*l),c={bitmap:m.transferToImageBitmap(),x:p,y:g,width:f,height:x}}this.image=c,r&&r.layersRendered++}else r&&r.layersSkipped++;const{globalAlpha:h}=a;if(a.globalAlpha=h*this.opacity,i){a.save();try{a.resetTransform(),i.drawImage(a)}finally{a.restore()}}else if(c){const{bitmap:d,x:u,y:p,width:g,height:f}=c;a.drawImage(d,0,0,g*l,f*l,u,p,g,f)}a.globalAlpha=h,super.render(n)}applyClip(t,i){const{x:s,y:n,width:o,height:a}=i;t.beginPath(),t.rect(s,n,o,a),t.clip()}renderInContext(t){const{ctx:i,stats:s}=t;this.dirtyZIndex&&(this.sortChildren(vf.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),t.clipBBox=Gt.toCanvas(this,this.clipRect));for(const n of this.children()){if(!n.visible){s&&(s.nodesSkipped+=n.childNodeCounts.nonGroups+n.childNodeCounts.groups,s.opsSkipped+=n.childNodeCounts.complexity);continue}n.isolatedRender(t)}}finally{i.restore()}}sortChildren(t){if(!this.childNodes)return;const i=[...this.childNodes].sort(t);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*children(){yield*this.childNodes}*excludeChildren(t){for(const i of this.children())(t.instance&&!(i instanceof t.instance)||t.name&&i.name!==t.name)&&(yield i)}*descendants(){for(const t of this.children())yield t,t instanceof vf&&(yield*t.descendants())}setClipRect(t){this.clipRect=t?Gt.fromCanvas(this,t):void 0}setClipRectCanvasSpace(t){this.clipRect=t}getVisibility(){for(const t of this.traverseUp(!0))if(!t.visible)return!1;return!0}toSVG(){if(!this.visible)return;const t=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&t.push(...n.defs))}return{elements:i,defs:t}}};gS.className="Group",M([te({convertor:e=>ve(0,e,1)})],gS.prototype,"opacity",2);var Re=gS,vV=class extends pS(Re){},SV=class extends Hh(Re){},As=class extends Wh(Re){},$h=class extends Hh(Wh(Re)){};function MV(e,t){return"context"in e}function HC(e,t){return e!=null&&MV(e,t)&&t[0]!=null&&typeof t[0]=="object"&&t[0].context===void 0?(t[0].context=e.context,!0):!1}function Lo(e,t,...i){if(Array.isArray(e)){for(const s of e)if(HC(s,i))break}else HC(e,i);return t(...i)}var WC=class{constructor(){this.cache=new WeakMap}call(e,t,...i){let s,n=this.cache.get(t);try{s=JSON.stringify(i)}catch{return this.invoke(e,t,n,void 0,...i)}return n==null&&(n=new Map,this.cache.set(t,n)),n.has(s)?n.get(s):this.invoke(e,t,n,s,...i)}invoke(e,t,i,s,...n){try{const o=Lo(e,t,...n);return i&&s!=null&&i.set(s,o),o}catch(o){X.warnOnce("User callback errored, ignoring",o);return}}invalidateCache(){this.cache=new WeakMap}};function iy(e,t){if(!e)return;const{x:i,y:s,width:n,height:o}=AV(t);ny(e.style,"width",n),ny(e.style,"height",o),ny(e.style,"left",i),ny(e.style,"top",s)}function $C(e){const t=parseFloat(e.style.width)||e.offsetWidth,i=parseFloat(e.style.height)||e.offsetHeight,s=parseFloat(e.style.left)||e.offsetLeft,n=parseFloat(e.style.top)||e.offsetTop;return{x:s,y:n,width:t,height:i}}function DV(e){if(e.focus({preventScroll:!0}),e.lastChild?.textContent==null)return;const t=oa().createRange();t.setStart(e.lastChild,e.lastChild.textContent.length),t.setEnd(e.lastChild,e.lastChild.textContent.length);const i=Ze().getSelection();i?.removeAllRanges(),i?.addRange(t)}function UC(){const e=Ze("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function sy(e){return`ag-charts-icon ag-charts-icon-${e}`}function AV(e){let{x:t,y:i,width:s,height:n}=e;return(s==null||s>0)&&(n==null||n>0)?e:(t!=null&&s!=null&&s<0&&(s=-s,t=t-s),i!=null&&n!=null&&n<0&&(n=-n,i=i-n),{x:t,y:i,width:s,height:n})}function ny(e,t,i){i==null?e.removeProperty(t):e.setProperty(t,`${i}px`)}var fS="class-instance";function Xa(e,t,i){if(Ue(t)){if(!Ue(e)||e.length!==t.length||t.some((s,n)=>Xa(e[n],s,i)!=null))return t}else if(Je(t)){if(!Je(e))return t;const s={},n=new Set([...Object.keys(e),...Object.keys(t)]);for(const o of n)if(e[o]!==t[o])if(i?.has(o))s[o]=t[o];else if(typeof e[o]==typeof t[o]){const a=Xa(e[o],t[o],i);a!==null&&(s[o]=a)}else s[o]=t[o];return Object.keys(s).length?s:null}else if(e!==t)return t;return null}function YC(e,t){for(const i of Object.keys(e))if(e[i]!==t?.[i])return!1;return!0}function Ot(e,t){return Ue(e)?IV(e,t):Je(e)?kV(e,t):e instanceof Map?new Map(Ot(Array.from(e))):yS(e)}function IV(e,t){const i=[],s=t?.seen;for(const n of e){if(typeof n=="object"&&s?.includes(n)){X.warn("cycle detected in array",n);continue}s?.push(n),i.push(Ot(n,t)),s?.pop()}return i}function kV(e,t){const i={};for(const s of Object.keys(e))t?.assign?.has(s)?i[s]=e[s]:t?.shallow?.has(s)?i[s]=yS(e[s]):i[s]=Ot(e[s],t);return i}function yS(e){return Ue(e)?e.slice(0):Je(e)?{...e}:aa(e)?new Date(e):q_(e)?new RegExp(e.source,e.flags):e}function Zr(e,t,i,s,n,o){if(Ue(e)){o=t(e,s,n,o);let a=0;for(const r of e)o=Zr(r,t,i,s?.[a],n,o),a++}else if(Je(e)){o=t(e,s,n,o);for(const a of Object.keys(e)){if(i?.has(a))continue;const r=e[a];o=Zr(r,t,i,s?.[a],n,o)}}return o}function Qu(e,t,i={}){const{path:s,matcherPath:n=s?.replace(/(\[[0-9+]+])/i,"[]"),skip:o=[]}=i;if(e==null)throw new Error(`AG Charts - target is uninitialised: ${s??"<root>"}`);if(t==null)return e;if(pc(e))return e.set(t);const a=e,r=mS(e);for(const l of Object.keys(t)){if(eS.has(l))continue;const c=`${n?n+".":""}${l}`;if(o.includes(c))continue;const h=t[l],d=`${s?s+".":""}${l}`,u=a.constructor,p=a[l];try{const g=mS(p),f=mS(h);if(r===fS&&!(l in e||l==="context")){if(h===void 0)continue;X.warn(`unable to set [${d}] in ${u?.name} - property is unknown`);continue}if(g!=null&&f!=null&&f!==g&&(g!==fS||f!=="object")){X.warn(`unable to set [${d}] in ${u?.name} - can't apply type of [${f}], allowed types are: [${g}]`);continue}if(pc(p))h===void 0?p.clear():p.set(h);else if(f==="object"&&l!=="context"){if(!(l in a)){X.warn(`unable to set [${d}] in ${u?.name} - property is unknown`);continue}p==null?a[l]=h:Qu(p,h,{...i,path:d,matcherPath:c})}else a[l]=h}catch(g){X.warn(`unable to set [${d}] in [${u?.name}]; nested error is: ${g.message}`)}}return e}function mS(e){return e==null?null:Q_(e)||aa(e)?"primitive":Ue(e)?"array":Fe(e)?Je(e)?"object":fS:$a(e)?"function":"primitive"}var CV=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(e){return new Promise(t=>{this.acquireQueue.push([e,t]),this.available&&this.dispatchNext().catch(i=>X.errorOnce(i))})}async acquireImmediately(e){return this.available?(await this.acquire(e),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[e,t]=this.acquireQueue.shift()??[];for(;e;){try{await e(),t?.()}catch(i){X.error("mutex callback error",i),t?.()}[e,t]=this.acquireQueue.shift()??[]}this.available=!0}},KC=class{constructor(){this.eventListeners=new Map}addEventListener(e,t){if(typeof t!="function")throw new Error("AG Charts - listener must be a Function");const i=this.eventListeners.get(e);i?i.add(t):this.eventListeners.set(e,new Set([t]))}removeEventListener(e,t){const i=this.eventListeners.get(e);i!=null&&(i.delete(t),i.size===0&&this.eventListeners.delete(e))}hasEventListener(e){return this.eventListeners.has(e)}clearEventListeners(){this.eventListeners.clear()}fireEvent(e){this.eventListeners.get(e.type)?.forEach(t=>t(e))}},fc=class extends we{constructor(e=0,t=e,i=e,s=t){super(),this.top=e,this.right=t,this.bottom=i,this.left=s}};M([I],fc.prototype,"top",2),M([I],fc.prototype,"right",2),M([I],fc.prototype,"bottom",2),M([I],fc.prototype,"left",2);function Gi(e,t){const i=Ue(e)?e:e.split(".");if(i.length===1){const[s]=i;return hc((n,o,a)=>n[s]=a,n=>n[s],t)}return hc((s,n,o)=>tS(s,i,o),s=>Jv(s,i),t)}function TV(e){return hc((t,i,s)=>t[e]=s)}function ni(e,t){return hc((i,s,n)=>i[e][t??s]=n)}function Is(e){const{newValue:t,oldValue:i,changeValue:s}=e;return hc((n,o,a,r)=>(a!==r&&(r!==void 0&&i?.call(n,r),a!==void 0&&t?.call(n,a),s?.call(n,a,r)),a))}function Xr(e){return uC(e)}function LV(e){return ZC((t,i)=>Ze().requestAnimationFrame(t),e)}function wV(e){return ZC((t,i=0)=>{i===0?queueMicrotask(t):setTimeout(t,i)},e)}function ZC(e,t){let i=0,s=!1,n,o;const a=()=>s,r=()=>{s=!1,o?.(),o=void 0,n=void 0,i>0&&e(l)},l=()=>{const c=i;i=0,s=!0;const h=t({count:c});if(!h){r();return}h.then(r,r)};return{schedule(c){i===0&&!a()&&e(l,c),i++},async await(){if(a())for(n??(n=new Promise(c=>{o=c}));a();)await n}}}var xS=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function Uh(e,t,i){const{offsetX:s,offsetY:n,clientX:o,clientY:a}=t,{currentX:r,currentY:l}=qa.calcCurrentXY(i,t);return{type:e,device:"mouse",offsetX:s,offsetY:n,clientX:o,clientY:a,currentX:r,currentY:l,sourceEvent:t}}function oy(e,t,i){return{type:e,sourceEvent:t}}var NV={blur:e=>({type:"blur",sourceEvent:e}),change:e=>({type:"change",sourceEvent:e}),contextmenu:(e,t)=>Uh("contextmenu",e,t),focus:e=>({type:"focus",sourceEvent:e}),keydown:e=>({type:"keydown",sourceEvent:e}),keyup:e=>({type:"keyup",sourceEvent:e}),click:(e,t)=>Uh("click",e,t),dblclick:(e,t)=>Uh("dblclick",e,t),mouseenter:(e,t)=>Uh("mouseenter",e,t),mousemove:(e,t)=>Uh("mousemove",e,t),mouseleave:(e,t)=>Uh("mouseleave",e,t),wheel:e=>{const{offsetX:t,offsetY:i,clientX:s,clientY:n}=e,o=e.deltaMode===0?.01:1,a=e.deltaX*o,r=e.deltaY*o;return{type:"wheel",offsetX:t,offsetY:i,clientX:s,clientY:n,deltaX:a,deltaY:r,sourceEvent:e}},touchstart:(e,t)=>oy("touchstart",e,t),touchmove:(e,t)=>oy("touchmove",e,t),touchend:(e,t)=>oy("touchend",e,t),touchcancel:(e,t)=>oy("touchcancel",e,t)},qa=class{static alloc(e,t,i){return NV[e](t,i)}static isHTMLEvent(e){return xS.includes(e)}static calcCurrentXY(e,t){const i=e.getBoundingClientRect();return{currentX:t.clientX-i.x,currentY:t.clientY-i.y}}},EV=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(e,t){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[e]=t}lazyGetWidgetListeners(e,t){var i;if(!(e in(this.sourceListeners??{}))){const s=o=>{const a=qa.alloc(e,o,t.getElement());this.dispatch(e,t,a)},n={};e.startsWith("touch")&&(n.passive=!1),this.initSourceHandler(e,s),t.getElement().addEventListener(e,s,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[e]??(i[e]=[]),this.widgetListeners[e]}add(e,t,i){this.lazyGetWidgetListeners(e,t).push(i)}remove(e,t,i){const s=this.lazyGetWidgetListeners(e,t),n=s.indexOf(i);n>-1&&s.splice(n,1)}destroy(e){if(this.widgetListeners=void 0,this.sourceListeners){for(const[t,i]of Et(this.sourceListeners))e.getElement().removeEventListener(t,i);this.sourceListeners=void 0}}dispatch(e,t,i){for(const s of this.widgetListeners?.[e]??[])s(i,t)}},OV=class{constructor(e,t,i,s){this.glob=e,this.self=t,this.window=Ze(),this.cleanup=new mt,this.mousegeneral=l=>{l.stopPropagation(),l.stopImmediatePropagation()},this.mousemove=l=>{l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(l)},this.mouseup=l=>{l.button===0&&(l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(l),this.destroy())};const{window:n,mousegeneral:o,mousemove:a,mouseup:r}=this;this.cleanup.register(ot(n,"mousedown",o,{capture:!0}),ot(n,"mouseenter",o,{capture:!0}),ot(n,"mouseleave",o,{capture:!0}),ot(n,"mouseout",o,{capture:!0}),ot(n,"mouseover",o,{capture:!0}),ot(n,"mousemove",a,{capture:!0}),ot(n,"mouseup",r,{capture:!0})),t.mouseDragger=this,e.globalMouseDragCallbacks=i,e.globalMouseDragCallbacks.mousedown(s),s.stopPropagation(),s.stopImmediatePropagation()}destroy(){this.cleanup.flush(),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function PV(e,t,i,s){if(e.globalMouseDragCallbacks==null)return new OV(e,t,i,s)}var RV=500,BV=100;function FV(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return i*i+s*s}var bS=!1,zV=class{constructor(e,t,i,s,n){this.glob=e,this.self=t,this.initialTouch=s,this.target=n,this.cleanup=new mt,this.longTapInterrupted=!1,this.longtap=()=>{const{target:r,initialTouch:l}=this;if(!this.longTapInterrupted){const c=new mt;r.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),bS=!0;const h=f=>f.preventDefault(),d=f=>{bS=!1,f.preventDefault(),c.flush()};c.register(ot(r,"touchmove",h,{passive:!1}),ot(r,"touchend",d,{passive:!1}),ot(r,"touchcancel",d,{passive:!1}));const{clientX:u,clientY:p}=l,g=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:Ze(),clientX:u,clientY:p,pointerType:"touch"});r.dispatchEvent(g)}},this.touchmove=r=>{const{glob:l,self:c,initialTouch:h}=this,d=this.findInitialFinger(r.targetTouches);d!=null&&(this.longTapInterrupted=this.longTapInterrupted||FV(h,d)>BV,c.dragTouchEnabled&&l.globalTouchDragCallbacks?.touchmove(r,d))},this.touchend=r=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(r.changedTouches,r.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(r,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,RV);const{touchmove:o,touchend:a}=this;this.cleanup.register(ot(n,"touchmove",o,{passive:!1}),ot(n,"touchstart",a,{passive:!1}),ot(n,"touchend",a,{passive:!1}),ot(n,"touchcancel",a,{passive:!1})),t.touchDragger=this,e.globalTouchDragCallbacks=i}destroy(){clearTimeout(this.longtapTimer),this.cleanup.flush(),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...e){const t=e.map(i=>Array.from(i)).flat();return Array.from(t).find(i=>i.identifier===this.initialTouch.identifier)}};function _V(e,t,i,s,n){if(!(e.globalTouchDragCallbacks!=null||bS))return new zV(e,t,i,s,n)}function vS(e,t,i,s){const{currentX:n,currentY:o}=qa.calcCurrentXY(e.getElement(),s),a=s.pageX-i.pageX,r=s.pageY-i.pageY;return{type:t,device:"mouse",offsetX:i.offsetX+a,offsetY:i.offsetY+r,clientX:s.clientX,clientY:s.clientY,currentX:n,currentY:o,originDeltaX:a,originDeltaY:r,sourceEvent:s}}function GV(e,{pageX:t,pageY:i}){const{x:s,y:n}=e.getElement().getBoundingClientRect();return{offsetX:t-s,offsetY:i-n}}function SS(e,t,i,s,n){const{currentX:o,currentY:a}=qa.calcCurrentXY(e.getElement(),n),r=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:t,device:"touch",offsetX:i.offsetX+r,offsetY:i.offsetY+l,clientX:n.clientX,clientY:n.clientY,currentX:o,currentY:a,originDeltaX:r,originDeltaY:l,sourceEvent:s}}var XC={},qC=class{constructor(e){this.dispatchCallback=e,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(e){this.listeners??(this.listeners=new Map);let t=this.listeners.get(e);return t===void 0&&(t=new Set,this.listeners.set(e,t)),t}add(e,t,i){switch(this.getListenerSet(e).add(i),e){case"drag-start":case"drag-move":case"drag-end":{this.registerDragTrigger(t);break}}}remove(e,t,i){this.getListenerSet(e).delete(i)}registerDragTrigger(e){if(this.dragTriggerRemover==null){const t=e.getElement(),i=new mt;i.register(ot(t,"mousedown",s=>this.triggerMouseDrag(e,s)),ot(t,"touchstart",s=>this.triggerTouchDrag(e,s),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(e,t){t.button===0&&this.startMouseDrag(e,t)}startMouseDrag(e,t){const i={pageX:NaN,pageY:NaN,offsetX:NaN,offsetY:NaN};iS(["pageX","pageY","offsetX","offsetY"],i,t);const s={mousedown:n=>{const o=vS(e,"drag-start",i,n);this.dispatch("drag-start",e,o)},mousemove:n=>{const o=vS(e,"drag-move",i,n);this.dispatch("drag-move",e,o)},mouseup:n=>{const o=vS(e,"drag-end",i,n);this.dispatch("drag-end",e,o),this.endDrag(e,o)}};this.mouseDragger=PV(XC,this,s,t)}endDrag(e,{sourceEvent:t,clientX:i,clientY:s}){const n=e.getElement(),o=n.getBoundingClientRect();Hv(o,i,s)||(n.dispatchEvent(new MouseEvent("mouseleave",t)),t.target?.dispatchEvent(new MouseEvent("mouseenter",t)))}triggerTouchDrag(e,t){const i=t.targetTouches[0];t.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(e,t,i)}startOneFingerTouch(e,t,i){const s={pageX:NaN,pageY:NaN,...GV(e,i)};iS(["pageX","pageY"],s,i);const n={touchmove:(r,l)=>{const c=SS(e,"drag-move",s,r,l);this.dispatch("drag-move",e,c)},touchend:(r,l)=>{const c=SS(e,"drag-end",s,r,l);this.dispatch("drag-end",e,c)}},o=e.getElement();this.touchDragger=_V(XC,this,n,i,o);const a=SS(e,"drag-start",s,t,i);this.dispatch("drag-start",e,a)}dispatch(e,t,i){for(const s of this.getListenerSet(e))s(i,t);this.dispatchCallback(e,i)}},VV=class{constructor(e){this.elem=e}setBounds(e){iy(this.elemContainer??this.elem,e)}getBounds(){return $C(this.elemContainer??this.elem)}static setElementContainer(e,t){const i=e.getBounds();iy(t,i),bG(e.elem,{width:"100%",height:"100%"}),e.elem.remove(),e.elemContainer=t,e.elemContainer.replaceChildren(e.elem)}},ua=class extends VV{constructor(){super(...arguments),this.index=NaN,this.children=[]}set id(e){Ge(this.elem,"id",e)}get id(){return Bh(this.elem,"id")}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.destroyListener?.(),this.destroyListener=void 0,this.parent?.removeChild(this),this.children.forEach(e=>{e.parent=void 0,e.destroy()}),this.children.length=0,this.destructor(),this.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove()}setHidden(e){ha(this.elem,"display",e?"none":void 0)}isHidden(){return Ze()?.getComputedStyle?.(this.elem).display==="none"}setCursor(e){ha(this.elem,"cursor",e)}setTextContent(e){this.elem.textContent=e??null}setAriaDescribedBy(e){Ge(this.elem,"aria-describedby",e)}setAriaHidden(e){Ge(this.elem,"aria-hidden",e)}setAriaLabel(e){Ge(this.elem,"aria-label",e)}setAriaExpanded(e){Ge(this.elem,"aria-expanded",e)}setAriaControls(e){Ge(this.elem,"aria-controls",e)}setAriaHasPopup(e){Ge(this.elem,"aria-haspopup",e)}setInnerHTML(e){this.elem.innerHTML=e}setPointerEvents(e){ha(this.elem,"pointer-events",e)}isDisabled(){return Bh(this.elem,"aria-disabled",!1)}hasPopup(){const e=Bh(this.elem,"aria-haspopup");return e!==void 0&&e!=="false"}parseFloat(e){return e===""?0:parseFloat(e)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(e){this.elem.focus(e)}setFocusOverride(e){Ge(this.elem,"data-focus-override",e)}setPreventsDefault(e){Ge(this.elem,"data-preventdefault",e)}setTabIndex(e){Ge(this.elem,"tabindex",e)}addChild(e){this.addChildToDOM(e,this.getBefore(e)),this.children.push(e),e.index=this.children.length-1,e.parent=this,this.onChildAdded(e)}removeChild(e){const t=this.children.findIndex(i=>i===e);this.children.splice(t,1),this.removeChildFromDOM(e),this.onChildRemoved(e)}moveChild(e,t){e.domIndex!==t&&(e.domIndex=t,this.removeChildFromDOM(e),this.addChildToDOM(e,this.getBefore(e)))}addClass(...e){this.elem.classList.add(...e)}removeClass(...e){this.elem.classList.remove(...e)}toggleClass(e,t){this.elem.classList.toggle(e,t)}appendOrInsert(e,t){t?t.getElement().insertAdjacentElement("beforebegin",e):this.elem.appendChild(e)}addChildToDOM(e,t){this.appendOrInsert(e.getElement(),t)}removeChildFromDOM(e){this.elem.removeChild(e.getElement())}onChildAdded(e){}onChildRemoved(e){}getBefore({domIndex:e}){if(e!==void 0)return this.children.filter(t=>t.domIndex!==void 0&&t.domIndex>e).reduce((t,i)=>!t||i.domIndex<t.domIndex?i:t,void 0)}addListener(e,t){return qa.isHTMLEvent(e)?(this.htmlListener??(this.htmlListener=new EV),this.htmlListener.add(e,this,t)):(this.internalListener??(this.internalListener=new qC(this.onDispatch.bind(this))),this.internalListener.add(e,this,t)),()=>this.removeListener(e,t)}removeListener(e,t){qa.isHTMLEvent(e)?this.htmlListener?.remove(e,this,t):this.htmlListener!=null&&this.internalListener?.remove(e,this,t)}setDragTouchEnabled(e){this.internalListener??(this.internalListener=new qC(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=e}onDispatch(e,t){if(!t.sourceEvent?.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:s}=i;if(s!=null){const n={...t,...qa.calcCurrentXY(i.getElement(),t)};s.dispatch(e,i,n)}i=i.parent}}static addWindowEvent(e,t){const i=s=>{s.persisted||t()};return ot(Ze(),"pagehide",i)}};function jV(e=0,t=0){return new OffscreenCanvas(e,t).getContext("2d")}var MS=class{constructor(e=5){this.maxCacheSize=e,this.store=new Map}get(e){if(!this.store.has(e))return;const t=this.store.get(e);return this.store.delete(e),this.store.set(e,t),t}has(e){return this.store.has(e)}set(e,t){if(this.store.set(e,t),this.store.size>this.maxCacheSize){const i=this.store.keys();let s=this.store.size-this.maxCacheSize;for(;s>0;){const n=i.next();n.done||this.store.delete(n.value),s--}}return t}clear(){this.store.clear()}},qr=class{static measureText(e,t){return this.getMeasurer(t).measureText(e)}static measureLines(e,t){return this.getMeasurer(t).measureLines(e)}static getMeasurer(e){const t=ut.toFontString(e.font),i=`${t}-${e.textAlign??"start"}-${e.textBaseline??"top"}`;return this.instanceMap.get(i)??this.createFontMeasurer(t,e,i)}static clear(){this.instanceMap.clear()}static createFontMeasurer(e,t,i){const s=jV();s.font=e,s.textAlign=t.textAlign??"start",s.textBaseline=t.textBaseline??"top";const n=new QC(s,t);return this.instanceMap.set(i,n),n}};qr.instanceMap=new MS(10);var QC=class{constructor(e,t){this.ctx=e,this.measureMap=new MS(100),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline),e.font=ut.toFontString(t.font),this.textMeasurer=new DS(i=>this.cachedCtxMeasureText(i),t.textBaseline??"alphabetic")}textWidth(e,t){return this.textMeasurer.textWidth(e,t)}measureText(e){return this.textMeasurer.measureText(e)}measureLines(e){return this.textMeasurer.measureLines(e)}cachedCtxMeasureText(e){if(!this.measureMap.has(e)){const t=this.ctx.measureText(e);this.measureMap.set(e,{actualBoundingBoxAscent:t.actualBoundingBoxAscent,emHeightAscent:t.emHeightAscent,emHeightDescent:t.emHeightDescent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,actualBoundingBoxLeft:t.actualBoundingBoxLeft,actualBoundingBoxRight:t.actualBoundingBoxRight,alphabeticBaseline:t.alphabeticBaseline,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent,hangingBaseline:t.hangingBaseline,ideographicBaseline:t.ideographicBaseline,width:t.width})}return this.measureMap.get(e)}},ut=class{static toFontString({fontSize:e=10,fontStyle:t,fontWeight:i,fontFamily:s}){let n="";return t&&t!=="normal"&&(n+=`${t} `),i&&i!=="normal"&&i!==400&&(n+=`${i} `),n+=`${e}px`,n+=` ${s}`,n.trim()}static getLineHeight(e){return Math.ceil(e*this.defaultLineHeight)}static getHorizontalModifier(e){switch(e){case"left":case"start":return 0;case"center":return .5;case"right":case"end":return 1;default:return 0}}static getVerticalModifier(e){switch(e){case"hanging":case"top":return 0;case"middle":return .5;case"alphabetic":case"bottom":case"ideographic":default:return 1}}};ut.EllipsisChar="\u2026",ut.defaultLineHeight=1.15,ut.lineSplitter=/\r?\n/g;var DS=class{constructor(e,t="alphabetic"){this.measureTextFn=e,this.textBaseline=t,this.charMap=new Map}getMetrics(e){const t=this.measureTextFn(e);return t.fontBoundingBoxAscent??(t.fontBoundingBoxAscent=t.emHeightAscent),t.fontBoundingBoxDescent??(t.fontBoundingBoxDescent=t.emHeightDescent),{width:t.width,height:t.actualBoundingBoxAscent+t.actualBoundingBoxDescent,lineHeight:t.fontBoundingBoxAscent+t.fontBoundingBoxDescent}}getMultilineMetrics(e){let t=0,i=0,s=0,n=0,o=0,a=0;const r=ut.getVerticalModifier(this.textBaseline),l=[];let c=0;const h=e.length;for(const d of e){const u=this.measureTextFn(d);u.fontBoundingBoxAscent??(u.fontBoundingBoxAscent=u.emHeightAscent),u.fontBoundingBoxDescent??(u.fontBoundingBoxDescent=u.emHeightDescent),t<u.width&&(t=u.width),n<u.actualBoundingBoxLeft&&(n=u.actualBoundingBoxLeft),c===0?(i+=u.actualBoundingBoxAscent,s+=u.actualBoundingBoxAscent,a=u.alphabeticBaseline):o+=u.fontBoundingBoxAscent,c===h-1?i+=u.actualBoundingBoxDescent:o+=u.fontBoundingBoxDescent,l.push({text:d,width:u.width,height:u.actualBoundingBoxAscent+u.actualBoundingBoxDescent,lineHeight:u.fontBoundingBoxAscent+u.fontBoundingBoxDescent,offsetTop:u.actualBoundingBoxAscent,offsetLeft:u.actualBoundingBoxLeft}),c++}return i+=o,s+=o*r,{width:t,height:i,offsetTop:s,offsetLeft:n,alphabeticBaseline:a,lineMetrics:l}}textWidth(e,t){if(t){let i=0;for(let s=0;s<e.length;s++)i+=this.textWidth(e.charAt(s));return i}return e.length>1?this.measureTextFn(e).width:this.charMap.get(e)??this.charWidth(e)}measureText(e){return this.getMetrics(e)}measureLines(e){const t=typeof e=="string"?e.split(ut.lineSplitter):e;return this.getMultilineMetrics(t)}charWidth(e){const{width:t}=this.measureTextFn(e);return this.charMap.set(e,t),t}};function HV(e){for(const t of["B","KB","MB","GB"]){if(e<1536)return`${e.toFixed(1)}${t}`;e/=1024}return`${e.toFixed(1)}TB}`}function WV(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[t,e,i])typeof n=="number"&&s.push(HV(n));return`Heap ${s.join(" / ")}`}function JC(e,t,i,s,n={},o=de.zero){if(!Be.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:a=0,layersSkipped:r=0,nodesRendered:l=0,nodesSkipped:c=0,opsPerformed:h=0,opsSkipped:d=0}=s??{},u=performance.now(),{start:p,...g}=t,f=Object.entries(g).map(([L,N])=>tT(L,N)).filter(L=>L!=null).join(" + "),x=Object.entries(n).map(([L,N])=>`${L}: ${JSON.stringify(N)}`).join(" ; "),m=Be.check("scene:stats:verbose"),b=WV(),v=[`${tT("\u23F1\uFE0F",p,u)} (${f})`,`${x}`,`Layers: ${m?AS(a,r):e.size}`,m?`Nodes: ${AS(l,c)}`:null,m?`Ops: ${AS(h,d)}`:null,m&&b?b:null].filter(ki),S=new DS(L=>i.measureText(L)),D=new Map(v.map(L=>[L,S.measureLines(L)])),C=Math.max(...Array.from(D.values(),L=>L.width)),T=XV(D.values(),L=>L.height),k=2+o.x;i.save();try{i.fillStyle="white",i.fillRect(k,0,C,T),i.fillStyle="black";let L=0;for(const[N,w]of D.entries())L+=w.height,i.fillText(N,k,L)}catch(L){X.warnOnce("Error during debug stats rendering",L)}finally{i.restore()}}function $V(e){const t=Gf(Ze("agChartsSceneDebug")),i=[];for(const s of t)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);e.debugNodeSearch=i}function UV(e,t){e.save();try{for(const[i,s]of Object.entries(t)){const n=Gt.toCanvas(s);if(!n){X.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(n.x,n.y,n.width,n.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,n.x,n.y,n.width),e.fillText(i,n.x,n.y,n.width)}}catch(i){X.warnOnce("Error during debug rendering",i)}finally{e.restore()}}var YV=new Set,KV=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function ZV(e){const{...t}=e;for(const i of Object.keys(t))KV.has(i)||typeof t[i]!="number"&&typeof t[i]!="string"&&typeof t[i]!="boolean"&&(YV.add(i),delete t[i]);return t}function ay(e,t){if(!Be.check(!0,"scene"))return{};let i=0;return{node:t==="json"?ZV(e):e,name:e.name??e.id,dirty:e instanceof Re?e.dirty:void 0,...Array.from(e instanceof Re?e.children():[],s=>ay(s,t)).reduce((s,n)=>{let{name:o}=n;const{node:{visible:a,opacity:r,zIndex:l,translationX:c,translationY:h,rotation:d,scalingX:u,scalingY:p},node:g}=n;(!a||r<=0)&&(o=`(${o})`),Re.is(g)&&g.renderToOffscreenCanvas&&(o=`*${o}*`);const f=Array.isArray(l)?`(${l.join(", ")})`:l,x=[`${(i++).toString().padStart(3,"0")}|`,`${o??"<unknown>"}`,`z: ${f}`,c&&`x: ${c}`,h&&`y: ${h}`,d&&`r: ${d}`,u!=null&&u!==1&&`sx: ${u}`,p!=null&&p!==1&&`sy: ${p}`].filter(v=>!!v).join(" ");let m=x,b=1;for(;s[m]!=null&&b<100;)m=`${x} (${b++})`;return s[m]=n,s},{})}}function eT(e){const t=e instanceof Re?e.dirty:void 0;if(!t)return{dirtyTree:{},paths:[]};const i=Array.from(e instanceof Re?e.children():[],o=>eT(o)).filter(o=>o.paths.length>0),s=Re.is(e)?e.name??e.id:e.id,n=i.length?i.flatMap(o=>o.paths).map(o=>`${s}.${o}`):[s];return{dirtyTree:{name:s,node:e,dirty:t,...i.map(o=>o.dirtyTree).filter(o=>o.dirty!=null).reduce((o,a)=>(o[a.name??"<unknown>"]=a,o),{})},paths:n}}function AS(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function tT(e,t,i){const s=i!=null?i-t:t;return`${e}: ${Math.round(s*100)/100}ms`}function XV(e,t){let i=0;for(const s of e)i+=t(s);return i}var Ju=(e,{x0:t,y0:i,x1:s,y1:n,cx:o,cy:a},r,l)=>{if(l&&e.moveTo(t,i),t!==s||i!==n){const c=Math.atan2(i-a,t-o),h=Math.atan2(n-a,s-o);e.arc(o,a,r,c,h)}else e.lineTo(t,i)},ks=class extends gi{constructor(){super(...arguments),this.path=new jh,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}resetPathDirty(){this.path.clear(!0),this._dirtyPath=!1}isPathDirty(){return this.path.isDirty()}onChangeDetection(e){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(e))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}distanceSquared(e,t){return this.distanceSquaredTransformedPoint(e,t)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)?0:this.path.distanceSquared(e,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.path.commands.length)}render(e){const{ctx:t}=e;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){t.save();try{const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new jh),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t)}finally{t.restore()}}else this._clipPath=void 0,this.drawPath(t);this.fillShadow?.markClean(),super.render(e)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=ti("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};ks.className="Path",M([te()],ks.prototype,"clip",2),M([te()],ks.prototype,"clipX",1),M([te()],ks.prototype,"clipY",1);var iT=1e-6,ry=(e,t,i,s,n)=>{let o=!1,a=!1,r=s-Math.sqrt(Math.max(n**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(n**2-s**2,0));return r>e?(o=!0,r=e,l=i-Math.sqrt(Math.max(n**2-(s-e)**2))):r<iT&&(r=0),h>t?(a=!0,c=s-Math.sqrt(Math.max(n**2-(i-t)**2)),h=t):h<iT&&(h=0),{leading0:r,leading1:l,trailing0:c,trailing1:h,leadingClipped:o,trailingClipped:a}},ly=(e,t,i,s,n,o,a)=>{let{topLeft:r,topRight:l,bottomRight:c,bottomLeft:h}=o;const d=Math.max(r+h,l+c),u=Math.max(r+l,h+c);if(d<=0&&u<=0){a==null?e.rect(t,i,s,n):e.rect(a.x,a.y,a.width,a.height);return}else if(a==null&&r===l&&r===c&&r===h){e.roundRect(t,i,s,n,r);return}if(s<0&&(t+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(a==null)a=new de(t,i,s,n);else{const T=Math.max(t,a.x),k=Math.min(t+s,a.x+a.width),L=Math.max(i,a.y),N=Math.min(i+n,a.y+a.height);a=new de(T,L,k-T,N-L)}const p=Math.max(d/n,u/s,1);p>1&&(r/=p,l/=p,c/=p,h/=p);let g=!0,f=!0,x=!0,m=!0,b,v,S,D;if(g){const T=ry(a.height,a.width,Math.max(t+r-a.x,0),Math.max(i+r-a.y,0),r);T.leadingClipped&&(m=!1),T.trailingClipped&&(f=!1);const k=Math.max(a.x+T.leading1,a.x),L=Math.max(a.y+T.leading0,a.y),N=Math.max(a.x+T.trailing1,a.x),w=Math.max(a.y+T.trailing0,a.y),O=t+r,R=i+r;b={x0:k,y0:L,x1:N,y1:w,cx:O,cy:R}}if(f){const T=ry(a.width,a.height,Math.max(i+l-a.y,0),Math.max(a.x+a.width-(t+s-l),0),l);T.leadingClipped&&(g=!1),T.trailingClipped&&(x=!1);const k=Math.min(a.x+a.width-T.leading0,a.x+a.width),L=Math.max(a.y+T.leading1,a.y),N=Math.min(a.x+a.width-T.trailing0,a.x+a.width),w=Math.max(a.y+T.trailing1,a.y),O=t+s-l,R=i+l;v={x0:k,y0:L,x1:N,y1:w,cx:O,cy:R}}if(x){const T=ry(a.height,a.width,Math.max(a.x+a.width-(t+s-c),0),Math.max(a.y+a.height-(i+n-c),0),c);T.leadingClipped&&(f=!1),T.trailingClipped&&(m=!1);const k=Math.min(a.x+a.width-T.leading1,a.x+a.width),L=Math.min(a.y+a.height-T.leading0,a.y+a.height),N=Math.min(a.x+a.width-T.trailing1,a.x+a.width),w=Math.min(a.y+a.height-T.trailing0,a.y+a.height),O=t+s-c,R=i+n-c;S={x0:k,y0:L,x1:N,y1:w,cx:O,cy:R}}if(m){const T=ry(a.width,a.height,Math.max(a.y+a.height-(i+n-h),0),Math.max(t+h-a.x,0),h);T.leadingClipped&&(x=!1),T.trailingClipped&&(g=!1);const k=Math.max(a.x+T.leading0,a.x),L=Math.min(a.y+a.height-T.leading1,a.y+a.height),N=Math.max(a.x+T.trailing0,a.x),w=Math.min(a.y+a.height-T.trailing1,a.y+a.height),O=t+h,R=i+n-h;D={x0:k,y0:L,x1:N,y1:w,cx:O,cy:R}}let C=!1;g&&b!=null&&(Ju(e,b,r,!C),C||(C=!0)),f&&v!=null&&(Ju(e,v,l,!C),C||(C=!0)),x&&S!=null&&(Ju(e,S,c,!C),C||(C=!0)),m&&D!=null&&Ju(e,D,h,!C),e.closePath()},Ti=class extends ks{constructor(){super(...arguments),this.borderPath=new jh,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=this.strokeWidth,this.effectiveStrokeWidth=this.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:t,crisp:i,topLeftCornerRadius:s,topRightCornerRadius:n,bottomRightCornerRadius:o,bottomLeftCornerRadius:a}=this;let{x:r,y:l,width:c,height:h,strokeWidth:d,clipBBox:u}=this;const g=1/(this.layerManager?.canvas.pixelRatio??1);let f=1;if(e.clear(!0),t.clear(!0),c===0||h===0){this.effectiveStrokeWidth=0,this.lastUpdatePathStrokeWidth=0,this.microPixelEffectOpacity=0;return}if(i&&(c<=g&&(f*=c/g),h<=g&&(f*=h/g),c=this.align(r,c),h=this.align(l,h),r=this.align(r),l=this.align(l),u=u!=null?new de(this.align(u.x),this.align(u.y),this.align(u.x,u.width),this.align(u.y,u.height)):void 0),d)if(c<g){const x=r+g/2;t.moveTo(x,l),t.lineTo(x,l+h),d=g,this.borderClipPath=void 0}else if(h<g){const x=l+g/2;t.moveTo(r,x),t.lineTo(r+c,x),d=g,this.borderClipPath=void 0}else if(d<c&&d<h){const x=d/2;r+=x,l+=x,c-=d,h-=d;const m=u?.clone().shrink(x),b={topLeft:s>0?s-d:0,topRight:n>0?n-d:0,bottomRight:o>0?o-d:0,bottomLeft:a>0?a-d:0};this.borderClipPath=void 0,c>0&&h>0&&(m==null||m?.width>0&&m?.height>0)&&(ly(e,r,l,c,h,b,m),ly(t,r,l,c,h,b,m))}else this.borderClipPath=this.borderClipPath??new jh,this.borderClipPath.clear(!0),this.borderClipPath.rect(r,l,c,h),t.rect(r,l,c,h);else{const x={topLeft:s,topRight:n,bottomRight:o,bottomLeft:a};this.borderClipPath=void 0,ly(e,r,l,c,h,x,u)}if([s,n,o,a].every(x=>x===0)){const x=this.getBBox();this.hittester=x.containsPoint.bind(x),this.distanceSquared=(m,b)=>this.getBBox().distanceSquared(m,b)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=d,this.lastUpdatePathStrokeWidth=d,this.microPixelEffectOpacity=f}computeBBox(){const{x:e,y:t,width:i,height:s,clipBBox:n}=this;return n?.clone()??new de(e,t,i,s)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAndAlpha(e){super.applyFillAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(e){super.applyStrokeAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}renderStroke(e){const{stroke:t,effectiveStrokeWidth:i}=this;if(t&&i){const{globalAlpha:s}=e,{lineDash:n,lineDashOffset:o,lineCap:a,lineJoin:r,borderPath:l,borderClipPath:c}=this;c&&e.clip(c.getPath2D()),this.applyStrokeAndAlpha(e),e.lineWidth=i,n&&e.setLineDash(n),o&&(e.lineDashOffset=o),a&&(e.lineCap=a),r&&(e.lineJoin=r),e.stroke(l.getPath2D()),e.globalAlpha=s}}};Ti.className="Rect",M([te()],Ti.prototype,"x",2),M([te()],Ti.prototype,"y",2),M([te()],Ti.prototype,"width",2),M([te()],Ti.prototype,"height",2),M([te()],Ti.prototype,"topLeftCornerRadius",2),M([te()],Ti.prototype,"topRightCornerRadius",2),M([te()],Ti.prototype,"bottomRightCornerRadius",2),M([te()],Ti.prototype,"bottomLeftCornerRadius",2),M([mn({equals:Wv})],Ti.prototype,"clipBBox",2),M([te()],Ti.prototype,"crisp",2);var IS=!1,qs=class Eu extends gi{constructor(t){super(t),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=Eu.defaultFontSize,this.fontFamily="sans-serif",this.textAlign="start",this.textBaseline="alphabetic",this.boxPadding=0,this.trimText=t?.trimText??!0}onTextChange(){if(this.richText?.clear(),this.textMap?.clear(),Ue(this.text))this.lines=[],this.richText??(this.richText=new Re),this.richText.setScene(this.scene),this.richText.append(this.text.map(()=>new Eu({trimText:!1})));else{const t=this.text?.split(`
`)??[];this.lines=this.trimText?t.map(i=>i.trim()):t}}static computeBBox(t,i,s,n,o=!0){const{font:a,font:{fontSize:r},textAlign:l,textBaseline:c,lineHeight:h=o?ut.getLineHeight(r):void 0}=n,{width:d,alphabeticBaseline:u,offsetLeft:p,offsetTop:g,height:f}=qr.measureLines(t,o?{font:a,lineHeight:h,textAlign:"start",textBaseline:"top"}:n),x=h==null?f:h*t.length;let m;h==null?m=g:c==="alphabetic"?m=(h-r)/2-u:m=ut.getVerticalModifier(c)*x;const b=o?d*ut.getHorizontalModifier(l):p;return new de(i-b,s-m,d,x)}computeBBox(t=IS){if(this.generateTextMap(),this.textMap?.size){const c=de.merge(this.textMap.values());return c.x=this.x,c.y=this.y,c}const{x:i,y:s,lines:n,textBaseline:o,textAlign:a,lineHeight:r}=this,l=Eu.computeBBox(n,i,s,{font:this,textBaseline:o,textAlign:a,lineHeight:r},t);return this.boxing!=null&&l.grow(this.boxPadding),l}getBBox(t=!0){if(t){IS=!0;const i=this.computeBBox(!0);return IS=!1,i}return super.getBBox()}getPlainText(){return Pv(this.text)}getTextMeasureBBox(){return this.computeBBox()}isPointInPath(t,i){return this.getBBox()?.containsPoint(t,i)??!1}setScene(t){this.richText?.setScene(t),super.setScene(t)}generateTextMap(){if(!Ue(this.text)||this.textMap?.size)return;this.textMap??(this.textMap=new Map);let t=0,i=0,s=0;const n={fill:this.fill,fontSize:this.fontSize,fontFamily:this.fontFamily,fontStyle:this.fontStyle,fontWeight:this.fontWeight};for(const a of this.richText.children()){const{color:r,...l}=this.text[t++];a.x=0,a.y=0,a.setProperties(et({fill:r},l,n));const c=a.getBBox();this.textMap.set(a,c),s=Math.max(s,c.y+c.height/2+(a.lineHeight??ut.getLineHeight(a.fontSize))),i+=c.x+c.width}let o=this.x-i/2;for(const[a,r]of this.textMap)a.x+=o,a.y+=s,o+=r.width}render(t){const{ctx:i,stats:s}=t;if(!this.text||!this.layerManager)return s&&(s.nodesSkipped+=1),super.render(t);if(Ue(this.text)){this.generateTextMap();const{width:n}=this.richText.getBBox();let o=0;switch(this.textAlign){case"left":case"start":o=n/2;break;case"right":case"end":o=n/-2}i.save(),i.translate(o,this.y),this.richText.render(t),i.restore()}else this.renderText(t);if(Eu.debug.check()&&!this.textMap?.size){const n=this.getBBox(!0);i.strokeStyle="red",i.lineWidth=1,i.strokeRect(n.x,n.y,n.width,n.height)}super.render(t)}markDirty(t){return this.textMap?.clear(),super.markDirty(t)}renderText(t){const{fill:i,stroke:s,strokeWidth:n}=this;if(!i&&!(s&&n)||!this.layerManager)return super.render(t);const{ctx:o}=t,a=ut.toFontString(this);o.font!==a&&(o.font=a);const{fontSize:r,lineHeight:l=ut.getLineHeight(r),textAlign:c,textBaseline:h}=this;if(o.textAlign=c,o.textBaseline=h,this.boxing){const d={font:this,textBaseline:h,textAlign:c,lineHeight:l},u=Eu.computeBBox(this.lines,this.x,this.y,d);if(u.width!==0&&u.height!==0){const{x:p,y:g,width:f,height:x}=u.grow(this.boxPadding);this.boxing.opacity=this.opacity,this.boxing.x=p,this.boxing.y=g,this.boxing.width=f,this.boxing.height=x,this.boxing.preRender(t),this.boxing.render(t)}}this.fillStroke(o)}executeFill(t){const{fontSize:i,lineHeight:s=ut.getLineHeight(i),textBaseline:n,lines:o}=this,a=n==="alphabetic"?0:ut.getVerticalModifier(n)*s*(1-o.length);this.renderLines(a,s,(r,l,c)=>t.fillText(r,l,c))}executeStroke(t){const{fontSize:i,lineHeight:s=ut.getLineHeight(i),textBaseline:n,lines:o}=this,a=n==="alphabetic"?0:ut.getVerticalModifier(n)*s*(1-o.length);this.renderLines(a,s,(r,l,c)=>t.strokeText(r,l,c))}renderLines(t,i,s){const{lines:n,x:o,y:a}=this;if(!(!Number.isFinite(o)||!Number.isFinite(a)||!Number.isFinite(t)||!Number.isFinite(i)))for(const r of n)s(r,o,a+t),t+=i}setFont(t){this.fontFamily=t.fontFamily,this.fontSize=t.fontSize,this.fontStyle=t.fontStyle,this.fontWeight=t.fontWeight}setAlign(t){this.textAlign=t.textAlign,this.textBaseline=t.textBaseline}setBoxing(t){const i=t.border?.enabled?t.border?.stroke:void 0;t.fill!=null||i!=null?(this.boxing??(this.boxing=new Ti({scene:this.scene})),this.boxing.fill=t.fill,this.boxing.fillOpacity=t.fillOpacity??1,this.boxing.cornerRadius=t.cornerRadius??0,this.boxing.stroke=i,this.boxing.strokeWidth=t.border?.strokeWidth??0,this.boxing.strokeOpacity=t.border?.strokeOpacity??1,this.boxPadding=t.padding??0):this.boxing&&(this.boxing.destroy(),this.boxing=void 0)}getBoxingProperties(){const{fill:t,fillOpacity:i,cornerRadius:s,stroke:n,strokeWidth:o,strokeOpacity:a}=this.boxing??{};return{border:{enabled:n!=null,stroke:n,strokeWidth:o,strokeOpacity:a},cornerRadius:s,fill:t,fillOpacity:i,padding:this.boxPadding}}toSVG(){if(!this.visible||!this.text)return;const t=ti("text");if(ki(this.text))this.applySvgFillAttributes(t),_C(t,this),t.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),t.setAttribute("alignment-baseline",this.textBaseline),t.setAttribute("x",String(this.x)),t.setAttribute("y",String(this.y)),t.textContent=this.text;else for(const i of this.text){const s=ti("tspan");_C(s,{fontSize:i.fontSize??this.fontSize,fontFamily:i.fontFamily??this.fontFamily,fontWeight:i.fontWeight??this.fontWeight,fontStyle:i.fontStyle??this.fontStyle}),this.applySvgFillAttributes(s),s.textContent=i.text,t.append(s)}return{elements:[t]}}};qs.className="Text",qs.debug=Be.create(!0,"scene:text"),qs.defaultFontSize=10,M([te()],qs.prototype,"x",2),M([te()],qs.prototype,"y",2),M([mC({changeCb:e=>e.onTextChange()})],qs.prototype,"text",2),M([te()],qs.prototype,"fontStyle",2),M([te()],qs.prototype,"fontWeight",2),M([te()],qs.prototype,"fontSize",2),M([te()],qs.prototype,"fontFamily",2),M([te()],qs.prototype,"textAlign",2),M([te()],qs.prototype,"textBaseline",2),M([te()],qs.prototype,"lineHeight",2);var xn=qs,sT=class extends Hh(xn){},Yh=class extends Hh(Wh(xn)){},ep=class{static wrapText(e,t){return this.wrapLines(e,t).join(`
`)}static wrapLines(e,t){const i=this.textWrap(e,t);return t.overflow==="hide"&&i.some(s=>s.endsWith(ut.EllipsisChar))?[]:i}static appendEllipsis(e){return e.replace(/[.,]{1,5}$/,"")+ut.EllipsisChar}static truncateLine(e,t,i,s){const n=t.textWidth(ut.EllipsisChar);let o=0,a=0;for(;a<e.length;a++){const r=t.textWidth(e.charAt(a));if(o+r>i)break;o+=r}if(e.length===a&&(!s||o+n<=i))return s?e+ut.EllipsisChar:e;for(e=e.slice(0,a).trimEnd();e.length&&t.textWidth(e)+n>i;)e=e.slice(0,-1).trimEnd();return e+ut.EllipsisChar}static textWrap(e,t){const i=e.split(ut.lineSplitter),s=qr.getMeasurer(t);if(t.textWrap==="never")return i.map(r=>this.truncateLine(r.trimEnd(),s,t.maxWidth));const n=[],o=t.textWrap==="hyphenate",a=t.textWrap==null||t.textWrap==="on-space";for(const r of i){let l=r.trimEnd();if(l===""){n.push(l);continue}let c=0,h=0,d=0;for(;c<l.length;){const u=l.charAt(c);if(h+=s.textWidth(u),u===" "&&(d=c),h>t.maxWidth){if(c===0)break;const p=s.textWidth(l.slice(0,c+1));if(p<=t.maxWidth){h=p,c++;continue}if(d){const x=this.getWordAt(l,d+1),m=s.textWidth(x);if(m<=t.maxWidth){n.push(l.slice(0,d).trimEnd()),l=l.slice(d).trimStart(),c=0,h=0,d=0;continue}else a&&m>t.maxWidth&&n.push(l.slice(0,d).trimEnd(),this.truncateLine(l.slice(d).trimStart(),s,t.maxWidth,!0))}else a&&n.push(this.truncateLine(l,s,t.maxWidth,!0));if(a){l="";break}const g=o?"-":"";let f=l.slice(0,c).trim();for(;f.length&&s.textWidth(f+g)>t.maxWidth;)f=f.slice(0,-1).trimEnd();if(n.push(f+g),!f.length){l="";break}l=l.slice(f.length).trimStart(),c=-1,h=0,d=0}c++}l&&n.push(l)}return this.avoidOrphans(n,s,t),this.clipLines(n,s,t)}static getWordAt(e,t){const i=e.indexOf(" ",t);return i===-1?e.slice(t):e.slice(t,i)}static clipLines(e,t,i){if(!i.maxHeight)return e;const{height:s,lineMetrics:n}=t.measureLines(e);if(s<=i.maxHeight)return e;for(let o=0,a=0;o<n.length;o++){const{lineHeight:r}=n[o];if(a+=r,a>i.maxHeight){if(i.overflow==="hide")return[];const l=e.slice(0,o||1),c=l.pop();return l.concat(this.truncateLine(c,t,i.maxWidth,!0))}}return e}static avoidOrphans(e,t,i){if(i.avoidOrphans===!1||e.length<2)return;const{length:s}=e,n=e[s-1],o=e[s-2];if(o.length<n.length)return;const a=o.lastIndexOf(" ");if(a===-1||a===o.indexOf(" ")||n.includes(" "))return;const r=o.slice(a+1);t.textWidth(n+r)<=i.maxWidth&&(e[s-2]=o.slice(0,a),e[s-1]=r+" "+n)}},nT={};gn(nT,{BASE_FONT_SIZE:()=>Qa,CARTESIAN_AXIS_TYPE:()=>aT,CARTESIAN_POSITION:()=>oT,FONT_SIZE:()=>kS,FONT_SIZE_RATIO:()=>bn,POLAR_AXIS_SHAPE:()=>lT,POLAR_AXIS_TYPE:()=>rT});var kS=(e=>(e[e.SMALLEST=8]="SMALLEST",e[e.SMALLER=10]="SMALLER",e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=14]="LARGE",e[e.LARGEST=17]="LARGEST",e))(kS||{}),Qa=12,bn=(e=>(e[e.SMALLEST=8/Qa]="SMALLEST",e[e.SMALLER=10/Qa]="SMALLER",e[e.SMALL=12/Qa]="SMALL",e[e.MEDIUM=13/Qa]="MEDIUM",e[e.LARGE=14/Qa]="LARGE",e[e.LARGEST=17/Qa]="LARGEST",e))(bn||{}),oT=(e=>(e.TOP="top",e.TOP_RIGHT="top-right",e.TOP_LEFT="top-left",e.RIGHT="right",e.RIGHT_TOP="right-top",e.RIGHT_BOTTOM="right-bottom",e.BOTTOM="bottom",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.LEFT="left",e.LEFT_TOP="left-top",e.LEFT_BOTTOM="left-bottom",e))(oT||{}),aT=(e=>(e.CATEGORY="category",e.GROUPED_CATEGORY="grouped-category",e.ORDINAL_TIME="ordinal-time",e.UNIT_TIME="unit-time",e.TIME="time",e.NUMBER="number",e.LOG="log",e))(aT||{}),rT=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(rT||{}),lT=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(lT||{}),Pt=class extends we{constructor(){super(...arguments),this.id=ns(this),this.node=new sT({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(e,t){return e.eventsHub.on("layout:complete",()=>this.updateA11yText(e,t))}computeTextWrap(e,t){const{text:i,padding:s,wrapping:n}=this;if(Ue(i))return;const o=Math.min(this.maxWidth??1/0,e)-s*2,a=this.maxHeight??t-s*2;if(!isFinite(o)&&!isFinite(a)){this.node.text=i;return}const r=ep.wrapText(i??"",{maxWidth:o,maxHeight:a,font:this,textWrap:n});this.node.text=r,this.truncated=r.includes(ut.EllipsisChar)}updateA11yText(e,t){const{proxyInteractionService:i}=e;if(this.enabled&&this.text){const s=Gt.toCanvas(this.node);if(s){const{id:n}=this;this.proxyText??(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:t})),this.proxyText.textContent=Pv(this.text),this.proxyText.setBounds(s),this.proxyText.addListener("mousemove",o=>this.handleMouseMove(e,o)),this.proxyText.addListener("mouseleave",o=>this.handleMouseLeave(e,o))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(e,t){if(t!=null&&this.enabled&&this.truncated){const{x:i,y:s}=Gt.toCanvas(this.node),n=t.sourceEvent.offsetX+i,o=t.sourceEvent.offsetY+s;e.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:o,showArrow:!1},[{type:"structured",title:Pv(this.text)}])}}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id)}};Pt.SMALL_PADDING=10,M([I,ni("node","visible")],Pt.prototype,"enabled",2),M([I,ni("node")],Pt.prototype,"text",2),M([I,ni("node")],Pt.prototype,"textAlign",2),M([I,ni("node")],Pt.prototype,"fontStyle",2),M([I,ni("node")],Pt.prototype,"fontWeight",2),M([I,ni("node")],Pt.prototype,"fontSize",2),M([I,ni("node")],Pt.prototype,"fontFamily",2),M([I,ni("node","fill")],Pt.prototype,"color",2),M([I],Pt.prototype,"spacing",2),M([I],Pt.prototype,"maxWidth",2),M([I],Pt.prototype,"maxHeight",2),M([I],Pt.prototype,"wrapping",2),M([I],Pt.prototype,"padding",2),M([I],Pt.prototype,"layoutStyle",2);var CS=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))(CS||{});function qV(e){switch(e){case"x":case"y":case"angle":case"radius":return!0;default:return!1}}var cy=class{constructor(){this.title=new Pt,this.subtitle=new Pt,this.footnote=new Pt}positionCaptions(e){const{title:t,subtitle:i,footnote:s}=this,n=e.layoutBox.height/10;t.enabled&&(this.positionCaption("top",t,e.layoutBox,n),this.shrinkLayoutByCaption("top",t,e.layoutBox)),i.enabled&&(this.positionCaption("top",i,e.layoutBox,n),this.shrinkLayoutByCaption("top",i,e.layoutBox)),s.enabled&&(this.positionCaption("bottom",s,e.layoutBox,n),this.shrinkLayoutByCaption("bottom",s,e.layoutBox))}positionAbsoluteCaptions(e){const{title:t,subtitle:i,footnote:s}=this,{rect:n}=e.series;for(const o of[t,i,s])if(o.layoutStyle==="overlay"){if(o.textAlign==="left")o.node.x=n.x+o.padding;else if(o.textAlign==="right"){const a=o.node.getBBox();o.node.x=n.x+n.width-a.width-o.padding}}}computeX(e,t){return e==="left"?t.x:e==="right"?t.x+t.width:t.x+t.width/2}positionCaption(e,t,i,s){const n=Math.max(ut.getLineHeight(t.fontSize),s);t.node.x=this.computeX(t.textAlign,i)+t.padding,t.node.y=i.y+(e==="top"?0:i.height)+t.padding,t.node.textBaseline=e,t.computeTextWrap(i.width,n)}shrinkLayoutByCaption(e,t,i){if(t.layoutStyle==="block"){const s=t.node.getBBox(),{spacing:n=0}=t;e==="bottom"&&Ue(t.text)&&(t.node.y-=s.height,s.y-=s.height),i.shrink(Math.ceil(e==="top"?s.y-i.y+s.height+n:i.y+i.height-s.y+n),e)}}};M([I],cy.prototype,"title",2),M([I],cy.prototype,"subtitle",2),M([I],cy.prototype,"footnote",2);var QV=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],JV=class{constructor(e){this.chartService=e,this.mementoOriginatorKey="chartType"}createMemento(){let e=this.chartService.publicApi?.getOptions()?.chartType;return e??(e="candlestick"),e}guardMemento(e){return e==null||QV.includes(e)}restoreMemento(e,t,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>X.error("error restoring state",n))}},Ja="12.1.1",cT=Symbol("previous-memento-not-found"),e4=class{constructor(e){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=Be.create(!0,"history"),this.cleanup=new mt,this.cleanup.register(e.on("series:undo",this.undo.bind(this)),e.on("series:redo",this.redo.bind(this)))}destroy(){this.cleanup.flush()}addMementoOriginator(e){this.originators.set(e.mementoOriginatorKey,e),this.clearState.set(e.mementoOriginatorKey,e.createMemento()),this.debugEvent("History add originator:",e.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[e,t]of this.originators.entries())this.clearState.set(e,t.createMemento())}record(e,...t){this.historyIndex<this.history.length-1&&(this.history=this.history.slice(0,this.historyIndex+1)),this.history.length>this.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const s of t){if(!this.originators.has(s.mementoOriginatorKey))throw new Error(`Originator [${s.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(s.mementoOriginatorKey,s.createMemento())}this.history.push({label:e,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${e}]`)}undo(){const e=this.history[this.historyIndex];if(e){for(const t of e.mementos.keys()){const i=this.findPreviousMemento(t);if(i===cT)throw new Error(`Could not find previous memento for [${t}].`);this.restoreMemento(t,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${e.label}]`)}}redo(){const e=this.history[this.historyIndex+1];if(e){for(const[t,i]of e.mementos.entries())this.restoreMemento(t,i);this.historyIndex+=1,this.debugEvent(`History redo: [${e.label}]`)}}findPreviousMemento(e){for(let t=this.historyIndex-1;t>=0;t--)if(this.history[t].mementos.has(e))return this.history[t].mementos.get(e);return this.clearState.has(e)?this.clearState.get(e):cT}restoreMemento(e,t){this.originators.get(e)?.restoreMemento(Ja,Ja,t)}debugEvent(...e){this.debug(...e,this.history.map((t,i)=>i===this.historyIndex?`** ${t.label} **`:t.label))}},hT=class Dk{constructor(t){this.version=t.split("-")[0]}save(...t){const i={version:this.version};for(const s of Object.values(t))i[s.mementoOriginatorKey]=this.encode(s,s.createMemento());return i}restore(t,...i){if(typeof t!="object"){X.warnOnce(`Could not restore data of type [${typeof t}], expecting an object, ignoring.`);return}if(t==null){X.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in t)||typeof t.version!="string"){X.warnOnce("Could not restore data, missing [version] string in object, ignoring.");return}for(const s of i){const n=this.decode(s,t[s.mementoOriginatorKey]),o=[];if(!s.guardMemento(n,o)){const a=o.length>0?`
${o.join(`
`)}
`:"";X.warnOnce(`Could not restore [${s.mementoOriginatorKey}] data, value was invalid, ignoring.${a}`,n);return}s.restoreMemento(this.version,t.version,n)}}encode(t,i){try{return JSON.parse(JSON.stringify(i,Dk.encodeTypes))}catch(s){throw new Error(`Failed to encode [${t.mementoOriginatorKey}] value [${s}].`,{cause:s})}}decode(t,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),Dk.decodeTypes)}catch(s){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${s}].`,{cause:s})}}static encodeTypes(t,i){return aa(this[t])?{__type:"date",value:this[t].toISOString()}:i}static decodeTypes(t,i){return Fe(this[t])&&"__type"in this[t]&&this[t].__type==="date"?new Date(this[t].value):i}},t4=class{constructor(){this.caretaker=new hT(Ja),this.state=new Map}setState(e,t){Ci(this.state.get(e.mementoOriginatorKey),t)||this.setStateAndRestore(e,t)}setStateAndRestore(e,t){this.state.set(e.mementoOriginatorKey,t),this.restoreState(e)}restoreState(e){const{caretaker:t,state:i}=this;if(!i.has(e.mementoOriginatorKey))return;const s=i.get(e.mementoOriginatorKey);t.restore({version:t.version,[e.mementoOriginatorKey]:s},e)}},i4=`.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-border-radius: 4px;--ag-charts-chart-background-color: #fff;--ag-charts-chart-padding: 20px;--ag-charts-focus-shadow: 0 0 0 3px #2196f3;--ag-charts-foreground-color: #181d1f;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-popup-shadow: 0 0 16px rgba(0, 0, 0, .15);--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #181d1f;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: Verdana, sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-button-background-color: #fff;--ag-charts-button-border: 1px solid #dddddd;--ag-charts-button-font-weight: normal;--ag-charts-button-text-color: inherit;--ag-charts-input-background-color: #fff;--ag-charts-input-border: 1px solid #dddddd;--ag-charts-input-text-color: #181d1f;--ag-charts-menu-background-color: #fafafa;--ag-charts-menu-border: 1px solid #dddddd;--ag-charts-menu-text-color: #181d1f;--ag-charts-panel-background-color: #fafafa;--ag-charts-panel-text-color: #181d1f;--ag-charts-tooltip-background-color: #fafafa;--ag-charts-tooltip-border: 1px solid #dddddd;--ag-charts-tooltip-text-color: #181d1f;--ag-charts-tooltip-subtle-text-color: #8c8c8c;--ag-charts-crosshair-label-background-color: #fafafa;--ag-charts-crosshair-label-text-color: #181d1f;--ag-charts-spacing: 4px;--ag-charts-icon-size: 16px;--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 12%);--ag-charts-input-border-radius: var(--ag-charts-border-radius);--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-tooltip-border-radius: var(--ag-charts-border-radius);--ag-charts-menu-border-radius: var(--ag-charts-border-radius);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border: 1px solid var(--ag-charts-border-color);--ag-charts-focus-border: 1px solid var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-charts-theme-default-dark{--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 22%)}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-chevron-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ3IDUuNDdhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0IDRhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNCA0YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTAuOTQgMTAgNy40NyA2LjUzYS43NS43NSAwIDAgMSAwLTEuMDYiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border:var(--ag-charts-button-border);border-radius:var(--ag-charts-button-border-radius);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-left:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border:var(--ag-charts-input-border);border-radius:var(--ag-charts-input-border-radius);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border:var(--ag-charts-input-border);border-radius:var(--ag-charts-input-border-radius);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-legend-toolbar{pointer-events:auto}.ag-charts-proxy-legend-toolbar>div[role=listitem]{pointer-events:none}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-tooltip-text-color);background:var(--ag-charts-tooltip-background-color);border:var(--ag-charts-tooltip-border);border-radius:var(--ag-charts-tooltip-border-radius);box-shadow:var(--ag-charts-popup-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-tooltip-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);background:var(--ag-charts-panel-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-popup-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-menu-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__label{grid-column:-1 / span 1}.ag-charts-toolbar{--toolbar-gap: calc(var(--ag-charts-spacing) * 2);--toolbar-size: 34px;--toolbar-button-padding: 6px;align-items:center;display:flex;flex-wrap:nowrap;position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-button-border);color:var(--ag-charts-button-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--ag-charts-focus-color);z-index:1}.ag-charts-toolbar__button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-toolbar__button--active{background:var(--ag-charts-focus-color);border-color:var(--ag-charts-accent-color);color:var(--ag-charts-accent-color);z-index:2}.ag-charts-toolbar__button[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}
`,TS=class{constructor(){this.cleanup=new mt,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}},s4=class Cv{constructor(t,i,s){this.element=t,this.topTabGuard=i,this.bottomTabGuard=s,this.cleanup=new mt,this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,!1),this.initTabGuard(this.bottomTabGuard,!0),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",n=>this.onBlur(n),{capture:!0})}set tabIndex(t){this.guardTabIndex=t,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){this.cleanup.flush()}initTabGuard(t,i){this.cleanup.register(ot(t,"focus",()=>this.onTab(t,i)))}setGuardIndices(t){const i=t;Ge(this.topTabGuard,"tabindex",i),Ge(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:t}){const{topTabGuard:i,bottomTabGuard:s}=this;this.hasFocus=!1,this.guardTabIndex!==0&&t!==i&&t!==s&&this.setGuardIndices(this.guardTabIndex)}onTab(t,i){if(this.guardTabIndex!==0){let s;t.tabIndex===0?(s=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):s=this.findEnterTarget(i),s?.focus()}}static queryFocusable(t,i){const s=Ze();return Array.from(t.querySelectorAll(i)).filter(n=>{if(n instanceof HTMLElement){const o=s.getComputedStyle(n);return o.display!=="none"&&o.visibility!=="none"}return!1})}findEnterTarget(t){const i=Cv.queryFocusable(this.element,'[tabindex="0"]'),s=t?i.length-1:0;return i[s]}findExitTarget(t){const i=Cv.queryFocusable(oa(),"[tabindex]").filter(o=>o.tabIndex>0).sort((o,a)=>o.tabIndex-a.tabIndex),{before:s,after:n}=Cv.findBeforeAndAfter(i,this.guardTabIndex);return t?s:n}static findBeforeAndAfter(t,i){let s=0,n=t.length-1,o,a;for(;s<=n;){const r=Math.floor((s+n)/2),l=t[r].tabIndex;if(l===i){o=t[r-1]||void 0,a=t[r+1]||void 0;break}else l<i?(o=t[r],s=r+1):(a=t[r],n=r-1)}return{before:o,after:a}}};function hy(e,t,i=["Escape"]){return ot(e,"keydown",s=>{dy(s,...i)&&t(s)})}function LS(e,t){const i=ot(Ze(),"mousedown",s=>{[0,2].includes(s.button)&&!dT(e,s)&&(t(),i())});return i}function wS(e,t){const i=ot(Ze(),"touchstart",s=>{Array.from(s.targetTouches).some(o=>!dT(e,o))&&(t(),i())});return i}function dT(e,t){return t.target instanceof Element&&t.target.shadowRoot!=null?!0:t.target instanceof Node&&e.contains(t.target)}function NS(e,t,i){const s=n=>{for(const o of t)Ge(o,"data-focus-visible-override",n)};return s(i),ot(e,"keydown",()=>s(!0),{once:!0})}function tp(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function dy(e,...t){return tp(e)&&t.some(i=>e.key===i)}function uT(e,t,i){return ot(e,"keydown",s=>{dy(s,i)&&t.focus()})}var Kh={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function pT(e){const{orientation:t,buttons:i,wrapAround:s=!1,onEscape:n,onFocus:o,onBlur:a}=e,{nextKey:r,prevKey:l}=Kh[t],c=p=>{p.target&&"tabIndex"in p.target&&(i.forEach(g=>g.tabIndex=-1),p.target.tabIndex=0)},[h,d]=s?[i.length,i.length]:[0,1/0],u=new mt;for(let p=0;p<i.length;p++){const g=i[(h+p-1)%d],f=i[p],x=i[(h+p+1)%d];u.register(ot(f,"focus",c),o&&ot(f,"focus",o),a&&ot(f,"blur",a),n&&hy(f,n),g&&uT(f,g,l),x&&uT(f,x,r),ot(f,"keydown",m=>{dy(m,r,l)&&m.preventDefault()})),f.tabIndex=p===0?0:-1}return u}var n4=class{constructor(e,t,i){this.lastFocus=t,this.closeCallback=i,this.cleanup=new mt,this.cleanup.register(LS(e,()=>this.close(!0)),wS(e,()=>this.close(!0)))}close(e){this.cleanup.flush(),this.closeCallback(),this.finishClosing(e)}finishClosing(e){this.cleanup.flush(),Ge(this.lastFocus,"aria-expanded",!1),e||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}};function gT(e){const{sourceEvent:t,orientation:i,menu:s,buttons:n,closeCallback:o,overrideFocusVisible:a}=e,{nextKey:r,prevKey:l}=Kh[i],c=py(t);Ge(c,"aria-expanded",!0);const h=new n4(s,c,o),d=()=>h.close(),{cleanup:u}=h;return s.role="menu",s.ariaOrientation=i,u.merge(pT({orientation:i,buttons:n,onEscape:d,wrapAround:!0})),s.tabIndex=-1,u.register(hy(s,d),ot(s,"keydown",p=>{p.target===s&&(p.key===r||p.key===l)&&(p.preventDefault(),n[0]?.focus())})),n[0]?.focus({preventScroll:!0}),a!==void 0&&u.register(NS(s,n,a)),h}function o4(e,t){return i=>{if(e.ariaDisabled==="true")return i.preventDefault();t(i)}}function uy(e){return"button"in e?e.button===0:tp(e)&&(e.code==="Space"||e.key==="Enter")}function py(e){if(e?.target instanceof HTMLElement&&"tabindex"in e.target.attributes)return e.target}function fT(e){return ot(e,"keydown",t=>{if(t.defaultPrevented)return;Bh(t.target,"data-preventdefault",!0)&&dy(t,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&t.preventDefault()})}var a4=class{constructor(e){this.callback=e,this.devicePixelRatio=Ze("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=t=>{t.matches||(this.devicePixelRatio=Ze("devicePixelRatio")??1,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))}}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const e=Ze("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);e?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=e}},yT=class{constructor(){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([t,i])=>this.observe(t,i)),this.queuedObserveRequests=[],this.observeWindow()},typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(t=>{for(const{target:i,contentRect:{width:s,height:n}}of t){const o=this.elements.get(i);this.checkSize(o,i,s,n)}}));let e;this.pixelRatioObserver=new a4(()=>{clearTimeout(e),e=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=oa("readyState")==="complete",this.documentReady?this.observeWindow():Ze()?.addEventListener("load",this.onLoad)}destroy(){Ze()?.removeEventListener("load",this.onLoad),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const e=this.pixelRatioObserver?.pixelRatio??1;for(const[t,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==e){const{width:s,height:n}=i.size;i.size={width:s,height:n,pixelRatio:e},i.cb(i.size,t)}}checkSize(e,t,i,s){if(e&&(i!==e.size?.width||s!==e.size?.height)){const n=this.pixelRatioObserver?.pixelRatio??1;e.size={width:i,height:s,pixelRatio:n},e.cb(e.size,t)}}observe(e,t){if(!this.documentReady){this.queuedObserveRequests.push([e,t]);return}this.elements.has(e)?this.removeFromQueue(e):this.resizeObserver?.observe(e);const i={cb:t};this.elements.set(e,i)}unobserve(e){this.resizeObserver?.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter(([t])=>t!==e)}},Zh=class extends Map{constructor(e,t){super(),this.defaultValue=e,this.defaultState=t}set(e,t){return this.delete(e),typeof t<"u"&&super.set(e,t),delete this.cachedState,delete this.cachedValue,this}stateId(){return this.cachedState??(this.cachedState=Array.from(this.keys()).pop()??this.defaultState),this.cachedState}stateValue(){return this.cachedValue??(this.cachedValue=Array.from(this.values()).pop()??this.defaultValue),this.cachedValue}},r4='<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>',l4=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],c4=new Set(["styles","canvas-container","canvas","tooltip-container"]),mT={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},h4=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}],["tooltip-container",{childElementType:"div"}]]);function d4(e,t){if(typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(s=>{for(const n of s)n.target===e&&t(n.intersectionRatio)},{root:e});return i.observe(e),i}var xT={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return xT}};function bT(e,t){const i=ke("div");return i.className="ag-charts-tab-guard",e.insertAdjacentElement(t,i),i}var ES=class Eh extends TS{constructor(t,i,s,n,o="normal"){super(),this.eventsHub=t,this.chart=i,this.styleContainer=n,this.mode=o,this.anchorName=`--${ns(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 yT,this.cursorState=new Zh("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=d4(this.element,r=>{r===0&&!a&&this.eventsHub.emit("dom:hidden",null),a=r===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",i4),this.setContainer(s),this.cleanup.register(fT(this.element)),this.mode==="normal"){const r=this.rootElements["canvas-center"].element;if(r==null)throw new Error("Error initializing tab guards");const l=bT(r,"beforebegin"),c=bT(r,"afterend");this.tabGuards=new s4(r,l,c)}}initDOM(){if(this.mode==="normal"){const s=ke("div");return s.innerHTML=r4,s.firstChild}const t=ke("div");t.role="presentation",t.dataset.agCharts="",t.classList.add("ag-charts-wrapper");const i=ke("div");return t.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),t}initRootElements(){const{mode:t,element:i}=this,s={};for(const n of l4){const o=`ag-charts-${n}`;let a;if(t==="normal"?a=i.classList.contains(o)?i:i.getElementsByClassName(o)[0]:c4.has(n)?a=i:a=i.getElementsByClassName(o)[0]??ke("div"),a==null)throw new Error(`AG Charts - unable to find DOM element ${o}`);s[n]={element:a,children:new Map,listeners:[]}}return s}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0,Object.values(this.rootElements).forEach(t=>{t.children.forEach(i=>i.remove()),t.element.remove()}),this.element.remove()}postRenderUpdate(){this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(Eh.batchedUpdateContainer.length===0&&Ze().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),Eh.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const t of Eh.batchedUpdateContainer)t.destroyed||t.updateContainer();Eh.batchedUpdateContainer.splice(0)}setSizeOptions(t=300,i=300,s,n){const{style:o}=this.element;o.width=`${s??t}px`,o.height=`${n??i}px`,this.minWidth=s??t,this.minHeight=n??i,this.updateContainerClassName()}updateContainerSize(){const{style:t}=this.rootElements["canvas-center"].element;t.visibility=this.containerSize==null?"hidden":"",this.containerSize?(t.width=`${this.containerSize.width??0}px`,t.height=`${this.containerSize.height??0}px`):(t.width="",t.height=""),this.updateContainerClassName()}setTabGuardIndex(t){this.tabGuards&&(this.tabGuards.tabIndex=t)}setContainer(t){t!==this.container&&(this.pendingContainer=t,(this.mode==="minimal"||this.container==null)&&this.updateContainer())}updateContainer(){const{pendingContainer:t}=this;if(!(t==null||t===this.container)){if(this.container&&(this.container.removeChild(this.element),this.sizeMonitor.unobserve(this.container)),this.documentRoot!=null)for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=t,this.pendingContainer=void 0,this.documentRoot=this.getShadowDocumentRoot(t),this.initiallyConnected=t.isConnected;for(const[i,s]of this.styles)this.addStyles(i,s);t.appendChild(this.element),this.sizeMonitor.observe(t,i=>{this.containerSize=i,this.updateContainerSize(),this.eventsHub.emit("dom:resize",null)}),this.eventsHub.emit("dom:container-change",null)}}setThemeClass(t){const i="ag-charts-theme-";this.element.classList.forEach(s=>{s.startsWith(i)&&s!==t&&this.element.classList.remove(s)}),this.element.classList.add(t)}setThemeParameters(t){for(const[i,s]of Et(t)){let n=`${s}`;i.endsWith("Size")||i.endsWith("Radius")?n=`${s}px`:i.endsWith("Border")&&typeof s=="boolean"&&(n=s?"var(--ag-charts-border)":"none"),this.element.style.setProperty(`--ag-charts-${nG(i)}`,n)}}updateCanvasLabel(t){Ge(this.rootElements["canvas-proxy"].element,"aria-label",t)}getEventElement(t,i){return["focus","blur","keydown","keyup"].includes(i)?this.rootElements["series-area"].element:t}addEventListener(t,i,s){const n=this.getEventElement(this.element,t);return ot(n,t,i,s)}removeEventListener(t,i,s){this.getEventElement(this.element,t).removeEventListener(t,i,s)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const t=Ze(),i=new de(0,0,t.innerWidth,t.innerHeight),s=this.getRawOverlayClientRect();return i.intersection(s)?.toDOMRect()??xT}getRawOverlayClientRect(){let t=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;t!=null;){let o;if(i!=null&&t===i)o=!0;else{const r=t.computedStyleMap?.()?.get("overflow-y")?.toString();o=r==="auto"||r==="scroll"}if(o)return de.fromDOMRect(t.getBoundingClientRect());t=t.parentElement}if(this.documentRoot!=null)return de.fromDOMRect(this.documentRoot.getBoundingClientRect());const{innerWidth:s,innerHeight:n}=Ze();return new de(0,0,s,n)}getShadowDocumentRoot(t=this.container){const i=t?.ownerDocument?.body??oa("body");for(;t!=null;){if(t===i)return;if(t.parentNode instanceof DocumentFragment)return t;t=t.parentNode}}getParent(t){return this.rootElements[t].element}getChildBoundingClientRect(t){const{children:i}=this.rootElements[t],s=[];for(const n of i.values())s.push(de.fromDOMRect(n.getBoundingClientRect()));return de.merge(s)}isManagedChildDOMElement(t,i,s){const{children:n}=this.rootElements[i],o=n?.get(s);return o!=null&&t.contains(o)}contains(t,i){return i==null?this.element.contains(t):this.rootElements[i].element.contains(t)}addStyles(t,i){const s="data-ag-charts";if(this.styles.set(t,i),this.container==null)return;const n=r=>r.getAttribute(s)===t,o=r=>{const l=new Set(["TITLE","META"]);let c=!0,h;for(const u of r.children){if(c&&l.has(u.tagName)){h=u;continue}if(c=!1,n(u))return;u.hasAttribute(s)&&(h=u)}const d=ke("style");return this.chart.styleNonce!=null&&(d.nonce=this.chart.styleNonce),h==null?r.prepend(d):r.insertBefore(d,h.nextSibling),d};let a;this.styleContainer?a=o(this.styleContainer):this.initiallyConnected===!1?a=this.addChild("styles",t):this.documentRoot==null&&!Eh.headStyles.has(t)?(a=o(oa("head")),Eh.headStyles.add(t)):this.documentRoot!=null&&(a=this.addChild("styles",t)),!(a==null||n(a))&&(a.setAttribute(s,t),a.innerHTML=i)}removeStyles(t){this.removeChild("styles",t)}updateCursor(t,i){this.cursorState.set(t,i),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}addChild(t,i,s,n){const{element:o,children:a,listeners:r}=this.rootElements[t];if(!a)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(a.has(i))return a.get(i);const{childElementType:l="div"}=h4.get(t)??{};if(s&&s.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=s??ke(l);for(const[h,d,u]of r)c.addEventListener(h,d,u);if(a.set(i,c),l==="style"&&this.chart.styleNonce!=null&&(c.nonce=this.chart.styleNonce),n){const h=o.querySelector(n.query);if(h==null)throw new Error(`AG Charts - addChild query failed ${n.query}`);h.insertAdjacentElement(n.where,c)}else o?.appendChild(c);return c}removeChild(t,i){const{children:s}=this.rootElements[t];s&&(s.get(i)?.remove(),s.delete(i))}incrementDataCounter(t){const{dataset:i}=this.element;i[t]??(i[t]="0"),i[t]=String(Number(i[t])+1)}setDataBoolean(t,i){this.element.dataset[t]=String(i)}updateContainerClassName(){const{element:t,containerSize:i,minWidth:s,minHeight:n}=this;t.classList.toggle(mT.safeHorizontal,s>=(i?.width??1/0)),t.classList.toggle(mT.safeVertical,n>=(i?.height??1/0))}};ES.batchedUpdateContainer=[],ES.headStyles=new Set;var vT=ES,u4=class extends ua{constructor(){super(ke("div")),this.textElement=ti("text"),this.textElement.role="presentation",this.svgElement=ti("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(e){this.textElement.textContent=e;const i=this.textElement.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}},ST=class extends ua{constructor(e,t){super(e),Ge(this.elem,"role",t),this.setEnabled(!0),this.addListener("keydown",({sourceEvent:i})=>{uy(i)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))})}destructor(){}setEnabled(e){Ge(this.elem,"aria-disabled",!e)}addListener(e,t){return super.addListener(e,(i,s)=>{(e==="click"||e==="dblclick")&&this.isDisabled()||t(i,s)})}},ip=class extends ST{constructor(){super(ke("button"))}},p4=class extends ua{constructor(){super(ke("div")),Ge(this.elem,"role","group")}destructor(){}},OS=class extends ua{constructor(e,t){super(ke("div")),this.focusedChildIndex=0,this.onChildFocus=(i,s)=>{const n=this.children[this.focusedChildIndex];this.focusedChildIndex=s.index,n?.setTabIndex(-1),s.setTabIndex(0)},this.onChildKeyDown=(i,s)=>{const n=this.orientation,[o,a]=n==="both"?[Kh.horizontal,Kh.vertical]:[Kh[n],void 0];let r=-1;if(tp(i.sourceEvent)){const l=i.sourceEvent.key;l===o.nextKey||l===a?.nextKey?r=s.index+1:(l===o.prevKey||l===a?.prevKey)&&(r=s.index-1)}this.children[r]?.focus()},Ge(this.elem,"role",t),this.orientation=e}get orientation(){return Bh(this.elem,"aria-orientation")??"both"}set orientation(e){Ge(this.elem,"aria-orientation",e!=="both"?e:void 0)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const e of this.children)this.removeChildListeners(e),e.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(e){e.addListener("focus",this.onChildFocus),e.addListener("keydown",this.onChildKeyDown)}removeChildListeners(e){e.removeListener("focus",this.onChildFocus),e.removeListener("keydown",this.onChildKeyDown)}onChildAdded(e){this.addChildListeners(e),e.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(e){this.removeChildListeners(e);const{focusedChildIndex:t,children:i}=this,s=t===e.index;for(let n=0;n<i.length;n++){const o=i[n];o.index===t&&(this.focusedChildIndex=n),o.index=n}if(s){const n=i[t]??i[t-1];n?(this.focusedChildIndex=n.index,n.setTabIndex(0)):this.focusedChildIndex=0}}},g4=class extends OS{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(e=>e.getElement().parentElement.remove())}addChildToDOM(e,t){const i=ke("div");Ge(i,"role","listitem"),ha(i,"position","absolute"),ua.setElementContainer(e,i),this.appendOrInsert(i,t),this.setHidden(!1)}removeChildFromDOM(e){e.getElement().parentElement.remove(),this.setHidden(this.children.length===0)}setHidden(e){this.children.length===0&&(e=!0),super.setHidden(e)}},Xh=class extends ua{constructor(e){super(e)}destructor(){}},f4=new Intl.NumberFormat("en-US",{style:"percent"});function qh(e,t=2){return typeof e=="number"?AT(e,t):typeof e=="string"?e:String(e??"")}function MT(e){return f4.format(e)}var DT=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function AT(e,t){let i=DT.get(t);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),DT.set(t,i)),i.format(e)}var PS=class Sf extends ua{constructor(){super(ke("input")),this._step=Sf.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(t){this._step=t,this.getElement().step=t.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(t){if(t!==this._keyboardStep?.step&&(this._keyboardStep!==void 0&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),t!==void 0)){const i=()=>this.getElement().step=t.attributeValue,s=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:t,onKeyDown:i,onKeyUp:s,onBlur:s},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return Bh(this.elem,"aria-orientation")??"both"}set orientation(t){Ge(this.elem,"aria-orientation",t!=="both"?t:void 0),Sf.registerDefaultPreventers(this,t)}destructor(){}clampValueRatio(t,i){const s=this.getValueRatio(),n=ve(t,s,i);return n!==s&&this.setValueRatio(n),n}setValueRatio(t,i){const{divider:s}=this.step,n=Math.round(t*1e4)/s,{ariaValueText:o=MT(n/s)}=i??{},a=this.getElement();a.value=`${n}`,a.ariaValueText=o}getValueRatio(){return this.getElement().valueAsNumber/this.step.divider}static registerDefaultPreventers(t,i){i==="both"?t.removeListener("keydown",Sf.onKeyDown):t.addListener("keydown",Sf.onKeyDown)}static onKeyDown(t,i){let s=[];const{orientation:n}=i;n==="horizontal"?s=["ArrowUp","ArrowDown"]:n==="vertical"&&(s=["ArrowLeft","ArrowRight"]),s.includes(t.sourceEvent.code)&&t.sourceEvent.preventDefault()}};PS.STEP_ONE={attributeValue:"1",divider:1},PS.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var RS=PS,y4=class extends ip{constructor(){super(),Ge(this.elem,"role","switch"),this.setChecked(!1)}setChecked(e){Ge(this.elem,"aria-checked",e)}},gy=class extends OS{constructor(e="horizontal"){super(e,"toolbar")}destructor(){}};function Qh(e,t){return t.params?.type===e}function m4(e){if(e==="button")return new ip;if(e==="slider")return new RS;if(e==="toolbar")return new gy;if(e==="group")return new p4;if(e==="list")return new g4;if(e==="region")return new Xh(ke("div"));if(e==="text")return new u4;if(e==="listswitch")return new y4;throw Error("AG Charts - error allocating meta")}function IT(e){const t={params:e,result:void 0};return t.result=m4(t.params.type),t}var kT=class{constructor(e,t,i){this.eventsHub=e,this.localeManager=t,this.domManager=i,this.cleanup=new mt}destroy(){this.cleanup.flush()}addLocalisation(e){e(),this.cleanup.register(this.eventsHub.on("locale:change",e))}createProxyContainer(e){const t=IT(e),{params:i,result:s}=t,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,Qh("toolbar",t)&&(t.result.orientation=t.params.orientation),this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),s}createProxyElement(e){const t=IT(e);if(Qh("button",t)){const{params:i,result:s}=t,n=s.getElement();if(this.initInteract(i,s),typeof i.textContent=="string")n.textContent=i.textContent;else{const{textContent:o}=i;this.addLocalisation(()=>{n.textContent=this.localeManager.t(o.id,o.params)})}this.setParent(t.params,t.result)}if(Qh("slider",t)){const{params:i,result:s}=t,n=s.getElement();this.initInteract(i,s),n.type="range",n.role="presentation",n.style.margin="0px",this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(t.params,t.result)}if(Qh("text",t)){const{params:i,result:s}=t;this.initElement(i,s),this.setParent(t.params,t.result)}if(Qh("listswitch",t)){const{params:i,result:s}=t;this.initInteract(i,s),s.setTextContent(i.textContent),s.setChecked(i.ariaChecked),s.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(t.params,t.result)}if(Qh("region",t)){const{params:i,result:s}=t,n=s.getElement();this.initInteract(i,s),n.role="region",this.setParent(t.params,t.result)}return t.result}initElement(e,t){const i=t.getElement();return ha(i,"cursor",e.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),i}initInteract(e,t){const{tabIndex:i,domIndex:s}=e,n=this.initElement(e,t);i!==void 0&&(n.tabIndex=i),s!==void 0&&(t.domIndex=s)}setParent(e,t){if("parent"in e)e.parent?.addChild(t);else{const i={where:e.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",e.domManagerId,t.getElement(),i),t.destroyListener=()=>{this.domManager.removeChild("canvas-proxy",e.domManagerId)}}}},CT={ariaInitSeriesArea:"interactive chart",ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceStandaloneChart:"chart, ${caption}",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationsToolbar:"Annotations",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColor:"Color",ariaLabelColorPicker:"Color picker",ariaLabelColorPickerAlpha:"Transparency",ariaLabelColorPickerHue:"Hue",ariaLabelColorPickerMultiColor:"Multi Color",ariaLabelColorPickerPalette:"Palette",ariaLabelFinancialCharts:"Financial Charts",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",ariaRoleDescription2DSlider:"2D slider",ariaValueColorPalette:"s ${s}[percent0to2dp], v ${v}[percent0to2dp]",ariaValueColorPaletteFirstV:"v ${v}[percent0to2dp], s ${s}[percent0to2dp]",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",contextMenuResetZoom:"Reset zoom",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},x4=/\$\{(\w+)}(?:\[(\w+)])?/gi,BS={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"})},b4=({defaultValue:e,variables:t})=>e?.replaceAll(x4,(i,s,n)=>{const o=t[s],a=n!=null?BS[n]:null;return n!=null&&a==null&&X.warnOnce(`Format style [${n}] is not supported`),a!=null?a.format(o):typeof o=="number"?BS.number.format(o):o instanceof Date?BS.datetime.format(o):String(o)}),v4=class{constructor(e){this.eventsHub=e,this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(e){this.localeText!==e&&(this.localeText=e,this.eventsHub.emit("locale:change",null))}setLocaleTextFormatter(e){this.getLocaleText=e,this.getLocaleText!==e&&(this.getLocaleText=e,this.eventsHub.emit("locale:change",null))}t(e,t={}){const{localeText:i=CT,getLocaleText:s}=this,n=i[e];return s?.({key:e,defaultValue:n,variables:t})??b4({key:e,defaultValue:n,variables:t})??e}},FS=class{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:t,height:i,canvasElement:s,willReadFrequently:n=!1}=e;this.pixelRatio=e.pixelRatio??Ze("devicePixelRatio")??1,this.element=s??ke("canvas"),this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((t??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:n}),this.onEnabledChange(),this.resize(t??0,i??0,this.pixelRatio),hC(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t,i){if(!(e>0&&t>0))return;const{element:s,context:n}=this;s.width=Math.round(e*i),s.height=Math.round(t*i),n.setTransform(i,0,0,i,0,0),s.style.width=e+"px",s.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=i}clear(){cC(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.reset(),this.context.verifyDepthZero?.()}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};M([Xr(e=>e.onEnabledChange())],FS.prototype,"enabled",2);var S4=class extends Io{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(e,t){const i=this.cache.get(e);if(i?.image)return i.image;if(i!=null&&t){i.nodes.add(t);return}if(!t)return;const s={image:void 0,nodes:new Set([t])},n=new Image;return this.imageLoadingCount++,n.onload=()=>{s.image=n;for(const o of s.nodes)o.markDirty();s.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:e})},n.onerror=()=>{this.imageLoadingCount--,s.nodes.clear(),this.emit("image-error",{uri:e})},n.src=e,this.cache.set(e,s),s.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){this.cache.forEach(e=>{e.nodes.clear()}),this.cache.clear()}},M4=class{constructor(e){this.canvas=e,this.debug=Be.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(e,t,i){this.canvas.resize(e,t,i),this.layersMap.forEach(({canvas:s})=>s.resize(e,t,i))}addLayer(e){const{width:t,height:i,pixelRatio:s}=this.canvas,{name:n}=e,o=new Kv({width:t,height:i,pixelRatio:s});return this.layersMap.set(o,{id:this.nextLayerId++,name:n,canvas:o}),this.debug("Scene.addLayer() - layers",this.layersMap),o}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.debug("Scene.removeLayer() - layers",this.layersMap))}clear(){for(const e of this.layersMap.values())e.canvas.destroy();this.layersMap.clear()}},fy=class extends Io{constructor(e){super(),this.debug=Be.create(!0,"scene"),this.id=ns(this),this.imageLoader=new S4,this.root=null,this.pendingSize=null,this.isDirty=!1,this.cleanup=new mt,this.updateDebugFlags(),this.canvas=new FS(e),this.layersManager=new M4(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:t})=>{X.warnOnce(`Unable to load image ${t}`)}))}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(e){const{element:t}=this.canvas;return t.parentElement?.removeChild(t),e.appendChild(t),this}setRoot(e){return this.root===e?this:(this.isDirty=!0,this.root?.setScene(),this.root=e,e&&(e.visible=!0,e.setScene(this)),this)}updateDebugFlags(){Be.inDevelopmentMode(()=>Ya._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(e){return this.appendChild(e),()=>this.removeChild(e)}appendChild(e){return this.root?.appendChild(e),this}removeChild(e){return this.root?.removeChild(e),this}download(e,t){K_(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,i){return e=Math.round(e),t=Math.round(t),i??(i=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||i!==this.pixelRatio)?(this.pendingSize=[e,t,i],this.isDirty=!0,!0):!1}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:i,seriesRect:s}=e??{},{canvas:n,canvas:{context:o}={},root:a,pendingSize:r,width:l,height:c,pixelRatio:h}=this;if(!o)return;const d=performance.now();let u=!1;if(r&&(u=!0,this.layersManager.resize(...r),this.pendingSize=null),a&&!a.visible){this.isDirty=!1;return}let p;if(a instanceof Re&&(p=a.dirty),a!=null&&p===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:ay(a,"console")}),JC(this.layersManager,t,o,void 0,i,s);return}const g={ctx:o,width:l,height:c,devicePixelRatio:h,debugNodes:{}};Be.check("scene:stats:verbose")&&(g.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),$V(g);let f=!1;if((p!==!1||u)&&(f=!0,n.clear()),a&&Be.check("scene:dirtyTree")){const{dirtyTree:x,paths:m}=eT(a);Be.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:x,paths:m})}if(a&&f){if(a.visible&&a.preRender(g),this.debug.check()){const x=ay(a,"console");this.debug("Scene.render() - before",{canvasCleared:f,tree:x})}if(a.visible)try{o.save(),a.render(g),o.restore()}catch(x){throw this.canvas.reset(),x}}t["\u270D\uFE0F"]=performance.now()-d,o.verifyDepthZero?.(),this.isDirty=!1,JC(this.layersManager,t,o,g.stats,i,s),UV(o,g.debugNodes),a&&this.debug.check()&&this.debug("Scene.render() - after",{tree:ay(a,"console"),canvasCleared:f})}toSVG(){const{root:e,width:t,height:i}=this;if(e!=null)return Ya.toSVG(e,t,i)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.cleanup.flush(),Object.assign(this,{canvas:void 0})}};fy.className="Scene";var D4=class{constructor(e,t,i){this.eventsHub=e,this.annotationRoot=t,this.fireChartEvent=i,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(e){return e==null||Ue(e)}restoreMemento(e,t,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return et(s,n)}),this.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(e){this.annotations=this.cleanData(e??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:Ot([...this.annotations])})}attachNode(e){return this.annotationRoot.append(e),()=>(this.annotationRoot?.removeChild(e),this)}setAnnotationStyles(e){this.styles=e}getAnnotationTypeStyles(e){return this.styles?.[e]}cleanData(e){for(const t of e)"textAlign"in t&&delete t.textAlign;return e}},TT=(e=>(e[e.CHART_BACKGROUND=0]="CHART_BACKGROUND",e[e.AXIS_BAND_HIGHLIGHT=1]="AXIS_BAND_HIGHLIGHT",e[e.AXIS_GRID=2]="AXIS_GRID",e[e.AXIS=3]="AXIS",e[e.SERIES_AREA_CONTAINER=4]="SERIES_AREA_CONTAINER",e[e.ZOOM_SELECTION=5]="ZOOM_SELECTION",e[e.SERIES_CROSSLINE_RANGE=6]="SERIES_CROSSLINE_RANGE",e[e.SERIES_LAYER=7]="SERIES_LAYER",e[e.AXIS_FOREGROUND=8]="AXIS_FOREGROUND",e[e.SERIES_CROSSHAIR=9]="SERIES_CROSSHAIR",e[e.SERIES_CROSSLINE_LINE=10]="SERIES_CROSSLINE_LINE",e[e.SERIES_ANNOTATION=11]="SERIES_ANNOTATION",e[e.CHART_ANNOTATION=12]="CHART_ANNOTATION",e[e.CHART_ANNOTATION_FOCUSED=13]="CHART_ANNOTATION_FOCUSED",e[e.STATUS_BAR=14]="STATUS_BAR",e[e.SERIES_LABEL=15]="SERIES_LABEL",e[e.LEGEND=16]="LEGEND",e[e.NAVIGATOR=17]="NAVIGATOR",e[e.FOREGROUND=18]="FOREGROUND",e))(TT||{}),A4=class{constructor(e,t){this.eventsHub=e,this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new Re({name:"Axes-Grids",zIndex:2}),this.axisGroup=new Re({name:"Axes",zIndex:3}),this.axisLabelGroup=new Re({name:"Axes-Labels",zIndex:15}),this.axisCrosslineRangeGroup=new Re({name:"Axes-Crosslines-Range",zIndex:6}),this.axisCrosslineLineGroup=new Re({name:"Axes-Crosslines-Line",zIndex:10}),this.axisCrosslineLabelGroup=new Re({name:"Axes-Crosslines-Label",zIndex:15}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(e,t){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of e)t.includes(s)||(s.detachAxis(i),s.destroy());for(const s of t)e?.includes(s)||s.attachAxis(i);this.axes.clear();for(const s of t){const n=s.createAxisContext();this.axes.has(n.direction)?this.axes.get(n.direction)?.push(n):this.axes.set(n.direction,[n])}this.eventsHub.emit("axis:change",null)}getAxisContext(e){return this.axes.get(e)??[]}destroy(){this.axes.clear(),this.sceneRoot.removeChild(this.axisGroup),this.sceneRoot.removeChild(this.axisGridGroup)}},sp=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",e[e.PERFORM_LAYOUT=4]="PERFORM_LAYOUT",e[e.SERIES_UPDATE=5]="SERIES_UPDATE",e[e.PRE_SCENE_RENDER=6]="PRE_SCENE_RENDER",e[e.SCENE_RENDER=7]="SCENE_RENDER",e[e.NONE=8]="NONE",e))(sp||{}),yy=class{constructor(e,t,i){this.eventsHub=e,this.caller=t,this.animationManager=i,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.pendingData=void 0,this.debug=Be.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(e){typeof e=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=e,this.isLoadingInitialData=!0,this.animationManager.skip(),this.eventsHub.emit("data:source-change",null))}clearCallback(){this.dataSourceCallback=void 0}load(e){const{pendingData:t}=this;if(t!=null&&t.params.windowStart?.valueOf()===e.windowStart?.valueOf()&&t.params.windowEnd?.valueOf()===e.windowEnd?.valueOf()){const i=this.requestCounter++;this.isLoadingInitialData=!1,this.dispatch(i,t.data);return}this.isLoadingData=!0,this.throttledFetch(e)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}async getData(){const{latestRequest:e}=this;if(!e)return;const{params:t,fetchRequest:i}=e,s=await i;return{params:t,data:s}}restoreData(e){this.pendingData=e}createThrottledFetch(e){return Bk(t=>this.fetch(t).catch(i=>X.error("callback failed",i)),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return Bk((t,i)=>this.dispatch(t,i),e,{leading:!0,trailing:!0})}dispatch(e,t){this.debug(`DataService - dispatching 'data-load' | ${e}`),this.eventsHub.emit("data:load",{data:t})}async fetch(e){"context"in this.caller&&(e.context=this.caller.context);const t=Promise.resolve().then(async()=>{if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const i=performance.now(),s=this.requestCounter++;this.debug(`DataService - requesting | ${s}`);let n;try{n=await this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-i}ms | ${s}`)}catch(a){this.debug(`DataService - request failed | ${s}`),X.errorOnce(`DataService - request failed | [${a}]`)}this.isLoadingInitialData=!1;const o=this.freshRequests.indexOf(t);return o===-1||this.dispatchOnlyLatest&&o!==this.freshRequests.length-1?(this.debug(`DataService - discarding stale request | ${s}`),n):(this.freshRequests=this.freshRequests.slice(o+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(n)?this.throttledDispatch(s,n):this.eventsHub.emit("data:error",null),n)});this.latestRequest={params:e,fetchRequest:t},this.freshRequests.push(t),await t}};M([Is({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],yy.prototype,"dispatchThrottle",2),M([Is({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],yy.prototype,"requestThrottle",2);var I4=class{constructor(e,t){this.domManager=e,this.updateService=t,this.observers=[]}updateFonts(e){!e||e.size===0||(this.loadFonts(e),e.forEach(t=>{this.observeFontStatus(t)}))}destroy(){for(const e of this.observers)e.disconnect();this.observers=[]}loadFonts(e){const t=Array.from(e).map(o=>encodeURIComponent(o)),i=":wght@100;200;300;400;500;600;700;800;900",s=`${i}&family=`,n=`@import url('https://fonts.googleapis.com/css2?family=${t.join(s)}${i}&display=swap');
`;this.domManager.addStyles(`google-font-${t.join("-")}`,n)}observeFontStatus(e){const t=window.document.createElement("div");t.style.setProperty("position","absolute"),t.style.setProperty("top","0"),t.style.setProperty("margin","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("visibility","hidden"),t.style.setProperty("width","auto"),t.style.setProperty("max-width","none"),t.style.setProperty("font-synthesis","none"),t.style.setProperty("font-family",e),t.style.setProperty("font-size","16px"),t.style.setProperty("white-space","nowrap"),t.textContent="UVWxyz",this.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(e)}`,t);const i=new ResizeObserver(s=>{const n=s?.at(0)?.contentBoxSize.at(0)?.inlineSize;n!=null&&n>0&&(qr.clear(),this.updateService.update(4))});i.observe(t),this.observers.push(i)}},my=["bar","line","scatter"],k4=void 0,C4=void 0;C4=k4;var T4=void 0,L4=void 0;L4=T4;var LT=(e=>(e.POINTER="pointer",e.NODE="node",e.CHART="chart",e))(LT||{}),wT=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.TOP_LEFT="top-left",e.CENTER="center",e))(wT||{}),w4=void 0,N4=void 0;N4=w4;var E4=void 0,O4=void 0;O4=E4;var NT=class{constructor(){this.registeredListeners=new Map}addListener(e,t){const i={symbol:Symbol(e),handler:t};return this.registeredListeners.has(e)?this.registeredListeners.get(e).push(i):this.registeredListeners.set(e,[i]),()=>this.removeListener(i.symbol)}removeListener(e){for(const[t,i]of this.registeredListeners.entries()){const s=i.findIndex(n=>n.symbol===e);if(s>=0){i.splice(s,1),i.length===0&&this.registeredListeners.delete(t);break}}}dispatch(e,...t){for(const i of this.getListenersByType(e))try{i.handler(...t)}catch(s){X.errorOnce(s)}}getListenersByType(e){return this.registeredListeners.get(e)??[]}destroy(){this.registeredListeners.clear()}},np=new WeakMap;function op(e,t){const i=JSON.stringify(e,null,0);return np.has(t)||np.set(t,new Map),np.get(t)?.has(i)||np.get(t)?.set(i,t(e)),np.get(t)?.get(i)}var zS=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function ap(e,t){let i=new zS;const s=(...n)=>{let o=i;for(const a of n){const r=typeof a=="object"||typeof a=="symbol"?o.weak:o.strong;let l=r.get(a);l==null&&(l=new zS,r.set(a,l)),o=l}if(o.set)return t?.("hit",e,n),o.value;{const a=e(...n);return o.set=!0,o.value=a,t?.("miss",e,n),a}};return s.reset=()=>{i=new zS},s}function as(e,t){const i=new Map,s=(...a)=>a.map(r=>typeof r=="object"||typeof r=="symbol"?r:(i.has(r)||i.set(r,{v:r}),i.get(r))),n={},o=new WeakMap;return(...a)=>{const r=a.length===0?[n]:s(...a);let l=o;for(const d of r.slice(0,-1))l.has(d)||l.set(d,new WeakMap),l=l.get(d);const c=r.at(-1);let h=l.get(c);return h?t?.("hit",e,a):(h=e(...a),l.set(c,h),t?.("miss",e,a)),h}}var xy={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 _S(e,t=new Date(e.getFullYear(),0,1)){const i=e.getTimezoneOffset()-t.getTimezoneOffset(),s=e.getTime()-t.getTime()+i*6e4,n=36e5*24;return Math.floor(s/n)}function ET(e,t){const s=new Date(e.getFullYear(),0,1).getDay(),n=(t-s+7)%7,o=new Date(e.getFullYear(),0,n+1);return o<=e?Math.floor(_S(e,o)/7)+1:0}var P4=0,OT=1,PT=4;function RT(e,t=e.getFullYear()){const s=new Date(t,0,1).getDay(),n=(PT-s+7)%7,o=new Date(t,0,n-(PT-OT)+1);return o<=e?Math.floor(_S(e,o)/7)+1:RT(e,t-1)}function R4(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${rs(Math.floor(i/60),2,"0")}${rs(Math.floor(i%60),2,"0")}`}var B4={a:e=>xy.shortDays[e.getDay()],A:e=>xy.days[e.getDay()],b:e=>xy.shortMonths[e.getMonth()],B:e=>xy.months[e.getMonth()],c:"%x, %X",d:(e,t)=>rs(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>rs(e.getMilliseconds()*1e3,6,t??"0"),H:(e,t)=>rs(e.getHours(),2,t??"0"),I:(e,t)=>{const i=e.getHours()%12;return i===0?"12":rs(i,2,t??"0")},j:(e,t)=>rs(_S(e)+1,3,t??"0"),m:(e,t)=>rs(e.getMonth()+1,2,t??"0"),M:(e,t)=>rs(e.getMinutes(),2,t??"0"),L:(e,t)=>rs(e.getMilliseconds(),3,t??"0"),p:e=>e.getHours()<12?"AM":"PM",Q:e=>String(e.getTime()),s:e=>String(Math.floor(e.getTime()/1e3)),S:(e,t)=>rs(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>rs(ET(e,P4),2,t??"0"),V:(e,t)=>rs(RT(e),2,t??"0"),w:(e,t)=>rs(e.getDay(),2,t??"0"),W:(e,t)=>rs(ET(e,OT),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>rs(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>rs(e.getFullYear(),4,t??"0"),Z:e=>R4(e),"%":()=>"%"},F4={_:" ",0:"0","-":""};function rs(e,t,i){const s=String(Math.floor(e));return s.length>=t?s:`${i.repeat(t-s.length)}${s}`}function yc(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(i!==0){const r=i>0?e.substring(0,i):e;t.push(r)}if(i<0)break;const s=e[i+1],n=F4[s];n!=null&&i++;const o=e[i+1],a=B4[o];if(typeof a=="function")t.push([a,n]);else if(typeof a=="string"){const r=yc(a);t.push([r,n])}else t.push(`${n??""}${o}`);e=e.substring(i+2)}return i=>{const s=typeof i=="number"?new Date(i):i;return t.map(n=>typeof n=="string"?n:n[0](s,n[1])).join("")}}var pa={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},z4={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"},Cs={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},_4=/%[-_0]?L/,G4=/%[-_0]?S/,V4=/%[-_0]?M/,j4=/%[-_0]?[HI]/,H4=/^%[-_0]?[de]$/,W4=/^%[-_0]?[Bbm]$/,$4=/^%[-_0]?[Yy]$/;function BT(e,t,i){if(typeof e=="string")return e;e??(e=pa);const{millisecond:s=pa.millisecond,second:n=pa.second,minute:o=pa.minute,hour:a=pa.hour,day:r=pa.day,month:l=pa.month,year:c=pa.year}=e,h=Cs[t],d=z4[t],u=i?Cs[i]:-1;if(u<Cs.year&&h>=Cs.year&&!$4.test(c)||u<Cs.month&&h>=Cs.month&&!W4.test(l)||u<Cs.day&&h>=Cs.day&&!H4.test(r))return d;let p;switch(t){case"year":return c;case"month":return u<Cs.year?`${l} ${c}`:l;case"day":return u<Cs.year?`${l} ${r} ${c}`:`${l} ${r}`;case"hour":p=a;break;case"minute":p=o;break;case"second":p=n;break;case"millisecond":p=s;break;default:return d}if(h>=Cs.hour&&!j4.test(p)||h>=Cs.minute&&!V4.test(p)||h>=Cs.second&&!G4.test(p)||h>=Cs.millisecond&&!_4.test(p))return d;let g;return u<Cs.year?g=`${l} ${r} ${c}`:u<Cs.month&&(g=`${l} ${r}`),g?`${p} ${g}`:p}var Jh=class Tv extends NT{constructor(){super(...arguments),this.formats=new Map,this.dateFormatter=ap((t,i,s,n,o)=>{const a=Tv.mergeSpecifiers(t,i)??pa;return Tv.getFormatter("date",a,s,n,{truncateDate:o})}),this.formatter=void 0}static mergeSpecifiers(...t){let i;for(const s of t)typeof s=="string"?i=s:Je(s)&&(i=Je(i)?{...i,...s}:s);return i}static getFormatter(t,i,s,n="long",{truncateDate:o}={}){if(Je(i)){if(t!=="date"){X.warn("Date formatter configuration is not supported for non-date types.");return}s??(s="millisecond");const a=n==="component"?i?.[s]??pa[s]:BT(i,s,o);return yc(a)}switch(t){case"number":{const a=Yv(i);return a==null?void 0:nC(a)}case"date":return yc(i);case"category":return a=>i.replace("%s",String(a))}}setFormatter(t){this.formatter!==t&&(this.formatter=t,this.formats.clear(),this.dateFormatter.reset(),this.dispatch("format-changed"))}format(t,i,{specifier:s,truncateDate:n}={}){if(i.value==null)return;const{formatter:o}=this;if(o==null)return;if(typeof o=="function"){const c=t(o,i);return c!=null?String(c):void 0}const a=o[i.property];if(a==null)return;if(typeof a=="function"){const c=t(a,i);return c!=null?String(c):void 0}else if(i.type==="date"){const{unit:c,style:h}=i;return this.dateFormatter(a,s,c,h,n)?.(i.value)}const r=s??a;if(typeof r!="string")return;let l=this.formats.get(r);return l==null&&(l=Tv.getFormatter(i.type,r),this.formats.set(r,l)),l?.(i.value,i.type==="number"?i.fractionDigits:void 0)}defaultFormat(t,{specifier:i,truncateDate:s}={}){const{formatter:n}=this,o=typeof n=="function"?void 0:n?.[t.property];switch(t.type){case"date":{const{unit:a,style:r}=t,l=o!=null&&typeof o!="function"?o:void 0;return this.dateFormatter(l,i,a,r,s)?.(t.value)??String(t.value)}case"number":return qh(t.value,t.fractionDigits);case"category":return Array.isArray(t.value)?t.value.join(" - "):typeof t.value=="string"?t.value:typeof t.value=="number"?qh(t.value):String(t.value)}}};function U4(e,t){return i=>Number(e)*(1-i)+Number(t)*i}function FT(e,t){if(typeof e=="string")try{e=gt.fromString(e)}catch{e=gt.fromArray([0,0,0])}if(typeof t=="string")try{t=gt.fromString(t)}catch{t=gt.fromArray([0,0,0])}return i=>gt.mix(e,t,i).toRgbaString()}var GS={};gn(GS,{easeIn:()=>Y4,easeInOut:()=>K4,easeInOutQuad:()=>q4,easeInQuad:()=>Z4,easeOut:()=>rp,easeOutQuad:()=>X4,inverseEaseOut:()=>_T,linear:()=>zT});var zT=e=>e,Y4=e=>1-Math.cos(e*Math.PI/2),rp=e=>Math.sin(e*Math.PI/2),K4=e=>-(Math.cos(e*Math.PI)-1)/2,Z4=e=>e*e,X4=e=>1-(1-e)**2,q4=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,_T=e=>2*Math.asin(e)/Math.PI,by=.2,ed=["initial","remove","update","add","trailing","end","none"],lp={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:by,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+by,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},GT=(e=>(e.Loop="loop",e.Reverse="reverse",e))(GT||{});function Q4(e){return e.every(t=>t instanceof Ya)}function vy(e){return Q4(e)?{nodes:e,selections:[]}:{nodes:[],selections:e}}function VS(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((i,s)=>VS(i,t[s])):Uf(e)&&Uf(t)?e.equals(t):Je(e)&&Je(t)?qv(e,t,VS):!1}var VT=class{constructor(e){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=e.id,this.groupId=e.groupId,this.autoplay=e.autoplay??!0,this.ease=e.ease??zT,this.phase=e.phase;const t=e.duration??lp[this.phase].animationDuration;this.duration=t*e.defaultDuration,this.delay=(e.delay??0)*e.defaultDuration,this.onComplete=e.onComplete,this.onPlay=e.onPlay,this.onStop=e.onStop,this.onUpdate=e.onUpdate,this.interpolate=this.createInterpolator(e.from,e.to),this.from=e.from,e.skip===!0&&(this.onUpdate?.(e.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),e.collapsable!==!1&&(this.duration=this.checkCollapse(e,this.duration))}checkCollapse(e,t){return VS(e.from,e.to)?0:t}play(e=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,e&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(e){if(this.isComplete)return e;!this.isPlaying&&this.autoplay&&this.play(!0);const t=this.elapsed;if(this.elapsed+=e,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const s=this.delay+this.duration;return this.elapsed>=s?(this.stop(),this.isComplete=!0,this.onComplete?.(this),e-(s-t)):0}get delta(){return this.ease(ve(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if(typeof t!="object"||Uf(t))return this.interpolateValue(e,t);const i=[];for(const s of Object.keys(t)){const n=this.interpolateValue(e[s],t[s]);n!=null&&i.push([s,n])}return s=>{const n={};for(const[o,a]of i)n[o]=a(s);return n}}interpolateValue(e,t){if(!(e==null||t==null)){if(Uf(e))return i=>e[$f](t,i);try{switch(typeof e){case"number":return U4(e,t);case"string":return FT(e,t);case"boolean":if(e===t)return()=>e;break;case"object":return()=>e;default:throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}catch{}throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}},jT=class{constructor(e){this.maxAnimationTime=e,this.debug=Be.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(ed.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(ed[this.currentPhase])??[]}checkOverlappingId(e){e!=null&&this.controllers.has(e)&&(this.controllers.get(e).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${e}`),this.skip())}addAnimation(e){if(e.isComplete)return;if(ed.indexOf(e.phase)<this.currentPhase){this.debug("Skipping animation due to being for an earlier phase",e.id),e.stop();return}this.controllers.set(e.id,e),this.phases.get(e.phase)?.push(e)}removeAnimation(e){this.controllers.delete(e.id);const t=this.phases.get(e.phase),i=t?.indexOf(e);i!=null&&i>=0&&t?.splice(i,1)}progress(e){if(!this.isReady)return;let t=e===0?.01:e;const i=()=>{const c=ed[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:lp[c]}};let{phase:s,phaseControllers:n,phaseMeta:o}=i();const a=()=>ed[this.currentPhase]==null,r=()=>{for({phase:s,phaseControllers:n,phaseMeta:o}=i();!a()&&n.length===0;)this.currentPhase++,{phase:s,phaseControllers:n,phaseMeta:o}=i(),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:t},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${s} with ${n?.length} of ${l}`);do{const c=t,h=o.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let d=0;for(const u of n)h?u.stop():t=Math.min(u.update(c),t),u.isComplete&&(d++,this.removeAnimation(u));this.animationTimeConsumed+=c-t,this.debug(`AnimationBatch - updated ${n.length} controllers; ${d} completed`,n),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),r()}while(t>0&&!a());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let e=!0;for(const[,t]of this.controllers)if(t.duration>0&&lp[t.phase].skipIfNoEarlierAnimations!==!0){e=!1;break}if(!e)for(const[,t]of this.controllers)t.autoplay&&t.play(!0)}skip(e=!0){if(this.skipAnimations===!1&&e===!0){for(const t of this.controllers.values())t.stop();this.controllers.clear()}this.skipAnimations=e}play(){for(const e of this.controllers.values())e.play()}stop(){for(const e of this.controllers.values())try{e.stop(),this.removeAnimation(e)}catch(t){X.error("Error during animation stop",t)}this.dispatchStopped()}stopByAnimationId(e){if(e!=null&&this.controllers.has(e)){const t=this.controllers.get(e);t&&(t.stop(),this.removeAnimation(t))}}stopByAnimationGroupId(e){for(const t of this.controllers.values())t.groupId===e&&this.stopByAnimationId(t.id)}dispatchStopped(){this.stoppedCbs.forEach(e=>e()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(e){if(!this.isActive())return 0;let t=0;for(const[i,s]of this.phases)s.length!==0&&(e!=null&&e!==i||(t+=Math.max(...s.map(n=>n.isComplete?0:n.delay+n.duration-(n.elapsed??0)))));return t}destroy(){this.stop(),this.controllers.clear()}},HT=(e=>(e[e.Default=32]="Default",e[e.ZoomDrag=16]="ZoomDrag",e[e.Annotations=8]="Annotations",e[e.ContextMenu=4]="ContextMenu",e[e.Animation=2]="Animation",e[e.AnnotationsSelected=1]="AnnotationsSelected",e[e.Clickable=41]="Clickable",e[e.Focusable=34]="Focusable",e[e.Keyable=43]="Keyable",e[e.ContextMenuable=36]="ContextMenuable",e[e.AnnotationsMoveable=9]="AnnotationsMoveable",e[e.AnnotationsDraggable=57]="AnnotationsDraggable",e[e.ZoomDraggable=50]="ZoomDraggable",e[e.ZoomClickable=34]="ZoomClickable",e[e.ZoomWheelable=59]="ZoomWheelable",e[e.All=63]="All",e))(HT||{}),WT=class{constructor(){this.stateQueue=34}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}isState(e){return!!(this.stateQueue&-this.stateQueue&e)}};function $T(e){return e==null?!0:!isNaN(e)&&e>=0&&e<=2}var UT=class{constructor(e,t){this.interactionManager=e,this.chartUpdateMutex=t,this.defaultDuration=1e3,this.batch=new jT(this.defaultDuration*1.5),this.debug=Be.create(!0,"animation"),this.events=new Io,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0}addListener(e,t){return this.events.on(e,t)}animate(e){const t=this.batch;try{t.checkOverlappingId(e.id)}catch(r){this.failsafeOnError(r);return}let{id:i}=e;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()||e.phase==="none";s&&this.debug("AnimationManager - skipping animation");const{delay:n,duration:o}=e;if(!$T(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!$T(o))throw new Error(`Animation duration of ${o} is unsupported (${i})`);const a=new VT({...e,id:i,skip:s,autoplay:this.isPlaying?e.autoplay:!1,phase:e.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(a,this.defaultDuration))return this.batch.addAnimation(a),a}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(e){this.failsafeOnError(e)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(e){try{this.batch.stopByAnimationId(e)}catch(t){this.failsafeOnError(t)}}stopByAnimationGroupId(e){try{this.batch.stopByAnimationGroupId(e)}catch(t){this.failsafeOnError(t)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(e=!0){this.skipAnimations=e}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(e){return this.batch.getRemainingTime(e)}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error().stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(e){this.requestId=Ze().requestAnimationFrame(t=>{e(t).catch(i=>X.error(i))})}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let e;const t=async i=>{await this.debug.group("AnimationManager.onAnimationFrame()",async()=>{const s=()=>{const n=i-(e??i);e=i,this.debug("AnimationManager",{controllersCount:this.batch.size,deltaTime:n}),this.interactionManager.pushState(2);try{this.batch.progress(n)}catch(o){this.failsafeOnError(o)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:n})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(s):await this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(t):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))})};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(t)}cancelAnimation(){this.requestId!==null&&(cancelAnimationFrame(this.requestId),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){X.error("Error during animation, skipping animations",e),t&&this.cancelAnimation()}startBatch(e){this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`),this.reset(),this.batch.destroy(),this.batch=new jT(this.defaultDuration*1.5),e===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(2),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(e){this.batch.stoppedCbs.add(e)}destroy(){this.stop(),this.events.clear()}},J4=class{constructor(){this.download={type:"action",showOn:"always",label:"contextMenuDownload",enabled:!0,action:void 0,items:void 0},this["zoom-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuZoomToCursor",enabled:!0,action:void 0,items:void 0},this["pan-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuPanToCursor",enabled:!0,action:void 0,items:void 0},this["reset-zoom"]={type:"action",showOn:"series-area",label:"contextMenuResetZoom",enabled:!0,action:void 0,items:void 0},this["toggle-series-visibility"]={type:"action",showOn:"legend-item",label:"contextMenuToggleSeriesVisibility",enabled:!0,action:void 0,items:void 0},this["toggle-other-series"]={type:"action",showOn:"legend-item",label:"contextMenuToggleOtherSeries",enabled:!0,action:void 0,items:void 0},this.separator={type:"separator",showOn:"always",label:"separator",enabled:!0,action:void 0,items:void 0}}},ej=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},YT=class{constructor(){this.items=new J4,this.lists=new ej}},KT=class{constructor(e){this.eventsHub=e,this.builtins=new YT,this.hiddenActions=new Set,this.setVisible("zoom-to-cursor",!1),this.setVisible("pan-to-cursor",!1),this.setVisible("reset-zoom",!1)}static check(e,t){return t.showOn==e}static checkCallback(e,t,i){return e===t}dispatchContext(e,t,i,s){const{widgetEvent:n}=t;if(n.sourceEvent.defaultPrevented)return;const o=s?.x??t.canvasX,a=s?.y??t.canvasY,r={showOn:e,x:o,y:a,context:i,widgetEvent:n};this.eventsHub.emit("context-menu:setup",r),this.eventsHub.emit("context-menu:complete",r)}isVisible(e){return!this.hiddenActions.has(e)}setVisible(e,t){t?this.hiddenActions.delete(e):this.hiddenActions.add(e)}},ZT=class{constructor(e){this.eventsHub=e,this.highlightStates=new Zh}updateHighlight(e,t){const i=this.getActiveHighlight();this.highlightStates.set(e,t);const s=this.getActiveHighlight();this.isEqual(s,i)||this.eventsHub.emit("highlight:change",{callerId:e,currentHighlight:s,previousHighlight:i})}getActiveHighlight(){return this.highlightStates.stateValue()}isEqual(e,t){return e===t||e!=null&&t!=null&&e?.series===t?.series&&e?.itemId===t?.itemId&&e?.datum===t?.datum}};function XT(e,t){if(e==null||t.length===0)return[!1,!1];const i=e.valueOf(),s=t[0],n=t[t.length-1];if(typeof s=="string")return[i===s,i===n];let o=s.valueOf(),a=n.valueOf();return o>a&&([o,a]=[a,o]),[i===o,i===a]}function Qr(e,t,i,s,n,o){const[a,r]=XT(t,o),[l,c]=XT(e,n);return{xKey:i,yKey:s,xValue:e,yValue:t,first:l,last:c,min:a,max:r}}function qT(e,t,[i,s],n){let o=Gu(0,t-1,r=>{const l=e===1?r:t-r,c=n(l)?.[1]??NaN;return!Number.isFinite(c)||c>i})??0,a=lc(0,t-1,r=>{const l=e===1?r:t-r,c=n(l)?.[0]??NaN;return!Number.isFinite(c)||c<s})??t-1;return e===-1&&([o,a]=[t-a,t-o]),o=Math.max(o,0),a=Math.min(a+1,t),[o,a]}function jS(e,t,i){if(i){const{x:n,y:o,width:a,height:r}=i;return{canvasX:n+a/2,canvasY:o+r/2}}const s=t.yBar?.upperPoint??t.midPoint??e.datumMidPoint?.(t);if(s){const{x:n,y:o}=Gt.toCanvasPoint(e.contentGroup,s.x,s.y);return{canvasX:Math.round(n),canvasY:Math.round(o)}}}function QT(e,t,i,s,n){let o=-1,a=0,r=0,l=!1;for(;a<s&&o<=t-e;){o+=1;const c=i+r;if(l||(r*=-1),r>=0&&(r+=1),l&&r<0&&(r-=1),c<e||c>t){l=!0;continue}n(c)&&(a+=1)}return a}var Sy=class{constructor(e,t,i,s){this.domManager=i,this.tooltip=s,this.stateTracker=new Zh,this.suppressState=new Zh(!1),this.appliedState=null,this.cleanup=new mt,this.cleanup.register(s.setup(t,i),e.on("dom:hidden",()=>this.tooltip.hide()))}destroy(){this.cleanup.flush()}updateTooltip(e,t,i,s){i??(i=this.stateTracker.get(e)?.content),this.stateTracker.set(e,{meta:t,content:i,pagination:s}),this.applyStates()}removeTooltip(e){this.stateTracker.delete(e),this.applyStates()}suppressTooltip(e){this.suppressState.set(e,!0)}unsuppressTooltip(e){this.suppressState.delete(e)}applyStates(){const e=this.stateTracker.stateId(),t=e?this.stateTracker.get(e):void 0;if(this.suppressState.stateValue()||t?.meta==null||t?.content==null){this.appliedState=null,this.tooltip.hide();return}const i=this.domManager.getBoundingClientRect(),s=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if(Ci(this.appliedState?.content,t?.content)&&Ci(this.appliedState?.pagination,t?.pagination)){const n=this.tooltip.isVisible();this.tooltip.show(s,i,t?.meta,null,void 0,n)}else this.tooltip.show(s,i,t?.meta,t?.content,t?.pagination);this.appliedState=t}static makeTooltipMeta(e,t,i,s){const{canvasX:n,canvasY:o}=e,a=t.properties.tooltip,{placement:r,anchorTo:l,xOffset:c,yOffset:h}=a.position,d=jS(t,i,s);return{canvasX:n,canvasY:o,nodeCanvasX:d?.canvasX??n,nodeCanvasY:d?.canvasY??o,enableInteraction:a.interaction?.enabled??!1,showArrow:a.showArrow,position:{placement:r,anchorTo:l,xOffset:c,yOffset:h}}}},JT=3,tj=505,eL=30;function HS(e,t){const{device:i,offsetX:s,offsetY:n,clientX:o,clientY:a,currentX:r,currentY:l,sourceEvent:c}=t;return{type:e,device:i,offsetX:s,offsetY:n,clientX:o,clientY:a,currentX:r,currentY:l,sourceEvent:c}}function tL(e,t){const i=e*e+t*t,s=JT*JT;return i>=s}function ij(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY,n=i*i+s*s,o=eL*eL;return n<o}var iL=class{constructor(e){this.cleanup=new mt,this.events=new Io,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.cleanup.register(e.addListener("touchstart",this.onTouchStart.bind(this)),e.addListener("touchmove",this.onTouchMove.bind(this)),e.addListener("touchend",this.onTouchEnd.bind(this)),e.addListener("mousemove",this.onMouseMove.bind(this)),e.addListener("dblclick",this.onDblClick.bind(this)),e.addListener("drag-start",this.onDragStart.bind(this)),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.cleanup.flush()}onTouchStart(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=t,this.touch.clientY=i}onTouchMove(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-t),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=t,this.touch.clientY=i}onTouchEnd(e){e.sourceEvent.preventDefault()}onMouseMove(e){this.events.emit("mousemove",e)}onDblClick(e){this.events.emit("dblclick",e)}onDragStart(e){this.dragStartEvent=e}onDragMove(e){this.dragStartEvent!=null&&tL(e.originDeltaX,e.originDeltaY)&&(this.events.emit("drag-start",this.dragStartEvent),this.events.emit("drag-move",{...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.events.emit("drag-move",e)}onDragEnd(e){if(this.isDragging){this.events.emit("drag-end",e),this.isDragging=!1;return}if(e.device==="mouse"){const t=HS("click",e);this.events.emit("click",t)}else if(e.sourceEvent.type==="touchend"){if(tL(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const t=HS("click",e);this.events.emit("click",t);const i=Date.now();if(this.lastClick!==void 0&&i-this.lastClick.time<=tj&&ij(this.lastClick,e)){const s=HS("dblclick",e);this.events.emit("dblclick",s),this.lastClick=void 0}else this.lastClick={time:i,clientX:e.clientX,clientY:e.clientY}}}},WS=class extends Xh{constructor(e){super(e)}addChildToDOM(){}removeChildFromDOM(){}},sj=class{constructor(e,t){this.seriesWidget=new WS(e.getParent("series-area")),this.chartWidget=new WS(e.getParent("canvas-proxy")),this.containerWidget=new WS(e.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),t.withDragInterpretation&&(this.seriesDragInterpreter=new iL(this.seriesWidget))}destroy(){this.seriesDragInterpreter?.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}};function cp(e,t){const[i,s]=Vi(t);return ve(i,e,s)}function Vi(e){if(e.length===0)return[];const t=[1/0,-1/0];for(const i of e)i<t[0]&&(t[0]=i),i>t[1]&&(t[1]=i);return t}function td(e){const[t,i]=Vi(e);return i-t}function nj(e){return e=e|0,e<=0?1:e===1?2:1<<32-Math.clz32(e-1)}function $S(e){return e=e|0,e<=0?0:e===1?1:1<<31-Math.clz32(e)}var sL=class Ak extends Qf{constructor(t=[],i=[]){super(),this.domain=t,this.range=i,this.defaultTickCount=Ak.defaultTickCount,this.defaultClamp=!1}static is(t){return t instanceof Ak}normalizeDomains(...t){return US(...t)}calcBandwidth(t=1,i=1){const{domain:s}=this,n=this.getPixelRange();if(s.length===0)return n;let a=Math.abs(s[1].valueOf()-s[0].valueOf())/t+1;if(i!==0){const r=Math.floor(n);a=Math.min(a,r)}return n/Math.max(1,a)}convert(t,i){const{domain:s}=this;if(!s||s.length<2||t==null)return NaN;const{range:n}=this,o=i?.clamp??this.defaultClamp;let a=s[0].valueOf(),r=s[1].valueOf(),l=t.valueOf();if(this.transform&&(a=this.transform(a),r=this.transform(r),l=this.transform(l)),o){const[h,d]=Vi([a,r]);if(l<h)return n[0];if(l>d)return n[1]}if(a===r)return(n[0]+n[1])/2;if(l===a)return n[0];if(l===r)return n[1];const c=n[0];return c+(l-a)/(r-a)*(n[1]-c)}invert(t,i){const{domain:s}=this;if(s.length<2)return;let n=s[0].valueOf(),o=s[1].valueOf();this.transform&&(n=this.transform(n),o=this.transform(o));const{range:a}=this,[r,l]=a;let c;return r===l?c=this.toDomain((n+o)/2):c=this.toDomain(n+(t-r)/(l-r)*(o-n)),this.transformInvert?this.transformInvert(c):c}getPixelRange(){const[t,i]=this.range;return Math.abs(i-t)}};sL.defaultTickCount=5;var ft=sL;function US(...e){let t,i=1/0,s,n=-1/0;for(const o of e)for(const a of o){const r=a.valueOf();r<i&&(i=r,t=a),r>n&&(n=r,s=a)}return t!=null&&s!=null?{domain:[t,s],animatable:!0}:{domain:[],animatable:!1}}var YS=class a_ extends Qf{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(t){return t instanceof a_}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=ve(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this.invalid=!0,this._paddingInner=ve(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this.invalid=!0,this._paddingOuter=ve(0,t,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&X.warnOnce("Expected update to not invalidate scale"))}convert(t,i){this.refresh();const s=this.findIndex(t,i?.alignment);return s==null||s<0||s>=this.bands.length?NaN:this.ordinalRange(s)}invertNearestIndex(t){this.refresh();const i=this.bands.length;if(i===0)return-1;let s=0,n=i-1,o=1/0,a=0;for(;s<=n;){const r=(n+s)/2|0,l=this.ordinalRange(r),c=Math.abs(l-t);if(c===0)return r;c<o&&(o=c,a=r),l<t?s=r+1:n=r-1}return a}update(){const[t,i]=this.range;let{_paddingInner:s}=this;const{_paddingOuter:n,round:o,bands:a}=this,r=a.length;if(r===0)return;const l=i-t;let c;r===1?(s=0,c=l*(1-n*2)):c=l/Math.max(1,r-s+n*2);const h=o?Math.floor(c):c;let d=t+(l-h*(r-s))/2,u=h*(1-s);o&&(d=Math.round(d),u=Math.round(u)),this._step=h,this._inset=d,this._bandwidth=u,this._rawBandwidth=c*(1-s)}ordinalRange(t){const{_inset:i,_step:s,range:n}=this,o=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return ve(o,i+s*t,a)}};M([Yu],YS.prototype,"range",2),M([Yu],YS.prototype,"round",2);var er=YS,wo=class r_ extends er{static is(t){return t instanceof r_}toDomain(t){return new Date(t)}convert(t,i){t instanceof Date||(t=new Date(t));const{domain:s,bands:n}=this;if(s.length<=0)return NaN;const o=this.ordinalRange(0),a=this.ordinalRange(n.length-1);if(n.length===0)return o;if(i?.clamp===!0){const{range:b}=this;if(t<n[0])return b[0];if(t>n[n.length-1])return b[1]}const r=i?.alignment??0,l=s[0].valueOf()>s[s.length-1].valueOf();if(r!==2){const b=super.convert(t,i);return l?a-(b-o):b}const c=t.valueOf();let h=this.findIndex(t)??0,d;l?(h=Math.min(Math.max(h,1),n.length-1),d=-1):(h=Math.min(Math.max(h,0),n.length-2),d=1);const u=n[h].valueOf(),p=n[h+d].valueOf(),g=this.ordinalRange(h),f=this.ordinalRange(h+d),m=(c-u)/(p-u)*(f-g)+g;return l?a-(m-o):m}invert(t,i=!1){this.refresh();const{domain:s,bands:n}=this;if(s.length<=0)return;const o=s[0].valueOf()>s[s.length-1].valueOf();let a;return i?a=this.invertNearestIndex(t-this.bandwidth/2):a=Gu(0,n.length-1,l=>this.ordinalRange(l)>=t)??n.length-1,n[o?n.length-1-a:a]}findIndex(t,i=0){const{bands:s}=this,n=t.valueOf();return i===1?Gu(0,s.length-1,o=>s[o].valueOf()>=n):lc(0,s.length-1,o=>s[o].valueOf()<=n)}},hp={bottomCenter:cj,center:lj,clone:pj,collides:gj,end:aj,from:fj,height:dj,round:uj,start:oj,topCenter:rj,origin:yj,width:hj};function oj(e){return{x:e.x1,y:e.y1}}function aj(e){return{x:e.x2,y:e.y2}}function rj(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}}function lj(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function cj(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}}function hj(e){return Math.abs(e.x2-e.x1)}function dj(e){return Math.abs(e.y2-e.y1)}function uj(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}}function pj(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}function gj(e,t){const i=KS(e),s=KS(t);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1}function KS(e){return{x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)}}function fj(e,t,i,s){if(typeof e=="number")return{x1:e,y1:t,x2:i,y2:s};if("width"in e)return KS({x1:e.x,y1:e.y,x2:e.x+e.width,y2:e.y+e.height});throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(e)}] [${t}] [${i}] [${s}]`)}function yj(){return{x1:0,y1:0,x2:0,y2:0}}function My(e,t,i,s,n){return t+(s-t)*((n-e)/(i-e))}function nL(e,t,i,s,n){return e+(n-t)*((i-e)/(s-t))}function oL(e,t,i){return[nL(e,i.min,t,i.max,0),nL(e,i.min,t,i.max,1)]}function mj(e,t,i){const[s,n]=oL(e.x1,e.x2,t),[o,a]=oL(e.y1,e.y2,i);return{x1:s,x2:n,y1:o,y2:a}}function aL(e,t,i,s,n,o){if(i<=n&&o<=s)return i;const a=n-i,r=o-s,l=Math.abs(a)<Math.abs(r)?a:r;return ve(e,i+l,t)}function xj(e,t,i){const{x:s={min:0,max:1},y:n={min:0,max:1}}=t,o=hp.from(i),a=hp.from(e),r=mj(a,s,n),l=aL(r.x1,r.x2,a.x1,a.x2,o.x1,o.x2),c=aL(r.y1,r.y2,a.y1,a.y2,o.y1,o.y2),h={x:{min:My(a.x1,s.min,a.x2,s.max,l),max:My(a.x1,s.min,a.x2,s.max,l+e.width)},y:{min:My(a.y1,n.min,a.y2,n.max,c),max:My(a.y1,n.min,a.y2,n.max,c+e.height)}},d=h.x.max-h.x.min,u=h.y.max-h.y.min;return h.x.min=ve(0,h.x.min,1-d),h.x.max=h.x.min+d,h.y.min=ve(0,h.y.min,1-u),h.y.max=h.y.min+u,h}function rL(e,t){const i=e?.valueOf(),s=t?.valueOf();return typeof i!="number"||typeof s!="number"?[void 0,void 0]:i<s?[0,1]:[1,0]}var bj=class{constructor(){this.enabled=!1,this.padding=0,this.manuallyAdjusted=!1}},lL=e=>Xe((t,{options:i})=>!ft.is(e?.scale)&&!wo.is(e?.scale)||t==null||i.end==null?!0:t<i.end,"to be less than end"),cL=class extends TS{constructor(e,t){super(),this.eventsHub=e,this.fireChartEvent=t,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new Zh(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new bj,this.lastRestoredState=void 0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.boundFireOnceChartEvent=this.fireOnceChartEvent.bind(this),this.cleanup.register(e.on("layout:complete",()=>{this.didLayoutAxes=!0;const{pendingMemento:i}=this;i&&this.restoreMemento(i.version,i.mementoVersion,i.memento),this.autoScaleYZoom("zoom-manager")}))}createMemento(){return this.getMementoRanges()}guardMemento(e,t){if(e==null)return!0;if(!Fe(e))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n={rangeX:{start:lL(i),end:Te},rangeY:{start:lL(s),end:Te},ratioX:{start:Te,end:Te},ratioY:{start:Te,end:Te},autoScaledAxes:Te},{invalid:o}=ss(e,n);return o.length>0?(t.push(...o.map(String)),!1):!0}restoreMemento(e,t,i){const{independentAxes:s}=this;if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:e,mementoVersion:t,memento:i};return}this.pendingMemento=void 0;const n=this.getDefinedZoom();if(i?.rangeX?n.x=this.rangeToRatio(i.rangeX,"x")??{min:0,max:1}:i?.ratioX?n.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:n.x={min:0,max:1},!this.navigatorModule||this.zoomModule){let r=i?.autoScaledAxes?.includes("y");if(i?.rangeY)r??(r=!1),n.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1};else if(i?.ratioY)r??(r=!1),n.y={min:i.ratioY.start??0,max:i.ratioY.end??1};else{r??(r=!0);const l=r?this.getAutoScaleYZoom(n.x):void 0;n.y=l??{min:0,max:1}}n.autoScaleYAxis=r}if(this.lastRestoredState=n,s!==!0){this.updateZoom("zoom-manager",n);return}const o=this.getPrimaryAxis("x"),a=this.getPrimaryAxis("y");for(const r of[o,a])r&&this.updateAxisZoom("zoom-manager",r.id,n[r.direction])}updateAxes(e){this.axes=e;const t=new Map(e.map(i=>[i.id,this.axisZoomManagers.get(i.id)]));this.axisZoomManagers.clear();for(const i of e)this.axisZoomManagers.set(i.id,t.get(i.id)??new vj(i));this.state.size>0&&e.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}setIndependentAxes(e=!0){this.independentAxes=e}setAutoScaleYAxis(e,t){this.autoScaleYAxis.enabled=e,this.autoScaleYAxis.padding=t,e&&this.autoScaleYZoom("toggle-auto-scale")}setNavigatorEnabled(e=!0){this.navigatorModule=e}setZoomModuleEnabled(e=!0){this.zoomModule=e}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom(e,t){if(t?.x&&(t.x.min<0||t.x.max>1)&&(X.warnOnce(`Attempted to update x-axis zoom to an invalid ratio of [{ min: ${t.x.min}, max: ${t.x.max} }], expecting a ratio of 0 to 1, ignoring.`),t.x=void 0),t?.y&&(t.y.min<0||t.y.max>1)&&(X.warnOnce(`Attempted to update y-axis zoom to an invalid ratio of [{ min: ${t.y.min}, max: ${t.y.max} }], expecting a ratio of 0 to 1, ignoring.`),t.y=void 0),this.axisZoomManagers.size===0){const s=this.state.stateId();(s==="initial"||s===e)&&this.state.set(e,t);return}this.state.set(e,t);const i=t?.autoScaleYAxis;i!=null&&(this.autoScaleYAxis.manuallyAdjusted=!i),this.axisZoomManagers.forEach(s=>{s.updateZoom(e,t?.[s.getDirection()])}),this.applyChanges(e)}updateAxisZoom(e,t,i){this.axisZoomManagers.get(t)?.updateZoom(e,i),this.applyChanges(e)}resetZoom(e){this.autoScaleYAxis.manuallyAdjusted=!1;const t=this.getRestoredZoom();this.updateZoom(e,{x:{min:t?.x?.min??0,max:t?.x?.max??1},y:{min:t?.y?.min??0,max:t?.y?.max??1},autoScaleYAxis:t?.autoScaleYAxis??!0})}resetAxisZoom(e,t){const s=this.axisZoomManagers.get(t)?.getDirection();if(s==null)return;const n=this.getRestoredZoom();if(s==="y"){const o=n?.autoScaleYAxis??!0;this.autoScaleYAxis.manuallyAdjusted=!o}for(const o of this.axes)o.direction===s&&this.updateAxisZoom(e,o.id,n?.[s]??{min:0,max:1})}setAxisManuallyAdjusted(e,t){this.axisZoomManagers.get(t)?.getDirection()==="y"&&(this.autoScaleYAxis.manuallyAdjusted=!0)}updatePrimaryAxisZoom(e,t,i){const s=this.getPrimaryAxis(t);s&&this.updateAxisZoom(e,s.id,i)}panToBBox(e,t,i){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const s=this.getZoom();if(s===void 0||!s.x&&!s.y)return!1;if(!(t.width>0&&t.height>0&&Math.abs(i.width)<=Math.abs(t.width)&&Math.abs(i.height)<=Math.abs(t.height)))return X.warnOnce("cannot pan to target BBox - chart too small?"),!1;const o=xj(t,s,i);return this.independentAxes?(this.updatePrimaryAxisZoom(e,"x",o.x),this.updatePrimaryAxisZoom(e,"y",o.y)):this.updateZoom(e,o),!0}fireZoomPanStartEvent(e){this.eventsHub.emit("zoom:pan-start",{callerId:e})}extendToEnd(e,t,i){return this.extendWith(e,t,s=>Number(s)-i)}extendWith(e,t,i){const s=this.getPrimaryAxis(t);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;const[,o]=n,a=i(o),r=this.rangeToRatio({start:a,end:o},t);r&&this.updateZoom(e,{[t]:r})}updateWith(e,t,i){const s=this.getPrimaryAxis(t);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;let[o,a]=n;[o,a]=i(o,a);const r=this.rangeToRatio({start:o,end:a},t);r&&this.updateZoom(e,{[t]:r})}getZoom(){let e,t;if(this.axisZoomManagers.forEach(i=>{i.getDirection()==="x"?e??(e=i.getZoom()):i.getDirection()==="y"&&(t??(t=i.getZoom()))}),e||t)return{x:e,y:t}}getAxisZoom(e){return this.axisZoomManagers.get(e)?.getZoom()??{min:0,max:1}}getAxisZooms(){const e={};for(const[t,i]of this.axisZoomManagers.entries())e[t]={direction:i.getDirection(),zoom:i.getZoom()};return e}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(e){return this.getPrimaryAxis(e)?.id}isVisibleItemsCountAtLeast(e,t){const{autoScaleYAxis:i}=this,s=this.getPrimaryAxis("x"),n=this.getPrimaryAxis("y");let o;if(this.independentAxes){const c=new Set(s?.boundSeries??[]),h=new Set(n?.boundSeries??[]);o=new Set;for(const d of c)h.has(d)&&o.add(d)}else o=new Set([...s?.boundSeries??[],...n?.boundSeries??[]]);const a=[e.x.min,e.x.max],r=i.enabled&&!i.manuallyAdjusted?void 0:[e.y.min,e.y.max];let l=0;for(const c of o){const h=t-(l??0),d=c.getVisibleItems(a,r,h);if(l+=d,l>=t)return!0}return o.size===0}getMementoRanges(){const e=this.getDefinedZoom();let t;return this.autoScaleYAxis.enabled&&(t=this.autoScaleYAxis.manuallyAdjusted?[]:["y"]),{rangeX:this.getRangeDirection(e.x,"x"),rangeY:this.getRangeDirection(e.y,"y"),ratioX:{start:e.x.min,end:e.x.max},ratioY:{start:e.y.min,end:e.y.max},autoScaledAxes:t}}getAutoScaleYZoom(e){if(!this.isZoomEnabled())return;const{independentAxes:t,autoScaleYAxis:i}=this;if(!i.enabled||i.manuallyAdjusted)return;const{padding:s}=i;return e?.min===0&&e?.max===1?{min:0,max:1}:t?this.primaryAxisZoom("y",e,{padding:s}):this.combinedAxisZoom("y",e,{padding:s})}autoScaleYZoom(e,t=!0){const{independentAxes:i}=this,s=this.getZoom();if(s?.x==null)return;const n=this.getAutoScaleYZoom(s.x);if(!(n==null||Ci(s.y,n))){if(i){const o=this.getPrimaryAxis("y");(o==null?void 0:this.axisZoomManagers.get(o.id))?.updateZoom("zoom-manager",n)}else for(const o of this.axisZoomManagers.values())o.getDirection()==="y"&&o.updateZoom("zoom-manager",n);t&&this.applyChanges(e)}}applyChanges(e){if(this.autoScaleYZoom(e,!1),!Array.from(this.axisZoomManagers.values(),s=>s.applyChanges()).includes(!0))return;const i={};for(const[s,n]of this.axisZoomManagers.entries())i[s]=n.getZoom();this.eventsHub.emit("zoom:change",{...this.getZoom(),axes:i,callerId:e}),this.eventsHub.on("layout:complete",this.boundFireOnceChartEvent)}fireOnceChartEvent(){this.fireChartEvent({type:"zoom",...this.getMementoRanges()}),this.eventsHub.off("layout:complete",this.boundFireOnceChartEvent)}getRangeDirection(e,t){const i=this.getPrimaryAxis(t);if(!i||!ft.is(i.scale)&&!wo.is(i.scale))return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,o]=s;let a,r;return n<=o?(a=i.scale.invert(0),r=i.scale.invert(n+(o-n)*e.max)):(a=i.scale.invert(n-(n-o)*e.min),r=i.scale.invert(0)),{start:a,end:r}}rangeToRatio(e,t){const i=this.getPrimaryAxis(t);if(!i)return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,o]=s,{scale:a}=i,{start:r,end:l}=e,[c=0,h=1]=rL(r,l);let d=e.start==null?n:a.convert(e.start,{alignment:c}),u=e.end==null?o:a.convert(e.end,{alignment:h})+(a.bandwidth??0);if(!Ye(d)||!Ye(u))return;const[p,g]=[Math.min(n,o),Math.max(n,o)];if(d<p||d>g){X.warnOnce(`Invalid range start [${e.start}], expecting a value between [${a.invert(n)}] and [${a.invert?.(o)}], ignoring.`);return}if(u<p||u>g){X.warnOnce(`Invalid range end [${e.end}], expecting a value between [${a.invert(n)}] and [${a.invert?.(o)}], ignoring.`);return}d=Math.min(g,Math.max(p,d)),u=Math.min(g,Math.max(p,u));const f=o-n,x=Math.abs((d-n)/f),m=Math.abs((u-n)/f);return{min:x,max:m}}getPrimaryAxis(e){return this.axes?.find(t=>t.direction===e)}getDomainExtents(e){const{domain:t}=e.scale,i=t.at(0),s=t.at(-1);if(!(i==null||s==null))return[i,s]}getDomainPixelExtents(e){const[t,i]=e.scale.range;if(!(!Ye(t)||!Ye(i)))return[t,i]}getDefinedZoom(){const e=this.getZoom();return{x:{min:e?.x?.min??0,max:e?.x?.max??1},y:{min:e?.y?.min??0,max:e?.y?.max??1}}}zoomBounds(e,t,i,s){const n=e.scale,o=n.range;n.range=[0,1];const a=t.scale,r=a.range;a.range=[0,1];let l=1,c=!1,h=0,d=!1;for(const g of t.boundSeries){if(!g.visible)continue;const{connectsToYAxis:f}=g,x=g.getRange("y",[i.min,i.max]);for(const m of x){const b=a.convert(m);Number.isFinite(b)&&(b<l&&(l=b,c=!f||m<0),b>h&&(h=b,d=!f||m>0))}}if(Ye(t.min)&&(l=0),Ye(t.max)&&(h=1),n.range=o,a.range=r,l>=h)return;const u=(c?s:0)+(d?s:0),p=Math.min((h-l)*(1+u),1);if(!(p<=0)){if(c&&d){const g=(h+l)/2;l=g-p/2,h=g+p/2}else!c&&d?h=l+p:c&&!d&&(l=h-p);return l<0?(h+=-l,l=0):h>1&&(l-=h-1,h=1),{min:l,max:h}}}primaryAxisZoom(e,t,{padding:i=0}={}){const s=e==="x"?"y":"x",n=this.getPrimaryAxis(s),o=this.getPrimaryAxis(e);if(!(n==null||o==null))return this.zoomBounds(n,o,t,i)}combinedAxisZoom(e,t,{padding:i=0}={}){const s=e==="x"?"y":"x",n=new Map;for(const l of this.axes)if(l.direction===s)for(const c of l.boundSeries)n.set(c,l);let o=1,a=0;for(const l of this.axes)if(l.direction===e)for(const c of l.boundSeries){const h=n.get(c);if(h==null)continue;const d=this.zoomBounds(h,l,t,i);if(d==null)return;o=Math.min(o,d.min),a=Math.max(a,d.max)}const r=1e-6;if(o<r&&(o=0),a>1-r&&(a=1),!(o>a))return{min:o,max:a}}},vj=class{constructor(e){this.axis=e;const[t=0,i=1]=e.visibleRange;this.state=new Zh({min:t,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(e,t){this.state.set(e,t)}getZoom(){return Ot(this.state.stateValue())}hasChanges(){const e=this.currentZoom,t=this.state.stateValue();return e.min!==t.min||e.max!==t.max}applyChanges(){const e=this.hasChanges();return this.currentZoom=this.state.stateValue(),e}},ZS=(e=>(e[e.Caption=0]="Caption",e[e.Legend=1]="Legend",e[e.ToolbarLeft=2]="ToolbarLeft",e[e.ToolbarBottom=3]="ToolbarBottom",e[e.Navigator=4]="Navigator",e[e.Overlay=5]="Overlay",e))(ZS||{}),hL=class{constructor(e){this.eventsHub=e,this.elements=new Map}registerElement(e,t){return this.elements.has(e)?this.elements.get(e).add(t):this.elements.set(e,new Set([t])),()=>this.elements.get(e)?.delete(t)}createContext(e,t){const i=new Sj(e,t);for(const s of Object.values(ZS))typeof s=="number"&&this.elements.get(s)?.forEach(n=>n(i));return i}emitLayoutComplete(e,t){const{width:i,height:s}=e;this.eventsHub.emit("layout:complete",{axes:t.axes??[],chart:{width:i,height:s},clipSeries:t.clipSeries??!1,series:t.series})}},Sj=class{constructor(e,t){this.width=e,this.height=t,this.layoutBox=new de(0,0,e,t)}};function Mj({point:e,anchor:t},i,s,n,o){if(e.size===0)return!1;let a=e.x,r=e.y;t!=null&&(a-=(t.x-.5)*e.size,r-=(t.y-.5)*e.size);let l=a;a<i?l=i:a>i+n&&(l=i+n);let c=r;r<s?c=s:r>s+o&&(c=s+o);const h=a-l,d=r-c;return Math.sqrt(h*h+d*d)<=e.size*.5}function Dj(e){return e!=null&&typeof e.point=="object"&&typeof e.label=="object"}var Aj={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 Ij(e,t,i=5){const s=new Map,n=[],o=new Map([...e.entries()].map(([r,l])=>[r,l.toSorted((c,h)=>h.point.size-c.point.size)])),a=[...o.values()].flat();for(const[r,l]of o.entries()){const c=[];if(l[0]?.label){for(let h=0,d=l.length;h<d;h++){const u=l[h],{point:p,label:g,anchor:f}=u,{text:x,width:m,height:b}=g,v=p.size*.5;let S=0,D=0;if(v>0&&u.placement!=null){const O=Aj[u.placement];S=(m*.5+v+i)*O.x,D=(b*.5+v+i)*O.y}const C=p.x-m*.5+S-((f?.x??.5)-.5)*p.size,T=p.y-b*.5+D-((f?.y??.5)-.5)*p.size;if(!Hv(t,C,T,m,b)||a.some(O=>Mj(O,C,T,m,b))||n.some(O=>Zk(O,C,T,m,b)))continue;const w={index:h,text:x,x:C,y:T,width:m,height:b,datum:u};c.push(w),n.push(w)}s.set(r,c)}}return s}var kj=class{constructor(){this.labelData=new Map}updateLabels(e,t,i=de.zero){const s={x:-t.left,y:-t.top,width:i.width+t.left+t.right,height:i.height+t.top+t.bottom},n=new Set(e.map(a=>a.id));for(const a of this.labelData.keys())n.has(a)||this.labelData.delete(a);for(const a of e){const r=a.getLabelData();r.every(Dj)&&this.labelData.set(a.id,r)}const o=Ij(this.labelData,s,5);for(const a of e)a.updatePlacedLabelData?.(o.get(a.id)??[])}},Cj=class{constructor(e){this.eventsHub=e,this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:e,isFixed:t})=>!e&&!t).map(({enabled:e,seriesId:t,itemId:i,legendItemName:s})=>({visible:e,seriesId:t,itemId:i,legendItemName:s}))}guardMemento(e){return e==null||Ue(e)}restoreMemento(e,t,i){i?.forEach(s=>{const{seriesId:n,data:o}=this.getRestoredData(s)??{};!n||!o||this.updateData(n,o)}),this.update()}getRestoredData(e){const{seriesId:t,itemId:i,legendItemName:s,visible:n}=e;if(t){const a=(this.legendDataMap.get(t)??[]).map(r=>{const l=r.seriesId===t&&(!i||r.itemId===i);return l&&r.isFixed&&this.warnFixed(r.seriesId,r.itemId),!r.isFixed&&l?{...r,enabled:n}:r});return{seriesId:t,data:a}}if(!(i==null&&s==null))for(const o of this.getData()){if(i!=null&&o.itemId!==i||s!=null&&o.legendItemName!==s)continue;if(o.isFixed){this.warnFixed(o.seriesId,i);return}const a=(this.legendDataMap.get(o.seriesId)??[]).map(r=>r.itemId===i||r.legendItemName===s?{...r,enabled:n}:r);return{seriesId:o.seriesId,data:a}}}warnFixed(e,t){X.warnOnce(`The legend item with seriesId [${e}] and itemId [${t}] is not configurable, this series item cannot be toggled through the legend.`)}update(e){this.eventsHub.emit("legend:change",{legendData:e??this.getData()})}updateData(e,t=[]){this.legendDataMap.set(e,t)}clearData(){this.legendDataMap.clear()}toggleItem(e,t,i,s){if(s){this.getData().forEach(r=>{const l=(this.legendDataMap.get(r.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:e}:c);this.updateData(r.seriesId,l)});return}const n=this.getData(t),o=n.length===1,a=n.map(r=>i==null&&o||r.itemId===i?{...r,enabled:e}:r);this.updateData(t,a)}getData(e){return e?this.legendDataMap.get(e)??[]:[...this.legendDataMap].reduce((t,[i,s])=>t.concat(s),[])}getDatum({seriesId:e,itemId:t}={}){return this.getData(e).find(i=>i.itemId===t)}getSeriesEnabled(e){const t=this.getData(e);if(t.length>0)return t.some(i=>i.enabled)}getItemEnabled({seriesId:e,itemId:t}={}){return this.getDatum({seriesId:e,itemId:t})?.enabled??!0}},Tj=class{constructor(){this.groups=new Map}registerSeries({internalId:e,seriesGrouping:t,visible:i,type:s}){if(!t)return;let n=this.groups.get(s);n==null&&(n=new Map,this.groups.set(s,n)),n.set(e,{grouping:t,visible:i})}updateSeries({internalId:e,seriesGrouping:t,visible:i,type:s}){if(!t)return;const n=this.groups.get(s)?.get(e);n&&(n.grouping=t,n.visible=i)}deregisterSeries({internalId:e,type:t}){const i=this.groups.get(t);i!=null&&(i.delete(e),i.size===0&&this.groups.delete(t))}getVisiblePeerGroupIndex({type:e,seriesGrouping:t,visible:i}){if(!t)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,n=new Set,o=this.groups.get(e);for(const r of o?.values()??[])r.visible&&(s.add(r.grouping.groupIndex),r.grouping.groupIndex===t.groupIndex&&n.add(r.grouping.stackIndex));const a=Array.from(s);return a.sort((r,l)=>r-l),{visibleGroupCount:a.length,visibleSameStackCount:n.size,index:a.indexOf(t.groupIndex)}}},dL=class{constructor(e){this.updateCallback=e,this.events=new Io}addListener(e,t){return this.events.on(e,t)}destroy(){this.events.clear()}update(e=0,t){this.updateCallback(e,t)}dispatchUpdateComplete(e){this.events.emit("update-complete",{type:"update-complete",apiUpdate:e})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:e}){this.events.emit("process-data",{type:"process-data",series:e})}},Lj=class{constructor(e,t){this.eventsHub=new Io,this.callbackCache=new WC,this.highlightManager=new ZT(this.eventsHub),this.formatManager=new Jh,this.layoutManager=new hL(this.eventsHub),this.localeManager=new v4(this.eventsHub),this.seriesStateManager=new Tj,this.stateManager=new t4,this.seriesLabelLayoutManager=new kj,this.cleanup=new mt,this.contextModules=[];const{scene:i,root:s,syncManager:n,container:o,fireEvent:a,updateCallback:r,updateMutex:l,styleContainer:c,chartType:h,domMode:d,withDragInterpretation:u}=t;this.chartService=e,this.syncManager=n,this.domManager=new vT(this.eventsHub,this.chartService,o,c,d),this.widgets=new sj(this.domManager,{withDragInterpretation:u});const p=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new fy({canvasElement:p}),this.scene.setRoot(s),this.cleanup.register(this.scene.on("scene-changed",()=>{this.updateService.update(7)})),this.axisManager=new A4(this.eventsHub,s),this.legendManager=new Cj(this.eventsHub),this.annotationManager=new D4(this.eventsHub,e.annotationRoot,a),this.chartTypeOriginator=new JV(e),this.interactionManager=new WT,this.contextMenuRegistry=new KT(this.eventsHub),this.updateService=new dL(r),this.proxyInteractionService=new kT(this.eventsHub,this.localeManager,this.domManager),this.fontManager=new I4(this.domManager,this.updateService),this.historyManager=new e4(this.eventsHub),this.animationManager=new UT(this.interactionManager,l),this.dataService=new yy(this.eventsHub,e,this.animationManager),this.tooltipManager=new Sy(this.eventsHub,this.localeManager,this.domManager,e.tooltip),this.zoomManager=new cL(this.eventsHub,a);for(const g of da.byType("context")){if(!g.chartTypes.includes(h))continue;const f=g.moduleFactory(this);this.contextModules.push(f),this[g.contextKey]=f}}destroy(){this.animationManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.domManager.destroy(),this.fontManager.destroy(),this.proxyInteractionService.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.contextModules.forEach(e=>e.destroy()),this.cleanup.flush()}},uL=class extends we{constructor(){super(...arguments),this.range="tooltip"}};M([I],uL.prototype,"range",2);function wj(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function Nj(e,t){if(e==null||t==null)return e===t;if(e.size!==t.size)return!1;for(const[i,s]of e){const n=t.get(i);if(n==null||!wj(s,n))return!1}return!0}function Ej(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1){const{type:s,idsMap:n,scopes:o,data:a,...r}=e[i],{type:l,idsMap:c,scopes:h,data:d,...u}=t[i];if(s!==l||o&&h&&!jn(o,h)||a&&d&&a!==d||!Ci(r,u)||!Nj(n,c))return!1}return!0}function Oj(e,t){const{props:i,...s}=e,{props:n,...o}=t;return Ci(s,o)&&Ej(i,n)}function Pj(e,t,i,s){return t===e.data&&jn(i,e.ids)&&Oj(s,e.opts)}var pL=class l_{constructor(){this.domain=new Set}static is(t){return t instanceof l_}extend(t){this.domain.add(t)}getDomain(){return Array.from(this.domain)}},Jr=class c_{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof c_}static extendDomain(t,i=[1/0,-1/0]){for(const s of t)typeof s=="number"&&(i[0]>s&&(i[0]=s),i[1]<s&&(i[1]=s));return i}extend(t){this.domain[0]>t&&(this.domain[0]=t),this.domain[1]<t&&(this.domain[1]=t)}getDomain(){return[...this.domain]}},id=0,sd=1,ga=2,Rj=class{constructor(e){const t=e.reduce((o,a)=>Math.max(o,a.length),0);let s=1<<32-Math.clz32(t);t===s/2&&(s=s>>>1),this.maxLevelSize=s;const n=new Float64Array((s*2-1)*2).fill(NaN);for(const o of e)for(let a=0;a<o.length;a+=1){const r=Number(o[a]),l=s+a-1,c=(l*ga|0)+id,h=(l*ga|0)+sd,d=n[c],u=n[h];(!Number.isFinite(d)||r<d)&&(n[c]=r),(!Number.isFinite(u)||r>u)&&(n[h]=r)}for(let o=s/2|0;o>=1;o=o/2|0){const a=o-1|0,r=a+o|0;for(let l=0;l<o;l+=1){const c=a+l,h=r+l*2,d=h+1,u=n[(h*ga|0)+id],p=n[(d*ga|0)+id];n[(c*ga|0)+id]=!Number.isFinite(p)||u<p?u:p;const g=n[(h*ga|0)+sd],f=n[(d*ga|0)+sd];n[(c*ga|0)+sd]=!Number.isFinite(f)||g>f?g:f}}this.buffer=n}computeRangeInto(e,t,i,s,n,o,a){const r=n+o-1;if(r<t||n>=i)return a;if(n>=t&&r<i){const l=e[(s*ga|0)+id],c=e[(s*ga|0)+sd];Number.isFinite(l)&&(a[0]=Math.min(a[0],l)),Number.isFinite(c)&&(a[1]=Math.max(a[1],c))}else o>1&&(s=s*2|0,o=o/2|0,this.computeRangeInto(e,t,i,s+1|0,n,o,a),this.computeRangeInto(e,t,i,s+2|0,n+o,o,a));return a}rangeBetween(e,t){if(e>t)return[NaN,NaN];const{maxLevelSize:i,buffer:s}=this,n=[1/0,-1/0];return this.computeRangeInto(s,e,t,0,0,i,n),n}get range(){const{buffer:e}=this;return[e[id],e[sd]]}};function Bj(e){if(e.length<=1)return 1;let t=0,i=e[0];for(let s=1;s<e.length;s++){const n=e[s];if(n==null)continue;if(typeof n.valueOf()!="number")return;const a=Math.sign(n-i);if(a!==0){if(t!==0&&t!==a)return;t=a}i=n}return t===0?1:t}var gL=Symbol("key-sort-orders"),fL=Symbol("column-sort-orders"),yL=Symbol("domain-ranges");function Fj(e){return e.map(t=>Fe(t)?JSON.stringify(t):t).join("-")}function vn(e){const t=e?.map(Number);return t?.every(Number.isFinite)?t:[]}function mL(e,t){return t?.get(e.id)??0}function zj(e){return"scopes"in e&&Array.isArray(e.scopes)}function XS(e,t){const i=[];for(let s=0;s<e;s+=1)i[s]=t;return i}function Dy(e,t,i){const s=[];for(const n of e){const o=n.get(t)?.[i];if(o==null)return;s.push(o)}return s}function xL(e){const t=[];let i=0,s;const n=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;s=n.exec(e);){if(s.index!==i)return;i=s.index+s[0].length;const o=s[1].trim();if(o.startsWith("."))t.push(o.slice(1).trim());else if(o.startsWith("[")){const a=o.slice(1,-1).trim();a.startsWith("'")?t.push(a.slice(1,-1).replace(/(?<!\\)\\'/g,"'")):a.startsWith('"')?t.push(a.slice(1,-1).replace(/(?<!\\)\\"/g,'"')):t.push(a)}else t.push(o)}if(i===e.length)return t}function _j(e){return t=>{let i=t;for(const s of e)i=i[s];return i}}var bL=class{constructor(e,t="standalone",i=!1){this.opts=e,this.mode=t,this.suppressFieldDotNotation=i,this.debug=Be.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[],this.markScopeDatumInvalid=function(r,l,c,h){for(const d of r)h.has(d)||h.set(d,XS(l.length,!1)),h.get(d)[c]=!0};let s=!0;for(const r of e.props){if(r.type==="key"&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");r.type==="value"&&s&&(s=!1)}const n=({matchGroupIds:r=[]})=>{for(const l of r)if(this.values.every(c=>c.groupId!==l))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${l}).`)},o=new Set,a=new Set;for(const r of e.props){const l=r.type==="key"?o:a;switch(zj(r)&&r.scopes?.forEach(c=>l.add(c)),r.type){case"key":this.keys.push({...r,index:this.keys.length,missing:new Map});break;case"value":if(r.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(r)}`);this.values.push({...r,index:this.values.length,missing:new Map});break;case"aggregate":n(r),this.aggregates.push({...r,index:this.aggregates.length});break;case"group-value-processor":n(r),this.groupProcessors.push({...r,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...r,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...r,index:this.reducers.length});break;case"processor":this.processors.push({...r,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const r=new Set(a.values());if(o.forEach(l=>r.delete(l)),r.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...r.values()]}`)}}resolveProcessedDataDefById(e,t){const i=this.scopeCache.get(e.id)?.get(t);if(!i)throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(e,t){return this.resolveProcessedDataDefById(e,t).index}resolveKeysById(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.keys[s];if(n==null)throw new Error(`AG Charts - didn't find keys for [${t}, ${e.id}]`);return n.get(e.id)}hasColumnById(e,t){return this.scopeCache.get(e.id)?.get(t)!=null}resolveColumnById(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.columns?.[s];if(n==null)throw new Error(`AG Charts - didn't find column for [${t}, ${e.id}]`);return n}*forEachDatum(e,t,i){const s=t.columnScopes.findIndex(n=>n.has(e.id));for(const n of i.datumIndices[s]??[])yield t.columns[s][n]}*forEachGroupDatum(e,t){const i=t.columnScopes.findIndex(o=>o.has(e.id)),s={groupIndex:0,columnIndex:i},n=[];for(const o of t.groups){s.group=o;for(const a of o.datumIndices[i]??n)s.datumIndex=a,yield s;s.groupIndex++}}*forEachGroupDatumTuple(e,t){const s={columnIndex:t.columnScopes.findIndex(n=>n.has(e.id)),datumIndexes:[void 0,void 0,void 0]};for(const n of this.forEachGroupDatum(e,t))s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=n.group,s.nextGroupIndex=n.groupIndex,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=n.datumIndex,s.group!=null&&s.datumIndexes[1]!=null&&(yield s);s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=void 0,s.nextGroupIndex=void 0,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=void 0,s.group!=null&&s.datumIndexes[1]!=null&&(yield s)}getDomain(e,t,i,s){return this.getDomainsByType(i??"value",s)?.[this.resolveProcessedDataIndexById(e,t)]??[]}getDomainBetweenRange(e,t,[i,s],n){const o=t.map(c=>this.resolveProcessedDataIndexById(e,c)),a=o.join(":"),r=n[yL];let l=r.get(a);if(l==null){const c=o.map(h=>n.columns[h]);l=new Rj(c),r.set(a,l)}return l.rangeBetween(i,s)}getSortOrder(e,t,i){let s=i.get(t);return s==null&&(s={sortOrder:Bj(e)},i.set(t,s)),s.sortOrder}getKeySortOrder(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.keys[s]?.get(e.id);return n?this.getSortOrder(n,s,i[gL]):void 0}getColumnSortOrder(e,t,i){const s=this.resolveProcessedDataIndexById(e,t);return this.getSortOrder(i.columns[s],s,i[fL])}getDomainsByType(e,t){switch(e){case"key":return t.domain.keys;case"value":return t.domain.values;case"aggregate":return t.domain.aggValues;case"group-value-processor":return t.domain.groups;default:return null}}processData(e){const{opts:{groupByKeys:t,groupByFn:i},aggregates:s,groupProcessors:n,reducers:o,processors:a,propertyProcessors:r}=this,l=performance.now();if(t&&this.keys.length===0)return;let c=this.extractData(e);t?c=this.groupData(c):i&&(c=this.groupData(c,i(c))),n.length>0&&c.type==="grouped"&&this.postProcessGroups(c),s.length>0&&c.type==="ungrouped"?this.aggregateUngroupedData(c):s.length>0&&c.type==="grouped"&&this.aggregateGroupedData(c),r.length>0&&this.postProcessProperties(c),o.length>0&&this.reduceData(c),a.length>0&&this.postProcessData(c),this.warnDataMissingProperties(e);const h=performance.now();return c.time=h-l,this.debug.check()&&Gj(c),this.processScopeCache(),c}warnDataMissingProperties(e){if(e.size!==0)for(const t of rc(this.keys,this.values))for(const[i,s]of t.missing){if(s<(e.get(i)?.length??1/0))continue;const n=i==null?"":` for ${i}`;X.warnOnce(`the key '${t.property}' was not found in any data element${n}.`)}}processScopeCache(){this.scopeCache.clear();for(const e of rc(this.keys,this.values,this.aggregates))if(e.idsMap)for(const[t,i]of e.idsMap)for(const s of i)if(!this.scopeCache.has(t))this.scopeCache.set(t,new Map([[s,e]]));else{if(this.scopeCache.get(t)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(t).set(s,e)}}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,s]of this.values.entries())(!e||s.groupId&&e.includes(s.groupId))&&t.push(i);return t}valueIdxLookup(e,t){const i=e==null||e.length===0,s=typeof t=="string"?t:t.id,n=a=>{if(a.idsMap){for(const[r,l]of a.idsMap)if(e?.includes(r)&&l.has(s))return!0}return!1},o=this.values.reduce((a,r,l)=>((r.scopes==null||i&&!r.scopes.length||r.scopes.some(h=>e?.includes(h)))&&(r.property===s||r.id===s||n(r))&&a.push(l),a),[]);if(o.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return o}extractData(e){const{dataDomain:t,processValue:i,allScopesHaveSameDefs:s}=this.initDataDomainProcessor(),{keys:n,values:o}=this,{invalidData:a,invalidKeys:r,invalidKeyCount:l,allKeyMappings:c}=this.extractKeys(n,e,i),{columns:h,columnScopes:d,partialValidDataCount:u,maxDataLength:p}=this.extractValues(a,o,e,r,i),g=f=>{const x=t.get(f),m=x.getDomain();return Jr.is(x)&&m[0]>m[1]?[]:m};return{type:"ungrouped",input:{count:p},scopes:new Set(e.keys()),dataSources:e,aggregation:void 0,keys:[...c.values()],columns:h,columnScopes:d,invalidKeys:r,invalidKeyCount:l,invalidData:a,domain:{keys:n.map(g),values:o.map(g)},defs:{allScopesHaveSameDefs:s,keys:n,values:o},partialValidDataCount:u,time:0,[yL]:new Map,[gL]:new Map,[fL]:new Map}}extractKeys(e,t,i){const s=new Map,n=new Map,o=new Map,a=new Map;let r,l;const c=(h,d)=>{const u=l.get(h);r.set(d,r.get(u)),s.has(u)&&(s.set(d,s.get(u)),n.set(d,n.get(u)))};for(const h of e){const{invalidValue:d,scopes:u}=h;r=new Map,l=new Map,a.set(h,r);for(const p of u??[]){const g=t.get(p)??[];if(l.has(g)){c(g,p);continue}const f=[];r.set(p,f),l.set(g,p);let x,m,b=0;for(let v=0;v<g.length;v++){if(g[v]==null||typeof g[v]!="object")continue;const S=i(h,g[v],v,p);if(S.valid){f.push(S.value);continue}f.push(d),x??(x=XS(g.length,!1)),m??(m=XS(g.length,!1)),b+=1,x[v]=!0,m[v]=!0}x&&m&&(s.set(p,x),n.set(p,m),o.set(p,b))}}return{invalidData:n,invalidKeys:s,invalidKeyCount:o,allKeyMappings:a}}extractValues(e,t,i,s,n){let o=0;const a=[],r=[];let l=0;for(const c of t){const{invalidValue:h}=c;if(new Set(c.scopes.map(m=>i.get(m))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(c)}`);const u=new Set(c.scopes),p=_u(c.scopes),g=i.get(p),f=new Array,x=s.get(p);for(let m=0;m<g.length;m++){if(g[m]==null||typeof g[m]!="object")continue;const b=g[m],v=x!=null?x[m]:!1,S=n(c,b,m,c.scopes);let D=S.value;(v||!S.valid)&&this.markScopeDatumInvalid(c.scopes,g,m,e),v?D=h:S.valid||(o+=1,D=h),f[m]=D}a.push(f),r.push(u),l=Math.max(l,f.length)}return{columns:a,columnScopes:r,partialValidDataCount:o,maxDataLength:l}}groupData(e,t){var i;const{keys:s,columns:n,columnScopes:o,invalidKeys:a,invalidData:r}=e,l=e.scopes,c=[],h=[],d=new Set,u=l.size!==1||t!=null?new Map:void 0;for(const p of l){const g=n.map((S,D)=>D).filter(S=>!d.has(S)&&o[S].has(p));if(g.length===0)continue;for(const S of g)d.add(S);const f=new Set;for(const S of g)for(const D of o[S])f.add(D);const x=s.map(S=>S.get(p)).filter(S=>S!=null),m=n[_u(g)],b=r?.get(p),v=a?.get(p);for(let S=0;S<m.length;S++){if(v?.[S]===!0)continue;const D=x.map(L=>L[S]);if(D==null||D.length===0)throw new Error("AG Charts - no keys found for scope: "+p);const C=t?.(D)??D,T=u!=null?Fj(C):void 0;let k=u?.get(T);if(k==null&&(k={keys:C,datumIndices:[],aggregation:[],validScopes:l},u?.set(T,k),c.push(k.keys),h.push(k)),b?.[S]===!0){k.validScopes===l&&(k.validScopes=new Set(l.values()));for(const L of f)k.validScopes.delete(L)}for(const L of g)(i=k.datumIndices)[L]??(i[L]=[]),k.datumIndices[L].push(S)}}return{...e,type:"grouped",domain:{...e.domain,groups:c},groups:h}}aggregateUngroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{keys:i,columns:s,dataSources:n}=e,o=_u(n.keys()),a=n.get(o);e.aggregation=a?.map((r,l)=>{const c=[];for(const[h,d]of this.aggregates.entries()){const u=this.valueGroupIdxLookup(d);let p=d.groupAggregateFunction?.()??[1/0,-1/0];const g=u.map(b=>s[b][l]),f=Dy(i,o,l),x=f!=null?d.aggregateFunction(g,f):void 0;x&&(p=d.groupAggregateFunction?.(x,p)??Jr.extendDomain(x,p));const m=d.finalFunction?.(p)??p;c[h]=m,Jr.extendDomain(m,t[h])}return c})}aggregateGroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{columns:i}=e;for(const[s,n]of this.aggregates.entries()){const o=this.valueGroupIdxLookup(n);for(const a of e.groups){a.aggregation??(a.aggregation=[]);const r=a.keys;let l=n.groupAggregateFunction?.()??[1/0,-1/0];const c=Math.max(...o.map(d=>a.datumIndices[d]?.length??0));for(let d=0;d<c;d++){const u=o.map(g=>i[g][a.datumIndices[g]?.[d]]),p=n.aggregateFunction(u,r);p&&(l=n.groupAggregateFunction?.(p,l)??Jr.extendDomain(p,l))}const h=n.finalFunction?.(l)??l;a.aggregation[s]=h,Jr.extendDomain(h,t[s])}}}postProcessGroups(e){const{groupProcessors:t}=this,{columnScopes:i,columns:s,invalidData:n}=e;for(const o of t){const a=this.valueGroupIdxLookup(o),r=o.adjust()();for(const l of e.groups)r(s,a,l);for(const l of a){const h=this.values[l].valueType==="category",d=s[l],u=_u(i[l]),p=n?.get(u),g=h?new pL:new Jr;for(let f=0;f<d.length;f+=1)p?.[f]!==!0&&g.extend(d[f]);e.domain.values[l]=g.getDomain()}}}postProcessProperties(e){for(const{adjust:t,property:i,scopes:s}of this.propertyProcessors)for(const n of this.valueIdxLookup(s,i))t()(e,n)}reduceData(e){e.reduced??(e.reduced={});const{dataSources:t,keys:i}=e;for(const s of this.reducers){const n=s.reducer();let o=s.initialValue;if(e.type==="grouped")for(const a of e.groups)o=n(o,a.keys);else{const a=_u(t.keys()),r=i.map(h=>h.get(a)).filter(h=>h!=null),l=r.map(()=>{}),c=t.get(a);for(let h=0;h<c.length;h+=1){for(let d=0;d<l.length;d++)l[d]=r[d]?.[h];o=n(o,l)}}e.reduced[s.property]=o}}postProcessData(e){e.reduced??(e.reduced={});for(const t of this.processors)e.reduced[t.property]=t.calculate(e,e.reduced[t.property])}initDataDomainProcessor(){const{keys:e,values:t}=this,i=new Set;for(const h of t)if(h.scopes)for(const d of h.scopes)i.add(d);const s=new Map,n=new Map;let o=!0;const a=()=>{for(const h of rc(e,t))h.valueType==="category"?s.set(h,new pL):(s.set(h,new Jr),o&&(o=(h.scopes?.length??0)===i.size))};a();const r=this.buildAccessors(rc(e,t)),l={value:void 0,missing:!1,valid:!1};return{dataDomain:s,processValue:(h,d,u,p)=>{let g,f;if(r.has(h.property)){try{f=r.get(h.property)(d)}catch{}g=f!=null}else g=h.property in d,f=g?d[h.property]:h.missingValue;h.forceValue!=null&&(f=g&&$v(f)?-1*h.forceValue:h.forceValue,g=!0),l.missing=!g;const x="missingValue"in h;if(!g&&!x)if(typeof p=="string"){const m=h.missing.get(p)??0;h.missing.set(p,m+1)}else for(const m of p){const b=h.missing.get(m)??0;h.missing.set(m,b+1)}if(s.has(h)||a(),g&&h.validation?.(f,d,u)===!1)if(l.valid=!1,"invalidValue"in h)f=h.invalidValue;else return this.mode!=="integrated"&&X.warnOnce(`invalid value of type [${typeof f}] for [${h.scopes} / ${h.id}] ignored:`,`[${f}]`),l.value=void 0,l;else l.valid=!0;if(h.processor){let m=n.get(h);m==null&&(m=h.processor(),n.set(h,m)),f=m(f,u)}return s.get(h)?.extend(f),l.value=f,l},initDataDomain:a,scopes:i,allScopesHaveSameDefs:o}}buildAccessors(e){const t=new Map;if(this.suppressFieldDotNotation)return t;for(const i of e){if(!(i.property.includes(".")||i.property.includes("[")))continue;const n=xL(i.property);if(n==null){X.warnOnce("Invalid property path [%s]",i.property);continue}const o=_j(n);t.set(i.property,o)}return t}};function Gj(e){const t=(i,s)=>{s.length>0&&(X.log(`DataModel.processData() - ${i}`),X.table(s))};X.log("DataModel.processData() - processedData",e),t("Key Domains",e.domain.keys),t("Group Domains",e.domain.groups??[]),t("Value Domains",e.domain.values),t("Aggregate Domains",e.domain.aggValues??[])}var qS=class Wa{constructor(t,i){this.mode=t,this.suppressFieldDotNotation=i,this.debug=Be.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(t,i,s){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((n,o)=>{this.requested.push({id:t,opts:s,data:i,resolve:n,reject:o})})}execute(t){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const i=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",i);const s=this.mergeRequested(i);this.debug("DataController.execute() - merged",s),this.debug.check()&&(Ze().processedData=[]);const n=[];for(const{data:o,ids:a,opts:r,resolves:l,rejects:c}of s){const h=t?.find(p=>Pj(p,o,a,r));let d,u;if(h==null)try{d=new bL(r,this.mode,this.suppressFieldDotNotation);const p=new Map(i.map(g=>[g.id,g.data]));u=d.processData(p)}catch(p){c.forEach(g=>g(p));continue}else({dataModel:d,processedData:u}=h);n.push({opts:r,data:o,ids:a,dataModel:d,processedData:u}),this.debug.check()&&Ze("processedData").push(u),u?.partialValidDataCount===0?l.forEach(p=>p({dataModel:d,processedData:u})):u?this.splitResult(d,u,a,l):c.forEach(p=>p(new Error("AG Charts - no processed data generated")))}return n}validateRequests(t){const i=[];for(const[s,n]of t.entries())s>0&&n.data.length!==t[0].data.length&&n.opts.groupByData===!1&&n.opts.groupByKeys===!1?n.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(n);return i}mergeRequested(t){const i=[];for(const s of t){const n=i.find(Wa.groupMatch(s));n?n.push(s):i.push([s])}return i.map(Wa.mergeRequests)}splitResult(t,i,s,n){for(let o=0;o<s.length;o++){const a=n[o];a({dataModel:t,processedData:i})}}static groupMatch({data:t,opts:i}){function s(c){return c.filter(h=>h.type==="key").map(h=>h.property).join(";")}const{groupByData:n,groupByKeys:o=!1,groupByFn:a,props:r}=i,l=s(r);return([c])=>(n===!1||c.data===t)&&(c.opts.groupByKeys??!1)===o&&c.opts.groupByFn===a&&s(c.opts.props)===l}static mergeRequests(t){const i={ids:[],rejects:[],resolves:[],data:t[0].data,opts:{...t[0].opts,props:[]}},s=new Map,n=new Map;let o=0;for(const a of t){const{id:r,data:l,resolve:c,reject:h,opts:{props:d,...u}}=a;i.ids.push(r),i.rejects.push(h),i.resolves.push(c),i.data??(i.data=l),i.opts??(i.opts={...u,props:[]});for(const p of d){const g={...p,scopes:[r],data:l};Wa.createIdsMap(r,g);let f;Wa.crossScopeMergableTypes.has(g.type)?f=-1:n.has(l)?f=n.get(l):(f=o++,n.set(l,f));const x=`${g.type}-${f}-${g.groupId}`,m=s.get(x),b=m?.find(v=>Wa.deepEqual(v,g));if(m==null){i.opts.props.push(g),s.set(x,[g]);continue}else if(b==null){i.opts.props.push(g),m.push(g);continue}g.scopes!=null&&(b.scopes??(b.scopes=[]),b.scopes.push(...g.scopes)),(b.type==="key"||b.type==="value")&&g.idsMap?.size&&(b.idsMap??(b.idsMap=new Map),Wa.mergeIdsMap(g.idsMap,b.idsMap))}}return i}static mergeIdsMap(t,i){for(const[s,n]of t){const o=i.get(s);if(o==null)i.set(s,new Set(n));else for(const a of n)o.add(a)}}static createIdsMap(t,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(t)?i.idsMap.get(t).add(i.id):i.idsMap.set(t,new Set([i.id])))}static deepEqual(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;let s,n;if(Array.isArray(t)){if(n=t.length,n!==i.length)return!1;for(s=n-1;s>=0;s--)if(!Wa.deepEqual(t[s],i[s]))return!1;return!0}const o=Object.keys(t);if(n=o.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const a=o[s];if(!Wa.skipKeys.has(a)&&(!Object.hasOwn(i,a)||!Wa.deepEqual(t[a],i[a])))return!1}return!0}return!1}};qS.crossScopeMergableTypes=new Set(["key","group-value-processor"]),qS.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var vL=qS,Vj=class{constructor(){this.axesMap=new Map,this.themeTemplates=new Map}register(e,t){this.axesMap.set(e,t.moduleFactory),t.themeTemplate&&this.setThemeTemplate(e,t.themeTemplate)}create(e,t){const i=this.axesMap.get(e);if(i)return i(t);throw new Error(`AG Charts - unknown axis type: ${e}`)}has(e){return this.axesMap.has(e)}keys(){return this.axesMap.keys()}setThemeTemplate(e,t){return this.themeTemplates.set(e,t),this}getThemeTemplate(e){return this.themeTemplates.get(e)}},mc=new Vj,dp=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","topology","standalone"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","topology","standalone"],optionsInnerKey:"image"},{type:"root",optionsKey:"foreground",chartTypes:["cartesian","polar","topology","standalone"],optionsInnerKey:"image"},{type:"root",optionsKey:"chartToolbar",chartTypes:["cartesian"]},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","topology","standalone"]},{type:"root",optionsKey:"statusBar",chartTypes:["cartesian"],identifier:"status-bar"},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","topology","standalone"]},{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","topology","standalone"],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:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"axis-option",optionsKey:"bandHighlight",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:["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:["standalone"],identifier:"pyramid"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"linear-gauge"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"radial-gauge"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"chord"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"sankey"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"},{type:"context",contextKey:"sharedToolbar",chartTypes:["cartesian"]}];function Ay(e){return dp.find(t=>t.type==="series"&&t.identifier===e)?.chartTypes}function jj(e){return Ay(e)?.find(i=>i==="cartesian")==="cartesian"}function Hj(e){return Ay(e)?.find(i=>i==="polar")==="polar"}function Wj(e){return Ay(e)?.find(i=>i==="topology")==="topology"}function $j(e){return Ay(e)?.find(i=>i==="standalone")==="standalone"}function Uj(e){return e.packageType==="enterprise"}function Yj(e){if(!Uj(e))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const t=dp.find(i=>i.type===e.type&&("optionsKey"in i&&"optionsKey"in e?i.optionsKey===e.optionsKey:!0)&&("contextKey"in i&&"contextKey"in e?i.contextKey===e.contextKey:!0)&&i.identifier===e.identifier&&e.chartTypes.every(s=>i.chartTypes.includes(s)));return t&&(t.useCount??(t.useCount=0),t.useCount++),t!=null}function Kj(){return dp.filter(({useCount:e})=>e==null||e===0)}var Zj=class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(e,{optionsKey:t,moduleFactory:i,themeTemplate:s}){this.legendMap.set(e,{optionsKey:t,moduleFactory:i}),this.themeTemplates.set(t,s)}create(e,t){const i=this.legendMap.get(e)?.moduleFactory;if(i)return i(t);throw new Error(`AG Charts - unknown legend type: ${e}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((e,[t,i])=>(e[t]=i.optionsKey,e),{})}},QS=new Zj,SL=class extends Map{get(e){return super.get(e)??"unknown"}isCartesian(e){return this.get(e)==="cartesian"}isPolar(e){return this.get(e)==="polar"}isTopology(e){return this.get(e)==="topology"}isStandalone(e){return this.get(e)==="standalone"}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(e=>this.isCartesian(e))}get polarTypes(){return this.seriesTypes.filter(e=>this.isPolar(e))}get topologyTypes(){return this.seriesTypes.filter(e=>this.isTopology(e))}get standaloneTypes(){return this.seriesTypes.filter(e=>this.isStandalone(e))}},Xj=class extends Map{set(e,t){return super.set(e,et(t,this.get(e)))}},ji=new SL,qj=new SL,JS=new Xj,Qj=class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(e,{chartTypes:[t],moduleFactory:i,defaultAxes:s,themeTemplate:n,solo:o,stackable:a,groupable:r,stackedByDefault:l,hidden:c}){this.setThemeTemplate(e,n),this.seriesMap.set(e,{moduleFactory:i,defaultAxes:s,solo:o,stackable:a,groupable:r,stackedByDefault:l}),ji.set(e,t),c||qj.set(e,t)}create(e,t){const i=this.seriesMap.get(e)?.moduleFactory;if(i)return i(t);throw new Error(`AG Charts - unknown series type: ${e}`)}cloneDefaultAxes(e){const t=this.seriesMap.get(e)?.defaultAxes;return t==null?null:{axes:Ot(t)}}setThemeTemplate(e,t){const i=this.themeTemplates.get(e);this.themeTemplates.set(e,et(t,i))}getThemeTemplate(e){return this.themeTemplates.get(e)}isSolo(e){return this.seriesMap.get(e)?.solo??!1}isGroupable(e){return this.seriesMap.get(e)?.groupable??!1}isStackable(e){return this.seriesMap.get(e)?.stackable??!1}isStackedByDefault(e){return this.seriesMap.get(e)?.stackedByDefault??!1}},No=new Qj,e0=class Vr{constructor(t){this.chart=t}subscribe(t=Vr.DEFAULT_GROUP){let i=this.get(t);return i||(i={members:new Set},Vr.chartsGroups.set(t,i)),i.members.add(this.chart),this}unsubscribe(t=Vr.DEFAULT_GROUP){const i=this.get(t);return i?.members.delete(this.chart),delete i?.domains?.x?.sources?.[this.chart.id],delete i?.domains?.y?.sources?.[this.chart.id],this}getChart(){return this.chart}getGroupState(t=Vr.DEFAULT_GROUP){return this.get(t)}getGroupMembers(t=Vr.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i.members):[]}getGroupSiblings(t=Vr.DEFAULT_GROUP){return this.getGroupMembers(t).filter(i=>i!==this.chart)}getGroupSyncMode(t=Vr.DEFAULT_GROUP){return this.getGroupMembers(t).some(i=>i.series.length>1)?"multi-series":"single-series"}get(t){return Vr.chartsGroups.get(t)}};e0.chartsGroups=new Map,e0.DEFAULT_GROUP=Symbol("sync-group-default");var Jj=e0,t0=class extends we{constructor(){super(...arguments),this.enabled=!1}};M([I],t0.prototype,"enabled",2),M([I],t0.prototype,"tabIndex",2);var ML={};gn(ML,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Eo,fromToMotion:()=>Li,staticFromToMotion:()=>tr});var Eo={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Li(e,t,i,s,n,o,a){const{fromFn:r,toFn:l,applyFn:c=(g,f)=>g.setProperties(f)}=n,{nodes:h,selections:d}=vy(s),u=(g,f)=>{let x,m=0,b=0;for(const v of f){const S=g[m]===v,D={last:b>=f.length-1,lastLive:m>=g.length-1,prev:f[b-1],prevFromProps:x,prevLive:g[m-1],next:f[b+1],nextLive:g[m+(S?1:0)]},C=`${e}_${t}_${v.id}`;i.stopByAnimationId(C);let T="unknown";S?o&&a&&(T=eH(v,v.datum,o,a)):T="removed",v.transitionOut=T==="removed";const{phase:k,start:L,finish:N,delay:w,duration:O,...R}=r(v,v.datum,T,D),{phase:B,start:P,finish:_,delay:F,duration:W,...H}=l(v,v.datum,T,D),j=N==null;i.animate({id:C,groupId:e,phase:k??B??"update",duration:O??W,delay:w??F,from:R,to:H,ease:rp,collapsable:j,onPlay:()=>{const V={...L,...P,...R};c(v,V,"start")},onUpdate(V){c(v,V,"update")},onStop:()=>{const V={...L,...P,...R,...H,...N,..._};c(v,V,"end")}}),S&&m++,b++,x=R}};let p=0;for(const g of d){const f=g.nodes(),x=f.filter(m=>!g.isGarbage(m));u(x,f),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:rp,onStop(){g.cleanup()}}),p++}u(h,h)}function tr(e,t,i,s,n,o,a){const{nodes:r,selections:l}=vy(s),{start:c,finish:h,phase:d}=a;i.animate({id:`${e}_${t}`,groupId:e,phase:d??"update",from:n,to:o,ease:rp,onPlay:()=>{if(c){for(const u of r)u.setProperties(c);for(const u of l)for(const p of u.nodes())p.setProperties(c)}},onUpdate(u){for(const p of r)p.setProperties(u);for(const p of l)for(const g of p.nodes())g.setProperties(u)},onStop:()=>{for(const u of r)u.setProperties({...o,...h});for(const u of l){for(const p of u.nodes())p.setProperties({...o,...h});u.cleanup()}}})}function eH(e,t,i,s){const n=i(e,t);return s.added.has(n)?"added":s.removed.has(n)?"removed":e.previousDatum==null&&e.datum!=null?"added":e.previousDatum!=null&&e.datum==null?"removed":"updated"}var DL={};gn(DL,{resetMotion:()=>ls});function ls(e,t){const{nodes:i,selections:s}=vy(e);for(const n of s){for(const o of n.nodes()){const a=t(o,o.datum);o.setProperties(a)}n.cleanup()}for(const n of i){const o=t(n,n.datum);n.setProperties(o)}}var Ts=class Oh{constructor(t,i,s=!0){this.parentNode=t,this.autoCleanup=s,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=Be.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(Ya,i)?()=>new i:i}static select(t,i,s=!0){return new Oh(t,i,s)}static selectAll(t,i){const s=[],n=o=>{if(i(o)&&s.push(o),o instanceof Re)for(const a of o.children())n(a)};return n(t),s}static selectByClass(t,...i){return Oh.selectAll(t,s=>i.some(n=>s instanceof n))}static selectByTag(t,i){return Oh.selectAll(t,s=>s.tag===i)}createNode(t,i,s){const n=this.nodeFactory(t);return n.datum=t,i?.(n),s==null?this._nodes.push(n):this._nodes.splice(s,0,n),this.parentNode.appendChild(n),n}update(t,i,s){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",t),s){const n=new Map,o=new Map;for(let a=0;a<t.length;a++){const r=t[a];let l=s(r);if(n.has(l)){const c=(o.get(l)??0)+1;o.set(l,c),l=`${l}:${c}`}n.set(l,a)}for(const[a,r]of this._nodesMap.entries()){const l=n.get(r);l==null?this.garbageBin.add(a):(a.datum=t[l],this.garbageBin.delete(a),n.delete(r))}for(const[a,r]of n.entries()){const l=t[r];this._nodesMap.set(this.createNode(l,i,r),a)}}else{const n=Math.max(t.length,this.data.length);for(let o=0;o<n;o++)o>=t.length?this.garbageBin.add(this._nodes[o]):o>=this._nodes.length?this.createNode(t[o],i):(this._nodes[o].datum=t[o],this.garbageBin.delete(this._nodes[o]))}return this.data=t.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return this.garbageBin.size===0?this:(this._nodes=this._nodes.filter(t=>this.garbageBin.has(t)?(this._nodesMap.delete(t),this.garbageBin.delete(t),t.destroy(),!1):!0),this)}clear(){return this.update([]),this}isGarbage(t){return this.garbageBin.has(t)}each(t){for(const i of this._nodes.entries())t(i[1],i[1].datum,i[0]);return this}*[Symbol.iterator](){for(let t=0;t<this._nodes.length;t++){const i=this._nodes[t];yield{node:i,datum:i.datum,index:t}}}select(t){return Oh.selectAll(this.parentNode,t)}selectByClass(t){return Oh.selectByClass(this.parentNode,t)}selectByTag(t){return Oh.selectByTag(this.parentNode,t)}nodes(){return this._nodes}at(t){return this._nodes.at(t)}get length(){return this._nodes.length}},Sn=class extends gi{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.fill=void 0,this.strokeWidth=1}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new de(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(e,t){return this.x1===this.x2||this.y1===this.y2?this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(e,t):!1}distanceSquared(e,t){const{x1:i,y1:s,x2:n,y2:o}=this;return ey(e,t,i,s,n,o,1/0)}render(e){const{ctx:t,devicePixelRatio:i}=e;let{x1:s,y1:n,x2:o,y2:a}=this;if(s===o){const{strokeWidth:r}=this,l=Math.round(s*i)/i+Math.trunc(r*i)%2/(i*2);s=l,o=l}else if(n===a){const{strokeWidth:r}=this,l=Math.round(n*i)/i+Math.trunc(r*i)%2/(i*2);n=l,a=l}t.beginPath(),t.moveTo(s,n),t.lineTo(o,a),this.fillStroke(t),this.fillShadow?.markClean(),super.render(e)}toSVG(){if(!this.visible)return;const e=ti("line");return e.setAttribute("x1",String(this.x1)),e.setAttribute("y1",String(this.y1)),e.setAttribute("x2",String(this.x2)),e.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(e),{elements:[e]}}};Sn.className="Line",M([te()],Sn.prototype,"x1",2),M([te()],Sn.prototype,"y1",2),M([te()],Sn.prototype,"x2",2),M([te()],Sn.prototype,"y2",2);var i0="color: green",s0="color: grey";function tH(){return uC(()=>{})}function n0(e,t){const i=Ur(t);if(i.length===0)return;const s=pC(e);for(const n of i)n in s&&(t[n]=s[n])}var AL=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},o0=class un extends AL{constructor(t,i,s){super(),this.defaultState=t,this.states=i,this.enterEach=s,this.debug=Be.create(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,i0)}transition(t,i){if(!this.transitionChild(t,i)||this.state===un.child||this.state===un.parent)return;const n=this.state,o=this.states[this.state];let a=o[t];const r=`%c${this.constructor.name} | ${this.state} -> ${t} ->`;if(Array.isArray(a))a=a.find(h=>{if(!h.guard)return!0;const d=h.guard(i);return d||this.debug(`${r} (guarded)`,h.target,s0),d});else if(typeof a=="object"&&!(a instanceof un)&&a.guard&&!a.guard(i)){this.debug(`${r} (guarded)`,a.target,s0);return}if(!a){this.debug(`${r} ${this.state}`,s0);return}const l=this.getDestinationState(a),c=l===this.state?void 0:o.onExit;this.debug(`${r} ${l}`,i0),this.state=l,typeof a=="function"?a(i):typeof a=="object"&&!(a instanceof un)&&a.action?.(i),c?.(),this.enterEach?.(n,l),l!==n&&l!==un.child&&l!==un.parent&&this.states[l].onEnter?.(n,i)}transitionAsync(t,i){setTimeout(()=>{this.transition(t,i)},0)}is(t){return this.state===un.child&&this.childState?this.childState.is(t):this.state===t}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(t,i){return this.state!==un.child||!this.childState||(n0(this,this.childState),this.childState.transition(t,i),!this.childState.is(un.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,i0),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(t){let i=this.state;return typeof t=="string"?i=t:t instanceof un?(this.childState=t,this.childState.parent=this,i=un.child):typeof t=="object"&&(t.target instanceof un?(this.childState=t.target,this.childState.parent=this,i=un.child):t.target!=null&&(i=t.target)),i}};o0.child="__child",o0.parent="__parent";var up=o0,iH=class extends AL{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const i of this.stateMachines)n0(this,i),i.transition(e,t)}transitionAsync(e,t){for(const i of this.stateMachines)n0(this,i),i.transitionAsync(e,t)}},nd=1e3,el=nd*60,xc=el*60,bc=xc*24,IL=bc*7,a0=bc*30,pp=bc*365,od=new Date().getTimezoneOffset()*el,gp={millisecond:{milliseconds:1,hierarchy:"day",encode(e){return e.getTime()},decode(e){return new Date(e)}},second:{milliseconds:nd,hierarchy:"day",encode(e,t){const i=t?0:od;return Math.floor((e.getTime()-i)/nd)},decode(e,t){const i=t?0:od;return new Date(i+e*nd)}},minute:{milliseconds:el,hierarchy:"day",encode(e,t){const i=t?0:od;return Math.floor((e.getTime()-i)/el)},decode(e,t){const i=t?0:od;return new Date(i+e*el)}},hour:{milliseconds:xc,hierarchy:"day",encode(e,t){const i=t?0:od;return Math.floor((e.getTime()-i)/xc)},decode(e,t){const i=t?0:od;return new Date(i+e*xc)}},day:{milliseconds:bc,hierarchy:"month",encode(e,t){const i=t?0:e.getTimezoneOffset()*el;return Math.floor((e.getTime()-i)/bc)},decode(e,t){let i;return t?(i=new Date(0),i.setUTCDate(i.getUTCDate()+e),i.setUTCHours(0,0,0,0)):(i=new Date(1970,0,1),i.setDate(i.getDate()+e)),i}},month:{milliseconds:a0,hierarchy:"year",encode(e,t){return t?e.getUTCFullYear()*12+e.getUTCMonth():e.getFullYear()*12+e.getMonth()},decode(e,t){if(t){const i=Math.floor(e/12),s=e-i*12;return new Date(Date.UTC(i,s,1))}else{const i=Math.floor(e/12),s=e-i*12;return new Date(i,s,1)}}},year:{milliseconds:pp,hierarchy:void 0,encode(e,t){return t?e.getUTCFullYear():e.getFullYear()},decode(e,t){let i;return t?(i=new Date,i.setUTCFullYear(e),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)):i=new Date(e,0,1,0,0,0,0),i}}};function fp(e){return typeof e=="string"?{unit:e,step:1,epoch:void 0,utc:!1}:{unit:e.unit,step:e.step??1,epoch:e.epoch,utc:e.utc??!1}}function yp(e,t,i,s){if(i==null)return 0;const n=gp[e];return Math.floor(n.encode(new Date(i),s))%t}function ad(e,t,i,s,n){const o=gp[t];return Math.floor((o.encode(new Date(e),s)-n)/i)}function mp(e,t,i,s,n){return gp[t].decode(e*i+n,s)}function Iy(e,t,i,s,n){const o=new Date(e),a=ad(o,t,i,s,n);return mp(a,t,i,s,n)}function ky(e,t,i,s,n){const o=new Date(Number(e)-1),a=ad(o,t,i,s,n);return mp(a+1,t,i,s,n)}function $n(e,t){const{unit:i,step:s,epoch:n,utc:o}=fp(e),a=yp(i,s,n,o);return Iy(t,i,s,o,a)}function kL(e,t){const{unit:i,step:s,epoch:n,utc:o}=fp(e),a=yp(i,s,n,o);return ky(t,i,s,o,a)}function CL(e,t){const{unit:i,step:s,epoch:n,utc:o}=fp(e),a=yp(i,s,n,o);return mp(ad(ky(t,i,s,o,a),i,s,o,a)-1,i,s,o,a)}function TL(e,t){const{unit:i,step:s,epoch:n,utc:o}=fp(e),a=yp(i,s,n,o);return mp(ad(Iy(t,i,s,o,a),i,s,o,a)+1,i,s,o,a)}function r0(e,t,i){if(e.valueOf()>t.valueOf()&&([e,t]=[t,e],i!=null&&(i=[1-i[1],1-i[0]])),i!=null){const s=t.valueOf()-e.valueOf(),n=e.valueOf();e=new Date(n+i[0]*s),t=new Date(n+i[1]*s)}return[new Date(e),new Date(t)]}function Cy(e,t,i,{extend:s=!1,visibleRange:n=[0,1],limit:o,defaultAlignment:a="start"}={}){const r=fp(e),{unit:l,step:c,utc:h}=r;let d;r.epoch!=null?d=r.epoch:a==="interval"?d=void 0:t.valueOf()>i.valueOf()?d=i:d=t;const u=yp(r.unit,r.step,d,r.utc);let[p,g]=r0(t,i,n);p=s?Iy(p,l,c,h,u):ky(p,l,c,h,u),g=s?ky(g,l,c,h,u):Iy(g,l,c,h,u);const f=ad(p,l,c,h,u);let x=ad(g,l,c,h,u);return o!=null&&x-f>o&&(x=f+o),{range:[f,x],unit:l,step:c,utc:h,offset:u}}function l0(e,t,i,s){const{range:[n,o]}=Cy(e,t,i,s);return Math.abs(o-n)}function Un(e,t,i,s){const{range:[n,o],unit:a,step:r,utc:l,offset:c}=Cy(e,t,i,s),h=[];for(let d=n;d<=o;d+=1){const u=mp(d,a,r,l,c);h.push(u)}return h}function Ty(e,t,i,{extend:s,visibleRange:n,limit:o,defaultAlignment:a}={}){const{range:[r]}=Cy(e,t,i,{extend:s,visibleRange:n,limit:o,defaultAlignment:a}),{range:[l]}=Cy(e,t,i,{extend:s,limit:o,defaultAlignment:a});return r-l}function fa(e){return typeof e=="string"?e:e.unit}function tl(e){return typeof e=="string"?1:e.step??1}function xp(e){return typeof e=="string"?void 0:e.epoch}function bp(e){return gp[fa(e)].hierarchy}function js(e){return tl(e)*gp[fa(e)].milliseconds}var vc=class{constructor(){this.enabled=!0}};M([I],vc.prototype,"enabled",2),M([I],vc.prototype,"stroke",2),M([I],vc.prototype,"strokeWidth",2),M([I],vc.prototype,"strokeOpacity",2);var Vt=class extends we{constructor(){super(...arguments),this.enabled=!0,this.border=new vc,this._cachedFormatter=void 0}formatValue(e,t,i,s){const{formatter:n,format:o}=this;let a;if(n!=null&&(a??(a=e(n,s))),o!=null){let r=this._cachedFormatter;(r==null||r.type!==t||r.format!==o)&&(r={type:t,format:o,formatter:Jh.getFormatter(t,o)},this._cachedFormatter=r),a??(a=r.formatter?.(i))}return a!=null?String(a):void 0}};M([I],Vt.prototype,"enabled",2),M([I],Vt.prototype,"border",2),M([I],Vt.prototype,"color",2),M([I],Vt.prototype,"cornerRadius",2),M([I],Vt.prototype,"fill",2),M([I],Vt.prototype,"fillOpacity",2),M([I],Vt.prototype,"fontStyle",2),M([I],Vt.prototype,"fontWeight",2),M([I],Vt.prototype,"fontSize",2),M([I],Vt.prototype,"fontFamily",2),M([I],Vt.prototype,"formatter",2),M([I],Vt.prototype,"format",2),M([I],Vt.prototype,"padding",2),M([I],Vt.prototype,"itemStyler",2);function rd(e){const{enabled:t=!1,stroke:i}=e?.border??{},n=e?.fill!=null||t&&i!=null?e?.padding:null;if(n==null)return{bottom:0,left:0,right:0,top:0};if(typeof n=="number")return{bottom:n,left:n,right:n,top:n};{const{bottom:o=0,left:a=0,right:r=0,top:l=0}=n;return{bottom:o,left:a,right:r,top:l}}}function sH(e,t,i=0,s=0){const n=Ka(e),o=!n&&s>=0&&s<=Math.PI?-1:1,a=!n&&i>=0&&i<=Math.PI?-1:1;let r=0;return t?r=o*Math.PI/2:a===-1&&(r=Math.PI),{configuredRotation:n,defaultRotation:r,parallelFlipFlag:o,regularFlipFlag:a}}function nH(e,t){return e??(t?0:10)}function oH(e,t,i,s){return e&&!t?i*s===-1?"top":"bottom":"middle"}function aH(e,t,i,s,n){const o=t>0&&t<=Math.PI,a=i>0&&i<=Math.PI,r=o||a?-1:1;if(e)if(t||i){if(s*r===-1)return"end"}else return"center";else if(s*n===-1)return"end";return"start"}function c0(e,t){if(e!=null){if(typeof e=="string")return e;if(Je(e)&&t!=null)return e[fa(t)]}}function rH(e,t,i,s,n){const o=c0(e.format,s)??(typeof e.format=="string"?e.format:void 0);if(o==null)return{width:0,height:0};const a=yc(o),r=s?bp(s):void 0,l=c0(t?.format,r),c=l?yc(l):a,h=new Date(i[0]),d=new Date(i[i.length-1]),u=r?Un(r,new Date(i[0]),new Date(i[i.length-1]),{extend:!0}):void 0;let p=0,g=0;if(a!=null){const f=rd(e),x=f.left+f.right,m=f.top+f.bottom;let b,v;u!=null&&u.length>1?(b=u[0],v=u[1]):(b=h,v=d);const S=Un(s,b,v,{limit:50});for(const D of S){const C=a(D),{width:T,height:k}=n.measureLines(C);p=Math.max(p,T+x),g=Math.max(g,k+m)}}if(c!=null&&u!=null){const f=rd(t),x=f.left+f.right,m=f.top+f.bottom;for(const b of u){const v=c(b),{width:S,height:D}=n.measureLines(v);p=Math.max(p,S+x),g=Math.max(g,D+m)}}return{width:Math.ceil(p),height:Math.ceil(g)}}function lH(e,t,i,s,n){const o=rd(n),a=o.left+o.right,r=o.top+o.bottom,l=[];for(const{tickLabel:c,translation:h}of e){if(!c)continue;const{x:d,y:u}=i.transformBBox(new de(t,h,0,0)),p=s.measureLines(c),g=p.width+a,f=p.height+r;l.push({point:{x:d,y:u},label:{text:c,width:g,height:f}})}return l}function cH({width:e,height:t,spacing:i},s,n){const o=[];for(const a of[0,i]){const{x:r,y:l}=n.transformBBox(new de(s,a,0,0));o.push({point:{x:r,y:l},label:{text:void 0,width:e,height:t}})}return o}var h0=class{constructor(){this.moduleMap=new Map}*modules(){for(const e of this.moduleMap.values())yield e.moduleInstance}addModule(e,t){if(this.moduleMap.has(e.optionsKey))throw new Error(`AG Charts - module already initialised: ${e.optionsKey}`);this.moduleMap.set(e.optionsKey,{module:e,moduleInstance:t(e)})}removeModule(e){const t=ki(e)?e:e.optionsKey;this.moduleMap.get(t)?.moduleInstance.destroy(),this.moduleMap.delete(t)}getModule(e){return this.moduleMap.get(ki(e)?e:e.optionsKey)?.moduleInstance}isEnabled(e){return this.moduleMap.has(ki(e)?e:e.optionsKey)}mapModules(e){return Array.from(this.moduleMap.values(),(t,i)=>e(t.moduleInstance,i))}destroy(){for(const e of this.moduleMap.keys())this.moduleMap.get(e)?.moduleInstance.destroy();this.moduleMap.clear()}},ya=class extends gi{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.horizontal=!1,this.strokeWidth=1}computeBBox(){return new de(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(e,t){return!1}render(e){const{ctx:t}=e;let{x1:i,y1:s,x2:n,y2:o}=this;i=this.align(i),s=this.align(s),n=this.align(n),o=this.align(o);const{fill:a,horizontal:r}=this,{globalAlpha:l}=t;a!=null&&(this.applyFillAndAlpha(t),t.beginPath(),t.moveTo(i,s),t.lineTo(n,s),t.lineTo(n,o),t.lineTo(i,o),t.closePath(),t.fill(),t.globalAlpha=l);const{stroke:c,strokeWidth:h,startLine:d,endLine:u}=this;if(!!((d||u)&&c&&h)){const{lineDash:g,lineDashOffset:f,lineCap:x,lineJoin:m}=this;this.applyStrokeAndAlpha(t),t.lineWidth=h,g&&t.setLineDash([...g]),f&&(t.lineDashOffset=f),x&&(t.lineCap=x),m&&(t.lineJoin=m),t.beginPath(),d&&(t.moveTo(i,s),r?t.lineTo(i,o):t.lineTo(n,s)),u&&(t.moveTo(n,o),r?t.lineTo(n,s):t.lineTo(i,o)),t.stroke(),t.globalAlpha=l}this.fillShadow?.markClean(),super.render(e)}};ya.className="Range",M([te()],ya.prototype,"x1",2),M([te()],ya.prototype,"y1",2),M([te()],ya.prototype,"x2",2),M([te()],ya.prototype,"y2",2),M([te()],ya.prototype,"startLine",2),M([te()],ya.prototype,"endLine",2),M([te()],ya.prototype,"horizontal",2);function hH(e){return e!=null&&Object.hasOwn(e,"toString")&&ki(e.toString())}function dH(e){return e!=null&&Object.hasOwn(e,"valueOf")&&Ye(e.valueOf())}function Ly(e){return Ye(e)||Ph(e)||dH(e)}function uH(e,t){return e!=null&&(!t||Ly(e))}function d0(e){return hH(e)&&Object.hasOwn(e,"id")?e.id:e}function LL(e){switch(e.type){case"line":return e.value;case"range":return e.range}}function wL(e,t){const i=LL(e);if(i==null)return!1;const s=ft.is(t)||wo.is(t),n=o=>uH(o,s)&&!isNaN(t.convert(o,{clamp:!0}));if(e.type==="range"){const[o,a]=i;return n(o)&&n(a)}else return n(i)}var pH={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}},gH={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}},fH={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}},yH={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}},Yn=class extends we{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};M([I],Yn.prototype,"enabled",2),M([I],Yn.prototype,"text",2),M([I],Yn.prototype,"fontStyle",2),M([I],Yn.prototype,"fontWeight",2),M([I],Yn.prototype,"fontSize",2),M([I],Yn.prototype,"fontFamily",2),M([I],Yn.prototype,"padding",2),M([I],Yn.prototype,"color",2),M([I],Yn.prototype,"position",2),M([I],Yn.prototype,"rotation",2),M([I],Yn.prototype,"parallel",2);var Hs=class extends we{constructor(){super(),this.id=ns(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new Yn,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.position="top",this.rangeGroup=new Re({name:this.id}),this.lineGroup=new Re({name:this.id}),this.labelGroup=new Re({name:this.id}),this.crossLineRange=new ya,this.crossLineLabel=new Yh,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(e){const{enabled:t,type:i,data:s,scale:n}=this;if(!n||!t||!e||!wL(this,n)||s==null){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateNodes();const o=i==="range";o!==this._isRange&&(o?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=o}calculateLayout(e){if(this.data=void 0,!e)return;const{type:t,range:i,value:s,scale:n,clippedRange:o,strokeWidth:a=0}=this;if(!n)return;const r=n.bandwidth??0,l=n.step??0,c=n instanceof er?(l-r)/2:0;let[h,d]=Vi(o);h-=r,d+=r;let u,p,g,f;if(t==="line"){const x=r/2;if(u=n.convert(s)+x,p=NaN,g=n.convert(s,{clamp:!0})+x,f=NaN,g>=d||g<=h)return}else if(i){const[x,m]=i,[b,v]=rL(x,m);if(u=n.convert(x,{alignment:b}),p=n.convert(m,{alignment:v}),g=n.convert(x,{clamp:!0,alignment:b}),f=n.convert(m,{clamp:!0,alignment:v}),g>f&&([g,f]=[f,g],[u,p]=[p,u]),g>=d||f<=h)return;Number.isFinite(u)&&(g-=c),Number.isFinite(p)&&(p+=r,f+=r+c)}else return;g=cp(g,o),f=cp(f,o),u-c>=g&&(u-=c),p+c<=f&&(p+=c),this.startLine=a>0&&u>=g&&u<=g+c,this.endLine=a>0&&p>=f-r-c&&p<=f,this.data=[g,f],this.label.enabled===!1||this.label.text}updateNodes(){const{position:e,data:[t,i]=[0,0],gridLength:s}=this,n=Number.isFinite(i)?i-t:0;let o;switch(e){case"top":case"bottom":o=new de(t,e==="top"?0:-s,n,s);break;case"left":case"right":o=new de(e==="left"?0:-s,t,s,n)}this.updateRangeNode(o);const{label:a}=this;a.enabled!==!1&&a.text&&(this.updateLabel(),this.positionLabel(o))}updateRangeNode(e){const{type:t,position:i,crossLineRange:s,startLine:n,endLine:o,fill:a,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d}=this;s.x1=e.x,s.x2=e.x+e.width,s.y1=e.y,s.y2=e.y+e.height,s.horizontal=i==="top"||i==="bottom",s.startLine=n,s.endLine=o,s.fill=t==="range"?a:void 0,s.fillOpacity=r??1,s.stroke=l,s.strokeWidth=c??1,s.strokeOpacity=h??1,s.lineDash=d}updateLabel(){const{crossLineLabel:e,label:t}=this;t.text&&(e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.fill=t.color,e.text=t.text)}get anchor(){const e=this.position==="left"||this.position==="right",t=this.type==="range",{position:i=this.defaultLabelPosition}=this.label;return t?(e?fH:yH)[i]:(e?pH:gH)[i]}positionLabel(e){const{crossLineLabel:t,label:i,anchor:s}=this;t.rotation=os(i.rotation??0),t.textBaseline="middle",t.textAlign="center";const n=t.getBBox();if(!n)return;const{width:o,height:a}=n,r=i.padding+o/2,l=i.padding+a/2,c=e.x+e.width*(s.rangeH+1)/2-r*s.labelH,h=e.y+e.height*(s.rangeV+1)/2-l*s.labelV;t.x=c,t.y=h,t.rotationCenterX=c,t.rotationCenterY=h}computeLabelSize(){const{label:e}=this;if(e.enabled===!1||!e.text)return;const t=new Yh;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text,t.rotation=os(e.rotation??0),t.textBaseline="middle",t.textAlign="center";const i=t.getBBox();if(!i)return;const{width:s,height:n}=i;return{width:s,height:n}}calculatePadding(e){const{label:t,anchor:i}=this,s=this.computeLabelSize();if(!s)return;const{width:n,height:o}=s,a=t.padding+n,r=t.padding+o,l=this.position==="left"||this.position==="right";l&&(i.rangeH===-1&&i.labelH===1?e.left=Math.max(e.left??0,a):i.rangeH===1&&i.labelH===-1&&(e.right=Math.max(e.right??0,a))),l||(i.rangeV===-1&&i.labelV===1?e.top=Math.max(e.top??0,r):i.rangeV===1&&i.labelV===-1&&(e.bottom=Math.max(e.bottom??0,r)))}};Hs.className="CrossLine",M([I],Hs.prototype,"enabled",2),M([I],Hs.prototype,"type",2),M([I],Hs.prototype,"range",2),M([I],Hs.prototype,"value",2),M([I],Hs.prototype,"defaultColorRange",2),M([I],Hs.prototype,"fill",2),M([I],Hs.prototype,"fillOpacity",2),M([I],Hs.prototype,"stroke",2),M([I],Hs.prototype,"strokeWidth",2),M([I],Hs.prototype,"strokeOpacity",2),M([I],Hs.prototype,"lineDash",2),M([I],Hs.prototype,"label",2);var wy=class{constructor(){this.enabled=!0,this.width=1,this.style=[{fill:void 0,fillOpacity:1,stroke:void 0,strokeWidth:void 0,lineDash:[]}]}};M([I],wy.prototype,"enabled",2),M([I],wy.prototype,"width",2),M([I],wy.prototype,"style",2);var Sc=class extends we{};M([I],Sc.prototype,"placement",2),M([I],Sc.prototype,"step",2),M([I],Sc.prototype,"values",2),M([I],Sc.prototype,"minSpacing",2),M([I],Sc.prototype,"maxSpacing",2);var Dt=class extends we{constructor(){super(...arguments),this.enabled=!0,this.border=new vc,this.wrapping="never",this.truncate=!1,this.spacing=5,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1,this._formatters={"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0}}getSideFlag(){return this.mirrored?1:-1}formatValue(e,t,i,s={dateStyle:"long",truncateDate:void 0}){const{formatter:n,format:o}=this,{type:a,value:r,domain:l,boundSeries:c}=t,h=t.type==="number"?t.fractionDigits:void 0,d=t.type==="date"?t.unit:void 0;let u;if(n!=null){const p=t.type==="date"?t.step:void 0;u=e(n,{value:r,index:i,domain:l,fractionDigits:h,unit:d,step:p,boundSeries:c})}if(o!=null&&u==null){const{specifier:p,dateStyle:g,truncateDate:f}=s,x=`${g}:${f??"none"}`;let m=this._formatters[x];const b=Jh.mergeSpecifiers(p,o);(m==null||m.type!==a||m.unit!==d||!Ci(m.mergedFormat,b))&&(m={type:a,mergedFormat:b,unit:d,formatter:Jh.getFormatter(a,b,d,g,s)},this._formatters[x]=m),u=m.formatter?.(r,h)}return u!=null?String(u):void 0}};M([I],Dt.prototype,"enabled",2),M([I],Dt.prototype,"border",2),M([I],Dt.prototype,"cornerRadius",2),M([I],Dt.prototype,"fill",2),M([I],Dt.prototype,"fillOpacity",2),M([I],Dt.prototype,"fontStyle",2),M([I],Dt.prototype,"fontWeight",2),M([I],Dt.prototype,"fontSize",2),M([I],Dt.prototype,"fontFamily",2),M([I],Dt.prototype,"wrapping",2),M([I],Dt.prototype,"truncate",2),M([I],Dt.prototype,"spacing",2),M([I],Dt.prototype,"minSpacing",2),M([I],Dt.prototype,"color",2),M([I],Dt.prototype,"rotation",2),M([I],Dt.prototype,"avoidCollisions",2),M([I],Dt.prototype,"mirrored",2),M([I],Dt.prototype,"padding",2),M([I],Dt.prototype,"parallel",2),M([I],Dt.prototype,"itemStyler",2),M([I],Dt.prototype,"formatter",2),M([I],Dt.prototype,"format",2);var Ny=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};M([I],Ny.prototype,"enabled",2),M([I],Ny.prototype,"width",2),M([I],Ny.prototype,"stroke",2);var Mc=class extends we{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};M([I],Mc.prototype,"enabled",2),M([I],Mc.prototype,"width",2),M([I],Mc.prototype,"size",2),M([I],Mc.prototype,"stroke",2);var Oo=class extends we{constructor(){super(...arguments),this.caption=new Pt,this.enabled=!1,this.spacing=Pt.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};M([I],Oo.prototype,"enabled",2),M([I],Oo.prototype,"text",2),M([I],Oo.prototype,"spacing",2),M([I],Oo.prototype,"fontStyle",2),M([I],Oo.prototype,"fontWeight",2),M([I],Oo.prototype,"fontSize",2),M([I],Oo.prototype,"fontFamily",2),M([I],Oo.prototype,"color",2),M([I],Oo.prototype,"wrapping",2),M([I],Oo.prototype,"formatter",2);var NL=(e=>(e[e.TickAndDomain=0]="TickAndDomain",e[e.TicksOnly=1]="TicksOnly",e[e.Off=2]="Off",e))(NL||{});function EL(e){const[t,i]=Vi(e.range),s=Math.floor(t),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var u0=Math.PI*2,mH=u0/2;function xH(e,t){return Math.abs(t-e)<mH?t:e>t?t+u0:t-u0}function OL(e){const{min:t,max:i}=e,s=l=>l<t||l>i;return{tick:{fromFn(l,c,h){let{x1:d,x2:u,y1:p,y2:g}=l,f=l.opacity;return(h==="added"||s(c.offset))&&({x1:d,x2:u,y1:p,y2:g}=c,f=0),{x1:d,x2:u,y1:p,y2:g,opacity:f,phase:Eo[h]}},toFn(l,c,h){const{x1:d,x2:u,y1:p,y2:g}=c;let f=1;return h==="removed"&&(f=0),{x1:d,x2:u,y1:p,y2:g,opacity:f}},applyFn(l,c){l.setProperties(c),l.visible=!s(l.y)}},line:{fromFn(l,c){const{x1:h,x2:d,y1:u,y2:p}=l.previousDatum??c;return{x1:h,x2:d,y1:u,y2:p,phase:Eo.updated}},toFn(l,c){const{x1:h,x2:d,y1:u,y2:p}=c;return{x1:h,x2:d,y1:u,y2:p}}},label:{fromFn(l,c,h){const d=l.previousDatum??c;let{x:u,y:p,rotationCenterX:g,rotationCenterY:f,rotation:x}=d,m=l.opacity;return h==="removed"||s(d.y)?x=c.rotation:(h==="added"||s(l.datum.y))&&({x:u,y:p,rotationCenterX:g,rotationCenterY:f,rotation:x}=c,m=0),{x:u,y:p,rotationCenterX:g,rotationCenterY:f,rotation:x,opacity:m,phase:Eo[h]}},toFn(l,c,h){const{x:d,y:u,rotationCenterX:p,rotationCenterY:g}=c;let f=0,x=1;return h==="added"?f=c.rotation:h==="removed"?(x=0,f=c.rotation):f=xH(l.previousDatum?.rotation??c.rotation,c.rotation),{x:d,y:u,rotationCenterX:p,rotationCenterY:g,rotation:f,opacity:x,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:h,translationY:d}=l;return{translationX:h,translationY:d,phase:Eo.updated}},toFn(l,c){const{translationX:h,translationY:d}=c;return{translationX:h,translationY:d}}}}}function PL(){return(e,t)=>({translationX:t.translationX,translationY:t.translationY})}function Ey(){return(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})}function p0(){return(e,t)=>{const{x1:i,x2:s,y1:n,y2:o}=t;return{x1:i,x2:s,y1:n,y2:o}}}function RL(){return(e,t)=>{const{x1:i,x2:s,y1:n,y2:o}=t;return{x:i,y:n,width:s-i,height:o-n}}}var BL=(e=>(e[e.TickLines=0]="TickLines",e[e.AxisLine=1]="AxisLine",e[e.TickLabels=2]="TickLabels",e))(BL||{});function FL(e,t){return e.domain===t.domain&&e.rangeExtent===t.rangeExtent&&e.nice===t.nice&&e.gridLength===t.gridLength&&e.visibleRange[0]===t.visibleRange[0]&&e.visibleRange[1]===t.visibleRange[1]&&e.initialPrimaryTickCount?.unzoomed===t.initialPrimaryTickCount?.unzoomed&&e.initialPrimaryTickCount?.zoomed===t.initialPrimaryTickCount?.zoomed}var ir=class h_{constructor(t,i){this.moduleCtx=t,this.scale=i,this.id=ns(this),this._crossLines=[],this.nice=!0,this.reverse=!1,this.keys=[],this.interval=new Sc,this.dataDomain={domain:[],clipped:!1},this.title=new Oo,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.layoutConstraints={stacked:!0,align:"start",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new Re({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new $h({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new $h({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new Re({name:`${this.id}-Labels`,zIndex:11}),this.gridGroup=new As({name:`${this.id}-Axis-grid`,zIndex:2}),this.gridFillGroup=this.gridGroup.appendChild(new Re({name:`${this.id}-gridFills`})),this.gridLineGroup=this.gridGroup.appendChild(new Re({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new $h({name:`${this.id}-CrossLines-Range`,zIndex:6}),this.crossLineLineGroup=new $h({name:`${this.id}-CrossLines-Line`,zIndex:10}),this.crossLineLabelGroup=new $h({name:`${this.id}-CrossLines-Label`,zIndex:15}),this.tickLabelGroupSelection=Ts.select(this.tickLabelGroup,Yh,!1),this.line=new Ny,this.tick=new Mc,this.gridLine=new wy,this.label=this.createLabel(),this.defaultTickMinSpacing=h_.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.cleanup=new mt,this.isHovering=!1,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.tickLayout=void 0,this.formatterBoundSeries=new SG(()=>{const{direction:s,boundSeries:n}=this;return Ua(n.flatMap(o=>o.getFormatterContext(s)))}),this.moduleMap=new h0,this.range=this.scale.range.slice(),this.crossLines.forEach(s=>this.initCrossLine(s)),this.cleanup.register(this.moduleCtx.widgets.containerWidget.addListener("mousemove",s=>this.onMouseMove(s)))}set crossLines(t){const{CrossLineConstructor:i}=this.constructor;this._crossLines.forEach(s=>this.detachCrossLine(s)),this._crossLines=t.map(s=>{const n=new i;return n.set(s),n}),this._crossLines.forEach(s=>{this.attachCrossLine(s),this.initCrossLine(s)})}get crossLines(){return this._crossLines}get type(){return this.constructor.type??""}get primaryLabel(){}get primaryTick(){}isCategoryLike(){return!1}resetAnimation(t){}onMouseMove(t){const s=this.tickLabelGroup.pickNode(t.currentX,t.currentY)?.datum,{textUntruncated:n=void 0}=s??{};n!=null?(this.moduleCtx.tooltipManager.updateTooltip(this.id,{canvasX:t.currentX,canvasY:t.currentY,showArrow:!1},[{type:"structured",title:n}]),this.isHovering=!0):this.isHovering&&(this.moduleCtx.tooltipManager.removeTooltip(this.id),this.isHovering=!1)}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.cleanup.flush()}setScaleRange(t){const{range:i,scale:s}=this,n=(i[1]-i[0])/(t[1]-t[0]),o=n*t[0],a=i[0]-o;s.range=[a,a+n]}updateScale(){const{range:[t,i]}=this;this.setScaleRange(this.visibleRange),this.crossLines.forEach(s=>{s.clippedRange=[t,i]})}setCrossLinesVisible(t){this.crossLineRangeGroup.visible=t,this.crossLineLineGroup.visible=t,this.crossLineLabelGroup.visible=t}attachAxis(t){t.gridNode.appendChild(this.gridGroup),t.axisNode.appendChild(this.axisGroup),t.labelNode.appendChild(this.labelGroup),t.crossLineRangeNode.appendChild(this.crossLineRangeGroup),t.crossLineLineNode.appendChild(this.crossLineLineGroup),t.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(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,i=0){const[s,n]=Vi(this.range);return t>=s-i&&t<=n+i}getRangeOverflow(t){const{range:i,visibleRange:s}=this,n=(i[1]-i[0])/(s[1]-s[0]),[o,a]=Vi([i[0]-n*s[0],i[0]-n*s[0]+n]);return t<o?t-o:t>a?t-a:0}createDatumFormatter(t,i){}onGridLengthChange(t,i){i^t&&this.onGridVisibilityChange(),this.crossLines.forEach(s=>this.initCrossLine(s))}onGridVisibilityChange(){}createLabel(){return new Dt}update(){this.formatterBoundSeries.clear(),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,i,s=this.label){const n={border:s.border,color:s.color,cornerRadius:s.cornerRadius,fill:s.fill,fillOpacity:s.fillOpacity,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,padding:s.padding,spacing:s.spacing};let o;s.itemStyler&&(o=this.cachedCallWithContext(s.itemStyler,{...t,...n}));const a=et(o,i,n);return{border:a.border,color:a.color,cornerRadius:a.cornerRadius,fill:a.fill,fillOpacity:a.fillOpacity,fontFamily:a.fontFamily,fontSize:a.fontSize,fontStyle:a.fontStyle,fontWeight:a.fontWeight,padding:a.padding,spacing:a.spacing}}getTickSize(t=this.tick){return t.enabled?t.size:0}processData(){this.invalidateLayoutCache();const{includeInvisibleDomains:t,boundSeries:i,direction:s}=this,o=(t?i:i.filter(a=>a.isEnabled())).map(a=>a.getDomain(s));this.setDomains(...o)}setDomains(...t){let i,s;t.length>0?{domain:i,animatable:s}=this.scale.normalizeDomains(...t):(i=[],s=!0),this.dataDomain=this.normaliseDataDomain(i),this.reverse&&this.dataDomain.domain.reverse(),this.animatable=s}calculateDomain(t){const{dataDomain:{domain:i},range:s,nice:n,scale:o,gridLength:a}=this,r=td(s),l=[0,1];this.updateScale();const{unzoomedTickLayoutCache:c}=this;let h;if(c==null||!FL(c,{domain:i,rangeExtent:r,nice:n,gridLength:a,visibleRange:l,initialPrimaryTickCount:t})){const d=o.range;this.setScaleRange([0,1]);const u=n?0:2;h=this.calculateTickLayout(i,u,[0,1],t),o.range=d,this.unzoomedTickLayoutCache={domain:i,rangeExtent:r,nice:n,gridLength:a,visibleRange:l,initialPrimaryTickCount:t,tickLayout:h}}else h=c.tickLayout;return this.updateScale(),o.domain=h.niceDomain,{unzoomedTickLayout:h,domain:o.domain}}calculateLayout(t,i){this.chartLayout=i;const{visibleRange:s,nice:n}=this,o=s[0]===0&&s[1]===1,{unzoomedTickLayout:a,domain:r}=this.calculateDomain(t);let l;if(o)l=a;else{const{range:g,gridLength:f}=this,x=td(g),m=n?1:2,{tickLayoutCache:b}=this;b==null||!FL(b,{domain:r,rangeExtent:x,nice:n,gridLength:f,visibleRange:s,initialPrimaryTickCount:t})?(l=this.calculateTickLayout(r,m,s,t),this.tickLayoutCache={domain:r,rangeExtent:x,nice:n,gridLength:f,visibleRange:s,initialPrimaryTickCount:t,tickLayout:l}):l=b.tickLayout}const{rawTickCount:c=0,fractionDigits:h,bbox:d}=l,u=a.rawTickCount??0,p=c!==0&&u!==0?{zoomed:c,unzoomed:u}:void 0;return this.tickLayout=l.layout,this.layout.label={fractionDigits:h,spacing:this.label.spacing,format:this.label.format},this.layoutCrossLines(),{primaryTickCount:p,bbox:d}}invalidateLayoutCache(){this.unzoomedTickLayoutCache=void 0,this.tickLayoutCache=void 0,this.tickLayout=void 0}updateCrossLines(){const t=this.hasDefinedDomain()||this.hasVisibleSeries();this.crossLines.forEach(i=>{i.update(t)})}updatePosition(){const{crossLineRangeGroup:t,crossLineLineGroup:i,crossLineLabelGroup:s,gridGroup:n,translation:o}=this,a=Math.floor(o.x),r=Math.floor(o.y);n.setProperties({translationX:a,translationY:r}),t.setProperties({translationX:a,translationY:r}),i.setProperties({translationX:a,translationY:r}),s.setProperties({translationX:a,translationY:r})}tickFormatter(t,i,s,n,o,a="long"){const{moduleCtx:r,label:l}=this,{formatManager:c}=r,h=s?this.primaryLabel:void 0,d=this.tickFormatParams(t,i,n,o),u=this.formatterBoundSeries.get();let p,g,f;if(d.type==="number")p=d.fractionDigits;else if(d.type==="date"){const{unit:D,step:C,epoch:T}=d;g={unit:D,step:C,epoch:T},f=d.truncateDate}const x=this.uncachedCallWithContext.bind(this),m={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.direction,domain:t,boundSeries:u},b=h??l,v=s?l.format:void 0,S={specifier:Jh.mergeSpecifiers(h?.format,l.format),truncateDate:f};return(D,C)=>{const T=this.datumFormatParams(D,m,p,g,a);return T.value=D,b.formatValue(x,T,C,{specifier:v,dateStyle:a,truncateDate:f})??c.format(x,T,S)??c.defaultFormat(T,S)}}formatDatum(t,i,s,n,o,a,r,l,c,h){if(i==null)return"";const{moduleCtx:d,direction:u,dataDomain:p}=this;l??(l=p.domain);const{formatManager:g}=d,f=this.formatterBoundSeries.get();let x;switch(s){case"crosshair":case"annotation-label":x=this.layout.label.fractionDigits+1;break;case"series-label":x=2;break;case"tooltip":x=3;break;case"legend-label":x=void 0;break}const m=this.datumFormatParams(i,{source:s,datum:a,seriesId:n,legendItemName:o,key:r,property:u,domain:l,boundSeries:f},x,void 0,"long"),{type:b,value:v}=m,S=this.createCallWithContext(t),D=c?.formatValue(S,b,v,h??m)??g.format(S,m)??this.label.formatValue(S,m,NaN)??g.defaultFormat(m);return String(D)}getBBox(){return this.axisGroup.getBBox()}initCrossLine(t){t.scale=this.scale,t.gridLength=this.gridLength}hasVisibleSeries(){return this.boundSeries.some(t=>t.isEnabled())}clipTickLines(t,i,s,n){this.tickLineGroup.setClipRect(new de(t,i,s,n))}clipGrid(t,i,s,n){this.gridGroup.setClipRect(new de(t,i,s,n))}getTitleFormatterParams(t){const{direction:i}=this,s=this.formatterBoundSeries.get();return{domain:t,direction:i,boundSeries:s,defaultValue:this.title?.text}}normaliseDataDomain(t){return{domain:[...t],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:ft.is(t)||wo.is(t),getCanvasBounds:()=>Gt.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((i,s)=>(s.getKeyProperties(this.direction).forEach(o=>i.add(o)),i),new Set),seriesIds:()=>this.boundSeries.map(i=>i.id),scaleInvert:i=>t.invert(i,!0),scaleInvertNearest:i=>t.invert(i,!0),formatScaleValue:(i,s,n)=>this.formatDatum(void 0,i,s,void 0,void 0,void 0,void 0,void 0,n),attachLabel:i=>this.attachLabel(i),inRange:(i,s)=>this.inRange(i,s),getRangeOverflow:i=>this.getRangeOverflow(i),pickBand:i=>this.pickBand(i)}}pickBand(t){if(!er.is(this.scale))return;const{scale:i,range:s}=this,n=i.invert(this.isVertical()?t.y:t.x,!0),o=i.bandwidth??0,r=((i.step??0)-o)/2,l=i.convert(n),c=l-r,h=l+o+r;return{id:this.id,value:n,band:[cp(c,s),cp(h,s)],position:l}}isVertical(){return this.direction==="y"}isReversed(){return this.reverse}cachedCallWithContext(t,...i){const{callbackCache:s,chartService:n}=this.moduleCtx;return s.call([this,n],t,...i)}uncachedCallWithContext(t,...i){const{chartService:s}=this.moduleCtx;return Lo([this,s],t,...i)}createCallWithContext(t){const{chartService:i}=this.moduleCtx;return(s,...n)=>Lo([t,this,i],s,...n)}};ir.defaultTickMinSpacing=50,ir.CrossLineConstructor=Hs,M([I],ir.prototype,"nice",2),M([I],ir.prototype,"reverse",2),M([I],ir.prototype,"keys",2),M([I],ir.prototype,"interval",2),M([I],ir.prototype,"title",2),M([Xr((e,t,i)=>e.onGridLengthChange(t,i))],ir.prototype,"gridLength",2);var g0=ir;function Mn(e){return e instanceof Date?e.getTime():e}function vp(e){return e<nd?"millisecond":e<el?"second":e<xc?"minute":e<xc*23?"hour":e<28*bc?"day":e<pp?"month":"year"}function f0(e){if(e.length===0)return"millisecond";if(e.length===1)return Oy(e[0]);let t=1/0;for(let i=1;i<e.length;i++)t=Math.min(t,Math.abs(e[i].valueOf()-e[i-1].valueOf()));return vp(t)}function Oy(e){return $n("second",e)<e?"millisecond":$n("minute",e)<e?"second":$n("hour",e)<e?"minute":$n("day",e)<e?"hour":$n("month",e)<e?"day":$n("year",e)<e?"month":"year"}function y0(e){const[t,i]=e.length===0?[0,0]:Vi([e[0].valueOf(),e[e.length-1].valueOf()]),s=new Date(t).getFullYear(),n=new Date(i).getFullYear();if(s!==n)return;const o=new Date(t).getMonth(),a=new Date(i).getMonth();if(o!==a)return"year";const r=new Date(t).getDate(),l=new Date(i).getDate();return r!==l?"month":"day"}function zL(e,t,i){if(i==null||i[0]===0&&i[1]===1)return{ticks:e,count:e.length,firstTickIndex:0};const s=ve(0,Math.floor(i[0]*e.length),e.length),n=ve(0,Math.ceil(i[1]*e.length),e.length),o=t?e.length-n:s,a=t?e.length-s:n;return{ticks:e.slice(o,a),count:e.length,firstTickIndex:o}}var ld=class d_ extends er{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this.index=new Map,this.indexInitialized=!1,this._domain=[]}static is(t){return t instanceof d_}set domain(t){this._domain!==t&&(this.invalid=!0,this._domain=t,this.index.clear(),this.indexInitialized=!1)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...t){let i;const s=new Set;let n=!0;for(const o of t)s.has(o)||(s.add(o),i==null?i=_L(o):(n&&(n=bH(o,i)),i=_L([...i,...o])));return i??(i=[]),{domain:i,animatable:n}}toDomain(t){}invert(t,i=!1){this.refresh();const s=i?this.bandwidth/2:0,n=this.invertNearestIndex(Math.max(0,t-s));return i||t===this.ordinalRange(n)?this.domain[n]:void 0}ticks(t,i=this.domain,s){const{bands:n}=this;let{tickCount:o}=t;if(o===0){const f=n.length>1?1:0;return{ticks:[n[f]],count:void 0,firstTickIndex:f}}let a=o!=null&&o!==0?n.length/o|0:1;if(a=$S(a),a<=1)return zL(i,!1,s);o=n.length/a|0;const r=a*o,l=$S((n.length-r)/2|0),c=ve(0,Math.floor((s?.[0]??0)*n.length),n.length),h=ve(0,Math.ceil((s?.[1]??1)*n.length),n.length),d=Math.floor((c-l)/a)*a+l,u=Math.ceil((h-l)/a)*a+l,p=[];for(let f=d;f<u;f+=a)f>=0&&f<n.length&&p.push(n[f]);let g=p.length>0?this.findIndex(p[0]):void 0;return g!=null&&(g=Math.floor((g-l)/a)),{ticks:p,count:void 0,firstTickIndex:g}}findIndex(t){const{index:i,indexInitialized:s}=this;if(!s){const{domain:n}=this;for(let o=0;o<n.length;o++)i.set(Mn(n[o]),o);this.indexInitialized=!0}return i.get(Mn(t))}};function _L(e){let t;const i=new Set;for(const s of e){const n=Mn(s),o=i.size;i.add(n),i.size!==o?t?.push(s):t??(t=e.slice(0,i.size))}return t??e}function bH(e,t){let i=-1;for(const s of e){const n=t.indexOf(s);if(n===-1)i=1/0;else{if(n<=i)return!1;i=n}}return!0}function m0(e,t){return e.valueOf()-t.valueOf()}function vH(e){let t=NaN;const i=[];for(const s of e){const n=s.valueOf();t!==n&&i.push(s),t=n}return i}function x0(e){const t=e.slice().sort(m0);return b0(t)==null?vH(t):t}function b0(e){if(e.length===0)return 1;const t=Number(e[e.length-1])>Number(e[0])?1:-1;let i=-1/0*t;for(const s of e){const n=s.valueOf();if(Math.sign(n-i)!==t)return;i=n}return t}var jt=(e,t)=>({duration:js(e)*t,timeInterval:e,step:t}),v0=[jt({unit:"second"},1),jt({unit:"second"},5),jt({unit:"second"},15),jt({unit:"second"},30),jt({unit:"minute"},1),jt({unit:"minute"},5),jt({unit:"minute"},15),jt({unit:"minute"},30),jt({unit:"hour"},1),jt({unit:"hour"},3),jt({unit:"hour"},6),jt({unit:"hour"},12),jt({unit:"day"},1),jt({unit:"day"},2),jt({unit:"day",step:7},1),jt({unit:"day",step:7},2),jt({unit:"day",step:7},3),jt({unit:"month"},1),jt({unit:"month"},2),jt({unit:"month"},3),jt({unit:"month"},4),jt({unit:"month"},6),jt({unit:"year"},1)],GL=[1,2,5,10];function VL(e,t){return Math.abs(Math.round(e)-e)<t}function jL(e,t,i){return Math.abs(t-e)>=i?Math.abs(t-e)/i+1:1}function Sp(e,t,i,s,n,o){if(e===t)return{ticks:[e],count:1,firstTickIndex:0};if(i<2)return{ticks:[e,t],count:2,firstTickIndex:0};const a=Mp(e,t,i,s,n);if(!Number.isFinite(a))return{ticks:[],count:0,firstTickIndex:void 0};let r=e,l=t;if(VL(r/a,1e-12)||(r=Math.ceil(r/a)*a),VL(l/a,1e-12)||(l=Math.floor(l/a)*a),o!=null){const d=l-r,u=t-e,p=e+u*o[0],g=e+u*o[1];o=[(p-r)/d,(g-r)/d]}const{ticks:c}=Ry(r,l,a,o),h=c.at(0);return{ticks:c,count:jL(r,l,a),firstTickIndex:h==null?void 0:Math.round((h-r)/a)}}var SH=Math.floor(2*IL/a0*10)/10;function HL({timeInterval:e,step:t}){const i=js(e)*t,s=bp(e),n=s?js(s):void 0;return i<=(n??1/0)*SH}function WL(e,{weekStart:t}){if(e.unit==="day"&&e.step===7)return t}function Py(e,t,i,s,n,{weekStart:o,primaryOnly:a=!1,targetInterval:r}){if(i<=0)return;const l=r??Math.abs(t-e)/Math.max(i,1),c=v0.findLast(p=>(!a||HL(p))&&l>p.duration),h=v0.find(p=>(!a||HL(p))&&l<=p.duration);if(c==null)return{unit:"millisecond",step:Math.max(Mp(e,t,i,s,n),1)};if(h==null)return{unit:"year",step:r==null?Mp(e/pp,t/pp,i,s,n):1};const{timeInterval:d,step:u}=l-c.duration<h.duration-l?c:h;return{unit:d.unit,step:tl(d)*u,epoch:WL(d,{weekStart:o})}}function Mp(e,t,i,s=0,n=1/0){if(e===t)return ve(1,s,n);if(i<1)return NaN;const o=Math.abs(t-e),a=10**Math.floor(Math.log10(o/i));let r=NaN,l=1/0,c=!1;for(const h of GL){const d=Math.ceil(o/(h*a)),u=d>=s&&d<=n;if(c&&!u)continue;const p=Math.abs(d-i);(l>p||c!==u)&&(c||(c=u),l=p,r=h)}return r*a}function $L(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]!=="0")return t+1;return 0}function UL(e,t){const i=Yv(t??",f");if(i==null)return;(i.precision==null||isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...e.map(n=>{if(!Number.isFinite(n))return 0;const[o,a]=n.toExponential((i.type?6:12)-1).split(/[.e]/g);return(o!=="1"&&o!=="-1"?1:0)+$L(a)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...e.map(n=>{if(!Number.isFinite(n)||n===0)return 0;const o=Math.floor(Math.log10(Math.abs(n))),a=i.type?6:12,r=n.toExponential(a-1).split(/[.e]/g)[1],l=$L(r);return Math.max(0,l-o)}))));const s=nC(i);return n=>s(Number(n))}function Ry(e,t,i,s){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0,firstTickIndex:void 0};if(e===t)return{ticks:[e],count:1,firstTickIndex:0};const n=10**Vu(i),o=Math.min(e,t),a=Math.max(e,t);let r,l;if(s!=null&&(s[0]!==0||s[1]!==1)){const d=t-e,u=e+d*s[0],p=t-d*(1-s[1]);r=Math.min(u,p),l=Math.max(u,p)}else r=o,l=a;r=Math.floor(r*n)/n,l=Math.ceil(l*n)/n;const c=[];for(let d=0;;d+=1){const u=Math.round((o+i*d)*n)/n;if(u>a)break;u>=r&&u<=l&&c.push(u)}const h=c.at(0);return{ticks:c,count:jL(o,a,i),firstTickIndex:h==null?void 0:Math.round((h-o)/i)}}function cd(e,t){return e>=t?(X.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function YL(e,t){const i=Math.abs(t-e),s=10**Math.floor(Math.log10(i));let n=1/0,o=[e,t];for(const a of GL){const r=a*s,l=Math.floor(e/r)*r,c=Math.ceil(t/r)*r,h=1-i/Math.abs(c-l);n>h&&(n=h,o=[l,c])}return o}function KL(e,t,i,s,n,o){if(e<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};o=Math.max(o,e/(n+1)),i??(i=o),s??(s=e),i>s&&(i===o?i=s:s=i),i=Math.max(i,1);const a=Math.max(1,Math.floor(e/(t*i))),r=Math.min(a,Math.ceil(e/(t*s))),l=ve(r,Math.floor(n/t),a);return{minTickCount:r,maxTickCount:a,tickCount:l}}var By=new Date(1970,0,4),hd=class u_ extends ft{constructor(){super([],[0,1]),this.type="time"}static is(t){return t instanceof u_}toDomain(t){return new Date(t)}convert(t,i){return super.convert(t?.valueOf()??NaN,i)}invert(t){return new Date(super.invert(t))}niceDomain(t,i=this.domain){if(i.length<2)return[];let[s,n]=i;const o=4,a=this.getPixelRange();for(let r=0;r<o;r++){const[l,c]=DH(s,n,t,a);if(Mn(s)===Mn(l)&&Mn(n)===Mn(c))break;s=l,n=c}return[s,n]}ticks(t,i=this.domain,s=[0,1],{extend:n=!1}={}){const{nice:o,interval:a,tickCount:r=ft.defaultTickCount,minTickCount:l,maxTickCount:c}=t;if(i.length<2)return;const h=i.map(Mn),d=h[0],u=h[h.length-1];if(a!=null){const x=this.getPixelRange();return{ticks:S0({start:d,stop:u,interval:a,availableRange:x,visibleRange:s,extend:n})??MH({start:d,stop:u,tickCount:r,minTickCount:l,maxTickCount:c,visibleRange:s,extend:n}),count:void 0}}else{if(o&&r===2)return{ticks:i,count:void 0};if(o&&r===1)return{ticks:i.slice(0,1),count:void 0}}const p=Py(d,u,r,l,c,{weekStart:By});if(p==null)return;const g=Un(p,new Date(d),new Date(u),{visibleRange:s,extend:n}),f=Ty(p,new Date(d),new Date(u),{visibleRange:s,extend:n});return{ticks:g,count:void 0,firstTickIndex:f,timeInterval:p}}};function MH({start:e,stop:t,tickCount:i,minTickCount:s,maxTickCount:n,visibleRange:o,extend:a}){const r=Py(e,t,i,s,n,{weekStart:By});return r?Un(r,new Date(e),new Date(t),{visibleRange:o,extend:a}):[]}function S0({start:e,stop:t,interval:i,availableRange:s,visibleRange:n,extend:o}){if(!i)return[];if(Je(i)||typeof i=="string"){const d=Un(i,new Date(e),new Date(t),{visibleRange:n,extend:o});return cd(d.length,s)?void 0:d}const a=Math.abs(i);if(cd(Math.abs(t-e)/a,s))return;const r=v0.findLast(d=>a%d.duration===0);if(r){const{timeInterval:d,step:u,duration:p}=r,g={...d,step:u*tl(d)*Math.round(a/p),epoch:WL(d,{weekStart:By})};return Un(g,new Date(e),new Date(t),{visibleRange:n,extend:o})}let l=new Date(Math.min(e,t));const c=new Date(Math.max(e,t)),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+a);return h}function DH(e,t,i,s){const{interval:n}=i,o=Math.min(Mn(e),Mn(t)),a=Math.max(Mn(e),Mn(t));let r;if(Je(n)||typeof n=="string")r=n;else{let d;typeof n=="number"&&(d=(a-o)/Math.max(n,1),cd(d,s)&&(d=void 0)),d??(d=i.tickCount??ft.defaultTickCount),r=Py(o,a,d,i.minTickCount,i.maxTickCount,{weekStart:By})}if(r==null)return[e,t];const l=Un(r,new Date(o),new Date(a),{extend:!0});if(l==null||l.length<2)return[e,t];const c=l[0],h=l[l.length-1];return e<=t?[c,h]:[h,c]}var dd=class p_ extends wo{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=ft.defaultTickCount,this._domain=[],this.isReversed=!1}static is(t){return t instanceof p_}set domain(t){t!==this._domain&&(this.invalid=!0,this._domain=t,this._bands=void 0,this.isReversed=ZL(t))}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 i=t.filter(s=>s.length>0);if(i.length===0)return{domain:[],animatable:!1};if(i.length===1){let s=i[0];const n=b0(s);return n===-1?s=s.slice().reverse():n==null&&(s=x0(s.slice())),{domain:s,animatable:!0}}return{domain:x0(i.flat()),animatable:!0}}ticks(t,i,s=[0,1],{extend:n=!1,dropInitial:o=!1}={}){const{interval:a,maxTickCount:r,tickCount:l=r}=t,{bands:c}=this;if(!c.length)return;if(this.refresh(),a==null){const{ticks:b,tickOffset:v,tickEvery:S}=this.getDefaultTicks(i,l,s,n);let D=b.length>0?this.findIndex(b[0]):void 0;return D=D!=null?Math.floor((D-v)/S):void 0,{ticks:b,count:void 0,firstTickIndex:D}}let h,d;i&&i.length>=2?(h=i[0].valueOf(),d=i[i.length-1].valueOf()):(h=c[0].valueOf(),d=c[c.length-1].valueOf());const[u,p]=this.range,g=Math.abs(p-u),f=S0({start:h,stop:d,interval:a,availableRange:g,visibleRange:s,extend:n})??this.getDefaultTicks(i,l,s,n).ticks,x=[];let m=-1;for(const b of f){const v=this.findIndex(b,1)??-1,S=v===m;m=v,!(o&&v===0)&&v!==-1&&!S&&x.push(c[v])}return{ticks:x,count:void 0,firstTickIndex:void 0}}stepTicks(t,i,s=[0,1],n=!0){const o=i?this.bandDomainIndices(i):void 0,a=this.ticksEvery(o,s,t,0,!1),r=a.at(-1),l=n&&t>1?o?.[1]:void 0,c=l!=null&&r!=null?this.findIndex(r):void 0;return c!=null&&l!=null&&l-c<t&&a.pop(),a}bandCount(t=[0,1]){const{domain:i}=this,s=Math.floor(t[0]*i.length);return Math.ceil(t[1]*i.length)-s}getDefaultTicks(t,i,s,n){const{bands:o}=this,a=Math.ceil(o.length/i),r=Math.floor(a/2),l=t?this.bandDomainIndices(t):void 0;return{ticks:this.ticksEvery(l,s,a,r,n),tickOffset:r,tickEvery:a}}bandDomainIndices(t){const i=ZL(t),s=this.findIndex(t[i?t.length-1:0],1)??0,n=this.findIndex(t[i?0:t.length-1],1)??this.bands.length-1;return[s,n]}ticksEvery([t,i]=[0,this.bands.length],s,n,o,a){const{bands:r}=this,l=t,c=i-t+1;let h=l+Math.floor(s[0]*c),d=l+Math.ceil(s[1]*c);a&&(h-=n,d+=n),h=Math.max(h,0),d=Math.min(d,r.length);let u;if(n<=1)u=r.slice(h,d);else{u=[];for(let p=h;p<d;p+=1)(p-l+o)%n===0&&u.push(r[p])}return u}};function ZL(e){return e.length>0&&e[0]>e[e.length-1]}var XL=5e7,il=class g_ extends wo{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=12,this._domain=[],this._bands=void 0}static is(t){return t instanceof g_}static supportsInterval(t,i){return qL(t,i)}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]).bands),this._bands}normalizeDomains(...t){return US(...t)}convert(t,i){t instanceof Date||(t=new Date(t));const{domain:s,interval:n}=this;if(s.length<2)return NaN;if(i?.clamp!==!0&&n!=null){const o=t.valueOf(),[a,r]=Fy(s,n),l=Math.min(a.valueOf(),r.valueOf()),c=Math.max(a.valueOf(),r.valueOf());if(o<l||o>=c+js(n))return NaN}return super.convert(t,i)}calculateBands(t,i,s=!1){if(t===this.domain&&i[0]===0&&i[1]===1&&!s&&this._bands!=null)return{bands:this._bands,firstBandIndex:0};if(t.length<2)return{bands:[],firstBandIndex:void 0};const{interval:n}=this;if(n==null)return{bands:[],firstBandIndex:void 0};const o={visibleRange:i,extend:s};if(!qL(t,n,o))return{bands:[],firstBandIndex:void 0};const[a,r]=Fy(t,n);if(l0(n,a,r,o)>XL)return X.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),{bands:[],firstBandIndex:void 0};const l=Un(n,a,r,o),c=Ty(n,a,r,o);return{bands:l,firstBandIndex:c}}ticks({interval:t},i=this.domain,s=[0,1],{extend:n=!1}={}){if(i.length<2)return;const{bands:o,firstBandIndex:a}=this.calculateBands(i,s,n),r=this.interval?js(this.interval):1/0;if(t==null)return{ticks:o,count:void 0,firstTickIndex:a};const l=Math.min(i[0].valueOf(),i[1].valueOf()),c=Math.max(i[0].valueOf(),i[1].valueOf());let h,d,u;Je(t)||typeof t=="string"?(h=Un(t,i[0],i[1],{extend:!0,visibleRange:s}),d=0,u=h.length-1):(h=o,d=lc(0,o.length-1,v=>o[v].valueOf()<=l)??0,u=lc(0,o.length-1,v=>o[v].valueOf()<=c)??o.length-1);const p=[];let g;for(let v=d;v<=u;v++){const S=h[v].valueOf(),D=lc(0,o.length-1,T=>o[T].valueOf()<=S),C=D!=null&&D!=g?o[D]:void 0;g=D,C!=null&&S-C.getTime()<=r&&p.push(C)}let f,x;if(this.interval){const v=Fy([new Date(l),new Date(c)],this.interval);f=v[0].valueOf(),x=v[1].valueOf()}else f=l,x=c;let m=Gu(0,p.length-1,v=>p[v].valueOf()>=f)??0,b=lc(0,p.length-1,v=>p[v].valueOf()<=x)??p.length-1;return n&&(m=Math.max(m-1,0),b=Math.min(b+1,p.length-1)),{ticks:p.slice(m,b+1),count:p.length,firstTickIndex:a}}};function qL(e,t,i){const[s,n]=Fy(e,t);return l0(t,s,n,i)<=XL}function Fy(e,t){const i=$n(t,e[0]),s=$n(t,e[1]);return[i,s]}function AH(e,t,i,s,n){let[o,a]=Vi(t.map(Number));const r=Math.floor(i.unzoomed);if(r<=1){const[m,b]=IH(o,a),v=5*Math.pow(2,-Math.ceil(Math.log2(n[1]-n[0]))),{ticks:S}=Sp(m,b,v,void 0,void 0,n),D=[e.toDomain(m),e.toDomain(b)];return s&&D.reverse(),{domain:D,ticks:S}}if(o===a){const m=Math.floor(Math.log10(o)),b=Math.pow(10,m),v=Math.min(b,1),S=r-1;o-=v*Math.floor(S/2),a=o+v*S}let l=o,c=a;l=kH(l,c,r);const h=TH(l,c,r),d=r-1;c=l+d*h;const u=Math.floor(l/h)*h,p=Math.floor(c/h)*h;u<=o&&p>=a&&(l=u,c=p);const g=[e.toDomain(l),e.toDomain(c)];s&&g.reverse();const f=h*((i.unzoomed-1)/(i.zoomed-1)),x=CH(l,f,Math.floor(i.zoomed));return{domain:g,ticks:x}}function IH(e,t){let i=e,s=t,n=0;do{[i,s]=YL(i,s);const{ticks:o}=Sp(i,s,5);if(o.length%2===1)return[i,s];i-=1,s+=1}while(n++<10);return[e,t]}function kH(e,t,i){e=Math.floor(e);const s=Math.abs(t-e)/(i-1),n=Math.floor(Math.log10(s)),o=Math.pow(10,n);return Math.floor(e/o)*o}function CH(e,t,i){const s=Vu(t),n=Math.pow(10,s),o=[];for(let a=0;a<i;a++){const r=e+t*a;o.push(Math.round(r*n)/n)}return o}function TH(e,t,i){const s=i-1,n=(t-e)/s;return LH(n)}function LH(e){const t=Math.floor(Math.log10(e)),i=Math.pow(10,t),s=e/i;return s>0&&s<=1?i:s>1&&s<=2?2*i:s>2&&s<=5?5*i:s>5&&s<=10?10*i:e}function M0(){const e=new Map;return t=>{const i=e.get(t);return i?(e.set(t,i+1),`${t}_${i}`):(e.set(t,1),t)}}var wH=18,NH=[1,2,3,4,6,8,9,10,12],EH=new Date(1970,0,4),QL=class{constructor(e){this.axis=e}estimateTickCount(e,t,i,s,n,o){const{scale:a,label:r}=this.axis,{defaultTickCount:l}=a,c=td(t),h=td(i);if(ld.is(a)){const d=e.length;let u=Math.ceil(c/(h*r.fontSize));return u=Math.min(u,d),{minTickCount:0,maxTickCount:d,tickCount:u}}return KL(c,h,n,o,l,s)}generateTicks({range:e,domain:t,reverse:i,primaryTickCount:s,defaultTickMinSpacing:n,visibleRange:o,niceMode:a,parallelFlipRotation:r,regularFlipRotation:l,labelX:c,sideFlag:h,removeOverflowLabels:d,removeOverflowThreshold:u=0,sizeLimit:p}){const{label:g,primaryLabel:f,interval:{minSpacing:x,maxSpacing:m}}=this.axis,{parallel:b,fontFamily:v,fontSize:S,fontStyle:D,fontWeight:C}=g,T=s!==void 0,{defaultRotation:k,configuredRotation:L,parallelFlipFlag:N,regularFlipFlag:w}=sH(g.rotation,b,l,r),{maxTickCount:O}=this.estimateTickCount(t,e,o,n,x,m),R=Number.isFinite(O)?O:10,B=oH(b,L,h,N),P={fontFamily:v,fontSize:S,fontStyle:D,fontWeight:C},_=qr.getMeasurer({font:P}),F=g.enabled&&g.avoidCollisions,W=L+k,H=new Za,j=re=>{const ee=W+re;Za.updateTransformMatrix(H,1,1,ee,0,0)},V=({ticks:re},ee)=>(j(ee),lH(re,c,H,_,g)),$=(re,ee)=>{const{niceDomain:Me,ticks:Ee,timeInterval:Ie}=re;if(Ie==null)return[];j(ee);const xe=PH(Ee),{width:ze,height:he}=rH(g,f,Me??t,Ie,_);return cH({width:ze,height:he,spacing:xe},c,H)},U=(re,ee)=>{if(!F)return!1;const Me=L!==0||ee!==0,Ee=nH(g.minSpacing,Me);return JL($(re,ee),Ee)||JL(V(re,ee),Ee)};let Z={tickDomain:[],niceDomain:t,ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0},q=0,Q=0,ie=!0,ne=!1;for(;!ne&&ie&&q<=R;){Q=0;for(const re of this.getTickStrategies({domain:t,range:e,reverse:i,niceMode:a,secondaryAxis:T,sizeLimit:p}))({tickData:Z,index:q,autoRotation:Q,terminate:ne}=re({index:q,tickData:Z,terminate:ne,primaryTickCount:s,defaultTickMinSpacing:n,visibleRange:o,labelsOverlap(){return U(Z,Q)}}));ie=U(Z,Q)}const oe=aH(b,L,Q,h,w),le=L+Q;if(d&&Z.ticks.length>2){const re=V(Z,Q),ee=Z.ticks.at(-1),Me=re.at(-1);ee!=null&&Me!=null&&ee.translation+Me.label.width/2>e[1]+u&&(ee.tickLabel=void 0,o[0]===0&&o[1]===1&&(Z.ticks[0].tickLabel=void 0))}return{tickData:Z,rotation:le,textBaseline:B,textAlign:oe}}getTickStrategies({domain:e,range:t,reverse:i,niceMode:s,secondaryAxis:n,sizeLimit:o}){const{label:a,interval:r}=this.axis,l=a.enabled&&a.avoidCollisions,c=a.autoRotate===!0&&a.rotation===void 0,h=[];let d;r.values?d=2:n?d=1:d=0;const u=({index:p,tickData:g,primaryTickCount:f,defaultTickMinSpacing:x,visibleRange:m,terminate:b})=>this.createTickData(e,t,i,s,m,f,x,d,p,g,b,o);if(h.push(u),l&&c){const p=({index:g,tickData:f,labelsOverlap:x,terminate:m})=>({index:g,tickData:f,autoRotation:x()?Ka(a.autoRotateAngle):0,terminate:m});h.push(p)}return h}createTickData(e,t,i,s,n,o,a,r,l,c,h,d){const{interval:u}=this.axis,{step:p,values:g,minSpacing:f,maxSpacing:x}=u,{maxTickCount:m,minTickCount:b,tickCount:v}=this.estimateTickCount(e,t,n,a,f,x),S=v-b,D=$=>Math.max(v-$,b),C=c.rawTicks,T=p==null&&g==null&&D(l)>b,k={domain:e,reverse:i,niceMode:s,visibleRange:n,primaryTickCount:o,tickGenerationType:r,minTickCount:b,maxTickCount:m,tickCount:0};k.tickCount=D(l);let L=this.getTicks(k);if(T&&e2(L.rawTicks,C)){let $=l,U=S;for(;$<=U;){l=($+U)/2|0,k.tickCount=D(l);const Z=this.getTicks(k);e2(Z.rawTicks,C)?$=l+1:(L=Z,U=l-1)}}const{tickDomain:N,niceDomain:w,rawTicks:O,rawTickCount:R,rawFirstTickIndex:B,generatePrimaryTicks:P,primaryTicksIndices:_,alignment:F,fractionDigits:W,timeInterval:H}=L,j=this.formatTicks({range:t,niceDomain:w,rawTicks:O,rawFirstTickIndex:B,generatePrimaryTicks:P,primaryTicksIndices:_,alignment:F,fractionDigits:W,timeInterval:H,sizeLimit:d}),V={tickDomain:N,niceDomain:w,rawTicks:O,rawTickCount:R,timeInterval:H,fractionDigits:W,ticks:j};return l+=1,h||(h=p!=null||g!=null),{tickData:V,index:l,autoRotation:0,terminate:h}}getTimeIntervalTicks(e,t,i,s,n,o){const a=bp(n);if(a==null)return;const{scale:r}=this.axis;if(!hd.is(r)&&!wo.is(r))return;o&&(e=[1-e[1],1-e[0]]);const l=Math.min(r.domain[0].valueOf(),r.domain[r.domain.length-1].valueOf()),c=Math.max(r.domain[0].valueOf(),r.domain[r.domain.length-1].valueOf());let[h,d]=r0(new Date(l),new Date(c),e);h=$n(a,h),h.valueOf()>=l&&(h=CL(a,h)),d=kL(a,d),d.valueOf()<=c&&(d=TL(a,d));const u=Un(a,h,d),p=js(n);let g=new Set;const f=dd.is(r),x=[],m={...s,interval:n};let b,v,S=0;if(dd.is(r)){const C=this.axis.minimumTimeGranularity,T=fa(n);b=C!=null&&js(C)>=js(T)?2:3,v=1;const k=t/i,L=r.bandCount(e)/(k*wH);S=NH.findLast(N=>L>=N)??1}else il.is(r)&&(r.interval==null||js(r.interval)>=p)?b=1:(b=0,v=2);for(let C=0;C<u.length-1;C+=1){const T=u[C],k=u[C+1],L=C===0,N=C===u.length-2,w=k.valueOf()-T.valueOf(),O=[Math.max((l-T.valueOf())/w,0),Math.min((c-T.valueOf())/w,1)];let R;switch(b){case 0:R=OH(m.interval,[T,k],O,!0).ticks;break;case 1:case 3:R=r.ticks(m,[T,k],O,{extend:!0,dropInitial:!0})?.ticks??[];break;case 2:R=r.stepTicks(S,[T,k],void 0,!N);break}if(gG(R,F=>F.valueOf()<T.valueOf()),N||fG(R,F=>{switch(b){case 0:case 3:return F.valueOf()+p>k.valueOf();case 1:case 2:return F.valueOf()>=k.valueOf()}}),R.length===0)continue;const B=R[0],P=m0(B,T);(b===0?P===0:P<=p)&&(!f||!L)&&g.add(x.length),x.push(...R)}(g.size===0||g.size===1&&g.has(0))&&(g=void 0);let D;return{ticks:x,tickCount:void 0,firstTickIndex:D,primaryTicksIndices:g,alignment:v}}getTicks({domain:e,reverse:t,niceMode:i,visibleRange:s,tickGenerationType:n,tickCount:o,minTickCount:a,maxTickCount:r,primaryTickCount:l}){const{axis:c}=this,{primaryLabel:h,scale:d,interval:u}=c,p={nice:i===0,interval:u.step,tickCount:o,minTickCount:a,maxTickCount:r},g={...p,nice:i===0||i===1};let f;n===1&&l!=null&&ft.is(d)&&(f=AH(d,e,l,t,s));const x=i===0?f?.domain??d.niceDomain(p,e):e;let m=x,b,v,S,D,C,T;const k=h?.enabled===!0&&g.interval==null,L=d.domain;switch(d.domain=x,n){case 2:if(m=u.values,b=u.values,v=b.length,dd.is(d)?T=1:il.is(d)&&(T=2),ft.is(d)){const[w,O]=Vi(x.map(Number));b=b.filter(R=>Number(R)>=w&&Number(R)<=O).sort((R,B)=>Number(R)-Number(B))}break;case 1:if(f)b=f.ticks,v=f.ticks.length;else{const w=d.ticks(g,x,s);b=w?.ticks??[],v=w?.count}break;default:{if(x.length>0&&g.interval==null&&(il.is(d)||k&&(hd.is(d)||dd.is(d)))){const R=x,B=Math.min(R[0].valueOf(),R[R.length-1].valueOf()),P=Math.max(R[0].valueOf(),R[R.length-1].valueOf());D=Py(B,P,o,a,r,{weekStart:h==null?EH:void 0,primaryOnly:!0})}let w;dd.is(d)?w=c.minimumTimeGranularity:il.is(d)&&(w=d.interval),w!=null&&D!=null&&js(w)>=js(D)&&(D=w);const O=D?this.getTimeIntervalTicks(s,o,r,g,D,t):void 0;if(O)({ticks:b,tickCount:v,firstTickIndex:S,primaryTicksIndices:C,alignment:T}=O);else{const R=il.is(d)&&g.interval==null&&D!=null?{...g,interval:D}:g,B=d.ticks(R,x,s);if(b=B?.ticks??[],v=B?.count,S=B?.firstTickIndex,hd.is(d)||wo.is(d)){const P=g,_=typeof P.interval=="number"?vp(P.interval):P.interval;D??(D=_??B?.timeInterval)}}}}const N=b.reduce((w,O)=>Math.max(w,typeof O=="number"?Vu(O):0),0);return k||(C=void 0),d.domain=L,{tickDomain:m,niceDomain:x,rawTicks:b,rawTickCount:v,rawFirstTickIndex:S,generatePrimaryTicks:k,primaryTicksIndices:C,alignment:T,fractionDigits:N,timeInterval:D}}formatTicks({niceDomain:e,range:t,rawTicks:i,rawFirstTickIndex:s=0,generatePrimaryTicks:n,primaryTicksIndices:o,alignment:a,fractionDigits:r,timeInterval:l,sizeLimit:c=1/0}){const{axis:h}=this,{label:d,scale:u}=h,p=u.domain;u.domain=e;const g=n?"component":"long",f=d.enabled?h.tickFormatter(e,i,!1,r,l,g):void 0,x=l!=null?bp(l):void 0,m=n?h.tickFormatter(e,i,!0,r,x,g):void 0,b=(u.bandwidth??0)/2,v=[],S=hd.is(u)||wo.is(u),D=M0(),C=h.direction==="y",T=(er.is(u)?u.bandwidth:null)??1/0,k={font:d,maxWidth:C?c:T,maxHeight:C?T:c,overflow:d.truncate?"ellipsis":"hide",textWrap:d.wrapping};for(let L=0;L<i.length;L++){const N=i[L],w=u.convert(N,{alignment:a})+b;if(t.length>0&&!h.inRange(w,.001))continue;const O=o?.has(L)??!1;let R=O?m?.(N,L):f?.(N,L);const B=R??String(N);d.avoidCollisions&&(R=ep.wrapText(B,k)||R);let P;const _=S?N?.valueOf():void 0;Number.isFinite(_)?P=D(`v:${_}`):P=D(`l:${R}`),v.push({index:L+s,tick:N,tickId:P,tickLabel:R,textUntruncated:R!=null&&B!==R?B:void 0,translation:Math.floor(w),primary:O})}return u.domain=p,v}};function JL(e,t=0){const i=[];for(const s of e){const{x:n,y:o}=s.point;let{width:a,height:r}=s.label;if(a+=t,r+=t,i.some(l=>Zk(l,n,o,a,r)))return!0;i.push({x:n,y:o,width:a,height:r})}return!1}function OH(e,t,i,s){if(e==null)return{ticks:t,firstTickIndex:void 0};const n=t[0].valueOf(),o=t[1].valueOf();if(typeof e!="number"){const r=t[0],l=typeof e=="string"?{unit:e,epoch:r}:{...e,epoch:r},c=Un(l,t[0],t[1],{visibleRange:i,extend:s}),h=Ty(l,t[0],t[1],{visibleRange:i,extend:s});return{ticks:c,firstTickIndex:h}}const a=[];for(let r=n;r<=o;r+=e)a.push(new Date(r));return{ticks:a,firstTickIndex:void 0}}function e2(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(e[i]?.valueOf()!==t[i]?.valueOf())return!1;return!0}function PH(e){if(e.length<2)return 1/0;let t=0,i=e[0].translation;for(let s=1;s<e.length;s++){const n=e[s].translation,o=Math.abs(n-i);t=Math.max(t,o),i=n}return t}var D0=class extends Dt{constructor(){super(...arguments),this.autoRotateAngle=335}};M([I],D0.prototype,"autoRotate",2),M([I],D0.prototype,"autoRotateAngle",2);var zy=class f_ extends g0{constructor(t,i){super(t,i),this.maxThicknessRatio=.3,this.headingLabelGroup=this.axisGroup.appendChild(new As({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new As({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new Sn({zIndex:1})),this.tickLineGroupSelection=Ts.select(this.tickLineGroup,Sn,!1),this.gridLineGroupSelection=Ts.select(this.gridLineGroup,Sn,!1),this.gridFillGroupSelection=Ts.select(this.gridFillGroup,Ti,!1),this.tempText=new Yh({debugDirty:!1}),this.tempCaption=new Pt,this.tickGenerator=new QL(this),this.animationManager=t.animationManager,this.animationState=new up("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:n=>this.animateReadyUpdate(n),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.title.caption.node);let s;this.cleanup.register(t.eventsHub.on("layout:complete",n=>{const o=[n.chart.width,n.chart.height];s!=null&&!jn(o,s)&&this.animationState.transition("resize"),s=o}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(t){return t instanceof f_}get horizontal(){return this.position==="top"||this.position==="bottom"}onGridVisibilityChange(){this.gridLineGroupSelection.clear(),this.gridFillGroupSelection.clear()}resetAnimation(t){t==="initial"&&this.animationState.transition("reset")}get direction(){return this.position==="top"||this.position==="bottom"?"x":"y"}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new D0}updateDirection(){switch(this.position){case"top":this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.label.mirrored=!1,this.label.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(t,i){return this.updateDirection(),super.calculateLayout(t,i)}layoutCrossLines(){const t=this.hasDefinedDomain()||this.hasVisibleSeries();this.crossLines.forEach(i=>{i.calculateLayout?.(t)})}calculateTickLayout(t,i,s,n){const o=this.label.getSideFlag(),a=this.horizontal?-.5*Math.PI:0,r=pi(a),l=pi(a-Math.PI/2),c=o*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding);if(i===2&&this.label.enabled===!1&&this.tick.enabled===!1&&this.gridLine.enabled===!1){const{bbox:j,spacing:V}=this.tickBBox(t,[],[]);return{ticks:[],rawTickCount:0,tickDomain:t,niceDomain:t,fractionDigits:0,timeInterval:void 0,bbox:j,layout:{ticks:[],tickLines:[],gridLines:[],gridFills:[],labels:[],spacing:V}}}const{range:h,reverse:d,defaultTickMinSpacing:u}=this,p=this.label.avoidCollisions&&this.horizontal&&(ft.is(this.scale)||wo.is(this.scale)),g=this.tickGenerator.generateTicks({domain:t,range:h,reverse:d,niceMode:i,visibleRange:s,primaryTickCount:n,defaultTickMinSpacing:u,parallelFlipRotation:r,regularFlipRotation:l,labelX:c,sideFlag:o,sizeLimit:this.chartLayout?.sizeLimit,removeOverflowLabels:p,removeOverflowThreshold:this.chartLayout?.padding.right}),{tickData:f}=g,{ticks:x,tickDomain:m,rawTicks:b,rawTickCount:v,fractionDigits:S,timeInterval:D,niceDomain:C}=f,T=x.map(j=>this.getTickLabelProps(j,g)),{position:k,gridPadding:L,gridLength:N}=this,w=k==="bottom"||k==="right"?-1:1,O=w*L,R=w*(N+L),B=this.calculateGridLines(x,O,R),P=this.calculateGridFills(x,O,R),_=this.calculateTickLines(x,w),{bbox:F,spacing:W}=this.tickBBox(m,x,T);return{ticks:b,rawTickCount:v,tickDomain:m,niceDomain:C,fractionDigits:S,timeInterval:D,bbox:F,layout:{ticks:x,gridLines:B,gridFills:P,tickLines:_,labels:T,spacing:W}}}calculateGridLines(t,i,s){return t.map((n,o)=>this.calculateGridLine(n,o,i,s,t))}calculateGridLine({index:t,tickId:i,translation:s},n,o,a,r){const{gridLine:l,horizontal:c}=this,[h,d,u,p]=c?[s,o,s,a]:[o,s,a,s],{style:g}=l,{stroke:f,strokeWidth:x=0,lineDash:m}=g[t%g.length]??{};return{tickId:i,offset:s,x1:h,y1:d,x2:u,y2:p,stroke:f,strokeWidth:x,lineDash:m}}calculateGridFills(t,i,s){const{horizontal:n,range:o,type:a}=this,r=[];if(t.length==0)return r;let l=0;const c=!n&&a==="unit-time";if(c&&t[0].translation<o[0]||!c&&t[0].translation>o[0]){const d={tickId:`before:${t[0].tickId}`,translation:o[0]};r.push(this.calculateGridFill(d,-1,t[0].index,i,s,t)),l=1}return r.push(...t.map((d,u)=>this.calculateGridFill(d,u,d.index+l,i,s,t))),r}calculateGridFill({tickId:t,translation:i},s,n,o,a,r){const{gridLine:l,horizontal:c,range:h}=this,d=r[s+1],u=i,p=d?d.translation:h[1],[g,f,x,m]=c?[u,Math.max(o,a),p,Math.min(o,a)]:[Math.min(o,a),Math.min(u,p),Math.max(o,a),Math.max(u,p)],{fill:b,fillOpacity:v}=l.style[n%l.style.length]??{};return{tickId:t,x1:g,y1:f,x2:x,y2:m,fill:b,fillOpacity:v}}calculateTickLines(t,i){return t.map(s=>this.calculateTickLine(s,s.index,i,t))}calculateTickLine({primary:t,tickId:i,translation:s},n,o,a){const{horizontal:r,tick:l,primaryTick:c}=this,h=t&&c?.enabled?c:l,d=-o*this.getTickSize(h),[u,p,g,f]=r?[s,0,s,d]:[0,s,d,s],{stroke:x,width:m}=h;return{tickId:i,offset:s,x1:u,y1:p,x2:g,y2:f,stroke:x,strokeWidth:m,lineDash:void 0}}update(){this.updateDirection();const t=Array.from(this.tickLabelGroupSelection.nodes(),a=>a.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{tickLayout:i}=this;if(this.updateTitle(this.scale.domain,i?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),i){const{ticks:a}=i;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const r=a.map(c=>c.tickId),l=MG(t,r);this.animationState.transition("update",l)}}const{enabled:s,stroke:n,width:o}=this.line;this.lineNode.setProperties({stroke:n,strokeWidth:s?o:0}),this.updateTickLines(),this.updateGridLines(),this.updateGridFills()}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,[i,s]=Vi(this.range);return t?{x1:i,x2:s,y1:0,y2:0}:{x1:0,x2:0,y1:i,y2:s}}getTickLineBBox(t){const{translation:i}=t,{position:s,primaryTick:n}=this;let o=this.getTickSize();switch(n?.enabled&&(o=Math.max(o,this.getTickSize(n))),s){case"top":return new de(i,-o,i,o);case"bottom":return new de(i,0,i,o);case"left":return new de(-o,i,o,i);case"right":return new de(0,i,o,i)}}lineNodeBBox(){const{position:t,seriesAreaPadding:i}=this,{y1:s,y2:n}=this.getAxisLineCoordinates(),o=n-s;switch(t){case"top":return new de(s,-i,o,i);case"bottom":return new de(s,0,o,i);case"left":return new de(-i,s,i,o);case"right":return new de(0,s,i,o)}}titleBBox(t,i){const{tempCaption:s}=this;return s.node.setProperties(this.titleProps(s,t,i)),s.node.getBBox()}tickBBox(t,i,s){const{tick:n,primaryTick:o,label:a,primaryLabel:r,title:l,position:c,horizontal:h,seriesAreaPadding:d}=this,u=[];if(u.push(this.lineNodeBBox()),n.enabled||o?.enabled)for(const x of i)u.push(this.getTickLineBBox(x));const{tempText:p}=this;if(a.enabled)for(const x of s){if(!x.visible)continue;p.setProperties(x);const m=p.getBBox(!1);m&&u.push(m)}if(r?.enabled&&c==="bottom"&&(u.push(new de(0,ut.getLineHeight(a.fontSize)+2,1,this.getTickSize(n)+a.spacing+d)),r.format!=null)){const{format:m}=r,v=(Je(m)?Object.values(m):[m]).reduce((S,D)=>Math.max(S,iG(D)),0);u.push(new de(0,this.getTickSize(o??n)+r.spacing+d,1,v*ut.getLineHeight(r.fontSize)+2))}let g=0;if(l.enabled){const x=de.merge(u);g=h?x.height:x.width,u.push(this.titleBBox(t,g))}return{bbox:de.merge(u),spacing:g}}titleProps(t,i,s){const{title:n}=this;if(!n.enabled)return t.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};t.enabled=!0,t.color=n.color,t.fontFamily=n.fontFamily,t.fontSize=n.fontSize,t.fontStyle=n.fontStyle,t.fontWeight=n.fontWeight,t.wrapping=n.wrapping;const o=(n.spacing??0)+s,{range:a}=this,r=(a[0]+a[1])/2;let l,c,h,d;switch(this.position){case"top":l=r,c=-o,h=0,d="bottom";break;case"bottom":l=r,c=o,h=0,d="top";break;case"left":l=-o,c=r,h=-.5*Math.PI,d="bottom";break;case"right":l=o,c=r,h=.5*Math.PI,d="bottom";break}const{formatter:u=g=>g.defaultValue}=n,p=this.cachedCallWithContext(u,this.getTitleFormatterParams(i));return t.text=p,{visible:!0,text:p,textBaseline:d,x:l,y:c,rotationCenterX:l,rotationCenterY:c,rotation:h}}getLabelBorderOffset(t){const i=rd(t);function s(n){return n}switch(this.position){case"top":return i.bottom;case"right":return i.left;case"bottom":return i.top;case"left":return i.right;default:this.position}}getTickLabelProps(t,i){const{horizontal:s,primaryLabel:n,primaryTick:o,seriesAreaPadding:a,scale:r}=this,{tickId:l,tickLabel:c="",translation:h,primary:d,textUntruncated:u}=t,p=d&&n?.enabled?n:this.label,g=d&&o?.enabled?o:this.tick,{rotation:f,textBaseline:x,textAlign:m}=i,{range:b}=r,v=this.label.getSideFlag(),S=-this.getLabelBorderOffset(p),D=v*(this.getTickSize(g)+p.spacing+a)+S,C=c!=="",T=s?h:D,k=s?-D:h;return{...this.getLabelStyles({value:c},void 0,p),tickId:l,rotation:f,text:c,textAlign:m,textBaseline:x,textUntruncated:u,visible:C,x:T,y:k,rotationCenterX:T,rotationCenterY:k,range:b}}updateSelections(){if(!this.tickLayout)return;const t=this.getAxisLineCoordinates(),{tickLines:i,gridLines:s,gridFills:n,labels:o}=this.tickLayout,a=r=>r.tickId;this.lineNode.datum=t,this.gridLineGroupSelection.update(this.gridLine.enabled?s:[],void 0,a),this.gridFillGroupSelection.update(this.gridLine.enabled?n:[],void 0,a),this.tickLineGroupSelection.update(i,void 0,a),this.tickLabelGroupSelection.update(o,void 0,a)}updateGridLines(){this.gridLineGroupSelection.each((t,i)=>{t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.lineDash=i.lineDash})}updateGridFills(){this.gridFillGroupSelection.each((t,i)=>{t.fill=i.fill,t.fillOpacity=i.fillOpacity??1})}updateTickLines(){this.tickLineGroupSelection.each((t,i)=>{t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.lineDash=i.lineDash})}updateTitle(t,i){const{caption:s}=this.title,n=this.titleProps(s,t,i);s.node.visible=n.visible,s.node.text=n.text,s.node.textBaseline=n.textBaseline,s.node.datum=n}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.color,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.pointerEvents=i.textUntruncated==null?1:0,t.setFont(i),t.setBoxing(i)})}animateReadyUpdate(t){const{animationManager:i}=this.moduleCtx,s=EL(this),n=OL(s);Li(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],n.group),Li(this.id,"line",i,[this.lineNode],n.line),Li(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(o,a)=>a.tickId,t),Li(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(o,a)=>a.tickId,t),Li(this.id,"title",i,[this.title.caption.node],n.label,(o,a)=>a.tickId,t)}resetSelectionNodes(){ls([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],PL()),ls([this.gridLineGroupSelection,this.tickLineGroupSelection],p0()),ls([this.gridFillGroupSelection],RL()),ls([this.tickLabelGroupSelection],Ey()),ls([this.title.caption.node],Ey()),ls([this.lineNode],p0())}};M([I],zy.prototype,"thickness",2),M([I],zy.prototype,"maxThicknessRatio",2),M([I],zy.prototype,"position",2);var Dp=zy,t2=["top","right","bottom","left"];function RH(e){return typeof e=="string"&&t2.includes(e)}function BH(e){const t=[],i=[],s=[...t2];for(const n of e)n instanceof Dp&&(RH(n.position)?i.push(n.position):t.push(n));for(const n of t){let o;do o=s.pop();while(o&&i.includes(o));if(o==null)break;n.position=o}}var FH=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function zH(e,t,i){const s=(c,h,d)=>{const u=[c];for(const p of FH)p in h&&h[p]!=null&&u.push(`${p}=${h[p]}`);return d?.seriesGrouping&&u.push(`seriesGrouping.groupId=${d?.seriesGrouping.groupId}`),u.join(";")},n=new Map;let o=0;for(const c of e){const h=s(c.type,c.properties,i?.[o]);n.has(h)||n.set(h,[]),n.get(h)?.push([c,o++])}const a=new Map;o=0;for(const c of t){const h=s(c.type,c,c);a.has(h)||a.set(h,[]),a.get(h)?.push([c,o++])}if(![...n.keys()].some(c=>a.has(c)))return{status:"no-overlap",oldKeys:n.keys(),newKeys:a.keys()};const l=[];for(const[c,h]of a.entries())for(const[d,u]of h){const p=n.get(c);if(p==null||p.length<1){l.push({opts:d,targetIdx:u,idx:u,status:"add"}),n.delete(c);continue}const[g,f]=p.shift(),x=i?.[f]??{},m=Xa(x,d??{}),{groupIndex:b,stackIndex:v}=m?.seriesGrouping??{};b!=null||v!=null?l.push({opts:d,series:g,diff:m,targetIdx:u,idx:f,status:"series-grouping"}):m?l.push({opts:d,series:g,diff:m,targetIdx:u,idx:f,status:"update"}):l.push({opts:d,series:g,targetIdx:u,idx:f,status:"no-op"}),p.length===0&&n.delete(c)}for(const c of n.values())for(const[h,d]of c)l.push({series:h,idx:d,targetIdx:-1,status:"remove"});return{status:"overlap",changes:l}}function _y(e){const{series:t}=e;return t?.[0]?.type??"line"}function i2(e){const t=_y(e);return ji.isCartesian(t)||jj(t)}function _H(e){const t=_y(e);return ji.isPolar(t)||Hj(t)}function s2(e){const t=_y(e);return ji.isTopology(t)||Wj(t)}function n2(e){const t=_y(e);return ji.isStandalone(t)||$j(t)}var GH=class extends h0{applyOptions(e){for(const t of this.moduleMap.values())t.module.optionsKey in e&&pc(t.moduleInstance)&&t.moduleInstance.set(e[t.module.optionsKey])}*legends(){for(const{module:e,moduleInstance:t}of this.moduleMap.values())e.type==="legend"&&(yield{legendType:e.identifier,legend:t})}},A0="ag-charts-overlay",o2="ag-charts-dark-overlay",Dc=class extends we{constructor(e,t){super(),this.className=e,this.defaultMessageId=t,this.enabled=!0}getText(e){return Ue(this.text)?this.text.map(t=>t.text).join(""):e.t(this.text??this.defaultMessageId)}getElement(e,t,i,s){if(this.content?.remove(),this.focusBox=s,this.renderer){const n={},o=Lo(e,this.renderer,n);if(o instanceof HTMLElement)this.content=o;else{const a=ke("div");a.innerHTML=o;const{firstElementChild:r}=a;r instanceof HTMLElement&&a.childElementCount===1?this.content=r:this.content=a}}else{const n=ke("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)"});if(Ue(this.text)){const o=ke("div");for(const a of this.text){const r=ke("span",{color:a.color,fontSize:`${a.fontSize}px`,fontFamily:a.fontFamily??"inherit",fontWeight:String(a.fontWeight),fontStyle:a.fontStyle});r.innerText=a.text,o.appendChild(r)}n.appendChild(o)}else n.innerText=this.getText(i);this.content=n,t?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(o){n.style.opacity=String(o)},onStop(){n.style.opacity="1"}})}return this.content}removeElement(e=()=>this.content?.remove(),t){if(this.content){if(t){const{content:i}=this;t.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(s){i.style.opacity=String(s)},onStop(){e?.()}})}else e?.();this.content=void 0,this.focusBox=void 0}}};M([I],Dc.prototype,"enabled",2),M([I],Dc.prototype,"text",2),M([I],Dc.prototype,"renderer",2);var ud=class extends we{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new Dc("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new Dc("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new Dc("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new Dc("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(e){for(const t of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(t.focusBox!==void 0)return{text:t.getText(e),rect:t.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};M([I],ud.prototype,"darkTheme",2),M([I],ud.prototype,"loading",2),M([I],ud.prototype,"noData",2),M([I],ud.prototype,"noVisibleSeries",2),M([I],ud.prototype,"unsupportedBrowser",2);function VH(e,t){const{animationDuration:i}=lp.add,s=i*t,n=ke("div",`${A0}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${s}ms linear 50ms both`}),o=ke("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=ke("p",{marginTop:"1em"});a.innerText=e;const r=ke("div",`${A0}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=ke("style");return l.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),n.replaceChildren(l,o,a,r),n}var a2=(e=>(e[e.None=0]="None",e[e.Item=1]="Item",e[e.Series=2]="Series",e[e.OtherSeries=3]="OtherSeries",e[e.OtherItem=4]="OtherItem",e))(a2||{}),sr=class extends we{};M([I],sr.prototype,"fill",2),M([I],sr.prototype,"fillOpacity",2),M([I],sr.prototype,"stroke",2),M([I],sr.prototype,"strokeWidth",2),M([I],sr.prototype,"strokeOpacity",2),M([I],sr.prototype,"lineDash",2),M([I],sr.prototype,"lineDashOffset",2);var nr=class extends we{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.bringToFront=!1,this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getItemHighlightStyle(e){switch(e){case 1:return this.highlightedItem;case 4:return this.unhighlightedItem;case 2:return this.highlightedSeries;case 3:return this.unhighlightedSeries}}getSeriesHighlightStyle(e){switch(e){case 1:case 4:case 2:return this.highlightedSeries;case 3:return this.unhighlightedSeries}}getStyle(e){return et(this.getItemHighlightStyle(e),this.getSeriesHighlightStyle(e))}};M([I],nr.prototype,"enabled",2),M([I],nr.prototype,"range",2),M([I],nr.prototype,"bringToFront",2),M([I],nr.prototype,"highlightedItem",2),M([I],nr.prototype,"unhighlightedItem",2),M([I],nr.prototype,"highlightedSeries",2),M([I],nr.prototype,"unhighlightedSeries",2);var Gy=class extends we{};M([I],Gy.prototype,"strokeWidth",2),M([I],Gy.prototype,"dimOpacity",2),M([I],Gy.prototype,"enabled",2);var r2=class extends we{constructor(){super(...arguments),this.color="black"}};M([I],r2.prototype,"color",2);var Kn=class extends we{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1}};M([I],Kn.prototype,"type",2),M([I],Kn.prototype,"colorStops",2),M([I],Kn.prototype,"bounds",2),M([I],Kn.prototype,"gradient",2),M([I],Kn.prototype,"rotation",2),M([I],Kn.prototype,"reverse",2);var Tt=class extends we{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}};M([I],Tt.prototype,"type",2),M([I],Tt.prototype,"colorStops",2),M([I],Tt.prototype,"bounds",2),M([I],Tt.prototype,"gradient",2),M([I],Tt.prototype,"rotation",2),M([I],Tt.prototype,"scale",2),M([I],Tt.prototype,"reverse",2),M([I],Tt.prototype,"path",2),M([I],Tt.prototype,"pattern",2),M([I],Tt.prototype,"width",2),M([I],Tt.prototype,"height",2),M([I],Tt.prototype,"padding",2),M([I],Tt.prototype,"fill",2),M([I],Tt.prototype,"fillOpacity",2),M([I],Tt.prototype,"backgroundFill",2),M([I],Tt.prototype,"backgroundFillOpacity",2),M([I],Tt.prototype,"stroke",2),M([I],Tt.prototype,"strokeOpacity",2),M([I],Tt.prototype,"strokeWidth",2);var Qs=class extends we{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"}};M([I],Qs.prototype,"type",2),M([I],Qs.prototype,"url",2),M([I],Qs.prototype,"rotation",2),M([I],Qs.prototype,"scale",2),M([I],Qs.prototype,"backgroundFill",2),M([I],Qs.prototype,"backgroundFillOpacity",2),M([I],Qs.prototype,"repeat",2),M([I],Qs.prototype,"fit",2);var Ap=class extends we{constructor(e=!0){super(),this.deprecated=e,this.item=new sr,this.series=new Gy,this.text=new r2}set(e){return this.deprecated&&X.warnOnce("highlightStyle is deprecated, use highlight instead."),super.set(e)}};M([I],Ap.prototype,"item",2),M([I],Ap.prototype,"series",2),M([I],Ap.prototype,"text",2);var Zn=class extends we{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new nr,this.highlightStyle=new Ap}handleUnknownProperties(e,t){"context"in t&&(this.context=t.context,e.delete("context"))}};M([I],Zn.prototype,"id",2),M([I],Zn.prototype,"visible",2),M([I],Zn.prototype,"focusPriority",2),M([I],Zn.prototype,"showInLegend",2),M([I],Zn.prototype,"cursor",2),M([I],Zn.prototype,"nodeClickRange",2),M([I],Zn.prototype,"highlight",2),M([I],Zn.prototype,"highlightStyle",2);var l2=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(l2||{}),c2=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(c2||{});function pd(e,t,i,s){if(To(e))return{type:"gradient",gradient:e.gradient??t.gradient,colorStops:e.colorStops??t.colorStops,bounds:e.bounds??t.bounds,rotation:e.rotation??t.rotation,reverse:e.reverse??t.reverse};if(Yr(e)){const n=e.pattern??i.pattern;let o=e.strokeWidth;n==="backward-slanted-lines"||n==="forward-slanted-lines"||n==="horizontal-lines"||n==="vertical-lines"?o??(o=i.strokeWidth):o??(o=0);const a=e.width??e.height??i.width,r=e.height??e.width??i.height;return{type:"pattern",pattern:n,width:a,height:r,path:e.path,padding:e.padding??i.padding,fill:e.fill??i.fill,fillOpacity:e.fillOpacity??i.fillOpacity,backgroundFill:e.backgroundFill??i.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??i.backgroundFillOpacity,stroke:e.stroke??i.stroke,strokeOpacity:e.strokeOpacity??i.strokeOpacity,strokeWidth:o,rotation:e.rotation??i.rotation,scale:e.scale??i.scale}}return gc(e)?{type:"image",url:e.url,width:e.width,height:e.height,backgroundFill:e.backgroundFill??s.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??s.backgroundFillOpacity,rotation:e.rotation??s.rotation,repeat:e.repeat??s.repeat,fit:e.fit??s.fit}:e}function ma(e,t,i,s){return!To(e?.fill)&&!Yr(e?.fill)&&!gc(e?.fill)?e:{...e,fill:pd(e.fill,t,i,s)}}function h2(e,t,i,s){i==null||!To(t)||t.bounds==null||t.bounds==="item"?e.fillBBox=void 0:e.fillBBox=i[t.bounds],e.fillParams=s}function or(e,t,i,s){const n=t?.opacity??1;e.fill=t?.fill,h2(e,e.fill,i,s),e.fillOpacity=(t?.fillOpacity??1)*n,e.stroke=t?.stroke,e.strokeOpacity=(t?.strokeOpacity??1)*n,e.strokeWidth=t?.strokeWidth??0,e.lineDash=t?.lineDash,e.lineDashOffset=t?.lineDashOffset??0}var d2=(e=>(e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_NODE=1]="NEAREST_NODE",e[e.AXIS_ALIGNED=2]="AXIS_ALIGNED",e))(d2||{}),jH=.25,HH=.125,Vy=class{constructor(e,t,i,s){this.type=e,this.event=t,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=s.id}preventDefault(){this.defaultPrevented=!0}},jy=class{constructor(e,t){this.series=e,this.seriesGrouping=t,this.type="groupingChanged"}};function u2(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius"}}function I0(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius"}}var Hy=class extends KC{constructor(e){super(),this.cleanup=new mt,this.usesPlacedLabels=!1,this.hasChangesOnHighlight=!1,this.seriesGrouping=void 0,this.NodeEvent=Vy,this.internalId=ns(this),this.contentGroup=new As({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new As({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new As({name:`${this.internalId}-annotation`}),this.labelGroup=new As({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new h0,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this.declarationOrder=-1,this._broughtToFront=!1,this.events=new Io,this._pickNodeCache=new MS,this.fireEventWrapper=r=>super.fireEvent(r);const{moduleCtx:t,pickModes:i,propertyKeys:s={},propertyNames:n={},canHaveAxes:o=!1,usesPlacedLabels:a=!1}=e;this.ctx=t,this.propertyKeys=s,this.propertyNames=n,this.canHaveAxes=o,this.usesPlacedLabels=a,this.pickModes=i,this.cleanup.register(this.ctx?.eventsHub.on("highlight:change",r=>this.onChangeHighlight(r)))}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(e){this.properties.visible=e,this.ctx.legendManager.toggleItem(e,this.id),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){return this.data!=null&&this.data.length>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this._pickNodeCache.clear()}setOptionsData(e){this._data=e,this.onDataChange()}setChartData(e){this._chartData=e,this.data===e&&this.onDataChange()}onSeriesGroupingChange(e,t){const{internalId:i,type:s,visible:n}=this;e&&this.ctx.seriesStateManager.deregisterSeries(this),t&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:s,visible:n,seriesGrouping:t}),this.fireEvent(new jy(this,t))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(e,t,i){e.appendChild(this.contentGroup),t.appendChild(this.highlightGroup),t.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(e,t,i){e?.removeChild(this.contentGroup),t.removeChild(this.highlightGroup),t.removeChild(this.labelGroup),i?.removeChild(this.annotationGroup)}setSeriesIndex(e,t=!1){const i=this.bringToFront();return!t&&e===this.declarationOrder&&i===this._broughtToFront?!1:(this.declarationOrder=e,this._broughtToFront=i,this.setZIndex(i?Number.MAX_VALUE:e),this.fireEvent(new jy(this,this.seriesGrouping)),!0)}setZIndex(e){this.contentGroup.zIndex=[1,e,0],this.highlightGroup.zIndex=[1,e,1],this.labelGroup.zIndex=[1,e,2],this.annotationGroup.zIndex=e}renderToOffscreenCanvas(){return!1}addEventListener(e,t){return super.addEventListener(e,t)}removeEventListener(e,t){return super.removeEventListener(e,t)}hasEventListener(e){return super.hasEventListener(e)}addChartEventListeners(){}updatedDomains(){}destroy(){this.cleanup.flush(),this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getPropertyValues(e,t){const i=u2(e),s=i!=null?I0(this.resolveKeyDirection(i)):e,n=t?.[s],o=[];if(!n)return o;const a=(...r)=>{for(const l of r)Array.isArray(l)?a(...l):typeof l=="object"?a(...Object.values(l)):o.push(l)};return a(...n.map(r=>this.properties[r])),o}getKeys(e){return this.getPropertyValues(I0(e),this.propertyKeys)}getKeyProperties(e){return this.propertyKeys[this.resolveKeyDirection(e)]??[]}getNames(e){return this.getPropertyValues(I0(e),this.propertyNames)}getFormatterContext(e){const{id:t}=this,i=this.getPropertyValues(e,this.propertyKeys),s=this.getPropertyValues(e,this.propertyNames),n=[];for(let o=0;o<i.length;o++)n.push({seriesId:t,key:i[o],name:s[o]});return n}resolveKeyDirection(e){return e}getDomain(e){const t=this.getSeriesDomain(e),i=this.moduleMap.mapModules(s=>s.getDomain(e)).flat();return i.length!==0?t.concat(i):t}getRange(e,t){return this.getSeriesRange(e,t)}getVisibleItems(e,t,i){return 1/0}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){this.ctx.seriesStateManager.updateSeries(this)}getOpacity(){if(!this.properties.highlight)return 1;const{opacity:t=1}=this.getHighlightStyle();return t}getHighlightState(e,t,i,s){if(t)return 1;if(e?.series==null)return 0;if(this.isSeriesHighlighted(e,s)){const n=this.isItemHighlighted(e,i);return n==null||n?2:4}return 3}getHighlightStateString(e,t,i,s){switch(this.getHighlightState(e,t,i,s)){case 1:return"highlighted-item";case 4:return"unhighlighted-item";case 2:return"highlighted-series";case 3:return"unhighlighted-series";case 0:default:return"none"}}onChangeHighlight(e){const t=e.previousHighlight,i=e.currentHighlight,s=this.getHighlightState(i),n=this.getHighlightState(t);if(this.setSeriesIndex(this.declarationOrder),s===n){this.hasChangesOnHighlight=!1;return}const{highlightedSeries:o,unhighlightedItem:a,unhighlightedSeries:r}=this.properties.highlight,l=this.hasItemStylers();this.hasChangesOnHighlight=l||!Ev(o)||!Ev(a)||!Ev(r)}bringToFront(){return this.properties.highlight.bringToFront&&this.isSeriesHighlighted(this.ctx.highlightManager.getActiveHighlight())}isSeriesHighlighted(e,t){return e?.series===this}isItemHighlighted(e,t){if(!(e?.datumIndex==null||t==null))return e.datumIndex===t}getHighlightStyle(e,t,i){const s=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightState(s,e,t,i);return this.properties.highlight.getStyle(n)}getModuleTooltipParams(){return this.moduleMap.mapModules(e=>e.getTooltipParams()).reduce((e,t)=>Object.assign(e,t),{})}pickNodes(e,t,i=!1){const{pickModes:s,pickModeAxis:n,visible:o,contentGroup:a}=this;if(!o||!a.visible||t==="highlight"&&!this.properties.highlight.enabled||t==="highlight-tooltip"&&!this.properties.highlight.enabled)return;let r=1/0;if(t==="tooltip"||t==="highlight-tooltip"){const{tooltip:u}=this.properties;r=typeof u.range=="number"?u.range:1/0,i||(i=u.range==="exact")}else if(t==="event"||t==="context-menu"){const{nodeClickRange:u}=this.properties;r=typeof u=="number"?u:1/0,i||(i=u==="exact")}const l=s.filter(u=>!i||u===0),{x:c,y:h}=e,d=JSON.stringify({x:c,y:h,maxDistance:r,selectedPickModes:l});if(this._pickNodeCache.has(d))return this._pickNodeCache.get(d);for(const u of l){let p;switch(u){case 0:{const g=this.pickNodesExactShape(e);p=g.length===0?void 0:{datums:g,distance:0};break}case 1:{const g=this.pickNodeClosestDatum(e),f=g?.distance===0?this.pickNodesExactShape(e):void 0;f!=null&&f.length!==0?p={datums:f,distance:0}:g?p={datums:[g.datum],distance:g.distance}:p=void 0;break}case 2:{const g=n!=null?this.pickNodeMainAxisFirst(e,n==="main-category"):void 0;p=g!=null?{datums:[g.datum],distance:g.distance}:void 0;break}}if(p&&p.distance<=r)return this._pickNodeCache.set(d,{pickMode:u,datums:p.datums,distance:p.distance})}return this._pickNodeCache.set(d,void 0)}pickNodesExactShape(e){const t=[];for(const i of this.contentGroup.pickNodes(e.x,e.y)){const s=i.closestDatum();s!=null&&s.missing!==!0&&t.push(s)}return t}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,t){const i=Yf(e.x,e.y,t),s=i.nearest?.closestDatum();if(s!=null&&s.missing!==!0)return{datum:s,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(e){}fireEvent(e){Lo([this.properties,this.ctx.chartService],this.fireEventWrapper,e)}fireNodeClickEvent(e,t){const i=new this.NodeEvent("seriesNodeClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}fireNodeDoubleClickEvent(e,t){const i=new this.NodeEvent("seriesNodeDoubleClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}createNodeContextMenuActionEvent(e,t){return new this.NodeEvent("nodeContextMenuAction",e,t,this)}onLegendInitialState(e,t){const{visible:i=!0,itemId:s,legendItemName:n}=t??{};this.toggleSeriesItem(i,e,s,n)}onLegendItemClick(e){const{enabled:t,itemId:i,series:s,legendType:n}=e,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,r=o!=null&&o===e.legendItemName;(s.id===this.id||r||a!=null)&&this.toggleSeriesItem(t,n,i,o,e)}onLegendItemDoubleClick(e){const{enabled:t,itemId:i,series:s,numVisibleItems:n,legendType:o}=e,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,r="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=a!=null&&a===e.legendItemName;s.id===this.id||l||r!=null?this.toggleSeriesItem(!0,o,i,a,e):t&&n===1?this.toggleSeriesItem(!0,o,void 0,a):this.toggleSeriesItem(!1,o,void 0,a)}toggleSeriesItem(e,t,i,s,n){const o=this.id;(e||t!=="category")&&(this.visible=e),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const a={type:"seriesVisibilityChange",seriesId:o,itemId:i,legendItemName:n?.legendItemName??s,visible:e};this.fireEvent(a),this.ctx.legendManager.toggleItem(e,o,i,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getAxisValueText(e,t,i,s,n,o){const{id:a,properties:r}=this;return e.formatDatum(r,i,t,a,o,s,n)}getLabelText(e,t,i,s,n,o,a){if(e==null)return"";const{axes:r,canHaveAxes:l,ctx:c,id:h,properties:d}=this,u="series-label",p="legendItemName"in d?d.legendItemName:void 0,g={seriesId:this.id,...a},f=l?u2(s):void 0,x=f!=null?r[this.resolveKeyDirection(f)]:void 0;if(x!=null)return x.formatDatum(d,e,u,h,p,t,i,n,o,g);const{formatManager:m}=c,b=this.callWithContext.bind(this),v=D=>o.formatValue(b,D.type,D.value,g)??m.format(b,D)??String(e),S=this.getFormatterContext(s);switch(s){case"y":case"color":case"size":return v({type:"number",value:e,datum:t,seriesId:h,legendItemName:p,key:i,source:u,property:s,domain:n,boundSeries:S,fractionDigits:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return v({type:"category",value:e,datum:t,seriesId:h,legendItemName:p,key:i,source:u,property:s,domain:n,boundSeries:S})}}getMarkerStyle(e,{datumIndex:t,datum:i,point:s},n,o=!1,a={size:s?.size??e.size??0},r,l=!0){const{itemStyler:c,fillGradientDefaults:h,fillPatternDefaults:d,fillImageDefaults:u}=e,p=l?this.getHighlightStyle(o,t):void 0,g=et(p,a,e.getStyle(),r);let f=ma(g,h,d,u);if(c&&n){const x=this.ctx.highlightManager?.getActiveHighlight(),m=this.getHighlightStateString(x,o,t),b=this.cachedCallWithContext(c,{seriesId:this.id,...f,...n,highlighted:o,highlightState:m,datum:i});f=ma(et(b,f),h,d,u)}return f}applyMarkerStyle(e,t,i,s,{applyTranslation:n=!0,selected:o=!0}={}){const{shape:a,size:r=0}=e,l=this.visible&&r>0&&i&&!isNaN(i.x)&&!isNaN(i.y);if(or(t,e,s),n?t.setProperties({visible:l,shape:a,size:r,x:i?.x,y:i?.y,scalingCenterX:i?.x,scalingCenterY:i?.y}):t.setProperties({visible:l,shape:a,size:r}),o||(t.fillOpacity*=jH,t.strokeOpacity*=HH),typeof a=="function"&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const c=t.getBBox();if(i!=null&&c.isFinite()){const h=c.computeCenter(),[d,u]=["x","y"].map(p=>(e.strokeWidth??0)+Math.abs(h[p]-i[p]));i.focusSize=Math.max(c.width+d,c.height+u)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(e){const{width:t,height:i}=e??{width:NaN,height:NaN},s=e?{seriesRectWidth:t,seriesRectHeight:i}:void 0,n=Xa(this.nodeDataDependencies,s)!=null;return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(e){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(e,t){const{datumCallbackCache:i}=this,s=i.get(e);if(s!=null)return s;try{const n=t();return i.set(e,n),n}catch(n){X.error(String(n))}}cachedCallWithContext(e,...t){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],e,...t)}callWithContext(e,...t){return Lo([this.properties,this.ctx.chartService],e,...t)}formatTooltipWithContext(e,t,i){return e.formatTooltip([this.properties,this.ctx.chartService],t,i)}minTimeInterval(){}};M([Is({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],Hy.prototype,"seriesGrouping",2);var WH=class{constructor(e){this.swapChain=e,this.hasBeenActivated=!1,this.div=ke("div"),this.svg=ti("svg"),this.outerPath=ti("path"),this.innerPath=ti("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=ke("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",t=>this.onSwap(t))}clear(){}update(e,t,i){if(t!=null)if(e instanceof ks){const s=(o,a)=>{let{x:r,y:l}=Gt.toCanvasPoint(e,o,a);return r-=t.x??0,l-=t.y??0,{x:r,y:l}},n=e.svgPathData(s);this.outerPath.setAttribute("d",n),this.innerPath.setAttribute("d",n),this.show(this.svg)}else{let s;if(i){const n=Math.max(e.x-t.x,0),o=Math.max(e.y-t.y,0),a=Math.min(e.x+e.width-t.x,t.width),r=Math.min(e.y+e.height-t.y,t.height);s=new de(n,o,a-n,r-o)}else s=new de(e.x-t.x,e.y-t.y,e.width,e.height);iy(this.div,s),this.show(this.div)}}onSwap(e){e!==this.element.parentElement&&(this.element.remove(),e.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(e){this.hasBeenActivated=!0,this.element.innerHTML="",this.element.append(e)}overrideFocusVisible(e){this.focusVisible=e;const t={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",t[`${e}`])}isFocusVisible(e=!1){if(!e&&!this.hasBeenActivated)return!1;const t=this.element.parentElement;return t!=null&&Ze().getComputedStyle(t).opacity==="1"}},$H=class{constructor(e,t,i,s){this.label1=e,this.label2=t,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=n=>(ha(n.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",n)),this.onFocus=n=>(ha(n.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",n)),Ge(this.label1,"id",cc()),Ge(this.label2,"id",cc()),ha(this.label1,"display","none"),ha(this.label2,"display","none"),this.label1.textContent=s,this.label2.textContent=s,this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),Ge(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap(s)}createAnnouncer(e){const t=ke("div");return t.role=e,t.className="ag-charts-swapchain",t.addEventListener("blur",this.onBlur),t.addEventListener("focus",this.onFocus),t}destroy(){for(const e of[this.activeAnnouncer,this.inactiveAnnouncer])e.removeEventListener("blur",this.onBlur),e.removeEventListener("focus",this.onFocus),e.remove()}focus(e){this.focusOptions=e,this.activeAnnouncer.focus(e),this.focusOptions=void 0}update(e){this.skipDispatch=!0,this.swap(e),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(e,t){this.listeners[e].push(t),e==="swap"&&t(this.activeAnnouncer)}dispatch(e,t){e==="focus"?this.hasFocus=!0:e==="blur"&&(this.hasFocus=!1),this.listeners[e].forEach(i=>i(t))}swap(e){const t=this.activeAnnouncer.tabIndex;this.label2.textContent=e,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],ca(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),ca(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:t}),this.dispatch("swap",this.activeAnnouncer)}},UH={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 YH(e,t){for(const i of t)if("code"in i){if(i.code===e.code)return!0}else if(i.key===e.key&&(i.shift===void 0||i.shift===e.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===e.ctrlKey||i.ctrlOrMeta===e.metaKey))return!0;return!1}function KH(e){for(const[t,{activatesFocusIndicator:i=!0,bindings:s}]of Et(UH))if(YH(e,s))return{name:t,activatesFocusIndicator:i}}function ZH(e,t,i){const s=jS(e,i.datum,i.movedBounds);if(s!=null)return{x:s.canvasX,y:s.canvasY};const n=i.bounds;if(n!=null){if(n instanceof de){const{x:o,y:a}=n.computeCenter();return{x:t.x+o,y:t.y+a}}return Gt.toCanvas(n).computeCenter()}}function XH({bounds:e}){return e instanceof de?e:e!=null?Gt.toCanvas(e):de.NaN}function qH(e,t,i){const{x:s,y:n}=ZH(e,t,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}function p2(e,t,i,s){let{top:n,right:o,bottom:a,left:r,width:l,height:c}=s;return r!=null?l!=null?o=i.width-r+l:o!=null&&(l=i.width-r-o):o!=null&&l!=null&&(r=i.width-o-l),n!=null?c!=null?a=i.height-n-c:a!=null&&(c=i.height-a-n):a!=null&&c!=null&&(n=i.height-a-c),l==null?c==null?(c=t,l=e):l=Math.ceil(e*c/t):c??(c=Math.ceil(t*l/e)),r==null&&(o==null?r=Math.floor((i.width-l)/2):r=i.width-o-l),n==null&&(a==null?n=Math.floor((i.height-c)/2):n=i.height-c-a),{x:r,y:n,width:l,height:c}}var g2=.1,f2=200,y2=12,QH=.5,JH=class{constructor(){this.events=new Io,this.x1=NaN,this.y1=NaN,this.x=NaN,this.y=NaN,this.vx=0,this.vy=0,this.t0=NaN,this.animationFrameHandle=void 0}reset(){this.x=NaN,this.y=NaN,this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(e,t){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=e,this.y=t,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=e,this.y1=t,this.t0=Date.now(),this.animationFrameHandle??(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:e,y1:t,t0:i}=this,s=Date.now(),n=s-i;this.t0=s;const o=.001,a=Math.ceil(n/(o*1e3))|0;let{x:r,y:l,vx:c,vy:h}=this;for(let d=0;d<a;d+=1){const u=r-e,p=l-t,g=-(f2*u+y2*c)/g2,f=-(f2*p+y2*h)/g2;c+=g*o,h+=f*o,r+=c*o,l+=h*o}Math.hypot(r-e,l-t)<QH?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=r,this.y=l,this.vx=c,this.vy=h,this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.events.emit("update",{x:this.x,y:this.y})}},Wy=null;function Ip(e){return e===""?"":(Wy??(Wy=ke("div")),Wy.textContent=String(e),Wy.innerHTML.replace(/\n/g,"<br>"))}function kp(e,t){const{path:i,size:s}=e,{x:n,y:o}=e;i.clear();let a=!1;for(const[r,l]of t){const c=n+(r-.5)*s,h=o+(l-.5)*s;a?i.lineTo(c,h):i.moveTo(c,h),a=!0}i.closePath()}var eW={circle({path:e,x:t,y:i,size:s}){const n=s/2;e.arc(t,i,n,0,Math.PI*2),e.closePath()},cross(e){kp(e,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(e){kp(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:i,size:s}){const n=s/4;i=i+n/2,e.arc(t-n,i-n,n,os(130),os(330)),e.arc(t+n,i-n,n,os(220),os(50)),e.lineTo(t,i+n),e.closePath()},pin({path:e,x:t,y:i,size:s}){e.moveTo(t+(.15625-.5)*s,i+(.34375-.5)*s),e.cubicCurveTo(t+(.15625-.5)*s,i+(.151491-.5)*s,t+(.307741-.5)*s,i+(0-.5)*s,t+(.5-.5)*s,i+(0-.5)*s),e.cubicCurveTo(t+(.692259-.5)*s,i+(0-.5)*s,t+(.84375-.5)*s,i+(.151491-.5)*s,t+(.84375-.5)*s,i+(.34375-.5)*s),e.cubicCurveTo(t+(.84375-.5)*s,i+(.493824-.5)*s,t+(.784625-.5)*s,i+(.600181-.5)*s,t+(.716461-.5)*s,i+(.695393-.5)*s),e.cubicCurveTo(t+(.699009-.5)*s,i+(.719769-.5)*s,t+(.681271-.5)*s,i+(.743104-.5)*s,t+(.663785-.5)*s,i+(.766105-.5)*s),e.cubicCurveTo(t+(.611893-.5)*s,i+(.834367-.5)*s,t+(.562228-.5)*s,i+(.899699-.5)*s,t+(.528896-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.524075-.5)*s,i+(.992358-.5)*s,t+(.512663-.5)*s,i+(1-.5)*s,t+(.5-.5)*s,i+(1-.5)*s),e.cubicCurveTo(t+(.487337-.5)*s,i+(1-.5)*s,t+(.475925-.5)*s,i+(.992358-.5)*s,t+(.471104-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.487337-.5)*s,i+(1-.5)*s,t+(.475925-.5)*s,i+(.992358-.5)*s,t+(.471104-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.437772-.5)*s,i+(.899699-.5)*s,t+(.388107-.5)*s,i+(.834367-.5)*s,t+(.336215-.5)*s,i+(.766105-.5)*s),e.cubicCurveTo(t+(.318729-.5)*s,i+(.743104-.5)*s,t+(.300991-.5)*s,i+(.719769-.5)*s,t+(.283539-.5)*s,i+(.695393-.5)*s),e.cubicCurveTo(t+(.215375-.5)*s,i+(.600181-.5)*s,t+(.15625-.5)*s,i+(.493824-.5)*s,t+(.15625-.5)*s,i+(.34375-.5)*s),e.closePath()},plus(e){kp(e,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:e,x:t,y:i,size:s,pixelRatio:n}){const o=s/2;e.moveTo(_i(n,t-o),_i(n,i-o)),e.lineTo(_i(n,t+o),_i(n,i-o)),e.lineTo(_i(n,t+o),_i(n,i+o)),e.lineTo(_i(n,t-o),_i(n,i+o)),e.closePath()},star({path:e,x:t,y:i,size:s}){const o=s/2,a=o/2,r=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?o:a,h=l*Math.PI/5-r,d=t+Math.cos(h)*c,u=i+Math.sin(h)*c;e.lineTo(d,u)}e.closePath()},triangle(e){kp(e,[[.5,0],[1,.87],[0,.87]])}},Cp=class extends ks{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}isPointInPath(e,t){return this.distanceSquared(e,t)<=0}distanceSquared(e,t){const i=wi.anchor(this.shape);return Math.max(Math.hypot(e-this.x+(i.x-.5)*this.size,t-this.y+(i.y-.5)*this.size)-this.size/2,0)}updatePath(){const{path:e,shape:t,x:i,y:s,size:n}=this,o=this.layerManager?.canvas?.pixelRatio??1,a=wi.anchor(t),r={path:e,x:i-(a.x-.5)*n,y:s-(a.y-.5)*n,size:n,pixelRatio:o};e.clear(),typeof t=="string"?eW[t](r):typeof t=="function"&&t(r)}computeBBox(){const{x:e,y:t,size:i}=this,s=wi.anchor(this.shape);return new de(e-i*s.x,t-i*s.y,i,i)}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};M([mn({equals:_h})],Cp.prototype,"shape",2),M([te()],Cp.prototype,"x",2),M([te()],Cp.prototype,"y",2),M([te({convertor:Math.abs})],Cp.prototype,"size",2);var wi=class extends Hh(pS(Wh(Cp))){static anchor(e){return e==="pin"?{x:.5,y:1}:typeof e=="function"&&"anchor"in e?e.anchor:{x:.5,y:.5}}constructor(e){super(e),e?.shape!=null&&(this.shape=e.shape)}};function m2(e,t,i=t*(5/3)){const s=new Re,n=Math.min(e.marker.strokeWidth??1,2),o=Math.min(e.line?.strokeWidth??0,2),a=Math.max(e.marker.enabled===!1?0:t,e.line==null?0:i),r=Math.max(e.marker.enabled===!1?0:t,o);if(e.line!=null){const{stroke:l,strokeOpacity:c,lineDash:h}=e.line,d=new Sn;d.x1=0,d.y1=r/2,d.x2=a,d.y2=r/2,d.stroke=l,d.strokeOpacity=c,d.strokeWidth=o,d.lineDash=h,s.append(d)}if(e.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:d,strokeOpacity:u,lineDash:p,lineDashOffset:g}=e.marker,f=new wi;f.shape=l??"square",f.size=t,f.fill=c,f.fillOpacity=h??1,f.stroke=d,f.strokeOpacity=u??1,f.strokeWidth=n,f.lineDash=p,f.lineDashOffset=g??0;const x=wi.anchor(l),m=a/2+(x.x-.5)*t,b=r/2+(x.y-.5)*t,v=t/(t+n);f.x=m,f.y=b,f.scalingCenterX=m,f.scalingCenterY=b,f.scalingX=v,f.scalingY=v,s.append(f)}return Re.toSVG(s,a,r)}var Zi="ag-charts-tooltip",x2="ag-charts-tooltip--dark";function b2(e){const t=[],i=new Map;for(const s of e)if(s.type==="structured"){const{heading:n}=s,o=n!=null?i.get(n):void 0,a={type:"structured",heading:n,items:[s]};o==null?(i.set(n,a),t.push(a)):o.items.push(s)}else t.push(s);return t}function v2(e){const t=b2(e),i=[];return t.forEach(s=>{if(s.type==="raw")return"";s.heading!=null&&i.push(s.heading),s.items.forEach(n=>{n.title!=null&&i.push(n.title),n.data?.forEach(o=>{i.push(o.label??o.fallbackLabel,o.value)})})}),i.join("; ")}function k0(e,t,i){let s="";e==null?s+=`<span class="${Zi}-label">${Ip(t)}</span>`:(s+=`<span class="${Zi}-label">${Ip(e)}</span>`,s+=" ",s+=`<span class="${Zi}-value">${Ip(t)}</span>`);const n=[`${Zi}-row`];return i&&n.push(`${Zi}-row--inline`),s=`<div class="${n.join(" ")}">${s}</div>`,s}function tW(e){let t="";if(e.data?.length&&e.data.every(n=>n.value==null||n.value===""))return t;const i=e.title==null&&e.data?.length===1,s=e.symbol==null?void 0:m2(e.symbol,12);return s!=null&&(e.title!=null||e.data?.length)&&(t+=`<span class="${Zi}-symbol">${s}</span>`),e.title!=null&&(t+=`<span class="${Zi}-title">${Ip(e.title)}</span>`,t+=" "),e.data?.forEach(n=>{t+=k0(n.label??n.fallbackLabel,n.value,i),t+=" "}),t}function S2(e,t){if(e==null||t.length===1)return;const i=e?.t("tooltipPaginationStatus",{index:t.index+1,count:t.length});return`<div class="${Zi}-footer">${i}</div>`}function M2(e,t,i,s){const n=t.items.length===1?t.items[0]:void 0;let o,a,r;switch(i){case"compact":o=!0,a=n?.title;break;case"single":o=n!=null&&(t.heading==null||n.title==null)&&n.data?.length===1&&n.data[0].label==null&&n.data[0].value!=null,r=t.heading??n?.title;break;case"shared":o=!1}let l="";if(o&&n!=null?(a!=null&&(l+=k0(void 0,a,!1)),n.data?.forEach(h=>{l+=k0(h.label??r,h.value,!1),l+=" "})):(t.heading!=null&&(l+=`<span class="${Zi}-heading">${Ip(t.heading)}</span>`,l+=" "),t.items.forEach(h=>{l+=tW(h)})),l.length===0)return;const c=i!=="compact"&&s!=null?S2(e,s):void 0;return c+null&&(l+=c),l=`<div class="${Zi}-content">${l.trimEnd()}</div>`,l}function iW(e,t){const i=t==null?void 0:S2(e,t);return i==null?"":`<div class="${Zi}-content">${i}</div>`}function D2(e,t,i,s){const n=b2(t);if(n.length!==0){if(n.length===1&&n[0].type==="structured")return M2(e,n[0],i,s);{const o=n.map(a=>a.type==="structured"?M2(e,a,i):a.rawHtmlString);return s!=null&&o.push(iW(e,s)??""),o.join("")}}}var sW={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},nW={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},oW={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},A2={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},aW={pointer:"top",node:"top",chart:"top-left"},Ac=class extends we{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};M([I],Ac.prototype,"xOffset",2),M([I],Ac.prototype,"yOffset",2),M([I],Ac.prototype,"anchorTo",2),M([I],Ac.prototype,"placement",2);var Xn=class extends we{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new Ac,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new mt,this.springAnimation=new JH,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new yT,this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.cleanup.register(this.springAnimation.events.on("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(e,t){return"togglePopover"in Ze().HTMLElement.prototype&&(this.element=t.addChild("tooltip-container",Zi),this.element.setAttribute("popover","manual"),this.element.className=Zi,this.element.style.positionAnchor=t.anchorName,this.sizeMonitor.observe(this.element,i=>{this._elementSize=i,this.updateTooltipPosition()})),this.localeManager=e,()=>{t.removeChild("tooltip-container",Zi),this.cleanup.flush(),this.element&&this.sizeMonitor.unobserve(this.element)}}isVisible(){return this._visible}contains(e){return this.element?.contains(e)??!1}updateTooltipPosition(){const{element:e,_elementSize:t,positionParams:i}=this;if(e==null||t==null||i==null)return;const{canvasRect:s,relativeRect:n,meta:o}=i,{x:a,y:r}=this.springAnimation,l=o.position?.anchorTo??"pointer";let c=o.position?.placement??aW[l];Array.isArray(c)||(c=[c]);const h=o.position?.xOffset??0,d=o.position?.yOffset??0,u=n.x,p=n.y,g=n.width-t.width-1+u,f=n.height-t.height+p;let x=0,m,b,v=!1;do{m=c[x],x+=1;const k=this.getTooltipBounds({elementSize:t,placement:m,anchorTo:l,canvasX:a,canvasY:r,yOffset:d,xOffset:h,canvasRect:s});b=p2(t.width,t.height,n,k),v=!1,A2[m]&1&&(v||(v=b.x<u||b.x>g)),A2[m]&2&&(v||(v=b.y<p||b.y>f))}while(x<c.length&&v);const S=ve(u,b.x,g),D=ve(p,b.y,f);v||(v=S!==b.x||D!==b.y);const C=l!=="chart"&&!v&&!h&&!d,T=o.showArrow??this.showArrow??C;this.arrowPosition=T?oW[m]:void 0,this.updateClassModifiers(),e.style.translate=`${S}px ${D}px`}show(e,t,i,s,n,o=!1){const{element:a}=this;if(a!=null&&s!=null&&s.length!==0){const c=D2(this.localeManager,s,this.mode,this.pagination?n:void 0);if(c==null){this.toggle(!1);return}a.innerHTML=c}else if(a==null||a.innerHTML===""){this.toggle(!1);return}const r={x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height};switch(this.positionParams={canvasRect:t,relativeRect:r,meta:i},i.position?.anchorTo??"pointer"){case"node":this.springAnimation.update(i.nodeCanvasX??i.canvasX,i.nodeCanvasY??i.canvasY);break;case"pointer":this.springAnimation.update(i.canvasX,i.canvasY);break;case"chart":this.springAnimation.reset()}i.enableInteraction?(this.enableInteraction=!0,a.style.pointerEvents="auto",a.removeAttribute("aria-hidden"),a.tabIndex=-1):(this.enableInteraction=!1,a.style.pointerEvents="none",a.setAttribute("aria-hidden","true"),a.removeAttribute("tabindex")),a.style.setProperty("--top",`${t.top}px`),a.style.setProperty("--left",`${t.left}px`),this.updateClassModifiers(),this.toggle(!0,o)}hide(){this.toggle(!1)}maybeEnterInteractiveTooltip({relatedTarget:e},t){const{interactive:i,interactiveLeave:s,enabled:n,element:o}=this;if(o==null)return!1;if(s)return!0;const a=i&&n&&this.isVisible()&&e instanceof Node&&this.contains(e);return a&&(this.interactiveLeave={callback:t,listener:r=>{(r.relatedTarget==null||r.relatedTarget instanceof Node&&!this.contains(r.relatedTarget))&&this.popInteractiveLeaveCallback()}},o.addEventListener("focusout",this.interactiveLeave.listener),o.addEventListener("mouseout",this.interactiveLeave.listener)),a}popInteractiveLeaveCallback(){const{interactiveLeave:e,element:t}=this;this.interactiveLeave=void 0,e&&(t&&(t.removeEventListener("focusout",e.listener),t.removeEventListener("mouseout",e.listener)),e.callback())}toggle(e,t=!1){const{delay:i}=this;e&&i>0&&!t?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(e))}toggleCallback(e){this.element?.isConnected&&this._visible!==e&&(this._visible=e,this.element.togglePopover(e),e?this.updateTooltipPosition():(this.springAnimation.reset(),this.popInteractiveLeaveCallback()))}updateClassModifiers(){if(!this.element?.isConnected)return;const{classList:e}=this.element,t=(i,s)=>e.toggle(`${Zi}--${i}`,s);t("no-interaction",!this.enableInteraction),t("arrow-top",this.arrowPosition===1),t("arrow-right",this.arrowPosition===3),t("arrow-bottom",this.arrowPosition===2),t("arrow-left",this.arrowPosition===0),t("compact",this.mode==="compact"),e.toggle(x2,this.darkTheme);for(const i of this.wrapTypes)e.toggle(`${Zi}--wrap-${i}`,i===this.wrapping)}getTooltipBounds(e){const{elementSize:t,anchorTo:i,placement:s,canvasX:n,canvasY:o,yOffset:a,xOffset:r,canvasRect:l}=e,{width:c,height:h}=t,d={width:c,height:h};if(i==="node"||i==="pointer"){const u=sW[s],p=nW[s];return d.top=o+a+h*(p-1)/2+8*p,d.left=n+r+c*(u-1)/2+8*u,d}switch(s){case"top":return d.top=a,d.left=l.width/2-c/2+r,d;case"right":return d.top=l.height/2-h/2+a,d.left=l.width-c/2+r,d;case"left":return d.top=l.height/2-h/2+a,d.left=r,d;case"bottom":return d.top=l.height-h+a,d.left=l.width/2-c/2+r,d;case"top-left":return d.top=a,d.left=r,d;case"top-right":return d.top=a,d.left=l.width-c+r,d;case"bottom-right":return d.top=l.height-h+a,d.left=l.width-c+r,d;case"bottom-left":return d.top=l.height-h+a,d.left=r,d}return d}};M([I],Xn.prototype,"enabled",2),M([I],Xn.prototype,"mode",2),M([I],Xn.prototype,"showArrow",2),M([I],Xn.prototype,"delay",2),M([I],Xn.prototype,"range",2),M([I],Xn.prototype,"wrapping",2),M([I],Xn.prototype,"position",2),M([I],Xn.prototype,"pagination",2),M([I],Xn.prototype,"darkTheme",2),M([I],Xn.prototype,"bounds",2);function C0(e,t){return e.series===t.series&&Ci(e.datumIndex,t.datumIndex)}var rW=class{constructor(){this.candidates=[]}get current(){return this.active}reset(){this.candidates.length=0,this.active=void 0}update(e,t){this.candidates=e;let i=t!=null?e.findIndex(s=>C0(s,t)):-1;return i===-1&&(i=0),this.active=e[i],{current:this.active,index:i,length:e.length}}next(){const{candidates:e,active:t}=this,i=t==null?-1:e.findIndex(n=>C0(n,t));if(i===-1)return;let s=i+1;return s>=e.length&&(s=0),this.active=e[s],{current:this.active,index:s,length:this.candidates.length}}},lW=class extends TS{constructor(e){super(),this.chart=e,this.id=ns(this),this.series=[],this.announceMode="when-changed",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.cachedTooltipContent=void 0,this.hoverScheduler=LV(()=>{if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=5){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}}),this.tooltipCandidates=new rW;const t=e.ctx.localeManager.t("ariaInitSeriesArea"),i=e.ctx.domManager.addChild("series-area","series-area-aria-label1"),s=e.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new $H(i,s,"img",t),this.swapChain.addListener("blur",r=>this.onBlur(r)),this.swapChain.addListener("focus",()=>this.onFocus()),e.ctx.domManager.mode==="normal"&&(this.focusIndicator=new WH(this.swapChain),this.focusIndicator.overrideFocusVisible(e.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:n,seriesWidget:o,containerWidget:a}=e.ctx.widgets;o.setTabIndex(-1),this.cleanup.register(()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label2"),o.addListener("focus",()=>this.swapChain.focus({preventScroll:!0})),o.addListener("mousemove",r=>this.onHover(r,o)),o.addListener("wheel",r=>this.onWheel(r)),o.addListener("mouseleave",r=>this.onLeave(r)),o.addListener("keydown",r=>this.onKeyDown(r)),o.addListener("contextmenu",(r,l)=>this.onContextMenu(r,l)),a.addListener("contextmenu",(r,l)=>this.onContextMenu(r,l)),a.addListener("click",(r,l)=>this.onClick(r,l)),a.addListener("dblclick",(r,l)=>this.onClick(r,l)),e.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),e.ctx.eventsHub.on("dom:resize",()=>this.clearAll()),e.ctx.eventsHub.on("highlight:change",r=>this.changeHighlightDatum(r)),e.ctx.eventsHub.on("layout:complete",r=>this.layoutComplete(r)),e.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),e.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),e.ctx.eventsHub.on("zoom:change",()=>this.clearAll()),e.ctx.eventsHub.on("zoom:pan-start",()=>this.clearAll())),n&&this.cleanup.register(n.events.on("drag-move",r=>this.onDragMove(r,o)),n.events.on("click",r=>this.onClick(r,o)),n.events.on("dblclick",r=>this.onClick(r,o)))}get bbox(){return(this.seriesRect??de.zero).clone()}isState(e){return this.chart.ctx.interactionManager.isState(e)}isIgnoredTouch(e){return!(e.device!=="touch"||e.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(9))}dataChanged(){var e;this.cachedTooltipContent=void 0,this.highlight.appliedHoverEvent&&((e=this.highlight).stashedHoverEvent??(e.stashedHoverEvent=this.highlight.appliedHoverEvent),this.clearHighlight()),this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear()}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0)}updateComplete(){this.isState(34)&&this.focusIndicator?.isFocusVisible()&&(this.announceMode!=="always"&&(this.announceMode="never"),this.handleFocus(0,0))}update(e,t){this.chart.ctx.updateService.update(e,t)}seriesChanged(e){this.focus.sortedSeries=[...e].sort((t,i)=>{let s=t.properties.focusPriority??1/0,n=i.properties.focusPriority??1/0;return s===n&&([s,n]=[t.declarationOrder,i.declarationOrder]),s<n?-1:s>n?1:0}),this.series=e}layoutComplete(e){this.seriesRect=e.series.rect,this.hoverRect=e.series.rect,this.chart.ctx.widgets.seriesWidget.setBounds(e.series.rect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(e.chart)}onContextMenu(e,t){const{sourceEvent:i}=e;if(i.currentTarget!=t.getElement())return;if(i.target==this.chart.ctx.widgets.containerWidget.getElement()){if(this.isState(36)){const{currentX:l,currentY:c}=e;this.chart.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:e,canvasX:l,canvasY:c},void 0)}return}let s,n;if(this.focusIndicator?.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(n=Gt.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(36)){const l=this.pickNodes({x:e.currentX,y:e.currentY},"context-menu");l&&(this.chart.ctx.highlightManager.updateHighlight(this.id),s=l.matches[0].datum)}const o=s?.series;this.clearAll();const a=e.currentX+t.cssLeft(),r=e.currentY+t.cssTop();o&&s?this.chart.ctx.contextMenuRegistry.dispatchContext("series-node",{widgetEvent:e,canvasX:a,canvasY:r},{pickedSeries:o,pickedNode:s},n):this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{widgetEvent:e,canvasX:a,canvasY:r},void 0,n)}onLeave(e){!this.isState(41)||e.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.maybeEnterInteractiveTooltip(e.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),this.hoverDevice!=="keyboard"&&this.clearAll())}onWheel(e){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.previousInputDevice="pointer")}onDragMove(e,t){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t))}onHover(e,t){this.isState(41)&&this.onHoverLikeEvent(e,t)}onHoverLikeEvent(e,t){if(!this.isIgnoredTouch(e)&&(e.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&e.sourceEvent.preventDefault(),t===this.chart.ctx.widgets.seriesWidget&&((e.device==="touch"||cW(e,"drag-move"))&&(this.tooltip.lastHover=e),this.hoverDevice="pointer",this.previousInputDevice="pointer",this.highlight.pendingHoverEvent=e,this.hoverScheduler.schedule(),this.isState(32)))){const{currentX:i,currentY:s}=e,n=this.pickNodes({x:i,y:s},"event")?.matches,o=n?.[0];o?.series.hasEventListener("seriesNodeClick")||o?.series.hasEventListener("seriesNodeDoubleClick")||n!=null&&n.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}}onClick(e,t){if(e.device==="keyboard"||(t===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),e.device==="touch"&&t===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(41)))return;if(t===this.chart.ctx.widgets.seriesWidget){if(!t.getElement().contains(e.sourceEvent.target))return}else if(e.sourceEvent.target!=t.getElement())return;if(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t),!this.isState(32))return;if(t==this.chart.ctx.widgets.seriesWidget&&this.checkSeriesNodeClick(e)){this.update(5),e.sourceEvent.preventDefault();return}const i={type:e.type==="click"?"click":"doubleClick",event:e.sourceEvent};this.chart.fireEvent(i)}onFocus(){this.isState(34)&&(this.hoverDevice=this.focusIndicator?.isFocusVisible(!0)?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(e){this.isState(34)&&(this.hoverDevice="pointer",this.maybeEnterInteractiveTooltip(e)||this.clearAll(),this.focusIndicator?.overrideFocusVisible(void 0))}onKeyDown(e){if(!this.isState(43))return;const t=KH(e.sourceEvent);switch(t?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.previousInputDevice==="keyboard"),t?.name){case"redo":return this.chart.ctx.eventsHub.emit("series:redo",null);case"undo":return this.chart.ctx.eventsHub.emit("series:undo",null);case"zoomin":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:1,widgetEvent:e});case"zoomout":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:-1,widgetEvent:e});case"arrowup":return this.onArrow(-1,0,e);case"arrowdown":return this.onArrow(1,0,e);case"arrowleft":return this.onArrow(0,-1,e);case"arrowright":return this.onArrow(0,1,e);case"submit":return this.onSubmit(e)}}onArrow(e,t,i){this.isState(34)&&(this.hoverDevice="keyboard",this.previousInputDevice="keyboard",this.focusIndicator?.overrideFocusVisible(!0),this.focus.seriesIndex+=e,this.focus.datumIndex+=t,this.handleFocus(e,t),i.sourceEvent.preventDefault(),this.chart.ctx.eventsHub.emit("series:focus-change",null))}onSubmit(e){if(!this.isState(34))return;const{series:t,datum:i}=this.focus,s=e.sourceEvent;t!=null&&i!=null?t.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s}),s.preventDefault()}checkSeriesNodeClick(e){var t;const i=this.pickNodes({x:e.currentX,y:e.currentY},"event");if(i==null||i.matches.length===0)return;const s=this.chart.tooltip.pagination?this.tooltipCandidates.update(i.matches,this.tooltipCandidates.current)?.current:void 0,{series:n,datum:o}=s??i.matches[0],a=s==null?i.distance:0;if(e.type==="click"){const l=n.fireNodeClickEvent(e.sourceEvent,o)&&this.chart.tooltip.pagination?this.tooltipCandidates.next():void 0;if(l!=null){e.sourceEvent.preventDefault();const{currentX:c,currentY:h}=e,d=c+(this.hoverRect?.x??0),u=h+(this.hoverRect?.y??0);(t=this.highlight).pendingHoverEvent??(t.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1),this.showTooltip(l.current,d,u,{index:l.index,length:l.length})}return!0}return e.type==="dblclick"?(e.preventZoomDblClick=a===0,n.fireNodeDoubleClickEvent(e.sourceEvent,o),!0):!1}handleFocus(e,t){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);i==null?this.handleSeriesFocus(e,t)===0?this.announceMode="when-changed":this.announceMode="always":(this.focusIndicator?.update(i.rect,this.seriesRect,!1),this.swapChain.update(i.text),this.announceMode="always")}handleSeriesFocus(e,t){if(this.chart.chartType==="standalone")return this.handleSoloSeriesFocus(e,t);const{focus:i}=this,s=i.sortedSeries.filter(l=>l.visible&&l.focusable);if(s.length===0)return 1;const n=i.datumIndex-t,o=i.seriesIndex-e;i.seriesIndex=ve(0,i.seriesIndex,s.length-1),i.series=s[i.seriesIndex];const a=this.focus.datumIndex,r=this.focus.seriesIndex;return this.updatePickedFocus(a,t,n,r,e,o)}handleSoloSeriesFocus(e,t){this.focus.series=this.focus.sortedSeries[0];const i=this.focus.datumIndex,s=this.focus.seriesIndex,n=this.focus.datumIndex-t,o=this.focus.seriesIndex-e;return this.updatePickedFocus(i,t,n,s,e,o)}updatePickedFocus(e,t,i,s,n,o){const{focus:a,hoverRect:r,seriesRect:l}=this;if(a.series==null||r==null)return 1;const c=a?.series?.pickFocus({datumIndex:e,datumIndexDelta:t,otherIndex:s,otherIndexDelta:n,seriesRect:l});if(!c)return 2;const{datum:h}=c;if(a.datum=h,a.datumIndex=c.datumIndex,c.otherIndex!=null&&(a.seriesIndex=c.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const u=XH(c),{x:p,y:g}=u.computeCenter();if(!r.containsPoint(p,g)&&this.chart.ctx.zoomManager.panToBBox(this.id,r,u))return 3;const{x1:f,x2:x,y1:m,y2:b}=hp.from(u),v=r.containsPoint(f,m),S=r.containsPoint(x,m),D=r.containsPoint(f,b),C=r.containsPoint(x,b);if(!(v||S||D||C)){const T=hp.from(r);c.movedBounds=u.clone(),f<T.x1&&x<T.x1?(c.movedBounds.x=T.x1-2,c.movedBounds.width=4):f>T.x2&&x>T.x2&&(c.movedBounds.x=T.x2-2,c.movedBounds.width=4),m<T.y1&&b<T.y1?(c.movedBounds.y=T.y1-2,c.movedBounds.height=4):m>T.y2&&b>T.y2&&(c.movedBounds.y=T.y2-2,c.movedBounds.height=4)}}this.focusIndicator?.update(c.movedBounds??c.bounds,this.seriesRect,c.clipFocusBox);const d=qH(a.series,r,c);if(d!=null&&this.hoverDevice==="keyboard"){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0;const u=this.getTooltipContent(a.series,h.datumIndex,h,"aria-label"),p=Sy.makeTooltipMeta(d,a.series,h,c.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,h),this.isTooltipEnabled(a.series)&&this.chart.ctx.tooltipManager.updateTooltip(this.id,p,u),this.maybeAnnouncePickedFocus(t,i,n,o,c,u)}return 0}maybeAnnouncePickedFocus(e,t,i,s,n,o){const{focus:a}=this;let r;this.announceMode==="when-changed"?e===0&&i===0||t!==n.datumIndex||s!==(n.otherIndex??a.seriesIndex)?r="always":r="never":r=this.announceMode,r==="always"&&this.swapChain.update(this.getDatumAriaText(n.datum,o))}getDatumAriaText(e,t){const i=t==null?"":v2(t);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:e.series.getDatumAriaText?.(e,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(e){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const t=this.highlight.appliedHoverEvent;if(!t||!this.isState(41))return;const{currentX:i,currentY:s}=t,n=t.currentX+(this.hoverRect?.x??0),o=t.currentY+(this.hoverRect?.y??0);if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,o)){this.clearHighlight();return}const{range:a}=this.chart.highlight,r=a==="tooltip"?"highlight-tooltip":"highlight",l=this.pickNodes({x:i,y:s},r);if(!l||l.matches.length===0){this.chart.ctx.highlightManager.updateHighlight(this.id);return}const{current:c}=this.tooltipCandidates,d=(c==null?void 0:l.matches.find(u=>C0(u,c)))?.datum??l.matches[0].datum;this.chart.ctx.highlightManager.updateHighlight(this.id,d),this.hoverDevice="pointer"}handleHoverTooltip(e,t){const{current:i}=this.tooltipCandidates;if(this.tooltipCandidates.reset(),!this.isState(41))return;const{currentX:s,currentY:n}=e,o=s+(this.hoverRect?.x??0),a=n+(this.hoverRect?.y??0),r=e.sourceEvent.target;if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(o,a)){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(r&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(r,"canvas-overlay",Zi))return;const l=this.pickNodes({x:e.currentX,y:e.currentY},"tooltip");if(!l||l.matches.length===0){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(this.hoverDevice="pointer",l.distance===0){const{current:c,index:h,length:d}=this.tooltipCandidates.update(l.matches,this.chart.tooltip.pagination?i:void 0);this.showTooltip(c,o,a,{index:h,length:d})}else this.showTooltip(l.matches[0],o,a)}showTooltip({series:e,datum:t,datumIndex:i},s,n,o){const a=this.getTooltipContent(e,i,t,"tooltip");if(a!=null){const l=Sy.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:n},e,t,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,l,a,o)}else this.chart.ctx.tooltipManager.removeTooltip(this.id)}maybeEnterInteractiveTooltip(e){return this.chart.tooltip.maybeEnterInteractiveTooltip(e,()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id),this.chart.ctx.highlightManager.updateHighlight(this.id)})}changeHighlightDatum(e){const t=e.previousHighlight?.series,i=e.currentHighlight?.series;t?.properties.cursor&&e.previousHighlight?.datum&&this.chart.ctx.domManager.updateCursor(t.id),i?.properties.cursor&&i.properties.cursor!=="default"&&e.currentHighlight?.datum&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),i==null||t==null?this.update(5):this.update(5,{seriesToUpdate:new Set([t,i].filter(Boolean))})}pickNodes(e,t,i){const s=[...this.series].reverse();let n;for(const o of s){if(!o.visible||!o.contentGroup.visible)continue;const a=o.pickNodes(e,t,i);if(a==null||a.datums.length===0)continue;const{datums:r,distance:l}=a;if(a.datums.length!==0){if(l===0){n?.distance!==0&&(n={matches:[],distance:0});for(const c of r){const{datumIndex:h}=c;n.matches.push({series:o,datum:c,datumIndex:h})}}else if(n==null||n.distance>l){const[c]=r,{datumIndex:h}=c;n={matches:[{series:o,datum:c,datumIndex:h}],distance:l}}}}return n}isTooltipEnabled(e){return e.tooltipEnabled??this.chart.tooltip.enabled}getTooltipContent(e,t,i,s){let n;if(s==="aria-label"||this.isTooltipEnabled(e)){const{cachedTooltipContent:o}=this;if(o!=null&&o.series===e&&o.datumIndex===t)n=o.content;else{const a=this.chart.getTooltipContent(e,t,i);this.cachedTooltipContent={series:e,datumIndex:t,content:a},n=a}}else this.cachedTooltipContent=void 0;return n}};function cW(e,t){return e.type!==t}var I2=30,hW=class{constructor(e){this.seriesRoot=e,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(e){this.expectedSeriesCount=e}getGroupIndex(e){const{internalId:t,seriesGrouping:i}=e;return i?.groupIndex??t}getGroupType(e,t){return t?"top":e.type}requestGroup(e){const{internalId:t,contentGroup:i}=e,s=e.bringToFront(),n=this.getGroupType(e,s),o=this.getGroupIndex(e),a=this.series.get(t);if(a!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(a)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=I2?"aggressive-grouping":"normal");let r=this.groups.get(n);r==null&&(r=new Map,this.groups.set(n,r));const l=this.lookupIdx(o);let c=r.get(l);return c==null&&(c={type:n,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new Re({name:`${e.contentGroup.name??n}-managed-layer`,zIndex:e.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},r.set(l,c)),this.series.set(t,{layerState:c,seriesConfig:e,bringToFront:s}),c.seriesIds.push(t),c.group.appendChild(i),c.group}changeGroup(e){const{internalId:t,contentGroup:i}=e,s=e.bringToFront(),n=this.getGroupType(e,s),o=this.series.get(t),a=o?this.getGroupType(o.seriesConfig,o.bringToFront):void 0,r=this.getGroupIndex(e),l=this.lookupIdx(r),c=this.groups.get(n)?.get(l);if(!(a===n&&c?.seriesIds.includes(t)===!0))return this.series.has(t)&&this._releaseGroup({internalId:t,contentGroup:i,type:a}),this.requestGroup(e)}releaseGroup(e){const{internalId:t,contentGroup:i}=e,s=this.getGroupType(e,e.bringToFront());this._releaseGroup({internalId:t,contentGroup:i,type:s})}_releaseGroup(e){const{internalId:t,contentGroup:i,type:s}=e;if(!this.series.has(t))throw new Error(`AG Charts - series doesn't have an allocated layer: ${t}`);const n=this.series.get(t)?.layerState;n&&(n.seriesIds=n.seriesIds.filter(o=>o!==t),n.group.removeChild(i)),n?.seriesIds.length===0?(this.seriesRoot.removeChild(n.group),this.groups.get(n.type)?.delete(n.id),this.groups.get(s)?.delete(t)):n!=null&&n.seriesIds.length>0&&(n.group.zIndex=this.getLowestSeriesZIndex(n.seriesIds)),this.series.delete(t)}updateLayerCompositing(){this.groups.forEach(e=>{e.forEach(t=>{const{group:i,seriesIds:s}=t;let n;s.length===0?n=!1:s.length>1?n=!0:n=this.series.get(s[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=n,i.zIndex=this.getLowestSeriesZIndex(s)})})}lookupIdx(e){return this.mode==="normal"?e:typeof e=="string"&&(e=Number(e.split("-").at(-1)),!Number.isFinite(e))?0:Math.floor(ve(0,e/this.expectedSeriesCount,1)*I2)}destroy(){this.groups.forEach(e=>{e.forEach(t=>{this.seriesRoot.removeChild(t.group)})}),this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(e){let t;for(const i of e){const n=this.series.get(i)?.seriesConfig.contentGroup.zIndex??1;if(t==null||n==null){t=n;continue}t=bC(t,n)<=0?t:n}return t??1}},k2=class extends we{constructor(){super(...arguments),this.dragAction="drag"}};M([I],k2.prototype,"dragAction",2);var dW=class{constructor(e,t,i,s,n,o){this.chart=e,this.eventsHub=t,this.dataService=i,this.updateService=s,this.zoomManager=n,this.animationManager=o,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.cleanup=new mt,this.cleanup.register(this.eventsHub.on("data:source-change",()=>this.onDataSourceChange()),this.eventsHub.on("data:load",()=>this.onDataLoad()),this.eventsHub.on("data:error",()=>this.onDataError()),this.updateService.addListener("update-complete",a=>this.onUpdateComplete(a)),this.eventsHub.on("zoom:change",()=>this.onZoomChange()))}destroy(){this.cleanup.flush()}onDataLoad(){this.animationManager.skip(),this.updateService.update(1)}onDataError(){this.updateService.update(4)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(e){!e.apiUpdate&&!this.dirtyZoom&&!this.dirtyDataSource||this.updateWindow(e)}onZoomChange(){this.dirtyZoom=!0}updateWindow(e){if(!this.dataService.isLazy())return;const t=this.getValidAxis();let i,s=!0;if(t){const n=this.zoomManager.getAxisZoom(t.id);(n.min!==0||n.max!==1)&&(i=this.getAxisWindow(t,n)),s=this.shouldRefresh(e,t,n)}this.dirtyZoom=!1,this.dirtyDataSource=!1,s&&this.dataService.load({windowStart:i?.min,windowEnd:i?.max})}getValidAxis(){return this.chart.axes.find(e=>e.type==="time")}shouldRefresh(e,t,i){if(e.apiUpdate||this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const s=this.lastAxisZooms.get(t.id);return s&&i.min===s.min&&i.max===s.max?!1:(this.lastAxisZooms.set(t.id,i),!0)}getAxisWindow(e,t){const{domain:i}=e.scale;if(!t||i.length===0||isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]),n=new Date(Number(i[0])+s*t.min),o=new Date(Number(i[0])+s*t.max);return{min:n,max:o}}},uW=/^((?!chrome|android).)*safari/i,pW=/Version\/(\d+(\.\d+)?)/,gW=/Chrome/,fW=/Chrome\/(\d+)/,yW=/Edg/,mW=/OPR/;function xW(){const{userAgent:e}=Ze("navigator");if(uW.test(e)){const t=pW.exec(e);if(t==null)return!1;const i=parseFloat(t[1]),s=Math.floor(i)>16;return s||X.warnOnce(`Unsupported Safari version: ${i}; ${e}`),!s}else if(gW.test(e)&&!yW.test(e)&&!mW.test(e)){const t=fW.exec(e);if(t==null)return!1;const i=parseInt(t[1],10),s=i>126;return s||X.warnOnce(`Unsupported Chrome version: ${i}; ${e}`),!s}return!1}var bW=new Set(["map-shape-background","map-line-background"]),vW=class{constructor(e,t,i,s,n,o,a){this.chartLike=e,this.overlays=t,this.eventsHub=i,this.dataService=s,this.localeManager=n,this.animationManager=o,this.domManager=a,this.cleanup=new mt,this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(A0),this.cleanup.register(this.eventsHub.on("layout:complete",r=>this.onLayoutComplete(r)))}destroy(){this.cleanup.flush(),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:e}}){const t=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),s=this.chartLike.series.some(c=>c.visible&&!bW.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(o2):this.overlayElem.classList.remove(o2),this.overlayElem.style.left=`${e.x}px`,this.overlayElem.style.top=`${e.y}px`,this.overlayElem.style.width=`${e.width}px`,this.overlayElem.style.height=`${e.height}px`;const n=t,o=!t&&!i,a=i&&!s,r=this.overlays.unsupportedBrowser.enabled&&xW();n?this.showOverlay(this.overlays.loading,e):this.hideOverlay(this.overlays.loading),o?this.showOverlay(this.overlays.noData,e):this.hideOverlay(this.overlays.noData),a?this.showOverlay(this.overlays.noVisibleSeries,e):this.hideOverlay(this.overlays.noVisibleSeries),r?this.showOverlay(this.overlays.unsupportedBrowser,e):this.hideOverlay(this.overlays.unsupportedBrowser);const l=n||o||a||r;Ge(this.overlayElem,"aria-hidden",!l)}showOverlay(e,t){if(!e.enabled)return;const i=e.getElement(this.chartLike,this.animationManager,this.localeManager,t);this.overlayElem.appendChild(i)}hideOverlay(e){e.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},qn=Be.create(!0,"opts"),Ht=class y_ extends KC{constructor(t,i){var s;super(),this.id=ns(this),this.seriesRoot=new As({name:`${this.id}-series-root`,zIndex:7}),this.annotationRoot=new As({name:`${this.id}-annotation-root`,zIndex:11}),this.titleGroup=new Re({name:"titles",zIndex:15}),this.debug=Be.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new jv,this.chartCaptions=new cy,this.padding=new fc(20),this.keyboard=new t0,this.touch=new k2,this.mode="standalone",this.styleNonce=void 0,this.formatter=void 0,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.destroyed=!1,this.cleanup=new mt,this.chartAnimationPhase="initial",this.modulesManager=new GH,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.fireEventWrapper=h=>super.fireEvent(h),this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new jv,this.performUpdateType=8,this.runningUpdateType=8,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new CV,this.updateRequestors={},this.performUpdateTrigger=wV(({count:h})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(h)}catch(d){X.error("update error",d,d.stack)}}).catch(d=>X.errorOnce(d))}),this._performUpdateSplits={},this.axes=[],this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=h=>{this.fireEvent(h)},this.onSeriesNodeDoubleClick=h=>{this.fireEvent(h)},this.onSeriesVisibilityChange=h=>{this.fireEvent(h)},this.seriesGroupingChanged=h=>{if(!(h instanceof jy))return;const{series:d,seriesGrouping:u}=h;if(d.contentGroup.isRoot())return;const p=this.seriesLayerManager.changeGroup({internalId:d.internalId,type:d.type,contentGroup:d.contentGroup,bringToFront:()=>d.bringToFront(),renderToOffscreenCanvas:()=>d.renderToOffscreenCanvas(),seriesGrouping:u});p!=null&&d.attachSeries(p,this.seriesRoot,this.annotationRoot)},this.chartOptions=t;const n=i?.scene,o=i?.container??t.processedOptions.container??void 0,a=i?.styleContainer??t.specialOverrides.styleContainer;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const r=new Re({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 Xn,this.seriesLayerManager=new hW(this.seriesRoot),this.mode=t.userOptions.mode??this.mode,this.styleNonce=t.processedOptions.styleNonce;const l=this.ctx=new Lj(this,{chartType:this.getChartType(),scene:n,root:r,container:o,styleContainer:a,domMode:t.optionMetadata.domMode,withDragInterpretation:t.optionMetadata.withDragInterpretation??!0,syncManager:new Jj(this),fireEvent:h=>this.fireEvent(h),updateCallback:(h,d)=>this.update(h,d),updateMutex:this.updateMutex});this.cleanup.register(l.eventsHub.on("dom:resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new ud,(s=this.overlays.loading).renderer??(s.renderer=()=>VH(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new dW(this,l.eventsHub,l.dataService,l.updateService,l.zoomManager,l.animationManager),new vW(this,this.overlays,l.eventsHub,l.dataService,l.localeManager,l.animationManager,l.domManager)],this.highlight=new uL,this.container=o;const c=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new lW(this.initSeriesAreaDependencies()),this.cleanup.register(l.layoutManager.registerElement(0,h=>{h.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(h)}),l.eventsHub.on("layout:complete",h=>this.chartCaptions.positionAbsoluteCaptions(h)),l.eventsHub.on("data:load",h=>{this.data=h.data}),this.title.registerInteraction(c,"beforebegin"),this.subtitle.registerInteraction(c,"beforebegin"),this.footnote.registerInteraction(c,"afterend"),ua.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.eventsHub.on("zoom:change",()=>{this.series.forEach(d=>d.animationState?.transition("updateData"));const h=this.chartAnimationPhase!=="initial";this.update(4,{forceNodeDataRefresh:!0,skipAnimations:h})})),this.parentResize(l.domManager.containerSize)}static getInstance(t){return y_.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}download(t,i){this.ctx.scene.download(t,i)}getCanvasDataURL(t){return this.ctx.scene.getDataURL(t)}toSVG(){return this.ctx.scene.toSVG()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}overrideFocusVisible(t){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(t)}fireEvent(t){Lo(this,this.fireEventWrapper,t)}initSeriesAreaDependencies(){const{ctx:t,tooltip:i,highlight:s,overlays:n,seriesRoot:o,mode:a}=this,r=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,getTooltipContent:(d,u,p)=>this.getTooltipContent(d,u,p),chartType:r,ctx:t,tooltip:i,highlight:s,overlays:n,seriesRoot:o,mode:a}}getModuleContext(){return this.ctx}getTooltipContent(t,i,s){const n=t.properties.tooltip.enabled!==!1?t.getTooltipContent(i,s):void 0,o=n==null?[]:[n];if(this.tooltip.mode!=="shared"||this.series.length===1)return o;const a=t.getCategoryValue(i);return a==null?o:this.series.flatMap(r=>{if(r===t)return o;if(!r.isEnabled()||r.properties.tooltip.enabled===!1)return[];const l=r.datumIndexForCategoryValue(a),c=l==null?void 0:r.getTooltipContent(l,void 0);return c==null?[]:[c]})}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 i=t?.keepTransferableResources;let s;return this.performUpdateType=8,this.cleanup.flush(),this.processors.forEach(n=>n.destroy()),this.overlays.destroy(),this.modulesManager.destroy(),i?(this.ctx.scene.strip(),s={container:this.container,scene:this.ctx.scene}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(n=>n.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.destroyed=!0,Object.freeze(this),s}requestFactoryUpdate(t){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await t(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>X.errorOnce(i)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const t of this.series)t.resetDatumCallbackCache()}update(t=0,i){if(this.destroyed)return;const{forceNodeDataRefresh:s=!1,skipAnimations:n,seriesToUpdate:o=this.series,newAnimationBatch:a,apiUpdate:r=!1}=i??{};this.apiUpdate=r,this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),s&&this.series.forEach(l=>l.markNodeDataDirty());for(const l of o)this.seriesToUpdate.add(l);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),a&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this.debug.check()){let l=new Error().stack??"<unknown>";l=l.replace(/\([^)]*/g,""),this.updateRequestors[l]=t}t<this.performUpdateType&&(this.performUpdateType=t,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(i?.backOffMs))}async performUpdate(t){const{performUpdateType:i,extraDebugStats:s,_performUpdateSplits:n,ctx:o}=this,a=[...this.seriesToUpdate];this.clearCallbackCache(),this.performUpdateType=8,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.updateShortcutCount===0&&i<7&&(o.animationManager.startBatch(this._performUpdateSkipAnimations),o.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",sp[i]);let r=performance.now();n.start??(n.start=r);const l=h=>{n[h]??(n[h]=0),n[h]+=performance.now()-r,r=performance.now()};switch(i){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;await this.updateData(),l("\u2B07\uFE0F");case 2:if(this.checkUpdateShortcut(2))break;await this.processData(),this.seriesAreaManager.dataChanged(),l("\u{1F3ED}");case 3:if(this.checkUpdateShortcut(3))break;await this.processDomains(),l("\u26F0\uFE0F");case 4:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(4))break;await this.processLayout(),l("\u2316");case 5:{if(this.checkUpdateShortcut(5))break;await this.updateSeries(a),l("\u{1F914}"),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing()}case 6:if(this.checkUpdateShortcut(6))break;o.updateService.dispatchPreSceneRender(),l("\u2196");case 7:if(this.checkUpdateShortcut(7))break;o.animationManager.endBatch(),s.updateShortcutCount=this.updateShortcutCount,o.scene.render({debugSplitTimes:n,extraDebugStats:s,seriesRect:this.seriesRect}),this.extraDebugStats={};for(const h of Object.keys(n))delete n[h];this.ctx.domManager.incrementDataCounter("sceneRenders"),this.ctx.domManager.postRenderUpdate();case 8:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,o.animationManager.endBatch()}this.destroyed||(o.updateService.dispatchUpdateComplete(this.apiUpdate),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=8,this.syncStatus="ready"),this._performUpdateNotify.notify();const c=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round((c-n.start)*100)/100,count:t,performUpdateType:sp[i]})}updateThemeClassName(){const t="ag-charts-theme-",i=[`${t}default`,`${t}default-dark`];let s=i[0],n=!1,{theme:o}=this.chartOptions.processedOptions;for(;typeof o!="string"&&o!=null;)o=o.baseTheme;typeof o=="string"&&(s=o.replace("ag-",t),n=o.includes("-dark")),i.includes(s)||(s=n?i[1]:i[0]),this.ctx.domManager.setThemeClass(s)}updateDOM(){this.updateThemeClassName();const{enabled:t,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(t?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(t){return this.destroyed?!0:this.updateShortcutCount>3?(X.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=t?(this.updateShortcutCount++,!0):!1}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.await(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}onAxisChange(t,i){i==null&&t.length===0||this.ctx.axisManager.updateAxes(i??[],t)}onSeriesChange(t,i){const s=i?.filter(n=>!t.includes(n))??[];this.destroySeries(s),this.seriesLayerManager?.setSeriesCount(t.length);for(const n of t){if(i?.includes(n))continue;const o=this.seriesLayerManager.requestGroup(n);n.attachSeries(o,this.seriesRoot,this.annotationRoot);const a=this;n.chart={get mode(){return a.mode},get isMiniChart(){return!1},get seriesRect(){return a.seriesRect}},n.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(n),n.addChartEventListeners()}this.seriesAreaManager?.seriesChanged(t)}destroySeries(t){t?.forEach(i=>{i.removeEventListener("seriesNodeClick",this.onSeriesNodeClick),i.removeEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),i.removeEventListener("groupingChanged",this.seriesGroupingChanged),i.destroy(),this.seriesLayerManager.releaseGroup(i),i.detachSeries(void 0,this.seriesRoot,this.annotationRoot),i.chart=void 0})}addSeriesListeners(t){this.hasEventListener("seriesNodeClick")&&t.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&t.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&t.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),t.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const t of this.axes)t.boundSeries=this.series.filter(i=>i.axes[t.direction]===t)}assignAxesToSeries(){const t=Vv(this.axes,i=>i.direction);for(const i of this.series)for(const s of i.directions){const n=t[s];if(!n){X.warnOnce(`no available axis for direction [${s}]; check series and axes configuration.`);return}const o=i.getKeys(s),a=n.find(r=>!r.keys.length||o.some(l=>r.keys.includes(l)));if(!a){X.warnOnce(`no matching axis for direction [${s}] and keys [${o}]; check series and axes configuration.`);return}i.axes[s]=a}}parentResize(t){if(t==null||this.width!=null&&this.height!=null)return;let{width:i,height:s}=t;const{pixelRatio:n}=t;if(i=Math.floor(i),s=Math.floor(s),i===0&&s===0)return;const[o=0,a=0,r=1]=this._lastAutoSize??[];o===i&&a===s&&r===n||(this._lastAutoSize=[i,s,n],this.resize("SizeMonitor",{}))}resize(t,i){const{scene:s,animationManager:n}=this.ctx,{inWidth:o,inHeight:a,inMinWidth:r,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(r??this.minWidth,l??this.minHeight,o??this.width,a??this.height);const h=o??this.width??this._lastAutoSize?.[0],d=a??this.height??this._lastAutoSize?.[1],u=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${t}`,{width:h,height:d,pixelRatio:u,stack:new Error().stack}),!(h==null||d==null||!Ye(h)||!Ye(d))&&s.resize(h,d,u)){n.reset();let p=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(p=!1,this._firstAutoSize=!1),this.update(4,{forceNodeDataRefresh:!0,skipAnimations:p}),this._autoSizeNotify.notify()}}async updateData(){this.series.forEach(i=>i.setChartData(this.data));const t=this.modulesManager.mapModules(i=>i.updateData?.(this.data));await Promise.all(t)}async processData(){this.series.some(n=>n.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const t=new vL(this.mode,this.suppressFieldDotNotation),i=this.series.map(n=>n.processData(t)),s=this.modulesManager.mapModules(n=>n.processData?.(t));this._cachedData=t.execute(this._cachedData),await Promise.all([...i,...s]),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:i,legendType:s}of this.modulesManager.legends())s==="category"?this.setCategoryLegendData(t):this.setLegendData(s,i)}setCategoryLegendData(t){var i;const{ctx:{legendManager:s,stateManager:n}}=this;t&&this.series.forEach(a=>{const r=t.find(l=>l.seriesId===a.id);a.onLegendInitialState("category",r)});const o=this.series.flatMap(a=>{const r=a.getLegendData("category");return s.updateData(a.id,r),r});if(t){n.setStateAndRestore(s,t);return}if(this.mode!=="integrated"){const a={},r=new Map(this.series.map(l=>[l.id,l.type]));for(const{seriesId:l,symbol:{marker:c},label:h}of o.filter(d=>!d.hideInLegend)){if(c.fill==null)continue;const d=r.get(l),u=a[d]??(a[d]={});u[i=h.text]??(u[i]=c.fill),u[h.text]!==c.fill&&X.warnOnce(`legend item '${h.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}s.update()}setLegendData(t,i){i.data=this.series.filter(s=>s.properties.showInLegend).flatMap(s=>s.getLegendData(t))}async processLayout(){const t=this.animationRect,{width:i,height:s}=this.ctx.scene,n=this.ctx.layoutManager.createContext(i,s);await this.performLayout(n),t&&!this.animationRect?.equals(t)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}async updateSeries(t){const{seriesRect:i}=this;await Promise.all(t.map(s=>s.update({seriesRect:i}))),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(s=>s.visible&&s.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(t,i){const s=Ze("agChartsDebugTimeout");s==null?(t??(t=1e5),i??(i=!1)):(t=s,i??(i=!0));const n=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==8||this.runningUpdateType!==8||this.ctx.scene.waitingForUpdate())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==8||this.runningUpdateType!==8)&&await this._performUpdateNotify.await(),performance.now()-n>t){const o=`Chart.waitForUpdate() timeout of ${t} reached - first chart update taking too long.`;if(i)throw new Error(o);X.warnOnce(o)}UC()&&await Kk(),this.ctx.scene.waitingForUpdate()&&await Kk(50)}}filterMiniChartSeries(t){return t?.filter(i=>i.showInMiniChart!==!1)}applyOptions(t){const s=this.firstApply?t.processedOptions:t.diffOptions(this.chartOptions);if(s==null||Object.keys(s).length===0){qn("Chart.applyOptions() - no delta, forcing re-layout",s),this.update(4,{apiUpdate:!0,newAnimationBatch:!0});return}const n=this.firstApply?{}:this.chartOptions.processedOptions,o=t.processedOptions;qn("Chart.applyOptions() - applying delta",s);const a=this.applyModules(o),r=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer","formatter"];s.listeners&&this.registerListeners(this,s.listeners),Qu(this,s,{skip:r});let l=!1,c="no-op";s.series!=null&&(c=this.applySeries(this,s.series,n?.series),l=!0),c==="replaced"&&this.resetAnimations(),this.applyAxes(this,o,n,c,[])&&(l=!0),s.data&&(this.data=s.data),s.legend?.listeners&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,s.legend.listeners),s.locale?.localeText&&(this.modulesManager.getModule("locale").localeText=s.locale?.localeText),this.chartOptions=t;const h=this.modulesManager.getModule("navigator"),d=this.modulesManager.getModule("zoom");!h?.enabled&&!d?.enabled&&this.ctx.zoomManager.updateZoom("chart");const u=h?.miniChart,p=o.navigator?.miniChart?.series??o.series;u?.enabled===!0&&p!=null?this.applyMiniChartOptions(u,p,o,n):u?.enabled===!1&&(u.series=[],u.axes=[]),this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes),l||(l=this.shouldForceNodeDataRefresh(s,c));const f=l||a?0:4;if(this.maybeResetAnimations(c),this.shouldClearLegendData(o,n,c)&&this.ctx.legendManager.clearData(),this.applyInitialState(o),this.ctx.formatManager.setFormatter(o.formatter),qn("Chart.applyOptions() - update type",sp[f],{seriesStatus:c,forceNodeDataRefresh:l}),t.optionsProcessingTime!==void 0){this._performUpdateSplits["\u2699\uFE0F"]=t.optionsProcessingTime;const x=performance.now()-t.optionsProcessingTime;this._performUpdateSplits.start=x}this.update(f,{apiUpdate:!0,forceNodeDataRefresh:l,newAnimationBatch:!0}),this.firstApply=!1}applyInitialState(t){const{annotationManager:i,chartTypeOriginator:s,historyManager:n,stateManager:o,zoomManager:a}=this.ctx,{initialState:r}=t;if("annotations"in t&&t.annotations?.enabled&&r?.annotations!=null){const l=r.annotations.map(c=>{const h=i.getAnnotationTypeStyles(c.type);return et(c,h)});o.setState(i,l)}r?.chartType!=null&&o.setState(s,r.chartType),(t.navigator?.enabled||t.zoom?.enabled)&&r?.zoom!=null&&o.setState(a,r.zoom),r?.legend!=null&&this.updateLegends(r.legend),r!=null&&n.clear()}maybeResetAnimations(t){if(this.mode==="standalone")switch(t){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(t,i){const s=!!t.data||i==="data-change"||i==="replaced",n=QS.getKeys(),o=Object.values(n).some(r=>t[r]!=null),a=t.title!=null&&t.subtitle!=null||t.formatter!=null;return s||o||a}shouldClearLegendData(t,i,s){const n=s==="replaced"||s==="series-grouping-change"||s==="updated"&&(t.series?.length!==i.series?.length||!t.series?.every((a,r)=>a.type===i.series?.[r].type)),o=i.legend!=null&&t.legend==null;return n||o}applyMiniChartOptions(t,i,s,n){const o=n?.navigator?.miniChart?.series??n?.series,a=this.applySeries(t,this.filterMiniChartSeries(i),this.filterMiniChartSeries(o));this.applyAxes(t,s,n,a,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const r=t.series;for(const h of r)h.properties.id=void 0;const l=t.axes,c=l.find(h=>h.direction==="x");for(const h of l)h.nice=!1,h.gridLine.enabled=!1,h.label.enabled=h===c,h.tick.enabled=!1,h.interactionEnabled=!1;if(c!=null){const h=s.navigator?.miniChart,d=h?.label,u=h?.label?.interval;if(c.line.enabled=!1,c.label.set(ce(d,["interval","autoRotate","autoRotateAngle","itemStyler","minSpacing","rotation"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:p}=c;if(p.length===0)p.set([{label:{enabled:!0}}]);else for(let g=1;g<p.length;g++)p[g].label.enabled=!1}else(c.type==="time"||c.type==="unit-time"||c.type==="ordinal-time")&&(c.parentLevel.enabled=!1);c.interval.step=u?.step,c.interval.values=u?.values,c.interval.minSpacing=u?.minSpacing,c.interval.maxSpacing=u?.maxSpacing}}applyModules(t){const{type:i}=this.constructor;let s=!1;for(const n of da.byType("root","legend")){const a=t[n.optionsKey]!=null&&n.chartTypes.includes(i);a!==this.modulesManager.isEnabled(n)&&(a?(this.modulesManager.addModule(n,r=>r.moduleFactory(this.getModuleContext())),n.type==="legend"&&this.modulesManager.getModule(n)?.attachLegend(this.ctx.scene),this[n.optionsKey]=this.modulesManager.getModule(n)):(this.modulesManager.removeModule(n),delete this[n.optionsKey]),s=!0)}return s}initSeriesDeclarationOrder(t){for(let i=0;i<t.length;i++)t[i].setSeriesIndex(i)}applySeries(t,i,s){if(!i)return"no-change";const n=zH(t.series,i,s);if(n.status==="no-overlap"){qn(`Chart.applySeries() - creating new series instances, status: ${n.status}`,n);const h=i.map(d=>this.createSeries(d));return this.initSeriesDeclarationOrder(h),t.series=h,"replaced"}qn("Chart.applySeries() - matchResult",n);const o=[];let a=!1,r=!1,l=!1;const c=n.changes.toSorted((h,d)=>h.targetIdx-d.targetIdx);for(const h of c)switch(r||(r=h.status==="series-grouping"),a||(a=h.diff?.data!=null),l||(l=h.status!=="no-op"),h.status){case"add":{const d=this.createSeries(h.opts);o.push(d),qn("Chart.applySeries() - created new series",d);break}case"remove":qn(`Chart.applySeries() - removing series at previous idx ${h.idx}`,h.series);break;case"no-op":o.push(h.series),qn(`Chart.applySeries() - no change to series at previous idx ${h.idx}`,h.series);break;case"series-grouping":case"update":default:{const{series:d,diff:u,idx:p}=h;qn(`Chart.applySeries() - applying series diff previous idx ${p}`,u,d),this.applySeriesValues(d,u),d.markNodeDataDirty(),o.push(d)}}return this.initSeriesDeclarationOrder(o),qn("Chart.applySeries() - final series instances",o),t.series=o,r?"series-grouping-change":a?"data-change":l?"updated":"no-op"}applyAxes(t,i,s,n,o=[]){if(!("axes"in i)||!i.axes)return!1;o=["axes[].type",...o];const a=i.axes;return!(n==="replaced")&&t.axes.length===a.length&&t.axes.every((c,h)=>c.type===a[h].type)&&i2(s)?(t.axes.forEach((c,h)=>{const d=s.axes?.[h]??{},u=Xa(d,a[h]);qn(`Chart.applyAxes() - applying axis diff idx ${h}`,u);const p=`axes[${h}]`;Qu(c,u,{path:p,skip:o})}),!0):(qn(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),t.axes=this.createAxis(a,o),!0)}createSeries(t){const i=No.create(t.type,this.getModuleContext());return this.applySeriesOptionModules(i,t),this.applySeriesValues(i,t),i}applySeriesOptionModules(t,i){const s=t.createModuleContext(),n=t.getModuleMap();for(const o of da.byType("series-option"))o.optionsKey in i&&o.seriesTypes.includes(t.type)&&n.addModule(o,a=>a.moduleFactory(s))}applySeriesValues(t,i){const s=t.getModuleMap(),{type:n,data:o,listeners:a,seriesGrouping:r,showInMiniChart:l,...c}=i;for(const h of dp)if(h.type==="series-option"&&h.optionsKey in c){const d=s.getModule(h.optionsKey);if(d){const u=c[h.optionsKey];delete c[h.optionsKey],d.properties.set(u)}}c.visible!=null&&(t.visible=c.visible),t.properties.set(c),"data"in i&&t.setOptionsData(o),a&&this.registerListeners(t,a),"seriesGrouping"in i&&(r==null?t.seriesGrouping=void 0:t.seriesGrouping={...t.seriesGrouping,...r})}createAxis(t,i){const s=[],n=this.getModuleContext();for(let o=0;o<t.length;o++){const a=t[o],r=mc.create(a.type,n);this.applyAxisModules(r,a),Qu(r,a,{path:`axes[${o}]`,skip:i}),s.push(r)}return BH(s),s}applyAxisModules(t,i){const s=t.createModuleContext(),n=t.getModuleMap();for(const o of da.byType("axis-option")){const a=i[o.optionsKey]!=null;a!==n.isEnabled(o)&&(a?(n.addModule(o,r=>r.moduleFactory(s)),t[o.optionsKey]=n.getModule(o)):(n.removeModule(o),delete t[o.optionsKey]))}}registerListeners(t,i){t.clearEventListeners();for(const[s,n]of Et(i))t.addEventListener(s,n)}};Ht.chartsInstances=new WeakMap,M([Is({newValue(e){this.destroyed||(this.ctx.domManager.setContainer(e),Ht.chartsInstances.set(e,this))},oldValue(e){Ht.chartsInstances.delete(e)}})],Ht.prototype,"container",2),M([Is({newValue(e){this.resize("width option",{inWidth:e})}})],Ht.prototype,"width",2),M([Is({newValue(e){this.resize("height option",{inHeight:e})}})],Ht.prototype,"height",2),M([Is({newValue(e){this.resize("minWidth option",{inMinWidth:e})}})],Ht.prototype,"minWidth",2),M([Is({newValue(e){this.resize("minHeight option",{inMinHeight:e})}})],Ht.prototype,"minHeight",2),M([Is({newValue(e){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:e})}})],Ht.prototype,"overrideDevicePixelRatio",2),M([I],Ht.prototype,"padding",2),M([I],Ht.prototype,"keyboard",2),M([I],Ht.prototype,"touch",2),M([I],Ht.prototype,"mode",2),M([I],Ht.prototype,"styleNonce",2),M([Gi("chartCaptions.title")],Ht.prototype,"title",2),M([Gi("chartCaptions.subtitle")],Ht.prototype,"subtitle",2),M([Gi("chartCaptions.footnote")],Ht.prototype,"footnote",2),M([I],Ht.prototype,"formatter",2),M([I],Ht.prototype,"suppressFieldDotNotation",2),M([I],Ht.prototype,"loadGoogleFonts",2),M([Is({changeValue(e,t){this.onAxisChange(e,t)}})],Ht.prototype,"axes",2),M([Is({changeValue(e,t){this.onSeriesChange(e,t)}})],Ht.prototype,"series",2);var $y=Ht;function C2(e,t){let i=[];const s=e?.series?.[0]?.type,n=s==="linear-gauge"||s==="radial-gauge",o=s?ji.get(s):"unknown";for(const a of dp)if(!(o!=="unknown"&&!a.chartTypes.includes(o))){if(a.type==="root"||a.type==="legend"){const r=e[a.optionsKey];if(r==null)continue;a.optionsInnerKey?r[a.optionsInnerKey]&&(i.push(`${a.optionsKey}.${a.optionsInnerKey}`),delete r[a.optionsInnerKey]):(i.push(a.optionsKey),delete e[a.optionsKey])}else if(a.type==="axis"){if(!("axes"in e)||!Ue(e.axes)||!e.axes?.some(r=>r.type===a.identifier))continue;i.push(`axis[type=${a.identifier}]`),e.axes=e.axes.filter(r=>r.type!==a.identifier)}else if(a.type==="axis-option"){if(!("axes"in e)||!Ue(e.axes)||!e.axes?.some(r=>r[a.optionsKey]))continue;i.push(`axis.${a.optionsKey}`),e.axes.forEach(r=>{r[a.optionsKey]&&delete r[a.optionsKey]})}else if(a.type==="series"){if(a.community||!Ue(e.series)||!e.series?.some(r=>r.type===a.identifier))continue;i.push(`series[type=${a.identifier}]`),e.series=e.series.filter(r=>r.type!==a.identifier)}else if(a.type==="series-option"){if(!Ue(e.series)||!e.series?.some(r=>r[a.optionsKey]))continue;i.push(`series.${a.optionsKey}`),e.series.forEach(r=>{r[a.optionsKey]&&delete r[a.optionsKey]})}}if(i.length&&!t){n&&(i=["AgCharts.createGauge"]);let a="ag-charts-enterprise",r="https://www.ag-grid.com/charts/javascript/installation/";e.mode==="integrated"&&(a="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",r="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),X.warnOnce([`unable to use these enterprise features as '${a}' has not been loaded:`,"",...i,"",`See: ${r}`].join(`
`))}}function SW(e){const t="mode"in e&&e.mode==="integrated";for(const i of da.byType("root","legend")){const s=e[i.optionsKey],n=s!=null&&s.enabled===!1,o=!("removable"in i)||i.removable===!0||i.removable==="standalone-only"&&!t;n&&o&&delete e[i.optionsKey]}}function T2(e){return e?.up||e?.down||e?.neutral?"user-full":e?.fills||e?.strokes?"user-indexed":"inbuilt"}var fi={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},ar={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},T0={};gn(T0,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>Np,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>Pp,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>Rp,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>Bp,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Fp,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Ep,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Op,DEFAULT_CAPTION_ALIGNMENT:()=>ol,DEFAULT_CAPTION_LAYOUT_STYLE:()=>nl,DEFAULT_FIBONACCI_STROKES:()=>Lp,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Ni,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Wt,DEFAULT_GRIDLINE_ENABLED:()=>Po,DEFAULT_POLAR_SERIES_STROKE:()=>Qy,DEFAULT_SEPARATION_LINES_COLOUR:()=>Tp,DEFAULT_SHADOW_COLOUR:()=>sl,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Jy,DEFAULT_TEXTBOX_COLOR:()=>Gp,DEFAULT_TEXTBOX_FILL:()=>zp,DEFAULT_TEXTBOX_STROKE:()=>_p,DEFAULT_TEXT_ANNOTATION_COLOR:()=>wp,DEFAULT_TOOLBAR_POSITION:()=>Vp,IS_DARK_THEME:()=>gd,PALETTE_ALT_DOWN_FILL:()=>E0,PALETTE_ALT_DOWN_STROKE:()=>w0,PALETTE_ALT_NEUTRAL_FILL:()=>O0,PALETTE_ALT_NEUTRAL_STROKE:()=>P0,PALETTE_ALT_UP_FILL:()=>N0,PALETTE_ALT_UP_STROKE:()=>L0,PALETTE_DOWN_FILL:()=>Zy,PALETTE_DOWN_STROKE:()=>Yy,PALETTE_NEUTRAL_FILL:()=>qy,PALETTE_NEUTRAL_STROKE:()=>Xy,PALETTE_UP_FILL:()=>Ky,PALETTE_UP_STROKE:()=>Uy});var gd=Symbol("is-dark-theme"),Tp=Symbol("default-separation-lines-colour"),sl=Symbol("default-shadow-colour"),nl=Symbol("default-caption-layout-style"),ol=Symbol("default-caption-alignment"),Uy=Symbol("palette-up-stroke"),Yy=Symbol("palette-down-stroke"),Ky=Symbol("palette-up-fill"),Zy=Symbol("palette-down-fill"),Xy=Symbol("palette-neutral-stroke"),qy=Symbol("palette-neutral-fill"),L0=Symbol("palette-alt-up-stroke"),w0=Symbol("palette-alt-down-stroke"),N0=Symbol("palette-alt-up-fill"),E0=Symbol("palette-alt-down-fill"),O0=Symbol("palette-gray-fill"),P0=Symbol("palette-gray-stroke"),Qy=Symbol("default-polar-series-stroke"),Jy=Symbol("default-sparkline-crosshair-stroke"),Wt=Symbol("default-financial-charts-annotation-stroke"),Lp=Symbol("default-hierarchy-strokes"),wp=Symbol("default-text-annotation-color"),Ni=Symbol("default-financial-charts-annotation-background-fill"),Np=Symbol("default-annotation-handle-fill"),Ep=Symbol("default-annotation-statistics-fill"),Op=Symbol("default-annotation-statistics-stroke"),Pp=Symbol("default-annotation-statistics-color"),Rp=Symbol("default-annotation-statistics-divider-stroke"),Bp=Symbol("default-annotation-statistics-fill"),Fp=Symbol("default-annotation-statistics-stroke"),zp=Symbol("default-textbox-fill"),_p=Symbol("default-textbox-stroke"),Gp=Symbol("default-textbox-color"),Vp=Symbol("default-toolbar-position"),Po=Symbol("default-gridline-enabled"),L2=[{type:"number",position:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"bottom","left"]}},{type:"category",position:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"left","bottom"]}}],MW={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},R0={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},em={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},DW={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},fd={type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},AW={...fd,colorStops:[{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]},{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}]},IW=e=>({...fd,colorStops:{$if:[{$or:[{$isGradient:{$palette:`${e}.fill`}},{$isPattern:{$palette:`${e}.fill`}},{$isImage:{$palette:`${e}.fill`}}]},{$map:[{$path:["/color",void 0,{$value:"$1"}]},{$path:["/colorStops",void 0,{$palette:`${e}.fill`}]}]},[{$mix:[{$palette:`${e}.fill`},"black",.15]},{$mix:[{$palette:`${e}.fill`},"white",.15]}]]}}),tm={type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},jp={...tm,reverse:!0},kW={...tm,bounds:"series"},CW={...tm,bounds:"series",reverse:!0},TW={type:"gradient",gradient:"conic",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},rr={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:em,strokeOpacity:1,strokeWidth:4,backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},LW={...rr,fill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},Ic={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0};function Dn(e){return fC(e,t=>{const i=gt.fromString(t);return[gt.darken(i,.15).toString(),t,gt.lighten(i,.15).toString()]})}var B0={stroke:{$path:["../../highlightStyle/item/stroke","rgba(0, 0, 0, 0.4)"]},strokeWidth:{$path:["../../highlightStyle/item/strokeWidth",2]},strokeOpacity:{$path:["../../highlightStyle/item/strokeOpacity",void 0]},opacity:{$path:["../../highlightStyle/item/opacity",1]}},w2={...B0,fill:{$path:["../../highlightStyle/item/fill","rgba(255,255,255, 0.33)"]},fillOpacity:{$path:["../../highlightStyle/item/fillOpacity",void 0]}},Qn={padding:8,cornerRadius:4,fill:{$if:[{$and:[{$eq:[{$path:"./fill/type"},"image"]},{$isUserOption:["./fill/backgroundFill",!1,!0]}]},{backgroundFill:"transparent"},void 0]},border:{enabled:{$isUserOption:["../border",!0,!1]},strokeWidth:1,stroke:{$foregroundOpacity:.08}}};function al(e=!0){return{enabled:!0,highlightedItem:e?w2:B0,unhighlightedItem:{strokeWidth:{$path:["../../highlightStyle/series/strokeWidth",void 0]}},highlightedSeries:{strokeWidth:{$path:["../../highlightStyle/series/strokeWidth",void 0]}},unhighlightedSeries:{opacity:{$path:["../../highlightStyle/series/dimOpacity",void 0]}}}}function N2(e=!0){return{enabled:!0,highlightedItem:e?w2:B0,unhighlightedItem:{strokeWidth:{$path:["../../highlightStyle/series/strokeWidth",void 0]},opacity:{$path:["../../highlightStyle/series/dimOpacity",void 0]}}}}var E2={border:{enabled:!1,stroke:{$foregroundBackgroundMix:.25},strokeOpacity:1,strokeWidth:1},cornerRadius:4,fillOpacity:1,padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},5,{$isUserOption:["./fill",5,0]}]}},F0="white",wW={get cartesian(){return{seriesTypes:ji.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:ji.polarTypes,commonOptions:[]}},get topology(){return{seriesTypes:ji.topologyTypes,commonOptions:[]}},get standalone(){return{seriesTypes:ji.standaloneTypes,commonOptions:[]}}},NW={"radial-gauge":!0,"linear-gauge":!0};function EW(e){return NW[e]===!0}var An=class Mf{static getDefaultColors(){return{fills:fi,fillsFallback:Object.values(fi),strokes:ar,sequentialColors:Dn(fi),divergingColors:[fi.ORANGE,fi.YELLOW,fi.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:gt.interpolate([gt.fromHexString(fi.BLUE),gt.fromHexString("#cbdef5")],8).map(t=>t.toString()),secondDivergingColors:[fi.GREEN,fi.YELLOW,fi.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:fi.GREEN,stroke:ar.GREEN},down:{fill:fi.RED,stroke:ar.RED},neutral:{fill:fi.GRAY,stroke:ar.GRAY},altUp:{fill:fi.BLUE,stroke:ar.BLUE},altDown:{fill:fi.ORANGE,stroke:ar.ORANGE},altNeutral:{fill:fi.GRAY,stroke:ar.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:.325},backgroundColor:F0,borderColor:{$foregroundOpacity:.15},borderRadius:4,chartBackgroundColor:{$ref:"backgroundColor"},chartPadding:20,focusShadow:"0 0 0 3px var(--ag-charts-accent-color)",foregroundColor:"#181d1f",fontFamily:"Verdana, sans-serif",fontSize:Qa,fontWeight:400,gridLineColor:{$foregroundBackgroundMix:.1},popupShadow:"0 0 16px rgba(0, 0, 0, 0.15)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:.02},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:{$ref:"foregroundColor"},chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},buttonBackgroundColor:{$ref:"backgroundColor"},buttonBorder:!0,buttonFontWeight:400,buttonTextColor:{$ref:"textColor"},inputBackgroundColor:{$ref:"backgroundColor"},inputBorder:!0,inputTextColor:{$ref:"textColor"},menuBackgroundColor:{$ref:"chromeBackgroundColor"},menuBorder:!0,menuTextColor:{$ref:"chromeTextColor"},panelBackgroundColor:{$ref:"chromeBackgroundColor"},panelSubtleTextColor:{$ref:"chromeSubtleTextColor"},tooltipBackgroundColor:{$ref:"chromeBackgroundColor"},tooltipBorder:!0,tooltipTextColor:{$ref:"chromeTextColor"},tooltipSubtleTextColor:{$ref:"chromeSubtleTextColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"chartBackgroundColor"}}}static getAxisDefaults(t,{title:i,time:s}){return et(t,i&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:bn.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},s&&{parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},border:{enabled:{$or:[{$isUserOption:["../border",!0,!1]},{$path:"../../../label/border/enabled"}]},strokeWidth:{$path:"../../../label/border/strokeWidth"},stroke:{$path:"../../../label/border/stroke"}},fill:{$path:"../../label/fill"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},cornerRadius:{$path:"../../label/cornerRadius"},padding:{$path:"../../label/padding"},avoidCollisions:{$path:"../../label/avoidCollisions"}},tick:{enabled:{$path:"../../tick/enabled"},width:{$path:"../../tick/width"},size:{$path:"../../tick/size"},stroke:{$path:"../../tick/stroke"}}}},{label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0,cornerRadius:4,border:{enabled:{$isUserOption:["../border",!0,!1]},strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},{left:12,right:12,top:8,bottom:8},void 0]}},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,width:1,style:{$apply:[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]},[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]}]]}},crossLines:{$apply:[{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.08,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"}}},void 0,{$pathString:["/common/axes/$axisType/crossLines",{axisType:{$path:["/axes/$index/type"]}}]},{$pathString:["/$seriesType/axes/$axisType/crossLines",{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["/axes/$index/type"]}}]}]}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"chartBackgroundColor"}},padding:{top:{$ref:"chartPadding"},right:{$ref:"chartPadding"},bottom:{$ref:"chartPadding"},left:{$ref:"chartPadding"}},seriesArea:{border:{enabled:!1,stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:1},cornerRadius:4,padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},5,0]}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:bn.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:nl,textAlign:ol},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:bn.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:nl,textAlign:ol},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:bn.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:nl,textAlign:ol},legend:{...E2,enabled:{$and:[{$greaterThan:[{$size:[{$path:"/series"}]},1]},{$or:[{$isChartType:"cartesian"},{$isChartType:"standalone"},{$and:[{$isChartType:"polar"},{$not:{$isSeriesType:"pie"}},{$not:{$isSeriesType:"donut"}}]}]}]},position:"bottom",orientation:{$if:[{$or:[{$eq:[{$path:"./position"},"left"]},{$eq:[{$path:"./position"},"left-top"]},{$eq:[{$path:"./position"},"left-bottom"]},{$eq:[{$path:"./position"},"right"]},{$eq:[{$path:"./position"},"right-top"]},{$eq:[{$path:"./position"},"right-bottom"]},{$eq:[{$path:"./position/placement"},"left"]},{$eq:[{$path:"./position/placement"},"left-top"]},{$eq:[{$path:"./position/placement"},"left-bottom"]},{$eq:[{$path:"./position/placement"},"right"]},{$eq:[{$path:"./position/placement"},"right-top"]},{$eq:[{$path:"./position/placement"},"right-bottom"]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$rem:bn.SMALL},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:{$ref:"foregroundColor"}},inactiveStyle:{fill:{$ref:"subtleTextColor"}},highlightStyle:{fill:{$ref:"foregroundColor"}},label:{color:{$ref:"textColor"}}},fill:{$if:[{$path:["./position/floating",!1]},{$ref:"chartBackgroundColor"},"transparent"]}},tooltip:{enabled:!0,darkTheme:gd,delay:0,pagination:!1,mode:{$if:[{$and:[{$isChartType:"cartesian"},{$not:{$hasSeriesType:"bubble"}},{$not:{$hasSeriesType:"scatter"}},{$greaterThan:[{$size:[{$path:"/series"}]},1]},{$lessThan:[{$size:[{$path:"/series"}]},4]}]},"shared","single"]}},overlays:{darkTheme:gd},listeners:{},series:{tooltip:{range:{$path:["/tooltip/range","exact"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","pointer"]},placement:{$path:["/tooltip/position/placement",void 0]},xOffset:{$path:["/tooltip/position/xOffset",0]},yOffset:{$path:["/tooltip/position/yOffset",0]}}}}}}constructor(t={}){const{overrides:i,palette:s,params:n}=Ot(t),o=this.createChartConfigPerChartType(this.getDefaults()),a={};i&&this.processOverrides(a,i);const{fills:r,strokes:l,sequentialColors:c,...h}=this.getDefaultColors();this.palette=Ua(et(s,{fills:Object.values(r),strokes:Object.values(l),sequentialColors:Object.values(c),...h})),this.paletteType=T2(s),this.params=et(n,this.getPublicParameters()),this.config=Ua(Ot(o)),this.overrides=Ua(i),this.presets=Ua(a)}processOverrides(t,i){ji.seriesTypes.forEach(s=>{const n=s,o=i[n];EW(n)&&(t[n]=o,delete i[n])})}createChartConfigPerChartType(t){for(const[i,{seriesTypes:s}]of Et(wW)){const n=JS.get(i);for(const o of s)t[o]??(t[o]=Ot(n))}return t}getDefaults(){const t=(i,s)=>{const n={},o={axes:{},...QS.getThemeTemplates(),...this.getChartDefaults(),...JS.get(i)};for(const a of s){n[a]=et(No.getThemeTemplate(a),n[a]??Ot(o));const{axes:r}=n[a];for(const l of mc.keys())r[l]=et(r[l],mc.getThemeTemplate(l),Mf.axisDefault[l]);(a==="map-shape-background"||a==="map-line-background")&&delete n[a].series.tooltip}return n};return et(t("cartesian",ji.cartesianTypes),t("polar",ji.polarTypes),t("topology",ji.topologyTypes),t("standalone",ji.standaloneTypes))}static applyTemplateTheme(t,i,s){if(Ue(t))for(let n=0;n<t.length;n++){const o=t[n];typeof o=="symbol"&&s?.has(o)&&(t[n]=s.get(o))}else for(const n of Object.keys(t)){const o=t[n];typeof o=="symbol"&&s?.has(o)&&(t[n]=s.get(o))}}templateTheme(t,i=!0){const s=i?Ot(t):t,n=this.getTemplateParameters();return Zr(s,Mf.applyTemplateTheme,void 0,void 0,n),s}getDefaultColors(){return Mf.getDefaultColors()}getPublicParameters(){return Mf.getDefaultPublicParameters()}getTemplateParameters(){const t=new Map;t.set(gd,!1),t.set(Tp,"#d9d9d9"),t.set(sl,"#00000080"),t.set(Jy,"#aaa"),t.set(nl,"block"),t.set(ol,"center"),t.set(Lp,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),t.set(Qy,F0),t.set(Wt,fi.BLUE),t.set(Ni,fi.BLUE),t.set(wp,fi.BLUE),t.set(Np,F0),t.set(Ep,"#fafafa"),t.set(Op,"#ddd"),t.set(Pp,"#000"),t.set(Rp,"#181d1f"),t.set(Bp,"#e35c5c"),t.set(Fp,"#e35c5c"),t.set(zp,"#fafafa"),t.set(_p,"#ddd"),t.set(Gp,"#000"),t.set(Vp,"top"),t.set(Po,!1);const i=this.getDefaultColors();return t.set(Uy,this.palette.up?.stroke??i.up.stroke),t.set(Ky,this.palette.up?.fill??i.up.fill),t.set(Yy,this.palette.down?.stroke??i.down.stroke),t.set(Zy,this.palette.down?.fill??i.down.fill),t.set(Xy,this.palette.neutral?.stroke??i.neutral.stroke),t.set(qy,this.palette.neutral?.fill??i.neutral.fill),t.set(L0,this.palette.altUp?.stroke??i.up.stroke),t.set(N0,this.palette.altUp?.fill??i.up.fill),t.set(w0,this.palette.altDown?.stroke??i.down.stroke),t.set(E0,this.palette.altDown?.fill??i.down.fill),t.set(O0,this.palette.altNeutral?.fill??i.altNeutral.fill),t.set(P0,this.palette.altNeutral?.stroke??i.altNeutral.stroke),t}};An.axisDefault={number:An.getAxisDefaults({keys:[],line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:!1}),log:An.getAxisDefaults({keys:[],base:10,line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:!1}),category:An.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:Po},crosshair:{enabled:!1}},{title:!0,time:!1}),"grouped-category":An.getAxisDefaults({keys:[],tick:{enabled:!0,stroke:Tp},label:{spacing:10,rotation:270,wrapping:"on-space"},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2,crosshair:{enabled:!1}},{title:!0,time:!1}),time:An.getAxisDefaults({keys:[],gridLine:{enabled:Po},crosshair:{enabled:!0}},{title:!0,time:!0}),"unit-time":An.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!1},gridLine:{enabled:Po},crosshair:{enabled:!0},parentLevel:{enabled:!0}},{title:!0,time:!0}),"ordinal-time":An.getAxisDefaults({keys:[],groupPaddingInner:0,label:{autoRotate:!1},gridLine:{enabled:Po},crosshair:{enabled:!0}},{title:!0,time:!0}),"angle-category":An.getAxisDefaults({label:{spacing:5},gridLine:{enabled:Po},shape:{$findFirstSiblingNotOperation:void 0}},{title:!1,time:!1}),"angle-number":An.getAxisDefaults({label:{spacing:5},gridLine:{enabled:Po}},{title:!1,time:!1}),"radius-category":An.getAxisDefaults({positionAngle:0,line:{enabled:!1}},{title:!0,time:!1}),"radius-number":An.getAxisDefaults({positionAngle:0,line:{enabled:!1},shape:{$findFirstSiblingNotOperation:void 0}},{title:!0,time:!1})};var Ro=An,z0="#192232",cs={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},kc={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},yd=class extends Ro{getDefaultColors(){return{fills:cs,fillsFallback:Object.values(cs),strokes:kc,sequentialColors:Dn(cs),divergingColors:[cs.ORANGE,cs.YELLOW,cs.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[cs.GREEN,cs.YELLOW,cs.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:cs.GREEN,stroke:kc.GREEN},down:{fill:cs.RED,stroke:kc.RED},neutral:{fill:cs.GRAY,stroke:kc.GRAY},altUp:{fill:cs.BLUE,stroke:kc.BLUE},altDown:{fill:cs.ORANGE,stroke:kc.ORANGE},altNeutral:{fill:cs.GRAY,stroke:kc.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:.737},backgroundColor:z0,borderColor:{$foregroundBackgroundMix:.216},chromeBackgroundColor:{$foregroundBackgroundMix:.07},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundMix:.257},popupShadow:"0 0 16px rgba(0, 0, 0, 0.33)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.57]},crosshairLabelBackgroundColor:{$foregroundBackgroundMix:.65}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(gd,!0),e.set(Qy,z0),e.set(Tp,"#7f8389"),e.set(Wt,cs.BLUE),e.set(wp,"#fff"),e.set(Ni,cs.BLUE),e.set(Np,z0),e.set(Ep,"#28313e"),e.set(Op,"#4b525d"),e.set(Pp,"#fff"),e.set(Rp,"#fff"),e.set(zp,"#28313e"),e.set(_p,"#4b525d"),e.set(Gp,"#fff"),e}constructor(e){super(e)}},Js={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Cc={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},OW=class extends yd{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Js},fillsFallback:Object.values({...Js}),strokes:{...Cc},sequentialColors:Dn(Js),divergingColors:[Js.GREEN,Js.BLUE,Js.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:Js.GREEN,stroke:Cc.GREEN},down:{fill:Js.RED,stroke:Cc.RED},neutral:{fill:Js.BLUE,stroke:Cc.BLUE},altUp:{fill:Js.GREEN,stroke:Cc.GREEN},altDown:{fill:Js.RED,stroke:Cc.RED},altNeutral:{fill:Js.GRAY,stroke:Cc.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Wt,Js.BLUE),e.set(Ni,Js.BLUE),e.set(nl,"overlay"),e.set(ol,"left"),e.set(Vp,"bottom"),e.set(Po,!0),e}},en={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Tc={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},PW=class extends Ro{getDefaultColors(){return{...super.getDefaultColors(),fills:{...en},fillsFallback:Object.values({...en}),strokes:{...Tc},sequentialColors:Dn(en),divergingColors:[en.GREEN,en.BLUE,en.RED],up:{fill:en.GREEN,stroke:Tc.GREEN},down:{fill:en.RED,stroke:Tc.RED},neutral:{fill:en.BLUE,stroke:Tc.BLUE},altUp:{fill:en.GREEN,stroke:Tc.GREEN},altDown:{fill:en.RED,stroke:Tc.RED},altNeutral:{fill:en.GRAY,stroke:Tc.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Wt,en.BLUE),e.set(Ni,en.BLUE),e.set(nl,"overlay"),e.set(ol,"left"),e.set(Vp,"bottom"),e.set(Po,!0),e}},hs={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Lc={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},RW=class extends yd{getDefaultColors(){return{...super.getDefaultColors(),fills:hs,fillsFallback:Object.values(hs),strokes:Lc,sequentialColors:Dn(hs),divergingColors:[hs.ORANGE,hs.YELLOW,hs.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[hs.GREEN,hs.YELLOW,hs.RED],up:{fill:hs.GREEN,stroke:Lc.GREEN},down:{fill:hs.RED,stroke:Lc.RED},neutral:{fill:hs.GRAY,stroke:Lc.GRAY},altUp:{fill:hs.BLUE,stroke:Lc.BLUE},altDown:{fill:hs.RED,stroke:Lc.RED},altNeutral:{fill:hs.GRAY,stroke:Lc.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Wt,hs.BLUE),e.set(Ni,hs.BLUE),e}},ds={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},wc={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},BW=class extends Ro{getDefaultColors(){return{...super.getDefaultColors(),fills:ds,fillsFallback:Object.values(ds),strokes:wc,sequentialColors:Dn(ds),divergingColors:[ds.ORANGE,ds.YELLOW,ds.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[ds.GREEN,ds.YELLOW,ds.RED],up:{fill:ds.GREEN,stroke:wc.GREEN},down:{fill:ds.RED,stroke:wc.RED},neutral:{fill:ds.GRAY,stroke:wc.GRAY},altUp:{fill:ds.BLUE,stroke:wc.BLUE},altDown:{fill:ds.RED,stroke:wc.RED},altNeutral:{fill:ds.GRAY,stroke:wc.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Wt,ds.BLUE),e.set(Ni,ds.BLUE),e}},$t={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Nc={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},FW=class extends yd{getDefaultColors(){return{fills:$t,fillsFallback:Object.values($t),strokes:Nc,sequentialColors:Dn($t),divergingColors:[$t.BLUE,$t.RED],hierarchyColors:[],secondSequentialColors:[$t.BLUE,$t.PURPLE,$t.MAGENTA,$t.PINK,$t.RED,$t.ORANGE,$t.YELLOW,$t.GREEN],secondDivergingColors:[$t.BLUE,$t.RED],secondHierarchyColors:[],up:{fill:$t.GREEN,stroke:Nc.GREEN},down:{fill:$t.RED,stroke:Nc.RED},neutral:{fill:$t.GRAY,stroke:Nc.GRAY},altUp:{fill:$t.BLUE,stroke:Nc.BLUE},altDown:{fill:$t.RED,stroke:Nc.RED},altNeutral:{fill:$t.GRAY,stroke:Nc.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Wt,$t.BLUE),e.set(Ni,$t.BLUE),e}},Ut={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Ec={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},zW=class extends Ro{getDefaultColors(){return{...super.getDefaultColors(),fills:Ut,fillsFallback:Object.values(Ut),strokes:Ec,sequentialColors:Dn(Ut),divergingColors:[Ut.BLUE,Ut.RED],hierarchyColors:[],secondSequentialColors:[Ut.BLUE,Ut.PURPLE,Ut.MAGENTA,Ut.PINK,Ut.RED,Ut.ORANGE,Ut.YELLOW,Ut.GREEN],secondDivergingColors:[Ut.BLUE,Ut.RED],secondHierarchyColors:[],up:{fill:Ut.GREEN,stroke:Ec.GREEN},down:{fill:Ut.RED,stroke:Ec.RED},neutral:{fill:Ut.GRAY,stroke:Ec.GRAY},altUp:{fill:Ut.BLUE,stroke:Ec.BLUE},altDown:{fill:Ut.RED,stroke:Ec.RED},altNeutral:{fill:Ut.GRAY,stroke:Ec.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Wt,Ut.BLUE),e.set(Ni,Ut.BLUE),e}},Ei={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"},rl={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"},_W=class extends yd{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ei,RED:Ei.ORANGE},fillsFallback:Object.values({...Ei,RED:Ei.ORANGE}),strokes:{...rl,RED:rl.ORANGE},sequentialColors:Dn({...Ei,RED:Ei.ORANGE}),divergingColors:[Ei.ORANGE,Ei.YELLOW,Ei.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Ei.GREEN,Ei.YELLOW,Ei.ORANGE],up:{fill:Ei.GREEN,stroke:rl.GREEN},down:{fill:Ei.ORANGE,stroke:rl.ORANGE},neutral:{fill:Ei.GRAY,stroke:rl.GRAY},altUp:{fill:Ei.BLUE,stroke:rl.BLUE},altDown:{fill:Ei.ORANGE,stroke:rl.ORANGE},altNeutral:{fill:Ei.GRAY,stroke:rl.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Wt,Ei.BLUE),e.set(Ni,Ei.BLUE),e}},Hi={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"},lr={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"},GW=class extends Ro{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Hi,RED:Hi.ORANGE},fillsFallback:Object.values({...Hi,RED:Hi.ORANGE}),strokes:{...lr,RED:lr.ORANGE},sequentialColors:Dn({...Hi,RED:Hi.ORANGE}),divergingColors:[Hi.ORANGE,Hi.YELLOW,Hi.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[Hi.GREEN,Hi.YELLOW,Hi.ORANGE],secondHierarchyColors:[],up:{fill:Hi.GREEN,stroke:lr.GREEN},down:{fill:Hi.ORANGE,stroke:lr.ORANGE},neutral:{fill:lr.GRAY,stroke:lr.GRAY},altUp:{fill:Hi.BLUE,stroke:lr.BLUE},altDown:{fill:Hi.ORANGE,stroke:lr.ORANGE},altNeutral:{fill:Hi.GRAY,stroke:lr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Wt,Hi.BLUE),e.set(Ni,Hi.BLUE),e}},_0=["top","top-right","top-left","bottom","bottom-right","bottom-left","right","right-top","right-bottom","left","left-top","left-bottom"],VW={floating:z,placement:J(..._0),xOffset:K,yOffset:K},O2=Xe((e,t)=>{let i;if(typeof e=="string")_0.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new jr("invalid",`a legend placement string: ["${_0.join('", "')}"]`,e,t.path)));else{const{cleared:s,invalid:n}=ss(e,VW);i={valid:n.length===0,cleared:s,invalid:n}}return i},"a legend position object or placement string"),im=Ce(J("circle","cross","diamond","heart","plus","pin","square","star","triangle"),rt),P2=J("never","always","hyphenate","on-space"),sm=J("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),nm=Ce(G,J("exact","nearest")),G0=Ce(E,ui({text:Y(E),...ht},"text segments array")),R2=J("pointer","start","middle","end"),om={enabled:z,text:G0,textAlign:J("left","center","right"),wrapping:J("never","always","hyphenate","on-space"),spacing:G,maxWidth:G,maxHeight:G,...ht};om.padding=me(G);var am={enabled:z,text:G0,renderer:oc(Ce(E,Gk))},V0=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],B2={type:J("action","separator"),showOn:J("always","series-area","series-node","legend-item"),label:Y(E),enabled:z,action:rt,items:(e,t)=>F2(e,t)};B2.iconUrl=me(E);var jW=_t(B2),HW=Xe((e,t)=>{let i;return typeof e=="string"?V0.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new jr("invalid",`a context menu item string alias: ["${V0.join('", "')}"]`,e,t.path))):i=jW(e,t),i},`a context menu item object or string alias: [${V0.join(", ")}]`),F2=Ae(HW,"a menu items array",!1),Oc={label:E,ariaLabel:E,tooltip:E,icon:J("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")},Bo=Ce(E,oc(E)),z2=_t({x:Bo,y:Bo,angle:Bo,radius:Bo,size:Bo,color:Bo,label:Bo,secondaryLabel:Bo,sectorLabel:Bo,calloutLabel:Bo,legendItem:Bo}),Fo=Xe(OG,"a valid number format string"),Ne={width:G,height:G,minWidth:G,minHeight:G,suppressFieldDotNotation:z,title:om,subtitle:om,footnote:om,padding:{top:G,right:G,bottom:G,left:G},seriesArea:{border:_f,clip:z,cornerRadius:K,padding:zf},legend:{enabled:z,position:O2,orientation:J("horizontal","vertical"),maxWidth:G,maxHeight:G,spacing:G,border:_f,cornerRadius:K,padding:zf,fill:Vn,fillOpacity:pe,preventHidingAll:z,reverseOrder:z,toggleSeries:z,item:{marker:{size:G,shape:im,padding:G,strokeWidth:G},line:{length:G,strokeWidth:G},label:{maxLength:G,formatter:rt,...ht},maxWidth:G,paddingX:G,paddingY:G,showSeriesStroke:z},pagination:{marker:{size:G,shape:im,padding:G},activeStyle:{...ue,...se},inactiveStyle:{...ue,...se},highlightStyle:{...ue,...se},label:ht},listeners:{legendItemClick:rt,legendItemDoubleClick:rt}},gradientLegend:{enabled:z,position:O2,spacing:G,reverseOrder:z,border:_f,cornerRadius:K,padding:zf,fill:Vn,fillOpacity:pe,gradient:{preferredLength:G,thickness:G},scale:{label:{...ht,minSpacing:G,format:Fo,formatter:rt},padding:G,interval:{step:K,values:ko,minSpacing:at(G,_n("maxSpacing")),maxSpacing:at(G,Gn("minSpacing"))}}},listeners:{seriesNodeClick:rt,seriesNodeDoubleClick:rt,seriesVisibilityChange:rt,click:rt,doubleClick:rt,annotations:rt,zoom:rt},loadGoogleFonts:z,highlight:{range:J("tooltip","node")},overlays:{loading:am,noData:am,noVisibleSeries:am,unsupportedBrowser:am},tooltip:{enabled:z,showArrow:z,pagination:z,delay:G,range:nm,wrapping:P2,mode:J("single","shared","compact"),position:{anchorTo:J("pointer","node","chart"),placement:Ce(sm,Ae(sm)),xOffset:K,yOffset:K}},animation:{enabled:z,duration:G},contextMenu:{enabled:z,items:F2},context:()=>!0,dataSource:{getData:rt},keyboard:{enabled:z,tabIndex:K},touch:{dragAction:J("none","drag","hover")},ranges:{enabled:z,buttons:ui({...Oc,value:Ce(K,at(Ae(Ce(K,Hr)),Wr(2,2)),rt)},"range button options array")},locale:{localeText:Of,getLocaleText:oc(E)},background:{visible:z,fill:ae,image:{url:Y(E),top:K,right:K,bottom:K,left:K,width:G,height:G,opacity:pe}},styleNonce:E,sync:{enabled:z,groupId:E,axes:J("x","y","xy"),nodeInteraction:z,zoom:z},zoom:{enabled:z,enableAxisDragging:z,enableAxisScrolling:z,enableDoubleClickToReset:z,enablePanning:z,enableScrolling:z,enableSelecting:z,enableTwoFingerZoom:z,keepAspectRatio:z,anchorPointX:R2,anchorPointY:R2,axisDraggingMode:J("pan","zoom"),axes:J("x","y","xy"),deceleration:Ce(J("off","short","long"),pe),minVisibleItems:G,panKey:J("alt","ctrl","meta","shift"),scrollingStep:pe,autoScaling:{enabled:z,padding:pe},buttons:{enabled:z,buttons:ui({...Oc,value:J("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:E},"zoom button options array"),visible:J("always","zoomed","hover")}},formatter:Ce(oc(E),z2)};Ne.dataSource.requestThrottle=me(G),Ne.dataSource.updateThrottle=me(G),Ne.dataSource.updateDuringInteraction=me(z),Ne.zoom.enableIndependentAxes=me(z),Ne.statusBar=me(Te),Ne.foreground=me({visible:z,text:E,image:{url:E,top:K,right:K,bottom:K,left:K,width:G,height:G,opacity:pe},...ue}),Ne.overrideDevicePixelRatio=me(K),Ne.sync.domainMode=me(J("direction","position","key"));var Ke={cursor:E,context:()=>!0,showInLegend:z,nodeClickRange:nm,listeners:{seriesNodeClick:rt,seriesNodeDoubleClick:rt},highlightStyle:{item:{...ue,...se},series:{enabled:z,dimOpacity:pe,strokeWidth:G}},highlight:Uk(Ct)},zo={...Ke,id:E,visible:z,context:()=>!0,data:ko};zo.seriesGrouping=me(Te);var cr={enabled:z,shape:im,size:G,itemStyler:bt({...ue,...se,...fe,shape:im,size:G}),...ue,...se,...fe},pt={enabled:z,formatter:rt,format:Fo,itemStyler:me(bt({enabled:z,...Co,...ht})),...Co,...ht},ll={...pt,lineHeight:G,minimumFontSize:G,wrapping:P2,overflowStrategy:J("ellipsis","hide")},Hp={visible:z,cap:{visible:z,length:G,lengthRatio:pe,...se,...fe},...se,...fe},rm={...Hp,xLowerKey:E,xUpperKey:E,yLowerKey:E,yUpperKey:E,xLowerName:E,xUpperName:E,yLowerName:E,yUpperName:E,itemStyler:bt({visible:z,...se,...fe,cap:{visible:z,length:G,lengthRatio:pe,...se,...fe}})},tt={enabled:z,showArrow:z,range:nm,renderer:oc(Ce(E,_t({heading:E,title:E,data:ui({label:Y(E),value:Y(E)})},"tooltip renderer result object"))),position:{anchorTo:J("node","pointer","chart"),placement:Ce(sm,Ae(sm)),xOffset:K,yOffset:K},interaction:{enabled:z}},xa={enabled:z,xOffset:K,yOffset:K,blur:G,color:ae},lm=nc({linear:{},smooth:{tension:pe},step:{position:J("start","middle","end")}},"interpolation line options"),Wp={fills:at(Wr(2),Ae(_t({color:ae,stop:K},"")),$k),fillMode:J("continuous","discrete")},cm={value:Y(K),text:E,shape:Ce(J("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),rt),placement:J("before","after","middle"),spacing:G,size:G,rotation:K,...ue,...se,...fe},hm={value:Y(K),text:E,shape:Ce(J("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),rt),placement:J("inside","outside","middle"),spacing:G,size:G,rotation:K,label:{...pt,spacing:G},...ue,...se,...fe},dm={direction:J("horizontal","vertical"),cornerMode:J("container","item"),cornerRadius:G,thickness:G,segmentation:{enabled:z,spacing:G,interval:{values:Ae(K),step:K,count:K}},bar:{enabled:z,thickness:G,thicknessRatio:pe,...Wp,...ue,...se,...fe},label:{...ll,text:E,spacing:G,avoidCollisions:z,placement:J("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:tt,...ce(Ke,["listeners"])},cl={...dm,...ce(zo,["listeners"]),type:Y(Le("linear-gauge")),value:Y(K),scale:{min:at(K,_n("max")),max:at(K,Gn("min")),label:{enabled:z,formatter:rt,rotation:K,spacing:G,minSpacing:G,placement:J("before","after"),avoidCollisions:z,format:Fo,...ht},interval:{values:Ae(K),step:K},...Wp,...ue,...se,...fe},targets:ui(cm,"target options array")};cl.margin=me(K),cl.defaultColorRange=me(Ae(ae)),cl.defaultTarget=me({...cm,value:K,label:{...pt,spacing:K}}),cl.defaultScale=me(cl.scale),cl.scale.defaultFill=me(ae);var um={outerRadius:G,innerRadius:G,outerRadiusRatio:pe,innerRadiusRatio:pe,startAngle:K,endAngle:K,spacing:G,cornerMode:J("container","item"),cornerRadius:G,scale:{min:at(K,_n("max")),max:at(K,Gn("min")),label:{enabled:z,formatter:rt,rotation:K,spacing:G,minSpacing:G,avoidCollisions:z,format:Fo,...ht},interval:{values:Ae(K),step:K},...Wp,...ue,...se,...fe},segmentation:{enabled:z,spacing:G,interval:{values:Ae(K),step:K,count:K}},bar:{enabled:z,...Wp,...ue,...se,...fe},needle:{enabled:z,spacing:G,radiusRatio:pe,...ue,...se,...fe},label:{text:E,spacing:G,...ll},secondaryLabel:{text:E,...ll},tooltip:tt,...Ke},$p={...um,...zo,type:Y(Le("radial-gauge")),value:Y(K),targets:ui(hm,"target options array")};$p.defaultColorRange=me(Ae(ae)),$p.defaultTarget=me({...hm,value:K,label:{...pt,spacing:K}}),$p.scale.defaultFill=me(ae);var Up=J("millisecond","second","minute","hour","day","month","year"),_2={unit:Y(Up),step:zu,epoch:Hr,utc:z};_2.every=rt;var pm=_t(_2,"a time interval object"),Pc={enabled:z,text:E,padding:K,...ht},ba=Xe({enabled:z,type:Y(J("line","range")),range:at(Xe((e,{options:t})=>t.type==="range","crossLine type to be 'range'"),Ae(Te),Wr(2,2)),value:at(Xe((e,{options:t})=>t.type==="line","crossLine type to be 'line'"),Te),label:Pc,fill:ae,fillOpacity:pe,...se,...fe},"cross-line options"),hr={...ba,label:{...Pc,position:J("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:K}},dr={enabled:z,rotation:K,avoidCollisions:z,minSpacing:G,spacing:G,formatter:rt,itemStyler:me(bt({...ht,...Co,spacing:K})),...ht,...Co},Yp={autoRotate:z,autoRotateAngle:K,wrapping:J("never","always","hyphenate","on-space"),truncate:z,...dr},j0={format:Fo,...Yp},Kp={format:Ce(E,Of),...Yp},G2={enabled:z,width:G,size:G,stroke:ae},gm={enabled:z,label:Kp,tick:G2},H0={values:Ae(Te),minSpacing:G},Rc={reverse:z,gridLine:{enabled:z,width:G,style:ui({fill:ae,fillOpacity:G,stroke:Ce(ae,Pf),strokeWidth:G,lineDash:Ae(G)},"a grid-line style object array")},interval:H0,label:dr,line:{enabled:z,width:G,stroke:ae},tick:G2,context:()=>!0};Rc.layoutConstraints=me({stacked:Y(z),align:Y(J("start","end")),unit:Y(J("percent","px")),width:Y(G)});var ur={...Rc,keys:Ae(E),crossLines:ui(hr,"a cross-line options array"),position:J("top","right","bottom","left"),thickness:G,maxThicknessRatio:pe,title:{enabled:z,text:E,spacing:G,formatter:rt,...ht}};ur.title._enabledFromTheme=me(z);var Zp={enabled:z,...ue,...se,...fe};function hl(e,t){const i={enabled:z,xOffset:K,yOffset:K,formatter:oc(E),renderer:oc(Ce(E,_t({text:E,color:ae,backgroundColor:ae,opacity:pe},"crosshair label renderer result object")))};let s;return e&&(s={...i,format:t?Ce(E,_t({millisecond:E,second:E,hour:E,day:E,month:E,year:E})):E}),{enabled:z,snap:z,label:s??i,...se,...fe}}function md(e,t){return{min:at(e,_n("max")),max:at(e,Gn("min")),nice:z,interval:{step:t?Ce(zu,Up,pm):zu,values:Ae(e),minSpacing:at(G,_n("maxSpacing")),maxSpacing:at(G,Gn("minSpacing"))}}}var W0={step:Ce(zu,Up,pm),values:Ae(Ce(K,Hr)),minSpacing:at(G,_n("maxSpacing")),maxSpacing:at(G,Gn("minSpacing")),placement:J("on","between")},xd=class m_ extends Dp{constructor(t,i=new ld,s=!0){super(t,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=s,this.nice=!1}static is(t){return t instanceof m_}isCategoryLike(){return!0}hasDefinedDomain(){return!1}normaliseDataDomain(t){return{domain:t,clipped:!1}}updateScale(){super.updateScale();let{paddingInner:t,paddingOuter:i}=this;if(!Ye(t)||!Ye(i)){const s=this.reduceBandScalePadding();t??(t=s.inner),i??(i=s.outer)}this.scale.paddingInner=t??0,this.scale.paddingOuter=i??0}calculateGridLines(t,i,s){const n=super.calculateGridLines(t,i,s);return this.interval.placement==="between"&&t.length>0&&n.push(super.calculateGridLine({index:t.at(-1).index+1,tickId:`after:${t.at(-1).tickId}`,translation:this.range[1]},t.length,i,s,t)),n}calculateGridLine({index:t,tickId:i,translation:s},n,o,a,r){const{gridLine:l,horizontal:c,interval:h,scale:d}=this;if(h.placement!=="between")return super.calculateGridLine({index:t,tickId:i,translation:s},n,o,a,r);const u=s<d.step?Math.floor(d.step/2):d.step/2,p=s-u,[g,f,x,m]=c?[p,Math.max(o,a),p,Math.min(o,a)]:[Math.min(o,a),p,Math.max(o,a),p],{style:b}=l,{stroke:v,strokeWidth:S=0,lineDash:D}=b[t%b.length]??{};return{tickId:i,offset:p,x1:g,y1:f,x2:x,y2:m,stroke:v,strokeWidth:S,lineDash:D}}calculateGridFills(t,i,s){const{horizontal:n,range:o,scale:a}=this;if(this.interval.placement!=="between")return super.calculateGridFills(t,i,s);const r=[];if(t.length==0)return r;const l=t[0],c=l.translation>o[0]+a.step/2,h=t[t.length-1],d=n&&h.translation<o[1]-a.step/2;if(c){const u={tickId:`before:${l.tickId}`,translation:l.translation-a.step};r.push(this.calculateGridFill(u,-1,l.index-1,i,s,t))}if(r.push(...t.map((u,p)=>this.calculateGridFill(u,p,u.index,i,s,t))),d){const u={tickId:`after:${h.tickId}`,translation:h.translation+a.step};r.push(this.calculateGridFill(u,t.length,h.index+1,i,s,t))}return r}calculateGridFill({tickId:t,translation:i},s,n,o,a,r){const{gridLine:l,horizontal:c,interval:h,scale:d}=this;if(h.placement!=="between")return super.calculateGridFill({tickId:t,translation:i},s,n,o,a,r);const u=i-d.step/2,p=i+d.step/2,[g,f,x,m]=c?[u,Math.max(o,a),p,Math.min(o,a)]:[Math.min(o,a),u,Math.max(o,a),p],{fill:b,fillOpacity:v}=l.style[n%l.style.length]??{};return{tickId:t,x1:g,y1:f,x2:x,y2:m,fill:b,fillOpacity:v}}calculateTickLines(t,i){const s=super.calculateTickLines(t,i);return this.interval.placement==="between"&&t.length>0&&s.push(super.calculateTickLine({primary:!1,tickId:`after:${t.at(-1)?.tickId}`,translation:this.range[1]},t.length,i,t)),s}calculateTickLine({primary:t,tickId:i,translation:s},n,o,a){const{horizontal:r,interval:l,primaryTick:c,scale:h,tick:d}=this;if(l.placement!=="between")return super.calculateTickLine({primary:t,tickId:i,translation:s},n,o,a);const u=t&&c?.enabled?c:d,p=-o*this.getTickSize(u),g=s<h.step?Math.floor(h.step/2):h.step/2,f=s-g,[x,m,b,v]=r?[f,0,f,p]:[0,f,p,f],{stroke:S,width:D}=u;return{tickId:i,offset:f,x1:x,y1:m,x2:b,y2:v,stroke:S,strokeWidth:D,lineDash:void 0}}reduceBandScalePadding(){return this.boundSeries.reduce((t,i)=>{const s=i.getBandScalePadding?.();return s&&(t.inner>s.inner&&(t.inner=s.inner),t.outer<s.outer&&(t.outer=s.outer)),t},{inner:1/0,outer:-1/0})}tickFormatParams(t,i,s,n){return{type:"category"}}datumFormatParams(t,i,s,n,o){const{datum:a,seriesId:r,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p}=i;return Array.isArray(t)&&t.some(g=>typeof g!="string")?t=t.map(String):!Array.isArray(t)&&typeof t!="string"&&typeof t!="number"&&!(t instanceof Date)&&(t=String(t)),{type:"category",value:t,datum:a,seriesId:r,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p}}};xd.className="CategoryAxis",xd.type="category",M([I],xd.prototype,"groupPaddingInner",2),M([I],xd.prototype,"paddingInner",2),M([I],xd.prototype,"paddingOuter",2);var bd=xd,V2=class x_ extends ld{static is(t){return t instanceof x_}normalizeDomains(...t){const{domain:i}=super.normalizeDomains(...t);return{domain:i,animatable:!1}}findIndex(t){return super.findIndex(t)??this.getMatchIndex(t)}getMatchIndex(t){const i=JSON.stringify(t),s=this._domain.find(n=>JSON.stringify(n)===i);if(s!=null)return super.findIndex(s)}};function dl(e){if(e.length===0)return null;let t=1/0,i=-1/0;for(const n of e){const o=n instanceof Date?n.getTime():n;typeof o=="number"&&(o<t&&(t=o),o>i&&(i=o))}const s=[t,i];return s.every(isFinite)?s:null}function $0(e,t,i){let s=!1;const n=dl(e);if(n==null)return{extent:t!=null&&i!=null&&t<=i?[t,i]:[],clipped:!1};let[o,a]=n;return t!=null&&(s||(s=t>o),o=t),i!=null&&(s||(s=i<a),a=i),o>a?{extent:[],clipped:!1}:{extent:[o,a],clipped:s}}function fm(e,t=[0,0]){for(const i of e)typeof i=="number"&&(i<0&&(t[0]+=i),i>0&&(t[1]+=i));return t}function WW(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:s=>fm(s)}}function j2(e,t){return{id:e,type:"aggregate",matchGroupIds:t?[t]:void 0,aggregateFunction:i=>fm(i),groupAggregateFunction:(i,s=[0,0])=>(s[0]+=i?.[0]??0,s[1]+=i?.[1]??0,s)}}function $W(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:s=>Jr.extendDomain(s)}}function U0(e){return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(t,i=[0,0])=>(i[0]+=t?.[0]??0,i[1]+=t?.[1]??0,i)}}function H2(e,t){return{id:e,matchGroupIds:t?[t]:void 0,type:"aggregate",aggregateFunction:s=>fm(s),groupAggregateFunction:(s,n=[0,0,-1])=>(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0,n[2]++,n),finalFunction:(s=[0,0,0])=>{const n=s[0]+s[1];return n>=0?[0,n/s[2]]:[n/s[2],0]}}}function Y0(e,t,i){const s={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(n,o=[])=>{const a=o[1]-o[0];return t.aggregateFunction(n).map(r=>r/a)}};return t.groupAggregateFunction&&(s.groupAggregateFunction=t.groupAggregateFunction),s}function W2(e){return()=>{let t=0;return i=>Ye(i)?(t+=e?Math.max(0,i):i,t):i}}function $2(){return()=>{let e=0;return t=>{if(!Ye(t))return t;const i=e;return e+=t,i}}}var UW=1e3;function vd(e){return e.input.count<=UW}function U2(e){return e!=null&&Ly(e)}function YW(e){return e!=null}function Y2(e){switch(e){case"number":case"log":case"time":case"unit-time":case"ordinal-time":case"color":return U2;default:return YW}}function K2(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function ul(e,t,i={}){return{property:e,type:"key",valueType:K2(t),validation:Y2(t),...i}}function St(e,t,i={}){return{property:e,type:"value",valueType:K2(t),validation:Y2(t),...i}}function Z2(e,t={}){return{property:e,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...t}}var KW=function(e){return e};function X2(...e){const t=e.filter(i=>i!=null);return t.length===0?()=>KW:t.length===1?t[0]:()=>{const i=t.map(s=>s());return(s,n)=>i.reduce((o,a)=>a(o,n),s)}}function q2(e,t={}){const{min:i=-1/0,max:s=1/0,processor:n,...o}=t;return{type:"value",property:e,valueType:"range",validation:U2,processor:X2(n,()=>a=>Ye(a)?ve(i,a,s):a),...o}}function K0(e,t,i={}){const{onlyPositive:s,processor:n,...o}=i;return{...St(e,t,o),processor:X2(n,W2(s))}}function ZW(e,t,i={}){return{...St(e,t,i),processor:$2()}}function pl(e,t,i,s,n){return[St(e,n,s),sw(s.groupId,t,i,s.separateNegative),...s.rangeId!=null?[$W(s.rangeId,s.groupId)]:[]]}function Q2(e,t,i){return[St(e,t,i),nw(i.groupId)]}var J2={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let e=NaN;return(t=1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-e);return e=s,!isNaN(n)&&n>0&&n<t?n:t}}},ew={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer:()=>{let e=NaN;return(t=-1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-e);return e=s,!isNaN(n)&&n>0&&n>t?n:t}}},tw={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:e}})=>e?.slice().sort((t,i)=>{for(let s=0;s<t.length;s++){const n=t[s]-i[s];if(n!==0)return n}return 0})};function XW({normaliseTo:e}){const t=(i,s)=>{if(s===0)return null;const n=(i??0)*e/s;return n>=0?Math.min(e,n):Math.max(-e,n)};return()=>()=>(i,s,n)=>{const o=qW(i,s,n);for(const a of s){const r=n.datumIndices[a];if(r!=null)for(const l of r){const c=i[a],h=c[l];if(h==null){c[l]=void 0;continue}c[l]=typeof h=="number"?t(h,o):h.map(d=>t(d,o))}}}}function qW(e,t,i){const s=[0,0];for(const n of t){const o=e[n],a=i.datumIndices[n];if(a!=null)for(const r of a){const l=o[r];if(l==null)continue;const c=typeof l=="number"?l:Math.max(...l.map(d=>d??0)),h=c<0?0:1;h===0?s[h]=Math.min(s[h],c):s[h]=Math.max(s[h],c)}}return Math.max(Math.abs(s[0]),s[1])}function ym(e,t){return{type:"group-value-processor",matchGroupIds:e,adjust:op({normaliseTo:t},XW)}}function QW({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:s}){const n=e[1]-e[0],o=(a,r,l)=>{const c=e[0]+(a-r)/l*n;return l===0?t:c>=e[1]?e[1]:c<e[0]?e[0]:c};return()=>(a,r)=>{let[l,c]=a.domain.values[r];i!=null&&(l=i),s!=null&&(c=s);const h=c-l;a.domain.values[r]=[e[0],e[1]];const d=a.columns[r];for(let u=0;u<d.length;u+=1)d[u]=o(d[u],l,h)}}function mm(e,t,i,s,n){return{type:"property-value-processor",property:e,adjust:op({normaliseTo:t,rangeMin:s,rangeMax:n,zeroDomain:i},QW)}}var Xp=1,xm=2;function iw(e,t,i,s){let n=Xp|xm;if(t.valueType==="category")return i.length<e&&(n&=~Xp),n;let o=s[0]?.valueOf();for(let a=1;n!==0&&a<s.length;a++){const r=s[a]?.valueOf();(!Number.isFinite(r)||o>r)&&(n&=~xm),Number.isFinite(r)&&o===r&&(n&=~Xp),o=r}return n}function qp(e){return{type:"processor",property:"animationValidation",calculate(t){if(!vd(t))return;const{keys:i,values:s}=t.defs,{input:n,domain:{keys:o,values:a},keys:r,columns:l,invalidKeyCount:c}=t;let h=Xp|xm;if(n.count!==0){for(let d=0;h!==0&&d<i.length;d++)for(const u of i[d].scopes){const p=r[d].get(u),g=c?.get(u)??0,f=p.length-g;h&=iw(f,i[d],o[d],p)}for(let d=0;h!==0&&d<s.length;d++){const u=s[d];e?.includes(u.id)&&(h&=iw(0,u,a[d],l[d]))}}return{uniqueKeys:(h&Xp)!==0,orderedKeys:(h&xm)!==0}}}}function JW({mode:e,separateNegative:t}){return()=>()=>(i,s,n)=>{const o=[0,0];for(const a of s){const r=n.datumIndices[a];if(r!=null)for(const l of r){const c=i[a],h=c[l],d=$v(h)&&t?0:1;Ye(h)&&(e==="normal"&&(o[d]+=h),c[l]=o[d],e==="trailing"&&(o[d]+=h))}}}}function e$({mode:e,sum:t}){return()=>{const i=[];let s=!0;return()=>(n,o,a)=>{let r=0;for(const l of o){const c=n[l],h=a.datumIndices[l];if(h!=null)for(const d of h){const u=c[d],p=s&&t==="current"?0:i[l];i[l]=u;const g=t==="current"?u:p;if(!Ye(u)||!Ye(p)){c[d]=r;continue}e==="normal"&&(r+=g),c[d]=r,e==="trailing"&&(r+=g)}}s=!1}}}function sw(e,t,i,s=!1){let n;if(t.startsWith("window")){const o=t.endsWith("-trailing")?"trailing":"normal";n=op({mode:o,sum:i},e$)}else n=op({mode:t,separateNegative:s},JW);return{type:"group-value-processor",matchGroupIds:[e],adjust:n}}function t$(){return()=>(e,t,i)=>{const s=new Float64Array(t.length);let n=0;for(const o of t){const a=e[o],r=i.datumIndices[o];if(r!=null)for(const l of r){const c=a[l];s[n]=Number.isFinite(c)?c:NaN,n+=1,a[l]=s.subarray(0,n)}}}}function nw(e){return{type:"group-value-processor",matchGroupIds:[e],adjust:t$}}function ow(e){return e.id??e.property}function i$(e,t,i){const s=new Map,n=t.defs.values;for(let r=0;r<n.length;r+=1){const l=n[r];if(l.scopes?.includes(e)===!1)continue;const c=ow(l);if(s.has(c))return;s.set(c,r)}const o=[],a=i.defs.values;for(let r=0;r<a.length;r+=1){const l=a[r];if(l.scopes?.includes(e)===!1)continue;const c=ow(l),h=s.get(c);if(h==null)return;s.delete(c),o.push({previousIndex:h,nextIndex:r})}if(s.size===0)return o}function Z0(e,t,i,s,n){for(const{previousIndex:o,nextIndex:a}of i){const r=e[o],l=t[a],c=r[s],h=l[n];if(c!==h)return!1}return!0}function Qp(e,t,i=!0){return{type:"processor",property:"diff",calculate(s,n){if(!vd(s))return;const o=new Map,a=new Map,r=new Map,l=new Map,c=t.keys,h=s.keys,d=t.columns,u=s.columns,p=i$(e,t,s);if(p==null)return n;const g=Math.max(t.input.count,s.input.count);for(let m=0;m<g;m++){const b=m<t.input.count,v=m<s.input.count,S=b?Dy(c,e,m):void 0,D=S!=null?pr(S):"",C=v?Dy(h,e,m):void 0,T=C!=null?pr(C):"";if(v&&b&&D===T){Z0(d,u,p,m,m)||r.set(T,m);continue}const k=l.get(T);k!=null?((i||!Z0(d,u,p,k,m))&&(r.set(T,m),o.set(T,m)),l.delete(T)):v&&a.set(T,m);const L=a.get(D);L!=null?((i||!Z0(d,u,p,L,m))&&(r.set(D,m),o.set(D,m)),a.delete(D)):b&&(r.delete(D),l.set(D,m))}const x={changed:a.size>0||r.size>0||l.size>0,added:new Set(a.keys()),updated:new Set(r.keys()),removed:new Set(l.keys()),moved:new Set(o.keys())};return{...n,[e]:x}}}}function pr(e,...t){let i;return Ue(e)?i=e.map(n=>d0(n)).join("___"):i=d0(e),(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i instanceof Date)&&t.length>0&&(i+=`___${t.join("___")}`),i}var s$=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(e,t){e>this.right&&(this.right=e),e<this.left&&(this.left=e),t>this.bottom&&(this.bottom=t),t<this.top&&(this.top=t)}},n$=class b_{constructor(t="",i,s){this.label=t,this.parent=i,this.refId=s,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=i?i.depth+1:0}insertTick(t,i){let s=this;for(let n=0;n<t.length;n++){const o=t[n],a=n!==t.length-1,{children:r}=s,l=r.find(c=>c.label===o);if(l&&a)s=l;else{const c=new b_(o,s,i);c.index=r.length,r.push(c),a&&(s=c)}}}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((t,i)=>i!==this.index)??[]}};function o$(e){const t=e.reduce((s,n)=>s<n.length?n.length:s,0),i=new n$;for(let s=0;s<e.length;s++){const n=e[s];for(;n.length<t;)n.push("");i.insertTick(n,s)}return i}function a$(e,t,i){const s=t.index-e.index,n=i/s;t.change-=n,t.shift+=i,e.change+=n,t.prelim+=i,t.mod+=i}function r$(e,t,i){return t.getSiblings().indexOf(e.ancestor)>=0?e.ancestor:i}function l$({children:e}){let t=0,i=0;for(let s=e.length-1;s>=0;s--){const n=e[s];n.prelim+=t,n.mod+=t,i+=n.change,t+=n.shift+i}}function c$(e,t){const i=e.getLeftSibling();if(i){let s=e,n=e,o=i,a=n.getLeftmostSibling(),r=n.mod,l=s.mod,c=o.mod,h=a.mod;for(;o.nextRight()&&n.nextLeft();){o=o.nextRight(),n=n.nextLeft(),a=a.nextLeft(),s=s.nextRight(),s.ancestor=e;const d=o.prelim+c-(n.prelim+r)+1;d>0&&(a$(r$(o,e,t),e,d),r+=d,l+=d),c+=o.mod,r+=n.mod,h+=a.mod,l+=s.mod}o.nextRight()&&!s.nextRight()?s.mod+=c-l:(n.nextLeft()&&!a.nextLeft()&&(a.mod+=r-h),t=e)}return t}function aw(e){const{children:t}=e;if(t.length){let[i]=t;for(const o of t)aw(o),i=c$(o,i);l$(e);const s=(t[0].prelim+t.at(-1).prelim)/2,n=e.getLeftSibling();n?(e.prelim=n.prelim+1,e.mod=e.prelim-s):e.prelim=s}else{const i=e.getLeftSibling();e.prelim=i?i.prelim+1:0}}function rw(e,t,i){e.position=e.prelim+t,i.insertNode(e);for(const s of e.children)rw(s,t+e.mod,i)}function lw(e){const{children:t}=e;let i=0;for(const s of t)lw(s),s.children.length?i+=s.leafCount:i++;e.leafCount=i,t.length?(e.subtreeLeft=t[0].subtreeLeft,e.subtreeRight=t[t.length-1].subtreeRight,e.position=(e.subtreeLeft+e.subtreeRight)/2):(e.subtreeLeft=e.position,e.subtreeRight=e.position)}function h$(e){const t=new d$,i=o$(e);return aw(i),rw(i,-i.prelim,t),lw(i),t}var d$=class{constructor(){this.dimensions=new s$,this.nodes=[],this.depth=0}insertNode(e){this.depth<e.depth&&(this.depth=e.depth),this.dimensions.update(e.position,e.depth),this.nodes.push(e)}scaling(e,t){let i=1;if(e>0){const{left:s,right:n}=this.dimensions;n!==s&&(i=e/(n-s))}return t&&(i*=-1),i}},Ls=class extends we{constructor(){super(...arguments),this.enabled=!0,this.border=new vc}};M([I],Ls.prototype,"enabled",2),M([I],Ls.prototype,"avoidCollisions",2),M([I],Ls.prototype,"border",2),M([I],Ls.prototype,"color",2),M([I],Ls.prototype,"cornerRadius",2),M([I],Ls.prototype,"spacing",2),M([I],Ls.prototype,"rotation",2),M([I],Ls.prototype,"wrapping",2),M([I],Ls.prototype,"truncate",2),M([I],Ls.prototype,"fill",2),M([I],Ls.prototype,"fontStyle",2),M([I],Ls.prototype,"fontWeight",2),M([I],Ls.prototype,"fontSize",2),M([I],Ls.prototype,"fontFamily",2),M([I],Ls.prototype,"padding",2);var bm=class extends we{constructor(){super(...arguments),this.enabled=!0}};M([I],bm.prototype,"enabled",2),M([I],bm.prototype,"width",2),M([I],bm.prototype,"stroke",2);var X0=class extends we{constructor(){super(...arguments),this.label=new Ls,this.tick=new bm}};M([I],X0.prototype,"label",2),M([I],X0.prototype,"tick",2);var Bc=class extends bd{constructor(e){super(e,new V2),this.tickScale=new V2,this.depthOptions=new Ku(X0),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:e}=this.tickTreeLayout,{range:t,step:i,inset:s,bandwidth:n}=this.scale,o=Math.abs(t[1]-t[0])-i,a=this.tickTreeLayout.scaling(o,t[0]>t[1]),r=s+n/2;let l=0;for(const c of e){const h=c.position*a;l>h&&(l=h),c.screen=h+r}for(const c of e)c.screen-=l}getDepthOptionsMap(e){const t=[],{depthOptions:i,label:s}=this,n=this.horizontal?0:-90;for(let o=0;o<e;o++)t.push(i[o]?.label.enabled??s.enabled?{enabled:!0,spacing:i[o]?.label.spacing??s.spacing,wrapping:i[o]?.label.wrapping??s.wrapping,truncate:i[o]?.label.truncate??s.truncate,rotation:i[o]?.label.rotation??(o?n:s.rotation),avoidCollisions:i[o]?.label.avoidCollisions??s.avoidCollisions}:{enabled:!1,spacing:0,rotation:0,avoidCollisions:!1});return t}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((e,t)=>{e.fill=t.color,e.text=t.text,e.textBaseline=t.textBaseline,e.textAlign=t.textAlign??"center",e.setFont(t),e.setBoxing(t)})}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){this.updateDirection(),this.updateScale();const{step:e}=this.scale,{title:t,label:i,range:s,depthOptions:n,horizontal:o,line:a}=this;if(this.lineNode.datum=o?{x1:s[0],x2:s[1],y1:0,y2:0}:{x1:0,x2:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:a.stroke,strokeWidth:a.enabled?a.width:0}),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:de.zero,spacing:0,separatorLayout:[],tickLabelLayout:[]};const{depth:r,nodes:l}=this.tickTreeLayout,c=o?-i.getSideFlag():i.getSideFlag(),h=[],d=new Map,u=new Yh,p=this.getDepthOptionsMap(r),g=c*p[0].spacing,f=this.tickFormatter(this.scale.domain,this.scale.domain,!1),x=(L,N)=>{const w=r-L.depth;if(!p[w]?.enabled||!DG(L.screen,s))return!1;let O=f(L.label,N-1);const R=this.getLabelStyles({value:O,depth:w},n[w]?.label);if(i.avoidCollisions){const B=p[w].rotation;let P=(L.leafCount||1)*e,_=this.thickness;if(B!=null){const F=uG(B,P,_);P=F.width,_=F.height}O=ep.wrapText(O,{font:R,textWrap:p[w].wrapping,overflow:p[w].truncate?"ellipsis":"hide",maxWidth:P,maxHeight:_})||O}return u.x=o?L.screen:g,u.y=o?g:L.screen,u.rotation=0,u.lineHeight=ut.getLineHeight(R.fontSize),u.fill=R.color,u.text=O,u.textAlign="center",u.textBaseline=i.parallel?"top":"bottom",u.setFont(R),u.setBoxing(R),!0},m={};l.forEach((L,N)=>{const w=r-L.depth;if(m[w]??(m[w]=0),!x(L,N)||!u.getBBox())return;d.set(N,u.getBBox()),u.rotation=Ka(p[w]?.rotation);const{width:R,height:B}=u.getBBox(),P=o?B:R;m[w]<P&&(m[w]=P)});const b=M0(),v=new Map,S=L=>{if(L===0)return 0;let N=m[0];for(let w=1;w<=L;w++)N+=p[w].spacing,w!==L&&(N+=m[w]);return N};l.forEach((L,N)=>{if(N===0)return;const w=x(L,N),O=!L.children.length,R=r-L.depth;if(L.parent){const j=O?L.position:L.position-(L.leafCount-1)/2;if(!v.has(j)){const V=this.depthOptions[R]?.tick;let $=m[0];for(let U=0;U<=R;U++)$+=p[U].spacing,U!==0&&($+=m[U]);v.set(j,{tickSize:$,tickStroke:V?.stroke,tickWidth:V?.enabled!==!1?V?.width:0})}}if(!w)return;const B=Ka(p[R].rotation),{width:P,height:_}=d.get(N),F=S(R);if(u.textAlign="center",u.textBaseline="middle",u.rotation=B,o?(u.y+=(F+oS(P/2,_/2,B))*c,u.rotationCenterX=L.screen,u.rotationCenterY=u.y):(u.x+=F*c+oS((p[R].spacing*c+P)/2,i.mirrored?P:0,B)-P/2,u.rotationCenterX=u.x,u.rotationCenterY=L.screen),p[R].avoidCollisions){const{width:j,height:V}=u.getBBox(),$=o?j:V,U=O?e:L.leafCount*e;if($>U){d.delete(N);return}}const W=u.getPlainText(),H=u.getBoxingProperties();h.push({text:W,visible:!0,tickId:b(W),range:this.scale.range,border:H.border,color:u.fill,cornerRadius:H.cornerRadius,fill:H.fill,fontFamily:u.fontFamily,fontSize:u.fontSize,fontStyle:u.fontStyle,fontWeight:u.fontWeight,padding:H.padding,rotation:u.rotation,rotationCenterX:u.rotationCenterX,rotationCenterY:u.rotationCenterY,textAlign:u.textAlign,textBaseline:u.textBaseline,x:u.x,y:u.y}),d.set(N,Gt.toCanvas(u))});const D=[...v.values()];D.push(D[0]);const C=[this.lineNodeBBox(),de.merge(d.values()),new de(0,0,D[0].tickSize*c,0)];let T=0;if(t.enabled){const L=de.merge(C);T=o?L.height:L.width,C.push(this.titleBBox(this.scale.domain,T))}const k=de.merge(C);return this.layoutCrossLines(),{bbox:k,spacing:T,separatorLayout:D,tickLabelLayout:h}}update(){if(!this.computedLayout)return;this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:e,tick:t,gridLine:i,gridLength:s}=this,{separatorLayout:n,spacing:o}=this.computedLayout,{position:a,horizontal:r,gridPadding:l}=this,c=a==="bottom"||a==="right"?-1:1,h=l,d=c*s-l,u=e.ticks({nice:!1,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0}).ticks.map((p,g)=>({index:g,tickId:pr(p,g),translation:Math.round(e.convert(p))}));this.gridLineGroupSelection.update(i.enabled&&s?this.calculateGridLines(u,h,d):[]),this.gridFillGroupSelection.update(i.enabled&&s?this.calculateGridFills(u,h,d):[]),this.tickLineGroupSelection.update(t.enabled?u.map(({tickId:p,translation:g},f)=>{const{tickSize:x=this.getTickSize(),tickStroke:m=t.stroke,tickWidth:b=t.width}=n[f]??{},v=-c*x,[S,D,C,T]=r?[g,g,0,v]:[0,v,g,g];return{tickId:p,offset:g,x1:S,y1:C,x2:D,y2:T,stroke:m,strokeWidth:b,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateGridFills(),this.updateTickLines(),this.updateTitle(this.scale.domain,o),this.updateCrossLines(),this.resetSelectionNodes()}calculateLayout(){const{separatorLayout:e,tickLabelLayout:t,spacing:i,bbox:s}=this.computeLayout();return this.computedLayout={separatorLayout:e,tickLabelLayout:t,spacing:i},{bbox:s,niceDomain:this.scale.domain}}onGridVisibilityChange(){super.onGridVisibilityChange(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:e}=this,t=this.boundSeries.filter(n=>n.visible).flatMap(n=>n.getDomain(e));this.dataDomain={domain:dl(t)??this.filterDuplicateArrays(t),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(n=>Gf(Fe(n)&&"value"in n?n.value:n));this.tickTreeLayout=h$(i);const s=[];for(const n of this.tickTreeLayout.nodes)n.leafCount||n.refId==null||s.push(this.dataDomain.domain[n.refId]);this.scale.domain=pG(this.dataDomain.domain,s),this.tickScale.domain=i.concat([[""]])}filterDuplicateArrays(e){const t=new Set;return e.filter(i=>{const s=Ue(i)?JSON.stringify(i):i;return t.has(s)?!1:(t.add(s),!0)})}};Bc.className="GroupedCategoryAxis",Bc.type="grouped-category",M([I],Bc.prototype,"depthOptions",2);var u$={2:(e,t)=>Math.log2(t),[Math.E]:(e,t)=>Math.log(t),10:(e,t)=>Math.log10(t)},p$=(e,t)=>Math.log(t)/Math.log(e);function q0(e,t,i){const s=Math.min(...t),n=u$[e]??p$;return s>=0?n(e,i):-n(e,-i)}var g$={[Math.E]:(e,t)=>Math.exp(t),10:(e,t)=>t>=0?10**t:1/10**-t},f$=(e,t)=>e**t;function Q0(e,t,i){const s=Math.min(...t),n=g$[e]??f$;return s>=0?n(e,i):-n(e,-i)}var J0=class v_ extends ft{constructor(t=[1,10],i=[0,1]){super(t,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=s=>q0(this.base,this.domain,s),this.pow=s=>Q0(this.base,this.domain,s)}static is(t){return t instanceof v_}transform(t){const[i,s]=Vi(this.domain);return i>=0!=s>=0?NaN:i>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[i,s]=Vi(this.domain);return i>=0!=s>=0?NaN:i>=0?Math.exp(t):-Math.exp(-t)}toDomain(t){return t}niceDomain(t,i=this.domain){if(i.length<2)return[];const{base:s}=this,[n,o]=i,a=n>o?Math.ceil:Math.floor,r=n>o?Math.floor:Math.ceil,l=Q0(s,i,a(q0(s,i,n))),c=Q0(s,i,r(q0(s,i,o)));return[l,c]}ticks({interval:t,tickCount:i=ft.defaultTickCount},s=this.domain,n){if(!s||s.length<2||i<1)return;const o=this.base,[a,r]=s,l=Math.min(a,r),c=Math.max(a,r);let h=this.log(l),d=this.log(c);if(t){const x=C=>C>=l&&C<=c,m=Math.min(Math.abs(t),Math.abs(d-h)),{ticks:b,count:v,firstTickIndex:S}=Ry(h,d,m,n),D=b.map(this.pow).filter(x);if(!cd(D.length,this.getPixelRange()))return{ticks:D,count:v,firstTickIndex:S}}if(!AG(o)||d-h>=i){const x=Math.min(d-h,i),{ticks:m,count:b,firstTickIndex:v}=Sp(h,d,x,void 0,void 0,n);return{ticks:m.map(this.pow),count:b,firstTickIndex:v}}const u=[],p=l>0;h=Math.floor(h)-1,d=Math.round(d)+1;const g=td(this.range)/i;let f=1/0;for(let x=h;x<=d;x++){const m=this.convert(this.pow(x+1));for(let b=1;b<o;b++){const v=p?b:o-b+1,S=this.pow(x)*v,D=this.convert(S),C=Math.abs(f-D),T=Math.abs(D-m),k=C>=g&&T>=g;S>=l&&S<=c&&(b===1||k||u.length===0)&&(u.push(S),f=D)}}return zL(u,p,n)}},Fc=class Ik extends ft{constructor(){super([0,1],[0,1]),this.type="number"}static is(t){return t instanceof Ik}static getTickStep(t,i,s){const{interval:n,tickCount:o=ft.defaultTickCount,minTickCount:a,maxTickCount:r}=s;return n??Mp(t,i,o,a,r)}toDomain(t){return t}ticks({interval:t,tickCount:i=ft.defaultTickCount,minTickCount:s,maxTickCount:n},o=this.domain,a){if(!o||o.length<2||i<1||!o.every(isFinite))return{ticks:[],count:0,firstTickIndex:0};const[r,l]=o;if(t){const c=Math.abs(t);if(!cd((l-r)/c,this.getPixelRange()))return Ry(r,l,c,a)}return Sp(r,l,i,s,n,a)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{tickCount:s=ft.defaultTickCount}=t;let[n,o]=i;if(s===1)[n,o]=YL(n,o);else if(s>1){const a=n>o?Math.ceil:Math.floor,r=n>o?Math.floor:Math.ceil,l=4;for(let c=0;c<l;c++){const h=n,d=o,u=Ik.getTickStep(n,o,t),[p,g]=i;if(n=a(p/u)*u,o=r(g/u)*u,n===h&&o===d)break}}return[n,o]}},va=class extends Dp{constructor(e,t=new Fc){super(e,t)}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:n}=$0(e,t,i);return{domain:s,clipped:n}}createDatumFormatter(e,t){const{format:i}=this.label;return typeof i=="number"?UL(t,i):void 0}tickFormatParams(e,t,i){return{type:"number",fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:n,legendItemName:o,key:a,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:n,legendItemName:o,key:a,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i}}};va.className="NumberAxis",va.type="number",M([I],va.prototype,"min",2),M([I],va.prototype,"max",2);var Sd=class extends va{normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:n}=$0(e,t,i);return s[0]<0&&s[1]>0||e[0]<0&&e[1]>0?(X.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):s[0]===0||s[1]===0||e[0]===0||e[1]===0?(X.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):{domain:s,clipped:n}}set base(e){this.scale.base=e}get base(){return this.scale.base}constructor(e){super(e,new J0)}};Sd.className="LogAxis",Sd.type="log";var Md=class extends we{constructor(){super(...arguments),this.enabled=!1,this.label=new Dt,this.tick=new Mc}};M([I],Md.prototype,"enabled",2),M([I],Md.prototype,"label",2),M([I],Md.prototype,"tick",2);var Sa=class extends Dp{constructor(e){super(e,new hd),this.parentLevel=new Md,this.min=void 0,this.max=void 0,this.minimumTimeGranularity=void 0}get _unit(){}set _unit(e){X.warnOnce("To use 'unit', use an axis with type 'unit-time' instead of 'time'.")}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}isCategoryLike(){return!1}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}normaliseDataDomain(e){return eM(e,this.min,this.max)}processData(){super.processData();const{boundSeries:e,direction:t,min:i,max:s}=this;this.minimumTimeGranularity=cw(e,t,i,s)}tickFormatParams(e,t,i,s){s??(s=f0(t));const n=y0(e),o=fa(s),a=tl(s),r=xp(s);return{type:"date",unit:o,step:a,epoch:r,truncateDate:n}}datumFormatParams(e,t,i,s,n){if(typeof e=="number"&&(e=new Date(e)),s==null){const{minimumTimeGranularity:x}=this,m=Oy(e);x!=null&&js(x)<js(m)?s=x:s=m}const{datum:o,seriesId:a,legendItemName:r,key:l,source:c,property:h,domain:d,boundSeries:u}=t,p=fa(s),g=tl(s),f=xp(s);return{type:"date",value:e,datum:o,seriesId:a,legendItemName:r,key:l,source:c,property:h,domain:d,boundSeries:u,unit:p,step:g,epoch:f,style:n}}};Sa.className="TimeAxis",Sa.type="time",M([I],Sa.prototype,"parentLevel",2),M([I],Sa.prototype,"min",2),M([I],Sa.prototype,"max",2),M([I,ni("_unit")],Sa.prototype,"unit",2);function cw(e,t,i,s){const n=e.reduce((o,a)=>Math.min(a.minTimeInterval()??1/0,o),1/0);return Number.isFinite(n)?vp(n):hw(e,t,i,s)?.unit}function hw(e,t,i,s){let n=1/0,o=-1/0,a,r=0;const l=[];for(const u of e){if(!u.visible)continue;const{domain:p}=eM(u.getDomain(t),void 0,void 0);if(p.length===0)continue;const g=p[0].valueOf(),f=p[p.length-1].valueOf();l.push(g,f),n=Math.min(n??1/0,g,f),o=Math.max(o??-1/0,g,f);const x=Math.abs(f-g);if(x===0)continue;const m=u.dataCount();if(r=Math.max(r,m),m<=1)continue;const b=x/(m-1);a=Math.min(a??1/0,b)}if(n=Math.min(n,i?.valueOf()??1/0,s?.valueOf()??1/0),o=Math.max(o,i?.valueOf()??-1/0,s?.valueOf()??-1/0),!Number.isFinite(n)||!Number.isFinite(o))return;a??(a=Math.abs(o-n)),a=Math.min(a,y$(l));const c=vp(a);let h=a/js(c);r<=2?h=Math.floor(h):h=Math.round(h),h=Math.max(h,1);const d=h===1?void 0:$n(c,n);return{unit:c,step:h,epoch:d}}function y$(e){e.sort((i,s)=>i-s);let t=1/0;for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i];n-s>0&&(t=Math.min(t,Math.abs(n-s)))}return t}function eM(e,t,i){let s=!1;typeof t=="number"&&(t=new Date(t)),typeof i=="number"&&(i=new Date(i));const n=dl(e)?.map(r=>new Date(r));if(n==null)return{domain:t!=null&&i!=null&&t.valueOf()<=i.valueOf()?[t,i]:[],clipped:!1};let[o,a]=n;return t instanceof Date&&(s||(s=t>o),o=t),i instanceof Date&&(s||(s=i<a),a=i),o>a?{domain:[],clipped:!1}:{domain:[o,a],clipped:s}}var dw=class extends bd{calculateGridLine({index:e,tickId:t,translation:i},s,n,o,a){const{gridLine:r,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridLine({index:e,tickId:t,translation:i},s,n,o,a);const d=a[s-1],u=d?i-(i-d.translation)/2:h[0],[p,g,f,x]=l?[u,Math.max(n,o),u,Math.min(n,o)]:[Math.min(n,o),u,Math.max(n,o),u],{style:m}=r,{stroke:b,strokeWidth:v=0,lineDash:S}=m[e%m.length]??{};return{tickId:t,offset:u,x1:p,y1:g,x2:f,y2:x,stroke:b,strokeWidth:v,lineDash:S}}calculateGridFills(e,t,i){return this.interval.placement!=="between"?super.calculateGridFills(e,t,i):e.map((s,n)=>this.calculateGridFill(s,n,s.index,t,i,e))}calculateGridFill({tickId:e,translation:t},i,s,n,o,a){const{gridLine:r,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridFill({tickId:e,translation:t},i,s,n,o,a);const d=a[i-1],u=a[i+1],p=d?t-(t-d.translation)/2:h[0],g=u?t+(u.translation-t)/2:h[1],[f,x,m,b]=l?[p,Math.max(n,o),g,Math.min(n,o)]:[Math.min(n,o),p,Math.max(n,o),g],{fill:v,fillOpacity:S}=r.style[s%r.style.length]??{};return{tickId:e,x1:f,y1:x,x2:m,y2:b,fill:v,fillOpacity:S}}calculateTickLine({primary:e,tickId:t,translation:i},s,n,o){const{horizontal:a,interval:r,primaryTick:l,range:c,tick:h}=this;if(r.placement!=="between")return super.calculateTickLine({primary:e,tickId:t,translation:i},s,n,o);const d=e&&l?.enabled?l:h,u=-n*this.getTickSize(d),p=o[s-1],g=p?i-(i-p.translation)/2:c[0],[f,x,m,b]=a?[g,0,g,u]:[0,g,u,g],{stroke:v,width:S}=d;return{tickId:t,offset:g,x1:f,y1:x,x2:m,y2:b,stroke:v,strokeWidth:S,lineDash:void 0}}},gl=class extends dw{constructor(e){super(e,new il,!1),this.parentLevel=new Md,this.min=void 0,this.max=void 0,this.unit=void 0,this.defaultUnit=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}isCategoryLike(){return!0}processData(){super.processData();let e;const{domain:t}=this.dataDomain;if(t.length===2&&t[0].valueOf()===t[1].valueOf())e=Oy(t[0]);else{const{boundSeries:i,direction:s,min:n,max:o}=this;e=hw(i,s,n,o)}Ci(this.defaultUnit,e)||(this.defaultUnit=e)}updateScale(){super.updateScale(),this.scale.interval=this.unit??this.defaultUnit}normaliseDataDomain(e){return eM(e,this.min,this.max)}createDatumFormatter(e,t){const i=this.scale.interval,{format:s}=this.label;if(s==null)return;const n=c0(i!=null?BT(s,fa(i)):s,i);if(n!=null)return yc(n)}tickFormatParams(e,t,i,s){s??(s=f0(t));const n=y0(e),o=fa(s),a=tl(s),r=xp(s);return{type:"date",unit:o,step:a,epoch:r,truncateDate:n}}datumFormatParams(e,t,i,s,n){const o=this.unit??this.defaultUnit??"millisecond";e=$n(o,e),typeof e=="number"&&(e=new Date(e)),s??(s=o);const{datum:a,seriesId:r,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p}=t,g=fa(s),f=tl(s),x=xp(s);return{type:"date",value:e,datum:a,seriesId:r,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p,unit:g,step:f,epoch:x,style:n}}};gl.className="UnitTimeAxis",gl.type="unit-time",M([I],gl.prototype,"parentLevel",2),M([I],gl.prototype,"min",2),M([I],gl.prototype,"max",2),M([I],gl.prototype,"unit",2);var Dd={...ur,...md(K),type:Y(Le("number")),label:j0,crosshair:hl(!0)},Ad={...ur,...md(K),type:Y(Le("log")),base:at(zu,Xe(e=>e!==1,"not equal to 1")),label:j0,crosshair:hl(!0)},Id={...ur,...md(Ce(K,Hr),!0),type:Y(Le("time")),label:Kp,parentLevel:gm,crosshair:hl(!0,!0)},kd={...ur,type:Y(Le("category")),label:Yp,paddingInner:pe,paddingOuter:pe,groupPaddingInner:pe,crosshair:hl(),bandHighlight:Zp,interval:{...H0,placement:J("on","between")}},Cd={...ur,type:Y(Le("grouped-category")),label:Yp,crosshair:hl(),bandHighlight:Zp,paddingInner:pe,groupPaddingInner:pe,depthOptions:ui({label:{enabled:z,avoidCollisions:z,wrapping:J("never","always","hyphenate","on-space"),truncate:z,rotation:K,spacing:K,...ht,...Co},tick:{enabled:z,stroke:ae,width:G}},"depth options objects array")},Td={...ur,type:Y(Le("unit-time")),unit:Ce(pm,Up),label:Kp,parentLevel:gm,paddingInner:pe,paddingOuter:pe,groupPaddingInner:pe,crosshair:hl(!0,!0),bandHighlight:Zp,min:at(Ce(K,Hr),_n("max")),max:at(Ce(K,Hr),Gn("min")),interval:W0},m$={type:"axis",name:"number",chartType:"cartesian",options:Dd,create:e=>new va(e)},x$={type:"axis",name:"log",chartType:"cartesian",options:Ad,create:e=>new Sd(e)},b$={type:"axis",name:"time",chartType:"cartesian",options:Id,create:e=>new Sa(e)},v$={type:"axis",name:"category",chartType:"cartesian",options:kd,create:e=>new bd(e)},S$={type:"axis",name:"grouped-category",chartType:"cartesian",options:Cd,create:e=>new Bc(e)},M$={type:"axis",name:"unit-time",chartType:"cartesian",options:Td,create:e=>new gl(e)},Ld={...ur,type:Y(Le("ordinal-time")),paddingInner:pe,paddingOuter:pe,groupPaddingInner:pe,label:Kp,parentLevel:gm,interval:W0,crosshair:hl(!0,!0),bandHighlight:Zp},uw={...Rc,...md(K),type:Y(Le("angle-number")),crossLines:ui(ba),startAngle:K,endAngle:K,label:{...dr,orientation:J("fixed","parallel","perpendicular"),format:Fo}},D$={innerRadiusRatio:pe},pw={...Rc,...D$,type:Y(Le("angle-category")),shape:J("polygon","circle"),crossLines:ui(ba),startAngle:K,endAngle:K,paddingInner:pe,groupPaddingInner:pe,label:{...dr,orientation:J("fixed","parallel","perpendicular")}},gw={...Rc,...md(K),type:Y(Le("radius-number")),shape:J("polygon","circle"),positionAngle:K,innerRadiusRatio:pe,crossLines:ui({...ba,label:{...Pc,positionAngle:K}},"cross-line options"),title:{enabled:z,text:E,spacing:G,formatter:rt,...ht},label:{...dr,format:Fo}},fw={...Rc,type:Y(Le("radius-category")),positionAngle:K,innerRadiusRatio:pe,paddingInner:pe,paddingOuter:pe,groupPaddingInner:pe,label:dr,crossLines:ui({...ba,label:{...Pc,positionAngle:K}},"cross-line options"),title:{enabled:z,text:E,spacing:G,formatter:rt,...ht}},yw=si(Ct,Ct),mw={showInMiniChart:z,connectMissingData:z,interpolation:lm,label:pt,marker:cr,tooltip:tt,shadow:xa,...Ke,...ue,...se,...fe,highlight:yw},xw={...mw,...zo,highlight:yw,type:Y(Le("area")),xKey:Y(E),yKey:Y(E),xName:E,yName:E,stacked:z,stackGroup:E,normalizedTo:K},bw=si(ra,ra),tM={direction:J("horizontal","vertical"),showInMiniChart:z,cornerRadius:G,itemStyler:bt({...ue,...se,...fe,cornerRadius:G}),crisp:z,label:{...pt,placement:J("inside-center","inside-start","inside-end","outside-start","outside-end"),spacing:G},errorBar:Hp,shadow:xa,tooltip:tt,...Ke,highlight:bw,...ue,...se,...fe};tM.sparklineMode=me(z);var vm={...tM,...zo,highlight:bw,type:Y(Le("bar")),xKey:Y(E),yKey:Y(E),xName:E,yName:E,direction:J("horizontal","vertical"),grouped:z,stacked:z,stackGroup:E,normalizedTo:K,legendItemName:E,errorBar:rm};vm.pickOutsideVisibleMinorAxis=me(z),vm.focusPriority=me(K);var vw={title:E,domain:Ae(K),maxSize:G,showInMiniChart:z,label:{placement:J("top","right","bottom","left"),...pt},tooltip:tt,maxRenderedItems:K,...Ke,...ce(cr,["enabled"]),highlight:si(Ct,Ct)},A$={...vw,...zo,type:Y(Le("bubble")),xKey:Y(E),yKey:Y(E),sizeKey:Y(E),labelKey:E,xName:E,yName:E,sizeName:E,labelName:E,highlight:si(Ct,Ct)},Sw={showInMiniChart:z,cornerRadius:G,label:pt,tooltip:tt,shadow:xa,...Ke,...ue,...se,...fe,highlight:si(Ct,Ct)},I$={...zo,...Sw,type:Y(Le("histogram")),xKey:Y(E),yKey:E,xName:E,yName:E,areaPlot:z,aggregation:J("count","sum","mean"),bins:Ae(Ae(K)),binCount:G},Mw=si(Ct,ac),iM={title:E,showInMiniChart:z,connectMissingData:z,interpolation:lm,label:pt,marker:cr,tooltip:tt,errorBar:Hp,...Ke,...se,...fe,highlight:Mw};iM.sparklineMode=me(z);var Sm={...iM,...zo,highlight:Mw,type:Y(Le("line")),xKey:Y(E),yKey:Y(E),xName:E,yName:E,stacked:z,stackGroup:E,normalizedTo:K,legendItemName:E,errorBar:rm};Sm.pickOutsideVisibleMinorAxis=me(z),Sm.focusPriority=me(K);var Dw={title:E,showInMiniChart:z,label:{placement:J("top","right","bottom","left"),...pt},tooltip:tt,errorBar:Hp,maxRenderedItems:K,...Ke,...ce(cr,["enabled"]),highlight:si(Ct,Ct)},k$={...Dw,...zo,type:Y(Le("scatter")),xKey:Y(E),yKey:Y(E),labelKey:E,xName:E,yName:E,labelName:E,errorBar:rm,highlight:si(Ct,Ct)},Aw=si(Ct,Ct),sM={...Ke,radiusMin:G,radiusMax:G,rotation:K,outerRadiusOffset:K,outerRadiusRatio:pe,hideZeroValueSectorsInLegend:z,sectorSpacing:G,cornerRadius:G,itemStyler:bt({...ue,...se,...fe,cornerRadius:G}),title:{enabled:z,text:E,showInLegend:z,spacing:G,...ht},calloutLabel:{enabled:z,offset:K,minAngle:G,avoidCollisions:z,formatter:rt,format:E,itemStyler:bt({enabled:z,...Co,...ht}),...Co,...ht},sectorLabel:{enabled:z,positionOffset:K,positionRatio:pe,formatter:rt,format:E,itemStyler:bt({enabled:z,...Co,...ht}),...Co,...ht},calloutLine:{colors:Ae(ae),length:G,strokeWidth:G},fills:Ae(Vn),strokes:Ae(ae),tooltip:tt,shadow:xa,highlight:Aw,...fe,...ce(ue,["fill"]),...ce(se,["stroke"])},zc={...sM,...zo,type:Y(Le("pie")),angleKey:Y(E),radiusKey:E,calloutLabelKey:E,sectorLabelKey:E,legendItemKey:E,angleName:E,radiusName:E,calloutLabelName:E,sectorLabelName:E,highlight:Aw};zc.defaultColorRange=me(Ae(Ae(ae))),zc.defaultPatternFills=me(Ae(ae)),zc.title._enabledFromTheme=me(z),zc.calloutLabel._enabledFromTheme=me(z),zc.sectorLabel._enabledFromTheme=me(z);var Iw={...sM,innerRadiusOffset:K,innerRadiusRatio:pe,innerCircle:{fill:E,fillOpacity:pe},innerLabels:{spacing:G,...ht,...Co}},C$={...Iw,...zc,type:Y(Le("donut")),innerLabels:ui({text:Y(E),spacing:G,...ht,...Co},"inner label options array")},wd={lineStyle:J("solid","dashed","dotted"),...fe},_c={...ue,...se,...fe},Jp={visible:z,locked:z,handle:_c,...ht},Mm={position:J("top","center","bottom"),alignment:J("left","center","right"),...ht},kw={position:J("top","inside","bottom"),alignment:J("left","center","right"),...ht},T$={enabled:z,cornerRadius:G,formatter:rt,...ht,...ue,...se,...fe},L$={visible:z,...wd,...se},Cw={divider:se,...ue,...se,...ht},Tw={handle:_c,statistics:Cw,...wd,...ue,...se},Dm={visible:z,locked:z,extendStart:z,extendEnd:z,handle:_c,text:Mm,...wd,...se},nM={visible:z,locked:z,axisLabel:T$,handle:_c,text:Mm,...wd,...se},oM={visible:z,locked:z,extendStart:z,extendEnd:z,handle:_c,text:kw,background:ue,...wd,...se},Lw={...oM},ww={...oM,middle:L$},aM={label:ht,showFill:z,isMultiColor:z,strokes:Ae(ae),rangeStroke:ae,bands:J(4,6,10),...Dm},Nw={...ue,...se,...Jp},Ew={...ue,...se,...Jp},Ow={...ue,...se,...Jp,background:{...ue,...se}},rM={visible:z,locked:z,handle:_c,...ue},Am={visible:z,locked:z,extendStart:z,extendEnd:z,handle:_c,text:Mm,background:ue,statistics:Cw,...wd,...se},Pw={visible:z,up:Tw,down:Tw},Nd={enabled:z,axesButtons:{enabled:z,axes:J("x","y","xy")},toolbar:{enabled:z,padding:G,buttons:ui({...Oc,value:J("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:z,buttons:Ae(Ce(_t({...Oc,value:Y(J("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),_t({...Oc,value:Y(J("lock")),checkedOverrides:Oc})))}};Nd.data=me(ko),Nd.xKey=me(E),Nd.volumeKey=me(E),Nd.snap=me(z);var lM={...ue,...se,...fe,cornerRadius:G,whisker:{...se,...fe},cap:{lengthRatio:pe}},cM={...lM,opacity:pe},Rw={direction:J("horizontal","vertical"),showInMiniChart:z,itemStyler:bt({...ue,...se,...fe,cornerRadius:G,whisker:{...se,...fe},cap:{lengthRatio:pe}}),tooltip:tt,...Ke,...lM,highlight:si(cM,cM)},hM={cornerRadius:G,wick:{...se,...fe},...ue,...se,...fe},Bw={...hM,opacity:pe},Fw={item:{up:hM,down:hM},itemStyler:bt({...ue,...se,...fe,cornerRadius:G,wick:{...se,...fe}}),showInMiniChart:z,tooltip:tt,...Ke,highlight:si(Bw,Bw)},zw={fills:Ae(Vn),strokes:Ae(ae),label:{spacing:G,maxWidth:G,...pt},link:{tension:pe,itemStyler:bt({...ue,...se,...fe,tension:pe}),...ue,...se,...fe},node:{width:G,spacing:G,itemStyler:bt({...ue,...se,...fe}),...ue,...se,...fe},tooltip:tt,...Ke},_w={direction:J("horizontal","vertical"),fills:Ae(Vn),strokes:Ae(ae),label:{spacing:G,placement:J("before","middle","after"),...pt},stageLabel:{placement:J("before","after"),format:Fo,...dr},tooltip:tt,...ce(Ke,["showInLegend"]),...ce(ue,["fill"]),...ce(se,["stroke"]),...fe,highlight:Uk(ac)},Gw={direction:J("horizontal","vertical"),fills:Ae(Vn),strokes:Ae(ae),itemStyler:bt({...ue,...se,...fe}),spacingRatio:pe,crisp:z,dropOff:{enabled:z,...ue,...se,...fe},stageLabel:{placement:J("before","after"),format:Fo,...dr},label:pt,tooltip:tt,shadow:xa,...ce(Ke,["showInLegend"]),...ce(ue,["fill"]),...ce(se,["stroke"]),...fe},Vw={title:E,textAlign:J("left","center","right"),verticalAlign:J("top","middle","bottom"),itemPadding:G,itemStyler:bt({...ue,...se}),showInMiniChart:z,label:ll,tooltip:tt,...Ke,...se},jw={showInMiniChart:z,itemStyler:bt({...se,...fe}),item:{up:{...se,...fe},down:{...se,...fe}},tooltip:tt,...Ke,highlight:si(ac,ac)},Hw={maxStrokeWidth:G,itemStyler:bt({...se,...fe}),sizeDomain:Ae(G),label:pt,tooltip:tt,...Ke,...se,...fe,highlightStyle:{...Ke.highlightStyle,...se},highlight:si(ac,ac)},Ww={...se,...fe},$w={colorRange:Ae(ae),maxSize:G,sizeDomain:Ae(G),label:{placement:J("top","bottom","left","right"),...pt},tooltip:tt,...Ke,...ce(cr,["enabled"]),highlightStyle:{...Ke.highlightStyle,...ue,...se},highlight:si(Ct,Ct)},Uw={colorRange:Ae(ae),padding:G,itemStyler:bt({...ue,...se,...fe}),label:ll,tooltip:tt,...Ke,...ue,...se,...fe,highlightStyle:{...Ke.highlightStyle,...ue,...se},highlight:si(Ct,Ct)},Yw={...Ke,...ue,...se,...fe},Kw={cornerRadius:G,itemStyler:bt({...ue,...se,...fe,cornerRadius:G}),label:pt,tooltip:tt,...Ke,...ue,...se,...fe,highlight:si(ra,ra)},Zw={direction:J("horizontal","vertical"),aspectRatio:G,spacing:G,reverse:z,itemStyler:bt({...ue,...se,...fe}),fills:Ae(Vn),strokes:Ae(ae),label:pt,stageLabel:{spacing:G,placement:J("before","after"),...pt},tooltip:tt,shadow:xa,...Ke,...ce(ue,["fill"]),...ce(se,["stroke"]),...fe},Xw={connectMissingData:z,marker:cr,label:pt,tooltip:tt,...Ke,...ue,...se,...fe,highlight:si(Ct,Ct)},qw={connectMissingData:z,marker:cr,label:pt,tooltip:tt,...Ke,...se,...fe,highlight:si(Ct,ac)},Qw={cornerRadius:G,itemStyler:bt({...ue,...se,...fe,cornerRadius:G}),label:pt,tooltip:tt,...Ke,...ue,...se,...fe,highlight:si(ra,ra)},Jw={cornerRadius:G,columnWidthRatio:pe,maxColumnWidthRatio:pe,itemStyler:bt({...ue,...se,...fe,cornerRadius:G}),label:pt,tooltip:tt,...Ke,...ue,...se,...fe,highlight:si(ra,ra)},eN={showInMiniChart:z,connectMissingData:z,interpolation:lm,label:{...pt,placement:J("inside","outside"),spacing:G},marker:cr,tooltip:tt,shadow:xa,...Ke,...ue,...se,...fe,highlight:si(Ct,Ct)},tN={direction:J("horizontal","vertical"),grouped:z,showInMiniChart:z,cornerRadius:G,itemStyler:bt({...ue,...se,...fe,cornerRadius:G}),label:{...pt,placement:J("inside","outside"),spacing:G},tooltip:tt,shadow:xa,...Ke,...ue,...se,...fe,highlight:si(ra,ra)},iN={fills:Ae(Vn),strokes:Ae(ae),label:{...pt,spacing:G},link:{itemStyler:bt({...ue,...se,...fe}),...ue,...se,...fe},node:{width:G,spacing:G,alignment:J("left","center","right","justify"),itemStyler:bt({...ue,...se,...fe}),...ue,...se,...fe},tooltip:tt,...Ke},sN={fills:Ae(Vn),strokes:Ae(ae),colorRange:Ae(ae),sectorSpacing:G,cornerRadius:G,padding:G,itemStyler:bt({...ue,...se}),label:{spacing:G,...ll},secondaryLabel:ll,tooltip:tt,...ce(Ke,["highlight","showInLegend"]),...ce(ue,["fill"]),...ce(se,["stroke"]),highlightStyle:{label:{color:ae},secondaryLabel:{color:ae},...ue,...se}},nN={fills:Ae(Vn),strokes:Ae(ae),colorRange:Ae(ae),itemStyler:bt({...ue,...se}),group:{gap:G,padding:G,cornerRadius:G,textAlign:J("left","center","right"),interactive:z,label:{...pt,spacing:G},...ue,...se},tile:{gap:G,padding:G,cornerRadius:G,textAlign:J("left","center","right"),verticalAlign:J("top","middle","bottom"),label:{...pt,spacing:G,lineHeight:G,minimumFontSize:G,wrapping:J("never","always","hyphenate","on-space"),overflowStrategy:J("ellipsis","hide")},secondaryLabel:{...pt,lineHeight:G,minimumFontSize:G,wrapping:J("never","always","hyphenate","on-space"),overflowStrategy:J("ellipsis","hide")},...ue,...se},tooltip:tt,...ce(Ke,["highlight","showInLegend"]),highlightStyle:{group:{label:{color:ae},...ue,...se},tile:{label:{color:ae},secondaryLabel:{color:ae},...ue,...se}}},dM={name:E,cornerRadius:G,itemStyler:bt({...ue,...se,...fe,cornerRadius:G}),label:{...pt,placement:J("inside-start","inside-center","inside-end","outside-start","outside-end"),spacing:G},tooltip:tt,shadow:xa,...ue,...se,...fe},oN={direction:J("horizontal","vertical"),showInMiniChart:z,item:{positive:dM,negative:dM,total:dM},line:{enabled:z,...se,...fe},tooltip:tt,...Ke},Im=_t({__type:Y(Le("date")),value:Ce(E,K)},"a serializable date object"),aN={width:G,height:G,grip:z,fill:ae,stroke:ae,strokeWidth:G,cornerRadius:G},st={enabled:z,height:G,spacing:G,cornerRadius:K,mask:{fill:ae,fillOpacity:pe,stroke:ae,strokeWidth:G},minHandle:aN,maxHandle:aN,miniChart:{enabled:z,padding:{top:G,bottom:G},label:{enabled:z,avoidCollisions:z,spacing:G,format:Fo,formatter:rt,interval:{minSpacing:G,maxSpacing:G,values:ko,step:K},...ht},series:Te}},ws={number:{...ce(Dd,["type","crossLines"]),top:ce(Dd,["type","crossLines","position"]),right:ce(Dd,["type","crossLines","position"]),bottom:ce(Dd,["type","crossLines","position"]),left:ce(Dd,["type","crossLines","position"]),crossLines:ce(hr,["type"])},log:{...ce(Ad,["type","crossLines"]),top:ce(Ad,["type","crossLines","position"]),right:ce(Ad,["type","crossLines","position"]),bottom:ce(Ad,["type","crossLines","position"]),left:ce(Ad,["type","crossLines","position"]),crossLines:ce(hr,["type"])},category:{...ce(kd,["type","crossLines"]),top:ce(kd,["type","crossLines","position"]),right:ce(kd,["type","crossLines","position"]),bottom:ce(kd,["type","crossLines","position"]),left:ce(kd,["type","crossLines","position"]),crossLines:ce(hr,["type"])},time:{...ce(Id,["type","crossLines"]),top:ce(Id,["type","crossLines","position"]),right:ce(Id,["type","crossLines","position"]),bottom:ce(Id,["type","crossLines","position"]),left:ce(Id,["type","crossLines","position"]),crossLines:ce(hr,["type"])},"unit-time":{...ce(Td,["type","crossLines"]),top:ce(Td,["type","crossLines","position"]),right:ce(Td,["type","crossLines","position"]),bottom:ce(Td,["type","crossLines","position"]),left:ce(Td,["type","crossLines","position"]),crossLines:ce(hr,["type"])},"grouped-category":{...ce(Cd,["type"]),top:ce(Cd,["type","position"]),right:ce(Cd,["type","position"]),bottom:ce(Cd,["type","position"]),left:ce(Cd,["type","position"]),crossLines:ce(hr,["type"])},"ordinal-time":{...ce(Ld,["type","crossLines"]),top:ce(Ld,["type","crossLines","position"]),right:ce(Ld,["type","crossLines","position"]),bottom:ce(Ld,["type","crossLines","position"]),left:ce(Ld,["type","crossLines","position"]),crossLines:ce(hr,["type"])}},Ed={"angle-category":{...ce(pw,["type","crossLines"]),crossLines:ce(ba,["type"])},"angle-number":{...ce(uw,["type","crossLines"]),crossLines:ce(ba,["type"])},"radius-category":{...ce(fw,["type","crossLines"]),crossLines:{...ce(ba,["type"]),label:{...Pc,positionAngle:K}}},"radius-number":{...ce(gw,["type","crossLines"]),crossLines:{...ce(ba,["type"]),label:{...Pc,positionAngle:K}}}},ct={visible:z},w$={common:{...Ne,navigator:st,axes:{...ws,...Ed},annotations:{...Nd,line:Dm,"horizontal-line":nM,"vertical-line":nM,"disjoint-channel":Lw,"parallel-channel":ww,"fibonacci-retracement":aM,"fibonacci-retracement-trend-based":aM,callout:Nw,comment:Ew,note:Ow,text:Jp,arrow:Dm,"arrow-up":rM,"arrow-down":rM,"date-range":Am,"price-range":Am,"date-price-range":Am,"quick-date-price-range":Pw},chartToolbar:{enabled:z},initialState:{legend:ui({visible:z,seriesId:E,itemId:E,legendItemName:E},"legend state array"),zoom:{rangeX:{start:Ce(K,Im),end:Ce(K,Im)},rangeY:{start:Ce(K,Im),end:Ce(K,Im)},ratioX:{start:pe,end:pe},ratioY:{start:pe,end:pe},autoScaledAxes:Ae(Le("y"))}}},line:{...Ne,axes:ws,series:iM,navigator:st,...ct},scatter:{...Ne,axes:ws,series:Dw,navigator:st,...ct},bubble:{...Ne,axes:ws,series:vw,navigator:st,...ct},area:{...Ne,axes:ws,series:mw,navigator:st,...ct},bar:{...Ne,axes:ws,series:tM,navigator:st,...ct},"box-plot":{...Ne,axes:ws,series:Rw,navigator:st,...ct},candlestick:{...Ne,axes:ws,series:Fw,navigator:st,...ct},"cone-funnel":{...Ne,axes:ws,series:_w,navigator:st,...ct},funnel:{...Ne,axes:ws,series:Gw,navigator:st,...ct},ohlc:{...Ne,axes:ws,series:jw,navigator:st,...ct},histogram:{...Ne,axes:ce(ws,["category","grouped-category","unit-time","ordinal-time"]),series:Sw,navigator:st,...ct},heatmap:{...Ne,axes:ws,series:Vw,navigator:st,...ct},waterfall:{...Ne,axes:ws,series:oN,navigator:st,...ct},"range-bar":{...Ne,axes:ws,series:tN,navigator:st,...ct},"range-area":{...Ne,axes:ws,series:eN,navigator:st,...ct},donut:{...Ne,series:Iw,navigator:st,...ct},pie:{...Ne,series:sM,navigator:st,...ct},"radar-line":{...Ne,axes:Ed,series:qw,navigator:st,...ct},"radar-area":{...Ne,axes:Ed,series:Xw,navigator:st,...ct},"radial-bar":{...Ne,axes:Ed,series:Qw,navigator:st,...ct},"radial-column":{...Ne,axes:Ed,series:Jw,navigator:st,...ct},nightingale:{...Ne,axes:Ed,series:Kw,navigator:st,...ct},sunburst:{...Ne,series:sN,navigator:st,...ct},treemap:{...Ne,series:nN,navigator:st,...ct},"map-shape":{...Ne,series:Uw,navigator:st,...ct},"map-line":{...Ne,series:Hw,navigator:st,...ct},"map-marker":{...Ne,series:$w,navigator:st,...ct},"map-shape-background":{...Ne,series:Yw,navigator:st,...ct},"map-line-background":{...Ne,series:Ww,navigator:st,...ct},sankey:{...Ne,series:iN,navigator:st,...ct},chord:{...Ne,series:zw,navigator:st,...ct},pyramid:{...Ne,series:Zw,navigator:st,...ct},"radial-gauge":{...Ne,...um,targets:ce(hm,["value"]),tooltip:{...um.tooltip,...Ne.tooltip}},"linear-gauge":{...Ne,...dm,targets:ce(cm,["value"]),tooltip:{...dm.tooltip,...Ne.tooltip}}};function km(e,t){const i={};for(const s of Reflect.ownKeys(e))i[s]=t(e[s],s,e);return i}var N$=km(w$,function e(t,i){if(Lf(i))return t;if($a(t))return Ce(t,Pf,Lf);if(Fe(t))return Ce(_t(Nf in t?km(t,s=>Fe(s)?km(s,e):s):km(t,e)),Pf,Lf);throw new Error(`Invalid theme override value: ${String(t)}`)}),us={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Gc={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},E$=class extends yd{getDefaultColors(){return{fills:us,fillsFallback:Object.values(us),strokes:Gc,sequentialColors:Dn(us),divergingColors:[us.ORANGE,us.YELLOW,us.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[us.GREEN,us.YELLOW,us.RED],secondHierarchyColors:[],up:{fill:us.GREEN,stroke:Gc.GREEN},down:{fill:us.RED,stroke:Gc.RED},neutral:{fill:us.GRAY,stroke:Gc.GRAY},altUp:{fill:us.BLUE,stroke:Gc.BLUE},altDown:{fill:us.ORANGE,stroke:Gc.ORANGE},altNeutral:{fill:us.GRAY,stroke:Gc.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Wt,us.BLUE),e.set(Ni,us.BLUE),e}},ps={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Vc={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},O$=class extends Ro{getDefaultColors(){return{...super.getDefaultColors(),fills:ps,fillsFallback:Object.values(ps),strokes:Vc,sequentialColors:Dn(ps),divergingColors:[ps.ORANGE,ps.YELLOW,ps.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[ps.GREEN,ps.YELLOW,ps.RED],secondHierarchyColors:[],up:{fill:ps.GREEN,stroke:Vc.GREEN},down:{fill:ps.RED,stroke:Vc.RED},neutral:{fill:ps.GRAY,stroke:Vc.GRAY},altUp:{fill:ps.BLUE,stroke:Vc.BLUE},altDown:{fill:ps.ORANGE,stroke:Vc.ORANGE},altNeutral:{fill:ps.GRAY,stroke:Vc.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Wt,ps.BLUE),e.set(Ni,ps.BLUE),e}},uM=as(()=>new Ro),P$=Be.create(!0,"perf"),_o=(e,t,i)=>{P$("[CACHE] ChartTheme",e,t.name,i)},pM={"ag-default-dark":as(()=>new yd),"ag-sheets-dark":as(()=>new _W,_o),"ag-polychroma-dark":as(()=>new FW,_o),"ag-vivid-dark":as(()=>new E$,_o),"ag-material-dark":as(()=>new RW,_o),"ag-financial-dark":as(()=>new OW,_o),"ag-default":uM,"ag-sheets":as(()=>new GW,_o),"ag-polychroma":as(()=>new zW,_o),"ag-vivid":as(()=>new O$,_o),"ag-material":as(()=>new BW,_o),"ag-financial":as(()=>new PW,_o)},Cm=as(R$,_o);function R$(e){if(e instanceof Ro)return e;if(!_$(e))return uM();if(e==null||typeof e=="string"){const n=pM[e??"ag-default"];if(n)return n();throw new Error(`Cannot find theme \`${e}\`.`)}const{cleared:t,invalid:i}=ss(B$(e),F$,"theme");for(const n of i)X.warnOnce(String(n));const s=t?.baseTheme?Cm(t.baseTheme):uM();return t?new s.constructor(t):s}function B$(e){if(!Fe(e)||!Fe(e.baseTheme))return e;let t=e,i,s;const n=[];for(;typeof t=="object";)i??(i=t.palette),s??(s=t.params),t.overrides&&n.push(t.overrides),t=t.baseTheme;return{baseTheme:t,overrides:et(...n),params:s,palette:i}}var F$={baseTheme:Ce(E,Of),overrides:N$,params:{accentColor:ae,axisColor:ae,backgroundColor:ae,borderColor:ae,borderRadius:K,chartBackgroundColor:ae,chartPadding:K,focusShadow:E,foregroundColor:ae,fontFamily:_v,fontSize:K,fontWeight:Ce(E,K),gridLineColor:ae,popupShadow:E,subtleTextColor:ae,textColor:ae,chromeBackgroundColor:ae,chromeFontFamily:_v,chromeFontSize:K,chromeFontWeight:Ce(E,K),chromeSubtleTextColor:ae,chromeTextColor:ae,buttonBackgroundColor:ae,buttonBorder:z,buttonFontWeight:K,buttonTextColor:ae,inputBackgroundColor:ae,inputBorder:z,inputTextColor:ae,menuBackgroundColor:ae,menuBorder:z,menuTextColor:ae,panelBackgroundColor:ae,panelSubtleTextColor:ae,tooltipBackgroundColor:ae,tooltipBorder:z,tooltipTextColor:ae,tooltipSubtleTextColor:ae,crosshairLabelBackgroundColor:ae,crosshairLabelTextColor:ae},palette:{fills:Ae(Vn),strokes:Ae(ae),up:{fill:Ce(ae,zv),stroke:ae},down:{fill:Ce(ae,zv),stroke:ae},neutral:{fill:Ce(ae,zv),stroke:ae}}},z$=J("ag-default","ag-default-dark","ag-sheets","ag-sheets-dark","ag-polychroma","ag-polychroma-dark","ag-vivid","ag-vivid-dark","ag-material","ag-material-dark","ag-financial","ag-financial-dark");function _$(e){const{invalid:t}=ss({theme:e},{theme:Ce(z$,Of)});for(const i of t)X.warnOnce(String(i));return t.length===0}var fl={isEnterprise:!1},Wi="path",Go="pathArray",$i="default",Vo="override",Od="user",eg="operation",tg="operationValue",gM="dependency",fM="autoEnable",rN="autoEnableValue";function yM(e){return di(e)&&e>=0&&e<=1}function ig(e,t){let i=e;for(const s of t){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return!1;i=i[s]}return!0}function jo(e,t){let i=e;for(const s of t){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return;i=i[s]}return i}function mM(e,t,i){const s=t.length;if(s===0)return;let n=e;const o=s-1,a=t[o];for(let r=0;r<o;r++){const l=t[r],c=t[r+1];let h=n[l];(h==null||!Tf(h))&&(h=isNaN(Number(c))?{}:[],n[l]=h),n=h}n[a]=i}var G$=/^\d+$/;function lN(e){for(let t=e.length-1;t>=0;t--){const i=e[t];if(G$.test(i))return t}return-1}function sg(e){const t=lN(e);return Number(e[t])}function jc(e,t,i){const s=t.split("/");let n=[...e];t.startsWith("/")&&(n=[],s.shift());let o=!1;for(const a of s){if(a==="..")n.pop(),o||n.pop();else if(a===".")n.pop();else if(a==="$index"){const r=sg(e);if(isNaN(r))return Ma;n.push(`${r}`)}else if(a==="$prevIndex"){const r=sg(e);if(isNaN(r)||Number(r)<=0)return Ma;n.push(`${Number(r)-1}`)}else if(a.startsWith("$")){const r=i?.[a.slice(1)];if(r==null)return Ma;n.push(r)}else a.length!==0&&n.push(a);o=a===".."}return n}var Ma=Symbol("unresolvable-path"),yl=Symbol("resolved-to-branch");function Pd(e,t){if(e==null||typeof e!="object"||Array.isArray(e)||(t??(t=Object.keys(e)),t.length===0))return;const i=t[0];if(uN.has(i))return{operation:i,values:Array.isArray(e[i])?e[i]:[e[i]]}}function V$(e,t,i){const s=Pd(e.getVertexValue(i));switch(s?.operation){case"$path":{const[n]=s.values,o=e.getPathArray(t),a=jc(o,n);return a===Ma?void 0:e.findVertexAtPath(a)}case"$value":return t}}var j$={$hasSeriesType:{dependencies:xM,resolve:H$},$isChartType:{dependencies:xM,resolve:$$},$isSeriesType:{dependencies:xM,resolve:W$}};function xM(e,t,i){const s=e.findVertexAtPath(["series","0","type"]);s&&e.addEdge(t,s,gM)}function H$(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),o=e.getResolvedPath(["series"]);if(!Array.isArray(o))return!1;for(const a of o)if(a.type===n)return!0;return!1}function W$(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return e.getResolvedPath(["series","0","type"])===n}function $$(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),o=e.getResolvedPath(["series","0","type"]);if(typeof o!="string")return!1;switch(n){case"cartesian":return ji.isCartesian(o);case"polar":return ji.isPolar(o);case"standalone":return ji.isStandalone(o)}return!1}var U$={$foregroundBackgroundMix:Y$,$foregroundOpacity:K$,$interpolate:Z$,$isGradient:X$,$isImage:q$,$isPattern:Q$,$mix:J$};function Y$(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),o=e.getParamValue("foregroundColor"),a=e.getParamValue("backgroundColor");if(typeof o=="string"&&typeof a=="string"&&yM(n))return gt.mix(gt.fromString(o),gt.fromString(a),1-n).toString();Be.inDevelopmentMode(()=>X.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(n)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function K$(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),o=e.getParamValue("foregroundColor");if(typeof o=="string"&&yM(n)){const a=gt.fromString(o);return new gt(a.r,a.g,a.b,n).toString()}Be.inDevelopmentMode(()=>X.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(n)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function Z$(e,t,i){const[s,n]=i,o=e.resolveVertexValue(t,s),a=e.resolveVertexValue(t,n);if(!(!Ue(o)||!di(a)))return gt.interpolate(o.map(r=>gt.fromString(r)),a).map(r=>r.toString())}function X$(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return To(n)}function q$(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return gc(n)}function Q$(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Yr(n)}function J$(e,t,i){const[s,n,o]=i,a=e.resolveVertexValue(t,s),r=e.resolveVertexValue(t,n),l=e.resolveVertexValue(t,o),c=e.getPathArray(t),h=`\`$mix\` json operation failed on [${String(a)}, ${String(r)}, ${String(l)}] at [${c.join(".")}], expecting`,d=`${h} two colors and a number between 0 and 1.`;if(typeof r!="string"||!yM(l)){Be.inDevelopmentMode(()=>X.warnOnce(d));return}if(typeof a=="string")try{return gt.mix(gt.fromString(a),gt.fromString(r),l).toString()}catch{Be.inDevelopmentMode(()=>X.warnOnce(d));return}if(!To(a)){Be.inDevelopmentMode(()=>X.warnOnce(d));return}let u=a.colorStops;try{u=u?.map(p=>{let g;return typeof p.color=="string"&&(g=gt.mix(gt.fromString(p.color),gt.fromString(r),l).toString()),{...p,color:g}})}catch{Be.inDevelopmentMode(()=>X.warnOnce(`${h} a gradient, a color and a number between 0 and 1.`));return}return{...a,colorStops:u}}var eU={$rem:tU};function tU(e,t,i){const[s]=i,n=e.getVertexValue(s),o=e.getParamValue("fontSize");if(typeof o=="number"&&typeof n=="number")return Math.round(n*o);Be.inDevelopmentMode(()=>X.warnOnce(`\`$rem\` json operation failed on [${String(n)}] at [${e.getPathArray(t).join(".")}], expecting a number.`))}var iU={$and:sU,$eq:nU,$greaterThan:oU,$if:aU,$lessThan:rU,$not:lU,$or:cU,$switch:hU};function sU(e,t,i){for(const s of i)if(!e.resolveVertexValue(t,s))return!1;return!0}function nU(e,t,i){let s,n=!0;for(const o of i){const a=e.resolveVertexValue(t,o);if(n)s=a,n=!1;else if(a!==s)return!1}return!0}function oU(e,t,i){const[s,n]=i;return e.resolveVertexValue(t,s)>e.resolveVertexValue(t,n)}function aU(e,t,i){const[s,n,o]=i,r=e.resolveVertexValue(t,s)?n:o,l=e.neighboursWithEdgeValue(r,Wi);if(l)for(const c of l)e.addEdge(t,c,Wi);return e.resolveVertexValue(t,r)}function rU(e,t,i){const[s,n]=i;return e.resolveVertexValue(t,s)<e.resolveVertexValue(t,n)}function lU(e,t,i){for(const s of i)return!e.resolveVertexValue(t,s)}function cU(e,t,i){for(const s of i)if(e.resolveVertexValue(t,s))return!0;return!1}function hU(e,t,i){const[s,n,...o]=i,a=e.resolveVertexValue(t,s);for(const r of o){const l=e.getVertexValue(r);if(!Array.isArray(l))continue;const[c,h]=l;if(a===c||Array.isArray(c)&&c.includes(a))return h}return e.getVertexValue(n)}var dU={$isUserOption:uU,$isThemeOverride:pU,$palette:gU,$mapPalette:fU,$path:{dependencies:dN,resolve:yU},$pathString:{dependencies:dN,resolve:mU},$ref:xU};function uU(e,t,i){const[s,n,o]=i,a=e.neighboursWithEdgeValue(s,Wi);if(a)for(const r of a){const l=e.findNeighbour(r,$i);if(l&&cN(e,t,l))return e.resolveVertexValue(t,n)}else if(cN(e,t,s))return e.resolveVertexValue(t,n);return e.resolveVertexValue(t,o)}function cN(e,t,i){const s=e.resolveVertexValue(t,i);if(!ki(s))throw new Error(`\`$isUserOption\` json operation failed on [${String(s)}], expecting a string.`);const n=e.getPathArray(t),o=jc(n,s);return o===Ma?!1:e.hasUserOption(o)}function pU(e,t,i){const[s,n,o]=i,a=e.resolveVertexValue(t,s);if(!ki(a))throw new Error(`\`$isThemeOverride\` json operation failed on [${String(a)}], expecting a string.`);const r=e.getPathArray(t),l=jc(r,a);if(l!==Ma)return e.hasThemeOverride(l)?e.resolveVertexValue(t,n):e.resolveVertexValue(t,o)}var hN=new Set(["fill","fillFallback","stroke","gradient","range2"]);function gU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);if(!ki(n))return;if(hN.has(n)){const a=e.getPathArray(t),r=sg(a);if(isNaN(r))return;switch(n){case"fill":return la(e.palette.fills,1,r)[0];case"fillFallback":return la(e.palette.fillsFallback,1,r)[0];case"stroke":return la(e.palette.strokes,1,r)[0];case"gradient":return la(e.palette.sequentialColors,1,r)[0];case"range2":return la(e.palette.fills,2,r)}return}if(n==="gradients")return e.palette.sequentialColors;const o=jo(e.palette,n.split("."));return Array.isArray(o)?[...o]:typeof o=="object"?{...o}:o}function fU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);if(!ki(n))return;if(hN.has(n)){const a=e.getPathArray(t);let r=sg(a),l=0;const c=["series","0","type"];for(let h=0;h<r;h++){c[1]=`${h}`;const d=e.getResolvedPath(c);(d==="map-shape-background"||d==="map-line-background")&&l++}if(r-=l,isNaN(r))return;switch(n){case"fill":return la(e.palette.fills,1,r)[0];case"fillFallback":return la(e.palette.fillsFallback,1,r)[0];case"stroke":return la(e.palette.strokes,1,r)[0];case"gradient":return la(e.palette.sequentialColors,1,r)[0];case"range2":return la(e.palette.fills,2,r)}return}if(n==="gradients")return e.palette.sequentialColors;const o=jo(e.palette,n.split("."));return Array.isArray(o)?[...o]:typeof o=="object"?{...o}:o}function dN(e,t,i){const[s]=i,n=e.getVertexValue(s);if(ki(n)){const o=e.getPathArray(t),a=jc(o,n);if(a===Ma)return;const r=e.findVertexAtPath(a);r&&e.addEdge(t,r,gM)}}function yU(e,t,i){const s=i.length>1,n=i.length>2,[o,a,r]=i,l=e.resolveVertexValue(t,o),c=n?e.resolveVertexValue(t,r):null;if(!ki(l))throw new Error(`\`$path\` json operation failed on [${String(l)}], expecting a string.`);const h=e.getPathArray(t),d=jc(h,l);if(d===Ma)return;const u=c?jo(c,d):e.getResolvedPath(d);if(u!=null)return u;if(s)return e.resolveVertexValue(t,a)}function mU(e,t,i){const[s,n]=i,o=e.resolveVertexValue(t,s);if(!ki(o))throw new Error(`\`$path\` json operation failed on [${String(o)}], expecting a string.`);let a;n&&(a=e.graftAndResolveOrphan(t,n));const r=e.getPathArray(t),l=jc(r,o,a);if(l===Ma)throw new Error(`Unresolvable path [${o}] at [${r.join(".")}]`);return l}function xU(e,t,i){const[s]=i,n=e.getVertexValue(s);return e.getParamValue(n)}var bU={$apply:vU,$applyTheme:SU,$findFirstSiblingNotOperation:MU,$map:DU,$merge:AU,$omit:IU,$size:kU,$shallow:CU,$value:TU};function vU(e,t,i){const[s,n,o,a]=i,r=e.getVertexValue(s);if(!Je(r))return;const l=n?e.getVertexValue(n):void 0,c=e.neighboursWithEdgeValue(t,Wi),h=o?e.resolveVertexValue(t,o):void 0,d=a?e.resolveVertexValue(t,a):void 0;if((!c||c.length===0)&&l!=null)if(Pd(l)){const u=e.resolveVertexValue(t,n);Je(u)&&e.graftObject(t,u,[h,d])}else e.graftObject(t,l,[h,d]);if(!c)return yl;for(const u of c){const p=e.neighboursWithEdgeValue(u,Wi);if(!p||p.length===0){const g=e.addVertex({});e.addEdge(u,g,$i)}else e.graftObject(u,r,[h,d])}return yl}function SU(e,t,i){const[s,n,o]=i;let a=e.getVertexValue(s);if(typeof a=="string"&&(a=[a]),!Array.isArray(a))return;const r=e.neighboursWithEdgeValue(t,Wi),l=o?e.getVertexValue(o):[],c=Array.isArray(l)?new Set(l):new Set;if(!r)return yl;for(const h of r){const d=e.graftAndResolveOrphan(h,n);for(const u of a){const p=jc([],u,d);p!==Ma&&e.graftConfig(h,p,c)}}return yl}function MU(e,t,i){const[s]=i,n=e.getPathArray(t),o=lN(n);if(o<0)return e.resolveVertexValue(t,s);const a=n.slice(0,o),r=e.findVertexAtPath(a);if(!r)return e.resolveVertexValue(t,s);const l=e.neighboursWithEdgeValue(r,Wi);if(l)for(let c=0;c<l.length;c++){if(`${c}`===n[o])continue;const h=a.concat([`${c}`,...n.slice(o+1)]),d=e.findVertexAtPath(h);if(!d)continue;const u=e.findNeighbourValue(d,Od);if(u!=null)return u;const p=e.findNeighbourValue(d,Vo);if(p!=null)return p}return e.resolveVertexValue(t,s)}function DU(e,t,i){const[s,n]=i,o=e.getVertexValue(s),a=e.resolveVertexValue(t,n);if(!Array.isArray(a))return;if(!Pd(o))return a.map(()=>o);let r=0;for(const l of a)e.graftValue(t,`${r}`,o,l),r++;return yl}function AU(e,t,i){for(const s of i){const n=e.resolveVertexValue(t,s);Je(n)&&e.graftObject(t,n)}return yl}function IU(e,t,i){const[s,n]=i;let o=e.getVertexValue(s);if(!Array.isArray(o)){const r=V$(e,t,n);if(!r)return;o=e.resolveVertexValue(r,s)}const a=e.resolveVertexValue(t,n);if(!(!Array.isArray(o)||!Je(a)))return ce(a,o)}function kU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Tf(n)?Object.keys(n).length:0}function CU(e,t,i){const s=[];for(const n of i)s.push(e.getVertexValue(n));return s}function TU(e,t,i){const[s]=i,n=e.getVertexValue(s),o=e.getPathArray(t);if(n==="$index")return sg(o);if(n==="$1")return e.resolveValue$1(o)}var LU={$isEven:wU,$mul:NU,$round:EU};function wU(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return isNaN(Number(n))?!1:Number(n)%2===0}function NU(e,t,i){let s;for(const n of i){const o=e.resolveVertexValue(t,n);s==null?s=Number(o):s*=Number(o)}return s}function EU(e,t,i){for(const s of i)return Math.round(Number(e.resolveVertexValue(t,s)))}var ng={...j$,...U$,...eU,...dU,...iU,...LU,...bU},uN=new Set(Object.keys(ng));function og(e){return uN.has(e)}var OU=as(PU);function PU(e,t){return new pN(e.config,t,e.params,e.palette,e.overrides,e.getTemplateParameters())}var ag=class ta extends LG{constructor(t={},i={},s=void 0,n=void 0,o={},a=new Map){super(Wi,eg),this.config=t,this.userOptions=i,this.overrides=o,this.internalParams=a,this.resolvedParams={},this.resolvedAnnotations={},this.value$1={},this.cachedPathVertices=new Map,this.EMPTY_PATH_ARRAY_VERTEX=this.addVertex([]),this.root=this.addVertex("root"),this.params=this.addVertex("params"),this.annotations=this.addVertex("annotations"),this.config=t,this.overrides=o,this.internalParams=a,this.palette=n?Ot(n):{},this.palette.type=Fe(i?.theme)?T2(i.theme?.palette):"inbuilt";const r="line",l=i.series?.[0]?.type??r,c=No.cloneDefaultAxes(l);i.axes??(i.axes=c?.axes??[]),this.buildGraphFromObject(this.root,Od,ce(i,["theme"])),this.buildGraphFromObject(this.root,$i,ce(t[l],ta.COMPLEX_KEYS));const h=o?ce(o[l],ta.COMPLEX_KEYS):{};Object.keys(h).length>0&&this.buildGraphFromObject(this.root,Vo,h);const d=o?ce(o.common,ta.COMPLEX_KEYS):{};Object.keys(d).length>0&&this.buildGraphFromObject(this.root,Vo,ji.isCartesian(l)?d:ce(d,["zoom","navigator"])),s&&this.buildGraphFromObject(this.params,$i,s);const u=this.findNeighbourWithValue(this.root,"axes",Wi),p=this.findNeighbourWithValue(this.root,"series",Wi);u&&this.buildGraphFromObject(u,$i,{$applyTheme:[["/$seriesType/axes/$axisType/$position","/$seriesType/axes/$axisType"],{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["./type","category"]},position:{$path:["./position"]}},["top","right","bottom","left"]]}),p&&this.buildGraphFromObject(p,$i,{$applyTheme:["/$seriesType/series",{seriesType:{$path:["./type","line"]}}]});const g=ce(t[l]?.annotations??{},ta.ANNOTATIONS_OPTIONS_KEYS);Object.keys(g).length>0&&this.buildGraphFromObject(this.annotations,$i,g);const f=ce(o?.common?.annotations??{},ta.ANNOTATIONS_OPTIONS_KEYS);Object.keys(f).length>0&&this.buildGraphFromObject(this.annotations,Vo,f);const x=Qv(t[l]?.annotations??{},ta.ANNOTATIONS_OPTIONS_KEYS);Object.keys(x).length>0&&this.buildGraphFromObject(this.root,$i,{annotations:x});const m=Qv(o?.common?.annotations??{},ta.ANNOTATIONS_OPTIONS_KEYS);Object.keys(m).length>0&&this.buildGraphFromObject(this.root,Vo,{annotations:m}),this.buildDependencyGraph()}clear(){super.clear(),this.cachedPathVertices.clear()}resolve(){return this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},this.resolveVertex(this.params,this.resolvedParams),this.resolveVertex(this.annotations,this.resolvedAnnotations),this.resolveVertex(this.root),this.resolved}resolveParams(){return this.resolvedParams}resolveAnnotationThemes(){return this.resolvedAnnotations}findVertexAtPath(t){const i=t.join(".");if(this.cachedPathVertices.has(i))return this.cachedPathVertices.get(i);const s=this.findVertexAlongEdge(this.root,t,Wi);if(s)return this.cachedPathVertices.set(i,s),s}hasUserOption(t){return ig(this.userOptions,t)}hasThemeOverride(t){if(t[0]==="axes"&&t.length>1){const i=this.getResolvedPath(["axes",t[1],"type"]);if(ig(this.overrides,["common","axes",i,...t.slice(2)]))return!0;const s=this.getResolvedPath(["series","0","type"]);return ig(this.overrides,[s,"axes",i,...t.slice(2)])}if(t[0]==="series"&&t.length>1){const i=this.getResolvedPath(["series",t[1],"type"]);return ig(this.overrides,[i,"series",...t.slice(2)])}return ig(this.overrides,t)}getParamValue(t){if(this.resolvedParams[t]!=null)return this.resolvedParams[t];const i=this.findVertexAlongEdge(this.params,[t],Wi);if(!i)return;const s=this.findNeighbour(i,$i);if(!s)return;const n=this.resolveVertexValue(i,s);return this.resolvedParams[t]=n,n}getPathArray(t){return this.findNeighbourValue(t,Go)??[]}getResolvedPath(t){return jo(this.resolved,t)}resolveVertexValue(t,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,eg);if(s&&og(s)){const o=this.neighboursWithEdgeValue(i,tg),a=ng[s],l=(typeof a=="function"?a:a.resolve)?.(this,t,o??[]);return l===yl?void 0:l}let n=this.getVertexValue(i);if(Array.isArray(n)){const o={};this.resolveVertexChildren(i,o),n=jo(o,this.getPathArray(t))}return this.resolveValueOrSymbol(n)}resolveValue$1(t){return jo(this.value$1,t)}graftConfig(t,i,s){const n=jo(this.config,i),o=this.findNeighbour(t,Go);if(Je(n)&&this.buildGraphFromObject(t,$i,n,o,void 0,s),this.overrides){const a=jo(this.overrides,i);Je(a)&&this.buildGraphFromObject(t,Vo,a,o,void 0,s);const r=jo(this.overrides,["common",...i.slice(1)]);Je(r)&&this.buildGraphFromObject(t,Vo,r,o,void 0,s)}this.buildDependencyGraph()}graftObject(t,i,s){const n=this.findNeighbour(t,Go);if(this.buildGraphFromObject(t,$i,i,n),this.overrides&&s)for(const o of s){if(o==null)continue;const a=jo(this.overrides,o);a&&this.buildGraphFromObject(t,Vo,a,n)}this.buildDependencyGraph()}graftValue(t,i,s,n){const o=[...this.getPathArray(t),i];mM(this.value$1,o,n);const a=this.findVertexAtPath(o)??this.addVertex(i);this.buildGraphFromValue(t,a,$i,o,s),this.buildDependencyGraph()}graftAndResolveOrphan(t,i){const s={},n=this.addVertex(s),o=this.getPathArray(t);return this.graftAndResolveChildren(i,n,o,[]),this.resolveVertex(n,s),jo(s,o)}buildGraphFromObject(t,i,s,n,o=ta.SHALLOW_KEYS,a){const r=Object.keys(s),l=Pd(s,r);if(l){const g=this.addVertex(s);this.addEdge(t,g,i),this.buildGraphFromOperation(g,i,l,n);return}if(r.length===0){this.addEdge(t,this.addVertex(Array.isArray(s)?[]:{}),i),this.buildGraphAutoEnable(t,i,s,void 0);return}const c=this.getVertexChildrenByKey(t),h=n?this.getVertexValue(n):[];let d;const u=[...h],p=h.length;for(const g of r){if(a?.has(g))continue;const f=c?.get(g)??this.addVertex(g);u[p]=g,o?.has(g)?this.buildShallowGraphFromValue(t,f,i,u,s[g]):this.buildGraphFromValue(t,f,i,u,s[g],o),g==="enabled"&&(d=f)}this.buildGraphAutoEnable(t,i,s,d)}buildGraphAutoEnable(t,i,s,n){if(i===$i&&!n||i===Od&&n||i!==$i&&i!==Od&&i!==Vo)return;let o=this.findNeighbour(t,fM);o||(o=this.addVertex(fM),this.addEdge(t,o,fM)),n&&this.addEdge(n,o,rN);const{enabled:a,_enabledFromTheme:r}=s;this.addEdge(o,this.addVertex({enabled:a,_enabledFromTheme:r,keys:Object.keys(s).length}),i)}getVertexChildrenByKey(t){const i=this.neighboursWithEdgeValue(t,Wi);if(!i)return;const s=new Map;for(const n of i)s.set(this.getVertexValue(n),n);return s}buildGraphFromValue(t,i,s,n,o,a){this.addEdge(t,i,Wi);let r=this.findNeighbour(i,Go);r||(r=this.addVertex([...n]),this.addEdge(i,r,Go));const l=Pd(o);if(l){const c=this.addVertex(o);this.addEdge(i,c,s),this.addEdge(c,r,Go),this.buildGraphFromOperation(c,s,l,r)}else if(Tf(o))this.buildGraphFromObject(i,s,o,r,a);else{const c=this.addVertex(o);this.addEdge(i,c,s)}}buildShallowGraphFromValue(t,i,s,n,o){this.addEdge(t,i,Wi);let a=this.findNeighbour(i,Go);a||(a=this.addVertex([...n]),this.addEdge(i,a,Go));const r=this.addVertex(o);this.addEdge(i,r,s)}buildGraphFromOperation(t,i,s,n){const o=this.addVertex(s.operation);this.addEdge(t,o,eg);for(const a of s.values)this.buildGraphFromOperationValue(t,a,i,n)}buildGraphFromOperationValue(t,i,s,n=this.EMPTY_PATH_ARRAY_VERTEX){const o=this.addVertex(i);this.addEdge(t,n,Go),this.addEdge(t,o,tg);const a=Pd(i);a?this.buildGraphFromOperation(o,s,a,n):Tf(i)&&this.buildGraphFromObject(o,s,i,n)}buildDependencyGraph(){for(let t=0;t<this.pendingProcessingEdgesFrom.length;t++){const i=this.pendingProcessingEdgesFrom[t],s=this.pendingProcessingEdgesTo[t],n=this.getVertexValue(s);if(!og(n))continue;const o=this.neighboursWithEdgeValue(i,tg),a=ng[n];(typeof a=="function"?void 0:a.dependencies)?.(this,i,o??[])}this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[]}resolveVertex(t,i=this.resolved){const s=this.getPathArray(t);this.resolveVertexInEdgePriority(t,i,s),this.resolveVertexAutoEnable(t,i,s),this.resolveVertexChildren(t,i)}resolveVertexInEdgePriority(t,i,s){const n=this.neighboursWithEdgeValue(t,Wi),[o]=ta.EDGE_PRIORITY;for(const a of ta.EDGE_PRIORITY){const r=this.findNeighbour(t,a);if(r==null)continue;const l=this.resolveVertexValueInternal(t,r);if(!(l==null&&a!==o)&&!(n&&n.length>0&&Array.isArray(l)&&a!==o)){if(s.length===0){if(l==null)continue;this.resolved=l}else mM(i,s,l);break}}}resolveVertexValueInternal(t,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,eg);if(s&&og(s)){const n=this.neighboursWithEdgeValue(i,tg),o=ng[s],r=(typeof o=="function"?o:o.resolve)?.(this,t,n??[]);return r===yl?void 0:r}return this.resolveValueOrSymbol(this.getVertexValue(i))}resolveVertexAutoEnable(t,i,s){const n=this.neighboursWithEdgeValue(t,rN)?.[0];if(!n)return;const o=this.findNeighbourValue(n,$i),a=this.findNeighbourValue(n,Vo),r=this.findNeighbourValue(n,Od);r&&r.enabled==null&&!o?._enabledFromTheme&&!a?._enabledFromTheme&&mM(i,s,!0)}resolveVertexChildren(t,i){const s=this.neighboursWithEdgeValue(t,Wi);if(s)for(const n of s){const o=this.getVertexValue(n);s.length>1&&og(o)||o!=="_enabledFromTheme"&&this.resolveVertex(n,i)}}resolveVertexDependencies(t){const i=this.neighboursWithEdgeValue(t,gM);if(i)for(const s of i)this.resolveVertex(s)}graftAndResolveChildren(t,i,s,n){const o=this.neighboursWithEdgeValue(t,Wi);if(o)for(const a of o){const r=this.getVertexValue(a),l=[...s,r],c=[...n,r],h=this.addVertex(r),d=this.findNeighbourValue(a,$i);this.addEdge(i,h,Wi);const u=this.addVertex(l);if(this.addEdge(h,u,Go),Je(d)){this.buildGraphFromObject(h,$i,d,u);const p=this.findNeighbour(h,$i);this.addEdge(p,this.addVertex(l),Go);const g=this.findNeighbourValue(p,eg);if(og(g)){const f=this.neighboursWithEdgeValue(p,tg),x=ng[g];(typeof x=="function"?void 0:x.dependencies)?.(this,p,f??[])}}this.graftAndResolveChildren(a,h,l,c)}}resolveValueOrSymbol(t){return typeof t=="symbol"&&this.internalParams?.has(t)?this.internalParams.get(t):t}};ag.EDGE_PRIORITY=[Od,Vo,$i],ag.SHALLOW_KEYS=new Set(["context","data","topology"]),ag.COMPLEX_KEYS=["annotations","axes","series"],ag.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"];var pN=ag,gN=e=>`'${e}'`,Hc=class is{constructor(t,i,s,n,o,a,r=!1,l){this.themeParameters={},this.optionMetadata=o??{},this.processedOverrides=s??{};let c=null;t instanceof is?(c=t,this.specialOverrides=c.specialOverrides,a===void 0&&(a=Xa(c.userOptions,i,is.JSON_DIFF_OPTS)),this.userOptions=Ot(Wu(a,c.userOptions),{...is.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=Ot(t??i,{...is.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...n})),r&&this.removeLeftoverSymbols(this.userOptions);let h,d,u,p,g,f;if(!r&&a!==void 0&&is.isFastPathDelta(a)&&c!=null?({activeTheme:h,processedOptions:d,fastDelta:u}=this.fastSetup(a,c),p=c.themeParameters,g=c.annotationThemes):(is.perfDebug("ChartOptions.slowSetup()"),{activeTheme:h,processedOptions:d,themeParameters:p,annotationThemes:g,googleFonts:f}=this.slowSetup(s,a,r)),this.activeTheme=h,this.processedOptions=d,this.fastDelta=u??void 0,this.themeParameters=p,this.annotationThemes=g,this.googleFonts=f,l!==void 0&&typeof l=="number"&&!isNaN(l)){const x=performance.now();this.optionsProcessingTime=x-l}Be.inDevelopmentMode(()=>Ua(this))}static isFastPathDelta(t){for(const i of Object.keys(t??{}))if(!this.FAST_PATH_OPTIONS.has(i))return is.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return is.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}fastSetup(t,i){const{activeTheme:s,processedOptions:n}=i,{presetType:o}=this.optionMetadata;if(o!=null&&t?.data!=null){const r=Vs.getPresetModule(o);if(r?.processData){const{series:l,data:c}=r.processData(t.data);t=et({series:l,data:c},t)}}this.fastSeriesSetup(t,n);const a=et(t,n);return is.debug("ChartOptions.fastSetup() - processed options",a),{activeTheme:s,processedOptions:a,fastDelta:t}}fastSeriesSetup(t,i){t?.series&&(t.series?.every((s,n)=>YC(s,i.series?.[n]??{}))?delete t.series:t.series=t.series.map((s,n)=>Wu(s,i.series?.[n]??{})))}slowSetup(t,i,s=!1){let n=Ot(this.userOptions,is.OPTIONS_CLONE_OPTS_FAST);i&&(n=et(i,n),s&&this.removeLeftoverSymbols(n));const{presetType:o}=this.optionMetadata;if(o!=null){const p=Vs.getPresetModule(o);if(p){const{validate:g=ss}=p,f=n,x=n.type,m=x!=null?Cm(n.theme).presets[x]:void 0,{cleared:b,invalid:v}=g(f,p.options,"");v.forEach(S=>X.warn(S)),Rh(v,"")?n={}:(is.debug(">>> AgCharts.createOrUpdate() - applying preset",b),n=p.create(b,m,()=>this.activeTheme))}}this.soloSeriesIntegrity(n),fl.isEnterprise||C2(n);const a=Cm(n.theme);if(o!=null&&a.templateTheme(n,!1),this.validateSeriesOptions(n),this.chartDef=Vs.detectChartDefinition(n),!this.chartDef.placeholder){const{validate:p=ss}=this.chartDef,{cleared:g,invalid:f}=p(n,this.chartDef.options,"");f.forEach(x=>X.warn(x)),n=g}this.validateAxesOptions(n),this.removeDisabledOptions(n);let r=this.processFonts(a.params);r=this.processFonts(n,r),this.processSeriesOptions(n);const l=OU(a,n),c=l.resolve(),h=l.resolveParams(),d=l.resolveAnnotationThemes();l.clear();const u=et(t,c);return SW(u),fl.isEnterprise||C2(u,!0),this.validateSeriesOptions(u),this.validateAxesOptions(u),this.validatePluginOptions(u),this.processMiniChartSeriesOptions(u),u.loadGoogleFonts||r.clear(),is.debug(()=>["ChartOptions.slowSetup() - processed options",Ot(u)]),{activeTheme:a,processedOptions:u,themeParameters:h,annotationThemes:d,googleFonts:r}}validatePluginOptions(t){for(const i of Vs.listModulesByType("plugin")){const s=i.name;if(s in t&&(!i.chartType||i.chartType===this.chartDef?.name)){const{cleared:n,invalid:o}=ss(t[s],i.options,i.name);o.forEach(a=>X.warn(a)),t[s]=n}}}validateSeriesOptions(t){const i=this.chartDef?.name,s=[],n=t.series?.length??0;let o;for(let a=0;a<n;a++){const r=`series[${a}]`,l=t.series[a],c=Vs.getSeriesModule(l.type);if(c==null){o??(o=Bu(Array.from(Vs.listModulesByType("series")).filter(p=>!i||p.chartType===i).map(p=>p.name),"or",gN)),X.warn(l.type==null?`Option \`${r}.type\` is required and has not been provided; expecting ${o}, ignoring.`:`Unknown type \`${l.type}\` at \`${r}.type\`; expecting ${o}, ignoring.`);continue}else if(i&&c.chartType!==i){X.warn(`Series type \`${c.name}\` at \`${r}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}const{validate:h=ss}=c,{cleared:d,invalid:u}=h(l,c.options,r);u.forEach(p=>X.warn(p)),Rh(u,r)||s.push(d)}t.series=s}validateAxesOptions(t){if(!("axes"in t)||!t.axes)return;const i=this.chartDef?.name,s=[],n=t.axes.length??0;let o;for(let a=0;a<n;a++){const r=`axes[${a}]`,l=t.axes[a],c=Vs.getAxisModule(l.type);if(c==null){o??(o=Bu(Array.from(Vs.listModulesByType("axis")).filter(p=>p.chartType===i).map(p=>p.name),"or",gN)),X.warn(`Unknown type \`${l.type}\` at \`${r}.type\`; expecting one of ${o}, ignoring all axes options.`),delete t.axes;break}else if(c.chartType!==i){X.warn(`Axis type \`${c.name}\` at \`${r}.type\` is not supported by chart type \`${i}\`, ignoring.`);break}const{validate:h=ss}=c,{cleared:d,invalid:u}=h(l,c.options,r);u.forEach(p=>X.warn(p)),Rh(u,r)||s.push(d)}t.axes=s}diffOptions(t){return this===t?{}:t==null?this.processedOptions:this.fastDelta??Xa(t.processedOptions,this.processedOptions,is.JSON_DIFF_OPTS)}optionsType(t){return t.series?.[0]?.type??"line"}processSeriesOptions(t){const i=t.series?.map(s=>{s.type??(s.type="line");const o=!!Vs.getSeriesModule(s.type)?.options.visible;return et(this.getSeriesGroupingOptions(s),s,o&&{visible:!0})});t.series=this.setSeriesGroupingOptions(i??[])}processMiniChartSeriesOptions(t){const i=t.navigator?.miniChart?.series;i!=null&&(t.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}getSeriesGroupingOptions(t){const i=No.isGroupable(t.type),s=No.isStackable(t.type),n=No.isStackedByDefault(t.type);t.grouped&&!i&&X.warnOnce(`unsupported grouping of series type "${t.type}".`),(t.stacked||t.stackGroup)&&!s&&X.warnOnce(`unsupported stacking of series type "${t.type}".`);let{grouped:o,stacked:a}=t;return a??(a=(n||t.stackGroup!=null)&&!(i&&o)),o??(o=!0),{stacked:s&&a,grouped:i&&o&&!(s&&a)}}setSeriesGroupingOptions(t){const i=this.getSeriesGrouping(t);is.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const s={},n=i.reduce((o,a)=>{var r;return a.groupType==="default"||(o[r=a.seriesType]??(o[r]=0),o[a.seriesType]+=a.groupType==="stack"?1:a.series.length),o},{});return i.flatMap(o=>{var a;switch(s[a=o.seriesType]??(s[a]=0),o.groupType){case"stack":{const r=s[o.seriesType]++;return o.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:o.groupId,groupIndex:r,groupCount:n[o.seriesType],stackIndex:c,stackCount:o.series.length}}))}case"group":return o.series.map(r=>Object.assign(r,{seriesGrouping:{groupId:o.groupId,groupIndex:s[o.seriesType]++,groupCount:n[o.seriesType],stackIndex:0,stackCount:0}}))}return o.series}).map(({stacked:o,grouped:a,...r})=>r)}getSeriesGroupId(t){return[t.type,t.xKey,t.stacked?t.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(t){const i=new Map;return t.reduce((s,n)=>{const o=n.type;if(!n.stacked&&!n.grouped)s.push({groupType:"default",seriesType:o,series:[n],groupId:"__default__"});else{const a=this.getSeriesGroupId(n);if(!i.has(a)){const l={groupType:n.stacked?"stack":"group",seriesType:o,series:[],groupId:a};i.set(a,l),s.push(l)}i.get(a).series.push(n)}return s},[])}soloSeriesIntegrity(t){if(!Ue(t.series))return;const i=t.series;if(i&&i.length>1&&i.some(s=>No.isSolo(s.type))){const s=this.optionsType(t);if(No.isSolo(s))X.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),t.series=i.slice(0,1);else{const{solo:n,nonSolo:o}=Vv(i,r=>No.isSolo(r.type)?"solo":"nonSolo"),a=Gv(n.map(r=>r.type)).join(", ");X.warn(`Unable to mix these series types with the lead series type: ${a}`),t.series=o}}}static processFontOptions(t,i,s,n=new Set){if(typeof t=="object"&&"fontFamily"in t)if(Array.isArray(t.fontFamily)){const o=[];for(const a of t.fontFamily)typeof a=="object"&&"googleFont"in a?(o.push(a.googleFont),n?.add(a.googleFont)):o.push(a);t.fontFamily=o.join(", ")}else typeof t.fontFamily=="object"&&"googleFont"in t.fontFamily&&(t.fontFamily=t.fontFamily.googleFont,n?.add(t.fontFamily));return n}processFonts(t,i=new Set){return Zr(t,is.processFontOptions,new Set(["data","theme"]),void 0,void 0,i)}static removeDisabledOptionJson(t){"enabled"in t&&t.enabled===!1&&Object.keys(t).forEach(i=>{i!=="enabled"&&delete t[i]})}removeDisabledOptions(t){Zr(t,is.removeDisabledOptionJson,new Set(["data","theme","contextMenu"]))}static removeLeftoverSymbolsJson(t){if(!(!t||!Fe(t)))for(const i of Object.keys(t)){const s=t[i];Lf(s)&&delete t[i]}}removeLeftoverSymbols(t){Zr(t,is.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(t){if(t.window==null?t.window=Ze():Y_(t.window),t.document==null?t.document=oa():U_(t.document),t.window==null)throw new Error("AG Charts - unable to resolve global window");if(t.document==null)throw new Error("AG Charts - unable to resolve global document");return t}};Hc.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},Hc.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])},Hc.JSON_DIFF_OPTS=new Set(["data"]),Hc.perfDebug=Be.create(!0,"perf"),Hc.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),Hc.debug=Be.create(!0,"opts");var rg=Hc,fN=Be.create(!0,"opts"),Wc="AG Charts - Chart was destroyed, cannot perform request.",lg=class{constructor(t,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=t}async update(t){if(!this.chart)throw new Error(Wc);return fN.group("AgChartInstance.update()",async()=>{const i=Be.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.update(t,this,void 0,i),await this.chart?.waitForUpdate()})}async updateDelta(t){if(!this.chart)throw new Error(Wc);return fN.group("AgChartInstance.updateDelta()",async()=>{const i=Be.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.updateUserDelta(this,t,i),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(Wc);const t=Ot(this.chart.getOptions(),rg.OPTIONS_CLONE_OPTS_FAST);for(const i of Object.keys(t))i.startsWith("_")&&delete t[i];return t}waitForUpdate(){if(!this.chart)throw new Error(Wc);return this.chart.waitForUpdate()}async download(t){if(!this.chart)throw new Error(Wc);const i=await this.prepareResizedChart(this,this.chart,t);try{i.chart?.download(t?.fileName,t?.fileFormat)}finally{i.destroy()}}async __toSVG(t){if(!this.chart)throw new Error(Wc);const i=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...t});try{return i?.chart?.toSVG()}finally{i?.destroy()}}async getImageDataURL(t){if(!this.chart)throw new Error(Wc);const i=await this.prepareResizedChart(this,this.chart,t);try{return i.chart.getCanvasDataURL(t?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(t){const{chart:i}=this;if(!i)return;const s=this.getEnabledOriginators();if(!s.includes(i.ctx.legendManager)){await this.setStateOriginators(t,s);return}await this.setStateOriginators(t,s.filter(n=>n!==i.ctx.zoomManager)),await this.setStateOriginators(t,[i.ctx.zoomManager])}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(t,i,s={}){const n=s.width??i.width??i.ctx.scene.canvas.width,o=s.height??i.height??i.ctx.scene.canvas.height,a=t.getState(),r=da.hasEnterpriseModules(),l={...i.chartOptions.processedOverrides,container:document.createElement("div"),width:n,height:o};s.width!=null&&s.height!=null&&(l.overrideDevicePixelRatio=1);const c=i.getOptions();r&&(l.animation={enabled:!1},this.licenseManager?.isDisplayWatermark()&&(l.foreground={text:this.licenseManager.getWatermarkMessage(),image:{url:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",width:170,height:25,right:25,bottom:50,opacity:.7}}));const h={...i.chartOptions.specialOverrides},d={...i.chartOptions.optionMetadata},u=await this.chart?.ctx.dataService.getData(),p=this.factoryApi.create(c,l,h,d,u);await p.setState(a),p.chart?.ctx.zoomManager.updateZoom("chartProxy",i.ctx.zoomManager.getZoom()),p.chart?.ctx.legendManager.clearData(),p.chart?.ctx.legendManager.update(i.ctx.legendManager.getData()),i.series.forEach((f,x)=>{p.chart.series[x].visible=f.visible});const g=[];for(const f of i.modulesManager.legends())g.push(f.legend.pagination?.currentPage??0);for(const f of p.chart.modulesManager.legends()){const x=g.shift()??0;f.legend.pagination&&f.legend.pagination.setPage(x)}return p.chart?.update(0,{forceNodeDataRefresh:!0}),await p.waitForUpdate(),p}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:t,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:n,zoomManager:o,legendManager:a}}=this.chart,r=[];return"annotations"in t&&t.annotations?.enabled&&r.push(s),i.presetType==="price-volume"&&r.push(n),(t.navigator?.enabled||t.zoom?.enabled)&&r.push(o),"legend"in this.chart&&r.push(a),r}async setStateOriginators(t,i){this.factoryApi.caretaker.restore(t,...i),this.chart?.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await this.chart?.waitForUpdate()}};lg.chartInstances=new WeakMap,M([Is({oldValue(e){e.destroyed||(e.publicApi=void 0),lg.chartInstances.delete(e)},newValue(e){e&&(e.publicApi=this,lg.chartInstances.set(e,this))}})],lg.prototype,"chart",2);var yN=lg,bM=class extends Wf{constructor(e){super(),this.ctx=e,this.localeText=void 0}};M([Xr(e=>{e.ctx.localeManager.setLocaleText(e.localeText)}),I],bM.prototype,"localeText",2),M([Xr(e=>{e.ctx.localeManager.setLocaleTextFormatter(e.getLocaleText)}),I],bM.prototype,"getLocaleText",2);var RU={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new bM(e)},Rd=class extends Wf{constructor(e){super(),this.ctx=e,this.rectNode=new Ti,this.textNode=new xn,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.cleanup.register(e.scene.attachNode(this.node),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)))}createNode(){return new Re({name:"background",zIndex:0})}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};M([I,ni("node","visible")],Rd.prototype,"visible",2),M([I,ni("rectNode","fill")],Rd.prototype,"fill",2),M([I],Rd.prototype,"image",2),M([I,ni("textNode")],Rd.prototype,"text",2);var mN={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new Rd(e)},$c=class extends we{constructor(e){super(),this.node=e,this.enabled=!1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};M([Is({changeValue(e){e?this.node.strokeWidth=this.strokeWidth:this.node.strokeWidth=0}}),I],$c.prototype,"enabled",2),M([ni("node","stroke"),I],$c.prototype,"stroke",2),M([ni("node","strokeOpacity"),I],$c.prototype,"strokeOpacity",2),M([Is({changeValue(e){this.enabled?this.node.strokeWidth=e:this.node.strokeWidth=0}}),I],$c.prototype,"strokeWidth",2);function BU({orientation:e,bboxes:t,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:o=0,forceResult:a=!1}){const r=e==="horizontal",l={max:r?s:i,fn:r?u=>u.width:u=>u.height,padding:r?o:n},c={max:r?i:s,fn:r?u=>u.height:u=>u.width,padding:r?n:o};let h=0;const d=[];for(;h<t.length;){const u=t.slice(h),p=FU(u,h,l,c,a);if(!p)return;h+=p.processedBBoxCount,d.push(p.pageIndices)}return _U(d,e,t,n,o)}function FU(e,t,i,s,n){let a=VU(e,i);if(a<1){if(!n)return;a=1}let r=a;for(;r>=1;){const l=zU(e,t,r,i,s,n);if(l==null&&r<=1)return;if(l==null){r--;continue}if(typeof l=="number"){if(l<=1)return;r=l<r&&l>1?l:r,r--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function zU(e,t,i,s,n,o){const a=[];let r=0,l=0,c=[];const h=[];for(let d=0;d<e.length;d++){const u=(d+i)%i;u===0&&(r+=l,l=0,c.length>0&&a.push(c),c=[]);const p=s.fn(e[d])+s.padding;h[u]=Math.max(h[u]??0,p),l=Math.max(l,n.fn(e[d])+n.padding);const g=r+l,f=!o||a.length>0;if(g>n.max&&f){c=[];break}if(h.reduce((m,b)=>m+b,0)>s.max&&!o)return h.length<i?h.length:void 0;c.push(d+t)}return c.length>0&&a.push(c),a.length>0?a:void 0}function _U(e,t,i,s,n){let o=0,a=0;return{pages:e.map(l=>{t==="horizontal"&&(l=GU(l));let c=0;const h=l.map(p=>{const g=p.map(m=>(c=Math.max(m,c),i[m]));let f=0,x=0;return g.forEach(m=>{f+=m.height+s,x=Math.max(x,m.width+n)}),{indices:p,bboxes:g,columnHeight:Math.ceil(f),columnWidth:Math.ceil(x)}});let d=0,u=0;return h.forEach(p=>{d+=p.columnWidth,u=Math.max(u,p.columnHeight)}),o=Math.max(d,o),a=Math.max(u,a),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:d,pageHeight:u}}),maxPageWidth:o,maxPageHeight:a}}function GU(e){const t=[];for(const i of e[0])t.push([]);return e.forEach((i,s)=>{i.forEach((n,o)=>{t[o][s]=n})}),t}function VU(e,t){const i=e.length;let s=0;for(let n=0;n<i;n++)if(s+=t.fn(e[n])+t.padding,s>t.max)return i/n<2?Math.ceil(i/2):n;return i}var Bd=class extends we{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};M([I],Bd.prototype,"color",2),M([I],Bd.prototype,"fontStyle",2),M([I],Bd.prototype,"fontWeight",2),M([I],Bd.prototype,"fontSize",2),M([I],Bd.prototype,"fontFamily",2);var gr=class extends we{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};M([I],gr.prototype,"size",2),M([I],gr.prototype,"fill",2),M([I],gr.prototype,"fillOpacity",2),M([I],gr.prototype,"stroke",2),M([I],gr.prototype,"strokeWidth",2),M([I],gr.prototype,"strokeOpacity",2);var Tm=class extends we{constructor(e){super(),this.parent=e,this.shape="triangle",this.size=15,this.padding=8}};M([Is({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],Tm.prototype,"shape",2),M([I],Tm.prototype,"size",2),M([I],Tm.prototype,"padding",2);var Uc=class extends we{constructor(e,t){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.id=ns(this),this.marker=new Tm(this),this.activeStyle=new gr,this.inactiveStyle=new gr,this.highlightStyle=new gr,this.label=new Bd,this.group=new As({name:"pagination"}),this.labelNode=new xn,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this.nextButton=new wi,this.previousButton=new wi,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(e){switch(this._orientation=e,e){case"horizontal":{this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}get orientation(){return this._orientation}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateNextButtonPosition(){const e=this.labelNode.getBBox();this.nextButton.translationX=e.width+(this.marker.size/2+this.marker.padding)*2}updateLabel(){const{currentPage:e,totalPages:t,labelNode:i,label:{color:s,fontStyle:n,fontWeight:o,fontSize:a,fontFamily:r}}=this;i.text=`${e+1} / ${t}`,i.fill=s,i.fontStyle=n,i.fontWeight=o,i.fontSize=a,i.fontFamily=r}updateMarkers(){const{nextButton:e,previousButton:t,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:o,highlightStyle:a,highlightActive:r}=this,l=(c,h)=>h?o:c===r?a:n;this.updateMarker(e,l("next",i)),this.updateMarker(t,l("previous",s))}updateMarker(e,t){const{shape:i,size:s}=this.marker;e.shape=i,e.size=s,e.fill=t.fill,e.fillOpacity=t.fillOpacity??1,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.strokeOpacity=t.strokeOpacity}enableOrDisableButtons(){const{currentPage:e,totalPages:t}=this,i=t===0,s=e===t-1,n=e===0;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}setPage(e){e=ve(0,e,Math.max(0,this.totalPages-1)),this.currentPage!==e&&(this.currentPage=e,this.onPaginationChanged())}getCursor(e){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[e]?void 0:"pointer"}onClick(e,t){e.preventDefault(),t==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):t==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(e){this.highlightActive=e,this.updateMarkers(),this.chartUpdateCallback(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(e){e.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const e=Gt.toCanvas(this.previousButton),t=Gt.toCanvas(this.nextButton);return{prev:e,next:t}}};Uc.className="Pagination",M([I],Uc.prototype,"marker",2),M([I],Uc.prototype,"activeStyle",2),M([I],Uc.prototype,"inactiveStyle",2),M([I],Uc.prototype,"highlightStyle",2),M([I],Uc.prototype,"label",2);var jU=class{constructor(e,t){this.dirty=!0,this.itemList=e.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${t}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${t}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"}}),this.itemDescription=ke("p"),this.itemDescription.style.display="none",this.itemDescription.id=cc(),this.itemDescription.textContent=this.getItemAriaDescription(e.localeManager),this.itemList.getElement().append(this.itemDescription)}initLegendList(e){if(!this.dirty)return;const{ctx:t,itemSelection:i,datumReader:s,itemListener:n}=e,o=t.localeManager,a=i.length;i.each((r,l,c)=>{r.proxyButton?.destroy(),r.proxyButton=t.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(o,s.getItemLabel(l),c,a),ariaChecked:!!r.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const h=r.proxyButton;h.addListener("click",d=>n.onClick(d.sourceEvent,r.datum,h)),h.addListener("dblclick",d=>n.onDoubleClick(d.sourceEvent,r.datum)),h.addListener("mouseenter",d=>n.onHover(d.sourceEvent,r)),h.addListener("mouseleave",()=>n.onLeave()),h.addListener("contextmenu",d=>n.onContextClick(d,r)),h.addListener("blur",()=>n.onLeave()),h.addListener("focus",d=>n.onHover(d.sourceEvent,r)),h.addListener("drag-start",()=>{})}),this.dirty=!1}update(e){e.visible&&(this.initLegendList(e),this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!0)),this.updateVisibility(e.visible)}updateVisibility(e){this.itemList.setHidden(!e),this.paginationGroup.setHidden(!e)}updateItemProxyButtons({itemSelection:e,group:t,pagination:i,interactive:s}){const n=Gt.toCanvas(t);this.itemList.setBounds(n);const o=Math.max(...e.nodes().map(a=>a.getBBox().height));e.each((a,r)=>{if(a.proxyButton){const l=a.pageIndex===i.currentPage,{x:c,y:h,height:d,width:u}=Gt.toCanvas(a),p=(o-d)/2,g={x:c-n.x,y:h-p-n.y,height:o,width:u},f=s&&l;a.proxyButton.setCursor("pointer"),a.proxyButton.setEnabled(f),a.proxyButton.setPointerEvents(f?void 0:"none"),a.proxyButton.setBounds(g)}})}updatePaginationProxyButtons(e,t){const{pagination:i}=e;if(this.paginationGroup.setHidden(!i.visible),t&&"ctx"in e){const{ctx:s,oldPages:n,newPages:o}=e,a=(n?.length??o.length)>1,r=o.length>1;a!==r&&(r?(this.prevButton=s.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",l=>this.onPageButton(e,l,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0)),this.nextButton??(this.nextButton=s.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup})),this.nextButton.addListener("click",l=>this.onPageButton(e,l,"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)),this.paginationGroup.setAriaHidden(r?void 0:!0)}if(this.prevButton&&this.nextButton){const{prev:s,next:n}=i.computeCSSBounds(),o=de.merge([s,n]);s.x-=o.x,s.y-=o.y,n.x-=o.x,n.y-=o.y,this.paginationGroup.setBounds(o),this.prevButton.setBounds(s),this.nextButton.setBounds(n),this.prevButton.setEnabled(i.currentPage!==0),this.nextButton.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton.setCursor(i.getCursor("next")),this.prevButton.setCursor(i.getCursor("previous"))}}onPageButton(e,t,i){e.pagination.onClick(t.sourceEvent,i),this.updatePaginationProxyButtons(e,!1)}onDataUpdate(e,t){this.dirty=e.length!==t.length||e.some((i,s,n)=>{const[o,a]=[t[s],e[s]];return o.id!==a.id})}onLocaleChanged(e,t,i){const s=t.length;t.each(({proxyButton:n},o,a)=>{const r=n?.getElement();if(r!=null){const l=i.getItemLabel(o);r.textContent=this.getItemAriaText(e,l,a,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(e)}onPageChange(e){this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!1)}getItemAriaText(e,t,i,s){return i>=0&&t?(i++,e.t("ariaLabelLegendItem",{label:t,index:i,count:s})):e.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(e){return e.t("ariaDescriptionLegendItem")}};function xN(e,{itemId:t,seriesId:i,label:{text:s}},n){const o={defaultPrevented:!1,apiEvent:{type:e,itemId:t,seriesId:i,text:s,event:n,preventDefault:()=>o.defaultPrevented=!0}};return o}var Jn=class extends As{constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new Re({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new xn),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new wi({zIndex:1})),this.line=this.symbolsGroup.appendChild(new Sn({zIndex:0}));const{label:e,line:t,symbolsGroup:i}=this;t.visible=!1,i.renderToOffscreenCanvas=!0,i.optimizeForInfrequentRedraws=!0,e.textBaseline="middle",e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(e){this.enabled=e,this.refreshVisibilities()}getTextMeasureBBox(){return this.layout(),de.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const e=this.enabled?1:.5;this.label.opacity=e,this.opacity=e}layout(){const{marker:e,line:t,length:i,isCustomMarker:s}=this;let n=0,o=0;if(e.visible){const{size:a}=e,r=wi.anchor(e.shape);n=(r.x-.5)*a+i/2,o=(r.y-.5)*a,s?(e.x=0,e.y=0,e.translationX=n,e.translationY=o):(e.x=n,e.y=o,e.translationX=0,e.translationY=0)}t.visible&&(t.x1=0,t.x2=i,t.y1=0,t.y2=0)}preRender(e){const t=super.preRender(e);return this.layout(),t}layoutLabel(){const{length:e,spacing:t}=this;this.label.x=e+t}computeBBox(){return this.layout(),super.computeBBox()}};Jn.className="MarkerLabel",M([ni("label")],Jn.prototype,"text",2),M([ni("label")],Jn.prototype,"fontStyle",2),M([ni("label")],Jn.prototype,"fontWeight",2),M([ni("label")],Jn.prototype,"fontSize",2),M([ni("label")],Jn.prototype,"fontFamily",2),M([ni("label","fill")],Jn.prototype,"color",2),M([Xr(e=>e.layoutLabel())],Jn.prototype,"spacing",2),M([Xr(e=>e.layoutLabel())],Jn.prototype,"length",2),M([te()],Jn.prototype,"isCustomMarker",2);function Lm(e){const{placement:t="bottom",floating:i=!1,xOffset:s=0,yOffset:n=0}=typeof e=="string"?{placement:e,floating:!1}:e;return{placement:t,floating:i,xOffset:s,yOffset:n}}var ml=class extends we{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"}};M([I],ml.prototype,"maxLength",2),M([I],ml.prototype,"color",2),M([I],ml.prototype,"fontStyle",2),M([I],ml.prototype,"fontWeight",2),M([I],ml.prototype,"fontSize",2),M([I],ml.prototype,"fontFamily",2),M([I],ml.prototype,"formatter",2);var Fd=class extends we{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};M([I],Fd.prototype,"shape",2),M([I],Fd.prototype,"size",2),M([I],Fd.prototype,"padding",2),M([I],Fd.prototype,"strokeWidth",2),M([I],Fd.prototype,"enabled",2);var vM=class extends we{};M([I],vM.prototype,"strokeWidth",2),M([I],vM.prototype,"length",2);var xl=class extends we{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new Fd,this.label=new ml,this.line=new vM}};M([I],xl.prototype,"maxWidth",2),M([I],xl.prototype,"paddingX",2),M([I],xl.prototype,"paddingY",2),M([I],xl.prototype,"showSeriesStroke",2),M([I],xl.prototype,"marker",2),M([I],xl.prototype,"label",2),M([I],xl.prototype,"line",2);var SM=class extends we{};M([I],SM.prototype,"legendItemClick",2),M([I],SM.prototype,"legendItemDoubleClick",2);var bN={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1},vN={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:1,rotation:0,scale:1},SN={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},yi=class extends we{constructor(e){super(),this.ctx=e,this.id=ns(this),this.group=new As({name:"legend",zIndex:16}),this.itemSelection=Ts.select(this.group,Jn),this.containerNode=this.group.appendChild(new Ti({name:"legend-container"})),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new xl,this.listeners=new SM,this.enabled=!0,this.position="bottom",this.border=new $c(this.containerNode),this.cornerRadius=0,this.fillOpacity=1,this.padding=4,this.spacing=20,this.cleanup=new mt,this.size=[0,0],this._visible=!0,this.pagination=new Uc(i=>e.updateService.update(i),i=>this.updatePageNumber(i)),this.pagination.attachPagination(this.group);const{items:t}=e.contextMenuRegistry.builtins;t["toggle-series-visibility"].action=i=>this.contextToggleVisibility(i),t["toggle-other-series"].action=i=>this.contextToggleOtherSeries(i),this.cleanup.register(e.eventsHub.on("legend:change",this.onLegendDataChange.bind(this)),e.layoutManager.registerElement(1,i=>this.positionLegend(i)),e.eventsHub.on("locale:change",()=>this.onLocaleChanged()),()=>delete t["toggle-series-visibility"].action,()=>delete t["toggle-other-series"].action,()=>this.group.remove()),this.domProxy=new jU(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(e.legendManager)}set data(e){Ci(e,this._data)||(this.domProxy.onDataUpdate(this._data,e),this._data=e,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:e=[]}){this.enabled&&(this.data=e.filter(t=>!t.hideInLegend))}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.cleanup.flush(),this.itemSelection.clear()}getOrientation(){return this.orientation??"horizontal"}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(e){e.appendChild(this.group)}getItemLabel(e){const{formatter:t}=this.item.label;if(t){const i=e.datum;return this.cachedCallWithContext(t,{itemId:e.itemId,value:e.label.text,seriesId:e.seriesId,...i&&{datum:i}})}return e.label.text}calcLayout(e,t){const{paddingX:i,paddingY:s,label:n,maxWidth:o,label:{maxLength:a=1/0,fontStyle:r,fontWeight:l,fontSize:c,fontFamily:h}}=this.item,d=[...this.data];this.reverseOrder&&d.reverse(),this.itemSelection.update(d);const u=[],p=qr.getMeasurer({font:n}),f=o??e*.8,{markerWidth:x,anyLineEnabled:m}=this.calculateMarkerWidth();if(this.itemSelection.each((N,w)=>{N.fontStyle=r,N.fontWeight=l,N.fontSize=c,N.fontFamily=h;const O=this.updateMarkerLabel(N,w,x,m),R=w.itemId??w.id,P=(this.getItemLabel(w)??"<unknown>").replace(/\r?\n/g," ");N.text=this.truncate(P,a,f,O,p,R),u.push(N.getTextMeasureBBox())}),e=Math.max(1,e),t=Math.max(1,t),!isFinite(e))return{};[e,t]=this.updateContainer(e,t);const b=this.size,v=this.oldSize;b[0]=e,b[1]=t,(b[0]!==v[0]||b[1]!==v[1])&&(v[0]=b[0],v[1]=b[1]);const{pages:S,maxPageHeight:D,maxPageWidth:C}=this.updatePagination(u,e,t),T=this.pages;this.pages=S,this.maxPageSize=[C-i,D-s];const k=this.pagination.currentPage,L=this.pages[k];return this.pages.length<1||!L?(this.visible=!1,{oldPages:T}):(this.visible=!0,this.updatePositions(k),this.update(),{oldPages:T})}isCustomMarker(e,t){return e&&t!==void 0&&typeof t!="string"}calcSymbolsEnabled(e){const{showSeriesStroke:t,marker:i}=this.item,s=!!i.enabled||!t||(e.marker.enabled??!0),n=!!(e.line&&t),o=this.isCustomMarker(s,e.marker.shape);return{markerEnabled:s,lineEnabled:n,isCustomMarker:o}}calcSymbolsLengths(e,t,i){const{marker:s,line:n}=this.item;let o;const{shape:a}=e.marker;if(this.isCustomMarker(t,a)){const c=new wi;c.shape=a,c.updatePath();const h=c.getBBox();o=Math.max(h.width,h.height)}const r=t?s.size:0,l=i?n.length??25:0;return{markerLength:r,lineLength:l,customMarkerSize:o}}calculateMarkerWidth(){let e=0,t=!1;return this.itemSelection.each((i,s)=>{const{symbol:n}=s,{lineEnabled:o,markerEnabled:a}=this.calcSymbolsEnabled(n),{markerLength:r,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(n,a,o);e=Math.max(e,l,c,r),t||(t=o)}),{markerWidth:e,anyLineEnabled:t}}updateMarkerLabel(e,t,i,s){const{marker:n,paddingX:o}=this.item,{symbol:a}=t;let r=o;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(a),h=n.padding;(l||s)&&(r+=h+i);const{marker:d,line:u}=e;return d.visible=l,d.visible&&(d.shape=n.shape??a.marker.shape??"square",d.size=n.size,or(d,this.getMarkerStyles(a))),u.visible=s,u.visible&&or(u,this.getLineStyles(a)),e.length=i,e.spacing=h,e.isCustomMarker=c,r}updateContainer(e,t){const i=this.getContainerStyles();return this.containerNode.width=0,this.containerNode.height=0,or(this.containerNode,i),this.containerNode.cornerRadius=i.cornerRadius,e-=i.strokeWidth*2+i.padding.left+i.padding.right,t-=i.strokeWidth*2+i.padding.top+i.padding.bottom,[e,t]}truncate(e,t,i,s,n,o){let a=!1;e.length>t&&(e=e.substring(0,t),a=!0);const r=ep.truncateLine(e,n,i-s,a);return r.endsWith(ut.EllipsisChar)?this.truncatedItems.add(o):this.truncatedItems.delete(o),r}updatePagination(e,t,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,e.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:o,maxPageHeight:a,maxPageWidth:r,paginationBBox:l,paginationVertical:c}=this.calculatePagination(e,t,i),h=o.findIndex(v=>v.endIndex>=n);this.pagination.currentPage=ve(0,h,o.length-1);const{paddingX:d,paddingY:u}=this.item,p=8,g=r-d,f=a-u;let x=0,m=-l.y-this.item.marker.size/2;c?m+=f+p:(x+=-l.x+g+p,m+=(f-l.height)/2),this.pagination.translationX=x,this.pagination.translationY=m,this.pagination.update(),this.pagination.updateMarkers();let b=0;return this.itemSelection.each((v,S,D)=>{D>(o[b]?.endIndex??1/0)&&b++,v.pageIndex=b}),{maxPageHeight:a,maxPageWidth:r,pages:o}}calculatePagination(e,t,i){const{paddingX:s,paddingY:n}=this.item,o=["left","left-top","left-bottom","right","right-top","right-bottom"],{placement:a}=Lm(this.position),r=this.getOrientation(),l=o.includes(a);let c=this.pagination.getBBox(),h=new de(0,0,0,0),d=[],u=0,p=0,g=0;const f=m=>m.width===c.width&&m.height===c.height,x=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(g++>10){X.warn("unable to find stable legend layout.");break}c=h;const m=t-(l?0:c.width),b=i-(l?c.height:0),v=BU({orientation:r,bboxes:e,maxHeight:b,maxWidth:m,itemPaddingY:n,itemPaddingX:s,forceResult:x});d=v?.pages??[],u=v?.maxPageWidth??0,p=v?.maxPageHeight??0;const S=d.length;if(this.pagination.visible=S>1,this.pagination.totalPages=S,this.pagination.update(),this.pagination.updateMarkers(),h=this.pagination.getBBox(),!this.pagination.visible)break}while(!f(h));return{maxPageWidth:u,maxPageHeight:p,pages:d,paginationBBox:h,paginationVertical:l}}updatePositions(e=0){const{item:{paddingY:t},itemSelection:i,pages:s}=this;if(s.length<1||!s[e])return;const{columns:n,startIndex:o,endIndex:a}=s[e];let r=0,l=0;const c=n.length,h=n[0].indices.length,d=this.getOrientation()==="horizontal",u=n[0].bboxes[0].height+t,p=[];i.each((g,f,x)=>{if(x<o||x>a){g.visible=!1;return}const m=x-o;let b,v;d?(b=m%c,v=Math.floor(m/c)):(b=Math.floor(m/h),v=m%h),g.visible=!0;const S=n[b];S&&(l=Math.floor(u*v),r=Math.floor(p[v]??0),p[v]=(p[v]??0)+S.columnWidth,g.translationX=r,g.translationY=l)})}updatePageNumber(e){const{itemSelection:t,group:i,pagination:s,pages:n,toggleSeries:o}=this,{startIndex:a,endIndex:r}=n[e];a===0?this.paginationTrackingIndex=0:e===n.length-1?this.paginationTrackingIndex=r:this.paginationTrackingIndex=Math.floor((a+r)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(e),this.domProxy.onPageChange({itemSelection:t,group:i,pagination:s,interactive:o}),this.ctx.updateService.update(7)}update(){const{label:{color:e}}=this.item;this.itemSelection.each((t,i)=>{t.setEnabled(i.enabled),t.color=e}),this.updateContextMenu()}updateContextMenu(){this.ctx.contextMenuRegistry.setVisible("toggle-series-visibility",this.toggleSeries),this.ctx.contextMenuRegistry.setVisible("toggle-other-series",this.toggleSeries)}getLineStyles(e){const{stroke:t,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=e.line??{},o=Math.min(2,s??1);return{stroke:t,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??o,lineDash:n}}getMarkerStyles({marker:e}){const{fill:t,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:o,lineDash:a,lineDashOffset:r}=e,l=Math.min(2,o??1);return Yr(t)&&(t.width=8,t.height=8,t.padding=1,t.strokeWidth=Math.min(2,t.strokeWidth??2)),gc(t)&&(t.fit="contain",t.width=void 0,t.height=void 0,t.repeat="no-repeat"),ma({fill:t,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:a,lineDashOffset:r},bN,vN,SN)}getContainerStyles(){const{stroke:e,strokeOpacity:t,strokeWidth:i}=this.border,{cornerRadius:s,fill:n,fillOpacity:o,padding:a}=this,r=typeof a=="number";return ma({cornerRadius:s,fill:n,fillOpacity:o,padding:{top:r?a:a.top??0,right:r?a:a.right??0,bottom:r?a:a.bottom??0,left:r?a:a.left??0},stroke:e,strokeOpacity:t,strokeWidth:this.border.enabled?i:0},bN,vN,SN)}computePagedBBox(){const e=Re.computeChildrenBBox(this.group.excludeChildren({name:"legend-container"}));if(this.pages.length>1){const[s,n]=this.maxPageSize;e.height=Math.max(n,e.height),e.width=Math.max(s,e.width)}const{strokeWidth:t,padding:i}=this.getContainerStyles();return e.grow(i).grow(t),e}findNode(e){const{datum:t,proxyButton:i}=this.itemSelection.select(s=>s.datum?.itemId===e.itemId)[0]??{};if(t===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${t}, proxyButton: ${JSON.stringify(i)} }`);return{datum:t,proxyButton:i}}contextToggleVisibility(e){const{datum:t,proxyButton:i}=this.findNode(e);this.doClick(e.event,t,i)}contextToggleOtherSeries(e){this.doDoubleClick(e.event,this.findNode(e).datum)}onContextClick(e,t){const{sourceEvent:i}=e,s=t.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&&this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries!==!0;this.ctx.contextMenuRegistry.setVisible("toggle-other-series",n);const{offsetX:o,offsetY:a}=i,{x:r,y:l}=Gt.toCanvasPoint(t,o,a);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:e,canvasX:r,canvasY:l},{legendItem:s})}onClick(e,t,i){this.doClick(e,t,i)&&e.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(e=>e.getLegendData("category")).filter(e=>e.enabled).length}doClick(e,t,i){const{listeners:{legendItemClick:s},ctx:{chartService:n,highlightManager:o},preventHidingAll:a,toggleSeries:r}=this;if(!t)return!1;const{legendType:l,seriesId:c,itemId:h,enabled:d,legendItemName:u}=t,p=n.series.find(x=>x.id===c);if(!p)return!1;let g=d;const f=xN("click",t,e);return s&&Lo([p.properties,this.ctx.chartService],s,f.apiEvent),f.defaultPrevented||(r&&(g=!d,a&&!g&&this.getVisibleItemCount()<2&&(g=!0),i.setChecked(g),this.ctx.eventsHub.emit("legend:item-click",{legendType:l,series:p,itemId:h,enabled:g,legendItemName:u})),g?o.updateHighlight(this.id,{series:p,itemId:h,datum:void 0,datumIndex:void 0,legendItemName:u}):o.updateHighlight(this.id),this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0,skipAnimations:t.skipAnimations??!1})),!0}onDoubleClick(e,t){this.doDoubleClick(e,t)&&e.preventDefault()}doDoubleClick(e,t){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:n}=this;if(!t)return!1;const{legendType:o,id:a,itemId:r,seriesId:l}=t,c=s.series.find(d=>d.id===a);if(!c)return!1;const h=xN("dblclick",t,e);if(i&&Lo([c.properties,this.ctx.chartService],i,h.apiEvent),h.defaultPrevented)return!0;if(n){const d=s.series.flatMap(f=>f.getLegendData("category"));let u=0;const p=new Set;for(const f of d)f.enabled&&(u+=1,f.legendItemName!=null&&p.add(f.legendItemName));p.size>0&&(u=p.size);const g=d.find(f=>f.itemId===r&&f.seriesId===l);this.ctx.eventsHub.emit("legend:item-double-click",{legendType:o,series:c,itemId:r,numVisibleItems:u,enabled:g?.enabled??!1,legendItemName:g?.legendItemName})}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(e,t){let i;return e instanceof FocusEvent?i=Gt.toCanvas(t).computeCenter():(e.preventDefault(),i=Gt.toCanvasPoint(t,e.offsetX,e.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}onHover(e,t){if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(t.pageIndex);const i=t.datum,s=i?this.ctx.chartService.series.find(n=>n.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const n=this.toTooltipMeta(e,t);this.ctx.tooltipManager.updateTooltip(this.id,n,[{type:"structured",title:this.getItemLabel(i)}])}else this.ctx.tooltipManager.removeTooltip(this.id);i?.enabled&&s?this.updateHighlight({series:s,itemId:i?.itemId,datum:void 0,datumIndex:void 0,legendItemName:i?.legendItemName}):this.updateHighlight()}onLeave(){this.ctx.tooltipManager.removeTooltip(this.id),this.updateHighlight()}updateHighlight(e){this.ctx.interactionManager.isState(32)?this.ctx.highlightManager.updateHighlight(this.id,e):this.ctx.interactionManager.isState(2)&&(this.pendingHighlightDatum=e,this.ctx.animationManager.onBatchStop(()=>{this.ctx.highlightManager.updateHighlight(this.id,this.pendingHighlightDatum)}))}onLocaleChanged(){this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(e){const t=this.positionLegendScene(e);this.positionLegendDOM(t)}positionLegendScene(e){if(!this.enabled||!this.data.length)return;const{placement:t,floating:i,xOffset:s,yOffset:n}=Lm(this.position),o=i?new de(0,0,e.width,e.height):e.layoutBox,{x:a,y:r,width:l,height:c}=o,[h,d]=this.calculateLegendDimensions(o),{oldPages:u}=this.calcLayout(h,d),p=this.computePagedBBox();if(this.visible){let f=function(v){};var g=f;const x=this.spacing;let m,b;switch(t){case"top":m=(l-p.width)/2,b=0;break;case"bottom":m=(l-p.width)/2,b=c-p.height;break;case"right":m=l-p.width,b=(c-p.height)/2;break;case"left":m=0,b=(c-p.height)/2;break;case"top-right":case"right-top":m=l-p.width,b=0;break;case"top-left":case"left-top":m=0,b=0;break;case"bottom-right":case"right-bottom":m=l-p.width,b=c-p.height;break;case"bottom-left":case"left-bottom":m=0,b=c-p.height;break;default:f(t)}if(!i){let v,S;switch(t){case"top":case"top-right":case"top-left":v=p.height+x,S="top";break;case"bottom":case"bottom-right":case"bottom-left":v=p.height+x,S="bottom";break;case"left":case"left-top":case"left-bottom":v=p.width+x,S="left";break;case"right":case"right-top":case"right-bottom":v=p.width+x,S="right";break;default:f(t)}o.shrink(v,S)}m+=s,b+=n,this.group.translationX=Math.floor(a+m-p.x),this.group.translationY=Math.floor(r+b-p.y),this.containerNode.x=p.x,this.containerNode.y=p.y,this.containerNode.width=p.width,this.containerNode.height=p.height}return u}positionLegendDOM(e){const{ctx:t,itemSelection:i,pagination:s,pages:n,toggleSeries:o,group:a,listeners:{legendItemClick:r,legendItemDoubleClick:l}}=this,c=this.visible&&this.enabled,h=o||l!=null||r!=null;this.domProxy.update({visible:c,interactive:h,ctx:t,itemSelection:i,group:a,pagination:s,oldPages:e,newPages:n,datumReader:this,itemListener:this})}calculateLegendDimensions(e){const{width:t,height:i}=e,{placement:s}=Lm(this.position),n=t/i,o=.5,a=.2,r=.25;let l,c;function h(d){}switch(s){case"top":case"top-left":case"top-right":case"bottom":case"bottom-left":case"bottom-right":{const d=n<1?Math.min(o,a*(1/n)):a;l=this.maxWidth?Math.min(this.maxWidth,t):t,c=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*d);break}case"left":case"left-top":case"left-bottom":case"right":case"right-top":case"right-bottom":{const d=n>1?Math.min(o,r*n):r;l=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*d),c=this.maxHeight?Math.min(this.maxHeight,i):i;break}default:}return[l,c]}cachedCallWithContext(e,...t){const{callbackCache:i,chartService:s}=this.ctx;return i.call([this,s],e,...t)}};yi.className="Legend",M([I],yi.prototype,"toggleSeries",2),M([I],yi.prototype,"pagination",2),M([I],yi.prototype,"item",2),M([I],yi.prototype,"listeners",2),M([Xr((e,t,i)=>{if(e.updateGroupVisibility(),t===i)return;const{ctx:{legendManager:s,stateManager:n}}=e;i===!1&&t===!0&&n.restoreState(s)}),I],yi.prototype,"enabled",2),M([I],yi.prototype,"position",2),M([I],yi.prototype,"maxWidth",2),M([I],yi.prototype,"maxHeight",2),M([I],yi.prototype,"reverseOrder",2),M([I],yi.prototype,"orientation",2),M([I],yi.prototype,"preventHidingAll",2),M([I],yi.prototype,"border",2),M([I],yi.prototype,"cornerRadius",2),M([I],yi.prototype,"fill",2),M([I],yi.prototype,"fillOpacity",2),M([I],yi.prototype,"padding",2),M([I],yi.prototype,"spacing",2),M([I],yi.prototype,"xOffset",2),M([I],yi.prototype,"yOffset",2);var HU={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new yi(e),packageType:"community",removable:"standalone-only"},cg=class extends we{constructor(e){super(),this.ctx=e,this.rectNode=new Ti,this.border=new $c(this.rectNode),this.cornerRadius=0,this.padding=0,this.cleanup=new mt,this.node=this.createNode(),this.node.append([this.rectNode]),this.rectNode.fill=void 0,this.cleanup.register(e.scene.attachNode(this.node),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)))}destroy(){this.cleanup.flush()}getPadding(){const{border:e,padding:t}=this,i=e.enabled?e.strokeWidth:0;if(typeof t=="number"){const s=t+i;return{top:s,right:s,bottom:s,left:s}}return{top:(t.top??0)+i,right:(t.right??0)+i,bottom:(t.bottom??0)+i,left:(t.left??0)+i}}createNode(){return new Re({name:"series-area-container",zIndex:4})}onLayoutComplete(e){const{x:t,y:i,width:s,height:n}=e.series.paddedRect;this.rectNode.x=t,this.rectNode.y=i,this.rectNode.width=s,this.rectNode.height=n}};M([I],cg.prototype,"border",2),M([I],cg.prototype,"clip",2),M([ni("rectNode","cornerRadius"),I],cg.prototype,"cornerRadius",2),M([I],cg.prototype,"padding",2);var WU={type:"root",optionsKey:"seriesArea",packageType:"community",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new cg(e)};function wm(e,t,i,s,n){const o=(d,u,p,g)=>{i.animate({id:`${e}_${t}_${u.id}_${d}`,groupId:e,from:p?1:0,to:1,ease:rp,collapsable:p,onUpdate(f,x){x&&d!=="removed"||(u.path.clear(!0),g(f,u),u.checkPathDirty())},onStop(){d==="added"&&(u.path.clear(!0),g(1,u),u.checkPathDirty())},phase:Eo[d]})},a=new ks,r=d=>(a.resetPathDirty(),d(0,a),a.resetPathDirty(),d(1,a),a.checkPathDirty(),a.isPathDirty()),{addPhaseFn:l,updatePhaseFn:c,removePhaseFn:h}=n;for(const d of s)i.isSkipped()||(o("removed",d,!r(h),h),o("updated",d,!r(c),c)),o("added",d,!r(l),l)}function Da(e,t,i,s,n,o){if(s.itemStyler){const a={border:s.border,color:s.color,cornerRadius:s.cornerRadius,datum:t?.datum,enabled:s.enabled,fill:s.fill,fillOpacity:s.fillOpacity,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,itemId:void 0,seriesId:e.id,padding:s.padding,highlighted:n,highlightState:o};return et(e.callWithContext(s.itemStyler,{...i,...a}),a)}return s}function MN(e,t,i,s,n,o,a){if(s.enabled&&n){const r=Da(e,n,i,s,o,a);t.visible=!0,t.x=n.x,t.y=n.y,t.text=n.text,t.fill=r.color,t.setAlign(n),t.setFont(r),t.setBoxing(r)}else t.visible=!1}var $U={"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 DN({isUpward:e,isVertical:t,placement:i,spacing:s=0,rect:n}){let o=n.x+n.width/2,a=n.y+n.height/2,r="center",l="middle";if(i!=="inside-center"){const c=(e?1:-1)*(t?-1:1),{direction:h,textAlignment:d}=$U[i],u=(h+1)*.5;if(t){const p=e?n.y+n.height:n.y,g=n.height*c;a=p+g*u+s*d*c,l=d===c?"top":"bottom"}else{const p=e?n.x:n.x+n.width,g=n.width*c;o=p+g*u+s*d*c,r=d===c?"left":"right"}}return{x:o,y:a,textAlign:r,textBaseline:l}}function oi({id:e},t,i,...s){for(const n of s)n.cleanup();tr(e,t,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function Nm({id:e},t,i,...s){tr(e,t,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function Yc(e){return{opacity:1}}var MM=class extends we{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},Aa=class extends MM{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};M([I,te()],Aa.prototype,"enabled",2),M([I,te()],Aa.prototype,"color",2),M([I,te()],Aa.prototype,"xOffset",2),M([I,te()],Aa.prototype,"yOffset",2),M([I,te()],Aa.prototype,"blur",2);var Xi=class extends MM{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillGradientDefaults=new Kn,this.fillPatternDefaults=new Tt,this.fillImageDefaults=new Qs,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};M([I,te()],Xi.prototype,"enabled",2),M([I,mn({equals:_h})],Xi.prototype,"shape",2),M([I,te()],Xi.prototype,"size",2),M([I,mn({equals:Ci})],Xi.prototype,"fill",2),M([I],Xi.prototype,"fillGradientDefaults",2),M([I],Xi.prototype,"fillPatternDefaults",2),M([I],Xi.prototype,"fillImageDefaults",2),M([I,te()],Xi.prototype,"fillOpacity",2),M([I,te()],Xi.prototype,"stroke",2),M([I,te()],Xi.prototype,"strokeWidth",2),M([I,te()],Xi.prototype,"strokeOpacity",2),M([I],Xi.prototype,"lineDash",2),M([I],Xi.prototype,"lineDashOffset",2),M([I,mn({equals:_h})],Xi.prototype,"itemStyler",2);var AN=class extends we{constructor(){super(...arguments),this.enabled=!1}};M([I],AN.prototype,"enabled",2);var fr=class extends we{constructor(){super(...arguments),this.interaction=new AN,this.position=new Ac,this.range=void 0,this.class=void 0}formatTooltip(e,t,i){const s=this.renderer==null?void 0:Lo(e,this.renderer,i);return typeof s=="string"?{type:"raw",rawHtmlString:s}:s!=null?{type:"structured",...t,...s}:{type:"structured",...t}}};M([I],fr.prototype,"enabled",2),M([I],fr.prototype,"showArrow",2),M([I],fr.prototype,"renderer",2),M([I],fr.prototype,"interaction",2),M([I],fr.prototype,"position",2),M([I],fr.prototype,"range",2),M([I],fr.prototype,"class",2);function Kc(){return new fr}var IN=class{constructor(e,t,i){this.root=new KU(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(s,n)=>e.distanceSquared(s,n)};this.root.addElem(i)}find(e,t){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(e,t,i),i.best}},UU=class{constructor(e,t,i,s){this.nw=e,this.ne=t,this.sw=i,this.se=s}addElem(e){this.nw.addElem(e),this.ne.addElem(e),this.sw.addElem(e),this.se.addElem(e)}find(e,t,i){this.nw.find(e,t,i),this.ne.find(e,t,i),this.sw.find(e,t,i),this.se.find(e,t,i)}},YU=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=i??de.NaN,this.elems=[],this.subdivisions=void 0}clear(e){this.elems.length=0,this.boundary=e,this.subdivisions=void 0}addElem(e){this.addCondition(e)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length<this.capacity?this.elems.push(e):this.subdivide(e):this.subdivisions.addElem(e))}find(e,t,i){this.findCondition(e,t,i)&&(this.subdivisions===void 0?this.findAction(e,t,i):this.subdivisions.find(e,t,i))}subdivide(e){this.subdivisions=this.makeSubdivisions();for(const t of this.elems)this.subdivisions.addElem(t);this.subdivisions.addElem(e),this.elems.length=0}makeSubdivisions(){const{x:e,y:t,width:i,height:s}=this.boundary,{capacity:n}=this,o=this.maxdepth-1,a=i/2,r=s/2,l=new de(e,t,a,r),c=new de(e+a,t,a,r),h=new de(e,t+r,a,r),d=new de(e+a,t+r,a,r);return new UU(this.child(n,o,l),this.child(n,o,c),this.child(n,o,h),this.child(n,o,d))}},KU=class S_ extends YU{addCondition(t){const{x:i,y:s}=t.hitTester.midPoint;return this.boundary.containsPoint(i,s)}findCondition(t,i,s){const{best:n}=s;return n.distanceSquared!==0&&this.boundary.distanceSquared(t,i)<n.distanceSquared}findAction(t,i,s){const n=Yf(t,i,this.elems,s.best.distanceSquared);n.nearest!==void 0&&n.distanceSquared<s.best.distanceSquared&&(s.best=n)}child(t,i,s){return new S_(t,i,s)}},DM=class extends Hy{constructor({clipFocusBox:e,categoryKey:t,...i}){super(i),this.categoryKey=t,this.clipFocusBox=e??!0}dataCount(){return this.processedData?.dataSources?.get(this.id)?.length??0}getScaleInformation({xScale:e,yScale:t}){const i=ft.is(e),s=ft.is(t);return{isContinuousX:i,isContinuousY:s,xScaleType:e?.type,yScaleType:t?.type}}getModulePropertyDefinitions(){const e=this.axes.x?.scale,t=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:e,yScale:t}))).flat()}async requestDataModel(e,t,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=await e.request(this.id,t??[],i);return this.dataModel=s,this.processedData=n,this.events.emit("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}}isProcessedDataAnimatable(){const{processedData:e}=this;if(!e)return!1;const t=e.reduced?.animationValidation;if(!t)return!0;const{orderedKeys:i,uniqueKeys:s}=t;return i&&s}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(e){const t=this.getNodeData();if(t===void 0||t.length===0)return;const i=this.computeFocusDatumIndex(e,t);if(i===void 0)return;const{clipFocusBox:s}=this,n=t[i],o={...e,datumIndex:i},a=this.computeFocusBounds(o);if(a!==void 0)return{bounds:a,clipFocusBox:s,datum:n,datumIndex:i}}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort((i,s)=>i.datumIndex-s.datumIndex),t}isDatumEnabled(e,t){const{missing:i=!1,enabled:s=!0,focusable:n=!0}=e[t];return!i&&s&&n}computeFocusDatumIndex(e,t){const i=(a,r)=>{for(;a>=0&&!this.isDatumEnabled(t,a);)a+=r;return a===-1?void 0:a},s=(a,r)=>{for(;a<t.length&&!this.isDatumEnabled(t,a);)a+=r;return a===t.length?void 0:a};let n;const o=ve(0,e.datumIndex,t.length-1);return e.datumIndexDelta<0?n=i(o,e.datumIndexDelta):e.datumIndexDelta>0?n=s(o,e.datumIndexDelta):n=s(o,1)??i(o,-1),n===void 0?e.datumIndexDelta===0?void 0:e.datumIndex-e.datumIndexDelta:n}dataModelPropertyIsKey(e){const{processedData:t}=this;return t?t.defs.keys.some(i=>i.id===e&&i.idsMap?.get(this.id)?.has(e)===!0):!1}keysOrValues(e){const{dataModel:t,processedData:i}=this;return!t||!i?[]:this.dataModelPropertyIsKey(e)?t.resolveKeysById(this,e,i):t.resolveColumnById(this,e,i)}sortOrder(e){const{dataModel:t,processedData:i}=this;if(!(!t||!i))return this.dataModelPropertyIsKey(e)?t.getKeySortOrder(this,e,i):t.getColumnSortOrder(this,e,i)}getCategoryKey(){return this.categoryKey}getCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();return!t||!i||!s||(t.invalidData?.get(this.id)?.[e]??!1)?void 0:this.keysOrValues(s)[e]}datumIndexForCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();if(!t||!i||!s)return;e=e.valueOf();const n=t.invalidData?.get(this.id),o=this.keysOrValues(s);for(let a=0;a<o.length;a+=1){if(n?.[a]===!0)continue;const r=o[a]?.valueOf();if(Ci(e,r))return a}}},zd={x:["xKey"],y:["yKey"]},_d={x:["xName"],y:["yName"]},AM=class extends Vy{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},bl=class extends Zn{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}};M([I],bl.prototype,"legendItemName",2),M([I],bl.prototype,"pickOutsideVisibleMinorAxis",2);var Em=100,Zc=class extends DM{constructor({pathsPerSeries:e=["path"],pathsZIndexSubOrderOffset:t=[],datumSelectionGarbageCollection:i=!0,animationAlwaysUpdateSelections:s=!1,animationResetFns:n,propertyKeys:o,propertyNames:a,...r}){if(super({propertyKeys:o,propertyNames:a,canHaveAxes:!0,...r}),this.NodeEvent=AM,this.dataNodeGroup=this.contentGroup.appendChild(new Re({name:`${this.id}-series-dataNodes`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new As({name:`${this.id}-series-labels`})),this.labelSelection=Ts.select(this.labelGroup,xn),this.highlightSelection=Ts.select(this.highlightGroup,()=>this.nodeFactory()),this.annotationSelections=new Set,this.debug=Be.create(),!o||!a)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:e,pathsZIndexSubOrderOffset:t,propertyKeys:o,propertyNames:a,animationResetFns:n,animationAlwaysUpdateSelections:s,datumSelectionGarbageCollection:i},this.paths=e.map(l=>new ks({name:`${this.id}-${l}`})),this.datumSelection=Ts.select(this.dataNodeGroup,()=>this.nodeFactory(),i),this.animationState=new up("empty",{empty:{update:{target:"ready",action:l=>this.animateEmptyUpdateReady(l)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:l=>this.animateReadyHighlight(l),resize:l=>this.animateReadyResize(l),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:l=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(l):this.animateWaitingUpdateReady(l)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:l=>this.resetAllAnimation(l),reset:"empty"},clearing:{update:{target:"empty",action:l=>this.animateClearingUpdateEmpty(l)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),this.attachPaths(this.paths)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.detachPaths(this.paths)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(e){for(const t of e)this.contentGroup.appendChild(t)}detachPaths(e){for(const t of e)this.contentGroup.removeChild(t)}renderToOffscreenCanvas(){const e=this.getNodeData();return e!=null&&e.length>Em}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"?this.animationState.transition("skip"):e==="disabled"&&this.animationState.transition("disable")}addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",e=>this.onLegendItemClick(e)),this.ctx.eventsHub.on("legend:item-double-click",e=>this.onLegendItemDoubleClick(e)))}destroy(){super.destroy(),this._contextNodeData=void 0}isSeriesHighlighted(e){const{series:t,legendItemName:i}=e??{},{legendItemName:s}=this.properties;return t===this||s!=null&&s===i}strokewidthChange(){const e=("strokeWidth"in this.properties&&this.properties.strokeWidth)??0,t=this.properties.highlight.highlightedSeries.strokeWidth??e,i=this.properties.highlight.highlightedItem?.strokeWidth??e;return e>i||t>i}update({seriesRect:e}){const{_contextNodeData:t}=this,i=this.checkResize(e),s=this.updateHighlightSelection();this.contentGroup.batchedUpdate(()=>{const o=this.updateSelections();this.updateNodes(s,i||o)});const n=this.getAnimationData(e,t);n&&(i&&this.animationState.transition("resize",n),this.animationState.transition("update",n))}updateSelections(){var e;const t=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!this.visible&&t)return!1;const{nodeDataRefresh:i}=this;if(!i&&!this.isPathOrSelectionDirty())return!1;if(i){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const s=this.isProcessedDataAnimatable();this._contextNodeData&&((e=this._contextNodeData).animationValid??(e.animationValid=s));const{dataModel:n,processedData:o}=this;n!==void 0&&o!==void 0&&this.events.emit("data-update",{dataModel:n,processedData:o}),this.updateSeriesSelections()}return i}updateSeriesSelections(){const{datumSelection:e,labelSelection:t,paths:i}=this,s=this._contextNodeData;if(!s)return;const{nodeData:n,labelData:o,itemId:a}=s;this.updatePaths({itemId:a,contextData:s,paths:i}),this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:e}),this.labelGroup.batchedUpdate(()=>{this.labelSelection=this.updateLabelSelection({labelData:o,labelSelection:t})??t})}getShapeFillBBox(){const{axes:e}=this,t=e.x,i=e.y,[s,n]=Vi(t?.range??[0,1]),[o,a]=Vi(i?.range??[0,1]),r=this.getSeriesDomain("x"),l=[t?.scale.convert(r.at(0)),t?.scale.convert(r.at(-1))],c=this.getSeriesDomain("y"),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[d,u]=Vi(l),[p,g]=Vi(h);return{axis:new de(s,o,n-s,a-o),series:new de(d,p,u-d,g-p)}}updateNodes(e,t){const{highlightSelection:i,datumSelection:s}=this,n=!this.ctx.animationManager.isSkipped(),o=this.visible&&this._contextNodeData!=null;this.contentGroup.visible=n||o,this.highlightGroup.visible=(n||o)&&e,this.updateDatumNodes({datumSelection:i,isHighlight:!0}),this.animationState.transition("highlight",i);const{dataNodeGroup:a,labelSelection:r,paths:l,labelGroup:c}=this,{itemId:h}=this.contextNodeData??{};if(this.updatePathNodes({itemId:h,paths:l,visible:o,animationEnabled:n}),a.visible=n||o,c.visible=o,!a.visible)return;const d=this.strokewidthChange()||this.hasChangesOnHighlight;(t||d)&&(this.updateDatumNodes({datumSelection:s,isHighlight:!1}),this.usesPlacedLabels||this.labelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:r,isHighlight:!1})}))}getHighlightLabelData(e,t){const i=e.filter(s=>s.datum===t.datum&&s.itemId===t.itemId);return i.length===0?void 0:i}getHighlightData(e,t){return t?[t]:void 0}updateHighlightSelection(){const{highlightSelection:e,_contextNodeData:t}=this;if(!t)return!1;const i=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(i)&&i?.datum?i:void 0;if(n==null)return!1;const{nodeData:o}=t,a=this.getHighlightData(o,n);return this.highlightSelection=this.updateHighlightSelectionItem({items:a,highlightSelection:e}),!0}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:e}of this.datumSelection)e.datum.missing!==!0&&(yield e)}getQuadTree(){if(this.quadtree===void 0){const{width:e,height:t}=this.ctx.scene.canvas,i=new de(0,0,e,t);this.quadtree=new IN(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);if(t.length!==0)return t;const{x:i,y:s}=e,{dataNodeGroup:n}=this,o=n.pickNodes(i,s).filter(a=>a.datum.missing!==!0);if(o.length!==0)return o.map(r=>r.datum);for(const a of this.moduleMap.modules()){const{datum:r}=a.pickNodeExact(e)??{};if(r!=null&&r?.missing!==!0)return[r]}return[]}pickNodeClosestDatum(e){const{x:t,y:i}=e,{axes:s,_contextNodeData:n}=this;if(!n)return;const o=s.x,a=s.y,r={x:t,y:i};let l=1/0,c;for(const h of n.nodeData){const{point:{x:d=NaN,y:u=NaN}={}}=h;if(isNaN(d)||isNaN(u)||!(o?.inRange(d)&&a?.inRange(u)))continue;const g=Math.max((r.x-d)**2+(r.y-u)**2,0);g<l&&(l=g,c=h)}for(const h of this.moduleMap.modules()){const d=h.pickNodeNearest(e);if(d!==void 0&&d.distanceSquared<l){l=d.distanceSquared,c=d.datum;break}}if(c){const h=Math.max(Math.sqrt(l)-(c.point?.size??0)/2,0);return{datum:c,distance:h}}}pickNodeMainAxisFirst(e,t){const{x:i,y:s}=e,{axes:n,_contextNodeData:o}=this,{pickOutsideVisibleMinorAxis:a}=this.properties;if(!o)return;const r=n.x,l=n.y;if(r==null||l==null)return;const c=[r,l].filter(g=>g.isCategoryLike()).map(g=>g.direction);if(t&&c.length===0)return;const[h="x"]=c,d=[i,s];h!=="x"&&d.reverse();const u=[1/0,1/0];let p;for(const g of o.nodeData){const{x:f=NaN,y:x=NaN}=g.point??g.midPoint??{};if(isNaN(f)||isNaN(x)||g.missing===!0)continue;const m=[r?.inRange(f,1),l?.inRange(x,1)];if(h!=="x"&&m.reverse(),!m[0]||!a&&!m[1])continue;const b=[f,x];h!=="x"&&b.reverse();let v=!0;for(let S=0;S<b.length;S++){const D=Math.abs(b[S]-d[S]);if(D>u[S]){v=!1;break}else D<u[S]&&(u[S]=D,u.fill(1/0,S+1,u.length))}v&&(p=g)}if(p){let g=Math.max(u[0]**2+u[1]**2-(p.point?.size??0),0);for(const f of this.moduleMap.modules()){const x=f.pickNodeMainAxisFirst(e,h);if(x!==void 0&&x.distanceSquared<g){p=x.datum,g=x.distanceSquared;break}}return{datum:p,distance:Math.sqrt(g)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRangeIndices(e,t,i,s){let n;if(s==null){const{processedData:c,dataModel:h}=this;n=h.getColumnSortOrder(this,e,c)??1}else n=s.sortOrder;const o=this.keysOrValues(e),a=0,[r,l]=qT(n,i?.length??o.length,t,c=>{const h=i?.[c]??c;return this.xCoordinateRange(o[h],a,h)});return r<l?[r,l]:[l,r]}domainForVisibleRange(e,t,i,s,n){const{processedData:o,dataModel:a}=this,[r,l]=s,c=this.keysOrValues(i),h=this.sortOrder(i);if(h!=null){const g=this.visibleRangeIndices(i,s,n,{sortOrder:h});return a.getDomainBetweenRange(this,t,g,o)}const d=t.map(g=>this.keysOrValues(g));let u=1/0,p=-1/0;return c.forEach((g,f)=>{const[x,m]=this.xCoordinateRange(g,0,f);if(!(m<r||x>l))for(let b=0;b<t.length;b++){const v=d[b][f];u=Math.min(u,v),p=Math.max(p,v)}}),u>p?[NaN,NaN]:[u,p]}domainForClippedRange(e,t,i){const{processedData:s,dataModel:n,axes:o}=this,r=ZU(o[e==="x"?"y":"x"]);if(!r)return t.flatMap(g=>n.getDomain(this,g,"value",s));const l=this.keysOrValues(i),c=n.getColumnSortOrder(this,i,s);if(c!=null){const g=XU(c,l.length,r,f=>l[f]);return n.getDomainBetweenRange(this,t,g,s)}const h=t.map(g=>this.keysOrValues(g)),d=r[0].valueOf(),u=r[1].valueOf(),p=[];return l.forEach((g,f)=>{const x=g.valueOf();if(x<d||x>u)return;const m=h.map(b=>b[f]);x>=d&&p.push(...m),x<=u&&p.push(...m)}),p}countVisibleItems(e,t,i,s,n){const{dataModel:o,processedData:a}=this;if(!o||!a)return 1/0;const r=this.keysOrValues(e),l=t.map(D=>o.resolveColumnById(this,D,a)),c=this.axes.x,h=this.axes.y,d=this.shouldFlipXY();if(s==null){const D=this.sortOrder(e);if(D==null)s=[0,1];else{const C=c.scale,T=C.range;C.range=[0,1];let[k,L]=this.visibleRangeIndices(e,i,void 0,{sortOrder:D});const N=this.keysOrValues(e),w=0;this.xCoordinateRange(N[k],w,k)[0]<i[0]&&(k+=1),L<N.length&&this.xCoordinateRange(N[L],w,L)[1]>i[1]&&(L-=1);const O=Math.abs(L-k);return C.range=T,O}}const u=(D,C,T)=>D[0]+(T-C[0])/(C[1]-C[0])*(D[1]-D[0]),p=c.range,g=h.range,f=u(p,c.visibleRange,i[0]),x=u(p,c.visibleRange,i[1]),m=u(g,h.visibleRange,d?s[0]:s[1]),b=u(g,h.visibleRange,d?s[1]:s[0]),v=Math.round((i[0]+(i[1]-i[0])/2)*r.length),S=0;return QT(0,r.length-1,v,n,D=>{let[C,T]=this.xCoordinateRange(r[D],S,D),[k,L]=this.yCoordinateRange(l.map(N=>N[D]),S,D);return!Ye(C)||!Ye(T)||!Ye(k)||!Ye(L)?!1:(d&&([C,T,k,L]=[k,L,C,T]),C>=f&&T<=x&&k>=m&&L<=b)})}minTimeInterval(){let e;try{e=this.keysOrValues("xValue")}catch{}if(e==null||e.length>1e3)return;let t=1/0,i=e[0],s;for(let n=1;n<e.length;n++){const o=e[n];if(o!=null&&i!=null){const a=o.valueOf()-i.valueOf(),r=Math.sign(a);if(r===0)continue;if(s!==void 0&&r!==s)return;t=Math.min(t,Math.abs(a)),s=r}i=o}if(Number.isFinite(t))return t}updateHighlightSelectionItem(e){const{items:t,highlightSelection:i}=e,s=t??[];return this.updateDatumSelection({nodeData:s,datumSelection:i})}updateHighlightSelectionLabel(e){return this.updateLabelSelection({labelData:e.items??[],labelSelection:e.highlightLabelSelection})}updateDatumSelection(e){return e.datumSelection}updateDatumNodes(e){}updatePaths(e){e.paths.forEach(t=>t.visible=!1)}updatePathNodes(e){const{paths:t,visible:i}=e;for(const s of t)s.visible=i}resetPathAnimation(e){const{path:t}=this.opts?.animationResetFns??{};t&&e.paths.forEach(i=>{ls([i],t)})}resetDatumAnimation(e){const{datum:t}=this.opts?.animationResetFns??{};t&&ls([e.datumSelection],t)}resetLabelAnimation(e){const{label:t}=this.opts?.animationResetFns??{};t&&ls([e.labelSelection],t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(e),this.resetDatumAnimation(e),this.resetLabelAnimation(e),e.contextData?.animationValid===!1&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){const{datum:t}=this.opts?.animationResetFns??{};t&&ls([e],t)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(e,t){const{_contextNodeData:i}=this;return i?{datumSelection:this.datumSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:t,paths:this.paths,seriesRect:e}:void 0}updateLabelSelection(e){return e.labelSelection}getScaling(e){if(e instanceof J0){const{range:t,domain:i}=e;return{type:"log",convert:s=>e.convert(s),domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof ft){const{range:t,domain:i}=e;return{type:"continuous",domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof er)return{type:"category",domain:e instanceof il?e.bands:e.domain,inset:e.inset,step:e.step}}calculateScaling(){const e={};for(const t of Object.values(CS)){const i=this.axes[t];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(e[t]=s)}return e}};function ZU(e){let t,i;if((e instanceof va||e instanceof Sa)&&({min:t,max:i}=e),!(t==null&&i==null))return t??(t=-1/0),i??(i=1/0),[t,i]}function XU(e,t,i,s){const n=i[0].valueOf(),o=i[1].valueOf();let a=Gu(0,t-1,l=>{const c=e===1?l:t-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h>=n}),r=lc(0,t-1,l=>{const c=e===1?l:t-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h<=o});return a==null||r==null?[0,0]:(e===-1&&([a,r]=[t-r,t-a]),a=Math.max(a,0),r=Math.min(r+1,t),[a,r])}var Gd=class extends we{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};M([I],Gd.prototype,"type",2),M([I],Gd.prototype,"tension",2),M([I],Gd.prototype,"position",2);var Yt=class extends bl{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillGradientDefaults=new Kn,this.fillPatternDefaults=new Tt,this.fillImageDefaults=new Qs,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Gd,this.shadow=new Aa,this.marker=new Xi,this.label=new Vt,this.tooltip=Kc(),this.connectMissingData=!1}};M([I],Yt.prototype,"xKey",2),M([I],Yt.prototype,"xName",2),M([I],Yt.prototype,"yKey",2),M([I],Yt.prototype,"yName",2),M([I],Yt.prototype,"yFilterKey",2),M([I],Yt.prototype,"normalizedTo",2),M([I],Yt.prototype,"fill",2),M([I],Yt.prototype,"fillGradientDefaults",2),M([I],Yt.prototype,"fillPatternDefaults",2),M([I],Yt.prototype,"fillImageDefaults",2),M([I],Yt.prototype,"fillOpacity",2),M([I],Yt.prototype,"stroke",2),M([I],Yt.prototype,"strokeWidth",2),M([I],Yt.prototype,"strokeOpacity",2),M([I],Yt.prototype,"lineDash",2),M([I],Yt.prototype,"lineDashOffset",2),M([I],Yt.prototype,"interpolation",2),M([I],Yt.prototype,"shadow",2),M([I],Yt.prototype,"marker",2),M([I],Yt.prototype,"label",2),M([I],Yt.prototype,"tooltip",2),M([I],Yt.prototype,"connectMissingData",2);function eo(e){switch(e.type){case"linear":case"step":return[{x:e.x0,y:e.y0},{x:e.x1,y:e.y1}];case"cubic":return[{x:e.cp0x,y:e.cp0y},{x:e.cp3x,y:e.cp3y}]}}function qU(e){const t=eo(e);return t[0].x>t[1].x&&t.reverse(),t}function QU(e,t){const{x:i,y:s}=t;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s};case"step":return{type:"step",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s,stepX:i};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:i,cp0y:s,cp1x:i,cp1y:s,cp2x:i,cp2y:s,cp3x:i,cp3y:s}}}function hg(e,t,i){const[s,n]=eo(e),o=n.x!==s.x?(i.x-t.x)/(n.x-s.x):0,a=n.y!==s.y?(i.y-t.y)/(n.y-s.y):0;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:t.x,cp0y:t.y,cp1x:i.x-(e.cp2x-s.x)*o,cp1y:i.y-(e.cp2y-s.y)*a,cp2x:i.x-(e.cp1x-s.x)*o,cp2y:i.y-(e.cp1y-s.y)*a,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y,stepX:i.x-(e.stepX-s.x)*o}}}function kN(e,t,i){const{moveTo:s}=e,[n,o]=qU(e),{x:a,y:r}=n,{x:l,y:c}=o;if(i<a)return hg(e,n,n);if(t>l)return hg(e,o,o);switch(e.type){case"linear":{const h=r===c?void 0:(c-r)/(l-a),d=h==null?r:h*(t-a)+r,u=h==null?r:h*(i-a)+r;return{type:"linear",moveTo:s,x0:t,y0:d,x1:i,y1:u}}case"step":if(i<=e.stepX){const h=e.y0;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:h,stepX:i}}else if(t>=e.stepX){const h=e.y1;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:h,stepX:t}}else{const{y0:h,y1:d,stepX:u}=e;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:d,stepX:u}}case"cubic":{const h=ty(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[d,u]=Xu(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,h);const p=ty(u[0].x,u[1].x,u[2].x,u[3].x,i);return[u,d]=Xu(u[0].x,u[0].y,u[1].x,u[1].y,u[2].x,u[2].y,u[3].x,u[3].y,p),{type:"cubic",moveTo:s,cp0x:u[0].x,cp0y:u[0].y,cp1x:u[1].x,cp1y:u[1].y,cp2x:u[2].x,cp2y:u[2].y,cp3x:u[3].x,cp3y:u[3].y}}}}function JU(e){const t=[];let i=0,s=NaN,n=NaN;for(const{x:o,y:a}of e){if(i>0){const r=i===1;t.push({type:"linear",moveTo:r,x0:s,y0:n,x1:o,y1:a})}i+=1,s=o,n=a}return t}var e3={start:0,middle:.5,end:1};function t3(e,t){const i=[];let s=0,n=NaN,o=NaN;const a=typeof t=="number"?t:e3[t];for(const{x:r,y:l}of e){if(s>0){const c=s===1,h=n+(r-n)*a;i.push({type:"step",moveTo:c,x0:n,y0:o,x1:r,y1:l,stepX:h})}s+=1,n=r,o=l}return i}var Om=.05;function i3(e,t){const i=Array.isArray(e)?e:Array.from(e);if(i.length<=1)return[];const s=i.map((o,a)=>{const r=a===0?o:i[a-1],l=a===i.length-1?o:i[a+1],c=a===0||a===i.length-1;if(Math.sign(r.y-o.y)===Math.sign(l.y-o.y))return 0;if(!c){const h=Math.abs(r.y-l.y),d=Math.abs(o.y-r.y)/h,u=Math.abs(o.y-l.y)/h;if(d<=Om||1-d<=Om||u<=Om||1-u<=Om)return 0}return(l.y-r.y)/(l.x-r.x)});s[1]===0&&(s[0]*=2),s[s.length-2]===0&&(s[s.length-1]*=2);const n=[];for(let o=1;o<i.length;o+=1){const a=i[o-1],r=s[o-1],l=i[o],c=s[o],h=l.x-a.x,d=l.y-a.y;let u=h*t/3,p=h*r*t/3,g=h*t/3,f=h*c*t/3;c===0&&Math.abs(p)>Math.abs(d)&&(u*=Math.abs(d/p),p=Math.sign(p)*Math.abs(d)),r===0&&Math.abs(f)>Math.abs(d)&&(g*=Math.abs(d/f),f=Math.sign(f)*Math.abs(d)),n.push({type:"cubic",moveTo:o===1,cp0x:a.x,cp0y:a.y,cp1x:a.x+u,cp1y:a.y+p,cp2x:l.x-g,cp2y:l.y-f,cp3x:l.x,cp3y:l.y})}return n}function Oi(e,t,i){return(t-e)*i+e}function s3(e,t){const{x0:i,y0:s,x1:n,y1:o}=e,r=(o-s)/(n-i)*(t-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:t,leftCp2y:r,stepX:t,stepY0:r,stepY1:r,rightCp1x:t,rightCp1y:r,rightCp2x:n,rightCp2y:o}}function n3(e,t){const{cp0x:i,cp0y:s,cp1x:n,cp1y:o,cp2x:a,cp2y:r,cp3x:l,cp3y:c}=e,h=ty(i,n,a,l,t),[d,u]=Xu(i,s,n,o,a,r,l,c,h),p=d[3].y;return{leftCp1x:d[1].x,leftCp1y:d[1].y,leftCp2x:d[2].x,leftCp2y:d[2].y,stepX:t,stepY0:p,stepY1:p,rightCp1x:u[1].x,rightCp1y:u[1].y,rightCp2x:u[2].x,rightCp2y:u[2].y}}function o3(e){const{x0:t,y0:i,x1:s,y1:n,stepX:o}=e;return{leftCp1x:(t+o)/2,leftCp1y:i,leftCp2x:(t+o)/2,leftCp2y:i,stepX:o,stepY0:i,stepY1:n,rightCp1x:(o+s)/2,rightCp1y:n,rightCp2x:(o+s)/2,rightCp2y:n}}function CN(e,t){return e.type==="linear"?s3(e,t):e.type==="cubic"?n3(e,t):o3(e)}function TN(e,t,i,s,n,o,a){switch(t){case 0:a?e.moveTo(n,o):e.moveTo(i,s);break;case 1:a?e.lineTo(n,o):e.lineTo(i,s);break}}function LN(e,t,i,s,n,o){o?e.lineTo(t,i):e.lineTo(s,n)}function wN(e,t,i,s,n,o,a,r,l,c){c?e.cubicCurveTo(o,a,s,n,t,i):e.cubicCurveTo(s,n,o,a,r,l)}function NN(e,t,i,s,n,o,a){a?(e.lineTo(o,n),e.lineTo(o,i),e.lineTo(t,i)):(e.lineTo(o,i),e.lineTo(o,n),e.lineTo(s,n))}function dg(e,t,i,s){const[n,o]=eo(t);switch(TN(e,i,n.x,n.y,o.x,o.y,s),t.type){case"linear":LN(e,t.x0,t.y0,t.x1,t.y1,s);break;case"cubic":wN(e,t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,s);break;case"step":NN(e,t.x0,t.y0,t.x1,t.y1,t.stepX,s);break}}function EN(e,t,i){const[s,n]=eo(e),[o,a]=eo(t),r=Oi(s.x,o.x,i),l=Oi(s.y,o.y,i),c=Oi(n.x,a.x,i),h=Oi(n.y,a.y,i);return[{x:r,y:l},{x:c,y:h}]}function IM(e,t,i,s,n,o){const[{x:a,y:r},{x:l,y:c}]=EN(t,i,s);if(TN(e,n,a,r,l,c,o),t.type==="cubic"&&i.type==="cubic"){const h=Oi(t.cp1x,i.cp1x,s),d=Oi(t.cp1y,i.cp1y,s),u=Oi(t.cp2x,i.cp2x,s),p=Oi(t.cp2y,i.cp2y,s);wN(e,a,r,h,d,u,p,l,c,o)}else if(t.type==="step"&&i.type==="step"){const h=Oi(t.stepX,i.stepX,s);NN(e,a,r,l,c,h,o)}else if(t.type==="linear"&&i.type==="linear")LN(e,a,r,l,c,o);else{let h;t.type==="step"?h=t.stepX:i.type==="step"?h=i.stepX:h=(a+l)/2;const d=CN(t,h),u=CN(i,h),p=Oi(d.leftCp1x,u.leftCp1x,s),g=Oi(d.leftCp1y,u.leftCp1y,s),f=Oi(d.leftCp2x,u.leftCp2x,s),x=Oi(d.leftCp2y,u.leftCp2y,s),m=Oi(d.stepX,u.stepX,s),b=Oi(d.stepY0,u.stepY0,s),v=Oi(d.stepY1,u.stepY1,s),S=Oi(d.rightCp1x,u.rightCp1x,s),D=Oi(d.rightCp1y,u.rightCp1y,s),C=Oi(d.rightCp2x,u.rightCp2x,s),T=Oi(d.rightCp2y,u.rightCp2y,s);o?(e.cubicCurveTo(C,T,S,D,m,v),e.lineTo(m,b),e.cubicCurveTo(f,x,p,g,a,r)):(e.cubicCurveTo(p,g,f,x,m,b),e.lineTo(m,v),e.cubicCurveTo(S,D,C,T,l,c))}}var a3=1e3,ON=(e=>(e[e.Zero=0]="Zero",e[e.Split=1]="Split",e))(ON||{});function r3(e,t){return e==null||t==null||typeof e!="object"||typeof t!="object"?!1:"id"in e&&"id"in t?e.id===t.id:e.toString()===t.toString()}function tn(e){return d0(e).valueOf()}function Ns(e,t){if(!t)return NaN;if(e instanceof Date&&(e=e.getTime()),t.type==="continuous"&&typeof e=="number")return(e-t.domain[0])/(t.domain[1]-t.domain[0])*(t.range[1]-t.range[0])+t.range[0];if(t.type==="log"&&typeof e=="number")return t.convert(e);if(t.type!=="category")return NaN;const i=tn(e);let s=t.domain.findIndex(n=>tn(n)===i);return s===-1&&(s=t.domain.findIndex(n=>r3(e,n))),s>=0?t.inset+t.step*s:NaN}function PN({data:e},t){return e.map((i,s)=>({xValue0Index:t.indexOf(tn(i.xValue0)),xValue1Index:t.indexOf(tn(i.xValue1)),datumIndex:s}))}function RN(e){return Object.values(e.scales).every(t=>t.type==="category"?t.domain.length<a3:!0)}function l3(e,t){const i=t.scales.x,s=e.scales.x;if(i?.type!=="category"||s?.type!=="category")return!0;let n=-1/0;for(const o of i.domain){const a=Ns(o,s);if(Number.isFinite(a)){if(a<n)return!1;n=a}}return!0}function c3(e,t){let i=-1/0;for(const s of e){const n=Ns(s.value,t.scales.x);if(Number.isFinite(n)){if(n<i)return!1;i=n}}return!0}function h3(e,t){const i=new Map;for(const{xValue0:h,xValue1:d}of e.data){const u=tn(h),p=tn(d);i.set(u,h).set(p,d)}const s=Array.from(i,([h,d])=>({axisValue:h,value:d}));s.sort((h,d)=>Ns(h.value,e.scales.x)-Ns(d.value,e.scales.x));const n=[];for(const{xValue0:h,xValue1:d}of t.data){const u=tn(h),p=tn(d);i.has(u)||(i.set(u,h),n.push({axisValue:u,value:h})),i.has(p)||(i.set(p,d),n.push({axisValue:p,value:d}))}n.sort((h,d)=>Ns(h.value,t.scales.x)-Ns(d.value,t.scales.x));const o=s;let a=0;for(const h of n){for(let d=o.length-1;d>=a;d-=1){const u=Ns(h.value,t.scales.x),p=Ns(o[d].value,t.scales.x);if(u>p){a=d+1;break}}o.splice(a,0,h),a+=1}if(!c3(o,t))return;const r=o.map(h=>h.axisValue),l=PN(t,r),c=PN(e,r);return{axisValues:r,oldDataAxisIndices:l,newDataAxisIndices:c}}function BN(e,t,i){if(i.xValue1Index===i.xValue0Index+1)return e;const s=eo(e),n=(s[1].x-s[0].x)/(i.xValue1Index-i.xValue0Index),o=s[0].x+(t-i.xValue0Index)*n,a=o+n;return kN(e,o,a)}function FN(e,t){const[i,s]=eo(e),n=Ns(0,t.scales.y);return hg(e,{x:i.x,y:n},{x:s.x,y:n})}function zN(e){const[t,i]=eo(e);return QU(e,{x:(t.x+i.x)/2,y:(t.y+i.y)/2})}function _N(e,t,i,s,n,o){let a,r;if(n.xValue0Index>=o.xValue1Index){const d=s.findLast(p=>p.xValue1Index<=o.xValue1Index)?.datumIndex,u=d!=null?i.data[d]:void 0;a=u?.xValue1,r=u?.yValue1}else if(n.xValue0Index<=o.xValue0Index){const d=s.find(p=>p.xValue0Index>=o.xValue0Index)?.datumIndex,u=d!=null?i.data[d]:void 0;a=u?.xValue0,r=u?.yValue0}if(a==null||r==null)switch(t){case 0:return FN(e,i);case 1:return zN(e)}const l=Ns(a,i.scales.x),c=Ns(r,i.scales.y),h={x:l,y:c};return hg(e,h,h)}function kM(e,t){if(t==null)return;const i=tn(e.xValue0),s=tn(e.xValue1);return t.find(n=>tn(n.xValue0)===i&&tn(n.xValue1)===s)?.span}function GN(e,t,i,s,n,o,a){const r=e.data[s.datumIndex],l=r.span,c=kM(r,n);if(c!=null)a.removed.push({from:c,to:c}),a.moved.push({from:c,to:l}),a.added.push({from:l,to:l});else{const h=_N(l,t,e,i,s,o);a.added.push({from:h,to:l})}}function VN(e,t,i,s,n,o,a){const r=e.data[s.datumIndex],l=r.span,c=kM(r,n);if(c!=null)a.removed.push({from:l,to:l}),a.moved.push({from:l,to:c}),a.added.push({from:c,to:c});else{const h=_N(l,t,e,i,s,o);a.removed.push({from:l,to:h})}}function jN(e,t,i,s,n){const o=t[n.xValue0Index],a=i.data.find(x=>tn(x.xValue0)===o),r=t[n.xValue1Index],l=i.data.find(x=>tn(x.xValue1)===r);if(a==null||l==null)return;const[{x:c},{x:h}]=eo(e),d=Ns(a.xValue0,i.scales.x),u=Ns(a.yValue0,i.scales.y),p=Ns(l.xValue1,i.scales.x),g=Ns(l.yValue1,i.scales.y);let f=s.data[n.datumIndex].span;return f=hg(f,{x:d,y:u},{x:p,y:g}),f=kN(f,c,h),f}function d3(e,t,i,s,n,o,a,r,l){const c=n+1,h=a.find(v=>v.xValue0Index<=n&&v.xValue1Index>=c),d=o.find(v=>v.xValue0Index<=n&&v.xValue1Index>=c),u=t.zeroData,p=e.zeroData;if(h==null&&d!=null){GN(e,i,o,d,u,r,l);return}else if(h!=null&&d==null){VN(t,i,a,h,p,r,l);return}else if(h==null||d==null)return;let g;h.xValue0Index===d.xValue0Index&&h.xValue1Index===d.xValue1Index?g=0:h.xValue0Index<=d.xValue0Index&&h.xValue1Index>=d.xValue1Index?g=-1:h.xValue0Index>=d.xValue0Index&&h.xValue1Index<=d.xValue1Index?g=1:g=0;const f=t.data[h.datumIndex],x=BN(f.span,n,h),m=e.data[d.datumIndex],b=BN(m.span,n,d);if(g===1){const v=jN(x,s,t,e,d);v!=null?(l.removed.push({from:x,to:v}),l.moved.push({from:v,to:b}),l.added.push({from:b,to:b})):VN(t,i,a,h,p,r,l)}else if(g===-1){const v=jN(b,s,e,t,h);v!=null?(l.removed.push({from:x,to:x}),l.moved.push({from:x,to:v}),l.added.push({from:v,to:b})):GN(e,i,o,d,u,r,l)}else l.removed.push({from:x,to:x}),l.moved.push({from:x,to:b}),l.added.push({from:b,to:b})}function u3(e,t,i,s){const n={removed:[],moved:[],added:[]},{axisValues:o,oldDataAxisIndices:a,newDataAxisIndices:r}=e,l={xValue0Index:Math.max(a.at(0)?.xValue0Index??-1/0,r.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(a.at(-1)?.xValue1Index??1/0,r.at(-1)?.xValue1Index??1/0)};for(let c=0;c<o.length-1;c+=1)d3(t,i,s,o,c,r,a,l,n);return n}function HN(e,t,i){const{span:s}=t;switch(i){case 0:return kM(t,e.zeroData)??FN(s,e);case 1:return zN(s)}}function p3(e,t,i){const s=[],n=[];for(const o of t.data){const a=o.span,r=HN(t,o,i);n.push({from:a,to:r})}for(const o of e.data){const a=o.span,r=HN(e,o,i);s.push({from:r,to:a})}return{removed:n,moved:[],added:s}}function ug(e,t,i){if(!RN(e)||!RN(t)||!l3(e,t))return;const s=h3(e,t);return s==null?p3(e,t,i):u3(s,e,t,i)}function WN(e){return e.type==="continuous"||e.type==="log"}function $N(e){return e.type==="category"}function Xc(e,t){return e===void 0||t===void 0?e!==void 0||t!==void 0:WN(e)&&WN(t)?e.type===t.type&&jn(e.domain,t.domain)&&jn(e.range,t.range):$N(e)&&$N(t)?e.inset===t.inset&&e.step===t.step&&jn(e.domain,t.domain):!1}function pg(e){return e==null?!1:e.type==="category"?e.domain.every(t=>t!=null):e.domain.every(t=>Number.isFinite(t)||t instanceof Date)&&e.range.every(t=>Number.isFinite(t))}function Pm(e,t){let i;const s=e.map(n=>n.point);switch(t.type){case"linear":i=JU(s);break;case"smooth":i=i3(s,t.tension);break;case"step":i=t3(s,t.position);break}return i.map((n,o)=>({span:n,xValue0:e[o].xDatum,yValue0:e[o].yDatum,xValue1:e[o+1].xDatum,yValue1:e[o+1].yDatum}))}function gg(e,t,i=.001){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}function CM({path:e},t){let i;for(const{span:s}of t){const[n,o]=eo(s),a=i!=null&&gg(i,n)?1:0;dg(e,s,a,!1),i=o}}function Rm(e,t,i){let s;for(const n of i){const[o,a]=EN(n.from,n.to,e),r=s!=null&&gg(s,o)?1:0;IM(t.path,n.from,n.to,e,r,!1),s=a}}function TM(e,t,i){const s=(r,l)=>Rm(r,l,t.removed),n=(r,l)=>Rm(r,l,t.moved),o=(r,l)=>Rm(r,l,t.added),a=LM(e,i);return{status:e,path:{addPhaseFn:o,updatePhaseFn:n,removePhaseFn:s},pathProperties:a}}function LM(e,t){const i=t==="none"?"updated":e,s={fromFn:n=>{let o;return e==="removed"?o={finish:{visible:!1}}:e==="added"?o={start:{visible:!0}}:o={},{phase:Eo[i],...o}},toFn:n=>({phase:Eo[i]})};return t==="fade"?{fromFn:n=>({opacity:e==="added"?0:n.opacity,...s.fromFn(n)}),toFn:n=>({opacity:e==="removed"?0:1,...s.toFn(n)})}:s}function UN(e,t,i){const s=e.scales.x?.type==="category",n=t.scales.x?.type==="category";if(s!==n||!pg(e.scales.x)||!pg(t.scales.x)||e.strokeData==null||t.strokeData==null)return;let o="updated";t.visible&&!e.visible?o="removed":!t.visible&&e.visible&&(o="added");const a=ug({scales:e.scales,data:e.strokeData.spans},{scales:t.scales,data:t.strokeData.spans},1);if(a==null)return;const r=TM(o,a,"fade"),l=(i?.changed??!0)||!Xc(e.scales.x,t.scales.x)||!Xc(e.scales.y,t.scales.y)||o!=="updated";return{status:o,stroke:r,hasMotion:l}}function YN({path:e},{spans:t,phantomSpans:i}){let s=0,n={x:NaN,y:NaN},o={x:NaN,y:NaN};for(let a=0;a<t.length;a+=1){const{span:r}=t[a],{span:l}=i[a],{0:c,1:h}=eo(r),{0:d,1:u}=eo(l);if(gg(n,c)&&gg(o,d))dg(e,r,1,!1);else{for(let p=a-1;p>=s;p-=1)dg(e,i[p].span,1,!0);e.closePath(),dg(e,r,0,!1),s=a}n=h,o=u}for(let a=t.length-1;a>=s;a-=1)dg(e,i[a].span,1,!0);e.closePath()}function Bm(e,{path:t},i,s){for(let n=0;n<i.length;n+=1){const o=i[n],a=s[n];IM(t,o.from,o.to,e,0,!1),IM(t,a.from,a.to,e,1,!0),t.closePath()}}function KN(e,t,i,s){const n=(l,c)=>Bm(l,c,t.removed,i.removed),o=(l,c)=>Bm(l,c,t.moved,i.moved),a=(l,c)=>Bm(l,c,t.added,i.added),r=LM(e,s);return{status:e,path:{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:n},pathProperties:r}}function ZN(e,t){const i=e.scales.x?.type==="category",s=t.scales.x?.type==="category";if(i!==s||!pg(e.scales.x)||!pg(t.scales.x))return;let n="updated";t.visible&&!e.visible?n="removed":!t.visible&&e.visible&&(n="added");const o=ug({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},0);if(o==null)return;const a=ug({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},0);if(a==null)return;const r=ug({scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},{scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},0);if(r==null)return;const l="none",c=KN(n,o,a,l),h=TM(n,r,l);return{status:n,fill:c,stroke:h}}var Ws=0,In=1,to=2,io=3,Ia=4;function wM(e){let t=Math.ceil(Math.log2(e.length))-1;return t=Math.min(Math.max(t,0),24),2**t|0}function fg(e,t){switch(e){case"category":return[NaN,NaN];case"number":case"time":case"ordinal-time":case"unit-time":{let i=1/0,s=-1/0;for(const n of t){const o=Number(n);i=Math.min(i,o),s=Math.max(s,o)}return[i,s]}case"color":case"log":case"mercator":return[0,0]}}function NM(e,t){return e/t}function yr(e,t,i){return(e.valueOf()-t)/(i-t)}function EM(e,t){return Math.min(Math.floor(e*t),t-1)*Ia|0}function OM(e,t,i,s,n,o){const a=new Int32Array(o*Ia).fill(-1),r=new Float64Array(o*Ia).fill(NaN),l=Number.isFinite(s)&&Number.isFinite(n),c=e.length;for(let h=0;h<e.length;h+=1){const d=e[h];if(d==null)continue;const u=l?yr(d,s,n):NM(h,c),p=EM(u,o),g=t[h],f=i[h],x=g!=null?g.valueOf():NaN,m=f!=null?f.valueOf():NaN,b=a[p+Ws]===-1;(b||u<r[p+Ws])&&(a[p+Ws]=h,r[p+Ws]=u),(b||u>r[p+In])&&(a[p+In]=h,r[p+In]=u),!Number.isNaN(m)&&(b||m<r[p+to])&&(a[p+to]=h,r[p+to]=m),!Number.isNaN(x)&&(b||x>r[p+io])&&(a[p+io]=h,r[p+io]=x)}return{indexData:a,valueData:r}}function PM(e,t,i,{inPlace:s=!1}={}){const n=i/2|0,o=s?e:new Int32Array(n*Ia),a=s?t:new Float64Array(n*Ia);for(let r=0;r<n;r+=1){const l=r*Ia|0,c=l*2|0,h=c+Ia|0,d=e[h+Ws]===-1,u=d||t[c+Ws]<t[h+Ws]?c:h;o[l+Ws]=e[u+Ws],a[l+Ws]=t[u+Ws];const p=d||t[c+In]>t[h+In]?c:h;o[l+In]=e[p+In],a[l+In]=t[p+In];const g=d||t[c+to]<t[h+to]?c:h;o[l+to]=e[g+to],a[l+to]=t[g+to];const f=d||t[c+io]>t[h+io]?c:h;o[l+io]=e[f+io],a[l+io]=t[f+io]}return{maxRange:n,indexData:o,valueData:a}}var g3=1e3,f3=10;function XN(e,t,i,s,n,o){const a=e[o];if(a==null)return!1;const r=Number.isFinite(t)?yr(a,t,i):NM(o,e.length),l=EM(r,n);return o===s[l+Ws]||o===s[l+In]||o===s[l+to]||o===s[l+io]}function qN(e,t,i,s){if(t.length<g3)return;const[n,o]=fg(e,s);let a=wM(t);const{indexData:r,valueData:l}=OM(t,i,i,n,o,a);let c=[];for(let d=0;d<t.length;d+=1)XN(t,n,o,r,a,d)&&c.push(d);const h=[{maxRange:a,indices:c}];for(;c.length>f3&&a>64;)({maxRange:a}=PM(r,l,a,{inPlace:!0})),c=c.filter(XN.bind(null,t,n,o,r,a)),h.push({maxRange:a,indices:c});return h.reverse(),h}function yg({id:e},t,i,...s){const n={phase:i?Eo[i]:"trailing"};tr(e,"markers",t,s,{opacity:0},{opacity:1},n),s.forEach(o=>o.cleanup())}function QN({id:e},t,...i){tr(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(s=>s.cleanup())}function RM({id:e,nodeDataDependencies:t},i,...s){const n=t.seriesRectWidth;Li(e,"markers",i,s,{fromFn:(r,l)=>{const c=l.midPoint?.x??n;let h=ve(0,_T(c/n),1);return isNaN(h)&&(h=0),{scalingX:0,scalingY:0,delay:h,duration:by,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function Fm(e){return{opacity:1,scalingX:1,scalingY:1}}function mg(e,t){return{x:t.point?.x??NaN,y:t.point?.y??NaN,scalingCenterX:t.point?.x??NaN,scalingCenterY:t.point?.y??NaN}}function zm(e,{datumIndex:t}){const i=e.getNodeData();if(i===void 0)return;const s=i[t],{point:n}=s??{};if(s==null||n==null)return;const o=e.getFormattedMarkerStyle(s),a=wi.anchor(o.shape),r=n.focusSize??o.size,l=4+r,c=l/2,h=(a.x-.5)*r,d=(a.y-.5)*r,u=s.point.x-c-h,p=s.point.y-c-d;return Gt.toCanvas(e.contentGroup,new de(u,p,l,l))}function BM({id:e,visible:t,nodeDataDependencies:i},s,...n){const{seriesRectWidth:o,seriesRectHeight:a}=i;tr(e,"path_properties",s,n,{clipX:0},{clipX:o},{phase:"initial",start:{clip:!0,clipY:a,visible:t},finish:{clip:!1,visible:t}})}function _m({id:e},t,i,s="add",...n){tr(e,t,i,n,{opacity:0},{opacity:1},{phase:s})}function FM(e){return t=>({visible:e.getVisible(),opacity:e.getOpacity(),clipScalingX:1,clip:!1})}function Gm({nodeDataDependencies:e},t){const i=s=>isFinite(s)?s:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}var y3=.125,m3=.25,x3=ap(qN),Vm=class extends Zc{constructor(e){super({moduleCtx:e,propertyKeys:zd,propertyNames:_d,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],datumSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:FM({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Yc,datum:(t,i)=>({...Fm(t),...mg(t,i)})},clipFocusBox:!1}),this.properties=new Yt,this.connectsToYAxis=!0,this.dataAggregationFilters=void 0,this.backgroundGroup=new Re({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){return super.renderToOffscreenCanvas()||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>Em||this.contextNodeData.strokeData.spans.length>Em)}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}attachPaths([e,t]){this.backgroundGroup.appendChild(e),this.contentGroup.appendChild(t),t.zIndex=-1}detachPaths([e,t]){this.backgroundGroup.removeChild(e),this.contentGroup.removeChild(t)}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}setSeriesIndex(e){const i=this.isStacked()===this._isStacked;return this._isStacked=i,super.setSeriesIndex(e,i)}setZIndex(e){super.setZIndex(e),this.isStacked()?(this.backgroundGroup.zIndex=[0,e],this.contentGroup.zIndex=[1,e,0]):(this.backgroundGroup.zIndex=[1,e,0,0],this.contentGroup.zIndex=[1,e,0,1])}async processData(e){if(this.data==null)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=1}={}}=this,{xKey:o,yKey:a,yFilterKey:r,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),d=this.axes.x?.scale,u=this.axes.y?.scale,{xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:d,yScale:u}),f=n>1||c!=null,x={value:`area-stack-${s}-yValue`,values:`area-stack-${s}-yValues`,stack:`area-stack-${s}-yValue-stack`,marker:`area-stack-${s}-yValues-marker`},m={invalidValue:null};(ii(c)||l)&&n>1&&(m.invalidValue=0),i||(m.forceValue=0);const b=[ul(o,p,{id:"xValue"}),St(a,g,{id:"yValueRaw",...m}),...r!=null?[St(r,g,{id:"yFilterRaw"})]:[],...Q2(a,g,{id:"yValueStack",...m,groupId:x.stack}),St(a,g,{id:"yValue",...m,groupId:x.value})];f&&b.push(...pl(a,"window","current",{id:"yValueEnd",...m,groupId:x.values},g),...pl(a,"normal","current",{id:"yValueCumulative",...m,groupId:x.marker},g)),ii(c)&&b.push(ym(Object.values(x),c)),h&&b.push(qp());const{dataModel:v,processedData:S}=await this.requestDataModel(e,t,{props:b,groupByKeys:f,groupByData:!f});this.dataAggregationFilters=this.aggregateData(v,S),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yCumulativeKey(e){return e.type==="grouped"?"yValueCumulative":"yValue"}getSeriesDomain(e){const{processedData:t,dataModel:i,axes:s}=this;if(!t||!i)return[];const n=s.y;if(e==="x"){const a=i.resolveProcessedDataDefById(this,"xValue"),r=i.getDomain(this,"xValue","key",t);return a?.def.type==="key"&&a.def.valueType==="category"?r:vn(dl(r))}const o=this.domainForClippedRange("y",[this.yCumulativeKey(t)],"xValue");if(n instanceof Sd||n instanceof Sa)return vn(o);{const a=Number.isFinite(o[1]-o[0])?[o[0]>0?0:o[0],o[1]<0?0:o[1]]:[];return vn(a)}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange("y",[this.yCumulativeKey(this.processedData)],"xValue",t);return[Math.min(i,0),Math.max(s,0)]}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}aggregateData(e,t){if(t.type==="grouped"||vd(t))return;const i=this.axes.x;if(i==null)return;const{scale:s}=i,n=e.resolveColumnById(this,"xValue",t),o=e.resolveColumnById(this,"yValueRaw",t),a=e.getDomain(this,"xValue","value",t);return x3(s.type,n,o,a)}createNodeData(){const{axes:e,data:t,processedData:i,dataModel:s,dataAggregationFilters:n}=this,o=e.x,a=e.y;if(!o||!a||!t||!s||!i)return;const{yKey:r,xKey:l,xName:c,yName:h,yFilterKey:d,marker:u,label:p,fill:g,stroke:f,connectMissingData:x,interpolation:m}=this.properties,{scale:b}=o,{scale:v}=a,S=this.getSeriesDomain("y"),{isContinuousY:D}=this.getScaleInformation({xScale:b,yScale:v}),C=(b.bandwidth??0)/2,T=i.type==="grouped",k=s.resolveKeysById(this,"xValue",i),L=s.resolveColumnById(this,"yValueRaw",i),N=T?s.resolveColumnById(this,"yValueCumulative",i):L,w=d!=null?s.resolveColumnById(this,"yFilterRaw",i):void 0,O=i.type==="grouped"?s.resolveColumnById(this,"yValueStack",i):void 0,R=[],B=[],{visibleSameStackCount:P}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let _=!1;const{dataSources:F}=i,W=F.get(this.id)??[],[H,j]=b.range,V=Math.abs(j-H),$=n?.find(he=>he.maxRange>V);let U=0,Z=0;const q=$?.indices;[U,Z]=this.visibleRangeIndices("xValue",o.range,q),U=Math.max(U-1,0),Z=Math.min(Z+1,q?.length??k.length),i.input.count<1e3&&(U=0,Z=i.input.count);const Q=(he,ye,be)=>{let Se;return(ii(this.properties.normalizedTo)?D&&Ly(be):!isNaN(be))&&(Se=ye),{x:b.convert(he)+C,y:v.convert(Se),size:u.size}},ie=he=>{const ye=k[he];if(ye==null)return;const be=W[he],Se=L[he],Oe=N[he],_e=Number.isFinite(Se),Mt=Q(ye,+Oe,Se),kt=w!=null?w[he]===Se:void 0;if(kt===!1&&(_=!0),_e&&u&&B.push({series:this,itemId:r,datum:be,datumIndex:he,midPoint:{x:Mt.x,y:Mt.y},cumulativeValue:Oe,yValue:Se,xValue:ye,yKey:r,xKey:l,point:Mt,fill:u.fill??g,stroke:u.stroke??f,strokeWidth:u.strokeWidth??this.properties.strokeWidth,selected:kt}),p.enabled&&_e){const Ki=this.getLabelText(Se,be,r,"y",S,p,{value:Se,datum:be,xKey:l,yKey:r,xName:c,yName:h});R.push({series:this,itemId:r,datum:be,datumIndex:he,x:Mt.x,y:Mt.y,labelText:Ki})}};if(i.type==="grouped")for(const{datumIndex:he}of s.forEachGroupDatum(this,i))ie(he);else for(let he=U;he<Z;he+=1){const ye=q?.[he]??he;k[ye]!=null&&ie(ye)}const ne=he=>he.flatMap(ye=>Array.isArray(ye)?Pm(ye,m):new Array(ye.skip).fill(null)),oe=(he,ye)=>({point:{x:b.convert(he)+C,y:v.convert(ye)},xDatum:he,yDatum:ye}),le=he=>{const ye=[],be=(Se,Oe,_e)=>{const Mt=k[Oe],kt=O!=null?O?.[Oe][he]:L[Oe];if(x&&!Number.isFinite(L[Oe]))return;const Ki=Number.isFinite(kt);let zn=0,Gr=!0,mf=0,vk=!0;if(O==null)Gr=Se==null||Number.isFinite(L[Se]),vk=_e==null||Number.isFinite(L[_e]),zn=Se!=null&&Number.isFinite(L[Se])?kt:0,mf=_e!=null&&Number.isFinite(L[_e])?kt:0;else{const xf=O[Oe],tc=Se!=null?O[Se]:void 0,n_=_e!=null?O[_e]:void 0;for(let bf=0;bf<=he;bf+=1){const Sk=xf[bf];if(Number.isFinite(Sk)){const Oce=tc==null||Number.isFinite(tc[bf]),Pce=n_==null||Number.isFinite(n_[bf]);Oce?zn+=Sk:Gr=!1,Pce?mf+=Sk:vk=!1}}}const Ha=ye[ye.length-1];if(!x&&(!Gr||!vk||!Ki||zn!==mf))if(!Ki&&Array.isArray(Ha)&&Ha.length===1)ye[ye.length-1]={skip:1};else{const xf=oe(Mt,zn),tc=oe(Mt,mf);Array.isArray(Ha)?Ha.push(xf):Ha!=null&&(Ha.skip+=1),ye.push(Ki?[tc]:{skip:0})}else{const xf=x?kt:Math.max(zn,mf),tc=oe(Mt,xf);Array.isArray(Ha)?Ha.push(tc):Ha!=null?(Ha.skip+=1,ye.push([tc])):ye.push([tc])}};if(i.type==="grouped")for(const{datumIndexes:[Se,Oe,_e]}of s.forEachGroupDatumTuple(this,i))be(Se,Oe,_e);else{let Se,Oe;for(let _e=U;_e<Z;_e+=1){const Mt=q?.[_e]??_e;k[Mt]!=null&&(Oe!=null&&be(Se,Oe,Mt),Se=Oe,Oe=Mt)}Oe!=null&&be(Se,Oe,void 0)}return ne(ye)},re=this.seriesGrouping?.stackIndex??0,ee=()=>{const he=be=>{const Se=k[be],Oe=O?.[be][re]??L[be];if(!(x&&!Number.isFinite(Oe)))return oe(Se,0)};let ye;if(i.type==="grouped")ye=Array.from(s.forEachGroupDatum(this,i),({datumIndex:be})=>he(be));else{ye=[];for(let be=U;be<Z;be+=1){const Se=q?.[be]??be;k[Se]!=null&&ye.push(he(Se))}}return ye=ye.filter(be=>be!=null),Pm(ye,m)},Me=le(re),Ee=Me.map(()=>null);for(let he=re-1;he>=-1;he-=1){let ye;for(let be=0;be<Ee.length;be+=1)Ee[be]==null&&(ye??(ye=he!==-1?le(he):ee()),Ee[be]=ye[be])}const Ie=Me.map((he,ye)=>he??Ee[ye]),xe=Me.filter(he=>he!=null);return{itemId:r,fillData:{itemId:r,spans:Ie,phantomSpans:Ee},strokeData:{itemId:r,spans:xe},labelData:R,nodeData:B,scales:this.calculateScaling(),visible:this.visible,stackVisible:P>0,crossFiltering:_}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{visible:t,animationEnabled:i}=e,[s,n]=e.paths,o=this.contextNodeData?.crossFiltering===!0,{strokeWidth:a,stroke:r,strokeOpacity:l,lineDash:c,lineDashOffset:h,fill:d,fillOpacity:u,opacity:p}=et(this.getHighlightStyle(),this.properties);n.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:r,strokeWidth:a,strokeOpacity:l*(o?m3:1),lineDash:c,lineDashOffset:h,opacity:p,visible:t||i});const g=pd(d,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);or(s,{fill:g,stroke:void 0,fillOpacity:u*(o?y3:1)},this.getShapeFillBBox()),s.setProperties({lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:p,visible:t||i}),Gm(this,n),Gm(this,s)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const i of e)i.path.clear(),i.markDirty("AreaSeries")}updateFillPath(e,t){const[i]=e;i.path.clear(),YN(i,t.fillData),i.markDirty("AreaSeries")}updateStrokePath(e,t){const{spans:i}=t.strokeData,[,s]=e;s.path.clear(),CM(s,i),s.markDirty("AreaSeries")}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(s?t:[])}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,marker:o,stroke:a,strokeWidth:r,strokeOpacity:l}=this.properties,c=this.getSeriesDomain("x"),h=this.getSeriesDomain("y"),d=this.getShapeFillBBox();t.each((u,p)=>{const{xValue:g,yValue:f}=p,x=Qr(g,f,s,n,c,h),m=this.getMarkerStyle(o,p,x,i,void 0,{stroke:a,strokeWidth:r,strokeOpacity:l});this.applyMarkerStyle(m,u,p.point,d,{selected:p.selected})}),i||this.properties.marker.markClean(),i||this.properties.marker.markClean()}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,n)=>{const{x:o,y:a,labelText:r}=n,l=t||this.isSeriesHighlighted(i),c=this.getHighlightStateString(i,l,n.datumIndex),h=Da(this,n,this.properties,this.properties.label,l,c),{enabled:d,fontStyle:u,fontWeight:p,fontSize:g,fontFamily:f,color:x}=h;r&&d&&this.visible?(s.fontStyle=u,s.fontWeight=p,s.fontSize=g,s.fontFamily=f,s.textAlign="center",s.textBaseline="bottom",s.text=r,s.x=o,s.y=a-10,s.fill=x,s.fillOpacity=this.getHighlightStyle(t,n.datumIndex).opacity??1,s.visible=!0,s.setBoxing(h)):s.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o}=this,{xKey:a,xName:r,yKey:l,yName:c,tooltip:h,marker:d,legendItemName:u}=o,p=n.x,g=n.y;if(!i||!s||!p||!g)return;const f=s.dataSources.get(this.id)?.[e],x=i.resolveKeysById(this,"xValue",s)[e],m=i.resolveColumnById(this,"yValueRaw",s)[e],{xDomain:b,yDomain:v}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));if(x==null)return;const S=this.getMarkerStyle(d,{datum:f,datumIndex:e},Qr(x,m,a,l,b,v),!1);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",x,f,a,u),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",m,f,l,u)}]},{seriesId:t,datum:f,title:c,xKey:a,xName:r,yKey:l,yName:c,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,marker:a,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c}=this.properties,h=!a.enabled||a.fill===void 0,d=h?pd(e,r,l,c):pd(a.fill,a.fillGradientDefaults,a.fillPatternDefaults,a.fillImageDefaults);return{marker:{...this.getMarkerStyle(a,{},void 0,!1,{size:a.size,fill:d,fillOpacity:h?i:a.fillOpacity},void 0,!1),enabled:a.enabled||n<=0},line:{stroke:t,strokeOpacity:s,strokeWidth:n,lineDash:o}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:o,legendItemName:a,showInLegend:r}=this.properties;return[{legendType:e,id:t,itemId:n,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:a??o??n},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!r}]}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,paths:n}=e,{animationManager:o}=this.ctx;this.updateAreaPaths(n,s),BM(this,o,...n),ls([t],mg),RM(this,o,t),oi(this,"labels",o,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,contextData:n,paths:o,previousContextData:a}=e,[r,l]=o;if(n.visible===!1&&a?.visible===!1||r==null&&l==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(o,n)},h=()=>{t.skipCurrentBatch(),c()};if(n==null||a==null){c(),yg(this,t,"added",i),_m(this,"fill_path_properties",t,"add",r),_m(this,"stroke_path_properties",t,"add",l),oi(this,"labels",t,s);return}if(n.crossFiltering!==a.crossFiltering){h();return}const d=ZN(n,a);if(d===void 0){h();return}else if(d.status==="no-op")return;yg(this,t,void 0,i),Li(this.id,"fill_path_properties",t,[r],d.fill.pathProperties),wm(this.id,"fill_path_update",t,[r],d.fill.path),Li(this.id,"stroke_path_properties",t,[l],d.stroke.pathProperties),wm(this.id,"stroke_path_update",t,[l],d.stroke.path),oi(this,"labels",t,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(o,n)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new wi}getFormattedMarkerStyle(e){const{xValue:t,yValue:i,xKey:s,yKey:n}=e,o=this.getSeriesDomain("x"),a=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,e,Qr(t,i,s,n,o,a),!0)}computeFocusBounds(e){return zm(this,e)}hasItemStylers(){return this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Vm.className="AreaSeries",Vm.type="area";var b3={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:e=>new Vm(e),stackable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{nodeClickRange:"nearest",fill:{$palette:"fill"},fillGradientDefaults:fd,fillPatternDefaults:rr,fillImageDefaults:Ic,stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:sl,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:jp,fillPatternDefaults:rr},label:{...Qn,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:al()}}},JN={type:"series",name:"area",chartType:"cartesian",options:xw,create:e=>new Vm(e)},zM=class extends Ti{constructor(){super(...arguments),this.direction="x",this.featherRatio=0}get feathered(){return Math.abs(this.featherRatio)>1e-6}isPointInPath(e,t){return this.feathered?this.getBBox().containsPoint(e,t):super.isPointInPath(e,t)}updatePath(){if(!this.feathered){super.updatePath();return}const{path:e,x:t,y:i,width:s,height:n,direction:o,featherRatio:a}=this;if(e.clear(),o==="x"){const r=Math.abs(a)*s;a>0?(e.moveTo(t,i),e.lineTo(t+s-r,i),e.lineTo(t+s,i+n/2),e.lineTo(t+s-r,i+n),e.lineTo(t,i+n),e.closePath()):(e.moveTo(t+r,i),e.lineTo(t+s,i),e.lineTo(t+s,i+n),e.lineTo(t+r,i+n),e.lineTo(t,i+n/2),e.closePath())}else{const r=Math.abs(a)*n;a>0?(e.moveTo(t,i+r),e.lineTo(t+s/2,i),e.lineTo(t+s,i+r),e.lineTo(t+s,i+n),e.lineTo(t,i+n),e.closePath()):(e.moveTo(t,i),e.lineTo(t+s,i),e.lineTo(t+s,i+n-r),e.lineTo(t+s/2,i+n),e.lineTo(t,i+n-r),e.closePath())}}};M([te()],zM.prototype,"direction",2),M([te()],zM.prototype,"featherRatio",2);function _M(e,t){for(const i of t){const s=i.datum;s===void 0?X.error("undefined datum"):e.addValue(i,s)}}function jm(e,t){const{x:i,y:s}=t,{nearest:n,distanceSquared:o}=e.getQuadTree().find(i,s);if(n!==void 0)return{datum:n.value,distance:Math.sqrt(o)}}var GM=class extends bl{constructor(){super(...arguments),this.direction="vertical"}};M([I],GM.prototype,"direction",2);var e1=class extends Zc{constructor(){super(...arguments),this.groupScale=new ld,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(e,t){const i=typeof t=="boolean"?1:.5,s=Ye(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=dl(e)??[NaN,NaN];return typeof t=="boolean"?n[t?0:1]-=(t?1:-1)*s:(n[0]-=s,n[1]+=s),vn(n)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return this.properties.direction==="vertical"}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const e=this.getBarDirection();return this.axes[e]}getCategoryAxis(){const e=this.getCategoryDirection();return this.axes[e]}getBandwidth(e,t){return ft.is(e.scale)?e.scale.calcBandwidth(this.smallestDataInterval,t):e.scale.bandwidth}xCoordinateRange(e){const t=this.axes[this.getCategoryDirection()],i=t.scale,s=this.getBandwidth(t,0)??0,n=ft.is(i)?s*-.5:0,o=i.convert(e)+n;return[o,o+s]}yCoordinateRange(e){const i=this.axes[this.getBarDirection()].scale,s=e.map(n=>i.convert(n));if(s.length===1){const n=i.convert(0);return[Math.min(s[0],n),Math.max(s[0],n)]}return[Math.min(...s),Math.max(...s)]}updateGroupScale(e){const t=[],{groupScale:i}=this,s=this.getBandwidth(e),{index:n,visibleGroupCount:o}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);for(let r=0;r<o;r++)t.push(String(r));return i.domain=t,i.range=[0,s??0],e instanceof Bc?i.paddingInner=e.groupPaddingInner:e instanceof bd?(i.paddingInner=e.groupPaddingInner,i.round=i.padding!==0):i.padding=0,{barWidth:i.bandwidth>=1?i.bandwidth:i.rawBandwidth,groupIndex:n}}resolveKeyDirection(e){return this.getBarDirection()==="x"?e==="x"?"y":"x":e}initQuadTree(e){_M(e,this.datumNodesIter())}pickNodesExactShape(e){const t=jm(this,e);return t!=null&&t.distance<=0?[t.datum]:[]}pickNodeClosestDatum(e){return jm(this,e)}},v3=Ws,S3=In,M3=to,D3=io,A3=Ia,I3=1e3;function t1(e,t){return Array.from({length:e},(i,s)=>{const n=s*Ia,o=t[n+Ws],a=t[n+In];return(o+a)/2|0})}function k3(e,t,i,s){if(t.length<I3)return;const[n,o]=fg(e,s);let a=wM(t),{indexData:r,valueData:l}=OM(t,i,i,n,o,a),c=t1(a,r);const h=[{maxRange:a,indexData:r,indices:c}];for(;a>64;)({indexData:r,valueData:l,maxRange:a}=PM(r,l,a)),c=t1(a,r),h.push({maxRange:a,indexData:r,indices:c});return h.reverse(),h}var VM=class extends Vt{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0}};M([I],VM.prototype,"placement",2),M([I],VM.prototype,"spacing",2);var Lt=class extends GM{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Kn,this.fillPatternDefaults=new Tt,this.fillImageDefaults=new Qs,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 Aa,this.label=new VM,this.tooltip=Kc(),this.sparklineMode=!1}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r,opacity:1}}};M([I],Lt.prototype,"xKey",2),M([I],Lt.prototype,"xName",2),M([I],Lt.prototype,"yKey",2),M([I],Lt.prototype,"yName",2),M([I],Lt.prototype,"yFilterKey",2),M([I],Lt.prototype,"stackGroup",2),M([I],Lt.prototype,"normalizedTo",2),M([I],Lt.prototype,"fill",2),M([I],Lt.prototype,"fillGradientDefaults",2),M([I],Lt.prototype,"fillPatternDefaults",2),M([I],Lt.prototype,"fillImageDefaults",2),M([I],Lt.prototype,"fillOpacity",2),M([I],Lt.prototype,"stroke",2),M([I],Lt.prototype,"strokeWidth",2),M([I],Lt.prototype,"strokeOpacity",2),M([I],Lt.prototype,"lineDash",2),M([I],Lt.prototype,"lineDashOffset",2),M([I],Lt.prototype,"cornerRadius",2),M([I],Lt.prototype,"crisp",2),M([I],Lt.prototype,"itemStyler",2),M([I],Lt.prototype,"shadow",2),M([I],Lt.prototype,"label",2),M([I],Lt.prototype,"tooltip",2),M([I],Lt.prototype,"sparklineMode",2);function i1(e,t,i,s){if(t!=null){const[n,o]=t;if(n!==0||o!==1)return!1}if(ft.is(e)){const n=e.calcBandwidth(s)-e.calcBandwidth(i);if(n>0&&n<1)return!1}if(er.is(e)){const{bandwidth:n,step:o}=e;if(n>0&&n<1)return!1;const a=o-n;if(a>0&&a<1)return!1}return!0}var jM=e=>$v(e.yValue??0);function Hm(e,t,i){const{startingX:s,startingY:n}=T3(e,t);return{isVertical:e,calculate:(a,r)=>{let l=e?a.x:s,c=e?n:a.y,h=e?a.width:0,d=e?0:a.height;const{opacity:u=1}=a;r&&(isNaN(l)||isNaN(c))&&({x:l,y:c}=r,h=e?r.width:0,d=e?0:r.height,e&&!jM(r)?c+=r.height:!e&&jM(r)&&(l+=r.width));let p;return a.clipBBox==null?p=void 0:jM(a)?p=e?new de(l,c-d,h,d):new de(l-h,c,h,d):p=new de(l,c,h,d),{x:l,y:c,width:h,height:d,clipBBox:p,opacity:u}},mode:i}}function C3(e,t){return{isVertical:e,calculate:i=>({x:e?i.x:i.x+i.width/2,y:e?i.y+i.height/2:i.y,width:e?i.width:0,height:e?0:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1}),mode:t}}function Wm(e){const t=o=>o==null||isNaN(o.x)||isNaN(o.y);return{toFn:(o,a,r)=>r==="removed"&&o.datum==null&&e.mode==="fade"?{...xg(o,a),opacity:0}:r==="removed"||t(a)?e.calculate(a,o.previousDatum):{x:a.x,y:a.y,width:a.width,height:a.height,clipBBox:a.clipBBox,opacity:a.opacity??1},fromFn:(o,a,r)=>{r==="updated"&&t(a)?r="removed":r==="updated"&&t(o.previousDatum)&&(r="added");let l;r==="added"&&o.previousDatum==null&&e.mode==="fade"?l={...xg(o,a),opacity:0}:r==="unknown"||r==="added"?l=e.calculate(a,o.previousDatum):l={x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1};const c=Eo[r];return{...l,phase:c}},applyFn:(o,a,r)=>{o.setProperties(a),o.crisp=r==="end"&&(o.datum?.crisp??!1)}}}function T3(e,t){const i=t[e?"y":"x"];let s=1/0,n=0;return i?(e?n=i.scale.convert(ft.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(ft.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function xg(e,{x:t,y:i,width:s,height:n,clipBBox:o,opacity:a=1}){return{x:t,y:i,width:s,height:n,clipBBox:o,opacity:a,crisp:e.datum?.crisp??!1}}function HM(e,t){if(t===void 0)return;const{x:i,y:s,width:n,height:o}=t;return Gt.toCanvas(e.contentGroup,new de(i,s,n,o))}function s1(e,t,i,s,n,o){let a=o?.reduced?.diff?.[e];if(a?.changed)return a;const r=L3(s,n);return a==null&&o?.reduced?.diff!=null?(a={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},r?a.updated=new Set(Array.from(t,({datum:l})=>i(l))):a.added=new Set(Array.from(t,({datum:l})=>i(l)))):r&&(a={changed:!0,added:new Set,updated:new Set(Array.from(t,({datum:l})=>i(l))),removed:new Set,moved:new Set}),a}function n1(e){return typeof e=="object"&&e!==null&&"groupScale"in e}function L3(e,t){if(!t)return!1;const i=e.scales,s=t.scales;if(!Xc(i.x,s.x)||!Xc(i.y,s.y))return!0;if(!n1(e)||!n1(t))return!1;const n=e.groupScale,o=t.groupScale;return!Xc(n,o)}var w3=ap(k3),bg=class extends e1{constructor(e){super({moduleCtx:e,propertyKeys:zd,propertyNames:_d,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:xg,label:Yc}}),this.properties=new Lt,this.connectsToYAxis=!0,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}crossFilteringEnabled(){return this.properties.yFilterKey!=null&&(this.seriesGrouping==null||this.seriesGrouping.stackIndex===0)}async processData(e){if(!this.data)return;const{xKey:t,yKey:i,yFilterKey:s,normalizedTo:n}=this.properties,{seriesGrouping:{groupIndex:o=this.id}={},data:a}=this,l=(this.seriesGrouping?.stackCount??0)>1||n!=null,c=l,h=!this.ctx.animationManager.isSkipped(),d=this.getCategoryAxis()?.scale,u=this.getValueAxis()?.scale,{isContinuousX:p,xScaleType:g,yScaleType:f}=this.getScaleInformation({xScale:d,yScale:u}),x=`bar-stack-${o}-yValues`,m=`${x}-trailing`,b=this.visible?{}:{forceValue:0},v=[ul(t,g,{id:"xValue"}),St(i,f,{id:"yValue-raw",invalidValue:null,...b})];this.crossFilteringEnabled()&&v.push(St(s,f,{id:"yFilterValue",invalidValue:null,...b})),l&&v.push(...pl(i,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:x,separateNegative:!0,...b},f),...pl(i,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:m,separateNegative:!0,...b},f)),p&&v.push(J2,ew),Ye(n)&&v.push(ym([x,m],Math.abs(n))),h&&this.processedData&&v.push(Qp(this.id,this.processedData)),(h||!c)&&v.push(qp());const{dataModel:S,processedData:D}=await this.requestDataModel(e,a,{props:v,groupByKeys:c,groupByData:!c});this.dataAggregationFilters=this.aggregateData(S,D),this.smallestDataInterval=D.reduced?.smallestKeyInterval,this.largestDataInterval=D.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(i==null||t==null)return[];if(e===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue"),r=i.getDomain(this,"xValue","key",t);return a?.def.type==="key"&&a.def.valueType==="category"?r:this.padBandExtent(r)}const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";let n=this.domainForClippedRange(e,[s],"xValue");const o=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",t):void 0;if(o!=null&&(n=[Math.min(n[0],o[0]),Math.max(n[1],o[1])]),this.getValueAxis()instanceof Sd)return vn(n);{const a=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return vn(a)}}getSeriesRange(e,t){const i=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw",[s,n]=this.domainForVisibleRange("y",[i],"xValue",t);return[Math.min(s,0),Math.max(n,0)]}getVisibleItems(e,t,i){const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";return this.countVisibleItems("xValue",[s],e,t,i)}aggregateData(e,t){if(t.type!=="ungrouped"||vd(t))return;const i=this.axes.x;if(i==null)return;const s=e.resolveKeysById(this,"xValue",t),n=e.resolveColumnById(this,"yValue-raw",t),{index:o}=e.resolveProcessedDataDefById(this,"xValue"),a=t.domain.keys[o];return w3(i.scale.type,s,n,a)}createNodeData(){const{dataModel:e,processedData:t,groupScale:i,dataAggregationFilters:s}=this,n=this.getCategoryAxis(),o=this.getValueAxis();if(!e||!t||!n||!o)return;const a=t.dataSources?.get(this.id);if(a==null)return;const r=n.scale,l=o.scale,{xKey:c,yKey:h,xName:d,yName:u,legendItemName:p,label:g}=this.properties,f=this.getSeriesDomain("y"),x=o.isReversed(),{barWidth:m,groupIndex:b}=this.updateGroupScale(n),v=i.convert(String(b)),S=ft.is(r)?m*-.5:0,D=e.resolveKeysById(this,"xValue",t),C=e.resolveColumnById(this,"yValue-raw",t),T=this.crossFilteringEnabled()?e.resolveColumnById(this,"yFilterValue",t):void 0,k=!this.ctx.animationManager.isSkipped(),L=V=>r.convert(D[V])+v+S,N=this.properties.crisp??i1(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),w=l.convert(0),O=({datum:V,datumIndex:$,xValue:U,yValue:Z,cumulativeValue:q,phantom:Q,currY:ie,prevY:ne,x:oe,width:le,isPositive:re,yRange:ee,labelText:Me,opacity:Ee,featherRatio:Ie,crossScale:xe=1})=>{const ze=re!==x,he=l.convert(ie),ye=l.convert(ne),be=l.convert(ee),Se=this.getBarDirection()==="x",Oe=le*.5*(1-xe),_e={x:Se?Math.min(he,ye):oe+Oe,y:Se?oe+Oe:Math.min(he,ye),width:Se?Math.abs(ye-he):le*xe,height:Se?le*xe:Math.abs(ye-he)},Mt=new de(_e.x,_e.y,_e.width,_e.height),kt={x:Se?Math.min(w,be):oe+Oe,y:Se?oe+Oe:Math.min(w,be),width:Se?Math.abs(w-be):le*xe,height:Se?le*xe:Math.abs(w-be)},Ki=this.shouldFlipXY()?_e.height:_e.width,zn=g.spacing+(typeof g.padding=="number"?g.padding:0);return{series:this,itemId:Q?pr(h,Q):h,datum:V,datumIndex:$,cumulativeValue:q,phantom:Q,xValue:U,yValue:Z,yKey:h,xKey:c,capDefaults:{lengthRatioMultiplier:Ki,lengthMax:Ki},x:kt.x,y:kt.y,width:kt.width,height:kt.height,midPoint:{x:_e.x+_e.width/2,y:_e.y+_e.height/2},opacity:Ee,featherRatio:Ie,topLeftCornerRadius:Se!==ze,topRightCornerRadius:ze,bottomRightCornerRadius:Se===ze,bottomLeftCornerRadius:!ze,clipBBox:Mt,crisp:N,label:Me!=null?{text:Me,...DN({isUpward:ze,isVertical:!Se,placement:g.placement,spacing:zn,rect:_e})}:void 0,missing:Z==null,focusable:!Q}},R=[],B=[],P=[],_=(V,$,U,Z,q,Q,ie=0,ne=1)=>{const oe=D[V];if(oe==null)return;const le=a[V],re=C[V],ee=T!=null?Number(T[V]):void 0,Me=re>=0&&!Object.is(re,-0);if(!Number.isFinite(q)||ee!=null&&!Number.isFinite(ee))return;const Ee=g.enabled&&re!=null?this.getLabelText(ee??re,le,h,"y",f,g,{datum:le,value:ee??re,xKey:c,yKey:h,xName:d,yName:u,legendItemName:p}):void 0,Ie=ee!=null&&ee>re,xe=O({datum:le,datumIndex:V,xValue:oe,yValue:ee??re,cumulativeValue:ee??q,phantom:!1,currY:ee!=null?Z+ee:q,prevY:Z,x:$,width:U,isPositive:Me,yRange:Math.max(Z+(ee??-1/0),Q),labelText:Ee,opacity:ne,featherRatio:ie,crossScale:Ie?.6:void 0});if(B.push(xe),P.push(xe),ee!=null){const ze=O({datum:a[V],datumIndex:V,xValue:oe,yValue:ee,cumulativeValue:ee,phantom:!0,currY:q,prevY:Z,x:$,width:U,isPositive:Me,yRange:Q,labelText:void 0,opacity:ne,featherRatio:ie,crossScale:void 0});R.push(ze)}},[F,W]=r.range,H=Math.abs(W-F),j=s?.find(V=>V.maxRange>H);if(t.type==="grouped"){const V=m,$=e.hasColumnById(this,"yValue-start"),U=$?e.resolveColumnById(this,"yValue-start",t):void 0,Z=$?e.resolveColumnById(this,"yValue-end",t):void 0,q=$?e.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:Q,group:{aggregation:ie}}of e.forEachGroupDatum(this,t)){const ne=L(Q),oe=C[Q],le=oe>=0&&!Object.is(oe,-0),re=$?Number(U?.[Q]):0,ee=$?Number(Z?.[Q]):oe;let Me=ee;$&&(Me=ie[q][le?1:0]),_(Q,ne,V,re,ee,Me)}}else if(j==null){const V=t.invalidData?.get(this.id),$=m;let[U,Z]=this.visibleRangeIndices("xValue",n.range);t.input.count<1e3&&(U=0,Z=t.input.count);for(let q=U;q<Z;q+=1){if(V?.[q]===!0)continue;const Q=L(q),ie=Number(C[q]);_(q,Q,$,0,ie,ie)}}else{const{indexData:V,indices:$}=j,[U,Z]=this.visibleRangeIndices("xValue",n.range,$),q=x?-1:1;for(let Q=U;Q<Z;Q+=1){const ie=Q*A3,ne=V[ie+v3],oe=V[ie+S3],le=V[ie+M3],re=V[ie+D3];if(ne===-1)continue;const ee=L((ne+oe)/2|0),Me=Math.abs(L(oe)-L(ne))+m,Ee=Math.abs(oe-ne),Ie=er.is(r)?r.bandwidth*Math.max(Ee-1,1)/(r.step*Ee):1,xe=D[re]!=null?Number(C[re]):NaN,ze=D[le]!=null?Number(C[le]):NaN;if(xe>0){const he=ze>=0?q*(1-ze/xe):q;_(re,ee,Me,0,xe,xe,he,Ie)}if(ze<0){const he=xe<=0?-q*(1-xe/ze):-q;_(le,ee,Me,0,ze,ze,he,Ie)}}}return{itemId:h,nodeData:R.length>0?[...R,...B]:B,labelData:P,scales:this.calculateScaling(),visible:this.visible||k,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new zM}getHighlightData(e,t){const i=e.find(s=>s.datum===t.datum&&!s.phantom);return i!=null?[i]:void 0}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>this.getDatumId(t))}getItemStyle(e,t){const{id:i,properties:s}=this,{xKey:n,yKey:o,itemStyler:a,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c}=s,{xValue:h,yValue:d,datum:u,datumIndex:p}=e,g=this.getHighlightStyle(t,p);let f=ma(et(g,s.getStyle()),r,l,c);if(a&&e!=null){const{xDomain:x,yDomain:m}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")})),b=this.cachedDatumCallback(pr(this.getDatumId(e),t?"highlight":"node"),()=>{const v=this.ctx.highlightManager?.getActiveHighlight(),S=this.getHighlightStateString(v,t,p);return this.callWithContext(a,{seriesId:i,...Qr(h,d,n,o,x,m),datum:u,xValue:h,yValue:d,highlighted:t,highlightState:S,...f})});b&&(f=ma(et(b,f),r,l,c))}return f}updateDatumNodes(e){const{shadow:t}=this.properties,i=this.getCategoryDirection()==="x",s=this.getShapeFillBBox(),n=this.getBarDirection();e.datumSelection.each((o,a)=>{const r=this.getItemStyle(a,e.isHighlight);or(o,r,s);const l=r.cornerRadius??0;o.topLeftCornerRadius=a.topLeftCornerRadius?l:0,o.topRightCornerRadius=a.topRightCornerRadius?l:0,o.bottomRightCornerRadius=a.bottomRightCornerRadius?l:0,o.bottomLeftCornerRadius=a.bottomLeftCornerRadius?l:0,o.visible=i?(a.clipBBox?.width??a.width)>0:(a.clipBBox?.height??a.height)>0,o.direction=n,o.featherRatio=a.featherRatio,o.crisp=a.crisp,o.fillShadow=t})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=1})}updateLabelNodes(e){const{isHighlight:t=!1}=e,i={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yKey,legendItemName:this.properties.legendItemName??this.properties.xName??this.properties.xKey};e.labelSelection.each((s,n)=>{s.fillOpacity=this.getHighlightStyle(t,n?.datumIndex).opacity??1;const o=this.ctx.highlightManager?.getActiveHighlight(),a=this.getHighlightStateString(o,t,n.datumIndex);MN(this,s,i,this.properties.label,n.label,t,a)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yKey:r,yName:l,legendItemName:c,stackGroup:h,tooltip:d}=n,u=this.getCategoryAxis(),p=this.getValueAxis(),g=this.contextNodeData?.nodeData?.[e];if(!i||!s||!u||!p||!g)return;const f=s.dataSources.get(this.id)?.[e],x=i.resolveKeysById(this,"xValue",s)[e],m=i.resolveColumnById(this,"yValue-raw",s)[e];if(x==null)return;const b=this.getItemStyle(g,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(u,"tooltip",x,f,o,c),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(p,"tooltip",m,f,r,c)}]},{seriesId:t,datum:f,title:l,xKey:o,xName:a,yKey:r,yName:l,legendItemName:c,stackGroup:h,...b,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:ma({fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:o,lineDashOffset:a},r,l,c)}}getLegendData(e){const{showInLegend:t}=this.properties;if(e!=="category")return[];const{id:i,ctx:{legendManager:s},visible:n}=this,{yKey:o,yName:a,legendItemName:r}=this.properties;return[{legendType:"category",id:i,itemId:o,seriesId:i,enabled:n&&s.getItemEnabled({seriesId:i,itemId:o}),label:{text:r??a??o},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!t}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const s=Wm(Hm(this.isVertical(),this.axes,"normal"));Li(this.id,"nodes",this.ctx.animationManager,[e],s),oi(this,"labels",this.ctx.animationManager,t),oi(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,annotationSelections:s,contextData:n,previousContextData:o}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id);const a=s1(this.id,t,this.getDatumId.bind(this),e.contextData,o,this.processedData),r=o==null?"fade":"normal",l=Wm(Hm(this.isVertical(),this.axes,r));Li(this.id,"nodes",this.ctx.animationManager,[t],l,(c,h)=>this.getDatumId(h),a),(a?.changed||!Xc(n.groupScale,o?.groupScale))&&(oi(this,"labels",this.ctx.animationManager,i),oi(this,"annotations",this.ctx.animationManager,...s))}getDatumId(e){return pr(e.xValue,e.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e].clipBBox;return HM(this,t)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};bg.className="BarSeries",bg.type="bar";var o1={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:e=>new bg(e),stackable:!0,groupable:!0,defaultAxes:L2,themeTemplate:{series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:fd,fillPatternDefaults:rr,fillImageDefaults:Ic,fillOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{...Qn,padding:{$isUserOption:["./spacing",0,8]},enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"chartBackgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:sl,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}},highlight:al()}}},a1={type:"series",name:"bar",chartType:"cartesian",options:vm,create:e=>new bg(e)},$m=3,N3=5;function r1(e,t,i,s,n,o,a,r,l,c,h){let d=0,u=1/0;const p=(r+c)/2,g=(l+h)/2;for(const f of a){const x=e[f],m=t[f];if(x==null||m==null)continue;const b=yr(x,i,n),v=yr(m,s,o),S=(b-p)**2+(v-g)**2;S<u&&(u=S,d=f)}return d}function E3(e,t,i,s,n,o,a,r,l,c,h){let d=0;for(const u of a){const p=e[u],g=t[u];if(p==null||g==null)continue;const f=yr(p,i,n),x=yr(g,s,o);f>=r&&f<=c&&x>=l&&x<=h&&(d+=1)}return d}function WM(e,t,i,s,n,o,a,r,l,c,h){if(a.length<N3)return;if(r===c&&l===h){const m=r1(e,t,i,s,n,o,a,r,l,c,h);return{scale:0,x0:r,y0:l,x1:c,y1:h,indices:a,primaryDatumIndex:m,children:null}}const d=[{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]}],u=(r+c)/2,p=(l+h)/2;for(const m of a){const b=e[m],v=t[m];if(b==null||v==null)continue;const S=yr(b,i,n),D=yr(v,s,o),C=(S>u?1:0)+(D>p?2:0),T=d[C];T.indices.push(m),T.x0=Math.min(T.x0,S),T.y0=Math.min(T.y0,D),T.x1=Math.max(T.x1,S),T.y1=Math.max(T.y1,D)}let g=[];for(const m of d){const{indices:b,x0:v,x1:S,y0:D,y1:C}=m,T=WM(e,t,i,s,n,o,b,v,D,S,C);T!=null&&g.push(T)}if(g.length===1)return g[0];g.length===0&&(g=null);const f=Math.hypot(c-r,h-l),x=r1(e,t,i,s,n,o,a,r,l,c,h);return{scale:f,x0:r,y0:l,x1:c,y1:h,indices:a,primaryDatumIndex:x,children:g}}function O3(e,t,i,s,n,o,a,r){const[l,c]=fg(e,o),[h,d]=fg(t,a),[u,p]=r,g=[];if(n!=null&&p>u){const f=Array.from({length:$m},()=>[]);for(let x=0;x<n.length;x+=1){const v=(n[x]-u)/(p-u)*$m|0;v>=0&&v<$m&&f[v].push(x)}for(let x=0;x<f.length;x+=1){const m=f[x],b=WM(i,s,l,h,c,d,m,0,0,1,1);if(b!=null){const v=x/$m;g.push({sizeRatio:v,node:b})}}}else{const f=i.map((m,b)=>b),x=WM(i,s,l,h,c,d,f,0,0,1,1);x!=null&&g.push({sizeRatio:0,node:x})}return g.length>0?{xValues:i,yValues:s,xd0:l,xd1:c,yd0:h,yd1:d,filters:g}:void 0}function l1(e,t,i,s,n,o){const{xRange:a,yRange:r,xVisibleRange:[l,c],yVisibleRange:[h,d],minSize:u,maxSize:p}=i,{xValues:g,yValues:f,xd0:x,xd1:m,yd0:b,yd1:v}=t,S=1/Math.min(a/(c-l),r/(d-h));for(const{sizeRatio:D,node:C}of t.filters){const T=.5*(u+D*(p-u)),k=T*S,L=e*k,N=l-T/a,w=c+T/a,O=h-T/r,R=d+T/r,B=[C];for(;B.length>0;){const P=B.pop();if(!(P.x1<N||P.x0>w||P.y1<O||P.y0>R))if(P.scale<=L)s!=null&&(s.count+=1),n?.push({datumIndex:P.primaryDatumIndex,count:P.indices.length,dilation:ve(1,P.scale/k,e)});else if(P.children==null){const{indices:_}=P;if(s!=null){const W=P.x0>=l&&P.x1<=c&&P.y0>=h&&P.y1<=d?_.length:E3(g,f,x,b,m,v,_,l,h,c,d);s.count+=W}o?.push(..._)}else B.push(...P.children)}}}function $M(e,t,i){const s={count:0};return l1(e,t,i,s,void 0,void 0),s.count}var P3=100,R3=12;function B3(e,t,i){let s=1,n=2;for(;$M(n,e,t)>i&&n<P3;)s*=2,n*=2;for(let o=0;o<R3;o+=1){const a=(n+s)/2;$M(a,e,t)>i?s=a:n=a}return s}function F3(e,t,i){const s=[],n=[];return l1(e,t,i,void 0,s,n),{groupedAggregation:s,singleDatumIndices:n}}var UM=class extends Xi{constructor(){super(...arguments),this.maxSize=30}};M([I,te()],UM.prototype,"maxSize",2),M([I,sS()],UM.prototype,"domain",2);var c1=class extends Vt{constructor(){super(...arguments),this.placement="top"}};M([I],c1.prototype,"placement",2);var dt=class extends bl{constructor(){super(...arguments),this.label=new c1,this.tooltip=Kc(),this.maxRenderedItems=1/0,this.marker=new UM}};M([I],dt.prototype,"xKey",2),M([I],dt.prototype,"yKey",2),M([I],dt.prototype,"sizeKey",2),M([I],dt.prototype,"labelKey",2),M([I],dt.prototype,"xFilterKey",2),M([I],dt.prototype,"yFilterKey",2),M([I],dt.prototype,"sizeFilterKey",2),M([I],dt.prototype,"xName",2),M([I],dt.prototype,"yName",2),M([I],dt.prototype,"sizeName",2),M([I],dt.prototype,"labelName",2),M([I],dt.prototype,"title",2),M([Gi("marker.shape")],dt.prototype,"shape",2),M([Gi("marker.size")],dt.prototype,"size",2),M([Gi("marker.maxSize")],dt.prototype,"maxSize",2),M([Gi("marker.domain")],dt.prototype,"domain",2),M([Gi("marker.fillGradientDefaults")],dt.prototype,"fillGradientDefaults",2),M([Gi("marker.fillPatternDefaults")],dt.prototype,"fillPatternDefaults",2),M([Gi("marker.fillImageDefaults")],dt.prototype,"fillImageDefaults",2),M([Gi("marker.fill")],dt.prototype,"fill",2),M([Gi("marker.fillOpacity")],dt.prototype,"fillOpacity",2),M([Gi("marker.stroke")],dt.prototype,"stroke",2),M([Gi("marker.strokeWidth")],dt.prototype,"strokeWidth",2),M([Gi("marker.strokeOpacity")],dt.prototype,"strokeOpacity",2),M([Gi("marker.lineDash")],dt.prototype,"lineDash",2),M([Gi("marker.lineDashOffset")],dt.prototype,"lineDashOffset",2),M([Gi("marker.itemStyler")],dt.prototype,"itemStyler",2),M([I],dt.prototype,"label",2),M([I],dt.prototype,"tooltip",2),M([I],dt.prototype,"maxRenderedItems",2);var z3=class extends AM{constructor(e,t,i,s){super(e,t,i,s),this.sizeKey=s.properties.sizeKey}},vg=class extends Zc{constructor(e){super({moduleCtx:e,propertyKeys:{...zd,label:["labelKey"],size:["sizeKey"]},propertyNames:{..._d,label:["labelName"],size:["sizeName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationResetFns:{label:Yc,datum:Fm},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=z3,this.properties=new dt,this.dataAggregation=void 0,this.sizeScale=new Fc}get pickModeAxis(){return"main-category"}async processData(e){if(this.data==null||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:t,yScale:i}),o=this.sizeScale.type,{xKey:a,yKey:r,sizeKey:l,xFilterKey:c,yFilterKey:h,sizeFilterKey:d,labelKey:u,marker:p}=this.properties,{dataModel:g,processedData:f}=await this.requestDataModel(e,this.data,{props:[St(a,s,{id:"xValue"}),St(r,n,{id:"yValue"}),...c!=null?[St(c,s,{id:"xFilterValue"})]:[],...h!=null?[St(h,n,{id:"yFilterValue"})]:[],...d!=null?[St(d,o,{id:"sizeFilterValue"})]:[],...l?[St(l,o,{id:"sizeValue"})]:[],...u?[St(u,"category",{id:"labelValue"})]:[]]});this.dataAggregation=this.aggregateData(g,f);const x=l?g.resolveProcessedDataIndexById(this,"sizeValue"):void 0,m=p.domain?[p.domain[0],p.domain[1]]:void 0;this.sizeScale.domain=m??(x==null?void 0:f.domain.values[x])??[],this.animationState.transition("updateData")}xCoordinateRange(e,t,i){const{properties:s,sizeScale:n}=this,{size:o,sizeKey:a}=s,r=this.axes.x.scale.convert(e),l=a!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):o)*t;return[r-h,r+h]}yCoordinateRange(e,t,i){const{properties:s,sizeScale:n}=this,{size:o,sizeKey:a}=s,r=this.axes.y.scale.convert(e[0]),l=a!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):o)*t;return[r-h,r+h]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s={x:"xValue",y:"yValue"},n=s[e],o=t.resolveProcessedDataDefById(this,n),a=t.getDomain(this,n,"value",i);if(o?.def.type==="value"&&o?.def.valueType==="category")return a;const l=s[e==="x"?"y":"x"],c=this.domainForClippedRange(e,[n],l);return vn(dl(c))}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t)}getVisibleItems(e,t,i){const{dataAggregation:s,axes:n}=this,o=n.x,a=n.y;if(s==null||o==null||a==null)return this.countVisibleItems("xValue",["yValue"],e,t,i);const r=this.aggregationOptions(o,a,e,t??[0,1]);return $M(0,s,r)}aggregateData(e,t){if(t.type==="grouped"||t.input.count<=this.properties.maxRenderedItems)return;const i=this.axes.x,s=this.axes.y;if(i==null||s==null)return;const n=i.scale,o=s.scale;if(!ft.is(n)||!ft.is(o))return;const{sizeScale:a,properties:r}=this,{sizeKey:l}=r,c=e.resolveColumnById(this,"xValue",t),h=e.resolveColumnById(this,"yValue",t),d=l?e.resolveColumnById(this,"sizeValue",t):void 0,u=e.getDomain(this,"xValue","value",t),p=e.getDomain(this,"yValue","value",t),g=l?a.domain:[0,0];return O3(n.type,o.type,c,h,d,u,p,g)}aggregationOptions(e,t,i=e.visibleRange,s=t.visibleRange){const{sizeKey:n,marker:o}=this.properties,a=Math.abs(e.range[1]-e.range[0]),r=Math.abs(t.range[1]-t.range[0]),l=o.size,c=n?o.maxSize:l;return{xRange:a,yRange:r,minSize:l,maxSize:c,xVisibleRange:i,yVisibleRange:s}}createNodeData(){const{axes:e,dataModel:t,processedData:i,sizeScale:s,visible:n}=this,{xKey:o,yKey:a,sizeKey:r,xFilterKey:l,yFilterKey:c,sizeFilterKey:h,labelKey:d,xName:u,yName:p,sizeName:g,labelName:f,label:x,marker:m,maxRenderedItems:b}=this.properties,{enabled:v,placement:S}=x,D=wi.anchor(m.shape),C=e.x,T=e.y;if(!(t&&i&&n&&C&&T))return;const k=t.resolveColumnById(this,"xValue",i),L=t.resolveColumnById(this,"yValue",i),N=r!=null?t.resolveColumnById(this,"sizeValue",i):void 0,w=d!=null?t.resolveColumnById(this,"labelValue",i):void 0,O=l!=null?t.resolveColumnById(this,"xFilterValue",i):void 0,R=c!=null?t.resolveColumnById(this,"yFilterValue",i):void 0,B=h!=null?t.resolveColumnById(this,"sizeFilterValue",i):void 0;let P;d?P=[]:r?P=t.getDomain(this,"sizeValue","value",i):P=[];const _=C.scale,F=T.scale,W=(_.bandwidth??0)/2,H=(F.bandwidth??0)/2,j=[];s.range=[m.size,m.maxSize];const V=qr.getMeasurer({font:x}),$=i.dataSources.get(this.id);if($==null)return;const U=rd(x),Z=(Q,ie,ne)=>{const oe=$[Q],le=k[Q],re=L[Q],ee=N?.[Q],Me=_.convert(le)+W,Ee=F.convert(re)+H;let Ie;O!=null&&R!=null&&(Ie=O[Q]===le&&R[Q]===re,B!=null&&Ie&&(Ie=B[Q]===ee));let xe;if(v){let he,ye,be;d&&w?(he=w[Q],ye=d,be="label"):r?(he=ee,ye=r,be="size"):(he=re,ye=a,be="y");const Se=this.getLabelText(he,oe,ye,be,P,x,{value:he,datum:oe,xKey:o,yKey:a,sizeKey:r,labelKey:d,xName:u,yName:p,sizeName:g,labelName:f}),Oe=V.measureText(String(Se));Oe.width+=U.left+U.right,Oe.height+=U.bottom+U.top,xe={text:Se,...Oe}}else xe={text:"",width:0,height:0};const ze=ee!=null?s.convert(ee):m.size;j.push({series:this,itemId:a,yKey:a,xKey:o,datum:oe,datumIndex:Q,xValue:le,yValue:re,sizeValue:ee,capDefaults:{lengthRatioMultiplier:m.getDiameter(),lengthMax:1/0},point:{x:Me,y:Ee,size:Math.sqrt(ne)*ze},midPoint:{x:Me,y:Ee},label:xe,anchor:D,placement:S,count:ie,dilation:ne,selected:Ie})},{dataAggregation:q}=this;if(q==null)for(let Q=0;Q<$.length;Q++)Z(Q,1,1);else{const Q=this.aggregationOptions(C,T),ie=B3(q,Q,b),{groupedAggregation:ne,singleDatumIndices:oe}=F3(ie,q,Q);for(const{datumIndex:le,count:re,dilation:ee}of ne)Z(le,re,ee);for(const le of oe)Z(le,1,1)}return{itemId:a,nodeData:j,labelData:v?j:[],scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,{sizeKey:s}=this.properties;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const n=this.properties.marker.enabled?t:[];let o;return s&&(o=a=>pr([a.xValue,a.yValue,a.sizeValue,a.label.text])),i.update(n,void 0,o)}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,sizeKey:o,labelKey:a,marker:r}=this.properties;this.sizeScale.range=[r.size,r.maxSize];const l=this.getShapeFillBBox(),c=this.dataAggregation!=null,h={xKey:s,yKey:n,sizeKey:o,labelKey:a};t.each((d,u,p)=>{const{count:g,dilation:f}=u,x=this.getMarkerStyle(r,u,h,i);x.fillOpacity=(1-(1-(x.fillOpacity??1))**g)/Math.sqrt(f),this.applyMarkerStyle(x,d,u.point,l,{selected:u.selected}),d.zIndex=c?[-g,p]:0}),i||this.properties.marker.markClean()}updatePlacedLabelData(e){this.labelSelection.update(e.map(t=>({...t.datum,point:{x:t.x,y:t.y,size:t.datum.point.size}})),t=>{t.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,n)=>{const o=t||this.isSeriesHighlighted(i),a=this.getHighlightStateString(i,o,n.datumIndex),r=Da(this,n,this.properties,this.properties.label,o,a);s.text=n.label.text,s.fill=r.color,s.x=n.point?.x??0,s.y=n.point?.y??0,s.fontStyle=r.fontStyle,s.fontWeight=r.fontWeight,s.fontSize=r.fontSize,s.fontFamily=r.fontFamily,s.textAlign="left",s.textBaseline="top",s.fillOpacity=this.getHighlightStyle(t,n.datumIndex).opacity??1,s.setBoxing(r)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o,ctx:a}=this,{formatManager:r}=a,{xKey:l,xName:c,yKey:h,yName:d,sizeKey:u,sizeName:p,labelKey:g,labelName:f,title:x,tooltip:m,marker:b,legendItemName:v}=o,S=n.x,D=n.y;if(!i||!s||!S||!D)return;const C=s.dataSources.get(this.id)?.[e],T=i.resolveColumnById(this,"xValue",s)[e],k=i.resolveColumnById(this,"yValue",s)[e],L=this.contextNodeData?.nodeData[e];if(T==null||L==null)return;const N=[];if(this.isLabelEnabled()&&g!=null){const O=i.resolveColumnById(this,"labelValue",s)[e],R=r.format(this.callWithContext.bind(this),{type:"category",value:O,datum:C,seriesId:t,legendItemName:v,key:g,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});N.push({label:f,fallbackLabel:g,value:R??qh(O)})}if(N.push({label:c,fallbackLabel:l,value:this.getAxisValueText(S,"tooltip",T,C,l,v)},{label:d,fallbackLabel:h,value:this.getAxisValueText(D,"tooltip",k,C,h,v)}),u!=null){const O=i.resolveColumnById(this,"sizeValue",s)[e],R=i.getDomain(this,"sizeValue","value",s),B=r.format(this.callWithContext.bind(this),{type:"number",value:O,datum:C,seriesId:t,legendItemName:v,key:u,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:R,fractionDigits:void 0});N.push({label:p,fallbackLabel:u,value:B??qh(O)})}const w=this.getMarkerStyle(b,{datum:C,datumIndex:e},{xKey:l,yKey:h,sizeKey:u,labelKey:g,highlighted:!0},!1);return this.formatTooltipWithContext(m,{title:x,symbol:this.legendItemSymbol(),data:N},{seriesId:t,datum:C,title:h,xKey:l,xName:c,yKey:h,yName:d,sizeKey:u,sizeName:p,labelKey:g,labelName:f,...w,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker,{},void 0,!1,void 0,void 0,!1)}}getLegendData(){const{id:e,ctx:{legendManager:t},visible:i}=this,{yKey:s,yName:n,title:o}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i&&t.getItemEnabled({seriesId:e,itemId:s}),label:{text:o??n??s},symbol:this.legendItemSymbol()}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){QN(this,this.ctx.animationManager,e),oi(this,"labels",this.ctx.animationManager,t)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new wi}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,sizeKey:s,labelKey:n,marker:o}=this.properties;return this.getMarkerStyle(o,e,{xKey:t,yKey:i,sizeKey:s,labelKey:n},!1)}computeFocusBounds(e){return zm(this,e)}hasItemStylers(){const{itemStyler:e,marker:t,label:i}=this.properties;return!!(e??t.itemStyler??i.itemStyler)}};vg.className="BubbleSeries",vg.type="bubble";var _3={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:e=>new vg(e),defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:jp,fillPatternDefaults:rr,fillImageDefaults:Ic,fillOpacity:.8,maxRenderedItems:1e4,label:{...Qn,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:al()}}},h1={type:"series",name:"bubble",chartType:"cartesian",options:A$,create:e=>new vg(e)},Kt=class extends bl{constructor(){super(...arguments),this.fillGradientDefaults=new Kn,this.fillPatternDefaults=new Tt,this.fillImageDefaults=new Qs,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 Aa,this.label=new Vt,this.tooltip=Kc()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r,opacity:1}}};M([I],Kt.prototype,"xKey",2),M([I],Kt.prototype,"yKey",2),M([I],Kt.prototype,"xName",2),M([I],Kt.prototype,"yName",2),M([I],Kt.prototype,"fill",2),M([I],Kt.prototype,"fillGradientDefaults",2),M([I],Kt.prototype,"fillPatternDefaults",2),M([I],Kt.prototype,"fillImageDefaults",2),M([I],Kt.prototype,"fillOpacity",2),M([I],Kt.prototype,"stroke",2),M([I],Kt.prototype,"strokeWidth",2),M([I],Kt.prototype,"strokeOpacity",2),M([I],Kt.prototype,"lineDash",2),M([I],Kt.prototype,"lineDashOffset",2),M([I],Kt.prototype,"cornerRadius",2),M([I],Kt.prototype,"areaPlot",2),M([I],Kt.prototype,"bins",2),M([I],Kt.prototype,"aggregation",2),M([I],Kt.prototype,"binCount",2),M([I],Kt.prototype,"shadow",2),M([I],Kt.prototype,"label",2),M([I],Kt.prototype,"tooltip",2);var d1=10,Um=class extends Zc{constructor(e){super({moduleCtx:e,propertyKeys:zd,propertyNames:_d,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!0,animationResetFns:{datum:xg,label:Yc}}),this.properties=new Kt,this.calculatedBins=[]}deriveBins(e){const t=Sp(e[0],e[1],d1).ticks,i=Mp(e[0],e[1],d1),[s]=t,n=o=>[o,o+i];return[[s-i,s],...t.map(n)]}calculateNiceBins(e,t){const i=Math.floor(e[0]),s=e[1],n=t||1,{start:o,binSize:a}=this.calculateNiceStart(i,s,n);return this.getBins(o,s,a,n)}getBins(e,t,i,s){const n=[],o=this.calculatePrecision(i);for(let a=0;a<s;a++){const r=Math.round((e+a*i)*o)/o;let l=Math.round((e+(a+1)*i)*o)/o;a===s-1&&(l=Math.max(l,t)),n[a]=[r,l]}return n}calculatePrecision(e){let t=10;if(isFinite(e)&&e>0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const s=Math.abs(t-e)/i,n=Math.floor(Math.log10(s)),o=Math.pow(10,n);return{start:Math.floor(e/o)*o,binSize:s}}async processData(e){this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:t,yKey:i,areaPlot:s,aggregation:n}=this.properties,o=this.axes.x?.scale,a=this.axes.y?.scale,{xScaleType:r,yScaleType:l}=this.getScaleInformation({yScale:a,xScale:o}),c=[ul(t,r),tw];if(i){let d=U0("groupAgg");n==="count"||(n==="sum"?d=j2("groupAgg"):n==="mean"&&(d=H2("groupAgg"))),s&&(d=Y0("groupAgg",d)),c.push(St(i,l,{invalidValue:void 0}),d)}else{c.push(Z2("count"));let d=U0("groupAgg");s&&(d=Y0("groupAgg",d)),c.push(d)}const h=d=>{const u=vn(d.domain.keys[0]);if(u.length===0)return d.domain.groups=[],()=>[];const p=di(this.properties.binCount)?this.calculateNiceBins(u,this.properties.binCount):this.properties.bins??this.deriveBins(u),g=p.length;return this.calculatedBins=[...p],f=>{let x=f[0];if(aa(x)&&(x=x.getTime()),!di(x))return[];for(let m=0;m<g;m++){const b=p[m];if(x>=b[0]&&x<b[1]||m===g-1&&x<=b[1])return b}return[]}};!this.ctx.animationManager.isSkipped()&&this.processedData&&c.push(Qp(this.id,this.processedData,!1)),await this.requestDataModel(e,this.data,{props:c,groupByFn:h}),this.animationState.transition("updateData")}xCoordinateRange(){return[NaN,NaN]}yCoordinateRange(){return[NaN,NaN]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i||!this.calculatedBins.length)return[];const s=i.getDomain(this,"groupAgg","aggregate",t),n=this.calculatedBins?.[0][0],o=this.calculatedBins?.[(this.calculatedBins?.length??0)-1][1];return vn(e==="x"?[n,o]:s)}getSeriesRange(e,[t,i]){const{dataModel:s,processedData:n}=this;if(!s||n?.type!=="grouped")return[NaN,NaN];const o=this.axes.x.scale,a=0;let r=-1/0;return n.groups.forEach(({keys:l,aggregation:c})=>{const[[h,d]=[0,0]]=c,[u,p]=l,[g,f]=Vi([o.convert(u),o.convert(p)]);if(f>=t&&g<=i){const x=h+d;r=Math.max(r,x)}}),a>r?[NaN,NaN]:[a,r]}frequency(e){return e.datumIndices.reduce((t,i)=>t+i.length,0)}createNodeData(){const{axes:e,processedData:t,dataModel:i}=this,s=e.x,n=e.y;if(!s||!n||!i)return;const{scale:o}=s,{scale:a}=n,{xKey:r,yKey:l,xName:c,yName:h,label:d}=this.properties,u=[],p={itemId:this.properties.yKey??this.id,nodeData:u,labelData:u,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return!this.visible||t==null||t.type!=="grouped"||(t.groups.forEach((g,f)=>{const{keys:x,aggregation:m}=g,[[b,v]=[0,0]]=m,S=this.frequency(g),D=x,[C,T]=D,k=[...i.forEachDatum(this,t,g)],L=o.convert(C),N=o.convert(T),w=b+v,O=a.convert(0),R=a.convert(w),B=Math.abs(N-L),P=Math.abs(R-O),_=Math.min(L,N),F=Math.min(O,R);let W;d.enabled&&w!==0&&(W={x:_+B/2,y:F+P/2,text:this.getLabelText(w,k,l,"y",[],d,{value:w,datum:k,xKey:r,yKey:l,xName:c,yName:h})});const H={x:_+B/2,y:F+P/2},j=n.isReversed();u.push({series:this,datumIndex:f,datum:k,aggregatedValue:w,frequency:S,domain:D,yKey:l,xKey:r,x:_,y:F,xValue:L,yValue:R,width:B,height:P,midPoint:H,topLeftCornerRadius:!j,topRightCornerRadius:!j,bottomRightCornerRadius:j,bottomLeftCornerRadius:j,label:W,crisp:!0})}),u.sort((g,f)=>g.x-f.x)),p}nodeFactory(){return new Ti}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return i.update(t,void 0,s=>s.domain.join("_"))}getItemStyle(e,t){const{properties:i}=this,s=this.getHighlightStyle(e,t?.datumIndex);return ma(et(s,i.getStyle()),i.fillGradientDefaults,i.fillPatternDefaults,i.fillImageDefaults)}updateDatumNodes(e){const{isHighlight:t}=e,{shadow:i}=this.properties,s=this.getShapeFillBBox();e.datumSelection.each((n,o)=>{const a=this.getItemStyle(t,o),{cornerRadius:r=0}=a,{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:h,bottomLeftCornerRadius:d}=o;or(n,a,s),n.topLeftCornerRadius=l?r:0,n.topRightCornerRadius=c?r:0,n.bottomRightCornerRadius=h?r:0,n.bottomLeftCornerRadius=d?r:0,n.crisp=o.crisp,n.fillShadow=i,n.visible=o.height>0})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=1,s.textAlign="center",s.textBaseline="middle"})}updateLabelNodes(e){const t=this.isLabelEnabled();e.labelSelection.each((i,s)=>{const n=Da(this,s,this.properties,this.properties.label),{enabled:o,fontStyle:a,fontWeight:r,fontSize:l,fontFamily:c,color:h}=n;o&&t&&s?.label?(i.text=s.label.text,i.x=s.label.x,i.y=s.label.y,i.fontStyle=a,i.fontWeight=r,i.fontFamily=c,i.fontSize=l,i.fill=h,i.visible=!0,i.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1,i.setBoxing(n)):i.visible=!1})}initQuadTree(e){const{value:t}=this.contentGroup.children().next();t instanceof Re&&_M(e,t.children())}pickNodeClosestDatum(e){return jm(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o,ctx:{localeManager:a}}=this,{xKey:r,xName:l,yKey:c,yName:h,tooltip:d,legendItemName:u}=o,p=n.x,g=n.y;if(!i||s?.type!=="grouped"||!p||!g)return;const f=s.groups[e],{aggregation:x,keys:m}=f,[[b,v]=[0,0]]=x,S=this.frequency(f),D=m,[C,T]=D,k=b+v,L={data:[...i.forEachDatum(this,s,f)],aggregatedValue:k,frequency:S,domain:D},N=[{label:l,fallbackLabel:r,value:`${this.getAxisValueText(p,"tooltip",C,L,r,u)} - ${this.getAxisValueText(p,"tooltip",T,L,r,u)}`},{label:a.t("seriesHistogramTooltipFrequency"),value:this.getAxisValueText(g,"tooltip",S,L,c,u)}];if(c!=null){let w;switch(o.aggregation){case"sum":w=a.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":w=a.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":w=a.t("seriesHistogramTooltipCount",{yName:h??c});break}N.push({label:w,value:this.getAxisValueText(g,"tooltip",k,L,c,u)})}return this.formatTooltipWithContext(d,{symbol:this.legendItemSymbol(),data:N},{seriesId:t,datum:L,title:h,xKey:r,xName:l,yKey:c,yName:h,xRange:[C,T],frequency:S,...this.getItemStyle(!1)})}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:ma({fill:e??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:t,strokeOpacity:n,strokeWidth:s,lineDash:o,lineDashOffset:a},r,l,c)}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:o,showInLegend:a}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:o??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!a}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Wm(Hm(!0,this.axes,"normal"));Li(this.id,"datums",this.ctx.animationManager,[e],i),oi(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetDatumAnimation(e)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return HM(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.label.itemStyler!=null}};Um.className="HistogramSeries",Um.type="histogram";var G3={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:e=>new Um(e),defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:fd,fillPatternDefaults:rr,fillImageDefaults:Ic,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{...Qn,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},shadow:{enabled:!1,color:sl,xOffset:3,yOffset:3,blur:5},highlight:al()}}},u1={type:"series",name:"histogram",chartType:"cartesian",enterprise:!0,options:I$,create:e=>new Um(e)},Pi=class extends bl{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Gd,this.marker=new Xi,this.label=new Vt,this.tooltip=Kc(),this.connectMissingData=!1,this.sparklineMode=!1}};M([I],Pi.prototype,"xKey",2),M([I],Pi.prototype,"yKey",2),M([I],Pi.prototype,"xName",2),M([I],Pi.prototype,"yName",2),M([I],Pi.prototype,"yFilterKey",2),M([I],Pi.prototype,"stackGroup",2),M([I],Pi.prototype,"normalizedTo",2),M([I],Pi.prototype,"title",2),M([I],Pi.prototype,"stroke",2),M([I],Pi.prototype,"strokeWidth",2),M([I],Pi.prototype,"strokeOpacity",2),M([I],Pi.prototype,"lineDash",2),M([I],Pi.prototype,"lineDashOffset",2),M([I],Pi.prototype,"interpolation",2),M([I],Pi.prototype,"marker",2),M([I],Pi.prototype,"label",2),M([I],Pi.prototype,"tooltip",2),M([I],Pi.prototype,"connectMissingData",2),M([I],Pi.prototype,"sparklineMode",2);var V3=.25,j3=ap(qN),Sg=class extends Zc{constructor(e){super({moduleCtx:e,propertyKeys:zd,propertyNames:_d,categoryKey:"xValue",pickModes:[2,1,0],datumSelectionGarbageCollection:!1,animationResetFns:{path:FM({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Yc,datum:(t,i)=>({...Fm(t),...mg(t,i)})},clipFocusBox:!1}),this.properties=new Pi,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}async processData(e){if(this.data==null)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=0}={}}=this,{xKey:o,yKey:a,yFilterKey:r,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),d=this.axes.x?.scale,u=this.axes.y?.scale,{isContinuousX:p,xScaleType:g,yScaleType:f}=this.getScaleInformation({xScale:d,yScale:u}),x=n>1||c!=null,m={invalidValue:null};l&&x&&(m.invalidValue=0),x&&!i&&(m.forceValue=0);const b=[];if((!p||x)&&b.push(ul(o,g,{id:"xKey"})),b.push(St(o,g,{id:"xValue"}),St(a,f,{id:"yValueRaw",...m,invalidValue:void 0})),r!=null&&b.push(St(r,f,{id:"yFilterRaw"})),x){const D=[`line-stack-${s}-yValues`,`line-stack-${s}-yValues-trailing`,`line-stack-${s}-yValues-marker`];b.push(...pl(a,"window","current",{id:"yValueEnd",...m,groupId:D[0]},f),...pl(a,"window-trailing","current",{id:"yValueStart",...m,groupId:D[1]},f),...pl(a,"normal","current",{id:"yValueCumulative",...m,groupId:D[2]},f)),ii(c)&&b.push(ym([D[0],D[1],D[2]],c))}h&&(b.push(qp(p?["xValue"]:void 0)),this.processedData&&b.push(Qp(this.id,this.processedData)));const{dataModel:v,processedData:S}=await this.requestDataModel(e,t,{props:b,groupByKeys:x,groupByData:!x});this.dataAggregationFilters=this.aggregateData(v,S),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!t||!i)return[];if(e==="x"){const o=t.resolveProcessedDataDefById(this,"xValue"),a=t.getDomain(this,"xValue","value",i);return o?.def.type==="value"&&o.def.valueType==="category"?a:vn(dl(a))}const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw",n=this.domainForClippedRange("y",[s],"xValue");return vn(n)}getSeriesRange(e,t){const i=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.domainForVisibleRange("y",[i],"xValue",t)}getVisibleItems(e,t,i){const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.countVisibleItems("xValue",[s],e,t,i)}aggregateData(e,t){if(t.type!=="ungrouped"||vd(t))return;const i=this.axes.x;if(i==null)return;const{scale:s}=i,n=e.resolveColumnById(this,"xValue",t),o=e.resolveColumnById(this,"yValueRaw",t),a=e.getDomain(this,"xValue","value",t);return j3(s.type,n,o,a)}createNodeData(){const{dataModel:e,processedData:t,axes:i,dataAggregationFilters:s}=this,n=i.x,o=i.y;if(!e||!t||!n||!o)return;const{xKey:a,yKey:r,yFilterKey:l,xName:c,yName:h,marker:d,label:u,connectMissingData:p,interpolation:g,legendItemName:f}=this.properties,x=this.dataModel?.hasColumnById(this,"yValueEnd"),m=n.scale,b=o.scale,v=(m.bandwidth??0)/2,S=(b.bandwidth??0)/2,D=d.enabled?d.size:0,C=t.dataSources.get(this.id)??[],T=e.resolveColumnById(this,"xValue",t),k=e.resolveColumnById(this,"yValueRaw",t),L=x?e.resolveColumnById(this,"yValueEnd",t):void 0,N=x?e.resolveColumnById(this,"yValueCumulative",t):k,w=l!=null?e.resolveColumnById(this,"yFilterRaw",t):void 0,O=this.getSeriesDomain("y"),R={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},B=[],P=[],_=ie=>{const ne=C[ie],oe=T[ie],le=k[ie],re=L?.[ie],ee=w?.[ie],Me=m.convert(oe)+v,Ee=b.convert(N[ie])+S;if(!Number.isFinite(Me))return;if(le!=null){const xe=u.enabled?this.getLabelText(le,ne,r,"y",O,u,{value:le,datum:ne,xKey:a,yKey:r,xName:c,yName:h,legendItemName:f}):void 0;B.push({series:this,datum:ne,datumIndex:ie,yKey:r,xKey:a,point:{x:Me,y:Ee,size:D},midPoint:{x:Me,y:Ee},cumulativeValue:re,yValue:le,xValue:oe,capDefaults:R,labelText:xe,selected:ee})}const Ie=P[P.length-1];if(le!=null){const xe={point:{x:Me,y:Ee},xDatum:oe,yDatum:le};Array.isArray(Ie)?Ie.push(xe):Ie!=null?(Ie.skip+=1,P.push([xe])):P.push([xe])}else p||(Array.isArray(Ie)||Ie==null?P.push({skip:0}):Ie.skip+=1)},[F,W]=m.range,H=Math.abs(W-F),V=s?.find(ie=>ie.maxRange>H)?.indices;let[$,U]=this.visibleRangeIndices("xValue",n.range,V);$=Math.max($-1,0),U=Math.min(U+1,V?.length??T.length),t.input.count<1e3&&($=0,U=t.input.count);for(let ie=$;ie<U;ie+=1)_(V?.[ie]??ie);const Z=P.flatMap(ie=>Array.isArray(ie)?Pm(ie,g):[]),q={itemId:r,spans:Z},Q=w?.some((ie,ne)=>ie===k[ne])??!1;return{itemId:r,nodeData:B,labelData:B,strokeData:q,scales:this.calculateScaling(),visible:this.visible,crossFiltering:Q}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[t],visible:i,animationEnabled:s}=e,n=this.contextNodeData?.crossFiltering===!0,{strokeWidth:o,stroke:a,strokeOpacity:r,lineDash:l,lineDashOffset:c,opacity:h}=et(this.getHighlightStyle(),this.properties);t.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:h,stroke:a,strokeWidth:o,strokeOpacity:r*(n?V3:1),lineDash:l,lineDashOffset:c}),s||(t.visible=i),Gm(this,t)}updateDatumSelection(e){let{nodeData:t}=e;const{datumSelection:i}=e;return t=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0?t:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(t,void 0,n=>pr(n.xValue))}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,marker:o,stroke:a,strokeWidth:r,strokeOpacity:l}=this.properties,c=this.getSeriesDomain("x"),h=this.getSeriesDomain("y"),d=this.ctx.animationManager.isSkipped(),u=this.getShapeFillBBox();t.each((p,g)=>{const{xValue:f,yValue:x}=g,m=Qr(f,x,s,n,c,h),b=this.getMarkerStyle(o,g,m,i,void 0,{stroke:a,strokeWidth:r,strokeOpacity:l});this.applyMarkerStyle(b,p,g.point,u,{applyTranslation:d,selected:g.selected})}),i||o.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,n)=>{const o=t||this.isSeriesHighlighted(i),a=this.getHighlightStateString(i,o,n.datumIndex),r=Da(this,n,this.properties,this.properties.label,o,a),{enabled:l,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,color:p}=r;l&&n?.labelText?(s.fontStyle=c,s.fontWeight=h,s.fontSize=d,s.fontFamily=u,s.textAlign="center",s.textBaseline="bottom",s.text=n.labelText,s.x=n.point.x,s.y=n.point.y-10,s.fill=p,s.visible=!0,s.fillOpacity=this.getHighlightStyle(t,n.datumIndex).opacity??1,s.setBoxing(r)):s.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o}=this,{xKey:a,xName:r,yKey:l,yName:c,tooltip:h,legendItemName:d}=o,u=n.x,p=n.y;if(!i||!s||!u||!p)return;const g=s.dataSources.get(this.id)?.[e],f=i.resolveColumnById(this,"xValue",s)[e],x=i.resolveColumnById(this,"yValueRaw",s)[e];if(f==null)return;const m=this.getSeriesDomain("x"),b=this.getSeriesDomain("y"),v=Qr(f,x,a,l,m,b),S=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:g},v,!1);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(u,"tooltip",f,g,a,d),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(p,"tooltip",x,g,l,d)}]},{seriesId:t,datum:g,title:c,xKey:a,xName:r,yKey:l,yName:c,...S,...this.getModuleTooltipParams()})}legendItemSymbol(){const e="rgba(0, 0, 0, 0)",{stroke:t,strokeOpacity:i,strokeWidth:s,lineDash:n,marker:o}=this.properties;return{marker:{...this.getMarkerStyle(o,{},void 0,!1,{size:o.size,fill:o.fill??e,stroke:o.stroke??t??e},void 0,!1),enabled:o.enabled},line:{stroke:t??e,strokeOpacity:i,strokeWidth:s,lineDash:n}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:o,title:a,legendItemName:r,showInLegend:l}=this.properties;return[{legendType:"category",id:t,itemId:n,legendItemName:r,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:r??a??o??n},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(e){this.updateLinePaths(e.paths,e.contextData)}updateLinePaths(e,t){const i=t.strokeData.spans,[s]=e;s.path.clear(),CM(s,i),s.markDirty("LineSeries")}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,annotationSelections:s,contextData:n,paths:o}=e,{animationManager:a}=this.ctx;this.updateLinePaths(o,n),BM(this,a,...o),ls([t],mg),RM(this,a,t),oi(this,"labels",a,i),oi(this,"annotations",a,...s)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateLinePaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,annotationSelections:n,contextData:o,paths:a,previousContextData:r}=e,[l]=a;if(o.visible===!1&&r?.visible===!1)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateLinePaths(a,o)},h=()=>{t.skipCurrentBatch(),c()};if(o==null||r==null){c(),yg(this,t,"added",i),_m(this,"path_properties",t,"add",l),oi(this,"labels",t,s),oi(this,"annotations",t,...n);return}if(o.crossFiltering!==r.crossFiltering){h();return}const d=UN(o,r,this.processedData?.reduced?.diff?.[this.id]);if(d===void 0){h();return}else if(d.status==="no-op")return;Li(this.id,"path_properties",t,[l],d.stroke.pathProperties),d.status==="added"?this.updateLinePaths(a,o):d.status==="removed"?this.updateLinePaths(a,r):wm(this.id,"path_update",t,[l],d.stroke.path),d.hasMotion&&(yg(this,t,void 0,i),oi(this,"labels",t,s),oi(this,"annotations",t,...n))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new wi}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=this.properties,{xValue:s,yValue:n}=e,o=this.getSeriesDomain("x"),a=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,e,Qr(s,n,t,i,o,a),!0)}computeFocusBounds(e){return zm(this,e)}hasItemStylers(){return this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Sg.className="LineSeries",Sg.type="line";var p1={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:e=>new Sg(e),stackable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{stroke:em,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:jp,fillPatternDefaults:rr,fillImageDefaults:Ic},label:{...Qn,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:al()}}},g1={type:"series",name:"line",chartType:"cartesian",options:Sm,create:e=>new Sg(e)},Ym=class extends vg{};Ym.className="ScatterSeries",Ym.type="scatter";var H3={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:e=>new Ym(e),defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:jp,fillPatternDefaults:rr,fillImageDefaults:Ic,fillOpacity:.8,maxRenderedItems:1e4,label:{...Qn,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:al()}}},f1={type:"series",name:"scatter",chartType:"cartesian",options:k$,create:e=>new Ym(e)},y1=class kk{constructor(t,i,s,n){this.startAngle=t,this.endAngle=i,this.innerRadius=s,this.outerRadius=n}clone(){const{startAngle:t,endAngle:i,innerRadius:s,outerRadius:n}=this;return new kk(t,i,s,n)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[$f](t,i){return new kk(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}};function m1({startAngle:e,endAngle:t,innerRadius:i,outerRadius:s}){let n=1/0,o=1/0,a=-1/0,r=-1/0;const l=(c,h)=>{n=Math.min(c,n),o=Math.min(h,o),a=Math.max(c,a),r=Math.max(h,r)};return l(i*Math.cos(e),i*Math.sin(e)),l(i*Math.cos(t),i*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),dc(0,e,t)&&l(s,0),dc(Math.PI*.5,e,t)&&l(0,s),dc(Math.PI,e,t)&&l(-s,0),dc(Math.PI*1.5,e,t)&&l(0,-s),new de(n,o,a-n,r-o)}function YM(e,t,i){const s=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:n,outerRadius:o}=i;if(i.startAngle===i.endAngle||s<Math.min(n,o)||s>Math.max(n,o))return!1;const a=Xf(i.startAngle),r=Xf(i.endAngle),l=Math.atan2(t,e);return a<r?l<=r&&l>=a:l<=r&&l>=-Math.PI||l>=a&&l<=Math.PI}function W3(e,t,i,s,n,o,a,r,l,c){if(isNaN(e)||isNaN(t))return 0;o&&([n,s]=[s,n]);const h=(c-r)/(l-a),d=r-h*a,u=Math.pow(h,2)+1,p=2*(h*(d-t)-e),g=Math.pow(e,2)+Math.pow(d-t,2)-Math.pow(i,2),f=Math.pow(p,2)-4*u*g;if(f<0)return 0;const x=(-p+Math.sqrt(f))/2/u,m=(-p-Math.sqrt(f))/2/u;let b=0;return[x,m].forEach(v=>{if(!(v>=Math.min(a,l)&&v<=Math.max(a,l)))return;const D=h*v+d,C=v-e,T=D-t,k=Math.atan2(T,C);dc(k,s,n)&&b++}),b}function x1(e,t){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:o}=t,a={x:o*Math.cos(i),y:o*Math.sin(i)},r={x:o*Math.cos(s),y:o*Math.sin(s)},l=n===0?{x:0,y:0}:{x:n*Math.cos(i),y:n*Math.sin(i)},c=n===0?{x:0,y:0}:{x:n*Math.cos(s),y:n*Math.sin(s)};return Zu(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,l.x,l.y)||Zu(e.start.x,e.start.y,e.end.x,e.end.y,r.x,r.y,c.x,c.y)||W3(0,0,o,i,s,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function $3(e,t){const i={x:e.x,y:e.y},s={x:e.x+e.width,y:e.y},n={x:e.x,y:e.y+e.height},o={x:e.x+e.width,y:e.y+e.height};return x1({start:i,end:s},t)||x1({start:n,end:o},t)}function b1(e,t,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*s)/(e+1*s))-t<0)return 1;let o=0,a=1;for(let r=0;r<8;r+=1){const l=(o+a)/2;Math.asin(Math.abs(l*i)/(e+l*i))+Math.asin(Math.abs(l*s)/(e+l*s))-t<0?o=l:a=l}return o}var U3=1e-6;function vl(e,t){return qf(e,t)<U3?t:pi(e-t)+t}function Km(e,t,i=0){const n=Math.abs(t-e)>=2*Math.PI?2*Math.PI:pi(t-e);return e=vl(e,i),t=e+n,{startAngle:e,endAngle:t}}function Zm(e,t,i,s,n,o){const a=Math.sin(o),r=Math.cos(o),l=e**2+t**2-i**2;let c,h,d,u;if(r>.5){const v=a/r,S=1+v**2,D=-2*(e+t*v),C=D**2-4*S*l;if(C<0)return;const T=(-D+Math.sqrt(C))/(2*S),k=(-D-Math.sqrt(C))/(2*S);c=T,h=T*v,d=k,u=k*v}else{const v=r/a,S=1+v**2,D=-2*(t+e*v),C=D**2-4*S*l;if(C<0)return;const T=(-D+Math.sqrt(C))/(2*S),k=(-D-Math.sqrt(C))/(2*S);c=T*v,h=T,d=k*v,u=k}const p=r,g=a,f=c*p+h*g,x=d*p+u*g,m=f>0?vl(Math.atan2(h-t,c-e),s):NaN,b=x>0?vl(Math.atan2(u-t,d-e),s):NaN;if(m>=s&&m<=n)return m;if(b>=s&&b<=n)return b}function Xm(e,t,i,s,n,o){const a=Math.hypot(e,t),r=(a**2-i**2+o**2)/(2*a),l=a-r,c=Math.atan2(t,e),h=Math.acos(-l/i),d=vl(c+h,s),u=vl(c-h,s);if(d>=s&&d<=n)return d;if(u>=s&&u<=n)return u}var KM=class{constructor(e,t,i,s,n){this.cx=e,this.cy=t,this.r=i,this.a0=s,this.a1=n,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){e==null||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(e){e==null||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},gs=class extends ks{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=Math.PI*2,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){return m1(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:e}=this;let{innerRadius:t,outerRadius:i}=this;return t=t>0?t+e:0,i=Math.max(i-e,0),{innerRadius:t,outerRadius:i}}normalizedClipSector(){const{clipSector:e}=this;if(e==null)return;const{startAngle:t,endAngle:i}=Km(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),o=Km(e.startAngle,e.endAngle,t);return new y1(Math.max(t,o.startAngle),Math.min(i,o.endAngle),Math.max(s,e.innerRadius),Math.min(n,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,s,n,o,a,r){if(e<=0)return;const{startAngle:l,endAngle:c}=Km(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(r&&h<=0)return;const p=r?this.getAngleOffset(h+e):this.getAngleOffset(d-e),g=a?l+p+t:c-p-t,f=r?h+e:d-e,x=f*Math.cos(g),m=f*Math.sin(g);if(u!=null&&(!a&&!(g>=l-1e-6&&g<=u.endAngle-1e-6)||a&&!(g>=u.startAngle+1e-6&&g<=c-1e-6)||r&&f<u.innerRadius-1e-6||!r&&f>u.outerRadius+1e-6))return;const b=new KM(x,m,e,i,s);if(u!=null){r?(b.clipStart(Zm(x,m,e,i,s,u.endAngle)),b.clipEnd(Zm(x,m,e,i,s,u.startAngle))):(b.clipStart(Zm(x,m,e,i,s,u.startAngle)),b.clipEnd(Zm(x,m,e,i,s,u.endAngle)));let T,k;if(a?(T=Xm(x,m,e,i,s,u.innerRadius),k=Xm(x,m,e,i,s,u.outerRadius)):(T=Xm(x,m,e,i,s,u.outerRadius),k=Xm(x,m,e,i,s,u.innerRadius)),b.clipStart(T),b.clipEnd(k),T!=null){const{x:L,y:N}=b.pointAt(T),w=vl(Math.atan2(N,L),l);a?o?.clipStart(w):n.clipEnd(w)}if(k!=null){const{x:L,y:N}=b.pointAt(k),w=vl(Math.atan2(N,L),l);a?n.clipStart(w):o?.clipEnd(w)}}if(u!=null){const{x:T,y:k}=b.pointAt((b.a0+b.a1)/2);if(!YM(T,k,u))return}const{x:v,y:S}=b.pointAt(a===r?b.a0:b.a1),D=vl(Math.atan2(S,v),l),C=r?o:n;return a?C?.clipStart(D):C?.clipEnd(D),b}updatePath(){const{path:t,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:o}=this;let{startOuterCornerRadius:a,endOuterCornerRadius:r,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:d}=Km(this.startAngle,this.endAngle),{innerRadius:u,outerRadius:p}=this.normalizedRadii(),g=this.normalizedClipSector(),f=d-h,x=f>=2*Math.PI-1e-6;if(t.clear(),u===0&&p===0||u>p)return;if((g?.startAngle??h)===(g?.endAngle??d))return;if(x&&this.clipSector==null&&a===0&&r===0&&l===0&&c===0){t.moveTo(i+p*Math.cos(h),s+p*Math.sin(h)),t.arc(i,s,p,h,d),u>n&&(t.moveTo(i+u*Math.cos(d),s+u*Math.sin(d)),t.arc(i,s,u,d,h,!0)),t.closePath();return}else if(this.clipSector==null&&Math.abs(u-p)<1e-6){t.arc(i,s,p,h,d,!1),t.arc(i,s,p,d,h,!0),t.closePath();return}const m=this.getAngleOffset(u),b=this.getAngleOffset(p);if(f<2*b)return;const S=(g?.innerRadius??u)>n,D=u<n||f<2*m,C=p-u,T=Math.max(a,l,r,c),k=T>0?Math.min(C/T,1):1;a*=k,r*=k,l*=k,c*=k;const L=b1(p,f-2*b,-a,-r);if(a*=L,r*=L,!D&&S){const ne=b1(u,f-2*m,l,c);l*=ne,c*=ne}else l=0,c=0;const N=Math.max(a+l,r+c),w=N>0?Math.min(C/N,1):1;a*=w,r*=w,l*=w,c*=w;let O=0,R=0;const B=a/(p-a),P=r/(p-r);if(B>=0&&B<1-1e-6)O=Math.asin(B);else{O=f/2;const ne=p/(1/Math.sin(O)+1);a=Math.min(ne,a)}if(P>=0&&P<1-1e-6)R=Math.asin(P);else{R=f/2;const ne=p/(1/Math.sin(R)+1);r=Math.min(ne,r)}const _=Math.asin(l/(u+l)),F=Math.asin(c/(u+c)),W=g?.outerRadius??p,H=this.getAngleOffset(W),j=new KM(0,0,W,h+H,d-H),V=g?.innerRadius??u,$=this.getAngleOffset(V),U=S?new KM(0,0,V,h+$,d-$):void 0;g!=null&&(j.clipStart(g.startAngle),j.clipEnd(g.endAngle),U?.clipStart(g.startAngle),U?.clipEnd(g.endAngle));const Z=this.arc(a,O,h-Math.PI*.5,h+O,j,U,!0,!1),q=this.arc(r,R,d-R,d+Math.PI*.5,j,U,!1,!1),Q=this.arc(c,F,d+Math.PI*.5,d+Math.PI-F,j,U,!1,!0),ie=this.arc(l,_,h+Math.PI+_,h+Math.PI*1.5,j,U,!0,!0);if(D){const ne=f<Math.PI*.5?o*(1+Math.cos(f))/Math.sin(f):NaN;let oe;ne>0&&ne<p?oe=Math.max(Math.hypot(o,ne),u):oe=o,oe=Math.max(oe,u);const le=h+f*.5;t.moveTo(i+oe*Math.cos(le),s+oe*Math.sin(le))}else if(!(ie?.isValid()===!0||U?.isValid()===!0)){const ne=h+f/2,oe=u*Math.cos(ne),le=u*Math.sin(ne);t.moveTo(i+oe,s+le)}if(Z?.isValid()===!0){const{cx:ne,cy:oe,r:le,a0:re,a1:ee}=Z;t.arc(i+ne,s+oe,le,re,ee)}if(j.isValid()){const{r:ne,a0:oe,a1:le}=j;t.arc(i,s,ne,oe,le)}if(q?.isValid()===!0){const{cx:ne,cy:oe,r:le,a0:re,a1:ee}=q;t.arc(i+ne,s+oe,le,re,ee)}if(!D){if(Q?.isValid()===!0){const{cx:ne,cy:oe,r:le,a0:re,a1:ee}=Q;t.arc(i+ne,s+oe,le,re,ee)}if(U?.isValid()===!0){const{r:ne,a0:oe,a1:le}=U;t.arc(i,s,ne,le,oe,!0)}if(ie?.isValid()===!0){const{cx:ne,cy:oe,r:le,a0:re,a1:ee}=ie;t.arc(i+ne,s+oe,le,re,ee)}}t.closePath()}isPointInPath(e,t){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:o}=this.clipSector??this;return YM(e-this.centerX,t-this.centerY,{startAngle:i,endAngle:s,innerRadius:Math.min(n,o),outerRadius:Math.max(n,o)})}};gs.className="Sector",M([te()],gs.prototype,"centerX",2),M([te()],gs.prototype,"centerY",2),M([te()],gs.prototype,"innerRadius",2),M([te()],gs.prototype,"outerRadius",2),M([te()],gs.prototype,"startAngle",2),M([te()],gs.prototype,"endAngle",2),M([mn({equals:(e,t)=>e.equals(t)})],gs.prototype,"clipSector",2),M([te()],gs.prototype,"concentricEdgeInset",2),M([te()],gs.prototype,"radialEdgeInset",2),M([te()],gs.prototype,"startOuterCornerRadius",2),M([te()],gs.prototype,"endOuterCornerRadius",2),M([te()],gs.prototype,"startInnerCornerRadius",2),M([te()],gs.prototype,"endInnerCornerRadius",2);var v1=class extends Pt{constructor(){super(...arguments),this.showInLegend=!1}};M([I],v1.prototype,"showInLegend",2);var ZM=class extends Vt{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};M([I],ZM.prototype,"text",2),M([I],ZM.prototype,"spacing",2);var XM=class extends we{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};M([I],XM.prototype,"fill",2),M([I],XM.prototype,"fillOpacity",2);var Vd=class extends Vt{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};M([I],Vd.prototype,"offset",2),M([I],Vd.prototype,"minAngle",2),M([I],Vd.prototype,"minSpacing",2),M([I],Vd.prototype,"maxCollisionOffset",2),M([I],Vd.prototype,"avoidCollisions",2);var qM=class extends Vt{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};M([I],qM.prototype,"positionOffset",2),M([I],qM.prototype,"positionRatio",2);var qm=class extends we{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};M([I],qm.prototype,"colors",2),M([I],qm.prototype,"length",2),M([I],qm.prototype,"strokeWidth",2);var je=class extends Zn{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(fi),this.strokes=Object.values(ar),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 Ku(ZM),this.title=new v1,this.innerCircle=new XM,this.shadow=new Aa,this.calloutLabel=new Vd,this.sectorLabel=new qM,this.calloutLine=new qm,this.tooltip=Kc()}};M([I],je.prototype,"angleKey",2),M([I],je.prototype,"angleName",2),M([I],je.prototype,"angleFilterKey",2),M([I],je.prototype,"radiusKey",2),M([I],je.prototype,"radiusName",2),M([I],je.prototype,"radiusMin",2),M([I],je.prototype,"radiusMax",2),M([I],je.prototype,"calloutLabelKey",2),M([I],je.prototype,"calloutLabelName",2),M([I],je.prototype,"sectorLabelKey",2),M([I],je.prototype,"sectorLabelName",2),M([I],je.prototype,"legendItemKey",2),M([I],je.prototype,"defaultColorRange",2),M([I],je.prototype,"defaultPatternFills",2),M([I],je.prototype,"fills",2),M([I],je.prototype,"strokes",2),M([I],je.prototype,"fillOpacity",2),M([I],je.prototype,"strokeOpacity",2),M([I],je.prototype,"lineDash",2),M([I],je.prototype,"lineDashOffset",2),M([I],je.prototype,"cornerRadius",2),M([I],je.prototype,"itemStyler",2),M([I],je.prototype,"rotation",2),M([I],je.prototype,"outerRadiusOffset",2),M([I],je.prototype,"outerRadiusRatio",2),M([I],je.prototype,"innerRadiusOffset",2),M([I],je.prototype,"innerRadiusRatio",2),M([I],je.prototype,"strokeWidth",2),M([I],je.prototype,"sectorSpacing",2),M([I],je.prototype,"hideZeroValueSectorsInLegend",2),M([I],je.prototype,"innerLabels",2),M([I],je.prototype,"title",2),M([I],je.prototype,"innerCircle",2),M([I],je.prototype,"shadow",2),M([I],je.prototype,"calloutLabel",2),M([I],je.prototype,"sectorLabel",2),M([I],je.prototype,"calloutLine",2),M([I],je.prototype,"tooltip",2);function Qm(e,t,i,s){const n=[i.convert(0),i.convert(1)],o=[s.convert(0),s.convert(1)],a=Math.PI/-2+os(t),r=e?"initial":"update",l=({radius:g})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*g}),c=({radius:g})=>({innerRadius:o[0],outerRadius:o[0]+(o[1]-o[0])*g});return{nodes:{toFn:(g,f,x,{prevLive:m})=>{let{startAngle:b,endAngle:v,innerRadius:S,outerRadius:D}=f;const{stroke:C,fill:T}=f.sectorFormat;if(x==="removed"&&m?(b=m.datum?.endAngle,v=m.datum?.endAngle):x==="removed"&&!m&&(b=a,v=a),x==="removed"){const k=l(f);S=k.innerRadius,D=k.outerRadius}return{startAngle:b,endAngle:v,outerRadius:D,innerRadius:S,stroke:C,fill:T}},fromFn:(g,f,x,{prevFromProps:m})=>{let{startAngle:b,endAngle:v,innerRadius:S,outerRadius:D}=g,{fill:C,stroke:T}=f.sectorFormat;if(x==="updated"&&g.previousDatum==null&&(x="added"),x==="unknown"||x==="added"&&!m?(b=a,v=a,S=f.innerRadius,D=f.outerRadius):x==="added"&&m&&(b=m.endAngle??a,v=m.endAngle??a,S=m.innerRadius??f.innerRadius,D=m.outerRadius??f.outerRadius),x==="added"&&!e){const k=c(f);S=k.innerRadius,D=k.outerRadius}return x==="updated"&&(C=g.fill??C,T=(typeof g.stroke=="string"?g.stroke:void 0)??T),{startAngle:b,endAngle:v,innerRadius:S,outerRadius:D,fill:C,stroke:T,phase:r}}},innerCircle:{fromFn:(g,f)=>({size:g.previousDatum?.radius??g.size??0,phase:r}),toFn:(g,f)=>({size:f.radius??0})}}}function S1(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,stroke:t.sectorFormat.stroke}}function M1(e,t){const i=t.y-e.centerY,s=t.x-e.centerX,n=Math.atan2(i,s),o=e.getItemNodes();for(const a of o)if(a.datum.missing!==!0&&dc(n,a.startAngle,a.endAngle)){const r=Math.sqrt(s*s+i*i);let l=0;return r<a.innerRadius?l=a.innerRadius-r:r>a.outerRadius&&(l=r-a.outerRadius),{datum:a.datum,distance:l}}}var D1=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(D1||{}),A1={angle:["angleKey"],radius:["radiusKey"]},I1={angle:["angleName"],radius:["radiusName"]},QM=class extends DM{constructor({categoryKey:e,pickModes:t=[1,0],canHaveAxes:i=!1,animationResetFns:s,...n}){super({...n,categoryKey:e,pickModes:t,canHaveAxes:i}),this.directions=["angle","radius"],this.itemGroup=this.contentGroup.appendChild(new Re),this.nodeData=[],this.itemSelection=Ts.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=Ts.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=Ts.select(this.highlightGroup,()=>this.nodeFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=s,this.animationState=new up("empty",{empty:{update:{target:"ready",action:o=>this.animateEmptyUpdateReady(o)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:o=>this.animateReadyHighlight(o),highlightMarkers:o=>this.animateReadyHighlightMarkers(o),resize:o=>this.animateReadyResize(o),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:o=>this.animateWaitingUpdateReady(o)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:o=>this.animateClearingUpdateEmpty(o)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}setZIndex(e){super.setZIndex(e),this.contentGroup.zIndex=[e,1],this.highlightGroup.zIndex=[e,2],this.labelGroup.zIndex=[e,3]}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}labelFactory(){const e=new xn;return e.pointerEvents=1,e}addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",e=>this.onLegendItemClick(e)),this.ctx.eventsHub.on("legend:item-double-click",e=>this.onLegendItemDoubleClick(e)))}getInnerRadius(){return 0}computeLabelsBBox(e,t){return null}getShapeFillBBox(){const e=this.radius;return{series:new de(-e,-e,e*2,e*2),axis:new de(-e,-e,e*2,e*2)}}resetAllAnimation(){const{item:e,label:t}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),e&&ls([this.itemSelection,this.highlightSelection],e),t&&ls([this.labelSelection],t),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){const{item:t}=this.animationResetFns??{};t&&ls([this.highlightSelection],t)}animateReadyHighlightMarkers(e){}animateReadyResize(e){this.resetAllAnimation()}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(t!==void 0)return this.itemSelection.select(i=>i instanceof ks&&i.datum===t)[0]}getSeriesRange(e,t){return[NaN,NaN]}isSeriesHighlighted(e,t){const{series:i,legendItemName:s,itemId:n}=e??{},o=t?.[n];return i===this||o!=null&&o===s}},Y3=class extends Vy{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},Mg=class extends QM{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{...A1,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...I1,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:S1,label:Yc}}),this.properties=new je,this.phantomNodeData=void 0,this.backgroundGroup=new As({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new Fc,this.radiusScale=new Fc,this.phantomGroup=this.backgroundGroup.appendChild(new Re({name:"phantom"})),this.phantomSelection=Ts.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Re({name:"pieCalloutLabels"})),this.calloutLabelSelection=new Ts(this.calloutLabelGroup,Re),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Re({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new wi({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new wi({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new Re({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new Re({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=Ts.select(this.innerLabelsGroup,xn),this.innerCircleSelection=Ts.select(this.innerCircleGroup,()=>new wi({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=Y3,this.angleScale=new Fc,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2),this.phantomGroup.opacity=.2,this.innerLabelsGroup.pointerEvents=1}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e?.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}setZIndex(e){super.setZIndex(e),this.backgroundGroup.zIndex=[0,e]}nodeFactory(){const e=new gs;return e.miterLimit=1e9,e}getSeriesDomain(e){return e==="angle"?this.angleScale.domain:this.radiusScale.domain}async processData(e){if(this.data==null)return;const{visible:t,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:o,radiusKey:a,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(x,m)=>t&&s.getItemEnabled({seriesId:i,itemId:m})?x:0,d=!this.ctx.animationManager.isSkipped(),u=[],p=[];c?u.push(ul(c,"category",{id:"legendItemKey"})):r?u.push(ul(r,"category",{id:"calloutLabelKey"})):l&&u.push(ul(l,"category",{id:"sectorLabelKey"}));const g=this.radiusScale.type,f=this.angleScale.type;a&&p.push(q2(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),St(a,g,{id:"radiusRaw",processor:h}),mm("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),r&&p.push(St(r,"category",{id:"calloutLabelValue"})),l&&p.push(St(l,"category",{id:"sectorLabelValue"})),c&&p.push(St(c,"category",{id:"legendItemValue"})),o&&p.push(K0(o,f,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),St(o,f,{id:"angleFilterRaw"}),mm("angleFilterValue",[0,1],0,0)),d&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&u.length>0&&p.push(Qp(this.id,this.processedData)),p.push(qp()),await this.requestDataModel(e,this.data,{props:[...u,K0(n,f,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),St(n,f,{id:"angleRaw"}),mm("angleValue",[0,1],0,0),...p]});for(const x of this.processedData?.defs?.values??[]){const{id:m,missing:b,property:v}=x,S=mL(this,b);m!=="angleRaw"&&S>0&&X.warnOnce(`no value was found for the key '${String(v)}' on ${S} data element${S>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,this.nodeDataRefresh=!1}getProcessedDataValues(e,t){const i=e.resolveColumnById(this,"angleValue",t),s=e.resolveColumnById(this,"angleRaw",t),n=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterValue",t):void 0,o=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterRaw",t):void 0,a=this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,r=this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,l=this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,c=this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,h=this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:o,radiusValues:a,radiusRawValues:r,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:o}=this,{rotation:a,innerRadiusRatio:r}=this.properties;if(!i||t?.type!=="ungrouped")return;const l=this.getProcessedDataValues(i,t),{angleValues:c,angleRawValues:h,angleFilterValues:d,angleFilterRawValues:u,radiusValues:p,radiusRawValues:g,legendItemValues:f}=l,x=u?.some((T,k)=>T>h[k])??!1;let m=0,b=0;const v=[],S=u!=null?[]:void 0,D=t.dataSources.get(this.id)??[],C=t.invalidData?.get(this.id);return D.forEach((T,k)=>{if(C?.[k]===!0)return;const L=x?d[k]:c[k],N=u!=null&&!x?Math.sqrt(u[k]/h[k]):1,w=s.convert(m)+os(a);m=L,b+=L;const O=s.convert(m)+os(a),R=Math.abs(O-w),B=w+R/2,P=h[k],F=(p?.[k]??1)*N,W=g?.[k],H=f?.[k],j=this.getLabels(k,T,B,R,l),V=this.getSectorFormat(T,k,!1),$={itemId:k,series:this,datum:T,datumIndex:k,angleValue:P,midAngle:B,midCos:Math.cos(B),midSin:Math.sin(B),startAngle:w,endAngle:O,radius:F,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(F),0),sectorFormat:V,radiusValue:W,legendItemValue:H,enabled:o&&n.getItemEnabled({seriesId:e,itemId:k}),focusable:!0,...j};v.push($),S?.push({...$,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}),this.zerosumOuterRing.visible=b===0,this.zerosumInnerRing.visible=b===0&&r!=null&&r!==1&&r>0,{itemId:e,nodeData:v,labelData:v,phantomNodeData:S}}getLabelContent(e,t,i){const{id:s,ctx:n,properties:o}=this,{formatManager:a}=n,{calloutLabel:r,sectorLabel:l,calloutLabelKey:c,sectorLabelKey:h,legendItemKey:d}=o,u=i.calloutLabelValues?.[e],p=i.sectorLabelValues?.[e],g=i.legendItemValues?.[e],f={datum:t,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},x={callout:void 0,sector:void 0,legendItem:void 0};return c&&(x.callout=this.getLabelText(u,t,c,"calloutLabel",[],r,{...f,value:u})),h&&(x.sector=this.getLabelText(p,t,h,"sectorLabel",[],l,{...f,value:p})),d!=null&&g!=null&&(x.legendItem=a.format(this.callWithContext.bind(this),{type:"category",value:g,datum:t,seriesId:s,legendItemName:void 0,key:d,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??g),x}getLabels(e,t,i,s,n){const{properties:o}=this,{calloutLabel:a,sectorLabel:r,legendItemKey:l}=o,c=this.getLabelContent(e,t,n),h={};return a.enabled&&c.callout&&s>=os(a.minAngle)&&(h.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),r.enabled&&c.sector&&(h.sectorLabel={text:c.sector}),l&&c.legendItem&&(h.legendItem={key:l,text:c.legendItem}),h}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=Xf(e),s=-.75*Math.PI,n=i-s,o=Math.floor(n/(Math.PI/2)),a=IG(o,t.length);return t[a]}getNodeFill(e,t,i){return pd(e,{type:"gradient",bounds:"series",colorStops:t.map(s=>({color:s})),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(e,t,i){if(!(!To(e)||e.bounds==="item"))return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getSectorFormat(e,t,i,s,n,o){const{angleKey:a,radiusKey:r,calloutLabelKey:l,sectorLabelKey:c,legendItemKey:h,fills:d,strokes:u,defaultColorRange:p,defaultPatternFills:g,itemStyler:f}=this.properties,x=u[t%u.length],m=d[t%d.length],{fill:b,fillOpacity:v,stroke:S,strokeWidth:D,strokeOpacity:C,lineDash:T,lineDashOffset:k,cornerRadius:L,opacity:N}=et(this.getHighlightStyle(i,s?.datumIndex,n),{fill:m,stroke:x},this.properties),w=p[t%p.length],O=g[t%g.length],R=b??"black";let B;return f&&(B=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>this.callWithContext(f,{datum:e,angleKey:a,radiusKey:r,calloutLabelKey:l,sectorLabelKey:c,legendItemKey:h,fill:this.getNodeFill(R,w,O),fillOpacity:v,stroke:S,strokeWidth:D,strokeOpacity:C,lineDash:T,lineDashOffset:k,cornerRadius:L,highlighted:i,highlightState:this.getHighlightStateString(o??this.ctx.highlightManager?.getActiveHighlight(),i,t),seriesId:this.id}))),{fill:this.getNodeFill(B?.fill??R,w,O),fillOpacity:B?.fillOpacity??v,stroke:B?.stroke??S,strokeWidth:B?.strokeWidth??D,strokeOpacity:B?.strokeOpacity??C,lineDash:B?.lineDash??T,lineDashOffset:B?.lineDashOffset??k,cornerRadius:B?.cornerRadius??L,opacity:N}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,s=e*t+i;return s===e||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:e,outerRadiusOffset:t}=this.properties;return Math.max(this.radius*e+t,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);if(e===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-e);return-e-i-s}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},s=Xa(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const n=this.getTitleTranslationY();t.node.y=isFinite(n)?n:0;const o=t.node.getBBox(!1);t.node.visible=t.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(o)}for(const n of[this.zerosumInnerRing,this.zerosumOuterRing])n.fillOpacity=0,n.stroke=this.properties.calloutLabel.color,n.strokeWidth=1,n.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&this.labelGroup?.removeChild(e.node),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=t=>{const i=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,i),y:t.midSin*Math.max(0,i)}};this.nodeData.forEach(e),this.phantomNodeData?.forEach(e)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,calloutLabelSelection:s,labelSelection:n,innerLabelsSelection:o}=this,a=this.nodeData.map(l=>({...l,sectorFormat:{...l.sectorFormat}})),r=(l,c)=>{l.update(c,void 0,h=>this.getDatumId(h.datumIndex)),this.ctx.animationManager.isSkipped()&&l.cleanup()};r(e,this.nodeData),r(t,a),r(i,this.phantomNodeData??[]),s.update(this.calloutNodeData,l=>{const c=new Sn;c.tag=0,c.pointerEvents=1,l.appendChild(c);const h=new xn;h.tag=1,h.pointerEvents=1,l.appendChild(h)}),n.update(this.nodeData),o.update(this.properties.innerLabels,l=>{l.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const n=Math.min(i,this.getOuterRadius()),o=1;t=Math.ceil(n*2+o)}const s=e?[{radius:t}]:[];this.innerCircleSelection.update(s)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i,dataModel:s,processedData:n}=this;if(this.backgroundGroup.visible=i,this.contentGroup.visible=i,!s||!n)return;const{legendItemValues:o}=this.getProcessedDataValues(s,n),a=this.isSeriesHighlighted(t,o);this.highlightGroup.visible=i&&a,this.labelGroup.visible=i,this.innerCircleSelection.each((u,{radius:p})=>{u.setProperties({fill:this.getNodeFill(this.properties.innerCircle?.fill,["black"],"black"),opacity:this.properties.innerCircle?.fillOpacity,size:p})});const r=this.radiusScale.range[0],l=this.radiusScale.range[1],c=this.getShapeFillBBox(),h=this.ctx.animationManager.isSkipped(),d=(u,p,g,f)=>{const x=this.getSectorFormat(p.datum,p.itemId,f,p,o,t);p.sectorFormat.fill=x.fill,p.sectorFormat.stroke=x.stroke,h&&(u.startAngle=p.startAngle,u.endAngle=p.endAngle,u.innerRadius=p.innerRadius,u.outerRadius=p.outerRadius),(f||h)&&(u.fill=x.fill,u.stroke=x.stroke);const m=this.getFillParams(x.fill,r,l);or(u,x,c,m),u.cornerRadius=x.cornerRadius,u.fillShadow=this.properties.shadow;const b=Math.max((this.properties.sectorSpacing+(x.stroke!=null?x.strokeWidth:0))/2,0);u.inset=b,u.lineJoin=this.properties.sectorSpacing>=0||b>0?"miter":"round"};this.itemSelection.each((u,p,g)=>d(u,p,g,!1)),this.highlightSelection.each((u,p,g)=>{d(u,p,g,!0),u.visible=p.itemId===t?.itemId}),this.phantomSelection.each((u,p,g)=>d(u,p,g,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:e,strokeWidth:t,colors:i},strokes:s}=this.properties,n=t,o=yV(i)?i??this.properties.strokes:s,{offset:a}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach(r=>{const l=r.closestDatum(),{calloutLabel:c,outerRadius:h,datumIndex:d}=l;if(c?.text&&!c.hidden&&h!==0){r.visible=!0,r.strokeWidth=n,r.stroke=o[d%o.length],r.strokeOpacity=this.getHighlightStyle(!1,l.datumIndex).opacity??1,r.fill=void 0;const u=l.midCos*h,p=l.midSin*h;let g=l.midCos*(h+e),f=l.midSin*(h+e);if((c.collisionTextAlign??c.collisionOffsetY!==0)&&c.box!=null){const m=c.box;let b=g,v=f;g<m.x?b=m.x:g>m.x+m.width&&(b=m.x+m.width),f<m.y?v=m.y:f>m.y+m.height&&(v=m.y+m.height);const S=b-g,D=v-f,C=Math.sqrt(Math.pow(S,2)+Math.pow(D,2)),T=C-a;T>0&&(g=g+S*T/C,f=f+D*T/C)}r.x1=u,r.y1=p,r.x2=g,r.y2=f}else r.visible=!1})}getLabelOverflow(e,t,i){const s=-this.centerX,n=s+i.width,o=-this.centerY,a=o+i.height,r=1;let l=1;t.x+r<s?l=(t.x+t.width-s)/t.width:t.x+t.width-r>n&&(l=(n-t.x)/t.width);const c=t.y+r<o||t.y+t.height-r>a,h=l===1?e.length:Math.floor(e.length*l)-1,d=this.bboxIntersectsSurroundingSeries(t);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:d}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(t==null)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=t**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=t,o=e.convert(0),a=b=>!b.calloutLabel||b.outerRadius===0,r=this.calloutNodeData,l=r.filter(b=>!a(b));if(l.forEach(b=>{const v=b.calloutLabel;v!=null&&(v.hidden=!1,v.collisionTextAlign=void 0,v.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(b=>b.midCos<0).sort((b,v)=>b.midSin-v.midSin),h=l.filter(b=>b.midCos>=0).sort((b,v)=>b.midSin-v.midSin),d=l.filter(b=>b.midSin<0&&b.calloutLabel?.textAlign==="center").sort((b,v)=>b.midCos-v.midCos),u=l.filter(b=>b.midSin>=0&&b.calloutLabel?.textAlign==="center").sort((b,v)=>b.midCos-v.midCos),p={angleKey:this.properties.angleKey},g=b=>{const v=b.calloutLabel;if(v==null)return de.zero.clone();const S=Da(this,b,p,t),D=rd(S),C=b.outerRadius+i.length+s,T=b.midCos*C,k=b.midSin*C+v.collisionOffsetY,L=v.collisionTextAlign??v.textAlign,N=v.textBaseline;return xn.computeBBox(v.text,T,k,{font:this.properties.calloutLabel,textAlign:L,textBaseline:N},!1).grow(D)},f=(b,v,S)=>{const D=g(b).grow(n/2),C=g(v).grow(n/2);D.x<C.x+C.width&&D.x+D.width>C.x&&(S==="to-top"?D.y<C.y+C.height:D.y+D.height>C.y)&&(v.calloutLabel.collisionOffsetY=S==="to-top"?D.y-C.y-C.height:D.y+D.height-C.y)},x=b=>{const v=b.slice().sort((D,C)=>Math.abs(D.midSin)-Math.abs(C.midSin))[0],S=b.indexOf(v);for(let D=S-1;D>=0;D--){const C=b[D+1],T=b[D];f(C,T,"to-top")}for(let D=S+1;D<b.length;D++){const C=b[D-1],T=b[D];f(C,T,"to-bottom")}},m=b=>{const v=l.some(L=>L.calloutLabel.collisionOffsetY!==0),S=b.map(L=>g(L)),D=S.map(L=>L.clone().grow(n/2));let C=!1;for(let L=0;L<D.length&&!C;L++){const N=D[L];for(let w=L+1;w<b.length;w++){const O=D[w];if(N.collidesBBox(O)){C=!0;break}}}const T=r.map(L=>{const{startAngle:N,endAngle:w,outerRadius:O}=L;return{startAngle:N,endAngle:w,innerRadius:o,outerRadius:O}}),k=S.some(L=>T.some(N=>$3(L,N)));!C&&!v&&!k||b.filter(L=>L.calloutLabel.textAlign==="center").forEach(L=>{const N=L.calloutLabel;L.midCos<0?N.collisionTextAlign="right":L.midCos>0?N.collisionTextAlign="left":N.collisionTextAlign="center"})};x(c),x(h),m(d),m(u)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=new xn;this.calloutLabelSelection.selectByTag(1).forEach(o=>{const a=o.closestDatum(),r=a.calloutLabel,l=t.convert(a.radius),c=Math.max(0,l);if(!r?.text||c===0||r.hidden){o.visible=!1;return}const h=this.ctx.highlightManager?.getActiveHighlight(),d=!1,u=this.getHighlightStateString(h,d,a.datumIndex),p=Da(this,a,this.properties,i,d,u),g=c+s.length+i.offset,f=a.midCos*g,x=a.midSin*g+r.collisionOffsetY,m={textAlign:r.collisionTextAlign??r.textAlign,textBaseline:r.textBaseline};n.text=r.text,n.x=f,n.y=x,n.setFont(p),n.setAlign(m),n.setBoxing(p);const b=n.getBBox(!1);let v=r.text,S=!0;if(i.avoidCollisions){const{textLength:D,hasVerticalOverflow:C}=this.getLabelOverflow(r.text,b,e);v=r.text.length===D?r.text:`${r.text.substring(0,D)}\u2026`,S=!C}o.text=v,o.x=f,o.y=x,o.setFont(p),o.setAlign(m),o.setBoxing(p),o.fill=p.color,o.fillOpacity=this.getHighlightStyle(!1,a.datumIndex).opacity??1,o.visible=S})}computeLabelsBBox(e,t){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:o,maxCollisionOffset:a,minSpacing:r}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new xn;let h;const{title:d}=this.properties;if(d?.text&&d.enabled){const p=this.getTitleTranslationY();isFinite(p)&&(c.text=d.text,c.x=0,c.y=p,c.setFont(d),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(!1),l.push(h))}const u={angleKey:this.properties.angleKey};return this.calloutNodeData.forEach(p=>{const g=p.calloutLabel;if(!g||p.outerRadius===0)return null;const f=Da(this,p,u,i),x=p.outerRadius+n+o,m=p.midCos*x,b=p.midSin*x+g.collisionOffsetY;c.text=g.text,c.x=m,c.y=b,c.setFont(f),c.setAlign({textAlign:g.collisionTextAlign??g.textAlign,textBaseline:g.textBaseline}),c.setBoxing(f);const v=c.getBBox(!1);if(g.box=v,Math.abs(g.collisionOffsetY)>a){g.hidden=!0;return}if(h){const S=-this.centerY,D=new de(h.x-r,S,h.width+2*r,h.y+h.height+r-S);if(v.collidesBBox(D)){g.hidden=!0;return}}if(e.hideWhenNecessary){const{textLength:S,hasVerticalOverflow:D,hasSurroundingSeriesOverflow:C}=this.getLabelOverflow(g.text,v,t),T=g.text.length>2&&S<2;if(D||T||C){g.hidden=!0;return}}g.hidden=!1,l.push(v)}),l.length===0?null:de.merge(l)}updateSectorLabelNodes(){const{properties:e}=this,{positionOffset:t,positionRatio:i}=this.properties.sectorLabel,s=this.radiusScale.convert(0),n=s<=0&&this.ctx.legendManager.getData(this.id)?.filter(r=>r.enabled).length===1,o={textAlign:"center",textBaseline:"middle"},a=(r,l)=>{const{outerRadius:c,startAngle:h,endAngle:d}=l;let u=!1;if(l.sectorLabel&&c!==0){const p=this.ctx.highlightManager?.getActiveHighlight(),g=!1,f=this.getHighlightStateString(p,g,l.datumIndex),x=Da(this,l,e,e.sectorLabel,g,f),m=s*(1-i)+c*i+t;r.fill=x.color,r.fillOpacity=this.getHighlightStyle(!1,l.datumIndex).opacity??1,r.text=l.sectorLabel.text,n?(r.x=0,r.y=0):(r.x=l.midCos*m,r.y=l.midSin*m),r.setFont(x),r.setAlign(o),r.setBoxing(x);const b=r.getBBox(!1),v=[[b.x,b.y],[b.x+b.width,b.y],[b.x+b.width,b.y+b.height],[b.x,b.y+b.height]],S={startAngle:h,endAngle:d,innerRadius:s,outerRadius:c};v.every(([D,C])=>YM(D,C,S))&&(u=!0)}r.visible=u};this.labelSelection.each(a)}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((h,d)=>{const{fontStyle:u,fontWeight:p,fontSize:g,fontFamily:f,color:x}=d;h.fontStyle=u,h.fontWeight=p,h.fontSize=g,h.fontFamily=f,h.text=d.text,h.x=0,h.y=0,h.fill=x,h.textAlign="center",h.textBaseline="alphabetic",e.push(h.getBBox()),t.push(d.spacing)});const i=h=>h===0?0:t[h],s=h=>h===t.length-1?0:t[h],n=e.reduce((h,d)=>h<d.width?d.width:h,0),o=e.reduce((h,d,u)=>h+d.height+i(u)+s(u),0),a=this.getInnerRadius(),l=Math.sqrt(Math.pow(n/2,2)+Math.pow(o/2,2))<=(a>0?a:this.getOuterRadius()),c=[];for(let h=0,d=-o/2;h<e.length;h++){const p=e[h].height+d+i(h);c.push(p),d=p+s(h)}this.innerLabelsSelection.each((h,d,u)=>{h.visible=l,Array.isArray(h.text)?h.y=c[u]-e[u].height:h.y=c[u]})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(e){return M1(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n,ctx:{formatManager:o}}=this,{legendItemKey:a,calloutLabelKey:r,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:d,angleName:u,radiusKey:p,radiusName:g,tooltip:f}=n,x=this.properties.title.node.getPlainText();if(!i||!s)return;const m=s.dataSources.get(this.id)?.[e],b=this.getProcessedDataValues(i,s),{angleRawValues:v}=b,S=v[e],D=this.getLabelContent(e,m,b),C=D.legendItem??D.callout??D.sector??u,T=i.getDomain(this,"angleRaw","value",s),k=o.format(this.callWithContext.bind(this),{type:"number",value:S,datum:m,seriesId:t,legendItemName:void 0,key:d,source:"tooltip",property:"angle",domain:T,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0})??qh(S,3);return this.formatTooltipWithContext(f,{title:x,symbol:this.legendItemSymbol(e),data:[{label:C,fallbackLabel:d,value:k}]},{seriesId:t,datum:m,title:u,legendItemKey:a,calloutLabelKey:r,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:d,angleName:u,radiusKey:p,radiusName:g,...this.getSectorFormat(m,e,!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.[e],i=this.getSectorFormat(t,e,!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r}=this.properties;let{fill:l}=i;const{stroke:c}=i;return To(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r}}}getLegendData(e){const{visible:t,processedData:i,dataModel:s,id:n,ctx:{legendManager:o}}=this;if(!s||!i||e!=="category")return[];const{angleKey:a,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!r||r===a)&&(!l||l===a))return[];const d=this.getProcessedDataValues(s,i),{angleRawValues:u}=d,p=this.properties.title?.showInLegend&&this.properties.title.text,g=[],f=this.properties.hideZeroValueSectorsInLegend,x=i.dataSources.get(this.id),m=i.invalidData?.get(this.id);for(let b=0;b<i.input.count;b++){const v=x?.[b],S=u[b];if(m?.[b]===!0||f&&S===0)continue;const D=[];p&&D.push(p);const C=this.getLabelContent(b,v,d);c&&C.legendItem!==void 0?D.push(C.legendItem):r&&r!==a&&C.callout!==void 0?D.push(C.callout):l&&l!==a&&C.sector!==void 0&&D.push(C.sector),D.length!==0&&g.push({legendType:"category",id:n,datum:v,itemId:b,seriesId:n,hideToggleOtherSeries:!0,enabled:t&&o.getItemEnabled({seriesId:n,itemId:b}),label:{text:D.join(" - ")},symbol:this.legendItemSymbol(b),legendItemName:c!=null?v[c]:void 0,hideInLegend:!h})}return g}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:s}}=this;e.forEach((n,o)=>i.toggleItem(n,t,o)),i.update(),s.update(5)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=Qm(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Li(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datumIndex)),Li(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),oi(this,"callout",t,this.calloutLabelSelection),oi(this,"sector",t,this.labelSelection),oi(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:o}=this,{animationManager:a}=this.ctx,r=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(r?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,h=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!h)&&this.ctx.animationManager.skipCurrentBatch();const d=!this.nodeData.some(p=>p.enabled),u=Qm(!1,this.properties.rotation,n,o);Li(this.id,"nodes",a,[e,t,i],u.nodes,(p,g)=>this.getDatumId(g.datumIndex),r),Li(this.id,"innerCircle",a,[this.innerCircleSelection],u.innerCircle),oi(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),oi(this,"sector",this.ctx.animationManager,this.labelSelection),this.noVisibleData!==d&&(this.noVisibleData=d,oi(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:o}=this.ctx,a=Qm(!1,this.properties.rotation,s,n);Li(this.id,"nodes",o,[e,t,i],a.nodes,(r,l)=>this.getDatumId(l.datumIndex)),Li(this.id,"innerCircle",o,[this.innerCircleSelection],a.innerCircle),Nm(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Nm(this,"sector",this.ctx.animationManager,this.labelSelection),Nm(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){return`${e}`}hasItemStylers(){const{itemStyler:e,calloutLabel:t,sectorLabel:i}=this.properties;return(e??t.itemStyler??i.itemStyler)!=null}};Mg.className="DonutSeries",Mg.type="donut";var K3={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:bn.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...Qn,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...Qn,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"chartBackgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:{$value:"$1"}},{$isPattern:{$value:"$1"}},{$isImage:{$value:"$1"}}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:R0,fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,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:sl,xOffset:3,yOffset:3,blur:5},innerLabels:{$apply:{...Qn,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:N2()},legend:{enabled:!0}},Z3={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:e=>new Mg(e),themeTemplate:K3},X3={type:"series",name:"donut",chartType:"polar",options:C$,create:e=>new Mg(e)},Jm=class extends Mg{};Jm.className="PieSeries",Jm.type="pie";var q3={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:bn.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...Qn,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...Qn,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"chartBackgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:{$value:"$1"}},{$isPattern:{$value:"$1"}},{$isImage:{$value:"$1"}}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:R0,fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,0]},lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:sl,xOffset:3,yOffset:3,blur:5},highlight:al()},legend:{enabled:!0}},Q3={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:e=>new Jm(e),themeTemplate:q3},J3={type:"series",name:"pie",chartType:"polar",options:zc,create:e=>new Jm(e)};function ex(){da.register(mN,WU,HU,RU,b3,o1,_3,p1,H3,Z3,Q3,G3);for(const e of[va,bd,Sa,Bc,Sd,gl])mc.register(e.type,{moduleFactory:t=>new e(t)})}function e5(){for(const e of da.modules){if(e.packageType==="enterprise"&&!Yj(e)&&X.errorOnce("Unexpected enterprise module registered: "+e.identifier),e.type==="root"&&e.themeTemplate)for(const t of e.chartTypes)JS.set(t,e.themeTemplate);if(e.type==="series"){if(e.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${e.identifier}`);No.register(e.identifier,e)}if(e.type==="series-option"&&e.themeTemplate)for(const t of e.seriesTypes)No.setThemeTemplate(t,e.themeTemplate);if(e.type==="axis-option"&&e.themeTemplate)for(const t of e.axisTypes){const i=mc.getThemeTemplate(t),s=et(e.themeTemplate,i);mc.setThemeTemplate(t,s)}e.type==="axis"&&mc.register(e.identifier,e),e.type==="legend"&&QS.register(e.identifier,e)}if(da.hasEnterpriseModules()){const e=Kj();e.length>0&&X.errorOnce("Enterprise modules expected but not registered: ",e)}}var sn=Symbol("IGNORED_PROP");function so(e,t){const i={};for(const s of Object.keys(t)){const n=t[s];n!==sn&&Object.hasOwn(e,s)&&(i[s]=n)}return i}function k1(e){const{enabled:t,mode:i,showArrow:s,range:n,position:o,pagination:a,delay:r,wrapping:l,interaction:c,renderer:h,...d}=e,u=so(e,{enabled:t,showArrow:s,range:n,position:o,interaction:c,renderer:h,...d});return{chartTooltipOptions:so(e,{enabled:sn,showArrow:sn,range:sn,position:sn,mode:i,pagination:a,delay:r,wrapping:l,...d}),seriesTooltipOptions:u}}function t5(e){const{animation:t,background:i,container:s,contextMenu:n,context:o,footnote:a,height:r,listeners:l,locale:c,minHeight:h,minWidth:d,overrideDevicePixelRatio:u,padding:p,subtitle:g,theme:f,title:x,width:m,type:b,cursor:v,nodeClickRange:S,tooltip:D={},value:C,scale:T={},startAngle:k,endAngle:L,highlightStyle:N,highlight:w,segmentation:O,bar:R,needle:B,targets:P,outerRadius:_,innerRadius:F,outerRadiusRatio:W,innerRadiusRatio:H,cornerRadius:j,cornerMode:V,label:$,secondaryLabel:U,spacing:Z,...q}=e,{chartTooltipOptions:Q,seriesTooltipOptions:ie}=k1(D),ne=so(e,{animation:t,background:i,container:s,contextMenu:n,context:o,footnote:a,height:r,listeners:l,locale:c,minHeight:h,minWidth:d,overrideDevicePixelRatio:u,padding:p,subtitle:g,theme:f,title:x,tooltip:Q,width:m}),oe=so(e,{needle:B!=null?{enabled:!0,...B}:sn,startAngle:k,endAngle:L,scale:T,type:b,cursor:v,context:o,nodeClickRange:S,tooltip:ie,value:C,highlightStyle:N,highlight:w,segmentation:O,bar:R,targets:P,outerRadius:_,innerRadius:F,outerRadiusRatio:W,innerRadiusRatio:H,cornerRadius:j,cornerMode:V,label:$,secondaryLabel:U,spacing:Z,...q});return{...ne,series:[oe]}}function i5(e){const{animation:t,background:i,container:s,contextMenu:n,context:o,footnote:a,height:r,listeners:l,locale:c,minHeight:h,minWidth:d,overrideDevicePixelRatio:u,padding:p,subtitle:g,theme:f,title:x,width:m,type:b,cursor:v,nodeClickRange:S,tooltip:D={},value:C,scale:T={},direction:k="vertical",thickness:L,highlightStyle:N,highlight:w,segmentation:O,bar:R,targets:B,cornerRadius:P,cornerMode:_,label:F,...W}=e,{chartTooltipOptions:H,seriesTooltipOptions:j}=k1(D),V=so(e,{animation:t,background:i,container:s,contextMenu:n,context:o,footnote:a,height:r,listeners:l,locale:c,minHeight:h,minWidth:d,overrideDevicePixelRatio:u,padding:p,subtitle:g,theme:f,title:x,tooltip:H,width:m}),$=so(e,{scale:T,type:b,cursor:v,context:o,nodeClickRange:S,tooltip:j,value:C,direction:k,thickness:L,highlightStyle:N,highlight:w,segmentation:O,bar:R,targets:B,cornerRadius:P,cornerMode:_,label:F,...W});return{...V,series:[$]}}function C1(e,t){if(t==null)return e;const{targets:i,...s}=t;return e=et(e,s),e.targets!=null&&i!=null&&(e.targets=gC(e.targets,i)),e}function s5(e,t){switch(e.type){case"radial-gauge":return t5(C1(e,t));case"linear-gauge":return i5(C1(e,t));default:return{}}}var no={stroke:Wt},fs={fill:Np},T1={color:"white",fill:Wt},mr={color:Wt},qc={color:wp,fontSize:{$rem:bn.LARGE},fontFamily:{$ref:"fontFamily"}},JM={...qc,fontSize:{$ref:"fontSize"},color:Pp,fill:Ep,stroke:Op,strokeWidth:1,divider:{stroke:Rp,strokeWidth:1,strokeOpacity:.5}},eD={...no,background:{fill:Ni,fillOpacity:.2},handle:{...fs},text:{...mr},statistics:{...JM}},n5={line:{...no,handle:{...fs},text:{...mr}},"horizontal-line":{...no,handle:{...fs},axisLabel:{...T1},text:{...mr}},"vertical-line":{...no,handle:{...fs},axisLabel:{...T1},text:{...mr}},"disjoint-channel":{...no,background:{fill:Ni,fillOpacity:.2},handle:{...fs},text:{...mr}},"parallel-channel":{...no,background:{fill:Ni,fillOpacity:.2},handle:{...fs},text:{...mr}},"fibonacci-retracement":{...no,strokes:Lp,rangeStroke:Wt,handle:{...fs},text:{...mr,position:"center"},label:{...qc,color:void 0,fontSize:{$rem:bn.SMALLER}}},"fibonacci-retracement-trend-based":{...no,strokes:Lp,rangeStroke:Wt,handle:{...fs},text:{...mr,position:"center"},label:{...qc,color:void 0,fontSize:{$rem:bn.SMALLER}}},callout:{...no,...qc,color:{$ref:"textColor"},handle:{...fs},fill:Ni,fillOpacity:.2},comment:{...qc,color:"white",fontWeight:700,handle:{...fs},fill:Wt},note:{...qc,color:Gp,fill:Wt,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...fs},background:{fill:zp,stroke:_p,strokeWidth:1}},text:{...qc,handle:{...fs}},arrow:{...no,handle:{...fs},text:{...mr}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...fs,stroke:Wt}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...fs,stroke:Wt}},"date-range":{...eD},"price-range":{...eD},"date-price-range":{...eD},"quick-date-price-range":{up:{...no,fill:Ni,fillOpacity:.2,handle:{...fs},statistics:{...JM,color:"#fff",fill:Ni,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...no,stroke:Fp,fill:Bp,fillOpacity:.2,handle:{...fs,stroke:Fp},statistics:{...JM,color:"#fff",fill:Bp,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},o5=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],a5=[{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"fibonacci-retracement-drawing",tooltip:"toolbarAnnotationsFibonacciAnnotations",value:"fibonacci-menu"},{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"measurer-drawing",tooltip:"toolbarAnnotationsMeasurerAnnotations",value:"measurer-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}];function r5(e,t,i){const{dateKey:s="date",highKey:n="high",openKey:o="open",lowKey:a="low",closeKey:r="close",volumeKey:l="volume",chartType:c="candlestick",navigator:h=!1,volume:d=!0,rangeButtons:u=!0,statusBar:p=!0,toolbar:g=!0,zoom:f=!0,sync:x=!1,theme:m,data:b,formatter:v,...S}=e,D=c5(c,s,n,a,o,r),C=l5(i,o,r,d,l),k={navigator:{enabled:h,...d?{miniChart:{enabled:h,series:[{type:"line",xKey:s,yKey:l,stroke:em,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},L={annotations:{enabled:g,optionsToolbar:{enabled:g},snap:!0,toolbar:{enabled:g,buttons:a5,padding:0},data:b,xKey:s,volumeKey:d?l:void 0}},N=p?{statusBar:{enabled:!0,data:b,highKey:n,openKey:o,lowKey:a,closeKey:r,volumeKey:d?l:void 0}}:null,w={zoom:{enabled:f,autoScaling:{enabled:!0},enableIndependentAxes:!0}},O={ranges:{enabled:u}},R=x?{sync:{enabled:x,nodeInteraction:!0,zoom:!0}}:null,B=d?[{type:"number",position:"left",keys:[l],label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percent",align:"end"}}]:[];return{theme:{baseTheme:typeof m=="string"?m:"ag-financial",...et(typeof m=="object"?m:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:6},chartToolbar:{enabled:g},annotations:{...n5},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}}}},bar:{series:{fillOpacity:.5}},line:{series:{marker:{enabled:!1},...N1(c,{hlc:{stroke:{$palette:"altNeutral.stroke"},strokeWidth:2},line:{stroke:{$palette:"neutral.stroke"}},"step-line":{stroke:{$palette:"neutral.stroke"},interpolation:{type:"step"}}})}},candlestick:{series:{...N1(c,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},"range-area":{series:{fillOpacity:.3,strokeWidth:2}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...C,...D],axes:[{type:"number",position:"right",keys:[o,r,n,a],crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...B,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:b,formatter:v,...L,...k,...N,...w,...O,...R,...S}}function l5(e,t,i,s,n){return s?[{type:"bar",xKey:"date",yKey:n,tooltip:{enabled:!1},itemStyler({datum:o}){const{up:a,down:r}=e().palette;return{fill:o[t]<o[i]?a?.fill:r?.fill}},focusPriority:1,highlight:{enabled:!1}}]:[]}var L1="range-area";function c5(e,t,i,s,n,o){const a={xKey:t,openKey:n,closeKey:o,highKey:i,lowKey:s},r={xKey:t,yKey:o},l={pickOutsideVisibleMinorAxis:!0};switch(e??"candlestick"){case"ohlc":return h5(l,a);case"line":case"step-line":return d5(l,r);case"hlc":return u5(l,r,a);case"high-low":return p5(l,a);case"candlestick":case"hollow-candlestick":return w1(l,a);default:return X.warnOnce(`unknown chart type: ${e}; expected one of: ${o5.join(", ")}`),w1(l,a)}}function h5(e,t){return[{type:"ohlc",focusPriority:0,...e,...t}]}function d5(e,t){return[{type:"line",focusPriority:0,...e,...t}]}function u5(e,t,{xKey:i,highKey:s,closeKey:n,lowKey:o}){return[{type:L1,focusPriority:0,...e,xKey:i,yHighKey:s,yLowKey:n,fill:Ky,stroke:Uy},{type:L1,focusPriority:0,...e,xKey:i,yHighKey:n,yLowKey:o,fill:Zy,stroke:Yy},{type:"line",...e,...t}]}function p5(e,{xKey:t,highKey:i,lowKey:s}){return[{type:"range-bar",...e,xKey:t,yHighKey:i,yLowKey:s,fill:qy,stroke:Xy,tooltip:{range:"nearest"},focusPriority:0}]}function w1(e,t){return[{type:"candlestick",focusPriority:0,...e,...t}]}function N1(e,t){return t[e]??t.default}var E1={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:Jy,lineDash:[0],label:{enabled:!1}}},tD={...E1,nice:!1},tx={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},iD={style:[{stroke:{$ref:"gridLineColor"}}],width:2},g5={number:{gridLine:iD},time:{gridLine:iD},category:{gridLine:iD}},f5={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:{...tD,interval:{values:[0]}},log:{...tD},time:{...tD},category:{...E1}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...tx,position:{...tx.position,anchorTo:"pointer"},range:"nearest"},axes:g5},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:tx},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:tx}}},O1=as(y5);function y5(e,t){return typeof e=="string"?{...t,baseTheme:e}:e!=null?{...e,baseTheme:O1(e.baseTheme,t)}:t}function P1(e){if(Array.isArray(e)&&e.length!==0){const t=e.find(i=>i!=null);if(typeof t=="number")return{data:e.map((s,n)=>({x:n,y:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(t))return{data:e.map(s=>({x:s?.[0],y:s?.[1],datum:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}else if(e?.length===0)return{data:e,series:[{xKey:"x",yKey:"y"}],datumKey:"y"};return{data:e}}function m5(e){switch(e?.type){case"number":{const{type:t,min:i,max:s,reverse:n}=e;return so(e,{type:t,reverse:n,min:i,max:s})}case"time":{const{type:t,min:i,max:s,reverse:n}=e;return so(e,{type:t,reverse:n,min:i,max:s})}case"category":default:{const{paddingInner:t,paddingOuter:i,reverse:s}=e??{};return so({...e,type:"category"},{type:"category",reverse:s,paddingInner:t,paddingOuter:i})}}}function x5(e,t,i){const s={};return e?.stroke!=null&&(s.style=[{stroke:e?.stroke}],s.enabled??(s.enabled=!0)),e?.strokeWidth!=null&&(s.width=e?.strokeWidth,s.enabled??(s.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(s.enabled??(s.enabled=!0)),e?.visible!=null&&(s.enabled=e.visible),s.enabled??(s.enabled=t),s}var b5=as((e,t,i)=>s=>{const n=s.datum[s.xKey],o=s.datum[s.yKey],a=i!=null?s.datum[i]:s.datum,r=t?.renderer?.({context:e,datum:a,xValue:n,yValue:o});if(typeof r=="string")return r;const l=r?.content??o.toFixed(2);return r?.title?{heading:void 0,title:void 0,data:[{label:r.title,value:l}]}:{heading:void 0,title:l,data:[]}});function v5(e){const{background:t,container:i,height:s,listeners:n,locale:o,minHeight:a,minWidth:r,overrideDevicePixelRatio:l,padding:c,width:h,theme:d,data:u,crosshair:p,axis:g,min:f,max:x,tooltip:m,context:b,styleNonce:v,...S}=e,D=so(e,{background:t,container:i,height:s,listeners:n,locale:o,minHeight:a,minWidth:r,overrideDevicePixelRatio:l,padding:c,width:h,styleNonce:v,tooltip:sn,context:sn,data:sn,crosshair:sn,axis:sn,min:sn,max:sn,theme:sn}),{data:C,series:[T]=[],datumKey:k}=P1(u),L=S;T!=null&&Object.assign(L,T),L.tooltip={...m,renderer:b5(b,m,k)},D.theme=O1(d,f5),D.data=C,D.series=[L];const N=L.type!=="bar"||L.direction!=="horizontal",[w,O]=N?["bottom","left"]:["left","bottom"],R={...m5(g),position:w,...so(e,{crosshair:p})},B={type:"number",gridLine:x5(g,!1,e),position:O,...so(e,{min:f,max:x})};return D.axes=N?[B,R]:[R,B],D}var S5={chartType:J("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),dateKey:E,openKey:E,highKey:E,lowKey:E,closeKey:E,volumeKey:E,navigator:z,volume:z,rangeButtons:z,statusBar:z,toolbar:z,zoom:z,sync:z,theme:Te,container:Te,width:Te,height:Te,minWidth:Te,minHeight:Te,listeners:Te,initialState:Te,title:Te,data:ko,formatter:Te},sD={theme:Te,container:Te,animation:Te,background:Te,contextMenu:Te,context:()=>!0,listeners:Te,locale:Te,width:Te,height:Te,minWidth:Te,minHeight:Te,title:Te,subtitle:Te,footnote:Te,padding:Te,tooltip:{...tt,...Ne.tooltip}};sD.overrideDevicePixelRatio=me(G);var nD=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],oD={visible:z,reverse:z,stroke:ae,strokeWidth:G},aD={context:()=>!0,tooltip:Te,theme:Te,background:Te,container:Te,width:Te,height:Te,minWidth:Te,minHeight:Te,padding:Te,listeners:Te,locale:Te,data:Te,styleNonce:E,axis:nc({number:{...oD,min:at(K,_n("max")),max:at(K,Gn("min"))},category:{...oD,paddingInner:pe,paddingOuter:pe},time:{...oD,min:at(Ce(K,Hr),_n("max")),max:at(Ce(K,Hr),Gn("min"))}},"axis options","category"),min:at(K,_n("max")),max:at(K,Gn("min")),crosshair:{enabled:z,snap:z,...se,...fe},xKey:E,yKey:E},M5={type:"preset",name:"price-volume",enterprise:!0,options:S5,create:r5},D5={type:"preset",name:"gauge-preset",enterprise:!0,options:nc({"linear-gauge":{...ce(cl,["type"]),...sD},"radial-gauge":{...ce($p,["type"]),...sD}},"gauge options"),create:s5},A5={type:"preset",name:"sparkline",options:nc({area:{...aD,...ce(xw,nD)},bar:{...aD,...ce(vm,nD)},line:{...aD,...ce(Sm,nD)}},"sparkline options"),create:v5,processData:P1},I5=["top","right","bottom","left"],ix=class M_ extends $y{constructor(t,i){super(t,i),this.paired=!0,this.lastUpdateClipRect=void 0,this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}onAxisChange(t,i){super.onAxisChange(t,i),this.syncAxisChanges(t,i),this.ctx!=null&&this.ctx.zoomManager.updateAxes(t)}destroySeries(t){super.destroySeries(t),this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}getChartType(){return"cartesian"}setRootClipRects(t){const{seriesRoot:i,annotationRoot:s}=this;i.setClipRect(t),s.setClipRect(t)}async processData(){await super.processData(),this.syncStatus==="init"&&(this.syncStatus="domains-calculated"),this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const t of this.axes){const i=await this.getSyncedDomain(t);i!=null&&t.setDomains(i)}}performLayout(t){const{seriesRoot:i,annotationRoot:s}=this,{clipSeries:n,seriesRect:o,visible:a}=this.updateAxes(t.layoutBox);this.seriesRoot.visible=a,this.seriesRect=o,this.animationRect=t.layoutBox;const{x:r,y:l}=o;if(t.width!==this.lastLayoutWidth||t.height!==this.lastLayoutHeight)for(const p of[i,s])p.translationX=Math.floor(r),p.translationY=Math.floor(l);else{const{translationX:p,translationY:g}=i;tr(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:p,translationY:g},{translationX:Math.floor(r),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=t.width,this.lastLayoutHeight=t.height;const c=this.modulesManager.getModule("seriesArea"),h=o.clone().grow(c.getPadding()),d=c.clip||n?h:void 0,{lastUpdateClipRect:u}=this;this.lastUpdateClipRect=d,this.ctx.animationManager.isActive()&&u!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:u,to:h,onUpdate:p=>this.setRootClipRects(p),onComplete:()=>this.setRootClipRects(d)}):this.setRootClipRects(d),this.ctx.layoutManager.emitLayoutComplete(t,{axes:this.axes.map(p=>p.getLayoutState()),series:{visible:a,rect:o,paddedRect:h},clipSeries:n})}updateAxes(t){const{clipSeries:i,seriesRect:s,overflows:n}=this.resolveAxesLayout(t);for(const o of this.axes)o.update(),o.setCrossLinesVisible(!n),this.clipAxis(o,s,t);return{clipSeries:i,seriesRect:s,visible:!n}}resolveAxesLayout(t){let i,s,n=0;const o=10;do if(s=i??this.getDefaultState(),i=this.updateAxesPass(new Map(s.axisAreaWidths),t.clone()),n++>o){X.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(i,s));return this.lastAreaWidths=i.axisAreaWidths,i}updateAxesPass(t,i){const s=new Map,n={};let o=!1,a=!1;for(const m of I5){const b=this.modulesManager.getModule("seriesArea").getPadding()[m],v=this.axes.findLast(S=>S.position===m);v?v.seriesAreaPadding=b:i.shrink(b,m)}const r=(t.get("left")??0)+(t.get("right")??0),l=(t.get("top")??0)+(t.get("bottom")??0),c=this.buildCrossLinePadding(t),h=c.left+c.right,d=c.top+c.bottom;i.width<=r+h||i.height<=l+d?o=!0:i.shrink(c);const{scene:u}=this.ctx,p=i.clone().shrink(Object.fromEntries(t));for(const m of this.axes){const{position:b="left",direction:v}=m,S=v==="y";let D;this.sizeAxis(m,p,b),m.thickness==null?D=rD(S,u)*(m.maxThicknessRatio??1):D=m.thickness;const{primaryTickCount:C,bbox:T}=m.calculateLayout(m.nice?n[v]:void 0,{sizeLimit:D,padding:this.padding});n[v]??(n[v]=C),a||(a=m.dataDomain.clipped||m.visibleRange[0]>0||m.visibleRange[1]<1),m.thickness==null&&(D=Math.min(rD(S,T)??0,D)),s.set(m.id,Math.ceil(D))}const g=Vv(this.axes,m=>m.position??"left"),f=new Map,x=new Map;for(const[m,b]of Et(g)){let v=rD(m!=="left"&&m!=="right",u)%u.pixelRatio,S=0;for(const D of b??[]){x.set(D.id,v);const C=s.get(D.id)??0;S=Math.max(S,v+C),D.layoutConstraints.stacked&&(v+=C+M_.AxesPadding)}f.set(m,Math.ceil(S))}for(const[m,b]of Et(g))this.positionAxes({axes:b??[],position:m,axisWidths:s,axisOffsets:x,axisAreaWidths:f,axisBound:i,seriesRect:p});return{clipSeries:a,seriesRect:p,axisAreaWidths:f,overflows:o}}buildCrossLinePadding(t){const i={top:0,right:0,bottom:0,left:0};this.axes.forEach(s=>{const{position:n,label:o}=s;s.crossLines?.forEach(a=>{var r;a instanceof Hs&&(a.position=n??"top",(r=a.label).parallel??(r.parallel=o.parallel)),a.calculatePadding?.(i)})});for(const[s,n=0]of Et(i))i[s]=Math.max(n-(t.get(s)??0),0);return i}clampToOutsideSeriesRect(t,i,s,n){const o=s==="x"?t.x:t.y,a=s==="x"?t.width:t.height;return n===1?Math.min(i,o+a):Math.max(i,o)}async getSyncedDomain(t){const i=this.modulesManager.getModule("sync");if(i?.enabled)return await i.getSyncedDomain(t)}syncAxisChanges(t,i){const s=this.modulesManager.getModule("sync");if(!s?.enabled)return;const n=new Set(i??[]);for(const o of t)n.delete(o);for(const o of n)s.removeAxis(o)}sizeAxis(t,i,s){const n=t instanceof va,o=s==="left"||s==="right",{width:a,height:r}=i,l=o?r:a;let c=0,h=l,{min:d,max:u}=this.ctx.zoomManager.getAxisZoom(t.id);const{width:p,unit:g,align:f}=t.layoutConstraints;g==="px"?h=c+p:h=h*p/100,f==="end"&&(c=l-(h-c),h=l),o&&(n?[c,h]=[h,c]:[d,u]=[1-u,1-d]),t.range=[c,h],t.visibleRange=[d,u],t.gridLength=o?a:r}positionAxes(t){const{axes:i,axisBound:s,axisWidths:n,axisOffsets:o,axisAreaWidths:a,seriesRect:r,position:l}=t,c=a.get(l)??0;let h="x",d="y",u=1;(l==="top"||l==="bottom")&&(h="y",d="x");let p=s[h];(l==="right"||l==="bottom")&&(u=-1,p+=h==="x"?s.width:s.height);for(const g of i){const f=a.get(d==="x"?"left":"top")??0,x=n.get(g.id)??0,m=o.get(g.id)??0;g.gridPadding=c-m-x,g.translation[d]=s[d]+f,g.translation[h]=this.clampToOutsideSeriesRect(r,p+u*(m+x),h,u)}}shouldFlipXY(){return this.series.every(t=>t instanceof Zc&&t.shouldFlipXY())}getDefaultState(){const t=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const s=this.lastAreaWidths.get(i);s!=null&&t.set(i,s)}return{axisAreaWidths:t,clipSeries:!1,overflows:!1}}isLayoutStable(t,i){if(i.overflows!==t.overflows||i.clipSeries!==t.clipSeries)return!1;for(const s of t.axisAreaWidths.keys())if(!i.axisAreaWidths.has(s))return!1;for(const[s,n]of i.axisAreaWidths.entries()){const o=t.axisAreaWidths.get(s);if((n!=null||o!=null)&&n!==o)return!1}return!0}clipAxis(t,i,s){const n=Math.ceil(t.gridLine?.width??0),o=Math.ceil(t.line?.width??0);let{width:a,height:r}=i;switch(a+=t.direction==="x"?n:o,r+=t.direction==="y"?n:o,t.clipGrid(i.x,i.y,a,r),t.position){case"left":case"right":t.clipTickLines(s.x,i.y-n,s.width+n,i.height+n*2);break;case"top":case"bottom":t.clipTickLines(i.x-n,s.y,i.width+n*2,s.height+n);break}}};ix.className="CartesianChart",ix.type="cartesian",ix.AxesPadding=15;var k5=ix;function rD(e,t){return e?t?.width:t?.height}var sx={mode:me(J("integrated","standalone")),container:Gk,context:()=>!0,theme:Te,series:ko,annotations:Te,navigator:Te,initialState:{chartType:E,annotations:Te,legend:ui({visible:z,seriesId:E,itemId:E,legendItemName:E},"legend state array"),zoom:Te}},R1={...Ne,...sx,axes:Wr(2),data:ko},B1={...Ne,...sx,axes:Wr(2),data:ko},C5={...Ne,...sx,data:ko,topology:Fh},T5={...Ne,...sx,data:ko},L5=new Set(["number","log","time"]),w5=e=>Fe(e)&&!L5.has(e.type),N5={type:"chart",name:"cartesian",options:R1,detect:i2,create(e,t){return new k5(e,t)},validate(e,t,i){const s=[];e?.series?.[0]?.type==="histogram"&&e?.axes?.some(w5)&&(s.push(new jr("invalid","only continuous axis types when histogram series is used",e.axes,i,"axes")),e=ce(e,["axes"]));const n=ss(e,t,i);return n.invalid.push(...s),n}},F1=()=>{throw new Error("Enterprise module placeholder cannot be initialised")},E5={type:"chart",name:"standalone",placeholder:!0,options:{},detect:n2,create:F1},O5={type:"chart",name:"topology",placeholder:!0,options:{},detect:s2,create:F1},jd=class extends g0{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}layoutCrossLines(){const e=this.label.getSideFlag(),t=this.hasDefinedDomain()||this.hasVisibleSeries(),{rotation:i,parallelFlipRotation:s,regularFlipRotation:n}=this.calculateRotations();this.crossLines.forEach(o=>{o.sideFlag=-e,o.direction=i===-Math.PI/2?"angle":"radius",o.parallelFlipRotation=s,o.regularFlipRotation=n,o.calculateLayout?.(t,this.reverse)})}updatePosition(){super.updatePosition();const e=Math.floor(this.translation.x),t=Math.floor(this.translation.y);this.tickLineGroup.translationX=e,this.tickLineGroup.translationY=t,this.tickLabelGroup.translationX=e,this.tickLabelGroup.translationY=t,this.crossLineRangeGroup.translationX=e,this.crossLineRangeGroup.translationY=t,this.crossLineLineGroup.translationX=e,this.crossLineLineGroup.translationY=t,this.crossLineLabelGroup.translationX=e,this.crossLineLabelGroup.translationY=t,this.tickLabelGroupSelection.each(Ey())}computeLabelsBBox(e,t){return null}computeRange(){}getAxisLinePoints(){}};M([I],jd.prototype,"shape",2),M([I],jd.prototype,"innerRadiusRatio",2);var lD=class extends $y{constructor(e,t){super(e,t),this.padding=new fc(40),this.ctx.axisManager.axisGroup.zIndex=8}getChartType(){return"polar"}async performLayout(e){const{layoutBox:t}=e,i=t.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());this.seriesRect=i,this.animationRect=i,this.seriesRoot.translationX=i.x,this.seriesRoot.translationY=i.y,await this.computeCircle(i),this.axes.forEach(s=>s.update()),this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:i,paddedRect:t}})}updateAxes(e,t,i,s){const n=this.axes.find(l=>l.direction==="angle"),o=this.axes.find(l=>l.direction==="radius");if(!(n instanceof jd)||!(o instanceof jd))return;const a=n.scale,r=o.innerRadiusRatio;n.innerRadiusRatio=r,n.computeRange(),n.gridLength=s,o.gridAngles=a.ticks({nice:n.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>a.convert(l)),o.gridRange=n.range,o.range=[s,s*r],[n,o].forEach(l=>{l.translation.x=e.x+t,l.translation.y=e.y+i,l.calculateLayout()})}async computeCircle(e){const t=this.series.filter(P5),i=this.axes.filter(R5),s=(c,h,d)=>{this.updateAxes(e,c,h,d),t.forEach(p=>{p.centerX=c,p.centerY=h,p.radius=d});const u=t.filter(p=>p.type==="donut"||p.type==="pie");if(u.length>1){const p=u.map(g=>{const f=g.getInnerRadius();return{series:g,innerRadius:f}}).sort((g,f)=>g.innerRadius-f.innerRadius);p.at(-1).series.surroundingRadius=void 0;for(let g=0;g<p.length-1;g++)p[g].series.surroundingRadius=p[g+1].innerRadius}},n=e.width/2,o=e.height/2,a=Math.max(0,Math.min(e.width,e.height)/2);let r=a;s(n,o,r);const l=async({hideWhenNecessary:c=!1}={})=>{const h=[];for(const p of rc(i,t)){const g=await p.computeLabelsBBox({hideWhenNecessary:c},e);g&&h.push(g)}if(h.length===0){s(n,o,a);return}const d=de.merge(h),u=this.refineCircle(d,r,e);s(u.centerX,u.centerY,u.radius),r=u.radius};await l(),await l(),await l(),await l({hideWhenNecessary:!0}),await l({hideWhenNecessary:!0});for(const c of rc(i,t))await c.computeLabelsBBox({hideWhenNecessary:!0},e);return{radius:r,centerX:n,centerY:o}}refineCircle(e,t,i){const n=-t,o=-t,a=t,r=t;let l=Math.max(0,n-e.x),c=Math.max(0,o-e.y),h=Math.max(0,e.x+e.width-a),d=Math.max(0,e.y+e.height-r);l=h=Math.max(l,h),c=d=Math.max(c,d);const u=i.width-l-h,p=i.height-c-d;let g=Math.min(u,p)/2;const f=.5*i.width/2,x=.5*i.height/2,m=Math.min(f,x);if(g<m){g=m;const S=l+h,D=c+d;if(2*g+D>i.height){const C=i.height-2*g;Math.min(c,d)*2>C?(c=C/2,d=C/2):c>d?c=C-d:d=C-c}if(2*g+S>i.width){const C=i.width-2*g;Math.min(l,h)*2>C?(l=C/2,h=C/2):l>h?l=C-h:h=C-l}}const b=l+2*g+h,v=c+2*g+d;return{centerX:(i.width-b)/2+l+g,centerY:(i.height-v)/2+c+g,radius:g}}};lD.className="PolarChart",lD.type="polar";function P5(e){return e instanceof QM}function R5(e){return e instanceof jd}var B5={type:"chart",name:"polar",options:B1,detect:_H,create(e,t){return new lD(e,t)},validate(e,t,i){const s=[],n=e?.series?.[0]?.type;(n==="pie"||n==="donut")&&e?.axes&&(s.push(new Rv([],e.axes,i,"axes")),e=ce(e,["axes"]));const o=ss(e,t,i);return o.invalid.push(...s),o}},F5=[N5,m$,x$,b$,v$,S$,M$,JN,a1,h1,u1,g1,f1],z5=[B5,X3,J3],_5=[...F5,...z5,E5,O5,M5,D5,A5],G5=1e3,cD=class ic{constructor(t,i,s,n,o,a=G5){this.name=t,this.buildItem=i,this.releaseItem=s,this.destroyItem=n,this.maxPoolSize=o,this.cleanupTimeMs=a,this.freePool=[],this.busyPool=new Set}static getPool(t,i,s,n,o){return this.pools.has(t)||this.pools.set(t,new ic(t,i,s,n,o)),this.pools.get(t)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(t){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(t),ic.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):ic.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i]),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}obtainFree(){const t=this.freePool.pop();if(t==null)throw new Error("AG Charts - pool has no free instances");return ic.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,t]),this.busyPool.add(t),{item:t,release:()=>this.release(t)}}release(t){if(!this.busyPool.has(t))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");ic.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]),this.releaseItem(t),this.busyPool.delete(t),this.freePool.push(t),ic.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]);const i=Date.now(),s=i+this.cleanupTimeMs*.5;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)<s&&(clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=void 0),this.cleanPoolTimer||(this.cleanPoolDue=i+this.cleanupTimeMs,this.cleanPoolTimer=setTimeout(this.cleanPool.bind(this),this.cleanupTimeMs))}cleanPool(){const t=this.freePool.splice(0);for(const i of t)this.destroyItem(i);ic.debug(()=>[`Pool[name=${this.name}]: Cleaned pool of ${t.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const t of this.busyPool.values())this.destroyItem(t);this.busyPool.clear()}};cD.pools=new Map,cD.debug=Be.create(!0,"pool");var V5=cD;Vs.registerMany(_5,Ja);var xr=Be.create(!0,"opts"),oo=class{static licenseCheck(e){this.licenseChecked||(this.licenseManager=fl.licenseManager?.(e),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(e){return fl.licenseManager?.({}).getLicenseDetails(e)}static getInstance(e){return z1.getInstance(e)}static create(e,t){const i=Be.check("scene:stats","scene:stats:verbose")?performance.now():void 0;return xr.group("AgCharts.create()",()=>{e=Be.inDevelopmentMode(()=>Ua(Ot(e)))??e,this.licenseCheck(e);const s=z1.createOrUpdate({userOptions:e,licenseManager:this.licenseManager,optionsMetadata:t,apiStartTime:i});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&fl.injectWatermark?.(s.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),s})}static createFinancialChart(e){return xr.group("AgCharts.createFinancialChart()",()=>this.create(e,{presetType:"price-volume"}))}static createGauge(e){return xr.group("AgCharts.createGauge()",()=>this.create(e,{presetType:"gauge-preset"}))}static __createSparkline(e){return xr.group("AgCharts.__createSparkline()",()=>{const{pool:t,...i}=e;return this.create(i,{presetType:"sparkline",pool:t??!0,domMode:"minimal",withDragInterpretation:!1})})}};oo.licenseChecked=!1;var ka=class sc{static getInstance(t){const i=$y.getInstance(t);return i?yN.chartInstances.get(i):void 0}static initialiseModules(){sc.initialised||(ex(),e5(),sc.initialised=!0)}static createOrUpdate(t){let{proxy:i}=t;const{userOptions:s,licenseManager:n,processedOverrides:o=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:a=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:r=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,data:c,stripSymbols:h=!1,apiStartTime:d}=t,u=fl.styles!=null?[["ag-charts-enterprise",fl.styles]]:[];sc.initialiseModules(),xr(()=>[">>> AgCharts.createOrUpdate() user options",Ot(s)]);const{presetType:p}=r;let g=s;oo.optionsMutationFn&&g&&(g=oo.optionsMutationFn(Ot(g,rg.OPTIONS_CLONE_OPTS_FAST),p),xr(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Ot(g)]));const f=this.getPool(r);let x=!1,m,b=i?.chart;b==null&&f?.hasFree()&&(m=f.obtainFree(),b=m.item);const{document:v,window:S,styleContainer:D,...C}=g??{},T=b?.getChartOptions(),k=new rg(T,C,o,{...a,document:v,window:S,styleContainer:D},r,l,h,d);return(b==null||Vs.detectChartDefinition(k.processedOptions)!==Vs.detectChartDefinition(b.chartOptions.processedOptions))&&(m?.release(),m=this.getPool(k.optionMetadata)?.obtain(k),m?b=m.item:(x=!0,b=sc.createChartInstance(k,b))),u.forEach(([L,N])=>{b.ctx.domManager.addStyles(L,N)}),b.ctx.fontManager.updateFonts(k.googleFonts),c!=null&&b.ctx.dataService.restoreData(c),i==null?(i=new yN(b,sc.callbackApi,n),i.releaseChart=m?.release):(m||x)&&(i.releaseChart?.(),i.chart=b,i.releaseChart=m?.release),xr.check()&&typeof window<"u"&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[b.id]=b),b.queuedUserOptions.push(k.userOptions),b.queuedChartOptions.push(k),b.requestFactoryUpdate(L=>{xr.group(">>>> Chart.applyOptions()",()=>{L.applyOptions(k);const N=L.queuedUserOptions.indexOf(k.userOptions)+1;L.queuedUserOptions.splice(0,N),L.queuedChartOptions.splice(0,N)})}),i}static markRemovedProperties(t,i,s=!1){if(typeof t!="object")return s;for(const n of Object.keys(t))typeof t[n]>"u"&&(Object.assign(t,{[n]:Symbol("UNSET")}),s||(s=!0));return s}static updateUserDelta(t,i,s){i=Ot(i,rg.OPTIONS_CLONE_OPTS_FAST);const n=Zr(i,sc.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);xr(()=>[">>> AgCharts.updateUserDelta() user delta",Ot(i)]),sc.createOrUpdate({proxy:t,deltaOptions:i,stripSymbols:n,apiStartTime:s})}static createChartInstance(t,i){const s=i?.destroy({keepTransferableResources:!0});return Vs.detectChartDefinition(t.processedOptions).create(t,s)}static getPool(t){if(t.pool===!0)return V5.getPool(t.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};ka.caretaker=new hT(Ja),ka.initialised=!1,ka.callbackApi={caretaker:ka.caretaker,create(e,t,i,s,n){return ka.createOrUpdate({userOptions:e,processedOverrides:t,specialOverrides:i,optionsMetadata:s,data:n})},update(e,t,i,s){return ka.createOrUpdate({userOptions:e,proxy:t,specialOverrides:i,apiStartTime:s})},updateUserDelta(e,t,i){return ka.updateUserDelta(e,t,i)}},ka.detachAndClear=e=>e.detachAndClear(),ka.destroy=e=>e.destroy();var z1=ka,nx={};gn(nx,{Arc:()=>Ca,BBox:()=>de,Caption:()=>Pt,CategoryScale:()=>ld,Group:()=>Re,Line:()=>Sn,LinearScale:()=>Fc,Marker:()=>wi,Path:()=>ks,RadialColumnShape:()=>ao,Rect:()=>Ti,Scene:()=>fy,Sector:()=>gs,Shape:()=>gi,TranslatableGroup:()=>As,getRadialColumnWidth:()=>_1,toRadians:()=>os});var Ca=class extends ks{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0}get fullPie(){return lt(pi(this.startAngle),pi(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?e.closePath():this.type===2&&!this.fullPie&&(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new de(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(e,t){const i=this.getBBox();return this.type!==0&&i.containsPoint(e,t)&&this.path.isPointInPath(e,t)}};Ca.className="Arc",M([te()],Ca.prototype,"centerX",2),M([te()],Ca.prototype,"centerY",2),M([te()],Ca.prototype,"radius",2),M([te()],Ca.prototype,"startAngle",2),M([te()],Ca.prototype,"endAngle",2),M([te()],Ca.prototype,"counterClockwise",2),M([te()],Ca.prototype,"type",2);function hD(e,t,i){const s=Math.sqrt(e**2+t**2),o=Math.atan2(t,e)+i;return{x:Math.cos(o)*s,y:Math.sin(o)*s}}var ao=class extends ks{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(e){}computeBBox(){const{innerRadius:e,outerRadius:t,columnWidth:i}=this,s=this.getRotation(),n=-i/2,o=i/2,a=-t,r=-e;let l=1/0,c=1/0,h=-1/0,d=-1/0;for(let u=0;u<4;u+=1){const{x:p,y:g}=hD(u%2===0?n:o,u<2?a:r,s);l=Math.min(p,l),c=Math.min(g,c),h=Math.max(p,h),d=Math.max(g,d)}return new de(l,c,h-l,d-c)}getRotation(){const{startAngle:e,endAngle:t}=this,i=qf(e,t);return pi(e+i/2+Math.PI/2)}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,innerRadius:t,outerRadius:i,path:s}=this,n=-e/2,o=e/2,a=-i,r=-t,l=this.getRotation(),c=[[n,r],[n,a],[o,a],[o,r]].map(([h,d])=>hD(h,d,l));s.clear(!0),s.moveTo(c[0].x,c[0].y),s.lineTo(c[1].x,c[1].y),s.lineTo(c[2].x,c[2].y),s.lineTo(c[3].x,c[3].y),s.closePath()}updateBeveledPath(){const{columnWidth:e,path:t,outerRadius:i,innerRadius:s,axisInnerRadius:n,axisOuterRadius:o,isRadiusAxisReversed:a}=this,r=lt(s,n),l=Math.asin(e/2/s),c=this.getRotation(),h=(k,L)=>hD(k,L,c),d=(k,L)=>Math.sqrt(k**2+L**2),u=(k,L)=>L>k?0:Math.sqrt(k**2-L**2),p=(k,L,N)=>N?k<L:k>L,g=r&&!isNaN(l)&&l<Math.PI/6;let f=-e/2,x=e/2;const m=-i,b=-s*(g?Math.cos(l):1),v=p(o,d(s,e/2),!a);if(v){const k=u(o,s);f=-k,x=k}t.clear(!0);const S=h(f,b);t.moveTo(S.x,S.y);const D=lt(s,i),C=p(o,d(i,e/2),!a);if(D&&g)t.arc(0,0,s,pi(-l-Math.PI/2)+c,pi(l-Math.PI/2)+c,!1);else if(C){const k=-u(o,e/2),L=u(o,i);if(!v){const N=h(f,k);t.lineTo(N.x,N.y)}if(t.arc(0,0,o,Math.atan2(k,f)+c,Math.atan2(m,-L)+c,!1),!lt(L,0)){const N=h(L,m);t.lineTo(N.x,N.y)}t.arc(0,0,o,Math.atan2(m,L)+c,Math.atan2(k,x)+c,!1)}else{const k=h(f,m),L=h(x,m);t.lineTo(k.x,k.y),t.lineTo(L.x,L.y)}const T=h(x,b);if(t.lineTo(T.x,T.y),g)t.arc(0,0,s,pi(l-Math.PI/2)+c,pi(-l-Math.PI/2)+c,!0);else{const k=h(f,b);t.lineTo(k.x,k.y)}t.closePath()}};ao.className="RadialColumnShape",M([te()],ao.prototype,"isBeveled",2),M([te()],ao.prototype,"columnWidth",2),M([te()],ao.prototype,"startAngle",2),M([te()],ao.prototype,"endAngle",2),M([te()],ao.prototype,"outerRadius",2),M([te()],ao.prototype,"innerRadius",2),M([te()],ao.prototype,"axisInnerRadius",2),M([te()],ao.prototype,"axisOuterRadius",2),M([te()],ao.prototype,"isRadiusAxisReversed",2);function _1(e,t,i,s,n){const o=qf(e,t),a=o*(1-s)/2;if(e+=a,t-=a,o<.001)return 2*i*n;if(o>=2*Math.PI){const p=e+o/2;e=p-Math.PI,t=p+Math.PI}const r=i*Math.cos(e),l=i*Math.sin(e),c=i*Math.cos(t),h=i*Math.sin(t),d=Math.floor(Math.sqrt((r-c)**2+(l-h)**2)),u=2*i*n;return Math.max(1,Math.min(u,d))}var ox={};gn(ox,{ChartTheme:()=>Ro,DEFAULT_ANNOTATION_HANDLE_FILL:()=>Np,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>Pp,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>Rp,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>Bp,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Fp,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Ep,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Op,DEFAULT_CAPTION_ALIGNMENT:()=>ol,DEFAULT_CAPTION_LAYOUT_STYLE:()=>nl,DEFAULT_FIBONACCI_STROKES:()=>Lp,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Ni,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Wt,DEFAULT_GRIDLINE_ENABLED:()=>Po,DEFAULT_POLAR_SERIES_STROKE:()=>Qy,DEFAULT_SEPARATION_LINES_COLOUR:()=>Tp,DEFAULT_SHADOW_COLOUR:()=>sl,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Jy,DEFAULT_TEXTBOX_COLOR:()=>Gp,DEFAULT_TEXTBOX_FILL:()=>zp,DEFAULT_TEXTBOX_STROKE:()=>_p,DEFAULT_TEXT_ANNOTATION_COLOR:()=>wp,DEFAULT_TOOLBAR_POSITION:()=>Vp,IS_DARK_THEME:()=>gd,PALETTE_ALT_DOWN_FILL:()=>E0,PALETTE_ALT_DOWN_STROKE:()=>w0,PALETTE_ALT_NEUTRAL_FILL:()=>O0,PALETTE_ALT_NEUTRAL_STROKE:()=>P0,PALETTE_ALT_UP_FILL:()=>N0,PALETTE_ALT_UP_STROKE:()=>L0,PALETTE_DOWN_FILL:()=>Zy,PALETTE_DOWN_STROKE:()=>Yy,PALETTE_NEUTRAL_FILL:()=>qy,PALETTE_NEUTRAL_STROKE:()=>Xy,PALETTE_UP_FILL:()=>Ky,PALETTE_UP_STROKE:()=>Uy,getChartTheme:()=>Cm,resolveOperation:()=>H5,themeNames:()=>j5,themeSymbols:()=>T0,themes:()=>pM});var j5=Object.keys(pM);function H5(e){const t=Ro.getDefaultPublicParameters(),i=Ro.getDefaultColors();return new pN({line:{operation:e}},{series:[{type:"line"}]},t,i).resolve().operation}var ax={};gn(ax,{Color:()=>gt,interpolateColor:()=>FT});function G1(e,t,i,s){return{unit:e,step:t,epoch:i,utc:s,every(n){return G1(this.unit,(this.step??1)*n,this.epoch,this.utc)}}}var V1={};function mi(e,t=1,i,s=!1){X.warnOnce("time import is deprecated, use object notation instead");const n=`${e}:${t}:${i?.getTime()??0}:${s}`;let o=V1[n];return o==null&&(o=G1(e,t,i,s),V1[n]=o),o}var W5={get millisecond(){return mi("millisecond")},get second(){return mi("second")},get minute(){return mi("minute")},get hour(){return mi("hour")},get day(){return mi("day")},get monday(){return mi("day",7,new Date(1970,0,5))},get tuesday(){return mi("day",7,new Date(1970,0,6))},get wednesday(){return mi("day",7,new Date(1970,0,7))},get thursday(){return mi("day",7,new Date(1970,0,1))},get friday(){return mi("day",7,new Date(1970,0,2))},get saturday(){return mi("day",7,new Date(1970,0,3))},get sunday(){return mi("day",7,new Date(1970,0,4))},get month(){return mi("month")},get year(){return mi("year")},get utcMillisecond(){return mi("millisecond",1,void 0,!0)},get utcSecond(){return mi("second",1,void 0,!0)},get utcMinute(){return mi("minute",1,void 0,!0)},get utcHour(){return mi("hour",1,void 0,!0)},get utcDay(){return mi("day",1,void 0,!0)},get utcMonth(){return mi("month",1,void 0,!0)},get utcYear(){return mi("year",1,void 0,!0)}},A={};gn(A,{AGGREGATION_INDEX_X_MAX:()=>In,AGGREGATION_INDEX_X_MIN:()=>Ws,AGGREGATION_INDEX_Y_MAX:()=>io,AGGREGATION_INDEX_Y_MIN:()=>to,AGGREGATION_SPAN:()=>Ia,AbstractBarSeries:()=>e1,AbstractBarSeriesProperties:()=>GM,ActionOnSet:()=>Is,AnchoredPopover:()=>K1,Animation:()=>VT,AnimationManager:()=>UT,Arc:()=>Ca,Axis:()=>g0,AxisGroupZIndexMap:()=>BL,AxisInterval:()=>Sc,AxisLabel:()=>Dt,AxisTick:()=>Mc,AxisTickGenerator:()=>QL,BASE_FONT_SIZE:()=>Qa,BBox:()=>de,Background:()=>Rd,BackgroundModule:()=>mN,BandScale:()=>er,BarSeries:()=>bg,BarSeriesModule:()=>o1,BaseModuleInstance:()=>Wf,BaseProperties:()=>we,BaseToolbar:()=>vD,Border:()=>$c,ButtonWidget:()=>ip,CachedTextMeasurer:()=>QC,CachedTextMeasurerPool:()=>qr,CallbackCache:()=>WC,Caption:()=>Pt,CartesianAxis:()=>Dp,CartesianSeries:()=>Zc,CartesianSeriesNodeEvent:()=>AM,CartesianSeriesProperties:()=>bl,CategoryAxis:()=>bd,CategoryScale:()=>ld,ChangeDetectableProperties:()=>MM,Chart:()=>$y,ChartAxisDirection:()=>CS,ChartOptions:()=>rg,ChartUpdateType:()=>sp,CollapseMode:()=>ON,Color:()=>gt,ColorScale:()=>Gh,ConicGradient:()=>kC,ContextMenuBuiltins:()=>YT,ContextMenuRegistry:()=>KT,ContinuousScale:()=>ft,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>zd,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>_d,DEFAULT_POLAR_DIRECTION_KEYS:()=>A1,DEFAULT_POLAR_DIRECTION_NAMES:()=>I1,DEFAULT_TOOLTIP_CLASS:()=>Zi,DEFAULT_TOOLTIP_DARK_CLASS:()=>x2,DIRECTION_SWAP_AXES:()=>L2,DOMManager:()=>vT,DataController:()=>vL,DataModel:()=>bL,DataModelSeries:()=>DM,DataService:()=>yy,Debug:()=>Be,Deprecated:()=>$5,DeprecatedAndRenamedTo:()=>U5,DiscreteTimeAxis:()=>dw,DiscreteTimeScale:()=>wo,DragInterpreter:()=>iL,DraggablePopover:()=>Z1,DropShadow:()=>Aa,ExtendedPath2D:()=>jh,FILL_GRADIENT_CONIC_DEFAULTS:()=>TW,FILL_GRADIENT_LINEAR_DEFAULTS:()=>fd,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:()=>AW,FILL_GRADIENT_LINEAR_SHADED_DEFAULTS:()=>IW,FILL_GRADIENT_RADIAL_DEFAULTS:()=>tm,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:()=>jp,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:()=>CW,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:()=>kW,FILL_IMAGE_DEFAULTS:()=>Ic,FILL_PATTERN_DEFAULTS:()=>rr,FILL_PATTERN_HIERARCHY_DEFAULTS:()=>LW,FONT_SIZE:()=>kS,FONT_SIZE_RATIO:()=>bn,FillGradientDefaults:()=>Kn,FillImageDefaults:()=>Qs,FillPatternDefaults:()=>Tt,FloatingToolbar:()=>kY,FormatManager:()=>Jh,Gradient:()=>Jf,Group:()=>Re,GroupedCategoryAxis:()=>Bc,HdpiCanvas:()=>FS,HierarchyNode:()=>hY,HierarchySeries:()=>dY,HierarchySeriesProperties:()=>Ho,HighlightManager:()=>ZT,HighlightProperties:()=>nr,HighlightState:()=>a2,HighlightStyle:()=>Ap,Image:()=>Wd,InteractionManager:()=>WT,InteractionState:()=>HT,InterpolationProperties:()=>Gd,Invalidating:()=>Yu,LABEL_BOXING_DEFAULTS:()=>Qn,LARGEST_KEY_INTERVAL:()=>ew,LEGEND_CONTAINER_THEME:()=>E2,Label:()=>Vt,LayoutElement:()=>ZS,LayoutManager:()=>hL,LegendMarkerLabel:()=>Jn,Line:()=>Sn,LineSeries:()=>Sg,LineSeriesModule:()=>p1,LinearGradient:()=>CC,LinearScale:()=>Fc,LogScale:()=>J0,LonLatBBox:()=>uY,Marker:()=>wi,Menu:()=>DY,MenuItemWidget:()=>xD,MenuWidget:()=>U1,MercatorScale:()=>pY,ModuleRegistry:()=>Vs,Motion:()=>GS,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Eo,NativeWidget:()=>Xh,NewAreaSeriesModule:()=>JN,NewBarSeriesModule:()=>a1,NewBubbleSeriesModule:()=>h1,NewHistogramSeriesModule:()=>u1,NewLineSeriesModule:()=>g1,NewScatterSeriesModule:()=>f1,NiceMode:()=>NL,Node:()=>Ya,NumberAxis:()=>va,ObserveChanges:()=>Xr,OrdinalTimeScale:()=>dd,PHASE_METADATA:()=>lp,PHASE_ORDER:()=>ed,PREV_NEXT_KEYS:()=>Kh,Padding:()=>fc,ParallelStateMachine:()=>iH,Path:()=>ks,PointerEvents:()=>vC,PolarAxis:()=>jd,PolarSeries:()=>QM,PolarZIndexMap:()=>D1,Popover:()=>bD,PropertiesArray:()=>Ku,Property:()=>I,ProxyInteractionService:()=>kT,ProxyOnWrite:()=>TV,ProxyProperty:()=>Gi,ProxyPropertyOnWrite:()=>ni,QUICK_TRANSITION:()=>by,QuadtreeNearest:()=>IN,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>Em,RadialColumnShape:()=>ao,Range:()=>ya,Rect:()=>Ti,RepeatType:()=>GT,Rotatable:()=>Hh,RotatableGroup:()=>SV,RotatableText:()=>sT,SAFE_FILLS_OPERATION:()=>R0,SAFE_FILL_OPERATION:()=>MW,SAFE_RANGE2_OPERATION:()=>DW,SAFE_STROKE_FILL_OPERATION:()=>em,SKIP_JS_BUILTINS:()=>eS,SMALLEST_KEY_INTERVAL:()=>J2,SORT_DOMAIN_GROUPS:()=>tw,Scalable:()=>pS,ScalableGroup:()=>vV,ScaleAlignment:()=>DC,Scene:()=>fy,SceneArrayChangeDetection:()=>sS,SceneChangeDetection:()=>te,SceneObjectChangeDetection:()=>mn,SceneRefChangeDetection:()=>mC,Sector:()=>gs,SectorBox:()=>y1,Selection:()=>Ts,Series:()=>Hy,SeriesContentZIndexMap:()=>c2,SeriesGroupingChangedEvent:()=>jy,SeriesItemHighlightStyle:()=>sr,SeriesMarker:()=>Xi,SeriesNodeEvent:()=>Vy,SeriesNodePickMode:()=>d2,SeriesProperties:()=>Zn,SeriesTooltip:()=>fr,SeriesZIndexMap:()=>l2,Shape:()=>gi,SimpleTextMeasurer:()=>DS,SliderWidget:()=>RS,StateMachine:()=>up,StateMachineProperty:()=>tH,StopProperties:()=>cS,SvgPath:()=>$1,TRIPLE_EQ:()=>_h,Text:()=>xn,TextUtils:()=>ut,TextWrapper:()=>ep,ThemeConstants:()=>nT,ThemeSymbols:()=>T0,TimeAxisParentLevel:()=>Md,TimeScale:()=>hd,Toolbar:()=>AY,ToolbarButtonProperties:()=>Ag,ToolbarButtonWidget:()=>X1,ToolbarWidget:()=>gy,Tooltip:()=>Xn,TooltipManager:()=>Sy,TooltipPosition:()=>Ac,Transformable:()=>Gt,TransformableGroup:()=>$h,TransformableText:()=>Yh,Translatable:()=>Wh,TranslatableGroup:()=>As,TranslatableSvgPath:()=>SY,UnitTimeScale:()=>il,UpdateService:()=>dL,Vec2:()=>Hd,Vec4:()=>hp,WIDGET_HTML_EVENTS:()=>xS,Widget:()=>ua,WidgetEventUtil:()=>qa,ZIndexMap:()=>TT,ZoomManager:()=>cL,accumulateGroup:()=>sw,accumulateStack:()=>nw,accumulatedValue:()=>W2,accumulativeValueProperty:()=>K0,addEscapeEventListener:()=>hy,addHitTestersToQuadtree:()=>_M,addMouseCloseListener:()=>LS,addOverrideFocusVisibleEventListener:()=>NS,addTouchCloseListener:()=>wS,adjustLabelPlacement:()=>DN,aggregationDomain:()=>fg,aggregationIndexForXRatio:()=>EM,aggregationRangeFittingPoints:()=>wM,aggregationXRatioForDatumIndex:()=>NM,aggregationXRatioForXValue:()=>yr,angleBetween:()=>qf,angleCategoryAxisOptionsDefs:()=>pw,angleNumberAxisOptionsDefs:()=>uw,angularPadding:()=>oS,animationValidation:()=>qp,annotationCalloutStylesDefs:()=>Nw,annotationChannelStyleDefs:()=>oM,annotationChannelTextDefs:()=>kw,annotationCommentStylesDefs:()=>Ew,annotationCrossLineStyleDefs:()=>nM,annotationDisjointChannelStyleDefs:()=>Lw,annotationFibonacciStylesDefs:()=>aM,annotationLineStyleDefs:()=>Dm,annotationLineTextDefs:()=>Mm,annotationMeasurerStylesDefs:()=>Am,annotationNoteStylesDefs:()=>Ow,annotationOptionsDef:()=>Nd,annotationParallelChannelStyleDefs:()=>ww,annotationQuickMeasurerStylesDefs:()=>Pw,annotationShapeStylesDefs:()=>rM,annotationTextStylesDef:()=>Jp,applyShapeFillBBox:()=>h2,applyShapeStyle:()=>or,areScalingEqual:()=>Xc,area:()=>Y0,autoSizedLabelOptionsDefs:()=>ll,bezier2DDistance:()=>RC,bezier2DExtrema:()=>PC,boxPlotHighlightStyleOptionsDef:()=>cM,boxPlotSeriesThemeableOptionsDef:()=>Rw,boxPlotStyleOptionsDef:()=>lM,buildDateFormatter:()=>yc,buildResetPathFn:()=>FM,calculateDataDiff:()=>s1,calculateLabelTranslation:()=>yY,calculatePlacement:()=>p2,callWithContext:()=>Lo,candlestickSeriesThemeableOptionsDef:()=>Fw,cartesianAxisBandHighlightOptions:()=>Zp,cartesianAxisCrosshairOptions:()=>hl,cartesianAxisLabelOptionsDefs:()=>Yp,cartesianAxisOptionsDefs:()=>ur,cartesianChartOptionsDefs:()=>R1,cartesianCrossLineOptionsDefs:()=>hr,cartesianNumericAxisLabel:()=>j0,cartesianTimeAxisLabel:()=>Kp,cartesianTimeAxisParentLevel:()=>gm,checkCrisp:()=>i1,chordSeriesThemeableOptionsDef:()=>zw,clampArray:()=>cp,clippedRoundRect:()=>ly,collapsedStartingBarPosition:()=>Hm,commonAxisIntervalOptionsDefs:()=>H0,commonAxisLabelOptionsDefs:()=>dr,commonAxisOptionsDefs:()=>Rc,commonChartOptionsDefs:()=>Ne,commonCrossLineLabelOptionsDefs:()=>Pc,commonCrossLineOptionsDefs:()=>ba,commonSeriesOptionsDefs:()=>zo,commonSeriesThemeableOptionsDefs:()=>Ke,compactAggregationIndices:()=>PM,compareDates:()=>m0,computeBarFocusBounds:()=>HM,computeMarkerFocusBounds:()=>zm,coneFunnelSeriesThemeableOptionsDef:()=>_w,continuousAxisOptions:()=>md,countExpandingSearch:()=>QT,createAggregationIndices:()=>OM,createButton:()=>mY,createCheckbox:()=>xY,createDatumId:()=>pr,createDeprecationWarning:()=>dD,createIcon:()=>W1,createIdsGenerator:()=>M0,createSelect:()=>bY,createTextArea:()=>vY,dateToNumber:()=>Mn,dateTruncationForDomain:()=>y0,datesSortOrder:()=>b0,datumKeys:()=>Dy,datumStylerProperties:()=>Qr,deconstructSelectionsOrNodes:()=>vy,deepClone:()=>Ot,deepFreeze:()=>Ua,diff:()=>Qp,discreteTimeAxisIntervalOptionsDefs:()=>W0,drawCorner:()=>Ju,drawMarkerUnitPolygon:()=>kp,durationDay:()=>bc,durationHour:()=>xc,durationMinute:()=>el,durationMonth:()=>a0,durationSecond:()=>nd,durationWeek:()=>IL,durationYear:()=>pp,easing:()=>GS,enterpriseModule:()=>fl,errorBarOptionsDefs:()=>rm,errorBarThemeableOptionsDefs:()=>Hp,estimateTickCount:()=>KL,evaluateBezier:()=>Vh,expandLegendPosition:()=>Lm,extent:()=>dl,extractDecoratedProperties:()=>pC,fillsOptionsDef:()=>Wp,findMinMax:()=>Vi,findQuadtreeMatch:()=>jm,findRangeExtent:()=>td,fixNumericExtent:()=>vn,focusCursorAtEnd:()=>DV,formatNumber:()=>AT,formatObjectValidator:()=>z2,formatPercent:()=>MT,formatValue:()=>qh,fromToMotion:()=>Li,funnelSeriesThemeableOptionsDef:()=>Gw,getAngleRatioRadians:()=>SC,getColorStops:()=>LC,getCrossLineValue:()=>LL,getDateTicksForInterval:()=>S0,getDatumRefPoint:()=>jS,getElementBBox:()=>$C,getIconClassNames:()=>sy,getLabelStyles:()=>Da,getLastFocus:()=>py,getMissCount:()=>mL,getPath:()=>Jv,getPathComponents:()=>xL,getRadialColumnWidth:()=>_1,getSequentialColors:()=>Dn,getShapeFill:()=>pd,getShapeStyle:()=>ma,groupAccumulativeValueProperty:()=>pl,groupAverage:()=>H2,groupCount:()=>U0,groupStackValueProperty:()=>Q2,groupSum:()=>j2,hasNoModifiers:()=>tp,heatmapSeriesThemeableOptionsDef:()=>Vw,initMenuKeyNav:()=>gT,initRovingTabIndex:()=>pT,interpolatePoints:()=>Pm,interpolationOptionsDefs:()=>lm,intervalCeil:()=>kL,intervalEpoch:()=>xp,intervalExtent:()=>r0,intervalFloor:()=>$n,intervalHierarchy:()=>bp,intervalMilliseconds:()=>js,intervalNext:()=>TL,intervalPrevious:()=>CL,intervalRange:()=>Un,intervalRangeCount:()=>l0,intervalRangeStartIndex:()=>Ty,intervalStep:()=>tl,intervalUnit:()=>fa,isAgStandaloneChartOptions:()=>n2,isAgTopologyChartOptions:()=>s2,isBetweenAngles:()=>dc,isButtonClickEvent:()=>uy,isChartAxisDirection:()=>qV,isContinuous:()=>Ly,isDecoratedObject:()=>Zf,isDenseInterval:()=>cd,isGradientFill:()=>To,isGradientOrPatternFill:()=>mV,isImageFill:()=>gc,isInputPending:()=>UC,isObjectWithProperty:()=>yC,isObjectWithStringProperty:()=>UG,isPatternFill:()=>Yr,isProperties:()=>pc,isScaleValid:()=>pg,jsonApply:()=>Qu,jsonDiff:()=>Xa,jsonPropertyCompare:()=>YC,jsonWalk:()=>Zr,keyProperty:()=>ul,legendSymbolSvg:()=>m2,lineDistanceSquared:()=>ey,linearGaugeSeriesOptionsDef:()=>cl,linearGaugeSeriesThemeableOptionsDef:()=>dm,linearGaugeTargetOptionsDef:()=>cm,listDecoratedProperties:()=>Ur,lowestGranularityForInterval:()=>vp,lowestGranularityUnitForTicks:()=>f0,lowestGranularityUnitForValue:()=>Oy,makeAccessibleClickListener:()=>o4,makeSeriesTooltip:()=>Kc,mapLineBackgroundSeriesThemeableOptionsDef:()=>Ww,mapLineSeriesThemeableOptionsDef:()=>Hw,mapMarkerSeriesThemeableOptionsDef:()=>$w,mapShapeBackgroundSeriesThemeableOptionsDef:()=>Yw,mapShapeSeriesThemeableOptionsDef:()=>Uw,mapValues:()=>fC,markerFadeInAnimation:()=>yg,markerOptionsDefs:()=>cr,markerScaleInAnimation:()=>QN,markerSwipeScaleInAnimation:()=>RM,memo:()=>op,merge:()=>Wu,mergeArrayDefaults:()=>gC,mergeDefaults:()=>et,midpointStartingBarPosition:()=>C3,minimumTimeAxisDatumGranularity:()=>cw,moduleRegistry:()=>da,motion:()=>TY,multiSeriesHighlightStyle:()=>al,nearestSquared:()=>Yf,nearestSquaredInContainer:()=>jG,nextPowerOf2:()=>nj,nightingaleSeriesThemeableOptionsDef:()=>Kw,normaliseGroupTo:()=>ym,normalisePropertyTo:()=>mm,normalisedExtentWithMetadata:()=>$0,normalizeAngle180:()=>Xf,normalizeAngle360:()=>pi,normalizeAngle360FromDegrees:()=>Ka,normalizeAngle360Inclusive:()=>JG,normalizeContinuousDomains:()=>US,numberFormatValidator:()=>Fo,objectsEqual:()=>Ci,objectsEqualWith:()=>qv,ohlcSeriesThemeableOptionsDef:()=>jw,ordinalTimeAxisOptionsDefs:()=>Ld,pairUpSpans:()=>ug,partialAssign:()=>iS,pathFadeInAnimation:()=>_m,pathMotion:()=>wm,pathSwipeInAnimation:()=>BM,pick:()=>Qv,pickByMatchingAngle:()=>M1,plotAreaPathFill:()=>YN,plotInterpolatedAreaSeriesFillSpans:()=>Bm,plotInterpolatedLinePathStroke:()=>Rm,plotLinePathStroke:()=>CM,pointsEq:()=>gg,polarChartOptionsDefs:()=>B1,prepareAreaFillAnimationFns:()=>KN,prepareAreaPathAnimation:()=>ZN,prepareAxisAnimationContext:()=>EL,prepareAxisAnimationFunctions:()=>OL,prepareBarAnimationFunctions:()=>Wm,prepareLinePathAnimation:()=>UN,prepareLinePathPropertyAnimation:()=>LM,prepareLinePathStrokeAnimationFns:()=>TM,preparePieSeriesAnimationFunctions:()=>Qm,previousPowerOf2:()=>$S,processedDataIsAnimatable:()=>vd,pyramidSeriesThemeableOptionsDef:()=>Zw,radarAreaSeriesThemeableOptionsDef:()=>Xw,radarLineSeriesThemeableOptionsDef:()=>qw,radialBarSeriesThemeableOptionsDef:()=>Qw,radialColumnSeriesThemeableOptionsDef:()=>Jw,radialGaugeSeriesOptionsDef:()=>$p,radialGaugeSeriesThemeableOptionsDef:()=>um,radialGaugeTargetOptionsDef:()=>hm,radiusCategoryAxisOptionsDefs:()=>fw,radiusNumberAxisOptionsDefs:()=>gw,range:()=>Ry,rangeAreaSeriesThemeableOptionsDef:()=>eN,rangeBarSeriesThemeableOptionsDef:()=>tN,rangeValidator:()=>nm,rangedValueProperty:()=>q2,resetAxisFillSelectionFn:()=>RL,resetAxisGroupFn:()=>PL,resetAxisLabelSelectionFn:()=>Ey,resetAxisLineSelectionFn:()=>p0,resetBarSelectionsFn:()=>xg,resetLabelFn:()=>Yc,resetMarkerFn:()=>Fm,resetMarkerPositionFn:()=>mg,resetMotion:()=>ls,resetPieSelectionsFn:()=>S1,rowCountProperty:()=>Z2,sankeySeriesThemeableOptionsDef:()=>iN,scale:()=>Ns,sectorBox:()=>m1,seriesLabelFadeInAnimation:()=>oi,seriesLabelFadeOutAnimation:()=>Nm,seriesLabelOptionsDefs:()=>pt,setElementBBox:()=>iy,setPath:()=>tS,shadowOptionsDefs:()=>xa,shallowClone:()=>yS,simpleMemorize:()=>as,simpleMemorize2:()=>ap,singleSeriesHighlightStyle:()=>N2,solveBezier:()=>ty,sortAndUniqueDates:()=>x0,splitBezier2D:()=>Xu,standaloneChartOptionsDefs:()=>T5,staticFromToMotion:()=>tr,stopPageScrolling:()=>fT,sum:()=>WW,sumValues:()=>fm,sunburstSeriesThemeableOptionsDef:()=>sN,textOrSegments:()=>G0,tickFormat:()=>UL,timeInterval:()=>pm,timeIntervalUnit:()=>Up,toDegrees:()=>eV,toRadians:()=>os,toolbarButtonOptionsDefs:()=>Oc,tooltipContentAriaLabel:()=>v2,tooltipHtml:()=>D2,tooltipOptionsDefs:()=>tt,topologyChartOptionsDefs:()=>C5,trailingAccumulatedValue:()=>$2,trailingAccumulatedValueProperty:()=>ZW,treemapSeriesThemeableOptionsDef:()=>nN,updateClipPath:()=>Gm,updateLabelNode:()=>MN,validateCrossLineValue:()=>wL,valueProperty:()=>St,visibleRangeIndices:()=>qT,waterfallSeriesThemeableOptionsDef:()=>oN,without:()=>ce});function dD(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");X.warnOnce(i)}}function $5(e,t){const i=dD(),s=t?.default;return hc((n,o,a)=>(a!==s&&i(o.toString(),e),a))}function U5(e,t){const i=dD();return hc((s,n,o)=>(o!==s[e]&&(i(n.toString(),`Use [${e}] instead.`),tS(s,e,t?t(o):o)),Zv),(s,n)=>(i(n.toString(),`Use [${e}] instead.`),Jv(s,e)))}var Hd={add:Y5,angle:J5,apply:lY,equal:aY,distance:X5,distanceSquared:q5,from:rY,gradient:tY,intercept:iY,intersectAtX:nY,intersectAtY:sY,length:pD,lengthSquared:Z5,multiply:K5,normalized:Q5,origin:j1,required:cY,rotate:eY,round:oY,sub:uD};function Y5(e,t){return typeof t=="number"?{x:e.x+t,y:e.y+t}:{x:e.x+t.x,y:e.y+t.y}}function uD(e,t){return typeof t=="number"?{x:e.x-t,y:e.y-t}:{x:e.x-t.x,y:e.y-t.y}}function K5(e,t){return typeof t=="number"?{x:e.x*t,y:e.y*t}:{x:e.x*t.x,y:e.y*t.y}}function pD(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function Z5(e){return e.x*e.x+e.y*e.y}function X5(e,t){const i=uD(e,t);return Math.sqrt(i.x*i.x+i.y*i.y)}function q5(e,t){const i=uD(e,t);return i.x*i.x+i.y*i.y}function Q5(e){const t=pD(e);return{x:e.x/t,y:e.y/t}}function J5(e,t){return t==null?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)}function eY(e,t,i=j1()){const s=pD(e);return{x:i.x+s*Math.cos(t),y:i.y+s*Math.sin(t)}}function tY(e,t,i){const s=t.x-e.x;return(i==null?t.y-e.y:i-t.y-(i-e.y))/s}function iY(e,t,i){return(i==null?e.y:i-e.y)-t*e.x}function sY(e,t,i=0,s){return{x:e===1/0?1/0:(i-t)/e,y:s==null?i:s-i}}function nY(e,t,i=0,s){const n=e===1/0?1/0:e*i+t;return{x:i,y:s==null?n:s-n}}function oY(e,t=2){return{x:Uv(e.x,t),y:Uv(e.y,t)}}function aY(e,t){return e.x===t.x&&e.y===t.y}function rY(e,t){if(typeof e=="number")return{x:e,y:t};if("currentX"in e)return{x:e.currentX,y:e.currentY};if("offsetWidth"in e)return{x:e.offsetWidth,y:e.offsetHeight};if("width"in e)return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y+e.height}];if("x1"in e)return[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(e)}] [${t}]`)}function lY(e,t){return e.x=t.x,e.y=t.y,e}function cY(e){return{x:e?.x??0,y:e?.y??0}}function j1(){return{x:0,y:0}}var H1=class Lv{constructor(t,i,s,n,o,a,r,l,c){this.series=t,this.datumIndex=i,this.datum=s,this.sizeValue=n,this.colorValue=o,this.sumSize=a,this.depth=r,this.parent=l,this.children=c,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(t,i=Lv.Walk.PreOrder){i===Lv.Walk.PreOrder&&t(this),this.children.forEach(s=>{s.walk(t,i)}),i===Lv.Walk.PostOrder&&t(this)}*[Symbol.iterator](){yield this;for(const t of this.children)yield*t}};H1.Walk={PreOrder:0,PostOrder:1};var hY=H1,dY=class extends Hy{constructor(e){super({moduleCtx:e,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new Gh,this.animationState=new up("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}processData(){const{NodeClass:e}=this,{childrenKey:t,sizeKey:i,colorKey:s,colorRange:n}=this.properties;let o=0,a=1/0,r=-1/0;const l=(u,p,g)=>{const f=g.depth!=null?g.depth+1:0,x=t!=null?u[t]:void 0,m=x==null||x.length===0;let b=i!=null?u[i]:void 0;Number.isFinite(b)?b=Math.max(b,0):b=m?1:0;const v=b;o=Math.max(o,f);const S=s!=null?u[s]:void 0;return typeof S=="number"&&(a=Math.min(a,S),r=Math.max(r,S)),c(new e(this,p,u,b,S,v,f,g,[]),x)},c=(u,p)=>{const{datumIndex:g}=u;return p?.forEach((f,x)=>{const m=l(f,g.concat(x),u);u.children.push(m),u.sumSize+=m.sumSize}),u},h=c(new e(this,[],void 0,0,void 0,0,void 0,void 0,[]),this.data),d=[a,r];this.colorScale.domain=a<r?[a,r]:[0,1],this.colorScale.range=n??["black"],this.colorScale.update(),this.rootNode=h,this.maxDepth=o,this.colorDomain=d}update({seriesRect:e}){this.updateSelections(),this.updateNodes();const t=this.getAnimationData();this.checkResize(e)&&this.animationState.transition("resize",t),this.animationState.transition("update",t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}dataCount(){return NaN}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(e){const{colorKey:t,colorRange:i}=this.properties,{id:s,ctx:{legendManager:n},visible:o}=this;return e==="gradient"&&t!=null&&i!=null?[{legendType:"gradient",enabled:o&&n.getItemEnabled({seriesId:s}),seriesId:s,series:this.getFormatterContext("color"),colorRange:i,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(e){return e.datumIndex.join(":")}getDatumId(e){return this.getDatumIdFromData(e)}removeMeIndexPathForIndex(e){return this.datumSelection.at(e+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(e){for(const{index:t,datum:i}of this.datumSelection)if(jn(i.datumIndex,e))return t-1;return 0}pickFocus(e){if(!this.rootNode?.children.length)return;const t=ve(0,e.datumIndex-e.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=e;let n=this.removeMeIndexPathForIndex(t);const o=n.reduce((l,c)=>l.children[c],this.rootNode);if(s>0&&o.hasChildren)n=[...n,0];else if(s<0&&n.length>1)n=n.slice(0,-1);else if(s===0&&i!==0){const l=o.parent.children.length-1;n=n.slice(),n[n.length-1]=ve(0,n[n.length-1]+i,l)}const a=n.reduce((l,c)=>l.children[c],this.rootNode),r=this.computeFocusBounds(this.datumSelection.at(t+1));if(r!=null)return{datum:a,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:a.depth,bounds:r,clipFocusBox:!0}}getDatumAriaText(e,t){if(!(e instanceof this.NodeClass)){X.error(`datum is not HierarchyNode: ${JSON.stringify(e)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(e.depth??-1)+1,count:e.children.length,description:t})}getCategoryValue(e){}datumIndexForCategoryValue(e){}},Ho=class extends Zn{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(fi),this.fillGradientDefaults=new Kn,this.fillPatternDefaults=new Tt,this.fillImageDefaults=new Qs,this.strokes=Object.values(ar)}};M([I],Ho.prototype,"childrenKey",2),M([I],Ho.prototype,"sizeKey",2),M([I],Ho.prototype,"colorKey",2),M([I],Ho.prototype,"colorName",2),M([I],Ho.prototype,"fills",2),M([I],Ho.prototype,"fillGradientDefaults",2),M([I],Ho.prototype,"fillPatternDefaults",2),M([I],Ho.prototype,"fillImageDefaults",2),M([I],Ho.prototype,"strokes",2),M([I],Ho.prototype,"colorRange",2);var uY=class D_{constructor(t,i,s,n){this.lon0=t,this.lat0=i,this.lon1=s,this.lat1=n}extend(t,i,s,n){return this.lon0=Math.min(this.lon0,t),this.lat0=Math.min(this.lat0,i),this.lon1=Math.max(this.lon1,s),this.lat1=Math.max(this.lat1,n),this}merge(t){return this.extend(t.lon0,t.lat0,t.lon1,t.lat1)}static extend(t,i,s,n,o){return t?t.extend(i,s,n,o):new D_(i,s,n,o)}},rx=Math.PI/180,gD=e=>e*rx,fD=e=>-Math.log(Math.tan(Math.PI*.25+e*rx*.5)),yD=e=>e/rx,mD=e=>(Math.atan(Math.exp(-e))-Math.PI*.25)/(rx*.5),pY=class Ck extends Qf{constructor(t,i){super(),this.domain=t,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=Ck.bounds(t)}static bounds(t){const[[i,s],[n,o]]=t,a=gD(i),r=fD(s),l=gD(n),c=fD(o);return new de(Math.min(a,l),Math.min(r,c),Math.abs(l-a),Math.abs(c-r))}static fixedScale(){return new Ck([[yD(0),mD(0)],[yD(1),mD(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...t){let i=-1/0,s=1/0,n=-1/0,o=1/0;for(const a of t)for(const[r,l]of a)i=Math.min(r,i),s=Math.max(r,s),n=Math.min(l,n),o=Math.max(l,o);return{domain:[[i,n],[s,o]],animatable:!0}}convert([t,i]){const[[s,n],[o,a]]=this.range,r=(o-s)/this.bounds.width,l=(a-n)/this.bounds.height;return[(gD(t)-this.bounds.x)*r+s,(fD(i)-this.bounds.y)*l+n]}invert([t,i]){const[[s,n],[o,a]]=this.range,r=(o-s)/this.bounds.width,l=(a-n)/this.bounds.height;return[yD((t-s)/r+this.bounds.x),mD((i-n)/l+this.bounds.y)]}},gY={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}},fY={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 yY({yDirection:e,padding:t=0,position:i="top",bbox:s}){const n=e?gY:fY,{xTranslationDirection:o,yTranslationDirection:a}=n[i],r=o*(t+s.width/2),l=a*(t+s.height/2);return{xTranslation:r,yTranslation:l}}function mY(e,t){const i=ke("button",lx("ag-charts-input ag-charts-button",t));return e.label!==void 0?i.append(e.label):(i.append(W1(e.icon)),i.ariaLabel=e.altText),i.addEventListener("click",e.onPress),ca(i,t),i}function xY(e,t){const i=ke("input",lx("ag-charts-input ag-charts-checkbox",t));return i.type="checkbox",i.checked=e.checked,i.addEventListener("change",s=>e.onChange(i.checked,s)),i.addEventListener("keydown",s=>{uy(s)&&(s.preventDefault(),i.click())}),ca(i,t),i}function bY(e,t){const i=ke("select",lx("ag-charts-input ag-charts-select",t));return i.append(...e.options.map(s=>{const n=ke("option");return n.value=s.value,n.textContent=s.label,n})),Ge(i,"data-preventdefault",!1),i.value=e.value,i.addEventListener("change",s=>e.onChange(i.value,s)),ca(i,t),i}function vY(e,t){const i=ke("textarea",lx("ag-charts-input ag-charts-textarea",t));return i.value=e.value,i.addEventListener("input",s=>e.onChange(i.value,s)),ca(i,t),Ge(i,"data-preventdefault",!1),i}function W1(e){const t=ke("span",`ag-charts-icon ag-charts-icon-${e}`);return Ge(t,"aria-hidden",!0),t}function lx(e,t){return t==null?e:`${e} ${t.class}`}var $1=class extends ks{constructor(e=""){super(),this._d="",this.d=e}get d(){return this._d}set d(e){e!==this._d&&(this._d=e,this.path.clear(),this.path.appendSvg(e),this.checkPathDirty())}},SY=class extends Wh($1){isPointInPath(e,t){return super.isPointInPath(e-this.translationX,t-this.translationY)}},Wd=class extends Ya{constructor(e){super(),this.sourceImage=e,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(e){const{ctx:t}=e,i=this.sourceImage;i&&(t.globalAlpha=this.opacity,t.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(e)}};M([te()],Wd.prototype,"x",2),M([te()],Wd.prototype,"y",2),M([te()],Wd.prototype,"width",2),M([te()],Wd.prototype,"height",2),M([te()],Wd.prototype,"opacity",2);var Dg={};gn(Dg,{ButtonWidget:()=>ip,MenuItemWidget:()=>xD,MenuWidget:()=>U1,NativeWidget:()=>Xh,SliderWidget:()=>RS,ToolbarWidget:()=>gy,WIDGET_HTML_EVENTS:()=>xS,Widget:()=>ua,WidgetEventUtil:()=>qa});var xD=class extends ST{constructor(){super(ke("div"),"menuitem")}},MY=["Escape","ArrowLeft"],U1=class A_ extends OS{constructor(t="vertical"){super(t,"menu"),this.closeSubMenu=i=>this.openSubMenu(i,void 0)}destructor(){this.selfClose("2")}addSeparator(){const t=oa().createElement("div");return Ge(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 t=new xD,i=cc(),s=new A_(this.orientation),n=a=>{t.isDisabled()||this.openSubMenu(a,s)},o=a=>{tp(a.sourceEvent)&&a.sourceEvent.code==="ArrowRight"&&n(a)};return t.setAriaHasPopup("menu"),t.setAriaExpanded(!1),t.setAriaControls(i),t.addListener("click",n),t.addListener("mouseenter",n),t.addListener("keydown",o),s.addListener("close-widget",()=>t.setAriaExpanded(!1)),s.addListener("open-widget",()=>t.setAriaExpanded(!0)),s.id=i,this.addChild(t),{subMenuButton:t,subMenu:s}}openSubMenu(t,i){const{openScope:s}=this;s&&(s.openSubMenu?.selfClose("4"),i?.open(t),s.openSubMenu=i)}open(t,i){if(this.openScope!=null)return;this.openScope={lastFocus:py(t.sourceEvent),openSubMenu:void 0,abort:()=>this.selfClose("1"),close:()=>this.selfClose("0"),removers:new mt};const s=this.openScope,n=this.children.map(o=>o.getElement());Ge(s.lastFocus,"aria-expanded",!0),s.removers.register(LS(this.elem,s.abort),wS(this.elem,s.abort),...this.children.map(o=>hy(o.getElement(),s.close,MY)),i?.overrideFocusVisible&&NS(this.elem,n,i.overrideFocusVisible)),this.internalListener?.dispatch("open-widget",this,{type:"open-widget"}),this.children[0]?.focus({preventScroll:!0})}selfClose(t){if(this.openScope===void 0)return;const{lastFocus:i,removers:s,openSubMenu:n}=this.openScope;this.openScope=void 0,n?.selfClose("3"),Ge(i,"aria-expanded",!1),t==="0"&&i?.focus({preventScroll:!0}),s.flush(),this.internalListener?.dispatch("close-widget",this,{type:"close-widget"})}close(){this.selfClose("0")}},Y1="canvas-overlay",bD=class extends Wf{constructor(e,t,i){super(),this.ctx=e,this.hideFns=[],this.moduleId=`popover-${t}`,i?.detached?this.element=ke("div"):this.element=e.domManager.addChild(Y1,this.moduleId),this.element.setAttribute("role","presentation"),this.cleanup.register(()=>e.domManager.removeChild(Y1,this.moduleId))}attachTo(e){this.element.parentElement||e.element.append(this.element)}hide(e){const{lastFocus:t=this.lastFocus}=e??{};this.element.children.length!==0&&(this.hideFns.forEach(i=>i()),t?.focus(),this.lastFocus=void 0)}removeChildren(){this.element.replaceChildren()}showWithChildren(e,t){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");const i=ke("div","ag-charts-popover");if(t.ariaLabel!=null&&i.setAttribute("aria-label",t.ariaLabel),t.class!=null&&i.classList.add(t.class),i.replaceChildren(...e),this.element.replaceChildren(i),this.hideFns.push(()=>this.removeChildren()),t.onHide&&this.hideFns.push(t.onHide),t.initialFocus&&t.sourceEvent){const s=py(t.sourceEvent);s!==void 0&&(this.lastFocus=s,this.initialFocus=t.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(e){const t=this.getPopoverElement();t&&(t.style.setProperty("right","unset"),t.style.setProperty("bottom","unset"),e.x!=null&&t.style.setProperty("left",`${Math.floor(e.x)}px`),e.y!=null&&t.style.setProperty("top",`${Math.floor(e.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},K1=class extends bD{setAnchor(e,t){this.anchor=e,this.fallbackAnchor=t,this.updatePosition(e),this.repositionWithinBounds()}showWithChildren(e,t){const i=t.anchor??this.anchor,s=t.fallbackAnchor??this.fallbackAnchor,n=super.showWithChildren(e,t);return i&&this.setAnchor(i,s),Ze().requestAnimationFrame(()=>{this.repositionWithinBounds()}),n}repositionWithinBounds(){const{anchor:e,ctx:t,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!e||!s)return;const n=t.domManager.getBoundingClientRect(),{offsetWidth:o,offsetHeight:a}=s;let r=ve(0,e.x,n.width-o),l=ve(0,e.y,n.height-a);r!==e.x&&i?.x!=null&&(r=ve(0,i.x-o,n.width-o)),l!==e.y&&i?.y!=null&&(l=ve(0,i.y-a,n.height-a)),this.updatePosition({x:r,y:l})}},DY=class extends K1{show(e){const t=e.items.map(s=>this.createRow(e,s)),i=this.showWithChildren(t,e);i.classList.add("ag-charts-menu"),i.setAttribute("role","menu"),this.menuCloser=gT({orientation:"vertical",menu:i,buttons:t,sourceEvent:e.sourceEvent,closeCallback:()=>this.hide()}),this.hideFns.push(()=>{this.menuCloser?.finishClosing(),this.menuCloser=void 0})}createRow(e,t){const{menuItemRole:i="menuitem"}=e,s=t.value===e.value,n=ke("div","ag-charts-menu__row");if(n.setAttribute("role",i),i==="menuitemradio"&&n.setAttribute("aria-checked",(e.value===t.value).toString()),typeof t.value=="string"&&(n.dataset.popoverId=t.value),n.classList.toggle("ag-charts-menu__row--active",s),t.icon!=null){const l=ke("span",`ag-charts-menu__icon ${sy(t.icon)}`);n.appendChild(l)}const o=t.strokeWidth!=null;if(o&&(n.classList.toggle("ag-charts-menu__row--stroke-width-visible",o),n.style.setProperty("--strokeWidth",o?`${t.strokeWidth}px`:null)),t.label!=null){const l=ke("span","ag-charts-menu__label");l.textContent=this.ctx.localeManager.t(t.label),n.appendChild(l)}"altText"in t&&(n.ariaLabel=this.ctx.localeManager.t(t.altText));const a=()=>{e.onPress?.(t)},r=l=>{uy(l)&&(a(),l.preventDefault(),l.stopPropagation())};return n.addEventListener("keydown",r),n.addEventListener("click",r),n.addEventListener("mousemove",()=>{n.focus({preventScroll:!0})}),n}},Z1=class extends bD{constructor(){super(...arguments),this.dragged=!1}setDragHandle(e){e.addListener("drag-start",t=>{e.addClass(this.dragHandleDraggingClass),this.onDragStart(t)}),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",()=>{e.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(e){const t=this.getPopoverElement();t&&(e.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:Hd.from(e.clientX,e.clientY),position:Hd.from(Number(t.style.getPropertyValue("left").replace("px","")),Number(t.style.getPropertyValue("top").replace("px","")))})}onDragMove(e){const{dragStartState:t}=this,i=this.getPopoverElement();if(!t||!i)return;const s=Hd.sub(Hd.from(e.clientX,e.clientY),t.client),n=Hd.add(t.position,s),o=this.ctx.domManager.getBoundingClientRect(),a={};n.x>=0&&n.x+i.offsetWidth<=o.width&&(a.x=n.x),n.y>=0&&n.y+i.offsetHeight<=o.height&&(a.y=n.y),this.updatePosition(a)}onDragEnd(){this.dragStartState=void 0}},Ag=class extends we{};M([I],Ag.prototype,"icon",2),M([I],Ag.prototype,"label",2),M([I],Ag.prototype,"ariaLabel",2),M([I],Ag.prototype,"tooltip",2);var X1=class extends ip{constructor(e){super(),this.localeManager=e}update(e){const{localeManager:t}=this;e.tooltip&&(this.elem.title=t.t(e.tooltip));let i="";if(e.icon!=null&&(i=`<span class="${sy(e.icon)} ag-charts-toolbar__icon"></span>`),e.label!=null){const s=t.t(e.label);i=`${i}<span class="ag-charts-toolbar__label">${s}</span>`}this.elem.innerHTML=i}setChecked(e){Ge(this.elem,"aria-checked",e)}},q1="ag-charts-toolbar__button--active",vD=class extends gy{constructor({eventsHub:e,localeManager:t},i,s){super(s),this.ariaLabelId=i,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new NT,this.hasPrefix=!1,this.buttonWidgets=[],this.updateAriaLabel=()=>this.setAriaLabel(this.localeManager.t(this.ariaLabelId)),this.eventsHub=e,this.localeManager=t,this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",s==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",s==="vertical"),this.eventsHub.on("locale:change",this.updateAriaLabel),this.updateAriaLabel()}setAriaLabelId(e){this.ariaLabelId=e,this.updateAriaLabel()}addToolbarListener(e,t){return this.events.addListener(e,t)}clearButtons(){for(const e of this.buttonWidgets)e.destroy();this.buttonWidgets.splice(0)}updateButtons(e){const{buttonWidgets:t}=this;for(const[i,s]of e.entries())(this.buttonWidgets.at(i)??this.createButton(i,s)).update(s);for(let i=e.length;i<t.length;i++)this.buttonWidgets.at(i)?.destroy();this.buttonWidgets.splice(e.length),this.refreshButtonClasses()}updateButtonByIndex(e,t){this.buttonWidgets.at(e)?.update(t)}clearActiveButton(){for(const e of this.buttonWidgets)e.toggleClass(q1,!1)}toggleActiveButtonByIndex(e){if(e!==-1)for(const[t,i]of this.buttonWidgets.entries())i.toggleClass(q1,e!=null&&e===t)}toggleButtonEnabledByIndex(e,t){e!==-1&&this.buttonWidgets.at(e)?.setEnabled(t)}toggleSwitchCheckedByIndex(e,t){e!==-1&&this.buttonWidgets.at(e)?.setChecked(t)}getButtonBounds(){return this.buttonWidgets.map(e=>this.getButtonWidgetBounds(e))}setButtonHiddenByIndex(e,t){this.buttonWidgets.at(e)?.setHidden(t)}getButtonWidgetBounds(e){const t=this.getBounds(),i=e.getBounds();return new de(i.x+t.x,i.y+t.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:e,hasPrefix:t}=this;let i,s,n;for(const[o,a]of e.entries())i=!t&&o===0||n!=a.section,s=o===e.length-1||a.section!=e.at(o+1)?.section,a.toggleClass("ag-charts-toolbar__button--first",i),a.toggleClass("ag-charts-toolbar__button--last",s),a.toggleClass("ag-charts-toolbar__button--gap",o>0&&i),n=a.section}createButton(e,t){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const n={index:e,...t instanceof we?t.toJson():t},o=this.getButtonWidgetBounds(i);this.events.dispatch("button-pressed",{event:s,button:n,buttonBounds:o})}),i.addListener("focus",()=>{this.events.dispatch("button-focused",{button:{index:e}})}),t.section&&(i.section=t.section),this.buttonWidgets.push(i),this.addChild(i),i}},AY=class extends vD{createButtonWidget(){return new X1(this.localeManager)}},IY=class extends Z1{constructor(e,t,i){super(e,t),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(e,t={}){this.showWithChildren(e,{...t,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const e=this.getPopoverElement();return new de(e?.offsetLeft??0,e?.offsetTop??0,e?.offsetWidth??0,e?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(e,t,i){const s=this.getPopoverElement();if(!s)return;const n=e.position??"above",{offsetWidth:o,offsetHeight:a}=s;let r=e.y-a-i,l=e.x-o/2;n==="below"?r=e.y+i:n==="right"?(r=e.y-a/2,l=e.x+t):n==="above-left"&&(l=e.x),this.updatePosition({x:l,y:r})}ignorePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="none")}capturePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="unset")}updatePosition(e){const t=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();e.x=Math.floor(ve(0,e.x,i.width-t.width)),e.y=Math.floor(ve(0,e.y,i.height-t.height)),super.updatePosition(e),this.onPopoverMoved()}},kY=class extends vD{constructor(e,t,i){super(e,t,"horizontal"),this.hasPrefix=!0,this.popover=new IY(e,i,this.onPopoverMoved.bind(this)),this.dragHandle=new CY(e.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}destroy(){super.destroy(),this.popover.destroy()}show(e={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],e)}hide(){this.popover.hide()}setAnchor(e){this.popover.setAnchor(e,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const e=this.popover.getBounds();if(this.popoverBounds?.equals(e))return;this.popoverBounds=e.clone();const t=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:e,buttonBounds:t})}getButtonWidgetBounds(e){const t=this.popover.getBounds(),i=super.getButtonWidgetBounds(e),s=this.dragHandle.getBounds();return new de(i.x+t.x-s.width,i.y+t.y,i.width,i.height)}},CY=class extends Xh{constructor(e){super(ke("div","ag-charts-floating-toolbar__drag-handle"));const t=new Xh(ke("span",`${sy("drag-handle")} ag-charts-toolbar__icon`));t.setAriaHidden(!0),this.addChild(t),this.elem.title=e}},TY={...ML,...DL},LY={VERSION:Ja,_Scene:nx,_Theme:ox,_Util:ax,create:oo.create.bind(oo),createSparkline:oo.__createSparkline.bind(oo),setup:ex,isEnterprise:!1},wY=Object.defineProperty,NY=Object.getOwnPropertyDescriptor,y=(e,t,i,s)=>{for(var n=s>1?void 0:s?NY(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(n=(s?a(t,i,n):a(n))||n);return s&&n&&wY(t,i,n),n},EY=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let i=e[0],s=e[1],n=e[2],o=e[3];i=this.ff(i,s,n,o,t[0],7,-680876936),o=this.ff(o,i,s,n,t[1],12,-389564586),n=this.ff(n,o,i,s,t[2],17,606105819),s=this.ff(s,n,o,i,t[3],22,-1044525330),i=this.ff(i,s,n,o,t[4],7,-176418897),o=this.ff(o,i,s,n,t[5],12,1200080426),n=this.ff(n,o,i,s,t[6],17,-1473231341),s=this.ff(s,n,o,i,t[7],22,-45705983),i=this.ff(i,s,n,o,t[8],7,1770035416),o=this.ff(o,i,s,n,t[9],12,-1958414417),n=this.ff(n,o,i,s,t[10],17,-42063),s=this.ff(s,n,o,i,t[11],22,-1990404162),i=this.ff(i,s,n,o,t[12],7,1804603682),o=this.ff(o,i,s,n,t[13],12,-40341101),n=this.ff(n,o,i,s,t[14],17,-1502002290),s=this.ff(s,n,o,i,t[15],22,1236535329),i=this.gg(i,s,n,o,t[1],5,-165796510),o=this.gg(o,i,s,n,t[6],9,-1069501632),n=this.gg(n,o,i,s,t[11],14,643717713),s=this.gg(s,n,o,i,t[0],20,-373897302),i=this.gg(i,s,n,o,t[5],5,-701558691),o=this.gg(o,i,s,n,t[10],9,38016083),n=this.gg(n,o,i,s,t[15],14,-660478335),s=this.gg(s,n,o,i,t[4],20,-405537848),i=this.gg(i,s,n,o,t[9],5,568446438),o=this.gg(o,i,s,n,t[14],9,-1019803690),n=this.gg(n,o,i,s,t[3],14,-187363961),s=this.gg(s,n,o,i,t[8],20,1163531501),i=this.gg(i,s,n,o,t[13],5,-1444681467),o=this.gg(o,i,s,n,t[2],9,-51403784),n=this.gg(n,o,i,s,t[7],14,1735328473),s=this.gg(s,n,o,i,t[12],20,-1926607734),i=this.hh(i,s,n,o,t[5],4,-378558),o=this.hh(o,i,s,n,t[8],11,-2022574463),n=this.hh(n,o,i,s,t[11],16,1839030562),s=this.hh(s,n,o,i,t[14],23,-35309556),i=this.hh(i,s,n,o,t[1],4,-1530992060),o=this.hh(o,i,s,n,t[4],11,1272893353),n=this.hh(n,o,i,s,t[7],16,-155497632),s=this.hh(s,n,o,i,t[10],23,-1094730640),i=this.hh(i,s,n,o,t[13],4,681279174),o=this.hh(o,i,s,n,t[0],11,-358537222),n=this.hh(n,o,i,s,t[3],16,-722521979),s=this.hh(s,n,o,i,t[6],23,76029189),i=this.hh(i,s,n,o,t[9],4,-640364487),o=this.hh(o,i,s,n,t[12],11,-421815835),n=this.hh(n,o,i,s,t[15],16,530742520),s=this.hh(s,n,o,i,t[2],23,-995338651),i=this.ii(i,s,n,o,t[0],6,-198630844),o=this.ii(o,i,s,n,t[7],10,1126891415),n=this.ii(n,o,i,s,t[14],15,-1416354905),s=this.ii(s,n,o,i,t[5],21,-57434055),i=this.ii(i,s,n,o,t[12],6,1700485571),o=this.ii(o,i,s,n,t[3],10,-1894986606),n=this.ii(n,o,i,s,t[10],15,-1051523),s=this.ii(s,n,o,i,t[1],21,-2054922799),i=this.ii(i,s,n,o,t[8],6,1873313359),o=this.ii(o,i,s,n,t[15],10,-30611744),n=this.ii(n,o,i,s,t[6],15,-1560198380),s=this.ii(s,n,o,i,t[13],21,1309151649),i=this.ii(i,s,n,o,t[4],6,-145523070),o=this.ii(o,i,s,n,t[11],10,-1120210379),n=this.ii(n,o,i,s,t[2],15,718787259),s=this.ii(s,n,o,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(s,e[1]),e[2]=this.add32(n,e[2]),e[3]=this.add32(o,e[3])}cmn(e,t,i,s,n,o){return t=this.add32(this.add32(t,e),this.add32(s,o)),this.add32(t<<n|t>>>32-n,i)}ff(e,t,i,s,n,o,a){return this.cmn(t&i|~t&s,e,t,n,o,a)}gg(e,t,i,s,n,o,a){return this.cmn(t&s|i&~s,e,t,n,o,a)}hh(e,t,i,s,n,o,a){return this.cmn(t^i^s,e,t,n,o,a)}ii(e,t,i,s,n,o,a){return this.cmn(i^(t|~s),e,t,n,o,a)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=e.length;s+=64)this.md5cycle(i,this.md5blk(e.substring(s-64,s)));e=e.substring(s-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s<e.length;s++)n[s>>2]|=e.charCodeAt(s)<<(s%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,n),s=0;s<16;s++)n[s]=0;return n[14]=t*8,this.md5cycle(i,n),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",s=0;for(;s<4;s++)i+=t[e>>s*8+4&15]+t[e>>s*8&15];return i}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const i=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(i>>16)<<16|i&65535}};function SD(e){return e==null||e.length===0}var cx={"01":"GRID","02":"CHARTS","0102":"BOTH"},Q1="https://www.ag-grid.com/charts/licensing/",MD=class zi{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new EY,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(zi.licenseKey,zi.gridContext),i=`AG ${t.currentLicenseType==="BOTH"?"Grid and ":""}Charts Enterprise`;let s="";if(t.suppliedLicenseType==="BOTH"?s="AG Grid and AG Charts Enterprise":t.suppliedLicenseType==="GRID"?s="AG Grid Enterprise":t.suppliedLicenseType!==void 0&&(s="AG Charts Enterprise"),t.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(t.expired){const n=zi.getChartsReleaseDate(),o=zi.formatDate(n);this.outputExpiredKey(t.expiry,o,s)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,s):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,s)}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(zi.decode(i),10))}static extractLicenseComponents(t){let i=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const s=i.length-32,n=i.substring(s),o=i.substring(0,s),[a,r,l]=zi.extractBracketedInformation(i);return{md5:n,license:o,version:a,isTrial:r,type:l}}getLicenseDetails(t,i=!1){const s="CHARTS";if(SD(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};const n=zi.getChartsReleaseDate(),{md5:o,license:a,version:r,isTrial:l,type:c}=zi.extractLicenseComponents(t);let h=o===this.md5.md5(a)&&t.indexOf("For_Trialing_ag-Grid_Only")===-1,d,u,p=null,g=!1,f;function x(){d=p<new Date,u=void 0}if(h&&(p=zi.extractExpiry(a),h=!isNaN(p.getTime()),h))switch(u=n>p,r){case"legacy":case"2":{h=!1;break}case"3":SD(c)?h=!1:(f=c,c!==cx["02"]&&c!==cx["0102"]?(h=!1,g=!0):l&&x())}return h?{licenseKey:t,valid:h,expiry:zi.formatDate(p),expired:u,version:r,isTrial:l,trialExpired:d,invalidLicenseTypeForCombo:i?f!=="BOTH":void 0,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:f}:{licenseKey:t,valid:h,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:f}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isE2ETest()&&!this.isWebsiteUrl()&&!SD(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getHostname(){if(!this.document)return"localhost";const t=this.document.defaultView??window;if(!t)return"localhost";const i=t.location,{hostname:s=""}=i;return s}isForceWatermark(){if(!this.document)return!1;const t=this.document?.defaultView??typeof window<"u"?window:void 0;if(!t)return!1;const{pathname:i}=t.location;return i?i.indexOf("forceWatermark")!==-1:!1}isWebsiteUrl(){const t=this.getHostname();return/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(t)!==null}isLocalhost(){const t=this.getHostname();return/^(?:127\.0\.0\.1|localhost)$/.exec(t)!==null}isE2ETest(){const t=this.getHostname();return/^(?:172\.17\.0\.1|host\.docker\.internal)$/.exec(t)!==null}static formatDate(t){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=t.getDate(),n=t.getMonth(),o=t.getFullYear();return s+" "+i[n]+" "+o}static getChartsReleaseDate(){return new Date(parseInt(zi.decode(zi.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s="",n,o,a,r,l,c,h,d=0;const u=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;d<u.length;)r=i.indexOf(u.charAt(d++)),l=i.indexOf(u.charAt(d++)),c=i.indexOf(u.charAt(d++)),h=i.indexOf(u.charAt(d++)),n=r<<2|l>>4,o=(l&15)<<4|c>>2,a=(c&3)<<6|h,s=s+String.fromCharCode(n),c!=64&&(s=s+String.fromCharCode(o)),h!=64&&(s=s+String.fromCharCode(a));return s=zi.utf8_decode(s),s}static utf8_decode(t){t=t.replace(/rn/g,"n");let i="";for(let s=0;s<t.length;s++){const n=t.charCodeAt(s);n<128?i+=String.fromCharCode(n):n>127&&n<2048?(i+=String.fromCharCode(n>>6|192),i+=String.fromCharCode(n&63|128)):(i+=String.fromCharCode(n>>12|224),i+=String.fromCharCode(n>>6&63|128),i+=String.fromCharCode(n&63|128))}return i}static setGridContext(t=!1){zi.gridContext=t}static setLicenseKey(t){zi.licenseKey=t}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const i=t.match(/\[(.*?)\]/g).map(r=>r.replace("[","").replace("]",""));if(!i||i.length===0)return["legacy",!1,void 0];const s=i.filter(r=>r==="TRIAL").length===1,n=i.filter(r=>r.startsWith("v"))[0],o=n?n.replace("v",""):"legacy",a=cx[i.filter(r=>cx[r])[0]];return[o,s,a]}centerPadAndOutput(t){const i=this.totalMessageLength-t.length;console.error(t.padStart(i/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,i="*",s=""){console.error(t.padEnd(this.totalMessageLength-s.length,i)+s)}outputInvalidLicenseKey(t,i,s){zi.gridContext||(t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${s} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${Q1}.`," ","*"),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 ${Q1}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,i,s){zi.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${s} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){zi.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,i,s){zi.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${s} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};MD.RELEASE_INFORMATION="MTc1NDM4MTgyMTg0OA==",MD.gridContext=!1;var $d=MD;function DD(e,t,i){const s=(o,a,r,l)=>{let c=e[0];for(let h=o;r>0?h<=a:h>a;h+=r){const d=e[h];if(l(c,d))return!0;c=d}return!1},n=Math.floor(e.length/2);return s(t,n,t,i)?!0:s(e.length-t,n,-t,i)}var{AxisInterval:OY,Property:PY}=A,AD=class extends OY{};y([PY],AD.prototype,"minSpacing",2);var{BaseProperties:J1,ChartAxisDirection:RY,Property:ai,Group:ID,FONT_SIZE:BY}=A,Wo=class extends J1{constructor(){super(...arguments),this.fontSize=BY.LARGE,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};y([ai],Wo.prototype,"enabled",2),y([ai],Wo.prototype,"text",2),y([ai],Wo.prototype,"fontStyle",2),y([ai],Wo.prototype,"fontWeight",2),y([ai],Wo.prototype,"fontSize",2),y([ai],Wo.prototype,"fontFamily",2),y([ai],Wo.prototype,"padding",2),y([ai],Wo.prototype,"color",2),y([ai],Wo.prototype,"parallel",2);var $s=class extends J1{constructor(){super(...arguments),this.id=ns(this),this.defaultColorRange=[],this.shape="polygon",this.label=new Wo,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=RY.Angle,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new ID({name:this.id}),this.rangeGroup=new ID({name:this.id}),this.labelGroup=new ID({name:this.id}),this._isRange=void 0}assignCrossLineGroup(e,t){e!==this._isRange&&(e?this.rangeGroup.appendChild(t):this.lineGroup.appendChild(t)),this._isRange=e}setSectorNodeProps(e){e.fill=this.fill,e.fillOpacity=this.fillOpacity??1,e.stroke=this.stroke,e.strokeOpacity=this.strokeOpacity??1,e.strokeWidth=this.strokeWidth??1,e.lineDash=this.lineDash}setLabelNodeProps(e,t,i,s,n){const{label:o}=this;e.x=t,e.y=i,e.text=o.text,e.textAlign="center",e.textBaseline=s,e.rotation=n,e.rotationCenterX=t,e.rotationCenterY=i,e.fill=o.color,e.fontFamily=o.fontFamily,e.fontSize=o.fontSize,e.fontStyle=o.fontStyle,e.visible=!0}};y([ai],$s.prototype,"enabled",2),y([ai],$s.prototype,"type",2),y([ai],$s.prototype,"range",2),y([ai],$s.prototype,"value",2),y([ai],$s.prototype,"defaultColorRange",2),y([ai],$s.prototype,"fill",2),y([ai],$s.prototype,"fillOpacity",2),y([ai],$s.prototype,"stroke",2),y([ai],$s.prototype,"strokeWidth",2),y([ai],$s.prototype,"strokeOpacity",2),y([ai],$s.prototype,"lineDash",2),y([ai],$s.prototype,"shape",2),y([ai],$s.prototype,"label",2);var{ChartAxisDirection:FY,getCrossLineValue:zY,validateCrossLineValue:_Y,normalizeAngle360:kD,Group:GY,Path:eE,Sector:VY,RotatableText:jY,ContinuousScale:HY}=A,CD=class extends $s{constructor(){super(),this.direction=FY.Angle,this.polygonNode=new eE,this.sectorNode=new VY,this.lineNode=new eE,this.crossLineRange=new GY,this.labelNode=new jY,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!HY.is(this.scale))return!0;const[e,t]=this.scale.domain,i=zY(this);if(this.type==="range"){const[s,n]=i;return s>=e&&s<=t&&n>=s&&n<=t}else return i>=e&&i<=t}update(e){const{scale:t}=this;if(!t||!_Y(this,t)||!this.visibilityCheck()){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateLineNode(e),this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e)}updateLineNode(e){const{scale:t,type:i,value:s,lineNode:n}=this;if(!e||i!=="line"||!t){n.visible=!1;return}const o=t.convert(s);if(isNaN(o)){n.visible=!1;return}const{axisInnerRadius:a,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(o),c=r*Math.sin(o),h=a*Math.cos(o),d=a*Math.sin(o);n.path.clear(!0),n.path.moveTo(h,d),n.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(e){const{polygonNode:t,range:i,scale:s,shape:n,type:o,ticks:a}=this;if(!e||o!=="range"||n!=="polygon"||!s||!i){t.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:l}=this,c=a.indexOf(i[0]),h=a.indexOf(i[1]),u=(c<=h?a.slice(c,h+1):a.slice(c).concat(a.slice(0,h+1))).map(g=>s.convert(g));t.visible=!0,this.setSectorNodeProps(t);const{path:p}=t;p.clear(!0),u.forEach((g,f)=>{const x=l*Math.cos(g),m=l*Math.sin(g);f===0?p.moveTo(x,m):p.lineTo(x,m)}),r===0?p.lineTo(0,0):u.slice().reverse().forEach(g=>{const f=r*Math.cos(g),x=r*Math.sin(g);p.lineTo(f,x)}),t.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(e){const{sectorNode:t,range:i,scale:s,shape:n,type:o}=this;if(!e||o!=="range"||n!=="circle"||!s||!i){t.visible=!1;return}const{axisInnerRadius:a,axisOuterRadius:r}=this,l=i.map(d=>s.convert(d)),c=s.step??0,h=s instanceof A.BandScale?c/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=a,t.outerRadius=r,t.startAngle=l[0]-h,t.endAngle=l[1]+h,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(e){const{label:t,labelNode:i,range:s,scale:n,type:o,ticks:a}=this;if(!e||t.enabled===!1||!t.text||!n||o==="range"&&!s){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,h,d,u;if(o==="line"){const p=kD(n.convert(this.value)),g=1.5*Math.PI,f=lt(p,g)||p>g||p<Math.PI/2,x=(r+l)/2*Math.cos(p),m=(r+l)/2*Math.sin(p);c=x+t.padding*Math.cos(p+Math.PI/2),h=m+t.padding*Math.sin(p+Math.PI/2),u=f?"top":"bottom",d=f?p:p-Math.PI}else{const[p,g]=s.map(b=>kD(n.convert(b)));let f=(p+g)/2;p>g&&(f-=Math.PI),f=kD(f);const x=(lt(f,0)||f>0)&&f<Math.PI;let m;this.shape==="circle"||a.length<3?m=l-t.padding:m=l*Math.cos(Math.PI/a.length)-t.padding,c=m*Math.cos(f),h=m*Math.sin(f),u=x?"bottom":"top",d=x?f-Math.PI/2:f+Math.PI/2}this.setLabelNodeProps(i,c,h,u,d)}};CD.className="AngleCrossLine";var{ChartAxisDirection:WY,TextWrapper:$Y,TextUtils:UY,Property:TD,toRadians:Ig,normalizeAngle360:Sl,normalizeAngle360Inclusive:YY,Path:KY,RotatableText:ZY,Transformable:XY,BBox:qY,Selection:tE,Line:iE}=A,LD=class extends A.AxisLabel{constructor(){super(...arguments),this.orientation="fixed"}};y([TD],LD.prototype,"orientation",2);var kg=class extends A.PolarAxis{constructor(e,t){super(e,t),this.startAngle=0,this.endAngle=void 0,this.tickLineGroupSelection=tE.select(this.tickLineGroup,iE,!1),this.gridLineGroupSelection=tE.select(this.gridLineGroup,iE,!1),this.labelData=[],this.tickData=[],this.radiusLineGroup=this.axisGroup.appendChild(new A.TransformableGroup),this.radiusLine=this.radiusLineGroup.appendChild(new KY),this.includeInvisibleDomains=!0}get direction(){return WY.Angle}createLabel(){return new LD}calculateRotations(){const e=Ig(this.startAngle),t=Sl(e),i=Sl(e-Math.PI/2);return{rotation:e,parallelFlipRotation:t,regularFlipRotation:i}}calculateTickLayout(e){const{nice:t,scale:i}=this,s={nice:t,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},n=t?i.niceDomain(s,e):e,o=this.generateAngleTicks(n);this.tickData=o;const a=o.map(l=>l.value),r=a.reduce((l,c)=>Math.max(typeof c=="number"?Vu(c):0,l),0);return{niceDomain:n,tickDomain:n,ticks:a,rawTickCount:void 0,fractionDigits:r,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const e=Sl(-Math.PI/2+Ig(this.startAngle)),t=this.endAngle!=null?YY(Ig(this.endAngle)-Ig(this.startAngle)):2*Math.PI,i=e+t;return[e,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const e=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?e:[]),this.tickLineGroupSelection.update(this.tick.enabled?e:[]),this.tickLabelGroupSelection.update(this.label.enabled?e:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:e,radiusLineGroup:t}=this,i=Math.floor(e.x),s=Math.floor(e.y);t.translationX=i,t.translationY=s}updateRadiusLine(){const e=this.radiusLine,{path:t}=e;t.clear(!0);const{points:i,closePath:s}=this.getAxisLinePoints();i.forEach(({x:n,y:o,moveTo:a,arc:r,radius:l=0,startAngle:c=0,endAngle:h=0})=>{r?t.arc(n,o,l,c,h):a?t.moveTo(n,o):t.lineTo(n,o)}),s&&t.closePath(),e.visible=this.line.enabled,e.stroke=this.line.stroke,e.strokeWidth=this.line.width,e.fill=void 0}getAxisLinePoints(){const{scale:e,shape:t,gridLength:i}=this,[s,n]=this.range,o=lt(n-s,2*Math.PI),a=[];if(t==="circle")o?a.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):a.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:Sl(s),endAngle:Sl(n),arc:!0,moveTo:!1});else if(t==="polygon"){const r=e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>e.convert(l));r&&r.length>2&&r.forEach((l,c)=>{const h=i*Math.cos(l),d=i*Math.sin(l),u=c===0;a.push({x:h,y:d,moveTo:u})})}return{points:a,closePath:o}}updateGridLines(){const{scale:e,gridLength:t,gridLine:{style:i,width:s},innerRadiusRatio:n}=this;if(!(i&&t>0))return;const o=t*n,a=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:h}=l,{stroke:d,lineDash:u}=i[c%a],p=e.convert(h);r.x1=o*Math.cos(p),r.y1=o*Math.sin(p),r.x2=t*Math.cos(p),r.y2=t*Math.sin(p),r.stroke=d,r.strokeWidth=s,r.lineDash=u,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:e,tickLabelGroupSelection:t}=this;t.each((i,s,n)=>{const o=this.labelData[n];if(!o||o.hidden){i.visible=!1;return}i.text=o.text,i.setFont(e),i.fill=e.color,i.x=o.x,i.y=o.y,i.setAlign(o),i.setBoxing(e),i.visible=!0,o.rotation?(i.rotation=o.rotation,i.rotationCenterX=o.x,i.rotationCenterY=o.y):i.rotation=0})}updateTickLines(){const{scale:e,gridLength:t,tick:i,tickLineGroupSelection:s}=this;s.each((n,o)=>{const{value:a}=o,r=e.convert(a),l=Math.cos(r),c=Math.sin(r);n.x1=t*l,n.y1=t*c,n.x2=(t+i.size)*l,n.y2=(t+i.size)*c,n.stroke=i.stroke,n.strokeWidth=i.width})}createLabelNodeData(e,t,i){const{label:s,gridLength:n,scale:o,tick:a}=this;if(!s.enabled)return[];const r=new ZY,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,{fractionDigits:h}=this.layout.label,d=this.tickFormatter(this.scale.domain,this.tickData,!1,h),u=e.map((p,g)=>{const{value:f}=p,x=n+s.spacing+a.size,m=o.convert(f),b=Math.cos(m),v=Math.sin(m),S=x*b,D=x*v,{textAlign:C,textBaseline:T}=this.getLabelAlign(m),k=g===e.length-1&&f!==e[0]&<(Sl(m),Sl(o.convert(e[0]))),L=this.getLabelRotation(m);let N=d(f,g);r.text=N,r.x=S,r.y=D,r.setFont(s),r.textAlign=C,r.textBaseline=T,r.rotation=L,L&&(r.rotationCenterX=S,r.rotationCenterY=D);let w=L?XY.toCanvas(r):r.getBBox();if(w&&t.hideWhenNecessary&&!L){const O=l-w.x,R=w.x+w.width-c,B=1;if(O>B||R>B){const P=w.width-Math.max(O,R);N=$Y.wrapText(N,{maxWidth:P,font:s,textWrap:"never"}),N===UY.EllipsisChar&&(N=""),r.text=N,w=r.getBBox()}}return{text:N,x:S,y:D,textAlign:C,textBaseline:T,hidden:N===""||p.hidden||k,rotation:L,box:w}});return s.avoidCollisions&&this.avoidLabelCollisions(u),u}computeLabelsBBox(e,t){this.labelData=this.createLabelNodeData(this.tickData,e,t);const i=this.labelData.map(({box:s})=>s).filter(s=>s!=null);return!this.label.enabled||i.length===0?null:qY.merge(i)}getLabelOrientation(){const{label:e}=this;return e instanceof LD?e.orientation:"fixed"}getLabelRotation(e){let t=Ig(this.label.rotation??0);e=Sl(e);const i=this.getLabelOrientation();return i==="parallel"?(t+=e,e>=0&&e<Math.PI?t-=Math.PI/2:t+=Math.PI/2):i==="perpendicular"&&(t+=e,e>=Math.PI/2&&e<1.5*Math.PI&&(t+=Math.PI)),t}getLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,n;const o=this.getLabelOrientation(),a=lt(t,0),r=lt(i,0),l=lt(t,1),c=lt(i,-1),h=t>0&&!a,d=i>0&&!r;return o==="parallel"?(s="center",n=l&&r||d?"top":"bottom"):o==="perpendicular"?(s=c||h?"left":"right",n="middle"):(s="right",a?s="center":h&&(s="left"),n="bottom",r?n="middle":d&&(n="top")),{textAlign:s,textBaseline:n}}updateCrossLines(){const{shape:e,gridLength:t,innerRadiusRatio:i}=this;this.crossLines.forEach(s=>{s instanceof CD&&(s.ticks=this.tickData.map(n=>n.value),s.shape=e,s.axisOuterRadius=t,s.axisInnerRadius=t*i)}),super.updateCrossLines()}};kg.CrossLineConstructor=CD,y([TD],kg.prototype,"startAngle",2),y([TD],kg.prototype,"endAngle",2);var{Property:wD,CategoryScale:QY}=A,Ml=class extends kg{constructor(e){super(e,new QY),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new AD}hasDefinedDomain(){return!1}generateAngleTicks(e){const{scale:t,gridLength:i}=this,{values:s,minSpacing:n}=this.interval,o={nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},a=s??t.ticks(o,e)?.ticks??[];if(a.length<2||n==null)return a.map(d=>({value:d,visible:!0}));const r=a[0],l=t.convert(r),c=i*Math.cos(l),h=i*Math.sin(l);for(let d=1;d<a.length-1;d++){const u=a[d],p=t.convert(u);if(p-l>Math.PI)break;const g=i*Math.cos(p),f=i*Math.sin(p);if(Math.sqrt((g-c)**2+(f-h)**2)>n){const m=new Set([r]);return DD(a,d,(b,v)=>{m.add(v)}),a.map(b=>{const v=m.has(b);return{value:b,visible:v}})}}return[{value:r,visible:!0}]}avoidLabelCollisions(e){const{minSpacing:t}=this.label;if(e.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;if(t==null)return l.box.collidesBBox(c.box);const h=l.box.clone().grow(t/2),d=c.box.clone().grow(t/2);return h.collidesBBox(d)},s=e[0],n=e.at(-1),o=new Set([s]),a=lt(s.x,n.x)&<(s.y,n.y),r=Math.floor(e.length/2);for(let l=1;l<=r;l++){const c=a?e.slice(0,-1):e;if(!DD(c,l,i)){DD(c,l,(d,u)=>{o.add(u)});break}}e.forEach(l=>{o.has(l)||(l.hidden=!0,l.box=void 0)})}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:s,legendItemName:n,key:o,source:a,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:n,key:o,source:a,property:r,domain:l,boundSeries:c}}};Ml.className="AngleCategoryAxis",Ml.type="angle-category",y([wD],Ml.prototype,"groupPaddingInner",2),y([wD],Ml.prototype,"paddingInner",2),y([wD],Ml.prototype,"interval",2);var JY={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-category",moduleFactory:e=>new Ml(e)},{range:sE,isDenseInterval:eK,LinearScale:ND}=A,nE=class Tk extends ND{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(t,i){const[s,n]=i;let o=ND.getTickStep(s,n,t);const a=isNaN(t.maxTickCount)?1/0:t.maxTickCount,r=Math.abs(n-s)/o;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>a&&(l/=2,o*=2),{count:l,step:o}}ticks(t,i=this.domain){const{arcLength:s}=this;if(!i||i.length<2||i.some(c=>!isFinite(c))||s<=0)return{ticks:[],count:0};const{nice:n,interval:o}=t,[a,r]=i;if(o){const c=Math.abs(o),h=this.getPixelRange();if(!eK((r-a)/c,h))return sE(a,r,c)}let l;if(n&&this.hasNiceRange()){const c=super.niceDomain(t,i);l=Tk.getNiceStepAndTickCount(t,c).step}else l=ND.getTickStep(a,r,t);return sE(a,r,l)}hasNiceRange(){const t=this.range.slice().sort((s,n)=>s-n);return[Math.PI,2*Math.PI].some(s=>lt(s,t[1]-t[0]))}niceDomain(t,i=this.domain){const s=super.niceDomain(t,i);if(!this.hasNiceRange())return s;const n=s[0]>s[1],o=n?s[1]:s[0],{step:a,count:r}=Tk.getNiceStepAndTickCount(t,s),l=1/a,c=a>=1?Math.ceil(o/a+r)*a:Math.ceil((o+r*a)*l)/l;return n?[c,o]:[o,c]}getPixelRange(){return this.arcLength}},{Property:ED,angleBetween:tK,normalisedExtentWithMetadata:iK,findMinMax:sK}=A,Qc=class extends kg{constructor(e){super(e,new nE),this.shape="circle",this.interval=new AD}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:n}=iK(e,t,i);return{domain:s,clipped:n}}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:e}=this,t=Math.min(...e),i=Math.max(...e),s=tK(t,i)||2*Math.PI,n=this.gridLength;return s*n}generateAngleTicks(e){const{scale:t,range:i,nice:s}=this,{values:n,step:o,minSpacing:a,maxSpacing:r}=this.interval;let l;if(n==null){const{arcLength:c}=t,h=r?Math.floor(c/r):1,d=a?Math.floor(c/a):1/0,u=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),p=Math.max(h,Math.min(d,u)),g={nice:s,interval:o,tickCount:p,minTickCount:h,maxTickCount:d};l=t.ticks(g,e)?.ticks??[]}else{const[c,h]=sK(e.map(Number));l=n.filter(d=>d>=c&&d<=h).sort((d,u)=>d-u)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(e){const{minSpacing:t}=this.label,i=(o,a)=>{if(o.hidden||a.hidden)return!1;if(t==null)return o.box.collidesBBox(a.box);const r=o.box.clone().grow(t/2),l=a.box.clone().grow(t/2);return r.collidesBBox(l)},s=e[0],n=e.at(-1);s!==n&<(s.x,n.x)&<(s.y,n.y)&&(n.hidden=!0);for(let o=1;o<e.length;o*=2){let a=!1;for(let r=o;r<e.length;r+=o){const l=e[r],c=e[r-o];if(i(c,l)){a=!0;break}}if(!a){e.forEach((r,l)=>{l%o>0&&(r.hidden=!0,r.box=void 0)});return}}e.forEach((o,a)=>{a>0&&(o.hidden=!0,o.box=void 0)})}tickFormatParams(e,t,i){return{type:"number",fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:n,legendItemName:o,key:a,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:n,legendItemName:o,key:a,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i}}};Qc.className="AngleNumberAxis",Qc.type="angle-number",y([ED],Qc.prototype,"min",2),y([ED],Qc.prototype,"max",2),y([ED],Qc.prototype,"interval",2);var nK={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-number",moduleFactory:e=>new Qc(e)},{OrdinalTimeScale:oK,Property:aK,TimeAxisParentLevel:rK,lowestGranularityUnitForTicks:lK,lowestGranularityUnitForValue:cK,minimumTimeAxisDatumGranularity:hK,dateTruncationForDomain:dK,intervalUnit:oE,intervalStep:aE,intervalEpoch:rE,intervalMilliseconds:lE}=A,Cg=class extends A.DiscreteTimeAxis{constructor(e){super(e,new oK),this.parentLevel=new rK,this.minimumTimeGranularity=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}processData(){super.processData();const{boundSeries:e,direction:t}=this;this.minimumTimeGranularity=hK(e,t,void 0,void 0)}tickFormatParams(e,t,i,s){s??(s=lK(t));const n=dK(e),o=oE(s),a=aE(s),r=rE(s);return{type:"date",unit:o,step:a,epoch:r,truncateDate:n}}datumFormatParams(e,t,i,s,n){if(typeof e=="number"&&(e=new Date(e)),s==null){const{minimumTimeGranularity:x}=this,m=cK(e);x!=null&&lE(x)<lE(m)?s=x:s=m}const{datum:o,seriesId:a,legendItemName:r,key:l,source:c,property:h,domain:d,boundSeries:u}=t,p=oE(s),g=aE(s),f=rE(s);return{type:"date",value:e,datum:o,seriesId:a,legendItemName:r,key:l,source:c,property:h,domain:d,boundSeries:u,unit:p,step:g,epoch:f,style:n}}};Cg.className="OrdinalTimeAxis",Cg.type="ordinal-time",y([aK],Cg.prototype,"parentLevel",2);var uK={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ordinal-time",moduleFactory:e=>new Cg(e)},{ChartAxisDirection:pK,Property:gK,validateCrossLineValue:fK,normalizeAngle360FromDegrees:yK,Group:mK,Path:xK,Sector:bK,RotatableText:vK}=A,cE=class extends Wo{constructor(){super(...arguments),this.positionAngle=void 0}};y([gK],cE.prototype,"positionAngle",2);var OD=class extends $s{constructor(){super(),this.direction=pK.Radius,this.label=new cE,this.polygonNode=new xK,this.sectorNode=new bK,this.crossLineRange=new mK,this.labelNode=new vK,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(e){const{scale:t}=this;if(!t||!fK(this,t)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.updateRadii();const{innerRadius:i,outerRadius:s}=this;e&&(e=i>=this.axisInnerRadius&&s<=this.axisOuterRadius),this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:e,scale:t,type:i,axisInnerRadius:s,axisOuterRadius:n}=this;if(!t)return{innerRadius:0,outerRadius:0};const o=l=>n+s-l;let a,r;if(i==="line")a=o(t.convert(this.value)),r=a;else{const l=Math.abs(t?.bandwidth??0),c=e.map(h=>t.convert(h));a=o(Math.max(...c)),r=o(Math.min(...c))+l}this.outerRadius=a,this.innerRadius=r}drawPolygon(e,t,i){t.forEach((s,n)=>{const o=e*Math.cos(s),a=e*Math.sin(s);n===0?i.path.moveTo(o,a):i.path.lineTo(o,a)}),i.path.closePath()}updatePolygonNode(e){const{gridAngles:t,polygonNode:i,scale:s,shape:n,type:o,innerRadius:a,outerRadius:r}=this;if(!e||n!=="polygon"||!s||!t){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,t,i);const c=t.slice().reverse(),h=o==="line"?r-l:a+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:s,sectorNode:n,shape:o,innerRadius:a,outerRadius:r}=this;if(!e||o!=="circle"||!s){n.visible=!1;return}n.visible=!0,n.startAngle=0,n.endAngle=2*Math.PI;const l=this.getPadding(),c=ve(t,a+l,i),h=ve(t,r-l,i);n.innerRadius=Math.min(c,h),n.outerRadius=Math.max(c,h),this.setSectorNodeProps(n)}updateLabelNode(e){const{innerRadius:t,label:i,labelNode:s,scale:n,shape:o,type:a}=this;if(!e||i.enabled===!1||!i.text||!n){s.visible=!1;return}const r=yK((i.positionAngle??0)-90),l=(lt(r,0)||r>0)&&r<Math.PI,c=l?r-Math.PI/2:r+Math.PI/2;let h;const d=this.gridAngles??[];a==="line"?h=t+i.padding:o==="circle"||d.length<3?h=t-i.padding:h=t*Math.cos(Math.PI/d.length)-i.padding;const u=h*Math.cos(r),p=h*Math.sin(r);let g;a==="line"?g=l?"top":"bottom":g=l?"bottom":"top",this.setLabelNodeProps(s,u,p,g,c)}getPadding(){const{scale:e}=this;if(!e)return 0;const t=Math.abs(e.bandwidth??0),i=Math.abs(e.step??0);return e instanceof A.BandScale?(i-t)/2:0}};OD.className="RadiusCrossLine";var{ChartAxisDirection:SK,ZIndexMap:MK,Property:PD,normalizeAngle360:hE,toRadians:DK,Caption:AK,Group:IK,TransformableGroup:dE,Path:kK,Line:uE,Selection:pE,AxisTickGenerator:CK,AxisGroupZIndexMap:TK}=A,RD=class extends A.AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};y([PD],RD.prototype,"autoRotate",2),y([PD],RD.prototype,"autoRotateAngle",2);var hx=class extends A.PolarAxis{constructor(e,t){super(e,t),this.positionAngle=0,this.gridLineGroupSelection=pE.select(this.gridLineGroup,uE,!1),this.tickGenerator=new CK(this),this.generatedTicks=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new dE({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new dE({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new uE({name:`${this.id}-Axis-line`,zIndex:TK.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new IK({name:`${this.id}-gridPaths`,zIndex:MK.AXIS_GRID})),this.gridPathSelection=pE.select(this.gridPathGroup,kK),this.headingLabelGroup.appendChild(this.title.caption.node),this.cleanup.register(this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}get direction(){return SK.Radius}getAxisTransform(){const e=this.scale.range[0],{translation:t,positionAngle:i,innerRadiusRatio:s}=this,n=e*s,o=DK(i);return{translationX:t.x,translationY:t.y-e-n,rotation:o,rotationCenterX:0,rotationCenterY:e+n}}update(){super.update(),this.updateTitle(),this.updateGridLines();const{enabled:e,stroke:t,width:i}=this.line;this.lineNode.setProperties({stroke:t,strokeWidth:e?i:0,x1:0,y1:this.range[0],x2:0,y2:this.range[1]})}updatePosition(){super.updatePosition();const e=this.getAxisTransform();this.tickLineGroup.setProperties(e),this.tickLabelGroup.setProperties(e),this.lineNodeGroup.setProperties(e),this.headingLabelGroup.setProperties(e)}calculateRotations(){return{rotation:0,parallelFlipRotation:0,regularFlipRotation:-Math.PI/2}}calculateTickLayout(e,t,i){const n=-Math.PI/2,o=[0,1],a=this.label.getSideFlag(),r=a*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),{range:l,reverse:c,defaultTickMinSpacing:h}=this,d=this.tickGenerator.generateTicks({domain:e,range:l,reverse:c,niceMode:t,visibleRange:o,primaryTickCount:void 0,defaultTickMinSpacing:h,parallelFlipRotation:0,regularFlipRotation:n,labelX:r,sideFlag:a,sizeLimit:void 0,removeOverflowLabels:!1}),{tickData:u}=d,{ticks:p,rawTicks:g,rawTickCount:f,tickDomain:x,fractionDigits:m,niceDomain:b=e}=u,v=p.map(S=>this.getTickLabelProps(S,d));return this.generatedTicks={ticks:p,labels:v},{ticks:g,tickDomain:x,niceDomain:b,rawTickCount:f,fractionDigits:m,timeInterval:void 0}}updateSelections(){const{generatedTicks:e}=this;if(!e)return;const{ticks:t,labels:i}=e;this.gridLineGroupSelection.update(this.gridLength?t:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(t):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const e=A.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.color,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setFont(i),t.setBoxing(i),t.setProperties(e(t,i))})}updateGridLines(){const{gridLine:{style:e,width:t},shape:i,generatedTicks:s}=this;if(!e||!s)return;const n=e.length,o=(u,p)=>{const{stroke:g,lineDash:f}=e[p%n];u.stroke=g,u.strokeWidth=t,u.lineDash=f,u.fill=void 0},[a,r]=this.gridRange??[0,2*Math.PI],l=lt(r-a,2*Math.PI),d=i==="circle"?(u,p)=>{const{path:g}=u;g.clear(!0);const f=this.getTickRadius(p);l?(g.moveTo(f,0),g.arc(0,0,f,0,2*Math.PI)):(g.moveTo(f*Math.cos(a),f*Math.sin(a)),g.arc(0,0,f,hE(a),hE(r))),l&&g.closePath()}:(u,p)=>{const{path:g}=u,f=this.gridAngles;if(g.clear(!0),!f||f.length<3)return;const x=this.getTickRadius(p);f.forEach((m,b)=>{const v=x*Math.cos(m),S=x*Math.sin(m);b===0?g.moveTo(v,S):g.lineTo(v,S),f.forEach((D,C)=>{const T=x*Math.cos(D),k=x*Math.sin(D);C===0?g.moveTo(T,k):g.lineTo(T,k)}),g.closePath()}),g.closePath()};this.gridPathSelection.each((u,p,g)=>{o(u,g),d(u,p)})}updateTitle(){const e=a=>a.defaultValue,{title:t,range:i}=this,{formatter:s=e}=this.title;t.caption.enabled=t.enabled,t.caption.fontFamily=t.fontFamily,t.caption.fontSize=t.fontSize,t.caption.fontStyle=t.fontStyle,t.caption.fontWeight=t.fontWeight,t.caption.color=t.color,t.caption.wrapping=t.wrapping;let n=!1;const o=t.caption.node;t.enabled&&(n=!0,o.rotation=Math.PI/2,o.x=Math.floor((i[0]+i[1])/2),o.y=-AK.SMALL_PADDING,o.textAlign="center",o.textBaseline="bottom",o.text=this.cachedCallWithContext(s,this.getTitleFormatterParams(this.scale.domain))),o.visible=n}updateCrossLines(){this.crossLines.forEach(e=>{if(e instanceof OD){const{shape:t,gridAngles:i,range:s,innerRadiusRatio:n}=this,o=s[0];e.shape=t,e.gridAngles=i,e.axisOuterRadius=o,e.axisInnerRadius=o*n}}),super.updateCrossLines()}createLabel(){return new RD}getTickLabelProps(e,t){const{label:i}=this,{rotation:s,textBaseline:n,textAlign:o}=t,a=this.scale.range,r=e.tickLabel??"",c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),h=r!==""&&r!=null,d=s;return{...this.getLabelStyles({value:e.tickLabel}),tickId:e.tickId,rotation:d,text:r,textAlign:o,textBaseline:n,visible:h,x:c,y:e.translation,rotationCenterX:c,rotationCenterY:e.translation,range:a}}};hx.CrossLineConstructor=OD,y([PD],hx.prototype,"positionAngle",2);var{ProxyPropertyOnWrite:gE,Property:BD,CategoryScale:fE}=A,Dl=class extends hx{constructor(e){super(e,new fE),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,s=t.range[0],n=s*i;if(fE.is(t)){const o=t.domain,a=o.length-1-o.indexOf(e.tick);return a===0?n:t.inset+t.step*(a-.5)+t.bandwidth/2}else{const o=(s-n)/t.domain.length;return s-e.translation+n-o/2}}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:s,legendItemName:n,key:o,source:a,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:n,key:o,source:a,property:r,domain:l,boundSeries:c}}};Dl.className="RadiusCategoryAxis",Dl.type="radius-category",y([BD],Dl.prototype,"groupPaddingInner",2),y([gE("scale","paddingInner"),BD],Dl.prototype,"paddingInner",2),y([gE("scale","paddingOuter"),BD],Dl.prototype,"paddingOuter",2);var LK={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-category",moduleFactory:e=>new Dl(e)},{Property:yE,normalisedExtentWithMetadata:wK,LinearScale:NK}=A,Ud=class extends hx{constructor(e){super(e,new NK),this.shape="polygon"}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&e<t}prepareGridPathTickData(e){const{scale:t}=this,i=t.domain[1];return e.filter(({tick:s})=>s!==i).sort((s,n)=>n.tick-s.tick)}getTickRadius(e){const{scale:t}=this,i=t.range[0],s=i*this.innerRadiusRatio;return i-e.translation+s}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:n}=wK(e,t,i);return{domain:s,clipped:n}}tickFormatParams(e,t,i){return{type:"number",fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:n,legendItemName:o,key:a,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:n,legendItemName:o,key:a,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i}}};Ud.className="RadiusNumberAxis",Ud.type="radius-number",y([yE],Ud.prototype,"min",2),y([yE],Ud.prototype,"max",2);var EK={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-number",moduleFactory:e=>new Ud(e)},{ObserveChanges:mE,Property:xE}=A,FD=class extends A.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,e.animationManager.skip(!1),this.cleanup.register(()=>{e.animationManager.skip(!0)})}};y([mE((e,t)=>{e.ctx.animationManager.skip(!t)}),xE],FD.prototype,"enabled",2),y([mE((e,t)=>{e.ctx.animationManager.defaultDuration=t}),xE],FD.prototype,"duration",2);var OK={type:"root",optionsKey:"animation",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new FD(e),themeTemplate:{animation:{enabled:!0}}},PK='<div contenteditable="plaintext-only" class="ag-charts-text-input__textarea" tabindex="0"></div>',{focusCursorAtEnd:RK}=A,bE="text-input",vE="canvas-overlay",BK=class extends A.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=e.domManager.addChild(vE,bE),this.element.classList.add("ag-charts-text-input"),this.cleanup.register(()=>e.domManager.removeChild(vE,bE))}setKeyDownHandler(e){this.cleanup.register(ot(this.element,"keydown",e))}show(e){this.element.innerHTML=PK;const t=this.element.firstElementChild;ca(t,{role:"textbox","data-preventdefault":!1}),t.isContentEditable||(t.contentEditable="true"),t.setAttribute("placeholder",this.ctx.localeManager.t(e.placeholderText??"inputTextareaPlaceholder")),e.styles?.placeholderColor&&t.style.setProperty("--placeholder-text-color",e.styles?.placeholderColor),t.innerText=e.text??"",t.style.color=e.styles?.color??"inherit",t.style.fontFamily=e.styles?.fontFamily??"inherit",t.style.fontSize=e.styles?.fontSize?`${e.styles.fontSize}px`:"inherit",t.style.fontStyle=e.styles?.fontStyle??"inherit",t.style.fontWeight=typeof e.styles?.fontWeight=="number"?`${e.styles.fontWeight}`:e.styles?.fontWeight??"inherit",RK(t),t.addEventListener("input",()=>{this.updatePosition(),e.onChange?.(this.getValue(),this.getBBox())}),t.addEventListener("click",i=>{i.stopPropagation()}),e.layout&&(this.layout=e.layout,this.updatePosition()),e.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(e){this.element.firstElementChild&&(this.element.firstElementChild.style.color=e)}updateFontSize(e){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${e}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:e}=this,t=e.firstElementChild;if(!t)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:s,getTextInputCoords:n,getTextPosition:o,alignment:a,textAlign:r}=this.layout;e.style.setProperty("width",s?`${s}px`:"unset");const l=t.getBoundingClientRect(),c=n(l.height);let h=c.x;a==="center"?h-=(s??l.width)/2:a==="right"&&(h-=s??l.width);const d=o();let u=c.y;d==="center"?u-=l.height/2:d==="bottom"&&(u-=l.height),e.style.setProperty("top",`${u}px`),e.style.setProperty("left",`${h}px`),e.style.setProperty("max-width",`${i.width-h}px`),e.style.setProperty("text-align",a),t.style.setProperty("text-align",r)}getBBox(){const{left:e,top:t,width:i,height:s}=this.element.getBoundingClientRect();return new A.BBox(e,t,i,s)}},{BaseProperties:FK,Property:SE}=A,zD=class extends FK{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};y([SE],zD.prototype,"enabled",2),y([SE],zD.prototype,"axes",2);var _D=(e=>(e.Line="line",e.HorizontalLine="horizontal-line",e.VerticalLine="vertical-line",e.DisjointChannel="disjoint-channel",e.ParallelChannel="parallel-channel",e.FibonacciRetracement="fibonacci-retracement",e.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",e.Callout="callout",e.Comment="comment",e.Note="note",e.Text="text",e.Arrow="arrow",e.ArrowUp="arrow-up",e.ArrowDown="arrow-down",e.DateRange="date-range",e.PriceRange="price-range",e.DatePriceRange="date-price-range",e.QuickDatePriceRange="quick-date-price-range",e))(_D||{}),zK=Object.values(_D);function _K(e){for(const t of zK)if(t===e)return t}var{BaseProperties:Al,FONT_SIZE:GK,Property:$e}=A,Tg=class extends Al{};y([$e],Tg.prototype,"x",2),y([$e],Tg.prototype,"y",2);var VK=class extends Es(br(IE(Al))){},GD=class extends Es(br(Ta(HD(th(Al))))){constructor(){super(...arguments),this.cornerRadius=2}};y([$e],GD.prototype,"enabled",2),y([$e],GD.prototype,"cornerRadius",2);var jK=class extends Ta(Al){},HK=class extends Es(br(Ta(Al))){},Jc=class extends th(Al){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};y([$e],Jc.prototype,"label",2),y([$e],Jc.prototype,"position",2),y([$e],Jc.prototype,"alignment",2);var WK=class extends th(Al){},Lg=class extends th(Al){constructor(){super(...arguments),this.label=""}};y([$e],Lg.prototype,"label",2),y([$e],Lg.prototype,"position",2),y([$e],Lg.prototype,"alignment",2);function eh(e){class t extends UK(IE(e)){constructor(){super(...arguments),this.id=jf()}}return t}function VD(e){class t extends e{constructor(){super(...arguments),this.start=new Tg,this.end=new Tg}}return y([$e],t.prototype,"start",2),y([$e],t.prototype,"end",2),t}function ME(e){class t extends e{}return y([$e],t.prototype,"x",2),y([$e],t.prototype,"y",2),t}function DE(e){class t extends e{}return y([$e],t.prototype,"value",2),t}function jD(e){class t extends e{constructor(){super(...arguments),this.background=new jK}}return y([$e],t.prototype,"background",2),t}function Il(e){class t extends e{constructor(){super(...arguments),this.handle=new HK}}return y([$e],t.prototype,"handle",2),t}function AE(e){class t extends e{constructor(){super(...arguments),this.axisLabel=new GD}}return y([$e],t.prototype,"axisLabel",2),t}function HD(e){class t extends e{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return y([$e],t.prototype,"padding",2),y([$e],t.prototype,"textAlign",2),y([$e],t.prototype,"formatter",2),t}function $K(e){class t extends e{}return t}function WD(e){class t extends e{}return y([$e],t.prototype,"extendStart",2),y([$e],t.prototype,"extendEnd",2),t}function UK(e){class t extends e{}return y([$e],t.prototype,"locked",2),t}function $D(e){class t extends e{setLocaleManager(s){this.localeManager??(this.localeManager=s)}}return t}function IE(e){class t extends e{}return y([$e],t.prototype,"visible",2),t}function Ta(e){class t extends e{}return y([$e],t.prototype,"fill",2),y([$e],t.prototype,"fillOpacity",2),t}function Es(e){class t extends e{}return y([$e],t.prototype,"stroke",2),y([$e],t.prototype,"strokeOpacity",2),y([$e],t.prototype,"strokeWidth",2),t}function br(e){class t extends e{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return y([$e],t.prototype,"lineDash",2),y([$e],t.prototype,"lineDashOffset",2),y([$e],t.prototype,"lineStyle",2),t}function th(e){class t extends e{constructor(){super(...arguments),this.fontSize=GK.SMALL,this.fontFamily="Verdana, sans-serif"}}return y([$e],t.prototype,"fontStyle",2),y([$e],t.prototype,"fontWeight",2),y([$e],t.prototype,"fontSize",2),y([$e],t.prototype,"fontFamily",2),y([$e],t.prototype,"color",2),t}function kE(e){return di(e)||ki(e)||aa(e)?{value:e,groupPercentage:0}:e??{value:void 0,groupPercentage:0}}function Ri(e){return kE(e)?.value}function Us(e,t){if(e.start==null||e.end==null)return;const i=Zt(e.start,t),s=Zt(e.end,t);if(!(i==null||s==null))return{x1:i.x,y1:i.y,x2:s.x,y2:s.y}}function Zt(e,t){const i=vr(e.x,t.xAxis),s=vr(e.y,t.yAxis);return{x:i,y:s}}function vr(e,t){if(e==null)return 0;const{value:i,groupPercentage:s}=kE(e),{scale:n,snapToGroup:o}=t,a=n.bandwidth===0?n.step??0:n.bandwidth??0,r=o?a/2:a*s;return n.convert(i)+r}function Ys(e,t){const i=dx(e.x,t.xAxis),s=dx(e.y,t.yAxis);return{x:i,y:s}}function dx(e,t){const{scale:i}=t;if(t.continuous&&i.step==null)return t.scaleInvert(e);const s=t.scaleInvertNearest(e),n=i.bandwidth===0?i.step:i.bandwidth??0,o=i.convert(s),a=o+n,r=o===a?0:(e-o)/(a-o);return{value:s,groupPercentage:r}}var{BaseProperties:YK}=A,UD=class extends eh(VD(Il(YK))){constructor(){super(...arguments),this.snapToAngle=45}getDefaultColor(e){}getDefaultOpacity(e){}},{Property:KK}=A,CE=class extends $D(HD(th(UD))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=this.text.length==0;let t=this.text;return e&&(t=this.placeholderText??"",this.localeManager&&(t=this.localeManager.t(t))),{text:t,isPlaceholder:e}}getTextInputCoords(e,t){return Zt(this.end,e)}getTextPosition(){return this.position}};y([KK],CE.prototype,"text",2);var{Property:ZK,Color:TE}=A,XK={top:6,right:12,bottom:9,left:12},$o=class extends Ta(Es(CE)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(e){return Fe(e)&&e.type==="callout"}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=TE.fromString(this.color??"#888888");return new TE(e,t,i,.66).toString()}getPadding(){const{padding:e}=this;return e==null?{...XK}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),s=this.getPadding(),n=s.left??0,o=s.bottom??0;return{x:i.x+n,y:i.y-o}}};y([ZK],$o.prototype,"type",2);var{BaseProperties:qK,Property:QK}=A,ux=class extends eh(ME(Il(HD(th(qK))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=this.text.length==0;return{text:e?this.placeholderText??"":this.text,isPlaceholder:e}}getTextInputCoords(e,t){return Zt(this,e)}getTextPosition(){return this.position}};y([QK],ux.prototype,"text",2);var{Property:JK,Color:LE}=A,px={top:8,right:14,bottom:8,left:14},La=class extends Ta(Es(ux)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(e){return Fe(e)&&e.type==="comment"}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=LE.fromString(this.color??"#888888");return new LE(e,t,i,.66).toString()}getPadding(){const{padding:e,fontSize:t}=this;return e==null?{top:Math.max(t*.4,px.top),bottom:Math.max(t*.4,px.bottom),left:Math.max(t*.8,px.left),right:Math.max(t*.8,px.right)}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),s=this.getPadding();return{x:i.x+s.left,y:i.y-s.bottom}}};y([JK],La.prototype,"type",2);var{Vec2:ih}=A;function wg(e,t){return e?"dashed":t??"solid"}function wE(e,t){switch(t){case"solid":return[];case"dashed":return[e*4,e*2];case"dotted":return[0,e*2]}}function Yd(e,t,i,s){const n=wg(e,i);return t??e??wE(s??1,n)}function Kd(e,t,i){const s=wg(t,i);return e??s==="dotted"?"round":void 0}function eZ(e,t){const[i,s]=ih.from(e),n=t.height,o=ih.gradient(s,i,n),a=ih.intercept(s,o,n),r=[{x:i.x,y:n??0},{x:i.x,y:n==null?t.height:n-t.height}];if(o===1/0)return r;let l=[ih.intersectAtY(o,a,0,n),ih.intersectAtY(o,a,t.height,n),ih.intersectAtX(o,a,0,n),ih.intersectAtX(o,a,t.width,n)];return l=l.filter(c=>c.x>=t.x&&c.x<=t.width&&c.y>=t.y&&c.y<=t.height).sort((c,h)=>c.x===h.x?0:c.x<h.x?-1:1),l.length!==2?r:l}var{BaseProperties:YD,Property:nn}=A,tZ=class extends Es(YD){},KD=class extends th(Ta(Es(YD))){constructor(){super(...arguments),this.divider=new tZ}};y([nn],KD.prototype,"divider",2);var ZD=class extends Ta(Es(Il(YD))){constructor(){super(...arguments),this.statistics=new KD}};y([nn],ZD.prototype,"statistics",2);var Zd=class extends $D(jD(Es(br(UD)))){constructor(){super(...arguments),this.direction="both",this.hasDateRange=!1,this.hasPriceRange=!1,this.statistics=new KD,this.getVolume=()=>{},this.text=new Jc}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Yd(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Kd(this.lineCap,this.lineDash,this.lineStyle)}};y([nn],Zd.prototype,"statistics",2),y([nn],Zd.prototype,"text",2);function XD(e){class t extends e{constructor(){super(...arguments),this.hasDateRange=!0}}return t}function qD(e){class t extends e{constructor(){super(...arguments),this.hasPriceRange=!0}}return t}var ro=class extends XD(Zd){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(e){return Fe(e)&&e.type==="date-range"}};y([nn],ro.prototype,"type",2),y([nn],ro.prototype,"extendAbove",2),y([nn],ro.prototype,"extendBelow",2);var lo=class extends qD(Zd){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(e){return Fe(e)&&e.type==="price-range"}};y([nn],lo.prototype,"type",2),y([nn],lo.prototype,"extendLeft",2),y([nn],lo.prototype,"extendRight",2);var Sr=class extends XD(qD(Zd)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(e){return Fe(e)&&e.type==="date-price-range"}};y([nn],Sr.prototype,"type",2);var kn=class extends XD(qD(Zd)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new ZD,this.down=new ZD,this.direction="both"}static is(e){return Fe(e)&&e.type==="quick-date-price-range"}};y([nn],kn.prototype,"type",2),y([nn],kn.prototype,"up",2),y([nn],kn.prototype,"down",2);var{TextWrapper:iZ,CachedTextMeasurerPool:sZ,BBox:nZ}=A,Ng=1.38;function NE(e){return{font:{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},textAlign:e.textAlign,textBaseline:e.position=="center"?"middle":e.position,lineHeight:Ng,avoidOrphans:!1,textWrap:"always"}}function gx(e,t,i){return i?iZ.wrapText(t,{...NE(e),maxWidth:i}):t}function oZ(e,t){const i=NE(e),{lineMetrics:s,width:n}=sZ.measureLines(t,i),o=s.length*(e.fontSize??14)*Ng;return{width:n,height:o}}function QD(e,t,i,s){let n=s?.width??0,o=s?.height??0;if(!s){const a=e.width!=null?gx(e,t,e.width):t;({width:n,height:o}=oZ(e,a))}return new nZ(i.x,i.y,n,o)}function EE(e,t,i,s,{x:n,y:o},a){const{visible:r=!0,fontFamily:l,fontSize:c=14,fontStyle:h,fontWeight:d,textAlign:u}=s,p=c*Ng;a??(a=s.position=="center"?"middle":s.position);const g=i?s.getPlaceholderColor():s.color;e.setProperties({x:n,y:o,visible:r,text:t,fill:g,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,textAlign:u,lineHeight:p,textBaseline:a})}var{BaseProperties:aZ,Property:OE}=A,rZ=10,lZ=11,PE=20,cZ=22,hZ=10,RE=PE+hZ,BE=34,dZ=class extends Ta(Es(aZ)){},on=class extends Ta(Es(ux)){constructor(){super(...arguments),this.type="note",this.background=new dZ,this.position="bottom",this.alignment="center",this.width=200}static is(e){return Fe(e)&&e.type==="note"}getDefaultColor(e){switch(e){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(e){switch(e){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const e=this.padding??rZ;return{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const{width:i,text:s}=this,n=super.getTextInputCoords(e,t),o=this.getPadding().top,a=QD(this,s,n);a.x=ve(i/2,a.x,e.seriesRect.width-i/2);const r=a.y-RE-o*2,l=a.y+lZ+o*2,c=Math.max(a.height,t);return r-c-BE<0?(a.y=l,this.position="top"):(a.y=r+o,this.position="bottom"),{x:a.x,y:a.y}}};y([OE],on.prototype,"type",2),y([OE],on.prototype,"background",2);var{BaseProperties:uZ}=A,pZ=class extends eh(ME(Il(uZ))){getDefaultColor(e){}getDefaultOpacity(e){}},JD=class I_ extends Ta(pZ){constructor(){super(...arguments),this.size=32}static is(t){return t instanceof I_}getDefaultColor(t){return t==="fill-color"?this.fill:void 0}getDefaultOpacity(t){return t==="fill-color"?this.fillOpacity:void 0}},{BaseProperties:FE,Property:fx}=A,Os=class extends eh(DE(Il(AE(Es(br(FE)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new Jc}static is(e){return Fe(e)&&e.type==="horizontal-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Yd(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Kd(this.lineCap,this.lineDash,this.lineStyle)}};y([fx],Os.prototype,"type",2),y([fx],Os.prototype,"text",2);var wa=class extends eh(DE(Il(AE(Es(br(FE)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new Jc}static is(e){return Fe(e)&&e.type==="vertical-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Yd(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Kd(this.lineCap,this.lineDash,this.lineStyle)}};y([fx],wa.prototype,"type",2),y([fx],wa.prototype,"text",2);var{BaseProperties:gZ,Property:yx}=A,co=class extends eh(jD(VD(Il(WD(Es(br(gZ))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new Lg,this.snapToAngle=45}static is(e){return Fe(e)&&e.type==="disjoint-channel"}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof e.start.y=="number"&&typeof e.end.y=="number"?(e.start.y-=this.startHeight,e.end.y-=this.endHeight):X.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Yd(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Kd(this.lineCap,this.lineDash,this.lineStyle)}};y([yx],co.prototype,"type",2),y([yx],co.prototype,"startHeight",2),y([yx],co.prototype,"endHeight",2),y([yx],co.prototype,"text",2);var{Property:eA}=A,mx=class extends $D($K(WD(Es(br(UD))))){constructor(){super(...arguments),this.text=new Jc}getDefaultColor(e){switch(e){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Yd(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Kd(this.lineCap,this.lineDash,this.lineStyle)}};y([eA],mx.prototype,"text",2);var Mr=class extends mx{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(e){return Fe(e)&&e.type==="arrow"}};y([eA],Mr.prototype,"type",2);var Dr=class extends mx{constructor(){super(...arguments),this.type="line"}static is(e){return Fe(e)&&e.type==="line"}};y([eA],Dr.prototype,"type",2);var{Property:sh}=A,Ar=class extends mx{constructor(){super(...arguments),this.label=new WK,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(e){switch(e){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};y([sh],Ar.prototype,"label",2),y([sh],Ar.prototype,"reverse",2),y([sh],Ar.prototype,"showFill",2),y([sh],Ar.prototype,"isMultiColor",2),y([sh],Ar.prototype,"strokes",2),y([sh],Ar.prototype,"rangeStroke",2),y([sh],Ar.prototype,"bands",2);var{Property:zE}=A,Na=class extends Ar{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new Tg}static is(e){return Fe(e)&&e.type==="fibonacci-retracement-trend-based"}};y([zE],Na.prototype,"type",2),y([zE],Na.prototype,"endRetracement",2);var{Property:fZ}=A,Ir=class extends Ar{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(e){return Fe(e)&&e.type==="fibonacci-retracement"}};y([fZ],Ir.prototype,"type",2);var{BaseProperties:yZ,Property:xx}=A,ho=class extends eh(jD(VD(Il(WD(Es(br(yZ))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new VK,this.text=new Lg,this.snapToAngle=45}static is(e){return Fe(e)&&e.type==="parallel-channel"}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof e.start.y=="number"&&typeof e.end.y=="number"?(e.start.y-=this.height,e.end.y-=this.height):X.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Yd(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Kd(this.lineCap,this.lineDash,this.lineStyle)}};y([xx],ho.prototype,"type",2),y([xx],ho.prototype,"height",2),y([xx],ho.prototype,"middle",2),y([xx],ho.prototype,"text",2);var{Property:mZ}=A,kr=class extends ux{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(e){return Fe(e)&&e.type==="text"}};y([mZ],kr.prototype,"type",2);function kl(e){return kn.is(e)}function bx(e){return Dr.is(e)||Os.is(e)||wa.is(e)||Mr.is(e)||_E(e)}function Cr(e){return co.is(e)||ho.is(e)}function _E(e){return Ir.is(e)||Na.is(e)}function Ea(e){return $o.is(e)||La.is(e)||on.is(e)||kr.is(e)}function Eg(e){return ro.is(e)||lo.is(e)||Sr.is(e)||kn.is(e)}function tA(e){return Ea(e)&&!on.is(e)}function Cl(e){return bx(e)||Cr(e)||Eg(e)&&!kn.is(e)}function xZ(e){return bx(e)||Cr(e)||Eg(e)||$o.is(e)||on.is(e)}function bZ(e){return on.is(e)}function vZ(e){return Cr(e)||Eg(e)||$o.is(e)||La.is(e)||JD.is(e)}function SZ(e){return Ea(e)&&!on.is(e)}function Xd(e){return(bx(e)||Cr(e)||Eg(e))&&!kl(e)&&Fe(e.text)}function MZ(e,t){"fontSize"in e&&(e.fontSize=t),Xd(e)&&(e.text.fontSize=t)}function GE(e,t){const i=t?.strokeWidth??e.strokeWidth??1,s=t?.type??e.lineStyle,n=s??wg(e.lineDash,s),o=wE(i,n);e.strokeWidth=i,e.computedLineDash=o,e.lineStyle=n,e.lineCap=n==="dotted"?"round":void 0}function vx(e,t,i,s,n,o){switch(t){case"fill-color":{"fill"in e&&(e.fill=s),"fillOpacity"in e&&(e.fillOpacity=n),"background"in e&&(e.background.fill=s,e.background.fillOpacity=n);break}case"line-color":{"axisLabel"in e&&(e.axisLabel.fill=s,e.axisLabel.fillOpacity=n,e.axisLabel.stroke=s,e.axisLabel.strokeOpacity=n),"fill"in e&&"fillOpacity"in e&&bZ(e)?(e.fill=s,e.fillOpacity=n):("strokeOpacity"in e&&(e.strokeOpacity=n),"isMultiColor"in e&&"rangeStroke"in e?(e.isMultiColor=o,e.rangeStroke=s):"stroke"in e&&(e.stroke=s));break}case"text-color":{"color"in e&&(e.color=i),Xd(e)&&(e.text.color=s);break}}}var{deepClone:uo}=A,DZ=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(_D).map(e=>[e,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:uo(this.colors),fontSizes:uo(this.fontSizes),lineStyles:uo(this.lineStyles),lineTextAlignments:uo(this.lineTextAlignments),lineTextPositions:uo(this.lineTextPositions),fibonacciOptions:uo(this.fibonacciOptions)}}guardMemento(e){return!0}restoreMemento(e,t,i){this.colors=uo(i.colors),this.fontSizes=uo(i.fontSizes),this.lineStyles=uo(i.lineStyles),this.lineTextAlignments=uo(i.lineTextAlignments),this.lineTextPositions=uo(i.lineTextPositions),this.fibonacciOptions=uo(i.fibonacciOptions)}setDefaultColor(e,t,i,s,n,o){this.colors.get(e)?.set(t,[i,s,n,o])}setDefaultFontSize(e,t){this.fontSizes.set(e,t)}setDefaultLineStyleType(e,t){const i=this.lineStyles.get(e);i?i.type=t:this.lineStyles.set(e,{type:t})}setDefaultLineStyleWidth(e,t){const i=this.lineStyles.get(e);i?i.strokeWidth=t:this.lineStyles.set(e,{strokeWidth:t})}setDefaultLineTextAlignment(e,t){this.lineTextAlignments.set(e,t)}setDefaultLineTextPosition(e,t){this.lineTextPositions.set(e,t)}setDefaultFibonacciOptions(e,t,i){if(e!="fibonacci-retracement"&&e!="fibonacci-retracement-trend-based")return;const s=this.fibonacciOptions.get(e);s[t]=i,this.fibonacciOptions.set(e,s)}applyDefaults(e){for(const[t,i]of this.colors)if(e.type===t)for(const[s,[n,o,a,r]=[]]of i)n&&o&&a!=null&&r!=null&&vx(e,s,n,o,a,r);for(const[t,i]of this.fontSizes)e.type!==t||i==null||MZ(e,i);for(const[t,i]of this.lineStyles)e.type!==t||i==null||GE(e,i);for(const[t,i]of this.lineTextPositions)e.type!==t||i==null||(e.text.position=i);for(const[t,i]of this.lineTextAlignments)e.type!==t||i==null||(e.text.alignment=i);for(const[t,i]of this.fibonacciOptions)e.type!==t||i==null||Object.keys(i).forEach(s=>{const n=i[s];n!=null&&e.set({[s]:n})})}},AZ='<div class="ag-charts-color-picker__palette" role="slider" tabindex="0"></div><div class="ag-charts-color-picker__color-row" role="presentation"><button class="ag-charts-color-picker__multi-color-button" tabindex="0" type="button" role="switch"></button> <input class="ag-charts-color-picker__hue-input" tabindex="0" type="range" min="0" max="360" value="0"></div><input class="ag-charts-color-picker__alpha-input" tabindex="0" type="range" min="0" max="1" value="1" step="0.01"> <label class="ag-charts-color-picker__color-field" role="presentation"><span class="ag-charts-color-picker__color-label" aria-hidden="true"></span> <input class="ag-charts-color-picker__color-input" tabindex="0" value="#000"></label>',{Color:iA}=A,VE=e=>{try{const t=iA.fromString(e),[i,s,n]=t.toHSB();return[i,s,n,t.a]}catch{return}},jE=class extends A.AnchoredPopover{constructor(e,t){super(e,"color-picker",t),this.hasChanged=!1,this.hideFns.push(()=>{this.i18nUpdater=void 0,this.hasChanged&&this.onChangeHide?.()}),this.cleanup.register(this.ctx.eventsHub.on("locale:change",()=>this.i18nUpdater?.()))}show(e){this.hasChanged=!1,this.onChangeHide=e.onChangeHide;const{element:t,initialFocus:i}=this.createColorPicker(e),s=this.showWithChildren([t],{initialFocus:i,...e});s.classList.add("ag-charts-color-picker"),s.setAttribute("role","dialog")}createColorPicker(e){const{localeManager:t}=this.ctx;let i=e.isMultiColor??!1,[s,n,o,a]=VE(e.color??"#f00")??[0,1,.5,1];a=e.opacity??a;const r=ke("div","ag-charts-color-picker__content");r.innerHTML=AZ,r.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const l=r.querySelector(".ag-charts-color-picker__palette"),c=r.querySelector(".ag-charts-color-picker__hue-input"),h=r.querySelector(".ag-charts-color-picker__multi-color-button"),d=r.querySelector(".ag-charts-color-picker__alpha-input"),u=r.querySelector(".ag-charts-color-picker__color-input"),p=r.querySelector(".ag-charts-color-picker__color-label"),g=v=>{const S={s:"ariaValueColorPalette",v:"ariaValueColorPaletteFirstV"}[v];l.ariaValueText=t.t(S,{s:n,v:o})};this.i18nUpdater=()=>{l.ariaRoleDescription=t.t("ariaRoleDescription2DSlider"),l.ariaLabel=t.t("ariaLabelColorPickerPalette"),c.ariaLabel=t.t("ariaLabelColorPickerHue"),h.ariaLabel=t.t("ariaLabelColorPickerMultiColor"),d.ariaLabel=t.t("ariaLabelColorPickerAlpha"),u.ariaLabel=t.t("ariaLabelColor"),g("s")},this.i18nUpdater(),h.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!e.hasMultiColorOption);const f=(v=!0)=>{const D=iA.fromHSB(s,n,o,a).toHexString();if(r.style.setProperty("--h",`${s}`),r.style.setProperty("--s",`${n}`),r.style.setProperty("--v",`${o}`),r.style.setProperty("--a",`${a}`),r.style.setProperty("--color",D.slice(0,7)),r.style.setProperty("--color-a",D),c.value=`${s}`,d.value=`${a}`,d.classList.toggle("ag-charts-color-picker__alpha-input--opaque",a===1),h.classList.toggle("ag-charts-color-picker__multi-color-button--active",i),p.classList.toggle("ag-charts-color-picker__color-label--multi-color",i),document.activeElement!==u&&(h.ariaChecked=i.toString(),u.value=i?t.t("ariaLabelColorPickerMultiColor"):D.toUpperCase()),v||e.color==null){const C=iA.fromHSB(s,n,o,1).toHexString();e.onChange?.(D,C,a,i)}v&&(this.hasChanged=!0)};f(!1);const x=v=>v.preventDefault(),m=v=>v.stopPropagation(),b=v=>{v.preventDefault();const S=v.currentTarget;S.focus();const D=S.getBoundingClientRect(),C=({clientX:k,clientY:L})=>{i=!1,n=Math.min(Math.max((k-D.left)/D.width,0),1),o=1-Math.min(Math.max((L-D.top)/D.height,0),1),f(),g("s")};C(v);const T=ot(Ze(),"pointermove",C);Ze().addEventListener("pointerup",T,{once:!0})};return r.addEventListener("mousedown",m),r.addEventListener("touchstart",m),r.addEventListener("touchmove",m),r.addEventListener("keydown",v=>{switch(v.stopPropagation(),v.key){case"Enter":case"Escape":this.hide();break;default:return}v.preventDefault()}),l.addEventListener("pointerdown",b),l.addEventListener("touchstart",x,{passive:!1}),l.addEventListener("touchmove",x,{passive:!1}),l.addEventListener("keydown",v=>{if(v.key==="ArrowLeft")n=ve(0,n-.01,1),g("s");else if(v.key==="ArrowRight")n=ve(0,n+.01,1),g("s");else if(v.key==="ArrowUp")o=ve(0,o+.01,1),g("v");else if(v.key==="ArrowDown")o=ve(0,o-.01,1),g("v");else return;v.preventDefault(),f()}),l.addEventListener("focus",()=>{g("s")}),h.addEventListener("click",()=>{i=!i,f()}),c.addEventListener("input",v=>{i=!1,s=v.currentTarget.valueAsNumber??0,f()}),d.addEventListener("input",v=>{i=!1,a=v.currentTarget.valueAsNumber??0,f()}),u.addEventListener("input",v=>{i=!1;const S=VE(v.currentTarget.value);S!=null&&([s,n,o,a]=S,f())}),u.addEventListener("blur",()=>f()),u.addEventListener("keydown",v=>{v.key==="Enter"&&(v.currentTarget.blur(),f())}),{element:r,initialFocus:l}}};function HE(e){return!(e instanceof A.LogScale)&&!(e instanceof A.BandScale)}var IZ=[{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:HE},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:HE}],kZ=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],CZ=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],TZ=[{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"}],LZ=[{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"}],wZ=[{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"}],WE=[{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}],Og=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],$E=[{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:UE,FloatingToolbar:NZ,Menu:sA,PropertiesArray:EZ,ToolbarButtonProperties:YE,ToolbarButtonWidget:OZ,Property:nh}=A,qd=class extends YE{constructor(){super(...arguments),this.checkedOverrides=new YE}};y([nh],qd.prototype,"value",2),y([nh],qd.prototype,"checkedOverrides",2),y([nh],qd.prototype,"color",2),y([nh],qd.prototype,"strokeWidth",2),y([nh],qd.prototype,"isMultiColor",2);var PZ=class extends OZ{update(e){super.update(e),e.value==="line-stroke-width"&&this.updateLineStrokeWidth(e),(e.value==="fill-color"||e.value==="line-color"||e.value==="text-color")&&this.updateFillColor(e)}updateFillColor(e){const t=this.getElement();t.classList.add("ag-charts-annotations__color-picker-button"),t.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",e.isMultiColor),t.style.setProperty("--color",e.color??null)}updateLineStrokeWidth(e){const t=this.getElement();t.classList.add("ag-charts-annotations__stroke-width-button"),t.style.setProperty("--stroke-width",`${e.strokeWidth}px`)}},RZ=class extends NZ{createButtonWidget(){return new PZ(this.localeManager)}},nA=class extends A.BaseProperties{constructor(e,t){super(),this.ctx=e,this.getActiveDatum=t,this.enabled=!0,this.buttons=new EZ(qd),this.cleanup=new mt,this.events=new Io,this.visibleButtons=[],this.toolbar=new RZ(this.ctx,"ariaLabelAnnotationOptionsToolbar","annotation-options"),this.colorPicker=new jE(this.ctx),this.textSizeMenu=new sA(this.ctx,"text-size"),this.lineStyleTypeMenu=new sA(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new sA(this.ctx,"annotations-line-stroke-width"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),e.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),e.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>{this.colorPicker.destroy(),this.toolbar.destroy()})}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){this.cleanup.flush()}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(e){if(!this.enabled)return;const t={"line-style-type":Cl(e),"line-stroke-width":Cl(e),"line-color":xZ(e),"text-color":SZ(e),"fill-color":vZ(e),"text-size":tA(e),settings:Xd(e),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(i=>t[i.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(e)}setAnchorScene(e){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(e.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.events.emit("hid-overlays",null)}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(e){this.updateColorPickerColor("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("text-color",e.getDefaultColor("text-color"),e.getDefaultOpacity("text-color"),"isMultiColor"in e&&e?.isMultiColor)}updateColorPickerColor(e,t,i,s){if(t!=null&&i!=null){const{r:n,g:o,b:a}=UE.fromString(t);t=UE.fromArray([n,o,a,i]).toHexString()}this.updateButtonByValue(e,{color:t,isMultiColor:s})}updateFontSize(e){this.updateButtonByValue("text-size",{label:e!=null?String(e):void 0})}updateLineStyleType(e){this.updateButtonByValue("line-style-type",{icon:e.icon})}updateStrokeWidth(e){this.updateButtonByValue("line-stroke-width",{label:e.label,strokeWidth:e.value})}onButtonPress({event:e,button:t}){const i=this.getActiveDatum();if(i)switch(this.hideOverlays(),t.value){case"line-style-type":{const s=Cl(i)?wg(i.lineDash,i.lineStyle):void 0;this.lineStyleTypeMenu.show({items:Og,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:s,sourceEvent:e.sourceEvent,onPress:n=>this.onLineStyleTypeMenuPress(n,i),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const s=Cl(i)?i.strokeWidth:void 0;this.lineStrokeWidthMenu.show({items:WE,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:s,sourceEvent:e.sourceEvent,onPress:n=>this.onLineStrokeWidthMenuPress(n,i),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":{this.toolbar.toggleActiveButtonByIndex(t.index),this.colorPicker.show({color:i?.getDefaultColor(t.value),opacity:i?.getDefaultOpacity(t.value),sourceEvent:e.sourceEvent,hasMultiColorOption:"isMultiColor"in i,isMultiColor:"isMultiColor"in i&&i?.isMultiColor,onChange:i!=null?this.onColorPickerChange.bind(this,t.value,i):void 0,onChangeHide:(s=>{this.events.emit("saved-color",{type:i.type,colorPickerType:t.value,color:i.getDefaultColor(s)})}).bind(this,t.value)});break}case"text-size":{const s=Ea(i)?i.fontSize:void 0;this.textSizeMenu.show({items:$E,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:s,sourceEvent:e.sourceEvent,onPress:n=>this.onTextSizeMenuPress(n,i),class:"ag-charts-annotations__text-size-menu"});break}case"delete":{this.events.emit("pressed-delete",null);break}case"lock":{i.locked=!i.locked,this.refreshButtons(i),this.events.emit("pressed-lock",null);break}case"settings":{this.toolbar.toggleActiveButtonByIndex(t.index),this.events.emit("pressed-settings",e);break}}}onToolbarMoved(e){const{buttonBounds:t,popoverBounds:i}=e,s={x:i.x,y:i.y+i.height+4},n={y:i.y-4};this.colorPicker.setAnchor(s,n);for(const[o,a]of t.entries()){const r=this.visibleButtons.at(o);if(!r)continue;const l={x:a.x,y:a.y+a.height-1},c={y:a.y};switch(r.value){case"line-stroke-width":this.lineStrokeWidthMenu.setAnchor(l,c);break;case"line-style-type":this.lineStyleTypeMenu.setAnchor(l,c);break;case"text-size":this.textSizeMenu.setAnchor(l,c);break}}}onColorPickerChange(e,t,i,s,n,o){this.events.emit("updated-color",{type:t.type,colorPickerType:e,colorOpacity:i,color:s,opacity:n,isMultiColor:o}),this.updateColorPickerColor(e,i,n,o)}onTextSizeMenuPress(e,t){if(!tA(t))return;const i=e.value;this.events.emit("updated-font-size",{type:t.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(e,t){if(!Cl(t))return;const i=e.value;this.events.emit("updated-line-style",{type:t.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(e)}onLineStrokeWidthMenuPress(e,t){if(!Cl(t))return;const i=e.value;this.events.emit("updated-line-width",{type:t.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(e)}refreshButtons(e){const t=e.locked??!1;for(const[i,s]of this.visibleButtons.entries())s&&(s.value==="lock"?(this.toolbar.toggleSwitchCheckedByIndex(i,t),this.updateButtonByIndex(i,t?s.checkedOverrides.toJson():s.toJson())):this.toolbar.toggleButtonEnabledByIndex(i,!t));tA(e)&&this.updateFontSize(e.fontSize),this.updateColors(e),this.updateLineStyles(e)}updateLineStyles(e){if(!Cl(e))return;const t=e.strokeWidth??1,i=wg(e.lineDash,e.lineStyle);this.updateStrokeWidth({strokeWidth:t,value:t,label:String(t)}),this.updateLineStyleType(Og.find(s=>s.value===i)??Og[0])}updateButtonByValue(e,t){const i=this.visibleButtons.findIndex(s=>s.value===e);i!==-1&&this.updateButtonByIndex(i,t)}updateButtonByIndex(e,t){const i=this.visibleButtons.at(e);i&&this.toolbar.updateButtonByIndex(e,{...i.toJson(),...t,value:t.value??i.value})}};y([nh],nA.prototype,"enabled",2),y([nh],nA.prototype,"buttons",2);var{StateMachine:KE,StateMachineProperty:oA,Vec2:ZE,Debug:BZ}=A,xi=class extends KE{constructor(e){const t=({context:i})=>{this.node?.drag(this.datum,this.offset,i,this.snapping),e.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:i,context:s})=>{this.hasMoved=!1,this.dragStart=i,this.offset=i,this.node?.dragStart(this.datum,i,s)}}},dragging:{keyDown:t,keyUp:t,drag:({offset:i,context:s})=>{this.hasMoved=ZE.lengthSquared(ZE.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,s,this.snapping),e.update()},dragEnd:{target:KE.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&e.recordAction("Move annotation"),e.update()}}}}),this.debug=BZ.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};y([oA()],xi.prototype,"snapping",2),y([oA()],xi.prototype,"datum",2),y([oA()],xi.prototype,"node",2);var{Property:FZ}=A,Tl=class extends JD{constructor(){super(...arguments),this.type="arrow-down"}static is(e){return Fe(e)&&e.type==="arrow-down"}};y([FZ],Tl.prototype,"type",2);var Qd=class extends A.Marker{isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}},XE=class k_ extends A.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(t){const{handle:i,locked:s}=this;return s?{point:{x:i.x,y:i.y},offset:{x:0,y:0}}:{point:t,offset:{x:t.x-i.x,y:t.y-i.y}}}toggleActive(t){this.active=t,t||(this.handle.strokeWidth=k_.INACTIVE_STROKE_WIDTH)}toggleHovered(t){this.glow.visible=!this.locked&&t,this.glow.dirtyPath=!0}toggleDragging(t){this.locked||(this.handle.visible=!t,this.glow.visible=this.glow.visible&&!t,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(t){this.locked=t}getCursor(){}containsPoint(t,i){return this.handle.containsPoint(t,i)}};XE.INACTIVE_STROKE_WIDTH=2;var Ll=XE,aA=class C_ extends Ll{constructor(){super(),this.handle=new Qd({shape:"circle"}),this.glow=new Qd({shape:"circle"}),this.append([this.handle]),this.handle.size=C_.HANDLE_SIZE,this.handle.strokeWidth=Ll.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(t){this.handle.setProperties({...t,strokeWidth:Ll.INACTIVE_STROKE_WIDTH})}drag(t){return{point:t,offset:{x:0,y:0}}}};aA.HANDLE_SIZE=7,aA.GLOW_SIZE=9;var wl=aA,Sx=class pn extends Ll{constructor(){super(),this.handle=new A.Rect,this.glow=new A.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=pn.CORNER_RADIUS,this.handle.width=pn.HANDLE_SIZE,this.handle.height=pn.HANDLE_SIZE,this.handle.strokeWidth=Ll.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=pn.CORNER_RADIUS,this.glow.width=pn.GLOW_SIZE,this.glow.height=pn.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){if(super.toggleLocked(t),t){const i=(pn.HANDLE_SIZE-wl.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=i,this.handle.y+=i,this.handle.width=wl.HANDLE_SIZE,this.handle.height=wl.HANDLE_SIZE,this.glow.width=wl.GLOW_SIZE,this.glow.height=wl.GLOW_SIZE}else this.handle.cornerRadius=pn.CORNER_RADIUS,this.handle.width=pn.HANDLE_SIZE,this.handle.height=pn.HANDLE_SIZE,this.glow.width=pn.GLOW_SIZE,this.glow.height=pn.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(t){if(this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked){delete t.fill,delete t.strokeWidth;const i=(pn.HANDLE_SIZE-wl.HANDLE_SIZE)/2;t.x-=i,t.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(t),this.glow.setProperties({...t,x:(t.x??this.glow.x)-2,y:(t.y??this.glow.y)-2,strokeWidth:0,fill:t.stroke})}drag(t){return this.locked?{point:t,offset:{x:0,y:0}}:this.gradient==="vertical"?{point:{x:t.x,y:this.handle.y},offset:{x:t.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:t.y},offset:{x:0,y:t.y-this.handle.y}}}getCursor(){if(!this.locked)return this.gradient==="vertical"?"col-resize":"row-resize"}};Sx.HANDLE_SIZE=12,Sx.GLOW_SIZE=16,Sx.CORNER_RADIUS=4;var Jd=Sx,rA=class Df extends Ll{constructor(){super(),this.handle=new Qd({shape:"circle"}),this.glow=new Qd({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=Df.HANDLE_SIZE,this.handle.strokeWidth=Ll.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=Df.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){super.toggleLocked(t),t?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=wl.HANDLE_SIZE,this.glow.size=wl.GLOW_SIZE):(this.handle.size=Df.HANDLE_SIZE,this.glow.size=Df.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"}};rA.HANDLE_SIZE=11,rA.GLOW_SIZE=17;var Xt=rA,{ZIndexMap:zZ}=A,qi=class extends A.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=zZ.CHART_ANNOTATION}static isCheck(e,t){return Fe(e)&&Object.hasOwn(e,"type")&&e.type===t}toggleHovered(e){this.toggleHandles(e)}computeBBoxWithoutHandles(){return A.Transformable.toCanvas(this,A.Group.computeChildrenBBox(this.excludeChildren({instance:Ll})))}updateNode(e,t,i){if(!i&&t){this.removeChild(t);return}return i&&t==null&&(t=new e,this.appendChild(t)),t}},{ContinuousScale:_Z,Vec2:po,toRadians:GZ}=A;function Pg(e,t,i=!1,s,n=1){if(!i)return Ys(e,t);const o=s?Zt(s,t):po.origin();return Ys(Mx(e,o,n),t)}function Mx(e,t,i){const s=po.sub(e,t),n=GZ(i),o=Math.round(po.angle(s)/n)*n;return po.rotate(s,o,t)}function Dx(e,t){const i={};for(const[s,n]of Et(e))i[s]=Zt(n,t);return i}function Tr(e,t,i,s={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:n,yAxis:o}=i,a=Object.keys(e),r=[],l=[],c=new Set(s.translateVectors??a),h=new Set(s.invertYVectors??[]),d=new Set([...c,...h]),u=po.multiply(t,po.from(1,-1));for(const m of a)d.has(m)&&(e[m]=po.add(e[m],h.has(m)?u:t),s.snap&&(e[m]=Mx(e[m],s.snap.vectors[m],s.snap.angle))),r.push(n.getRangeOverflow(e[m].x)),l.push(o.getRangeOverflow(e[m].y));const p=(m,b)=>Math.abs(m)-Math.abs(b),g=(m,b,v)=>s.overflowContinuous===0||!_Z.is(m)?v.toSorted(p).at(-1)??0:a.length===d.size?v.toSorted(p).at(-s.overflowContinuous-1)??0:v.filter(D=>D!==0).length<=s.overflowContinuous?0:v.filter((D,C)=>D!==0&&Math.abs(D)<=Math.abs(b)&&d.has(a[C])).toSorted(p).at(-1)??0,f=po.from(g(n.scale,t.x,r),g(o.scale,t.y,l));if(!po.equal(f,po.origin()))for(const m of a)d.has(m)&&(e[m]=po.round(po.sub(e[m],f),4));const x={};for(const m of a)x[m]=Ys(e[m],i);return x}var{Vec2:VZ}=A,qE=class extends qi{constructor(){super(...arguments),this.handle=new Xt,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=Zt(e,t);this.updateHandle(e,i),this.anchor=this.updateAnchor(e,i,t)}dragStart(e,t,i){this.dragState={offset:t,...Dx({handle:e},i)}}drag(e,t,i){const{dragState:s}=this;if(e.locked||!s)return;const{point:n}=Tr({point:s.handle},VZ.sub(t,s.offset),i);e.x=n.x,e.y=n.y}translate(e,t,i){if(e.locked)return;const{point:s}=Tr({point:Zt(e,i)},t,i);e.x=s.x,e.y=s.y}toggleHandles(e){this.handle.visible=!!e,this.handle.toggleHovered(this.activeHandle==="handle")}toggleActive(e){this.toggleHandles(e),this.handle.toggleActive(e)}stopDragging(){this.handle.toggleDragging(!1)}copy(e,t,i){const s=Zt(e,i),n=Ys({x:s.x-30,y:s.y-30},i);return t.x=n.x,t.y=n.y,t}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{handle:i}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="handle",!0):!1}getNodeAtCoords(e,t){if(this.handle.containsPoint(e,t))return"handle"}updateHandle(e,t,i){const{x:s,y:n}=this.getHandleCoords(e,t,i),o=this.getHandleStyles(e);this.handle.update({...o,x:s,y:n}),this.handle.toggleLocked(e.locked??!1)}updateAnchor(e,t,i){const s=this.getHandleCoords(e,t);return{x:s.x+i.seriesRect.x,y:s.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i){return{x:t.x,y:t.y}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},QE=class extends qE{constructor(){super(),this.append([this.handle])}update(e,t){super.update(e,t);const i=Zt(e,t);this.updateShape(e,i)}updateShape(e,t){this.updateShapeStyles(e),this.updateShapePath(e,t)}updateShapeStyles(e){const{shape:t}=this;t.fill=e.fill,t.fillOpacity=e.fillOpacity??1}updateShapePath(e,t){const{shape:i}=this;i.x=t.x,i.y=t.y,i.size=e.size}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}getNodeAtCoords(e,t){return this.shape.containsPoint(e,t)?"shape":super.getNodeAtCoords(e,t)}},JE=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function eO(e){A.drawMarkerUnitPolygon(e,JE)}eO.anchor={x:.5,y:0};var Ax=class extends QE{constructor(){super(),this.type="arrow-up",this.shape=new Qd({shape:eO}),this.append([this.shape])}static is(e){return qi.isCheck(e,"arrow-up")}getHandleCoords(e,t){const i=Xt.HANDLE_SIZE/2,s=super.getHandleCoords(e,t);return s.y-=i,s}},jZ=JE.map(([e,t])=>[e,1-t]);function tO(e){A.drawMarkerUnitPolygon(e,jZ)}tO.anchor={x:.5,y:1};var Ix=class extends QE{constructor(){super(),this.type="arrow-down",this.shape=new Qd({shape:tO}),this.append([this.shape])}static is(e){return qi.isCheck(e,"arrow-down")}updateAnchor(e,t,i){const s=super.updateAnchor(e,t,i);return s.y-=e.size,s}getHandleCoords(e,t){const i=Xt.HANDLE_SIZE/2,s=super.getHandleCoords(e,t);return s.y+=i,s}},{StateMachine:kx,StateMachineProperty:HZ,Debug:WZ}=A,lA=class extends kx{constructor(e){const t=({point:s})=>{const n=this.createDatum();n.set({x:s.x,y:s.y}),e.create(n)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},cancel:kx.parent,reset:kx.parent},"waiting-first-render":{render:{target:kx.parent,action:i}}}),this.debug=WZ.create(!0,"annotations")}};y([HZ()],lA.prototype,"node",2);var $Z=class extends lA{createDatum(){return new Tl}},iO={type:"arrow-down",datum:Tl,scene:Ix,isDatum:Tl.is,translate:(e,t,i,s)=>{Tl.is(t)&&Ix.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Tl.is(t)&&Tl.is(i)&&Ix.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Tl.is(t)&&Ix.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new $Z({...e,create:t("arrow-down")}),dragState:e=>new xi(e)},{Property:UZ}=A,Nl=class extends JD{constructor(){super(...arguments),this.type="arrow-up"}static is(e){return Fe(e)&&e.type==="arrow-up"}};y([UZ],Nl.prototype,"type",2);var YZ=class extends lA{createDatum(){return new Nl}},sO={type:"arrow-up",datum:Nl,scene:Ax,isDatum:Nl.is,translate:(e,t,i,s)=>{Nl.is(t)&&Ax.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Nl.is(t)&&Nl.is(i)&&Ax.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Nl.is(t)&&Ax.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new YZ({...e,create:t("arrow-up")}),dragState:e=>new xi(e)},{Vec2:KZ,Vec4:nO}=A,oO=class extends qi{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:e,y1:t,x2:i,y2:s},n,o){const a={x1:e,y1:t,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return a;const[r,l]=eZ(a,o.yAxis.bounds),c=a.x2<a.x1,h=a.y1>=a.y2,d=a.x2===a.x1;return n.extendEnd&&(d?a.y2=h?l.y:r.y:(a.x2=c?r.x:l.x,a.y2=c?r.y:l.y)),n.extendStart&&(d?a.y1=h?r.y:l.y:(a.x1=c?l.x:r.x,a.y1=c?l.y:r.y)),a}dragStart(e,t,i){this.dragState={offset:t,...Dx({start:e.start,end:e.end},i)}}drag(e,t,i,s){e.locked||(this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints(e,s.start,s.end,KZ.sub(t,s.offset),i)}translate(e,t,i){e.locked||this.translatePoints(e,Zt(e.start,i),Zt(e.end,i),t,i)}copy(e,t,i){const s=Us(e,i);if(!s)return;const n=this.computeBBoxWithoutHandles(),o={x:-n.width/2,y:-n.height/2};return this.translatePoints(t,nO.start(s),nO.end(s),o,i),t}translatePoints(e,t,i,s,n){const o=this.getTranslatePointsVectors(t,i),a=Tr(o,s,n,{overflowContinuous:this.overflowContinuous});e.start.x=a.start.x,e.end.x=a.end.x,e.start.y=a.start.y,e.end.y=a.end.y}getTranslatePointsVectors(e,t){return{start:e,end:t}}},{Vec2:ZZ,Vec4:aO}=A,cA=class extends oO{constructor(){super(...arguments),this.start=new Xt,this.end=new Xt,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=Us(e,t);i!=null&&(this.updateHandles(e,i),this.updateAnchor(e,i,t))}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e;else for(const[t,i]of Et(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}dragHandle(e,t,i,s){const{activeHandle:n,dragState:o}=this;if(!n||!o)return;this[n].toggleDragging(!0);const a=n==="start"?"end":"start",r=s?{vectors:{[n]:Zt(e[a],i)},angle:e.snapToAngle}:void 0,{[n]:l}=Tr({[n]:o[n]},ZZ.sub(t,o.offset),i,{overflowContinuous:0,snap:r});e[n].x=l.x,e[n].y=l.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):!1}getNodeAtCoords(e,t){if(this.start.containsPoint(e,t)||this.end.containsPoint(e,t))return"handle"}updateHandles(e,t,i){this.start.update({...this.getHandleStyles(e,"start"),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e,"end"),...this.getHandleCoords(e,t,"end",i)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}updateAnchor(e,t,i,s){this.anchor={x:t.x1+i.seriesRect.x,y:t.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i,s){return i==="start"?aO.start(t):aO.end(t)}getHandleStyles(e,t){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},{Vec4:rO}=A,XZ=class extends cA{constructor(){super(...arguments),this.label=new A.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualStartEndScene")}update(e,t){const i=Us(e,t);if(i==null)return;const s=this.getTextBBox(e,i);this.updateLabel(e,s,i),this.updateHandles(e,i,s),this.updateShape(e,s,i),this.updateAnchor(e,i,t,s)}containsPoint(e,t){return super.containsPoint(e,t)||this.label.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t){const{text:i}=e.getText();return QD(e,i,rO.end(t),this.textInputBBox)}updateLabel(e,t,i){const{text:s,isPlaceholder:n}=e.getText();EE(this.label,s,n,e,this.getLabelCoords(e,t,i))}updateShape(e,t,i){}getLabelCoords(e,t,i){return rO.end(i)}getHandleStyles(e,t){return{...super.getHandleStyles(e,t),stroke:e.handle.stroke??e.color}}},{drawCorner:qZ,Path:QZ}=A,Cx=class extends XZ{constructor(){super(),this.type="callout",this.shape=new QZ,this.append([this.shape,this.label,this.start,this.end])}static is(e){return qi.isCheck(e,"callout")}drag(e,t,i,s){e.locked||(this.activeHandle==="end"?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}getLabelCoords(e,t,i){const s=e.getPadding(),{bodyBounds:n={x:0,y:0,width:0,height:0}}=this.getDimensions(e,t,i)??{};return{x:n.x+s.left,y:n.y-s.bottom}}getHandleStyles(e,t){return t==="start"?{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(e,t,i,s){const{bodyBounds:n}=this.getDimensions(e,s,t)??{},o=n??s;this.anchor={x:o.x+i.seriesRect.x,y:o.y+i.seriesRect.y-o.height,position:this.anchor.position}}updateShape(e,t,i){const{shape:s}=this;s.fill=e.fill,s.fillOpacity=e.fillOpacity??1,s.stroke=e.stroke,s.strokeWidth=e.strokeWidth??1,s.strokeOpacity=e.strokeOpacity??1;const{tailPoint:n,bodyBounds:o}=this.getDimensions(e,t,i)??{};!n||!o||this.updatePath(n,o)}updatePath(e,t){const{x:i,y:s}=e,{x:n,y:o,width:a,height:r}=t,l=o-r,c=n+a,h=this.calculateCalloutPlacement({x:i,y:s},t),d=8,u=[{coordinates:{x0:n,x1:n+d,y0:l+d,y1:l,cx:h==="topLeft"?i:n+d,cy:h==="topLeft"?s:l+d},type:h==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:n+d,x1:c-d,y0:l,y1:l,cx:i,cy:s},type:h==="top"?"calloutSide":"side"},{coordinates:{x0:c-d,x1:c,y0:l,y1:l+d,cx:h==="topRight"?i:c-d,cy:h==="topRight"?s:l+d},type:h==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+d,y1:o-d,cx:i,cy:s},type:h==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-d,y0:o-d,y1:o,cx:h==="bottomRight"?i:c-d,cy:h==="bottomRight"?s:o-d},type:h==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-d,x1:n+d,y0:o,y1:o,cx:i,cy:s},type:h==="bottom"?"calloutSide":"side"},{coordinates:{x0:n+d,x1:n,y0:o,y1:o-d,cx:h==="bottomLeft"?i:n+d,cy:h==="bottomLeft"?s:o-d},type:h==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:n,x1:n,y0:o-d,y1:l+d,cx:i,cy:s},type:h==="left"?"calloutSide":"side"}],{path:p}=this.shape;p.clear(),p.moveTo(n,l+d),u.forEach(({coordinates:g,type:f})=>{this.drawPath(p,g,d,f)}),p.closePath()}drawPath(e,{x0:t,y0:i,x1:s,y1:n,cx:o,cy:a},r,l){switch(l){case"calloutCorner":{e.lineTo(o,a),e.lineTo(s,n);break}case"corner":{qZ(e,{x0:t,x1:s,y0:i,y1:n,cx:o,cy:a},r,!1);break}case"calloutSide":{if(t!==s){const h=t>s?-1:1,d=Math.min(t,s)+Math.abs(s-t)/2;e.lineTo(d-6*h,i),e.lineTo(o,a),e.lineTo(d+6*h,i),e.lineTo(s,n)}else{const h=i>n?-1:1,d=Math.min(i,n)+Math.abs(i-n)/2;e.lineTo(t,d-6*h),e.lineTo(o,a),e.lineTo(t,d+6*h),e.lineTo(s,n)}break}case"side":default:{e.lineTo(s,n);break}}}calculateCalloutPlacement(e,t){const i=t.x+t.width,s=t.y-t.height;let n,o;return e.x>i?n="right":e.x<t.x&&(n="left"),e.y>t.y?o="bottom":e.y<s&&(o="top"),n&&o?`${o}${n[0].toUpperCase()}${n.substring(1)}`:o??n}getDimensions(e,t,i){const{fontSize:s}=e,n=e.getPadding(),o=n.left+n.right,a=n.top+n.bottom,r=t.width+o,l=Math.max(t.height+a,s+a);return{tailPoint:{x:i.x1,y:i.y1},bodyBounds:{x:t.x,y:t.y,width:r,height:l}}}containsPoint(e,t){const{start:i,end:s,shape:n}=this;if(this.activeHandle=void 0,i.containsPoint(e,t))return this.activeHandle="start",!0;const o=s.containsPoint(e,t)||n.containsPoint(e,t);return o&&(this.activeHandle="end"),o}};function hA({key:e}){return e==="Escape"}function dA({key:e,shiftKey:t}){return!t&&e==="Enter"}var{StateMachine:Uo,StateMachineProperty:lO,Debug:JZ}=A,uA=class extends Uo{constructor(e){const t=({point:u})=>{const p=this.createDatum();p.set({start:u,end:u,visible:!0}),e.create(p)},i=()=>{const{node:u}=this;u?.toggleActive(!0),u?.toggleHandles({start:!0})},s=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},n=()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},o=u=>{this.node?.setTextInputBBox(u),e.update()},a=({point:u})=>{const{datum:p,node:g}=this;p?.set({end:u}),g?.toggleActive(!0),g?.toggleHandles({end:!1}),e.update()},r=()=>{e.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:u,colorOpacity:p,color:g,opacity:f,isMultiColor:x})=>{const{datum:m}=this;m&&(u==="text-color"&&e.updateTextInputColor(g),vx(m,u,p,g,f,x),e.update())},c=u=>{const{datum:p,node:g}=this;!p||!g||!Ea(p)||(p.fontSize=u,e.updateTextInputFontSize(u),e.update())},h=()=>{e.delete()},d=({textInputValue:u,bbox:p})=>{const{datum:g}=this;if(p!=null&&u!=null&&u.length>0){if(!Ea(g))return;const f=gx(g,u,p.width);g?.set({text:f}),e.update(),e.recordAction(`Create ${g?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:Uo.parent,reset:Uo.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:a,drag:a,click:{target:"edit",action:r},dragEnd:{target:"edit",action:r},reset:{target:Uo.parent,action:h},cancel:{target:Uo.parent,action:h}},edit:{onEnter:s,updateTextInputBBox:o,color:l,fontSize:c,textInput:[{guard:hA,target:Uo.parent,action:h},{guard:dA,target:Uo.parent,action:d}],click:{target:Uo.parent,action:d},dragStart:{target:Uo.parent,action:d},resize:{target:Uo.parent,action:d},onExit:n,cancel:{target:Uo.parent,action:h}}}),this.debug=JZ.create(!0,"annotations")}};y([lO()],uA.prototype,"datum",2),y([lO()],uA.prototype,"node",2);var eX=class extends uA{createDatum(){return new $o}},cO={type:"callout",datum:$o,scene:Cx,isDatum:$o.is,translate:(e,t,i,s)=>{if($o.is(t)&&Cx.is(e))return e.translate(t,i,s)},copy:(e,t,i,s)=>{if($o.is(t)&&$o.is(i)&&Cx.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{$o.is(t)&&Cx.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new eX({...e,create:t("callout")}),dragState:e=>new xi(e)},pA=class extends qE{constructor(){super(...arguments),this.label=new A.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualPointScene")}update(e,t){const i=Zt(e,t),s=this.getTextBBox(e,i,t);this.updateLabel(e,s),this.updateHandle(e,i,s),this.updateShape(e,s),this.anchor=this.updateAnchor(e,s,t)}copy(e,t,i){const s=Zt(e,i),n=this.getTextBBox(e,s,i),o=e.getPadding(),a=o.left+o.right,r=o.top+o.bottom,l=(n.width+a)/2,c=n.height+r,h=Ys({x:s.x-l,y:s.y-c},i);return t.x=h.x,t.y=h.y,t}containsPoint(e,t){const{label:i}=this;return super.containsPoint(e,t)||i.visible&&i.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.visible&&this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t,i){const{text:s}=e.getText();return QD(e,s,{x:t.x,y:t.y},this.textInputBBox)}updateLabel(e,t){const{text:i,isPlaceholder:s}=e.getText();EE(this.label,i,s,e,this.getLabelCoords(e,t),this.getTextBaseline(e))}updateShape(e,t){}updateAnchor(e,t,i){return{x:t.x+i.seriesRect.x,y:t.y+i.seriesRect.y-t.height,position:this.anchor.position}}getLabelCoords(e,t){return t}getTextBaseline(e){return e.position=="center"?"middle":e.position}getHandleCoords(e,t,i){return i}getHandleStyles(e){const t=super.getHandleStyles(e);return t.stroke=e.handle.stroke??e.color,t}},{drawCorner:gA}=A,Tx=class extends pA{constructor(){super(),this.type="comment",this.shape=new A.Path,this.append([this.shape,this.label,this.handle])}static is(e){return qi.isCheck(e,"comment")}updateShape(e,t){const{shape:i}=this;i.fill=e.fill,i.fillOpacity=e.fillOpacity??1,i.stroke=e.stroke??"transparent",i.strokeWidth=e.strokeWidth??1,i.strokeOpacity=e.strokeOpacity??1,this.updatePath(e,t)}getLabelCoords(e,t){const i=e.getPadding();return{x:t.x+i.left,y:t.y-i.bottom}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}updateAnchor(e,t,i){const s=super.updateAnchor(e,t,i),n=e.getPadding();return s.y-=n.bottom+n.top,s}updatePath(e,t){const i=e.getPadding(),{x:s,y:n}=t;let{width:o,height:a}=t;const{fontSize:r}=e,l=i.left+i.right,c=i.top+i.bottom;o=o+l,a=Math.max(a+c,r+c);const h=n-a,d=s+o,u=(r*Ng+c)/2,{path:p}=this.shape;p.clear(),p.moveTo(s,n),p.lineTo(s,h+u),gA(p,{x0:s,x1:s+u,y0:h+u,y1:h,cx:s+u,cy:h+u},u,!1),p.lineTo(d-u,h),gA(p,{x0:d-u,x1:d,y0:h,y1:h+u,cx:d-u,cy:h+u},u,!1),p.lineTo(d,n-u),gA(p,{x0:d,x1:d-u,y0:n-u,y1:n,cx:d-u,cy:n-u},u,!1),p.closePath()}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}},{StateMachine:Lr,StateMachineProperty:hO,Debug:tX}=A,Rg=class extends Lr{constructor(e){const t=({point:h})=>{const d=this.createDatum();d.set({x:h.x,y:h.y}),e.create(d)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()},s=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},n=()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},o=h=>{this.node?.setTextInputBBox(h),e.update()},a=({colorPickerType:h,colorOpacity:d,color:u,opacity:p,isMultiColor:g})=>{this.datum&&(h==="text-color"&&e.updateTextInputColor(u),vx(this.datum,h,d,u,p,g),e.update())},r=h=>{const{datum:d,node:u}=this;!d||!u||!Ea(d)||(d.fontSize=h,e.updateTextInputFontSize(h),e.update())},l=()=>{e.delete()},c=({textInputValue:h,bbox:d})=>{if(d!=null&&h!=null&&h.length>0){const{datum:u}=this;if(!Ea(u))return;const p=gx(u,h,d.width);u?.set({text:p}),e.update(),e.recordAction(`Create ${u?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:Lr.parent,reset:Lr.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:s,updateTextInputBBox:o,color:a,fontSize:r,textInput:[{guard:hA,target:Lr.parent,action:l},{guard:dA,target:Lr.parent,action:c}],click:{target:Lr.parent,action:c},dragStart:{target:Lr.parent,action:c},resize:{target:Lr.parent,action:c},onExit:n,cancel:{target:Lr.parent,action:l}}}),this.debug=tX.create(!0,"annotations")}};y([hO()],Rg.prototype,"datum",2),y([hO()],Rg.prototype,"node",2);var iX=class extends Rg{createDatum(){return new La}},dO={type:"comment",datum:La,scene:Tx,isDatum:La.is,translate:(e,t,i,s)=>{La.is(t)&&Tx.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(La.is(t)&&La.is(i)&&Tx.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{La.is(t)&&Tx.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new iX({...e,create:t("comment")}),dragState:e=>new xi(e)},{calculateLabelTranslation:sX}=A,uO=class extends A.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new A.Text({zIndex:1}),this.rect=new A.Rect;const{label:e}=this;e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.textBaseline="middle",e.textAlign="center",this.append([this.rect,this.label])}update(e){this.updateLabel(e),this.updateRect(e),this.updatePosition(e)}updateLabel({value:e,styles:t,context:i}){const{fontWeight:s,fontSize:n,fontStyle:o,fontFamily:a,textAlign:r,color:l="white",formatter:c}=t,h=c?c({value:e}):i.formatScaleValue(e,"annotation-label");this.label.setProperties({fontWeight:s,fontSize:n,fontStyle:o,fontFamily:a,textAlign:r,fill:l,text:h})}updateRect({styles:e}){const{rect:t}=this,{cornerRadius:i,fill:s,fillOpacity:n,stroke:o,strokeOpacity:a}=e;t.fill=s,t.fillOpacity=n??1,t.stroke=o,t.strokeOpacity=a??1,t.cornerRadius=i??0}updatePosition({x:e,y:t,context:i,styles:{padding:s}}){const{label:n,rect:o}=this,a=n.getBBox()?.clone(),r=s??8,l=s??4,{xTranslation:c,yTranslation:h}=sX({yDirection:!0,padding:i.labelPadding,position:i.position??"left",bbox:a});a.grow(r,"horizontal"),a.grow(l,"vertical");const d=e+c,u=t+h;n.x=d,n.y=u,o.y=u-Math.round(a.height/2),o.x=d-Math.round(a.width/2),o.height=a.height,o.width=a.width}};uO.className="AxisLabel";var{Vec2:Oa}=A,an=class extends A.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(e){return super.setProperties(e),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:e,strokeWidth:t,x1:i,y1:s,x2:n,y2:o}=this;let a=t+e;a%2===0&&(a+=1);const r=Oa.from(i,s-Math.floor(a/2)),l=Oa.from(n,o),c=Oa.distance(r,l);this.collisionBBox=new A.BBox(r.x,r.y,c,a)}isPointInPath(e,t){const{collisionBBox:i,x1:s,y1:n,x2:o,y2:a}=this;if(!i)return!1;const r=Oa.from(s,n),l=Oa.from(o,a),c=Oa.sub(Oa.from(e,t),r),h=Oa.sub(l,r),d=Oa.rotate(c,Oa.angle(c,h),r);return i.containsPoint(d.x,d.y)??!1}render(e){const{clipMask:t}=this,{ctx:i}=e;if(t.size===0){super.render(e);return}i.save();try{for(const s of this.clipMask.values()){const{x:n,y:o,radius:a}=s;i.beginPath(),i.rect(0,0,i.canvas.width,i.canvas.height),i.ellipse(n,o,a,a,0,Math.PI*2,0,!0),i.clip()}super.render(e)}finally{i.restore()}}setClipMask(e,t){const i=this.clipMask.get(e);A.jsonDiff(i,t)!=null&&this.markDirty("CollidableLine"),t?this.clipMask.set(e,t):this.clipMask.delete(e)}},oh=class extends A.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(e,t){const i=this.fromParentPoint(e,t),s=this.computeBBoxWithoutTransforms();return s?s.grow(this.growCollisionBox).containsPoint(i.x,i.y):!1}},{Vec2:Ps}=A;function eu(e,t,i,s,n,o,a){if(!o||!n||!s){t.setClipMask(e);return}const{alignment:r,position:l}=s,c=gO(i,s.fontSize,a),{point:h,textBaseline:d}=fO(c,l,r);yO(n,o,s,h,c.angle,d);const{x:u,y:p,width:g,height:f}=n.getBBox(),x=Ps.length(Ps.from(g,f)),m={x:u+g/2,y:p+f/2,radius:x/2+Ps.length(c.offset)};return l==="center"?t.setClipMask(e,m):t.setClipMask(e),{clipMask:m,numbers:c}}function pO(e,t,i,s,n,o,a){if(!a||!o)return;const{alignment:r,position:l}=s,[c,h]=t.y1<=i.y1?[t,i]:[i,t];let d=c;l==="bottom"?d=h:l==="inside"&&(d={x1:(c.x1+h.x1)/2,y1:(c.y1+h.y1)/2,x2:(c.x2+h.x2)/2,y2:(c.y2+h.y2)/2});const u=gO(d,s.fontSize,n),{point:p,textBaseline:g}=fO(u,l==="inside"?"center":l,r,e);yO(o,a,s,p,u.angle,g)}function gO(e,t,i){let[s,n]=Ps.from(e);s.x>n.x&&([s,n]=[n,s]);const o=Ps.normalized(Ps.sub(n,s)),a=Ps.angle(o),r=Ps.multiply(o,Xt.HANDLE_SIZE/2+(t??14)/2),l=Ps.multiply(o,(i??2)/2+(t??14)/3);return{left:s,right:n,normal:o,angle:a,inset:r,offset:l}}function fO({left:e,right:t,normal:i,angle:s,inset:n,offset:o},a,r,l){let c;r==="right"?c=Ps.sub(t,n):r==="center"?c=Ps.add(e,Ps.multiply(i,Ps.distance(e,t)/2)):c=Ps.add(e,n);let h="bottom";return a==="bottom"?(c=Ps.rotate(o,s+Math.PI/2,c),h="top"):a==="center"&&!l?h="middle":c=Ps.rotate(o,s-Math.PI/2,c),{point:c,textBaseline:h}}function yO(e,t,i,s,n,o){e.setProperties({text:t,x:s.x,y:s.y,rotation:n,rotationCenterX:s.x,rotationCenterY:s.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:o})}var{ChartAxisDirection:nX,Vec2:ah,Vec4:fA}=A,El=class extends qi{constructor(){super(),this.type="cross-line",this.line=new an,this.middle=new Jd,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(e){return qi.isCheck(e,"cross-line")}update(e,t){const{seriesRect:i}=t;this.seriesRect=i,this.isHorizontal=Os.is(e);const s=this.isHorizontal?t.yAxis:t.xAxis,n=this.convertCrossLine(e,s);if(n==null){this.visible=!1;return}this.visible=e.visible??!0,this.visible&&(this.updateLine(e,n),this.updateHandle(e,n),this.updateText(e,n),this.updateAxisLabel(e,s,n))}updateLine(e,t){const{line:i}=this,{lineDashOffset:s,stroke:n,strokeWidth:o,strokeOpacity:a}=e,{x1:r,y1:l,x2:c,y2:h}=t;i.setProperties({x1:r,y1:l,x2:c,y2:h,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:s,stroke:n,strokeWidth:o,strokeOpacity:a,fillOpacity:0})}updateHandle(e,t){const{middle:i}=this,{locked:s,stroke:n,strokeWidth:o,strokeOpacity:a}=e,r={fill:e.handle.fill,stroke:e.handle.stroke??n,strokeOpacity:e.handle.strokeOpacity??a,strokeWidth:e.handle.strokeWidth??o},l=ah.sub(fA.center(t),ah.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...r,...l}),i.toggleLocked(s??!1)}updateText(e,t){this.text=this.updateNode(oh,this.text,!!e.text.label),eu(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}createAxisLabel(e){const t=new uO;return e.attachLabel(t),t}updateAxisLabel(e,t,i){this.axisLabel??(this.axisLabel=this.createAxisLabel(t));const{axisLabel:s,seriesRect:n}=this,{direction:o,position:a}=t;if(e.axisLabel.enabled){s.visible=this.visible;const r=a==="left"||a==="top"?fA.start(i):fA.end(i),l=o===nX.X?r.x:r.y;if(!t.inRange(l)){s.visible=!1;return}const c=Ri(e.value);s.update({...ah.add(r,ah.required(n)),value:c,styles:e.axisLabel,context:t})}else s.visible=!1}setAxisLabelOpacity(e){this.axisLabel&&(this.axisLabel.opacity=e)}setAxisLabelVisible(e){this.axisLabel&&(this.axisLabel.visible=e)}toggleHandles(e){this.middle.visible=e,this.middle.toggleHovered(this.activeHandle==="middle")}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(e){this.toggleHandles(e),this.middle.toggleActive(e)}dragStart(e,t,i){const s=Os.is(e)?{x:t.x,y:vr(e.value,i.yAxis)}:{x:vr(e.value,i.xAxis),y:t.y};this.dragState={offset:t,middle:s}}drag(e,t,i){const{activeHandle:s,dragState:n}=this;e.locked||!n||(s&&this[s].toggleDragging(!0),this.translatePoint(e,n.middle,ah.sub(t,n.offset),i))}translate(e,t,i){if(e.locked)return;const s=Os.is(e)?ah.from(0,vr(e.value,i.yAxis)):ah.from(vr(e.value,i.xAxis),0);this.translatePoint(e,s,t,i)}translatePoint(e,t,i,s){const n=Os.is(e);n?i.x=0:i.y=0;const{point:o}=Tr({point:t},i,s);e.value=n?o.y:o.x}stopDragging(){this.middle.toggleDragging(!1)}copy(e,t,i){const s=Os.is(e),n=this.isHorizontal?i.yAxis:i.xAxis,o=this.convertCrossLine(e,n);if(!o)return;const a=s?-30:0,r=s?0:-30,l=Ys({x:o.x1+r,y:o.y1+a},i);return t.set({value:s?l.y:l.x}),t}getCursor(){return this.activeHandle==null?"pointer":this[this.activeHandle].getCursor()}containsPoint(e,t){const{middle:i,line:s,text:n}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="middle",!0):s.isPointInPath(e,t)||!!n?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.line.isPointInPath(e,t))return"line";if(this.middle.containsPoint(e,t))return"handle"}getAnchor(){const e=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:e.x+e.width/2,y:e.y}:{x:e.x+e.width,y:e.y+e.height/2,position:"right"}}convertCrossLine(e,t){if(e.value==null)return;let i=0,s=0,n,o;const{bounds:a}=t,r=vr(e.value,t);return Os.is(e)?(n=a.width,s=r,o=r):(i=r,n=r,o=a.height),{x1:i,y1:s,x2:n,y2:o}}},{StateMachine:Lx,StateMachineProperty:oX,Debug:aX}=A,yA=class extends Lx{constructor(e,t){const i=({point:n})=>{const o=e==="horizontal",a=o?new Os:new wa;a.set({value:o?n.y:n.x}),t.create(a),t.recordAction(`Create ${o?"horizontal-line":"vertical-line"} annotation`)},s=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:Lx.parent,cancel:Lx.parent},"waiting-first-render":{render:{target:Lx.parent,action:s}}}),this.debug=aX.create(!0,"annotations")}};y([oX()],yA.prototype,"node",2);var mO={type:"horizontal-line",datum:Os,scene:El,isDatum:Os.is,translate:(e,t,i,s)=>{Os.is(t)&&El.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Os.is(t)&&Os.is(i)&&El.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Os.is(t)&&El.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new yA("horizontal",{...e,create:t("horizontal-line")}),dragState:e=>new xi(e)},xO={type:"vertical-line",datum:wa,scene:El,isDatum:wa.is,translate:(e,t,i,s)=>{wa.is(t)&&El.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(wa.is(t)&&wa.is(i)&&El.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{wa.is(t)&&El.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new yA("vertical",{...e,create:t("vertical-line")}),dragState:e=>new xi(e)},{Vec4:rX}=A,bO=class{static updateBackground(e,t,i,s){const{background:n}=this,{seriesRect:o}=s;n.path.clear(!0);const a=rX.from(0,0,o.width,o.height),r=this.getBackgroundPoints(e,t,i,a);for(let c=0;c<r.length;c++){const h=r[c];c===0?n.path.moveTo(h.x,h.y):n.path.lineTo(h.x,h.y)}n.path.closePath(),n.checkPathDirty();const l=this.getBackgroundStyles?.(e)??e.background;n.fill=l.fill,n.fillOpacity=l.fillOpacity??1}},vO=class extends oO{constructor(){super(...arguments),this.handles={},this.overflowContinuous=2,this.topLine=new an,this.bottomLine=new an,this.background=new A.Path({zIndex:-1}),this.anchor={x:0,y:0},this.updateBackground=bO.updateBackground.bind(this)}update(e,t){const{locked:i,visible:s}=e,n=Us(e,t),o=Us(e.bottom,t);if(n==null||o==null){this.visible=!1;return}else this.visible=s??!0;const a=this.extendLine(n,e,t),r=this.extendLine(o,e,t);this.updateLines(e,a,r,t,n,o),this.updateHandles(e,n,o),this.updateText(e,n,o),this.updateBackground(e,a,r,t),this.updateAnchor(n,o);for(const l of Object.values(this.handles))l.toggleLocked(i??!1)}toggleHandles(e){const{handles:t}=this;if(typeof e=="boolean"){for(const[i,s]of Object.entries(t))s.visible=e,s.toggleHovered(this.activeHandle===i);return}for(const[i,s]of Object.entries(e)){const n=t[i];n.visible=s??!0,n.toggleHovered(this.activeHandle===i)}}toggleActive(e){this.toggleHandles(e);for(const t of Object.values(this.handles))t.toggleActive(e)}stopDragging(){const{activeHandle:e,handles:t}=this;e!=null&&t[e].toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return this.activeHandle==null?"pointer":this.handles[this.activeHandle].getCursor()}containsPoint(e,t){const{handles:i,topLine:s,bottomLine:n,text:o}=this;this.activeHandle=void 0;for(const[a,r]of Object.entries(i))if(r.containsPoint(e,t))return this.activeHandle=a,!0;return s.containsPoint(e,t)||n.containsPoint(e,t)||!!o?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.topLine.containsPoint(e,t)||this.bottomLine.containsPoint(e,t))return"line";for(const[i,s]of Object.entries(this.handles))if(s.containsPoint(e,t))return"handle"}updateAnchor(e,t){const{x:i,y:s}=A.Transformable.toCanvasPoint(this.topLine,(e.x1+e.x2)/2,Math.min(e.y1,e.y2,t.y1,t.y2));this.anchor.x=i,this.anchor.y=s}},{Vec2:go,Vec4:Ol}=A,wx=class extends vO{constructor(){super(),this.type="disjoint-channel",this.handles={topLeft:new Xt,topRight:new Xt,bottomLeft:new Xt,bottomRight:new Jd},this.append([this.background,this.topLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return qi.isCheck(e,"disjoint-channel")}dragHandle(e,t,i,s){const{activeHandle:n,handles:o}=this;if(n==null)return;const{offset:a}=o[n].drag(t);o[n].toggleDragging(!0),n==="bottomRight"&&(a.x=0);let r=[],l=[],c=s;switch(n){case"topLeft":r=["topLeft"],l=["bottomLeft"];break;case"bottomLeft":r=["bottomLeft"],l=["topLeft"];break;case"topRight":r=["topRight"],l=["bottomRight"];break;case"bottomRight":r=["bottomLeft","bottomRight"],c=!1;break}const h=Us(e,i),d=Us(e.bottom,i);if(!h||!d)return;const u={topLeft:Ol.start(h),topRight:Ol.end(h),bottomLeft:Ol.start(d),bottomRight:Ol.end(d)},p={vectors:{topLeft:u.topRight,bottomLeft:u.bottomRight,topRight:u.topLeft,bottomRight:u.bottomLeft},angle:e.snapToAngle},g=Tr(u,a,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,invertYVectors:l,snap:c?p:void 0});e.start.x=g.topLeft.x,e.start.y=g.topLeft.y,e.end.x=g.topRight.x,e.end.y=g.topRight.y,e.startHeight=g.topLeft.y-g.bottomLeft.y,e.endHeight=g.topRight.y-g.bottomRight.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,bottomRight:s,topLeft:n,topRight:o}=this.handles,a=i.getBBox().y-n.getBBox().y,r=s.getBBox().y-o.getBBox().y,l=go.add(e,go.from(0,a)),c=go.add(t,go.from(0,r));return{start:e,end:t,bottomStart:l,bottomEnd:c}}updateLines(e,t,i){const{topLine:s,bottomLine:n}=this,{lineDashOffset:o,stroke:a,strokeOpacity:r,strokeWidth:l}=e,c={lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:o,stroke:a,strokeOpacity:r,strokeWidth:l};s.setProperties({...t,...c}),n.setProperties({...i,...c})}updateHandles(e,t,i){const{handles:{topLeft:s,topRight:n,bottomLeft:o,bottomRight:a}}=this,r={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...r,...Ol.start(t)}),n.update({...r,...Ol.end(t)}),o.update({...r,...Ol.start(i)}),a.update({...r,...go.sub(Ol.end(i),go.from(a.handle.width/2,a.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(oh,this.text,!!e.text.label),pO(!1,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,s){const n=t.x1>t.x2,o=t.y1>t.y2,a=o?s.y2:s.y1,r=o?s.y1:s.y2,l=go.from(t);return e.extendEnd&&t.y2===r&&l.push(go.from(n?s.x1:s.x2,o?s.y1:s.y2)),e.extendEnd&&i.y2===a&&l.push(go.from(n?s.x1:s.x2,o?s.y2:s.y1)),l.push(...go.from(i).reverse()),e.extendStart&&i.y1===r&&l.push(go.from(n?s.x2:s.x1,o?s.y1:s.y2)),e.extendStart&&t.y1===a&&l.push(go.from(n?s.x2:s.x1,o?s.y2:s.y1)),l}},{StateMachine:Pl,StateMachineProperty:mA,Debug:lX}=A,Nx=class extends Pl{constructor(e){const t=({point:l})=>{const c=new co;c.set({start:l,end:l,startHeight:0,endHeight:0}),e.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})},s=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:Pg(l,c,d,h.start,h.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},o=({point:l})=>{const{datum:c,node:h}=this,d=Ri(c?.end.y),u=Ri(c?.start.y),{y:p}=l;if(c==null||!di(u)||!di(d)||!di(p))return;const g=d-(p??0),f=(u-d)*2+g,x={x:c?.start.x,y:u-f},m={x:c?.end.x,y:l.y};h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint(x,{overflowContinuous:!0})||!e.validatePoint(m,{overflowContinuous:!0}))&&(c.set({startHeight:f,endHeight:g}),e.update())},a=({point:l})=>{const{datum:c,node:h}=this,d=Ri(c?.end.y),u=Ri(c?.start.y),{y:p}=l;if(c==null||!di(u)||!di(d)||!di(p))return;const g=d-(p??0),f=(u-d)*2+g,x={x:c.start.x,y:u-g},m={x:c.end.x,y:l.y};h?.toggleHandles(!0),!(!e.validatePoint(x,{overflowContinuous:!0})||!e.validatePoint(m,{overflowContinuous:!0}))&&(c.set({startHeight:f,endHeight:g}),e.recordAction("Create disjoint-channel annotation"),e.showAnnotationOptions(),e.update())},r=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Pl.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:Pl.parent,action:r},cancel:{target:Pl.parent,action:r}},height:{hover:o,click:{target:Pl.parent,action:a},drag:{target:Pl.parent,action:a},reset:{target:Pl.parent,action:r},cancel:{target:Pl.parent,action:r}}}),this.debug=lX.create(!0,"annotations"),this.snapping=!1}};y([mA()],Nx.prototype,"datum",2),y([mA()],Nx.prototype,"node",2),y([mA()],Nx.prototype,"snapping",2);var SO={type:"disjoint-channel",datum:co,scene:wx,isDatum:co.is,translate:(e,t,i,s)=>{co.is(t)&&wx.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(co.is(t)&&co.is(i)&&wx.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{co.is(t)&&wx.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Nx({...e,create:t("disjoint-channel")}),dragState:e=>new xi(e)},xA=[0,23.6,38.2,50,61.8,78.6,100],cX=[161.8,261.8,361.8,423.6],hX=[...xA,...cX],dX={10:hX,6:xA,4:xA.filter(e=>e!==78.6&&e!==23.6)},uX=10;function pX(e,t){const{x2:i,y1:s,y2:n}=e,o=s-n;return t==null?{x1:i,x2:i,y1:n-o,y2:n}:{x1:t.x1,x2:t.x2,y1:t.y2-o,y2:t.y2}}function MO({x1:e,y1:t,x2:i,y2:s},n,o,a,r=10){const l=t-s,c=o?-1:1;let h=a;const d=[];return dX[r].forEach((u,p)=>{const g=a+l*(u/100)*c,f=n.yAxis.scaleInvert(g);d.push({id:p,x1:e,x2:i,y1:h,y2:g,tag:u==100?0:1,label:{x1:Math.min(e,i)-uX,x2:i,y1:g,y2:g,text:`${(u/100).toFixed(3)} (${f.toFixed(2)})`}}),h=g}),d}var{Vec2:gX,Vec4:DO}=A,AO=class extends qi{constructor(){super(),this.trendLine=new an,this.rangeFillsGroup=new A.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=A.Selection.select(this.rangeFillsGroup,A.Range),this.rangeStrokesGroup=new A.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=A.Selection.select(this.rangeStrokesGroup,an),this.labelsGroup=new A.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=A.Selection.select(this.labelsGroup,oh),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(e,t){let i=Us(e,t);if(i==null){this.visible=!1;return}if(i=DO.round(i),this.visible=e.visible??!0,!this.visible)return;this.updateLine(e,i,this.trendLine),this.updateHandles(e,i),this.updateAnchor(e,i,t);const{reverse:s}=e,n=this.extendLine(i,e,t),o=s?n.y1:n.y2,a=s?n.y2:n.y1,r=MO(n,t,e.reverse,o,e.bands);this.updateRanges(e,r,t);const l={...n,y1:a,y2:a};this.updateText(e,l)}extendLine({x1:e,y1:t,x2:i,y2:s},n,o){const a={x1:e,y1:t,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return a;const{x:r,width:l}=o.xAxis.bounds;return n.extendEnd&&(a[e>i?"x1":"x2"]=r+l),n.extendStart&&(a[e>i?"x2":"x1"]=r),a}updateLine(e,t,i){if(!t||!i)return;const{lineDashOffset:s,strokeWidth:n,strokeOpacity:o,stroke:a}=e;i.setProperties({...t,lineCap:e.getLineCap(),lineDash:[3,4],lineDashOffset:s,strokeWidth:n,strokeOpacity:o,fillOpacity:0,stroke:a})}updateRangeStrokes(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:o,isMultiColor:a}=e;this.rangeStrokesGroupSelection.each((r,{x1:l,x2:c,y2:h,tag:d},u)=>{const p=h,g=a?n[u%n.length]:o;r.setProperties({x1:l,x2:c,y1:p,y2:p,stroke:g,strokeOpacity:s,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,tag:d})})}updateRanges(e,t,i){const s=n=>n.id;this.rangeFillsGroupSelection.update(t,void 0,s),this.rangeStrokesGroupSelection.update(t,void 0,s),this.labelsGroupSelection.update(t,void 0,s),this.updateRangeFills(e),this.updateRangeStrokes(e),this.updateRangeLabels(e,i)}updateRangeFills(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:o,showFill:a,isMultiColor:r}=e;this.rangeFillsGroupSelection.each((l,{x1:c,x2:h,y1:d,y2:u},p)=>{const g=r?n[p%n.length]:o;if(!a){l.visible=!1;return}l.setProperties({x1:c,x2:h,y1:d,y2:u,startLine:!1,endLine:!1,stroke:g,strokeOpacity:s,fill:g,fillOpacity:(s??1)*.15,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,visible:!0})})}updateRangeLabels(e,{xAxis:t}){const{rangeStrokesGroupSelection:i}=this,{strokes:s,strokeWidth:n,rangeStroke:o,isMultiColor:a,label:{fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,color:d}}=e,u={fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h},p=this.checkWithinBounds(t,u,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((g,f,x)=>{const m=d??(a?s[x%s.length]:o),b=i.at(x);if(!b)return;const{text:v,...S}=f.label;if(p)g.setProperties({...u,text:v,x:S.x1,y:S.y1,textBaseline:"middle",textAlign:"end",fill:m}),eu(g.id,b,S);else{const D={...u,label:v,position:"center",alignment:"left",color:m};eu(g.id,b,S,D,g,v,n)}})}checkWithinBounds(e,t,i){if(!i)return!1;const{text:s,...n}=i.datum.label;i.setProperties({...t,text:s,x:n.x1,y:n.y1,textBaseline:"middle",textAlign:"end"});const{x:o}=i.getBBox();return o>=e.bounds.x&&o<=e.bounds.x+e.bounds.width}updateText(e,t){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:s,strokeWidth:n}=e;this.text=this.updateNode(oh,this.text,!!s.label),eu(i.id,i,t,s,this.text,s.label,n)}updateAnchor(e,t,i,s){const n=DO.topCenter(t);gX.apply(this.anchor,A.Transformable.toCanvasPoint(this.trendLine,n.x,n.y))}containsPoint(e,t){const{trendLine:i,rangeStrokesGroupSelection:s,text:n}=this;let o=!1;return s.each(a=>o||(o=a.isPointInPath(e,t))),o||i.isPointInPath(e,t)||!!n?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.trendLine.isPointInPath(e,t))return"line"}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}drag(e,t,i,s){e.locked||(this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{ContinuousScale:IO}=A;function Ex(e,t,i={overflowContinuous:!1},s){if(t.x==null||t.y==null)return s&&X.warnOnce(`${s}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:n,yAxis:o}=e,a=i.overflowContinuous&&IO.is(n.scale),r=i.overflowContinuous&&IO.is(o.scale),l=a||kO(t.x,n),c=r||kO(t.y,o);if(l&&c)return!0;if(s){let h="x & y domains";l&&(h="y domain"),c&&(h="x domain");const d=Ri(t.x),u=Ri(t.y);X.warnOnce(`${s}is outside the ${h}, ignoring. - x: [${d}], y: ${u}]`)}return!1}function kO(e,t){const{domain:i}=t.scale,s=Ri(e);return i&&s!=null&&t.continuous?s>=i[0]&&s<=i.at(-1):!0}var{Vec2:fX,Vec4:rh}=A,Ox=class extends AO{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new an,this.start=new Xt,this.end=new Xt,this.endRetracement=new Xt,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(e){return qi.isCheck(e,"fibonacci-retracement-trend-based")}update(e,t){let{coords1:i,coords2:s}=this.getCoords(e,t);if(i==null||s==null){this.visible=!1;return}if(i=rh.round(i),s=rh.round(s),this.visible=e.visible??!0,!this.visible)return;(e.endRetracement.x==null||e.endRetracement.y==null)&&(s=void 0),this.updateLine(e,i,this.trendLine),this.updateLine(e,s,this.endRetracementLine),this.updateHandles(e,i,s),this.updateAnchor(e,s??i,t);const{reverse:n,bands:o}=e,a=pX(i,s),r=this.extendLine(a,e,t),l=r.y2,c=r.y1,h=s?MO(r,t,n,l,o):[];this.updateRanges(e,h,t);const d={...r,y1:c,y2:c};this.updateText(e,d)}containsPoint(e,t){const{start:i,end:s,endRetracement:n,endRetracementLine:o}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):n.containsPoint(e,t)?(this.activeHandle="endRetracement",!0):o.isPointInPath(e,t)||super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)||this.endRetracement.containsPoint(e,t)?"handle":this.endRetracementLine.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...Dx({start:e.start,end:e.end,endRetracement:e.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,endRetracement:s.endRetracement,translation:fX.sub(t,s.offset),context:i})}dragHandle(e,t,i,s){const{activeHandle:n,dragState:o}=this;if(!n||!o)return;this[n].toggleDragging(!0);const a=s?this.snapToAngle(e,t,i):Ys(this[n].drag(t).point,i);!a||!Ex(i,a)||(e[n].x=a.x,e[n].y=a.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,n=["start","end","endRetracement"];if(!s)return;const o=(n.indexOf(s)+1)%n.length,a=n[o];this[s].toggleDragging(!0);const r=Zt(e[a],i);return Ys(Mx(t,r,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,endRetracement:s,translation:n,context:o}){const a=Tr({start:t,end:i,endRetracement:s},n,o,{overflowContinuous:2});e.start.x=a.start.x,e.end.x=a.end.x,e.endRetracement.x=a.endRetracement.x,e.start.y=a.start.y,e.end.y=a.end.y,e.endRetracement.y=a.endRetracement.y}translate(e,t,i){this.translatePoints({datum:e,start:Zt(e.start,i),end:Zt(e.end,i),endRetracement:Zt(e.endRetracement,i),translation:t,context:i})}copy(e,t,i){const{coords1:s,coords2:n}=this.getCoords(e,i);if(!s||!n)return;const o=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:rh.start(s),end:rh.end(s),endRetracement:rh.end(n),translation:{x:-o.width/2,y:-o.height/2},context:i}),t}getCoords(e,t){return{coords1:Us(e,t),coords2:Us({start:e.end,end:e.endRetracement},t)}}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e,this.endRetracement.visible=e;else for(const[t,i]of Et(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end"),this.endRetracement.toggleHovered(this.activeHandle==="endRetracement")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e),this.endRetracement.toggleActive(e)}updateHandles(e,t,i,s){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",s)}),i&&this.endRetracement.update({...this.getHandleStyles(e),...this.getHandleCoords(e,i,"endRetracement",s)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1),this.endRetracement.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return i==="start"?rh.start(t):rh.end(t)}},{StateMachine:Rl,StateMachineProperty:bA,Debug:yX}=A,Px=class extends Rl{constructor(e){const t=({point:c})=>{const h=this.createDatum();h.set({start:c,end:c}),e.create(h)},i=()=>{const{node:c}=this;c?.toggleActive(!0),c?.toggleHandles({start:!0,end:!1,endRetracement:!1})},s=({offset:c,context:h})=>{const{datum:d,snapping:u}=this;d&&(d.set({end:Pg(c,h,u,d.start,d.snapToAngle)}),e.update())},n=()=>{const{datum:c}=this;c&&(c.endRetracement.x=c.end.x,c.endRetracement.y=c.end.y,this.node?.toggleHandles({end:!0}),e.update())},o=({offset:c,context:h})=>{const{datum:d,snapping:u}=this;d&&(d.set({endRetracement:Pg(c,h,u,d.end,d.snapToAngle)}),e.update())},a=()=>{this.node?.toggleHandles({endRetracement:!0}),e.update()},r=()=>e.delete(),l=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Rl.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:"endRetracement",action:n},drag:s,dragEnd:{target:"endRetracement",action:n},reset:{target:Rl.parent,action:r},cancel:{target:Rl.parent,action:r},onExit:l},endRetracement:{hover:o,click:{target:Rl.parent,action:a},drag:{target:Rl.parent,action:a},reset:{target:Rl.parent,action:r},cancel:{target:Rl.parent,action:r}}}),this.debug=yX.create(!0,"annotations"),this.snapping=!1}createDatum(){return new Na}};y([bA()],Px.prototype,"datum",2),y([bA()],Px.prototype,"node",2),y([bA()],Px.prototype,"snapping",2);var CO={type:"fibonacci-retracement-trend-based",datum:Na,scene:Ox,isDatum:Na.is,translate:(e,t,i,s)=>{Na.is(t)&&Ox.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Na.is(t)&&Na.is(i)&&Ox.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Na.is(t)&&Ox.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Px({...e,create:t("fibonacci-retracement-trend-based")}),dragState:e=>new xi(e)},{Vec2:mX,Vec4:TO}=A,Rx=class extends AO{constructor(){super(),this.type="fibonacci-retracement",this.start=new Xt,this.end=new Xt,this.append([this.start,this.end])}static is(e){return qi.isCheck(e,"fibonacci-retracement")}containsPoint(e,t){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...Dx({start:e.start,end:e.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,translation:mX.sub(t,s.offset),context:i})}dragHandle(e,t,i,s){const{activeHandle:n,dragState:o}=this;if(!n||!o)return;this[n].toggleDragging(!0);const a=s?this.snapToAngle(e,t,i):Ys(this[n].drag(t).point,i);!a||!Ex(i,a)||(e[n].x=a.x,e[n].y=a.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,o=["start","end"].find(r=>r!==s);if(!s||!o)return;this[s].toggleDragging(!0);const a=Zt(e[o],i);return Ys(Mx(t,a,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,translation:s,context:n}){const o=Tr({start:t,end:i},s,n,{overflowContinuous:1});e.start.x=o.start.x,e.end.x=o.end.x,e.start.y=o.start.y,e.end.y=o.end.y}translate(e,t,i){this.translatePoints({datum:e,start:Zt(e.start,i),end:Zt(e.end,i),translation:t,context:i})}copy(e,t,i){const s=Us(e,i);if(!s)return;const n=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:{x:s.x1,y:s.y1},end:{x:s.x2,y:s.y2},translation:{x:-n.width/2,y:-n.height/2},context:i}),t}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e;else for(const[t,i]of Et(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}updateHandles(e,t,i,s){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",s)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return i==="start"?TO.start(t):TO.end(t)}},{StateMachine:tu,StateMachineProperty:vA,Debug:xX}=A,iu=class extends tu{constructor(e){const t=({point:r})=>{const l=this.createDatum();l.set({start:r,end:r}),e.create(l)},i=()=>{const{node:r}=this;r?.toggleActive(!0),r?.toggleHandles({start:!0,end:!1})},s=({offset:r,context:l})=>{const{datum:c,snapping:h}=this;c&&(c.set({end:Pg(r,l,h,c.start,c.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({end:!0}),e.update()},o=()=>e.delete(),a=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:tu.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:tu.parent,action:n},drag:s,dragEnd:{target:tu.parent,action:n},reset:{target:tu.parent,action:o},cancel:{target:tu.parent,action:o},onExit:a}}),this.debug=xX.create(!0,"annotations"),this.snapping=!1}};y([vA()],iu.prototype,"datum",2),y([vA()],iu.prototype,"node",2),y([vA()],iu.prototype,"snapping",2);var bX=class extends iu{createDatum(){return new Mr}},vX=class extends iu{createDatum(){return new Dr}},SX=class extends iu{createDatum(){return new Ir}},LO={type:"fibonacci-retracement",datum:Ir,scene:Rx,isDatum:Ir.is,translate:(e,t,i,s)=>{Ir.is(t)&&Rx.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Ir.is(t)&&Ir.is(i)&&Rx.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Ir.is(t)&&Rx.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new SX({...e,create:t("fibonacci-retracement")}),dragState:e=>new xi(e)},{Vec2:Bg}=A,MX=class extends A.Group{},Bx=class extends MX{constructor(){super(),this.type="arrow",this.path=new A.Path,this.armLength=6,this.append([this.path])}update(e){const{path:t}=this,{x:i,y:s,angle:n,...o}=e,a=Bg.from(i,s),r=3*Math.PI/4,l=this.armLength+(e.strokeWidth??0)*2,c=Bg.rotate(Bg.from(0,l),n+r,a),h=Bg.rotate(Bg.from(l,0),n-r,a);t.setProperties(o),t.fillOpacity=0,t.path.clear(),t.path.moveTo(c.x,c.y),t.path.lineTo(a.x,a.y),t.path.lineTo(h.x,h.y)}},{Vec2:Yo,Vec4:wO}=A,Bl=class extends cA{constructor(){super(),this.type="line",this.line=new an,this.append([this.line,this.start,this.end])}static is(e){return qi.isCheck(e,"line")}update(e,t){let i=Us(e,t);if(i==null){this.visible=!1;return}i=wO.round(i),this.visible=e.visible??!0,this.visible&&(this.updateLine(e,i,t),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateAnchor(e,i,t))}updateLine(e,t,i){const{line:s}=this,{lineDashOffset:n,stroke:o,strokeWidth:a,strokeOpacity:r}=e,l=this.extendLine(t,e,i);s.setProperties({...l,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:n,stroke:o,strokeWidth:a,strokeOpacity:r,fillOpacity:0})}updateText(e,t){this.text=this.updateNode(oh,this.text,!!e.text.label),eu(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}updateCaps(e,t){if(!e.startCap&&this.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),!e.endCap&&this.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),!e.startCap&&!e.endCap)return;const{stroke:i,strokeWidth:s,strokeOpacity:n}=e,[o,a]=Yo.from(t),r=Yo.angle(Yo.sub(a,o));e.startCap&&(this.startCap&&this.startCap.type!==e.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),this.startCap==null&&(this.startCap=new Bx,this.append([this.startCap])),this.startCap.update({x:o.x,y:o.y,angle:r-Math.PI,stroke:i,strokeWidth:s,strokeOpacity:n})),e.endCap&&(this.endCap&&this.endCap.type!==e.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),this.endCap==null&&(this.endCap=new Bx,this.append([this.endCap])),this.endCap.update({x:a.x,y:a.y,angle:r,stroke:i,strokeWidth:s,strokeOpacity:n}))}updateAnchor(e,t,i,s){const n=wO.topCenter(t);Yo.apply(this.anchor,A.Transformable.toCanvasPoint(this.line,n.x,n.y))}containsPoint(e,t){const{line:i,text:s}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||!!s?.containsPoint(e,t)}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.line.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}getHandleCoords(e,t,i,s){const{startCap:n,endCap:o}=this;let[a,r]=Yo.from(t);const l=Yo.angle(Yo.sub(r,a));return n&&(a=Yo.rotate(Yo.from(0,-Xt.HANDLE_SIZE/2),l,a)),o&&(r=Yo.rotate(Yo.from(0,Xt.HANDLE_SIZE/2),l,r)),i==="start"?a:r}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},NO={type:"line",datum:Dr,scene:Bl,isDatum:Dr.is,translate:(e,t,i,s)=>{Dr.is(t)&&Bl.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Dr.is(t)&&Dr.is(i)&&Bl.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Dr.is(t)&&Bl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new vX({...e,create:t("line")}),dragState:e=>new xi(e)},EO={type:"arrow",datum:Mr,scene:Bl,isDatum:Mr.is,translate:(e,t,i,s)=>{Mr.is(t)&&Bl.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Mr.is(t)&&Mr.is(i)&&Bl.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Mr.is(t)&&Bl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new bX({...e,create:t("arrow")}),dragState:e=>new xi(e)};function OO(e,t=0,i=0){let s=t;for(const n of e)if(Array.isArray(n)){for(const o of n)PO(o,s);s+=A.Group.computeChildrenBBox(n).width+i}else PO(n,s),s+=n.getBBox().width+i}function DX(e,t=0,i=0){let s=t;for(const n of e)if(Array.isArray(n)){for(const o of n)RO(o,s);s+=A.Group.computeChildrenBBox(n).height+i}else RO(n,s),s+=n.getBBox().height+i}function PO(e,t){"x1"in e?(e.x2=t+(e.x2-e.x1),e.x1=t):e.x=t}function RO(e,t){"y1"in e?(e.y2=t+(e.y2-e.y1),e.y1=t):e.y=t}function BO(e,t){"x1"in e?(e.x1+=t,e.x2+=t):e.x+=t}function FO(e,t){"y1"in e?(e.y1+=t,e.y2+=t):e.y+=t}var{Vec4:SA}=A,zO=class extends A.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new A.Rect,this.dateRangeBarsText=new A.Text,this.dateRangeDivider=new A.Line,this.dateRangeValueText=new A.Text,this.priceRangeValueText=new A.Text,this.priceRangeDivider=new A.Line,this.priceRangePercentageText=new A.Text,this.volumeText=new A.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(e,t,i,s,n,o,a){this.verticalDirection=o;const r=this.updateStatistics(e,t,i,a),l=A.Group.computeChildrenBBox(r.flat()),c=10;l.grow(c),this.updateBackground(e,l,c),this.reposition(r,c,n),this.checkVisibility(e,n,s)}checkVisibility(e,t,i){const s=SA.from(new A.BBox(0,0,t.seriesRect.width,t.seriesRect.height));SA.collides(i,s)?this.visible=e.visible??!0:this.visible=!1}updateStatistics(e,t,i,s){const{dateRangeBarsText:n,dateRangeDivider:o,dateRangeValueText:a,priceRangeValueText:r,priceRangeDivider:l,priceRangePercentageText:c,volumeText:h}=this,d=8,u=6,p=e.statistics.fontSize+3,g=-2,f=this.getTextStyles(e),x={...this.getDividerStyles(e),x1:0,y1:0,x2:0,y2:p},m=[n,o,a],b=[r,l,c],v=[];return t.priceRange&&(r.setProperties({...f,text:this.formatPriceRangeValue(t.priceRange.value,s)}),l.setProperties(x),c.setProperties({...f,text:this.formatPriceRangePercentage(t.priceRange.percentage,s)}),OO(b,i.x,d),v.push(b)),t.dateRange&&(n.setProperties({...f,text:this.formatDateRangeBars(t.dateRange.bars,s)}),o.setProperties(x),a.setProperties({...f,text:this.formatDateRangeValue(t.dateRange.value)}),OO(m,i.x,d),v.push(m)),t.volume!=null?(h.setProperties({...f,x:i.x,text:this.formatVolume(t.volume,s),visible:!0}),v.push(h)):h.visible=!1,DX(v,i.y,u),l.y1+=g,l.y2+=g,o.y1+=g,o.y2+=g,v}updateBackground(e,t,i){const s=this.getBackgroundStyles(e);this.background.setProperties({...s,...t,x:t.x-t.width/2+i,y:t.y})}reposition(e,t,i){const{width:s,height:n}=i.seriesRect,o=SA.from(this.background.getBBox());let a=0;o.x1<0&&(a=-o.x1),o.x2>s&&(a=s-o.x2);const r=Math.min(t,n-o.y2);for(const l of e)if(Array.isArray(l)){const c=A.Group.computeChildrenBBox(l).width;for(const h of l)BO(h,a-c/2),FO(h,r)}else BO(l,a-l.getBBox().width/2),FO(l,r);this.background.x+=a,this.background.y+=r}getTextStyles(e){return{fill:e.statistics.color,fontFamily:e.statistics.fontFamily,fontSize:e.statistics.fontSize,fontStyle:e.statistics.fontStyle,fontWeight:e.statistics.fontWeight,textBaseline:"top"}}getDividerStyles(e){return{stroke:e.statistics.divider.stroke,strokeOpacity:e.statistics.divider.strokeOpacity,strokeWidth:e.statistics.divider.strokeWidth}}getBackgroundStyles(e){return{fill:e.statistics.fill,stroke:e.statistics.stroke,strokeOpacity:e.statistics.strokeOpacity,strokeWidth:e.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(e,t){return t?.t("measurerDateRangeBars",{value:e})??`${e}`}formatDateRangeValue(e){const t=[],i=e>=0?"":"-";e=Math.abs(e);const s=1e3*60,n=s*60,o=n*24,a=Math.floor(e/s),r=Math.floor(e/n),l=Math.floor(e/o),c=r%(o/n),h=a%(n/s);return l>=1&&t.push(`${l}d`),r>=1&&(e<o||c!==0)&&t.push(`${c}h`),(e<n||h!==0)&&t.push(`${h}m`),t[0]=`${i}${t[0]}`,t.join(" ")}formatPriceRangeValue(e,t){return t?.t("measurerPriceRangeValue",{value:Number(e.toFixed(2))})??`${e}`}formatPriceRangePercentage(e,t){return t?.t("measurerPriceRangePercent",{value:e})??`${e}`}formatVolume(e,t){const i=isNaN(e)?"":this.volumeFormatter.format(e);return t?.t("measurerVolume",{value:i})??i}},AX=class extends zO{getDirectionStyles(e){return this.verticalDirection==="down"?e.down.statistics:e.up.statistics}getTextStyles(e){const t=this.getDirectionStyles(e);return{...super.getTextStyles(e),fill:t.color,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight}}getDividerStyles(e){const t=this.getDirectionStyles(e);return{stroke:t.divider.stroke,strokeOpacity:t.divider.strokeOpacity,strokeWidth:t.divider.strokeWidth}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{...super.getBackgroundStyles(e),fill:t.fill,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth}}},{Vec2:Pa,Vec4:lh}=A,Cn=class extends cA{constructor(){super(),this.type="measurer",this.horizontalLine=new an,this.verticalLine=new an,this.horizontalStartLine=new an,this.horizontalEndLine=new an,this.verticalStartLine=new an,this.verticalEndLine=new an,this.horizontalEndCap=new Bx,this.verticalEndCap=new Bx,this.background=new A.Path({zIndex:-1}),this.updateBackground=bO.updateBackground.bind(this),this.statistics=this.createStatisticsScene(),this.statistics.zIndex=1,this.append([this.background,this.verticalStartLine,this.verticalEndLine,this.horizontalStartLine,this.horizontalEndLine,this.horizontalLine,this.verticalLine,this.horizontalEndCap,this.verticalEndCap,this.start,this.end,this.statistics])}static is(e){return qi.isCheck(e,"measurer")}createStatisticsScene(){return new zO}update(e,t){const i=Us(e,t);if(i==null){this.visible=!1;return}if(this.visible=e.visible??!0,!this.visible)return;const s=this.extendPerpendicular(i,e,t),n={...s,y2:s.y1},o={...s,y1:s.y2};this.verticalDirection=i.y1<i.y2?"down":"up",this.updateVisibilities(e),this.updateLines(e,i),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateBoundingLines(e,s),this.updateBackground(e,n,o,t),this.updateStatistics(e,i,t),this.updateAnchor(e,i,t)}extendPerpendicular(e,t,i){const s={x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)},[n,o]=Pa.from(i.yAxis.bounds);return ro.is(t)?(t.extendAbove&&(s.y1=n.y),t.extendBelow&&(s.y2=o.y)):lo.is(t)&&(t.extendLeft&&(s.x1=n.x),t.extendRight&&(s.x2=o.x)),s}updateVisibilities(e){const{horizontalStartLine:t,horizontalEndLine:i,horizontalEndCap:s,verticalStartLine:n,verticalEndLine:o,verticalEndCap:a}=this,{direction:r}=e;n.visible=r!=="vertical",o.visible=r!=="vertical",s.visible=r!=="vertical",t.visible=r!=="horizontal",i.visible=r!=="horizontal",a.visible=r!=="horizontal"}updateLines(e,t){const{horizontalLine:i,verticalLine:s}=this,{direction:n}=e,{x1:o,y1:a,x2:r,y2:l}=t,c=Pa.round(lh.center(t),0),h=this.getLineStyles(e);n!=="vertical"&&i.setProperties({...h,x1:o,x2:r,y1:c.y,y2:c.y}),n!=="horizontal"&&s.setProperties({...h,x1:c.x,x2:c.x,y1:a,y2:l})}updateText(e,t){const{direction:i}=e,s=Pa.round(lh.center(t),0);let n;const o={...t};i==="vertical"?(n=this.verticalLine,o.x1=s.x,o.x2=s.x):(n=this.horizontalLine,o.y1=s.y,o.y2=s.y),this.text=this.updateNode(oh,this.text,!!e.text.label);const{id:a}=n,r=eu(a,n,o,e.text,this.text,e.text.label,e.strokeWidth);let l;if(i==="both"&&r&&this.text){const c=lh.from(this.text.getBBox()),{offset:h}=r.numbers;c.x1<=s.x+h.x&&c.x2>=s.x-h.x&&(l={x:s.x,y:r.clipMask.y,radius:this.text.getBBox().height/2+Pa.length(h)})}this.verticalLine.setClipMask(a,l)}updateCaps(e,t){const{horizontalEndCap:i,verticalEndCap:s}=this,{direction:n}=e,{x1:o,y1:a,x2:r,y2:l}=t,c=Pa.round(lh.center(t),0),{stroke:h,strokeWidth:d,strokeOpacity:u}=this.getLineStyles(e),p={stroke:h,strokeWidth:d,strokeOpacity:u};if(n!=="vertical"){const g=o<=r?0:Math.PI;let f=r;n==="horizontal"&&(f+=o<=r?-2:2),i.update({...p,x:f,y:c.y,angle:g})}if(n!=="horizontal"){const g=a<=l?Math.PI/2:Math.PI/-2;let f=l;n==="vertical"&&(f+=a<=l?-2:2),s.update({...p,x:c.x,y:f,angle:g})}}updateBoundingLines(e,t){const{verticalStartLine:i,verticalEndLine:s,horizontalStartLine:n,horizontalEndLine:o}=this,{direction:a}=e,{x1:r,y1:l,x2:c,y2:h}=t,d=this.getLineStyles(e);a==="horizontal"&&(i.setProperties({...d,x1:r,y1:l,x2:r,y2:h}),s.setProperties({...d,x1:c,y1:l,x2:c,y2:h})),a==="vertical"&&(n.setProperties({...d,x1:r,y1:l,x2:c,y2:l}),o.setProperties({...d,x1:r,y1:h,x2:c,y2:h}))}updateStatistics(e,t,i){const s=Pa.add(lh.bottomCenter(t),Pa.from(0,10)),n={volume:this.getVolume(e)};e.hasPriceRange&&(n.priceRange={percentage:this.getPriceRangePercentage(e),value:this.getPriceRangeValue(e)}),e.hasDateRange&&(n.dateRange={bars:this.getDateRangeBars(t,i),value:this.getDateRangeValue(e)}),this.statistics.update(e,n,s,t,i,this.verticalDirection,e.localeManager)}updateAnchor(e,t,i,s){const n=lh.topCenter(t);Pa.apply(this.anchor,A.Transformable.toCanvasPoint(this.horizontalLine,n.x,n.y))}getBackgroundPoints(e,t,i,s){const[n,o]=Pa.from(t),[a,r]=Pa.from(i);return[n,o,r,a]}getLineStyles(e){const{lineDashOffset:t,stroke:i,strokeWidth:s,strokeOpacity:n}=e;return{lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,stroke:i,strokeWidth:s,strokeOpacity:n,fillOpacity:0}}getBackgroundStyles(e){const{background:t}=e;return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}containsPoint(e,t){const{horizontalLine:i,text:s,verticalLine:n,horizontalStartLine:o,horizontalEndLine:a,verticalStartLine:r,verticalEndLine:l}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||n.isPointInPath(e,t)||o.visible&&o.isPointInPath(e,t)||a.visible&&a.isPointInPath(e,t)||r.visible&&r.isPointInPath(e,t)||l.visible&&l.isPointInPath(e,t)||!!s?.containsPoint(e,t)}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":"line"}getDateRangeBars(e,t){const{step:i}=t.xAxis.scale,s=e.x1<=e.x2?1:-1;return i?Math.round(lh.width(e)/i)*s:0}getDateRangeValue(e){const t=Ri(e.start.x),i=Ri(e.end.x);if(!aa(t)||!aa(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-t.getTime()}getPriceRangePercentage(e){if(e.start.y==null||e.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=Ri(e.end.y),i=Ri(e.start.y);if(!di(t)||!di(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(t-i)/i}getPriceRangeValue(e){if(e.start.y==null||e.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=Ri(e.end.y),i=Ri(e.start.y);if(!di(t)||!di(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return t-i}getVolume(e){return e.getVolume(e.start.x,e.end.x)}},Fx=class extends Cn{constructor(){super(...arguments),this.type="quick-measurer"}static is(e){return qi.isCheck(e,"quick-measurer")}createStatisticsScene(){return new AX}getDirectionStyles(e){return this.verticalDirection==="down"?e.down:e.up}getLineStyles(e){const t=this.getDirectionStyles(e);return{...super.getLineStyles(e),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){const t=this.getDirectionStyles(e);return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},{StateMachine:su,StateMachineProperty:_O,Debug:IX}=A,nu=class extends su{constructor(e){const t=({point:a})=>{const r=this.createDatum();r.set({start:a,end:a}),e.create(r)},i=({point:a})=>{const{datum:r,node:l}=this;r?.set({end:a}),l?.toggleActive(!0),l?.toggleHandles({end:!1}),e.update()},s=()=>{this.node?.toggleHandles({end:!0})},n=()=>e.delete(),o=()=>{e.showAnnotationOptions(),!kl(this.datum)&&e.recordAction(`Create ${this.node?.type} annotation`)};super("start",{start:{reset:su.parent,click:{target:"end",action:t},drag:{target:"end",action:t}},end:{hover:i,drag:i,click:{target:su.parent,action:s},dragEnd:{target:su.parent,action:s},reset:{target:su.parent,action:n},cancel:{target:su.parent,action:n},onExit:o}}),this.debug=IX.create(!0,"annotations")}};y([_O()],nu.prototype,"datum",2),y([_O()],nu.prototype,"node",2);var kX=class extends nu{createDatum(){return new ro}},CX=class extends nu{createDatum(){return new lo}},TX=class extends nu{createDatum(){return new Sr}},LX=class extends nu{createDatum(){return new kn}},GO={type:"date-range",datum:ro,scene:Cn,isDatum:ro.is,translate:(e,t,i,s)=>{ro.is(t)&&Cn.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(ro.is(t)&&ro.is(i)&&Cn.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{ro.is(t)&&Cn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new kX({...e,create:t("date-range")}),dragState:e=>new xi(e)},VO={type:"price-range",datum:lo,scene:Cn,isDatum:lo.is,translate:(e,t,i,s)=>{lo.is(t)&&Cn.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(lo.is(t)&&lo.is(i)&&Cn.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{lo.is(t)&&Cn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new CX({...e,create:t("date-range")}),dragState:e=>new xi(e)},jO={type:"date-price-range",datum:Sr,scene:Cn,isDatum:Sr.is,translate:(e,t,i,s)=>{Sr.is(t)&&Cn.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Sr.is(t)&&Sr.is(i)&&Cn.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Sr.is(t)&&Cn.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new TX({...e,create:t("date-range")}),dragState:e=>new xi(e)},HO={type:"quick-date-price-range",datum:kn,scene:Fx,isDatum:kn.is,translate:(e,t,i,s)=>{kn.is(t)&&Fx.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(kn.is(t)&&kn.is(i)&&Fx.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{kn.is(t)&&Fx.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new LX({...e,create:t("quick-date-price-range")}),dragState:e=>new xi(e)},{ZIndexMap:WO,TextWrapper:wX}=A,zx=class extends pA{constructor(){super(),this.type="note",this.shape=new A.Rect,this.iconBackground=new A.TranslatableSvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new A.TranslatableSvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new A.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(e){return qi.isCheck(e,"note")}update(e,t){this.updateIcon(e,t),super.update(e,t)}getTextBBox(e,t,i){const s=super.getTextBBox(e,t,i);s.x-=e.width/2,s.x=ve(0,s.x,i.seriesRect.width-e.width);const n=e.getPadding().top,o=s.y-RE-n*2,a=s.y+Xt.HANDLE_SIZE+n*2;return o-s.height-BE<0?(s.y=a,e.position="top"):(s.y=o+n,e.position="bottom"),s}updateLabel(e,t){const i=e.visible===!1?!1:this.label.visible;super.updateLabel(e,t),this.label.visible=i,this.label.text=wX.wrapText(e.text,{font:{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},avoidOrphans:!1,textAlign:e.textAlign,textBaseline:"top",textWrap:"always",maxWidth:200})}updateShape(e,t){const{shape:i}=this;i.fill=e.background.fill,i.fillOpacity=e.background.fillOpacity??1,i.stroke=e.background.stroke,i.strokeOpacity=e.background.strokeOpacity??1,i.strokeWidth=e.background.strokeWidth??1,i.cornerRadius=4;const s=e.getPadding().top,n=e.position==="top";i.x=t.x-s,i.width=e.width+s*2,i.height=t.height+s*2,i.y=t.y+(n?0:-t.height)-s}updateIcon(e,t){const{active:i,iconBackground:s,iconLines:n}=this,{x:o,y:a}=Zt(e,t);s.translationX=o-cZ/2,s.translationY=a-PE,n.translationX=s.translationX,n.translationY=s.translationY,s.fill=e.fill,s.fillOpacity=e.fillOpacity??1,s.stroke=e.stroke,s.strokeOpacity=e.strokeOpacity??1,s.strokeWidth=e.strokeWidth??1,n.fill=e.stroke,i?s.fillShadow.color=e.fill??"rgba(0, 0, 0, 0.22)":s.fillShadow.color="rgba(0, 0, 0, 0.22)"}updateAnchor(e,t,i){const s=e.getPadding().top,n=e.position==="top",o=n?1:-1;return{x:t.x+i.seriesRect.x+e.width/2,y:t.y+i.seriesRect.y+o*(t.height+s),position:n?"below":"above"}}getLabelCoords(e,t){const i=e.position==="top",s=e.getPadding().top+e.fontSize*Ng/2;return{x:t.x,y:t.y+(i?s/2:0)}}getTextBaseline(e){return e.position==="top"?"middle":e.position}getHandleCoords(e,t,i){return{x:t.x,y:t.y+Xt.HANDLE_SIZE/2+4}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}toggleHovered(e){super.toggleHovered(e),this.label.visible=e,this.shape.visible=e,this.zIndex=e?WO.CHART_ANNOTATION_FOCUSED:WO.CHART_ANNOTATION}toggleActive(e){super.toggleActive(e),this.label.visible=e,this.shape.visible=e,this.active=e}containsPoint(e,t){return this.shape.visible&&this.shape.containsPoint(e,t)||this.iconBackground.containsPoint(e,t)?!0:super.containsPoint(e,t)}},NX=class extends Rg{createDatum(){return new on}},$O={type:"note",datum:on,scene:zx,isDatum:on.is,translate:(e,t,i,s)=>{on.is(t)&&zx.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(on.is(t)&&on.is(i)&&zx.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{on.is(t)&&zx.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new NX({...e,create:t("note")}),dragState:e=>new xi(e)},{Vec2:fo,Vec4:Ra}=A,_x=class extends vO{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new Xt,topMiddle:new Jd,topRight:new Xt,bottomLeft:new Xt,bottomMiddle:new Jd,bottomRight:new Xt},this.middleLine=new an,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return qi.isCheck(e,"parallel-channel")}dragHandle(e,t,i,s){const{activeHandle:n,handles:o}=this;if(n==null)return;const{offset:a}=o[n].drag(t);o[n].toggleDragging(!0),(n==="topMiddle"||n==="bottomMiddle")&&(a.x=0);let r=[],l=s;switch(n){case"topLeft":case"bottomLeft":r=["topLeft","bottomLeft"];break;case"topMiddle":r=["topLeft","topRight"],a.y-=Jd.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":r=["topRight","bottomRight"];break;case"bottomMiddle":r=["bottomLeft","bottomRight"],a.y-=Jd.HANDLE_SIZE/2,l=!1;break}const c=Us(e,i),h=Us(e.bottom,i);if(!c||!h)return;const d={topLeft:Ra.start(c),topRight:Ra.end(c),bottomLeft:Ra.start(h),bottomRight:Ra.end(h)},u={vectors:{topLeft:d.topRight,bottomLeft:d.bottomRight,topRight:d.topLeft,bottomRight:d.bottomLeft},angle:e.snapToAngle},p=Tr(d,a,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,snap:l?u:void 0});e.start.x=p.topLeft.x,e.start.y=p.topLeft.y,e.end.x=p.topRight.x,e.end.y=p.topRight.y,e.height=p.topLeft.y-p.bottomLeft.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,topLeft:s}=this.handles,n=i.getBBox().y-s.getBBox().y,o=fo.add(e,fo.from(0,n)),a=fo.add(t,fo.from(0,n));return{start:e,end:t,bottomStart:o,bottomEnd:a}}containsPoint(e,t){return super.containsPoint(e,t)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)}getNodeAtCoords(e,t){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)?"line":super.getNodeAtCoords(e,t)}updateLines(e,t,i,s,n,o){const{topLine:a,middleLine:r,bottomLine:l}=this,{lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u}=e,p=e.getLineDash(),g={lineCap:e.getLineCap(),lineDash:p,lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u};a.setProperties({...t,...g}),l.setProperties({...i,...g});const f=this.extendLine({x1:n.x1,y1:o.y1+(n.y1-o.y1)/2,x2:n.x2,y2:o.y2+(n.y2-o.y2)/2},e,s);r.setProperties({...f,lineDash:e.middle.lineDash??p,lineDashOffset:e.middle.lineDashOffset??c,stroke:e.middle.stroke??h,strokeOpacity:e.middle.strokeOpacity??d,strokeWidth:e.middle.strokeWidth??u,visible:e.middle.visible??!0})}updateHandles(e,t,i){const{handles:{topLeft:s,topMiddle:n,topRight:o,bottomLeft:a,bottomMiddle:r,bottomRight:l}}=this,c={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...c,...Ra.start(t)}),o.update({...c,...Ra.end(t)}),a.update({...c,...Ra.start(i)}),l.update({...c,...Ra.end(i)}),n.update({...c,...fo.sub(Ra.center(t),fo.from(n.handle.width/2,n.handle.height/2))}),r.update({...c,...fo.sub(Ra.center(i),fo.from(r.handle.width/2,r.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(oh,this.text,!!e.text.label),pO(!0,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,s){const n=t.x1>t.x2,o=t.y1>t.y2,a=t.x1!==i.x1&&t.y1!==i.y1,r=t.x2!==i.x2&&t.y2!==i.y2,l=fo.from(t);return e.extendEnd&&r&&l.push(fo.from(n?s.x1:s.x2,o?s.y1:s.y2)),l.push(...fo.from(i).reverse()),e.extendStart&&a&&l.push(fo.from(n?s.x2:s.x1,o?s.y2:s.y1)),l}},{StateMachine:Fl,StateMachineProperty:MA,Debug:EX}=A,Gx=class extends Fl{constructor(e){const t=({point:l})=>{const c=new ho;c.set({start:l,end:l,height:0}),e.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})},s=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:Pg(l,c,d,h.start,h.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},o=({point:l})=>{const{datum:c,node:h}=this,d=Ri(c?.end.y),u=Ri(c?.start.y),{y:p}=l;if(c==null||!di(u)||!di(d)||!di(p))return;const g=d-(p??0),f=u-g;h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint({x:c.start.x,y:f},{overflowContinuous:!0})||!e.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:g}),e.update())},a=({point:l})=>{const{datum:c,node:h}=this,d=Ri(c?.end.y),u=Ri(c?.start.y),{y:p}=l;if(c==null||!di(u)||!di(d)||!di(p))return;const g=d-(p??0),f=u-g;h?.toggleHandles(!0),!(!e.validatePoint({x:c.start.x,y:f},{overflowContinuous:!0})||!e.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:g}),e.recordAction("Create parallel-channel annotation"),e.showAnnotationOptions(),e.update())},r=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Fl.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:Fl.parent,action:r},cancel:{target:Fl.parent,action:r}},height:{hover:o,click:{target:Fl.parent,action:a},drag:{target:Fl.parent,action:a},reset:{target:Fl.parent,action:r},cancel:{target:Fl.parent,action:r}}}),this.debug=EX.create(!0,"annotations"),this.snapping=!1}};y([MA()],Gx.prototype,"datum",2),y([MA()],Gx.prototype,"node",2),y([MA()],Gx.prototype,"snapping",2);var UO={type:"parallel-channel",datum:ho,scene:_x,isDatum:ho.is,translate:(e,t,i,s)=>{ho.is(t)&&_x.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(ho.is(t)&&ho.is(i)&&_x.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{ho.is(t)&&_x.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Gx({...e,create:t("parallel-channel")}),dragState:e=>new xi(e)},Vx=class extends pA{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(e){return qi.isCheck(e,"text")}getHandleCoords(e,t){const i=Xt.HANDLE_SIZE/2;return{x:t.x+i,y:t.y+2+i}}},OX=class extends Rg{createDatum(){return new kr}},YO={type:"text",datum:kr,scene:Vx,isDatum:kr.is,translate:(e,t,i,s)=>{kr.is(t)&&Vx.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(kr.is(t)&&kr.is(i)&&Vx.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{kr.is(t)&&Vx.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new OX({...e,create:t("text")}),dragState:e=>new xi(e)},Tn={[NO.type]:NO,[mO.type]:mO,[xO.type]:xO,[UO.type]:UO,[SO.type]:SO,[LO.type]:LO,[CO.type]:CO,[cO.type]:cO,[dO.type]:dO,[$O.type]:$O,[YO.type]:YO,[EO.type]:EO,[sO.type]:sO,[iO.type]:iO,[GO.type]:GO,[VO.type]:VO,[jO.type]:jO,[HO.type]:HO};function ch(e){for(const{isDatum:t}of Object.values(Tn))if(t(e))return e}var{ActionOnSet:PX,ParallelStateMachine:RX,StateMachine:DA,StateMachineProperty:Ba,Debug:BX}=A,jx=class extends RX{constructor(e){super(new FX(t=>{this.snapping=t}),new zX(()=>{this.node=this.active==null?void 0:e.node(this.active)}),new zl(e,t=>{this.active=t,this.datum=this.active==null?void 0:e.datum(this.active),this.node=this.active==null?void 0:e.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(e){return e===this.active}};y([Ba()],jx.prototype,"snapping",2),y([Ba()],jx.prototype,"datum",2),y([Ba()],jx.prototype,"node",2);var FX=class extends DA{constructor(e){super("idle",{idle:{hover:({shiftKey:t})=>e(t),keyDown:({shiftKey:t})=>e(t),keyUp:({shiftKey:t})=>e(t),click:({shiftKey:t})=>e(t),drag:({shiftKey:t})=>e(t)},dragging:{},translating:{},"text-input":{}})}},zX=class extends DA{constructor(e){super("idle",{idle:{onEnter:e,render:e},dragging:{onEnter:e,render:e},translating:{onEnter:e,render:e},"text-input":{render:e}})}},zl=class extends DA{constructor(e,t){const i=v=>S=>{e.create(v,S),this.active=e.selectLast()},s=()=>{this.active!=null&&e.delete(this.active),this.active=void 0,e.select()},n={createDatum:i},o={...e,delete:s,showTextInput:()=>{this.active!=null&&e.showTextInput(this.active)},deselect:()=>{const v=this.active;this.active=void 0,this.hovered=void 0,e.select(this.active,v)},showAnnotationOptions:()=>{this.active!=null&&e.showAnnotationOptions(this.active)}},a=Object.fromEntries(Object.entries(Tn).map(([v,S])=>[v,S.createState(o,n)])),r=Object.fromEntries(Object.entries(Tn).map(([v,S])=>[v,S.dragState(e,n)])),l=({colorPickerType:v,colorOpacity:S,color:D,opacity:C,isMultiColor:T})=>{this.datum&&(v==="text-color"&&e.updateTextInputColor(D),vx(this.datum,v,S,D,C,T),e.update())},c=v=>{const{datum:S,node:D}=this;!S||!D||(Ea(S)?(S.fontSize=v,e.updateTextInputFontSize(v)):Xd(S)&&(S.text.fontSize=v),e.update())},h=v=>{const{datum:S,node:D}=this;!S||!D||!Cl(S)||(GE(S,v),e.update())},d=v=>{const{node:S}=this;!S||!("setTextInputBBox"in S)||(S.setTextInputBBox(v),e.update())},u=({textInputValue:v,bbox:S})=>{const{datum:D}=this;if(S!=null&&v!=null&&v.length>0){if(!Ea(D))return;const C=gx(D,v,S.width);D.set({text:C}),e.update(),e.recordAction(`Change ${D.type} annotation text`)}else e.delete(this.active),e.recordAction(`Delete ${D?.type} annotation`)},p=()=>{e.updateTextInputBBox(void 0)},g=()=>this.active!=null,f=()=>this.copied!=null,x=()=>{const{active:v,datum:S}=this;return v==null||!S?!1:Xd(S)&&!S.locked},m=()=>this.active!=null&&!kl(this.datum),b=()=>this.hovered!=null;super("idle",{idle:{onEnter:()=>{e.select(this.active,this.active),this.hoverCoords&&(this.hovered=e.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:v})=>{this.hovered=e.hoverAtCoords(v,this.active,this.hovered),this.hoverCoords=v},translate:{guard:g,target:"translating",action:({translation:v})=>{e.startInteracting(),e.translate(this.active,v),e.update()}},copy:{guard:m,action:()=>{this.copied=e.copy(this.active)}},cut:{guard:m,action:()=>{this.copied=e.copy(this.active),s()}},paste:{guard:f,action:()=>{e.paste(this.copied)}},selectLast:()=>{const v=this.active;this.active=e.selectLast(),e.select(this.active,v)},click:[{guard:()=>{const{active:v,hovered:S,datum:D}=this;return v==null||S!==v||!D?!1:Ea(D)&&!D.locked},target:"text-input"},{action:()=>{const v=this.active;this.active=this.hovered,e.select(this.active,v)}}],dblclick:{guard:x,action:({offset:v})=>{const S=e.getNodeAtCoords(v,this.active)==="text"?"text":"line";e.showAnnotationSettings(this.active,void 0,S)}},dragStart:[{guard:b,target:"dragging",action:()=>{const v=this.active;this.active=this.hovered,e.select(this.active,v),e.startInteracting()}},{action:()=>{const v=this.active;this.active=this.hovered,e.select(this.active,v)}}],color:{guard:g,action:l},fontSize:{guard:g,action:c},lineProps:{guard:g,action:v=>{const S=ch(this.datum);S?.set(v),e.update(),e.recordAction(`Change ${S?.type} ${Object.entries(v).map(([D,C])=>`${D} to ${C}`).join(", ")}`)}},lineStyle:{guard:g,action:h},lineText:{guard:g,action:v=>{const S=ch(this.datum);Xd(S)&&(Cr(S)&&v.position==="center"&&(v.position="inside"),S.text.set(v),e.update())}},updateTextInputBBox:{guard:g,action:d},toolbarPressSettings:{guard:x,action:v=>{e.showAnnotationSettings(this.active,v)}},reset:()=>{this.active!=null&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,e.select(this.active,this.active),e.resetToIdle()},delete:()=>{this.active!=null&&(e.delete(this.active),!kl(this.datum)&&e.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{e.deleteAll()},...a},dragging:{onEnter:(v,S)=>{if(this.active==null)return;const D=e.getAnnotationType(this.active);D&&(this.transitionRoot(D),this.transitionRoot("dragStart",S))},...r},translating:{onEnter:()=>{},translate:{guard:g,target:"translating",action:({translation:v})=>{e.startInteracting(),e.translate(this.active,v),e.update()}},translateEnd:{guard:g,target:"idle"},onExit:()=>{e.stopInteracting(),e.update(),e.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(this.active==null)return;const v=ch(this.datum);!v||!("getTextInputCoords"in v)||(e.startInteracting(),e.showTextInput(this.active),v.visible=!1,e.update())},updateTextInputBBox:{guard:g,action:d},resize:{target:"idle",action:u},click:{target:"idle",action:u},drag:{target:"idle",action:u},textInput:[{guard:hA,target:"idle",action:p},{guard:dA,target:"idle",action:u}],color:{guard:g,action:l},fontSize:{guard:g,action:c},cancel:{target:"idle",action:p},onExit:()=>{e.stopInteracting(),e.hideTextInput();const v=this.active;if(this.active=this.hovered=void 0,e.select(this.active,v),v==null)return;const S=e.datum(v),D=e.node(v);!S||!D||(S.visible=!0)}}}),this.setActive=t,this.debug=BX.create(!0,"annotations"),this.snapping=!1}};y([PX({changeValue(e){this.setActive(e)}}),Ba()],zl.prototype,"active",2),y([Ba()],zl.prototype,"hovered",2),y([Ba()],zl.prototype,"hoverCoords",2),y([Ba()],zl.prototype,"copied",2),y([Ba()],zl.prototype,"snapping",2),y([Ba()],zl.prototype,"datum",2),y([Ba()],zl.prototype,"node",2);var{ActionOnSet:_X,LayoutElement:GX,Menu:VX,PropertiesArray:jX,ToolbarButtonProperties:HX,Property:Hx,ChartAxisDirection:WX}=A,KO=class extends HX{};y([Hx],KO.prototype,"value",2);var Wx=class extends A.BaseProperties{constructor(e){super(),this.ctx=e,this.enabled=!0,this.padding=20,this.buttons=new jX(KO),this.events=new Io,this.annotationMenu=new VX(this.ctx,"annotations"),this.cleanup=new mt,this.toolbar=e.sharedToolbar.getSharedToolbar("annotations");const t=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",t),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),e.layoutManager.registerElement(GX.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",t),this.toolbar.destroy()})}destroy(){this.cleanup.flush()}toggleClearButtonEnabled(e){const t=this.buttons.findIndex(i=>i.value==="clear");this.toolbar.toggleButtonEnabledByIndex(t,e)}resetButtonIcons(){for(const[e,t]of this.buttons.entries())switch(t.value){case"line-menu":this.updateButtonByIndex(e,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(e,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(e,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(e,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(e,{icon:"measurer-drawing",value:"measurer-menu"});break}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}onLayoutStart(e){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(e.layoutBox,this.padding))}refreshButtonsEnabled(e){for(const[t,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(t,e)}onToolbarButtonPress({event:e,button:t,buttonBounds:i}){const s=this.ctx.axisManager.getAxisContext(WX.Y)[0].scale;switch(t.value){case"clear":this.events.emit("pressed-clear",null);break;case"line-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsLineAnnotations",IZ.filter(n=>n.visible?n.visible(s):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsFibonacciAnnotations",kZ);break;case"text-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsTextAnnotations",TZ);break;case"shape-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsShapeAnnotations",LZ);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(e,i,t.value,"toolbarAnnotationsMeasurerAnnotations",wZ);break}}onToolbarButtonPressShowMenu(e,t,i,s,n){this.events.emit("pressed-show-menu",null);const o=this.buttons.findIndex(a=>a.value===i);this.toolbar.toggleActiveButtonByIndex(o),this.annotationMenu.setAnchor({x:t.x+t.width+6,y:t.y}),this.annotationMenu.show({items:n,ariaLabel:this.ctx.localeManager.t(s),class:"ag-charts-annotations__toolbar-menu",sourceEvent:e.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,i)})}onButtonPressMenuCreateAnnotation(e,t){const i=this.buttons.findIndex(s=>s.value===e);this.updateButtonByIndex(i,{icon:t.icon}),this.events.emit("pressed-create-annotation",{annotation:t.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:e}){e.key==="Escape"&&this.events.emit("cancel-create-annotation",null)}updateButtonByIndex(e,t){const i=this.buttons.at(e);i&&(i.set({...i.toJson(),...t,value:t.value??i.value}),this.toolbar.updateButtonByIndex(e,{...i.toJson()}))}};y([Hx,_X({changeValue(e){this.toolbar?.setHidden(!e)}})],Wx.prototype,"enabled",2),y([Hx],Wx.prototype,"padding",2),y([Hx],Wx.prototype,"buttons",2);var{BaseModuleInstance:$X,InteractionState:Fg,Property:UX,ChartAxisDirection:YX,getIconClassNames:KX}=A,zg="ag-charts-annotations__axis-button",ZO=class extends $X{constructor(e,t,i,s){super(),this.ctx=e,this.axisCtx=t,this.onButtonClick=i,this.seriesRect=s,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=!!t.scale.bandwidth,e.domManager.addEventListener("focusin",({target:n})=>{const o=n instanceof HTMLElement?n:void 0;!(o&&e.domManager.contains(o,"series-area"))&&o!==this.button.getElement()&&this.hide()}),this.cleanup.register(e.widgets.seriesWidget.addListener("drag-move",n=>this.onMouseDrag(n)),e.widgets.seriesWidget.addListener("mousemove",n=>this.onMouseMove(n)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),e.widgets.seriesDragInterpreter?.events.on("click",n=>this.onClick(n)),e.eventsHub.on("series:focus-change",()=>this.onKeyPress()),e.eventsHub.on("zoom:pan-start",()=>this.hide()),e.eventsHub.on("zoom:change",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(e,t){this.seriesRect=e,this.padding=t}setup(){const e=new Dg.ButtonWidget;return e.addClass(zg),e.setTabIndex(-1),e.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(e.getElement()),e}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",zg)}onMouseMove(e){this.ctx.interactionManager.isState(Fg.Clickable)&&this.show(e)}onMouseDrag(e){this.ctx.interactionManager.isState(Fg.AnnotationsMoveable)&&this.show(e)}onMouseLeave(){this.ctx.interactionManager.isState(Fg.Clickable)&&this.hide()}onClick(e){this.ctx.interactionManager.isState(Fg.Clickable)&&e.device==="touch"&&this.show(e)}show(e){const{sourceEvent:t,currentX:i,currentY:s}=e;if(!(this.enabled&&this.ctx.widgets.seriesWidget.getElement().contains(t.target))){this.hide();return}this.toggleVisibility(!0);const n=this.getButtonCoordinates({x:i,y:s});this.coords={x:n.x+this.button.clientWidth/2,y:n.y+this.button.clientHeight/2},this.updatePosition(n)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(Fg.Default)||this.hide()}getButtonCoordinates({x:e,y:t}){const{axisCtx:{direction:i,position:s},seriesRect:n,snap:o,axisCtx:a,padding:r}=this,{clientWidth:l,clientHeight:c}=this.button,[h,d]=[0,n.height],[u,p]=[0,n.width];if(o&&(e=vr(dx(e-n.x,a),a)+n.x,t=vr(dx(t-n.y,a),a)+n.y),i===YX.X){const f=c-Math.max(0,r-5);e=e-l/2,t=s==="top"?h-c+f:d-f}else{const f=l-Math.max(0,r-9);e=s==="left"?u-l+f:p-f,t=t-c/2}return{x:e,y:t}}toggleVisibility(e){const{button:t}=this;if(t==null)return;const i=this.enabled&&e;this.toggleClass("-hidden",!i)}toggleClass(e,t){this.button.toggleClass(`${zg}-${e}`,t)}updatePosition({x:e,y:t}){this.button.getElement().style.transform=`translate(${Math.round(e)}px, ${Math.round(t)}px)`}updateButtonElement(){const{button:e}=this;e.addListener("click",()=>this.onButtonClick(this.coords)),e.addListener("touchend",()=>this.onButtonClick(this.coords)),e.addListener("drag-start",()=>{}),e.setInnerHTML(`<span class="${KX("zoom-in")} ${zg}-icon"></span>`)}};y([UX],ZO.prototype,"enabled",2);var{Color:XO,DraggablePopover:ZX,NativeWidget:AA,Vec2:Bi,createButton:$x,createCheckbox:XX,createSelect:qX,createTextArea:QX,initRovingTabIndex:qO,getIconClassNames:JX,mapValues:IA}=A,QO=class Lk extends ZX{constructor(t,i){super(t,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new jE(this.ctx,{detached:!0}),this.cleanup.register(t.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(t,i){const s=super.showWithChildren(t,i);return s.classList.add("ag-charts-dialog"),s.setAttribute("role","dialog"),s.addEventListener("mousedown",n=>{n.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),s.addEventListener("keydown",this.onKeyDown.bind(this)),Ze().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),s}updatePosition(t){super.updatePosition(t);const{anchor:i,fallbackAnchor:s}=this.getColorPickerAnchors()??{};i&&this.colorPicker.setAnchor(i,s)}createTabs(t,i,s){const n=ke("div","ag-charts-dialog__tabs"),o=IA(s,()=>cc()),a=IA(s,()=>cc());for(const[p,g]of Et(s))ca(g.panel,{id:a[p],role:"tabpanel","aria-labelledby":o[p]});const r=p=>{for(const[g,f]of Et(s))f.panel.classList.toggle("ag-charts-dialog__tab-panel--active",g===p),h[g].classList.toggle("ag-charts-dialog__tab-button--active",g===p),Ge(h[g],"aria-selected",g===p),g===p&&f.onShow?.()},l=new AA(ke("div","ag-charts-dialog__header"));l.addListener("drag-start",p=>{const{sourceEvent:g}=p;g.target instanceof Element&&g.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(p)}),l.addListener("drag-move",p=>this.onDragMove(p)),l.addListener("drag-end",()=>this.onDragEnd());const c=new t6;this.setDragHandle(c);const h=IA(s,(p,g)=>$x({label:this.ctx.localeManager.t(p.label),onPress:()=>r(g)},{id:o[g],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":a[g]})),d=ke("div","ag-charts-dialog__tab-list");ca(d,{role:"tablist","aria-label":this.ctx.localeManager.t(t)}),d.append(...Object.values(h));const u=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),d,u),n.append(l.getElement(),...Object.values(s).map(p=>p.panel)),r(i),qO({orientation:"horizontal",buttons:Object.values(h)}),{tabs:n,initialFocus:h[i]}}createTabPanel(){return ke("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return ke("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:t,options:i,value:s,onChange:n}){const o=this.createInputGroup(t);ca(o,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(t)});const a="ag-charts-dialog__button--active",r=[];for(const l of i){const{icon:c,altText:h}=l,d=this.ctx.localeManager.t(h),u=$x({icon:c,altText:d,onPress:()=>{for(const p of Array.from(o.children))p.classList.remove(a),p.ariaChecked="false";u.classList.add(a),u.ariaChecked="true",n(l.value)}},{"aria-checked":l.value===s,class:"ag-charts-dialog__button",role:"radio",title:d});l.value===s&&u.classList.add(a),o.appendChild(u),r.push(u)}return qO({orientation:"horizontal",buttons:r}),o}createSelect({altText:t,label:i,options:s,value:n,onChange:o}){const a=this.createInputGroup(i),r=this.ctx.localeManager.t(t),l=qX({value:n,options:s,onChange:o},{class:"ag-charts-dialog__select","aria-label":r,title:r});return a.append(l),a}createTextArea({placeholder:t,value:i,onChange:s}){const n=t?this.ctx.localeManager.t(t):void 0;return QX({value:i,onChange:s},{placeholder:n})}createCheckbox({label:t,checked:i,onChange:s}){const n=cc(),o=this.createInputGroup(t,{for:n}),a=XX({checked:i,onChange:s},{class:"ag-charts-dialog__checkbox",role:"switch",id:n});return o.append(a),o}createColorPicker({color:t,opacity:i,label:s,altText:n,onChange:o,onChangeHide:a,isMultiColor:r,hasMultiColorOption:l}){const c=this.createInputGroup(s),h=this.ctx.localeManager.t(n),d=$x({label:h,onPress:u=>{const{anchor:p,fallbackAnchor:g}=this.getColorPickerAnchors(d)??{};this.colorPicker.show({anchor:p,fallbackAnchor:g,color:t,opacity:i,isMultiColor:r,hasMultiColorOption:l,sourceEvent:u,onChange:(f,x,m,b)=>{d.style.setProperty("--color",f),d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",b),o(f,x,m,b)},onChangeHide:a})}},{"aria-label":h,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:h});if(r)d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(t){const u=XO.fromString(t),p=new XO(u.r,u.g,u.b,i);d.style.setProperty("--color",p.toHexString())}return c.append(d),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return $x({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(t,i){const s=ke("div","ag-charts-dialog__input-group"),n=ke("label","ag-charts-dialog__input-group-label");return n.innerText=this.ctx.localeManager.t(t),Ge(n,"for",i?.for),s.appendChild(n),s}onLayoutComplete(t){this.seriesRect=t.series.paddedRect,this.reposition()}onKeyDown(t){t.altKey||t.ctrlKey||t.metaKey||t.isComposing||t.key!=="Escape"||this.hide()}reposition(){const{seriesRect:t,ctx:i}=this,s=i.domManager.getBoundingClientRect(),n=this.getPopoverElement();if(!t||!n)return;const o=Bi.from(0,t.y),a=Bi.from(s.width,t.height),r=Bi.from(n),l=Bi.from(.5,1);let c;if(t.width>1e3){const h=Bi.sub(Bi.add(o,Bi.multiply(a,l)),Bi.multiply(r,l));c=Bi.sub(h,Bi.from(0,Lk.offset))}else{const h=Bi.sub(Bi.add(o,a),r);c=Bi.sub(h,Lk.offset)}this.updatePosition(c)}getColorPickerAnchors(t){if(t&&(this.colorPickerAnchorElement=t),!this.colorPickerAnchorElement)return;const i=this.colorPickerAnchorElement.getBoundingClientRect(),s=this.ctx.domManager.getBoundingClientRect(),n=Bi.sub(Bi.from(i.x,i.y),Bi.from(s.left,s.top)),o=Bi.add(n,Bi.from(0,i.height+5)),a=Bi.sub(n,Bi.from(0,5));return{anchor:o,fallbackAnchor:a}}};QO.offset=60;var e6=QO,t6=class extends AA{constructor(){super(ke("div","ag-charts-dialog__drag-handle"));const e=new AA(ke("span",JX("drag-handle")));e.setAriaHidden(!0),this.addChild(e)}},{focusCursorAtEnd:i6}=A,s6=class extends e6{constructor(e){super(e,"settings"),this.events=new Io,this.hideFns.push(()=>this.events.emit("hidden",null))}show(e,t){const i=this.createLinearLineTab(e,t),s=this.createLinearTextTab(e,t);let n="dialogHeaderLine";Cr(e)?n="dialogHeaderChannel":_E(e)?n="dialogHeaderFibonacciRange":e.type==="date-range"?n="dialogHeaderDateRange":e.type==="price-range"?n="dialogHeaderPriceRange":e.type==="date-price-range"&&(n="dialogHeaderDatePriceRange");const{tabs:o,initialFocus:a}=this.createTabs("ariaLabelSettingsTabBar",t.initialSelectedTab,{line:{label:n,panel:i},text:{label:"dialogHeaderText",panel:s.panel,onShow:s.onShow}});t.initialFocus=a,this.showWithChildren([o],t).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(e,t){const i=this.createTabPanel(),s=this.createInputGroupLine(),n=this.createInputGroupLine(),o="isMultiColor"in e,a=this.createColorPickerInput("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),o?e.isMultiColor:!1,o,t.onChangeLineColor,t.onChangeHideLineColor),r=this.createStrokeWidthSelect(e.strokeWidth??2,t.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(e.lineStyle??"solid",t.onChangeLineStyleType);if(s.append(a),"background"in e){const c=this.createColorPickerInput("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),!1,!1,t.onChangeFillColor,t.onChangeHideFillColor);s.append(c),n.append(r)}else"showFill"in e?(s.append(this.createCheckbox({label:"dialogInputShowFill",checked:e.showFill??!0,onChange:c=>t.onChangeLine({showFill:c})})),n.append(r)):s.append(r);return n.append(l),i.append(s,n),"bands"in e&&i.append(this.createFibonacciRatioSelect(e.bands??10,c=>t.onChangeLine({bands:c}))),"extendStart"in e&&"extendEnd"in e&&i.append(this.createCheckbox({label:Cr(e)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:e.extendStart??!1,onChange:c=>t.onChangeLine({extendStart:c})}),this.createCheckbox({label:Cr(e)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:e.extendEnd??!1,onChange:c=>t.onChangeLine({extendEnd:c})})),"extendAbove"in e&&"extendBelow"in e&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:e.extendAbove??!1,onChange:c=>t.onChangeLine({extendAbove:c})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:e.extendBelow??!1,onChange:c=>t.onChangeLine({extendBelow:c})})),"extendLeft"in e&&"extendRight"in e&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:e.extendLeft??!1,onChange:c=>t.onChangeLine({extendLeft:c})}),this.createCheckbox({label:"dialogInputExtendRight",checked:e.extendRight??!1,onChange:c=>t.onChangeLine({extendRight:c})})),"reverse"in e&&"showFill"in e&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:e.reverse??!1,onChange:c=>t.onChangeLine({reverse:c})})),i}createLinearTextTab(e,t){const i=this.createTabPanel(),s=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:e.text.label,onChange:h=>t.onChangeText({label:h})}),n=this.createFontSizeSelect(e.text.fontSize,t.onChangeTextFontSize),o=this.createColorPickerInput("text-color",e.text.color,1,!1,!1,t.onChangeTextColor,t.onChangeHideTextColor),a=e.text.position==="inside"?"center":e.text.position,r=this.createPositionRadioGroup(a??"top",h=>t.onChangeText({position:h})),l=this.createAlignmentRadioGroup(e.text.alignment??"center",h=>t.onChangeText({alignment:h})),c=this.createInputGroupLine();return c.append(n,o,r,l),i.append(s,c),{panel:i,onShow:()=>i6(s)}}createColorPickerInput(e,t,i,s,n,o,a){const r=e==="fill-color"?"dialogInputFillColorPicker":"dialogInputColorPicker",l=e==="fill-color"?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:r,altText:l,color:t,opacity:i,isMultiColor:s,hasMultiColorOption:n,onChange:o,onChangeHide:a})}createStrokeWidthSelect(e,t){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:WE.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(e),onChange:i=>t(Number(i))})}createFibonacciRatioSelect(e,t){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:CZ.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(e),onChange:i=>t(Number(i))})}createLineStyleRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:e,onChange:t})}createFontSizeSelect(e,t){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:$E.map(({label:i,value:s})=>({label:i,value:String(s)})),value:String(e),onChange:i=>t(Number(i))})}createPositionRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:e,onChange:t})}createAlignmentRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:"iconAltTextAlignLeft",value:"left"},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:"iconAltTextAlignRight",value:"right"}],value:e,onChange:t})}};function kA(e){return e.gridPadding+e.seriesAreaPadding+e.tickSize+e.label.spacing}function n6(e,t,i){for(const{update:s}of Object.values(Tn))s(e,t,i)}var{ChartUpdateType:o6,InteractionState:rn,PropertiesArray:a6,Property:_g,ChartAxisDirection:r6,keyProperty:l6,valueProperty:c6,Vec2:hh,Selection:h6,BBox:d6}=A,ou=class T_ extends A.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!0,this.toolbar=new Wx(this.ctx),this.optionsToolbar=new nA(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return ch(this.annotationData.at(i))}),this.axesButtons=new zD,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new a6(T_.createAnnotationDatum),this.defaults=new DZ,this.container=new A.Group({name:"static-annotations"}),this.annotations=new h6(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new s6(this.ctx),this.textInput=new BK(this.ctx),this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(t.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this)),this.cleanup.register(()=>this.clear())}setupStateMachine(){const{ctx:t}=this;return new jx({resetToIdle:()=>{t.domManager.updateCursor("annotations"),this.popAnnotationState(rn.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(i,s,n)=>{let o;return this.annotations.each((a,r,l)=>{const c=a.containsPoint(i.x,i.y);c&&(o??(o=l)),a.toggleHovered(c||s===l)}),o!=null?t.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||t.tooltipManager.unsuppressTooltip("annotations"),this.ctx.domManager.updateCursor("annotations",o==null?void 0:this.annotations.at(o)?.getCursor()),o!==n&&this.update(),o},getNodeAtCoords:(i,s)=>{const n=this.annotations.at(s);if(n)return n.getNodeAtCoords(i.x,i.y)},translate:(i,s)=>{const n=this.annotations.at(i),o=ch(this.annotationData.at(i));if(!(!n||!o))return this.translateNode(n,o,s)},copy:i=>{const s=this.annotations.at(i),n=ch(this.annotationData.at(i));if(!(!s||!n))return this.createAnnotationDatumCopy(s,n)},paste:i=>{this.createAnnotation(i.type,i,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(i,s)=>{const{annotations:n,optionsToolbar:o,toolbar:a}=this;this.hideOverlays(),a.clearActiveButton(),a.resetButtonIcons();const r=i!=null?n.at(i):null,l=s!=null?n.at(s):null;l===r&&r!=null||(l?.toggleActive(!1),o.hide(),r?(this.pushAnnotationState(rn.AnnotationsSelected),r.toggleActive(!0),o.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{o.show(),o.setAnchorScene(r)})):(this.popAnnotationState(rn.AnnotationsSelected),this.popAnnotationState(rn.Annotations)),this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(rn.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(rn.Annotations)},stopInteracting:()=>{this.popAnnotationState(rn.Annotations)},create:(i,s)=>{this.createAnnotation(i,s)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{this.annotationData.splice(0,this.annotationData.length)},validatePoint:(i,s)=>{const n=this.getAnnotationContext();return n?Ex(n,i,s):!0},getAnnotationType:i=>_K(this.annotationData[i].type),datum:i=>this.annotationData.at(i),node:i=>this.annotations.at(i),recordAction:i=>{this.recordActionAfterNextUpdate(i)},update:()=>{this.postUpdateFns.push(()=>{const i=this.state.getActive(),s=i!=null?this.annotations.at(i):null;s!=null&&this.optionsToolbar.setAnchorScene(s)}),this.update()},showTextInput:i=>{const s=ch(this.annotationData.at(i));if(!this.annotations.at(i)||!s||!("getTextInputCoords"in s)||!("getTextPosition"in s))return;const o={color:s.color,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,placeholderColor:s.getPlaceholderColor()},a=this.getAnnotationContext(),r=c=>hh.add(s.getTextInputCoords(a,c),hh.required(this.seriesRect)),l=()=>s.getTextPosition();this.textInput.show({styles:o,layout:{getTextInputCoords:r,getTextPosition:l,alignment:s.alignment,textAlign:s.textAlign,width:s.width},text:s.text,placeholderText:s.placeholderText,onChange:(c,h)=>{this.state.transition("updateTextInputBBox",h)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:i=>{this.textInput.updateColor(i)},updateTextInputFontSize:i=>{const s=this.textInput.updateFontSize(i);this.state.transition("updateTextInputBBox",s)},updateTextInputBBox:i=>{this.state.transition("updateTextInputBBox",i)},showAnnotationOptions:i=>{const s=this.annotations.at(i);!s||kl(this.annotationData.at(i))||(this.optionsToolbar.updateButtons(this.annotationData.at(i)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(s))},showAnnotationSettings:(i,s,n="line")=>{const o=this.annotationData.at(i);if(!bx(o)&&!Cr(o)&&!Eg(o)||kl(o))return;const a=c=>(h,d,u,p)=>{this.setColorAndDefault(o.type,c,h,d,u,p),this.optionsToolbar.updateColorPickerColor(c,d,u,p)},r=c=>()=>{this.recordActionAfterNextUpdate(`Change ${o.type} ${c} to ${o.getDefaultColor(c)}`,["annotations","defaults"]),this.update()},l={initialSelectedTab:n,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:s,onChangeLine:c=>{this.state.transition("lineProps",c),c.bands!=null&&this.defaults.setDefaultFibonacciOptions(o.type,"bands",c.bands),c.reverse!=null&&this.defaults.setDefaultFibonacciOptions(o.type,"reverse",c.reverse),c.showFill!=null&&this.defaults.setDefaultFibonacciOptions(o.type,"showFill",c.showFill)},onChangeText:c=>{this.state.transition("lineText",c),c.alignment&&this.defaults.setDefaultLineTextAlignment(o.type,c.alignment),c.position&&this.defaults.setDefaultLineTextPosition(o.type,c.position),this.recordActionAfterNextUpdate(`Change ${o.type} text ${Object.keys(c).map(h=>`${h} to ${c[h]}`).join(", ")}`)},onChangeFillColor:a("fill-color"),onChangeHideFillColor:r("fill-color"),onChangeLineColor:a("line-color"),onChangeHideLineColor:r("line-color"),onChangeLineStyleType:c=>{this.setLineStyleTypeAndDefault(o.type,c),this.optionsToolbar.updateLineStyleType(Og.find(h=>h.value===c)??Og[0])},onChangeLineStyleWidth:c=>{this.setLineStyleWidthAndDefault(o.type,c),this.optionsToolbar.updateStrokeWidth({strokeWidth:c,value:c,label:String(c)})},onChangeTextColor:a("text-color"),onChangeHideTextColor:r("text-color"),onChangeTextFontSize:c=>{this.setFontSizeAndDefault(o.type,c)}};this.settingsDialog.show(o,l)}})}setupListeners(){const{ctx:t,optionsToolbar:i,settingsDialog:s,toolbar:n}=this,{seriesWidget:o,seriesDragInterpreter:a,chartWidget:r}=t.widgets;a&&this.cleanup.register(a.events.on("click",this.hoverTouchPreHandler.bind(this)),a.events.on("drag-start",this.hoverTouchPreHandler.bind(this)),a.events.on("drag-move",this.dragMoveTouchPreHandler.bind(this)),a.events.on("mousemove",this.onHover.bind(this)),a.events.on("click",this.onClick.bind(this)),a.events.on("dblclick",this.onDoubleClick.bind(this)),a.events.on("drag-start",this.onDragStart.bind(this)),a.events.on("drag-move",this.onDrag.bind(this)),a.events.on("drag-end",this.onDragEnd.bind(this))),this.cleanup.register(o.addListener("keydown",this.onKeyDown.bind(this)),o.addListener("keyup",this.onKeyUp.bind(this)),r.addListener("click",this.onCancel.bind(this)),t.eventsHub.on("annotations:restore",this.onRestoreAnnotations.bind(this)),t.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),t.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),t.eventsHub.on("zoom:change",()=>this.onResize()),t.eventsHub.on("dom:resize",()=>this.onResize()),n.events.on("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),n.events.on("pressed-create-annotation",({annotation:l})=>{this.cancel(),this.pushAnnotationState(rn.Annotations),this.state.transition(l),this.update()}),n.events.on("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),n.events.on("pressed-show-menu",()=>{this.cancel(),this.reset()}),n.events.on("pressed-unrelated",()=>{this.reset()}),i.events.on("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),i.events.on("pressed-settings",({sourceEvent:l})=>{this.state.transition("toolbarPressSettings",l)}),i.events.on("pressed-lock",()=>{this.update()}),i.events.on("hid-overlays",()=>{this.settingsDialog.hide()}),i.events.on("saved-color",({type:l,colorPickerType:c,color:h})=>{this.recordActionAfterNextUpdate(`Change ${l} ${c} to ${h}`,["annotations","defaults"])}),i.events.on("updated-color",({type:l,colorPickerType:c,colorOpacity:h,color:d,opacity:u,isMultiColor:p})=>{this.setColorAndDefault(l,c,h,d,u,p)}),i.events.on("updated-font-size",({type:l,fontSize:c})=>{this.setFontSizeAndDefault(l,c)}),i.events.on("updated-line-style",({type:l,lineStyleType:c})=>{this.setLineStyleTypeAndDefault(l,c)}),i.events.on("updated-line-width",({type:l,strokeWidth:c})=>{this.setLineStyleWidthAndDefault(l,c)}),s.events.on("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:t,toolbar:i,optionsToolbar:s}=this;this.cleanup.register(t.annotationManager.attachNode(this.container),()=>{t.domManager.removeStyles(zg),i.destroy(),s.destroy()})}async processData(t){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[l6(this.xKey,void 0,{id:"date"}),c6(this.volumeKey,"number",{id:"volume"})],{dataModel:s,processedData:n}=await t.request("annotations",[...this.data],{props:i});this.dataModel=s,this.processedData=n}createAnnotationScene(t){if(t.type in Tn)return new Tn[t.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${t.type}], expected one of [${Object.keys(Tn)}], ignoring.`)}static createAnnotationDatum(t){if(t.type in Tn)return new Tn[t.type].datum().set(t);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${t.type}], expected one of [${Object.keys(Tn)}], ignoring.`)}createAnnotation(t,i,s=!0){if(this.annotationData.push(i),s){const n=this.ctx.annotationManager.getAnnotationTypeStyles(t);n&&i.set(n),this.defaults.applyDefaults(i)}this.injectDatumDependencies(i),this.update()}injectDatumDependencies(t){"setLocaleManager"in t&&t.setLocaleManager(this.ctx.localeManager),"getVolume"in t&&(t.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(t,i){const{dataModel:s,processedData:n}=this;let o=Ri(t),a=Ri(i);if(!Ph(o)||!Ph(a)||!s||!n||this.volumeKey==null)return;o>a&&([o,a]=[a,o]);const r=s.resolveKeysById({id:"annotations"},"date",n),l=s.resolveColumnById({id:"annotations"},"volume",n);let c=0;for(let h=0;h<n.input.count;h++){const d=r[h];Ph(d)&&d>=o&&d<=a&&(c+=l[h])}return c}translateNode(t,i,s){const n=this.getAnnotationConfig(i),o=this.getAnnotationContext();o&&n.translate(t,i,s,o)}createAnnotationDatumCopy(t,i){const s=this.getAnnotationConfig(i),n=new s.datum;n.set(i.toJson());const o=this.getAnnotationContext();if(o)return s.copy(t,i,n,o)}getAnnotationConfig(t){if(t.type in Tn)return Tn[t.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${t.type}], expected one of [${Object.keys(Tn)}], ignoring.`)}onRestoreAnnotations(t){this.enabled&&(this.clear(),this.annotationData.set(t.annotations),this.postUpdateFns.push(()=>{this.ctx.annotationManager.fireChangedEvent()}),this.update())}onLayoutComplete(t){const i=t.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i);for(const s of t.axes??[])s.direction===A.ChartAxisDirection.X?this.xAxis=this.getAxis(s,i,this.xAxis?.button):this.yAxis=this.getAxis(s,i,this.yAxis?.button);this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const t=this.ctx.chartService.series.some(n=>n.hasData),s=this.yAxis.context.seriesIds().some(n=>this.ctx.chartService.series.find(a=>a.id===n)?.visible);return t&&s}animateAnnotations({from:t,to:i,phase:s}){const{annotations:n}=this;this.ctx.animationManager?.animate({from:t,to:i,id:"chart-annotations",phase:s,groupId:"opacity",onUpdate(o){n.each(a=>{a.opacity=o,"setAxisLabelOpacity"in a&&a.setAxisLabelOpacity(o)})},onStop(){n.each(o=>{o.opacity=i,"setAxisLabelOpacity"in o&&o.setAxisLabelOpacity(i)})}})}onPreRender(){this.updateAnnotations(),this.state.transition("render")}getAxis(t,i,s){const n=this.ctx.axisManager.getAxisContext(t.direction)[0],{position:o="bottom",direction:a}=n,r=t.gridPadding+t.seriesAreaPadding,l=new d6(0,0,i.width,i.height).grow(r,o),c=n.direction===r6.X?"vertical":"horizontal",{axesButtons:h,snap:d}=this;if(this.enabled&&h.enabled&&(h.axes==="xy"||h.axes===a)){s??(s=new ZO(this.ctx,{...n,snapToGroup:d},g=>this.onAxisButtonClick(g,c),i));const p=kA(t);s.update(i,p)}else s?.destroy(),s=void 0;return{layout:t,context:n,bounds:l,button:s}}recordActionAfterNextUpdate(t,i=["annotations"]){const{defaults:s,ctx:{annotationManager:n,historyManager:o}}=this,a=i.map(r=>r==="defaults"?s:n);this.postUpdateFns.push(()=>{o.record(t,...a),n.fireChangedEvent()})}setColorAndDefault(t,i,s,n,o,a){this.state.transition("color",{colorPickerType:i,colorOpacity:s,color:n,opacity:o,isMultiColor:a}),this.defaults.setDefaultColor(t,i,s,n,o,a)}setFontSizeAndDefault(t,i){this.state.transition("fontSize",i),this.defaults.setDefaultFontSize(t,i),this.recordActionAfterNextUpdate(`Change ${t} font size to ${i}`,["annotations","defaults"])}setLineStyleTypeAndDefault(t,i){this.state.transition("lineStyle",{type:i}),this.defaults.setDefaultLineStyleType(t,i),this.recordActionAfterNextUpdate(`Change ${t} line style to ${i}`,["annotations","defaults"])}setLineStyleWidthAndDefault(t,i){this.state.transition("lineStyle",{strokeWidth:i}),this.defaults.setDefaultLineStyleWidth(t,i),this.recordActionAfterNextUpdate(`Change ${t} stroke width to ${i}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:t,annotations:i,seriesRect:s,ctx:{annotationManager:n}}=this,o=this.getAnnotationContext();if(!s||!o)return;n.updateData(t.toJson().filter(r=>!kl(r)));const a=this.showAnnotations();this.toolbar.refreshButtonsEnabled(a),this.toolbar.toggleClearButtonEnabled(t.length>0&&a),i.update(t??[],void 0,r=>r.id).each((r,l)=>{if(!a){r.visible=!1,"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!1);return}"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!0),this.injectDatumDependencies(l),n6(r,l,o)}),this.postUpdateFns.forEach(r=>r()),this.postUpdateFns=[]}getAnnotationContext(){const{seriesRect:t,xAxis:i,yAxis:s,snap:n}=this;if(t&&i&&s)return{seriesRect:t,xAxis:{...i.context,bounds:i.bounds,labelPadding:kA(i.layout),snapToGroup:n},yAxis:{...s.context,bounds:s.bounds,labelPadding:kA(i.layout),snapToGroup:n}}}onHover(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const n=t.sourceEvent.shiftKey,o=hh.from(t),a=Ys(o,s);i.transition("hover",{offset:o,point:a,shiftKey:n,context:s})}onClick(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const n=t.sourceEvent.shiftKey,o=Ys(hh.from(t),s),a=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("click",{point:o,shiftKey:n,textInputValue:a,bbox:r})}onDoubleClick(t){const{state:i}=this;if(!this.getAnnotationContext())return;const n=hh.from(t);i.transition("dblclick",{offset:n})}onAxisButtonClick(t,i){this.cancel(),this.reset();const s=this.getAnnotationContext();if(!this.annotationData||!s)return;const{state:n}=this;this.pushAnnotationState(rn.Annotations);const o=i==="horizontal";if(n.transition(o?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!t)return;const a=Ys(t,s);Ex(s,a)&&(n.transition("click",{point:a,shiftKey:!1}),this.update())}onResize(){const t=this.textInput.getValue(),i=this.textInput.getBBox();this.state.transition("resize",{textInputValue:t,bbox:i})}hoverTouchPreHandler(t){t.device==="touch"&&this.onHover(t)}dragMoveTouchPreHandler(t){t.device==="touch"&&this.ctx.interactionManager.isState(rn.AnnotationsSelected)&&t.sourceEvent.preventDefault()}onDragStart(t){if(!this.ctx.interactionManager.isState(rn.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=hh.from(t),n=Ys(s,i),o=this.textInput.getValue(),a=this.textInput.getBBox();this.state.transition("dragStart",{context:i,offset:s,point:n,textInputValue:o,bbox:a})}onDrag(t){if(!this.ctx.interactionManager.isState(rn.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=hh.from(t),n=Ys(s,i),o=t.sourceEvent.shiftKey,a=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("drag",{context:i,offset:s,point:n,shiftKey:o,textInputValue:a,bbox:r})}onDragEnd(){this.state.transition("dragEnd")}onCancel(t){const{sourceEvent:i}=t??{};i?.currentTarget===i?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{key:n,shiftKey:o}=t,a=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("textInput",{key:n,shiftKey:o,textInputValue:a,bbox:r,context:s})}onKeyDown(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{sourceEvent:n}=t,{shiftKey:o,ctrlKey:a,metaKey:r}=n,l=a||r,c=a||o;i.transition("keyDown",{shiftKey:o,context:s});const h={x:0,y:0},d=Math.max(s?.xAxis.scale.bandwidth??0,c?10:1),u=Math.max(s?.yAxis.scale.bandwidth??0,c?10:1);switch(n.key){case"ArrowDown":h.y=u;break;case"ArrowUp":h.y=-u;break;case"ArrowLeft":h.x=-d;break;case"ArrowRight":h.x=d;break;case"Escape":this.onCancel();return;case"Backspace":case"Delete":this.onDelete();return}if((h.x||h.y)&&(i.transition("translate",{translation:h}),n.stopPropagation(),n.preventDefault()),!!l)switch(n.key){case"c":i.transition("copy");return;case"x":i.transition("cut"),this.recordActionAfterNextUpdate("Cut annotation");return;case"v":i.transition("paste"),this.recordActionAfterNextUpdate("Paste annotation");return}}onKeyUp(t){const{shiftKey:i}=t.sourceEvent,s=this.getAnnotationContext();s&&(this.state.transition("keyUp",{shiftKey:i,context:s}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){for(const[t,i]of this.annotationData.entries())kl(i)&&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(rn.Annotations)||this.ctx.interactionManager.isState(rn.AnnotationsSelected)}update(t=o6.PRE_SCENE_RENDER){this.ctx.updateService.update(t)}};y([_g],ou.prototype,"enabled",2),y([_g],ou.prototype,"toolbar",2),y([_g],ou.prototype,"optionsToolbar",2),y([_g],ou.prototype,"axesButtons",2),y([_g],ou.prototype,"snap",2);var u6=ou,{FONT_SIZE_RATIO:CA,ThemeSymbols:ys}=A,yo={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},ms={fill:ys.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},dh={color:{$ref:"chartBackgroundColor"},fontSize:{$rem:CA.LARGE},fontFamily:{$ref:"fontFamily"}},JO={...dh,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},Ux={...dh,textAlign:"left"},uh={...dh,position:"top",alignment:"center",color:{$ref:"textColor"}},eP={...dh,position:"top",alignment:"center",color:{$ref:"textColor"}},TA={...dh,fontSize:{$ref:"fontSize"},color:ys.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:ys.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:ys.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:ys.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},LA={...yo,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ms},text:{...uh},statistics:{...TA}},p6={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:"chartPadding"}},g6={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"}]},f6={enabled:!1,line:{...yo,handle:{...ms},text:{...uh}},"horizontal-line":{...yo,handle:{...ms},axisLabel:{...JO},text:{...uh}},"vertical-line":{...yo,handle:{...ms},axisLabel:{...JO},text:{...uh}},"disjoint-channel":{...yo,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ms},text:{...eP}},"parallel-channel":{...yo,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ms},text:{...eP}},"fibonacci-retracement":{...yo,strokes:ys.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...ms},text:{...uh,position:"center"},label:{...dh,color:void 0,fontSize:{$rem:CA.SMALLER}}},"fibonacci-retracement-trend-based":{...yo,strokes:ys.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...ms},text:{...uh,position:"center"},label:{...dh,color:void 0,fontSize:{$rem:CA.SMALLER}}},callout:{...yo,...Ux,color:{$ref:"textColor"},handle:{...ms},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...Ux,fontWeight:700,handle:{...ms},fill:{$ref:"foregroundColor"}},note:{...Ux,color:ys.DEFAULT_TEXTBOX_COLOR,fill:ys.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...ms},background:{fill:ys.DEFAULT_TEXTBOX_FILL,stroke:ys.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...Ux,color:{$ref:"textColor"},handle:{...ms}},arrow:{...yo,handle:{...ms},text:{...uh}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...ms,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...ms,stroke:{$ref:"foregroundColor"}}},"date-range":{...LA},"price-range":{...LA},"date-price-range":{...LA},"quick-date-price-range":{up:{...yo,fill:ys.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...ms},statistics:{...TA,color:"#fff",fill:ys.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...yo,stroke:ys.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:ys.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...ms,stroke:ys.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...TA,color:"#fff",fill:ys.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:p6,optionsToolbar:g6},y6={type:"root",optionsKey:"annotations",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new u6(e),themeTemplate:{annotations:f6}},{BaseProperties:m6,ObserveChanges:x6,ProxyProperty:b6,Property:ph,calculatePlacement:v6}=A,Fa=class extends m6{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=ke("img"),this.imageElement.onload=this.onImageLoad,this.node=new A.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(e,t){this.containerWidth=e,this.containerHeight=t;const i={width:e,height:t},s=v6(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...s}:{visible:!1}),s}};y([ph],Fa.prototype,"top",2),y([ph],Fa.prototype,"right",2),y([ph],Fa.prototype,"bottom",2),y([ph],Fa.prototype,"left",2),y([ph],Fa.prototype,"width",2),y([ph],Fa.prototype,"height",2),y([ph],Fa.prototype,"opacity",2),y([b6("imageElement.src"),x6(e=>e.loadedSynchronously=e.complete)],Fa.prototype,"url",2);var{ActionOnSet:S6,Property:M6}=A,tP=class extends A.Background{constructor(){super(...arguments),this.image=new Fa}onLayoutComplete(e){if(super.onLayoutComplete(e),this.image){const{width:t,height:i}=e.chart;this.image.performLayout(t,i)}}onImageLoad(){this.ctx.updateService.update(A.ChartUpdateType.SCENE_RENDER)}};y([M6,S6({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){this.node.removeChild(e.node),e.onLoad=void 0}})],tP.prototype,"image",2);var D6={type:"root",optionsKey:"background",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new tP(e)},{Range:A6,TranslatableGroup:I6,BBox:k6,Property:Ko,ZIndexMap:C6,ChartAxisDirection:T6,FillGradientDefaults:L6,FillImageDefaults:w6,FillPatternDefaults:N6,getShapeFill:E6,InteractionState:Yx}=A,mo=class extends A.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.id=ns(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.fill="#c16068",this.fillOpacity=1,this.fillGradientDefaults=new L6,this.fillPatternDefaults=new N6,this.fillImageDefaults=new w6,this.bounds=new k6(0,0,0,0),this.bandHighlightGroup=new I6({name:"bandHighlight",zIndex:C6.AXIS_BAND_HIGHLIGHT}),this.rangeNode=this.bandHighlightGroup.appendChild(new A6),this.activeAxisHighlight=void 0,this.axisCtx=e.parent,this.hideBand(),e.domManager.addEventListener("focusin",({target:o})=>{const a=o instanceof HTMLElement&&e.domManager.contains(o,"series-area");this.bandHighlightGroup.visible&&!a&&(this.hideBand(),this.ctx.updateService.update(A.ChartUpdateType.PERFORM_LAYOUT))});const{widgets:{seriesWidget:t,seriesDragInterpreter:i},animationManager:s,eventsHub:n}=e;this.cleanup.register(e.scene.attachNode(this.bandHighlightGroup),t.addListener("mousemove",o=>this.onHoverLikeEvent(o)),t.addListener("mouseleave",()=>this.clearAllHighlight()),s.addListener("animation-start",()=>this.clearAllHighlight()),n.on("layout:complete",o=>this.layout(o)),n.on("series:focus-change",()=>this.onKeyPress()),n.on("zoom:pan-start",()=>this.clearAllHighlight()),n.on("zoom:change",()=>this.clearAllHighlight()),n.on("dom:resize",()=>this.clearAllHighlight()),n.on("axis:change",()=>this.axisChange())),i&&this.cleanup.register(i.events.on("drag-move",o=>this.onHoverLikeEvent(o)),i.events.on("click",o=>this.onClick(o)))}axisChange(){this.onHighlightChange()}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}onClick(e){e.device==="touch"&&this.onHoverLikeEvent(e)}clearAllHighlight(){this.ctx.interactionManager.isState(Yx.Clickable)&&this.onHighlightChange()}onKeyPress(){this.ctx.interactionManager.isState(Yx.Default)&&this.onHighlightChange()}onHoverLikeEvent(e){const t=this.isHover(e)?Yx.Clickable:Yx.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&this.handleHoverHighlight(e)}handleHoverHighlight(e){if(!e)return;const{currentX:t,currentY:i}=e;this.onHighlightChange(this.axisCtx.pickBand({x:t,y:i}))}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;const{position:s="left",axisId:n}=this.axisCtx,o=i.find(l=>l.id===n);if(!o)return;this.axisLayout=o,this.bounds=e.clone().grow(o.gridPadding,s);const{bandHighlightGroup:a,bounds:r}=this;a.translationX=Math.round(r.x),a.translationY=Math.round(r.y),this.updateBand()}updateBand(){const{rangeNode:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,fill:o,fillOpacity:a,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c,lineDashOffset:h,axisLayout:d}=this;d&&(e.stroke=t,e.strokeWidth=i,e.strokeOpacity=s,e.lineDash=n,e.lineDashOffset=h,e.fill=E6(o,r,l,c),e.fillOpacity=a,e.startLine=!0,e.endLine=!0)}isVertical(){return this.axisCtx.direction===T6.X}onHighlightChange(e){this.enabled&&(this.activeAxisHighlight=e,this.activeAxisHighlight?this.showBand():this.hideBand(),this.ctx.updateService.update(A.ChartUpdateType.SCENE_RENDER))}updateBandPosition(){const{rangeNode:e,bounds:t}=this,{band:i}=this.activeAxisHighlight??{};if(i==null){this.hideBand();return}let s=Math.min(...i),n=Math.max(...i);if(n-s<1){const o=(s+n)/2;s=o-.5,n=o+.5}this.isVertical()?(e.y1=0,e.y2=t.height,e.x1=s,e.x2=n,e.horizontal=!0):(e.y1=s,e.y2=n,e.x1=0,e.x2=t.width,e.horizontal=!1)}showBand(){this.updateBandPosition(),this.bandHighlightGroup.visible=!0}hideBand(){this.bandHighlightGroup.visible=!1}};y([Ko],mo.prototype,"enabled",2),y([Ko],mo.prototype,"stroke",2),y([Ko],mo.prototype,"lineDash",2),y([Ko],mo.prototype,"lineDashOffset",2),y([Ko],mo.prototype,"strokeWidth",2),y([Ko],mo.prototype,"strokeOpacity",2),y([Ko],mo.prototype,"fill",2),y([Ko],mo.prototype,"fillOpacity",2),y([Ko],mo.prototype,"fillGradientDefaults",2),y([Ko],mo.prototype,"fillPatternDefaults",2),y([Ko],mo.prototype,"fillImageDefaults",2);var O6={type:"axis-option",optionsKey:"bandHighlight",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","ordinal-time","unit-time","grouped-category"],moduleFactory:e=>new mo(e),themeTemplate:{bandHighlight:{enabled:!1,strokeWidth:0,lineDash:[],fill:{$foregroundBackgroundMix:.05}}}},{ActionOnSet:P6,LayoutElement:R6,Menu:B6,Property:F6}=A,wA=[{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"}],iP=class extends A.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.menu=new B6(this.ctx,"chart-toolbar"),this.toolbar=e.sharedToolbar.getSharedToolbar("chartToolbar"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),e.layoutManager.registerElement(R6.ToolbarLeft,this.onLayoutStart.bind(this)),()=>this.toolbar.destroy())}onLayoutStart(e){this.enabled&&(this.updateButton(),this.toolbar.layout(e.layoutBox))}onButtonPressed({event:e,buttonBounds:t}){this.menu.setAnchor({x:t.x+t.width+6,y:t.y}),this.menu.show({items:wA,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:e.sourceEvent,onPress:i=>{this.setChartType(i.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton()}}),this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const e=this.getChartType(),t=wA.find(i=>i.value===e)?.icon;t!=null&&this.toolbar.updateButtons([{icon:t,tooltip:"toolbarSeriesTypeDropdown"}])}hidePopover(){this.toolbar.clearActiveButton(),this.menu.hide()}setChartType(e){const t={chartType:e};this.ctx.chartService.publicApi?.updateDelta(t).catch(i=>X.error(i))}getChartType(){const e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return e==null||!wA.some(t=>t.value===e)?"candlestick":e}};y([F6,P6({changeValue(e){this.toolbar?.setHidden(!e)}})],iP.prototype,"enabled",2);var z6={type:"root",optionsKey:"chartToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new iP(e)};function _6(e,t){return e==="always"?!0:e==="series-area"?t==="series-area"||t==="series-node":e===t}function sP(e,t,i){let s=!0;if(t.type==="separator"){const n=i.at(i.length-1);s=n!==void 0&&n.type!=="separator"}if(s&&(s=_6(t.showOn??"always",e)),s){const n=new V6(t);return i.push(n),n}}function nP(e,t,i,s){t.isVisible(i)&&sP(e,t.builtins.items[i],s)}function G6(e,t,i,s){const{builtins:n}=t;if(eG(i,n.lists))for(const o of n.lists[i])nP(e,t,o,s);else nP(e,t,i,s)}function oP(e,t,i,s){for(const n of i)if(typeof n=="string")G6(e,t,n,s);else{const o=sP(e,n,s);n.items&&o&&n.items.length>0&&oP(e,t,n.items,o.items)}s[s.length-1]?.type==="separator"&&s.pop()}var V6=class{constructor(e){this.type="action",this.showOn="always",this.label="",this.iconUrl=void 0,this.enabled=!0,this.items=[],this.action=void 0,e&&this.setOptions(e),this.items=[]}setField(e,t,i){t[e]=i}setOptions(e){let t;for(t in e)e[t]!==void 0&&this.setField(t,this,e[t])}},wr="ag-charts-context-menu",{Property:NA,ContextMenuRegistry:Gg,callWithContext:Kx,getIconClassNames:j6}=A,EA="context-menu",Zx=class extends A.BaseModuleInstance{constructor(e){if(super(),this.ctx=e,this.enabled=!0,this.darkTheme=!1,this.items=["defaults"],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.closingSubMenus=0,this.menuWidget=new Dg.MenuWidget,this.interactionManager=e.interactionManager,this.element=e.domManager.addChild("canvas-overlay",EA),this.element.classList.add(wr),this.element.style.display="none",this.element.addEventListener("contextmenu",t=>t.preventDefault()),this.element.addEventListener("focusout",({relatedTarget:t})=>{this.closingSubMenus>0||(t==null||t instanceof Node&&!this.element.contains(t))&&this.hide()}),this.cleanup.register(()=>this.element.parentNode?.removeChild(this.element),()=>this.menuWidget.destroy(),e.eventsHub.on("dom:hidden",()=>this.hide()),this.menuWidget.addListener("close-widget",()=>this.onClose())),this.menuWidget.addClass(`${wr}__menu`),typeof MutationObserver<"u"){const t=new MutationObserver(()=>{this.element.contains(this.menuWidget.getElement())&&this.reposition()});t.observe(this.element,{childList:!0}),this.mutationObserver=t,this.cleanup.register(()=>t.disconnect())}this.ctx.contextMenuRegistry.builtins.items.download.action=()=>{const t=e.chartService.title;let i="image";t?.enabled&&(i=t.node.getPlainText().replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(s=>{X.error("Unable to download chart",s)})},this.cleanup.register(this.ctx.eventsHub.on("context-menu:complete",t=>this.onContext(t)))}expandItemsOptions(e){const t=[];return oP(e,this.ctx.contextMenuRegistry,this.items,t),t}onContext(e){if(!this.enabled)return;e.widgetEvent.sourceEvent.preventDefault(),this.showEvent=e.widgetEvent.sourceEvent,this.x=e.x,this.y=e.y,this.pickedNode=void 0,this.pickedLegendItem=void 0,Gg.check("series-node",e)?this.pickedNode=e.context.pickedNode:Gg.check("legend-item",e)&&(this.pickedLegendItem=e.context.legendItem);const t=this.expandItemsOptions(e.showOn);t.length!==0&&this.show(e.widgetEvent,t)}show(e,t){this.interactionManager.pushState(A.InteractionState.ContextMenu),this.element.style.display="block";const i=e.sourceEvent.pointerType==="touch"?!1:void 0;i!==void 0&&this.ctx.chartService.overrideFocusVisible(i),this.createMenu(t),this.element.appendChild(this.menuWidget.getElement()),this.menuWidget.open(e,{overrideFocusVisible:i})}hide(){this.menuWidget.close()}onClose(){this.interactionManager.popState(A.InteractionState.ContextMenu),this.element.removeChild(this.menuWidget.getElement()),this.element.style.display="none"}onSubMenuOpen(e,t){const i=e.getBounds();e.setFocusOverride(!0),e.getElement().insertAdjacentElement("afterend",t.getElement()),t.getElement().style.position="absolute";const s=this.ctx.domManager.getBoundingClientRect(),n=e.getBoundingClientRect(),o=s.right-n.right,a=n.left-s.left,{offsetWidth:r,offsetHeight:l}=t.getElement();let c=i.y;if(s.height>l){const h=s.bottom-n.top;h<l&&(c-=l-h)}if(o>=r)t.setBounds({x:i.x+i.width,y:c});else{const h=i.x-r,d=a+h;d>=0?t.setBounds({x:h,y:c}):t.setBounds({x:h-d,y:c})}}onSubMenuClose(e,t){e.setFocusOverride(void 0),this.closingSubMenus++,t.remove(),this.closingSubMenus--}createMenu(e){const{menuWidget:t}=this;t.clear(),t.setTabIndex(-1),this.createMenuItems(t,e)}createMenuItems(e,t){for(const i of t)switch(i.type){case"separator":{e.addSeparator().classList.add(`${wr}__divider`);break}case"action":{if(i.items.length===0){const s=new Dg.MenuItemWidget;this.initButtonElement(s,i),e.addChild(s)}else{const{subMenuButton:s,subMenu:n}=e.addSubMenu();n.addClass(`${wr}__menu`),n.addListener("open-widget",()=>this.onSubMenuOpen(s,n)),n.addListener("close-widget",()=>this.onSubMenuClose(s,n)),this.initButtonElement(s,i),this.createMenuItems(n,i.items)}break}default:throw new Error("unhandled case")}}createButtonOnClick(e,t){return Gg.checkCallback("legend-item",e,t)?i=>{const s=i.sourceEvent;if(this.pickedLegendItem){const{seriesId:n,itemId:o,label:a}=this.pickedLegendItem,{chartService:r}=this.ctx,c=[r.series.find(d=>d.id===n)?.properties,r],h={type:"contextmenu",seriesId:n,itemId:o,text:a.text,event:s};Kx(c,t,h),this.hide()}else X.error("legend item not found")}:Gg.checkCallback("series-area",e,t)?()=>{const i=this.ctx.chartService,s={type:"seriesContextMenuAction",event:this.showEvent};Kx(i,t,s),this.hide()}:Gg.checkCallback("series-node",e,t)?()=>{const{showEvent:i}=this,{chartService:s}=this.ctx,n=this.pickedNode,o=[n?.series.properties,s],a=n?.series.createNodeContextMenuActionEvent(i,n);a?Kx(o,t,a):X.error("series node not found"),this.hide()}:()=>{const i=this.ctx.chartService,s={type:"contextMenuEvent",event:this.showEvent};Kx(i,t,s),this.hide()}}initTableCells(e){const t=ke("div"),i=ke("div"),s=ke("div");return t.classList.toggle(`${wr}__icon`,!0),i.classList.toggle(`${wr}__cell`,!0),s.classList.toggle(`${wr}__cell`,!0),t.ariaHidden="true",i.role="presentation",s.ariaHidden="true",e.append(t,i,s),{cellIcon:t,cellLabel:i,cellArrow:s}}initButtonElement(e,t){e.addClass(`${wr}__item`),e.setEnabled(t.enabled);const i=this.ctx.localeManager.t(t.label),s=`${wr}__cellpadding`,{cellIcon:n,cellLabel:o,cellArrow:a}=this.initTableCells(e.getElement());if(o.textContent=i,o.classList.add(s),t.iconUrl!=null){const c=ke("img");c.src=t.iconUrl,n.append(c),n.classList.add(s)}if(t.items.length>0){const c=ke("span",j6("chevron-right"));a.append(c),a.classList.add(s)}const{showOn:r,action:l}=t;l!=null&&e.addListener("click",this.createButtonOnClick(r,l)),e.addListener("mousemove",()=>e.focus({preventScroll:!0})),t.items.length===0&&(e.addListener("mouseleave",()=>e.setFocusOverride(!1)),e.addListener("focus",()=>e.setFocusOverride(void 0)))}reposition(){let{x:e,y:t}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:s,offsetHeight:n}=this.element;e=ve(0,e,i.width-s),t=ve(0,t,i.height-n),this.element.style.left=`${e}px`,this.element.style.top=`calc(${t}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(EA),this.ctx.domManager.removeChild("canvas-overlay",EA)}};y([NA],Zx.prototype,"enabled",2),y([NA],Zx.prototype,"darkTheme",2),y([NA],Zx.prototype,"items",2);var H6={type:"root",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],optionsKey:"contextMenu",moduleFactory:e=>new Zx(e),themeTemplate:{contextMenu:{enabled:!0,darkTheme:A.ThemeSymbols.IS_DARK_THEME}}};function Vg(e){return typeof e?.datum=="object"?e.datum:null}var{FormatManager:W6,BaseProperties:$6,Property:au}=A,U6="ag-charts-crosshair-label",_l=class extends $6{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0,this._cachedFormatter=void 0}formatValue(e,t,i,s){const{formatter:n,format:o}=this,{domain:a,boundSeries:r}=s;let l;if(n!=null){const c=s.type==="number"?s.fractionDigits:void 0,h=s.type==="date"?s.unit:void 0,d=s.type==="date"?s.step:void 0;l=e(n,{value:i,domain:a,fractionDigits:c,unit:h,step:d,boundSeries:r})}if(o!=null){let c=this._cachedFormatter;(c==null||c.type!==t||c.format!==o)&&(c={type:t,format:o,formatter:W6.getFormatter(t,o)},this._cachedFormatter=c),l??(l=c.formatter?.(i))}return l!=null?String(l):void 0}};y([au],_l.prototype,"enabled",2),y([au],_l.prototype,"xOffset",2),y([au],_l.prototype,"yOffset",2),y([au],_l.prototype,"formatter",2),y([au],_l.prototype,"format",2),y([au],_l.prototype,"renderer",2);var Y6=class extends _l{constructor(e,t,i){super(),this.domManager=e,this.id=ns(this),this.element=e.addChild("canvas-overlay",`crosshair-label-${this.id}`),this.element.classList.add(U6),Ge(this.element,"aria-hidden",!0),this.element.setAttribute("data-key",t),this.element.setAttribute("data-axis-id",i)}show(e){const{element:t}=this,i=e.x+this.xOffset,s=e.y+this.yOffset;t.style.top=`${Math.round(s)}px`,t.style.left=`${Math.round(i)}px`,this.toggle(!0)}setLabelHtml({html:e,styles:t}){if(e!==void 0&&(this.element.innerHTML=e),t!==void 0){const i=this.element.children[0]??this.element;Object.assign(i.style,t)}}getBBox(){const{element:e}=this;return new A.BBox(e.clientLeft,e.clientTop,e.clientWidth,e.clientHeight)}toggle(e){this.element.classList.toggle("ag-charts-crosshair-label--hidden",!e)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(e,t){if(typeof e=="string")return{html:e,styles:{}};t=t??{};const{text:i=t.text??"",color:s=t.color,backgroundColor:n=t.backgroundColor,opacity:o=t.opacity??1}=e,a={opacity:o,"background-color":n?.toLowerCase(),color:s};return{html:`<div class="ag-charts-crosshair-label-content">
<span>${i}</span>
</div>`,styles:a}}},{Group:K6,TranslatableGroup:Z6,Line:X6,BBox:aP,InteractionState:Xx,Property:Gl,ZIndexMap:rP,ChartAxisDirection:lP}=A,Nr=class extends A.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.id=ns(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 _l,this.seriesRect=new aP(0,0,0,0),this.bounds=new aP(0,0,0,0),this.crosshairGroup=new Z6({name:"crosshairs",zIndex:rP.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new K6({name:`${this.id}-crosshair-lines`,zIndex:rP.SERIES_CROSSHAIR})),this.lineGroupSelection=A.Selection.select(this.lineGroup,X6,!1),this.activeHighlight=void 0,this.axisCtx=e.parent,this.labels={},this.hideCrosshairs(),e.domManager.addEventListener("focusin",({target:i})=>{const s=i instanceof HTMLElement&&e.domManager.contains(i,"series-area");this.crosshairGroup.visible&&!s&&(this.hideCrosshairs(),this.ctx.updateService.update(A.ChartUpdateType.PERFORM_LAYOUT))});const{seriesDragInterpreter:t}=e.widgets;this.cleanup.register(e.scene.attachNode(this.crosshairGroup),e.widgets.seriesWidget.addListener("mousemove",i=>this.onMouseHoverLike(i)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),e.eventsHub.on("series:focus-change",()=>this.onKeyPress()),e.eventsHub.on("zoom:pan-start",()=>this.onMouseOut()),e.eventsHub.on("zoom:change",()=>this.onMouseOut()),e.eventsHub.on("highlight:change",i=>this.onHighlightChange(i)),e.eventsHub.on("layout:complete",i=>this.layout(i)),()=>Object.values(this.labels).forEach(i=>i.destroy())),t&&this.cleanup.register(t.events.on("drag-move",i=>this.onMouseHoverLike(i)),t.events.on("click",i=>this.onClick(i)))}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;this.seriesRect=e;const{position:s="left",axisId:n}=this.axisCtx,o=i.find(c=>c.id===n);if(!o)return;this.axisLayout=o,this.bounds=e.clone().grow(o.gridPadding+o.seriesAreaPadding,s);const{crosshairGroup:a,bounds:r}=this;a.translationX=Math.round(r.x),a.translationY=Math.round(r.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l)}updateSelections(e){this.lineGroupSelection.update(e,void 0,t=>t)}updateLabels(e){const{labels:t,ctx:i}=this;for(const s of e)this.label.enabled&&(t[s]??(t[s]=new Y6(i.domManager,s,this.axisCtx.axisId))),t[s]&&this.updateLabel(t[s])}updateLabel(e){const{enabled:t,xOffset:i,yOffset:s,format:n,renderer:o}=this.label;e.enabled=t,e.xOffset=i,e.yOffset=s,e.format=n,e.renderer=o}updateLines(){const{lineGroupSelection:e,bounds:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,axisLayout:r}=this;if(!r)return;const l=this.isVertical();e.each(c=>{c.stroke=i,c.strokeWidth=s,c.strokeOpacity=n,c.lineDash=o,c.lineDashOffset=a,c.y1=0,c.y2=l?t.height:0,c.x1=0,c.x2=l?0:t.width})}isVertical(){return this.axisCtx.direction===lP.X}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(e){return this.axisCtx.formatScaleValue(e,"crosshair",this.label)}onClick(e){e.device==="touch"&&this.onMouseHoverLike(e)}onMouseHoverLike(e){if(!this.enabled||this.snap)return;const t=this.isHover(e)?Xx.Clickable:Xx.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&(this.updatePositions(this.getData(e)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(A.ChartUpdateType.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(Xx.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(A.ChartUpdateType.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(Xx.Default)&&this.hideCrosshairs()}onHighlightChange(e){if(!this.enabled)return;const{crosshairGroup:t,axisCtx:i}=this,{datum:s,series:n}=e.currentHighlight??{},o=s&&(n?.axes.x?.id===i.axisId||n?.axes.y?.id===i.axisId);if(this.activeHighlight=o?e.currentHighlight:void 0,!this.activeHighlight)this.hideCrosshairs();else if(this.snap){const a=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(a),t.visible=!0}}isInRange(e){return this.axisCtx.inRange(e)}updatePositions(e){const{seriesRect:t,lineGroupSelection:i}=this;i.each((s,n)=>{const o=e[n];if(!o){s.visible=!1,this.hideLabel(n);return}s.visible=!0;const{value:a,position:r}=o;let l=0,c=0;this.isVertical()?(l=r,s.x=Math.round(l)):(c=r,s.y=Math.round(c)),this.label.enabled?this.showLabel(l+t.x,c+t.y,a,n):this.hideLabel(n)})}getData(e){const{axisCtx:t}=this,i="pointer",{xKey:s="",yKey:n=""}=this.activeHighlight??{},{currentX:o,currentY:a}=e,r=Vg(this.activeHighlight),l=this.isVertical(),c=l?o:a;let h=r?.[l?s:n]??"";return t.continuous&&(h=t.scaleInvert(c)),{[i]:{position:c,value:h}}}getActiveHighlightData(e){const{axisCtx:t}=this,{series:i,xKey:s="",aggregatedValue:n,cumulativeValue:o,midPoint:a}=e,r=Vg(e),l=i.getKeyProperties(t.direction),c=(t.scale.bandwidth??0)/2,h=i.axes[t.direction]?.id===t.axisId,d=l.indexOf("yKey")>-1&&h,u=l.indexOf("xKey")>-1&&h,p=n??o;if(d&&p!==void 0){const f=t.scale.convert(p)+c;return this.isInRange(f)?{yKey:{value:p,position:f}}:{}}if(u){const f=(this.isVertical()?a?.x:a?.y)??0,x=t.continuous?t.scaleInvert(f):r?.[s];return this.isInRange(f)?{xKey:{value:x,position:f}}:{}}const g={};return l.forEach(f=>{const x=i.properties[f],m=r?.[x],b=t.scale.convert(m)+c;this.isInRange(b)&&(g[f]={value:m,position:b})}),g}getLabelHtml(e,t){const i=this.axisLayout?.label?.fractionDigits??0,s={text:this.formatValue(e)};return this.label.renderer?t.toLabelHtml(this.label.renderer({value:e,fractionDigits:i}),s):t.toLabelHtml(s)}showLabel(e,t,i,s){if(!this.axisLayout)return;const{bounds:n}=this,o=this.labels[s],a=this.getLabelHtml(i,o);o.setLabelHtml(a);const{width:r,height:l}=o.getBBox(),c=this.axisCtx.position;let h=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===lP.X?(h-=4,o.show({x:e-r/2,y:c==="bottom"?n.y+n.height+h:n.y-l-h})):(h-=8,o.show({x:c==="right"?n.x+n.width+h:n.x-r-h,y:t-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const e of Object.keys(this.labels))this.hideLabel(e)}hideLabel(e){this.labels[e]?.toggle(!1)}};y([Gl],Nr.prototype,"enabled",2),y([Gl],Nr.prototype,"stroke",2),y([Gl],Nr.prototype,"lineDash",2),y([Gl],Nr.prototype,"lineDashOffset",2),y([Gl],Nr.prototype,"strokeWidth",2),y([Gl],Nr.prototype,"strokeOpacity",2),y([Gl],Nr.prototype,"snap",2),y([Gl],Nr.prototype,"label",2);var q6={type:"axis-option",optionsKey:"crosshair",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","time","unit-time","ordinal-time","number","log"],moduleFactory:e=>new Nr(e),themeTemplate:{crosshair:{snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}}}},{ActionOnSet:jg,Property:cP}=A,ru=class extends A.BaseModuleInstance{constructor(e){super(),this.enabled=!1,this.getData=()=>Promise.resolve(),this.dataService=e.dataService}updateCallback(e,t){this.dataService&&(e&&t!=null?this.dataService.updateCallback(t):this.dataService.clearCallback())}};y([jg({newValue(e){this.updateCallback(e,this.getData)}}),cP],ru.prototype,"enabled",2),y([jg({newValue(e){this.updateCallback(this.enabled,e)}}),cP],ru.prototype,"getData",2),y([jg({newValue(e){this.dataService.requestThrottle=e}})],ru.prototype,"requestThrottle",2),y([jg({newValue(e){this.dataService.dispatchThrottle=e}})],ru.prototype,"updateThrottle",2),y([jg({newValue(e){this.dataService.dispatchOnlyLatest=!e}})],ru.prototype,"updateDuringInteraction",2);var Q6={type:"root",optionsKey:"dataSource",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new ru(e),themeTemplate:{dataSource:{enabled:!1}}},{nearestSquared:J6,nearestSquaredInContainer:e9,partialAssign:t9,mergeDefaults:hP,BBox:Vl}=A,i9=class{constructor(e){this.components=e,this.union=Vl.merge(e)}containsPoint(e,t){if(!this.union.containsPoint(e,t))return!1;for(const i of this.components)if(i.containsPoint(e,t))return!0;return!1}},s9=class extends A.Group{constructor(){super(),this.capLength=NaN,this._datum=void 0,this.whiskerPath=new A.Path,this.capsPath=new A.Path,this.bboxes=new i9([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(e){this._datum=e}calculateCapLength(e,t){const{lengthRatio:i=1,length:s}=e,{lengthRatioMultiplier:n,lengthMax:o}=t,a=s??i*n;return Math.min(a,o)}getItemStylerParams(e,t,i,s){const{datum:n}=this;if(n==null||e.itemStyler==null)return;const{xLowerKey:o,xUpperKey:a,yLowerKey:r,yUpperKey:l}=e;return{...t,datum:n.datum,seriesId:n.series.id,xKey:n.xKey,yKey:n.yKey,xLowerKey:o,xUpperKey:a,yLowerKey:r,yUpperKey:l,highlighted:i,highlightState:s}}formatStyles(e,t,i,s,n){let{cap:o,...a}=e;const r=this.getItemStylerParams(t,e,s,n);if(r!=null&&t.itemStyler!=null){const l=i.callWithContext(t.itemStyler,r);a=hP(l,a),o=hP(l?.cap,l,o)}return{whiskerStyle:a,capsStyle:o}}applyStyling(e,t){t9(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],e,t)}update(e,t,i,s,n){if(this.datum===void 0)return;const{whiskerStyle:o,capsStyle:a}=this.formatStyles(e,t,i,s,n),{xBar:r,yBar:l,capDefaults:c}=this.datum,h=this.whiskerPath;this.applyStyling(h,o),h.path.clear(!0),l!==void 0&&(h.path.moveTo(l.lowerPoint.x,l.lowerPoint.y),h.path.lineTo(l.upperPoint.x,l.upperPoint.y)),r!==void 0&&(h.path.moveTo(r.lowerPoint.x,r.lowerPoint.y),h.path.lineTo(r.upperPoint.x,r.upperPoint.y)),h.path.closePath(),this.capLength=this.calculateCapLength(a??{},c);const d=this.capLength/2,u=this.capsPath;this.applyStyling(u,a),u.path.clear(!0),l!==void 0&&(u.path.moveTo(l.lowerPoint.x-d,l.lowerPoint.y),u.path.lineTo(l.lowerPoint.x+d,l.lowerPoint.y),u.path.moveTo(l.upperPoint.x-d,l.upperPoint.y),u.path.lineTo(l.upperPoint.x+d,l.upperPoint.y)),r!==void 0&&(u.path.moveTo(r.lowerPoint.x,r.lowerPoint.y-d),u.path.lineTo(r.lowerPoint.x,r.lowerPoint.y+d),u.path.moveTo(r.upperPoint.x,r.upperPoint.y-d),u.path.lineTo(r.upperPoint.x,r.upperPoint.y+d)),u.path.closePath()}updateBBoxes(){const{capLength:e,whiskerPath:t,capsPath:i}=this,{yBar:s,xBar:n}=this.datum??{},o=e/2,a=[];if(s!==void 0){const r=s.lowerPoint.y-s.upperPoint.y;a.push(new Vl(s.lowerPoint.x,s.upperPoint.y,t.strokeWidth,r),new Vl(s.lowerPoint.x-o,s.lowerPoint.y,e,i.strokeWidth),new Vl(s.upperPoint.x-o,s.upperPoint.y,e,i.strokeWidth))}if(n!==void 0){const r=n.upperPoint.x-n.lowerPoint.x;a.push(new Vl(n.lowerPoint.x,n.upperPoint.y,r,t.strokeWidth),new Vl(n.lowerPoint.x,n.lowerPoint.y-o,i.strokeWidth,e),new Vl(n.upperPoint.x,n.upperPoint.y-o,i.strokeWidth,e))}this.bboxes.components=a,this.bboxes.union=Vl.merge(a)}containsPoint(e,t){return this.bboxes.containsPoint(e,t)}pickNode(e,t){return this.containsPoint(e,t)?this:void 0}nearestSquared(e,t,i){const{bboxes:s}=this;if(s.union.distanceSquared(e,t)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:n}=J6(e,t,s.components);return{nearest:this,distanceSquared:n}}},n9=class extends A.Group{nearestSquared(e,t){const{nearest:i,distanceSquared:s}=e9(e,t,{children:this.children()});if(i!==void 0&&!isNaN(s))return{datum:i.datum,distanceSquared:s}}},{BaseProperties:dP,Property:Rt}=A,Er=class extends dP{};y([Rt],Er.prototype,"visible",2),y([Rt],Er.prototype,"stroke",2),y([Rt],Er.prototype,"strokeWidth",2),y([Rt],Er.prototype,"strokeOpacity",2),y([Rt],Er.prototype,"lineDash",2),y([Rt],Er.prototype,"lineDashOffset",2),y([Rt],Er.prototype,"length",2),y([Rt],Er.prototype,"lengthRatio",2);var xs=class extends dP{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new Er}};y([Rt],xs.prototype,"yLowerKey",2),y([Rt],xs.prototype,"yLowerName",2),y([Rt],xs.prototype,"yUpperKey",2),y([Rt],xs.prototype,"yUpperName",2),y([Rt],xs.prototype,"xLowerKey",2),y([Rt],xs.prototype,"xLowerName",2),y([Rt],xs.prototype,"xUpperKey",2),y([Rt],xs.prototype,"xUpperName",2),y([Rt],xs.prototype,"visible",2),y([Rt],xs.prototype,"stroke",2),y([Rt],xs.prototype,"strokeWidth",2),y([Rt],xs.prototype,"strokeOpacity",2),y([Rt],xs.prototype,"lineDash",2),y([Rt],xs.prototype,"lineDashOffset",2),y([Rt],xs.prototype,"itemStyler",2),y([Rt],xs.prototype,"cap",2);var{fixNumericExtent:o9,groupAccumulativeValueProperty:a9,mergeDefaults:r9,valueProperty:qx,ChartAxisDirection:Hg}=A;function l9(e){for(const t of my)if(t===e.series.type)return e.series;throw new Error(`AG Charts - unsupported series type '${e.series.type}', error bars supported series types: ${my.join(", ")}`)}var c9=class Af extends A.BaseModuleInstance{constructor(t){super(),this.properties=new xs;const i=l9(t),{annotationGroup:s,annotationSelections:n}=i;this.cartesianSeries=i,this.groupNode=new n9({name:`${s.id}-errorBars`}),s.appendChild(this.groupNode),this.selection=A.Selection.select(this.groupNode,()=>this.errorBarFactory()),n.add(this.selection),i.addEventListener("seriesVisibilityChange",o=>this.onToggleSeriesItem(o)),this.cleanup.register(i.events.on("data-processed",o=>this.onDataProcessed(o)),i.events.on("data-update",o=>this.onDataUpdate(o)),t.eventsHub.on("highlight:change",o=>this.onHighlightChange(o)),()=>s.removeChild(this.groupNode),()=>n.delete(this.selection))}hasErrorBars(){const{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:n}=this.properties;return ii(t)&&ii(i)||ii(s)&&ii(n)}isStacked(){const t=this.cartesianSeries.seriesGrouping?.stackCount;return t==null?!1:t>0}getUnstackPropertyDefinition(t){const i=[],{xLowerKey:s,xUpperKey:n,yLowerKey:o,yUpperKey:a,xErrorsID:r,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:h}=t;return o!=null&&a!=null&&i.push(qx(o,h,{id:`${l}-lower`}),qx(a,h,{id:`${l}-upper`})),s!=null&&n!=null&&i.push(qx(s,c,{id:`${r}-lower`}),qx(n,c,{id:`${r}-upper`})),i}getStackPropertyDefinition(t){const i=[],{cartesianSeries:s}=this,{xLowerKey:n,xUpperKey:o,yLowerKey:a,yUpperKey:r,xErrorsID:l,yErrorsID:c}=this.getMaybeFlippedKeys(),{xScaleType:h,yScaleType:d}=t,u=s.seriesGrouping?.groupIndex??s.id,p={invalidValue:null,missingValue:0,separateNegative:!0,...s.visible?{}:{forceValue:0}},g=(x,m,b,v)=>a9(x,"normal","current",{id:`${m}-${b}`,groupId:`errorGroup-${u}-${b}`,...p},v),f=(x,m,b,v)=>{i.push(...g(x,b,"lower",v),...g(m,b,"upper",v))};return a!=null&&r!=null&&f(a,r,c,d),n!=null&&o!=null&&f(n,o,l,h),i}getPropertyDefinitions(t){return this.isStacked()?this.getStackPropertyDefinition(t):this.getUnstackPropertyDefinition(t)}onDataProcessed(t){this.dataModel=t.dataModel,this.processedData=t.processedData}getDomain(t){const{xLowerKey:i,xUpperKey:s,xErrorsID:n,yLowerKey:o,yUpperKey:a,yErrorsID:r}=this.getMaybeFlippedKeys();if(t===Hg.X?ii(i)&&ii(s):ii(o)&&ii(a)){const{dataModel:c,processedData:h,cartesianSeries:d}=this;if(c!=null&&h!=null){const u={x:n,y:r}[t],p=c.getDomain(d,`${u}-lower`,"value",h),g=c.getDomain(d,`${u}-upper`,"value",h),f=[Math.min(...p,...g),Math.max(...p,...g)];return o9(f)}}return[]}onDataUpdate(t){this.dataModel=t.dataModel,this.processedData=t.processedData,ii(t.dataModel)&&ii(t.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const t=this.getNodeData(),i=this.cartesianSeries.axes[Hg.X]?.scale,s=this.cartesianSeries.axes[Hg.Y]?.scale;if(!(!i||!s||!t))for(let n=0;n<t.length;n++){const{midPoint:o,xLower:a,xUpper:r,yLower:l,yUpper:c}=this.getDatum(t,n);if(o!=null){let h,d;ii(a)&&ii(r)&&(h={lowerPoint:{x:this.convert(i,a),y:o.y},upperPoint:{x:this.convert(i,r),y:o.y}}),ii(l)&&ii(c)&&(d={lowerPoint:{x:o.x,y:this.convert(s,l)},upperPoint:{x:o.x,y:this.convert(s,c)}}),t[n].xBar=h,t[n].yBar=d}}}getMaybeFlippedKeys(){let{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:n}=this.properties,[o,a]=["xValue-errors","yValue-errors"];return this.cartesianSeries.shouldFlipXY()&&([t,s]=[s,t],[i,n]=[n,i],[o,a]=[a,o]),{xLowerKey:t,xUpperKey:i,xErrorsID:o,yLowerKey:s,yUpperKey:n,yErrorsID:a}}static getDatumKey(t,i,s){if(i==null)return;const o=Vg(t)?.[i];if(o!=null){if(typeof o!="number"){X.warnOnce(`Found [${i}] error value of type ${typeof o}. Expected number type`);return}return o+s}}getDatum(t,i){const{xLowerKey:s,xUpperKey:n,yLowerKey:o,yUpperKey:a}=this.getMaybeFlippedKeys(),r=t[i],l=r.cumulativeValue==null||!this.isStacked()?0:r.cumulativeValue-r.yValue,[c,h]=this.cartesianSeries.shouldFlipXY()?[l,0]:[0,l];return{midPoint:r.midPoint,xLower:Af.getDatumKey(r,s,c),xUpper:Af.getDatumKey(r,n,c),yLower:Af.getDatumKey(r,o,h),yUpper:Af.getDatumKey(r,a,h)}}convert(t,i){const s=(t.bandwidth??0)/2;return t.convert(i)+s}update(){const t=this.getNodeData();t!=null&&(this.selection.update(t),this.selection.each((i,s,n)=>this.updateNode(i,s,n)))}updateNode(t,i,s){t.datum=i,t.update(this.getDefaultStyle(),this.properties,this.cartesianSeries,!1,"none"),t.updateBBoxes()}pickNodeExact(t){const{x:i,y:s}=t,n=this.groupNode.pickNode(i,s);if(n!=null)return{datum:n.datum,distanceSquared:0}}pickNodeNearest(t){return this.groupNode.nearestSquared(t.x,t.y)}pickNodeMainAxisFirst(t,i){let s,n=[1/0,1/0];const o=[t.x,t.y];i===Hg.Y&&o.reverse();for(const a of this.groupNode.children()){const r=a.getBBox(),l=[r.x+r.width/2,r.y+r.height/2];i===Hg.Y&&l.reverse();const c=[];for(let h=0;h<o.length;h++)c.push(Math.abs(o[h]-l[h]));(c[0]<n[0]||c[0]==n[0]&&c[1]<n[1])&&(s=a.datum,n=c)}if(s)return{datum:s,distanceSquared:Math.pow(n[0],2)+Math.pow(n[1],2)}}getTooltipParams(){const{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:n,xLowerName:o=t,xUpperName:a=i,yLowerName:r=s,yUpperName:l=n}=this.properties;return{xLowerKey:t,xLowerName:o,xUpperKey:i,xUpperName:a,yLowerKey:s,yLowerName:r,yUpperKey:n,yUpperName:l}}onToggleSeriesItem(t){this.groupNode.visible=t.visible}makeStyle(t){return{visible:t.visible,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity,cap:r9(this.properties.cap,t)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(t,i,s){const n=this.getNodeData();if(n!=null){for(let o=0;o<n.length;o++)if(t===n[o]){this.selection.at(o)?.update(i,this.properties,this.cartesianSeries,s,s?"highlighted-item":"unhighlighted-item");break}}}onHighlightChange(t){const{previousHighlight:i,currentHighlight:s}=t;s?.series===this.cartesianSeries&&this.restyleHighlightChange(s,this.getHighlightStyle(),!0),i?.series===this.cartesianSeries&&this.restyleHighlightChange(i,this.getDefaultStyle(),!1),this.groupNode.opacity=this.cartesianSeries.getOpacity()}errorBarFactory(){return new s9}getWhiskerProperties(){const{stroke:t,strokeWidth:i,visible:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}=this.properties;return{stroke:t,strokeWidth:i,visible:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}}},h9={series:{errorBar:{visible:!0,stroke:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1,cap:{length:void 0,lengthRatio:void 0}}}},d9={type:"series-option",identifier:"error-bars",optionsKey:"errorBar",packageType:"enterprise",chartTypes:["cartesian"],seriesTypes:my,moduleFactory:e=>new c9(e),themeTemplate:h9},{ZIndexMap:u9,ActionOnSet:p9,Property:OA,ProxyPropertyOnWrite:uP}=A,Qx=class extends A.Background{constructor(){super(...arguments),this.image=new Fa,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new A.Group({name:"foreground",zIndex:u9.FOREGROUND})}onLayoutComplete(e){super.onLayoutComplete(e);const{width:t,height:i}=e.chart;let s={x:0,y:0,width:t,height:i};this.image&&(s=this.image.performLayout(t,i)),this.text&&this.updateTextNode(s)}onImageLoad(){this.ctx.updateService.update(A.ChartUpdateType.SCENE_RENDER)}updateTextNode(e){const{textNode:t}=this;t.fontWeight="bold",t.fontFamily="Impact, sans-serif",t.fontSize=19,t.opacity=.7,t.fill="#9b9b9b",t.textBaseline="top";const i=this.textNode.getBBox(),s=10;t.x=e.x+e.width/2-i.width/2,t.y=e.y+e.height+s}};y([OA,p9({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){this.node.removeChild(e.node),e.onLoad=void 0}})],Qx.prototype,"image",2),y([OA,uP("rectNode","fill")],Qx.prototype,"fill",2),y([OA,uP("rectNode","fillOpacity")],Qx.prototype,"fillOpacity",2);var g9={type:"root",optionsKey:"foreground",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new Qx(e)},{TranslatableGroup:f9,SceneChangeDetection:pP}=A,PA=class extends f9{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(e,t){const{cornerRadius:i,inset:s}=this,{x:n,y:o,width:a,height:r}=t,l=new Path2D;l.roundRect(n+s,o+s,a-2*s,r-2*s,i),e.clip(l)}};y([pP()],PA.prototype,"inset",2),y([pP()],PA.prototype,"cornerRadius",2);var{Property:RA,ZIndexMap:gh,ActionOnSet:gP,CategoryAxis:y9,TextUtils:m9,Padding:x9,Group:fh,BBox:fP,ProxyProperty:yP}=A,BA=class{constructor(){this.top=0,this.bottom=0}};y([RA],BA.prototype,"top",2),y([RA],BA.prototype,"bottom",2);var lu=class extends A.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.padding=new BA,this.root=new fh({name:"root"}),this.seriesRoot=this.root.appendChild(new PA({name:"Series-root",zIndex:gh.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new fh({name:"Axes-Grids",zIndex:gh.AXIS_GRID})),this.axisGroup=this.root.appendChild(new fh({name:"Axes-Grids",zIndex:gh.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new fh({name:"Axes-Labels",zIndex:gh.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new fh({name:"Axes-Crosslines-Range",zIndex:gh.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new fh({name:"Axes-Crosslines-Line",zIndex:gh.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new fh({name:"Axes-Crosslines-Label",zIndex:gh.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.axes=[],this.series=[]}destroy(){this._destroyed||(this.destroySeries(this.series),this.axes.forEach(e=>e.destroy()),this.axes=[],this._destroyed=!0)}onSeriesChange(e,t){const i=t?.filter(s=>!e.includes(s))??[];this.destroySeries(i);for(const s of e){if(t?.includes(s))continue;s.attachSeries(this.seriesRoot,this.seriesRoot,void 0);const n=this;s.chart={get mode(){return"standalone"},get isMiniChart(){return!0},get seriesRect(){return n.seriesRect}},s.resetAnimation(this.miniChartAnimationPhase==="initial"?"initial":"disabled")}}destroySeries(e){e?.forEach(t=>{t.destroy(),t.detachSeries(this.seriesRoot,this.seriesRoot,void 0),t.chart=void 0})}assignSeriesToAxes(){this.axes.forEach(e=>{e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)})}assignAxesToSeries(){const e={};this.axes.forEach(t=>{const i=t.direction;(e[i]??(e[i]=[])).push(t)}),this.series.forEach(t=>{t.directions.forEach(i=>{const s=e[i];if(!s){X.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);return}const n=t.getKeys(i),o=this.findMatchingAxis(s,n);if(!o){X.warnOnce(`no matching axis for direction [${i}] and keys [${n}]; check series and axes configuration.`);return}t.axes[i]=o})})}findMatchingAxis(e,t){for(const i of e){if(!i.keys.length)return i;if(t){for(const s of t)if(i.keys.includes(s))return i}}}updateData(e){this.series.forEach(t=>t.setChartData(e)),this.miniChartAnimationPhase==="initial"&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready",this.series.forEach(t=>t.resetAnimation("disabled"))})}async processData(e){this.series.some(t=>t.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(t=>(t.resetDatumCallbackCache(),t.processData(e))));for(const t of this.axes)t.processData()}computeAxisPadding(){const e=new x9;return this.enabled&&this.axes.forEach(({position:t,thickness:i,line:s,label:n})=>{if(t==null)return;let o;i?o=i:o=(s.enabled?s.width:0)+(n.enabled?m9.getLineHeight(n.fontSize??0)+n.spacing:0),e[t]=Math.ceil(o)}),e}async layout(e,t){const{padding:i}=this,s=this.seriesRect!=null,n=new fP(0,0,e,t-(i.top+i.bottom));this.seriesRect=n,this.seriesRoot.translationY=i.top,this.seriesRoot.setClipRectCanvasSpace(new fP(0,-i.top,e,t)),this.axes.forEach(o=>{const{position:a="left"}=o;switch(a){case"top":case"bottom":o.range=[0,n.width],o.gridLength=n.height;break;case"right":case"left":{const r=o instanceof y9;o.range=r?[0,n.height]:[n.height,0],o.gridLength=n.width;break}}o.gridPadding=0,o.translation.x=0,o.translation.y=0,a==="right"?o.translation.x=e:a==="bottom"&&(o.translation.y=t),s||o.resetAnimation("initial"),o.calculateLayout(),o.update()}),await Promise.all(this.series.map(o=>o.update({seriesRect:n})))}};y([RA],lu.prototype,"enabled",2),y([yP(["seriesRoot","inset"])],lu.prototype,"inset",2),y([yP(["seriesRoot","cornerRadius"])],lu.prototype,"cornerRadius",2),y([gP({changeValue(e,t=[]){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(i),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i)}})],lu.prototype,"axes",2),y([gP({changeValue(e,t){this.onSeriesChange(e,t)}})],lu.prototype,"series",2);var{SliderWidget:mP}=A,b9=class{constructor(e,t){this.ctx=e,this.sliderHandlers=t,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=e,this.toolbar=e.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[e.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[i,s]of["min","pan","max"].entries()){const n=this.sliders[i];n.step=mP.STEP_HUNDRETH,n.keyboardStep=mP.STEP_ONE,n.orientation="horizontal",n.setPreventsDefault(!1),n.addListener("drag-start",o=>this.onDragStart(i,o,s)),n.addListener("drag-move",o=>this.onDrag(n,o,s)),n.addListener("drag-end",()=>this.updateSliderRatios()),n.addListener("contextmenu",o=>this.onContextMenu(n,o))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(e){this.toolbar.setHidden(!e)}updateZoom(){const{_min:e,_max:t}=this;if(!(e==null||t==null))return this.ctx.zoomManager.updateZoom("navigator",{x:{min:e,max:t}})}updateBounds(e){this.toolbar.setBounds(e)}updateSliderBounds(e,t){this.sliders[e].setBounds(t)}updateMinMax(e,t){this._min=e,this._max=t,this.updateSliderRatios()}updateSliderRatios(){let{_min:e,_max:t}=this;e=Math.round(e*100)/100,t=Math.round(t*100)/100;const i=this.ctx.localeManager.t("ariaValuePanRange",{min:e,max:t});this.sliders[0].setValueRatio(e),this.sliders[1].setValueRatio(e,{ariaValueText:i}),this.sliders[2].setValueRatio(t)}toCanvasOffsets(e){return{offsetX:this.dragStartX+e.originDeltaX}}moveToFront(e){if(e===1)return;const t=this.sliders[e],i=this.sliders[2-e];this.toolbar.moveChild(i,t.domIndex-1)}onDragStart(e,t,i){const s=this.sliders[e],n=this.toolbar.cssLeft(),o=s.cssLeft();this.dragStartX=n+o+t.offsetX,this.moveToFront(e),t.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(t))}onDrag(e,t,i){t.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(t))}onContextMenu(e,t){const{offsetX:i,offsetY:s}=t,{x:n,y:o}=this.toolbar.getBounds(),{x:a,y:r}=e.getBounds(),l=i+n+a,c=s+o+r;this.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:t,canvasX:l,canvasY:c},void 0)}onPanSliderChange(){const e=this.sliders[1].getValueRatio(),t=this._max-this._min;this._min=ve(0,e,1-t),this._max=this._min+t,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}},{Property:Jx,SceneChangeDetection:eb,BBox:v9,ExtendedPath2D:S9}=A,jl=class extends A.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 S9}setCenter(e,t){this.dirtyPath=!0,(this.centerX!==e||this.centerY!==t)&&(this.centerX=e,this.centerY=t,this.markDirty("center"))}static align(e,t,i,s,n,o,a,r,l){const c=e.align(i+n*a)+l,h=c+e.align(i+n*a,n*(r-a))-2*l,d=e.align(s+o/2);e.setCenter(c,d),t.setCenter(h,d)}computeBBox(){const{centerX:e,centerY:t,width:i,height:s}=this,n=e-i/2,o=t-s/2;return new v9(n,o,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}updatePath(){const{centerX:e,centerY:t,path:i,gripPath:s,strokeWidth:n,cornerRadius:o,grip:a}=this,r=n/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),s.clear();const c=Math.floor(this.width/2*l)/l,h=Math.floor(this.height/2*l)/l;i.roundRect(e-c+r,t-h+r,2*(c-r),2*(h-r),o);const d=3;if(a)for(let u=-.5;u<=.5;u+=1)for(let p=-1;p<=1;p+=1)s.arc(e+u*d,t+p*d,1,0,2*Math.PI),s.closePath()}renderFill(e,t){const{stroke:i}=this;super.renderFill(e,t),e.fillStyle=typeof i=="string"?i:"black",e.fill(this.gripPath.getPath2D())}};jl.className="RangeHandle",y([Jx,eb()],jl.prototype,"width",2),y([Jx,eb()],jl.prototype,"height",2),y([Jx,eb()],jl.prototype,"cornerRadius",2),y([Jx,eb()],jl.prototype,"grip",2);var{Path:M9,BBox:FA,ExtendedPath2D:D9,clippedRoundRect:A9,Property:I9,SceneChangeDetection:k9}=A,zA=class extends M9{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 D9}layout(e,t,i,s,n,o){n=isNaN(n)?this.min:n,o=isNaN(o)?this.max:o,(e!==this.x||t!==this.y||i!==this.width||this.height!==s||n!==this.min||o!==this.max)&&(this.x=e,this.y=t,this.width=i,this.height=s,this.min=n,this.max=o,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:e,y:t,width:i,height:s}=this;return new FA(e,t,i,s)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:s,min:n,max:o}=this,a=e+i*n,r=e+i*o;return new FA(a,t,r-a,s)}updatePath(){const{path:e,visiblePath:t,x:i,y:s,width:n,height:o,min:a,max:r,strokeWidth:l,cornerRadius:c}=this,h=l/2;e.clear(),t.clear();const d=this.align(i)+h,u=this.align(s)+h,p=this.align(i,n)-2*h,g=this.align(s,o)-2*h,f=this.align(i+n*a)+h,x=f+this.align(i+n*a,n*(r-a))-2*h,m={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c},b=(v,S,D)=>{if(D-S<1)return;const C=new FA(S,u,D-S,g);A9(v,d,u,p,g,m,C)};b(e,d,f),b(e,x,p+d),b(t,f,x)}renderStroke(e,t){super.renderStroke(e,t),super.renderStroke(e,this.visiblePath.getPath2D())}};zA.className="RangeMask",y([I9,k9()],zA.prototype,"cornerRadius",2);var C9=class extends A.Group{constructor(e){super({name:"rangeSelectorGroup",zIndex:A.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 A.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(e)}layout(e,t,i,s,n,o){this.x=e,this.y=t,this.width=i,this.height=s,this.lOffset=n,this.rOffset=o,this.background.translationX=e,this.background.translationY=t,this.markDirty("RangeSelector")}updateBackground(e,t){e!=null&&this.background.removeChild(e),t!=null&&this.background.appendChild(t),this.markDirty("RangeSelector")}computeBBox(){const{x:e,y:t,width:i,height:s,lOffset:n,rOffset:o}=this;return new A.BBox(e-n,t,i+(n+o),s)}},{BaseModuleInstance:T9,ObserveChanges:_A,Property:tb}=A,cu=class extends T9{constructor(e){super(),this.ctx=e,this.enabled=!1,this.mask=new zA,this.minHandle=new jl,this.maxHandle=new jl,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(t,i)=>({x:t,y:i})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new C9([this.mask,this.minHandle,this.maxHandle]),this.cleanup.register(e.scene.attachNode(this.rangeSelector),e.eventsHub.on("locale:change",()=>this.updateZoom()),e.layoutManager.registerElement(A.LayoutElement.Navigator,t=>this.onLayoutStart(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("zoom:change",t=>this.onZoomChange(t))),this.domProxy=new b9(e,this),this.updateGroupVisibility(),this.miniChart=new lu(e)}updateBackground(e,t){this.rangeSelector?.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;this.rangeSelector==null||e===this.rangeSelector.visible||(this.rangeSelector.visible=e,this.domProxy.updateVisibility(e),e?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}onLayoutStart(e){if(this.enabled){const{layoutBox:t}=e,i=this.height+this.spacing;t.shrink(i,"bottom"),this.y=t.y+t.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:t,bottom:i}=this.miniChart.computeAxisPadding();e.layoutBox.shrink(t+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(e){const{x:t,width:i}=e.series.rect,{y:s,height:n}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:o,_max:a}=this.domProxy;this.layoutNodes(t,s,i,n,o,a),this.domProxy.updateBounds({x:t,y:s,width:i,height:n})}this.x=t,this.width=i,this.miniChart?.layout(i,n).catch(o=>X.error(o))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(A.InteractionState.ZoomDraggable)}onDragStart(e,{offsetX:t}){this.canDrag()&&(e==="pan"&&(this.panStart=(t-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(e,{offsetX:t}){if(!this.canDrag())return;const{panStart:i,x:s,width:n}=this,{minRange:o}=this.domProxy;let{_min:a,_max:r}=this.domProxy;const l=(t-s)/n;if(e==="min")a=ve(0,l,r-o);else if(e==="max")r=ve(a+o,l,1);else if(e==="pan"&&i!=null){const c=r-a;a=ve(0,l-i,1-c),r=a+c}this.domProxy._min=a,this.domProxy._max=r,this.updateZoom()}onZoomChange(e){const{x:t}=e;if(!t)return;const{x:i,y:s,width:n,height:o}=this,{min:a,max:r}=t;this.domProxy.updateMinMax(a,r),this.layoutNodes(i,s,n,o,a,r)}layoutNodes(e,t,i,s,n,o){const{rangeSelector:a,mask:r,minHandle:l,maxHandle:c}=this;r.layout(e,t,i,s,n,o),a.layout(e,t,i,s,l.width/2,c.width/2),jl.align(l,c,e,t,i,s,n,o,r.strokeWidth/2),n+(o-n)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3),[l,this.maskVisibleRange,c].forEach((h,d)=>{const u=h.getBBox(),p={x:u.x-e,y:u.y-t,height:u.height,width:u.width};this.domProxy.updateSliderBounds(d,p)})}updateZoom(){this.enabled&&this.domProxy.updateZoom()}updateData(e){return this.miniChart?.updateData(e)}async processData(e){if(this.miniChart)return this.miniChart?.processData(e)}};y([_A((e,t,i)=>{e.updateBackground(i?.root,t?.root)})],cu.prototype,"miniChart",2),y([tb,_A((e,t)=>{e.ctx.zoomManager.setNavigatorEnabled(!!t),e.updateGroupVisibility()})],cu.prototype,"enabled",2),y([tb],cu.prototype,"height",2),y([tb,_A((e,t)=>{e.mask.cornerRadius=t})],cu.prototype,"cornerRadius",2),y([tb],cu.prototype,"spacing",2);function L9(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function w9(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}var{ScalableGroup:N9,Rect:Wg,Line:$g,BBox:E9,Selection:xP,applyShapeFillBBox:O9}=A,P9=class extends N9{constructor(){super(),this.append([new Wg({tag:0}),new Wg({tag:2}),new Wg({tag:1}),new $g({tag:3}),new $g({tag:3}),new $g({tag:4}),new $g({tag:4})])}updateDatumStyles(e,t,i,s,n){const{bandwidth:o,scaledValues:{xValue:a,medianValue:r}}=e;let{minValue:l,q1Value:c,q3Value:h,maxValue:d}=e.scaledValues;(i&&!s||!i&&s)&&([d,h,c,l]=[l,c,h,d]);const u=($,U,Z,q)=>i?{y:$,x:U,width:q,height:Z}:{x:$,y:U,width:Z,height:q},p=($,U,Z)=>i?{y1:$,y2:U,x:Z}:{x1:$,x2:U,y:Z},g=($,U,Z)=>i?{x1:U,x2:Z,y:$}:{x:$,y1:U,y2:Z},f=($,U,Z,q)=>({x:$,y:U,width:Z,height:q}=u($,U,Z,q),new E9($,U,Z,q)),{opacity:x,fill:m,fillOpacity:b,stroke:v,strokeWidth:S,strokeOpacity:D,lineDash:C,lineDashOffset:T,cornerRadius:k,cap:L,whisker:N}=t;this.opacity=x??1;const w=xP.select(this,Wg),[O]=w.selectByTag(0),[R]=w.selectByTag(2),[B]=w.selectByTag(1),P=w.selectByTag(3),_=w.selectByTag(4);N.strokeWidth>o&&(N.strokeWidth=o);const F=u(c,a,h-c,o);R.setProperties(F),O.setProperties(F),O.setProperties({cornerRadius:k});const W=Math.max(Math.round(r-S/2),c+S),H=Math.min(Math.round(r+S/2),h-S);B.setProperties(F),B.setProperties({visible:W<H,cornerRadius:k,clipBBox:f(W,a+S,H-W,Math.max(0,o-S*2))});const j=Math.floor(a+o*(1-L.lengthRatio)/2),V=Math.ceil(a+o*(1+L.lengthRatio)/2);_[0].setProperties(g(l,j,V)),_[1].setProperties(g(d,j,V)),P[0].setProperties(p(Math.round(l+N.strokeWidth/2),c,Math.floor(a+o/2))),P[1].setProperties(p(h,Math.round(d-N.strokeWidth/2),Math.floor(a+o/2))),O9(O,m,n),O.setProperties({fill:m,fillOpacity:b,strokeWidth:S*2,strokeOpacity:0}),B.setProperties({fill:v,fillOpacity:D,strokeWidth:0});for(const $ of[...P,..._])$.setProperties(N);R.setProperties({stroke:v,strokeWidth:S,strokeOpacity:D,lineDash:C,lineDashOffset:T,cornerRadius:k,fillOpacity:0})}distanceSquared(e,t){const i=xP.selectByClass(this,Wg,$g);return A.nearestSquared(e,t,i).distanceSquared}get midPoint(){const e=this.datum;return e.midPoint===void 0?(X.error("BoxPlotGroup.datum.midPoint is undefined"),{x:NaN,y:NaN}):e.midPoint}},{BaseProperties:bP,FillGradientDefaults:R9,FillPatternDefaults:B9,FillImageDefaults:F9,AbstractBarSeriesProperties:z9,makeSeriesTooltip:_9,Property:it,mergeDefaults:G9}=A,vP=class extends bP{constructor(){super(...arguments),this.lengthRatio=.5}};y([it],vP.prototype,"lengthRatio",2);var hu=class extends bP{};y([it],hu.prototype,"stroke",2),y([it],hu.prototype,"strokeWidth",2),y([it],hu.prototype,"strokeOpacity",2),y([it],hu.prototype,"lineDash",2),y([it],hu.prototype,"lineDashOffset",2);var yt=class extends z9{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new R9,this.fillPatternDefaults=new B9,this.fillImageDefaults=new F9,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new vP,this.whisker=new hu,this.tooltip=_9()}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:n}=this,o=super.toJson();return o.whisker=G9(o.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:n}),o}getStyle(){const{fill:e,fillOpacity:t,strokeWidth:i,strokeOpacity:s,stroke:n,lineDash:o,lineDashOffset:a,cornerRadius:r,cap:l,whisker:c}=this;return{fill:e,fillOpacity:t,strokeWidth:i,strokeOpacity:s,stroke:n,lineDash:o,lineDashOffset:a,cornerRadius:r,cap:l,whisker:c,opacity:1}}};y([it],yt.prototype,"xKey",2),y([it],yt.prototype,"minKey",2),y([it],yt.prototype,"q1Key",2),y([it],yt.prototype,"medianKey",2),y([it],yt.prototype,"q3Key",2),y([it],yt.prototype,"maxKey",2),y([it],yt.prototype,"xName",2),y([it],yt.prototype,"yName",2),y([it],yt.prototype,"minName",2),y([it],yt.prototype,"q1Name",2),y([it],yt.prototype,"medianName",2),y([it],yt.prototype,"q3Name",2),y([it],yt.prototype,"maxName",2),y([it],yt.prototype,"fill",2),y([it],yt.prototype,"fillGradientDefaults",2),y([it],yt.prototype,"fillPatternDefaults",2),y([it],yt.prototype,"fillImageDefaults",2),y([it],yt.prototype,"fillOpacity",2),y([it],yt.prototype,"stroke",2),y([it],yt.prototype,"strokeWidth",2),y([it],yt.prototype,"strokeOpacity",2),y([it],yt.prototype,"lineDash",2),y([it],yt.prototype,"lineDashOffset",2),y([it],yt.prototype,"cornerRadius",2),y([it],yt.prototype,"itemStyler",2),y([it],yt.prototype,"cap",2),y([it],yt.prototype,"whisker",2),y([it],yt.prototype,"tooltip",2);var{fixNumericExtent:V9,keyProperty:j9,mergeDefaults:GA,SeriesNodePickMode:SP,SMALLEST_KEY_INTERVAL:H9,valueProperty:Ug,diff:W9,animationValidation:$9,computeBarFocusBounds:U9,createDatumId:Y9,ContinuousScale:K9,ChartAxisDirection:Z9,motion:MP,getShapeStyle:VA}=A,X9=class extends A.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.minKey=s.properties.minKey,this.q1Key=s.properties.q1Key,this.medianKey=s.properties.medianKey,this.q3Key=s.properties.q3Key,this.maxKey=s.properties.maxKey}},ib=class extends A.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[SP.NEAREST_NODE,SP.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},propertyNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.properties=new yt,this.NodeEvent=X9}async processData(e){if(!this.visible)return;const{xKey:t,minKey:i,q1Key:s,medianKey:n,q3Key:o,maxKey:a}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:d,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),p=[];r&&this.processedData&&p.push(W9(this.id,this.processedData)),r&&p.push($9());const{processedData:g}=await this.requestDataModel(e,this.data,{props:[j9(t,d,{id:"xValue"}),Ug(i,u,{id:"minValue"}),Ug(s,u,{id:"q1Value"}),Ug(n,u,{id:"medianValue"}),Ug(o,u,{id:"q3Value"}),Ug(a,u,{id:"maxValue"}),...h?[H9]:[],...p]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];if(e!==this.getBarDirection()){const{index:n,def:o}=i.resolveProcessedDataDefById(this,"xValue"),a=t.domain.keys[n];return o.type==="key"&&o.valueType==="category"?a:this.padBandExtent(a)}const s=this.domainForClippedRange(e,["minValue","maxValue"],"xValue");return V9(s)}getSeriesRange(e,t){return this.domainForVisibleRange(Z9.Y,["maxValue","minValue"],"xValue",t)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!(t&&i&&s&&n))return;const{xKey:o}=this.properties,a=[],r=t.resolveKeysById(this,"xValue",i),l=t.resolveColumnById(this,"minValue",i),c=t.resolveColumnById(this,"q1Value",i),h=t.resolveColumnById(this,"medianValue",i),d=t.resolveColumnById(this,"q3Value",i),u=t.resolveColumnById(this,"maxValue",i),{barWidth:p,groupIndex:g}=this.updateGroupScale(s),f=K9.is(s.scale)?p*-.5:0,{groupScale:x}=this,m=this.isVertical(),b={itemId:o,nodeData:a,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};return e&&(i.dataSources.get(this.id)??[]).forEach((S,D)=>{const C=r[D];if(C==null)return;const T=l[D],k=c[D],L=h[D],N=d[D],w=u[D];if([T,k,L,N,w].some(H=>typeof H!="number")||T>k||k>L||L>N||N>w)return;const O={xValue:Math.round(s.scale.convert(C)),minValue:Math.round(n.scale.convert(T)),q1Value:Math.round(n.scale.convert(k)),medianValue:Math.round(n.scale.convert(L)),q3Value:Math.round(n.scale.convert(N)),maxValue:Math.round(n.scale.convert(w))};O.xValue+=Math.round(x.convert(String(g)))+f;const R=Math.round(p),B=Math.abs(O.q3Value-O.q1Value),P=O.xValue+R/2,_=Math.min(O.q3Value,O.q1Value)+B/2,F={x:m?P:_,y:m?_:P};let W;m?W={x:F.x-R/2,y:O.minValue,width:R,height:O.maxValue-O.minValue}:W={x:O.minValue,y:F.y-R/2,width:O.maxValue-O.minValue,height:R},a.push({series:this,itemId:C,datum:S,datumIndex:D,xKey:o,bandwidth:R,scaledValues:O,midPoint:F,focusRect:W})}),b}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:VA({fill:e,fillOpacity:t,stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:o,lineDashOffset:a},r,l,c)}}getLegendData(e){const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:o,showInLegend:a,legendItemName:r}=this.properties;return!n||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:t}),label:{text:r??o??t},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!a}]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:u,q3Name:p,minKey:g,minName:f,maxKey:x,maxName:m,legendItemName:b,tooltip:v}=n,S=this.getCategoryAxis(),D=this.getValueAxis();if(!i||!s||!S||!D)return;const C=s.dataSources.get(this.id)?.[e],T=i.resolveKeysById(this,"xValue",s)[e],k=i.resolveColumnById(this,"minValue",s)[e],L=i.resolveColumnById(this,"q1Value",s)[e],N=i.resolveColumnById(this,"medianValue",s)[e],w=i.resolveColumnById(this,"q3Value",s)[e],O=i.resolveColumnById(this,"maxValue",s)[e];if(T==null)return;const R=this.getItemStyle({datumIndex:e,datum:C},!1),B=[{label:f,fallbackLabel:g,value:this.getAxisValueText(D,"tooltip",k,C,g,b)},{label:d,fallbackLabel:h,value:this.getAxisValueText(D,"tooltip",L,C,h,b)},{label:c,fallbackLabel:l,value:this.getAxisValueText(D,"tooltip",N,C,l,b)},{label:p,fallbackLabel:u,value:this.getAxisValueText(D,"tooltip",w,C,u,b)},{label:m,fallbackLabel:x,value:this.getAxisValueText(D,"tooltip",O,C,x,b)}];return this.formatTooltipWithContext(v,{heading:this.getAxisValueText(S,"tooltip",T,C,o,b),title:b??r,symbol:this.legendItemSymbol(),data:B},{seriesId:t,datum:C,title:r,xKey:o,xName:a,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:u,q3Name:p,minKey:g,minName:f,maxKey:x,maxName:m,...R})}animateEmptyUpdateReady({datumSelection:e}){const t=this.isVertical(),{from:i,to:s}=L9(t);MP.resetMotion([e],w9(t)),MP.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[e],i,s,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}getItemStyle({datumIndex:e,datum:t},i){const{id:s,properties:n}=this,{xKey:o,minKey:a,q1Key:r,medianKey:l,q3Key:c,maxKey:h,fillGradientDefaults:d,fillPatternDefaults:u,fillImageDefaults:p,itemStyler:g}=n,f=this.getHighlightStyle(i);let x=VA(GA(f,n.getStyle()),d,u,p);if(g!=null&&e!=null){const C=this.cachedDatumCallback(Y9(e,i?"highlight":"node"),()=>{const T=this.ctx.highlightManager?.getActiveHighlight(),k=this.getHighlightStateString(T,i,e);return this.callWithContext(g,{seriesId:s,datum:t,xKey:o,minKey:a,q1Key:r,medianKey:l,q3Key:c,maxKey:h,highlighted:i,highlightState:k,...x})});C&&(x=VA(GA(C,x),d,u,p))}const{stroke:m,strokeWidth:b,strokeOpacity:v,lineDash:S,lineDashOffset:D}=x;return x.whisker=GA(x.whisker,{stroke:m,strokeWidth:b,strokeOpacity:v,lineDash:S,lineDashOffset:D}),x}updateDatumNodes({datumSelection:e,isHighlight:t}){const i=this.isVertical(),s=this.getValueAxis()?.isReversed();e.each((n,o)=>{const a=this.getItemStyle(o,t),r=this.getShapeFillBBox();n.updateDatumStyles(o,a,i,s,r)})}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new P9}computeFocusBounds({datumIndex:e}){return U9(this,this.contextNodeData?.nodeData[e].focusRect)}hasItemStylers(){return this.properties.itemStyler!=null}};ib.className="BoxPlotSeries",ib.type="box-plot";var{boxPlotSeriesThemeableOptionsDef:q9,commonSeriesOptionsDefs:Q9}=A,J9={...Q9,...q9,type:Y(Le("box-plot")),xKey:Y(E),minKey:Y(E),q1Key:Y(E),medianKey:Y(E),q3Key:Y(E),maxKey:Y(E),xName:E,yName:E,minName:E,q1Name:E,medianName:E,q3Name:E,maxName:E,grouped:z,legendItemName:E},{ThemeConstants:{CARTESIAN_AXIS_TYPE:DP},multiSeriesHighlightStyle:e8}=A,t8={series:{direction:"vertical",fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fill"},{$mix:[A.SAFE_FILL_OPERATION,{$ref:"chartBackgroundColor"},.7]}]},stroke:{$palette:"stroke"},fillGradientDefaults:A.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,strokeWidth:2,highlight:e8()},axes:{[DP.NUMBER]:{crosshair:{snap:!1}},[DP.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},i8={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:e=>new ib(e),defaultAxes:A.DIRECTION_SWAP_AXES,themeTemplate:t8,groupable:!0},AP={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,options:J9,create:e=>new ib(e)},{AGGREGATION_SPAN:IP,AGGREGATION_INDEX_X_MAX:s8,AGGREGATION_INDEX_X_MIN:n8,AGGREGATION_INDEX_Y_MAX:o8,AGGREGATION_INDEX_Y_MIN:a8,aggregationDomain:r8,aggregationRangeFittingPoints:l8,compactAggregationIndices:c8,createAggregationIndices:h8}=A,d8=1e3,kP=n8,u8=o8,p8=a8,CP=s8;function g8(e,t,i,s,n){if(t.length<d8)return;const[o,a]=r8(e,n);let r=l8(t),{indexData:l,valueData:c}=h8(t,i,s,o,a,r);const h=[{maxRange:r,indexData:l}];for(;r>64;)({indexData:l,valueData:c,maxRange:r}=c8(l,c,r)),h.push({maxRange:r,indexData:l});return h.reverse(),h}var{fixNumericExtent:f8,keyProperty:y8,createDatumId:TP,SeriesNodePickMode:LP,ChartAxisDirection:wP,SMALLEST_KEY_INTERVAL:m8,valueProperty:sb,diff:x8,animationValidation:b8,computeBarFocusBounds:v8,visibleRangeIndices:NP,BandScale:S8,getShapeStyle:jA,processedDataIsAnimatable:M8,mergeDefaults:HA,simpleMemorize2:D8}=A,A8=D8(g8),I8=class extends A.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.openKey=s.properties.openKey,this.closeKey=s.properties.closeKey,this.highKey=s.properties.highKey,this.lowKey=s.properties.lowKey}},EP=class extends A.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[LP.AXIS_ALIGNED,LP.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},propertyNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=I8,this.dataAggregationFilters=void 0}async processData(e){if(!this.visible)return;const{xKey:t,openKey:i,closeKey:s,highKey:n,lowKey:o}=this.properties,a=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:h,yScaleType:d}=this.getScaleInformation({xScale:r,yScale:l}),u=[];a&&(this.processedData&&u.push(x8(this.id,this.processedData)),u.push(b8())),i&&u.push(sb(i,d,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:p,processedData:g}=await this.requestDataModel(e,this.data,{props:[y8(t,h,{id:"xValue"}),sb(s,d,{id:"closeValue"}),sb(n,d,{id:"highValue"}),sb(o,d,{id:"lowValue"}),...c?[m8]:[],...u]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(e,t){if(t.type!=="ungrouped"||M8(t))return;const i=this.axes[wP.X];if(i==null)return;const s=e.resolveKeysById(this,"xValue",t),n=e.resolveColumnById(this,"highValue",t),o=e.resolveColumnById(this,"lowValue",t),{index:a}=e.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[a];return A8(i.scale.type,s,n,o,r)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];if(e!==this.getBarDirection()){const{index:n,def:o}=i.resolveProcessedDataDefById(this,"xValue"),a=t.domain.keys[n];return o.type==="key"&&o.valueType==="category"?a:this.padBandExtent(a)}const s=this.domainForClippedRange(e,["highValue","lowValue"],"xValue");return f8(s)}getSeriesRange(e,t){return this.domainForVisibleRange(wP.Y,["highValue","lowValue"],"xValue",t)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["highValue","lowValue"],e,t,i)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!(t&&i&&s&&n))return;const o=[],{xKey:a,highKey:r,lowKey:l}=this.properties,c=i.dataSources.get(this.id)??[],h=t.resolveKeysById(this,"xValue",i),d=t.resolveColumnById(this,"openValue",i),u=t.resolveColumnById(this,"closeValue",i),p=t.resolveColumnById(this,"highValue",i),g=t.resolveColumnById(this,"lowValue",i),{groupScale:f}=this,{barWidth:x,groupIndex:m}=this.updateGroupScale(s),b=f.convert(String(m)),v=x>=1?x:f.rawBandwidth,S=S8.is(s.scale),D={itemId:a,nodeData:o,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};if(!e)return D;const C=(B,P,_,F,W,H,j,V)=>{const $=c[B],U=S?j/2:0,Z=s.scale.convert(P)+b+U,q=n.scale.convert(_),Q=n.scale.convert(F),ie=n.scale.convert(W),ne=n.scale.convert(H),oe=F>_,le=oe?"up":"down",re=Math.min(ie,ne),ee=Math.max(ie,ne)-re,Me={x:Z,y:re+ee/2};o.push({series:this,itemId:le,datum:$,datumIndex:B,xKey:a,xValue:P,openValue:_,closeValue:F,highValue:W,lowValue:H,midPoint:Me,aggregatedValue:F,isRising:oe,centerX:Z,width:j,y:re,height:ee,yOpen:q,yClose:Q,crisp:V})},{dataAggregationFilters:T}=this,k=s.scale,[L,N]=k.range,w=Math.abs(N-L),O=B=>k.convert(h[B])+b,R=T?.find(B=>B.maxRange>w);if(R==null){const B=i.invalidData?.get(this.id);let[P,_]=NP(1,c.length,s.range,F=>{const W=S?0:-v/2,H=O(F)+W;return[H,H+v]});i.input.count<1e3&&(P=0,_=i.input.count);for(let F=P;F<_;F+=1){if(B?.[F]===!0)continue;const W=h[F];if(W==null)continue;const H=d[F],j=u[F],V=p[F],$=g[F],U=$!=null&&$<=H&&$<=j,Z=V!=null&&V>=H&&V>=j;if(!U){X.warnOnce(`invalid low value for key [${l}] in data element, low value cannot be higher than datum open or close values`);continue}if(!Z){X.warnOnce(`invalid high value for key [${r}] in data element, high value cannot be lower than datum open or close values.`);continue}C(F,W,H,j,V,$,v,!0)}}else{const{maxRange:B,indexData:P}=R,[_,F]=NP(1,B,s.range,W=>{const H=W*IP,j=P[H+kP],V=P[H+CP];if(j===-1)return;const $=S?0:-v/2;return[O(j)+$,O(V)+$+v]});for(let W=_;W<F;W+=1){const H=W*IP,j=P[H+kP],V=P[H+CP],$=P[H+u8],U=P[H+p8];if(j===-1)continue;const Z=(j+V)/2|0,q=h[Z];if(q==null)continue;const Q=d[j],ie=u[V],ne=p[$],oe=g[U],le=Math.abs(O(V)-O(j))+v;C(Z,q,Q,ie,ne,oe,le,!1)}}return D}isVertical(){return!0}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}updateLabelNodes(e){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}getItemStyle({datumIndex:e,itemId:t="up",datum:i,xValue:s},n){const{id:o,properties:a}=this,r=a.item[t],{itemStyler:l}=a,c=this.getHighlightStyle(n),h=HA(c,a.getStyle(t));let d=r.fillGradientDefaults&&r.fillPatternDefaults&&r.fillImageDefaults?jA(h,r.fillGradientDefaults,r.fillPatternDefaults,r.fillImageDefaults):h;if(l!=null&&e!=null){const{xKey:u,openKey:p,closeKey:g,highKey:f,lowKey:x}=a,m=this.ctx.highlightManager?.getActiveHighlight(),b=this.cachedDatumCallback(TP(TP(s),n?"highlight":"node"),()=>{const v=this.getHighlightStateString(m,n,e);return this.callWithContext(l,{seriesId:o,datum:i,itemId:t,xKey:u,openKey:p,closeKey:g,highKey:f,lowKey:x,highlighted:n,highlightState:v,...d})});b&&(d=r.fillGradientDefaults&&r.fillPatternDefaults&&r.fillImageDefaults?jA(HA(b,d),r.fillGradientDefaults,r.fillPatternDefaults,r.fillImageDefaults):HA(b,d))}return d}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yName:r,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:g,closeName:f,legendItemName:x,tooltip:m}=n,b=this.getCategoryAxis(),v=this.getValueAxis();if(!i||!s||!b||!v)return;const S=s.dataSources.get(this.id)?.[e],D=i.resolveKeysById(this,"xValue",s)[e],C=i.resolveColumnById(this,"openValue",s)[e],T=i.resolveColumnById(this,"highValue",s)[e],k=i.resolveColumnById(this,"lowValue",s)[e],L=i.resolveColumnById(this,"closeValue",s)[e];if(D==null)return;const N=L>=C?"up":"down",w=this.properties.item[N],O=this.getItemStyle({datumIndex:e,datum:S,itemId:N},!1);let R={fill:w.fill??w.stroke,fillOpacity:w.fillOpacity??w.strokeOpacity??1,stroke:w.stroke,strokeWidth:w.strokeWidth??1,strokeOpacity:w.strokeOpacity??1,lineDash:w.lineDash??[0],lineDashOffset:w.lineDashOffset??0};return w.fillGradientDefaults&&w.fillPatternDefaults&&w.fillImageDefaults&&(R=jA(R,w.fillGradientDefaults,w.fillPatternDefaults,w.fillImageDefaults)),this.formatTooltipWithContext(m,{heading:this.getAxisValueText(b,"tooltip",D,S,o,x),title:x,symbol:{marker:R},data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(v,"tooltip",C,S,l,x)},{label:d,fallbackLabel:h,value:this.getAxisValueText(v,"tooltip",T,S,h,x)},{label:p,fallbackLabel:u,value:this.getAxisValueText(v,"tooltip",k,S,u,x)},{label:f,fallbackLabel:g,value:this.getAxisValueText(v,"tooltip",L,S,g,x)}]},{seriesId:t,datum:S,title:r,itemId:N,xKey:o,xName:a,yName:r,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:g,closeName:f,...O})}computeFocusBounds(e){const t=this.getNodeData()?.at(e.datumIndex);if(t==null)return;const{centerX:i,y:s,width:n,height:o}=t,a={x:i-n/2,y:s,width:n,height:o};return v8(this,a)}},{Path:k8,SceneChangeDetection:Hl,BBox:C8}=A,za=class extends k8{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:e,y:t,width:i,height:s}=this;return new C8(e-i/2,t,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return{x:this.centerX,y:this.y+this.height/2}}alignedCoordinates(){const{y:e,width:t,height:i,crisp:s,strokeAlignment:n}=this;let{centerX:o,yOpen:a,yClose:r}=this,l=o-t/2,c=o+t/2,h=e,d=e+i;if(s&&t>1){o=this.align(o),a=this.align(a),r=this.align(r);const p=this.align(t/2);l=o-p,c=o+p,h=this.align(e),d=h+this.align(h,i)}const u=(h+d)/2;return o+=n,l+=n,c+=n,h-=n,d+=n,a+=a<u?n:-n,r+=r<u?n:-n,{centerX:o,x0:l,x1:c,y0:h,y1:d,yOpen:a,yClose:r}}executeStroke(e,t){const{width:i,strokeWidth:s}=this;i<s&&(e.lineWidth=i),super.executeStroke(e,t)}};y([Hl()],za.prototype,"centerX",2),y([Hl()],za.prototype,"y",2),y([Hl()],za.prototype,"width",2),y([Hl()],za.prototype,"height",2),y([Hl()],za.prototype,"yOpen",2),y([Hl()],za.prototype,"yClose",2),y([Hl()],za.prototype,"crisp",2),y([Hl()],za.prototype,"strokeAlignment",2);var T8=class extends za{updatePath(){const{path:e}=this,{centerX:t,x0:i,x1:s,y0:n,y1:o,yOpen:a,yClose:r}=this.alignedCoordinates();e.clear(),e.moveTo(t,n),e.lineTo(t,o),Math.abs(s-i)>1&&(e.moveTo(i,a),e.lineTo(t,a),e.moveTo(t,r),e.lineTo(s,r))}},{SceneArrayChangeDetection:L8,SceneChangeDetection:nb,ExtendedPath2D:w8,BBox:N8}=A,du=class extends za{constructor(){super(...arguments),this.wickPath=new w8,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0}computeDefaultGradientFillBBox(){const{width:e,centerX:t,yOpen:i,yClose:s}=this,n=Math.min(i,s),a=Math.max(i,s)-n,r=t-e/2,l=t+e/2;return new N8(r,n,l-r,a)}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:o,wickStroke:a,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h,strokeAlignment:d}=this,{centerX:u,x0:p,x1:g,y0:f,y1:x,yOpen:m,yClose:b}=this.alignedCoordinates();this.path.clear(),this.wickPath.clear();const S=a!=null&&a!==t||r!=null&&r!==i||l!=null&&l!==s||c!=null&&c!==n||h!=null&&h!==o?this.wickPath:e;if(Math.abs(g-p)<=3){S.moveTo(u,f),S.lineTo(u,x);return}const D=Math.min(m,b),C=Math.max(m,b);S.moveTo(u,f),S.lineTo(u,D+i/2),S.moveTo(u,x),S.lineTo(u,C-i/2);const T=d+i/2,k=C-D-2*T;if(k>0)e.rect(p+T,D+T,g-p-2*T,k);else{const L=(D+C)/2;e.moveTo(p,L),e.lineTo(g,L)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,wickStroke:r=i,wickStrokeWidth:l=s,wickStrokeOpacity:c=n,wickLineDash:h=o,wickLineDashOffset:d=a}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,h!=null&&e.setLineDash([...h]),e.lineDashOffset=d,e.stroke(t.getPath2D()))}};y([nb()],du.prototype,"wickStroke",2),y([nb()],du.prototype,"wickStrokeWidth",2),y([nb()],du.prototype,"wickStrokeOpacity",2),y([L8()],du.prototype,"wickLineDash",2),y([nb()],du.prototype,"wickLineDashOffset",2);var{BaseProperties:OP,Property:bi,AbstractBarSeriesProperties:E8,makeSeriesTooltip:O8}=A,yh=class extends OP{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([bi],yh.prototype,"stroke",2),y([bi],yh.prototype,"strokeWidth",2),y([bi],yh.prototype,"strokeOpacity",2),y([bi],yh.prototype,"lineDash",2),y([bi],yh.prototype,"lineDashOffset",2);var WA=class extends OP{constructor(){super(...arguments),this.up=new yh,this.down=new yh}};y([bi],WA.prototype,"up",2),y([bi],WA.prototype,"down",2);var Ln=class extends E8{};y([bi],Ln.prototype,"xKey",2),y([bi],Ln.prototype,"openKey",2),y([bi],Ln.prototype,"closeKey",2),y([bi],Ln.prototype,"highKey",2),y([bi],Ln.prototype,"lowKey",2),y([bi],Ln.prototype,"xName",2),y([bi],Ln.prototype,"yName",2),y([bi],Ln.prototype,"openName",2),y([bi],Ln.prototype,"closeName",2),y([bi],Ln.prototype,"highName",2),y([bi],Ln.prototype,"lowName",2);var ob=class extends Ln{constructor(){super(...arguments),this.tooltip=O8(),this.item=new WA}getStyle(e){const{strokeWidth:t,strokeOpacity:i,stroke:s,lineDash:n,lineDashOffset:o}=this.item[e];return{stroke:s,strokeWidth:t,strokeOpacity:i,lineDash:n,lineDashOffset:o,opacity:1}}};y([bi],ob.prototype,"tooltip",2),y([bi],ob.prototype,"item",2),y([bi],ob.prototype,"itemStyler",2);var{FillGradientDefaults:P8,FillPatternDefaults:R8,FillImageDefaults:B8,BaseProperties:$A,makeSeriesTooltip:F8,Property:ri}=A,uu=class extends $A{};y([ri],uu.prototype,"stroke",2),y([ri],uu.prototype,"strokeWidth",2),y([ri],uu.prototype,"strokeOpacity",2),y([ri],uu.prototype,"lineDash",2),y([ri],uu.prototype,"lineDashOffset",2);var ln=class extends $A{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new P8,this.fillPatternDefaults=new R8,this.fillImageDefaults=new B8,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new uu}};y([ri],ln.prototype,"fill",2),y([ri],ln.prototype,"fillGradientDefaults",2),y([ri],ln.prototype,"fillPatternDefaults",2),y([ri],ln.prototype,"fillImageDefaults",2),y([ri],ln.prototype,"fillOpacity",2),y([ri],ln.prototype,"stroke",2),y([ri],ln.prototype,"strokeWidth",2),y([ri],ln.prototype,"strokeOpacity",2),y([ri],ln.prototype,"lineDash",2),y([ri],ln.prototype,"lineDashOffset",2),y([ri],ln.prototype,"cornerRadius",2),y([ri],ln.prototype,"wick",2);var UA=class extends $A{constructor(){super(...arguments),this.up=new ln,this.down=new ln}};y([ri],UA.prototype,"up",2),y([ri],UA.prototype,"down",2);var ab=class extends Ln{constructor(){super(),this.item=new UA,this.tooltip=F8(),this.highlightStyle.deprecated=!1}getStyle(e){const{fill:t,fillOpacity:i,strokeWidth:s,strokeOpacity:n,stroke:o,lineDash:a,lineDashOffset:r,cornerRadius:l,wick:c}=this.item[e];return{fill:t,fillOpacity:i,stroke:o,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:r,cornerRadius:l,opacity:1,wick:c}}};y([ri],ab.prototype,"item",2),y([ri],ab.prototype,"tooltip",2),y([ri],ab.prototype,"itemStyler",2);var{isGradientFill:PP,isPatternFill:YA,isImageFill:KA,getShapeFill:RP,applyShapeStyle:z8}=A,rb=class extends EP{constructor(){super(...arguments),this.properties=new ab}nodeFactory(){return new du}updateDatumNodes({datumSelection:e,isHighlight:t}){const{item:i}=this.properties,{up:s,down:n}=i,{strokeWidth:o}=s,{strokeWidth:a}=n;e.each((r,l)=>{const{isRising:c,centerX:h,width:d,y:u,height:p,yOpen:g,yClose:f,crisp:x}=l,m=this.getItemStyle(l,t);r.centerX=h,r.width=d,r.y=u,r.height=p,r.yOpen=g,r.yClose=f,r.crisp=x,z8(r,m,this.getShapeFillBBox());const b=m?.wick;r.wickStroke=b?.stroke,r.wickStrokeWidth=b?.strokeWidth,r.wickStrokeOpacity=b?.strokeOpacity,r.wickLineDash=b?.lineDash,r.wickLineDashOffset=b?.lineDashOffset,r.strokeAlignment=(c?o:a)/2})}legendItemSymbol(){const{up:e,down:t}=this.properties.item,i=RP(e.fill,e.fillGradientDefaults,e.fillPatternDefaults,e.fillImageDefaults),s=PP(i)?i.colorStops.map(l=>typeof l=="string"?l:{color:l.color,stop:l.stop!=null?l.stop*.5:void 0}):[{color:YA(i)||KA(i)?e.stroke:i,stop:0},{color:YA(i)||KA(i)?e.stroke:i,stop:.5}],n=RP(t.fill,t.fillGradientDefaults,t.fillPatternDefaults,t.fillImageDefaults),o=PP(n)?n.colorStops.map(l=>typeof l=="string"?l:{color:l.color,stop:l.stop!=null?l.stop*.5:void 0}):[{color:YA(n)||KA(n)?t.stroke:n,stop:.5}],a={type:"gradient",gradient:"linear",rotation:90,colorStops:[...s,...o],reverse:!1},r={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:e.stroke,stop:0},{color:e.stroke,stop:.5},{color:t.stroke,stop:.5}],reverse:!1};return{marker:{fill:a,fillOpacity:e.fillOpacity,stroke:r,strokeWidth:e.strokeWidth??1,strokeOpacity:e.strokeOpacity??1,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset}}}getLegendData(e){const{id:t,data:i,visible:s,ctx:{legendManager:n}}=this,{xKey:o,yName:a,showInLegend:r,legendItemName:l}=this.properties;return!i?.length||!o||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&n.getItemEnabled({seriesId:t,itemId:t}),label:{text:l??a??t},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]}hasItemStylers(){return this.properties.itemStyler!=null}};rb.className="CandleStickSeries",rb.type="candlestick";var{commonSeriesOptionsDefs:_8,candlestickSeriesThemeableOptionsDef:G8}=A,ZA={..._8,...G8,type:Y(Le("candlestick")),xKey:Y(E),openKey:Y(E),highKey:Y(E),lowKey:Y(E),closeKey:Y(E),xName:E,yName:E,openName:E,highName:E,lowName:E,closeName:E};ZA.pickOutsideVisibleMinorAxis=me(z),ZA.focusPriority=me(K);var{ThemeConstants:{CARTESIAN_AXIS_TYPE:BP},multiSeriesHighlightStyle:V8}=A;function FP(e){return{fill:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},e==="up"?"transparent":{$palette:"fill"},{$palette:`${e}.fill`}]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${e}.stroke`}]},fillGradientDefaults:A.FILL_GRADIENT_LINEAR_SHADED_DEFAULTS(e),fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS}}var j8={series:{item:{up:FP("up"),down:FP("down")},highlightStyle:{item:{strokeWidth:3}},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:V8()},animation:{enabled:!1},axes:{[BP.NUMBER]:{crosshair:{snap:!1}},[BP.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:zP,CARTESIAN_POSITION:_P}=A.ThemeConstants,H8={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:e=>new rb(e),defaultAxes:[{type:zP.NUMBER,position:_P.LEFT},{type:zP.ORDINAL_TIME,position:_P.BOTTOM}],themeTemplate:j8,groupable:!1},GP={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,options:ZA,create:e=>new rb(e)},{CachedTextMeasurerPool:VP,TextUtils:jP,TextWrapper:lb}=A;function W8(e,t){const{fontSize:i,minimumFontSize:s=i}=e,{fontSize:n,minimumFontSize:o=n}=t,a=i-s,r=n-o;let l=e.fontSize,c=t.fontSize;const h=[{labelFontSize:i,secondaryLabelFontSize:n}];for(;l>s||c>o;){const d=a>0?(l-s)/a:-1,u=r>0?(c-o)/r:-1;d>u?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c})}return h.reverse(),h}function pu(e,t){return e.lineHeight!=null&&e.fontSize!=null?e.lineHeight*t/e.fontSize:jP.getLineHeight(t)}function HP(e,t,i,s,{padding:n},o){const{spacing:a=0}=t,r=2*n,l=2*n+a,c=(t.minimumFontSize??t.fontSize)+(s.minimumFontSize??s.fontSize);if(c>o(c+l,!1).height-l)return;const h=W8(t,s),d={fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},u={fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let p,g;return Xk(0,h.length-1,f=>{const{labelFontSize:x,secondaryLabelFontSize:m}=h[f],b=f===0,v=pu(t,x),S=pu(s,m),D=o(v+S+l,b),C=D.width-r,T=D.height-l;if(v+S>T||((p==null||p.fontSize!==x)&&(d.fontSize=x,p=$P(t,e,C,T,d,t.wrapping,b?t.overflowStrategy:"hide")),p==null||p.width>C||p.height>T)||((g==null||g.fontSize!==m)&&(u.fontSize=m,g=$P(s,i,C,T,u,s.wrapping,b?s.overflowStrategy:"hide")),g==null))return;const k=p.height+g.height;if(!(g.width>C||k>T))return{width:Math.max(p.width,g.width),height:k+a,meta:D.meta,label:p,secondaryLabel:g}})}function Yg(e,t,{padding:i},s){const n=2*i,o=Math.min(t.minimumFontSize??t.fontSize,t.fontSize),a={fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight};return Xk(o,t.fontSize,r=>{const l=pu(t,r),c=r===o,h=s(l+n,c),d=h.width-n,u=h.height-n;if(l>u)return;a.fontSize=r;const p=lb.wrapLines(e,{maxWidth:d,maxHeight:u,font:a,textWrap:t.wrapping,overflow:(c?t.overflowStrategy:void 0)??"hide"});if(!p.length)return;const g=$8(p,{lineHeight:l,font:a,maxWidth:d,maxHeight:u});if(g)return[{fontSize:r,lineHeight:l,...g},h.meta]})}function WP(e){return e?.minimumFontSize!=null&&e?.fontSize!=null&&e?.minimumFontSize>e?.fontSize}function XA(e,t,i,s,n,o){const a=t.enabled?e:void 0,r=s.enabled?i:void 0;(WP(t)||WP(s))&&X.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;a!=null&&r!=null&&(l=HP(a,t,r,s,n,o));let c;if(l==null&&a!=null&&(c=Yg(a,t,n,o)),c!=null){const[d,u]=c;l={width:d.width,height:d.height,meta:u,label:d,secondaryLabel:void 0}}let h;if(l==null&&a==null&&r!=null&&(h=Yg(r,s,n,o)),h!=null){const[d,u]=h;l={width:d.width,height:d.height,meta:u,label:void 0,secondaryLabel:d}}return l}function $P(e,t,i,s,n,o,a){const r=lb.wrapLines(t,{maxWidth:i,maxHeight:s,font:n,textWrap:o,overflow:a});if(!r.length)return;const l=pu(e,n.fontSize),{width:c}=VP.measureLines(r,{font:n});return{width:c,lineHeight:l,text:r.join(`
`),height:r.length*l,fontSize:n.fontSize}}function $8(e,{font:t,lineHeight:i=jP.defaultLineHeight,maxWidth:s,maxHeight:n=1/0}){let o=i*e.length;for(;o>n;){if(e.length===1)return;e.pop(),e[e.length-1]=lb.appendEllipsis(e.at(-1)),o=i*e.length}const a=VP.measureLines(e,{font:t});let r,l;if(a.width>s){const c=[];l=0;for(const h of a.lineMetrics){if(h.width>s){if(!c.length)return;break}c.push(h.text),l=Math.max(l,h.width)}r=lb.appendEllipsis(c.join(`
`))}else r=e.join(`
`),l=a.width;return{text:r,width:l,height:o}}var{Property:Kg}=A,gu=class extends A.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};y([Kg],gu.prototype,"wrapping",2),y([Kg],gu.prototype,"overflowStrategy",2),y([Kg],gu.prototype,"lineHeight",2),y([Kg],gu.prototype,"minimumFontSize",2);var _a=class extends gu{constructor(){super(...arguments),this.spacing=0}};y([Kg],_a.prototype,"spacing",2);var Zg=class extends gu{},{CartesianSeriesProperties:U8,makeSeriesTooltip:Y8,Property:bs}=A,Qi=class extends U8{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 _a,this.tooltip=Y8()}};y([bs],Qi.prototype,"title",2),y([bs],Qi.prototype,"xKey",2),y([bs],Qi.prototype,"yKey",2),y([bs],Qi.prototype,"colorKey",2),y([bs],Qi.prototype,"xName",2),y([bs],Qi.prototype,"yName",2),y([bs],Qi.prototype,"colorName",2),y([bs],Qi.prototype,"colorRange",2),y([bs],Qi.prototype,"stroke",2),y([bs],Qi.prototype,"strokeOpacity",2),y([bs],Qi.prototype,"strokeWidth",2),y([bs],Qi.prototype,"textAlign",2),y([bs],Qi.prototype,"verticalAlign",2),y([bs],Qi.prototype,"itemPadding",2),y([bs],Qi.prototype,"itemStyler",2),y([bs],Qi.prototype,"label",2),y([bs],Qi.prototype,"tooltip",2);var{SeriesNodePickMode:UP,computeBarFocusBounds:K8,getMissCount:Z8,valueProperty:qA,ChartAxisDirection:xo,DEFAULT_CARTESIAN_DIRECTION_KEYS:X8,DEFAULT_CARTESIAN_DIRECTION_NAMES:q8,createDatumId:Q8,ColorScale:J8,Rect:eq,PointerEvents:tq,applyShapeStyle:iq,mergeDefaults:YP,formatValue:sq,addHitTestersToQuadtree:nq,findQuadtreeMatch:KP,updateLabelNode:oq}=A,aq=class extends A.CartesianSeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.colorKey=s.properties.colorKey}},rq={left:-.5,center:0,right:-.5},lq={top:-.5,middle:0,bottom:-.5},cb=class extends A.CartesianSeries{constructor(e){super({moduleCtx:e,propertyKeys:{...X8,color:["colorKey"]},propertyNames:{...q8,color:["colorName"]},categoryKey:void 0,pickModes:[UP.NEAREST_NODE,UP.EXACT_SHAPE_MATCH],pathsPerSeries:[]}),this.properties=new Qi,this.NodeEvent=aq,this.colorScale=new J8}async processData(e){const t=this.axes[xo.X],i=this.axes[xo.Y];if(!t||!i||!this.data?.length)return;const{xKey:s,yKey:n,colorRange:o,colorKey:a}=this.properties,r=this.axes[xo.X]?.scale,l=this.axes[xo.Y]?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:r,yScale:l}),d=this.colorScale.type,{dataModel:u,processedData:p}=await this.requestDataModel(e,this.data,{props:[qA(s,c,{id:"xValue"}),qA(n,h,{id:"yValue"}),...a?[qA(a,d,{id:"colorValue",invalidValue:void 0})]:[]]});if(this.isColorScaleValid()){const g=u.resolveProcessedDataIndexById(this,"colorValue"),f=p.domain.values[g].filter(m=>m!=null),x=A.extent(f);if(this.colorScale.domain=x??[],x?.length&&x[0]===x[1]){const m=Math.floor(o.length/2);this.colorScale.range=[o[m],o[m]]}else this.colorScale.range=o;this.colorScale.update()}}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=Z8(this,i.defs.values[s].missing),a=t.resolveProcessedDataIndexById(this,"colorValue"),r=i.domain.values[a].filter(c=>c!=null).length;return!(n===0||n===o||r===0)}xCoordinateRange(e,t){const i=this.axes[xo.X].scale,s=t*(i.bandwidth??0)/2,n=i.convert(e)+s,o=t*(i.bandwidth??10);return[n,n+o]}yCoordinateRange(e,t){const i=this.axes[xo.Y].scale,s=t*(i.bandwidth??0)/2,n=i.convert(e[0])+s,o=t*(i.bandwidth??10);return[n,n+o]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;return!t||!i?[]:e===xo.X?t.getDomain(this,"xValue","value",i):t.getDomain(this,"yValue","value",i)}getSeriesRange(e,t){return[NaN,NaN]}createNodeData(){const{data:e,visible:t,axes:i,dataModel:s,processedData:n}=this,o=i[xo.X],a=i[xo.Y];if(!(e&&s&&n&&t&&o&&a))return;if(o.type!=="category"||a.type!=="category"){X.warnOnce(`Heatmap series expected axes to have "category" type, but received "${o.type}" and "${a.type}" instead.`);return}const{xKey:r,xName:l,yKey:c,yName:h,colorKey:d,colorName:u,textAlign:p,verticalAlign:g,itemPadding:f,label:x}=this.properties,m=s.resolveColumnById(this,"xValue",n),b=s.resolveColumnById(this,"yValue",n),v=d?s.resolveColumnById(this,"colorValue",n):void 0,S=d?s.getDomain(this,"colorValue","value",n):[],D=o.scale,C=a.scale,T=(D.bandwidth??0)/2,k=(C.bandwidth??0)/2,L=[],N=[],w=D.bandwidth??10,O=C.bandwidth??10,R=(w-2*f)*rq[p],B=(O-2*f)*lq[g],P=()=>({width:w,height:O,meta:null});return(n.dataSources.get(this.id)??[]).forEach((F,W)=>{const H=m[W],j=b[W],V=D.convert(H)+T,$=C.convert(j)+k,U=v?.[W],Z=x.enabled&&U!=null?this.getLabelText(U,F,d,"color",S,x,{value:U,datum:F,colorKey:d,colorName:u,xKey:r,yKey:c,xName:l,yName:h}):void 0,q=XA(Z,this.properties.label,void 0,this.properties.label,{padding:f},P),Q={x:V,y:$,size:0};if(L.push({series:this,itemId:c,datumIndex:W,yKey:c,xKey:r,xValue:H,yValue:j,colorValue:U,datum:F,point:Q,width:w,height:O,midPoint:{x:V,y:$},missing:v!=null&&U==null}),q?.label!=null){const{text:ie,fontSize:ne,lineHeight:oe,height:le}=q.label,{fontStyle:re,fontFamily:ee,fontWeight:Me,color:Ee}=this.properties.label,Ie=Q.x+R*(w-2*f),xe=Q.y+B*(O-2*f)-(q.height-le)*.5;N.push({series:this,itemId:c,datum:F,datumIndex:W,text:ie,fontSize:ne,lineHeight:oe,fontStyle:re,fontFamily:ee,fontWeight:Me,color:Ee,textAlign:p,textBaseline:g,x:Ie,y:xe})}}),{itemId:this.properties.yKey??this.id,nodeData:L,labelData:N,scales:this.calculateScaling(),visible:this.visible}}nodeFactory(){return new eq}update(e){return this.ctx.animationManager.skipCurrentBatch(),super.update(e)}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s)}getItemStyle({datumIndex:e,datum:t,colorValue:i},s){const{id:n,properties:o}=this,{xKey:a,yKey:r,itemStyler:l,stroke:c,strokeWidth:h,strokeOpacity:d}=o,u=this.getHighlightStyle(s,e),p=YP(u,{fill:this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):"transparent",fillOpacity:1,stroke:c,strokeWidth:h,strokeOpacity:d,opacity:1});let g;return l!=null&&e!=null&&(g=this.cachedDatumCallback(Q8(e,s?"highlight":"node"),()=>{const f=this.ctx.highlightManager?.getActiveHighlight(),x=this.getHighlightStateString(f,s,e);return this.callWithContext(l,{seriesId:n,datum:t,xKey:a,yKey:r,highlighted:s,highlightState:x,...p})})),g?YP(g,p):p}updateDatumNodes(e){const{isHighlight:t}=e,i=this.axes[xo.X],[s,n]=i?.visibleRange??[],a=!(s!==0||n!==1);e.datumSelection.each((r,l)=>{const{point:c,width:h,height:d}=l,u=this.getItemStyle(l,t);r.crisp=a,r.x=Math.floor(c.x-h/2),r.y=Math.floor(c.y-d/2),r.width=Math.ceil(h),r.height=Math.ceil(d),iq(r,u)})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e,{enabled:s}=this.properties.label,n=s?t:[];return i.update(n)}updateLabelNodes(e){e.labelSelection.each((t,i)=>{t.pointerEvents=tq.None,t.text=i.text,t.fillOpacity=this.getHighlightStyle(!1,i.datumIndex)?.opacity??1,oq(this,t,this.properties,this.properties.label,i)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o,colorScale:a,ctx:r}=this,{formatManager:l}=r,{xKey:c,xName:h,yKey:d,yName:u,colorKey:p,colorName:g,colorRange:f,title:x,legendItemName:m,tooltip:b}=o,v=n[xo.X],S=n[xo.Y];if(!i||!s||!v||!S)return;const D=s.dataSources.get(this.id)?.[e],C=i.resolveColumnById(this,"xValue",s)[e],T=i.resolveColumnById(this,"yValue",s)[e],k=p!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",s)[e]:void 0;if(C==null)return;const L=[];let N;if(k==null)N=f[0];else{N=a.convert(k);const R=i.getDomain(this,"colorValue","value",s),B=l.format(this.callWithContext.bind(this),{type:"number",value:k,datum:D,seriesId:t,legendItemName:m,key:p,source:"tooltip",property:"color",domain:R,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0});L.push({label:g,fallbackLabel:p,value:B??sq(k)})}L.push({label:h,fallbackLabel:c,value:this.getAxisValueText(v,"tooltip",C,D,c,m)},{label:u,fallbackLabel:d,value:this.getAxisValueText(S,"tooltip",T,D,d,m)});const w=this.getItemStyle({datumIndex:e,datum:D,colorValue:k},!1);w.fill!=null&&(N=w.fill);const O=N!=null?{marker:{shape:"square",fill:N,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}}:void 0;return this.formatTooltipWithContext(b,{title:x??m,symbol:O,data:L},{seriesId:t,datum:D,title:x,xKey:c,xName:h,yKey:d,yName:u,colorKey:p,colorName:g,...w})}getLegendData(e){return e!=="gradient"||!this.isColorScaleValid()||!this.dataModel?[]:[{legendType:"gradient",enabled:this.visible,seriesId:this.id,series:this.getFormatterContext("color"),colorDomain:this.colorScale.domain,colorRange:this.colorScale.range}]}isLabelEnabled(){return this.properties.label.enabled&&!!this.properties.colorKey}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e];if(t===void 0)return;const{width:i,height:s,midPoint:n}=t,o={x:n.x-i/2,y:n.y-s/2,width:i,height:s};return K8(this,o)}initQuadTree(e){nq(e,this.datumNodesIter())}pickNodesExactShape(e){const t=KP(this,e);return t!=null&&t.distance<=0?[t.datum]:[]}pickNodeClosestDatum(e){return KP(this,e)}hasItemStylers(){return this.properties.itemStyler!=null}};cb.className="HeatmapSeries",cb.type="heatmap";var{commonSeriesOptionsDefs:cq,heatmapSeriesThemeableOptionsDef:hq,without:ZP}=A,dq={...ZP(hq,["showInLegend"]),...ZP(cq,["showInLegend"]),type:Y(Le("heatmap")),xKey:Y(E),yKey:Y(E),colorKey:E,xName:E,yName:E,colorName:E,colorRange:Ae(ae)},uq={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$path:["/0",{$palette:"stroke"},{$palette:"strokes"}]}]},strokeWidth:{$isUserOption:["./stroke",2,void 0]},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},A.SAFE_RANGE2_OPERATION]},label:{...A.LABEL_BOXING_DEFAULTS,enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3,highlight:A.singleSeriesHighlightStyle()},gradientLegend:{enabled:!0,...A.LEGEND_CONTAINER_THEME}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:XP,CARTESIAN_POSITION:qP}}=A,pq={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"heatmap",moduleFactory:e=>new cb(e),defaultAxes:[{type:XP.CATEGORY,position:qP.LEFT},{type:XP.CATEGORY,position:qP.BOTTOM}],themeTemplate:uq},QP={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,options:dq,create:e=>new cb(e)},{applyShapeStyle:gq}=A,hb=class extends EP{constructor(){super(...arguments),this.properties=new ob}nodeFactory(){return new T8}updateDatumNodes({datumSelection:e,isHighlight:t}){const{item:i}=this.properties,{up:s,down:n}=i,{strokeWidth:o}=s,{strokeWidth:a}=n;e.each((r,l)=>{const{isRising:c,centerX:h,width:d,y:u,height:p,yOpen:g,yClose:f,crisp:x}=l;r.centerX=h,r.width=d,r.y=u,r.height=p,r.yOpen=g,r.yClose=f,r.crisp=x;const m=this.getItemStyle(l,t);gq(r,m),r.strokeAlignment=(c?o:a)/2})}getLegendData(e){const{id:t,data:i,ctx:{legendManager:s},visible:n}=this,{xKey:o,yName:a,item:{up:r,down:l},showInLegend:c,legendItemName:h}=this.properties;if(!i?.length||!o||e!=="category")return[];const d={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:r.stroke,stop:0},{color:r.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:n&&s.getItemEnabled({seriesId:t,itemId:t}),label:{text:h??a??t},symbol:{marker:{fill:d,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}hasItemStylers(){return this.properties.itemStyler!=null}};hb.className="ohlc",hb.type="ohlc";var{commonSeriesOptionsDefs:fq,ohlcSeriesThemeableOptionsDef:yq}=A,QA={...fq,...yq,type:Y(Le("ohlc")),xKey:Y(E),openKey:Y(E),highKey:Y(E),lowKey:Y(E),closeKey:Y(E),xName:E,yName:E,openName:E,highName:E,lowName:E,closeName:E};QA.pickOutsideVisibleMinorAxis=me(z),QA.focusPriority=me(K);var{ThemeConstants:{CARTESIAN_AXIS_TYPE:db,CARTESIAN_POSITION:JP},multiSeriesHighlightStyle:mq}=A,xq={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ohlc",moduleFactory:e=>new hb(e),defaultAxes:[{type:db.NUMBER,position:JP.LEFT},{type:db.ORDINAL_TIME,position:JP.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"}]}}},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:mq(!1)},axes:{[db.NUMBER]:{crosshair:{snap:!1}},[db.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},groupable:!1},eR={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,options:QA,create:e=>new hb(e)},{AGGREGATION_INDEX_Y_MAX:bq,AGGREGATION_INDEX_Y_MIN:vq,aggregationDomain:Sq,aggregationIndexForXRatio:tR,aggregationRangeFittingPoints:Mq,aggregationXRatioForXValue:iR,compactAggregationIndices:Dq,createAggregationIndices:Aq}=A,Iq=1e3;function sR(e,t,i,s,n,o){const a=e[o];if(a==null)return!1;const r=iR(a,t,i),l=tR(r,n);return o===s[l+bq]}function nR(e,t,i,s,n,o){const a=e[o];if(a==null)return!1;const r=iR(a,t,i),l=tR(r,n);return o===s[l+vq]}function kq(e,t,i,s,n){if(t.length<Iq)return;const[o,a]=Sq(e,n);let r=Mq(t);const{indexData:l,valueData:c}=Aq(t,i,s,o,a,r);let h=[],d=[];for(let p=0;p<t.length;p+=1)sR(t,o,a,l,r,p)&&h.push(p),nR(t,o,a,l,r,p)&&d.push(p);const u=[{maxRange:r,topIndices:h,bottomIndices:d}];for(;r>64;)({maxRange:r}=Dq(l,c,r,{inPlace:!0})),h=h.filter(sR.bind(null,t,o,a,l,r)),d=d.filter(nR.bind(null,t,o,a,l,r)),u.push({maxRange:r,topIndices:h,bottomIndices:d});return u.reverse(),u}var{CartesianSeriesProperties:Cq,FillGradientDefaults:Tq,FillPatternDefaults:Lq,FillImageDefaults:wq,InterpolationProperties:Nq,SeriesMarker:Eq,makeSeriesTooltip:Oq,Property:wt,DropShadow:Pq,Label:Rq}=A,JA=class extends Rq{constructor(){super(...arguments),this.placement="outside",this.spacing=0}};y([wt],JA.prototype,"placement",2),y([wt],JA.prototype,"spacing",2);var Bt=class extends Cq{constructor(){super(...arguments),this.fill="#99CCFF",this.fillGradientDefaults=new Tq,this.fillPatternDefaults=new Lq,this.fillImageDefaults=new wq,this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Nq,this.shadow=new Pq().set({enabled:!1}),this.marker=new Eq,this.label=new JA,this.tooltip=Oq(),this.connectMissingData=!1}};y([wt],Bt.prototype,"xKey",2),y([wt],Bt.prototype,"yLowKey",2),y([wt],Bt.prototype,"yHighKey",2),y([wt],Bt.prototype,"xName",2),y([wt],Bt.prototype,"yName",2),y([wt],Bt.prototype,"yLowName",2),y([wt],Bt.prototype,"yHighName",2),y([wt],Bt.prototype,"fill",2),y([wt],Bt.prototype,"fillGradientDefaults",2),y([wt],Bt.prototype,"fillPatternDefaults",2),y([wt],Bt.prototype,"fillImageDefaults",2),y([wt],Bt.prototype,"fillOpacity",2),y([wt],Bt.prototype,"stroke",2),y([wt],Bt.prototype,"strokeWidth",2),y([wt],Bt.prototype,"strokeOpacity",2),y([wt],Bt.prototype,"lineDash",2),y([wt],Bt.prototype,"lineDashOffset",2),y([wt],Bt.prototype,"interpolation",2),y([wt],Bt.prototype,"shadow",2),y([wt],Bt.prototype,"marker",2),y([wt],Bt.prototype,"label",2),y([wt],Bt.prototype,"tooltip",2),y([wt],Bt.prototype,"connectMissingData",2);var{CollapseMode:ub,isScaleValid:oR,pairUpSpans:pb,prepareAreaFillAnimationFns:Bq,plotInterpolatedLinePathStroke:fu,prepareLinePathPropertyAnimation:Fq,areScalingEqual:aR}=A;function zq(e,t,i,s){const n=(l,c)=>{fu(l,c,t.removed),fu(l,c,i.removed)},o=(l,c)=>{fu(l,c,t.moved),fu(l,c,i.moved)},a=(l,c)=>{fu(l,c,t.added),fu(l,c,i.added)},r=Fq(e,s);return{status:e,path:{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:n},pathProperties:r}}function _q(e,t,i){const s=e.scales.x?.type==="category",n=t.scales.x?.type==="category";if(s!==n||!oR(e.scales.x)||!oR(t.scales.x))return;let o="updated";t.visible&&!e.visible?o="removed":!t.visible&&e.visible&&(o="added");const a=pb({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},ub.Split);if(a==null)return;const r=pb({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},ub.Split);if(r==null)return;const l=pb({scales:e.scales,data:e.highStrokeData.spans},{scales:t.scales,data:t.highStrokeData.spans},ub.Split);if(l==null)return;const c=pb({scales:e.scales,data:e.lowStrokeData.spans},{scales:t.scales,data:t.lowStrokeData.spans},ub.Split);if(c==null)return;const h="fade",d=Bq(o,a,r,h),u=zq(o,l,c,h),p=(i?.changed??!0)||!aR(e.scales.x,t.scales.x)||!aR(e.scales.y,t.scales.y)||o!=="updated";return{status:o,fill:d,stroke:u,hasMotion:p}}var{valueProperty:rR,keyProperty:Gq,ChartAxisDirection:vs,mergeDefaults:Vq,updateLabelNode:jq,fixNumericExtent:lR,buildResetPathFn:Hq,resetLabelFn:Wq,resetMarkerFn:$q,resetMarkerPositionFn:cR,pathSwipeInAnimation:Uq,resetMotion:Yq,markerSwipeScaleInAnimation:Kq,seriesLabelFadeInAnimation:eI,animationValidation:Zq,diff:Xq,updateClipPath:hR,computeMarkerFocusBounds:dR,plotAreaPathFill:qq,plotLinePathStroke:uR,interpolatePoints:pR,pathFadeInAnimation:gR,markerFadeInAnimation:fR,fromToMotion:yR,pathMotion:mR,extent:Qq,applyShapeFillBBox:Jq,PointerEvents:tI,Marker:eQ,BBox:tQ,findMinMax:iQ,getShapeStyle:sQ,getShapeFill:nQ,applyShapeStyle:oQ,processedDataIsAnimatable:aQ,simpleMemorize2:rQ}=A,lQ=rQ(kq),cQ=class extends A.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},gb=class extends A.CartesianSeries{constructor(e){super({moduleCtx:e,pathsPerSeries:["fill","stroke"],pickModes:[A.SeriesNodePickMode.AXIS_ALIGNED],propertyKeys:{[vs.X]:["xKey"],[vs.Y]:["yLowKey","yHighKey"]},propertyNames:{[vs.X]:["xName"],[vs.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:Hq({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Wq,datum:(t,i)=>({...$q(t),...cR(t,i)})},clipFocusBox:!1}),this.properties=new Bt,this.NodeEvent=cQ,this.dataAggregationFilters=void 0}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties,n=this.axes[vs.X]?.scale,o=this.axes[vs.Y]?.scale,{xScaleType:a,yScaleType:r}=this.getScaleInformation({xScale:n,yScale:o}),l=[],c=!this.ctx.animationManager.isSkipped();!this.ctx.animationManager.isSkipped()&&this.processedData&&l.push(Xq(this.id,this.processedData)),c&&l.push(Zq());const{dataModel:h,processedData:d}=await this.requestDataModel(e,this.data,{props:[Gq(t,a,{id:"xValue"}),rR(i,r,{id:"yLowValue"}),rR(s,r,{id:"yHighValue"}),...l]});this.dataAggregationFilters=this.aggregateData(h,d),this.animationState.transition("updateData")}aggregateData(e,t){if(t.type!=="ungrouped"||aQ(t))return;const i=this.axes[vs.X];if(i==null)return;const s=e.resolveKeysById(this,"xValue",t),n=e.resolveColumnById(this,"yHighValue",t),o=e.resolveColumnById(this,"yLowValue",t),{index:a}=e.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[a];return lQ(i.scale.type,s,n,o,r)}xCoordinateRange(e){const t=this.axes[vs.X].scale.convert(e);return[t,t]}yCoordinateRange(e){const t=this.axes[vs.Y].scale.convert(e[0]);return[t,t]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];const{domain:{keys:[s]}}=t;if(e===vs.X){const n=i.resolveProcessedDataDefById(this,"xValue");return n?.def.type==="key"&&n.def.valueType==="category"?s:lR(Qq(s))}else{const n=this.domainForClippedRange(vs.Y,["yHighValue","yLowValue"],"xValue"),o=iQ(n);return lR(o)}}getSeriesRange(e,t){return this.domainForVisibleRange(vs.Y,["yHighValue","yLowValue"],"xValue",t)}createNodeData(){const{data:e,dataModel:t,processedData:i,axes:s}=this,n=s[vs.X],o=s[vs.Y];if(!(e&&n&&o&&t&&i))return;const a=n.scale,r=o.scale,{xKey:l,yLowKey:c,yHighKey:h,connectMissingData:d,marker:u,interpolation:p}=this.properties,g=i.dataSources.get(this.id)??[],f=(a.bandwidth??0)/2,x=t.resolveKeysById(this,"xValue",i),m=t.resolveColumnById(this,"yHighValue",i),b=t.resolveColumnById(this,"yLowValue",i),v=j=>a.convert(x[j])+f,S=[],D=[],C=[],T=(j,V,$)=>{const U=g[j],Z=x[j];if(Z==null)return;const q=C[C.length-1];if(Number.isFinite(V)&&Number.isFinite($)){const Q=(Me,Ee,Ie)=>{D.push({index:j,series:this,itemId:Me,datum:U,datumIndex:j,midPoint:{x:ne,y:Ie},yHighValue:V,yLowValue:$,xValue:Z,xKey:l,yLowKey:c,yHighKey:h,point:{x:ne,y:Ie,size:re},enabled:!0});const xe=this.createLabelData({datumIndex:j,point:{x:ne,y:Ie},value:Ee,yLowValue:$,yHighValue:V,itemId:Me,inverted:ie,datum:U,series:this});S.push(xe)},ie=$>V,ne=v(j),oe=r.convert(V),le=r.convert($),{size:re}=u;Q("high",V,oe),Q("low",$,le);const ee={high:{point:{x:ne,y:oe},xDatum:Z,yDatum:V},low:{point:{x:ne,y:le},xDatum:Z,yDatum:$}};Array.isArray(q)?q.push(ee):q!=null?(q.skip+=1,C.push([ee])):C.push([ee])}else d||(Array.isArray(q)||q==null?C.push({skip:0}):q.skip+=1)},{dataAggregationFilters:k}=this,[L,N]=a.range,w=Math.abs(N-L),O=k?.find(j=>j.maxRange>w),R=O?.topIndices,B=O?.bottomIndices;let[P,_]=this.visibleRangeIndices("xValue",n.range,R);P=Math.max(P-1,0),_=Math.min(_+1,R?.length??x.length),i.input.count<1e3&&(P=0,_=i.input.count);for(let j=P;j<_;j+=1){const V=R?.[j]??j,$=B?.[j]??j;T(V,m[V],b[$])}const F=C.flatMap(j=>{if(!Array.isArray(j))return[];const V=j.map($=>$.high);return pR(V,p)}),W=C.flatMap(j=>{if(!Array.isArray(j))return[];const V=j.map($=>$.low);return pR(V,p)});return{itemId:`${c}-${h}`,labelData:S,nodeData:D,fillData:{itemId:"high",spans:F,phantomSpans:W},highStrokeData:{itemId:"high",spans:F},lowStrokeData:{itemId:"low",spans:W},scales:this.calculateScaling(),visible:this.visible}}createLabelData({datumIndex:e,point:t,value:i,itemId:s,inverted:n,datum:o,series:a}){const{xKey:r,yLowKey:l,yHighKey:c,xName:h,yName:d,yLowName:u,yHighName:p,label:g}=this.properties,{placement:f}=g,x=g.spacing+(typeof g.padding=="number"?g.padding:0);let m=s;n&&(m=s==="low"?"high":"low");const b=f==="outside"&&m==="high"||f==="inside"&&m==="low"?-1:1,v=this.getSeriesDomain(vs.Y);return{x:t.x,y:t.y+x*b,series:a,itemId:s,datum:o,datumIndex:e,text:this.getLabelText(i,o,s==="high"?c:l,"y",v,g,{value:i,datum:o,itemId:s,xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:u,yHighName:p,yName:d}),textAlign:"center",textBaseline:b===-1?"bottom":"top"}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{visible:t}=e,[i,s]=e.paths,{strokeWidth:n,stroke:o,strokeOpacity:a,lineDash:r,lineDashOffset:l,fill:c,fillOpacity:h,opacity:d}=Vq(this.getHighlightStyle(),this.properties);s.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:tI.None,stroke:o,strokeWidth:n,strokeOpacity:a,lineDash:r,lineDashOffset:l,opacity:d,visible:t});const u=nQ(c,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults),p=this.getShapeFillBBox();Jq(i,u,p),oQ(i,{stroke:void 0,fill:u,fillOpacity:h,lineDash:r,lineDashOffset:l,strokeOpacity:a,strokeWidth:n,opacity:d},p),i.setProperties({pointerEvents:tI.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:d,visible:t}),hR(this,s),hR(this,i)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const i of e)i.path.clear(),i.markDirty("RangeArea")}updateFillPath(e,t){const[i]=e;i.path.clear(),qq(i,t.fillData),i.markDirty("RangeArea")}updateStrokePath(e,t){const[,i]=e;i.path.clear(),uR(i,t.highStrokeData.spans),uR(i,t.lowStrokeData.spans),i.markDirty("RangeArea")}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,{xKey:s,yLowKey:n,yHighKey:o,marker:a,fill:r,stroke:l,strokeWidth:c,fillOpacity:h,strokeOpacity:d}=this.properties,u=this.getShapeFillBBox();t.each((p,g)=>{const f={xKey:s,yHighKey:o,yLowKey:n},x=this.getMarkerStyle(a,g,f,i,void 0,{fill:r,fillOpacity:h,stroke:l,strokeWidth:c,strokeOpacity:d});this.applyMarkerStyle(x,p,g.point,u)}),i||this.properties.marker.markClean()}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=tI.None})}updateLabelNodes(e){const t={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey};e.labelSelection.each((i,s)=>{i.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1,jq(this,i,t,this.properties.label,s)})}getHighlightLabelData(e,t){const i=e.filter(s=>s.datum===t.datum);return i.length>0?i:void 0}getHighlightData(e,t){const i=e.filter(s=>s.datum===t.datum);return i.length>0?i:void 0}getTooltipContent(e,t){const{id:i,dataModel:s,processedData:n,axes:o,properties:a}=this,{xName:r,yName:l,yLowKey:c,yLowName:h,xKey:d,yHighKey:u,yHighName:p,tooltip:g,legendItemName:f}=a,x=o[vs.X],m=o[vs.Y];if(!s||!n||!x||!m)return;const b=n.dataSources.get(this.id)?.[e],v=s.resolveKeysById(this,"xValue",n)[e],S=s.resolveColumnById(this,"yHighValue",n)[e],D=s.resolveColumnById(this,"yLowValue",n)[e];if(v==null)return;const C=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:b},{xKey:d,yLowKey:c,yHighKey:u},!1),T=`${this.getAxisValueText(m,"tooltip",D,b,c,f)} - ${this.getAxisValueText(m,"tooltip",S,b,u,f)}`;return this.formatTooltipWithContext(g,{heading:this.getAxisValueText(x,"tooltip",v,b,d,f),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:`${h??c} - ${p??u}`,value:T}]},{seriesId:i,datum:b,title:l,itemId:t?.itemId??"unknown",xName:r,yName:l,yLowKey:c,yLowName:h,xKey:d,yHighKey:u,yHighName:p,...C})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,marker:o}=this.properties;return{marker:sQ({shape:o.shape,fill:o.fill??e,stroke:o.stroke??t,fillOpacity:o.fillOpacity,strokeOpacity:o.strokeOpacity,strokeWidth:o.strokeWidth,lineDash:o.lineDash,lineDashOffset:o.lineDashOffset},o.fillGradientDefaults,o.fillPatternDefaults,o.fillImageDefaults),line:{stroke:t,strokeOpacity:s,strokeWidth:i,lineDash:n}}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{yLowKey:s,yHighKey:n,yName:o,yLowName:a,yHighName:r,showInLegend:l}=this.properties,c=o??`${a??s} - ${r??n}`,h=`${s}-${n}`;return[{legendType:"category",id:t,itemId:h,seriesId:t,enabled:i,label:{text:`${c}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}nodeFactory(){return new eQ}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,paths:n}=e,{animationManager:o}=this.ctx;this.updateAreaPaths(n,s),Uq(this,o,...n),Yq([t],cR),Kq(this,o,t),eI(this,"labels",o,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,contextData:n,paths:o,previousContextData:a}=e,[r,l]=o;if(r==null&&l==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(o,n)},h=()=>{t.skipCurrentBatch(),c()};if(n==null||a==null){c(),fR(this,t,"added",i),gR(this,"fill_path_properties",t,"add",r),gR(this,"stroke_path_properties",t,"add",l),eI(this,"labels",t,s);return}const d=_q(n,a,this.processedData?.reduced?.diff?.[this.id]);if(d===void 0){h();return}else if(d.status==="no-op")return;yR(this.id,"fill_path_properties",t,[r],d.fill.pathProperties),yR(this.id,"stroke_path_properties",t,[l],d.stroke.pathProperties),d.status==="added"?this.updateAreaPaths(o,n):d.status==="removed"?this.updateAreaPaths(o,a):(mR(this.id,"fill_path_update",t,[r],d.fill.path),mR(this.id,"stroke_path_update",t,[l],d.stroke.path)),d.hasMotion&&(fR(this,t,void 0,i),eI(this,"labels",t,s)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(o,n)})}getFormattedMarkerStyle(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,e,{xKey:t,yLowKey:i,yHighKey:s},!0)}computeFocusBounds(e){const t=dR(this,e),i=dR(this,{...e,datumIndex:e.datumIndex+1});if(t&&i)return tQ.merge([t,i])}isDatumEnabled(e,t){return t%2===0&&super.isDatumEnabled(e,t)}hasItemStylers(){return this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};gb.className="RangeAreaSeries",gb.type="range-area";var{commonSeriesOptionsDefs:hQ,rangeAreaSeriesThemeableOptionsDef:dQ}=A,iI={...hQ,...dQ,type:Y(Le("range-area")),xKey:Y(E),yLowKey:Y(E),yHighKey:Y(E),xName:E,yName:E,yLowName:E,yHighName:E};iI.pickOutsideVisibleMinorAxis=me(z),iI.focusPriority=me(K);var uQ={series:{fill:{$palette:"fill"},fillGradientDefaults:A.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,stroke:{$palette:"stroke"},fillOpacity:.7,nodeClickRange:"nearest",marker:{enabled:!1,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:A.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,size:6,strokeWidth:2},label:{...A.LABEL_BOXING_DEFAULTS,enabled:!1,placement:"outside",padding:{$isUserOption:["./spacing",0,10]},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear"},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:A.multiSeriesHighlightStyle()},axes:{[A.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:xR,CARTESIAN_POSITION:bR}}=A,pQ={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-area",moduleFactory:e=>new gb(e),defaultAxes:[{type:xR.NUMBER,position:bR.LEFT},{type:xR.CATEGORY,position:bR.BOTTOM}],themeTemplate:uQ},vR={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,options:iI,create:e=>new gb(e)},{aggregationDomain:gQ,aggregationRangeFittingPoints:fQ,compactAggregationIndices:yQ,createAggregationIndices:mQ}=A,xQ=1e3;function bQ(e,t,i,s,n){if(t.length<xQ)return;const[o,a]=gQ(e,n);let r=fQ(t),{indexData:l,valueData:c}=mQ(t,i,s,o,a,r);const h=[{maxRange:r,indexData:l}];for(;r>64;)({indexData:l,valueData:c,maxRange:r}=yQ(l,c,r)),h.push({maxRange:r,indexData:l});return h.reverse(),h}var{AbstractBarSeriesProperties:vQ,FillGradientDefaults:SQ,FillPatternDefaults:MQ,FillImageDefaults:DQ,makeSeriesTooltip:AQ,Property:Ft,DropShadow:IQ,Label:kQ}=A,sI=class extends kQ{constructor(){super(...arguments),this.placement="inside",this.spacing=0}};y([Ft],sI.prototype,"placement",2),y([Ft],sI.prototype,"spacing",2);var qt=class extends vQ{constructor(){super(...arguments),this.fill="#99CCFF",this.fillGradientDefaults=new SQ,this.fillPatternDefaults=new MQ,this.fillImageDefaults=new DQ,this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new IQ().set({enabled:!1}),this.label=new sI,this.tooltip=AQ()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r,opacity:1}}};y([Ft],qt.prototype,"xKey",2),y([Ft],qt.prototype,"yLowKey",2),y([Ft],qt.prototype,"yHighKey",2),y([Ft],qt.prototype,"xName",2),y([Ft],qt.prototype,"yName",2),y([Ft],qt.prototype,"yLowName",2),y([Ft],qt.prototype,"yHighName",2),y([Ft],qt.prototype,"fill",2),y([Ft],qt.prototype,"fillGradientDefaults",2),y([Ft],qt.prototype,"fillPatternDefaults",2),y([Ft],qt.prototype,"fillImageDefaults",2),y([Ft],qt.prototype,"fillOpacity",2),y([Ft],qt.prototype,"stroke",2),y([Ft],qt.prototype,"strokeWidth",2),y([Ft],qt.prototype,"strokeOpacity",2),y([Ft],qt.prototype,"lineDash",2),y([Ft],qt.prototype,"lineDashOffset",2),y([Ft],qt.prototype,"cornerRadius",2),y([Ft],qt.prototype,"itemStyler",2),y([Ft],qt.prototype,"shadow",2),y([Ft],qt.prototype,"label",2),y([Ft],qt.prototype,"tooltip",2);var{SeriesNodePickMode:SR,valueProperty:MR,keyProperty:CQ,ChartAxisDirection:Xg,checkCrisp:TQ,updateLabelNode:LQ,SMALLEST_KEY_INTERVAL:wQ,LARGEST_KEY_INTERVAL:NQ,diff:EQ,prepareBarAnimationFunctions:DR,midpointStartingBarPosition:AR,resetBarSelectionsFn:OQ,fixNumericExtent:PQ,seriesLabelFadeInAnimation:IR,resetLabelFn:RQ,animationValidation:BQ,computeBarFocusBounds:FQ,visibleRangeIndices:zQ,createDatumId:_Q,ContinuousScale:GQ,Rect:VQ,PointerEvents:jQ,motion:kR,applyShapeStyle:HQ,findMinMax:WQ,getShapeStyle:nI,areScalingEqual:$Q,processedDataIsAnimatable:UQ,AGGREGATION_SPAN:CR,AGGREGATION_INDEX_X_MAX:TR,AGGREGATION_INDEX_X_MIN:LR,AGGREGATION_INDEX_Y_MAX:YQ,AGGREGATION_INDEX_Y_MIN:KQ,mergeDefaults:wR,simpleMemorize2:ZQ}=A,XQ=ZQ(bQ),qQ=class extends A.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},fb=class extends A.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[SR.AXIS_ALIGNED,SR.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},propertyNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:OQ,label:RQ}}),this.properties=new qt,this.dataAggregationFilters=void 0,this.NodeEvent=qQ}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties,n=this.getCategoryAxis()?.scale,o=this.getValueAxis()?.scale,{isContinuousX:a,xScaleType:r,yScaleType:l}=this.getScaleInformation({xScale:n,yScale:o}),c=[];this.ctx.animationManager.isSkipped()||(this.processedData&&c.push(EQ(this.id,this.processedData)),c.push(BQ()));const h=this.visible?{}:{forceValue:0},{dataModel:d,processedData:u}=await this.requestDataModel(e,this.data,{props:[CQ(t,r,{id:"xValue"}),MR(i,l,{id:"yLowValue",invalidValue:null,...h}),MR(s,l,{id:"yHighValue",invalidValue:null,...h}),...a?[wQ,NQ]:[],...c],groupByKeys:!1});this.smallestDataInterval=u.reduced?.smallestKeyInterval,this.largestDataInterval=u.reduced?.largestKeyInterval,this.dataAggregationFilters=this.aggregateData(d,u),this.animationState.transition("updateData")}aggregateData(e,t){if(t.type!=="ungrouped"||UQ(t))return;const i=this.axes[Xg.X];if(i==null)return;const s=e.resolveKeysById(this,"xValue",t),n=e.resolveColumnById(this,"yHighValue",t),o=e.resolveColumnById(this,"yLowValue",t),{index:a}=e.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[a];return XQ(i.scale.type,s,n,o,r)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];const{keys:[s]}=t.domain;if(e===this.getCategoryDirection()){const n=i.resolveProcessedDataDefById(this,"xValue");return n?.def.type==="key"&&n?.def.valueType==="category"?s:this.padBandExtent(s)}else{const n=this.domainForClippedRange(e,["yHighValue","yLowValue"],"xValue"),o=WQ(n);return PQ(o)}}getSeriesRange(e,t){return this.domainForVisibleRange(Xg.Y,["yHighValue","yLowValue"],"xValue",t)}createNodeData(){const{data:e,dataModel:t,groupScale:i,processedData:s,visible:n}=this,o=this.getCategoryAxis(),a=this.getValueAxis();if(!(e&&o&&a&&t&&s?.dataSources))return;const r=o.scale,l=a.scale,c=this.getBarDirection()===Xg.X,{xKey:h,yLowKey:d,yHighKey:u,strokeWidth:p}=this.properties,g=`${d}-${u}`,f={itemId:g,nodeData:[],labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible};if(!n)return f;const x=s.dataSources.get(this.id)??[],m=t.resolveKeysById(this,"xValue",s),b=t.resolveColumnById(this,"yLowValue",s),v=t.resolveColumnById(this,"yHighValue",s),{barWidth:S,groupIndex:D}=this.updateGroupScale(o),C=GQ.is(r)?S*-.5:0,T=i.convert(String(D)),k=TQ(o?.scale,o?.visibleRange,this.smallestDataInterval,this.largestDataInterval),L=_=>Math.round(r.convert(m[_]))+T+C,N=(_,F,W,H,j,V,$)=>{const U=x[_],Z=m[_];if(Z==null)return;const q=b[_],Q=v[_];if(!Number.isFinite(q?.valueOf())||!Number.isFinite(Q?.valueOf()))return;const[ie,ne]=q<Q?[q,Q]:[Q,q],oe=Math.round(l.convert(V)),le=Math.round(l.convert(j)),re=Math.max(p,Math.abs(le-oe)),ee={x:c?Math.min(oe,le):W,y:c?W:Math.min(oe,le),width:c?re:H,height:c?H:re},Me={x:ee.x+ee.width/2,y:ee.y+ee.height/2},Ee=this.createLabelData({datumIndex:_,rect:ee,barAlongX:c,yLowValue:ie,yHighValue:ne,datum:U,series:this}),Ie={index:F,series:this,itemId:g,datum:U,datumIndex:_,xValue:Z,yLowValue:q,yHighValue:Q,yLowKey:d,yHighKey:u,xKey:h,x:ee.x,y:ee.y,width:ee.width,height:ee.height,midPoint:Me,crisp:$,labels:Ee};f.nodeData.push(Ie),f.labelData.push(...Ee)},{dataAggregationFilters:w}=this,[O,R]=r.range,B=Math.abs(R-O),P=w?.find(_=>_.maxRange>B);if(P!=null){const{maxRange:_,indexData:F}=P,[W,H]=zQ(1,_,o.range,j=>{const V=j*CR,$=F[V+LR],U=F[V+TR];if($===-1)return;const Z=($+U)/2|0;return[L(Z),L(U)+S]});for(let j=W;j<H;j+=1){const V=j*CR,$=F[V+LR],U=F[V+TR],Z=F[V+KQ],q=F[V+YQ];if($===-1)continue;const Q=($+U)/2|0;if(m[Q]==null)continue;const ne=L(Q),oe=Math.abs(L($)-L(U))+S,le=b[Z],re=v[q];N(Q,0,ne,oe,le,re,!1)}}else if(s.type==="ungrouped"){const _=s.invalidData?.get(this.id);let[F,W]=this.visibleRangeIndices("xValue",o.range);s.input.count<1e3&&(F=0,W=s.input.count);for(let H=F;H<W;H+=1){if(_?.[H]===!0)continue;const j=L(H),V=S,$=b[H],U=v[H];N(H,0,j,V,$,U,k)}}else for(const{datumIndex:_,groupIndex:F}of t.forEachGroupDatum(this,s)){const W=L(_),H=S,j=b[_],V=v[_];N(_,F,W,H,j,V,k)}return f}createLabelData({datumIndex:e,rect:t,barAlongX:i,yLowValue:s,yHighValue:n,datum:o,series:a}){const{xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:d,yHighName:u,yName:p,label:g}=this.properties,f={datum:o,xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:d,yHighName:u,yName:p},{placement:x}=g,v=(g.spacing+(typeof g.padding=="number"?g.padding:0))*(x==="outside"?1:-1),S=this.getSeriesDomain(Xg.Y),D={datumIndex:e,x:t.x+(i?-v:t.width/2),y:t.y+(i?t.height/2:t.height+v),textAlign:i?"left":"center",textBaseline:i?"middle":"bottom",text:this.getLabelText(s,o,l,"y",S,g,{itemId:"low",value:s,...f}),itemId:"low",datum:o,series:a},C={datumIndex:e,x:t.x+(i?t.width+v:t.width/2),y:t.y+(i?t.height/2:-v),textAlign:i?"right":"center",textBaseline:i?"middle":"top",text:this.getLabelText(n,o,c,"y",S,g,{itemId:"high",value:n,...f}),itemId:"high",datum:o,series:a};return x==="outside"&&(D.textAlign=i?"right":"center",D.textBaseline=i?"middle":"top",C.textAlign=i?"left":"center",C.textBaseline=i?"middle":"bottom"),[D,C]}nodeFactory(){return new VQ}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s,void 0,n=>this.getDatumId(n))}getItemStyle(e,t){const{id:i,properties:s}=this,{xKey:n,yHighKey:o,yLowKey:a,itemStyler:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=s,d=this.getHighlightStyle(t,e.datumIndex),u=wR(d,s.getStyle());let p=nI(u,l,c,h);if(r!=null&&e!=null){const g=this.cachedDatumCallback(_Q(this.getDatumId(e),t?"highlight":"node"),()=>{const f=this.ctx.highlightManager?.getActiveHighlight(),x=this.getHighlightStateString(f,t,e.datumIndex);return this.callWithContext(r,{seriesId:i,datum:e.datum,xKey:n,yHighKey:o,yLowKey:a,highlighted:t,highlightState:x,...p})});g&&(p=nI(wR(g,p),l,c,h))}return p}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getCategoryDirection()===Xg.X,n=this.getShapeFillBBox();t.each((o,a)=>{const r=this.getItemStyle(a,i);HQ(o,r,n),o.cornerRadius=r.cornerRadius,o.visible=s?a.width>0:a.height>0,o.crisp=a.crisp})}getHighlightLabelData(e,t){const i=e.filter(s=>s.datum===t.datum);return i.length>0?i:void 0}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=jQ.None})}updateLabelNodes(e){const t={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey};e.labelSelection.each((i,s)=>{i.fillOpacity=this.getHighlightStyle(!1,s?.datumIndex).opacity??1,LQ(this,i,t,this.properties.label,s)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,tooltip:u,legendItemName:p}=n,g=this.getCategoryAxis(),f=this.getValueAxis(),x=this.contextNodeData?.nodeData?.[e];if(!i||!s||!g||!f||!x)return;const m=s.dataSources.get(this.id)?.[e],b=i.resolveKeysById(this,"xValue",s)[e],v=i.resolveColumnById(this,"yHighValue",s)[e],S=i.resolveColumnById(this,"yLowValue",s)[e];if(b==null)return;const D=this.getItemStyle(x,!1),C=`${this.getAxisValueText(f,"tooltip",S,m,l,p)} - ${this.getAxisValueText(f,"tooltip",v,m,c,p)}`;return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(g,"tooltip",b,m,o,p),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${h??l} - ${d??c}`,value:C}]},{seriesId:t,datum:m,title:r,xKey:o,xName:a,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,...D})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:nI({fill:e,stroke:t,fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:o,lineDashOffset:a},r,l,c)}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{yName:s,yLowName:n,yHighName:o,yLowKey:a,yHighKey:r,showInLegend:l}=this.properties,c=s??`${n??a} - ${o??r}`,h=`${a}-${r}`;return[{legendType:"category",id:t,itemId:h,seriesId:t,enabled:i,label:{text:`${c}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=DR(AR(this.isVertical(),"normal"));kR.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],i),IR(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,previousContextData:n}=e,o=A.calculateDataDiff(this.id,t,this.getDatumId.bind(this),s,n,this.processedData);this.ctx.animationManager.stopByAnimationGroupId(this.id);const a=n==null?"fade":"normal",r=DR(AR(this.isVertical(),a));kR.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],r,(l,c)=>this.getDatumId(c),o),(o?.changed||!$Q(s.groupScale,n?.groupScale))&&IR(this,"labels",this.ctx.animationManager,i)}getDatumId(e){return`${e.xValue}`}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:e}){return FQ(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.itemStyler!=null}};fb.className="RangeBarSeries",fb.type="range-bar";var{commonSeriesOptionsDefs:QQ,rangeBarSeriesThemeableOptionsDef:JQ}=A,oI={...QQ,...JQ,type:Y(Le("range-bar")),xKey:Y(E),yLowKey:Y(E),yHighKey:Y(E),xName:E,yName:E,yLowName:E,yHighName:E};oI.pickOutsideVisibleMinorAxis=me(z),oI.focusPriority=me(K);var e7={series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:A.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...A.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},placement:"inside",padding:{$isUserOption:["./spacing",0,6]}},highlight:A.multiSeriesHighlightStyle()},axes:{[A.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},t7={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-bar",moduleFactory:e=>new fb(e),defaultAxes:A.DIRECTION_SWAP_AXES,themeTemplate:e7,groupable:!0},NR={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,options:oI,create:e=>new fb(e)},{AbstractBarSeriesProperties:i7,BaseProperties:qg,FillGradientDefaults:s7,FillPatternDefaults:n7,FillImageDefaults:o7,PropertiesArray:a7,makeSeriesTooltip:r7,Property:He,DropShadow:l7,Label:c7}=A,yb=class extends qg{};y([He],yb.prototype,"totalType",2),y([He],yb.prototype,"index",2),y([He],yb.prototype,"axisLabel",2);var ER=class extends qg{};y([He],ER.prototype,"renderer",2);var aI=class extends c7{constructor(){super(...arguments),this.placement="outside-end",this.spacing=0}};y([He],aI.prototype,"placement",2),y([He],aI.prototype,"spacing",2);var Ui=class extends qg{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new s7,this.fillPatternDefaults=new n7,this.fillImageDefaults=new o7,this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=new l7().set({enabled:!1}),this.label=new aI,this.tooltip=new ER}};y([He],Ui.prototype,"name",2),y([He],Ui.prototype,"fill",2),y([He],Ui.prototype,"fillGradientDefaults",2),y([He],Ui.prototype,"fillPatternDefaults",2),y([He],Ui.prototype,"fillImageDefaults",2),y([He],Ui.prototype,"stroke",2),y([He],Ui.prototype,"fillOpacity",2),y([He],Ui.prototype,"strokeOpacity",2),y([He],Ui.prototype,"lineDash",2),y([He],Ui.prototype,"lineDashOffset",2),y([He],Ui.prototype,"strokeWidth",2),y([He],Ui.prototype,"cornerRadius",2),y([He],Ui.prototype,"itemStyler",2),y([He],Ui.prototype,"shadow",2),y([He],Ui.prototype,"label",2),y([He],Ui.prototype,"tooltip",2);var mh=class extends qg{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};y([He],mh.prototype,"enabled",2),y([He],mh.prototype,"stroke",2),y([He],mh.prototype,"strokeOpacity",2),y([He],mh.prototype,"lineDash",2),y([He],mh.prototype,"lineDashOffset",2),y([He],mh.prototype,"strokeWidth",2);var mb=class extends qg{constructor(){super(...arguments),this.positive=new Ui,this.negative=new Ui,this.total=new Ui}};y([He],mb.prototype,"positive",2),y([He],mb.prototype,"negative",2),y([He],mb.prototype,"total",2);var Or=class extends i7{constructor(){super(...arguments),this.item=new mb,this.totals=new a7(yb),this.line=new mh,this.tooltip=r7()}getStyle(e){const{fillOpacity:t,strokeWidth:i,strokeOpacity:s,fill:n,stroke:o,lineDash:a,lineDashOffset:r,cornerRadius:l}=this.item[e==="subtotal"?"total":e];return{fill:n,fillOpacity:t,stroke:o,strokeWidth:i,strokeOpacity:s,lineDash:a,lineDashOffset:r,cornerRadius:l,opacity:1}}};y([He],Or.prototype,"xKey",2),y([He],Or.prototype,"yKey",2),y([He],Or.prototype,"xName",2),y([He],Or.prototype,"yName",2),y([He],Or.prototype,"item",2),y([He],Or.prototype,"totals",2),y([He],Or.prototype,"line",2),y([He],Or.prototype,"tooltip",2);var{adjustLabelPlacement:h7,SeriesNodePickMode:OR,fixNumericExtent:d7,valueProperty:PR,keyProperty:u7,accumulativeValueProperty:xb,trailingAccumulatedValueProperty:p7,ChartAxisDirection:bb,createDatumId:g7,checkCrisp:f7,updateLabelNode:y7,prepareBarAnimationFunctions:m7,collapsedStartingBarPosition:x7,resetBarSelectionsFn:b7,seriesLabelFadeInAnimation:v7,resetLabelFn:S7,animationValidation:M7,DEFAULT_CARTESIAN_DIRECTION_KEYS:D7,DEFAULT_CARTESIAN_DIRECTION_NAMES:A7,computeBarFocusBounds:I7,isContinuous:RR,Rect:k7,motion:C7,applyShapeStyle:T7,getShapeStyle:rI,mergeDefaults:BR}=A,vb=class extends A.AbstractBarSeries{constructor(e){super({moduleCtx:e,propertyKeys:D7,propertyNames:A7,categoryKey:void 0,pickModes:[OR.NEAREST_NODE,OR.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:b7,label:S7}}),this.properties=new Or,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(e){const{xKey:t,yKey:i,totals:s}=this.properties,{data:n=[]}=this;if(!this.visible)return;const o=b=>RR(b)&&Number(b)>=0,a=b=>RR(b)&&Number(b)>=0,r=b=>b==="total"||b==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],h=s.reduce((b,v)=>{const S=b.get(v.index);return S?S.push(v):b.set(v.index,[v]),b},new Map);n.forEach((b,v)=>{c.push(b),h.get(v)?.forEach(S=>c.push({...S.toJson(),[t]:S.axisLabel}))});const d=[];this.ctx.animationManager.isSkipped()||d.push(M7());const u=this.getCategoryAxis()?.scale,p=this.getValueAxis()?.scale,{isContinuousX:g,xScaleType:f,yScaleType:x}=this.getScaleInformation({xScale:u,yScale:p}),{processedData:m}=await this.requestDataModel(e,c,{props:[u7(t,f,{id:"xValue"}),xb(i,x,{...l,id:"yCurrent"}),xb(i,x,{...l,missingValue:0,id:"yCurrentTotal"}),xb(i,x,{...l,id:"yCurrentPositive",validation:o}),xb(i,x,{...l,id:"yCurrentNegative",validation:a}),p7(i,x,{...l,id:"yPrevious"}),PR(i,x,{id:"yRaw"}),PR("totalType","category",{id:"totalTypeValue",missingValue:void 0,validation:r}),...g?[A.SMALLEST_KEY_INTERVAL,A.LARGEST_KEY_INTERVAL]:[],...d]});this.smallestDataInterval=m.reduced?.smallestKeyInterval,this.largestDataInterval=m.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];const{keys:[s],values:n}=t.domain;if(e===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue");if(o?.def.type==="key"&&o?.def.valueType==="category")return s;const a=e===bb.Y,r=this.getCategoryAxis().isReversed();return this.padBandExtent(s,r!==a)}else{const o=i.resolveProcessedDataIndexById(this,"yCurrent"),a=n[o],r=[Math.min(0,a[0]),Math.max(0,a[1])];return d7(r)}}getSeriesRange(e,t){return[NaN,NaN]}createNodeData(){const{data:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!e||!s||!n||!t||!i)return;const{line:o}=this.properties,a=s.scale,r=n.scale,l=this.getBarDirection()===bb.X,c=this.getBandwidth(s)??10,h=s.isReversed(),d=n.isReversed();if(i.type!=="ungrouped")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=t.resolveKeysById(this,"xValue",i),f=t.resolveColumnById(this,"yRaw",i),x=t.resolveColumnById(this,"totalTypeValue",i),m=t.resolveColumnById(this,"yCurrent",i),b=t.resolveColumnById(this,"yPrevious",i),v=t.resolveColumnById(this,"yCurrentTotal",i),S=this.getSeriesDomain(bb.Y),D=f7(s?.scale,s?.visibleRange,this.smallestDataInterval,this.largestDataInterval);function C(P,_,F){return P||_?{cumulativeValue:v[F],trailingValue:_?k:0}:{cumulativeValue:m[F],trailingValue:b[F]}}function T(P,_,F,W,H){return P?W:_?(W??0)-(H??0):F}let k=0;const{xKey:L,yKey:N,xName:w,yName:O}=this.properties;(i.dataSources.get(this.id)??[]).forEach((P,_)=>{const F=x[_],W=this.isSubtotal(F),H=this.isTotal(F),j=H||W,V=g[_];if(V==null)return;const $=Math.round(a.convert(V)),U=f[_],{cumulativeValue:Z,trailingValue:q}=C(H,W,_);j&&(k=Z??0);const Q=Math.round(r.convert(Z)),ie=Math.round(r.convert(q)),ne=T(H,W,U,Z,q),oe=(ne??0)>=0,le=this.getSeriesItemType(oe,F),{strokeWidth:re,label:ee}=this.getItemConfig(le),Me=oe?Q:ie,Ee=oe?ie:Q,Ie=Math.max(re,Math.abs(Ee-Me)),xe={x:l?Math.min(Me,Ee):$,y:l?$:Math.min(Me,Ee),width:l?Ie:c,height:l?c:Ie},ze={x:xe.x+xe.width/2,y:xe.y+xe.height/2},he=j?Q:ie,ye=Math.floor(o.strokeWidth)%2/2,be=h?Q:he,Se=h?he:Q;let Oe,_e;l?(Oe={x:be+ye,y:xe.y},_e={x:Se+ye,y:xe.y+xe.height}):(Oe={x:xe.x,y:be+ye},_e={x:xe.x+xe.width,y:Se+ye});const Mt={x:h?_e.x:Oe.x,y:h?_e.y:Oe.y,x2:h?Oe.x:_e.x,y2:h?Oe.y:_e.y,size:0};p.push(Mt);const kt=le==="subtotal"?"total":le,Ki=this.getLabelText(ne,P,N,"y",S,ee,{itemId:kt,value:ne,datum:P,xKey:L,yKey:N,xName:w,yName:O}),zn=ee.spacing+(typeof ee.padding=="number"?ee.padding:0),Gr={index:_,series:this,itemId:le,datum:P,datumIndex:_,cumulativeValue:Z??0,xValue:V,yValue:ne,yKey:N,xKey:L,x:xe.x,y:xe.y,width:xe.width,height:xe.height,midPoint:ze,crisp:D,label:{text:Ki,...h7({isUpward:(ne??-1)>=0!==d,isVertical:!l,placement:ee.placement,spacing:zn,rect:xe})}};u.nodeData.push(Gr),u.labelData.push(Gr)});const B=this.properties.line.enabled;return m!=null&&B&&(u.pointData=p),u}updateSeriesItemTypes(){const{dataModel:e,seriesItemTypes:t,processedData:i}=this;if(!e||!i)return;t.clear();const s=e.resolveProcessedDataIndexById(this,"yCurrentPositive"),n=e.resolveProcessedDataIndexById(this,"yCurrentNegative"),o=e.resolveProcessedDataIndexById(this,"totalTypeValue"),a=i.domain.values[s]??[],r=i.domain.values[n]??[];a.length>0&&t.add("positive"),r.length>0&&t.add("negative");const l=i?.domain.values[o];l&&l.forEach(c=>{(c==="total"||c==="subtotal")&&t.add("total")})}isSubtotal(e){return e==="subtotal"}isTotal(e){return e==="total"}nodeFactory(){return new k7}getSeriesItemType(e,t){return t??(e?"positive":"negative")}getItemConfig(e){switch(e){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s)}getItemStyle({datumIndex:e=0,datum:t,itemId:i="total"},s){const{id:n,properties:o}=this,a=o.item[i==="subtotal"?"total":i],r=this.getHighlightStyle(s,e),l=BR(r,o.getStyle(i)),{itemStyler:c,fillGradientDefaults:h,fillPatternDefaults:d,fillImageDefaults:u}=a,{xKey:p,yKey:g}=o;let f=rI(l,h,d,u);if(c!=null){const x=this.ctx.highlightManager?.getActiveHighlight(),m=this.cachedDatumCallback(g7(e,s?"highlight":"node"),()=>{const b=this.getHighlightStateString(x,s,e);return this.callWithContext(c,{seriesId:n,itemId:i,datum:t,xKey:p,yKey:g,highlighted:s,highlightState:b,...f})});m&&(f=rI(BR(m,f),h,d,u))}return f}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getCategoryDirection()===bb.X,n=this.getShapeFillBBox();t.each((o,a)=>{const r=this.getItemStyle(a,i);T7(o,r,n),o.cornerRadius=r.cornerRadius??0,o.visible=s?a.width>0:a.height>0,o.crisp=a.crisp})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;if(t.length===0)return i.update([]);const s=t.filter(n=>{const{label:o}=this.getItemConfig(n.itemId);return o.enabled});return i.update(s)}updateLabelNodes(e){const t={itemId:"positive",xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xName,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yName};e.labelSelection.each((i,s)=>{t.itemId=s.itemId,i.fillOpacity=this.getHighlightStyle(!1,s.datumIndex)?.opacity??1,y7(this,i,t,this.getItemConfig(s.itemId).label,s.label)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yKey:r,yName:l,tooltip:c,legendItemName:h}=n,d=this.getCategoryAxis(),u=this.getValueAxis();if(!i||!s||!d||!u)return;const p=s.dataSources.get(this.id)?.[e],g=i.resolveKeysById(this,"xValue",s)[e],f=i.resolveColumnById(this,"yRaw",s)[e],x=i.resolveColumnById(this,"yCurrentTotal",s),m=i.resolveColumnById(this,"totalTypeValue",s);if(g==null)return;const b=m[e],v=(f??0)>=0,S=this.getSeriesItemType(v,b);let D;if(this.isTotal(b))D=x[e];else if(this.isSubtotal(b)){D=x[e];for(let T=e-1;T>=0;T-=1)if(this.isSubtotal(m[T])){D=D-x[T];break}}else D=f;const C=this.getItemStyle({datumIndex:e,datum:p,itemId:S},!1);return this.formatTooltipWithContext(c,{heading:this.getAxisValueText(d,"tooltip",g,p,o,h),symbol:this.legendItemSymbol(S),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(u,"tooltip",D,p,r,h)}]},{seriesId:t,datum:p,title:l,itemId:S,xKey:o,xName:a,yKey:r,yName:l,...C})}legendItemSymbol(e){const{fill:t,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=this.getItemConfig(e);return{marker:rI({fill:t,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r},l,c,h)}}getLegendData(e){if(e!=="category")return[];const{id:t,seriesItemTypes:i}=this,s=[],n=a=>a.charAt(0).toUpperCase()+a.substring(1),{showInLegend:o}=this.properties;return i.forEach(a=>{const{name:r}=this.getItemConfig(a);s.push({legendType:"category",id:t,itemId:a,seriesId:t,enabled:!0,label:{text:r??n(a)},symbol:this.legendItemSymbol(a),hideInLegend:!o,isFixed:!0})}),s}toggleSeriesItem(){}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s}=e,n=m7(x7(this.isVertical(),this.axes,"normal"));C7.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],n),v7(this,"labels",this.ctx.animationManager,i);const{pointData:o}=s;o&&(this.isVertical()?this.animateConnectorLinesVertical(e):this.animateConnectorLinesHorizontal(e))}animateConnectorLinesHorizontal(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const n=this.getValueAxis(),o=n?.isReversed(),a=o?(h,d)=>h<d:(h,d)=>h>d,r=n?.scale.convert(0),l=t.reduce((h,d)=>(a(d.x,h)&&(h=d.x),h),o?1/0:0),c=(h,d,u,p,g)=>(h-d)/(u-d)*(g-p)+p;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:A.Motion.easeOut,collapsable:!1,onUpdate(h){s.clear(!0),t.forEach((d,u)=>{const p=c(h,r,l,r,d.x),g=c(h,r,l,r,d.x2);u!==0&&s.lineTo(p,d.y),s.moveTo(g,d.y2)}),i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateConnectorLinesVertical(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const n=this.getValueAxis(),o=n?.isReversed(),a=o?(h,d)=>h>d:(h,d)=>h<d,r=n?.scale.convert(0),l=t.reduce((h,d)=>(a(d.y,h)&&(h=d.y),h),o?0:1/0),c=(h,d,u,p,g)=>(h-d)/(u-d)*(g-p)+p;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:A.Motion.easeOut,collapsable:!1,onUpdate(h){s.clear(!0),t.forEach((d,u)=>{const p=c(h,r,l,r,d.y),g=c(h,r,l,r,d.y2);u!==0&&s.lineTo(d.x,p),s.moveTo(d.x2,g)}),i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateReadyResize(e){super.animateReadyResize(e),this.resetConnectorLinesPath(e)}updatePaths(e){this.resetConnectorLinesPath({contextData:e.contextData,paths:e.paths})}resetConnectorLinesPath({contextData:e,paths:t}){if(t.length===0)return;const[i]=t;this.updateLineNode(i);const{path:s}=i;s.clear(!0);const{pointData:n}=e;n&&(n.forEach((o,a)=>{a!==0&&s.lineTo(o.x,o.y),s.moveTo(o.x2,o.y2)}),i.checkPathDirty())}updateLineNode(e){const{stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:o}=this.properties.line;e.setProperties({fill:void 0,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:o,lineJoin:"round",pointerEvents:A.PointerEvents.None})}isLabelEnabled(){const{positive:e,negative:t,total:i}=this.properties.item;return e.label.enabled||t.label.enabled||i.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:e}){return I7(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){const{positive:e,negative:t,total:i}=this.properties.item;return e.itemStyler!=null||t.itemStyler!=null||i.itemStyler!=null}};vb.className="WaterfallSeries",vb.type="waterfall";var{commonSeriesOptionsDefs:L7,waterfallSeriesThemeableOptionsDef:w7}=A,N7={...w7,...L7,type:Y(Le("waterfall")),xKey:Y(E),yKey:Y(E),xName:E,yName:E,totals:ui({totalType:Y(J("total","subtotal")),index:Y(G),axisLabel:Y(E)},"a total definition options array")};function lI(e,t){return{fill:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`/${t}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${e}.fill`}]},fillGradientDefaults:A.FILL_GRADIENT_LINEAR_SHADED_DEFAULTS(e),fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,stroke:{$palette:`${e}.stroke`},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...A.LABEL_BOXING_DEFAULTS,enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end",padding:{$isUserOption:["./spacing",0,6]}}}}var E7={series:{item:{positive:lI("altUp",0),negative:lI("altDown",1),total:lI("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2},highlight:A.singleSeriesHighlightStyle()},legend:{enabled:!0,toggleSeries:!1}},O7={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"waterfall",solo:!0,moduleFactory:e=>new vb(e),defaultAxes:A.DIRECTION_SWAP_AXES,themeTemplate:E7},FR={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,options:N7,create:e=>new vb(e)},{NewAreaSeriesModule:P7,NewBarSeriesModule:R7,NewBubbleSeriesModule:B7,NewHistogramSeriesModule:F7,NewLineSeriesModule:z7,NewScatterSeriesModule:_7,numberFormatValidator:G7,without:wn}=A,zR={width:G,height:G,grip:z,fill:ae,stroke:ae,strokeWidth:G,cornerRadius:G},cn=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],_R=[...cn,"errorBar","label","legendItemName","direction"],GR=[...cn,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"],VR=[...cn,"title","label","labelKey","labelName","sizeName"],jR=[...cn,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"],HR=[...cn,"label"],WR=[...cn,"errorBar","title","label"],$R=[...cn,"label","yLowName","yHighName"],UR=[...cn,"direction","label","yLowName","yHighName"],YR=[...cn,"errorBar","title","label","labelKey","labelName"],KR=[...cn,"direction"],V7={enabled:z,height:G,spacing:G,cornerRadius:K,mask:{fill:ae,fillOpacity:pe,stroke:ae,strokeWidth:G},minHandle:zR,maxHandle:zR,miniChart:{enabled:z,padding:{top:G,bottom:G},label:{enabled:z,avoidCollisions:z,spacing:G,format:G7,formatter:rt,interval:{minSpacing:G,maxSpacing:G,values:ko,step:K},...ht},series:ui(nc({area:wn(P7.options,[...cn,"type"]),bar:wn(R7.options,[..._R,"type"]),"box-plot":wn(AP.options,[...GR,"type"]),bubble:wn(B7.options,[...VR,"type"]),candlestick:wn(GP.options,[...cn,"type"]),heatmap:wn(QP.options,[...jR,"type"]),histogram:wn(F7.options,[...HR,"type"]),line:wn(z7.options,[...WR,"type"]),ohlc:wn(eR.options,[...cn,"type"]),"range-area":wn(vR.options,[...$R,"type"]),"range-bar":wn(NR.options,[...UR,"type"]),scatter:wn(_7.options,[...YR,"type"]),waterfall:wn(FR.options,[...KR,"type"])},"miniChart series options"))}},j7=["area","bar","bubble","candlestick","heatmap","histogram","line","ohlc","range-area","range-bar","scatter","waterfall"],H7=["itemStyler","direction","fill","fillGradientDefaults","fillPatternDefaults","fillImageDefaults","fillOpacity","shadow","focusPriority","seriesGrouping","highlight","lineDash","lineDashOffset","strokeWidth"];function ZR(e,t){return{$merge:[{$switch:[t,{},[["area","line","range-area"],{marker:{enabled:{$isUserOption:["/series/$index/marker/enabled",{$path:["/series/$index/marker/enabled",!1]},!1]}}}]]},{$omit:[{$switch:[t,cn,["bar",_R],["box-plot",GR],["bubble",VR],["heatmap",jR],["histogram",HR],["line",[...WR,...H7]],["range-area",$R],["range-bar",UR],["scatter",YR],["waterfall",KR]]},e]}]}}var W7={enabled:!1,height:{$if:[{$path:"./miniChart/enabled"},40,18]},cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:A.FONT_SIZE_RATIO.SMALLER},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0},series:{$apply:[ZR({$path:"/series/$index"},{$path:["/navigator/miniChart/series/$index/type",{$path:["type",{$path:"/series/$index/type"}]}]}),{$if:[{$or:j7.map(e=>({$eq:[{$path:"/series/0/type"},e]}))},{$map:[ZR({$value:"$1"},{$path:"/series/$index/type"}),{$path:"/series"}]},void 0]}]}}},$7={type:"root",optionsKey:"navigator",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new cu(e),removable:!1,themeTemplate:{navigator:W7}},{ToolbarButtonProperties:U7,Property:Y7}=A,XR=class extends U7{};y([Y7],XR.prototype,"value",2);var{ChartAxisDirection:cI,LayoutElement:K7,PropertiesArray:Z7,Toolbar:X7,Property:qR}=A,hI=class extends A.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.buttons=new Z7(XR),this.verticalSpacing=10,this.container=e.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new X7(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),e.layoutManager.registerElement(K7.ToolbarBottom,this.onLayoutStart.bind(this)),e.eventsHub.on("zoom:change",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.container.removeChild(this.toolbar.getElement()),this.toolbar.destroy()}onLayoutStart(e){const{buttons:t,ctx:i,enabled:s,toolbar:n,verticalSpacing:o}=this,{layoutBox:a}=e;if(!s||!i.zoomManager.isZoomEnabled()){n.setHidden(!0);return}n.setHidden(!1),n.updateButtons(t);const r=n.getBounds().height;n.setBounds({x:a.x,y:a.y+a.height-r,width:a.width,height:r}),a.shrink({bottom:r+o})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:e}}){const{zoomManager:t}=this.ctx,i=this.buttons.at(e);if(!i)return;const{value:s}=i;s==null?t.resetZoom("zoom-buttons"):typeof s=="number"?t.extendToEnd("zoom-buttons",cI.X,s):Array.isArray(s)?t.updateWith("zoom-buttons",cI.X,()=>s):typeof s=="function"&&t.updateWith("zoom-buttons",cI.X,s),this.toolbar.toggleActiveButtonByIndex(e)}};y([qR],hI.prototype,"enabled",2),y([qR],hI.prototype,"buttons",2);var QR=1e3*60*60*24,dI=QR*30,q7=QR*365,Q7={type:"root",optionsKey:"ranges",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new hI(e),themeTemplate:{ranges:{enabled:!1,buttons:{$shallow:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:dI},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*dI},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*dI},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),t]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:q7},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:void 0}]}}}},JR=class If extends A.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(),t==="chartToolbar"&&this.sharedToolbar&&this.sharedToolbar.setAriaLabelId("ariaLabelFinancialCharts"),this.toolbarWithSection(t)}createSharedToolbar(){this.sharedToolbar=new A.Toolbar(this.ctx,"ariaLabelAnnotationsToolbar","vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.cleanup.register(()=>{this.sharedToolbar&&(this.container.removeChild(this.sharedToolbar.getElement()),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(t){const i=this.sharedToolbar,s={layout:(n,o)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==t&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=t;const a=i.getBounds().width;i.setBounds({x:n.x,y:n.y,width:a}),n.shrink({left:a+i.horizontalSpacing+(o??0)})},addToolbarListener:(n,o)=>i.addToolbarListener(n,a=>{const r=this.getSectionIndex(t,a.button.index);if(r<0)return;const l={...a,button:this.sectionButtons[t][r]};o(l)}),updateButtons:n=>{this.sectionButtons[t]=n;const o=If.SECTION_ORDER.flatMap(a=>this.sectionButtons[a]);i.updateButtons(o)},updateButtonByIndex:(n,o)=>{i.updateButtonByIndex(this.getIndex(t,n),o)},toggleActiveButtonByIndex:n=>{i.toggleActiveButtonByIndex(this.getIndex(t,n))},toggleButtonEnabledByIndex:(n,o)=>{i.toggleButtonEnabledByIndex(this.getIndex(t,n),o)},setHidden:n=>{n?this.activeSections.delete(t):this.activeSections.add(t);let o=0;for(const a of If.SECTION_ORDER){if(a!==t){o+=this.sectionButtons[a].length;continue}for(const r of this.sectionButtons[t].keys())i.setButtonHiddenByIndex(o+r,n)}},destroy:()=>{s.setHidden(!0),this.activeSections.size===0&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return s.setHidden(!1),s}getIndex(t,i){let s=0;for(const n of If.SECTION_ORDER){if(n===t)return s+i;s+=this.sectionButtons[n].length}return-1}getSectionIndex(t,i){let s=0;for(const n of If.SECTION_ORDER){if(n===t)return i>=s+this.sectionButtons[t].length?-1:i-s;s+=this.sectionButtons[n].length}return-1}};JR.SECTION_ORDER=["chartToolbar","annotations"];var J7=JR,eJ={type:"context",contextKey:"sharedToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new J7(e)},{CachedTextMeasurerPool:Qg,ZIndexMap:tJ,LayoutElement:iJ,Property:Ks,BaseProperties:sJ,valueProperty:nJ,TextUtils:oJ,Group:aJ,Label:Jg,Rect:rJ,Text:Ji}=A,eB={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},lJ={up:"positive",down:"negative"},cJ={hlc:"altNeutral"},uI=class extends sJ{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};y([Ks],uI.prototype,"fill",2),y([Ks],uI.prototype,"fillOpacity",2);var hn=class extends A.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new Jg,this.positive=new Jg,this.negative=new Jg,this.neutral=new Jg,this.altNeutral=new Jg,this.background=new uI,this.layoutStyle="block",this.id="status-bar",this.data=void 0,this.layer=new aJ({name:"StatusBar",zIndex:tJ.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new A.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new rJ),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new Ji),value:this.labelGroup.appendChild(new Ji),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 Ji),value:this.labelGroup.appendChild(new Ji),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 Ji),value:this.labelGroup.appendChild(new Ji),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 Ji),value:this.labelGroup.appendChild(new Ji),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 Ji),value:this.labelGroup.appendChild(new Ji),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 Ji),value:this.labelGroup.appendChild(new Ji),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 Ji),value:this.labelGroup.appendChild(new Ji),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 Ji),value:this.labelGroup.appendChild(new Ji),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 Ji),value:this.labelGroup.appendChild(new Ji),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=e.highlightManager,this.labelGroup.visible=!1,this.cleanup.register(e.scene.attachNode(this.layer),e.layoutManager.registerElement(iJ.Overlay,t=>this.startPerformLayout(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("highlight:change",()=>this.updateHighlight()))}async processData(e){if(!this.enabled||this.data==null)return;const t=[];for(const n of this.labels){const{id:o,key:a}=n,r=this[a];r==null?n.domain=void 0:t.push(nJ(r,"number",{id:o}))}if(t.length===0)return;const{processedData:i,dataModel:s}=await e.request(this.id,this.data,{props:t});for(const n of this.labels){const{id:o,key:a}=n;this[a]!=null&&(n.domain=s.getDomain(this,o,"value",i))}}startPerformLayout(e){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled)return;const{layoutBox:t}=e,i=4,s=12,n=0,o=8;this.labelGroup.translationY=t.y+n;const a=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),r=oJ.getLineHeight(a),l=eB[this.getChartType()]??0;let c=0,h,d="alphabetic";if(this.layoutStyle==="block")t.shrink(n+r+o,"top"),h=a+(r-a)/2;else{const{title:u}=this.ctx.chartService;if(d="top",h=n+u.padding,u.enabled){const p=u.node.getBBox();c=p.x+p.width+s}else c=u.padding}for(const{label:u,configuration:p,title:g,value:f,domain:x,formatter:m}of this.labels){if(x==null||!(l&p)){g.visible=!1,f.visible=!1;continue}const b=Math.max(Qg.measureText(m.format(x[0]),{font:this.positive,textBaseline:d,textAlign:"left"}).width,Qg.measureText(m.format(x[1]),{font:this.positive,textBaseline:d,textAlign:"left"}).width,Qg.measureText(m.format(x[0]),{font:this.negative,textBaseline:d,textAlign:"left"}).width,Qg.measureText(m.format(x[1]),{font:this.negative,textBaseline:d,textAlign:"left"}).width);g.visible=!0,f.visible=!0;const v=Qg.measureText(u,{font:this.title,textBaseline:d,textAlign:"left"});g.setFont(this.title),g.fill=this.title.color,g.text=u,g.textBaseline=d,g.y=h,g.x=c,c+=v.width+i,f.textBaseline=d,f.y=h,f.x=c,c+=b+s}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=c-s,this.backgroundNode.height=r+n+o,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(e){this.labelGroup.translationX=e.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const e=this.highlightManager.getActiveHighlight(),t=e?.datum??this.data?.at(-1);if(t==null){this.labelGroup.visible=!1;return}this.labelGroup.visible=!0;const i=e?.itemId;let s=i!=null?lJ[i]:void 0;s==null&&this.openKey!=null&&this.closeKey!=null&&(t[this.openKey]<t[this.closeKey]?s="positive":s="negative");for(const{domain:n,value:o,key:a,formatter:r,style:l}of this.labels){if(n==null)continue;let c=l??s??"neutral";c==="neutral"&&(c=cJ[this.getChartType()]??c);const h=this[a],d=h!=null?t?.[h]:void 0;o.setFont(this[c]),o.fill=this[c].color,o.text=typeof d=="number"?r.format(d):""}}getChartType(){let e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return(e==null||eB[e]==null)&&(e="candlestick"),e}};y([Ks],hn.prototype,"enabled",2),y([Ks],hn.prototype,"openKey",2),y([Ks],hn.prototype,"highKey",2),y([Ks],hn.prototype,"lowKey",2),y([Ks],hn.prototype,"closeKey",2),y([Ks],hn.prototype,"volumeKey",2),y([Ks],hn.prototype,"title",2),y([Ks],hn.prototype,"positive",2),y([Ks],hn.prototype,"negative",2),y([Ks],hn.prototype,"neutral",2),y([Ks],hn.prototype,"altNeutral",2),y([Ks],hn.prototype,"background",2),y([Ks],hn.prototype,"layoutStyle",2);var hJ={type:"root",identifier:"status-bar",optionsKey:"statusBar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new hn(e),themeTemplate:{statusBar:{enabled:!1,layoutStyle:A.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:"chartBackgroundColor"},fillOpacity:.5},altNeutral:{color:"gray",fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}}}}},bo=0,Rs=1,xh=Rs-bo,tB="end",iB="middle",Sb=(e,t=bo,i=Rs)=>ve(t,e,i);function pI(){return{x:{min:bo,max:Rs},y:{min:bo,max:Rs}}}function es(e){return e.x.max-e.x.min}function Nn(e){return e.y.max-e.y.min}function sB(e,t,i=1e-10){return lt(e.min,t.min,i)&<(e.max,t.max,i)}function ef(e,t,i){return sB(e.x,t.x,i)&&sB(e.y,t.y,i)}function gI(e){return ef(e,pI())}function Ss(e){return{x:{min:e?.x?.min??bo,max:e?.x?.max??Rs},y:{min:e?.y?.min??bo,max:e?.y?.max??Rs}}}function Pr(e,t,i){if(!e)return{x:0,y:0};const s=Sb(t-e.x,0,e.x+e.width),n=Sb(i-e.y,0,e.y+e.height),o=1/e.width*s,a=1-1/e.height*n;return{x:Sb(o),y:Sb(a)}}function bh(e,t,i){return{x:{min:e.x.min+t,max:e.x.max+t},y:{min:e.y.min+i,max:e.y.max+i}}}function Mb(e,t,i){return{x:{min:e.x.min,max:e.x.min+es(e)*t},y:{min:e.y.min,max:e.y.min+Nn(e)*i}}}function nB(e,t,i){const s=es(e),n=Nn(e),o=e.x.min+s/2,a=e.y.min+n/2;return{x:{min:o-s*t/2,max:o+s*t/2},y:{min:a-n*i/2,max:a+n*i/2}}}function En(e,t,i,s){const{min:n,max:o}=t,a=n+(o-n)/2,r=e.max-e.min;switch(i){case"start":return{min:n,max:t.min+r};case"end":return{min:t.max-r,max:o};case"middle":return{min:a-r/2,max:a+r/2};case"pointer":return dJ(e,t,s??a);default:return{min:n,max:o}}}function dJ(e,t,i){const s=e.max-e.min,n=t.max-t.min,o=i*(1-(n-s)),a=i-o,r=e.min+a,l=e.max+a;return{min:r,max:l}}function uJ(e,t,i){return{x:{min:e.x.min*t,max:e.x.max*t},y:{min:e.y.min*i,max:e.y.max*i}}}function vo(e){return{x:Db(e.x),y:Db(e.y)}}function Db(e){const t=e.max-e.min;let i=e.max>Rs?Rs-t:e.min,s=e.min<bo?t:e.max;return i=Math.max(bo,i),s=Math.min(Rs,s),{min:i,max:s}}var{BaseProperties:pJ,CartesianAxis:fI,ChartAxisDirection:vh,ContinuousScale:yI,TimeScale:gJ,UnitTimeScale:fJ,ChartUpdateType:Ab,ObserveChanges:yu,TooltipManager:yJ,Property:mu,findMinMax:Ib,isObjectWithStringProperty:mJ}=A,Zo=A.Debug.create("sync");function oB(e,t,i){const s=e.getKeys(t),n=e.getKeys(i);return e.shouldFlipXY?.()?[n,s]:[s,n]}function mI(e="x"){switch(e){case"x":return[vh.X];case"y":return[vh.Y];case"xy":return[vh.X,vh.Y]}}function aB(e,t,i){return gJ.is(e)||fJ.is(e)?!jn(t.map(s=>s?.valueOf()),i.map(s=>s?.valueOf())):!jn(t,i)}var Wl=class extends pJ{constructor(e){super(),this.moduleContext=e,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0,this.domainMode="key",this.domainSync=new jv}updateSiblings(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(e??this.groupId))Zo("ChartSync.updateSiblings()",i.id,i),this.updateChart(i)}updateChart(e,t=Ab.PROCESS_DOMAIN){Zo("ChartSync.updateChart()",e.id,Ab[t],e),t===Ab.PROCESS_DOMAIN?e.ctx.updateService.update(t,{forceNodeDataRefresh:!0}):e.ctx.updateService.update(t)}enabledZoomSync(){const{eventsHub:e}=this.moduleContext;this.disableZoomSync?.(),this.disableZoomSync=e.on("zoom:change",this.onZoom.bind(this))}onZoom(){const{syncManager:e}=this.moduleContext;for(const t of e.getGroupSiblings(this.groupId)){if(!t.modulesManager.getModule("sync")?.zoom)continue;const i=t.modulesManager.getModule("zoom");if(!i)continue;const s=this.prepareZoomUpdate();Zo("ChartsSyncManager.enabledZoomSync()",t.id,s),i.updateSyncZoom(s)}}enabledNodeInteractionSync(){this.disableNodeInteractionSync?.(),this.disableNodeInteractionSync=this.moduleContext.eventsHub.on("highlight:change",this.onHighlightChange.bind(this))}onHighlightChange(e){const{syncManager:t}=this.moduleContext;if(e.callerId.endsWith("-sync"))return;Zo("ChartSync.onHighlightChange()",e);const i=e.currentHighlight?.series,[s]=mI(this.axes),n=s===vh.X?vh.Y:vh.X,[o,a]=i?oB(i,s,n):[],r=Vg(e.currentHighlight);let l=o?.[0]?r?.[o[0]]:void 0,c=!1;if(aa(l)&&(c=!0,l=l.getTime()),!e.currentHighlight?.datum){for(const d of t.getGroupSiblings(this.groupId))d.modulesManager.getModule("sync")?.nodeInteraction&&(d.ctx.highlightManager.updateHighlight(`${d.id}-sync`),d.ctx.tooltipManager.removeTooltip(`${d.id}-sync`));return}const h=t.getGroupSyncMode(this.groupId)==="multi-series";this.findMatchingHighlightNodes(s,n,h?a:[],c,l,e)}findMatchingHighlightNodes(e,t,i,s,n,o){const{syncManager:a}=this.moduleContext;Zo("ChartSync.findMatchingHighlightNodes()",{mainDirection:e,secondaryKeys:i});for(const r of a.getGroupSiblings(this.groupId)){if(!r.modulesManager.getModule("sync")?.nodeInteraction)continue;let l=!1;for(const c of r.axes){if(!fI.is(c)||c.direction!==e)continue;const h=r.series.filter(d=>{if(!d.visible)return!1;if(i.length>0){const[,u]=oB(d,e,t);return i.every(p=>u.includes(p))}return!0}).map(this.findMatchingNodes(c,e,s,n)).filter(ii);if(h.length===1&&h[0]?.nodeDatum!==r.ctx.highlightManager.getActiveHighlight()){this.dispatchHighlightUpdate(r,h[0].nodeDatum),l=!0;break}}l||(Zo("ChartSync.findMatchingHighlightNodes() - no matching nodes",r.id,o),this.dispatchHighlightUpdate(r))}}findMatchingNodes(e,t,i,s){return n=>{const o=n.getKeys(e.direction);if(e.keys.length&&!e.keys.some(d=>o.includes(d)))return;const a=n.contextNodeData?.nodeData??[];if(!a?.length)return;const r=a[0],l=`${t}Key`;if(!mJ(r,l))return;const c=r[l],h=a.find(d=>{const u=d.datum[c];return i?u.getTime()===s:u===s});return h?{series:n,nodeDatum:h}:null}}dispatchHighlightUpdate(e,t){Zo("ChartSync.dispatchHighlightUpdate()",e.id,t),e.ctx.highlightManager.updateHighlight(`${e.id}-sync`,t);const i=t?.series.tooltipEnabled??e.tooltip.enabled;if(t&&i){const s=e.seriesAreaBoundingBox,n=s.x+(t.midPoint?.x??t.point?.x??0),o=s.y+(t.midPoint?.y??t.point?.y??0),a=yJ.makeTooltipMeta({type:"pointermove",canvasX:n,canvasY:o},t.series,t,void 0);e.ctx.tooltipManager.updateTooltip(`${e.id}-sync`,a,e.getTooltipContent(t.series,t.datumIndex,t))}else e.ctx.tooltipManager.removeTooltip(`${e.id}-sync`);this.updateChart(e,Ab.SERIES_UPDATE)}async getSyncedDomain(e){if(!fI.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{groupState:t,directionDomains:i,domainsByKey:s,positionDomains:n}=this.updateDomainState(e);return this.validateAxis(e,t),await this.waitForDomainsToBeReady(),this.domainMode==="position"?this.calculateDerivedDomain(e,n):this.domainMode==="direction"||e.keys.length===0?this.calculateDerivedDomain(e,i):this.calculateKeyDerivedDomain(e,s)}updateDomainState(e){var t,i,s,n,o;const{syncManager:a}=this.moduleContext,r=a.getChart().id,l=e.id,c=a.getGroupState(this.groupId);if(!c)throw new Error("AG Charts - no GroupState for groupId: "+this.groupId);const h=c.domains??(c.domains={}),d=h[t=e.direction]??(h[t]={derived:[],sources:{},dirty:!0}),u=(i=d.sources)[r]??(i[r]={});u[l]=e.dataDomain.domain,d.dirty=!0;const p=c.domainsByKey??(c.domainsByKey={});for(const m of e.keys??[]){const b=p[m]??(p[m]={derived:[],sources:{},dirty:!0}),v=(s=b.sources)[r]??(s[r]={});v[l]=e.dataDomain.domain,b.dirty=!0}const g=c.domainsByPosition??(c.domainsByPosition={}),f=g[n=e.position]??(g[n]={derived:[],sources:{},dirty:!0}),x=(o=f.sources)[r]??(o[r]={});return x[l]=e.dataDomain.domain,f.dirty=!0,{groupState:c,directionDomains:d,domainsByKey:p,positionDomains:f}}validateAxis(e,t){const i=this.moduleContext.syncManager.getGroupSyncMode(this.groupId)==="multi-series";mI(this.axes).includes(e.direction)&&(i?this.validateMultiSeries(e,t):this.validateSingleSeries(e,t))}validateMultiSeries(e,t){const{min:i,max:s,nice:n,reverse:o}=e,a=new Set(e.boundSeries.flatMap(r=>r.getKeys(e.direction)));for(const r of t.members){const{axes:l,modulesManager:c}=r,h=mI(c.getModule("sync")?.axes),d=l.filter(p=>h.includes(p.direction)).filter(p=>p.boundSeries.some(g=>g.getKeys(p.direction).some(f=>a.has(f))));if(d.length===0)continue;const[u]=d;if(u.min!==i||u.max!==s||u.nice!==n||u.reverse!==o){X.warnOnce("To allow synchronization, ensure that all synchronized axes with matching keys have matching min, max, nice, and reverse properties."),this.enabled=!1;return}}}validateSingleSeries(e,t){const i=t.members,[{axes:s}]=i,{direction:n,min:o,max:a,nice:r,reverse:l}=e;for(const c of s)if(n===c.direction&&(r!==c.nice||l!==c.reverse||o!==c.min&&(Ye(o)||Ye(c.min))||a!==c.max&&(Ye(a)||Ye(c.max)))){X.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),this.enabled=!1;return}}calculateDerivedDomain(e,t){if(!t.dirty)return t.derived;const i=t.derived;return t.derived=Gv(Object.values(t.sources).map(s=>Object.values(s)).flat(2)),yI.is(e.scale)&&(t.derived=Ib(t.derived)),t.dirty=!1,aB(e.scale,i,t.derived)&&(Zo(e.id,"updated",e.keys,{before:i,after:t.derived}),this.updateSiblings()),t.derived}calculateKeyDerivedDomain(e,t){let i=[],s=[],n=!1;for(const o of e.keys??[]){const a=t[o],r=a.derived;if(i.push(...r),!a.dirty){s.push(...a.derived);continue}a.derived=Gv(Object.values(a.sources).map(l=>Object.values(l)).flat(2)),yI.is(e.scale)&&(a.derived=Ib(a.derived)),s.push(...a.derived),a.dirty=!1,n||(n=!jn(r,a.derived))}return yI.is(e.scale)&&(i=Ib(i),s=Ib(s)),n&&aB(e.scale,i,s)&&(Zo(e.id,"updated",e.keys,{before:i,after:s}),this.updateSiblings()),s}removeAxis(e){if(!fI.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{syncManager:t}=this.moduleContext,i=t.getGroupState(this.groupId),s=t.getChart().id,n=e.id;delete i?.domains?.[e.direction]?.sources?.[s]?.[n];for(const o of e.keys??[])delete i?.domainsByKey?.[o]?.sources?.[s]?.[n];delete i?.domainsByPosition?.[e.position]?.sources?.[s]?.[n]}async waitForDomainsToBeReady(){const{syncManager:e}=this.moduleContext;let t=0;for(;e.getGroupMembers(this.groupId).some(i=>i.syncStatus==="init");)Zo("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated",this.groupId),await this.domainSync.await(),t++;t>0&&Zo("ChartSync.waitForDomainsToBeReady() - waited for",t,"iterations"),this.domainSync.notify()}prepareZoomUpdate(){const{zoomManager:e}=this.moduleContext,t=e.getZoom();return this.axes==="x"?delete t?.y:this.axes==="y"&&delete t?.x,Ss(t)}onEnabledChange(){const{syncManager:e}=this.moduleContext;this.enabled?e.subscribe(this.groupId):e.unsubscribe(this.groupId),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(e,t){if(!this.enabled||e===t)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(t),i.subscribe(e),this.updateSiblings(t),this.updateSiblings(e)}onAxesChange(){if(!this.enabled)return;const{syncManager:e}=this.moduleContext;this.updateChart(e.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:e}=this.moduleContext;e.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};Wl.className="Sync",y([mu,yu(e=>e.onEnabledChange())],Wl.prototype,"enabled",2),y([mu,yu((e,t,i)=>e.onGroupIdChange(t,i))],Wl.prototype,"groupId",2),y([mu,yu(e=>e.onAxesChange())],Wl.prototype,"axes",2),y([mu,yu(e=>e.onNodeInteractionChange())],Wl.prototype,"nodeInteraction",2),y([mu,yu(e=>e.onZoomChange())],Wl.prototype,"zoom",2),y([mu,yu(e=>e.onAxesChange())],Wl.prototype,"domainMode",2);var xJ={type:"root",optionsKey:"sync",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Wl(e),themeTemplate:{sync:{enabled:!1}}},{Property:rB}=A,lB="#2196f3",bJ="#8a8a8a",kb=class extends A.Rect{constructor(){super(...arguments),this.fill=lB,this.fillOpacity=.2,this.zIndex=A.ZIndexMap.ZOOM_SELECTION}updateValid(){this.fill=lB}updateInvalid(){this.fill=bJ}};kb.className="ZoomRect",y([rB],kb.prototype,"fill",2),y([rB],kb.prototype,"fillOpacity",2);var vJ=class{update(e,t,i,s,n,o){return this.oldZoom??(this.oldZoom=Ss(t===A.ChartAxisDirection.X?{...n,x:o}:{...n,y:o})),this.updateCoords(e.offsetX,e.offsetY),this.updateZoom(t,i,s)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(e,t){this.coords?(this.coords.x2=e,this.coords.y2=t):this.coords={x1:e,y1:t,x2:e,y2:t}}updateZoom(e,t,i){const{coords:s,oldZoom:n}=this;let o=Ss(n);if(!s||!n)return e===A.ChartAxisDirection.X?o.x:o.y;const a=Pr(i,s.x1,s.y1),r=Pr(i,s.x2,s.y2);if(e===A.ChartAxisDirection.X){const c=(r.x-a.x)*es(n);return o.x.max+=c,o.x=En(o.x,n.x,t,a.x),o=vo(o),o.x}const l=(r.y-a.y)*Nn(n);return o.y.max-=l,o.y=En(o.y,n.y,t,a.y),o=vo(o),o.y}},SJ=class{constructor(e,t,i,s,n,o,a,r){this.eventsHub=e,this.contextMenuRegistry=t,this.zoomManager=i,this.getModuleProperties=s,this.canResetZoom=n,this.getRect=o,this.updateZoom=a,this.isZoomValid=r}registerActions(e){const{contextMenuRegistry:t}=this;if(e)t.setVisible("zoom-to-cursor",!0),t.setVisible("pan-to-cursor",!0),t.setVisible("reset-zoom",!0);else{t.setVisible("zoom-to-cursor",!1),t.setVisible("pan-to-cursor",!1),t.setVisible("reset-zoom",!1);return}t.builtins.items["zoom-to-cursor"].action=this.onZoomToHere.bind(this),t.builtins.items["pan-to-cursor"].action=this.onPanToHere.bind(this),t.builtins.items["reset-zoom"].action=this.onResetZoom.bind(this);const i=o=>{const a=this.getRect();if(!a)return!0;const r=Pr(a,o.x,o.y);return this.iterateFindNextZoomAtPoint(r)!=null},s=()=>!ef(Ss(this.zoomManager.getZoom()),pI()),n=this.eventsHub.on("context-menu:setup",o=>{t.builtins.items["zoom-to-cursor"].enabled=i(o),t.builtins.items["pan-to-cursor"].enabled=s(),t.builtins.items["reset-zoom"].enabled=this.canResetZoom()});return()=>{n(),t.setVisible("zoom-to-cursor",!1),t.setVisible("pan-to-cursor",!1),t.setVisible("reset-zoom",!1)}}computeOrigin(e){const t=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!t||!e?.target||!(e instanceof MouseEvent))return;const s={x:0,y:0,width:t.width,height:t.height};return Pr(s,e.offsetX,e.offsetY)}onZoomToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=this.iterateFindNextZoomAtPoint(t);i!=null&&this.updateZoom(i)}onPanToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=Ss(this.zoomManager.getZoom()),s=es(i),n=Nn(i),o=t.x*s,a=t.y*n,r=xh/2;let l={x:{min:t.x-r,max:t.x+r},y:{min:t.y-r,max:t.y+r}};l=nB(l,s,n),l=bh(l,i.x.min-t.x+o,i.y.min-t.y+a),this.updateZoom(vo(l))}onResetZoom(e){this.zoomManager.resetZoom("zoom")}iterateFindNextZoomAtPoint(e){const{scrollingStep:t}=this.getModuleProperties();for(let i=t;i<=1-t;i+=t){const s=this.getNextZoomAtPoint(e,i);if(this.isZoomValid(s))return s}}getNextZoomAtPoint(e,t){const{isScalingX:i,isScalingY:s}=this.getModuleProperties(),n=Ss(this.zoomManager.getZoom()),o=e.x*es(n),a=e.y*Nn(n),r=xh/2;let l={x:{min:e.x-r,max:e.x+r},y:{min:e.y-r,max:e.y+r}};return l=nB(l,i?es(n)*t:xh,s?Nn(n)*t:xh),l=bh(l,n.x.min-e.x+o,n.y.min-e.y+a),vo(l)}},{ChartAxisDirection:cB}=A,MJ=class{constructor(e){this.axesHandlers=e,this.axes=[]}destroy(){this.axes.forEach(e=>e.div.destroy())}update(e,t,i){if(this.axes.forEach(l=>l.div.setHidden(!e&&!t)),!e&&!t)return;const{X:s,Y:n}=cB,o=[...i.axisManager.getAxisContext(s),...i.axisManager.getAxisContext(n)],{removed:a,added:r}=this.diffAxisIds(o);a.length>0&&(this.axes=this.axes.filter(l=>a.includes(l.axisId)?(l.div.destroy(),!1):!0));for(const l of r){const{axisId:c,direction:h}=l;this.axes.push(this.initAxis(i,c,this.axesHandlers,h))}for(const l of this.axes){const h=o.find(d=>d.axisId===l.axisId).getCanvasBounds();l.div.setHidden(vG(h)),h!==void 0&&l.div.setBounds(h)}}setAxisCursor(e){this.cursor=e;for(const t of this.axes)t.div.setCursor(this.getCursor(t.direction))}toggleAxisDraggingCursor(e,t){for(const i of this.axes)i.direction===e&&i.div.setCursor(t?this.getCursor(e):void 0)}getCursor(e){return this.cursor?this.cursor:e===cB.X?"ew-resize":"ns-resize"}initAxis(e,t,i,s){const n="afterend",o=e.proxyInteractionService.createProxyElement({type:"region",domManagerId:t,where:n});return o.setCursor(this.getCursor(s)),o.addListener("drag-start",a=>{a.device==="touch"&&a.sourceEvent.preventDefault(),i.onAxisDragStart(s)}),o.addListener("drag-move",a=>i.onAxisDragMove(t,s,a)),o.addListener("drag-end",i.onAxisDragEnd),o.addListener("dblclick",()=>i.onAxisDoubleClick(t,s)),o.addListener("wheel",a=>i.onAxisWheel(t,s,a)),{axisId:t,div:o,direction:s}}diffAxisIds(e){const t=this.axes.map(o=>o.axisId),i=e.map(o=>o.axisId),s=t.filter(o=>!i.includes(o)),n=e.filter(o=>!t.includes(o.axisId));return{removed:s,added:n}}},hB=16,DJ={off:1,short:.01,long:.002},AJ=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:e}=this;return Math.max(typeof e=="number"?e:DJ[e]??1,1e-4)}addListener(e,t){return this.onUpdate=t,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(e){this.updateCoords(e.currentX,e.currentY);const{x1:t=0,y1:i=0,x2:s=0,y2:n=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:this.isPanningX()?t-s:0,deltaY:this.isPanningY()?i-n:0})}start(e){this.direction=e,this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:e}=this;let t=0,i=0,s=0;if(e.length>0){const n=this.zoomCoordsHistoryIndex%hB;let o=n-1;o<0&&(o=e.length-1);let a=n;a>=e.length&&(a=0);const r=e[o],l=e[a];t=this.isPanningX()?r.x-l.x:0,i=this.isPanningY()?r.y-l.y:0,s=r.t-l.t}if(this.coords=void 0,this.direction=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,s>0&&this.decelerationValue<1){const n=t/s,o=i/s,a=Math.hypot(n,o),r=Math.atan2(o,n),l=performance.now();this.inertiaHandle=Ze().requestAnimationFrame(c=>{this.animateInertia(c,c,l,a,r)})}}recordCurrentZoomCoords(){const{coords:e,coordsHistory:t,zoomCoordsHistoryIndex:i}=this;if(!e)return;const{x2:s,y2:n}=e,o=Date.now();t[i%hB]={x:s,y:n,t:o},this.zoomCoordsHistoryIndex+=1}animateInertia(e,t,i,s,n){const o=1-this.decelerationValue,a=-s/Math.log(o),r=s*(o**(t-i)-1)/Math.log(o),l=s*(o**(e-i)-1)/Math.log(o);this.onUpdate?.({type:"update",deltaX:this.isPanningX()?-Math.cos(n)*(l-r):0,deltaY:this.isPanningY()?-Math.sin(n)*(l-r):0}),!(l>=a-1)&&(this.inertiaHandle=requestAnimationFrame(c=>{this.animateInertia(c,e,i,s,n)}))}updateCoords(e,t){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:e,y2:t}:this.coords={x1:e,y1:t,x2:e,y2:t}}isPanningX(){return this.direction==null||this.direction===A.ChartAxisDirection.X}isPanningY(){return this.direction==null||this.direction===A.ChartAxisDirection.Y}translateZooms(e,t,i,s){const n=Pr(e,e.x+Math.abs(i),e.y+e.height-Math.abs(s)),o=Math.sign(i)*n.x,a=-Math.sign(s)*n.y,r={};for(const[l,{direction:c,zoom:h}]of Et(t)){if(h&&h.min===bo&&h.max===Rs)continue;let d=Ss({[c]:h});d=vo(bh(d,o*es(d),a*Nn(d))),r[l]={direction:c,zoom:d[c]}}return r}},IJ=200,kJ=class{update(e,t,i,s){const n=e.deltaX*t*IJ;return this.translateZooms(i,s,n)}translateZooms(e,t,i){const s={},n=Pr(e,e.x+Math.abs(i),0),o=i<0?-n.x:n.x;for(const[a,{direction:r,zoom:l}]of Et(t)){if(r!==A.ChartAxisDirection.X)continue;let c=Ss({x:l});c=vo(bh(c,o*es(c),0)),s[a]={direction:r,zoom:c.x}}return s}},CJ=class{updateAxes(e,t,i,s){const n=e.sourceEvent,o={},{anchorPointX:a,anchorPointY:r,isScalingX:l,isScalingY:c,scrollingStep:h}=t,d=Pr(i,n.offsetX??n.clientX,n.offsetY??n.clientY);for(const[u,{direction:p,zoom:g}]of Et(s)){if(g==null)continue;let f={...g};const x=h*e.deltaY*(g.max-g.min);if(p===A.ChartAxisDirection.X&&l)f.max+=x,f=En(f,g,a,d.x);else if(p===A.ChartAxisDirection.Y&&c)f.max+=x,f=En(f,g,r,d.y);else continue;o[u]={direction:p,zoom:Db(f)}}return o}update(e,t,i,s){const{anchorPointX:n,anchorPointY:o,isScalingX:a,isScalingY:r,scrollingStep:l}=t,c=e.offsetX+i.x,h=e.offsetY+i.y,d=Pr(i,c,h),u=e.deltaY;let p=Ss(s);if(p.x.max+=a?l*u*es(s):0,p.y.max+=r?l*u*Nn(s):0,!(p.x.max<p.x.min||p.y.max<p.y.min))return a&&(p.x=En(p.x,s.x,n,d.x)),r&&(p.y=En(p.y,s.y,o,d.y)),p=vo(p),p}updateDelta(e,t,i){const{anchorPointX:s,anchorPointY:n,isScalingX:o,isScalingY:a,scrollingStep:r}=t;let l=Ss(i);return l.x.max+=o?r*-e*es(i):0,l.y.max+=a?r*-e*Nn(i):0,o&&(l.x=En(l.x,i.x,s)),a&&(l.y=En(l.y,i.y,n)),l=vo(l),l}},TJ=class{constructor(e,t,i){this.rect=e,this.getZoom=t,this.isZoomValid=i,this.rect.visible=!1}update(e,t,i){const s=e.currentX+(i?.x??0),n=e.currentY+(i?.y??0);this.rect.visible=!0,this.updateCoords(s,n,t,i),this.updateRect(i)}stop(e,t,i){let s=Ss();if(!e||!t)return s;this.coords&&(s=this.createZoomFromCoords(t,i));const n=t.width/e.width,o=t.height/e.height;return s=vo(uJ(s,n,o)),this.reset(),s}reset(){this.coords=void 0,this.rect.visible=!1}didUpdate(){return this.rect.visible&&this.rect.width>0&&this.rect.height>0}updateCoords(e,t,i,s){if(!this.coords){this.coords={x1:e,y1:t,x2:e,y2:t};return}const{coords:n}=this;if(n.x2=e,n.y2=t,!s)return;const{isScalingX:o,isScalingY:a,keepAspectRatio:r}=i,l=this.getNormalisedDimensions();if(r&&o&&a){const c=s.width/s.height;n.y2<n.y1?n.y2=Math.min(n.y1-l.width/c,n.y1):n.y2=Math.max(n.y1+l.width/c,n.y1)}o||(n.x1=s.x,n.x2=s.x+s.width),a||(n.y1=s.y,n.y2=s.y+s.height)}updateRect(e){if(!e)return;const{rect:t}=this,i=this.getNormalisedDimensions(),{width:s,height:n}=i;let{x:o,y:a}=i;o=Math.max(o,e.x),o-=Math.max(0,o+s-(e.x+e.width)),a=Math.max(a,e.y),a-=Math.max(0,a+n-(e.y+e.height)),t.x=o,t.y=a,t.width=s,t.height=n;const r=this.createZoomFromCoords(e,this.getZoom());this.isZoomValid(r)?t.updateValid():t.updateInvalid()}createZoomFromCoords(e,t){const i=Ss(t),s=this.getNormalisedDimensions(),n=Pr(e,s.x,s.y+s.height),o=s.width/e.width,a=s.height/e.height;let r=Mb(i,o,a);const l=n.x*es(i),c=n.y*Nn(i);return r=bh(r,l,c),r=vo(r),r}getNormalisedDimensions(){const{x1:e=0,y1:t=0,x2:i=0,y2:s=0}=this.coords??{},n=e<=i?e:i,o=t<=s?t:s,a=e<=i?i-e:e-i,r=t<=s?s-t:t-s;return{x:n,y:o,width:a,height:r}}},{ActionOnSet:dB,BaseProperties:LJ,ChartAxisDirection:wJ,NativeWidget:NJ,PropertiesArray:EJ,Toolbar:OJ,ToolbarButtonProperties:PJ,Property:Sh}=A,xI=class extends PJ{};y([Sh],xI.prototype,"value",2),y([Sh],xI.prototype,"section",2);var xu=class extends LJ{constructor(e,t,i,s,n,o,a){super(),this.ctx=e,this.getModuleProperties=t,this.canResetZoom=i,this.updateZoom=s,this.updateAxisZoom=n,this.resetZoom=o,this.isZoomValid=a,this.enabled=!1,this.buttons=new EJ(xI),this.visible="hover",this.verticalSpacing=10,this.detectionRange=38,this.cleanup=new mt,this.container=new NJ(ke("div")),this.container.addClass("ag-charts-zoom-buttons"),e.domManager.addChild("canvas-overlay","zoom-buttons",this.container.getElement()),this.toolbar=new OJ(e,"ariaLabelZoomToolbar","horizontal"),this.container.addChild(this.toolbar),this.toolbar.getElement().style.transform="translateY(54px)",this.toggleVisibility(this.visible==="always"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("button-focused",this.onButtonFocus.bind(this)),e.widgets.containerWidget.addListener("mousemove",this.onHover.bind(this)),e.widgets.containerWidget.addListener("mouseleave",this.onLeave.bind(this)),e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),this.teardown.bind(this))}destroy(){this.cleanup.flush()}toggleVisibleZoomed(e){this.visible==="zoomed"&&this.toggleVisibility(!e)}teardown(){this.ctx.domManager.removeChild("canvas-overlay","zoom-buttons"),this.container.destroy()}onLayoutComplete(e){const{buttons:t,container:i}=this,{rect:s}=e.series;for(const o of t)if(o.tooltip==null&&o.label==null){const a={"pan-end":"toolbarZoomPanEnd","pan-left":"toolbarZoomPanLeft","pan-right":"toolbarZoomPanRight","pan-start":"toolbarZoomPanStart","zoom-in":"toolbarZoomZoomIn","zoom-out":"toolbarZoomZoomOut",reset:"toolbarZoomReset"};o.tooltip=a[o.value]}this.toolbar.updateButtons(t),this.toggleButtons();const n=i.getBounds().height;i.setBounds({y:s.y+s.height-n})}onHover(e){if(!this.enabled||this.visible!=="hover"||this.toolbar.isHidden())return;const{container:t,detectionRange:i,ctx:{scene:s}}=this,{currentY:n,sourceEvent:{target:o}}=e,a=t.getElement(),r=a.offsetTop-i,l=n>r&&n<s.canvas.element.offsetHeight||o===a;this.toggleVisibility(l)}onLeave(){this.visible==="hover"&&this.toggleVisibility(!1)}toggleVisibility(e,t=!1){const{container:i,toolbar:s,verticalSpacing:n}=this;s.toggleClass("ag-charts-zoom-buttons__toolbar--hidden",!e);const o=s.getElement();o.style.transitionDuration=t?"0s":"",o.style.transform=e?"translateY(0)":`translateY(${i.getBounds().height+n}px)`}toggleButtons(){const e=Ss(this.ctx.zoomManager.getZoom());if(!(this.previousZoom&&ef(this.previousZoom,e))){this.previousZoom=e;for(const[t,i]of this.buttons.entries()){let s=!0;switch(i?.value){case"pan-start":s=e.x.min>bo;break;case"pan-end":s=e.x.max<Rs;break;case"pan-left":s=e.x.min>bo;break;case"pan-right":s=e.x.max<Rs;break;case"zoom-out":s=!ef(e,pI());break;case"zoom-in":s=this.isZoomValid(this.getNextZoomStateUnified("zoom-in",e,this.getModuleProperties()));break;case"reset":s=this.canResetZoom(e);break}this.toolbar.toggleButtonEnabledByIndex(t,s)}}}onButtonPress({button:e}){if(!this.enabled||this.toolbar.isHidden())return;const t=this.getModuleProperties();if(t.independentAxes&&e.value!=="reset"){const i=this.ctx.zoomManager.getAxisZooms();for(const[s,{direction:n,zoom:o}]of Et(i))o!=null&&this.onButtonPressAxis(e,t,s,n,o)}else this.onButtonPressUnified(e,t)}onButtonFocus(e){this.toggleVisibility(!0,!0)}onButtonPressAxis(e,t,i,s,n){const{isScalingX:o,isScalingY:a,scrollingStep:r}=t;let l={...n};const c=n.max-n.min;switch(e.value){case"pan-start":l.max=c,l.min=0;break;case"pan-end":l.min=l.max-c,l.max=Rs;break;case"pan-left":l.min-=c*r,l.max-=c*r;break;case"pan-right":l.min+=c*r,l.max+=c*r;break;case"zoom-in":case"zoom-out":{const h=s===wJ.X,d=h&&o||!h&&a;let u=e.value==="zoom-in"?1-r:1+r;d||(u=1);const p=h?this.getAnchorPointX(t):this.getAnchorPointY(t);l.max=l.min+(l.max-l.min)*u,l=En(l,n,p);break}}this.updateAxisZoom(i,s,Db(l))}onButtonPressUnified(e,t){const{scrollingStep:i}=t,s=Ss(this.ctx.zoomManager.getZoom());let n=Ss(s);switch(e.value){case"reset":this.resetZoom();return;case"pan-start":n.x.max=es(n),n.x.min=0;break;case"pan-end":n.x.min=Rs-es(n),n.x.max=Rs;break;case"pan-left":n=bh(n,-es(n)*i,0);break;case"pan-right":n=bh(n,es(n)*i,0);break;case"zoom-in":case"zoom-out":{n=this.getNextZoomStateUnified(e.value,s,t);break}}this.updateZoom(vo(n))}getNextZoomStateUnified(e,t,i){const{isScalingX:s,isScalingY:n,scrollingStep:o}=i,a=e==="zoom-in"?1-o:1+o,r=Mb(t,s?a:1,n?a:1);return r.x=En(r.x,t.x,this.getAnchorPointX(i)),r.y=En(r.y,t.y,this.getAnchorPointY(i)),r}getAnchorPointX(e){const t=this.anchorPointX??e.anchorPointX;return t==="pointer"?tB:t}getAnchorPointY(e){const t=this.anchorPointY??e.anchorPointY;return t==="pointer"?iB:t}};y([Sh,dB({changeValue(e){this.toolbar?.setHidden(!e)}})],xu.prototype,"enabled",2),y([Sh],xu.prototype,"buttons",2),y([Sh,dB({changeValue(e,t){t!=null&&this.toggleVisibility(e==="always")}})],xu.prototype,"visible",2),y([Sh],xu.prototype,"anchorPointX",2),y([Sh],xu.prototype,"anchorPointY",2);var Mh=1e6;function Cb({min:e,max:t},i,s,n){return n===0?0:Mh*((i-s)/n*(t-e)+e)}function RJ(e,t,i,s,n,o){[e,t]=[Math.min(e,t),Math.max(e,t)],[i,s]=[Math.min(i,s),Math.max(i,s)];const a=Mh*(i-n)/o,r=Mh*(s-n)/o,l=(i-n)/(s-n),c=(e-l*t)/(Mh-a+l*(r-Mh)),h=(t+(r-Mh)*c)/r;return{min:c,max:h}}function uB(e,t,i,s){t===0&&(t=30),s===0&&(s=30);const n=e-t,o=e+t,a=i-s,r=i+s;return!(o<a||r<n)}var BJ=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(e,t,i){if(e.sourceEvent.targetTouches.length!==2)return!1;e.sourceEvent.preventDefault();const s=Array.from(e.sourceEvent.targetTouches),{x:n,y:o,width:a,height:r}=t.getBoundingClientRect();this.initialZoom.x.min=i.x?.min??0,this.initialZoom.x.max=i.x?.max??1,this.initialZoom.y.min=i.y?.min??0,this.initialZoom.y.max=i.y?.max??1,this.touchStart.origins.forEach(g=>g.identifier=0),this.previous.a1=NaN,this.previous.a2=NaN,this.previous.b1=NaN,this.previous.b2=NaN;for(const g of[0,1]){const f=s[g].clientX,x=o+r-s[g].clientY;this.touchStart.origins[g].identifier=s[g].identifier,this.touchStart.origins[g].normalX=Cb(this.initialZoom.x,f,n,a),this.touchStart.origins[g].normalY=Cb(this.initialZoom.y,x,o,r)}const[l,c]=s,[h,d]=this.touchStart.origins,u=uB(l.clientX,l.radiusX,c.clientX,c.radiusX);return uB(l.clientY,l.radiusY,c.clientY,c.radiusY)&&(h.normalY=d.normalY=(h.normalY+d.normalY)/2),u&&(h.normalX=d.normalX=(h.normalX+d.normalX)/2),!0}update(e,t){e.sourceEvent.preventDefault();const i=Array.from(e.sourceEvent.targetTouches),{x:s,y:n,width:o,height:a}=t.getBoundingClientRect(),{origins:r}=this.touchStart,l=[0,1].map(m=>i.find(b=>b.identifier===r[m].identifier)),c=r[0].normalX,h=r[1].normalX,d=l[0].clientX,u=l[1].clientX,p=r[0].normalY,g=r[1].normalY,f=n+a-l[0].clientY,x=n+a-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,d,u,p,g,f,x,s,n,o,a)}end(e){const t=Array.from(e.sourceEvent.targetTouches).map(i=>i.identifier);return!t.includes(this.touchStart.origins[0].identifier)||!t.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(e,t,i,s,n,o,a,r,l,c,h,d){const{initialZoom:u,previous:p}=this,g=pB(e,t,i,s,p,"a1","a2",l,h,u.x),f=pB(n,o,a,r,p,"b1","b2",c,d,u.y);return{x:g,y:f}}};function pB(e,t,i,s,n,o,a,r,l,c){if(e!=t){const h=n[o],d=n[a];return Math.abs(i-h)+Math.abs(s-d)<=1?(i=h,s=d):(n[o]=i,n[a]=s),RJ(e,t,i,s,r,l)}else{const h=Cb(c,i,r,l),d=Cb(c,s,r,l),u=(h+d)/2,p=(e-u)/Mh;return{min:c.min+p,max:c.max+p}}}var{ActionOnSet:Dh,ChartAxisDirection:Rr,ChartUpdateType:bI,Property:li,InteractionState:tf,ProxyProperty:FJ}=A,Tb=e=>Uv(e,10),vI="zoom-cursor",sf="zoom-tooltip",SI=class extends A.BaseProperties{constructor(e){super(),this.onChange=e,this.enabled=!1,this.padding=0}};y([li,Dh({changeValue(e){this.onChange({enabled:e,padding:this.padding})}})],SI.prototype,"enabled",2),y([li,Dh({changeValue(e){this.onChange({enabled:this.enabled,padding:e})}})],SI.prototype,"padding",2);var vi=class extends A.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.enableAxisDragging=!0,this.enableAxisScrolling=!1,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=xh/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=tB,this.anchorPointY=iB,this.autoScaling=new SI(i=>{this.ctx.zoomManager.setAutoScaleYAxis(i.enabled,i.padding)}),this.axisDraggingMode="zoom",this.canResetZoom=i=>(i??(i=this.getZoom()),!ef(i,this.getResetZoom())),this.buttons=new xu(this.ctx,this.getModuleProperties.bind(this),this.canResetZoom,this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.axisDragger=new vJ,this.panner=new AJ,this.scroller=new CJ,this.scrollPanner=new kJ,this.twoFingers=new BJ,this.deceleration="short",this.dragState=0,this.isState=i=>this.ctx.interactionManager.isState(i),this.destroyContextMenuActions=void 0,this.isFirstWheelEvent=!0,this.debouncedWheelReset=tG(()=>{this.isFirstWheelEvent=!0},100);const t=new kb;this.selector=new TJ(t,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new SJ(e.eventsHub,e.contextMenuRegistry,e.zoomManager,this.getModuleProperties.bind(this),this.canResetZoom,()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this)),this.domProxy=new MJ({onAxisDragStart:i=>this.onAxisDragStart(i),onAxisDragMove:(i,s,n)=>this.onAxisDragMove(i,s,n),onAxisDragEnd:()=>this.onAxisDragEnd(),onAxisDoubleClick:i=>this.onAxisDoubleClick(i),onAxisWheel:(i,s,n)=>this.onAxisWheel(i,s,n)}),e.widgets.seriesDragInterpreter&&this.cleanup.register(e.widgets.seriesDragInterpreter.events.on("dblclick",i=>this.onSeriesAreaDoubleClick(i)),e.widgets.seriesDragInterpreter.events.on("drag-move",i=>this.onSeriesAreaDragMove(i)),e.widgets.seriesDragInterpreter.events.on("drag-start",i=>this.onSeriesAreaDragStart(i)),e.widgets.seriesDragInterpreter.events.on("drag-end",()=>this.onSeriesAreaDragEnd())),this.cleanup.register(e.scene.attachNode(t),e.eventsHub.on("series:keynav-zoom",i=>this.onNavZoom(i)),e.widgets.seriesWidget.addListener("wheel",i=>this.onWheel(i)),e.widgets.seriesWidget.addListener("touchstart",(i,s)=>this.onTouchStart(i,s)),e.widgets.seriesWidget.addListener("touchmove",(i,s)=>this.onTouchMove(i,s)),e.widgets.seriesWidget.addListener("touchend",i=>this.onTouchEnd(i)),e.widgets.seriesWidget.addListener("touchcancel",i=>this.onTouchEnd(i)),e.updateService.addListener("process-data",i=>this.onProcessData(i)),e.eventsHub.on("layout:complete",i=>this.onLayoutComplete(i)),e.eventsHub.on("zoom:change",i=>this.onZoomChange(i)),e.eventsHub.on("zoom:pan-start",i=>this.onZoomPanStart(i)),this.panner.addListener("update",i=>this.onPanUpdate(i)),()=>this.teardown())}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.(),this.domProxy.destroy()}onEnabledChange(e){this.ctx.zoomManager.setZoomModuleEnabled(e),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(e))}isIgnoredTouch(e){return e?.device!=="touch"?!1:this.ctx.chartService.touch.dragAction!=="drag"?!0:this.enableSelecting?!1:this.enablePanning?gI(this.getZoom()):!0}onSeriesAreaDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i}=this;!t||!i||e?.preventZoomDblClick||!this.isState(tf.ZoomClickable)||this.resetZoom()}onSeriesAreaDragStart(e){const{enabled:t,enablePanning:i,enableSelecting:s,ctx:{domManager:n,zoomManager:o}}=this;if(!t||!this.isState(tf.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(e))return;this.panner.stopInteractions();let a=0;const r=this.isPanningKeyPressed(e.sourceEvent);i&&(!s||r)?(n.updateCursor(vI,"grabbing"),a=2,this.panner.start()):s&&!r&&(a=3),(this.dragState=a)!==0&&o.fireZoomPanStartEvent("zoom")}onSeriesAreaDragMove(e){const{dragState:t,enabled:i,paddedRect:s,panner:n,selector:o,ctx:{interactionManager:a,tooltipManager:r,updateService:l}}=this;if(!(!i||!s||!this.isState(tf.ZoomDraggable)||this.isIgnoredTouch(e))){switch(a.pushState(A.InteractionState.ZoomDrag),e.device==="touch"&&e.sourceEvent.preventDefault(),t){case 2:n.update(e);break;case 3:o.update(e,this.getModuleProperties(),s);break;case 0:return}r.updateTooltip(sf),l.update(bI.PERFORM_LAYOUT,{skipAnimations:!0})}}onSeriesAreaDragEnd(){const{dragState:e,enabled:t,panner:i,selector:s,ctx:{domManager:n,interactionManager:o,tooltipManager:a}}=this;if(o.popState(A.InteractionState.ZoomDrag),!(!t||e===0)){switch(e){case 2:i.stop();break;case 3:{if(!s.didUpdate())break;const r=this.getZoom(),l=s.stop(this.seriesRect,this.paddedRect,r);this.updateZoom(l);break}}this.dragState=0,n.updateCursor(vI),a.removeTooltip(sf)}}onAxisDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i,ctx:{zoomManager:s}}=this;!t||!i||!this.isState(tf.ZoomClickable)||s.resetAxisZoom("zoom",e)}onAxisDragStart(e){const{axisDraggingMode:t,domProxy:i,enabled:s,enableAxisDragging:n,panner:o,ctx:{zoomManager:a}}=this;!s||!n||(o.stopInteractions(),t==="pan"?(i.setAxisCursor("grabbing"),this.dragState=2,this.panner.start(e),a.fireZoomPanStartEvent("zoom")):this.dragState=1)}onAxisDragMove(e,t,i){const{anchorPointX:s,anchorPointY:n,axisDragger:o,dragState:a,enabled:r,enableAxisDragging:l,seriesRect:c,shouldFlipXY:h,ctx:{interactionManager:d,tooltipManager:u,updateService:p,zoomManager:g}}=this;if(!r||!l||!c)return;d.pushState(A.InteractionState.ZoomDrag),i.device==="touch"&&i.sourceEvent.preventDefault();const f=this.getZoom();if(a===2)this.panner.update({currentX:i.offsetX,currentY:i.offsetY});else{let x=t===Rr.X?s:n;h&&(x=t===Rr.X?n:s);const m=g.getAxisZoom(e),b=o.update(i,t,x,c,f,m);g.setAxisManuallyAdjusted("zoom",e),this.updateAxisZoom(e,t,b)}u.updateTooltip(sf),p.update(bI.PERFORM_LAYOUT,{skipAnimations:!0})}onAxisDragEnd(){const{axisDraggingMode:e,axisDragger:t,dragState:i,domProxy:s,enabled:n,enableAxisDragging:o,ctx:{domManager:a,interactionManager:r,tooltipManager:l}}=this;r.popState(A.InteractionState.ZoomDrag),!(!n||!o||i===0)&&(this.dragState=0,e==="pan"&&(s.setAxisCursor("grab"),this.panner.stop()),t.stop(),a.updateCursor(vI),l.removeTooltip(sf))}onNavZoom(e){const{enabled:t,enableScrolling:i,scroller:s}=this;!this.ctx.interactionManager.isState(A.InteractionState.Default)||!t||!i||(e.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(s.updateDelta(e.delta,this.getModuleProperties(),this.getZoom())))}onWheel(e){const{enabled:t,enablePanning:i,enableScrolling:s,paddedRect:n}=this;if(!t||!s||!n||!this.isState(tf.ZoomWheelable))return;const{deltaX:o,deltaY:a}=e.sourceEvent,r=o!=null&&a!=null&&Math.abs(o)>Math.abs(a);i&&r?this.onWheelPanning(e):this.onWheelScrolling(e)}onWheelPanning(e){const{scrollingStep:t,scrollPanner:i,seriesRect:s,ctx:{zoomManager:n}}=this;if(!s)return;e.sourceEvent.preventDefault();const o=i.update(e,t,s,n.getAxisZooms());for(const[a,{direction:r,zoom:l}]of Et(o))this.updateAxisZoom(a,r,l)}onWheelScrolling(e){const t=this.getZoom(),i=e.deltaY>0&&gI(t);this.handleWheelScrolling(e,i)}onAxisWheel(e,t,i){const{enableAxisScrolling:s,ctx:{zoomManager:n}}=this;if(!s||t!==Rr.X&&t!==Rr.Y)return;const o=t===Rr.X,a=!o,r=this.getModuleProperties({isScalingX:o,isScalingY:a}),l=this.getZoom(),c=i.deltaY>0&&l[t].min===bo&&l[t].max===Rs;n.setAxisManuallyAdjusted("zoom",e),this.handleWheelScrolling(i,c,r)}handleWheelScrolling(e,t,i=this.getModuleProperties()){const{enableIndependentAxes:s,scroller:n,seriesRect:o,ctx:{zoomManager:a}}=this;if(!o)return;let r=!0;if(s===!0){const l=n.updateAxes(e,i,o,a.getAxisZooms());for(const[c,{direction:h,zoom:d}]of Et(l))r&&(r=this.updateAxisZoom(c,h,d))}else{const l=n.update(e,i,o,this.getZoom());if(l==null)return;r=this.updateUnifiedZoom(l)}t||(t=e.deltaY<0&&!r),(!this.isFirstWheelEvent||!t)&&e.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}onTouchStart(e,t){!this.enableTwoFingerZoom||this.dragState!==0||this.twoFingers.start(e,t,this.getZoom())&&(this.dragState=4)}onTouchMove(e,t){if(!this.enableTwoFingerZoom||this.dragState!==4)return;const i=this.twoFingers.update(e,t);this.updateZoom(vo(i))}onTouchEnd(e){!this.enableTwoFingerZoom||this.dragState!==4||(e.sourceEvent.preventDefault(),this.twoFingers.end(e)&&(this.dragState=0))}onProcessData(e){this.shouldFlipXY=e.series.shouldFlipXY}onLayoutComplete(e){this.domProxy.update(this.enableAxisDragging,this.enableAxisScrolling,this.ctx),this.enabled&&(this.seriesRect=e.series.rect,this.paddedRect=e.series.paddedRect,this.enableAxisDragging&&this.toggleAxisDraggingCursors())}onZoomChange(e){e.callerId!=="zoom"&&this.panner.stopInteractions();const t=this.getZoom();this.buttons.toggleVisibleZoomed(gI(t))}onZoomPanStart(e){e.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(e){const{panner:t,seriesRect:i,ctx:{tooltipManager:s,zoomManager:n}}=this;if(!i)return;const o=t.translateZooms(i,n.getAxisZooms(),e.deltaX,e.deltaY);for(const[a,{direction:r,zoom:l}]of Et(o))this.updateAxisZoom(a,r,l);s.updateTooltip(sf)}isPanningKeyPressed(e){switch(this.panKey){case"alt":return e.altKey;case"ctrl":return e.ctrlKey;case"shift":return e.shiftKey;case"meta":return e.metaKey}}isScalingX(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="y":this.axes==="x"}isScalingY(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="x":this.axes==="y"}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}isZoomValid(e){const{minVisibleItems:t,ctx:{zoomManager:i}}=this;if(t===0)return!0;const s=this.getZoom(),n=Tb(es(e))<Tb(es(s)),o=Tb(Nn(e))<Tb(Nn(s));return!n&&!o?!0:i.isVisibleItemsCountAtLeast(e,t)}isAxisZoomValid(e,t){const{minVisibleItems:i,ctx:{zoomManager:s}}=this,n=this.getZoom(),o=t.max-t.min,a=n[e].max-n[e].min,r={...n,[e]:t};return o>=a||s.isVisibleItemsCountAtLeast(r,i)}resetZoom(){this.ctx.zoomManager.resetZoom("zoom")}updateSyncZoom(e){this.updateZoom(e)}updateZoom(e){this.enableIndependentAxes?this.updatePrimaryAxisZooms(e):this.updateUnifiedZoom(e)}updateUnifiedZoom(e){return this.isZoomValid(e)?(this.ctx.zoomManager.updateZoom("zoom",e),!0):(this.ctx.updateService.update(bI.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(e){this.updatePrimaryAxisZoom(e,Rr.X),this.updatePrimaryAxisZoom(e,Rr.Y)}updatePrimaryAxisZoom(e,t){const i=this.ctx.zoomManager.getPrimaryAxisId(t);i!=null&&this.updateAxisZoom(i,t,e[t])}updateAxisZoom(e,t,i){const{enableIndependentAxes:s,ctx:{zoomManager:n}}=this;if(!i)return!1;const o=this.getZoom();return s!==!0?(o[t]=i,this.updateUnifiedZoom(o)):this.isAxisZoomValid(t,i)?(n.updateAxisZoom("zoom",e,i),!0):!1}updateAxisCursor(e){if(!this.domProxy)return;const{enableAxisDragging:t=this.enableAxisDragging,enableAxisScrolling:i=this.enableAxisScrolling,axisDraggingMode:s=this.axisDraggingMode}=e;t?this.domProxy.setAxisCursor(s==="pan"?"grab":void 0):i?this.domProxy.setAxisCursor("default"):this.domProxy.setAxisCursor(void 0)}toggleAxisDraggingCursors(){const{anchorPointX:e,anchorPointY:t,domProxy:i}=this,s=this.getZoom();let n=es(s)!==xh,o=Nn(s)!==xh;if(!n){const a=Mb(s,.999,1);a.x=En(a.x,s.x,e),n=this.isZoomValid(a)}if(!o){const a=Mb(s,1,.999);a.y=En(a.y,s.y,t),o=this.isZoomValid(a)}i.toggleAxisDraggingCursor(Rr.X,n),i.toggleAxisDraggingCursor(Rr.Y,o)}getZoom(){return Ss(this.ctx.zoomManager.getZoom())}getResetZoom(){return Ss(this.ctx.zoomManager.getRestoredZoom())}getModuleProperties(e){return{anchorPointX:e?.anchorPointX??this.getAnchorPointX(),anchorPointY:e?.anchorPointY??this.getAnchorPointY(),enabled:e?.enabled??this.enabled,independentAxes:e?.independentAxes??this.enableIndependentAxes===!0,isScalingX:e?.isScalingX??this.isScalingX(),isScalingY:e?.isScalingY??this.isScalingY(),keepAspectRatio:e?.keepAspectRatio??this.keepAspectRatio,scrollingStep:e?.scrollingStep??this.scrollingStep}}};y([Dh({newValue(e){this.onEnabledChange(e)}}),li],vi.prototype,"enabled",2),y([Dh({changeValue(e){this.updateAxisCursor({enableAxisDragging:e})}}),li],vi.prototype,"enableAxisDragging",2),y([Dh({changeValue(e){this.updateAxisCursor({enableAxisScrolling:e})}}),li],vi.prototype,"enableAxisScrolling",2),y([li],vi.prototype,"enableDoubleClickToReset",2),y([Dh({changeValue(e){this.ctx.zoomManager.setIndependentAxes(!!e)}}),li],vi.prototype,"enableIndependentAxes",2),y([li],vi.prototype,"enablePanning",2),y([li],vi.prototype,"enableScrolling",2),y([li],vi.prototype,"enableSelecting",2),y([li],vi.prototype,"enableTwoFingerZoom",2),y([li],vi.prototype,"panKey",2),y([li],vi.prototype,"axes",2),y([li],vi.prototype,"scrollingStep",2),y([li],vi.prototype,"keepAspectRatio",2),y([li],vi.prototype,"minVisibleItems",2),y([li],vi.prototype,"anchorPointX",2),y([li],vi.prototype,"anchorPointY",2),y([li],vi.prototype,"autoScaling",2),y([Dh({changeValue(e){this.updateAxisCursor({axisDraggingMode:e})}}),li],vi.prototype,"axisDraggingMode",2),y([li],vi.prototype,"buttons",2),y([FJ("panner.deceleration"),li],vi.prototype,"deceleration",2);var zJ={enabled:!0,visible:"hover",buttons:[{icon:"zoom-out",value:"zoom-out",section:"scale"},{icon:"zoom-in",value:"zoom-in",section:"scale"},{icon:"pan-left",value:"pan-left",section:"pan"},{icon:"pan-right",value:"pan-right",section:"pan"},{icon:"reset",value:"reset",section:"reset"}]},_J={type:"root",optionsKey:"zoom",packageType:"enterprise",chartTypes:["cartesian","topology"],moduleFactory:e=>new vi(e),themeTemplate:{zoom:{anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:zJ,enabled:!1,enableAxisDragging:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:{$eq:[{$path:"../axes"},"x"]},padding:.05}}}};function nf(e,t,i){return A.callWithContext(e.chartService,t,i)}var{AxisInterval:GJ,AxisLabel:VJ,ZIndexMap:jJ,LinearScale:HJ,BBox:WJ,TranslatableGroup:$J,Selection:UJ,Text:YJ,CachedTextMeasurerPool:KJ,createIdsGenerator:ZJ,findMinMax:XJ,findRangeExtent:qJ,estimateTickCount:QJ}=A,MI=class wk{constructor(t,i){this.ctx=t,this.dataProvider=i,this.id=ns(this),this.axisGroup=new $J({name:`${this.id}-AxisTicks`,zIndex:jJ.AXIS}),this.labelSelection=UJ.select(this.axisGroup,YJ),this.interval=new GJ,this.label=new VJ,this.scale=new HJ,this.placement="bottom",this.translationX=0,this.translationY=0,this.padding=0}get horizontal(){return this.placement.startsWith("top")||this.placement.startsWith("bottom")}attachAxis(t){t.appendChild(this.axisGroup)}calculateLayout(){const{placement:t,translationX:i,translationY:s,horizontal:n,label:o}=this;function a(u){}let r,l;switch(t){case"top":case"top-right":case"top-left":r="bottom",l="center",o.mirrored=!1,o.parallel=!0;break;case"bottom":case"bottom-right":case"bottom-left":r="top",l="center",o.mirrored=!1,o.parallel=!0;break;case"right":case"right-top":case"right-bottom":case"left":case"left-top":case"left-bottom":r="middle",l="left",o.mirrored=!0,o.parallel=!1;break;default:}const c=[],h=this.generateTicks(),{ticks:d}=h;return this.labelSelection.update(d,void 0,u=>u.tickId),this.axisGroup.setProperties({translationX:i,translationY:s}),this.labelSelection.each((u,p)=>{u.fontFamily=o.fontFamily,u.fontSize=o.fontSize,u.fontStyle=o.fontStyle,u.fontWeight=o.fontWeight,u.fill=o.color,u.textBaseline=r,u.textAlign=l,u.text=p.tickLabel,u.x=n?p.translation:0,u.y=n?0:p.translation,c.push(u.getBBox())}),c.length>0?WJ.merge(c).translate(i,s):void 0}tickFormatter(t,i,s,n){const{ctx:o}=this,{formatManager:a}=o,r=this.dataProvider.data.flatMap(l=>l.series);return(l,c)=>{const h={type:"number",value:l,datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"gradient-legend",property:"color",domain:t,boundSeries:r,fractionDigits:n};return this.label.formatValue((d,u)=>nf(o,d,u),h,c)??a.format((d,u)=>nf(o,d,u),h)??a.defaultFormat(h)}}inRange(t,i=.001){const[s,n]=XJ(this.scale.range);return t>=s-i&&t<=n+i}generateTicks(){const{minSpacing:t,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:n,tickCount:o}=QJ(qJ(this.scale.range),1,t,i,wk.DefaultTickCount,wk.DefaultMinSpacing),a=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:o,minTickCount:n,maxTickCount:s});if(this.placement==="bottom"||this.placement==="top"){const r=KJ.getMeasurer({font:this.label}),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let d=-1/0*h;a.ticks=a.ticks.filter(u=>Math.sign(u.translation-d)!==h?!1:(d=u.translation+r.textWidth(u.tickLabel,!0)*h,!0))}return a}getTicksData(t){const i=[],s=t.nice?this.scale.niceDomain(t):this.scale.domain,n=this.scale.ticks(t,s)?.ticks??[],o=n.reduce((l,c)=>Math.max(l,Vu(c)),0),a=ZJ(),r=this.tickFormatter(s,n,!1,o);for(let l=0;l<n.length;l++){const c=n[l],h=this.scale.convert(c);if(!this.inRange(h))continue;const d=r(c,l);if(d==null||d==="")continue;const u=a(d);i.push({tick:c,tickId:u,tickLabel:d,translation:h})}return{rawTicks:n,fractionDigits:o,ticks:i}}};MI.DefaultTickCount=5,MI.DefaultMinSpacing=10;var JJ=MI,{BaseProperties:eee,ZIndexMap:tee,ProxyProperty:DI,Property:On,LayoutElement:iee,Group:see,Rect:gB,Marker:nee,TranslatableGroup:oee,BBox:AI,expandLegendPosition:II}=A,kI=class extends eee{constructor(){super(...arguments),this.thickness=16,this.preferredLength=100}};y([On],kI.prototype,"thickness",2),y([On],kI.prototype,"preferredLength",2);var Lb=class extends A.BaseProperties{constructor(e){super(),this.axisTicks=e}};y([DI("axisTicks.label")],Lb.prototype,"label",2),y([DI("axisTicks.interval")],Lb.prototype,"interval",2),y([DI("axisTicks.padding")],Lb.prototype,"padding",2);var aee={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1},ree={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:1,rotation:0,scale:1},lee={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},Pn=class extends A.BaseProperties{constructor(e){super(),this.ctx=e,this.id=ns(this),this.legendGroup=new oee({name:"legend",zIndex:tee.LEGEND}),this.containerNode=this.legendGroup.appendChild(new gB({name:"legend-container"})),this.gradientRect=new gB,this.arrow=new nee({shape:"triangle"}),this.ticksGroup=new see({name:"legend-axis-group"}),this.cleanup=new mt,this.enabled=!1,this.position="bottom",this.reverseOrder=!1,this.gradient=new kI,this.spacing=20,this.border=new A.Border(this.containerNode),this.cornerRadius=0,this.fillOpacity=1,this.padding=4,this.data=[],this.highlightManager=e.highlightManager,this.axisTicks=new JJ(e,this),this.axisTicks.attachAxis(this.ticksGroup),this.scale=new Lb(this.axisTicks),this.legendGroup.append([this.gradientRect,this.arrow,this.ticksGroup]),this.cleanup.register(e.eventsHub.on("highlight:change",()=>this.onChartHoverChange()),e.layoutManager.registerElement(iee.Legend,t=>this.onStartLayout(t)),()=>this.legendGroup.remove())}isVertical(){const{placement:e}=II(this.position);return e.startsWith("right")||e.startsWith("left")}destroy(){this.cleanup.flush()}attachLegend(e){e.appendChild(this.legendGroup)}onStartLayout(e){const[t]=this.data;if(!this.enabled||!t?.enabled||t.legendType!=="gradient"){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(t),s=this.updateGradientRect(e.layoutBox,i),n=this.updateAxis(t,s)??new AI(0,0,0,0),o=AI.merge([s,n]),{strokeWidth:a,padding:r}=this.getContainerStyles();o.grow(r).grow(a);const{left:l,top:c}=this.getMeasurements(e.layoutBox,o);this.updateContainer(o),this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=l,this.legendGroup.translationY=c}normalizeColorArrays(e){let t=e.colorDomain.slice();const i=e.colorRange.slice();if(t.length===i.length)return{colorDomain:t,colorRange:i};t.length>i.length&&i.splice(t.length);const[s,n]=t,o=i.length;return t=i.map((a,r)=>r===0?s:r===o-1?n:s+(n-s)*r/(o-1)),{colorDomain:t,colorRange:i}}updateGradientRect(e,t){const{gradientRect:i,gradient:s}=this,{preferredLength:n,thickness:o}=s,a=new AI(0,0,0,0);let r;return this.isVertical()?(r=0,a.width=o,a.height=Math.min(e.height,n)):(r=90,a.width=Math.min(e.width,n),a.height=o),i.x=a.x,i.y=a.y,i.width=a.width,i.height=a.height,i.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:t.map((l,c)=>({stop:c/(t.length-1),color:l})),rotation:r},a}updateAxis(e,t){const{axisTicks:i,gradient:s,scale:n}=this,{placement:o}=II(this.position),a=this.isVertical(),r=this.reverseOrder!==a;i.placement=o;const l=s.thickness+(n.padding??0);return i.translationX=a?l:t.x,i.translationY=a?t.y:l,i.scale.domain=r?e.colorDomain.slice().reverse():e.colorDomain,i.scale.range=a?[t.x,t.height]:[t.y,t.width],i.calculateLayout()}updateContainer(e){const t=this.getContainerStyles();A.applyShapeStyle(this.containerNode,t),this.containerNode.cornerRadius=t.cornerRadius,this.containerNode.x=e.x,this.containerNode.y=e.y,this.containerNode.width=e.width,this.containerNode.height=e.height}updateArrow(){const e=this.highlightManager.getActiveHighlight(),{arrow:t}=this;if(e?.colorValue==null){t.visible=!1;return}const{scale:i,label:s}=this.axisTicks,n=s.fontSize??0,o=i.convert(e.colorValue);let{x:a,y:r}=this.gradientRect,l=Math.PI;this.isVertical()?(a-=n/2,r+=o,l/=2):(a+=o,r-=n/2),t.visible=!0,t.fill=s.color,t.rotation=l,t.size=n,t.translationX=a,t.translationY=r}getMeasurements(e,t){function i(u){}let{x:s,y:n}=e;const{width:o,height:a}=t,{placement:r,floating:l,xOffset:c,yOffset:h}=II(this.position),d=this.getContainerStyles();switch(s+=d.strokeWidth+d.padding.left,n+=d.strokeWidth+d.padding.top,r){case"left":n+=e.height/2-a/2;break;case"right":s+=e.width-o,n+=e.height/2-a/2;break;case"top":s+=e.width/2-o/2;break;case"bottom":s+=e.width/2-o/2,n+=e.height-a;break;case"right-top":case"top-right":s+=e.width-o;break;case"right-bottom":case"bottom-right":s+=e.width-o,n+=e.height-a;break;case"left-bottom":case"bottom-left":n+=e.height-a;break;case"left-top":case"top-left":break;default:}if(!l)switch(r){case"left":case"left-top":case"left-bottom":e.shrink(o+this.spacing,"left");break;case"right":case"right-top":case"right-bottom":e.shrink(o+this.spacing,"right");break;case"top":case"top-left":case"top-right":e.shrink(a+this.spacing,"top");break;case"bottom":case"bottom-left":case"bottom-right":e.shrink(a+this.spacing,"bottom");break;default:}return s+=c,n+=h,{top:n,left:s}}getContainerStyles(){const{stroke:e,strokeOpacity:t,strokeWidth:i}=this.border,{cornerRadius:s,fill:n,fillOpacity:o,padding:a}=this,r=typeof a=="number";return A.getShapeStyle({cornerRadius:s,fill:n,fillOpacity:o,padding:{top:r?a:a.top??0,right:r?a:a.right??0,bottom:r?a:a.bottom??0,left:r?a:a.left??0},stroke:e,strokeOpacity:t,strokeWidth:this.border.enabled?i:0},aee,ree,lee)}onChartHoverChange(){this.enabled&&this.updateArrow()}};Pn.className="GradientLegend",y([On],Pn.prototype,"enabled",2),y([On],Pn.prototype,"position",2),y([On],Pn.prototype,"reverseOrder",2),y([On],Pn.prototype,"gradient",2),y([On],Pn.prototype,"spacing",2),y([On],Pn.prototype,"border",2),y([On],Pn.prototype,"cornerRadius",2),y([On],Pn.prototype,"fill",2),y([On],Pn.prototype,"fillOpacity",2),y([On],Pn.prototype,"padding",2),y([On],Pn.prototype,"scale",2);var cee={type:"legend",optionsKey:"gradientLegend",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],identifier:"gradient",moduleFactory:e=>new Pn(e),themeTemplate:{enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},minSpacing:5},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1},removable:"standalone-only"};function hee(e,t){const i=e.addChild("canvas-overlay","watermark"),s=ke("span");s.innerText=t,i.addEventListener("animationend",()=>{e.removeChild("canvas-overlay","watermark"),e.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(s)}var{ordinalTimeAxisOptionsDefs:dee,angleNumberAxisOptionsDefs:uee,angleCategoryAxisOptionsDefs:pee,radiusNumberAxisOptionsDefs:gee,radiusCategoryAxisOptionsDefs:fee}=A,yee={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,options:dee,create:e=>new Cg(e)},mee={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,options:uee,create:e=>new Qc(e)},xee={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,options:pee,create:e=>new Ml(e)},bee={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,options:gee,create:e=>new Ud(e)},vee={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,options:fee,create:e=>new Dl(e)},{Chart:See}=A,CI=class extends See{getChartType(){return"standalone"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e,n=s.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());this.seriesRect=n,this.animationRect=n;for(const o of[t,i])o.translationX=Math.floor(n.x),o.translationY=Math.floor(n.y);t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:n,paddedRect:s}})}getAriaLabel(){const e=this.series[0]?.type;if(e==null)return"";const t=this.getCaptionText();switch(e){case"radial-gauge":case"linear-gauge":{const i=[];t.length!==0&&i.push(t);for(const s of this.series)i.push(s.getCaptionText());return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i.join(". ")})}case"treemap":case"sunburst":return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t});default:return this.ctx.localeManager.t("ariaAnnounceStandaloneChart",{caption:t})}}};CI.className="StandaloneChart",CI.type="standalone";var{isAgStandaloneChartOptions:Mee,standaloneChartOptionsDefs:Dee}=A,Aee={type:"chart",name:"standalone",enterprise:!0,options:Dee,detect:Mee,create(e,t){return new CI(e,t)}},{Chart:Iee,MercatorScale:fB,NumberAxis:yB,Property:kee}=A;function mB(e){return e.type==="map-shape"||e.type==="map-line"||e.type==="map-marker"||e.type==="map-shape-background"||e.type==="map-line-background"}var wb=class extends Iee{constructor(e,t){super(e,t),this.xAxis=new yB(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new yB(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}async updateData(){await super.updateData();const e=this.getOptions();this.topology!==e.topology&&(this.topology=e.topology);const{topology:t}=this;this.series.forEach(i=>{mB(i)&&i.setChartTopology(t)})}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e,n=s.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());this.seriesRect=n,this.animationRect=n;const o=this.series.filter(mB),a=o.reduce((c,h)=>{if(!h.visible)return c;const d=h.topologyBounds;return d==null?c:c==null?d:c.merge(d)},void 0);let r;if(a!=null){const{lon0:c,lat0:h,lon1:d,lat1:u}=a,p=[[c,h],[d,u]],g=fB.bounds(p),{width:f,height:x}=n,m=Math.min(f/g.width,x/g.height),b=g.width*m,v=g.height*m,S=(f-b)/2,D=(x-v)/2,C=S,T=D,k=S+b,L=D+v,N=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),w=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),O=(k-C)/(N.max-N.min),R=C-O*N.min,B=(L-T)/(1-w.min-(1-w.max)),P=T-B*(1-w.max);r=new fB(p,[[R,P],[R+O,P+B]])}o.forEach(c=>{c.scale=r});const l=this.series.some(c=>c.visible);t.visible=l;for(const c of[t,i])c.translationX=Math.floor(n.x),c.translationY=Math.floor(n.y),c.setClipRect(n.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:l,rect:n,paddedRect:s}})}};wb.className="TopologyChart",wb.type="topology",y([kee],wb.prototype,"topology",2);var{isAgTopologyChartOptions:Cee,topologyChartOptionsDefs:Tee}=A,Lee={type:"chart",name:"topology",enterprise:!0,options:Tee,detect:Cee,create(e,t){return new wb(e,t)}},{annotationCalloutStylesDefs:wee,annotationNoteStylesDefs:Nee,annotationTextStylesDef:Eee,annotationCommentStylesDefs:Oee,annotationMeasurerStylesDefs:TI,annotationShapeStylesDefs:xB,annotationChannelTextDefs:Pee,annotationCrossLineStyleDefs:bB,annotationFibonacciStylesDefs:vB,annotationLineStyleDefs:SB,annotationLineTextDefs:Ree,annotationDisjointChannelStyleDefs:Bee,annotationParallelChannelStyleDefs:Fee}=A,of=_t({__type:Y(Le("date")),value:Ce(E,K)},"a serializable date object"),MB=Ce(E,K,of),LI=Ce(MB,_t({value:MB,groupPercentage:Hk(-1,2)})),DB={...Pee,label:E},Br={...Ree,label:E},At={x:LI,y:K},zee=nc({line:{...SB,start:At,end:At,text:Br},"horizontal-line":{...bB,value:LI,text:Br},"vertical-line":{...bB,value:LI,text:Br},"disjoint-channel":{...Bee,startHeight:K,endHeight:K,start:At,end:At,text:DB},"parallel-channel":{...Fee,height:K,start:At,end:At,text:DB},"fibonacci-retracement":{...vB,start:At,end:At,text:Br,reverse:z},"fibonacci-retracement-trend-based":{...vB,start:At,end:At,endRetracement:At,text:Br,reverse:z},callout:{...wee,start:At,end:At,text:E},comment:{...Oee,...At,text:E},note:{...Nee,...At,text:E},text:{...Eee,...At,text:E},arrow:{...SB,text:Br,start:At,end:At},"arrow-up":{...xB,...At},"arrow-down":{...xB,...At},"date-range":{...TI,extendAbove:z,extendBelow:z,text:Br,start:At,end:At},"price-range":{...TI,extendLeft:z,extendRight:z,text:Br,start:At,end:At},"date-price-range":{...TI,text:Br,start:At,end:At}},"an annotation initial state object"),_ee={chartType:J("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),annotations:ui(zee),legend:ui({visible:z,seriesId:E,itemId:E,legendItemName:E},"legend state array"),zoom:{rangeX:{start:Ce(K,of),end:Ce(K,of)},rangeY:{start:Ce(K,of),end:Ce(K,of)},ratioX:{start:at(pe,_n("end")),end:at(pe,Gn("start"))},ratioY:{start:at(pe,_n("end")),end:at(pe,Gn("start"))},autoScaledAxes:Ae(Le("y"))}},{annotationOptionsDef:Gee}=A,Vee={type:"plugin",name:"annotations",chartType:"cartesian",options:Gee,create(){return null}},jee={type:"plugin",name:"navigator",chartType:"cartesian",options:V7,create(){return null}},Hee={type:"plugin",name:"initialState",options:_ee,create(){return null}};function AB(e,t,i){i||(t=Wee(t));const s=new Map;for(const o of e)s.set(o.id,{datum:o,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let n=0;return s.forEach((o,a)=>{n=Math.max(n,wI(s,t,o,a,-1,[])+wI(s,t,o,a,1,[])+1)}),{links:t,nodeGraph:s,maxPathLength:n}}function IB(e,t,i,s){const n=s.indexOf(t);if(n!==-1){for(let a=n;a<s.length;a+=1)i.add(s[a]);return}s.push(t);const{toNode:o}=t;for(const a of e)a.fromNode===o&&IB(e,a,i,s);s.pop()}function Wee(e){const t=new Set;for(const i of e)IB(e,i,t,[]);return t.size!==0&&X.warnOnce("Some links formed circular references. These will be removed from the output."),t.size===0?e:e.filter(i=>!t.has(i))}function wI(e,t,i,s,n,o){if(o.includes(s))return 1/0;let a=n===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(a===-1){a=0;const r=n===-1?i.linksBefore:i.linksAfter;for(const l of t){const{fromNode:c,toNode:h}=l,d=n===-1?h.id:c.id,u=n===-1?c.id:h.id,p=s===d?e.get(u):void 0;p!=null&&(r.push({node:p,link:l}),o?.push(s),a=Math.max(a,wI(e,t,p,u,n,o)+1),o?.pop())}n===-1?i.maxPathLengthBefore=a:i.maxPathLengthAfter=a}return a}var{Series:$ee,DataController:Uee,keyProperty:Yee,valueProperty:Nb,Selection:Ah,Group:bu,TransformableText:Kee}=A,Zee=class extends A.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s);const{datumIndex:n}=i,o=s.contextNodeData?.nodeData.find(a=>a.datumIndex.type===n.type&&a.datumIndex.index===n.index);this.size=o?.size,this.label=o?.type===1?o?.label:void 0}},kB=class extends $ee{constructor(){super(...arguments),this.NodeEvent=Zee,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 bu({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new bu({name:"nodeGroup"})),this.focusLinkGroup=this.highlightGroup.appendChild(new bu({name:"linkGroup"})),this.focusNodeGroup=this.highlightGroup.appendChild(new bu({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightGroup.appendChild(new bu({name:"linkGroup"})),this.highlightNodeGroup=this.highlightGroup.appendChild(new bu({name:"nodeGroup"})),this.labelSelection=Ah.select(this.labelGroup,Kee),this.linkSelection=Ah.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=Ah.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=Ah.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=Ah.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=Ah.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=Ah.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes}async processData(e){const{data:t,nodes:i}=this;if(t==null)return;const{fromKey:s,toKey:n,sizeKey:o,idKey:a,labelKey:r}=this.properties,l=new Uee("standalone",e.suppressFieldDotNotation),c=i!=null?l.request(this.id,i,{props:[Yee(a,void 0,{id:"idValue",includeProperty:!1}),...r!=null?[Nb(r,void 0,{id:"labelValue",includeProperty:!1})]:[]],groupByKeys:!0}):null,h=e.request(this.id,t,{props:[Nb(s,void 0,{id:"fromValue",includeProperty:!1}),Nb(n,void 0,{id:"toValue",includeProperty:!1}),...o!=null?[Nb(o,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]:[]],groupByKeys:!1});i!=null&&l.execute();const[d,u]=await Promise.all([c,h]);this.nodesDataModel=d?.dataModel,this.nodesProcessedData=d?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const p=new Map;if(d==null){const g=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),f=u.dataModel.resolveColumnById(this,"toValue",u.processedData),x=m=>{const b=p.size;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:b},type:1,index:b,linksBefore:[],linksAfter:[],id:m,size:0,label:m}};u.processedData.dataSources.get(this.id)?.forEach((m,b)=>{const v=g[b],S=f[b];v==null||S==null||(p.has(v)||p.set(v,x(v)),p.has(S)||p.set(S,x(S)))})}else{const g=d.dataModel.resolveColumnById(this,"idValue",d.processedData),f=r!=null?d.dataModel.resolveColumnById(this,"labelValue",d.processedData):void 0;d.processedData.dataSources.get(this.id)?.forEach((x,m)=>{const b=g[m],v=f?.[m];p.set(b,{series:this,itemId:void 0,datum:x,datumIndex:{type:1,index:m},type:1,index:m,linksBefore:[],linksAfter:[],id:b,size:0,label:v})})}this.processedNodes=p}getNodeGraph(e,t,{includeCircularReferences:i}){const{linksDataModel:s,linksProcessedData:n}=this;if(s==null||n==null){const{links:g,nodeGraph:f,maxPathLength:x}=AB(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:f,links:g,maxPathLength:x}}const{sizeKey:o}=this.properties,a=s.resolveColumnById(this,"fromValue",n),r=s.resolveColumnById(this,"toValue",n),l=o!=null?s.resolveColumnById(this,"sizeValue",n):void 0,c=new Map;this.processedNodes.forEach(g=>{const f=e(g);c.set(g.id,f)});const h=[];n.dataSources.get(this.id)?.forEach((g,f)=>{const x=a[f],m=r[f],b=l!=null?l[f]:1,v=c.get(x),S=c.get(m);if(b<=0||v==null||S==null)return;const D=t({series:this,itemId:void 0,datum:g,datumIndex:{type:0,index:f},type:0,index:f,fromNode:v,toNode:S,size:b});h.push(D)});const{links:d,nodeGraph:u,maxPathLength:p}=AB(c.values(),h,i);return u.forEach(g=>{g.datum.linksBefore=g.linksBefore.map(f=>f.link),g.datum.linksAfter=g.linksAfter.map(f=>f.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(e){const{seriesRect:t}=e,i={seriesRectWidth:t?.width??0,seriesRectHeight:t?.height??0};(this._nodeDataDependencies==null||this._nodeDataDependencies.seriesRectWidth!==i.seriesRectWidth||this._nodeDataDependencies.seriesRectHeight!==i.seriesRectHeight)&&(this._nodeDataDependencies=i),this.updateSelections();const s=this.contextNodeData?.nodeData??[],n=this.contextNodeData?.labelData??[];let o=this.ctx.highlightManager?.getActiveHighlight();if(o?.series===this&&o.type==null){const{itemId:h}=o;o=h!=null?s.find(d=>d.type===1&&d.id===h):void 0}else o?.series!==this&&(o=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=o!=null?this.properties.highlight.unhighlightedItem.opacity??1:1,this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:s.filter(h=>h.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:s.filter(h=>h.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let a,r,l,c;o?.type===1?(a=s.filter(h=>h.type===0&&(h.toNode===o||h.fromNode===o)),r=a.map(h=>h.fromNode===o?h.toNode:h.fromNode),r.push(o),l=[],c=[o]):o?.type===0?(a=[o],r=[o.fromNode,o.toNode],l=[o],c=[]):(a=[],r=[],l=[],c=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:a,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:r,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:l,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:c,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}resetAnimation(e){}dataCount(){return NaN}getSeriesDomain(e){return[]}getSeriesRange(e,t){return[NaN,NaN]}legendItemSymbol(e,t,i={}){const{fills:s,strokes:n}=this.properties,{fill:o=s[t%s.length],fillOpacity:a=1,stroke:r=n[t%n.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:h=[0],lineDashOffset:d=0}=i;return{marker:{fill:o,fillOpacity:a,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}}getLegendData(e){if(e!=="category")return[];const{showInLegend:t}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:s},n)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:s??i},symbol:this.legendItemSymbol(1,n),hideInLegend:!t,isFixed:!0}))}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.linkSelection.each((n,o)=>{const a=n.distanceSquared(e,t);a<i&&(i=a,s=o)}),this.nodeSelection.each((n,o)=>{const a=n.distanceSquared(e,t);a<i&&(i=a,s=o)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}getDatumAriaText(e,t){if(e.type===0)return this.ctx.localeManager.t("ariaAnnounceFlowProportionLink",{index:e.index+1,count:this.linkCount,from:e.fromNode.id,to:e.toNode.id,size:e.size,sizeName:this.properties.sizeName??this.properties.sizeKey});if(e.type===1)return this.ctx.localeManager.t("ariaAnnounceFlowProportionNode",{index:e.index+1,count:this.nodeCount,description:t})}pickFocus(e){const{datumIndexDelta:t,otherIndexDelta:i}=e,s=this.contextNodeData?.nodeData[e.datumIndex-e.datumIndexDelta];let n=s;if(i!==0||t===0)return;if(s?.type===0){const r=Array.from(this.linkSelection,h=>h.datum),c=r.indexOf(s)+t;if(c>=0&&c<r.length)n=r[c];else if(c>0)n=r[r.length-1];else{const h=Array.from(this.nodeSelection,d=>d.datum);n=h[h.length-1]}}else if(s?.type===1){const r=Array.from(this.nodeSelection,h=>h.datum),c=r.indexOf(s)+t;c>=0&&c<r.length?n=r[c]:c<0?n=r[0]:n=Array.from(this.linkSelection,d=>d.datum)[0]}if(n==null)return;const o=n.type===1?Array.from(this.nodeSelection).find(r=>r.datum===n):Array.from(this.linkSelection).find(r=>r.datum===n);if(o==null)return;const a=this.computeFocusBounds(o.node);if(a!=null)return{datum:o.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(o.datum)??0,otherIndex:0,bounds:a,clipFocusBox:!0}}getCategoryValue(e){}datumIndexForCategoryValue(e){}},{Path:Xee,SceneChangeDetection:$l}=A;function CB({radius:e,startAngle:t,endAngle:i,tension:s}){const n=e*Math.cos(t),o=e*Math.sin(t),a=e*Math.cos(i),r=e*Math.sin(i),l=n*s,c=o*s,h=a*s,d=r*s;return{x:[n,l,h,a],y:[o,c,d,r]}}var Fr=class extends Xee{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}tensionedCurveTo(e,t,i,s,n,o,a,r){const{path:l,tension:c}=this,h=1-c;l.cubicCurveTo((i-e)*h+e,(s-t)*h+t,(n-a)*h+a,(o-r)*h+r,a,r)}updatePath(){const{path:e,centerX:t,centerY:i,radius:s}=this;let{startAngle1:n,endAngle1:o,startAngle2:a,endAngle2:r}=this;n>a&&([n,a]=[a,n],[o,r]=[r,o]),e.clear();const l=t+s*Math.cos(n),c=i+s*Math.sin(n);e.moveTo(l,c),this.tensionedCurveTo(l,c,t,i,t,i,t+s*Math.cos(r),i+s*Math.sin(r)),e.arc(t,i,s,r,a,!0),this.tensionedCurveTo(t+s*Math.cos(a),i+s*Math.sin(a),t,i,t,i,t+s*Math.cos(o),i+s*Math.sin(o)),e.arc(t,i,s,o,n,!0),e.closePath()}};y([$l()],Fr.prototype,"centerX",2),y([$l()],Fr.prototype,"centerY",2),y([$l()],Fr.prototype,"radius",2),y([$l()],Fr.prototype,"startAngle1",2),y([$l()],Fr.prototype,"endAngle1",2),y([$l()],Fr.prototype,"startAngle2",2),y([$l()],Fr.prototype,"endAngle2",2),y([$l()],Fr.prototype,"tension",2);var{FillGradientDefaults:qee,FillPatternDefaults:Qee,FillImageDefaults:Jee,BaseProperties:TB,makeSeriesTooltip:ete,SeriesProperties:tte,Property:We,Label:ite}=A,NI=class extends ite{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};y([We],NI.prototype,"spacing",2),y([We],NI.prototype,"maxWidth",2);var Ga=class extends TB{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}getStyle(e,t,i){const{fillOpacity:s,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,tension:l}=this,c=this.fill??e[i%e.length],h=this.stroke??t[i%e.length];return{fill:c,fillOpacity:s,stroke:h,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,tension:l}}};y([We],Ga.prototype,"fill",2),y([We],Ga.prototype,"fillOpacity",2),y([We],Ga.prototype,"stroke",2),y([We],Ga.prototype,"strokeOpacity",2),y([We],Ga.prototype,"strokeWidth",2),y([We],Ga.prototype,"lineDash",2),y([We],Ga.prototype,"lineDashOffset",2),y([We],Ga.prototype,"tension",2),y([We],Ga.prototype,"itemStyler",2);var Xo=class extends TB{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t,i){const{fillOpacity:s,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=this,l=this.fill??e[i%e.length],c=this.stroke??t[i%e.length];return{fill:l,fillOpacity:s,stroke:c,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}}};y([We],Xo.prototype,"spacing",2),y([We],Xo.prototype,"width",2),y([We],Xo.prototype,"fill",2),y([We],Xo.prototype,"fillOpacity",2),y([We],Xo.prototype,"stroke",2),y([We],Xo.prototype,"strokeOpacity",2),y([We],Xo.prototype,"strokeWidth",2),y([We],Xo.prototype,"lineDash",2),y([We],Xo.prototype,"lineDashOffset",2),y([We],Xo.prototype,"itemStyler",2);var Yi=class extends tte{constructor(){super(),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 qee,this.fillPatternDefaults=new Qee,this.fillImageDefaults=new Jee,this.fills=[],this.strokes=[],this.label=new NI,this.link=new Ga,this.node=new Xo,this.tooltip=ete(),this.highlightStyle.deprecated=!1}};y([We],Yi.prototype,"fromKey",2),y([We],Yi.prototype,"toKey",2),y([We],Yi.prototype,"idKey",2),y([We],Yi.prototype,"idName",2),y([We],Yi.prototype,"labelKey",2),y([We],Yi.prototype,"labelName",2),y([We],Yi.prototype,"sizeKey",2),y([We],Yi.prototype,"sizeName",2),y([We],Yi.prototype,"nodes",2),y([We],Yi.prototype,"fillGradientDefaults",2),y([We],Yi.prototype,"fillPatternDefaults",2),y([We],Yi.prototype,"fillImageDefaults",2),y([We],Yi.prototype,"fills",2),y([We],Yi.prototype,"strokes",2),y([We],Yi.prototype,"label",2),y([We],Yi.prototype,"link",2),y([We],Yi.prototype,"node",2),y([We],Yi.prototype,"tooltip",2);var{SeriesNodePickMode:LB,CachedTextMeasurerPool:ste,TextWrapper:nte,TextUtils:ote,createDatumId:Eb,angleBetween:Ob,normalizeAngle360:ate,isBetweenAngles:wB,Sector:rte,evaluateBezier:Pb,applyShapeStyle:NB,getShapeStyle:Rb,getLabelStyles:lte,BBox:cte,mergeDefaults:Bb}=A,Fb=e=>e.startAngle+Ob(e.startAngle,e.endAngle)/2,zb=class extends kB{constructor(e){super({moduleCtx:e,pickModes:[LB.NEAREST_NODE,LB.EXACT_SHAPE_MATCH]}),this.properties=new Yi}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new Fr}nodeFactory(){return new rte}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0},properties:s}=this,{fromKey:n,toKey:o,sizeKey:a,labelKey:r,label:{spacing:l,maxWidth:c,fontSize:h},node:{width:d,spacing:u}}=s,p=t/2,g=i/2;let f=[];const{nodeGraph:x,links:m}=this.getNodeGraph(P=>({...P,centerX:p,centerY:g,innerRadius:NaN,outerRadius:NaN,startAngle:NaN,endAngle:NaN}),P=>({...P,centerX:p,centerY:g,radius:NaN,startAngle1:NaN,endAngle1:NaN,startAngle2:NaN,endAngle2:NaN}),{includeCircularReferences:!0});let b=0;x.forEach(({datum:P,linksBefore:_,linksAfter:F},W)=>{const H=_.reduce((j,{link:V})=>j+V.size,0)+F.reduce((j,{link:V})=>j+V.size,0);if(H===0)x.delete(W);else{const{label:j}=s;P.size=H,b+=P.size;const V=j.enabled?this.getLabelText(P.label,P.datum,r,"label",[],j,{datum:P.datum,value:P.label,fromKey:n,toKey:o,sizeKey:a,size:P.size}):void 0;P.label=V}});let v=0;if(this.isLabelEnabled()){const P=ste.getMeasurer({font:this.properties.label});let _=0;x.forEach(({datum:F})=>{const{id:W,label:H}=F;if(H==null)return;const j=nte.wrapText(H,{maxWidth:c,font:this.properties.label,textWrap:"never"}),{width:V}=P.measureText(j);_=Math.max(V,_),f.push({id:W,text:j,centerX:p,centerY:g,angle:NaN,radius:NaN,size:F.size})}),v=_+l}const S=x.size;let D=Math.min(t,i)/2-d-v,C=u/D;if(v!==0&&(S*C>=1.5*Math.PI||D<=0)&&(f=[],D=Math.min(t,i)/2-d,C=u/D),S*C>=2*Math.PI||D<=0){X.warnOnce("There was insufficient space to display the Chord Series.");return}const T=D,k=D+d,L=Math.max((2*Math.PI-S*C)/b,0);let N=0;x.forEach(({datum:P})=>{P.innerRadius=T,P.outerRadius=k,P.startAngle=N,P.endAngle=N+P.size*L,N=P.endAngle+C;const _=(P.innerRadius+P.outerRadius)/2,F=Fb(P);P.midPoint={x:P.centerX+_*Math.cos(F),y:P.centerY+_*Math.sin(F)}});const w=[];x.forEach(({datum:P,linksBefore:_,linksAfter:F})=>{const W=Fb(P),H=[..._.map(V=>({link:V.link,distance:Ob(Fb(V.node.datum),W),after:!1})),...F.map(V=>({link:V.link,distance:Ob(Fb(V.node.datum),W),after:!0}))];let j=P.startAngle;H.toSorted((V,$)=>V.distance-$.distance).forEach(({link:V,after:$})=>{const U=V.size*L;$?(V.startAngle1=j,V.endAngle1=j+U):(V.startAngle2=j,V.endAngle2=j+U),j+=V.size*L}),w.push(P)});const{tension:O}=this.properties.link;m.forEach(P=>{P.radius=D;const _=CB({radius:D,startAngle:P.startAngle1,endAngle:P.endAngle2,tension:O}),F=CB({radius:D,startAngle:P.startAngle2,endAngle:P.endAngle1,tension:O}),W=Pb(..._.x,.5),H=Pb(..._.y,.5),j=Pb(...F.x,.5),V=Pb(...F.y,.5);P.midPoint={x:P.centerX+(W+j)/2,y:P.centerY+(H+V)/2},w.push(P)}),f.forEach(P=>{const _=x.get(P.id)?.datum;_!=null&&(P.radius=k+l,P.angle=ate(_.startAngle+Ob(_.startAngle,_.endAngle)/2))}),f.sort((P,_)=>P.angle-_.angle);let R=1/0,B=-1/0;return f=f.filter(P=>{const _=ote.getLineHeight(h),F=Math.atan2(_/2,P.radius),W=P.angle-F,H=P.angle+F;return wB(R,W,H)||wB(B,W,H)?!1:(R=Math.min(W,R),B=Math.max(H,B),!0)}),{itemId:e,nodeData:w,labelData:f}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const t={toKey:this.properties.toKey,fromKey:this.properties.fromKey,sizeKey:this.properties.sizeKey,size:NaN};e.labelSelection.each((i,{size:s,text:n,centerX:o,centerY:a,radius:r,angle:l})=>{t.size=s;const c=lte(this,void 0,t,this.properties.label),{fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p,color:g}=c;i.visible=!0,i.translationX=o+r*Math.cos(l),i.translationY=a+r*Math.sin(l),i.text=n,i.fill=g,i.fontStyle=h,i.fontWeight=d,i.fontSize=u,i.fontFamily=p,i.textBaseline="middle",Math.cos(l)>=0?(i.textAlign="left",i.rotation=l):(i.textAlign="right",i.rotation=l-Math.PI),i.setBoxing(c)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Eb([t.type,t.id]))}getNodeStyle({datumIndex:e,datum:t,size:i=0,label:s},n,o){const{id:a,properties:r}=this,{fills:l,strokes:c,fillGradientDefaults:h,fillPatternDefaults:d,fillImageDefaults:u}=r,{itemStyler:p}=r.node,g=this.getHighlightStyle(o,e),f=Bb(g,r.node.getStyle(l,c,n));let x=Rb(f,h,d,u);if(p!=null&&e!=null){const m=this.ctx.highlightManager?.getActiveHighlight(),b=this.cachedDatumCallback(Eb(e,"node",o?"highlight":"node"),()=>{const v=this.getHighlightStateString(m,o,e);return this.callWithContext(p,{seriesId:a,datum:t,highlighted:o,highlightState:v,...x,size:i,label:s})});b&&(x=Rb(Bb(b,x),h,d,u))}return x.opacity=1,x}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((n,o)=>{const{datumIndex:a}=o,r=this.getNodeStyle(o,a.index,i);NB(n,r,s),n.centerX=o.centerX,n.centerY=o.centerY,n.innerRadius=o.innerRadius,n.outerRadius=o.outerRadius,n.startAngle=o.startAngle,n.endAngle=o.endAngle,n.inset=n.strokeWidth/2})}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Eb([t.type,t.index,t.fromNode.id,t.toNode.id]))}getLinkStyle({datumIndex:e,datum:t},i,s){const{id:n,properties:o}=this,{fills:a,strokes:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=o,{itemStyler:d}=o.link,u=this.getHighlightStyle(s,e),p=Bb(u,o.link.getStyle(a,r,i.index));let g=Rb(p,l,c,h);if(d!=null&&e!=null){const f=this.ctx.highlightManager?.getActiveHighlight(),x=this.cachedDatumCallback(Eb(e,"link",s?"highlight":"node"),()=>{const m=this.getHighlightStateString(f,s,i);return this.callWithContext(d,{seriesId:n,datum:t,highlighted:s,highlightState:m,...g})});x&&(g=Rb(Bb(x,g),l,c,h))}return g.opacity=1,g}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((n,o)=>{const a=o.fromNode.datumIndex,r=this.getLinkStyle(o,a,i);n.centerX=o.centerX,n.centerY=o.centerY,n.radius=o.radius,n.startAngle1=o.startAngle1,n.endAngle1=o.endAngle1,n.startAngle2=o.startAngle2,n.endAngle2=o.endAngle2,n.tension=r.tension,NB(n,r,s)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(e,t),s=(e-i)/2,n=(t-i)/2,o=new cte(s,n,e,t);return{series:o,axis:o}}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:n,ctx:{formatManager:o}}=this,{fromKey:a,toKey:r,sizeKey:l,sizeName:c,tooltip:h}=n,d=this.contextNodeData?.nodeData.find(b=>b.datumIndex.type===e.type&&b.datumIndex.index===e.index);if(d==null)return;const u=d.type===0?d.fromNode.index:d.index,p=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,g=e.type===0?i?.dataSources.get(this.id)?.[e.index]:s?.dataSources.get(this.id)?.[e.index],f=d.size;let x;if(d.type===0){const b=d.fromNode.datumIndex;x=this.getLinkStyle({datumIndex:e,datum:g},b,!1)}else{const b=d.label;x=this.getNodeStyle({datumIndex:e,datum:g,size:f,label:b},e.index,!1)}const m=[];if(l!=null){const b=o.format(this.callWithContext.bind(this),{type:"number",value:f,datum:g,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0});m.push({label:c,fallbackLabel:l,value:b??String(f)})}return this.formatTooltipWithContext(h,{title:p,symbol:this.legendItemSymbol(d.type,u,x),data:m},{seriesId:t,datum:g,title:p,fromKey:a,toKey:r,sizeKey:l,sizeName:c,size:f,...x})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null}};zb.className="ChordSeries",zb.type="chord";var{commonSeriesOptionsDefs:hte,chordSeriesThemeableOptionsDef:dte}=A,_b={...dte,...hte,type:Y(Le("chord")),fromKey:Y(E),toKey:Y(E),sizeKey:E,sizeName:E};_b.fillGradientDefaults=me(Rf),_b.fillPatternDefaults=me(Bf),_b.fillImageDefaults=me(Ff);var ute={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],solo:!0,identifier:"chord",moduleFactory:e=>new zb(e),themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:A.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,highlightStyle:{series:{dimOpacity:.2}},highlight:A.singleSeriesHighlightStyle(),label:{...A.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]},tension:.4}},legend:{enabled:!1,toggleSeries:!1}}},pte={type:"series",name:"chord",chartType:"standalone",enterprise:!0,options:_b,create:e=>new zb(e)},{ThemeConstants:{CARTESIAN_AXIS_TYPE:vu,CARTESIAN_POSITION:Su},ThemeSymbols:{DEFAULT_SHADOW_COLOUR:gte}}=A,Mu={$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},EB={autoRotate:{$path:"/series/0/stageLabel/autoRotate"},autoRotateAngle:{$path:"/series/0/stageLabel/autoRotateAngle"},avoidCollisions:{$path:["/series/0/stageLabel/avoidCollisions",!0]},border:{$path:["/series/0/stageLabel/border"]},color:{$path:["/series/0/stageLabel/color",{$ref:"textColor"}]},cornerRadius:{$path:["/series/0/stageLabel/cornerRadius"]},enabled:{$if:[{$eq:[{$path:"/series/0/stageLabel/enabled"},void 0]},!0,{$path:"/series/0/stageLabel/enabled"}]},fill:{$path:["/series/0/stageLabel/fill"]},fillOpacity:{$path:["/series/0/stageLabel/fillOpacity"]},fontSize:{$path:["/series/0/stageLabel/fontSize",{$ref:"fontSize"}]},fontStyle:{$path:["/series/0/stageLabel/fontStyle",{$ref:"fontStyle"}]},fontWeight:{$path:["/series/0/stageLabel/fontWeight",{$ref:"fontWeight"}]},format:{$path:"/series/0/stageLabel/format"},formatter:{$path:"/series/0/stageLabel/formatter"},itemStyler:{$path:"/series/0/stageLabel/itemStyler"},minSpacing:{$path:"/series/0/stageLabel/minSpacing"},padding:{$path:["/series/0/stageLabel/padding"]},rotation:{$path:["/series/0/stageLabel/rotation",0]}},OB=[{type:{$if:[Mu,vu.NUMBER,vu.CATEGORY]},position:{$if:[Mu,Su.LEFT,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"after"]},Su.RIGHT,Su.LEFT]}]},label:{$if:[Mu,void 0,EB]}},{type:{$if:[Mu,vu.CATEGORY,vu.NUMBER]},position:{$if:[Mu,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"before"]},Su.TOP,Su.BOTTOM]},Su.BOTTOM]},label:{$if:[Mu,EB,void 0]}}],fte={series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacingRatio:.25,fills:[{$palette:"fill"}],strokes:[{$palette:"stroke"}],fillGradientDefaults:A.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,label:{...A.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:{$isUserOption:["./stroke",2,0]}},shadow:{enabled:!1,color:gte,xOffset:3,yOffset:3,blur:5},highlight:A.singleSeriesHighlightStyle()},axes:{[vu.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[vu.CATEGORY]:{line:{enabled:!1}}}},{lineDistanceSquared:Gb,BBox:yte,Path:mte,SceneChangeDetection:Ul}=A,PB=1e-6;function RB([e,t],[i,s]){return Math.abs(e-i)<=PB&&Math.abs(t-s)<=PB}var Va=class extends mte{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:e,y0:t,x1:i,y1:s,x2:n,y2:o,x3:a,y3:r}=this;return{x:(e+i+n+a)/4,y:(t+s+o+r)/4}}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const{x0:i,y0:s,x1:n,y1:o,x2:a,y2:r,x3:l,y3:c}=this;return Math.min(Gb(e,t,i,s,n,o,1/0),Gb(e,t,n,o,a,r,1/0),Gb(e,t,a,r,l,c,1/0),Gb(e,t,l,c,i,s,1/0))}computeBBox(){const{x0:e,y0:t,x1:i,y1:s,x2:n,y2:o,x3:a,y3:r}=this,l=Math.min(e,i,n,a),c=Math.max(e,i,n,a)-l,h=Math.min(t,s,o,r),d=Math.max(t,s,o,r)-h;return new yte(l,h,c,d)}updatePath(){const{path:e,x0:t,y0:i,x1:s,y1:n,x2:o,y2:a,x3:r,y3:l}=this,c=[[t,i],[s,n],[o,a],[r,l]];e.clear();let h,d;c.forEach(u=>{if(h!=null&&RB(h,u)||d!=null&&RB(d,u))return;const[p,g]=u;h==null?e.moveTo(p,g):e.lineTo(p,g),h??(h=u),d=u}),e.closePath()}};y([Ul()],Va.prototype,"x0",2),y([Ul()],Va.prototype,"y0",2),y([Ul()],Va.prototype,"x1",2),y([Ul()],Va.prototype,"y1",2),y([Ul()],Va.prototype,"x2",2),y([Ul()],Va.prototype,"y2",2),y([Ul()],Va.prototype,"x3",2),y([Ul()],Va.prototype,"y3",2);var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:xte}=A;function BB(e,t,i,s){const{x0:n,y0:o,x1:a,y1:r,x2:l,y2:c,x3:h,y3:d,opacity:u}=e;return i?{x0:(n+h)/2,y0:(o+d)/2,x1:(a+l)/2,y1:(r+c)/2,x2:(a+l)/2,y2:(r+c)/2,x3:(n+h)/2,y3:(o+d)/2,opacity:u}:{x0:(n+a)/2,y0:(o+r)/2,x1:(n+a)/2,y1:(o+r)/2,x2:(l+h)/2,y2:(c+d)/2,x3:(l+h)/2,y3:(c+d)/2,opacity:u}}function bte(e,t){const i=o=>o==null;return{fromFn:(o,a,r)=>{r==="updated"&&i(a)?r="removed":r==="updated"&&i(o.previousDatum)&&(r="added");let l;r==="added"&&o.previousDatum==null&&t==="fade"?l={...af(o,a),opacity:0}:r==="unknown"||r==="added"?l=BB(a,o.previousDatum,e,t):l={x0:o.x0,y0:o.y0,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,x3:o.x3,y3:o.y3,opacity:o.opacity};const c=xte[r];return{...l,phase:c}},toFn:(o,a,r)=>{let l;return r==="removed"&&o.datum==null&&t==="fade"?l={...af(o,a),opacity:0}:r==="removed"||i(a)?l=BB(a,o.previousDatum,e,t):l=af(o,a),l}}}function af(e,t){const{x0:i,y0:s,x1:n,y1:o,x2:a,y2:r,x3:l,y3:c,opacity:h}=t;return{x0:i,y0:s,x1:n,y1:o,x2:a,y2:r,x3:l,y3:c,opacity:h}}var{SeriesNodePickMode:FB,SeriesZIndexMap:zB,valueProperty:vte,keyProperty:Ste,ChartAxisDirection:Mte,updateLabelNode:Dte,SMALLEST_KEY_INTERVAL:Ate,LARGEST_KEY_INTERVAL:Ite,diff:kte,fixNumericExtent:Cte,seriesLabelFadeInAnimation:_B,resetMotion:Tte,resetLabelFn:Lte,animationValidation:wte,computeBarFocusBounds:Nte,ContinuousScale:Ete,Group:Ote,Selection:Pte,PointerEvents:GB,motion:Rte,checkCrisp:Bte,createDatumId:Fte,applyShapeStyle:zte,getShapeStyle:_te,getShapeFill:Gte}=A,Vte=class extends A.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.stageKey,this.yKey=s.properties.valueKey}},VB=class extends A.AbstractBarSeries{constructor({moduleCtx:e,animationResetFns:t}){super({moduleCtx:e,pickModes:[FB.AXIS_ALIGNED,FB.EXACT_SHAPE_MATCH],propertyKeys:{x:["stageKey"],y:["valueKey"]},propertyNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:t.datum,label:Lte}}),this.NodeEvent=Vte,this.connectorNodeGroup=this.contentGroup.appendChild(new Ote({name:`${this.id}-series-connectorNodes`,zIndex:zB.BACKGROUND})),this.connectorSelection=Pte.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=GB.None}get pickModeAxis(){return"main-category"}setZIndex(e){return super.setZIndex(e),this.connectorNodeGroup.zIndex=[zB.BACKGROUND,e],!0}isVertical(){return!super.isVertical()}connectionFactory(){return new Va}async processData(e){const{stageKey:t,valueKey:i}=this.properties,{visible:s,id:n}=this,o=(g,f,x)=>s&&this.ctx.legendManager.getItemEnabled({seriesId:n,itemId:x}),a=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:r}),d=[];this.ctx.animationManager.isSkipped()||(this.processedData&&d.push(kte(this.id,this.processedData)),d.push(wte()));const u=this.visible?{}:{forceValue:0},{processedData:p}=await this.requestDataModel(e,this.data,{props:[Ste(t,c,{id:"xValue"}),vte(i,h,{id:"yValue",...u,validation:o,invalidValue:0}),...l?[Ate,Ite]:[],...d],groupByKeys:!1});this.smallestDataInterval=p.reduced?.smallestKeyInterval,this.largestDataInterval=p.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:n}}=this;if(!t||!i)return[];const{keys:[o]}=t.domain;if(e===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");return a?.def.type==="key"&&a?.def.valueType==="category"?this.hasData?o.filter((r,l)=>n.getItemEnabled({seriesId:s,itemId:l})):[]:this.padBandExtent(o)}else{const a=this.domainForClippedRange(e,["yValue"],"xValue"),r=Math.max(...a),l=[-r,r];return Cte(l)}}getSeriesRange(e,t){return[NaN,NaN]}createNodeData(){const{hasData:e,data:t,dataModel:i,groupScale:s,processedData:n,id:o,ctx:{legendManager:a}}=this,r=this.getCategoryAxis(),l=this.getValueAxis();if(!(e&&t&&r&&l&&i&&n?.type==="ungrouped"))return;const c=r.scale,h=l.scale,d=this.getBarDirection()===Mte.X,{stageKey:u,valueKey:p}=this.properties,{strokeWidth:g}=this.barStyle(),f=`${p}`,x={itemId:f,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible},m=this.visible;if(!m)return x;const b=i.resolveKeysById(this,"xValue",n),v=i.resolveColumnById(this,"yValue",n),{barWidth:S,groupIndex:D}=this.updateGroupScale(r),C=Ete.is(c)?S*-.5:0,T=Bte(r?.scale,r?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let k;return(n.dataSources.get(this.id)??[]).forEach((N,w)=>{const O=m&&a.getItemEnabled({seriesId:o,itemId:w}),R=b[w];if(R==null)return;const B=Math.round(c.convert(R))+s.convert(String(D))+C,P=v[w],_=Math.round(h.convert(-P)),F=Math.round(h.convert(P)),W=Math.max(g,Math.abs(F-_)),H={x:d?Math.min(F,_):B,y:d?B:Math.min(F,_),width:d?W:S,height:d?S:W},j={x:H.x+H.width/2,y:H.y+H.height/2},V=this.createLabelData({datumIndex:w,rect:H,barAlongX:d,yDatum:P,datum:N,visible:O}),$={index:w,series:this,itemId:f,datum:N,datumIndex:w,xValue:R,yValue:P,xKey:u,yKey:p,x:H.x,y:H.y,width:H.width,height:H.height,midPoint:j,strokeWidth:g,crisp:T,label:V,visible:O};if(x.nodeData.push($),V!=null&&x.labelData.push(V),k!=null){const U=k.rect,Z=k.nodeDatum,q=k.datumIndex;d?x.connectorData.push({datum:Z,datumIndex:q,x0:U.x,y0:U.y+U.height,x1:U.x+U.width,y1:U.y+U.height,x2:H.x+H.width,y2:H.y,x3:H.x,y3:H.y,opacity:1}):x.connectorData.push({datum:Z,datumIndex:q,x0:U.x+U.width,y0:U.y,x1:H.x,y1:H.y,x2:H.x,y2:H.y+H.height,x3:U.x+U.width,y3:U.y+U.height,opacity:1})}O&&(k={itemId:f,rect:H,nodeDatum:$,datumIndex:w})}),x}updateNodes(e,t){super.updateNodes(e,t);const{connectorSelection:i}=this,s=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:i,connectorData:s}),this.updateConnectorNodes({connectorSelection:i})}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s,void 0,n=>this.getDatumId(n))}updateConnectorSelection(e){const{connectorData:t,connectorSelection:i}=e;return i.update(this.connectorEnabled()?t:[],void 0,s=>this.getDatumId(s.datum))}updateConnectorNodes(e){const{fills:t,strokes:i,fillGradientDefaults:s,fillPatternDefaults:n,fillImageDefaults:o}=this.properties,{fill:a,fillOpacity:r,stroke:l,strokeOpacity:c,strokeWidth:h,lineDash:d,lineDashOffset:u}=this.connectorStyle(),p=this.getShapeFillBBox();e.connectorSelection.each((g,f)=>{const{datumIndex:x}=f;g.setProperties(af(g,f));const m=Gte(a??t[x%t.length],s,n,o);zte(g,{fill:m,stroke:l??i[x%i.length],fillOpacity:r,strokeOpacity:c,strokeWidth:h,lineDash:d,lineDashOffset:u},p)})}getHighlightLabelData(e,t){const i=e.filter(s=>s.datum===t.datum);return i.length>0?i:void 0}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=GB.None})}updateLabelNodes(e){const t={stageKey:this.properties.stageKey,valueKey:this.properties.valueKey};e.labelSelection.each((i,s)=>{i.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1,Dte(this,i,t,this.properties.label,s)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{stageKey:o,valueKey:a,tooltip:r,legendItemName:l}=n,c=this.getCategoryAxis(),h=this.getValueAxis();if(!i||!s||!c||!h)return;const d=s.dataSources.get(this.id)?.[e],u=i.resolveKeysById(this,"xValue",s)[e],p=i.resolveColumnById(this,"yValue",s)[e];if(u!=null)return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:this.getAxisValueText(c,"tooltip",u,d,o,l),value:this.getAxisValueText(h,"tooltip",p,d,a,l)}]},{seriesId:t,datum:d,title:o,stageKey:o,valueKey:a,...this.tooltipStyle(d,e)})}resetAllAnimation(e){super.resetAllAnimation(e),Tte([this.connectorSelection],af)}animateEmptyUpdateReady({labelSelection:e}){const{connectorSelection:t}=this,i=this.isVertical(),n=bte(i,"normal");Rte.fromToMotion(this.id,"connectors",this.ctx.animationManager,[t],n),_B(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(e){const{labelSelection:t}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id),_B(this,"labels",this.ctx.animationManager,t)}getDatumId(e){return Fte(e.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return Nte(this,this.contextNodeData?.nodeData[e])}legendItemSymbol(e){const{strokeWidth:t,fillOpacity:i,strokeOpacity:s,lineDash:n,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:r,fillImageDefaults:l}=this.barStyle(),{fills:c,strokes:h}=this.properties,d=c[e%c.length]??"black",u=h[e%h.length]??"black";return{marker:_te({fill:d,fillOpacity:i,stroke:u,strokeWidth:t,strokeOpacity:s,lineDash:n,lineDashOffset:o},a,r,l)}}getLegendData(e){const{id:t,processedData:i,dataModel:s,ctx:{legendManager:n},visible:o}=this;if(!s||!i||e!=="category")return[];const{showInLegend:a}=this.properties,r=s.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)??[]).map((l,c)=>{const h=r[c];if(h!=null)return{legendType:"category",id:t,datum:l,itemId:c,seriesId:t,enabled:o&&n.getItemEnabled({seriesId:t,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!a}}).filter(l=>l!=null)}hasItemStylers(){return this.properties.itemStyler!=null}},{FillGradientDefaults:jte,FillPatternDefaults:Hte,FillImageDefaults:Wte,Label:$te,AbstractBarSeriesProperties:Ute,makeSeriesTooltip:Yte,AxisLabel:Kte,Property:ts}=A,EI=class extends $te{constructor(){super(...arguments),this.spacing=0}};y([ts],EI.prototype,"placement",2),y([ts],EI.prototype,"spacing",2);var jB=class extends Kte{};y([ts],jB.prototype,"placement",2);var Bs=class extends Ute{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new jte,this.fillPatternDefaults=new Hte,this.fillImageDefaults=new Wte,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new EI,this.stageLabel=new jB,this.tooltip=Yte()}};y([ts],Bs.prototype,"stageKey",2),y([ts],Bs.prototype,"valueKey",2),y([ts],Bs.prototype,"fills",2),y([ts],Bs.prototype,"fillGradientDefaults",2),y([ts],Bs.prototype,"fillPatternDefaults",2),y([ts],Bs.prototype,"fillImageDefaults",2),y([ts],Bs.prototype,"fillOpacity",2),y([ts],Bs.prototype,"strokes",2),y([ts],Bs.prototype,"strokeWidth",2),y([ts],Bs.prototype,"strokeOpacity",2),y([ts],Bs.prototype,"lineDash",2),y([ts],Bs.prototype,"lineDashOffset",2),y([ts],Bs.prototype,"label",2),y([ts],Bs.prototype,"stageLabel",2),y([ts],Bs.prototype,"tooltip",2);function HB(e,{x:t,y:i,width:s,height:n,opacity:o}){return{x1:t,y1:i,x2:t+s,y2:i+n,opacity:o??1}}var{Line:Zte,ChartAxisDirection:Xte}=A,Vb=class extends VB{constructor(e){super({moduleCtx:e,animationResetFns:{datum:HB}}),this.properties=new Bs}get hasData(){const{id:e,ctx:{legendManager:t}}=this,i=this.data?.reduce((s,n,o)=>s+(t.getItemEnabled({seriesId:e,itemId:o})?1:0),0);return i!=null&&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:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a,fillImageDefaults:r}=this.properties;return{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a,fillImageDefaults:r}}nodeFactory(){return new Zte}createLabelData({datumIndex:e,rect:t,barAlongX:i,yDatum:s,datum:n,visible:o}){const{stageKey:a,valueKey:r,label:l}=this.properties,{spacing:c,placement:h}=l;if(!l.enabled)return;let d,u,p,g;if(i)switch(d=t.x+t.width/2,p="center",h){case"before":u=t.y-c,g="bottom";break;case"after":u=t.y+t.height+c,g="top";break;default:u=t.y+t.height/2,g="middle"}else switch(u=t.y+t.height/2,g="middle",h){case"before":d=t.x-c,p="right";break;case"after":d=t.x+t.width+c,p="left";break;default:d=t.x+t.width/2,p="center"}const f=this.getSeriesDomain(Xte.Y),x=this.getLabelText(s,n,r,"y",f,l,{itemId:r,value:s,datum:n,stageKey:a,valueKey:r});return{x:d,y:u,textAlign:p,textBaseline:g,text:x,itemId:r,datum:n,datumIndex:e,series:this,visible:o}}updateDatumNodes(e){const t=this.getHighlightStyle(e.isHighlight);e.datumSelection.each((i,s)=>{i.setProperties(HB(i,s)),i.stroke=t?.stroke,i.strokeWidth=t?.strokeWidth??0,i.strokeOpacity=t?.strokeOpacity??1,i.lineDash=t?.lineDash,i.lineDashOffset=t?.lineDashOffset??0,i.opacity=t?.opacity??1})}tooltipStyle(e,t){const{fills:i,strokes:s}=this.properties,n=i[t%i.length]??"black",o=s[t%s.length]??"black",{fillOpacity:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=this.barStyle();return{fill:n,fillOpacity:a,stroke:o,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}}hasItemStylers(){return this.properties.label.itemStyler!=null}};Vb.className="ConeFunnelSeries",Vb.type="cone-funnel";var{commonSeriesOptionsDefs:qte,coneFunnelSeriesThemeableOptionsDef:Qte,without:Jte}=A,eie={...Jte(qte,["showInLegend"]),...Qte,type:Y(Le("cone-funnel")),stageKey:Y(E),valueKey:Y(E)},{ThemeConstants:{CARTESIAN_AXIS_TYPE:WB}}=A,tie={series:{direction:"vertical",fills:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},A.SAFE_RANGE2_OPERATION]},strokes:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},A.SAFE_RANGE2_OPERATION]},fillGradientDefaults:A.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...A.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:A.singleSeriesHighlightStyle(!1)},seriesArea:{padding:{top:20,bottom:20}},axes:{[WB.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[WB.CATEGORY]:{line:{enabled:!1}}}},iie={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"cone-funnel",moduleFactory:e=>new Vb(e),solo:!0,defaultAxes:OB,themeTemplate:tie},sie={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,options:eie,create:e=>new Vb(e)},{FillGradientDefaults:nie,FillPatternDefaults:oie,FillImageDefaults:aie,Label:rie,DropShadow:lie,AbstractBarSeriesProperties:cie,BaseProperties:hie,makeSeriesTooltip:die,AxisLabel:uie,Property:xt}=A,pie=class extends rie{},$B=class extends uie{};y([xt],$B.prototype,"placement",2);var zr=class extends hie{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}};y([xt],zr.prototype,"enabled",2),y([xt],zr.prototype,"fill",2),y([xt],zr.prototype,"fillOpacity",2),y([xt],zr.prototype,"stroke",2),y([xt],zr.prototype,"strokeWidth",2),y([xt],zr.prototype,"strokeOpacity",2),y([xt],zr.prototype,"lineDash",2),y([xt],zr.prototype,"lineDashOffset",2);var Fi=class extends cie{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new nie,this.fillPatternDefaults=new oie,this.fillImageDefaults=new aie,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new zr,this.shadow=new lie().set({enabled:!1}),this.label=new pie,this.stageLabel=new $B,this.tooltip=die()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=this;return{fill:t[e%t.length],fillOpacity:s,stroke:i[e%i.length],strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,opacity:1}}};y([xt],Fi.prototype,"stageKey",2),y([xt],Fi.prototype,"valueKey",2),y([xt],Fi.prototype,"fills",2),y([xt],Fi.prototype,"fillGradientDefaults",2),y([xt],Fi.prototype,"fillPatternDefaults",2),y([xt],Fi.prototype,"fillImageDefaults",2),y([xt],Fi.prototype,"fillOpacity",2),y([xt],Fi.prototype,"strokes",2),y([xt],Fi.prototype,"strokeWidth",2),y([xt],Fi.prototype,"strokeOpacity",2),y([xt],Fi.prototype,"lineDash",2),y([xt],Fi.prototype,"lineDashOffset",2),y([xt],Fi.prototype,"spacingRatio",2),y([xt],Fi.prototype,"itemStyler",2),y([xt],Fi.prototype,"dropOff",2),y([xt],Fi.prototype,"shadow",2),y([xt],Fi.prototype,"label",2),y([xt],Fi.prototype,"stageLabel",2),y([xt],Fi.prototype,"tooltip",2);var{ChartAxisDirection:UB,resetBarSelectionsFn:gie,prepareBarAnimationFunctions:YB,midpointStartingBarPosition:KB,createDatumId:fie,Rect:yie,motion:ZB,applyShapeStyle:mie,getShapeStyle:XB,mergeDefaults:qB}=A,jb=class extends VB{constructor(e){super({moduleCtx:e,animationResetFns:{datum:gie}}),this.properties=new Fi}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}barStyle(){const{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a,fillImageDefaults:r}=this.properties;return{fillOpacity:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a,fillImageDefaults:r}}connectorStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a}=this.properties.dropOff;return{fill:e,fillOpacity:t,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:this.properties.fillGradientDefaults,fillPatternDefaults:this.properties.fillPatternDefaults,fillImageDefaults:this.properties.fillImageDefaults}}nodeFactory(){return new yie}createLabelData({datumIndex:e,rect:t,yDatum:i,datum:s,visible:n}){const{valueKey:o,stageKey:a,label:r}=this.properties;if(!r.enabled)return;const l=this.getSeriesDomain(UB.Y),c=this.getLabelText(i,s,o,"y",l,r,{itemId:o,value:i,datum:s,stageKey:a,valueKey:o});return{x:t.x+t.width/2,y:t.y+t.height/2,textAlign:"center",textBaseline:"middle",text:c,itemId:a,datum:s,datumIndex:e,series:this,visible:n}}getItemStyle({datum:e},t,i){const{id:s,properties:n}=this,{stageKey:o,valueKey:a,itemStyler:r}=n,l=this.getHighlightStyle(i,t),c=qB(l,n.getStyle(t));let h=XB(c,n.fillGradientDefaults,n.fillPatternDefaults,n.fillImageDefaults);if(r!=null){const d=this.ctx.highlightManager?.getActiveHighlight(),u=this.cachedDatumCallback(fie(t,i?"highlight":"node"),()=>{const p=this.getHighlightStateString(d,i,t);return this.callWithContext(r,{seriesId:s,datum:e,highlighted:i,highlightState:p,stageKey:o,valueKey:a,...h})});u&&(h=XB(qB(u,h),n.fillGradientDefaults,n.fillPatternDefaults,n.fillImageDefaults))}return h}updateDatumNodes(e){const{shadow:t}=this.properties,{datumSelection:i,isHighlight:s}=e,n=this.getCategoryDirection()===UB.X,o=this.getShapeFillBBox();i.each((a,r)=>{const{datumIndex:l}=r,c=this.getItemStyle(r,l,s);mie(a,c,o),a.visible=n?r.width>0:r.height>0,a.crisp=r.crisp,a.fillShadow=t})}tooltipStyle(e,t){return this.getItemStyle({datumIndex:t,datum:e},t,!1)}animateEmptyUpdateReady(e){super.animateEmptyUpdateReady(e);const{datumSelection:t}=e,i=this.isVertical(),n=YB(KB(i,"normal"));ZB.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],n)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e);const{datumSelection:t}=e,{processedData:i}=this,s=i?.reduced?.diff?.[this.id],n=YB(KB(this.isVertical(),"fade"));ZB.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],n,(o,a)=>a.xValue,s)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};jb.className="FunnelSeries",jb.type="funnel";var{commonSeriesOptionsDefs:xie,funnelSeriesThemeableOptionsDef:bie,without:vie}=A,Sie={...bie,...vie(xie,["showInLegend"]),type:Y(Le("funnel")),stageKey:Y(E),valueKey:Y(E)},Mie={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"funnel",moduleFactory:e=>new jb(e),solo:!0,defaultAxes:OB,themeTemplate:fte},Die={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,options:Sie,create:e=>new jb(e)},QB=class{*[Symbol.iterator](){const{node:e,datum:t}=this;e&&t&&(yield{node:e,datum:t})}nodes(){return this.node?[this.node]:[]}update(e,t,i,s){const n=e.nodes();if(n.length===0)this.node?.remove(),this.node=void 0;else{this.node===void 0&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,t.appendChild(this.node));const o=n[0],a=n.toReversed().find(r=>r.datum.datum.value>r.datum.datum.segmentStart)??n[n.length-1];this.node.datum=this.datum=o.datum,s(this.node,o,a)}}},JB={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function eF(e,t){if(e==null)return"";const{min:i,max:s}=t,n=i!==0?Math.ceil(Math.log10(Math.abs(i))):0,o=s!==0?Math.ceil(Math.log10(Math.abs(s))):0,a=Math.max(2-Math.max(n,o),0);return e.toFixed(a)}function rf(e,t,i,s){if(i.text!=null)return i.text;const n=s??i.value;let o;if(i?.formatter!=null&&(o=nf(t,i.formatter,{seriesId:e,datum:void 0,value:n})),o!=null)return String(o)}function tF({path:e,x:t,y:i,size:s}){e.moveTo(t,i-s/2),e.lineTo(t,i+s/2)}function iF(e,t){const i=rc(e.datumUnion.nodes(),e.targetSelection.nodes());return e.pickNodeNearestDistantObject(t,i)}function sF(e,t){const i=[{data:e.contextNodeData?.nodeData,selection:e.datumUnion},{data:e.contextNodeData?.targetData,selection:e.targetSelection}].filter(l=>l.data&&l.data.length>0),s=ve(0,t.otherIndex+t.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:n,selection:o}=i[s];if(n==null||n.length===0)return;const a=ve(0,t.datumIndex,n.length-1),r=n[a];for(const l of o)if(l.datum===r)return{bounds:l.node,clipFocusBox:!0,datum:r,datumIndex:a,otherIndex:s}}var{BaseProperties:nF,Property:Du}=A,Hb=class extends nF{getSegments(e,t){const{values:i,step:s,count:n}=this,o=Math.min(...e.domain),a=Math.max(...e.domain);let r;if(i!=null){const l=i.filter(c=>c>o&&c<a).sort((c,h)=>c-h);r=[o,...l,a]}else if(s!=null){const l=[];for(let c=o;c<a;c+=s)l.push(c);l.push(a),r=l}else if(n!=null){const l=n+1;r=Array.from({length:l+1},(c,h)=>h/l*(a-o)+o)}else{const l=e.ticks({nice:!0,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.filter(c=>c>o&&c<a);r=l!=null?[o,...l,a]:void 0}return r!=null&&r.length>t&&(X.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),r=void 0),r??(r=[o,a]),r}};y([Du],Hb.prototype,"values",2),y([Du],Hb.prototype,"step",2),y([Du],Hb.prototype,"count",2);var lf=class extends nF{constructor(){super(...arguments),this.enabled=!1,this.interval=new Hb,this.spacing=0}};y([Du],lf.prototype,"enabled",2),y([Du],lf.prototype,"interval",2),y([Du],lf.prototype,"spacing",2);var{BaseProperties:Wb,makeSeriesTooltip:Aie,SeriesProperties:Iie,PropertiesArray:OI,Property:De,Label:kie,AxisLabel:Cie}=A,oF=class extends kie{};y([De],oF.prototype,"spacing",2);var Ms=class extends Wb{constructor(){super(...arguments),this.value=0,this.label=new oF}};y([De],Ms.prototype,"text",2),y([De],Ms.prototype,"value",2),y([De],Ms.prototype,"shape",2),y([De],Ms.prototype,"placement",2),y([De],Ms.prototype,"spacing",2),y([De],Ms.prototype,"size",2),y([De],Ms.prototype,"rotation",2),y([De],Ms.prototype,"fill",2),y([De],Ms.prototype,"fillOpacity",2),y([De],Ms.prototype,"stroke",2),y([De],Ms.prototype,"strokeWidth",2),y([De],Ms.prototype,"strokeOpacity",2),y([De],Ms.prototype,"lineDash",2),y([De],Ms.prototype,"lineDashOffset",2),y([De],Ms.prototype,"label",2);var Rn=class extends Wb{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new OI(A.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([De],Rn.prototype,"enabled",2),y([De],Rn.prototype,"thickness",2),y([De],Rn.prototype,"thicknessRatio",2),y([De],Rn.prototype,"fills",2),y([De],Rn.prototype,"fillMode",2),y([De],Rn.prototype,"fill",2),y([De],Rn.prototype,"fillOpacity",2),y([De],Rn.prototype,"stroke",2),y([De],Rn.prototype,"strokeWidth",2),y([De],Rn.prototype,"strokeOpacity",2),y([De],Rn.prototype,"lineDash",2),y([De],Rn.prototype,"lineDashOffset",2);var cf=class extends Wb{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};y([De],cf.prototype,"values",2),y([De],cf.prototype,"step",2),y([De],cf.prototype,"minSpacing",2),y([De],cf.prototype,"maxSpacing",2);var aF=class extends Cie{constructor(){super(...arguments),this.placement=void 0}};y([De],aF.prototype,"placement",2);var Fs=class extends Wb{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new OI(A.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 cf,this.label=new aF}};y([De],Fs.prototype,"min",2),y([De],Fs.prototype,"max",2),y([De],Fs.prototype,"fills",2),y([De],Fs.prototype,"fillMode",2),y([De],Fs.prototype,"fill",2),y([De],Fs.prototype,"fillOpacity",2),y([De],Fs.prototype,"stroke",2),y([De],Fs.prototype,"strokeWidth",2),y([De],Fs.prototype,"strokeOpacity",2),y([De],Fs.prototype,"lineDash",2),y([De],Fs.prototype,"lineDashOffset",2),y([De],Fs.prototype,"defaultFill",2),y([De],Fs.prototype,"interval",2),y([De],Fs.prototype,"label",2);var $b=class extends _a{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};y([De],$b.prototype,"text",2),y([De],$b.prototype,"placement",2),y([De],$b.prototype,"avoidCollisions",2);var zs=class extends Iie{constructor(){super(...arguments),this.value=0,this.segmentation=new lf,this.defaultColorRange=[],this.targets=new OI(Ms),this.defaultTarget=new Ms,this.defaultScale=new Fs,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new Fs,this.bar=new Rn,this.label=new $b,this.tooltip=Aie()}};y([De],zs.prototype,"value",2),y([De],zs.prototype,"segmentation",2),y([De],zs.prototype,"defaultColorRange",2),y([De],zs.prototype,"targets",2),y([De],zs.prototype,"defaultTarget",2),y([De],zs.prototype,"defaultScale",2),y([De],zs.prototype,"direction",2),y([De],zs.prototype,"thickness",2),y([De],zs.prototype,"cornerRadius",2),y([De],zs.prototype,"cornerMode",2),y([De],zs.prototype,"margin",2),y([De],zs.prototype,"scale",2),y([De],zs.prototype,"bar",2),y([De],zs.prototype,"label",2),y([De],zs.prototype,"tooltip",2);var{CachedTextMeasurerPool:Tie,BBox:Lie}=A;function PI(e){const{x0:t,y0:i,x1:s,y1:n,horizontalInset:o,verticalInset:a}=e,r=Math.min(t,s)+o,l=Math.min(i,n)+a,c=Math.max(Math.abs(s-t)-2*o,0),h=Math.max(Math.abs(n-i)-2*a,0);return{x:r,y:l,width:c,height:h}}function wie(e,t){if(t==null)return!0;const i=PI(e),s=1e-6,n=i.x+s,o=i.y+s,a=i.x+i.width-s,r=i.y+i.height-s,l=t.x,c=t.x+t.width,h=t.y,d=t.y+t.height;return Math.max(n,l)<=Math.min(a,c)&&Math.max(o,h)<=Math.min(r,d)}function RI(e){const{clipX0:t,clipX1:i,clipY0:s,clipY1:n}=e;return t!=null&&i!=null||s!=null&&n!=null}function Nie(e){if(!RI(e))return;const{x0:t,y0:i,x1:s,y1:n}=e,{x:o,y:a,width:r,height:l}=PI(e);let{clipX0:c,clipX1:h,clipY0:d,clipY1:u}=e;(c==null||h==null)&&(c=t,h=s),(d==null||u==null)&&(d=i,u=n);const p=Math.min(c,h),g=Math.min(d,u),f=Math.abs(h-c),x=Math.abs(u-d);return c=Math.max(o,p),d=Math.max(a,g),h=Math.min(o+r,p+f),u=Math.min(a+l,g+x),new Lie(Math.min(c,h),Math.min(d,u),Math.abs(h-c),Math.abs(u-d))}function rF(e,t){const i=e?"initial":"update";return{node:{fromFn(n,o){const a=n.previousDatum;let{x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:g}=a??o;const{horizontalInset:f,verticalInset:x}=o,m=a!=null&&RI(a),b=RI(o);return m&&b||(!m&&b?({x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:g}=o,e&&(t?p=o.clipX0:g=o.clipY0)):m&&!b?({x0:r,y0:l,x1:c,y1:h}=o,d=void 0,u=void 0,p=void 0,g=void 0):e&&(t?c=r:h=l)),{x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:g,horizontalInset:f,verticalInset:x,phase:i}},toFn(n,o){const{x0:a,y0:r,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:f}=o;return{x0:a,y0:r,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:f}},applyFn(n,o){n.setProperties(Ub(n,o))}}}}function Ub(e,t){const{x:i,y:s,width:n,height:o}=PI(t),a=Nie(t),r=wie(t,a);return{x:i,y:s,width:n,height:o,clipBBox:a,visible:r}}var Eie={Before:"right",Center:"center",After:"left"},Oie={Before:"top",Center:"middle",After:"bottom"},Pie={Before:-1,Center:-.5,After:0},Rie={Before:0,Center:-.5,After:-1};function Bie(e,t,i,s,n,o){const{seriesRect:a,gaugeRect:r,barRect:l}=n,{padding:c,horizontal:h}=s;i.each((d,u)=>{const p=rf(e.id,t,u,o?.label);let g,f;u.placement==="outside-start"?h?(g=r.x,f=a.height):(g=a.width,f=a.height-(r.y+r.height)):u.placement==="outside-end"?h?(g=a.width-(r.x+r.width),f=a.height):(g=a.width,f=r.y):u.avoidCollisions&&(g=r.width,f=r.height);let x;if(p==null)return;if(g!=null&&f!=null)x=Yg(p,u,{padding:c},()=>({width:g,height:f,meta:null}))?.[0];else{const P={fontSize:u.fontSize,fontStyle:u.fontStyle,fontWeight:u.fontWeight,fontFamily:u.fontFamily,lineHeight:u.lineHeight},{width:_,height:F}=Tie.measureText(p,{font:P});x={text:p,fontSize:u.fontSize,lineHeight:pu(u,u.fontSize),width:_,height:F}}if(x==null){d.visible=!1;return}const m=h?r.x:r.y+r.height,b=h?r.x+r.width:r.y,v=h?l.x:l.y+l.height,S=h?l.x+l.width:l.y,D=u.spacing*(h?1:-1);let C,T,k,L;switch(u.placement){case"outside-start":C=-1/0,T=1/0,k=m-D,L="Before";break;case"outside-end":C=-1/0,T=1/0,k=b+D,L="After";break;case"inside-start":C=m,T=S,k=m+D,L="After";break;case"inside-end":C=S,T=b,k=b-D,L="Before";break;case"inside-center":C=m,T=b,k=(m+b)/2,L="Center";break;case"bar-inside":C=v,T=S,k=(v+S)/2,L="Center";break;case"bar-inside-end":C=v,T=S,k=S-D,L="Before";break;case"bar-outside-end":C=S,T=b,k=S+D,L="After";break;case"bar-end":C=-1/0,T=1/0,k=S,L="Center";break}const N=h?k:r.x+r.width/2,w=h?r.y+r.height/2:k;let O,R;h?(O=N+Pie[L]*x.width,R=O+x.width):(O=w+Rie[L]*x.height,R=O+x.height);const B=Math.min(O,R)>=Math.min(C,T)&&Math.max(O,R)<=Math.max(C,T);if(u.avoidCollisions&&!B){d.visible=!1;return}d.visible=!0,d.text=x.text,d.fontSize=x.fontSize,d.lineHeight=x.lineHeight,d.textAlign=h?Eie[L]:"center",d.textBaseline=h?"middle":Oie[L],d.x=N,d.y=w})}var{fromToMotion:BI,resetMotion:Fie,SeriesNodePickMode:lF,StateMachine:zie,createDatumId:cF,CachedTextMeasurerPool:_ie,toRadians:hF,BBox:Yl,Group:Ih,PointerEvents:dF,Selection:kh,Rect:Gie,Text:uF,TransformableText:Vie,Marker:jie,LinearScale:Hie,AxisTickGenerator:Wie,NiceMode:$ie,easing:Uie,getColorStops:Yie,findRangeExtent:Kie,tickFormat:Zie,mergeDefaults:Xie,applyShapeStyle:qie}=A,Qie={before:180,middle:0,after:0},Jie={before:90,middle:0,after:-90},ese=class{constructor(e,t){this.gauge=e,this.ctx=t}get scale(){return this.gauge.scale}get label(){return this.gauge.properties.scale.label}get interval(){return this.gauge.properties.scale.interval}tickFormatter(e,t,i,s,n){const{format:o}=this.label;let a;return o!=null&&(a=Zie(t,typeof o=="string"?o:void 0)),(r,l)=>{const{formatter:c}=this.label;let h;return c&&(h??(h=nf(this.ctx,c,{value:r,index:l,domain:e,boundSeries:void 0}))),h??(h=a?.(r)),h??this.gauge.formatLabel(r)}}inRange(){return!0}},Yb=class extends A.Series{constructor(e){super({moduleCtx:e,pickModes:[lF.EXACT_SHAPE_MATCH,lF.NEAREST_NODE]}),this.properties=new zs,this.seriesRect=Yl.NaN,this.gaugeRect=Yl.NaN,this.scale=new Hie,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new Ih({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Ih({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Ih({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Ih({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Ih({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Ih({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Ih({name:"tickGroup"})),this.scaleSelection=kh.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=kh.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=kh.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=kh.select(this.itemTargetLabelGroup,uF),this.labelSelection=kh.select(this.itemLabelGroup,uF),this.highlightTargetSelection=kh.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=kh.select(this.tickGroup,Vie),this.datumUnion=new QB,this.axis=new ese(this,e),this.tickGenerator=new Wie(this.axis),this.animationState=new zie("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=dF.None,this.tickGroup.pointerEvents=dF.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return this.properties.direction==="horizontal"}get hasData(){return!0}nodeFactory(){const e=new Gie;return e.crisp=!0,e}markerFactory(){return new jie}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){return eF(e,this.properties.scale)}createLinearGradient(e,t,i){const{properties:s,horizontal:n}=this,{defaultColorRange:o}=s;return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:Yie(t,o,e.domain,i),rotation:n?90:0}}getShapeFillBBox(){const{properties:e,originX:t,originY:i,horizontal:s,scale:n}=this,{thickness:o}=e,a=Kie(n.range);return new Yl(t,i,s?a:o,s?o:a)}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map(i=>{const{text:s=t.text,value:n=t.value??0,shape:o=t.shape??"triangle",rotation:a=t.rotation??0,strokeWidth:r=t.strokeWidth??0,placement:l=t.placement??"middle",spacing:c=t.spacing??0,size:h=t.size??0,fill:d=t.fill??"black",fillOpacity:u=t.fillOpacity??1,stroke:p=t.stroke??"black",strokeOpacity:g=t.strokeOpacity??1,lineDash:f=t.lineDash??[0],lineDashOffset:x=t.lineDashOffset??0}=i,{enabled:m=t.label.enabled,color:b=t.label.color??"black",fontStyle:v=t.label.fontStyle??"normal",fontWeight:S=t.label.fontWeight??"normal",fontSize:D=t.label.fontSize,fontFamily:C=t.label.fontFamily,spacing:T=t.label.spacing??0}=i.label;return{text:s,value:n,shape:o,placement:l,spacing:c,size:h,rotation:a,fill:d,fillOpacity:u,stroke:p,strokeWidth:r,strokeOpacity:g,lineDash:f,lineDashOffset:x,label:{enabled:m,color:b,fontStyle:v,fontWeight:S,fontSize:D,fontFamily:C,spacing:T}}})}getTargetPoint(e){const{properties:t,originX:i,originY:s,horizontal:n,scale:o,gaugeRect:a}=this,{thickness:r}=t,{value:l,placement:c,spacing:h,size:d}=e,u=o.convert(l);let p;switch(c){case"before":p=-(h+d/2);break;case"after":p=r+h+d/2;break;default:p=r/2;break}return{x:i+a.x+(n?u:p),y:s+a.y+(n?p:u)}}getTargetLabel(e){const{size:t,placement:i,label:s}=e,{spacing:n,color:o,fontStyle:a,fontWeight:r,fontSize:l,fontFamily:c}=s,h=void 0,d=t/2+n;let u,p,g=0,f=0;return this.horizontal?(u="center",i==="after"?(p="top",f=d):(p="bottom",f=-d)):(p="middle",i==="before"?(u="right",g=-d):(u="left",g=d)),{offsetX:g,offsetY:f,fill:o,textAlign:u,textBaseline:p,fontStyle:a,fontWeight:r,fontSize:l,fontFamily:c,lineHeight:h}}labelDatum(e,t){const{placement:i,avoidCollisions:s,spacing:n,text:o,color:a,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:f=x=>this.formatLabel(x.value)}=e;return{placement:i,avoidCollisions:s,spacing:n,text:o,value:t,fill:a,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:f}}verticalLabelInset(){const{properties:e}=this,{label:t}=e,i=t.text?.split(`
`),s=pu(t,t.fontSize)*(i?.length??1);return t.spacing+s}horizontalLabelInset(){const{scale:e,properties:t}=this,{scale:i,label:s}=t,n=s.text?.split(`
`),o=_ie.getMeasurer({font:s}),a=i.interval.values??e.ticks({nice:!1,interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5})?.ticks??[],l=(n??a?.map(c=>rf(this.id,this.ctx,this.labelDatum(s,c))??"")).reduce((c,h)=>{const{width:d}=o.measureText(h);return Math.max(c,d)},0);return s.spacing+l}createNodeData(){const{id:e,properties:t,horizontal:i,scale:s,seriesRect:n}=this,{value:o,segmentation:a,thickness:r,cornerRadius:l,cornerMode:c,bar:h,scale:d,label:u}=t;s.domain=[d.min,d.max],s.range=i?[0,n.width]:[n.height,0];let p,g;i?(g=1,p=Math.PI/2):d.label.placement==="before"?(g=1,p=0):(g=-1,p=0);const f=p-Math.PI/2;let x,m,b,v;i?(x=0,m=n.width,b=(n.height-r)/2,v=b+r,u.placement==="outside-start"?x+=this.horizontalLabelInset():u.placement==="outside-end"&&(m-=this.horizontalLabelInset())):(x=(n.width-r)/2,m=x+r,v=0,b=n.height,u.placement==="outside-start"?b-=this.verticalLabelInset():u.placement==="outside-end"&&(v+=this.verticalLabelInset())),this.gaugeRect=new Yl(Math.min(x,m),Math.min(b,v),Math.abs(m-x),Math.abs(v-b));const S=0,D=0;s.domain=[d.min,d.max],s.range=i?[x,m]:[b,v];const{ticks:C}=this.tickGenerator.generateTicks({domain:s.domain,range:this.range,reverse:!1,primaryTickCount:void 0,defaultTickMinSpacing:0,visibleRange:[0,1],niceMode:$ie.Off,labelX:0,parallelFlipRotation:p,regularFlipRotation:f,sideFlag:g,sizeLimit:void 0,removeOverflowLabels:!1}).tickData,T=!1,k=this.getTargets(),L=[],N=[],w=[],O=[],[R,B]=s.range,P=Math.abs(B-R),_=i?s.convert(o):m,F=i?v:s.convert(o),W=a.enabled?a.spacing/2:0,H=i?W:0,j=i?0:W,V=Math.min(h.thickness??Math.round(h.thicknessRatio*r),r),$=-(r-V)/2,U=i?0:$,Z=i?$:0,q=c==="item",Q=Math.ceil(P);let ie=a.enabled?a.interval.getSegments(s,Q):void 0;const ne=h.fill??this.createLinearGradient(s,h.fills,h.fillMode),oe=d.fill??(h.enabled&&d.fills.length===0?d.defaultFill:void 0)??this.createLinearGradient(s,d.fills,d.fillMode);if(ie==null&&q){const re=Math.min(...s.domain),ee=Math.max(...s.domain),Me={value:o,segmentStart:re,segmentEnd:ee};if(h.enabled){const ye=Math.min(l,V/2,P/2)*(T?-1:1),be=i?ye:0,Se=i?0:ye;L.push({series:this,itemId:"value",datum:Me,datumIndex:{type:0},type:0,x0:S+x-be-U,y0:D+b-Se-Z,x1:S+_+be+U,y1:D+F+Se+Z,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:ne,horizontalInset:H,verticalInset:j})}const Ie=Math.min(l,r/2,P/2)*(T?-1:1),xe=i?Ie:0,ze=i?0:Ie;O.push({series:this,itemId:"scale",datum:Me,datumIndex:{type:0},type:0,x0:S+x-xe,y0:D+b-ze,x1:S+m+xe,y1:D+v+ze,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:oe,horizontalInset:H,verticalInset:j})}else{ie??(ie=s.domain);const re=S+x-U,ee=D+b-Z,Me=S+_+U,Ee=D+F+Z;for(let Ie=0;Ie<ie.length-1;Ie+=1){const xe=ie[Ie+0],ze=ie[Ie+1],he={value:o,segmentStart:xe,segmentEnd:ze},ye=Ie===0,be=Ie===ie.length-2,Se=s.convert(xe),Oe=s.convert(ze),_e=q||ye?l:0,Mt=q||be?l:0,kt=i?_e:Mt,Ki=Mt,zn=i?Mt:_e,Gr=_e;h.enabled&&L.push({series:this,itemId:`value-${Ie}`,datum:he,datumIndex:{type:0},type:0,x0:S+(i?Se:x),y0:D+(i?b:Se),x1:S+(i?Oe:m),y1:D+(i?v:Oe),clipX0:re,clipY0:ee,clipX1:Me,clipY1:Ee,topLeftCornerRadius:kt,topRightCornerRadius:Ki,bottomRightCornerRadius:zn,bottomLeftCornerRadius:Gr,fill:ne,horizontalInset:H,verticalInset:j}),O.push({series:this,itemId:`scale-${Ie}`,datum:he,datumIndex:{type:0},type:0,x0:S+(i?Se:x),y0:D+(i?b:Se),x1:S+(i?Oe:m),y1:D+(i?v:Oe),clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:kt,topRightCornerRadius:Ki,bottomRightCornerRadius:zn,bottomLeftCornerRadius:Gr,fill:oe,horizontalInset:H,verticalInset:j})}}u.enabled&&w.push(this.labelDatum(u,o));const le=i?Qie:Jie;for(let re=0;re<k.length;re+=1){const ee=k[re],{value:Me,text:Ee,shape:Ie,size:xe,fill:ze,fillOpacity:he,stroke:ye,strokeWidth:be,strokeOpacity:Se,lineDash:Oe,lineDashOffset:_e}=ee,Mt=this.getTargetPoint(ee),kt=hF(ee.rotation+le[ee.placement]);N.push({series:this,itemId:`target-${re}`,midPoint:Mt,datum:{value:Me},datumIndex:{type:1,index:re},type:1,value:Me,text:Ee,x:Mt.x,y:Mt.y,shape:Ie,size:xe,rotation:kt,fill:ze,fillOpacity:he,stroke:ye,strokeOpacity:Se,strokeWidth:be,lineDash:Oe,lineDashOffset:_e,label:this.getTargetLabel(ee)})}return{itemId:e,nodeData:L,tickData:C,targetData:N,labelData:w,scaleData:O}}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(e!=null&&e.series===this&&e.type===1)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,targetSelection:s,targetLabelSelection:n,scaleSelection:o,highlightTargetSelection:a,tickSelection:r}=this;this.seriesRect=e??Yl.NaN;const l=this.checkResize(e);this.updateSelections(l),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const c=this.contextNodeData?.nodeData??[],h=this.contextNodeData?.labelData??[],d=this.contextNodeData?.targetData??[],u=this.contextNodeData?.scaleData??[],p=this.contextNodeData?.tickData??[],g=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:u,scaleSelection:o}),this.updateScaleNodes({scaleSelection:o}),this.targetSelection=this.updateTargetSelection({targetData:d,targetSelection:s}),this.updateTargetNodes({targetSelection:s,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:d,targetLabelSelection:n}),this.updateTargetLabelNodes({targetLabelSelection:n}),this.datumSelection=this.updateDatumSelection({nodeData:c,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:h,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:g!=null?[g]:[],targetSelection:a}),this.updateTargetNodes({targetSelection:a,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:p,tickSelection:r}),this.updateTickNodes({tickSelection:r}),l&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>cF(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i,properties:s}=this,{bar:n}=s,{fillOpacity:o,stroke:a,strokeOpacity:r,lineDash:l,lineDashOffset:c}=n,h=n.strokeWidth,d=i.animationManager.isSkipped(),u=this.getShapeFillBBox();t.each((p,g)=>{const{topLeftCornerRadius:f,topRightCornerRadius:x,bottomRightCornerRadius:m,bottomLeftCornerRadius:b,fill:v}=g;p.fill=v,p.fillBBox=u,p.fillOpacity=o,p.stroke=a,p.strokeOpacity=r,p.strokeWidth=h,p.lineDash=l,p.lineDashOffset=c,p.topLeftCornerRadius=f,p.topRightCornerRadius=x,p.bottomRightCornerRadius=m,p.bottomLeftCornerRadius=b,p.pointerEvents=this.properties.bar.enabled?A.PointerEvents.All:A.PointerEvents.None,(d||p.previousDatum==null)&&p.setProperties(Ub(p,g))}),this.datumUnion.update(t,this.itemGroup,A.Rect,(p,g,f)=>{p.pointerEvents=A.PointerEvents.None,p.clipBBox??(p.clipBBox=new Yl(NaN,NaN,NaN,NaN)),p.x=g.x,p.y=g.y,p.clipBBox.x=g.clipBBox?.x??g.x,p.clipBBox.y=g.clipBBox?.y??g.y,this.horizontal?(p.height=p.clipBBox.height=f.height,p.width=f===g?f.width:f.x+f.width,p.clipBBox.width=p.width-(f.width-(f.clipBBox?.width??f.width)),p.topLeftCornerRadius=g.topLeftCornerRadius,p.bottomLeftCornerRadius=g.bottomLeftCornerRadius,p.topRightCornerRadius=f.topRightCornerRadius,p.bottomRightCornerRadius=f.bottomRightCornerRadius):(p.width=p.clipBBox.width=f.width,p.height=f===g?f.height:f.x+f.height,p.clipBBox.height=p.height-(f.height-(f.clipBBox?.height??f.height)),p.topLeftCornerRadius=g.topLeftCornerRadius,p.topRightCornerRadius=g.topRightCornerRadius,p.bottomLeftCornerRadius=f.bottomLeftCornerRadius,p.bottomRightCornerRadius=f.bottomRightCornerRadius)})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>cF(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,{scale:i}=this.properties,{fillOpacity:s,stroke:n,strokeOpacity:o,strokeWidth:a,lineDash:r,lineDashOffset:l}=i,c=this.getShapeFillBBox();t.each((h,d)=>{const{topLeftCornerRadius:u,topRightCornerRadius:p,bottomRightCornerRadius:g,bottomLeftCornerRadius:f,fill:x}=d;h.fill=x,h.fillBBox=c,h.fillOpacity=s,h.stroke=n,h.strokeOpacity=o,h.strokeWidth=a,h.lineDash=r,h.lineDashOffset=l,h.topLeftCornerRadius=u,h.topRightCornerRadius=p,h.bottomRightCornerRadius=g,h.bottomLeftCornerRadius=f,h.setProperties(Ub(h,d))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetNodes(e){const{targetSelection:t,isHighlight:i}=e;t.each((s,n)=>{const{x:o,y:a,shape:r,size:l,rotation:c,fill:h,fillOpacity:d,stroke:u,strokeOpacity:p,strokeWidth:g,lineDash:f,lineDashOffset:x}=n,m=this.getHighlightStyle(i,n.datumIndex),b=Xie(m,{fill:h,fillOpacity:d,stroke:u,strokeOpacity:p,strokeWidth:g,lineDash:f,lineDashOffset:x,opacity:1});qie(s,b),s.size=l,s.shape=r==="line"?tF:r,s.translationX=o,s.translationY=a,s.rotation=c})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((i,s)=>{const{x:n,y:o,text:a}=s,{offsetX:r,offsetY:l,fill:c,fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p,textAlign:g,textBaseline:f}=s.label;i.visible=!0,i.x=n+r,i.y=o+l,i.text=a,i.fill=c,i.fontStyle=h,i.fontWeight=d,i.fontSize=u,i.fontFamily=p,i.textAlign=g,i.textBaseline=f})}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,t=>t.tickId)}updateTickNodes(e){const{gaugeRect:t,properties:i}=this,s=i.defaultScale,{enabled:n,color:o,fontFamily:a=s.label.fontFamily,fontSize:r=s.label.fontSize,fontStyle:l,fontWeight:c=s.label.fontWeight,spacing:h}=i.scale.label;let{placement:d}=i.scale.label;const u=hF(i.scale.label.rotation??0);let p,g,f,x;this.horizontal?(d??(d="after"),p="center",g=d==="before"?"bottom":"top",x=this.originY+t.y+(d==="before"?-h:t.height+h)):(d??(d="before"),p=d==="before"?"end":"start",g="middle",f=this.originX+t.x+(d==="before"?-h:t.width+h)),e.tickSelection.each((m,b)=>{if(!n){m.visible=!1;return}const v=f??b.translation,S=x??b.translation;m.visible=!0,m.text=b.tickLabel,m.fill=o,m.fontFamily=a,m.fontSize=r,m.fontStyle=l,m.fontWeight=c,m.textBaseline=g,m.textAlign=p,m.x=v,m.y=S,m.rotationCenterX=v,m.rotationCenterY=S,m.rotation=u})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,t=>"primary")}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((s,n)=>{s.fill=n.fill,s.fontStyle=n.fontStyle,s.fontWeight=n.fontWeight,s.fontFamily=n.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(e.text==null)return!1;return!0}formatLabelText(e){const{labelSelection:t,horizontal:i,scale:s,seriesRect:n,gaugeRect:o}=this,{x:a,y:r,width:l,height:c}=o,h=e?.label??this.properties.value;let d;if(i){const g=s.convert(h);d=new Yl(a,r,g-a,c)}else{const g=s.convert(h);d=new Yl(a,g,l,c-g)}const u={seriesRect:n,gaugeRect:o,barRect:d},{margin:p}=this.properties;Bie(this,this.ctx,t,{padding:p,horizontal:i},u,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),Fie([this.datumSelection],Ub),this.formatLabelText()}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i=0,s=0;if(this.labelSelection.each((n,o)=>{n.opacity=1,i=n.previousDatum?.value??e.from??o.value,s=o.value}),!this.labelsHaveExplicitText())if(i===s)this.formatLabelText({label:s});else{const n=`${this.id}_labels`;t.animate({id:n,groupId:"label",from:{label:i},to:{label:s},phase:e.phase??"update",ease:Uie.easeOut,onUpdate:o=>this.formatLabelText(o),onStop:()=>this.formatLabelText({label:s})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=rF(!0,this.horizontal);BI(this.id,"node",e,[this.datumSelection],t,(i,s)=>s.itemId),BI(this.id,"label",e,[this.labelSelection],JB,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=rF(!1,this.horizontal);BI(this.id,"node",e,[this.datumSelection],t,(i,s)=>s.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[0,1]}dataCount(){return NaN}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:s}=i;let n,o;if(e.type===0?(n=i.value,o=i.label.text):{value:n,text:o}=i.targets[e.index],n!=null)return this.formatTooltipWithContext(s,{data:[{label:o,fallbackLabel:"Value",value:this.formatLabel(n)}]},{seriesId:t,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(e){return iF(this,e)}pickFocus(e){return sF(this,e)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return!1}};Yb.className="LinearGaugeSeries",Yb.type="linear-gauge";var tse={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"linear-gauge",moduleFactory:e=>new Yb(e),themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},A.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",A.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{spacing:11}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:1},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},label:{...A.LABEL_BOXING_DEFAULTS,enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:2},minimumFontSize:A.FONT_SIZE.SMALL,spacing:18,color:{$ref:"chartBackgroundColor"}},margin:4,tooltip:{range:{$path:["/tooltip/range",10]}}}}},ise={type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,options:A.linearGaugeSeriesOptionsDef,create:e=>new Yb(e)},hf={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1},gradientLegend:{enabled:!1,...A.LEGEND_CONTAINER_THEME}};function _s(e){const t=A.deepClone(e);return A.jsonWalk(t,i=>{typeof i=="object"&&"$palette"in i&&(i.$mapPalette=i.$palette,delete i.$palette)}),t}var sse=1e-9;function pF(e,t,i,s){const[n,o]=e,[a,r]=t,l=a-n,c=r-o,h=l*l+c*c;let d,u;if(Math.abs(h)<sse)d=n,u=o;else{let f=((i-n)*l+(s-o)*c)/h;f=Math.max(0,Math.min(1,f)),d=n+f*(a-n),u=o+f*(r-o)}const p=i-d,g=s-u;return p*p+g*g}function gF(e,t,i){let s=1/0,n=e[e.length-1];for(const o of e)s=Math.min(s,pF(n,o,t,i)),n=o;return Math.sqrt(s)}function FI(e){let[t,i]=e[0],s=0;for(let n=1;n<e.length;n+=1){const[o,a]=e[n],r=Math.hypot(o-t,a-i);s+=r,t=o,i=a}return s}function Kb(e){if(e.length===0)return;const t=FI(e)/2;let[i,s]=e[0],n=0;for(let o=1;o<e.length;o+=1){const[a,r]=e[o],l=Math.hypot(a-i,r-s),c=n+l;if(c>t){const h=(t-n)/l,d=[i+(a-i)*h,s+(r-s)*h],u=Math.atan2(r-s,a-i);return{point:d,angle:u}}n=c,i=a,s=r}}var{LonLatBBox:nse}=A;function Ch(e,t){return e.forEach(i=>{const[s,n]=i;t=nse.extend(t,s,n,s,n)}),t}function ose(e){if(e.length===0)return;let t=0,i=0,s=0,[n,o]=e[e.length-1];for(const[a,r]of e){const l=n*r-a*o;s+=l,t+=(n+a)*l,i+=(o+r)*l,n=a,o=r}return s*=3,[t/s,i/s]}function Zb(e,t,i){let s=!1,n=1/0;for(const o of e){let a=o[o.length-1],[r,l]=a;for(const c of o){const[h,d]=c;d>i!=l>i&&t<(r-h)*(i-d)/(l-d)+h&&(s=!s),n=Math.min(n,pF(a,c,t,i)),a=c,r=h,l=d}}return(s?-1:1)*Math.sqrt(n)}var{Path:ase,ExtendedPath2D:rse,BBox:lse,SceneChangeDetection:cse,SceneObjectChangeDetection:hse,objectsEqual:dse}=A,Au=class extends ase{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new rse}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:e}=this;this.strokePath.clear(),this.path.clear(),this.bbox=e!=null?this.drawGeometry(e,void 0):void 0}drawPath(e){super.drawPath(e),this.renderStroke(e,this.strokePath.getPath2D())}containsPoint(e,t){const{projectedGeometry:i}=this;return i==null||!this.getBBox().containsPoint(e,t)?!1:this.geometryDistance(i,e,t)<=0}distanceSquared(e,t){const{projectedGeometry:i}=this;if(i==null)return 1/0;const s=this.geometryDistance(i,e,t);return s>0?s*s:0}geometryDistance(e,t,i){const{renderMode:s,strokeWidth:n}=this,o=(s&1)!==0,a=(s&2)!==0,r=Math.max(n/2,1)+1;switch(e.type){case"GeometryCollection":return e.geometries.reduce((l,c)=>Math.min(l,this.geometryDistance(c,t,i)),1/0);case"MultiPolygon":return o?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(Zb(c,t,i),0)),1/0):1/0;case"Polygon":return o?Math.max(Zb(e.coordinates,t,i),0):1/0;case"MultiLineString":return a?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(gF(c,t,i)-r,0)),1/0):1/0;case"LineString":return a?Math.max(gF(e.coordinates,t,i)-r,0):1/0;case"MultiPoint":case"Point":default:return 1/0}}drawGeometry(e,t){const{renderMode:i,path:s,strokePath:n}=this,o=(i&1)!==0,a=(i&2)!==0;switch(e.type){case"GeometryCollection":e.geometries.forEach(r=>{t=this.drawGeometry(r,t)});break;case"MultiPolygon":o&&e.coordinates.forEach(r=>{t=this.drawPolygon(s,r,t)});break;case"Polygon":o&&(t=this.drawPolygon(s,e.coordinates,t));break;case"LineString":a&&(t=this.drawLineString(n,e.coordinates,t,!1));break;case"MultiLineString":a&&e.coordinates.forEach(r=>{t=this.drawLineString(n,r,t,!1)});break;case"Point":case"MultiPoint":break}return t}drawPolygon(e,t,i){if(t.length<1)return i;i=this.drawLineString(e,t[0],i,!0);for(let s=1;s<t.length;s+=1){const n=t[s];this.drawLineString(e,n,void 0,!0)}return i}drawLineString(e,t,i,s){if(t.length<2)return i;const n=s?t.length-1:t.length;for(let o=0;o<n;o+=1){const[a,r]=t[o];if(o===0?e.moveTo(a,r):e.lineTo(a,r),i==null)i=new lse(a,r,0,0);else{const{x:l,y:c}=i,h=l+i.width,d=c+i.height;i.x=Math.min(l,a),i.y=Math.min(c,r),i.width=Math.max(h,a)-i.x,i.height=Math.max(d,r)-i.y}}return s&&e.closePath(),i}};y([hse({equals:dse})],Au.prototype,"projectedGeometry",2),y([cse()],Au.prototype,"renderMode",2);var{LonLatBBox:zI}=A;function Iu(e,t){if(e.bbox!=null){const[i,s,n,o]=e.bbox;return t=zI.extend(t,i,s,n,o),t}switch(e.type){case"GeometryCollection":e.geometries.forEach(i=>{t=Iu(i,t)});break;case"MultiPolygon":e.coordinates.forEach(i=>{i.length>0&&(t=Ch(i[0],t))});break;case"Polygon":e.coordinates.length>0&&(t=Ch(e.coordinates[0],t));break;case"MultiLineString":e.coordinates.forEach(i=>{t=Ch(i,t)});break;case"LineString":t=Ch(e.coordinates,t);break;case"MultiPoint":e.coordinates.forEach(i=>{const[s,n]=i;t=zI.extend(t,s,n,s,n)});break;case"Point":{const[i,s]=e.coordinates;t=zI.extend(t,i,s,i,s);break}}return t}function Xb(e){switch(e.type){case"GeometryCollection":{let t,i;return e.geometries.forEach(s=>{const n=Xb(s);if(n==null)return;const o=Ch(n[0],void 0);if(o==null)return;const a=Math.abs(o.lat1-o.lat0)*Math.abs(o.lon1-o.lon0);(t==null||a>t)&&(t=a,i=n)}),i}case"MultiPolygon":{let t,i;return e.coordinates.forEach(s=>{const n=Ch(s[0],void 0);if(n==null)return;const o=Math.abs(n.lat1-n.lat0)*Math.abs(n.lon1-n.lon0);(t==null||o>t)&&(t=o,i=s)}),i}case"Polygon":return e.coordinates;case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function qb(e){switch(e.type){case"GeometryCollection":{let t,i;return e.geometries.forEach(s=>{const n=qb(s);if(n==null)return;const o=FI(n);o!=null&&(t==null||o>t)&&(t=o,i=n)}),i}case"MultiLineString":{let t=0,i;return e.coordinates.forEach(s=>{const n=FI(s);n>t&&(t=n,i=s)}),i}case"LineString":return e.coordinates;case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function _I(e,t){if(e==null)return!1;switch(e.type){case"GeometryCollection":return e.geometries.some(i=>_I(i,t));case"MultiPolygon":case"Polygon":return(t&1)!==0;case"MultiLineString":case"LineString":return(t&2)!==0;case"MultiPoint":case"Point":return(t&4)!==0}}function Kl(e,t){switch(e.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:e.geometries.map(i=>Kl(i,t))};case"Polygon":return{type:"Polygon",coordinates:GI(e.coordinates,t)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:use(e.coordinates,t)};case"MultiLineString":return{type:"MultiLineString",coordinates:GI(e.coordinates,t)};case"LineString":return{type:"LineString",coordinates:VI(e.coordinates,t)};case"MultiPoint":return{type:"MultiPoint",coordinates:VI(e.coordinates,t)};case"Point":return{type:"Point",coordinates:t.convert(e.coordinates)}}}function use(e,t){return e.map(i=>GI(i,t))}function GI(e,t){return e.map(i=>VI(i,t))}function VI(e,t){return e.map(i=>t.convert(i))}function pse(){return{fromFn:(i,s,n)=>n==="removed"?{scalingX:1,scalingY:1}:i.previousDatum==null?{scalingX:0,scalingY:0}:{scalingX:i.scalingX,scalingY:i.scalingY},toFn:(i,s,n)=>n==="removed"?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}}}function fF(e,t){const i=e.contextNodeData?.nodeData[t.datumIndex];if(i!==void 0){for(const s of e.datumSelection.nodes())if(s.datum===i)return s}}var Bce=class extends A.SeriesProperties{},df=class extends A.DataModelSeries{addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",e=>{this.onLegendItemClick(e)}),this.ctx.eventsHub.on("legend:item-double-click",e=>{this.onLegendItemDoubleClick(e)}))}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}},{Property:Qt,SeriesProperties:gse,makeSeriesTooltip:fse,Label:yse}=A,zt=class extends gse{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 yse,this.tooltip=fse()}};y([Qt],zt.prototype,"topology",2),y([Qt],zt.prototype,"title",2),y([Qt],zt.prototype,"legendItemName",2),y([Qt],zt.prototype,"idKey",2),y([Qt],zt.prototype,"topologyIdKey",2),y([Qt],zt.prototype,"idName",2),y([Qt],zt.prototype,"labelKey",2),y([Qt],zt.prototype,"labelName",2),y([Qt],zt.prototype,"sizeKey",2),y([Qt],zt.prototype,"sizeName",2),y([Qt],zt.prototype,"colorKey",2),y([Qt],zt.prototype,"colorName",2),y([Qt],zt.prototype,"sizeDomain",2),y([Qt],zt.prototype,"colorRange",2),y([Qt],zt.prototype,"maxStrokeWidth",2),y([Qt],zt.prototype,"stroke",2),y([Qt],zt.prototype,"strokeOpacity",2),y([Qt],zt.prototype,"strokeWidth",2),y([Qt],zt.prototype,"lineDash",2),y([Qt],zt.prototype,"lineDashOffset",2),y([Qt],zt.prototype,"itemStyler",2),y([Qt],zt.prototype,"label",2),y([Qt],zt.prototype,"tooltip",2);var{getMissCount:mse,getLabelStyles:xse,createDatumId:yF,SeriesNodePickMode:mF,valueProperty:uf,CachedTextMeasurerPool:bse,ColorScale:vse,LinearScale:Sse,Selection:jI,Text:Mse,Transformable:Dse}=A,Qb=class extends df{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[mF.EXACT_SHAPE_MATCH,mF.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new zt,this._chartTopology=void 0,this.colorScale=new vse,this.sizeScale=new Sse,this.datumSelection=jI.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=jI.select(this.labelGroup,Mse),this.highlightDatumSelection=jI.select(this.highlightGroup,()=>this.nodeFactory()),this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[2,e],!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const e=new Au;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e}async processData(e){if(this.data==null)return;const{data:t,topology:i,sizeScale:s,colorScale:n}=this,{topologyIdKey:o,idKey:a,sizeKey:r,colorKey:l,labelKey:c,sizeDomain:h,colorRange:d}=this.properties,u=new Map;i?.features.forEach(v=>{const S=v.properties?.[o];S==null||!_I(v.geometry,2)||u.set(S,v)});const p=this.sizeScale.type,g=this.colorScale.type,f=this.scale?.type,{dataModel:x,processedData:m}=await this.requestDataModel(e,t,{props:[uf(a,f,{id:"idValue",includeProperty:!1}),uf(a,f,{id:"featureValue",includeProperty:!1,processor:()=>v=>u.get(v)}),...c!=null?[uf(c,"category",{id:"labelValue"})]:[],...r!=null?[uf(r,p,{id:"sizeValue"})]:[],...l!=null?[uf(l,g,{id:"colorValue"})]:[]]}),b=x.resolveColumnById(this,"featureValue",m);if(this.topologyBounds=b.reduce((v,S)=>{const D=S?.geometry;return D==null?v:Iu(D,v)},void 0),r!=null){const v=x.resolveProcessedDataIndexById(this,"sizeValue"),S=m.domain.values[v]??[];s.domain=h??S}if(d!=null&&this.isColorScaleValid()){const v=x.resolveProcessedDataIndexById(this,"colorValue");n.domain=m.domain.values[v],n.range=d,n.update()}i==null&&X.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=mse(this,i.defs.values[s].missing);return!(n===0||n===o)}getLabelDatum(e,t,i,s){if(t==null||i==null)return;const n=qb(i);if(n==null)return;const{idKey:o,idName:a,sizeKey:r,sizeName:l,colorKey:c,colorName:h,labelKey:d,labelName:u,label:p}=this.properties;if(d==null||!p.enabled)return;const g=this.getLabelText(t,e,d,"label",[],p,{value:t,datum:e,idKey:o,idName:a,sizeKey:r,sizeName:l,colorKey:c,colorName:h,labelKey:d,labelName:u});if(g==null)return;const f=s.measureText(String(g)),x=Kb(n);if(x==null)return;const[m,b]=x.point,{width:v,height:S}=f;return{point:{x:m,y:b,size:0},label:{width:v,height:S,text:g},anchor:void 0,placement:void 0}}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:n,scale:o}=this,{idKey:a,sizeKey:r,colorKey:l,labelKey:c,label:h,legendItemName:d}=n;if(t==null||i==null)return;const u=t.resolveColumnById(this,"idValue",i),p=t.resolveColumnById(this,"featureValue",i),g=c!=null?t.resolveColumnById(this,"labelValue",i):void 0,f=r!=null?t.resolveColumnById(this,"sizeValue",i):void 0,x=l!=null?t.resolveColumnById(this,"colorValue",i):void 0,m=n.maxStrokeWidth??n.strokeWidth;s.range=[Math.min(n.strokeWidth,m),m];const b=bse.getMeasurer({font:h}),v=new Map;i.dataSources.get(this.id)?.forEach((L,N)=>{const w=u[N],O=p[N]?.geometry??void 0,R=O!=null&&o!=null?Kl(O,o):void 0;w!=null&&R!=null&&v.set(w,R)});const S=[],D=[],C=[];(i.dataSources.get(this.id)??[]).forEach((L,N)=>{const w=u[N],O=x?.[N],R=f?.[N],B=g?.[N],P=v.get(w);P==null&&C.push(w);const _=this.getLabelDatum(L,B,P,b);_!=null&&D.push(_),S.push({series:this,itemId:a,datum:L,datumIndex:N,idValue:w,labelValue:B,colorValue:O,sizeValue:R,projectedGeometry:P,legendItemName:d})});const k=10;if(C.length>k){const L=C.length-k;C.length=k,C.push(`(+${L} more)`)}return C.length>0&&X.warnOnce("some data items do not have matches in the provided topology",C),{itemId:e,nodeData:S,labelData:D}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,highlightDatumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;let i=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:s}=this.properties,n=s!=null&&i?.datum==null&&s===i?.legendItemName;i!=null&&(i.series!==this&&!n||i.datum==null)&&(i=void 0);const o=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:i!=null?[i]:[],datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!0})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>yF(t.idValue))}getItemBaseStyle(e,t){const{properties:i}=this,s=this.getHighlightStyle(e,t?.datumIndex);return{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,opacity:s?.opacity??1}}getItemStyleOverrides(e,t,i,s,n,o,a){const{id:r,properties:l,colorScale:c,sizeScale:h}=this,{colorRange:d,itemStyler:u}=l;let p;if(!o&&i!=null&&(p??(p={}),p.stroke=this.isColorScaleValid()?c.convert(i):d?.[0]??l.stroke),s!=null&&(p??(p={}),p.strokeWidth=h.convert(s,{clamp:!0})),u!=null){const g=this.cachedDatumCallback(yF(e,o?"highlight":"node"),()=>{const f=this.ctx.highlightManager?.getActiveHighlight(),x=this.getHighlightStateString(f,o,a);return this.callWithContext(u,{seriesId:r,datum:t,highlighted:o,highlightState:x,...n,...p})});p??(p={}),Object.assign(p,g)}return p}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e;t.each((s,n)=>{const{datum:o,datumIndex:a,colorValue:r,sizeValue:l,projectedGeometry:c}=n;if(c==null){s.visible=!1,s.projectedGeometry=void 0;return}const h=this.getItemBaseStyle(i,n),d=this.getItemStyleOverrides(String(a),o,r,l,h,i,a);s.visible=!0,s.projectedGeometry=c,s.stroke=d?.stroke??h.stroke,s.strokeWidth=d?.strokeWidth??h.strokeWidth,s.strokeOpacity=d?.strokeOpacity??h.strokeOpacity,s.lineDash=d?.lineDash??h.lineDash,s.lineDashOffset=d?.lineDashOffset??h.lineDashOffset})}updatePlacedLabelData(e){this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=A.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){e.labelSelection.each((t,{x:i,y:s,width:n,height:o,text:a},r)=>{const l=xse(this,void 0,this.properties,this.properties.label),{color:c,fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p}=l;t.visible=!0,t.x=i+n/2,t.y=s+o/2,t.text=a,t.fill=c,t.fontStyle=h,t.fontWeight=d,t.fontSize=u,t.fontFamily=p,t.textAlign="center",t.textBaseline="middle",t.fillOpacity=this.getHighlightStyle(!1,r).opacity??1,t.setBoxing(l)})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((n,o)=>{const a=n.distanceSquared(e,t);a<i&&(i=a,s=o)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}datumMidPoint(e){const{_previousDatumMidPoint:t}=this;if(t?.datum===e)return t.point;const i=e.projectedGeometry,s=i!=null?qb(i):void 0,n=s!=null?Kb(s)?.point:void 0,o=n!=null?{x:n[0],y:n[1]}:void 0;return this._previousDatumMidPoint={datum:e,point:o},o}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:s}=this,{strokeWidth:n,strokeOpacity:o,lineDash:a}=s;let{stroke:r}=s;if(e!=null&&this.isColorScaleValid()){const c=t.resolveColumnById(this,"colorValue",i)[e];r=this.colorScale.convert(c)}return{marker:{fill:void 0,fillOpacity:0,stroke:void 0,strokeWidth:0,strokeOpacity:0,lineDash:[0],lineDashOffset:0,enabled:!1},line:{stroke:r,strokeWidth:n,strokeOpacity:o,lineDash:a}}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(t==null||i==null)return[];const{id:s,visible:n}=this,{title:o,legendItemName:a,idKey:r,idName:l,colorKey:c,colorRange:h,showInLegend:d}=this.properties;if(e==="gradient"&&c!=null&&h!=null){const u=t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:n,seriesId:s,series:this.getFormatterContext("color"),colorRange:h,colorDomain:u}]}else return e==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:a??o??l??r},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!d}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n,ctx:{formatManager:o}}=this,{idKey:a,idName:r,colorKey:l,colorName:c,sizeKey:h,sizeName:d,labelKey:u,labelName:p,title:g,legendItemName:f,tooltip:x}=n;if(!i||!s)return;const m=s.dataSources.get(this.id)?.[e],b=i.resolveColumnById(this,"idValue",s),v=h!=null?i.resolveColumnById(this,"sizeValue",s)[e]:void 0,S=l!=null?i.resolveColumnById(this,"colorValue",s)[e]:void 0,D=[];if(this.isLabelEnabled()&&u!=null&&u!==a){const T=i.resolveColumnById(this,"labelValue",s)[e],k=o.format(this.callWithContext.bind(this),{type:"category",value:T,datum:m,seriesId:t,legendItemName:f,key:u,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});D.push({label:p,fallbackLabel:u,value:k??T})}if(v!=null&&h!=null){const T=i.getDomain(this,"sizeValue","value",s),k=o.format(this.callWithContext.bind(this),{type:"number",value:v,datum:m,seriesId:t,legendItemName:f,key:h,source:"tooltip",property:"size",domain:T,boundSeries:this.getFormatterContext("size"),fractionDigits:void 0});D.push({label:d,fallbackLabel:h,value:k??String(v)})}if(S!=null&&l!=null){const T=i.getDomain(this,"colorValue","value",s),k=o.format(this.callWithContext.bind(this),{type:"number",value:S,datum:m,seriesId:t,legendItemName:f,key:l,source:"tooltip",property:"color",domain:T,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0});D.push({label:c,fallbackLabel:l,value:k??String(S)})}const C=this.getItemBaseStyle(!1);return Object.assign(C,this.getItemStyleOverrides(String(e),e,S,v,C,!1,e)),this.formatTooltipWithContext(x,{heading:b[e],title:g??f,symbol:this.legendItemSymbol(e),data:D},{seriesId:t,datum:m,title:g,idKey:a,idName:r,colorKey:l,colorName:c,sizeKey:h,sizeName:d,labelKey:u,labelName:p,...C})}computeFocusBounds(e){const t=fF(this,e);return t?Dse.toCanvas(this.contentGroup,t.getBBox()):void 0}hasItemStylers(){return this.properties.itemStyler!=null}};Qb.className="MapLineSeries",Qb.type="map-line";var{commonSeriesOptionsDefs:Ase,mapLineSeriesThemeableOptionsDef:Ise,without:kse}=A,xF={...kse(Ase,["highlightStyle","highlight"]),...Ise,type:Y(Le("map-line")),idKey:Y(E),sizeKey:E,colorKey:E,labelKey:E,idName:E,sizeName:E,colorName:E,labelName:E,topology:Fh,topologyIdKey:E,legendItemName:E,title:E};xF.colorRange=me(at(Ae(ae),Wr(1)));var Cse={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line",moduleFactory:e=>new Qb(e),themeTemplate:{...hf,series:{stroke:_s(A.SAFE_STROKE_FILL_OPERATION),colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},_s(A.SAFE_RANGE2_OPERATION)]},strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{...A.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:_s(A.multiSeriesHighlightStyle(!1))},tooltip:{range:"exact"}}},Tse={type:"series",name:"map-line",chartType:"topology",enterprise:!0,options:xF,create:e=>new Qb(e)},{Property:Th,SeriesProperties:Lse,makeSeriesTooltip:wse}=A,Zl=class extends Lse{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=wse()}};y([Th],Zl.prototype,"topology",2),y([Th],Zl.prototype,"stroke",2),y([Th],Zl.prototype,"strokeOpacity",2),y([Th],Zl.prototype,"strokeWidth",2),y([Th],Zl.prototype,"lineDash",2),y([Th],Zl.prototype,"lineDashOffset",2),y([Th],Zl.prototype,"tooltip",2);var{createDatumId:Nse,Group:Ese,Selection:Ose,PointerEvents:bF}=A,Jb=class extends df{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new Zl,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new Ese({name:"itemGroup"})),this.datumSelection=Ose.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=bF.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new Au;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e.pointerEvents=bF.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const s=i.geometry;return s==null?t:Iu(s,t)},void 0),e==null&&X.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i}=this;if(t==null)return;const s=[],n=[];return t.features.forEach((o,a)=>{const{geometry:r}=o,l=r!=null&&i!=null?Kl(r,i):void 0;l!=null&&s.push({series:this,itemId:a,datum:o,datumIndex:0,index:a,projectedGeometry:l})}),{itemId:e,nodeData:s,labelData:n}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Nse(t.index))}updateDatumNodes(e){const{properties:t}=this,{datumSelection:i}=e,{stroke:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}=t,r=t.strokeWidth;i.each((l,c)=>{const{projectedGeometry:h}=c;if(h==null){l.visible=!1,l.projectedGeometry=void 0;return}l.visible=!0,l.projectedGeometry=h,l.stroke=s,l.strokeWidth=r,l.strokeOpacity=n,l.lineDash=o,l.lineDashOffset=a})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}computeFocusBounds(e){}hasItemStylers(){return!1}};Jb.className="MapLineBackgroundSeries",Jb.type="map-line-background";var{mapLineBackgroundSeriesThemeableOptionsDef:Pse}=A,Rse={...Pse,type:Y(Le("map-line-background")),topology:Fh},Bse={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line-background",moduleFactory:e=>new Jb(e),themeTemplate:{...hf,series:{stroke:{$path:["/1",{$mapPalette:"stroke"},{$mapPalette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}}},Fse={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,options:Rse,create:e=>new Jb(e)},zse=void 0,_se=void 0;_se=zse;var Gse=void 0,Vse=void 0;Vse=Gse;var jse=void 0,Hse=void 0;Hse=jse;var Wse=void 0,$se=void 0;$se=Wse;function vF(e,t,i){const s=Ch(e[0],void 0);if(s==null)return;const n=(s.lon0+s.lon1)/2,o=(s.lat0+s.lat1)/2,a=Math.abs(s.lon1-s.lon0),r=Math.abs(s.lat1-s.lat0),l=ose(e[0]),[c,h]=l,d=-Zb(e,c,h);let u;const p=(D,C)=>{const k=Math.max(C-d,0);return D-.5*k},g=(D,C,T)=>{const{distance:k,maxDistance:L}=i(e,D,C,T),N=Math.hypot(c-D,h-C),w=Math.min(Math.max(c,D-T/2),D+T/2),O=Math.min(Math.max(h,C-T/2),C+T/2),R=Math.hypot(c-w,h-O),B=p(k,N),P=p(L,R);return{distance:k,maxDistance:L,value:B,maxValue:P,x:D,y:C,stride:T}},f=(D,C,T,k)=>{const L=g(C,T,k);L.maxDistance>=0&&D.push(L)},x=Math.min(a,r)/2;let m={value:g(n,o,x),next:null};for(;m!=null;){const D=m.value,{distance:C,value:T,maxValue:k,x:L,y:N,stride:w}=D;if(m=m.next,C>0&&(u==null||T>u.value)&&(u=D),u!=null&&k-u.value<=t)continue;const O=w/2,R=[];f(R,L-O,N-O,O),f(R,L+O,N-O,O),f(R,L-O,N+O,O),f(R,L+O,N+O,O),R.sort(SF),m=tC(m,R,SF)}if(u==null)return;const{distance:b,x:v,y:S}=u;return{x:v,y:S,distance:b}}var SF=(e,t)=>t.maxValue-e.maxValue;function HI(e,t){const i=vF(e,t,(o,a,r,l)=>{const c=-Zb(o,a,r),h=c+l*Math.SQRT2;return{distance:c,maxDistance:h}});if(i==null)return;const{x:s,y:n}=i;return[s,n]}function MF(e,t){let i;switch(e.type){case"GeometryCollection":return e.geometries.flatMap(s=>MF(s,t));case"MultiPoint":return e.coordinates;case"Point":return[e.coordinates];case"MultiPolygon":{const s=Xb(e);i=s!=null?HI(s,t):void 0;break}case"Polygon":{const s=e.coordinates;i=s!=null?HI(s,t):void 0;break}case"MultiLineString":{const s=qb(e);i=s!=null?Kb(s)?.point:void 0;break}case"LineString":{const s=e.coordinates;i=Kb(s)?.point;break}}return i!=null?[i]:[]}var{BBox:Use}=A;function DF(e){if(!e)return;const{range:t}=e,i=t[0][0],s=t[0][1],n=t[1][0]-i,o=t[1][1]-s,a=new Use(i,s,n,o);return{series:a,axis:a}}var{FillGradientDefaults:Yse,FillPatternDefaults:Kse,FillImageDefaults:Zse,Property:qe,SeriesProperties:Xse,makeSeriesTooltip:qse,Label:Qse}=A,AF=class extends Qse{constructor(){super(...arguments),this.placement="bottom"}};y([qe],AF.prototype,"placement",2);var Qe=class extends Xse{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 Yse,this.fillPatternDefaults=new Kse,this.fillImageDefaults=new Zse,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new AF,this.tooltip=qse()}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:s,opacity:1,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}}};y([qe],Qe.prototype,"topology",2),y([qe],Qe.prototype,"title",2),y([qe],Qe.prototype,"legendItemName",2),y([qe],Qe.prototype,"idKey",2),y([qe],Qe.prototype,"topologyIdKey",2),y([qe],Qe.prototype,"idName",2),y([qe],Qe.prototype,"latitudeKey",2),y([qe],Qe.prototype,"latitudeName",2),y([qe],Qe.prototype,"longitudeKey",2),y([qe],Qe.prototype,"longitudeName",2),y([qe],Qe.prototype,"labelKey",2),y([qe],Qe.prototype,"labelName",2),y([qe],Qe.prototype,"sizeKey",2),y([qe],Qe.prototype,"sizeName",2),y([qe],Qe.prototype,"colorKey",2),y([qe],Qe.prototype,"colorName",2),y([qe],Qe.prototype,"colorRange",2),y([qe],Qe.prototype,"shape",2),y([qe],Qe.prototype,"size",2),y([qe],Qe.prototype,"maxSize",2),y([qe],Qe.prototype,"sizeDomain",2),y([qe],Qe.prototype,"fill",2),y([qe],Qe.prototype,"fillGradientDefaults",2),y([qe],Qe.prototype,"fillPatternDefaults",2),y([qe],Qe.prototype,"fillImageDefaults",2),y([qe],Qe.prototype,"fillOpacity",2),y([qe],Qe.prototype,"stroke",2),y([qe],Qe.prototype,"strokeWidth",2),y([qe],Qe.prototype,"strokeOpacity",2),y([qe],Qe.prototype,"lineDash",2),y([qe],Qe.prototype,"lineDashOffset",2),y([qe],Qe.prototype,"itemStyler",2),y([qe],Qe.prototype,"label",2),y([qe],Qe.prototype,"tooltip",2);var{CachedTextMeasurerPool:Jse,fromToMotion:ene,StateMachine:tne,getMissCount:ine,createDatumId:IF,SeriesNodePickMode:kF,valueProperty:Lh,computeMarkerFocusBounds:sne,ColorScale:nne,LinearScale:one,Group:ane,Selection:WI,Text:rne,Marker:$I,applyShapeStyle:lne,getShapeStyle:UI,getLabelStyles:cne,LonLatBBox:hne,mergeDefaults:CF}=A,ev=class extends df{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[kF.EXACT_SHAPE_MATCH,kF.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new Qe,this._chartTopology=void 0,this.colorScale=new nne,this.sizeScale=new one,this.markerGroup=this.contentGroup.appendChild(new ane({name:"markerGroup"})),this.labelSelection=WI.select(this.labelGroup,rne,!1),this.markerSelection=WI.select(this.markerGroup,$I,!1),this.highlightMarkerSelection=WI.select(this.highlightGroup,$I),this.animationState=new tne("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const e=this.properties.latitudeKey!=null&&this.properties.longitudeKey!=null;return super.hasData&&(this.topology!=null||e)}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[3,e],this.highlightGroup.zIndex=[4,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}async processData(e){if(this.data==null)return;const{data:t,topology:i,sizeScale:s,colorScale:n}=this,{topologyIdKey:o,idKey:a,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:d,sizeDomain:u,colorRange:p}=this.properties,g=new Map;i?.features.forEach(k=>{const L=k.properties?.[o];L!=null&&g.set(L,k)});const f=this.sizeScale.type,x=this.colorScale.type,m=this.scale?.type,b=r!=null&&l!=null,{dataModel:v,processedData:S}=await this.requestDataModel(e,t,{props:[...a!=null?[Lh(a,m,{id:"idValue",includeProperty:!1}),Lh(a,m,{id:"featureValue",includeProperty:!1,processor:()=>k=>g.get(k)})]:[],...b?[Lh(r,m,{id:"latValue"}),Lh(l,m,{id:"lonValue"})]:[],...d?[Lh(d,"category",{id:"labelValue"})]:[],...c?[Lh(c,f,{id:"sizeValue"})]:[],...h?[Lh(h,x,{id:"colorValue"})]:[]]}),D=a!=null?v.resolveColumnById(this,"featureValue",S):void 0,C=b?v.resolveColumnById(this,"latValue",S):void 0,T=b?v.resolveColumnById(this,"lonValue",S):void 0;if(this.topologyBounds=S.dataSources.get(this.id)?.reduce((k,L,N)=>{const O=D?.[N]?.geometry;if(O!=null&&(k=Iu(O,k)),C!=null&&T!=null){const R=T[N],B=C[N];k=hne.extend(k,R,B,R,B)}return k},void 0),c!=null){const k=v.resolveProcessedDataIndexById(this,"sizeValue"),L=S.domain.values[k]??[];s.domain=u??L}if(p!=null&&this.isColorScaleValid()){const k=v.resolveProcessedDataIndexById(this,"colorValue");n.domain=S.domain.values[k],n.range=p,n.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=ine(this,i.defs.values[s].missing);return!(n===0||n===o)}getLabelDatum(e,t,i,s,n,o){if(t==null)return;const{idKey:a,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:f,labelKey:x,labelName:m,label:b,shape:v}=this.properties;if(x==null||!b.enabled)return;const{placement:S}=b,D=this.getLabelText(t,e,x,"label",[],b,{value:t,datum:e,idKey:a,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:f,labelKey:x,labelName:m});if(D==null)return;const{width:C,height:T}=o.measureText(String(D)),k=$I.anchor(v);return{point:{x:i,y:s,size:n},label:{width:C,height:T,text:D},anchor:k,placement:S}}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:n,scale:o}=this,{idKey:a,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:d,label:u,legendItemName:p}=n;if(t==null||i==null||o==null)return;const g=r!=null&&l!=null,f=a!=null?t.resolveColumnById(this,"idValue",i):void 0,x=a!=null?t.resolveColumnById(this,"featureValue",i):void 0,m=g?t.resolveColumnById(this,"latValue",i):void 0,b=g?t.resolveColumnById(this,"lonValue",i):void 0,v=d!=null?t.resolveColumnById(this,"labelValue",i):void 0,S=c!=null?t.resolveColumnById(this,"sizeValue",i):void 0,D=h!=null?t.resolveColumnById(this,"colorValue",i):void 0,C=n.maxSize??n.size;s.range=[Math.min(n.size,C),C];const T=Jse.getMeasurer({font:u});let k;f!=null&&x!=null&&(k=new Map,i.dataSources.get(this.id)?.forEach((B,P)=>{const _=f[P],F=x[P]?.geometry??void 0,W=F!=null&&o!=null?Kl(F,o):void 0;_!=null&&W!=null&&k.set(_,W)}));const L=[],N=[],w=[];(i.dataSources.get(this.id)??[]).forEach((B,P)=>{const _=f?.[P],F=b?.[P],W=m?.[P],H=D?.[P],j=S?.[P],V=v?.[P],$=j!=null?s.convert(j,{clamp:!0}):n.size,U=_!=null?k?.get(_):void 0;if(_!=null&&Kl==null&&w.push(_),F!=null&&W!=null){const[Z,q]=o.convert([F,W]),Q=this.getLabelDatum(B,V,Z,q,$,T);Q&&N.push(Q),L.push({series:this,itemId:r,datum:B,datumIndex:P,index:-1,idValue:_,lonValue:F,latValue:W,labelValue:V,sizeValue:j,colorValue:H,point:{x:Z,y:q,size:$},midPoint:{x:Z,y:q},legendItemName:p})}else U!=null&&MF(U,1).forEach(([Z,q],Q)=>{const ie=this.getLabelDatum(B,V,Z,q,$,T);ie&&N.push(ie),L.push({series:this,itemId:r,datum:B,datumIndex:P,index:Q,idValue:_,lonValue:F,latValue:W,labelValue:V,sizeValue:j,colorValue:H,point:{x:Z,y:q,size:$},midPoint:{x:Z,y:q},legendItemName:p})})});const R=10;if(w.length>R){const B=w.length-R;w.length=R,w.push(`(+${B} more)`)}return w.length>0&&X.warnOnce("some data items do not have matches in the provided topology",w),{itemId:e,nodeData:L,labelData:N}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale===this.scale?!1:(this.previousScale=this.scale,!0)}update({seriesRect:e}){const t=this.checkResize(e),i=this.checkScaleChange(),{markerSelection:s,highlightMarkerSelection:n}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;let o=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:a}=this.properties,r=a!=null&&o?.datum==null&&a===o?.legendItemName;o!=null&&(o.series!==this&&!r||o.datum==null)&&(o=void 0);const l=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:l,markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!1,highlightedDatum:o}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:o!=null?[o]:[],markerSelection:n}),this.updateMarkerNodes({markerSelection:n,isHighlight:!0,highlightedDatum:o}),(i||t)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(e){this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=A.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){e.labelSelection.each((t,{x:i,y:s,width:n,height:o,text:a},r)=>{const l=cne(this,void 0,this.properties,this.properties.label),{color:c,fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p}=l;t.visible=!0,t.x=i+n/2,t.y=s+o/2,t.text=a,t.fill=c,t.fontStyle=h,t.fontWeight=d,t.fontSize=u,t.fontFamily=p,t.textAlign="center",t.textBaseline="middle",t.fillOpacity=this.getHighlightStyle(!1,r).opacity??1,t.setBoxing(l)})}updateMarkerSelection(e){const{markerData:t,markerSelection:i}=e;return i.update(t,void 0,s=>IF([s.index,s.idValue,s.lonValue,s.latValue]))}getMarkerItemStyle({datumIndex:e,datum:t,colorValue:i,sizeValue:s},n){const{id:o,properties:a,colorScale:r,sizeScale:l}=this,{colorRange:c,itemStyler:h,fillGradientDefaults:d,fillPatternDefaults:u,fillImageDefaults:p}=a,g=this.getHighlightStyle(n,e),f=CF(g,a.getStyle());!n&&i!=null&&(f.fill=this.isColorScaleValid()?r.convert(i):c?.[0]??f.fill),s!=null&&(f.size=l.convert(s,{clamp:!0}));let x=UI(f,d,u,p);if(h!=null&&e!=null){const m=this.cachedDatumCallback(IF(e,n?"highlight":"node"),()=>{const b=this.ctx.highlightManager?.getActiveHighlight(),v=this.getHighlightStateString(b,n,e);return this.callWithContext(h,{seriesId:o,datum:t,highlighted:n,highlightState:v,...x})});m&&(x=UI(CF(m,f),d,u,p))}return x}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i,highlightedDatum:s}=e,n=DF(this.scale);t.each((o,a)=>{const{datum:r,point:l}=a,c=this.getMarkerItemStyle(a,i);o.shape=c.shape,o.size=c.size,lne(o,c,n),o.x=l.x,o.y=l.y,o.scalingCenterX=l.x,o.scalingCenterY=l.y,o.zIndex=!i&&s!=null&&r===s.datum?1:0})}isProcessedDataAnimatable(){return!0}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup()}animateMarkers(){const{animationManager:e}=this.ctx,t=pse();ene(this.id,"markers",e,[this.markerSelection,this.highlightMarkerSelection],t)}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(e){const{x:t,y:i}=e;let s=1/0,n;return this.contextNodeData?.nodeData.forEach(o=>{const{x:a,y:r,size:l}=o.point,c=Math.max(Math.abs(a-t)-l,0),h=Math.max(Math.abs(r-i)-l,0),d=c*c+h*h;d<s&&(s=d,n=o)}),n!=null?{datum:n,distance:Math.sqrt(s)}:void 0}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:s}=this,{shape:n,fillOpacity:o,stroke:a,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}=s;let{fill:d}=s;if(e!=null&&this.isColorScaleValid()){const p=t.resolveColumnById(this,"colorValue",i)[e];d=this.colorScale.convert(p)}return{marker:UI({shape:n,fill:d,fillOpacity:o,stroke:a,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(t==null||i==null)return[];const{id:s,visible:n}=this,{title:o,legendItemName:a,idName:r,idKey:l,colorKey:c,colorRange:h,showInLegend:d}=this.properties;if(e==="gradient"&&c!=null&&h!=null){const u=t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:n,seriesId:s,series:this.getFormatterContext("color"),colorRange:h,colorDomain:u}]}else return e==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:a??o??r??l??s},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!d}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n,ctx:{formatManager:o}}=this,{idKey:a,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,colorKey:u,colorName:p,sizeKey:g,sizeName:f,labelKey:x,labelName:m,title:b,legendItemName:v,tooltip:S}=n;if(!i||!s)return;const D=s.dataSources.get(this.id)?.[e],C=g!=null?i.resolveColumnById(this,"sizeValue",s)[e]:void 0,T=u!=null?i.resolveColumnById(this,"colorValue",s)[e]:void 0,k=[];if(this.isLabelEnabled()&&x!=null&&x!==a){const w=i.resolveColumnById(this,"labelValue",s)[e],O=o.format(this.callWithContext.bind(this),{type:"category",value:w,datum:D,seriesId:t,legendItemName:v,key:x,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});k.push({label:m,fallbackLabel:x,value:O??w})}if(g!=null&&C!=null){const w=i.getDomain(this,"sizeValue","value",s),O=o.format(this.callWithContext.bind(this),{type:"number",value:C,datum:D,seriesId:t,legendItemName:v,key:g,source:"tooltip",property:"size",domain:w,boundSeries:this.getFormatterContext("size"),fractionDigits:void 0});k.push({label:f,fallbackLabel:g,value:O??String(C)})}if(u!=null&&T!=null){const w=i.getDomain(this,"colorValue","value",s),O=o.format(this.callWithContext.bind(this),{type:"number",value:T,datum:D,seriesId:t,legendItemName:v,key:u,source:"tooltip",property:"color",domain:w,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0});k.push({label:p,fallbackLabel:u,value:O??String(T)})}let L;if(a!=null)L=i.resolveColumnById(this,"idValue",s)[e];else if(l!=null&&h!=null){const w=i.resolveColumnById(this,"latValue",s)[e],O=i.resolveColumnById(this,"lonValue",s)[e];L=`${Math.abs(w).toFixed(4)}\xB0 ${w>=0?"N":"S"}, ${Math.abs(O).toFixed(4)}\xB0 ${O>=0?"W":"E"}`}const N=this.getMarkerItemStyle({datumIndex:e,datum:D,colorValue:T,sizeValue:C},!1);return this.formatTooltipWithContext(S,{heading:L,title:b??v,symbol:this.legendItemSymbol(e),data:k},{seriesId:t,datum:D,title:b,idKey:a,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,colorKey:u,colorName:p,sizeKey:g,sizeName:f,labelKey:x,labelName:m,...N})}getFormattedMarkerStyle(e){const t=this.getMarkerItemStyle(e,!1);return{size:t.size,shape:t.shape}}computeFocusBounds(e){return sne(this,e)}hasItemStylers(){return this.properties.itemStyler!=null}};ev.className="MapMarkerSeries",ev.type="map-marker";var{commonSeriesOptionsDefs:dne,mapMarkerSeriesThemeableOptionsDef:une,without:pne}=A,gne={...pne(dne,["highlightStyle","highlight"]),...une,type:Y(Le("map-marker")),idKey:E,latitudeKey:E,longitudeKey:E,sizeKey:E,colorKey:E,labelKey:E,idName:E,latitudeName:E,longitudeName:E,sizeName:E,colorName:E,labelName:E,topology:Fh,topologyIdKey:E,legendItemName:E,title:E},fne={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-marker",moduleFactory:e=>new ev(e),themeTemplate:{...hf,series:{shape:"circle",maxSize:30,fill:{$mapPalette:"fill"},stroke:{$mapPalette:"stroke"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},_s(A.SAFE_RANGE2_OPERATION)]},fillGradientDefaults:_s(A.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS),fillPatternDefaults:_s(A.FILL_PATTERN_DEFAULTS),fillImageDefaults:_s(A.FILL_IMAGE_DEFAULTS),fillOpacity:.5,label:{...A.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:_s(A.multiSeriesHighlightStyle())},tooltip:{range:"exact"}}},yne={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,options:gne,create:e=>new ev(e),validate(e,t,i){const s=ss(e,t,i),{cleared:n,invalid:o}=s;if(n?.idKey==null&&(n?.latitudeKey==null||n?.longitudeKey==null)){const a=l=>i?`${i}.${l}`:l,r=`Either \`${a("idKey")}\` or both \`${a("latitudeKey")}\` and \`${a("longitudeKey")}\` are required.`;o.push(new jr("required",r,null,i))}return s}};function mne(e,{aspectRatio:t,precision:i}){const s=vF(e,i,(l,c,h,d)=>{const u=bne(l,c,h,t),p=u+2*d*t,g=u*Math.SQRT2,f=p*Math.SQRT2;return{distance:g,maxDistance:f}});if(s==null)return;const{x:n,y:o,distance:a}=s,r=a/Math.SQRT2;return{x:n,y:o,maxWidth:r}}function xne(e,t,i,s,n){const[o,a]=e,[r,l]=t,c=1/n,h=r-o,d=l-a,[u,p]=a<=l?e:t,[g,f]=o<=r?e:t,[x,m]=a<=l?t:e,[b,v]=o<=r?t:e;let S=1/0;if(h!==0){const N=d/h;for(let w=0;w<=1;w+=1){const O=w===0?c:-c,R=(N*o-a-O*i+s)/(N-O);if(R>=g&&R<=b){const B=Math.abs(i-R)*2;S=Math.min(S,B)}}}else for(let N=0;N<=1;N+=1){const O=(N===0?c:-c)*(o-i)+s;if(O>=p&&O<=m){const B=Math.abs(s-O)*2*n;S=Math.min(S,B)}}const D=n,C=Math.abs((u-i)/(p-s)),T=Math.abs((x-i)/(m-s));if(m<s&&T<D){const w=Math.abs(s-m)*2*n;S=Math.min(S,w)}else if(p>s&&C<D){const w=Math.abs(s-p)*2*n;S=Math.min(S,w)}const k=Math.abs((f-s)/(g-i)),L=Math.abs((v-s)/(b-i));if(b<i&&L<c){const N=Math.abs(i-b)*2;S=Math.min(S,N)}else if(g>i&&k<c){const N=Math.abs(i-g)*2;S=Math.min(S,N)}return S}function bne(e,t,i,s){let n=!1,o=1/0;for(const a of e){let r=a[a.length-1],[l,c]=r;for(const h of a){const[d,u]=h;u>i!=c>i&&t<(l-d)*(i-u)/(c-u)+d&&(n=!n);const p=xne(r,h,t,i,s);o=Math.min(o,p),r=h,l=d,c=u}}return(n?1:-1)*o}function tv(e,t,i){i>=t&&(e.maxX=Math.min(e.maxX,i-t)),i<=t&&(e.minX=Math.max(e.minX,i-t))}function vne(e,t,i,s,n,o){const a=n-o/2,r=n+o/2,[l,c]=t,[h,d]=i,u=h-l,p=d-c,[g,f]=l<=h?t:i,[x,m]=l<=h?i:t;if(u!==0){const b=p/u;for(let v=0;v<=1;v+=1){const D=((v===0?a:r)-c)/b+l;D>=g&&D<=x&&tv(e,s,D)}}else Math.max(a,Math.min(c,d))<=Math.min(r,Math.max(c,d))&&tv(e,s,l);return x<s&&m>=a&&m<=r?tv(e,s,x):g>s&&f>=a&&f<=r&&tv(e,s,g),e}function Sne(e,t,i,s){const n={minX:-1/0,maxX:1/0};for(const r of e){let l=r[r.length-1];for(const c of r)vne(n,l,c,t,i,s),l=c}const{minX:o,maxX:a}=n;return Number.isFinite(o)&&Number.isFinite(a)?{x:t+(o+a)/2,width:a-o}:{x:t,width:0}}var{Property:Nt,SeriesProperties:Mne,makeSeriesTooltip:Dne,FillGradientDefaults:Ane,FillPatternDefaults:Ine,FillImageDefaults:kne}=A,It=class extends Mne{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 Ane,this.fillPatternDefaults=new Ine,this.fillImageDefaults=new kne,this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new Zg,this.tooltip=Dne()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,opacity:1}}};y([Nt],It.prototype,"topology",2),y([Nt],It.prototype,"title",2),y([Nt],It.prototype,"legendItemName",2),y([Nt],It.prototype,"idKey",2),y([Nt],It.prototype,"idName",2),y([Nt],It.prototype,"topologyIdKey",2),y([Nt],It.prototype,"labelKey",2),y([Nt],It.prototype,"labelName",2),y([Nt],It.prototype,"colorKey",2),y([Nt],It.prototype,"colorName",2),y([Nt],It.prototype,"colorRange",2),y([Nt],It.prototype,"fill",2),y([Nt],It.prototype,"fillGradientDefaults",2),y([Nt],It.prototype,"fillPatternDefaults",2),y([Nt],It.prototype,"fillImageDefaults",2),y([Nt],It.prototype,"fillOpacity",2),y([Nt],It.prototype,"stroke",2),y([Nt],It.prototype,"strokeOpacity",2),y([Nt],It.prototype,"strokeWidth",2),y([Nt],It.prototype,"lineDash",2),y([Nt],It.prototype,"lineDashOffset",2),y([Nt],It.prototype,"padding",2),y([Nt],It.prototype,"itemStyler",2),y([Nt],It.prototype,"label",2),y([Nt],It.prototype,"tooltip",2);var{getMissCount:Cne,createDatumId:TF,SeriesNodePickMode:LF,valueProperty:iv,CachedTextMeasurerPool:Tne,TextUtils:wF,ColorScale:Lne,Group:NF,Selection:YI,Text:wne,PointerEvents:Nne,applyShapeStyle:Ene,getShapeStyle:KI,getLabelStyles:One,mergeDefaults:EF}=A,OF=A.MercatorScale.fixedScale(),sv=class extends df{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{color:["colorKey"],label:["labelKey"]},propertyNames:{color:["colorName"],label:["labelName"]},pickModes:[LF.EXACT_SHAPE_MATCH,LF.NEAREST_NODE]}),this.properties=new It,this._chartTopology=void 0,this.colorScale=new Lne,this.itemGroup=this.contentGroup.appendChild(new NF({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new NF({name:"itemLabelGroup"})),this.datumSelection=YI.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=YI.select(this.itemLabelGroup,wne),this.highlightDatumSelection=YI.select(this.highlightGroup,()=>this.nodeFactory()),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=Nne.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[2,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const e=new Au;return e.renderMode=1,e.lineJoin="round",e}async processData(e){if(this.data==null)return;const{data:t,topology:i,colorScale:s}=this,{topologyIdKey:n,idKey:o,colorKey:a,labelKey:r,colorRange:l}=this.properties,c=new Map;i?.features.forEach(f=>{const x=f.properties?.[n];x==null||!_I(f.geometry,1)||c.set(x,f)});const h=this.colorScale.type,d=this.scale?.type,{dataModel:u,processedData:p}=await this.requestDataModel(e,t,{props:[iv(o,d,{id:"idValue",includeProperty:!1}),iv(o,d,{id:"featureValue",includeProperty:!1,processor:()=>f=>c.get(f)}),...r?[iv(r,"category",{id:"labelValue"})]:[],...a?[iv(a,h,{id:"colorValue"})]:[]]}),g=u.resolveColumnById(this,"featureValue",p);if(this.topologyBounds=g.reduce((f,x)=>{const m=x?.geometry;return m==null?f:Iu(m,f)},void 0),l!=null&&this.isColorScaleValid()){const f=u.resolveProcessedDataIndexById(this,"colorValue");s.domain=p.domain.values[f],s.range=l,s.update()}i==null&&X.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=Cne(this,i.defs.values[s].missing);return!(n===0||n===o)}getLabelLayout(e,t,i,s,n){if(t==null||s==null)return;const{idKey:o,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h,padding:d,label:u}=this.properties;if(c==null||!u.enabled)return;const p=this.getLabelText(t,e,c,"label",[],u,{value:t,datum:e,idKey:o,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h});if(p==null)return;const g=i.measureText(String(p)),f=p.split(`
`).length,x=(g.width+2*d)/(f*wF.getLineHeight(u.fontSize)+2*d);if(n?.geometry===s&&n?.labelText===p&&n?.aspectRatio===x)return n;const m=Kl(s,OF),b=Xb(m);if(b==null)return;const v=mne(b,{aspectRatio:x,precision:.001});if(v==null)return;const{x:S,y:D,maxWidth:C}=v;return{geometry:s,labelText:p,aspectRatio:x,x:S,y:D,maxWidth:C,fixedPolygon:b}}getLabelDatum(e,t){const{scale:i}=this;if(i==null)return;const{padding:s,label:n}=this.properties,{labelText:o,aspectRatio:a,x:r,y:l,maxWidth:c,fixedPolygon:h}=e,d={width:Math.ceil(c*t),height:Math.ceil(c*t/a),meta:r},u=Yg(o,n,{padding:s},(S,D)=>{if(!D)return d;const C=Sne(h,r,l,S/t);return{width:C.width*t,height:S,meta:C.x}});if(u==null)return;const[{text:p,fontSize:g,lineHeight:f,width:x},m]=u;if(p===wF.EllipsisChar)return;const b=x<d.width?r:m,v=this.scale.convert(OF.invert([b,l]));return{x:v[0],y:v[1],text:p,fontSize:g,lineHeight:f}}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,scale:n,previousLabelLayouts:o}=this,{idKey:a,colorKey:r,labelKey:l,label:c,legendItemName:h}=s;if(t==null||i==null)return;const d=n!=null?(n.range[1][0]-n.range[0][0])/n.bounds.width:NaN,u=t.resolveColumnById(this,"idValue",i),p=t.resolveColumnById(this,"featureValue",i),g=l!=null?t.resolveColumnById(this,"labelValue",i):void 0,f=r!=null?t.resolveColumnById(this,"colorValue",i):void 0,x=Tne.getMeasurer({font:c}),m=new Map;this.previousLabelLayouts=m;const b=[],v=[],S=[];(i.dataSources.get(this.id)??[]).forEach((T,k)=>{const L=u[k],N=f?.[k],w=g?.[k],O=p[k]?.geometry??void 0;O==null&&S.push(L);const R=this.getLabelLayout(T,w,x,O,o?.get(L));R!=null&&m.set(L,R);const B=R!=null&&n!=null?this.getLabelDatum(R,d):void 0;B!=null&&v.push(B);const P=O!=null&&n!=null?Kl(O,n):void 0;b.push({series:this,itemId:a,datum:T,datumIndex:k,idValue:L,colorValue:N,labelValue:w,projectedGeometry:P,legendItemName:h})});const C=10;if(S.length>C){const T=S.length-C;S.length=C,S.push(`(+${T} more)`)}return S.length>0&&X.warnOnce("some data items do not have matches in the provided topology",S),{itemId:e,nodeData:b,labelData:v}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,labelSelection:t,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;let s=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:n}=this.properties,o=n!=null&&s?.datum==null&&n===s?.legendItemName;s!=null&&(s.series!==this&&!o||s.datum==null)&&(s=void 0);const a=this.contextNodeData?.nodeData??[],r=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:t}),this.updateLabelNodes({labelSelection:t}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:s!=null?[s]:[],datumSelection:i}),this.updateDatumNodes({datumSelection:i,isHighlight:!0})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>TF(t.idValue))}getItemStyle({datumIndex:e,datum:t,colorValue:i},s){const{id:n,properties:o,colorScale:a}=this,{colorRange:r,itemStyler:l}=o,c=this.getHighlightStyle(s,e),h=EF(c,o.getStyle());!s&&i!=null&&(h.fill=this.isColorScaleValid()?a.convert(i):r?.[0]??h.fill);let d=KI(h,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);if(l!=null&&e!=null){const u=this.cachedDatumCallback(TF(e,s?"highlight":"node"),()=>{const p=this.ctx.highlightManager?.getActiveHighlight(),g=this.getHighlightStateString(p,s,e);return this.callWithContext(l,{seriesId:n,datum:t,highlighted:s,highlightState:g,...d})});u&&(d=KI(EF(u,d),this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults))}return d}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,s=DF(this.scale);t.each((n,o)=>{const{projectedGeometry:a}=o;if(a==null){n.visible=!1,n.projectedGeometry=void 0;return}const r=this.getItemStyle(o,i);n.visible=!0,n.projectedGeometry=a,Ene(n,r,s)})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){e.labelSelection.each((t,{x:i,y:s,text:n,fontSize:o,lineHeight:a},r)=>{const l=One(this,void 0,this.properties,this.properties.label),{color:c,fontStyle:h,fontWeight:d,fontFamily:u}=l;t.visible=!0,t.x=i,t.y=s,t.text=n,t.fill=c,t.fontStyle=h,t.fontWeight=d,t.fontSize=o,t.lineHeight=a,t.fontFamily=u,t.textAlign="center",t.textBaseline="middle",t.fillOpacity=this.getHighlightStyle(!1,r).opacity??1,t.setBoxing(l)})}resetAnimation(){}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((n,o)=>{const a=n.distanceSquared(e,t);a<i&&(i=a,s=o)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}datumMidPoint(e){const{_previousDatumMidPoint:t}=this;if(t?.datum===e)return t.point;const i=e.projectedGeometry,s=i!=null?Xb(i):void 0,n=s!=null?HI(s,2):void 0,o=n!=null?{x:n[0],y:n[1]}:void 0;return this._previousDatumMidPoint={datum:e,point:o},o}legendItemSymbol(e){const{dataModel:t,processedData:i,properties:s}=this,{fillOpacity:n,stroke:o,strokeWidth:a,strokeOpacity:r,lineDash:l,lineDashOffset:c}=s;let{fill:h}=s;if(e!=null&&this.isColorScaleValid()){const u=t.resolveColumnById(this,"colorValue",i)[e];h=this.colorScale.convert(u)}return{marker:KI({fill:h,fillOpacity:n,stroke:o,strokeWidth:a,strokeOpacity:r,lineDash:l,lineDashOffset:c},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}}getLegendData(e){const{processedData:t,dataModel:i}=this;if(t==null||i==null)return[];const{id:s,visible:n}=this,{title:o,legendItemName:a,idKey:r,idName:l,colorKey:c,colorRange:h,showInLegend:d}=this.properties;if(e==="gradient"&&c!=null&&h!=null){const u=t.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:n,seriesId:s,series:this.getFormatterContext("color"),colorRange:h,colorDomain:u}]}else return e==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:a??o??l??r},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!d}]:[]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n,ctx:{formatManager:o}}=this,{idKey:a,idName:r,colorKey:l,colorName:c,labelKey:h,labelName:d,legendItemName:u,title:p,tooltip:g}=n;if(!i||!s)return;const f=s.dataSources.get(this.id)?.[e],x=i.resolveColumnById(this,"idValue",s)[e],m=l!=null?i.resolveColumnById(this,"colorValue",s)[e]:void 0,b=[];if(this.isLabelEnabled()&&h!=null&&h!==a){const S=i.resolveColumnById(this,"labelValue",s)[e],D=o.format(this.callWithContext.bind(this),{type:"category",value:S,datum:f,seriesId:t,legendItemName:u,key:h,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});b.push({label:d,fallbackLabel:h,value:D??S})}if(m!=null){const S=i.getDomain(this,"colorValue","value",s),D=o.format(this.callWithContext.bind(this),{type:"number",value:m,datum:f,seriesId:t,legendItemName:u,key:l,source:"tooltip",property:"color",domain:S,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0});b.push({label:c,fallbackLabel:l,value:D??String(m)})}const v=this.getItemStyle({datum:f,datumIndex:e,colorValue:m},!1);return this.formatTooltipWithContext(g,{heading:x,title:p??u,symbol:this.legendItemSymbol(e),data:b},{seriesId:t,datum:f,title:p,idKey:a,idName:r,colorKey:l,colorName:c,labelKey:h,labelName:d,...v})}computeFocusBounds(e){return fF(this,e)}hasItemStylers(){return this.properties.itemStyler!=null}};sv.className="MapShapeSeries",sv.type="map-shape";var{commonSeriesOptionsDefs:Pne,mapShapeSeriesThemeableOptionsDef:Rne,without:Bne}=A,Fne={...Bne(Pne,["highlightStyle","highlight"]),...Rne,type:Y(Le("map-shape")),idKey:Y(E),colorKey:E,labelKey:E,idName:E,colorName:E,labelName:E,topology:Fh,topologyIdKey:E,legendItemName:E,title:E},zne={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape",moduleFactory:e=>new sv(e),themeTemplate:{...hf,series:{fill:{$mapPalette:"fill"},stroke:{$ref:"chartBackgroundColor"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},_s(A.SAFE_RANGE2_OPERATION)]},fillGradientDefaults:_s(A.FILL_GRADIENT_LINEAR_DEFAULTS),fillPatternDefaults:_s(A.FILL_PATTERN_DEFAULTS),fillImageDefaults:_s(A.FILL_IMAGE_DEFAULTS),fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{...A.LABEL_BOXING_DEFAULTS,color:{$ref:"chartBackgroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"},highlight:_s(A.multiSeriesHighlightStyle(!0))},tooltip:{range:"exact"}}},_ne={type:"series",name:"map-shape",chartType:"topology",enterprise:!0,options:Fne,create:e=>new sv(e)},{FillGradientDefaults:Gne,FillPatternDefaults:Vne,FillImageDefaults:jne,Property:So,SeriesProperties:Hne,makeSeriesTooltip:Wne}=A,Bn=class extends Hne{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillGradientDefaults=new Gne,this.fillPatternDefaults=new Vne,this.fillImageDefaults=new jne,this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=Wne()}};y([So],Bn.prototype,"topology",2),y([So],Bn.prototype,"fill",2),y([So],Bn.prototype,"fillGradientDefaults",2),y([So],Bn.prototype,"fillPatternDefaults",2),y([So],Bn.prototype,"fillImageDefaults",2),y([So],Bn.prototype,"fillOpacity",2),y([So],Bn.prototype,"stroke",2),y([So],Bn.prototype,"strokeOpacity",2),y([So],Bn.prototype,"strokeWidth",2),y([So],Bn.prototype,"lineDash",2),y([So],Bn.prototype,"lineDashOffset",2),y([So],Bn.prototype,"tooltip",2);var{createDatumId:$ne,Selection:Une,Group:Yne,PointerEvents:PF,getShapeStyle:Kne}=A,nv=class extends df{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new Bn,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new Yne({name:"itemGroup"})),this.datumSelection=Une.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=PF.None}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new Au;return e.renderMode=1,e.lineJoin="round",e.pointerEvents=PF.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const s=i.geometry;return s==null?t:Iu(s,t)},void 0),e==null&&X.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i}=this;if(t==null)return;const s=[],n=[];return t.features.forEach((o,a)=>{const{geometry:r}=o,l=r!=null&&i!=null?Kl(r,i):void 0;l!=null&&s.push({series:this,itemId:a,datum:o,datumIndex:0,index:a,projectedGeometry:l})}),{itemId:e,nodeData:s,labelData:n}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>$ne(t.index))}updateDatumNodes(e){const{properties:t}=this,{datumSelection:i}=e,{fill:s,fillOpacity:n,stroke:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}=t,c=t.strokeWidth;i.each((h,d)=>{const{projectedGeometry:u}=d;if(u==null){h.visible=!1,h.projectedGeometry=void 0;return}h.visible=!0,h.projectedGeometry=u;const p=Kne({fill:s,fillOpacity:n,stroke:o,strokeWidth:c,strokeOpacity:a,lineDash:r,lineDashOffset:l},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);h.setProperties(p)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}pickFocus(){}computeFocusBounds(e){}hasItemStylers(){return!1}};nv.className="MapShapeBackgroundSeries",nv.type="map-shape-background";var{commonSeriesOptionsDefs:Zne,mapShapeBackgroundSeriesThemeableOptionsDef:Xne}=A,qne={...Xne,...Zne,type:Y(Le("map-shape-background")),topology:Fh},Qne={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape-background",moduleFactory:e=>new nv(e),themeTemplate:{...hf,series:{fill:{$path:["/1",{$mapPalette:"fill"},{$mapPalette:"hierarchyColors"}]},stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,fillGradientDefaults:_s(A.FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS),fillPatternDefaults:_s(A.FILL_PATTERN_HIERARCHY_DEFAULTS),fillImageDefaults:_s(A.FILL_IMAGE_DEFAULTS)}}},Jne={type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,options:qne,create:e=>new nv(e)},{DEFAULT_POLAR_DIRECTION_KEYS:eoe,DEFAULT_POLAR_DIRECTION_NAMES:toe,ChartAxisDirection:ja,PolarAxis:ioe,diff:soe,fixNumericExtent:noe,groupAccumulativeValueProperty:RF,keyProperty:ooe,normaliseGroupTo:aoe,resetLabelFn:roe,seriesLabelFadeInAnimation:loe,seriesLabelFadeOutAnimation:coe,valueProperty:hoe,animationValidation:doe,createDatumId:BF,SeriesNodePickMode:FF,normalizeAngle360:zF,CategoryScale:uoe,motion:_F,applyShapeStyle:poe,isGradientFill:goe,getShapeStyle:ZI,updateLabelNode:foe,mergeDefaults:GF}=A,yoe=class extends A.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},VF=class extends A.PolarSeries{constructor(e,{animationResetFns:t}){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:eoe,propertyNames:toe,canHaveAxes:!0,pickModes:[FF.NEAREST_NODE,FF.EXACT_SHAPE_MATCH],animationResetFns:{...t,label:roe}}),this.NodeEvent=yoe,this.groupScale=new uoe,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];if(e===ja.Angle)return t.getDomain(this,"angleValue","key",i);{const s=t.getDomain(this,"radiusValue-end","value",i),n=Number.isFinite(s[1]-s[0])?[s[0]>0?0:s[0],s[1]<0?0:s[1]]:[];return noe(n)}}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped(),o=this.getStackId(),a=`${o}-trailing`,r=[];ii(s)&&r.push(aoe([o,a],Math.abs(s))),n&&this.processedData&&r.push(soe(this.id,this.processedData)),n&&r.push(doe());const l=this.visible?{}:{forceValue:0},c=this.axes[ja.Radius]?.scale.type,h=this.axes[ja.Angle]?.scale.type;await this.requestDataModel(e,this.data,{props:[ooe(t,h,{id:"angleValue"}),hoe(i,c,{id:"radiusValue-raw",invalidValue:null,...l}),...RF(i,"normal","current",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:o,separateNegative:!0,...l},c),...RF(i,"trailing","current",{id:"radiusValue-start",invalidValue:null,groupId:a,separateNegative:!0,...l},c),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e!==s.r||t!==s.cx||i!==s.cy?(this.circleCache={r:e,cx:t,cy:i},!0):!1}isRadiusAxisReversed(){return this.axes[ja.Radius]?.isReversed()}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:t=[]}=this.createNodeData()??{};this.nodeData=t,this.nodeDataRefresh=!1}getAxisInnerRadius(){const e=this.axes[ja.Radius];return e instanceof ioe?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t,groupScale:i}=this;if(!t||!e||e.type!=="grouped")return;const s=this.axes[ja.Angle],n=this.axes[ja.Radius],o=s?.scale,a=n?.scale;if(!o||!a)return;const r=t.resolveKeysById(this,"angleValue",e),l=t.resolveColumnById(this,"radiusValue-start",e),c=t.resolveColumnById(this,"radiusValue-end",e),h=t.resolveColumnById(this,"radiusValue-raw",e),d=t.resolveProcessedDataIndexById(this,"radiusValue-range");let u=0,p=0;s instanceof Ml&&(u=s.groupPaddingInner,p=s.paddingInner);const f=(o.bandwidth??0)*(1-p),{index:x,visibleGroupCount:m}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:m}).map((F,W)=>String(W)),i.range=[-f/2,f/2],i.paddingInner=m>1?u:0;const b=this.isRadiusAxisReversed(),v=b?this.radius:this.getAxisInnerRadius(),S=b?this.getAxisInnerRadius():this.radius,D=S+v,{angleKey:C,radiusKey:T,angleName:k,radiusName:L,label:N}=this.properties,w=this.getSeriesDomain(ja.Radius),O=(F,W,H,j)=>{const V=this.getLabelText(W,F,T,"radius",w,N,{value:W,datum:F,angleKey:C,radiusKey:T,angleName:k,radiusName:L});if(V)return{x:H,y:j,text:V,textAlign:"center",textBaseline:"middle"}},R=[],B={itemId:T,nodeData:R,labelData:R};if(!this.visible)return B;const{dataSources:P}=e,_=P.get(this.id)??[];for(const{datumIndex:F,group:W}of t.forEachGroupDatum(this,e)){const H=_[F],j=r[F];if(j==null)return;const V=h[F],$=V>=0&&!Object.is(V,-0),U=l[F],Z=c[F],q=W.aggregation[d][$?1:0]??0,Q=$===b;if(U===void 0||Z===void 0)return;let ie,ne;if(_.length===1)ie=-.5*Math.PI,ne=1.5*Math.PI;else{const ye=o.convert(j);ie=zF(ye+i.convert(String(x))),ne=zF(ie+i.bandwidth)}const oe=ie+i.bandwidth/2,le=D-a.convert(U),re=D-a.convert(Z),ee=(le+re)/2,Me=D-a.convert(0),Ee=D-a.convert(q),Ie=Math.cos(oe)*ee,xe=Math.sin(oe)*ee,ze=this.properties.label.enabled?O(H,V,Ie,xe):void 0,he=this.getColumnWidth(ie,ne);R.push({series:this,datum:H,datumIndex:F,point:{x:Ie,y:xe,size:0},midPoint:{x:Ie,y:xe},label:ze,angleValue:j,radiusValue:V,negative:Q,innerRadius:le,outerRadius:re,stackInnerRadius:Me,stackOuterRadius:Ee,startAngle:ie,endAngle:ne,midAngle:oe,axisInnerRadius:v,axisOuterRadius:S,columnWidth:he,index:F})}return{itemId:T,nodeData:R,labelData:R}}getColumnWidth(e,t){return NaN}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemStyle(e,t){const{id:i,properties:s}=this,{angleKey:n,radiusKey:o,itemStyler:a,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c}=s,h=this.getHighlightStyle(t,e.datumIndex),d=GF(h,s.getStyle());let u=ZI(d,r,l,c);if(a!=null&&e!=null){const p=this.cachedDatumCallback(BF(this.getDatumId(e),t?"highlight":"node"),()=>{const g=this.ctx.highlightManager?.getActiveHighlight(),f=this.getHighlightStateString(g,t,e.datumIndex);return this.callWithContext(a,{seriesId:i,datum:e.datum,highlighted:t,highlightState:f,angleKey:n,radiusKey:o,...u})});p&&(u=ZI(GF(p,u),r,l,c))}return u}updateSectorSelection(e,t){let i=[];if(t){const r=this.ctx.highlightManager?.getActiveHighlight();r?.datum&&r.series===this&&i.push(r)}else i=this.nodeData;const s=this.isRadiusAxisReversed(),n=s?this.radius:this.getAxisInnerRadius(),o=s?this.getAxisInnerRadius():this.radius,a=this.getShapeFillBBox();e.update(i,void 0,r=>this.getDatumId(r)).each((r,l)=>{const{midPoint:c}=l,h=this.getItemStyle(l,t),d=h.fill,p=goe(d)&&d.bounds==="item"?{centerX:c?.x??0,centerY:c?.y??0}:{centerX:0,centerY:0,innerRadius:n,outerRadius:o};this.updateItemPath(r,l,t),poe(r,h,a,p),r.cornerRadius=h.cornerRadius,r.lineJoin="round"})}updateLabels(){const e=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.update(this.nodeData).each((t,i)=>{const s=this.getHighlightStateString(e,!1,i.datumIndex);foe(this,t,this.properties,this.properties.label,i.label,!1,s),t.fillOpacity=this.getHighlightStyle(!1,i.datumIndex).opacity??1})}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getColumnTransitionFunctions();_F.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),loe(this,"labels",this.ctx.animationManager,e)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getColumnTransitionFunctions();_F.fromToMotion(this.id,"datums",t,[e],i),coe(this,"labels",t,this.labelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,tooltip:h}=o,d=n[ja.Angle],u=n[ja.Radius],p=this.nodeData?.[e];if(!i||!s||!d||!u||!p)return;const g=s.dataSources.get(this.id)?.[e],f=i.resolveKeysById(this,"angleValue",s)[e],x=i.resolveColumnById(this,"radiusValue-raw",s)[e];if(f==null)return;const m=this.getItemStyle(p,!1);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(d,"tooltip",f,g,a,void 0),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(u,"tooltip",x,g,l,void 0)}]},{seriesId:t,datum:g,title:r,angleKey:a,angleName:r,radiusKey:l,radiusName:c,...m})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c}=this.properties,h=ZI({fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a},r,l,c);return A.isGradientFill(h.fill)&&(h.fill={...h.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:h}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{radiusKey:s,radiusName:n,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i,label:{text:n??s},symbol:this.legendItemSymbol(),hideInLegend:!o}]}getDatumId(e){return BF(e.angleValue)}computeLabelsBBox(){return null}},{SeriesProperties:moe,FillGradientDefaults:xoe,FillPatternDefaults:boe,FillImageDefaults:voe,makeSeriesTooltip:Soe,Property:Si,Label:Moe}=A,Jt=class extends moe{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new xoe,this.fillPatternDefaults=new boe,this.fillImageDefaults=new voe,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 Moe,this.tooltip=Soe()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r,opacity:1}}};y([Si],Jt.prototype,"angleKey",2),y([Si],Jt.prototype,"angleName",2),y([Si],Jt.prototype,"radiusKey",2),y([Si],Jt.prototype,"radiusName",2),y([Si],Jt.prototype,"fill",2),y([Si],Jt.prototype,"fillGradientDefaults",2),y([Si],Jt.prototype,"fillPatternDefaults",2),y([Si],Jt.prototype,"fillImageDefaults",2),y([Si],Jt.prototype,"fillOpacity",2),y([Si],Jt.prototype,"stroke",2),y([Si],Jt.prototype,"strokeWidth",2),y([Si],Jt.prototype,"strokeOpacity",2),y([Si],Jt.prototype,"lineDash",2),y([Si],Jt.prototype,"lineDashOffset",2),y([Si],Jt.prototype,"cornerRadius",2),y([Si],Jt.prototype,"itemStyler",2),y([Si],Jt.prototype,"rotation",2),y([Si],Jt.prototype,"stackGroup",2),y([Si],Jt.prototype,"normalizedTo",2),y([Si],Jt.prototype,"label",2),y([Si],Jt.prototype,"tooltip",2);var{motion:Doe}=A;function jF(){const e={startAngle:new Map,endAngle:new Map},t=["startAngle","endAngle"],i=(a,r,l)=>{t.forEach(c=>{const h=e[c];let d=(l==="removed"||l==="updated"?a:r)[c],u=(l==="removed"?a:r)[c];isNaN(u)&&(u=a.previousDatum?.[c]??NaN);const p=d-u;Math.abs(p)>Math.PI&&(d-=Math.sign(p)*2*Math.PI),h.set(r,{from:d,to:u})})},s=(a,r)=>({startAngle:e.startAngle.get(a)[r],endAngle:e.endAngle.get(a)[r]});return{calculate:i,from:a=>s(a,"from"),to:a=>s(a,"to")}}function HF(e,t,i){if(i==="updated"){if(e.previousDatum==null||isNaN(e.previousDatum.startAngle)||isNaN(e.previousDatum.endAngle))return"added";if(isNaN(t.startAngle)||isNaN(t.endAngle))return"removed"}return i==="added"&&e.previousDatum!=null?"updated":i}function Aoe(e){const t=jF();return{toFn:(n,o,a)=>{const{startAngle:r,endAngle:l}=t.to(o);let c,h,d,u,p;return a==="removed"?(c=n.innerRadius,h=n.innerRadius,d=n.columnWidth,u=n.axisInnerRadius,p=n.axisOuterRadius):(c=isNaN(o.innerRadius)?e:o.innerRadius,h=isNaN(o.outerRadius)?e:o.outerRadius,d=isNaN(o.columnWidth)?n.columnWidth:o.columnWidth,u=o.axisInnerRadius,p=o.axisOuterRadius),{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:u,axisOuterRadius:p,startAngle:r,endAngle:l}},fromFn:(n,o,a)=>{a=HF(n,o,a),t.calculate(n,o,a);const{startAngle:r,endAngle:l}=t.from(o);let c,h,d,u,p;a==="removed"||a==="updated"?(c=n.innerRadius,h=n.outerRadius,d=n.columnWidth,u=n.axisInnerRadius,p=n.axisOuterRadius):(c=e,h=e,d=o.columnWidth,u=o.axisInnerRadius,p=o.axisOuterRadius);const g=Doe.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:u,axisOuterRadius:p,startAngle:r,endAngle:l,phase:g}}}}function Ioe(e,{innerRadius:t,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:o,startAngle:a,endAngle:r}){return{innerRadius:t,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:o,startAngle:a,endAngle:r}}var{SectorBox:ov,motion:koe}=A;function XI(e){const{negative:t,innerRadius:i,outerRadius:s,stackInnerRadius:n,stackOuterRadius:o}=e;return{innerRadius:t?o:n,outerRadius:t?n:o,clipInnerRadius:t?s:i,clipOuterRadius:t?i:s}}function Coe(e){const t=jF();return{toFn:(n,o,a)=>{const{startAngle:r,endAngle:l}=t.to(o);let c,h,d;if(a==="removed")c=e,h=e,d=new ov(r,l,c,h);else{let u,p;({innerRadius:c,outerRadius:h,clipInnerRadius:u,clipOuterRadius:p}=XI(o)),isNaN(c)&&(c=e),isNaN(h)&&(h=e),isNaN(u)&&(u=e),isNaN(p)&&(p=e),d=new ov(r,l,u,p)}return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:d}},fromFn:(n,o,a)=>{a=HF(n,o,a),t.calculate(n,o,a);const{startAngle:r,endAngle:l}=t.from(o);let c,h,d;a==="removed"||a==="updated"?(c=n.innerRadius,h=n.outerRadius,d=n.clipSector):(c=e,h=e),d??(d=new ov(r,l,c,h));const u=koe.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:d,phase:u}}}}function Toe(e,t){const{startAngle:i,endAngle:s}=t,{innerRadius:n,outerRadius:o,clipInnerRadius:a,clipOuterRadius:r}=XI(t),l=new ov(i,s,a,r);return{innerRadius:n,outerRadius:o,startAngle:i,endAngle:s,clipSector:l}}var{Sector:Loe,SectorBox:woe,PolarZIndexMap:qI}=A,av=class extends VF{constructor(e){super(e,{animationResetFns:{item:Toe}}),this.properties=new Jt}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,qI.FOREGROUND,e],this.highlightGroup.zIndex=[0,qI.HIGHLIGHT,e],this.labelGroup.zIndex=[0,qI.LABEL,e],!0}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new Loe}updateItemPath(e,t,i){const{negative:s}=t;if(e.centerX=0,e.centerY=0,e.startOuterCornerRadius=s?0:this.properties.cornerRadius,e.endOuterCornerRadius=s?0:this.properties.cornerRadius,e.startInnerCornerRadius=s?this.properties.cornerRadius:0,e.endInnerCornerRadius=s?this.properties.cornerRadius:0,i){const{startAngle:n,endAngle:o}=t,{innerRadius:a,outerRadius:r,clipInnerRadius:l,clipOuterRadius:c}=XI(t);e.innerRadius=a,e.outerRadius=r,e.startAngle=n,e.endAngle=o,e.clipSector=new woe(n,o,l,c)}}getColumnTransitionFunctions(){const e=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return Coe(e)}hasItemStylers(){return this.properties.itemStyler!=null}};av.className="NightingaleSeries",av.type="nightingale";var{commonSeriesOptionsDefs:Noe,nightingaleSeriesThemeableOptionsDef:Eoe}=A,Ooe={...Noe,...Eoe,type:Y(Le("nightingale")),angleKey:Y(E),radiusKey:Y(E),angleName:E,radiusName:E,grouped:z,stacked:z,stackGroup:E,normalizedTo:K},{ThemeConstants:{POLAR_AXIS_TYPE:WF,POLAR_AXIS_SHAPE:$F}}=A,Poe={series:{fill:{$palette:"fill"},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$palette:"stroke"}]},fillGradientDefaults:A.FILL_GRADIENT_RADIAL_SERIES_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,strokeWidth:1,label:{...A.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:A.multiSeriesHighlightStyle()},axes:{[WF.ANGLE_CATEGORY]:{shape:{$findFirstSiblingNotOperation:$F.CIRCLE},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[WF.RADIUS_NUMBER]:{shape:{$findFirstSiblingNotOperation:$F.CIRCLE}}}},{ThemeConstants:{POLAR_AXIS_TYPE:UF}}=A,Roe={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"nightingale",moduleFactory:e=>new av(e),defaultAxes:[{type:UF.ANGLE_CATEGORY},{type:UF.RADIUS_NUMBER}],themeTemplate:Poe,stackable:!0,groupable:!0,stackedByDefault:!0},Boe={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,options:Ooe,create:e=>new av(e)},{SeriesProperties:Foe,FillGradientDefaults:zoe,FillPatternDefaults:_oe,FillImageDefaults:Goe,makeSeriesTooltip:Voe,Property:ei,Label:YF,DropShadow:joe}=A,Hoe=class extends YF{},QI=class extends YF{constructor(){super(...arguments),this.spacing=0}};y([ei],QI.prototype,"spacing",2),y([ei],QI.prototype,"placement",2);var ci=class extends Foe{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new zoe,this.fillPatternDefaults=new _oe,this.fillImageDefaults=new Goe,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 joe().set({enabled:!1}),this.label=new Hoe,this.stageLabel=new QI,this.tooltip=Voe()}getStyle(e=0){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=this;return{fill:t[e%t.length],fillOpacity:s,stroke:i[e%i.length],strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,opacity:1}}};y([ei],ci.prototype,"stageKey",2),y([ei],ci.prototype,"valueKey",2),y([ei],ci.prototype,"fills",2),y([ei],ci.prototype,"fillGradientDefaults",2),y([ei],ci.prototype,"fillPatternDefaults",2),y([ei],ci.prototype,"fillImageDefaults",2),y([ei],ci.prototype,"fillOpacity",2),y([ei],ci.prototype,"strokes",2),y([ei],ci.prototype,"strokeWidth",2),y([ei],ci.prototype,"strokeOpacity",2),y([ei],ci.prototype,"lineDash",2),y([ei],ci.prototype,"lineDashOffset",2),y([ei],ci.prototype,"direction",2),y([ei],ci.prototype,"reverse",2),y([ei],ci.prototype,"spacing",2),y([ei],ci.prototype,"aspectRatio",2),y([ei],ci.prototype,"itemStyler",2),y([ei],ci.prototype,"shadow",2),y([ei],ci.prototype,"label",2),y([ei],ci.prototype,"stageLabel",2),y([ei],ci.prototype,"tooltip",2);function KF(e,{x:t,y:i,top:s,right:n,bottom:o,left:a}){e.x0=t-s/2,e.x1=t+s/2,e.x2=t+o/2,e.x3=t-o/2,e.y0=i-a/2,e.y1=i-n/2,e.y2=i+n/2,e.y3=i+a/2}function Woe(e){return{fromFn:(n,o)=>{const{x:a,y:r}=o;let{top:l,right:c,bottom:h,left:d}=o;return e==="vertical"?(l=0,h=0):(d=0,c=0),{x:a,y:r,top:l,right:c,bottom:h,left:d}},toFn:(n,o)=>{const{x:a,y:r,top:l,right:c,bottom:h,left:d}=o;return{x:a,y:r,top:l,right:c,bottom:h,left:d}},applyFn:KF}}var{StateMachine:$oe,valueProperty:ZF,SeriesNodePickMode:XF,CachedTextMeasurerPool:Uoe,TextUtils:Yoe,createDatumId:Koe,BBox:JI,Group:ek,Selection:rv,Text:qF,PointerEvents:QF,applyShapeStyle:Zoe,mergeDefaults:JF,fromToMotion:Xoe,seriesLabelFadeInAnimation:qoe,getShapeStyle:tk,getLabelStyles:Qoe}=A,lv=class extends A.DataModelSeries{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[XF.EXACT_SHAPE_MATCH,XF.NEAREST_NODE]}),this.properties=new ci,this.itemGroup=this.contentGroup.appendChild(new ek({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new ek({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new ek({name:"stageLabelGroup"})),this.datumSelection=rv.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=rv.select(this.itemLabelGroup,qF),this.stageLabelSelection=rv.select(this.stageLabelGroup,qF),this.highlightDatumSelection=rv.select(this.highlightGroup,()=>this.nodeFactory()),this.animationState=new $oe("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=QF.None,this.stageLabelGroup.pointerEvents=QF.None}addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",e=>this.onLegendItemClick(e)))}nodeFactory(){return new Va}getNodeData(){return this.contextNodeData?.nodeData}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}async processData(e){if(this.data==null)return;const{id:t,visible:i,ctx:{legendManager:s}}=this,{stageKey:n,valueKey:o}=this.properties,a="category",r="number",l=(h,d,u)=>i&&s.getItemEnabled({seriesId:t,itemId:u}),c=this.visible?{}:{forceValue:0};await this.requestDataModel(e,this.data,{props:[ZF(n,a,{id:"xValue"}),ZF(o,r,{id:"yValue",...c,validation:l,invalidValue:0})]})}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,visible:n,ctx:{legendManager:o}}=this,{stageKey:a,valueKey:r,direction:l,reverse:c=l==="horizontal",spacing:h,aspectRatio:d,label:u,stageLabel:p}=s;if(t==null||i==null)return;const g=l==="horizontal",f=t.resolveColumnById(this,"xValue",i),x=t.resolveColumnById(this,"yValue",i),m=t.getDomain(this,"xValue","value",i),b=t.getDomain(this,"yValue","value",i),v=Uoe.getMeasurer({font:p});let S,D;g?(S="center",D=p.placement==="before"?"bottom":"top"):(S=p.placement==="after"?"left":"right",D="middle");const C=p.enabled?[]:void 0;let T=0,k=0,L=0;const N=i.dataSources.get(this.id)??[];N.forEach(($,U)=>{const Z=f[U],q=x[U],Q=n&&o.getItemEnabled({seriesId:e,itemId:U});if(L+=q,C==null)return;const ie=this.getLabelText(Z,$,a,"x",m,this.properties.stageLabel,{datum:$,value:q,stageKey:a,valueKey:r}),{width:ne}=v.measureText(ie),oe=ie.split(`
`).length*Yoe.getLineHeight(u.fontSize);T=Math.max(T,ne),k=Math.max(k,oe),C.push({x:NaN,y:NaN,text:ie,textAlign:S,textBaseline:D,visible:Q})});const w=this._nodeDataDependencies?.seriesRectWidth??0,O=this._nodeDataDependencies?.seriesRectHeight??0,R=h*(i.input.count-1);let B;if(g){const $=k+p.spacing;B=new JI(0,p.placement==="before"?$:0,w,O-$)}else{const $=T+p.spacing;B=new JI(p.placement==="after"?0:$,0,w-$,O)}if(d!=null&&d!==0){const $=l==="horizontal"?1/d:d,U=Math.min(B.width,B.height*$),Z=U/$;B=new JI(B.x+(B.width-U)/2,B.y+(B.height-Z)/2,U,Z)}let P,_;g?_=p.placement==="before"?B.y-p.spacing:B.y+B.height+p.spacing:P=p.placement==="after"?B.x+B.width+p.spacing:B.x-p.spacing;const F=B.width-(g?R:0),W=B.height-(g?0:R);if(F<0||W<0)return;const H=[],j=[];let V=0;return N.forEach(($,U)=>{const Z=f[U],q=x[U],Q=n&&o.getItemEnabled({seriesId:e,itemId:U}),ie=V+q,ne=(V+ie)/(2*L),oe=(ie-V)/L,le=g?F*ne+h*U:F*.5,re=g?W*.5:W*ne+h*U,ee=B.x+le,Me=B.y+re;if(C!=null){const be=C[U];be.x=P??ee,be.y=_??Me}let Ee,Ie,xe,ze;if(g){const be=F*oe;Ee=be,xe=be;const Se=(le+be/2)*(W/B.width),Oe=(le-be/2)*(W/B.width);Ie=c?B.height-Se:Se,ze=c?B.height-Oe:Oe}else{const be=W*oe;Ie=be,ze=be;const Se=(re-be/2)*(F/B.height),Oe=(re+be/2)*(F/B.height);Ee=c?B.width-Se:Se,xe=c?B.width-Oe:Oe}const he=this.getLabelText(q,$,r,"y",b,u,{datum:$,value:q,stageKey:a,valueKey:r}),ye={x:ee,y:Me,text:he,textAlign:"center",textBaseline:"middle",visible:Q};j.push(ye),H.push({series:this,itemId:r,datum:$,datumIndex:U,index:U,xValue:Z,yValue:q,x:ee,y:Me,top:Ee,right:Ie,bottom:xe,left:ze,label:ye,enabled:Q,midPoint:{x:ee,y:Me}}),V=ie}),{itemId:e,nodeData:H,labelData:j,stageLabelData:C,bounds:B}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:e}){this.checkResize(e);const{datumSelection:t,labelSelection:i,stageLabelSelection:s,highlightDatumSelection:n}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let o=this.ctx.highlightManager?.getActiveHighlight();o!=null&&(o.series!==this||o.datum==null)&&(o=void 0);const a=this.contextNodeData?.nodeData??[],r=this.contextNodeData?.labelData??[],l=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:t}),this.updateDatumNodes({datumSelection:t,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:o!=null?[o]:[],datumSelection:n}),this.updateDatumNodes({datumSelection:n,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData)}getItemStyle({datumIndex:e,datum:t},i){const{id:s,properties:n}=this,{stageKey:o,valueKey:a,itemStyler:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=n,d=this.getHighlightStyle(i,e),u=JF(d,n.getStyle(e));let p=tk(u,l,c,h);if(r!=null&&e!=null){const g=this.ctx.highlightManager?.getActiveHighlight(),f=this.cachedDatumCallback(Koe(e,i?"highlight":"node"),()=>{const x=this.getHighlightStateString(g,i,e);return this.callWithContext(r,{seriesId:s,datum:t,stageKey:o,valueKey:a,highlighted:i,highlightState:x,...p})});f&&(p=tk(JF(f,p),l,c,h))}return p}updateDatumNodes(e){const{datumSelection:t,isHighlight:i}=e,{properties:s}=this,{shadow:n}=s,o=this.contextNodeData?.bounds,a=o?{series:o,axis:o}:void 0;t.each((r,l)=>{const c=this.getItemStyle(l,i);Zoe(r,c,a),KF(r,l),r.fillShadow=n})}updateLabelSelection(e){return e.labelSelection.update(this.properties.label.enabled?e.labelData:[])}updateStageLabelSelection(e){return e.stageLabelSelection.update(e.stageLabelData)}updateLabelNodes(e){e.labelSelection.each((t,i,s)=>{const{visible:n,x:o,y:a,text:r,textAlign:l,textBaseline:c}=i,h=Qoe(this,void 0,this.properties,e.labelProperties),{color:d,fontSize:u,fontStyle:p,fontWeight:g,fontFamily:f}=h;t.visible=n,t.x=o,t.y=a,t.text=r,t.fill=d,t.fillOpacity=this.getHighlightStyle(!1,s).opacity??1,t.fontStyle=p,t.fontWeight=g,t.fontSize=u,t.fontFamily=f,t.textAlign=l,t.textBaseline=c,t.setBoxing(h)})}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(t!==void 0){for(const i of this.datumSelection)if(i.datum===t)return i.node}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{stageKey:o,valueKey:a,tooltip:r}=n;if(!i||!s)return;const l=s.dataSources.get(this.id)?.[e],c=i.resolveColumnById(this,"xValue",s)[e],h=i.resolveColumnById(this,"yValue",s)[e];if(c==null)return;const d=this.getLabelText(c,l,o,"x",i.getDomain(this,"xValue","value",s),this.properties.stageLabel,{datum:l,value:c,stageKey:o,valueKey:a}),u=this.getLabelText(h,l,a,"y",i.getDomain(this,"yValue","value",s),this.properties.stageLabel,{datum:l,value:h,stageKey:o,valueKey:a}),p=this.getItemStyle({datumIndex:e,datum:l},!1);return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:d,value:u}]},{seriesId:t,datum:l,title:void 0,stageKey:o,valueKey:a,...p})}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((n,o)=>{const a=n.distanceSquared(e,t);a<i&&(i=a,s=o)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}legendItemSymbol(e){const{fills:t,strokes:i,strokeWidth:s,fillOpacity:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=this.properties,l=t[e%t.length]??"black",c=i[e%i.length]??"black";return{marker:tk({fill:l,fillOpacity:n,stroke:c,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:r},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults)}}getLegendData(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:n},visible:o}=this;if(!i||!t||e!=="category")return[];const{showInLegend:a}=this.properties,r=[],l=i.resolveColumnById(this,"xValue",t);return(t.dataSources.get(this.id)??[]).forEach((h,d)=>{const u=l[d];r.push({legendType:"category",id:s,itemId:d,seriesId:s,enabled:o&&n.getItemEnabled({seriesId:s,itemId:d}),label:{text:u},symbol:this.legendItemSymbol(d),hideInLegend:!a})}),r}animateReset(){this.ctx.animationManager.skipCurrentBatch(),this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(){const{datumSelection:e,labelSelection:t,properties:i}=this,s=Woe(i.direction);Xoe(this.id,"nodes",this.ctx.animationManager,[e],s),qoe(this,"labels",this.ctx.animationManager,t)}hasItemStylers(){return this.properties.itemStyler!=null}};lv.className="PyramidSeries",lv.type="pyramid";var{commonSeriesOptionsDefs:Joe,pyramidSeriesThemeableOptionsDef:eae}=A,tae={...eae,...Joe,type:Y(Le("pyramid")),stageKey:Y(E),valueKey:Y(E)},{ThemeSymbols:{DEFAULT_SHADOW_COLOUR:iae}}=A,sae={series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacing:2,fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:A.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,label:{...A.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},stageLabel:{...A.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:12},shadow:{enabled:!1,color:iae,xOffset:3,yOffset:3,blur:5},highlight:A.singleSeriesHighlightStyle()}},nae={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"pyramid",moduleFactory:e=>new lv(e),solo:!0,themeTemplate:sae},oae={type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,options:tae,create:e=>new lv(e)},{ThemeConstants:{POLAR_AXIS_TYPE:aae}}=A,ez={series:{stroke:{$palette:"stroke"},label:{...A.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:A.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",1,0]}},highlight:A.multiSeriesHighlightStyle(),tooltip:{range:{$path:["/tooltip/range","nearest"]}}},axes:{[aae.ANGLE_CATEGORY]:{label:{spacing:10}}}},rae=A.mergeDefaults({series:{stroke:A.SAFE_STROKE_FILL_OPERATION,strokeWidth:2}},ez),lae=A.mergeDefaults({series:{fill:{$palette:"fill"},fillGradientDefaults:A.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,fillOpacity:.8,strokeWidth:2,marker:{enabled:!1}}},ez),{Label:cae,SeriesMarker:hae,SeriesProperties:dae,makeSeriesTooltip:uae,Property:dn}=A,Gs=class extends dae{constructor(){super(...arguments),this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new hae,this.label=new cae,this.tooltip=uae(),this.connectMissingData=!1}};y([dn],Gs.prototype,"angleKey",2),y([dn],Gs.prototype,"radiusKey",2),y([dn],Gs.prototype,"angleName",2),y([dn],Gs.prototype,"radiusName",2),y([dn],Gs.prototype,"stroke",2),y([dn],Gs.prototype,"strokeWidth",2),y([dn],Gs.prototype,"strokeOpacity",2),y([dn],Gs.prototype,"lineDash",2),y([dn],Gs.prototype,"lineDashOffset",2),y([dn],Gs.prototype,"rotation",2),y([dn],Gs.prototype,"marker",2),y([dn],Gs.prototype,"label",2),y([dn],Gs.prototype,"tooltip",2),y([dn],Gs.prototype,"connectMissingData",2);var{DEFAULT_POLAR_DIRECTION_KEYS:pae,DEFAULT_POLAR_DIRECTION_NAMES:gae,ChartAxisDirection:Mo,PolarAxis:fae,SeriesNodePickMode:tz,valueProperty:iz,fixNumericExtent:yae,seriesLabelFadeInAnimation:mae,markerFadeInAnimation:xae,resetMarkerFn:bae,animationValidation:vae,computeMarkerFocusBounds:Sae,extent:Mae,BBox:Dae,Group:Aae,Path:Iae,PointerEvents:kae,Selection:sz,Text:Cae,Marker:Tae,mergeDefaults:Lae,getShapeStyle:wae,updateLabelNode:Nae}=A,Eae=class extends A.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},ik=class extends A.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:pae,propertyNames:gae,pickModes:[tz.NEAREST_NODE,tz.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:bae},clipFocusBox:!1}),this.properties=new Gs,this.NodeEvent=Eae,this.lineGroup=this.contentGroup.appendChild(new Aae({name:"radar-line"})),this.lineSelection=sz.select(this.lineGroup,Iae),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}nodeFactory(){return new Tae}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];if(e===Mo.Angle)return t.getDomain(this,"angleValue","value",i);{const s=t.getDomain(this,"radiusValue","value",i),n=Mae(s.length===0?s:[0].concat(s));return yae(n)}}async processData(e){const{angleKey:t,radiusKey:i}=this.properties,s=[];this.ctx.animationManager.isSkipped()||s.push(vae());const n=this.axes[Mo.Radius]?.scale.type,o=this.axes[Mo.Angle]?.scale.type;await this.requestDataModel(e,this.data,{props:[iz(t,o,{id:"angleValue"}),iz(i,n,{id:"radiusValue",invalidValue:void 0}),...s]}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e===s.r&&t===s.cx&&i===s.cy?!1:(this.circleCache={r:e,cx:t,cy:i},!0)}getAxisInnerRadius(){const e=this.axes[Mo.Radius];return e instanceof fae?this.radius*e.innerRadiusRatio:0}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:t=[]}=this.createNodeData()??{};this.nodeData=t,this.nodeDataRefresh=!1}createNodeData(){const{processedData:e,dataModel:t}=this;if(!e||!t)return;const{angleKey:i,radiusKey:s,angleName:n,radiusName:o,marker:a,label:r}=this.properties,l=this.axes[Mo.Angle]?.scale,c=this.axes[Mo.Radius]?.scale;if(!l||!c)return;const h=t.resolveColumnById(this,"angleValue",e),d=t.resolveColumnById(this,"radiusValue",e),u=this.getAxisInnerRadius(),p=this.getSeriesDomain(Mo.Radius),f=(e.dataSources.get(this.id)??[]).map((x,m)=>{const b=h[m],v=d[m],S=l.convert(b),D=this.radius+u-c.convert(v),C=Math.cos(S),T=Math.sin(S),k=C*D,L=T*D;let N;if(r.enabled){const w=this.getLabelText(v,x,s,"radius",p,r,{value:v,datum:x,angleKey:i,radiusKey:s,angleName:n,radiusName:o});if(w){let O="right";lt(C,0)?O="center":C>0&&(O="left");let R="bottom";lt(T,0)?R="middle":T>0&&(R="top"),N={x:k+C*a.size,y:L+T*a.size,text:w,textAlign:O,textBaseline:R}}}return{series:this,datum:x,datumIndex:m,index:m,point:{x:k,y:L,size:a.size},midPoint:{x:k,y:L},label:N,angleValue:b,radiusValue:v,missing:!Ye(S)||!Ye(D)}});return{itemId:s,nodeData:f,labelData:f}}update({seriesRect:e}){const t=this.checkResize(e),i=!this.ctx.animationManager.isSkipped(),{series:s}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&s===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updatePathNodes(),this.updateMarkers(this.itemSelection,!1),this.updateMarkers(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const e=this.visible?[!0]:[];this.lineSelection.update(e)}updateMarkerSelection(){this.properties.marker.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=sz.select(this.itemGroup,()=>this.nodeFactory(),!1)),this.itemSelection.update(this.properties.marker.enabled?this.nodeData:[])}getMarkerFill(e){return e?.fill??this.properties.marker.fill}getDatumStylerProperties(e){const{id:t,properties:i}=this,{angleKey:s,radiusKey:n}=i;return{seriesId:t,datum:e,angleKey:s,radiusKey:n}}updateMarkers(e,t){const{visible:i}=this,{marker:s,stroke:n,strokeWidth:o,strokeOpacity:a}=this.properties;let r=[];if(i&&s.shape&&s.enabled)if(t){const c=this.ctx.highlightManager?.getActiveHighlight();c?.datum&&(r=[c])}else r=this.nodeData;const l=this.getShapeFillBBox();e.update(r).each((c,h)=>{const d=this.getMarkerStyle(s,h,this.getDatumStylerProperties(h),t,void 0,{stroke:n,strokeWidth:o,strokeOpacity:a});this.applyMarkerStyle(d,c,h.point,l)})}updateLabels(){this.labelSelection.update(this.nodeData).each((e,t)=>{if(t.label){e.fillOpacity=this.getHighlightStyle(!1,t.datumIndex).opacity??1;const s=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightStateString(s,!1,t.datumIndex);Nae(this,e,this.properties,this.properties.label,t.label,!1,n)}})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,tooltip:h,marker:d}=o,u=n[Mo.Angle],p=n[Mo.Radius];if(!i||!s||!u||!p)return;const g=s.dataSources.get(this.id)?.[e],f=i.resolveColumnById(this,"angleValue",s)[e],x=i.resolveColumnById(this,"radiusValue",s)[e];if(f==null)return;const m=this.getMarkerStyle(d,{datum:g,datumIndex:e},this.getDatumStylerProperties(g),!1);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(u,"tooltip",f,g,a,void 0),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(p,"tooltip",x,g,l,void 0)}]},{seriesId:t,datum:g,title:r,angleKey:a,radiusKey:l,angleName:r,radiusName:c,...m})}legendItemSymbol(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,marker:n}=this.properties;return{marker:wae({shape:n.shape,enabled:n.enabled||t<=0,fill:this.getMarkerFill()??n.stroke??e??"rgba(0, 0, 0, 0)",stroke:n.stroke??e??"rgba(0, 0, 0, 0)",fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},n.fillGradientDefaults,n.fillPatternDefaults,n.fillImageDefaults),line:{stroke:e,strokeOpacity:i,strokeWidth:t,lineDash:s}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{radiusKey:n,radiusName:o,showInLegend:a}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:o??n},symbol:this.legendItemSymbol(),hideInLegend:!a}]}pickNodeClosestDatum(e){const{nodeData:t,centerX:i,centerY:s}=this,{x:n,y:o}=e,a=this.radius;if(Math.sqrt((n-i)**2+(o-s)**2)>a+this.properties.marker.size)return;let l=1/0,c;for(const h of t){const{point:{x:d=NaN,y:u=NaN}={}}=h;if(isNaN(d)||isNaN(u))continue;const p=Math.sqrt((e.x-d-i)**2+(e.y-u-s)**2);p<l&&(l=p,c=h)}if(c){const h=Math.max(l-(c.point?.size??0),0);return{datum:c,distance:h}}}computeLabelsBBox(){const{label:e}=this.properties;this.maybeRefreshNodeData();const t=[],i=new Cae;return this.nodeData.forEach(s=>{if(!e.enabled||!s.label)return;i.text=s.label.text,i.x=s.label.x,i.y=s.label.y,i.setFont(e),i.setAlign(s.label);const n=i.getBBox();t.push(n)}),t.length===0?null:Dae.merge(t)}getLineNode(){return this.lineSelection?.at(0)}beforePathAnimation(){this.updatePathNodes()}updatePathNodes(){const e=this.getLineNode();if(!e)return;const{strokeWidth:t,stroke:i,strokeOpacity:s,lineDash:n,lineDashOffset:o,opacity:a}=Lae(this.getHighlightStyle(),this.properties);e.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:kae.None,opacity:a,stroke:i,strokeWidth:t,strokeOpacity:s,lineDash:n,lineDashOffset:o})}getLinePoints(){const{nodeData:e,resetInvalidToZero:t}=this,{connectMissingData:i}=this.properties;if(e.length===0)return[];const s=this.axes[Mo.Radius],o=this.axes[Mo.Angle]?.isReversed(),r=s?.isReversed()&&!o?[...e].reverse():e,l=[];let c=!1,h;return r.forEach((d,u)=>{let{x:p,y:g}=d.point;const f=isNaN(p)||isNaN(g);f||(h??(h=d)),f&&!i&&(p=0,g=0);const x=u===0||!t&&!i&&(f||c);l.push({x:p,y:g,moveTo:x}),c=f}),h!==void 0&&l.push({x:h.point.x,y:h.point.y,moveTo:!1}),l}animateSinglePath(e,t,i){const{path:s}=e;s.clear(!0);const n=this.getAxisInnerRadius(),o=this.axes[Mo.Radius],r=o?.isReversed()?this.radius+n-o?.scale.convert(0):n;t.forEach(l=>{const{x:c,y:h,arc:d,radius:u=0,startAngle:p=0,endAngle:g=0,moveTo:f}=l,x=Math.atan2(h,c),m=r*Math.cos(x),b=r*Math.sin(x),v=i,S=m*(1-v)+c*v,D=b*(1-v)+h*v;d?s.arc(c,h,u,p,g):f?s.moveTo(S,D):s.lineTo(S,D)}),e.checkPathDirty()}animatePaths(e){const t=this.getLinePoints(),i=this.getLineNode();i&&this.animateSinglePath(i,t,e)}animateEmptyUpdateReady(){const{itemSelection:e,labelSelection:t}=this,{animationManager:i}=this.ctx;this.beforePathAnimation(),i.animate({id:`${this.id}_'path`,groupId:this.id,from:0,to:1,phase:"initial",collapsable:!1,onUpdate:s=>this.animatePaths(s),onStop:()=>this.animatePaths(1)}),xae(this,i,"added",e),mae(this,"labels",i,t)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e),this.resetPaths()}animateReadyResize(e){super.animateReadyResize(e),this.resetPaths()}resetPaths(){const e=this.getLineNode();if(e){const{path:t}=e,i=this.getLinePoints();e.fill=void 0,e.stroke=this.properties.stroke,e.strokeWidth=this.properties.strokeWidth,e.strokeOpacity=this.properties.strokeOpacity,e.lineDash=this.properties.lineDash,e.lineDashOffset=this.properties.lineDashOffset,t.clear(!0);for(const{x:s,y:n,moveTo:o}of i)o?t.moveTo(s,n):t.lineTo(s,n);e.checkPathDirty()}}getFormattedMarkerStyle(e){const{angleKey:t,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,e,{angleKey:t,radiusKey:i},!0)}computeFocusBounds(e){return Sae(this,e)}};ik.className="RadarSeries";var{FillGradientDefaults:Oae,FillPatternDefaults:Pae,FillImageDefaults:Rae,Property:pf}=A,ku=class extends Gs{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new Oae,this.fillPatternDefaults=new Pae,this.fillImageDefaults=new Rae,this.fillOpacity=1}};y([pf],ku.prototype,"fill",2),y([pf],ku.prototype,"fillGradientDefaults",2),y([pf],ku.prototype,"fillPatternDefaults",2),y([pf],ku.prototype,"fillImageDefaults",2),y([pf],ku.prototype,"fillOpacity",2);var{Group:Bae,Path:Fae,PointerEvents:zae,Selection:_ae,ChartAxisDirection:nz,applyShapeStyle:oz,getShapeFill:Gae,getShapeStyle:Vae,mergeDefaults:jae}=A,cv=class extends ik{constructor(e){super(e),this.properties=new ku,this.areaGroup=this.contentGroup.appendChild(new Bae({name:"radar-area"})),this.areaSelection=_ae.select(this.areaGroup,Fae),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}updatePathSelections(){const e=this.visible?[!0]:[];this.areaSelection.update(e),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(e){return e?.fill??this.properties.marker.fill??this.properties.fill}updatePathNodes(){super.updatePathNodes();const{fill:e,fillOpacity:t,opacity:i}=jae(this.getHighlightStyle(),this.properties),{fill:s,fillOpacity:n}=Vae({fill:e,fillOpacity:t},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults),o=this.getAreaNode();o&&(oz(o,{fill:s,fillOpacity:n,stroke:void 0},this.getShapeFillBBox()),o.setProperties({lineJoin:"round",pointerEvents:zae.None,opacity:i}))}animatePaths(e){super.animatePaths(e);const t=this.getAreaNode();t&&this.animateSinglePath(t,this.getAreaPoints(),e)}getAreaPoints(){const e=this.getLinePoints(),t=a=>{const r=this.axes[a];return r instanceof A.PolarAxis?r:void 0},i=t(nz.Radius),s=t(nz.Angle);if(!i?.isReversed())return e;const o=s?.getAxisLinePoints()?.points??[];return e.concat(...o)}hasItemStylers(){return this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}resetPaths(){super.resetPaths();const e=this.getAreaNode();if(e){const{path:t}=e,i=this.getAreaPoints(),s=Gae(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults),n=this.getShapeFillBBox();oz(e,{fill:s,stroke:void 0,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset},n),e.lineJoin=e.lineCap="round",t.clear(!0),i.forEach(({x:o,y:a,moveTo:r,arc:l,radius:c=0,startAngle:h=0,endAngle:d=0})=>{l?t.arc(o,a,c,h,d):r?t.moveTo(o,a):t.lineTo(o,a)}),t.closePath(),e.checkPathDirty()}}};cv.className="RadarAreaSeries",cv.type="radar-area";var{commonSeriesOptionsDefs:Hae,radarAreaSeriesThemeableOptionsDef:Wae}=A,$ae={...Hae,...Wae,type:Y(Le("radar-area")),angleKey:Y(E),radiusKey:Y(E),angleName:E,radiusName:E},{ThemeConstants:{POLAR_AXIS_TYPE:az}}=A,Uae={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-area",moduleFactory:e=>new cv(e),defaultAxes:[{type:az.ANGLE_CATEGORY},{type:az.RADIUS_NUMBER}],themeTemplate:lae},Yae={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,options:$ae,create:e=>new cv(e)},hv=class extends ik{hasItemStylers(){return this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}};hv.className="RadarLineSeries",hv.type="radar-line";var{commonSeriesOptionsDefs:Kae,radarLineSeriesThemeableOptionsDef:Zae}=A,Xae={...Kae,...Zae,type:Y(Le("radar-line")),angleKey:Y(E),radiusKey:Y(E),angleName:E,radiusName:E},{POLAR_AXIS_TYPE:rz}=A.ThemeConstants,qae={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-line",moduleFactory:e=>new hv(e),defaultAxes:[{type:rz.ANGLE_CATEGORY},{type:rz.RADIUS_NUMBER}],themeTemplate:rae},Qae={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,options:Xae,create:e=>new hv(e)},{SeriesProperties:Jae,FillGradientDefaults:ere,FillPatternDefaults:tre,FillImageDefaults:ire,makeSeriesTooltip:sre,Property:Mi,Label:nre}=A,hi=class extends Jae{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new ere,this.fillPatternDefaults=new tre,this.fillImageDefaults=new ire,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 nre,this.tooltip=sre()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r,opacity:1}}};y([Mi],hi.prototype,"angleKey",2),y([Mi],hi.prototype,"radiusKey",2),y([Mi],hi.prototype,"angleName",2),y([Mi],hi.prototype,"radiusName",2),y([Mi],hi.prototype,"fill",2),y([Mi],hi.prototype,"fillGradientDefaults",2),y([Mi],hi.prototype,"fillPatternDefaults",2),y([Mi],hi.prototype,"fillImageDefaults",2),y([Mi],hi.prototype,"fillOpacity",2),y([Mi],hi.prototype,"stroke",2),y([Mi],hi.prototype,"strokeWidth",2),y([Mi],hi.prototype,"strokeOpacity",2),y([Mi],hi.prototype,"lineDash",2),y([Mi],hi.prototype,"lineDashOffset",2),y([Mi],hi.prototype,"cornerRadius",2),y([Mi],hi.prototype,"itemStyler",2),y([Mi],hi.prototype,"rotation",2),y([Mi],hi.prototype,"stackGroup",2),y([Mi],hi.prototype,"normalizedTo",2),y([Mi],hi.prototype,"label",2),y([Mi],hi.prototype,"tooltip",2);var{SectorBox:lz,motion:ore}=A;function are(e,t,i){if(i==="updated"){if(e.previousDatum==null||isNaN(e.previousDatum.innerRadius)||isNaN(e.previousDatum.outerRadius))return"added";if(isNaN(t.innerRadius)||isNaN(t.outerRadius))return"removed"}return i==="added"&&e.previousDatum!=null?"updated":i}function cz(e){return{toFn:(s,n,o)=>{let a,r,l,c,h;return o==="removed"?(a=e,r=e,l=n.innerRadius,c=n.outerRadius,h=new lz(a,r,l,c)):(a=n.startAngle,r=n.endAngle,l=isNaN(n.innerRadius)?s.innerRadius:n.innerRadius,c=isNaN(n.outerRadius)?s.outerRadius:n.outerRadius,h=n.clipSector),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h}},fromFn:(s,n,o)=>{o=are(s,n,o);let a,r,l,c,h;o==="removed"||o==="updated"?(a=s.startAngle,r=s.endAngle,l=s.innerRadius,c=s.outerRadius,h=s.clipSector):(a=e,r=e,l=n.innerRadius,c=n.outerRadius),h??(h=new lz(a,r,l,c));const d=ore.NODE_UPDATE_STATE_TO_PHASE_MAPPING[o];return{startAngle:a,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h,phase:d}}}}function rre(e,t){return{centerX:0,centerY:0,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,clipSector:t.clipSector}}var{DEFAULT_POLAR_DIRECTION_KEYS:lre,DEFAULT_POLAR_DIRECTION_NAMES:cre,ChartAxisDirection:qo,PolarAxis:hre,diff:dre,groupAccumulativeValueProperty:hz,keyProperty:ure,normaliseGroupTo:pre,valueProperty:gre,fixNumericExtent:fre,resetLabelFn:yre,seriesLabelFadeInAnimation:mre,seriesLabelFadeOutAnimation:xre,animationValidation:bre,angleBetween:vre,createDatumId:dz,CategoryScale:Sre,Sector:Mre,SectorBox:Dre,motion:uz,isGradientFill:Are,applyShapeStyle:Ire,getShapeStyle:sk,updateLabelNode:kre,mergeDefaults:pz}=A,Cre=class extends A.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},dv=class extends A.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"radiusValue",propertyKeys:lre,propertyNames:cre,canHaveAxes:!0,animationResetFns:{item:rre,label:yre}}),this.properties=new hi,this.NodeEvent=Cre,this.groupScale=new Sre,this.circleCache={r:0,cx:0,cy:0}}get defaultShapeStyle(){const e=this.axes[qo.Angle]?.scale;return{...this.properties.fillGradientDefaults.toJson(),rotation:A.toDegrees(e.range[0])+90}}nodeFactory(){return new Mre}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];if(e===qo.Angle){const s=t.getDomain(this,"angleValue-end","value",i),n=[s[0]>0?0:s[0],s[1]<0?0:s[1]];return fre(n)}else return t.getDomain(this,"radiusValue","key",i)}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped(),o=this.getStackId(),a=`${o}-trailing`,r=[];ii(s)&&r.push(pre([o,a],Math.abs(s))),n&&(this.processedData&&r.push(dre(this.id,this.processedData)),r.push(bre()));const l=this.visible?{}:{forceValue:0},c=this.axes[qo.Radius]?.scale.type,h=this.axes[qo.Angle]?.scale.type;await this.requestDataModel(e,this.data,{props:[ure(i,c,{id:"radiusValue"}),gre(t,h,{id:"angleValue-raw",invalidValue:null,...l}),...hz(t,"normal","current",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:o,separateNegative:!0,...l},h),...hz(t,"trailing","current",{id:"angleValue-start",invalidValue:null,groupId:a,separateNegative:!0,...l},h),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e===s.r&&t===s.cx&&i===s.cy?!1:(this.circleCache={r:e,cx:t,cy:i},!0)}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:t=[]}=this.createNodeData()??{};this.nodeData=t,this.nodeDataRefresh=!1}getAxisInnerRadius(){const e=this.axes[qo.Radius];return e instanceof hre?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t}=this;if(!t||!e||e.type!=="grouped")return;const i=this.axes[qo.Angle],s=this.axes[qo.Radius],n=i?.scale,o=s?.scale;if(!n||!o)return;const a=t.resolveKeysById(this,"radiusValue",e),r=t.resolveColumnById(this,"angleValue-start",e),l=t.resolveColumnById(this,"angleValue-end",e),c=t.resolveColumnById(this,"angleValue-raw",e),h=t.resolveProcessedDataIndexById(this,"angleValue-range");let d=0;s instanceof Dl&&(d=s.groupPaddingInner);const{groupScale:u}=this,{index:p,visibleGroupCount:g}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);u.domain=Array.from({length:g}).map((_,F)=>String(F)),u.range=[0,Math.abs(o.bandwidth??0)],u.paddingInner=g>1?d:0;const f=u.bandwidth>=1?u.bandwidth:u.rawBandwidth,x=i.isReversed(),m=s.isReversed(),b=m?this.radius:this.getAxisInnerRadius(),S=(m?this.getAxisInnerRadius():this.radius)+b,D=this.getSeriesDomain(qo.Angle),{angleKey:C,radiusKey:T,angleName:k,radiusName:L,label:N}=this.properties,w=(_,F,W,H)=>{const j=this.getLabelText(F,_,C,"angle",D,N,{value:F,datum:_,angleKey:C,radiusKey:T,angleName:k,radiusName:L});if(j)return{x:W,y:H,text:j,textAlign:"center",textBaseline:"middle"}},O=[],R={itemId:T,nodeData:O,labelData:O};if(!this.visible)return R;const{dataSources:B}=e,P=B.get(this.id)??[];for(const{datumIndex:_,group:F}of t.forEachGroupDatum(this,e)){const W=P[_],H=a[_];if(H==null)return;const j=c[_],V=r[_],$=l[_],U=j>=0&&!Object.is(j,-0),Z=F.aggregation[h][U?1:0],q=U===x;let Q=n.convert(V,{clamp:!0}),ie=n.convert($,{clamp:!0}),ne=n.convert(0,{clamp:!0}),oe=n.convert(Z,{clamp:!0});q&&([ne,oe]=[oe,ne],[Q,ie]=[ie,Q]);const re=S-o.convert(H)+u.convert(String(p)),ee=re+f,Me=(re+ee)/2,Ee=Q+vre(Q,ie)/2,Ie=Math.cos(Ee)*Me,xe=Math.sin(Ee)*Me,ze=this.properties.label.enabled?w(W,j,Ie,xe):void 0,he=new Dre(Q,ie,re,ee);O.push({series:this,datum:W,datumIndex:_,point:{x:Ie,y:xe,size:0},midPoint:{x:Ie,y:xe},label:ze,angleValue:j,radiusValue:H,innerRadius:re,outerRadius:ee,startAngle:ne,endAngle:oe,clipSector:he,reversed:q,index:_})}return R}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemStyle(e,t){const{id:i,properties:s}=this,{angleKey:n,radiusKey:o,itemStyler:a,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c}=s,h=this.getHighlightStyle(t,e.datumIndex),d=pz(h,s.getStyle());let u=sk(d,r,l,c);if(a!=null&&e!=null){const p=this.cachedDatumCallback(dz(this.getDatumId(e),t?"highlight":"node"),()=>{const g=this.ctx.highlightManager?.getActiveHighlight(),f=this.getHighlightStateString(g,t,e.datumIndex);return this.callWithContext(a,{seriesId:i,datum:e.datum,highlighted:t,highlightState:f,angleKey:n,radiusKey:o,...u})});p&&(u=sk(pz(p,u),r,l,c))}return u}updateSectorSelection(e,t){let i=[];if(t){const n=this.ctx.highlightManager?.getActiveHighlight();n?.datum&&n.series===this&&i.push(n)}else i=this.nodeData;const s=this.getShapeFillBBox();e.update(i,void 0,n=>this.getDatumId(n)).each((n,o)=>{const a=Vg(o);if(a==null)return;const r=this.getItemStyle(o,t),l=r.cornerRadius,c=r.fill,h=A.isGradientFill(c)&&c.bounds!=="item"?{centerX:0,centerY:0}:void 0;Ire(n,r,s,h),n.lineJoin="round",n.inset=n.stroke!=null?n.strokeWidth/2:0,n.startInnerCornerRadius=a.reversed?l:0,n.startOuterCornerRadius=a.reversed?l:0,n.endInnerCornerRadius=a.reversed?0:l,n.endOuterCornerRadius=a.reversed?0:l,t&&(n.startAngle=o.startAngle,n.endAngle=o.endAngle,n.clipSector=o.clipSector,n.innerRadius=o.innerRadius,n.outerRadius=o.outerRadius)})}updateLabels(){this.labelSelection.update(this.nodeData).each((e,t)=>{const s=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightStateString(s,!1,t.datumIndex);kre(this,e,this.properties,this.properties.label,t.label,!1,n),e.fillOpacity=this.getHighlightStyle(!1,t.datumIndex).opacity??1})}getBarTransitionFunctions(){const e=this.axes[qo.Angle]?.scale;let t=0;if(!e)return cz(t);const i=Math.min(e.domain[0],e.domain[1]),s=Math.max(e.domain[0],e.domain[1]);return i<=0&&s>=0&&(t=e.convert(0)),cz(t)}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getBarTransitionFunctions();uz.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),mre(this,"labels",this.ctx.animationManager,e)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getBarTransitionFunctions();uz.fromToMotion(this.id,"datums",t,[e],i),xre(this,"labels",t,this.labelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,tooltip:h}=o,d=n[qo.Angle],u=n[qo.Radius],p=this.nodeData?.[e];if(!i||!s||!d||!u||!p)return;const g=s.dataSources.get(this.id)?.[e],f=i.resolveKeysById(this,"radiusValue",s)[e],x=i.resolveColumnById(this,"angleValue-raw",s)[e];if(f==null)return;const m=this.getItemStyle(p,!1);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(u,"tooltip",f,g,l,void 0),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:a,value:this.getAxisValueText(d,"tooltip",x,g,a,void 0)}]},{seriesId:t,datum:g,title:r,angleKey:a,angleName:r,radiusKey:l,radiusName:c,...m})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a,fillPatternDefaults:r,fillImageDefaults:l}=this.properties,c=sk({fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a},this.defaultShapeStyle,r,l);return Are(c.fill)&&(c.fill={...c.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:c}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{angleKey:s,angleName:n,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i,label:{text:n??s},symbol:this.legendItemSymbol(),hideInLegend:!o}]}getDatumId(e){return dz(e.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}hasItemStylers(){return this.properties.itemStyler!=null}};dv.className="RadialBarSeries",dv.type="radial-bar";var{commonSeriesOptionsDefs:Tre,radialBarSeriesThemeableOptionsDef:Lre}=A,wre={...Tre,...Lre,type:Y(Le("radial-bar")),angleKey:Y(E),radiusKey:Y(E),angleName:E,radiusName:E,grouped:z,stacked:z,stackGroup:E,normalizedTo:K},{ThemeConstants:{POLAR_AXIS_TYPE:Nre}}=A,Ere={series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:A.FILL_GRADIENT_CONIC_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...A.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},highlight:A.multiSeriesHighlightStyle()},axes:{[Nre.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},{POLAR_AXIS_TYPE:gz}=A.ThemeConstants,Ore={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-bar",moduleFactory:e=>new dv(e),defaultAxes:[{type:gz.ANGLE_NUMBER},{type:gz.RADIUS_CATEGORY}],themeTemplate:Ere,stackable:!0,groupable:!0},Pre={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,options:wre,create:e=>new dv(e)},{Property:fz}=A,nk=class extends Jt{};y([fz],nk.prototype,"columnWidthRatio",2),y([fz],nk.prototype,"maxColumnWidthRatio",2);var{ChartAxisDirection:Rre,PolarAxis:Bre,RadialColumnShape:Fre,getRadialColumnWidth:zre}=A,uv=class extends VF{constructor(e){super(e,{animationResetFns:{item:Ioe}}),this.properties=new nk}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new Fre}getColumnTransitionFunctions(){const e=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return Aoe(e)}isRadiusAxisCircle(){const e=this.axes[Rre.Radius];return e instanceof Bre?e.shape==="circle":!1}updateItemPath(e,t,i){e.isBeveled=this.isRadiusAxisCircle(),e.isRadiusAxisReversed=this.isRadiusAxisReversed(),i&&(e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius,e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.columnWidth=t.columnWidth,e.axisInnerRadius=t.axisInnerRadius,e.axisOuterRadius=t.axisOuterRadius)}getColumnWidth(e,t){const{columnWidthRatio:i=.5,maxColumnWidthRatio:s=.5}=this.properties;return zre(e,t,this.radius,i,s)}hasItemStylers(){return this.properties.itemStyler!=null}};uv.className="RadialColumnSeries",uv.type="radial-column";var{commonSeriesOptionsDefs:_re,radialColumnSeriesThemeableOptionsDef:Gre}=A,Vre={..._re,...Gre,type:Y(Le("radial-column")),angleKey:Y(E),radiusKey:Y(E),angleName:E,radiusName:E,grouped:z,stacked:z,stackGroup:E,normalizedTo:K},{ThemeConstants:{POLAR_AXIS_TYPE:yz,POLAR_AXIS_SHAPE:mz}}=A,jre={series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:A.FILL_GRADIENT_RADIAL_SERIES_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...A.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:A.multiSeriesHighlightStyle()},axes:{[yz.ANGLE_CATEGORY]:{shape:{$findFirstSiblingNotOperation:mz.CIRCLE},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[yz.RADIUS_NUMBER]:{shape:{$findFirstSiblingNotOperation:mz.CIRCLE},innerRadiusRatio:.5}}},{POLAR_AXIS_TYPE:xz}=A.ThemeConstants,Hre={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-column",moduleFactory:e=>new uv(e),defaultAxes:[{type:xz.ANGLE_CATEGORY},{type:xz.RADIUS_NUMBER}],themeTemplate:jre,stackable:!0,groupable:!0},Wre={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,options:Vre,create:e=>new uv(e)},{SvgPath:$re,Rotatable:Ure,Translatable:Yre,Scalable:Kre}=A,ok=class extends Ure(Kre(Yre($re))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};ok.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:gf,makeSeriesTooltip:Zre,SeriesProperties:Xre,PropertiesArray:ak,AxisLabel:qre,Property:ge,Label:Qre}=A,bz=class extends Qre{};y([ge],bz.prototype,"spacing",2);var Ds=class extends gf{constructor(){super(...arguments),this.label=new bz}};y([ge],Ds.prototype,"text",2),y([ge],Ds.prototype,"value",2),y([ge],Ds.prototype,"shape",2),y([ge],Ds.prototype,"placement",2),y([ge],Ds.prototype,"spacing",2),y([ge],Ds.prototype,"size",2),y([ge],Ds.prototype,"rotation",2),y([ge],Ds.prototype,"fill",2),y([ge],Ds.prototype,"fillOpacity",2),y([ge],Ds.prototype,"stroke",2),y([ge],Ds.prototype,"strokeWidth",2),y([ge],Ds.prototype,"strokeOpacity",2),y([ge],Ds.prototype,"lineDash",2),y([ge],Ds.prototype,"lineDashOffset",2),y([ge],Ds.prototype,"label",2);var Qo=class extends gf{constructor(){super(...arguments),this.enabled=!0,this.fills=new ak(A.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};y([ge],Qo.prototype,"enabled",2),y([ge],Qo.prototype,"fills",2),y([ge],Qo.prototype,"fillMode",2),y([ge],Qo.prototype,"fill",2),y([ge],Qo.prototype,"fillOpacity",2),y([ge],Qo.prototype,"stroke",2),y([ge],Qo.prototype,"strokeWidth",2),y([ge],Qo.prototype,"strokeOpacity",2),y([ge],Qo.prototype,"lineDash",2),y([ge],Qo.prototype,"lineDashOffset",2);var ff=class extends gf{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};y([ge],ff.prototype,"values",2),y([ge],ff.prototype,"step",2),y([ge],ff.prototype,"minSpacing",2),y([ge],ff.prototype,"maxSpacing",2);var Jre=class extends qre{},Zs=class extends gf{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new ak(A.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 ff,this.label=new Jre}};y([ge],Zs.prototype,"min",2),y([ge],Zs.prototype,"max",2),y([ge],Zs.prototype,"fills",2),y([ge],Zs.prototype,"fillMode",2),y([ge],Zs.prototype,"fill",2),y([ge],Zs.prototype,"fillOpacity",2),y([ge],Zs.prototype,"stroke",2),y([ge],Zs.prototype,"strokeWidth",2),y([ge],Zs.prototype,"strokeOpacity",2),y([ge],Zs.prototype,"lineDash",2),y([ge],Zs.prototype,"lineDashOffset",2),y([ge],Zs.prototype,"defaultFill",2),y([ge],Zs.prototype,"interval",2),y([ge],Zs.prototype,"label",2);var Jo=class extends gf{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}};y([ge],Jo.prototype,"enabled",2),y([ge],Jo.prototype,"radiusRatio",2),y([ge],Jo.prototype,"spacing",2),y([ge],Jo.prototype,"fill",2),y([ge],Jo.prototype,"fillOpacity",2),y([ge],Jo.prototype,"stroke",2),y([ge],Jo.prototype,"strokeWidth",2),y([ge],Jo.prototype,"strokeOpacity",2),y([ge],Jo.prototype,"lineDash",2),y([ge],Jo.prototype,"lineDashOffset",2);var vz=class extends _a{};y([ge],vz.prototype,"text",2);var Sz=class extends Zg{};y([ge],Sz.prototype,"text",2);var Di=class extends Xre{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new lf,this.defaultColorRange=[],this.targets=new ak(Ds),this.defaultTarget=new Ds,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new Zs,this.bar=new Qo,this.needle=new Jo,this.label=new vz,this.secondaryLabel=new Sz,this.tooltip=Zre()}};y([ge],Di.prototype,"value",2),y([ge],Di.prototype,"startAngle",2),y([ge],Di.prototype,"endAngle",2),y([ge],Di.prototype,"segmentation",2),y([ge],Di.prototype,"defaultColorRange",2),y([ge],Di.prototype,"targets",2),y([ge],Di.prototype,"defaultTarget",2),y([ge],Di.prototype,"outerRadiusRatio",2),y([ge],Di.prototype,"innerRadiusRatio",2),y([ge],Di.prototype,"outerRadius",2),y([ge],Di.prototype,"innerRadius",2),y([ge],Di.prototype,"cornerRadius",2),y([ge],Di.prototype,"cornerMode",2),y([ge],Di.prototype,"spacing",2),y([ge],Di.prototype,"scale",2),y([ge],Di.prototype,"bar",2),y([ge],Di.prototype,"needle",2),y([ge],Di.prototype,"label",2),y([ge],Di.prototype,"secondaryLabel",2),y([ge],Di.prototype,"tooltip",2);var{SectorBox:rk}=A;function ele(e){const{startAngle:t,endAngle:i,clipStartAngle:s,clipEndAngle:n,innerRadius:o,outerRadius:a}=e;if(!(s==null||n==null))return new rk(Math.max(s,t),Math.min(n,i),o,a)}function Mz(e,t,i){return Math.max(e,i.startAngle)<=Math.min(t,i.endAngle)}function lk(e){return e.clipStartAngle!=null&&e.clipEndAngle!=null}function ck(e,t){const{clipStartAngle:i,clipEndAngle:s,innerRadius:n,outerRadius:o}=e;return new rk(i,t?i:s,n,o)}function Dz(e,t){const i=e?"initial":"update";return{node:{fromFn(o,a){const r=o.previousDatum;let{startAngle:l,endAngle:c}=r??a;const h=r!=null&&lk(r)?ck(r,e):void 0,d=lk(a)?ck(a,e):void 0;let u;return h!=null&&d!=null?u=h:h==null&&d!=null?(u=d,l=a.startAngle,c=a.endAngle):h!=null&&d==null?(u=void 0,l=a.startAngle,c=a.endAngle):e&&(c=l),{startAngle:l,endAngle:c,clipSector:u,phase:i}},toFn(o,a){const{startAngle:r,endAngle:l}=a;let c;return lk(a)&&(c=ck(a,!1)),{startAngle:r,endAngle:l,clipSector:c}},applyFn(o,a){const{startAngle:r,endAngle:l}=a;let{clipSector:c}=a;c!=null&&(c=new rk(Math.max(r,c.startAngle),Math.min(l,c.endAngle),c.innerRadius,c.outerRadius));const h=c==null||Mz(r,l,c);o.startAngle=r,o.endAngle=l,o.clipSector=c,o.visible=h}},needle:{fromFn(o){let{angle:a}=o.previousDatum??o.datum;return e&&(a=t),{rotation:a,phase:i}},toFn(o,a){const{angle:r}=a;return{rotation:r}}}}}function hk(e,t){const{startAngle:i,endAngle:s}=t,n=ele(t),o=n==null||Mz(i,s,n);return{startAngle:i,endAngle:s,clipSector:n,visible:o}}function Az(e,t){const{angle:i}=t;return{rotation:i}}var tle={top:0,middle:.5,bottom:1};function ile(e,t,i,s,n,o){const{padding:a,textAlign:r,verticalAlign:l}=s;let c,h;if(i.each((D,C)=>{C.label==="primary"?c=C:C.label==="secondary"&&(h=C)}),c==null)return;const d=rf(e.id,t,c,o?.label);if(d==null)return;const u=h!=null?rf(e.id,t,h,o?.secondaryLabel):void 0,p={padding:a},g=r==="center"?2:1,f=l==="middle"?2:1,x=D=>({width:Math.sqrt(Math.max(n**2-(D/f)**2,0))*g,height:Math.min(D,f*n),meta:null});let m,b,v;if(h!=null&&u!=null){const D=HP(d,c,u,h,p,x);m=D?.label,b=D?.secondaryLabel,v=D?.height??0}else{const D=Yg(d,c,p,x);m=D?.[0],b=void 0,v=D?.[0].height??0}const S=v*tle[l];i.each((D,C)=>{let T;if(C.label==="primary"?T=m:C.label==="secondary"&&(T=b),T==null){D.visible=!1;return}D.visible=!0,D.text=T.text,D.fontSize=T.fontSize,D.lineHeight=T.lineHeight,D.textAlign=r,D.textBaseline="middle";const k=C.label==="primary"?T.height/2:v-T.height/2;D.y=C.centerY+k-S,D.x=C.centerX})}var{fromToMotion:yf,resetMotion:Iz,CachedTextMeasurerPool:sle,SeriesNodePickMode:kz,StateMachine:nle,createDatumId:dk,normalizeAngle360:Cz,normalizeAngle360Inclusive:uk,isBetweenAngles:pv,sectorBox:ole,toDegrees:ale,toRadians:gv,BBox:rle,Group:Xl,PointerEvents:fv,Selection:ql,Sector:lle,SectorBox:cle,Text:Tz,Marker:hle,getColorStops:dle,tickFormat:ule,applyShapeStyle:ple,mergeDefaults:gle}=A,fle={inside:90,middle:0,outside:-90},yle=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],mle=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],yv=class extends A.Series{constructor(e){super({moduleCtx:e,pickModes:[kz.EXACT_SHAPE_MATCH,kz.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new Di,this.scale=new nE,this.scaleGroup=this.contentGroup.appendChild(new Xl({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Xl({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new Xl({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Xl({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Xl({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Xl({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Xl({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Xl({name:"tickGroup"})),this.scaleSelection=ql.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=ql.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=ql.select(this.itemNeedleGroup,ok),this.targetSelection=ql.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=ql.select(this.itemTargetLabelGroup,Tz),this.labelSelection=ql.select(this.itemLabelGroup,Tz),this.highlightTargetSelection=ql.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=ql.select(this.tickGroup,A.TransformableText),this.datumUnion=new QB,this.animationState=new nle("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=fv.None,this.tickGroup.pointerEvents=fv.None,this.itemNeedleGroup.pointerEvents=fv.None,this.itemLabelGroup.pointerEvents=fv.None}get hasData(){return this.properties.value!=null}nodeFactory(){return new lle}markerFactory(){const e=new hle;return e.size=1,e}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){const{min:t,max:i}=this.properties.scale;return eF(e,{min:t,max:i})}layoutScale(){const{scale:e,properties:t}=this,{seriesRectWidth:i,seriesRectHeight:s}=this.nodeDataDependencies,{scale:n,outerRadius:o}=this.properties,{min:a,max:r,label:l,interval:c}=n,h=gv(t.startAngle-90),d=gv(t.endAngle-90),p=uk(d-h)>Math.PI,g=p||pv(1.5*Math.PI,h,d),f=p||pv(0*Math.PI,h,d),x=p||pv(.5*Math.PI,h,d),m=p||pv(1*Math.PI,h,d);let b;m&&!f?b="right":!m&&f?b="left":b="center";let v;g&&!x?v="bottom":!g&&x?v="top":v="middle";const S=ole({startAngle:h,endAngle:d,innerRadius:0,outerRadius:.5}),D=-(S.x+S.width/2)*2,C=-(S.y+S.height/2)*2,T=Math.min(i/S.width,s/S.height);e.domain=[a,r],e.range=[h,d],e.arcLength=T/2;const{maxSpacing:k,minSpacing:L}=c,{arcLength:N}=e,w=k?Math.floor(N/k):1,O=L?Math.floor(N/L):1/0,R=Math.floor(4/Math.PI*Math.abs(e.range[0]-e.range[1])),B=Math.max(w,Math.min(O,R)),P=c.values??e.ticks({nice:!1,interval:c.step,minTickCount:w,maxTickCount:O,tickCount:B})?.ticks??[],_=ule(P,typeof l.format=="string"?l.format:void 0),F=sle.getMeasurer({font:l}),W=P.map((Z,q)=>{let Q;if(l.formatter&&(Q=nf(this.ctx,l.formatter,{value:Z,index:q,domain:e.domain,boundSeries:void 0})),Q??(Q=_?.(Z)),Q==null)return;const{width:ie,height:ne}=F.measureText(Q);return{index:q,value:Z,text:Q,width:ie,height:ne}}).filter(Z=>Z!=null),H=W.reduce((Z,q)=>Math.max(Z,q.width),0),j=W.reduce((Z,q)=>Math.max(Z,q.height),0),V=l.enabled?Math.max(H,j)+l.spacing:0,$=Math.max(.5*T-V,0),U=o??$;return this.centerX=i/2+D*U,this.centerY=s/2+C*U,this.radius=U,this.textAlign=b,this.verticalAlign=v,W}createConicGradient(e,t){const{scale:i}=this,{domain:s,range:n}=i,[o,a]=n,{defaultColorRange:r}=this.properties,l=Cz((o+a)/2+Math.PI),c=uk(a-o);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:dle(e,r,s,t).map(({color:d,stop:u})=>(u=Math.min(Math.max(u,0),1),u=(o+c*u-l)/(2*Math.PI),u=(u%1+1)%1,{stop:u,color:d})),rotation:ale(l)+90}}getShapeFillBBox(){const{centerX:e,centerY:t,radius:i}=this;return new rle(e-i,t-i,2*i,2*i)}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map(i=>{const{text:s=t.text,value:n=t.value??0,shape:o=t.shape??"triangle",rotation:a=t.rotation??0,strokeWidth:r=t.strokeWidth??0,placement:l=t.placement??"middle",spacing:c=t.spacing??0,size:h=t.size??0,fill:d=t.fill??"black",fillOpacity:u=t.fillOpacity??1,stroke:p=t.stroke??"black",strokeOpacity:g=t.strokeOpacity??1,lineDash:f=t.lineDash??[0],lineDashOffset:x=t.lineDashOffset??0}=i,{enabled:m=t.label.enabled,color:b=t.label.color??"black",fontStyle:v=t.label.fontStyle??"normal",fontWeight:S=t.label.fontWeight??"normal",fontSize:D=t.label.fontSize,fontFamily:C=t.label.fontFamily,spacing:T=t.label.spacing??0}=i.label;return{text:s,value:n,shape:o,placement:l,spacing:c,size:h,rotation:a,fill:d,fillOpacity:u,stroke:p,strokeWidth:r,strokeOpacity:g,lineDash:f,lineDashOffset:x,label:{enabled:m,color:b,fontStyle:v,fontWeight:S,fontSize:D,fontFamily:C,spacing:T}}})}getTargetRadius(e){const{radius:t,properties:i}=this,{innerRadiusRatio:s,outerRadiusRatio:n}=i,{placement:o,spacing:a,size:r}=e,l=t*n,c=t*s;switch(o){case"inside":return Math.max(c-a-r/2,0);case"outside":return l+a+r/2;default:return(c+l)/2}}getTargetLabel(e){const{scale:t}=this,{value:i,size:s,placement:n,label:o}=e,{spacing:a,color:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d}=o,u=void 0,p=t.convert(i),g=Cz(p)/(Math.PI/2)|0,f=s/2+a;let x,m,b,v;switch(n){case"outside":({textAlign:x,textBaseline:m}=yle[g]),b=f*Math.cos(p),v=f*Math.sin(p);break;case"inside":({textAlign:x,textBaseline:m}=mle[g]),b=-f*Math.cos(p),v=-f*Math.sin(p);break;default:x="center",m="bottom",b=0,v=-f;break}return{offsetX:b,offsetY:v,fill:r,textAlign:x,textBaseline:m,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,lineHeight:u}}createNodeData(){const e=this.layoutScale(),{id:t,scale:i,properties:s,radius:n,centerX:o,centerY:a}=this,{value:r,innerRadiusRatio:l,outerRadiusRatio:c,segmentation:h,cornerRadius:d,cornerMode:u,needle:p,bar:g,scale:f,label:x,secondaryLabel:m}=s,{outerRadius:b=n*c,innerRadius:v=n*l}=s,S=this.getTargets(),D=[],C=[],T=[],k=[],L=[],N=u==="item",w=i.convert(i.domain[0]),O=i.convert(r),R=Math.ceil(uk(O-w)*n);let B=h.enabled?h.interval.getSegments(i,R):void 0;const P=g.enabled?g.fill??this.createConicGradient(g.fills,g.fillMode):"rgba(0,0,0,0)",_=f.fill??(g.enabled&&f.fills.length===0?f.defaultFill:void 0)??this.createConicGradient(f.fills,f.fillMode);if(B==null&&N){const F=Math.min(...i.domain),W=Math.max(...i.domain),H={value:r,segmentStart:F,segmentEnd:W},V=Math.min(d,(b-v)/2)/((v+b)/2);D.push({series:this,itemId:"value",datum:H,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:b,innerRadius:v,startAngle:w-V,endAngle:O+V,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,fill:P}),L.push({series:this,itemId:"scale",datum:H,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:b,innerRadius:v,startAngle:i.range[0]-V,endAngle:i.range[1]+V,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,fill:_})}else{B??(B=i.domain);for(let F=0;F<B.length-1;F++){const W=B[F],H=B[F+1],j={value:r,segmentStart:W,segmentEnd:H},V=F===0,$=F===B.length-2,U=i.convert(W),Z=i.convert(H);D.push({series:this,itemId:`value-${F}`,datum:j,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:b,innerRadius:v,startAngle:U,endAngle:Z,clipStartAngle:w,clipEndAngle:O,startCornerRadius:N||V?d:0,endCornerRadius:N||$?d:0,fill:P}),L.push({series:this,itemId:`scale-${F}`,datum:j,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:b,innerRadius:v,startAngle:U,endAngle:Z,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:N||V?d:0,endCornerRadius:N||$?d:0,fill:_})}}if(!p.enabled&&x.enabled){const{text:F,color:W,fontSize:H,minimumFontSize:j,fontStyle:V,fontWeight:$,fontFamily:U,lineHeight:Z,formatter:q=Q=>this.formatLabel(Q.value)}=x;k.push({label:"primary",centerX:o,centerY:a,text:F,value:r,fill:W,fontSize:H,minimumFontSize:j,fontStyle:V,fontWeight:$,fontFamily:U,lineHeight:Z,formatter:q})}if(!p.enabled&&m.enabled){const{text:F,color:W,fontSize:H,minimumFontSize:j,fontStyle:V,fontWeight:$,fontFamily:U,lineHeight:Z,formatter:q}=m;k.push({label:"secondary",centerX:o,centerY:a,text:F,value:r,fill:W,fontSize:H,minimumFontSize:j,fontStyle:V,fontWeight:$,fontFamily:U,lineHeight:Z,formatter:q})}if(p.enabled){let F=p.radiusRatio!=null?n*p.radiusRatio:v;F=Math.max(F-p.spacing,0);const W=i.convert(r);T.push({centerX:o,centerY:a,radius:F,angle:W,series:this})}for(let F=0;F<S.length;F+=1){const W=S[F],{value:H,text:j,size:V,shape:$,fill:U,fillOpacity:Z,stroke:q,strokeWidth:Q,strokeOpacity:ie,lineDash:ne,lineDashOffset:oe}=W;if(H<Math.min(...i.domain)||H>Math.max(...i.domain))continue;const le=this.getTargetRadius(W),re=i.convert(H),ee=gv(W.rotation+fle[W.placement]);C.push({series:this,itemId:`target-${F}`,midPoint:{x:le*Math.cos(re)+o,y:le*Math.sin(re)+a},datum:{value:H},datumIndex:{type:1,index:F},type:1,value:H,text:j,centerX:o,centerY:a,shape:$,radius:le,angle:re,rotation:ee,size:V,fill:U,fillOpacity:Z,stroke:q,strokeOpacity:ie,strokeWidth:Q,lineDash:ne,lineDashOffset:oe,label:this.getTargetLabel(W)})}return{itemId:t,nodeData:D,needleData:T,targetData:C,labelData:k,scaleData:L,tickData:e}}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(e!=null&&e.series===this&&e.type===1)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,needleSelection:s,targetSelection:n,targetLabelSelection:o,scaleSelection:a,highlightTargetSelection:r,tickSelection:l}=this,c=this.checkResize(e);this.updateSelections(c),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const h=this.contextNodeData?.nodeData??[],d=this.contextNodeData?.labelData??[],u=this.contextNodeData?.needleData??[],p=this.contextNodeData?.targetData??[],g=this.contextNodeData?.scaleData??[],f=this.contextNodeData?.tickData??[],x=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:g,scaleSelection:a}),this.updateScaleNodes({scaleSelection:a}),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:o}),this.updateTargetLabelNodes({targetLabelSelection:o}),this.datumSelection=this.updateDatumSelection({nodeData:h,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:d,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:x!=null?[x]:[],targetSelection:r}),this.updateTargetNodes({targetSelection:r,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:f,tickSelection:l}),this.updateTickNodes({tickSelection:l}),c&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>dk(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i,properties:s}=this,{bar:n,segmentation:o}=s,a=o.spacing??0,{fillOpacity:r,stroke:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=n,u=n.strokeWidth,p=i.animationManager.isSkipped(),g=this.getShapeFillBBox();t.each((f,x)=>{const{centerX:m,centerY:b,innerRadius:v,outerRadius:S,startCornerRadius:D,endCornerRadius:C,fill:T}=x;f.centerX=m,f.centerY=b,f.innerRadius=v,f.outerRadius=S,f.pointerEvents=this.properties.bar.enabled?A.PointerEvents.All:A.PointerEvents.None,f.fill=T,f.fillBBox=g,f.fillOpacity=r,f.stroke=l,f.strokeOpacity=c,f.strokeWidth=u,f.lineDash=h,f.lineDashOffset=d,f.startOuterCornerRadius=D,f.startInnerCornerRadius=D,f.endOuterCornerRadius=C,f.endInnerCornerRadius=C,f.radialEdgeInset=(a+f.strokeWidth)/2,f.concentricEdgeInset=f.strokeWidth/2,(p||f.previousDatum==null)&&f.setProperties(hk(f,x))}),this.datumUnion.update(t,this.itemGroup,A.Sector,(f,x,m)=>{f.clipSector??(f.clipSector=new cle(NaN,NaN,NaN,NaN)),f.centerX=x.centerX,f.centerY=x.centerY,f.outerRadius=f.clipSector.outerRadius=x.outerRadius,f.innerRadius=f.clipSector.innerRadius=x.innerRadius,f.startAngle=f.clipSector.startAngle=x.startAngle,f.startInnerCornerRadius=x.startInnerCornerRadius,f.startOuterCornerRadius=x.startOuterCornerRadius,f.endAngle=m.endAngle,f.clipSector.endAngle=m.clipSector?.endAngle??m.endAngle,f.endInnerCornerRadius=m.endInnerCornerRadius,f.endOuterCornerRadius=m.endOuterCornerRadius,f.pointerEvents=A.PointerEvents.None})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>dk(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,{scale:i,segmentation:s}=this.properties,n=s.spacing??0,{fillOpacity:o,stroke:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=i,d=this.getShapeFillBBox();t.each((u,p)=>{const{centerX:g,centerY:f,innerRadius:x,outerRadius:m,startCornerRadius:b,endCornerRadius:v,fill:S}=p;u.centerX=g,u.centerY=f,u.innerRadius=x,u.outerRadius=m,u.fill=S,u.fillBBox=d,u.fillOpacity=o,u.stroke=a,u.strokeOpacity=r,u.strokeWidth=l,u.lineDash=c,u.lineDashOffset=h,u.startOuterCornerRadius=b,u.startInnerCornerRadius=b,u.endOuterCornerRadius=v,u.endInnerCornerRadius=v,u.radialEdgeInset=(n+u.strokeWidth)/2,u.concentricEdgeInset=u.strokeWidth/2,u.setProperties(hk(u,p))})}updateNeedleSelection(e){return e.needleSelection.update(e.needleData,void 0,()=>dk([]))}updateNeedleNodes(e){const{needleSelection:t}=e,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,strokeWidth:a,lineDash:r,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();t.each((h,d)=>{const{centerX:u,centerY:p,radius:g}=d,f=g*2;h.d=ok.defaultPathData,h.fill=i,h.fillOpacity=s,h.stroke=n,h.strokeOpacity=o,h.strokeWidth=a/f,h.lineDash=r.map(x=>x/f),h.lineDashOffset=l/f,h.translationX=u,h.translationY=p,h.scalingX=f,h.scalingY=f,c&&h.setProperties(Az(h,d))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetNodes(e){const{targetSelection:t,isHighlight:i}=e;t.each((s,n)=>{const{centerX:o,centerY:a,angle:r,radius:l,shape:c,size:h,rotation:d,fill:u,fillOpacity:p,stroke:g,strokeOpacity:f,strokeWidth:x,lineDash:m,lineDashOffset:b}=n,v=this.getHighlightStyle(i,n.datumIndex),S=gle(v,{fill:u,fillOpacity:p,stroke:g,strokeOpacity:f,strokeWidth:x,lineDash:m,lineDashOffset:b,opacity:1});ple(s,S),s.size=h,s.shape=c==="line"?tF:c,s.translationX=o+l*Math.cos(r),s.translationY=a+l*Math.sin(r),s.rotation=r+d})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((i,s)=>{const{centerX:n,centerY:o,radius:a,angle:r,text:l}=s,{offsetX:c,offsetY:h,fill:d,fontStyle:u,fontWeight:p,fontSize:g,fontFamily:f,textAlign:x,textBaseline:m}=s.label;if(l==null){i.visible=!1;return}i.visible=!0,i.x=n+a*Math.cos(r)+c,i.y=o+a*Math.sin(r)+h,i.text=l,i.fill=d,i.fontStyle=u,i.fontWeight=p,i.fontSize=g,i.fontFamily=f,i.textAlign=x,i.textBaseline=m})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,t=>t.label)}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((s,n)=>{s.fill=n.fill,s.fontStyle=n.fontStyle,s.fontWeight=n.fontWeight,s.fontFamily=n.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,t=>t.index)}updateTickNodes(e){const{scale:t,radius:i,centerX:s,centerY:n,properties:o}=this,{enabled:a,color:r,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,spacing:u}=o.scale.label,p=gv(o.scale.label.rotation??0);e.tickSelection.each((g,f)=>{if(!a){g.visible=!1;return}g.visible=!0,g.text=f.text,g.fill=r,g.fontFamily=l,g.fontSize=c,g.fontStyle=h,g.fontWeight=d,g.textAlign="center",g.textBaseline="middle";const x=t.convert(f.value),{width:m,height:b}=f,v=Math.abs(i*Math.cos(x)),S=Math.abs(i*Math.sin(x)),D=Math.min(Math.max(Math.abs(i/Math.tan(x)),v-m/2),v+m/2),C=Math.min(Math.max(Math.abs(i*Math.tan(x)),S-b/2),S+b/2),T=Math.hypot(D,C),k=s+(T+u)*Math.cos(x),L=n+(T+u)*Math.sin(x);g.x=k,g.y=L,g.rotationCenterX=k,g.rotationCenterY=L,g.rotation=p})}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(e.text==null)return!1;return!0}formatLabelText(e){const{labelSelection:t,radius:i,textAlign:s,verticalAlign:n}=this,{spacing:o,innerRadiusRatio:a}=this.properties;ile(this,this.ctx,t,{padding:o,textAlign:s,verticalAlign:n},i*a,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),Iz([this.datumSelection],hk),Iz([this.needleSelection],Az),this.formatLabelText()}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i,s,n,o;if(this.labelSelection.each((a,r)=>{a.opacity=1,r.label==="primary"?(i=a.previousDatum?.value??e.from??r.value,s=r.value):r.label==="secondary"&&(n=a.previousDatum?.value??e.from??r.value,o=r.value)}),!this.labelsHaveExplicitText())if(s==null||o==null)this.formatLabelText();else if(i===s&&n===o)this.formatLabelText({label:s,secondaryLabel:o});else{const a=`${this.id}_labels`;t.animate({id:a,groupId:"label",from:{label:i,secondaryLabel:n},to:{label:s,secondaryLabel:o},phase:e.phase??"update",onUpdate:r=>this.formatLabelText(r),onStop:()=>this.formatLabelText({label:s,secondaryLabel:o})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=Dz(!0,this.scale.range[0]);yf(this.id,"node",e,[this.datumSelection],t,(s,n)=>n.itemId),yf(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),yf(this.id,"label",e,[this.labelSelection],JB,(s,n)=>n.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=Dz(!1,this.scale.range[0]);yf(this.id,"node",e,[this.datumSelection],t,(s,n)=>n.itemId),yf(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}dataCount(){return NaN}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:s}=i;let n,o;if(e.type===0?(n=i.value,o=i.label.text):{value:n,text:o}=i.targets[e.index],n!=null)return this.formatTooltipWithContext(s,{data:[{label:o,fallbackLabel:"Value",value:this.formatLabel(n)}]},{seriesId:t,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(e){return iF(this,e)}pickFocus(e){return sF(this,e)}getCaptionText(){const{value:e}=this.properties,t=[];return t.push(this.formatLabel(e)),this.labelSelection.each((i,s)=>{const n=rf(this.id,this.ctx,s);n!=null&&t.push(n)}),t.join(". ")}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return!1}};yv.className="RadialGaugeSeries",yv.type="radial-gauge";var{FONT_SIZE_RATIO:xle}=A,ble={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"radial-gauge",moduleFactory:e=>new yv(e),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]},A.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",A.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:12}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:2},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"outside",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},needle:{enabled:!1,fill:{$ref:"foregroundColor"},spacing:10},label:{...A.LABEL_BOXING_DEFAULTS,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{...A.LABEL_BOXING_DEFAULTS,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:xle.LARGE},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}},tooltip:{range:{$path:["/tooltip/range",10]}}}}},vle={type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,options:A.radialGaugeSeriesOptionsDef,create:e=>new yv(e)};function Lz(e){e.nodes.sort((t,i)=>Math.round((t.datum.y-i.datum.y)*100)/100||-(t.datum.size-i.datum.size))}function Sle({nodes:e,size:t},{seriesRectHeight:i,nodeSpacing:s,sizeScale:n}){const o=i*t*n;let a=(i-(o+s*(e.length-1)))/2;e.forEach(({datum:r})=>{const l=i*r.size*n;r.y=a,r.height=l,a+=l+s})}function Mle(e,t){const{nodes:i}=e,{seriesRectHeight:s,nodeSpacing:n}=t;Lz(e);let o=0,a=0;for(const{datum:c}of i){const h=Math.max(a-c.y,0);c.y+=h,o+=h,a=c.y+c.height+n}if(a-n<s)return o>0;let l=s;for(let c=i.length-1;c>=0;c-=1){const{datum:h}=i[c],d=h.y+h.height,u=Math.min(l-d,0);h.y+=u,o+=u,l=h.y-n}return!0}function pk(e,t,i,s,n,o,a,r){const l=(i-e)/(s-t),c=(a-n)/(r-o),h=((o-t)*(l*c)+e*c-n*l)/(c-l);return e<i?h>e&&h<Math.min(i,a):h<e&&h>Math.max(i,a)}function wz(e,t){let i=!1;const s=e.nodes.filter(o=>t(o).length===1);let n=!0;for(let o=0;n&&o<s.length;o+=1){n=!1;for(let a=0;a<s.length-1;a+=1){const{datum:r}=s[a],l=t(s[a])[0].node.datum,{datum:c}=s[a+1],h=t(s[a+1])[0].node.datum;if(!(pk(r.x,r.y,l.x,l.y,c.x,c.y,h.x,h.y)||pk(r.x,r.y+r.height/2,l.x,l.y+l.height/2,c.x,c.y+c.height/2,h.x,h.y+h.height/2)||pk(r.x,r.y+r.height,l.x,l.y+l.height,c.x,c.y+c.height,h.x,h.y+h.height)))continue;const u=s[a];s[a]=s[a+1],s[a+1]=u;const p=r.y;r.y=c.y+c.height-r.height,c.y=p,i=!0,n=!0}}return i}function Dle(e){let t=!1;return Lz(e),t=wz(e,i=>i.linksBefore)||t,t=wz(e,i=>i.linksAfter)||t,t}function Ale(e){if(e.length===0)return;let t=0,i=0;for(const{node:{datum:s}}of e)t+=s.y*s.size,i+=s.size;return t/i}function Nz(e,t,i,s){return e.nodes.forEach(({datum:n,linksBefore:o,linksAfter:a})=>{const r=s===1?o:a,l=s===1?a:o,c=Ale(r);if(c!=null){const h=l.length!==0?i:1;n.y=n.y+(c-n.y)*h}}),Mle(e,t)}function Ez(e,t,i){let s=!1;for(const n of e)s=Nz(n,t,i,1)||s;return s}function Ile(e,t,i){let s=!1;for(let n=e.length-1;n>=0;n-=1)s=Nz(e[n],t,i,-1)||s;return s}function Oz(e){let t=!1;for(let i=e.length-1;i>=0;i-=1)t=Dle(e[i])||t;return t}function kle(e,t){e.forEach(s=>{Sle(s,t)});let i=!1;for(let s=0;s<6;s+=1){const n=Ez(e,t,1);i=Ile(e,t,.5);const o=Oz(e);if(!n&&!i&&!o)break}i&&(Ez(e,t,1),Oz(e))}var{BBox:Cle,Path:Tle,SceneChangeDetection:Cu,splitBezier2D:Lle}=A;function mv(e,t,i,s,n,o,a,r,l,c){let h,d;if(n!==i&&l!==a){const C=-(s-t)/(n-i),T=-(r-o)/(l-a);h=(a-i+C*t-T*o)/(C-T),d=C*(h-t)+i}else if(n===i&&l!==a)h=t,d=-(r-o)/(l-a)*(h-r)+l;else if(n!==i&&l===a)h=r,d=-(s-t)/(n-i)*(h-t)+i;else throw new Error("Offsetting flat bezier curve");const u=Math.hypot(i-d,t-h),p=(u+c)/u,g=Math.hypot(l-d,r-h),f=(g+c)/g,x=h+(s-h)*p,m=d+(n-d)*p,b=h+(o-h)*f,v=d+(a-d)*f,S=h+(r-h)*f,D=d+(l-d)*f;e.cubicCurveTo(x,m,b,v,S,D)}var wh=class extends Tle{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0}computeBBox(){const e=Math.min(this.x1,this.x2),t=Math.max(this.x1,this.x2)-e,i=Math.min(this.y1,this.y2),s=Math.max(this.y1,this.y2)-i+this.height;return new Cle(e,i,t,s)}updatePath(){const{path:e,inset:t}=this;e.clear();const i=this.x1+t,s=this.x2-t,n=this.y1+t,o=this.y2+t,a=this.height-2*t;if(a<0||i>s)return;const r=i,l=n+a/2,c=(i+s)/2,h=n+a/2,d=(i+s)/2,u=o+a/2,p=s,g=o+a/2;if(e.moveTo(r,l-a/2),Math.abs(this.y2-this.y1)<1||this.x2-this.x1<this.height*Math.SQRT2)e.cubicCurveTo(c,h-a/2,d,u-a/2,p,g-a/2),e.lineTo(p,g+a/2),e.cubicCurveTo(d,u+a/2,c,h+a/2,r,l+a/2);else{const[f,x]=Lle(r,l,c,h,d,u,p,g,.5),m=(o>n?1:-1)*a/2;mv(e,f[0].x,f[0].y,f[1].x,f[1].y,f[2].x,f[2].y,f[3].x,f[3].y,m),mv(e,x[0].x,x[0].y,x[1].x,x[1].y,x[2].x,x[2].y,x[3].x,x[3].y,-m),e.lineTo(p,g+a/2),mv(e,x[3].x,x[3].y,x[2].x,x[2].y,x[1].x,x[1].y,x[0].x,x[0].y,m),mv(e,f[3].x,f[3].y,f[2].x,f[2].y,f[1].x,f[1].y,f[0].x,f[0].y,-m)}e.closePath()}};y([Cu()],wh.prototype,"x1",2),y([Cu()],wh.prototype,"x2",2),y([Cu()],wh.prototype,"y1",2),y([Cu()],wh.prototype,"y2",2),y([Cu()],wh.prototype,"height",2),y([Cu()],wh.prototype,"inset",2);var{BaseProperties:Pz,FillGradientDefaults:wle,FillPatternDefaults:Nle,FillImageDefaults:Ele,makeSeriesTooltip:Ole,SeriesProperties:Ple,Property:Ve,Label:Rle}=A,Rz=class extends Rle{constructor(){super(...arguments),this.spacing=1}};y([Ve],Rz.prototype,"spacing",2);var _r=class extends Pz{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}};y([Ve],_r.prototype,"fill",2),y([Ve],_r.prototype,"fillOpacity",2),y([Ve],_r.prototype,"stroke",2),y([Ve],_r.prototype,"strokeOpacity",2),y([Ve],_r.prototype,"strokeWidth",2),y([Ve],_r.prototype,"lineDash",2),y([Ve],_r.prototype,"lineDashOffset",2),y([Ve],_r.prototype,"itemStyler",2);var Do=class extends Pz{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}};y([Ve],Do.prototype,"spacing",2),y([Ve],Do.prototype,"width",2),y([Ve],Do.prototype,"alignment",2),y([Ve],Do.prototype,"fill",2),y([Ve],Do.prototype,"fillOpacity",2),y([Ve],Do.prototype,"stroke",2),y([Ve],Do.prototype,"strokeOpacity",2),y([Ve],Do.prototype,"strokeWidth",2),y([Ve],Do.prototype,"lineDash",2),y([Ve],Do.prototype,"lineDashOffset",2),y([Ve],Do.prototype,"itemStyler",2);var Ai=class extends Ple{constructor(){super(),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 wle,this.fillPatternDefaults=new Nle,this.fillImageDefaults=new Ele,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new Rz,this.link=new _r,this.node=new Do,this.tooltip=Ole(),this.highlightStyle.deprecated=!1}getStyle(e,t,i,s){const{fillOpacity:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l,fill:c=t[s%t.length],stroke:h=i[s%t.length]}=e?this.link:this.node;return{fill:c,fillOpacity:n,stroke:h,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}}};y([Ve],Ai.prototype,"nodes",2),y([Ve],Ai.prototype,"fromKey",2),y([Ve],Ai.prototype,"toKey",2),y([Ve],Ai.prototype,"idKey",2),y([Ve],Ai.prototype,"idName",2),y([Ve],Ai.prototype,"labelKey",2),y([Ve],Ai.prototype,"labelName",2),y([Ve],Ai.prototype,"sizeKey",2),y([Ve],Ai.prototype,"sizeName",2),y([Ve],Ai.prototype,"fillGradientDefaults",2),y([Ve],Ai.prototype,"fillPatternDefaults",2),y([Ve],Ai.prototype,"fillImageDefaults",2),y([Ve],Ai.prototype,"defaultColorRange",2),y([Ve],Ai.prototype,"defaultPatternFills",2),y([Ve],Ai.prototype,"fills",2),y([Ve],Ai.prototype,"strokes",2),y([Ve],Ai.prototype,"label",2),y([Ve],Ai.prototype,"link",2),y([Ve],Ai.prototype,"node",2),y([Ve],Ai.prototype,"tooltip",2);var{Transformable:Ble,applyShapeStyle:Bz,SeriesNodePickMode:Fz,CachedTextMeasurerPool:Fle,TextWrapper:zz,TextUtils:_z,createDatumId:xv,getShapeStyle:Gz,getLabelStyles:zle,Rect:Vz,BBox:jz,mergeDefaults:bv}=A,vv=class extends kB{constructor(e){super({moduleCtx:e,pickModes:[Fz.NEAREST_NODE,Fz.EXACT_SHAPE_MATCH]}),this.properties=new Ai}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new wh}nodeFactory(){return new Vz}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:n,sizeKey:o,labelKey:a,label:{spacing:r},node:{spacing:l,width:c,alignment:h}}=this.properties,{nodeGraph:d,links:u,maxPathLength:p}=this.getNodeGraph(k=>({...k,x:NaN,y:NaN,width:c,height:NaN}),k=>({...k,x1:NaN,x2:NaN,y1:NaN,y2:NaN,height:NaN}),{includeCircularReferences:!1}),g=d,f=this.isLabelEnabled()?(t-c)*(1-p/(p+1)):0,x=(t-c-2*f)/(p-1),m=[];for(let k=0;k<p;k+=1){const L=f+k*x;m.push({index:k,size:0,nodes:[],x:L})}g.forEach(k=>{const{datum:L,linksBefore:N,linksAfter:w,maxPathLengthBefore:O,maxPathLengthAfter:R}=k,B=Math.max(N.reduce((W,{link:H})=>W+H.size,0),w.reduce((W,{link:H})=>W+H.size,0));if(N.length===0&&w.length===0||B===0){k.columnIndex=-1;return}let P;switch(h){case"left":P=m[O];break;case"right":P=m[p-1-R];break;case"center":{if(N.length!==0)P=m[O];else if(w.length!==0){const W=w.reduce((H,j)=>Math.min(H,j.node.maxPathLengthBefore),p)-1;P=m[W]}else P=m[0];break}case"justify":{P=w.length===0?m[p-1]:m[O];break}}L.x=P.x,L.size=B;const{label:_}=this.properties,F=_.enabled?this.getLabelText(L.label,L.datum,a,"label",[],this.properties.label,{datum:L.datum,value:L.label,fromKey:s,toKey:n,sizeKey:o,size:B}):void 0;L.label=F,P.nodes.push(k),P.size+=B,k.columnIndex=P.index}),g.forEach(k=>{let L=1/0,N=0;k.linksAfter.forEach(w=>{const O=w.node,{columnIndex:R}=O;R<L?(L=R,N=O.datum.size):R===L&&(N=Math.max(N,O.datum.size))}),k.closestColumnIndex=L,k.maxSizeOfClosestNodesAfter=N});const b=m.reduce((k,{size:L,nodes:N})=>{const w=(1-(N.length-1)*(l/i))/L;return Math.min(k,w)},1/0);for(let k=m.length-1;k>=0;k-=1)m[k].nodes.sort((N,w)=>N.closestColumnIndex-w.closestColumnIndex||N.maxSizeOfClosestNodesAfter-w.maxSizeOfClosestNodesAfter||N.datum.size-w.datum.size);kle(m,{seriesRectHeight:i,nodeSpacing:l,sizeScale:b});let v=!1;if(g.forEach(({datum:k,linksBefore:L,linksAfter:N})=>{v||(v=k.height<0);const w=k.y+k.height,O=P=>P.sort((_,F)=>{const W=_.node.datum,H=F.node.datum,j=W.y+W.height,V=H.y+H.height,$=Math.atan2(W.y-k.y,Math.abs(W.x-k.x))-Math.atan2(H.y-k.y,Math.abs(H.x-k.x)),U=Math.atan2(j-w,Math.abs(W.x-k.x))-Math.atan2(V-w,Math.abs(H.x-k.x));return $+U});let R=k.y;O(L).forEach(({link:P})=>{P.y2=R,R+=P.size*i*b});let B=k.y;O(N).forEach(({link:P})=>{P.y1=B,B+=P.size*i*b})}),v){X.warnOnce("There was insufficient space to display the Sankey Series. Reduce the node spacing, or provide a larger container.");return}const S=[],D=[],{fontSize:C}=this.properties.label,T=Fle.getMeasurer({font:this.properties.label});return m.forEach((k,L)=>{const N=L===0,w=L===m.length-1;let O=-1/0;k.nodes.sort((R,B)=>R.datum.y-B.datum.y),k.nodes.forEach(({datum:R})=>{if(R.midPoint={x:R.x+R.width/2,y:R.y+R.height/2},S.push(R),R.label==null)return;const B=N?R.x-r:R.x+R.width+r,P=R.y+R.height/2;let _;if(!N&&!w){const j=P-_z.getLineHeight(C),V=P+_z.getLineHeight(C);let $=t;g.forEach(({datum:Z})=>{Z.x>R.x&&Math.max(Z.y,j)<=Math.min(Z.y+Z.height,V)&&($=Math.min($,Z.x-r))});const U=$-R.x-2*r;_=zz.wrapText(R.label,{maxWidth:U,maxHeight:R.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(_==null||_===""){const j=N||w?r:r*2;_=zz.wrapText(R.label,{maxWidth:x-j,maxHeight:R.height,font:this.properties.label,textWrap:"never"})}if(_==="")return;const{height:F}=T.measureText(_),W=P-F/2,H=P+F/2;W>=O&&(D.push({x:B,y:P,leading:N,text:_,size:R.size}),O=H)})}),u.forEach(k=>{const{fromNode:L,toNode:N,size:w}=k;k.height=i*w*b,k.x1=L.x+c,k.x2=N.x,k.midPoint={x:(k.x1+k.x2)/2,y:(k.y1+k.y2)/2+k.height/2},S.push(k)}),{itemId:e,nodeData:S,labelData:D}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){e.labelSelection.each((t,i)=>{const{x:s,y:n,leading:o,text:a}=i,l=zle(this,void 0,i,this.properties.label),{color:c,fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p}=l;t.visible=!0,t.x=s,t.y=n,t.text=a,t.fill=c,t.fontStyle=h,t.fontWeight=d,t.fontSize=u,t.fontFamily=p,t.textAlign=o?"right":"left",t.textBaseline="middle",t.setBoxing(l)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>xv([t.type,t.id]))}getNodeStyle({datumIndex:e,datum:t,size:i=0,label:s},n,o){const{id:a,properties:r}=this,{fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:d,fillGradientDefaults:u,fillPatternDefaults:p,fillImageDefaults:g}=r,{itemStyler:f}=r.node,x=h[n%h.length].map(C=>({color:C})),m=d[n%d.length],b=this.getHighlightStyle(o,e),v=bv(b,r.getStyle(!1,l,c,n)),S=r.node.fill!=null;let D=Gz(v,S?u:{...u.toJson(),colorStops:x},S?p:{...p.toJson(),fill:m,stroke:m},g);if(f!=null&&e!=null){const C=this.cachedDatumCallback(xv(e.index,"node",o?"highlight":"node"),()=>{const T=this.ctx.highlightManager?.getActiveHighlight(),k=this.getHighlightStateString(T,o,e);return this.callWithContext(f,{seriesId:a,datum:t,highlighted:o,highlightState:k,...D,size:i,label:s})});C&&(D=bv(C,D,{...u.toJson(),colorStops:x},{...p.toJson(),fill:m,stroke:m},g))}return D.opacity=1,D}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((n,o)=>{const{datumIndex:a}=o,r=this.getNodeStyle(o,a.index,i);n.x=o.x,n.y=o.y,n.width=Math.max(o.width,0),n.height=Math.max(o.height,0),Bz(n,r,s)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=new jz(0,0,e,t);return{series:i,axis:i}}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>xv([t.type,t.index,t.fromNode.id,t.toNode.id]))}getLinkStyle({datumIndex:e,datum:t},i,s){const{id:n,properties:o}=this,{fills:a,strokes:r,defaultColorRange:l,defaultPatternFills:c,fillGradientDefaults:h,fillPatternDefaults:d,fillImageDefaults:u}=o,{itemStyler:p}=o.link,g=l[i%l.length].map(S=>({color:S})),f=c[i%c.length],x=this.getHighlightStyle(s,e),m=bv(x,o.getStyle(!0,a,r,i)),b=o.link.fill!=null;let v=Gz(m,b?h:{...h.toJson(),colorStops:g},b?d:{...d.toJson(),fill:f,stroke:f},u);if(p!=null&&e!=null){const S=this.cachedDatumCallback(xv(e.index,"link",s?"highlight":"node"),()=>{const D=this.ctx.highlightManager?.getActiveHighlight(),C=this.getHighlightStateString(D,s,e);return this.callWithContext(p,{seriesId:n,datum:t,highlighted:s,highlightState:C,...v})});S&&(v=bv(S,v,{...h.toJson(),colorStops:g},{...d.toJson(),fill:f,stroke:f},u))}return v.opacity=1,v}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((n,o)=>{const a=o.fromNode.datumIndex.index,r=this.getLinkStyle(o,a,i);n.x1=o.x1,n.y1=o.y1,n.x2=o.x2,n.y2=o.y2,n.height=o.height,Bz(n,r,s),n.inset=n.strokeWidth/2})}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:n,ctx:{formatManager:o}}=this,{fromKey:a,toKey:r,sizeKey:l,sizeName:c,tooltip:h}=n,d=this.contextNodeData?.nodeData.find(b=>b.datumIndex.type===e.type&&b.datumIndex.index===e.index);if(d==null)return;const u=d.type===0?d.fromNode.index:d.index,p=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,g=e.type===0?i?.dataSources.get(this.id)?.[e.index]:s?.dataSources.get(this.id)?.[e.index],f=d.size;let x;if(d.type===0){const b=d.fromNode.datumIndex;x=this.getLinkStyle({datumIndex:e,datum:g},b.index,!1)}else x=this.getNodeStyle({datumIndex:e,datum:g},e.index,!1);const m=[];if(l!=null){const b=o.format(this.callWithContext.bind(this),{type:"number",value:f,datum:g,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0});m.push({label:c,fallbackLabel:l,value:b??String(f)})}return this.formatTooltipWithContext(h,{title:p,symbol:this.legendItemSymbol(d.type,u,x),data:m},{seriesId:t,datum:g,title:p,fromKey:a,toKey:r,sizeKey:l,sizeName:c,size:f,...x})}computeFocusBounds(e){if(e instanceof Vz){const{x:t,y:i,width:s,height:n}=e,o=new jz(t,i,s,n);return Ble.toCanvas(this.contentGroup,o)}return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null}};vv.className="SankeySeries",vv.type="sankey";var{commonSeriesOptionsDefs:_le,sankeySeriesThemeableOptionsDef:Gle}=A,Tu={...Gle,..._le,type:Y(Le("sankey")),fromKey:Y(E),toKey:Y(E),sizeKey:E,sizeName:E};Tu.fillGradientDefaults=me(Rf),Tu.fillPatternDefaults=me(Bf),Tu.fillImageDefaults=me(Ff),Tu.defaultColorRange=me(Ae(Ae(ae))),Tu.defaultPatternFills=me(Ae(ae));var Vle={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],solo:!0,identifier:"sankey",moduleFactory:e=>new vv(e),themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:A.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,defaultColorRange:{$palette:"gradients"},defaultPatternFills:A.SAFE_FILLS_OPERATION,highlightStyle:{series:{dimOpacity:.2}},highlight:{...A.singleSeriesHighlightStyle()},label:{...A.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:20,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]}}},legend:{enabled:!1,toggleSeries:!1}}},jle={type:"series",name:"sankey",chartType:"standalone",enterprise:!0,options:Tu,create:e=>new vv(e)},{HierarchySeriesProperties:Hle,HighlightStyle:Wle,makeSeriesTooltip:$le,Property:Ii}=A,Ql=class extends Wle{constructor(){super(!1),this.label=new _a,this.secondaryLabel=new _a}};y([Ii],Ql.prototype,"fill",2),y([Ii],Ql.prototype,"fillOpacity",2),y([Ii],Ql.prototype,"stroke",2),y([Ii],Ql.prototype,"strokeWidth",2),y([Ii],Ql.prototype,"strokeOpacity",2),y([Ii],Ql.prototype,"label",2),y([Ii],Ql.prototype,"secondaryLabel",2);var Xs=class extends Hle{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlightStyle=new Ql,this.label=new _a,this.secondaryLabel=new Zg,this.tooltip=$le()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:n,strokeOpacity:o}=this;return{fill:t[e%t.length],fillOpacity:s,stroke:i[e%i.length],strokeWidth:n,strokeOpacity:o,opacity:1}}};y([Ii],Xs.prototype,"sizeName",2),y([Ii],Xs.prototype,"labelKey",2),y([Ii],Xs.prototype,"secondaryLabelKey",2),y([Ii],Xs.prototype,"fillOpacity",2),y([Ii],Xs.prototype,"strokeWidth",2),y([Ii],Xs.prototype,"strokeOpacity",2),y([Ii],Xs.prototype,"cornerRadius",2),y([Ii],Xs.prototype,"sectorSpacing",2),y([Ii],Xs.prototype,"padding",2),y([Ii],Xs.prototype,"itemStyler",2),y([Ii],Xs.prototype,"highlightStyle",2),y([Ii],Xs.prototype,"label",2),y([Ii],Xs.prototype,"secondaryLabel",2),y([Ii],Xs.prototype,"tooltip",2);var{fromToMotion:Ule,normalizeAngle360:Yle,createDatumId:Kle,PointerEvents:Zle,Sector:Hz,Group:Sv,ScalableGroup:Xle,Selection:gk,TransformableText:fk,BBox:Wz,applyShapeStyle:qle,getShapeStyle:yk,mergeDefaults:$z}=A,Qle=class extends A.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 Uz(e,t=0,i=2*Math.PI/e.sumSize){for(const s of e.children){const n=t+s.sumSize*i;s.startAngle=t,s.endAngle=n,Uz(s,t,i),t=n}}var Mv=class extends A.HierarchySeries{constructor(e){super(e),this.NodeClass=Qle,this.properties=new Xs,this.scalingGroup=this.contentGroup.appendChild(new Xle),this.sectorGroup=this.scalingGroup.appendChild(new Sv),this.sectorLabelGroup=this.scalingGroup.appendChild(new Sv),this.highlightSectorGroup=this.scalingGroup.appendChild(new Sv),this.datumSelection=gk.select(this.sectorGroup,Hz),this.labelSelection=gk.select(this.sectorLabelGroup,Sv),this.highlightSelection=gk.select(this.highlightSectorGroup,Hz),this.sectorLabelGroup.pointerEvents=Zle.None}processData(){super.processData(),Uz(this.rootNode)}updateSelections(){const e=this.ctx.highlightManager?.getActiveHighlight();if(this.highlightSelection.update(e!=null?[e]:[],void 0,o=>this.getDatumId(o)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:t}=this;if(t==null||t.seriesRect==null)return;const s=Array.from(this.rootNode),n=o=>{o.append([new fk({tag:0}),new fk({tag:1})])};this.datumSelection.update(s,void 0,o=>this.getDatumId(o)),this.labelSelection.update(s,n,o=>this.getDatumId(o))}getItemStyle(e,t){const{id:i,properties:s,colorScale:n}=this,{itemStyler:o,fillGradientDefaults:a,fillPatternDefaults:r,fillImageDefaults:l}=s,c=e.datumIndex?.[0]??0,h=t?s.highlightStyle:void 0,d=$z(h,s.getStyle(c));!t&&e.colorValue!=null&&(d.fill=n.convert(e.colorValue));let u=yk(d,a,r,l);if(o!=null&&e!=null){const p=this.ctx.highlightManager?.getActiveHighlight(),g=this.cachedDatumCallback(Kle(this.getDatumId(e),t?"highlight":"node"),()=>{const f=this.getHighlightStateString(p,t,e.datumIndex);return this.callWithContext(o,{seriesId:i,datum:e.datum,depth:e.depth??0,highlighted:t,highlightState:f,...u})});g&&(u=yk($z(g,u),a,r,l))}return u}updateNodes(){const{chart:e,data:t,maxDepth:i}=this;if(e==null||t==null)return;const{width:s,height:n}=e.seriesRect,{sectorSpacing:o=0,padding:a=0,cornerRadius:r,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:g}=this.properties;this.contentGroup.translationX=s/2,this.contentGroup.translationY=n/2;const f=o*.5,x=Math.min(s,n)/2,m=x/(i+1),b=-Math.PI/2,v={series:new Wz(-x,-x,2*x,2*x),axis:new Wz(-x,-x,2*x,2*x)};this.rootNode?.walk(T=>{const{startAngle:k,endAngle:L}=T;if(T.depth!=null){const N=(k+L)/2+b,w=(T.depth+.5)*m;T.midPoint.x=Math.cos(N)*w,T.midPoint.y=Math.sin(N)*w}}),this.rootNode?.walk(T=>{const{datum:k,depth:L,startAngle:N,endAngle:w,parent:O,sumSize:R}=T;T.label=void 0,T.secondaryLabel=void 0,T.contentHeight=0;let B;if(k!=null&&L!=null&&d!=null){const he=k[d];B=this.getLabelText(he,k,d,"label",[],this.properties.label,{depth:L,datum:k,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:g,value:he})}B===""&&(B=void 0);let P;if(k!=null&&L!=null&&u!=null){const he=k[u];P=this.getLabelText(he,k,u,"secondaryLabel",[],this.properties.secondaryLabel,{depth:L,datum:k,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:g,value:he})}if(P===""&&(P=void 0),L==null)return;const _=L*m+f,F=(L+1)*m-f,W=_>f?f/_:f,H=F>f?f/F:f,j=N+W,$=w+W-j,U=N+H,q=w+H-U,Q=he=>{if(L===0&&O?.sumSize===R)return{width:2*Math.sqrt(F**2-(he*.5)**2),height:he,meta:0};const be=he,Se=2*Math.sqrt(F**2-(_+be)**2),Oe=$<Math.PI?2*_*Math.tan($*.5):1/0,_e=Math.min(Se,Oe),Mt=Math.PI/4;let kt,Ki;return L===0?(kt=he,Ki=Math.sqrt(F**2-(kt/2)**2)-he/(2*Math.tan(q*.5))):Yle($)<Mt?(kt=2*_*Math.tan($*.5),Ki=Math.sqrt(F**2-(kt/2)**2)-_):(Ki=0,kt=0),_e>=Ki?{width:_e,height:be,meta:1}:{width:Ki,height:kt,meta:2}},ie=XA(B,this.properties.label,P,this.properties.secondaryLabel,{padding:a},Q);if(ie==null)return;const{width:ne,height:oe,meta:le,label:re,secondaryLabel:ee}=ie,Me=b+(N+w)/2,Ee=Math.sin(Me)>=0,Ie=Math.cos(Me)>=0,xe=(Ee?3:12)&(Ie?6:9);let ze;switch(le){case 0:ze=0;break;case 1:{const ye=F-(m-oe)*.58,be=Math.sqrt((F-a)**2-(ne/2)**2);ze=Math.min(ye,be);break}case 2:if(L===0){const he=oe/(2*Math.tan($*.5))+ne*.5,ye=Math.sqrt(F**2-(oe*.5)**2)-ne*.5;ze=(he+ye)*.5}else ze=(_+F)*.5;break}if(re!=null){const{fontStyle:he="normal",fontFamily:ye,fontWeight:be="normal",color:Se="black"}=this.properties.label;T.label={...re,fontStyle:he,fontFamily:ye,fontWeight:be,color:Se,labelPlacement:le,circleQuarter:xe,radius:ze,theta:Me}}if(ee!=null){const{fontStyle:he="normal",fontFamily:ye,fontWeight:be="normal",color:Se="black"}=this.properties.secondaryLabel;T.secondaryLabel={...ee,fontStyle:he,fontFamily:ye,fontWeight:be,color:Se,labelPlacement:le,circleQuarter:xe,radius:ze,theta:Me}}T.contentHeight=ie.height});const S=(T,k,L)=>{const{depth:N,startAngle:w,endAngle:O}=T;if(N==null){k.visible=!1;return}k.visible=!0;const R=this.getItemStyle(T,L),B=R.fill,P=R.strokeWidth,_=A.isGradientFill(B)&&B.bounds!=="item"?v:void 0;qle(k,R,_),k.centerX=0,k.centerY=0,k.innerRadius=N*m,k.outerRadius=(N+1)*m,k.startAngle=w+b,k.endAngle=O+b,k.inset=f+P*.5,k.cornerRadius=r};this.datumSelection.each((T,k)=>{S(k,T,!1)}),this.highlightSelection.each((T,k)=>{S(k,T,!0)});const D=(T,k,L,N)=>{const{depth:w,contentHeight:O}=T,R=L===0,B=R?T.label:T.secondaryLabel;if(w==null||B==null){k.visible=!1;return}const{labelPlacement:P,circleQuarter:_,radius:F,theta:W}=B;let H;switch(N&&(H=(R?this.properties.highlightStyle.label:this.properties.highlightStyle.secondaryLabel).color),k.text=B.text,k.fontSize=B.fontSize,k.lineHeight=B.lineHeight,k.fontStyle=B.fontStyle,k.fontFamily=B.fontFamily,k.fontWeight=B.fontWeight,k.fill=H??B.color,k.fillOpacity=this.getHighlightStyle(N,T.datumIndex)?.opacity??1,P){case 0:k.textAlign="center",k.textBaseline="top",k.translationX=0,k.translationY=(R?0:O-B.height)-O*.5,k.rotation=0;break;case 1:{const j=(_&3)!==0,V=R===!j?F:F-(O-B.height);k.textAlign="center",k.textBaseline=j?"bottom":"top",k.translationX=Math.cos(W)*V,k.translationY=Math.sin(W)*V,k.rotation=j?W-Math.PI*.5:W+Math.PI*.5;break}case 2:{const j=(_&6)!==0,V=R===!j?(O-B.height)*.5:(B.height-O)*.5;k.textAlign="center",k.textBaseline="middle",k.translationX=Math.cos(W)*F+Math.cos(W+Math.PI/2)*V,k.translationY=Math.sin(W)*F+Math.sin(W+Math.PI/2)*V,k.rotation=j?W:W+Math.PI;break}}k.visible=!0},C=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(fk).forEach(T=>{const k=T.closestDatum();D(k,T,T.tag,k===C)})}getTooltipContent(e){const{id:t,properties:i}=this,{labelKey:s,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:r,colorKey:l,colorName:c,tooltip:h}=i,d=e.reduce((S,D)=>S?.children[D],this.rootNode);if(d==null)return;const{datum:u,depth:p}=d;if(u==null||p==null)return;const g=[],f=a!=null?u[a]:void 0;f!=null&&g.push({label:r,fallbackLabel:a,value:f});const x=l!=null?u[l]:void 0;x!=null&&g.push({label:c,fallbackLabel:l,value:x});const m=this.getItemStyle({...d,colorValue:x??d.colorValue},!1),b=m.fill,v=yk({shape:"square",fill:b,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0},i.fillGradientDefaults,i.fillPatternDefaults,i.fillImageDefaults);return A.isGradientFill(v.fill)&&(v.fill={...v.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(h,{title:s!=null?u[s]:void 0,symbol:{marker:v},data:g},{seriesId:t,datum:u,title:void 0,depth:p,labelKey:s,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:r,colorKey:l,colorName:c,...m})}createNodeData(){}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}animateEmptyUpdateReady(){Ule(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn(){return{scalingX:1,scalingY:1}},fromFn(){return{scalingX:0,scalingY:0}}})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.itemStyler!=null}};Mv.className="SunburstSeries",Mv.type="sunburst";var{commonSeriesOptionsDefs:Jle,sunburstSeriesThemeableOptionsDef:ece,without:tce}=A,ice={...ece,...tce(Jle,["highlightStyle","highlight","showInLegend"]),type:Y(Le("sunburst")),labelKey:E,secondaryLabelKey:E,childrenKey:E,sizeKey:E,colorKey:E,sizeName:E,colorName:E},{BASE_FONT_SIZE:Yz,FONT_SIZE_RATIO:Kz}=A,sce={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"sunburst",moduleFactory:e=>new Mv(e),solo:!0,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},colorRange:{$palette:"divergingColors"},fillGradientDefaults:A.FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...A.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:Kz.LARGE},minimumFontSize:{$rem:9/Yz},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{...A.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:Kz.SMALLEST},minimumFontSize:{$rem:7/Yz},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlightStyle:{label:{color:{$ref:"chartBackgroundColor"}},secondaryLabel:{color:{$ref:"chartBackgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}},gradientLegend:{enabled:!0,...A.LEGEND_CONTAINER_THEME}}},nce={type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,options:ice,create:e=>new Mv(e)},{BaseProperties:Dv,HierarchySeriesProperties:oce,HighlightStyle:ace,makeSeriesTooltip:rce,Property:Pe,Label:lce}=A,Zz=class extends lce{constructor(){super(...arguments),this.spacing=0}};y([Pe],Zz.prototype,"spacing",2);var Ao=class extends Dv{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 Zz}};y([Pe],Ao.prototype,"fill",2),y([Pe],Ao.prototype,"fillOpacity",2),y([Pe],Ao.prototype,"stroke",2),y([Pe],Ao.prototype,"strokeWidth",2),y([Pe],Ao.prototype,"strokeOpacity",2),y([Pe],Ao.prototype,"cornerRadius",2),y([Pe],Ao.prototype,"textAlign",2),y([Pe],Ao.prototype,"gap",2),y([Pe],Ao.prototype,"padding",2),y([Pe],Ao.prototype,"interactive",2),y([Pe],Ao.prototype,"label",2);var Fn=class extends Dv{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 _a,this.secondaryLabel=new Zg}};y([Pe],Fn.prototype,"fill",2),y([Pe],Fn.prototype,"fillOpacity",2),y([Pe],Fn.prototype,"stroke",2),y([Pe],Fn.prototype,"strokeWidth",2),y([Pe],Fn.prototype,"strokeOpacity",2),y([Pe],Fn.prototype,"cornerRadius",2),y([Pe],Fn.prototype,"textAlign",2),y([Pe],Fn.prototype,"verticalAlign",2),y([Pe],Fn.prototype,"gap",2),y([Pe],Fn.prototype,"padding",2),y([Pe],Fn.prototype,"label",2),y([Pe],Fn.prototype,"secondaryLabel",2);var Nh=class extends Dv{constructor(){super(...arguments),this.label=new _a}};y([Pe],Nh.prototype,"fill",2),y([Pe],Nh.prototype,"fillOpacity",2),y([Pe],Nh.prototype,"stroke",2),y([Pe],Nh.prototype,"strokeWidth",2),y([Pe],Nh.prototype,"strokeOpacity",2),y([Pe],Nh.prototype,"label",2);var Jl=class extends Dv{constructor(){super(...arguments),this.label=new _a,this.secondaryLabel=new Zg}};y([Pe],Jl.prototype,"fill",2),y([Pe],Jl.prototype,"fillOpacity",2),y([Pe],Jl.prototype,"stroke",2),y([Pe],Jl.prototype,"strokeWidth",2),y([Pe],Jl.prototype,"strokeOpacity",2),y([Pe],Jl.prototype,"label",2),y([Pe],Jl.prototype,"secondaryLabel",2);var mk=class extends ace{constructor(){super(!1),this.group=new Nh,this.tile=new Jl}getStyle(e){return e?this.tile:this.group}};y([Pe],mk.prototype,"group",2),y([Pe],mk.prototype,"tile",2);var ea=class extends oce{constructor(){super(...arguments),this.highlightStyle=new mk,this.tooltip=rce(),this.group=new Ao,this.tile=new Fn,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}getStyle(e,t,i,s){const{fillOpacity:n,strokeWidth:o,strokeOpacity:a,fill:r=e?t[s%t.length]:t[Math.min(s,t.length)],stroke:l=e?i[s%t.length]:i[Math.min(s,i.length)]}=e?this.tile:this.group;return{fill:r,fillOpacity:n,stroke:l,strokeWidth:o,strokeOpacity:a,opacity:1}}};y([Pe],ea.prototype,"sizeName",2),y([Pe],ea.prototype,"labelKey",2),y([Pe],ea.prototype,"secondaryLabelKey",2),y([Pe],ea.prototype,"itemStyler",2),y([Pe],ea.prototype,"highlightStyle",2),y([Pe],ea.prototype,"tooltip",2),y([Pe],ea.prototype,"group",2),y([Pe],ea.prototype,"tile",2),y([Pe],ea.prototype,"undocumentedGroupFills",2),y([Pe],ea.prototype,"undocumentedGroupStrokes",2);var{TextUtils:cce,TextWrapper:hce,createDatumId:dce,Rect:Xz,Group:qz,BBox:Lu,Selection:xk,Text:Av,Transformable:uce,applyShapeStyle:pce,getShapeStyle:bk,getLabelStyles:gce,mergeDefaults:Qz}=A,fce=class extends A.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}},Jz=new Av;function yce(e,t){const{fontStyle:i,fontWeight:s,fontSize:n,fontFamily:o}=t;Jz.setProperties({text:e,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:o,textAlign:"left",textBaseline:"top"});const{width:a,height:r}=Jz.getBBox();return{width:a,height:r}}function ec(e){return e.children.length>0?e.sumSize-e.sizeValue:e.sizeValue}var e_={left:0,center:.5,right:1},mce={top:0,middle:.5,bottom:1},Fce=class extends A.Group{distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}},Iv=class extends A.HierarchySeries{constructor(){super(...arguments),this.NodeClass=fce,this.properties=new ea,this.rectGroup=this.contentGroup.appendChild(new qz),this.datumSelection=xk.select(this.rectGroup,Xz),this.labelSelection=xk.select(this.labelGroup,qz),this.highlightSelection=xk.select(this.rectGroup,Xz)}groupTitleHeight(e,t){const{labelValue:i}=e,{label:s}=this.properties.group,n=3;if(i!=null){if(s.fontSize>t.width/n||s.fontSize>t.height/n)return;{const{height:o}=yce(i,s);return Math.max(o,s.fontSize)}}}getNodePadding(e,t){if(e.parent==null)return{top:0,right:0,bottom:0,left:0};if(e.children.length===0){const{padding:a}=this.properties.tile;return{top:a,right:a,bottom:a,left:a}}const{label:{spacing:i},padding:s}=this.properties.group,n=this.groupTitleHeight(e,t),o=n!=null?n+i:0;return{top:s+o,right:s,bottom:s,left:s}}sortChildren({children:e}){const t=Array.from(e,(s,n)=>n).filter(s=>ec(e[s])>0).sort((s,n)=>ec(e[n])-ec(e[s]));return{sortedChildrenIndices:t,childAt:s=>{const n=t[s];return e[n]}}}squarify(e,t){const{datum:i,children:s}=e;if(t.width<=0||t.height<=0){e.bbox=void 0,e.padding=void 0,e.midPoint.x=NaN,e.midPoint.y=NaN;return}const n=i!=null?this.getNodePadding(e,t):{top:0,right:0,bottom:0,left:0};e.parent==null?(e.bbox=void 0,e.padding=void 0,e.midPoint.x=NaN,e.midPoint.y=NaN):(e.bbox=t,e.padding=n,e.midPoint.x=t.x+t.width/2,e.midPoint.y=t.y);const{sortedChildrenIndices:o,childAt:a}=this.sortChildren(e),r=o.every(D=>s[D].children.length===0),l=1,c=t.width-n.left-n.right,h=t.height-n.top-n.bottom;if(c<=0||h<=0)return;const d=o.length;let u=0,p=0,g=1/0,f=o.reduce((D,C)=>D+ec(s[C]),0);const x=new Lu(t.x+n.left,t.y+n.top,c,h),m=x.clone();let b=0;for(;b<d;){const D=ec(a(b)),C=ec(a(p)),T=m.width<m.height;u+=D;const k=T?m.height:m.width,L=T?m.width:m.height,N=L*C/u;let w=k*u/f;const O=Math.max(N,w)/Math.min(N,w),R=Math.abs(l-O);if(R<g){g=R,b++;continue}u-=D,w=k*u/f;let B=T?m.x:m.y;for(let P=p;P<b;P++){const _=a(P),F=ec(_),W=T?B:m.x,H=T?m.y:B,j=L*F/u,V=T?j:w,$=T?w:j,U=new Lu(W,H,V,$);this.applyGap(x,U,r),this.squarify(_,U),f-=F,B+=j}T?(m.y+=w,m.height-=w):(m.x+=w,m.width-=w),p=b,u=0,g=1/0}const v=m.width<m.height;let S=v?m.x:m.y;for(let D=p;D<d;D++){const C=a(D),T=v?S:m.x,k=v?m.y:S,L=ec(C)/f,N=m.width*(v?L:1),w=m.height*(v?1:L),O=new Lu(T,k,N,w);this.applyGap(x,O,r),this.squarify(C,O),S+=v?N:w}}applyGap(e,t,i){const s=i?this.properties.tile.gap*.5:this.properties.group.gap*.5,n=l=>({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),o=n(e),a=n(t);["top","right","bottom","left"].forEach(l=>{lt(o[l],a[l])||t.shrink(s,l)})}createNodeData(){}getItemStyle(e,t,i){const{id:s,properties:n,colorScale:o,ctx:a}=this,{itemStyler:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=n,d=e.datumIndex?.[0]??0,u=t?n.fills:n.undocumentedGroupFills,p=t?n.strokes:n.undocumentedGroupStrokes,g=t?d:e.depth??-1,f=i?n.highlightStyle.getStyle(t):void 0,x=Qz(f,n.getStyle(t,u,p,g));!i&&t&&e.colorValue!=null&&(x.fill=o.convert(e.colorValue));let m=bk(x,l,c,h);if(r!=null&&e!=null){const b=this.cachedDatumCallback(dce(this.getDatumId(e),i?"highlight":"node"),()=>{const v=a.highlightManager?.getActiveHighlight(),S=this.getHighlightStateString(v,i,e.datumIndex);return this.callWithContext(r,{seriesId:s,datum:e.datum,depth:e.depth??-1,highlighted:i,highlightState:S,...m})});b&&(m=bk(Qz(b,m),l,c,h))}return m}updateSelections(){let e=this.ctx.highlightManager?.getActiveHighlight();if(e!=null&&!this.properties.group.interactive&&e.children.length!==0&&(e=void 0),this.highlightSelection.update(e!=null?[e]:[],void 0,n=>this.getDatumId(n)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:t}=this.chart??{};if(!t)return;const i=Array.from(this.rootNode),s=n=>{n.append([new Av({tag:0}),new Av({tag:1})])};this.datumSelection.update(i,void 0,n=>this.getDatumId(n)),this.labelSelection.update(i,s,n=>this.getDatumId(n))}updateNodes(){const{rootNode:e,data:t}=this,{childrenKey:i,colorKey:s,colorName:n,labelKey:o,secondaryLabelKey:a,sizeKey:r,sizeName:l,highlightStyle:c,tile:h,group:d}=this.properties,{seriesRect:u}=this.chart??{};if(!u||!t)return;this.rootNode?.walk(v=>{const{datum:S,depth:D,children:C}=v,T=C.length===0,k=T?h.label:d.label;let L;if(k.enabled&&S!=null&&D!=null&&o!=null){const w=S[o];L=this.getLabelText(w,S,o,"label",[],k,{depth:D,datum:S,childrenKey:i,colorKey:s,colorName:n,labelKey:o,secondaryLabelKey:a,sizeKey:r,sizeName:l,value:w})}L===""&&(L=void 0);let N;if(h.secondaryLabel.enabled&&T&&S!=null&&D!=null&&a!=null){const w=S[a];N=this.getLabelText(w,S,a,"secondaryLabel",[],h.secondaryLabel,{depth:D,datum:S,childrenKey:i,colorKey:s,colorName:n,labelKey:o,secondaryLabelKey:a,sizeKey:r,sizeName:l,value:w})}N===""&&(N=void 0),v.labelValue=L,v.secondaryLabelValue=N});const{width:p,height:g}=u;this.squarify(e,new Lu(0,0,p,g)),this.rootNode?.walk(v=>{const{bbox:S,children:D,labelValue:C,secondaryLabelValue:T}=v;if(v.label=void 0,v.secondaryLabel=void 0,S!=null)if(D.length===0){const k={width:S.width,height:S.height,meta:null},L=XA(C,this.properties.tile.label,T,this.properties.tile.secondaryLabel,{padding:h.padding},()=>k);if(L==null)return;const{height:N,label:w,secondaryLabel:O}=L,{textAlign:R,verticalAlign:B,padding:P}=h,_=e_[R]??.5,F=S.x+P+(S.width-2*P)*_,W=mce[B]??.5,H=S.y+P+N*.5+(S.height-2*P-N)*W;if(w!=null){const{fontStyle:j="normal",fontFamily:V,fontWeight:$="normal",color:U="black"}=this.properties.tile.label;v.label={text:w.text,fontSize:w.fontSize,lineHeight:w.lineHeight,fontStyle:j,fontFamily:V,fontWeight:$,color:U,textAlign:R,verticalAlign:"middle",x:F,y:H-(N-w.height)*.5}}if(O!=null){const{fontStyle:j="normal",fontFamily:V,fontWeight:$="normal",color:U="black"}=this.properties.tile.secondaryLabel;v.secondaryLabel={text:O.text,fontSize:O.fontSize,lineHeight:O.fontSize,fontStyle:j,fontFamily:V,fontWeight:$,color:U,textAlign:R,verticalAlign:"middle",x:F,y:H+(N-O.height)*.5}}}else{if(C==null)return;{const{padding:k,textAlign:L}=d,N=this.groupTitleHeight(v,S);if(N==null)return;const w=S.width-2*k,O=hce.wrapText(C,{maxWidth:S.width-2*k,font:d.label,textWrap:"never"}),R=e_[L]??.5,{fontStyle:B="normal",fontFamily:P,fontWeight:_="normal",color:F="black"}=this.properties.group.label;v.label={text:O,fontSize:d.label.fontSize,lineHeight:cce.getLineHeight(d.label.fontSize),fontStyle:B,fontFamily:P,fontWeight:_,color:F,textAlign:L,verticalAlign:"middle",x:S.x+k+w*R,y:S.y+k+N*.5}}}});const f={series:new Lu(0,0,p,g),axis:new Lu(0,0,p,g)},x=(v,S,D)=>{const{bbox:C}=v;if(C==null){S.visible=!1;return}const{depth:T=-1}=v,k=v.children.length===0,L=this.getItemStyle(v,k,D);S.crisp=!0,pce(S,L,f),S.cornerRadius=k?h.cornerRadius:d.cornerRadius,S.zIndex=[0,T,D?1:0];const N=v.parent?.children.every(R=>R.children.length===0),w=v.parent!=null?v.parent.bbox:void 0,O=v.parent!=null?v.parent.padding:void 0;N===!0&&w!=null&&O!=null?(S.clipBBox=C,S.x=w.x+O.left,S.y=w.y+O.top,S.width=w.width-(O.left+O.right),S.height=w.height-(O.top+O.bottom)):(S.clipBBox=void 0,S.x=C.x,S.y=C.y,S.width=C.width,S.height=C.height),S.visible=!0};this.datumSelection.each((v,S)=>x(S,v,!1)),this.highlightSelection.each((v,S)=>{x(S,v,!0)});const m=(v,S,D,C)=>{const T=v.children.length===0,k=D===0?v.label:v.secondaryLabel;if(k==null){S.visible=!1;return}const L=D===0?h.label:h.secondaryLabel;let N;if(C){const{tile:P,group:_}=c;N=P.secondaryLabel.color,T?D===0&&(N=P.label.color):N=_.label.color}const w={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:v.depth??NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},O=this.ctx.highlightManager?.getActiveHighlight(),R=this.getHighlightStateString(O,C,v.datumIndex),B=gce(this,v,w,L,C,R);S.text=k.text,S.fontSize=k.fontSize,S.lineHeight=k.lineHeight,S.fontStyle=k.fontStyle,S.fontFamily=k.fontFamily,S.fontWeight=k.fontWeight,S.fill=N??k.color,S.fillOpacity=this.getHighlightStyle(C,v.datumIndex)?.opacity??1,S.textAlign=k.textAlign,S.textBaseline=k.verticalAlign,S.x=k.x,S.y=k.y,S.setBoxing(B),S.visible=!0,S.zIndex=1},b=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(Av).forEach(v=>{const S=v.closestDatum();m(S,v,v.tag,S===b)})}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort((i,s)=>s.datumIndex.length-i.datumIndex.length),t}pickNodeClosestDatum(e){const t=this.pickNodesExactShape(e);return t.length!==0?{datum:t[0],distance:0}:this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}getTooltipContent(e){const{id:t,properties:i}=this,{labelKey:s,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:r,colorKey:l,colorName:c,tooltip:h}=i,d=e.reduce((T,k)=>T?.children[k],this.rootNode);if(d==null)return;const{datum:u,depth:p,children:g}=d;if(u==null||p==null)return;const f=g.length===0,x=[],m=a!=null?u[a]:void 0;m!=null&&x.push({label:r,fallbackLabel:a,value:m});const b=l!=null?u[l]:void 0;b!=null&&x.push({label:c,fallbackLabel:l,value:b});const v=this.getItemStyle({...d,colorValue:b??d.colorValue},f,!1),S=v.fill,D=bk({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);A.isGradientFill(D.fill)&&(D.fill={...D.fill,gradient:"linear",rotation:0,reverse:!1});const C=f?{marker:D}:void 0;return this.formatTooltipWithContext(h,{title:s!=null?u[s]:void 0,symbol:C,data:x},{seriesId:t,datum:u,title:void 0,depth:p,labelKey:s,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:r,colorKey:l,colorName:c,...v})}computeFocusBounds(e){return uce.toCanvas(this.contentGroup,e.getBBox())}hasItemStylers(){return this.properties.itemStyler!=null}};Iv.className="TreemapSeries",Iv.type="treemap";var{commonSeriesOptionsDefs:xce,treemapSeriesThemeableOptionsDef:bce,without:vce}=A,wu={...bce,...vce(xce,["highlightStyle","highlight","showInLegend"]),type:Y(Le("treemap")),labelKey:E,secondaryLabelKey:E,childrenKey:E,sizeKey:E,colorKey:E,sizeName:E,colorName:E};wu.fillGradientDefaults=me(Rf),wu.fillPatternDefaults=me(Bf),wu.fillImageDefaults=me(Ff),wu.undocumentedGroupFills=me(Ae(ae)),wu.undocumentedGroupStrokes=me(Ae(ae));var{FONT_SIZE_RATIO:t_}=A,Sce={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"treemap",moduleFactory:e=>new Iv(e),solo:!0,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},colorRange:{$palette:"divergingColors"},fillGradientDefaults:A.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:A.FILL_PATTERN_DEFAULTS,fillImageDefaults:A.FILL_IMAGE_DEFAULTS,undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},group:{label:{...A.LABEL_BOXING_DEFAULTS,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:{...A.LABEL_BOXING_DEFAULTS,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:1.5},minimumFontSize:{$rem:t_.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{...A.LABEL_BOXING_DEFAULTS,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:t_.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:{$isUserOption:["../strokes/0",2,{$isUserOption:["./stroke",2,0]}]},padding:3,gap:1},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:"chartBackgroundColor"}},secondaryLabel:{color:{$ref:"chartBackgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},gradientLegend:{enabled:!0,...A.LEGEND_CONTAINER_THEME}}},Mce={type:"series",name:"treemap",chartType:"standalone",enterprise:!0,options:wu,create:e=>new Iv(e)},zce=A.ModuleRegistry,Dce=[yee,AP,GP,sie,Die,QP,eR,vR,NR,FR],Ace=[mee,xee,bee,vee,Boe,Yae,Qae,Pre,Wre],Ice=[Aee,oae,ise,vle,nce,Mce,pte,jle],kce=[Lee,Tse,Fse,yne,_ne,Jne],Cce=[...Dce,...Ace,...Ice,...kce,Vee,jee,Hee],Tce=`.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-panel-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-left:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-left:auto;padding:1px 6px}.ag-charts-dialog__close-button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-panel-subtle-text-color);margin-right:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-right:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-bottom-left-radius:var(--ag-charts-input-border-radius);border-top-left-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-bottom-right-radius:var(--ag-charts-input-border-radius);border-top-right-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red 0%,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red 100%)}.ag-charts-color-picker{width:190px;padding:8px;cursor:default;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-moz-range-thumb,.ag-charts-color-picker__alpha-input::-moz-range-thumb{appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-moz-range-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-moz-range-thumb{background:transparent}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-moz-range-thumb{background:var(--color)}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-moz-range-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-moz-range-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input::-moz-range-track,.ag-charts-color-picker__alpha-input::-moz-range-track{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input::-moz-range-track{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input::-moz-range-track{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0 7px 7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-right:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-button-font-family);font-size:var(--ag-charts-button-font-size);font-weight:var(--ag-charts-button-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{background:var(--ag-charts-menu-background-color);border-radius:var(--ag-charts-border-radius);border:var(--ag-charts-menu-border);box-shadow:var(--ag-charts-popup-shadow);color:var(--ag-charts-menu-text-color);display:flex;flex-direction:column;padding:.5em 0;transition:transform .1s ease;white-space:nowrap}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{align-items:center;background:none;border:none;box-sizing:border-box;color:inherit;cursor:pointer;display:flex;font:inherit;justify-content:space-between;text-align:left;width:100%;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__icon>img{width:var(--ag-charts-icon-size);height:var(--ag-charts-icon-size)}.ag-charts-context-menu__icon,.ag-charts-context-menu__cell{display:flex;align-items:center;flex-shrink:0}.ag-charts-context-menu__cell{flex-grow:1}.ag-charts-context-menu__cellpadding{padding:.5em 1em}.ag-charts-context-menu__icon{padding-right:0}.ag-charts-context-menu__item[data-focus-override=true],.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-override=false]{background:inherit}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;color:color-mix(in srgb,var(--ag-charts-input-text-color) 50%,transparent)}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-context-menu__divider{padding:5px 0}.ag-charts-context-menu__divider:after{content:"";display:block;border-top:1px solid var(--ag-charts-border-color)}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons .ag-charts-toolbar__button{padding:var(--toolbar-button-padding) calc(var(--toolbar-button-padding) * 1.5)}.ag-charts-zoom-buttons{align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-left:var(--ag-charts-spacing);padding-right:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-left:0}.ag-charts-toolbar__button--gap{margin-left:var(--toolbar-gap)}&.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{gap:var(--toolbar-gap);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}}
`;A.ModuleRegistry.registerMany(Cce,Ja);function i_(){A.moduleRegistry.register(JY,nK,OK,y6,D6,g9,i8,H8,ute,iie,Mie,xq,z6,H6,q6,O6,Q6,d9,tse,Cse,Bse,fne,zne,Qne,$7,hJ,cee,pq,Roe,uK,Uae,qae,Ore,Hre,LK,ble,EK,t7,pQ,Q7,nae,Vle,eJ,sce,xJ,Sce,O7,_J),A.enterpriseModule.isEnterprise=!0,A.enterpriseModule.styles=Tce,A.enterpriseModule.licenseManager=e=>new $d(e.container?.ownerDocument??(typeof document>"u"?void 0:document)),A.enterpriseModule.injectWatermark=hee}i_();var Lce={setLicenseKey(e){$d.setLicenseKey(e)}};function s_(){i_(),ex()}var wce={VERSION:Ja,_Scene:nx,_Theme:ox,_Util:ax,create:oo.create.bind(oo),createSparkline:oo.__createSparkline.bind(oo),setup:s_,setGridContext:$d.setGridContext.bind($d),setLicenseKey:$d.setLicenseKey.bind($d),isEnterprise:!0};if(typeof ia.exports=="object"&&typeof Ou=="object"){var Nce=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Object.getOwnPropertyNames(t))!Object.prototype.hasOwnProperty.call(e,n)&&n!==i&&Object.defineProperty(e,n,{get:()=>t[n],enumerable:!(s=Object.getOwnPropertyDescriptor(t,n))||s.enumerable});return e};ia.exports=Nce(ia.exports,Ou)}return ia.exports});