var Gi=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,nt=(e,t)=>{for(var n in t)Gi(e,n,{get:t[n],enumerable:!0})},he=(e,t,n,r)=>{for(var i=r>1?void 0:r?Wa(t,n):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(i=(r?s(t,n,i):s(i))||i);return r&&i&&Gi(t,n,i),i},Ui=(e=>(e.Chart="chart",e.Axis="axis",e.Series="series",e.Plugin="plugin",e.AxisPlugin="axis:plugin",e.SeriesPlugin="series:plugin",e.Preset="preset",e))(Ui||{});function Va(e){return e.domain}var Bi=(e=>(e[e.Leading=0]="Leading",e[e.Trailing=1]="Trailing",e[e.Interpolate=2]="Interpolate",e))(Bi||{}),za=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 n=this.events.get(e);n&&(n.delete(t),n.size===0&&this.events.delete(e))}emit(e,t){const n=this.events.get(e);if(n)for(const r of n)r(t)}clear(e){e?this.events.delete(e):this.events.clear()}},ur=class{constructor(e){if(this.maxCacheSize=e,this.store=new Map,e<=0)throw new Error("LRUCache size must be greater than 0")}get(e){if(!this.store.has(e))return;const t=this.store.get(e);return this.store.delete(e),this.store.set(e,t),t}has(e){return this.store.has(e)}set(e,t){return this.store.set(e,t),this.store.size>this.maxCacheSize&&this.store.delete(this.store.keys().next().value),t}clear(){this.store.clear()}},ji={};nt(ji,{Time:()=>gl,check:()=>it,create:()=>Qi,inDevelopmentMode:()=>Zi});function fr(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function qa(e){return Array.from(new Set(e))}function Ka(e,t){return e.reduce((n,r)=>{const i=t(r);return n[i]??(n[i]=[]),n[i].push(r),n},{})}function rt(e,t){if(e==null||t==null||e.length!==t.length)return!1;for(let n=0;n{const o=n.get(r)??1/0,s=n.get(i)??1/0;return o-s})}function Ja(e,t){let n=0;for(;n=0&&t(e[n]);)n-=1;const r=e.length-1-n;r!==0&&e.splice(e.length-r,r)}function Za(e,t,n){const r=[e],i=Math.round((t-e)/(n-1));if(i>0)for(let o=e+i;o=n-1);o+=i);return r.push(t),r}var Q={};typeof globalThis.window<"u"&&(Q.window=globalThis.window),typeof document<"u"?Q.document=document:typeof globalThis.global<"u"&&(Q.document=globalThis.document);function ln(e){return e?Q.document?.[e]:Q.document}function cn(e){return e?Q.window?.[e]:Q.window}function el(e){Q.document=e}function tl(e){Q.window=e}function Hi(){return Q.window?.OffscreenCanvas??globalThis.OffscreenCanvas}function nl(){return Q.window?.Path2D??globalThis.Path2D}function rl(){return Q.window?.DOMMatrix??globalThis.DOMMatrix}function il(){return Q.window?.Image??globalThis.Image}function ol(){return Q.window?.ResizeObserver??globalThis.ResizeObserver}var Wi=1,sl=11;function Vi(e){return e!=null&&typeof e.nodeType=="number"}function hr(e){return e!=null&&e.nodeType===Wi}function al(e){return e!=null&&e.nodeType===sl}function zi(e){return e!=null&&e.nodeType===Wi&&"style"in e}var qi={};nt(qi,{error:()=>Ki,errorOnce:()=>cl,log:()=>un,logGroup:()=>Xi,reset:()=>ul,table:()=>ll,warn:()=>be,warnOnce:()=>te});var dr=new Set;function un(...e){console.log(...e)}function be(e,...t){console.warn(`AG Charts - ${e}`,...t)}function Ki(e,...t){typeof e=="object"?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function ll(...e){console.table(...e)}function Yi(e,t,n){let r;e instanceof Error?r=e.message:typeof e=="string"?r=e:typeof e=="object"?r=JSON.stringify(e):r=String(e);const i=`${t}: ${r}`;dr.has(i)||(n(e),dr.add(i))}function te(e,...t){Yi(e,"Logger.warn",n=>be(n,...t))}function cl(e,...t){Yi(e,"Logger.error",n=>Ki(n,...t))}function ul(){dr.clear()}function fl(e){return typeof e=="object"&&e!==null&&"then"in e}function Xi(e,t){console.groupCollapsed(e);let n=!0;try{const r=t();return fl(r)?(n=!1,r.finally(()=>{console.groupEnd()})):r}finally{n&&console.groupEnd()}}var hl=2e3,Ji=Date.now();function dl(){const e=Date.now()-Ji;if(e>hl){const t=(Math.floor(e/100)/10).toFixed(1);un(`**** ${t}s since last log message ****`)}Ji=Date.now()}function Qi(...e){return Object.assign((...n)=>{it(...e)&&(typeof n[0]=="function"&&(n=fr(n[0]())),dl(),un(...n))},{check:()=>it(...e),group:(n,r)=>it(...e)?Xi(n,r):r()})}function it(...e){return e.length===0&&e.push(!0),fr(cn("agChartsDebug")).some(n=>e.includes(n))}function Zi(e){if(it("dev"))return e()}function gl(e,t={}){const{logResult:n=!0,logStack:r=!1,logArgs:i=!1,logData:o}=t;return function(s,a,l){const c=l.value;l.value=function(...u){const f=performance.now(),h=c.apply(this,u),g={duration:performance.now()-f};return n&&(g.result=h),i&&(g.args=u),r&&(g.stack=new Error("Stack trace for timing debug").stack),o&&(g.logData=o(this)),un(e,g),h}}}var eo={};nt(eo,{flush:()=>no,record:()=>to});var gr=new Map;function to(e,t){it("scene:stats:verbose")&&gr.set(e,t)}function no(){const e=Object.fromEntries(gr);return gr.clear(),e}var pl={},ro={};nt(ro,{RegistryMode:()=>io,getAxisModule:()=>xl,getChartModule:()=>El,getPresetModule:()=>Tl,getSeriesModule:()=>Al,hasModule:()=>bl,isEnterprise:()=>Sl,isIntegrated:()=>Ml,isModuleType:()=>ot,isUmd:()=>Dl,listModules:()=>vl,listModulesByType:()=>wl,register:()=>pr,registerModules:()=>yl,reset:()=>ml,setRegistryMode:()=>Ol});var io=(e=>(e.Enterprise="enterprise",e.Integrated="integrated",e.UMD="umd",e))(io||{}),$t=new Set,ve=new Map;function oo(e){if(ve.set(e.name,e),e.dependencies)for(const t of e.dependencies)pr(t)}function pr(e){const t=ve.get(e.name);if(!t){oo(e);return}if(t.version===e.version){!t.enterprise&&e.enterprise&&oo(e);return}throw new Error([`AG Charts - Module '${e.name}' already registered with different version:`,`${t.version} vs ${e.version}`,"","Check your package.json for conflicting dependencies - depending on your package manager","one of these commands may help:","- npm ls ag-charts-community","- yarn why ag-charts-community"].join(` `))}function yl(e){for(const t of e.flat())pr(t)}function ml(){$t.clear(),ve.clear()}function bl(e){return ve.has(e)}function*vl(){for(const e of ve.values())yield e}function*wl(e){for(const t of ve.values())ot(e,t)&&(yield t)}function xl(e){const t=ve.get(e);if(ot("axis",t))return t}function El(e){const t=ve.get(e);if(ot("chart",t))return t;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function Tl(e){const t=ve.get(e);if(ot("preset",t))return t}function Al(e){const t=ve.get(e);if(ot("series",t))return t}function Ol(e){$t.add(e)}function Sl(){return $t.has("enterprise")}function Ml(){return $t.has("integrated")}function Dl(){return $t.has("umd")}function ot(e,t){return t?.type===e}var yr=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)}},Fl=class{constructor(){this.cleanup=new yr}destroy(){this.cleanup.flush()}},kl=void 0,$l=void 0;$l=kl;var Ll=void 0,Cl=void 0;Cl=Ll;var Il=void 0,Rl=void 0;Rl=Il;var Nl=void 0,_l=void 0;_l=Nl;var Lt="\u2026",fn=/\r?\n/g,Ct="\u200B",so=/[\s.,;:-]{1,5}$/,It;function ao(e){if(It==null){const n=cn("Option");It=new n().style}It.color=e;const t=It.color||null;return It.color="",t}function lo(e){return e?.ownerDocument.defaultView?.getComputedStyle(e).direction==="rtl"}function Pl(e,t){if(!e)return;const{x:n,y:r,width:i,height:o}=Hl(t);hn(e.style,"width",i),hn(e.style,"height",o),hn(e.style,"left",n),hn(e.style,"top",r)}function Gl(e){const t=Number.parseFloat(e.style.width),n=Number.parseFloat(e.style.height),r=Number.parseFloat(e.style.left),i=Number.parseFloat(e.style.top),o=Number.isFinite(t)?t:e.offsetWidth,s=Number.isFinite(n)?n:e.offsetHeight,a=Number.isFinite(r)?r:e.offsetLeft,l=Number.isFinite(i)?i:e.offsetTop;return{x:a,y:l,width:o,height:s}}function Ul(e){if(e.focus({preventScroll:!0}),e.lastChild?.textContent==null)return;const{ownerDocument:t}=e,n=t.createRange();n.setStart(e.lastChild,e.lastChild.textContent.length),n.setEnd(e.lastChild,e.lastChild.textContent.length);const r=t.defaultView?.getSelection();r?.removeAllRanges(),r?.addRange(n)}function Bl(){const e=cn("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function jl(e){return`ag-charts-icon ag-charts-icon-${e}`}function Hl(e){let{x:t,y:n,width:r,height:i}=e;return(r==null||r>0)&&(i==null||i>0)?e:(t!=null&&r!=null&&r<0&&(r=-r,t=t-r),n!=null&&i!=null&&i<0&&(i=-i,n=n-i),{x:t,y:n,width:r,height:i})}function hn(e,t,n){n==null?e.removeProperty(t):e.setProperty(t,`${n}px`)}function dn(e){return e!=null}function N(e){return Array.isArray(e)}function co(e){return typeof e=="boolean"}function st(e){return e instanceof Date}function gn(e){return st(e)&&!Number.isNaN(Number(e))}function uo(e){return e instanceof RegExp}function xe(e){return typeof e=="function"}function q(e){return typeof e=="object"&&e!==null&&!N(e)}function Wl(e){return N(e)||V(e)}function V(e){return typeof e=="object"&&e!==null&&e.constructor?.name==="Object"}function Vl(e){if(typeof e!="object"||e===null)return!1;for(const t in e)return!1;return!0}function we(e){return typeof e=="string"}function Rt(e){return typeof e=="number"}function de(e){return Number.isFinite(e)}function mr(e){return e!=null&&e.nodeType===1&&"style"in e}function zl(e,t){return we(t)&&Object.keys(e).includes(t)}function ql(e,t){return Object.values(e).includes(t)}function Kl(e){return typeof e=="symbol"}function fo(e){return we(e)&&(e==="none"||ao(e)!=null)}function Yl(e,t){return e in t}function ho({fontSize:e,fontStyle:t,fontWeight:n,fontFamily:r}){let i="";return t&&t!=="normal"&&(i+=`${t} `),n&&n!=="normal"&&n!==400&&(i+=`${n===700?"bold":n} `),i+=`${e}px`,i+=` ${r}`,i}function Xl(e,t=1.15){return Math.round(e*t)}function at(e){return String(e??"")}function br(e){return vr(e.replace(so,""))+Lt}var Jl=new Set([1575,1577,1583,1584,1585,1586,1608]);function Ql(e){return e>=1568&&e<=1610&&!Jl.has(e)}function vr(e){if(!e)return e;const t=e.codePointAt(e.length-1);return Ql(t)?e+"\u200D":e}function go(e){return Ct+e+Ct}function po(e){return e.replaceAll(Ct,"")}function Zl(e){return N(e)?yo(e.at(-1)):Nt(at(e))}function Nt(e){return e.endsWith(Lt)}function yo(e){return at(e?.text).endsWith(Lt)}var mo=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function Ee(e){return mo?Array.from(mo.segment(e),t=>t.segment):Array.from(e)}function lt(e,t="and",n=String,r=1/0){if(e.length===0)return"";if(e.length===1)return n(e[0]);e=e.map(n);const i=e.pop();if(e.length>=r){const o=e.length-(r-1);return`${e.slice(0,r-1).join(", ")}, and ${o} more ${t} ${i}`}return`${e.join(", ")} ${t} ${i}`}function _t(e,t=1/0){if(typeof e=="number"){if(Number.isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}const n=JSON.stringify(e)??typeof e;return n.length>t?`${n.slice(0,t)}... (+${n.length-t} characters)`:n}function ec(e){let t=1;for(let n=0;nc),a=new Array(i+1);for(let l=1;l<=o;l++){a[0]=l;for(let c=1;c<=i;c++){const u=r[l-1]===n[c-1]?0:1;a[c]=Math.min(s[c]+1,a[c-1]+1,s[c-1]+u)}[s,a]=[a,s]}return s[i]}function tc(e){return e.replaceAll(nc,(t,n)=>(n>0?"-":"")+t.toLowerCase())}var nc=/[A-Z]+(?![a-z])|[A-Z]/g;function rc(e,t=""){return e==null?t:N(e)?e.map(n=>at(n.text)).join(""):we(e)?e:String(e)}function ic(e,t=0,n){const{leading:r=!1,trailing:i=!0,maxWait:o=1/0}=n??{};let s,a;if(oa=null,t),e(...c);return}let u=t;if(o!==1/0&&a){const f=Date.now()-a;t>o-f&&(u=o-f)}clearTimeout(s),a??(a=Date.now()),s=setTimeout(()=>{a=null,i&&e(...c)},u)}return Object.assign(l,{cancel(){clearTimeout(s),a=null}})}function oc(e,t,n){const{leading:r=!0,trailing:i=!0}=n??{};let o,s,a=!1;function l(){i&&s?(o=setTimeout(l,t),e(...s)):a=!1,s=null}function c(...u){a?s=u:(a=!0,o=setTimeout(l,t),r?e(...u):s=u)}return Object.assign(c,{cancel(){clearTimeout(o),a=!1,s=null}})}function wr(e,t,n=""){try{return e(...t)}catch(r){const i=n?` \`${n}\``:"";te(`Uncaught exception in user callback${i}`,r)}}var ce=Symbol("description"),vo=Symbol("required"),pn=Symbol("marked"),yn=Symbol("undocumented"),mn=Symbol("union"),sc=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["src","url"],["width","thickness"],["show","visible","enabled"]].reduce((e,t)=>{for(const n of t)e.set(n.toLowerCase(),new Set(t.filter(r=>r!==n)));return e},new Map),wo=(e=>(e.Invalid="invalid",e.Required="required",e.Unknown="unknown",e))(wo||{});function Pt(e,t){return de(t)?`${e}[${t}]`:e?`${e}.${t}`:t}var _e=class{constructor(e,t,n,r,i){this.type=e,this.description=t,this.value=n,this.path=r,this.key=i}setUnionType(e,t){if(this.path.startsWith(t)){const n=this.path.slice(t.length);this.altPath=`${t}[type=${e}]${n}`}}getPrefix(){const{altPath:e=this.path,key:t}=this;return!e&&!t?"Value":`Option \`${t?Pt(e,t):e}\``}toString(){const{description:e="unknown",type:t,value:n}=this;return t==="required"&&n==null?`${this.getPrefix()} is required and has not been provided; expecting ${e}, ignoring.`:`${this.getPrefix()} cannot be set to \`${_t(n,50)}\`; expecting ${e}, ignoring.`}},xr=class extends _e{constructor(e,t,n,r){super("unknown",void 0,t,n,r),this.suggestions=e,this.key=r}getPrefix(){return`Unknown option \`${Pt(this.altPath??this.path,this.key)}\``}getPostfix(){const e=lt(ac(this.key,this.suggestions),"or",t=>`\`${t}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function Pe(e,t,n=""){if(!q(e))return{cleared:null,invalid:[new _e("required","an object",e,n)]};const r={},i=[],o=new Set(Object.keys(e)),s=[];if(mn in t){const a=Object.keys(t),l=t[mn];if(e.type!=null&&a.includes(e.type)||e.type==null&&l!=null){const{type:c=l,...u}=e,f=Pe(u,t[c],n);Object.assign(r,{type:c},f.cleared);for(const h of f.invalid)h.setUnionType(c,n);i.push(...f.invalid)}else{const c=lt(a,"or",u=>`'${u}'`);i.push(new _e("required",`a keyword such as ${c}`,e.type,n,"type"))}return{cleared:r,invalid:i}}for(const a of Object.keys(t)){const l=t[a],c=l[vo],u=e[a];if(o.delete(a),u===void 0&&(l[yn]||s.push(a),!c))continue;const f=Pt(n,a);if(xe(l)){const d=l(u,{options:e,path:f});if(typeof d=="object"){if(i.push(...d.invalid),d.valid){r[a]=d.cleared;continue}else if(xn(d.invalid,f))continue}else if(d){r[a]=u;continue}i.push(new _e(c?"required":"invalid",l[ce],u,n,a))}else{const h=Pe(u,l,f);h.cleared!=null&&(r[a]=h.cleared),i.push(...h.invalid)}}for(const a of o){const l=e[a];l!==void 0&&i.push(new xr(s,l,n,a))}return{cleared:r,invalid:i}}function ac(e,t,n=2){const r=e.toLowerCase(),i=sc.get(r);return t.filter(o=>{const s=o.toLowerCase();return i?.has(o)===!0||s.includes(r)||bo(r,s)<=n})}function $(e,t){if(xe(e)){let r=function(i,o){return e(i,o)};var n=r;return r[ce]=t,r}else return{...e,[ce]:t}}function A(e){return Object.assign(xe(e)?(t,n)=>e(t,n):z(e),{[vo]:!0,[ce]:e[ce]})}function D(e){return Object.assign(xe(e)?(t,n)=>e(t,n):z(e),{[yn]:!0,[ce]:e[ce]})}var z=(e,t="an object",n=!1)=>$((r,i)=>{const o=Pe(r,e,i.path),s=!xn(o.invalid,i.path);return{valid:s,cleared:s||!n?o.cleared:null,invalid:o.invalid}},t),Er=(e,t,n)=>({...e,[ce]:t,[mn]:n}),ge=(...e)=>$((t,n)=>{const r=[];for(const i of e){const o=i(t,n);if(typeof o=="object"){if(r.push(...o.invalid),!o.valid)return{valid:!1,cleared:t,invalid:r};t=o.cleared}else if(!o)return!1}return{valid:!0,cleared:t,invalid:r}},lt(e.filter(t=>!t[yn]).map(t=>t[ce]).filter(dn),"and")),G=(...e)=>$((t,n)=>{for(const r of e){const i=r(t,n);if(typeof i=="object"?i.valid:i)return i}return!1},lt(e.filter(t=>!t[yn]).map(t=>t[ce]).filter(dn),"or")),ct=e=>de(e)||gn(e),lc=e=>st(e)||(de(e)||we(e))&&gn(new Date(e)),Tr=$(N,"an array"),b=$(co,"a boolean"),R=$(xe,"a function"),F=$(fo,"a color string"),ut=$(lc,"a date"),ne=$(dn,"a defined value"),m=$(de,"a number"),xo=$(q,"an object"),O=$(we,"a string"),Eo=$(mr,"an html element"),Gt=(e,t=1/0)=>{let n;return t===1/0?n=`an array of at least ${e} items`:e===t?n=`an array of exactly ${e} items`:e===0?n=`an array of no more than ${t} items`:n=`an array of at least ${e} and no more than ${t} items`,$(r=>N(r)&&r.length>=e&&r.length<=t,n)},Ar=(e,t=1/0)=>{let n;return t===1/0?n=`a string of at least ${e} characters`:e===t?n=`an string of exactly ${e} characters`:e===0?n=`an string of no more than ${t} characters`:n=`an string of at least ${e} and no more than ${t} characters`,$(r=>we(r)&&r.length>=e&&r.length<=t,n)},Or=(e,t=!0)=>$(n=>de(n)&&(n>e||t&&n===e),`a number greater than ${t?"or equal to ":""}${e}`),To=(e,t)=>$(n=>de(n)&&n>=e&&n<=t,`a number between ${e} and ${t} inclusive`),p=Or(0),Ao=Or(0,!1),C=To(0,1),bn=e=>$((t,{options:n})=>!ct(t)||!ct(n[e])||t$((t,{options:n})=>!ct(t)||!ct(n[e])||t<=n[e],`the value to be less than or equal to \`${e}\``),vn=e=>$((t,{options:n})=>!ct(t)||!ct(n[e])||t>n[e],`the value to be greater than \`${e}\``);function x(...e){q(e[0])&&(e=Object.values(e[0]));const t=lt(e,"or",n=>`'${n}'`);return $(n=>e.includes(n),`a keyword such as ${t}`)}function Oo(){return x}var Ge=e=>$(t=>e===t,`the value ${JSON.stringify(e)}`),uc=(e,t)=>$(n=>n instanceof e,t??`an instance of ${e.name}`),X=(e,t,n=!0)=>$((r,i)=>{if(!N(r))return!1;let o=n;const s=[],a=[],l=c=>{o=n?o&&c:o||c};if(r.length===0)return{valid:!0,cleared:s,invalid:a};for(let c=0;c$((n,r)=>{if(!N(n))return!1;const i=[],o=[];for(let s=0;s$((n,r)=>{if(!xe(n))return!1;if(pn in n)return!0;const i=t??e[ce];return{valid:!0,cleared:Object.assign((...s)=>{const a=wr(n,s);if(a==null)return;const l=e(a,{options:a,path:""});if(typeof l=="object"){if(So(l,r,i,a),l.valid)return l.cleared}else{if(l)return a;te(`Callback \`${r.path}\` returned an invalid value \`${_t(a,50)}\`; expecting ${i}, ignoring.`)}},{[pn]:!0}),invalid:[]}},"a function"),wn=(e,t="an object")=>$((n,r)=>{if(!xe(n))return!1;if(pn in n)return!0;const i=t;return{valid:!0,cleared:Object.assign((...s)=>{const a=wr(n,s,r.path);if(a==null)return;const l=Pe(a,e);return So(l,r,i,a),l.cleared},{[pn]:!0}),invalid:[]}},"a function");function xn(e,t){return e.some(n=>n.type==="required"&&n.path===t)}function So(e,t,n,r){if(e.invalid.length!==0){if(N(r)){const i=n??e.invalid[0]?.description??"a valid value";return te(`Callback \`${t.path}\` returned an invalid value \`${_t(r,50)}\`; expecting ${i}, ignoring.`)}for(const i of e.invalid){if(i instanceof xr)return te(`Callback \`${t.path}\` returned an unknown property \`${Pt(i.path,i.key)}\`${i.getPostfix()}`);const o=_t(i.value,50);te(i.key?`Callback \`${t.path}\` returned an invalid property \`${Pt(i.path,i.key)}\`: \`${o}\`; expecting ${i.description}, ignoring.`:`Callback \`${t.path}\` returned an invalid value \`${o}\`; expecting ${n??i.description}, ignoring.`)}}}function Z(e,t,n){return Math.min(n,Math.max(e,t))}function fc(e,t,n=1e-10){return e>=t[0]-n&&e<=t[1]+n}function Sr(e,t,n=1e-10){return e===t||Math.abs(e-t)=1e21){let i;[t,i]=t.split("e"),i!=null&&(n=Number(i))}const r=t.split(".")[1]?.length??0;return Math.max(r-n,0)}var Do=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,Fo=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function ko(e){if(!we(e))return!1;const t=Fo.exec(e);return Do.test(t?t[2]:e)}function Dr(e){let t,n;const r=Fo.exec(e);r&&([,t,e,n]=r);const i=Do.exec(e);if(!i){te(`The number formatter is invalid: ${e}`);return}const[,o,s,a,l,c,u,f,h,d,g]=i;return{fill:o,align:s,sign:a,symbol:l,zero:c,width:Number.parseInt(u),comma:f,precision:Number.parseInt(h),trim:!!d,type:g,prefix:t,suffix:n}}function $o(e){const t=typeof e=="string"?Dr(e):e;if(t==null)return;const{fill:n,align:r,sign:i="-",symbol:o,zero:s,width:a,comma:l,type:c,prefix:u="",suffix:f="",precision:h}=t;let{trim:d}=t;const g=h==null||Number.isNaN(h);let y;if(!c)y=ue.g,d=!0;else if(c in ue&&c in ft)y=g?ft[c]:ue[c];else if(c in ue)y=ue[c];else if(c in ft)y=ft[c];else throw new Error(`The number formatter type is invalid: ${c}`);const v=c?6:12;let w;g||(w=h);let T=r,E=n;return s&&(E??(E="0"),T??(T="=")),(M,B)=>{let I;w!=null?I=w:c==="f"||c==="%"?I=B??v:c?I=v:I=B??v;let S=y(M,I);d&&(S=bc(S)),l&&(S=vc(S,l));const H=Tc(o,c),Ae=H?.length??0;H&&(S=`${H}${S}`),c==="s"&&(S=`${S}${wc(M)}`),(c==="%"||c==="p")&&(S=`${S}%`);const{value:Re,prefixLength:Oe}=xc(M,S,i),Ne=Oe+Ae;let ae=Re;return a!=null&&!Number.isNaN(a)&&(ae=Ec(ae,a,E??" ",T,Ne)),ae=`${u}${ae}${f}`,ae}}var ft={b:e=>En(e).toString(2),c:e=>String.fromCodePoint(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>En(e).toString(8),x:e=>En(e).toString(16),X:e=>ft.x(e).toUpperCase(),n:e=>ft.d(e),"%":e=>`${En(e*100).toFixed(0)}`},ue={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>ue.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>ue.f(e,t).toUpperCase(),g:(e,t)=>{if(e===0)return"0";const n=Math.abs(e),r=Math.floor(Math.log10(n));return r>=-4&&rue.g(e,t).toUpperCase(),n:(e,t)=>ue.g(e,t),p:(e,t)=>ue.r(e*100,t),r:(e,t)=>{if(e===0)return"0";const n=Math.abs(e),i=Math.floor(Math.log10(n))-(t-1);if(i<=0)return n.toFixed(-i);const o=10**i;return(Math.round(n/o)*o).toFixed()},s:(e,t)=>{const n=Io(e);return ue.r(e/10**n,t)},"%":(e,t)=>ue.f(e*100,t)},Lo=-24,Co=24,yc={[Lo]:"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",[Co]:"Y"},mc="\u2212";function En(e){return Math.floor(Math.abs(e))}function bc(e){if(!e.endsWith("0")||!e.includes("."))return e;let t=e.length-1;for(;t>0;)if(e[t]=="0")t-=1;else if(e[t]=="."){t-=1;break}else break;return e.substring(0,t+1)}function vc(e,t){let n=e.indexOf(".");n<0&&(n=e.length);const r=e.substring(0,n).split(""),i=e.substring(n);for(let o=r.length-3;o>0;o-=3)r.splice(o,0,t);return`${r.join("")}${i}`}function wc(e){return yc[Io(e)]}function Io(e){return Z(Lo,e?Math.floor(Math.log10(Math.abs(e))/3)*3:0,Co)}function xc(e,t,n=""){if(n==="(")return e>=0?{value:t,prefixLength:0}:{value:`(${t})`,prefixLength:1};let r="";return e<0?r=mc:n==="+"?r="+":n===" "&&(r=" "),{value:`${r}${t}`,prefixLength:r.length}}function Ec(e,t,n=" ",r=">",i=0){const o=t-e.length;if(o<=0)return e;const s=n.repeat(o);if(r==="="){const a=Math.min(Math.max(i,0),e.length),l=e.slice(0,a),c=e.slice(a);return`${l}${s}${c}`}if(r===">"||!r)return s+e;if(r==="<")return`${e}${s}`;if(r==="^"){const a=Math.ceil(o/2),l=Math.floor(o/2);return`${n.repeat(a)}${e}${n.repeat(l)}`}return s+e}function Tc(e,t){if(e==="#")switch(t){case"b":return"0b";case"o":return"0o";case"x":return"0x";case"X":return"0X";default:return""}return e??""}var Ro=e=>{if(!q(e))return!1;const t=Object.keys(e);return t.length===1&&t[0].startsWith("$")},Ac=z({color:F,stop:C},""),Fr=$(e=>{let t=-1/0;for(const n of e)if(n?.stop!=null){if(n.stop{let n;if(typeof e=="string")Cr.includes(e)?n=!0:(n={valid:!1,invalid:[],cleared:null},n.invalid.push(new _e("invalid",`a legend placement string: ["${Cr.join('", "')}"]`,e,t.path)));else{const{cleared:r,invalid:i}=Pe(e,Ic);n={valid:i.length===0,cleared:r,invalid:i}}return n},"a legend position object or placement string"),ht=G(x("circle","cross","diamond","heart","plus","pin","square","star","triangle"),R),zo=x("never","always","hyphenate","on-space"),On=x("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),Sn=G(p,x("exact","nearest","area")),qo=G(p,x("exact","nearest")),dt=G(O,m,ut,Se({text:A(O),...ie},"text segments array")),Bt={enabled:b,text:dt,textAlign:x("left","center","right"),wrapping:x("never","always","hyphenate","on-space"),spacing:p,maxWidth:p,maxHeight:p,...ie};Bt.padding=D(p),Bt.truncate=D(b);var Mn={enabled:b,text:dt,renderer:Ue(G(O,Eo))},Rr=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],Ko={type:x("action","separator"),showOn:x("always","series-area","series-node","legend-item"),label:A(O),enabled:b,action:R,items:(e,t)=>Yo(e,t)};Ko.iconUrl=D(O);var Rc=z(Ko),Nc=$((e,t)=>{let n;return typeof e=="string"?Rr.includes(e)?n=!0:(n={valid:!1,invalid:[],cleared:null},n.invalid.push(new _e("invalid",`a context menu item string alias: ["${Rr.join('", "')}"]`,e,t.path))):n=Rc(e,t),n},`a context menu item object or string alias: [${Rr.join(", ")}]`),Yo=X(Nc,"a menu items array",!1),Xo={label:O,ariaLabel:O,tooltip:O,iconPosition:x("before","after"),icon:x("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","chevron-filled-down","chevron-right","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")},pe=G(O,Ue(dt)),Jo=z({x:pe,y:pe,angle:pe,radius:pe,size:pe,color:pe,label:pe,secondaryLabel:pe,sectorLabel:pe,calloutLabel:pe,legendItem:pe}),jt=$(ko,"a valid number format string"),Nr=x("millisecond","second","minute","hour","day","month","year"),Qo={unit:A(Nr),step:Ao,epoch:ut,utc:b};Qo.every=R;var Zo=z(Qo,"a time interval object"),ye={width:p,height:p,minWidth:p,minHeight:p,suppressFieldDotNotation:b,title:Bt,subtitle:Bt,footnote:Bt,padding:{top:p,right:p,bottom:p,left:p},seriesArea:{border:Ut,clip:b,cornerRadius:m,padding:Me},legend:{enabled:b,position:Ir,orientation:x("horizontal","vertical"),maxWidth:p,maxHeight:p,spacing:p,border:Ut,cornerRadius:m,padding:Me,fill:An,fillOpacity:C,preventHidingAll:b,reverseOrder:b,toggleSeries:b,item:{marker:{size:p,shape:ht,padding:p,strokeWidth:p},line:{length:p,strokeWidth:p},label:{maxLength:p,formatter:R,...ie},maxWidth:p,paddingX:p,paddingY:p,showSeriesStroke:b},pagination:{marker:{size:p,shape:ht,padding:p},activeStyle:{...U,...k},inactiveStyle:{...U,...k},highlightStyle:{...U,...k},label:ie},listeners:{legendItemClick:R,legendItemDoubleClick:R}},gradientLegend:{enabled:b,position:Ir,spacing:p,reverseOrder:b,border:Ut,cornerRadius:m,padding:Me,fill:An,fillOpacity:C,gradient:{preferredLength:p,thickness:p},scale:{label:{...ie,minSpacing:p,format:jt,formatter:R},padding:p,interval:{step:m,values:Tr,minSpacing:ge(p,bn("maxSpacing")),maxSpacing:ge(p,vn("minSpacing"))}}},listeners:{seriesNodeClick:R,seriesNodeDoubleClick:R,seriesVisibilityChange:R,activeChange:R,click:R,doubleClick:R,annotations:R,zoom:R},loadGoogleFonts:b,highlight:{drawingMode:x("overlay","cutout"),range:x("tooltip","node")},overlays:{loading:Mn,noData:Mn,noVisibleSeries:Mn,unsupportedBrowser:Mn},tooltip:{enabled:b,showArrow:b,pagination:b,delay:p,range:Sn,wrapping:zo,mode:x("single","shared","compact"),position:{anchorTo:x("pointer","node","chart"),placement:G(On,X(On)),xOffset:m,yOffset:m}},animation:ne,flashOnUpdate:ne,contextMenu:ne,context:()=>!0,dataSource:{getData:R},keyboard:{enabled:b,tabIndex:m,initialFocus:Oo()("data-start","data-end","viewport-start","viewport-end")},touch:{dragAction:x("none","drag","hover")},ranges:{enabled:b,enableOutOfRange:b,position:x("top-left","top","top-right","bottom-left","bottom","bottom-right"),spacing:p,button:{...re,...k,textColor:F,...ie,cornerRadius:p,padding:Me,active:{...re,stroke:k.stroke,textColor:F},disabled:{...re,stroke:k.stroke,textColor:F},hover:{...re,stroke:k.stroke,textColor:F}},dropdown:{visible:x("auto","always","never"),...re,...k,textColor:F,...ie,cornerRadius:p,padding:Me,active:{...re,stroke:k.stroke,textColor:F},disabled:{...re,stroke:k.stroke,textColor:F},hover:{...re,stroke:k.stroke,textColor:F}},gap:p,...re,...k,textColor:F,...ie,cornerRadius:p,padding:Me,active:{...re,stroke:k.stroke,textColor:F},disabled:{...re,stroke:k.stroke,textColor:F},hover:{...re,stroke:k.stroke,textColor:F},buttons:Se({...Xo,enabled:b,value:G(m,ge(X(G(m,ut)),Gt(2,2)),Zo,Nr,R)},"range button options array")},locale:{localeText:xo,getLocaleText:Ue(O)},background:{visible:b,fill:F,image:{url:A(O),top:m,right:m,bottom:m,left:m,width:p,height:p,opacity:C}},styleNonce:O,sync:ne,zoom:ne,scrollbar:ne,formatter:G(Ue(dt),Jo),enableRtl:b};ye.highlight.enabled=D(b),ye.dataSource.requestThrottle=D(p),ye.dataSource.updateThrottle=D(p),ye.dataSource.updateDuringInteraction=D(b),ye.statusBar=D(ne),ye.ranges.minSize=D(p),ye.foreground=D({visible:b,text:O,image:{url:O,top:m,right:m,bottom:m,left:m,width:p,height:p,opacity:C},...U}),ye.overrideDevicePixelRatio=D(m),ye.sync.domainMode=D(x("direction","position","key")),ye.displayNullData=D(b);var Ht={cursor:O,context:()=>!0,showInLegend:b,nodeClickRange:Sn,listeners:{seriesNodeClick:R,seriesNodeDoubleClick:R},highlight:Uo(Go)};Ht.allowNullKeys=D(b);var Dn={...Ht,id:O,visible:b,context:()=>!0,data:Tr};Dn.seriesGrouping=D(ne);var es={shape:ht,size:p,...U,...k,...j},_c={enabled:b,itemStyler:wn({...U,...k,...j,shape:ht,size:p}),...es},Wt={enabled:b,formatter:Ue(dt),format:jt,itemStyler:wn({enabled:b,...Lr,...ie}),...Lr,...ie},Fn={...Wt,lineHeight:p,minimumFontSize:p,wrapping:zo,overflowStrategy:x("ellipsis","hide")},ts={visible:b,cap:{visible:b,length:p,lengthRatio:C,...k,...j},...k,...j},Pc={...ts,xLowerKey:O,xUpperKey:O,yLowerKey:O,yUpperKey:O,xLowerName:O,xUpperName:O,yLowerName:O,yUpperName:O,itemStyler:wn({visible:b,...k,...j,cap:{visible:b,length:p,lengthRatio:C,...k,...j}})},kn={enabled:b,showArrow:b,range:qo,renderer:Ue(G(O,m,ut,z({heading:O,title:O,symbol:{marker:{enabled:b,shape:ht,...U,stroke:F,strokeOpacity:C,strokeWidth:p,...j},line:{enabled:b,stroke:F,strokeWidth:p,strokeOpacity:C,...j}},data:Se({label:A(O),value:A(G(O,m,ut))})},"tooltip renderer result object"))),position:{anchorTo:x("node","pointer","chart"),placement:G(On,X(On)),xOffset:m,yOffset:m},interaction:{enabled:b}},Gc={...kn,range:Sn},Uc={enabled:b,xOffset:m,yOffset:m,blur:p,color:F},Bc=Er({linear:{},smooth:{tension:C},step:{position:x("start","middle","end")}},"interpolation line options"),$n=Symbol("BREAK"),Vt="__decorator_config",Ln="__decorator_accessors";function oe(e,t){_r(e,t).optional=!0}function _r(e,t){if(Object.getOwnPropertyDescriptor(e,Vt)==null&&Object.defineProperty(e,Vt,{value:{}}),Object.getOwnPropertyDescriptor(e,Ln)==null){const u=Object.getPrototypeOf(e)?.[Ln]?.slice()??[];Object.defineProperty(e,Ln,{value:u})}const n=e[Vt],r=t.toString();if(n[r]!=null)return n[r];n[r]={setters:[],getters:[],observers:[]};const i=Object.getOwnPropertyDescriptor(e,t);let o=i?.get,s=i?.set;if(o==null||s==null){const c=e[Ln];let u=c.indexOf(t);u===-1&&(u=c.push(t)-1),o??(o=function(){let f=this.__accessors;return f==null&&(f=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:f})),f[u]}),s??(s=function(f){let h=this.__accessors;h==null&&(h=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:h})),h[u]=f})}return Object.defineProperty(e,t,{set:function(c){const{setters:u,observers:f}=n[r];let h;u.some(d=>d.length>2)&&(h=o.call(this));for(const d of u)if(c=d(this,t,c,h),c===$n)return;s.call(this,c);for(const d of f)d(this,c,h)},get:function(){let c=o.call(this);for(const u of n[r].getters)if(c=u(this,t,c),c===$n)return;return c},enumerable:!0,configurable:!1}),n[r]}function De(e,t,n){return(r,i)=>{const o=_r(r,i);o.setters.push(e),t&&o.getters.unshift(t),n&&Object.assign(o,n)}}function Pr(e){return(t,n)=>{_r(t,n).observers.push(e)}}function Cn(e){return e!==void 0&&Vt in e}function Fe(e){const t=new Set;for(;Cn(e);)t.add(e?.[Vt]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(n=>Object.keys(n))}function ns(e){return Fe(e).reduce((t,n)=>(t[String(n)]=e[n]??null,t),{})}function*jc(...e){for(const t of e)t!=null&&(t[Symbol.iterator]?yield*t:yield t)}function Hc(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e?e:[e]}function Wc(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*zt(e){const t=[void 0,void 0];for(const n of Object.keys(e))t[0]=n,t[1]=e[n],yield t}function Vc(e){return Object.keys(e)}function Gr(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>Gr(n,t[r])):V(e)?V(t)?rs(e,t,Gr):!1:e===t}function rs(e,t,n){if(Object.is(e,t))return!0;for(const r of Object.keys(t))if(!(r in e))return!1;for(const r of Object.keys(e))if(!(r in t)||!n(e[r],t[r]))return!1;return!0}function Ur(...e){const t={};for(const n of e){if(!q(n))continue;const r=Cn(n)?Fe(n):Object.keys(n);for(const i of r)V(t[i])&&V(n[i])?t[i]=Ur(t[i],n[i]):t[i]??(t[i]=n[i])}return t}function Br(...e){const t={};for(const n of e){if(!q(n))continue;const r=Cn(n)?Fe(n):Object.keys(n);for(const i of r)V(t[i])&&V(n[i])?t[i]=Br(t[i],n[i]):i in t||(t[i]??(t[i]=n[i]))}return t}function zc(e,...t){return t&&N(e)?e.map(n=>Ur(n,...t)):e}function is(e,t){const n={};for(const[r,i]of zt(e))n[r]=t(i,r,e);return n}function qt(e,t){const n={...e};for(const r of t)delete n[r];return n}function qc(e,t){if(e==null)return;const n={};for(const r of t)Object.hasOwn(e,r)&&(n[r]=e[r]);return n}function Kc(e,t){if(e==null)return!0;for(const[n,r]of zt(e))if(!t(n,r))return!1;return!0}function Yc(e){const t={};if(e==null)return t;for(const[n,r]of e)t[n]=r;return t}function jr(e,t){return(N(t)?t:t.split(".")).reduce((r,i)=>r[i],e)}var Hr=new Set(["__proto__","constructor","prototype"]);function Wr(e,t,n){const r=N(t)?t.slice():t.split("."),i=r.pop();if(r.some(s=>Hr.has(s)))return;const o=r.reduce((s,a)=>s[a],e);return o[i]=n,o[i]}function Xc(e,t,n){if(n===void 0)return t;for(const r of e){const i=n[r];i!==void 0&&(t[r]=i)}return t}function Jc(e,t,n){const r=n??Object.keys(t);for(let i=0,o=r.length;i(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))(cs||{}),je=12,Zc={SMALLEST:8/je,SMALLER:10/je,SMALL:12/je,MEDIUM:13/je,LARGE:14/je,LARGEST:17/je},us=(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))(us||{}),fs=(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))(fs||{}),hs=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(hs||{}),ds=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(ds||{}),He=(e,t,n)=>e*(1-n)+t*n,qr=e=>{const t=e<0?-1:1,n=Math.abs(e);return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4},Kr=e=>{const t=e<0?-1:1,n=Math.abs(e);return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e},gs=class L{constructor(t,n,r,i=1){this.r=Z(0,t||0,1),this.g=Z(0,n||0,1),this.b=Z(0,r||0,1),this.a=Z(0,i||0,1)}static validColorString(t){return t.includes("#")?!!L.parseHex(t):t.includes("rgb")?!!L.stringToRgba(t):L.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.includes("#"))return L.fromHexString(t);const n=L.nameToHex.get(t.toLowerCase());if(n)return L.fromHexString(n);if(t.includes("rgb"))return L.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(t){t=t.replaceAll(" ","").slice(1);let n;switch(t.length){case 6:case 8:n=[];for(let r=0;rNumber.parseInt(r,16)).map(r=>r+r*16);break}if(n?.length>=3&&n.every(r=>r>=0))return n.length===3&&n.push(255),n}static fromHexString(t){const n=L.parseHex(t);if(n){const[r,i,o,s]=n;return new L(r/255,i/255,o/255,s/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let n=-1,r=-1;for(let a=0;a=0?d:d+360;return[g,y,v]}static OKLCHtoRGB(t,n,r){const i=t,o=n*Math.cos(r*Math.PI/180),s=n*Math.sin(r*Math.PI/180),a=(i+.3963377774*o+.2158037573*s)**3,l=(i-.1055613458*o-.0638541728*s)**3,c=(i-.0894841775*o-1.291485548*s)**3,u=4.0767416621*a-3.3077115913*l+.2309699292*c,f=-1.2684380046*a+2.6097574011*l-.3413193965*c,h=-.0041960863*a-.7034186147*l+1.707614701*c,d=Kr(u),g=Kr(f),y=Kr(h);return[d,g,y]}static RGBtoHSL(t,n,r){const i=Math.min(t,n,r),o=Math.max(t,n,r),s=(o+i)/2;let a,l;if(o===i)a=0,l=0;else{const c=o-i;l=s>.5?c/(2-o-i):c/(o+i),o===t?a=(n-r)/c+(n1&&(u-=1),u<1/6?o+(i-o)*6*u:u<1/2?i:u<2/3?o+(i-o)*(2/3-u)*6:o}const a=s(t/360+1/3),l=s(t/360),c=s(t/360-1/3);return[a,l,c]}static RGBtoHSB(t,n,r){const i=Math.min(t,n,r),o=Math.max(t,n,r),s=o===0?0:(o-i)/o;let a=0;if(i!==o){const l=o-i,c=(o-t)/l,u=(o-n)/l,f=(o-r)/l;t===o?a=f-u:n===o?a=2+c-f:a=4+u-c,a/=6,a<0&&(a=a+1)}return[a*360,s,o]}static HSBtoRGB(t,n,r){t=(t%360+360)%360/360;let i=0,o=0,s=0;if(n===0)i=o=s=r;else{const a=(t-Math.floor(t))*6,l=a-Math.floor(a),c=r*(1-n),u=r*(1-n*l),f=r*(1-n*(1-l));switch(Math.trunc(a)){case 0:i=r,o=f,s=c;break;case 1:i=u,o=r,s=c;break;case 2:i=c,o=r,s=f;break;case 3:i=c,o=u,s=r;break;case 4:i=f,o=c,s=r;break;case 5:i=r,o=c,s=u;break}}return[i,o,s]}static mix(t,n,r){return new L(He(t.r,n.r,r),He(t.g,n.g,r),He(t.b,n.b,r),He(t.a,n.a,r))}static lighten(t,n){const r=L.RGBtoOKLCH(t.r,t.g,t.b);return L.fromOKLCH(Z(0,r[0]+n,1),r[1],r[2])}static darken(t,n){const r=L.RGBtoOKLCH(t.r,t.g,t.b);return L.fromOKLCH(Z(0,r[0]-n,1),r[1],r[2])}static interpolate(t,n){const r=1/(t.length-1),i=t.map(o=>L.RGBtoOKLCH(o.r,o.g,o.b));return Array.from({length:n},(o,s)=>{const a=s/(n-1),l=t.length<=2?0:Math.min(Math.floor(a*(t.length-1)),t.length-2),c=(a-l*r)/r,u=i[l],f=i[l+1];return L.fromOKLCH(He(u[0],f[0],c),He(u[1],f[1],c),He(u[2],f[2],c))})}};gs.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 Nn=gs,eu={x:{position:"bottom",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"number","category"]}},y:{position:"left",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"category","number"]}}},tu={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},nu={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},ps={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},ru={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},iu={type:"gradient",gradient:"linear",bounds:"item",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},Kt={type:"gradient",gradient:"linear",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},ou={...Kt,colorStops:{$shallow:[{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]}},{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}}]}},su={...Kt,colorStops:{$map:[{color:{$value:"$1"}},{$path:["/0",void 0,{$palette:"gradients"}]}]}},au=e=>({...Kt,colorStops:{$shallow:{$if:[{$or:[{$isGradient:{$palette:`${e}.fill`}},{$isPattern:{$palette:`${e}.fill`}},{$isImage:{$palette:`${e}.fill`}}]},{$path:["/colorStops",void 0,{$palette:`${e}.fill`}]},[{color:{$mix:[{$palette:`${e}.fill`},"black",.15]}},{color:{$mix:[{$palette:`${e}.fill`},"white",.15]}}]]}}}),_n={type:"gradient",gradient:"radial",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},lu={..._n,reverse:!0},cu={..._n,bounds:"series"},uu={..._n,bounds:"series",reverse:!0},fu={type:"gradient",gradient:"conic",bounds:"series",colorStops:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]},rotation:0,reverse:!1,colorSpace:"rgb"},Yt={type:"pattern",pattern:"forward-slanted-lines",width:{$isUserOption:["./height",{$path:"./height"},10]},height:{$isUserOption:["./width",{$path:"./width"},10]},padding:2,fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:ps,strokeOpacity:1,strokeWidth:{$switch:[{$path:"./pattern"},0,[["backward-slanted-lines","forward-slanted-lines","horizontal-lines","vertical-lines"],4]]},backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},hu={...Yt,stroke:{$if:[{$isGradient:{$palette:"fill"}},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]},fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]}},du={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},gu={...Yt,fill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},pu=e=>({...Yt,stroke:{$if:[{$isGradient:{$palette:`${e}.fill`}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:`${e}.fill`}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:`${e}.fill`}]},{$palette:`${e}.fill`}]}]}}),ys={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0},yu={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8};function mu(e){return is(e,t=>{const n=Nn.fromString(t);return[Nn.darken(n,.15).toString(),t,Nn.lighten(n,.15).toString()]})}var bu={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}}},Pn={$isUserOption:["/highlight/enabled",{$path:"/highlight/enabled"},!0]},vu={enabled:Pn,unhighlightedItem:{opacity:.6},unhighlightedSeries:{opacity:.2}},wu={enabled:Pn,unhighlightedSeries:{opacity:.2}},xu={enabled:Pn,unhighlightedItem:{opacity:.2},unhighlightedSeries:{opacity:.2}},Eu={enabled:Pn,unhighlightedItem:{opacity:.2}},Tu={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]}]}},Au={enabled:!1,key:"x",segments:{$apply:{fill:{$applySwitch:[{$path:"type"},{$path:"../../../fill"},["gradient",Kt],["image",ys],["pattern",Yt]]},stroke:{$path:"../../../stroke"},fillOpacity:{$path:"../../../fillOpacity"},strokeWidth:{$isUserOption:["./stroke",{$isUserOption:["../../../strokeWidth",{$path:"../../../strokeWidth"},{$if:[{$greaterThan:[{$path:"../../../strokeWidth"},0]},{$path:"../../../strokeWidth"},2]}]},{$path:"../../../strokeWidth"}]},strokeOpacity:{$path:"../../../strokeOpacity"},lineDash:{$path:"../../../lineDash"},lineDashOffset:{$path:"../../../lineDashOffset"}}}},Ou=class Ni{constructor(t){this.version=t.split("-")[0]}save(...t){const n={version:this.version};for(const r of Object.values(t))n[r.mementoOriginatorKey]=this.encode(r,r.createMemento());return n}restore(t,...n){if(!q(t)){te(`Could not restore data of type [${t===null?"null":typeof t}], expecting an object, ignoring.`);return}if(!("version"in t)||typeof t.version!="string"){te("Could not restore data, missing [version] string in object, ignoring.");return}for(const r of n){const i=this.decode(r,t[r.mementoOriginatorKey]),o=[];if(!r.guardMemento(i,o)){let s=`Could not restore [${r.mementoOriginatorKey}] data, value was invalid, ignoring.`;o.length>0&&(s+=` ${o.join(` `)} `),te(s,i);return}r.restoreMemento(this.version,t.version,i)}}encode(t,n){try{return JSON.parse(JSON.stringify(n,Ni.encodeTypes))}catch(r){throw new Error(`Failed to encode [${t.mementoOriginatorKey}] value [${r}].`,{cause:r})}}decode(t,n){if(n==null)return n;try{return JSON.parse(JSON.stringify(n),Ni.decodeTypes)}catch(r){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${r}].`,{cause:r})}}static encodeTypes(t,n){return st(this[t])?{__type:"date",value:this[t].toISOString()}:n}static decodeTypes(t,n){return q(this[t])&&"__type"in this[t]&&this[t].__type==="date"?new Date(this[t].value):n}},ms=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))(ms||{}),bs=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",e[e.PROCESS_RANGE=4]="PROCESS_RANGE",e[e.PERFORM_LAYOUT=5]="PERFORM_LAYOUT",e[e.PRE_SERIES_UPDATE=6]="PRE_SERIES_UPDATE",e[e.SERIES_UPDATE=7]="SERIES_UPDATE",e[e.PRE_SCENE_RENDER=8]="PRE_SCENE_RENDER",e[e.SCENE_RENDER=9]="SCENE_RENDER",e[e.NONE=10]="NONE",e))(bs||{}),vs=(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))(vs||{}),ws=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(ws||{}),xs=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(xs||{}),Es=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(Es||{});function Su(e){const{placement:t="bottom",floating:n=!1,xOffset:r=0,yOffset:i=0}=typeof e=="string"?{placement:e,floating:!1}:e;return{placement:t,floating:n,xOffset:r,yOffset:i}}var gt=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 be(`unable to set ${t} - expecting a properties object`),this;const n=new Set(Object.keys(e));for(const r of Fe(this))if(n.has(r)){const i=e[r],o=this;if(pt(o[r]))if(o[r]instanceof Yr){const s=o[r].reset(i);s==null?be(`unable to set [${String(r)}] - expecting a properties array`):o[r]=s}else o[r].set(i);else V(i)?o[r]=Br(i,o[r]??{}):o[r]=i;n.delete(r)}this.handleUnknownProperties(n,e);for(const r of n)be(`unable to set [${String(r)}] in ${t} - property is unknown`);return this}clear(){for(const e of Fe(this)){const t=this[e];pt(t)?t.clear():this[e]=void 0}return this}toJson(){return Fe(this).reduce((e,t)=>{const n=this[t];return e[String(t)]=pt(n)?n.toJson():n,e},{})}},Yr=class Ba extends Array{constructor(t,...n){super(n.length);const i=(o=>!!o?.prototype?.constructor?.name)(t)?o=>new t().set(o):t;Object.defineProperty(this,"itemFactory",{value:i,enumerable:!1,configurable:!1}),this.set(n)}set(t){if(N(t)){this.length=t.length;for(let n=0;nt?.toJson?.()??t)}};function pt(e){return e instanceof gt||e instanceof Yr}var Gn=class extends gt{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};he([oe],Gn.prototype,"type",2),he([oe],Gn.prototype,"tension",2),he([oe],Gn.prototype,"position",2);function Mu(e,t){const[n,r]=Un(t);return Z(n,e,r)}function Un(e){if(e.length===0)return[];const t=[1/0,-1/0];for(const n of e)nt[1]&&(t[1]=n);return t}function Du(e){const[t,n]=Un(e);return n-t}function Xr(e){return e=Math.trunc(e),e<=0?1:e===1?2:1<<32-Math.clz32(e-1)}function Fu(e){return e=Math.trunc(e),e<=0?0:e===1?1:1<<31-Math.clz32(e)}var Te=0,ke=1,We=2,Ve=3,ze=4,Jr=1e3,ku=10,Bn=64,jn=4294967295,$u=3,Lu=20,Qr=100;function Zr(e,t,n,r,i,o,s,a){let l=0;for(;lr;)i-=1,l+=1;if(l>=Qr||r>=i)return o;const c=Number.isFinite(t)?Wn(e[i],t,n,a)-Wn(e[r],t,n,a):Hn(i,e.length)-Hn(r,e.length);if(c===0||!Number.isFinite(c))return o;const u=Math.abs(c)/(i-r);let f;if(s<$u?f=!0:s>Lu?f=!1:f=u<=o,o=Math.min(o,u),!f)return o;const h=Math.floor((r+i)/2),d=Zr(e,t,n,r,h,o,s+1,a),g=Zr(e,t,n,h+1,i,o,s+1,a);return Math.min(d,g,o)}function Cu(e,t,n,r){return Zr(e,t,n,0,e.length-1,1/(e.length-1),0,r)}function ei(e,t,n,r){if(Number.isFinite(t)){const i=r?.smallestKeyInterval,o=r?.xNeedsValueOf??!0,s=i==null?Cu(e,t,n,o):i/(n-t);return Xr(Math.trunc(1/s))>>3}else{let i=Math.ceil(Math.log2(e.length))-1;return i=Math.min(Math.max(i,0),24),Math.trunc(2**i)}}function Iu(e,t){const{domain:n,sortMetadata:r}=t;switch(e){case"category":return[Number.NaN,Number.NaN];case"number":case"time":case"ordinal-time":case"unit-time":{if(n.length===0)return[1/0,-1/0];if(r?.sortOrder===1)return[Number(n[0]),Number(n.at(-1))];if(r?.sortOrder===-1)return[Number(n.at(-1)),Number(n[0])];let i=1/0,o=-1/0;for(const s of n){const a=Number(s);i=Math.min(i,a),o=Math.max(o,a)}return[i,o]}case"color":case"log":case"mercator":return[0,0]}}function Hn(e,t){return e/t}function Wn(e,t,n,r){return r?(e.valueOf()-t)/(n-t):(e-t)/(n-t)}function Ts(e,t){return Math.trunc(Math.min(Math.floor(e*t),t-1)*ze)}function Ru(e,t,n,r,i,{xNeedsValueOf:o=!0,xValuesLength:s}={}){const a=e[i];if(a==null)return-1;const l=s??e.length,c=Number.isFinite(t)?Wn(a,t,n,o):Hn(i,l);return Ts(c,r)}function Nu(e,t,n,r){for(const i of r)if(n===e[t+i])return!0;return!1}function ti(e,t,n,r,i,o,{positive:s,split:a=!1,xNeedsValueOf:l=!0,yNeedsValueOf:c=!0,reuseIndexData:u,reuseValueData:f,reuseNegativeIndexData:h,reuseNegativeValueData:d}={}){const g=Number.NaN,y=o*ze,v=u?.length===y?u:new Uint32Array(y),w=f?.length===y?f:new Float64Array(y);let T,E;a&&(h?.length===y?T=h:T=new Uint32Array(y),d?.length===y?E=d:E=new Float64Array(y));const M=Number.isFinite(r)&&Number.isFinite(i),B=e.length;M&&(w.fill(g),v.fill(jn),a&&(E.fill(g),T.fill(jn)));const I=M?o/(i-r):o*(1/B);let S=-1,H=-1,Ae=g,Re=-1,Oe=g,Ne=-1,ae=g,Ot=-1,Xe=g,W=-1,Je=-1,Qe=g,St=-1,Ze=g,Mt=-1,et=g,Dt=-1,tt=g;const ja=e.length,Ha=t===n;for(let P=0;P=0;else if(s!=null&&J>=0!==s)continue;let Y;M?l?Y=(lr.valueOf()-r)*I:Y=(lr-r)*I:Y=P*I;const Pi=Math.floor(Y),an=(PiOe&&(Re=P,Oe=Y),Ft&&leXe&&(Ot=P,Xe=J))}else{an!==W&&(W!==-1&&(T[W]=Je,T[W+1]=St,T[W+2]=Mt,T[W+3]=Dt,E[W]=Qe,E[W+1]=Ze,E[W+2]=et,E[W+3]=tt),W=an,Je=-1,Qe=g,St=-1,Ze=g,Mt=-1,et=g,Dt=-1,tt=g);const Ft=le===le,kt=J===J;Je===-1?(Je=P,Qe=Y,St=P,Ze=Y,Ft&&(Mt=P,et=le),kt&&(Dt=P,tt=J)):(YZe&&(St=P,Ze=Y),Ft&&lett&&(Dt=P,tt=J))}}return S!==-1&&(v[S]=H,v[S+1]=Re,v[S+2]=Ne,v[S+3]=Ot,w[S]=Ae,w[S+1]=Oe,w[S+2]=ae,w[S+3]=Xe),a&&W!==-1&&(T[W]=Je,T[W+1]=St,T[W+2]=Mt,T[W+3]=Dt,E[W]=Qe,E[W+1]=Ze,E[W+2]=et,E[W+3]=tt),{indexData:v,valueData:w,negativeIndexData:T,negativeValueData:E}}function ni(e,t,n,{inPlace:r=!1,midpointData:i,reuseIndexData:o,reuseValueData:s}={}){const a=Math.trunc(n/2),l=a*ze;let c;r?c=e:o?.length===l?c=o:c=new Uint32Array(l);let u;r?u=t:s?.length===l?u=s:u=new Float64Array(l);const f=i??new Uint32Array(a);for(let h=0;ht[y+ke]?g:y,M=e[E+ke];c[d+ke]=M,u[d+ke]=t[E+ke],f[h]=T+M>>1;const B=v||t[g+We]t[y+Ve]?g:y;c[d+Ve]=e[I+Ve],u[d+Ve]=t[I+Ve]}return{maxRange:a,indexData:c,valueData:u,midpointData:f}}function Vn(e,t,n,r=Te,i=ke,o=-1){const s=n?.length===e?n:new Uint32Array(e);for(let a=0,l=0;a>1}return s}function _u(e,{collectLevel:t,shouldContinue:n,minRange:r=Bn,compactInPlace:i=!1}){let o=e,s=t(o);const a=[s];for(;o.maxRange>r&&n(s,o);){const l=ni(o.indexData,o.valueData,o.maxRange,{inPlace:i});o={maxRange:l.maxRange,indexData:l.indexData,valueData:l.valueData,midpointData:l.midpointData},s=t(o),a.push(s)}return a.reverse(),a}function As(e,t,n,r,i){if(t.lengthw.maxRange===f);let{indexData:d,valueData:g}=ti(t,n,r,o,s,f,{xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:h?.indexData,reuseValueData:h?.valueData}),y=Vn(f,d,h?.midpointIndices);const v=[{maxRange:f,indexData:d,valueData:g,midpointIndices:y}];for(;f>Bn;){const w=f,T=Math.trunc(w/2),E=u?.find(B=>B.maxRange===T),M=ni(d,g,w,{reuseIndexData:E?.indexData,reuseValueData:E?.valueData});f=M.maxRange,d=M.indexData,g=M.valueData,y=M.midpointData??Vn(f,d,E?.midpointIndices),v.push({maxRange:f,indexData:d,valueData:g,midpointIndices:y})}return v.reverse(),v}function Pu(e,t,n,r,i){if(t.lengthM.maxRange===d),{indexData:y,valueData:v}=ti(t,n,r,o,s,d,{xNeedsValueOf:c,yNeedsValueOf:u,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),w=Vn(d,y,g?.midpointIndices),T={maxRange:d,indexData:y,valueData:v,midpointIndices:w};function E(){return As([o,s],t,n,r,{smallestKeyInterval:a,xNeedsValueOf:c,yNeedsValueOf:u,existingFilters:f})?.filter(B=>B.maxRange!==d)??[]}return{immediate:[T],computeRemaining:E}}var Gu=Symbol("is-dark-theme"),Uu=Symbol("default-shadow-colour"),Bu=Symbol("default-caption-layout-style"),ju=Symbol("default-caption-alignment"),Hu=Symbol("palette-up-stroke"),Wu=Symbol("palette-down-stroke"),Vu=Symbol("palette-up-fill"),zu=Symbol("palette-down-fill"),qu=Symbol("palette-neutral-stroke"),Ku=Symbol("palette-neutral-fill"),Yu=Symbol("palette-alt-up-stroke"),Xu=Symbol("palette-alt-down-stroke"),Ju=Symbol("palette-alt-up-fill"),Qu=Symbol("palette-alt-down-fill"),Zu=Symbol("palette-gray-fill"),ef=Symbol("palette-gray-stroke"),tf=Symbol("default-polar-series-stroke"),nf=Symbol("default-sparkline-crosshair-stroke"),rf=Symbol("default-financial-charts-annotation-stroke"),of=Symbol("default-hierarchy-strokes"),sf=Symbol("default-text-annotation-color"),af=Symbol("default-financial-charts-annotation-background-fill"),lf=Symbol("default-annotation-handle-fill"),cf=Symbol("default-annotation-statistics-fill"),uf=Symbol("default-annotation-statistics-stroke"),ff=Symbol("default-annotation-statistics-color"),hf=Symbol("default-annotation-statistics-divider-stroke"),df=Symbol("default-annotation-statistics-fill"),gf=Symbol("default-annotation-statistics-stroke"),pf=Symbol("default-textbox-fill"),yf=Symbol("default-textbox-stroke"),mf=Symbol("default-textbox-color"),bf=Symbol("default-toolbar-position");function vf(e,t){return"context"in e}function Os(e,t){return e!=null&&vf(e,t)&&t!=null&&typeof t=="object"&&t.context===void 0?(t.context=e.context,!0):!1}function Ss(e,t,n){if(Array.isArray(e)){for(const r of e)if(Os(r,n))break}else Os(e,n);return t(n)}var wf=class{constructor(){this.cache=new WeakMap}call(e,t,n){let r,i=this.cache.get(t);try{r=JSON.stringify(n)}catch{return this.invoke(e,t,i,void 0,n)}return i==null&&(i=new Map,this.cache.set(t,i)),i.has(r)?i.get(r):this.invoke(e,t,i,r,n)}invoke(e,t,n,r,i){try{const o=Ss(e,t,i);return n&&r!=null&&n.set(r,o),o}catch(o){te("User callback errored, ignoring",o);return}}invalidateCache(){this.cache=new WeakMap}},xf=class{constructor(e,t=e.defaultView){this.fallbackDocument=e,this.fallbackWindow=t,this.windowEvents=new Map}destroy(){this.removeWindowEvents(),this.container=void 0,this.cachedDocument=void 0,this.cachedWindow=void 0,this.windowEvents.clear()}get document(){return this.cachedDocument??this.fallbackDocument}get window(){return this.cachedWindow??this.fallbackWindow}getContainer(){return this.container}setContainer(e){if(this.container=e,e==null)return;const t=e.ownerDocument,n=t.defaultView??void 0,r=t!==this.document;r&&this.removeWindowEvents(),this.cachedDocument=t,this.cachedWindow=n,r&&this.reattachWindowEvents()}removeWindowEvents(){for(const[e,t]of this.windowEvents)for(const{listener:n,options:r}of t)this.window.removeEventListener(e,n,r)}reattachWindowEvents(){for(const[e,t]of this.windowEvents)for(const{listener:n,options:r}of t)this.window.addEventListener(e,n,r)}get devicePixelRatio(){return this.window.devicePixelRatio}get innerWidth(){return this.window.innerWidth}get innerHeight(){return this.window.innerHeight}get navigator(){return this.window.navigator}getComputedStyle(e,t){return this.window.getComputedStyle(e,t)}matchMedia(e){return this.window.matchMedia?.(e)}getSelection(){return this.window.getSelection()}requestAnimationFrame(e){return this.window.requestAnimationFrame(e)}cancelAnimationFrame(e){this.window.cancelAnimationFrame(e)}shimIdleCallback(e,t){return setTimeout(()=>e(null),t?.timeout)}requestIdleCallback(e,t){return typeof this.window.requestIdleCallback=="function"?this.window.requestIdleCallback(e,t):this.shimIdleCallback(e,t)}cancelIdleCallback(e){return typeof this.window.cancelIdleCallback=="function"?this.window.cancelIdleCallback(e):clearTimeout(e)}attachListener(e,t,n){let r=this.windowEvents.get(e);r==null&&(r=new Set,this.windowEvents.set(e,r));const i=()=>{r?.delete(s),r?.size===0&&this.windowEvents.delete(e)},o=q(n)&&n.once?a=>{i(),t(a)}:t,s={listener:o,options:n};return r.add(s),this.window.addEventListener(e,o,n),()=>{i(),this.window.removeEventListener(e,o,n)}}get body(){return this.document.body}get head(){return this.document.head}isReady(){return this.document.readyState==="complete"}createElement(e,t,n){const r=this.document.createElement(e);if(typeof t=="object"&&(n=t,t=void 0),t)for(const i of t.split(" "))r.classList.add(i);return n&&Object.assign(r.style,n),r}createSvgElement(e){return this.document.createElementNS("http://www.w3.org/2000/svg",e)}createResizeObserver(e){const t=this.window.ResizeObserver;if(t!=null)return new t(e)}createIntersectionObserver(e,t){const n=this.window.IntersectionObserver;if(n!=null)return new n(e,t)}};function Ef(e,t,n=1/0){const r=t,i=n,o=e%180*(Math.PI/180),s=Math.abs(Math.sin(o)),a=Math.abs(Math.cos(o));if(s===0)return{width:r,height:i};if(a===0)return{width:i,height:r};if(!Number.isFinite(i)){const c=a/s,u=r/(a+c*s);return{width:u,height:c*u}}const l=a*a-s*s;if(l===0){const c=Math.min(r,i)/Math.SQRT2;return{width:c,height:c}}return{width:Math.abs((r*a-i*s)/l),height:Math.abs((i*a-r*s)/l)}}function Tf(e,t,n=1/0){const r=t,i=n,o=e%180*(Math.PI/180),s=Math.abs(Math.sin(o)),a=Math.abs(Math.cos(o));return s===0?{width:r,height:i}:a===0?{width:i,height:r}:{width:r*a+i*s,height:r*s+i*a}}function Af(e,t,n,r=0,i=0){const o=Math.cos(n),s=Math.sin(n),a=e-r,l=t-i;return{x:r+a*o-l*s,y:i+a*s+l*o}}var fe=Math.PI*2,Xt=Math.PI/2;function $e(e){return e%=fe,e+=fe,e%=fe,e}function Of(e){return e%=fe,e+=fe,e!==fe&&(e%=fe),e}function Sf(e){return e%=fe,e<-Math.PI?e+=fe:e>=Math.PI&&(e-=fe),e}function Ms(e,t,n){const r=$e(e),i=$e(t),o=$e(n);return io?i<=r||r<=o:t!==n}function Ds(e){return e/180*Math.PI}function Mf(e){return e/Math.PI*180}function Df(e,t){return e=$e(e),t=$e(t),t-e+(e>t?fe:0)}function Fs(e){const t=$e(e);return t<=Xt?t/Xt:t<=Math.PI?(Math.PI-t)/Xt:t<=1.5*Math.PI?(t-Math.PI)/Xt:(fe-t)/Xt}function Ff(e,t,n){const r=Fs(n);return e*r+t*Math.abs(1-r)}function kf(e){return e?$e(Ds(e)):0}var $f=class{constructor(){this.queue=[]}waitForCompletion(e=50){const t=this.queue;function n(r){function i(){clearTimeout(s),r(!0)}function o(){const a=t.indexOf(i);a<0||(t.splice(a,1),r(!1))}const s=setTimeout(o,e);t.push(i)}return new Promise(n)}notify(){for(const e of this.queue.splice(0))e()}};function Lf(e=0){function t(n){setTimeout(n,e)}return new Promise(t)}async function Cf(e,t,n=`Timeout after ${t}ms`){let r;const i=new Promise((o,s)=>{r=setTimeout(()=>s(new Error(n)),t)});try{return await Promise.race([e,i])}finally{clearTimeout(r)}}function Le(e){return e==="true"}function If(e){return Number(e)}function se(e){return e}var Rf={role:se,"aria-checked":Le,"aria-controls":se,"aria-describedby":se,"aria-disabled":Le,"aria-expanded":Le,"aria-haspopup":se,"aria-hidden":Le,"aria-label":se,"aria-labelledby":se,"aria-live":se,"aria-orientation":se,"aria-selected":Le,"data-focus-override":Le,"data-focus-visible-override":Le,"data-preventdefault":Le,class:se,for:se,id:se,tabindex:If,title:se,placeholder:se};function yt(e,t,n){n==null||n===""||n===""?e?.removeAttribute(t):e?.setAttribute(t,n.toString())}function Jt(e,t){if(t!=null)for(const[n,r]of zt(t))n!=="class"&&yt(e,n,r)}function ks(e,t,n){if(!zi(e))return;const r=e.getAttribute(t);return r===null?n:Rf[t]?.(r)??void 0}function $s(e,t,n){e!=null&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n.toString()))}function Nf(e,t){for(const[n,r]of zt(t))$s(e,n,r)}function _f(e,t){const n=Array.isArray(e)?e:e.split(".");if(n.length===1){const[r]=n;return De((i,o,s)=>i[r]=s,i=>i[r],t)}return De((r,i,o)=>Wr(r,n,o),r=>jr(r,n),t)}function Pf(e){return De((t,n,r)=>t[e]=r)}function ri(e,t){return De((n,r,i)=>n[e][t??r]=i)}function ii(e){const{newValue:t,oldValue:n,changeValue:r}=e;return De((i,o,s,a)=>(s!==a&&(a!==void 0&&n?.call(i,a),s!==void 0&&t?.call(i,s),r?.call(i,s,a)),s))}function Gf(e){return Pr(e)}var Qt=class extends gt{constructor(e){super(),this.node=e,this.enabled=!1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};he([ii({changeValue(e){e?this.node.strokeWidth=this.strokeWidth:this.node.strokeWidth=0}}),oe],Qt.prototype,"enabled",2),he([ri("node","stroke"),oe],Qt.prototype,"stroke",2),he([ri("node","strokeOpacity"),oe],Qt.prototype,"strokeOpacity",2),he([ii({changeValue(e){this.enabled?this.node.strokeWidth=e:this.node.strokeWidth=0}}),oe],Qt.prototype,"strokeWidth",2);function Ls(e,t,n,r,i){return te.x&&ne.y}function Cs(e,t,n,r=0,i=0){return t>=e.x&&t+r<=e.x+e.width&&n>=e.y&&n+i<=e.y+e.height}function Uf(e){return e==null||e.height===0||e.width===0||Number.isNaN(e.height)||Number.isNaN(e.width)}function Bf(e,t){return e===t?!0:e==null||t==null?!1:e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jf(e,t,n){if(e>t)return;let r;for(;t>=e;){const i=Math.floor((t+e)/2);n(i)?(r=i,e=i+1):t=i-1}return r}function Hf(e,t,n){if(e>t)return;let r;for(;t>=e;){const i=Math.floor((t+e)/2);n(i)?(r=i,t=i-1):e=i+1}return r}function Wf(e,t,n){if(e>t)return;let r;for(;t>=e;){const i=Math.floor((t+e)/2),o=n(i);o==null?t=i-1:(r=o,e=i+1)}return r}function Vf(e,t,n){if(e>t)return;let r;for(;t>=e;){const i=Math.floor((t+e)/2),o=n(i);o==null?e=i+1:(r=o,t=i-1)}return r}function Is(e=0,t=0){const n=Hi();return new n(e,t).getContext("2d")}var zf=800,qf=600,Kf={quality:1};function Yf(e){const t=class extends e{constructor(...r){super(...r),this.gpu=!1}toBuffer(r,i){return super.toBuffer(r,{...i,msaa:!1})}transferToImageBitmap(){const{width:r,height:i}=this,o=new t(Math.max(1,r),Math.max(1,i));return r>0&&i>0&&o.getContext("2d").drawCanvas(this,0,0,r,i),Object.defineProperty(o,"close",{value:()=>{}}),o}};return t}var Rs=!1;function Xf(e,t){Rs||(Rs=!0,Object.defineProperty(e.prototype,"fillText",{value:function(n,r,i){let o=this.outlineText(n);o=o.transform(new t([1,0,0,1,r,i])),this.fill(o)},writable:!0,configurable:!0}))}var Jf=class{constructor(e){this.getter=e}get(){return this.result??(this.result=this.getter()),this.result}clear(){this.result=void 0}},Qf=class{constructor(e){this.getter=e}get(){let e=this.result?.deref();return e||(e=this.getter(),this.result=new WeakRef(e),e)}clear(){this.result=void 0}};function Ns(e,t){return e.valueOf()-t.valueOf()}function Zf(e){let t=Number.NaN;const n=[];for(const r of e){const i=r.valueOf();t!==i&&n.push(r),t=i}return n}function eh(e){const t=e.slice().sort(Ns);return _s(t)==null?Zf(t):t}function _s(e){if(e.length===0)return 1;const t=Number(e.at(-1))>Number(e[0])?1:-1;let n=-1/0*t;for(const r of e){const i=r.valueOf();if(Math.sign(i-n)!==t)return;n=i}return t}function oi(){return(e,t)=>{const n=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");te(n)}}function th(e,t){const n=oi(),r=t?.default;return De((i,o,s)=>(s!==r&&n(o.toString(),e),s))}function nh(e,t){const n=oi();return De((r,i,o)=>(o!==r[e]&&(n(i.toString(),`Use [${e}] instead.`),Wr(r,e,t?t(o):o)),$n),(r,i)=>(n(i.toString(),`Use [${e}] instead.`),jr(r,e)))}function rh(e,t){const n=Math.max(e.length,t.length),r=new Set,i=new Set;for(let o=0;o0||i.size>0,added:r,removed:i}}function Zt(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function ih(e,t,n,r,i,o,s){if(n===i&&r===o)return Math.min(s,Zt(e,t,n,r));const a=i-n,l=o-r,c=Math.max(0,Math.min(1,((e-n)*a+(t-r)*l)/(a*a+l*l))),u=n+c*a,f=r+c*l;return Math.min(s,Zt(e,t,u,f))}function oh(e,t,n,r,i,o,s,a,l){a&&([s,o]=[o,s]);const c=Math.atan2(t-r,e-n);if(!Ms(c,o,s)){const f=n+Math.cos(o)*i,h=r+Math.sin(o)*i,d=n+Math.cos(o)*i,g=r+Math.sin(o)*i;return Math.min(l,Zt(e,t,f,h),Zt(e,t,d,g))}const u=i-Math.sqrt(Zt(e,t,n,r));return Math.min(l,u*u)}function Ps(e,t){if(e.length===0)return null;if(t!==void 0){const o=e.at(0),s=e.at(-1),a=o instanceof Date?o.getTime():o,l=s instanceof Date?s.getTime():s;if(typeof a=="number"&&typeof l=="number")return t===1?[a,l]:[l,a]}let n=1/0,r=-1/0;for(const o of e){const s=o instanceof Date?o.getTime():o;typeof s=="number"&&(sr&&(r=s))}const i=[n,r];return i.every(Number.isFinite)?i:null}function Gs(e,t,n,r,i,o,s){let a=!1;const l=Ps(e,s),c=l&&o?[o(l[0]),o(l[1])]:l;if(c==null){let h;return t!=null&&n!=null&&t<=n?h=[t,n]:r!=null&&i!=null&&r<=i&&(h=[r,i]),{extent:h??[],clipped:!1}}let[u,f]=c;return t!=null?(a||(a=t>u),u=t):r!=null&&rf&&(f=i),u>f?{extent:[],clipped:!1}:{extent:[u,f],clipped:a}}function sh(e,t,n,r,i){const{extent:o,clipped:s}=Gs(e.domain,Rt(t)?new Date(t):t,Rt(n)?new Date(n):n,Rt(r)?new Date(r):r,Rt(i)?new Date(i):i,a=>new Date(a),e.sortMetadata?.sortOrder);return{extent:o.map(a=>new Date(a)),clipped:s}}var ah=new Intl.NumberFormat("en-US",{style:"percent"});function lh(e,t=2){return typeof e=="number"?Bs(e,t):typeof e=="string"?e:String(e??"")}function ch(e){return ah.format(e)}var Us=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function Bs(e,t){let n=Us.get(t);return n||(n=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),Us.set(t,n)),n.format(e)}function js(e){return Array.isArray(e)&&e.length>=2&&e.every(de)}function zn(e){return Array.isArray(e)&&e.length>=2&&e.every(js)}function uh(e){const t=e[0],n=e.at(-1);return n===void 0?!1:Sr(t[0],n[0],.001)&&Sr(t[1],n[1],.001)}function Hs(e){return Array.isArray(e)&&e.every(zn)&&e.every(uh)}function Ws(e){if(e===null)return!0;if(!q(e)||e.type==null)return!1;const{type:t,coordinates:n}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(Ws);case"MultiPolygon":return Array.isArray(n)&&n.every(Hs);case"Polygon":return Hs(n);case"MultiLineString":return Array.isArray(n)&&n.every(zn);case"LineString":return zn(n);case"MultiPoint":return zn(n);case"Point":return js(n);default:return!1}}function fh(e){return q(e)&&e.type==="Feature"&&Ws(e.geometry)}function hh(e){return q(e)&&e.type==="FeatureCollection"&&Array.isArray(e.features)&&e.features.every(fh)}var dh=$(hh,"a GeoJSON object"),gh=class{constructor(e,t,n){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.cachedNeighboursEdge=e,this.processedEdge=t,this.singleValueEdges=n}clear(){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.singleValueEdges?.clear()}getVertexCount(){return this._vertexCount}getEdgeCount(){return this._edgeCount}addVertex(e){const t=new Vs(e);return this._vertexCount++,t}addEdge(e,t,n){n===this.cachedNeighboursEdge?e.updateCachedNeighbours().set(t.value,t):n===this.processedEdge&&(this.pendingProcessingEdgesFrom.push(e),this.pendingProcessingEdgesTo.push(t));const{edges:r}=e,i=r.get(n);i?i.includes(t)||(this.singleValueEdges?.has(n)?r.set(n,[t]):(i.push(t),this._edgeCount++)):(r.set(n,[t]),this._edgeCount++)}removeVertex(e){this._vertexCount--;const t=e.edges;if(t){for(const[,n]of t)this._vertexCount-=n.length;e.clear()}}removeEdge(e,t,n){const r=e.edges.get(n);if(!r)return;const i=r.indexOf(t);i!==-1&&(r.splice(i,1),r.length===0&&e.edges.delete(n),this._edgeCount--,n===this.cachedNeighboursEdge&&e.readCachedNeighbours()?.delete(t.value))}removeEdges(e,t){e.edges.delete(t)}getVertexValue(e){return e.value}*neighbours(e){for(const[,t]of e.edges)for(const n of t)yield n}*neighboursAndEdges(e){for(const[t,n]of e.edges)for(const r of n)yield[r,t]}neighboursWithEdgeValue(e,t){return e.edges.get(t)}findNeighbour(e,t){return e.edges.get(t)?.[0]}findNeighbourValue(e,t){const n=this.findNeighbour(e,t);if(n)return this.getVertexValue(n)}findNeighbourWithValue(e,t,n){const r=n==null?this.neighbours(e):this.neighboursWithEdgeValue(e,n);if(r){for(const i of r)if(this.getVertexValue(i)===t)return i}}findVertexAlongEdge(e,t,n){if(n===this.cachedNeighboursEdge){let i;for(const o of t)if(i=(i??e).readCachedNeighbours()?.get(o),!i)return;return i}if(t.length===0)return;let r=e;for(const i of t){const o=r?this.neighboursWithEdgeValue(r,n):void 0;if(!o)return;r=o.find(s=>s.value===i)}return r}adjacent(e,t){for(const[,n]of e.edges)if(n.includes(t))return!0;return!1}},Vs=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()}},si="class-instance";function ai(e,t,n){if(N(t)){if(!N(e)||e.length!==t.length||t.some((r,i)=>ai(e[i],r,n)!=null))return t}else if(V(t)){if(!V(e))return t;const r={},i=new Set([...Object.keys(e),...Object.keys(t)]);for(const o of i)if(e[o]!==t[o])if(n?.has(o))r[o]=t[o];else if(typeof e[o]==typeof t[o]){const s=ai(e[o],t[o],n);s!==null&&(r[o]=s)}else r[o]=t[o];return Object.keys(r).length?r:null}else if(e!==t)return t;return null}function ph(e,t){for(const n of Object.keys(e))if(e[n]!==t?.[n])return!1;return!0}function qn(e,t){return N(e)?yh(e,t):V(e)?mh(e,t):e instanceof Map?new Map(qn(Array.from(e))):li(e)}function yh(e,t){const n=[],r=t?.seen;for(const i of e){if(typeof i=="object"&&r?.includes(i)){be("cycle detected in array",i);continue}r?.push(i),n.push(qn(i,t)),r?.pop()}return n}function mh(e,t){const n={};for(const r of Object.keys(e))t?.assign?.has(r)?n[r]=e[r]:t?.shallow?.has(r)?n[r]=li(e[r]):n[r]=qn(e[r],t);return n}function li(e){return N(e)?e.slice(0):V(e)?{...e}:st(e)?new Date(e):uo(e)?new RegExp(e.source,e.flags):e}function ci(e,t,n,r,i,o){if(N(e)){o=t(e,r,i,o);let s=0;for(const a of e)o=ci(a,t,n,r?.[s],i,o),s++}else if(V(e)){o=t(e,r,i,o);for(const s of Object.keys(e)){if(n?.has(s))continue;const a=e[s];o=ci(a,t,n,r?.[s],i,o)}}return o}function zs(e,t,n={}){const{path:r,matcherPath:i=r?.replace(/(\[[0-9+]+])/i,"[]"),skip:o=[]}=n;if(e==null)throw new Error(`AG Charts - target is uninitialised: ${r??""}`);if(t==null)return e;if(pt(e))return e.set(t);const s=e,a=ui(e);for(const l of Object.keys(t)){if(Hr.has(l))continue;const c=`${i?i+".":""}${l}`;if(o.includes(c))continue;const u=t[l],f=`${r?r+".":""}${l}`,h=s.constructor,d=s[l];try{const g=ui(d),y=ui(u);if(a===si&&!(l in e||l==="context")){if(u===void 0)continue;be(`unable to set [${f}] in ${h?.name} - property is unknown`);continue}if(g!=null&&y!=null&&y!==g&&(g!==si||y!=="object")){be(`unable to set [${f}] in ${h?.name} - can't apply type of [${y}], allowed types are: [${g}]`);continue}if(pt(d))u===void 0?d.clear():d.set(u);else if(y==="object"&&l!=="context"){if(!(l in s)){be(`unable to set [${f}] in ${h?.name} - property is unknown`);continue}d==null?s[l]=u:zs(d,u,{...n,path:f,matcherPath:c})}else s[l]=u}catch(g){be(`unable to set [${f}] in [${h?.name}]; nested error is: ${g.message}`)}}return e}function ui(e){return e==null?null:mr(e)||st(e)?"primitive":N(e)?"array":q(e)?V(e)?"object":si:xe(e)?"function":"primitive"}function me(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function qs(e,t,n){return me(e,"keydown",r=>{const i=n?.()??["Escape"];Kn(r,...i)&&t(r)})}function bh(e,t){const n=e.ownerDocument.defaultView,r=me(n,"mousedown",i=>{[0,2].includes(i.button)&&!Ks(e,i)&&(t(),r())});return r}function vh(e,t){const n=e.ownerDocument.defaultView,r=me(n,"touchstart",i=>{Array.from(i.targetTouches).some(s=>!Ks(e,s))&&(t(),r())});return r}function Ks(e,t){return hr(t.target)&&t.target.shadowRoot!=null?!0:Vi(t.target)&&e.contains(t.target)}function wh(e,t,n){const r=i=>{for(const o of t)yt(o,"data-focus-visible-override",i)};return r(n),me(e,"keydown",()=>r(!0),{once:!0})}function fi(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function Kn(e,...t){return fi(e)&&t.includes(e.key)}function Ys(e,t,n){return me(e,"keydown",r=>{Kn(r,n)&&t.focus()})}var xh={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}},Eh={nextKey:"ArrowLeft",prevKey:"ArrowRight"};function Xs(e,t){return t&&e==="horizontal"?Eh:xh[e]}function Th(e){const{orientation:t,buttons:n,wrapAround:r=!1,onEscape:i,onFocus:o,onBlur:s}=e,{nextKey:a,prevKey:l}=Xs(t,lo(n[0])),c=d=>{if(d.target&&"tabIndex"in d.target){for(const g of n)g.tabIndex=-1;d.target.tabIndex=0}},[u,f]=r?[n.length,n.length]:[0,1/0],h=new yr;for(let d=0;d{Kn(w,a,l)&&w.preventDefault()})),y.tabIndex=d===0?0:-1}return h}function Ah(e,t){return n=>{if(e.ariaDisabled==="true")return n.preventDefault();t(n)}}function Js(e){return"button"in e?e.button===0:fi(e)&&(e.code==="Space"||e.key==="Enter")}function Oh(e){const t=e?.target;if(hr(t)&&"tabindex"in t.attributes)return t}function Sh(e){return me(e,"keydown",t=>{if(t.defaultPrevented)return;ks(t.target,"data-preventdefault",!0)&&Kn(t,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&t.preventDefault()})}var hi=new Map,Qs=1;function Mh(){hi.clear(),Qs=1}function Dh(e){const t=e.constructor;let n=Object.hasOwn(t,"className")?t.className:t.name;Zi(()=>{if(!n)throw new Error(`The ${String(t)} is missing the 'className' property.`)}),n??(n="Unknown");const r=(hi.get(n)??0)+1;return hi.set(n,r),`${n}-${r}`}function Fh(){return`ag-charts-${Qs++}`}function kh(){return crypto.randomUUID?.()??$h()}function $h(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n0)r={value:o,next:r},i=r;else{for(i=i;i.next!=null&&n(i.next.value,o)<=0;)i=i.next;i.next={value:o,next:i.next}}return r}var en=new WeakMap;function Lh(e,t){const n=JSON.stringify(e,null,0);return en.has(t)||en.set(t,new Map),en.get(t)?.has(n)||en.get(t)?.set(n,t(e)),en.get(t)?.get(n)}var di=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function Ch(e,t){let n=new di;const r=(...i)=>{let o=n;for(const s of i){const a=typeof s=="object"||typeof s=="symbol"?o.weak:o.strong;let l=a.get(s);l==null&&(l=new di,a.set(s,l)),o=l}if(o.set)return t?.("hit",e,i),o.value;{const s=e(...i);return o.set=!0,o.value=s,t?.("miss",e,i),s}};return r.reset=()=>{n=new di},r}function Ih(e,t){const n=new Map,r=(...s)=>s.map(a=>typeof a=="object"||typeof a=="symbol"?a:(n.has(a)||n.set(a,{v:a}),n.get(a))),i={},o=new WeakMap;return(...s)=>{const a=s.length===0?[i]:r(...s);let l=o;for(const f of a.slice(0,-1))l.has(f)||l.set(f,new WeakMap),l=l.get(f);const c=a.at(-1);let u=l.get(c);return u?t?.("hit",e,s):(u=e(...s),l.set(c,u),t?.("miss",e,s)),u}}function Rh(e,t,n,r=1/0){const i={nearest:void 0,distanceSquared:r};for(const o of n){const s=o.distanceSquared(e,t);if(s===0)return{nearest:o,distanceSquared:0};s{})}function yi(e,t){const n=Fe(t);if(n.length===0)return;const r=ns(e);for(const i of n)i in r&&(t[i]=r[i])}var ea=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},mi=class ee extends ea{constructor(t,n,r){super(),this.defaultState=t,this.states=n,this.enterEach=r,this.debug=Qi(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,gi)}transition(t,n){if(!this.transitionChild(t,n)||this.state===ee.child||this.state===ee.parent)return;const i=this.state,o=this.states[this.state];let s=o[t];const a=`%c${this.constructor.name} | ${this.state} -> ${t} ->`;if(Array.isArray(s))s=s.find(u=>{if(!u.guard)return!0;const f=u.guard(n);return f||this.debug(`${a} (guarded)`,u.target,pi),f});else if(typeof s=="object"&&!(s instanceof ee)&&s.guard&&!s.guard(n)){this.debug(`${a} (guarded)`,s.target,pi);return}if(!s){this.debug(`${a} ${this.state}`,pi);return}const l=this.getDestinationState(s),c=l===this.state?void 0:o.onExit;this.debug(`${a} ${l}`,gi),this.state=l,typeof s=="function"?s(n):typeof s=="object"&&!(s instanceof ee)&&s.action?.(n),c?.(),this.enterEach?.(i,l),l!==i&&l!==ee.child&&l!==ee.parent&&this.states[l].onEnter?.(i,n)}transitionAsync(t,n){setTimeout(()=>{this.transition(t,n)},0)}is(t){return this.state===ee.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,n){return this.state!==ee.child||!this.childState||(yi(this,this.childState),this.childState.transition(t,n),!this.childState.is(ee.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,gi),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(t){let n=this.state;return typeof t=="string"?n=t:t instanceof ee?(this.childState=t,this.childState.parent=this,n=ee.child):typeof t=="object"&&(t.target instanceof ee?(this.childState=t.target,this.childState.parent=this,n=ee.child):t.target!=null&&(n=t.target)),n}};mi.child="__child",mi.parent="__parent";var Gh=mi,Uh=class extends ea{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const n of this.stateMachines)yi(this,n),n.transition(e,t)}transitionAsync(e,t){for(const n of this.stateMachines)yi(this,n),n.transitionAsync(e,t)}},ta=class{constructor(e,t){this.ctx=e,this.measureTextCached=t,this.baselineMap=new Map,this.charMap=new Map,this.lineHeightCache=null}baselineDistance(e){if(e==="alphabetic")return 0;if(this.baselineMap.has(e))return this.baselineMap.get(e);this.ctx.textBaseline=e;const{alphabeticBaseline:t}=this.ctx.measureText("");return this.baselineMap.set(e,t),this.ctx.textBaseline="alphabetic",t}lineHeight(){return this.lineHeightCache??(this.lineHeightCache=this.measureText("").height),this.lineHeightCache}measureText(e){const t=this.measureTextCached?.(e)??this.ctx.measureText(e),{width:n,fontBoundingBoxAscent:r=t.emHeightAscent,fontBoundingBoxDescent:i=t.emHeightDescent}=t,o=r+i;return{width:n,height:o,ascent:r,descent:i}}measureLines(e){const t=typeof e=="string"?e.split(fn):e;let n=0,r=0;const i=t.map(o=>{const s=this.measureText(o);return n1?this.ctx.measureText(e).width:this.charMap.get(e)??this.charWidth(e)}charWidth(e){const{width:t}=this.ctx.measureText(e);return this.charMap.set(e,t),t}},bi=new ur(50);function mt(e){typeof e=="object"&&(e=ho(e));let t=bi.get(e);if(t)return t;const n=new ur(1e4),r=Is();return r.font=e,t=new ta(r,i=>{let o=n.get(i);return o||(o=r.measureText(i),n.set(i,o),o)}),bi.set(e,t),t}mt.clear=()=>bi.clear();function na(e,t){let n={segments:[],width:0,height:0,ascent:0,descent:0};const r=[n];for(const s of e){const{text:a,fontSize:l=t.fontSize,fontStyle:c=t.fontStyle,fontWeight:u=t.fontWeight,fontFamily:f=t.fontFamily,...h}=s,d={fontSize:l,fontStyle:c,fontWeight:u,fontFamily:f},g=mt(d),y=at(a).split(fn);for(let v=0;v0&&(n={segments:[],width:0,height:0,ascent:0,descent:0},r.push(n)),w&&(n.width+=T.width,n.ascent=Math.max(n.ascent,T.ascent),n.descent=Math.max(n.descent,T.descent),n.height=Math.max(n.height,n.ascent+n.descent),n.segments.push({...d,...h,text:w,textMetrics:T}))}}let i=0,o=0;for(const s of r)i=Math.max(i,s.width),o+=s.height;return{width:i,height:o,lineMetrics:r}}function Ce(e,t,n){const r=ln().createElement(e);if(typeof t=="object"&&(n=t,t=void 0),t)for(const i of t.split(" "))r.classList.add(i);return n&&Object.assign(r.style,n),r}function Bh(e){return ln().createElementNS("http://www.w3.org/2000/svg",e)}function jh(e,t){const n=ln("body"),r=Ce("a",{display:"none"});r.href=e,r.download=t,n.appendChild(r),r.click(),setTimeout(()=>r.remove())}function ra(e,t){return t.overflow==="hide"&&e.some(Nt)}function Hh(e,t){return N(e)?oa(e,t):vi(at(e),t).join(` `)}function Wh(e,t){return vi(e,t).join(` `)}function vi(e,t){return Yn(e,t)}function bt(e,t,n,r){const i=t.textWidth(Lt),o=Ee(e);let s=0,a=0;for(const c of o){const u=t.textWidth(c);if(s+u>n)break;s+=u,a+=c.length}if(a===e.length&&(!r||s+i<=n))return r?br(e):e;e=e.slice(0,a).trimEnd();const l=Ee(e);for(;l.length&&t.textWidth(e)+i>n;){for(l.pop();l.length&&l.at(-1).trim()==="";)l.pop();e=l.join("")}return br(e)}function Yn(e,t,n=0){const r=e.split(fn),i=mt(t.font),o=[];if(t.textWrap==="never"){for(const c of r){const u=bt(c.trimEnd(),i,Math.max(0,t.maxWidth-n));if(!u)break;o.push(u),n=0}return ra(o,t)?[]:o}const s=t.textWrap==="hyphenate",a=t.textWrap==null||t.textWrap==="on-space";for(const c of r){let u=c.trimEnd();if(u===""){o.push(u);continue}let f=Ee(u),h=0,d=0,g=0,y=0;for(o.length||(g=n);ht.maxWidth){if(h===0){u="";break}let w=i.textWidth(u.slice(0,d+v.length));if(o.length||(w+=n),w<=t.maxWidth){g=w,d+=v.length,h++;continue}if(y){const B=Vh(u,y+1),I=i.textWidth(B);if(I<=t.maxWidth){o.push(u.slice(0,y).trimEnd()),u=u.slice(y).trimStart(),f=Ee(u),h=0,d=0,g=0,y=0;continue}else a&&I>t.maxWidth&&o.push(u.slice(0,y).trimEnd(),bt(u.slice(y).trimStart(),i,t.maxWidth,!0))}else if(a){const B=bt(u,i,t.maxWidth,!0);B&&o.push(B)}if(a){u="";break}const T=s?"-":"";let E=u.slice(0,d).trim();const M=Ee(E);for(;M.length&&i.textWidth(E+T)>t.maxWidth;){for(M.pop();M.length&&M.at(-1).trim()==="";)M.pop();E=M.join("")}if(E&&E!==Ct)o.push(vr(E)+T);else{u="";break}u=u.slice(E.length).trimStart(),f=Ee(u),h=0,d=0,g=0,y=0;continue}d+=v.length,h++}u&&o.push(u)}zh(o,i,t);const l=ia(o,i,t);return ra(l,t)?[]:l}function Vh(e,t){const n=e.indexOf(" ",t);return n===-1?e.slice(t):e.slice(t,n)}function ia(e,t,n){if(!de(n.maxHeight))return e;const{height:r,lineMetrics:i}=t.measureLines(e);if(r<=n.maxHeight)return e;for(let o=0,s=0;on.maxHeight){if(n.overflow==="hide"||o===0)return[];const a=e.slice(0,o),l=a.pop();return a.concat(Nt(l)?l:bt(l,t,n.maxWidth,!0))}return e}function zh(e,t,n){if(n.avoidOrphans===!1||e.length<2)return;const{length:r}=e,i=e[r-1],o=e[r-2];if(Ee(o).lengthn){r.length&&s();break}if(i+a<=t.maxWidth){i+=a,o+=l,r.push(...c);continue}for(const u of c){if(i+u.textMetrics.width<=t.maxWidth){i+=u.textMetrics.width,r.push(u);continue}const f=mt(u),h=go(u.text),d={...t,font:u,maxHeight:n-o};let g=Yn(h,{...d,overflow:"hide"},i);if(g.length===0)if(t.textWrap==="never")g=Yn(h,d,i);else{g=Yn(h,d);const w=r.at(-1);w&&(w.text+=` `,i=0)}if(g.length===0){s();break}const y=g.findIndex(Nt);y!==-1&&(g=g.slice(0,y+1));const v=g.at(-1);for(const w of g){const T=po(w),E=f.measureText(T),M={...u,text:T,textMetrics:E};w===v?i+=E.width:(M.text+=` `,i=0),o+=E.height,r.push(M)}if(y!==-1)break}}return r}function sa(e,[t,n],[r,i]){const o=i-r,s=n-t,a=t+s*e[0],l=t+s*e[1];return[(a-r)/o,(l-r)/o]}var vt=1e3,Ie=vt*60,qe=Ie*60,Ke=qe*24,aa=Ke*7,wi=Ke*30,nn=Ke*365,wt=new Date().getTimezoneOffset()*Ie,xt={millisecond:{milliseconds:1,hierarchy:"day",encode(e){return e.getTime()},decode(e){return new Date(e)}},second:{milliseconds:vt,hierarchy:"day",encode(e,t){const n=t?0:wt;return Math.floor((e.getTime()-n)/vt)},decode(e,t){const n=t?0:wt;return new Date(n+e*vt)}},minute:{milliseconds:Ie,hierarchy:"day",encode(e,t){const n=t?0:wt;return Math.floor((e.getTime()-n)/Ie)},decode(e,t){const n=t?0:wt;return new Date(n+e*Ie)}},hour:{milliseconds:qe,hierarchy:"day",encode(e,t){const n=t?0:wt;return Math.floor((e.getTime()-n)/qe)},decode(e,t){const n=t?0:wt;return new Date(n+e*qe)}},day:{milliseconds:Ke,hierarchy:"month",encode(e,t){const n=t?0:e.getTimezoneOffset()*Ie;return Math.floor((e.getTime()-n)/Ke)},decode(e,t){let n;return t?(n=new Date(0),n.setUTCDate(n.getUTCDate()+e),n.setUTCHours(0,0,0,0)):(n=new Date(1970,0,1),n.setDate(n.getDate()+e)),n}},month:{milliseconds:wi,hierarchy:"year",encode(e,t){return t?e.getUTCFullYear()*12+e.getUTCMonth():e.getFullYear()*12+e.getMonth()},decode(e,t){if(t){const n=Math.floor(e/12),r=e-n*12;return new Date(Date.UTC(n,r,1))}else{const n=Math.floor(e/12),r=e-n*12;return new Date(n,r,1)}}},year:{milliseconds:nn,hierarchy:void 0,encode(e,t){return t?e.getUTCFullYear():e.getFullYear()},decode(e,t){let n;return t?(n=new Date,n.setUTCFullYear(e),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)):n=new Date(e,0,1,0,0,0,0),n}}};function Et(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 rn(e,t,n,r){if(n==null)return 0;const i=xt[e];return Math.floor(i.encode(new Date(n),r))%t}function Tt(e,t,n,r,i){const o=xt[t];return Math.floor((o.encode(new Date(e),r)-i)/n)}function At(e,t,n,r,i){return xt[t].decode(e*n+i,r)}function Xn(e,t,n,r,i){const o=new Date(e),s=Tt(o,t,n,r,i);return At(s,t,n,r,i)}function Jn(e,t,n,r,i){const o=new Date(Number(e)-1),s=Tt(o,t,n,r,i);return At(s+1,t,n,r,i)}function Ye(e,t){const{unit:n,step:r,epoch:i,utc:o}=Et(e),s=rn(n,r,i,o);return Xn(t,n,r,o,s)}function qh(e,t){const{unit:n,step:r,epoch:i,utc:o}=Et(e),s=rn(n,r,i,o);return Jn(t,n,r,o,s)}function Kh(e,t){const{unit:n,step:r,epoch:i,utc:o}=Et(e),s=rn(n,r,i,o);return At(Tt(Jn(t,n,r,o,s),n,r,o,s)-1,n,r,o,s)}function Yh(e,t){const{unit:n,step:r,epoch:i,utc:o}=Et(e),s=rn(n,r,i,o);return At(Tt(Xn(t,n,r,o,s),n,r,o,s)+1,n,r,o,s)}function la(e,t,n){if(e.valueOf()>t.valueOf()&&([e,t]=[t,e],n!=null&&(n=[1-n[1],1-n[0]])),n!=null){const r=t.valueOf()-e.valueOf(),i=e.valueOf();e=new Date(i+n[0]*r),t=new Date(i+n[1]*r)}return[new Date(e),new Date(t)]}function on(e,t,n,{extend:r=!1,visibleRange:i=[0,1],limit:o,defaultAlignment:s="start"}={}){const a=Et(e),{unit:l,step:c,utc:u}=a;let f;a.epoch!=null?f=a.epoch:s==="interval"?f=void 0:t.valueOf()>n.valueOf()?f=n:f=t;const h=rn(a.unit,a.step,f,a.utc);let[d,g]=la(t,n,i);d=r?Xn(d,l,c,u,h):Jn(d,l,c,u,h),g=r?Jn(g,l,c,u,h):Xn(g,l,c,u,h);const y=Tt(d,l,c,u,h);let v=Tt(g,l,c,u,h);return o!=null&&v-y>o&&(v=y+o),{range:[y,v],unit:l,step:c,utc:u,offset:h}}function Xh(e,t,n,r){const{range:[i,o]}=on(e,t,n,r);return Math.abs(o-i)}function Jh(e,t,n,r){const{range:[i,o],unit:s,step:a,utc:l,offset:c}=on(e,t,n,r),u=[];for(let f=i;f<=o;f+=1){const h=At(f,s,a,l,c);u.push(h)}return u}function Qh(e,t,n,r){const{range:[i,o],unit:s,step:a,utc:l,offset:c}=on(e,t,n,r),u=Math.max(0,o-i+1),f=new Array(u);for(let h=0;h0?1:-1))}else if(r.setMonth(e.getMonth()+t),t!==0)for(;r.getMonth()===e.getMonth();)r.setDate(r.getDate()+(t>0?1:-1));return r}},year:{adjust(e,t,n){const r=new Date(e.getTime());return n?r.setUTCFullYear(e.getUTCFullYear()+t):r.setFullYear(e.getFullYear()+t),r}}};function sd(e,t){const{unit:n,step:r,utc:i}=Et(e);return od[n].adjust(t,-r,i)}function Ei(e){return typeof e=="string"?e:e.unit}function Ti(e){return typeof e=="string"?1:e.step??1}function ad(e){return typeof e=="string"?void 0:e.epoch}function ca(e){return xt[Ei(e)].hierarchy}function Qn(e){return Ti(e)*xt[Ei(e)].milliseconds}var ua=["millisecond","second","minute","hour","day","month","year"];function ld(e){return V(e)?"unit"in e&&ua.includes(e.unit):!1}function cd(e){return we(e)&&ua.includes(e)}var _=(e,t)=>({duration:Qn(e)*t,timeInterval:e,step:t}),Ai=[_({unit:"second"},1),_({unit:"second"},5),_({unit:"second"},15),_({unit:"second"},30),_({unit:"minute"},1),_({unit:"minute"},5),_({unit:"minute"},15),_({unit:"minute"},30),_({unit:"hour"},1),_({unit:"hour"},3),_({unit:"hour"},6),_({unit:"hour"},12),_({unit:"day"},1),_({unit:"day"},2),_({unit:"day",step:7},1),_({unit:"day",step:7},2),_({unit:"day",step:7},3),_({unit:"month"},1),_({unit:"month"},2),_({unit:"month"},3),_({unit:"month"},4),_({unit:"month"},6),_({unit:"year"},1)],fa=[1,2,5,10];function ha(e,t){return Math.abs(Math.round(e)-e)=n?Math.abs(t-e)/n+1:1}function ud(e,t,n,r,i,o){if(e===t)return{ticks:[e],count:1,firstTickIndex:0};if(n<2)return{ticks:[e,t],count:2,firstTickIndex:0};const s=Zn(e,t,n,r,i);if(!Number.isFinite(s))return{ticks:[],count:0,firstTickIndex:void 0};let a=e,l=t;ha(a/s,1e-12)||(a=Math.ceil(a/s)*s),ha(l/s,1e-12)||(l=Math.floor(l/s)*s),o!=null&&(o=sa(o,[e,t],[a,l]));const{ticks:c}=ma(a,l,s,o),u=c.at(0);return{ticks:c,count:da(a,l,s),firstTickIndex:u==null?void 0:Math.round((u-a)/s)}}var fd=Math.floor(2*aa/wi*10)/10;function ga({timeInterval:e,step:t}){const n=Qn(e)*t,r=ca(e),i=r?Qn(r):void 0;return n<=(i??1/0)*fd}function pa(e,{weekStart:t}){if(e.unit==="day"&&e.step===7)return t}function hd(e,t,n,r,i,{weekStart:o,primaryOnly:s=!1,targetInterval:a}){if(n<=0)return;const l=a??Math.abs(t-e)/Math.max(n,1),c=Ai.findLast(d=>(!s||ga(d))&&l>d.duration),u=Ai.find(d=>(!s||ga(d))&&l<=d.duration);if(c==null)return{unit:"millisecond",step:Math.max(Zn(e,t,n,r,i),1)};if(u==null)return{unit:"year",step:a==null?Zn(e/nn,t/nn,n,r,i):1};const{timeInterval:f,step:h}=l-c.duration=r&&f<=i;if(c&&!h)continue;const d=Math.abs(f-n);(l>d||c!==h)&&(c||(c=h),l=d,a=u)}return a*s}function ya(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]!=="0")return t+1;return 0}function dd(e,t){const n=Dr(t??",f");if(n==null)return;(n.precision==null||Number.isNaN(n.precision))&&(!n.type||"eEFgGnprs".includes(n.type)?n.precision=Math.max(...e.map(i=>{if(!Number.isFinite(i))return 0;const[o,s]=i.toExponential((n.type?6:12)-1).split(/[.e]/g);return(o!=="1"&&o!=="-1"?1:0)+ya(s)+1})):"f%".includes(n.type)&&(n.precision=Math.max(...e.map(i=>{if(!Number.isFinite(i)||i===0)return 0;const o=Math.floor(Math.log10(Math.abs(i))),s=n.type?6:12,a=i.toExponential(s-1).split(/[.e]/g)[1],l=ya(a);return Math.max(0,l-o)}))));const r=$o(n);return i=>r(Number(i))}function ma(e,t,n,r){if(!Number.isFinite(n)||n<=0)return{ticks:[],count:0,firstTickIndex:void 0};if(e===t)return{ticks:[e],count:1,firstTickIndex:0};const i=10**Mo(n),o=Math.min(e,t),s=Math.max(e,t);let a,l;if(r!=null&&(r[0]!==0||r[1]!==1)){const f=t-e,h=e+f*r[0],d=t-f*(1-r[1]);a=Math.min(h,d),l=Math.max(h,d)}else a=o,l=s;a=Math.floor(a*i)/i,l=Math.ceil(l*i)/i;const c=[];for(let f=0;;f+=1){const h=Math.round((o+n*f)*i)/i;if(h>s)break;h>=a&&h<=l&&c.push(h)}const u=c.at(0);return{ticks:c,count:da(o,s,n),firstTickIndex:u==null?void 0:Math.round((u-o)/n)}}function gd(e,t){return e>=t?(te("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function pd(e,t){const n=Math.abs(t-e),r=10**Math.floor(Math.log10(n));let i=1/0,o=[e,t];for(const s of fa){const a=s*r,l=Math.floor(e/a)*a,c=Math.ceil(t/a)*a,u=1-n/Math.abs(c-l);i>u&&(i=u,o=[l,c])}return o}function yd(e,t,n,r,i,o){if(e<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};o=Math.max(o,e/(i+1)),n??(n=o),r??(r=e),n>r&&(n===o?n=r:r=n),n=Math.max(n,1);const s=Math.max(1,Math.floor(e/(t*n))),a=Math.min(s,Math.ceil(e/(t*r))),l=Z(a,Math.floor(i/t),s);return{minTickCount:a,maxTickCount:s,tickCount:l}}function md(e){return e instanceof Date?e.getTime():e}function ba(e){return e{const n=e.get(t);return n?(e.set(t,n+1),`${t}_${n}`):(e.set(t,1),t)}}function Oi(e){return e!=null&&Object.hasOwn(e,"toString")&&we(e.toString())}function wa(e){return e!=null&&Object.hasOwn(e,"valueOf")&&de(e.valueOf())}function xa(e){return de(e)||gn(e)||wa(e)}function xd(e,t){return e!=null&&(!t||xa(e))}function Ed(e){return Oi(e)&&Object.hasOwn(e,"id")?e.id:e}function Td(e){return Oi(e)&&Object.hasOwn(e,"value")?e.value:e}var Ea={};nt(Ea,{add:()=>Ad,angle:()=>Fd,apply:()=>Pd,distance:()=>Sd,distanceSquared:()=>Md,equal:()=>Nd,from:()=>_d,gradient:()=>$d,intercept:()=>Ld,intersectAtX:()=>Id,intersectAtY:()=>Cd,length:()=>er,lengthSquared:()=>Ta,multiply:()=>Od,normalized:()=>Dd,origin:()=>Aa,required:()=>Gd,rotate:()=>kd,round:()=>Rd,sub:()=>Si});function Ad(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 Si(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 Od(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 er(e){return Math.hypot(e.x,e.y)}function Ta(e){return e.x*e.x+e.y*e.y}function Sd(e,t){return er(Si(e,t))}function Md(e,t){return Ta(Si(e,t))}function Dd(e){const t=er(e);return{x:e.x/t,y:e.y/t}}function Fd(e,t){return t==null?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)}function kd(e,t,n=Aa()){const r=er(e);return{x:n.x+r*Math.cos(t),y:n.y+r*Math.sin(t)}}function $d(e,t,n){const r=t.x-e.x;return(n==null?t.y-e.y:n-t.y-(n-e.y))/r}function Ld(e,t,n){return(n==null?e.y:n-e.y)-t*e.x}function Cd(e,t,n=0,r){return{x:e===1/0?1/0:(n-t)/e,y:r==null?n:r-n}}function Id(e,t,n=0,r){const i=e===1/0?1/0:e*n+t;return{x:n,y:r==null?i:r-i}}function Rd(e,t=2){return{x:Mr(e.x,t),y:Mr(e.y,t)}}function Nd(e,t){return e.x===t.x&&e.y===t.y}function _d(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 Pd(e,t){return e.x=t.x,e.y=t.y,e}function Gd(e){return{x:e?.x??0,y:e?.y??0}}function Aa(){return{x:0,y:0}}var Oa={};nt(Oa,{bottomCenter:()=>Wd,center:()=>Hd,clone:()=>Kd,collides:()=>Yd,end:()=>Bd,from:()=>Xd,height:()=>zd,normalise:()=>tr,origin:()=>Jd,round:()=>qd,start:()=>Ud,topCenter:()=>jd,width:()=>Vd});function Ud(e){return{x:e.x1,y:e.y1}}function Bd(e){return{x:e.x2,y:e.y2}}function jd(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}}function Hd(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function Wd(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}}function Vd(e){return Math.abs(e.x2-e.x1)}function zd(e){return Math.abs(e.y2-e.y1)}function qd(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}}function Kd(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}function Yd(e,t){const n=tr(e),r=tr(t);return n.x1<=r.x2&&n.x2>=r.x1&&n.y1<=r.y2&&n.y2>=r.y1}function tr(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 Xd(e,t,n,r){if(typeof e=="number")return{x1:e,y1:t,x2:n,y2:r};if("width"in e)return tr({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}] [${n}] [${r}]`)}function Jd(){return{x1:0,y1:0,x2:0,y2:0}}function Mi(e){return q(e)&&e.type=="gradient"}function Qd(e){return N(e)&&e.every(Mi)}function Zd(e){return N(e)&&e.every(t=>typeof t=="string")}function Sa(e){return e!==null&&q(e)&&e.type=="pattern"}function eg(e){return e!==null&&q(e)&&e.type=="image"}function tg(e){return Mi(e)||Sa(e)}function nr(e,t,n,r,i){return(1-i)**3*e+3*(1-i)**2*i*t+3*(1-i)*i**2*n+i**3*r}function Di(e,t,n,r,i){if(i<=Math.min(e,r))return e=Math.max(e,r))return e0&&l<1)return[l]}return[]}const a=o*o-4*i*s;if(a>=0){const l=Math.sqrt(a),c=(-o+l)/(2*i),u=(-o-l)/(2*i);return[c,u].filter(f=>f>0&&f<1)}return[]}function ng(e,t,n,r,i,o,s,a){const l=Ma(e,n,i,s),c=Ma(t,r,o,a);return[...l,...c]}function Fi(e,t,n){const r=nr(e[0].x,e[1].x,e[2].x,e[3].x,.5),i=nr(e[0].y,e[1].y,e[2].y,e[3].y,.5),o=Math.hypot(r-t,i-n),s=Math.min(Math.hypot(e[0].x-t,e[0].y-n),Math.hypot(e[1].x-t,e[1].y-n),Math.hypot(e[2].x-t,e[2].y-n),Math.hypot(e[3].x-t,e[3].y-n));return{points:e,distance:o,minDistance:s}}function rg(e,t,n,r,i,o,s,a,l,c,u=1){let h={value:Fi([{x:e,y:t},{x:n,y:r},{x:i,y:o},{x:s,y:a}],l,c),next:null},d;for(;h!=null;){const{points:g,distance:y,minDistance:v}=h.value;if(h=h.next,(d==null||yt.minDistance-e.minDistance;function ig({point:e,anchor:t},n,r,i,o){if(e.size===0)return!1;let s=e.x,a=e.y;t!=null&&(s-=(t.x-.5)*e.size,a-=(t.y-.5)*e.size);let l=s;sn+i&&(l=n+i);let c=a;ar+o&&(c=r+o);const u=s-l,f=a-c;return Math.hypot(u,f)<=e.size/2}function og(e){return e!=null&&typeof e.point=="object"&&typeof e.label=="object"}var sg={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 ag(e,t,n=5){const r=new Map,i=[],o=new Map(Array.from(e.entries(),([a,l])=>[a,l.toSorted((c,u)=>u.point.size-c.point.size)])),s=[...o.values()].flat();for(const[a,l]of o.entries()){const c=[];if(l[0]?.label){for(let u=0,f=l.length;u0&&h.placement!=null){const H=sg[h.placement];M=(w/2+E+n)*H.x,B=(T/2+E+n)*H.y}let I=d.x-w/2+M,S=d.y-T/2+B;if(y&&(I-=(y.x-.5)*d.size,S-=(y.y-.5)*d.size),Cs(t,I,S,w,T)&&!s.some(H=>ig(H,I,S,w,T))&&!i.some(H=>Ls(H,I,S,w,T))){const H={index:u,text:v,x:I,y:S,width:w,height:T,datum:h};c.push(H),i.push(H)}}r.set(a,c)}}return r}function Fa(e){return e.type==="continuous"||e.type==="log"}function ka(e){return e.type==="category"}function ir(e){return"variant"in e&&e.variant==="unit-time"}function $a(e){return!("variant"in e)}function lg(e,t){return e===void 0||t===void 0?e!==void 0||t!==void 0:Fa(e)&&Fa(t)?e.type===t.type&&rt(e.domain,t.domain)&&rt(e.range,t.range):ka(e)&&ka(t)?ir(e)&&ir(t)?e.firstBandTime===t.firstBandTime&&e.lastBandTime===t.lastBandTime&&e.bandCount===t.bandCount&&e.intervalMs===t.intervalMs&&e.inset===t.inset&&e.step===t.step:$a(e)&&$a(t)?e.inset===t.inset&&e.step===t.step&&rt(e.domain,t.domain):!1:!1}function cg(e){return e==null?!1:e.type==="category"?ir(e)?Number.isFinite(e.firstBandTime)&&Number.isFinite(e.lastBandTime)&&Number.isFinite(e.bandCount)&&e.bandCount>0:e.domain.every(t=>t!=null):e.domain.every(t=>Number.isFinite(t)||t instanceof Date)&&e.range.every(t=>Number.isFinite(t))}function ki(e){switch(e.type){case"linear":case"step":case"multi-line":return[{x:e.x0,y:e.y0},{x:e.x1,y:e.y1}];case"cubic":return[{x:e.cp0x,y:e.cp0y},{x:e.cp3x,y:e.cp3y}]}}function ug(e){const t=ki(e);return t[0].x>t[1].x&&t.reverse(),t}function fg(e,t){const{x:n,y:r}=t;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:n,y0:r,x1:n,y1:r};case"step":return{type:"step",moveTo:e.moveTo,x0:n,y0:r,x1:n,y1:r,stepX:n};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:n,cp0y:r,cp1x:n,cp1y:r,cp2x:n,cp2y:r,cp3x:n,cp3y:r};case"multi-line":return{type:"multi-line",moveTo:e.moveTo,x0:n,y0:r,x1:n,y1:r,midPoints:e.midPoints.map(()=>({x:n,y:r}))}}}function $i(e,t,n){const[r,i]=ki(e),o=i.x===r.x?0:(n.x-t.x)/(i.x-r.x),s=i.y===r.y?0:(n.y-t.y)/(i.y-r.y);switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:n.x,y1:n.y};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:t.x,cp0y:t.y,cp1x:n.x-(e.cp2x-r.x)*o,cp1y:n.y-(e.cp2y-r.y)*s,cp2x:n.x-(e.cp1x-r.x)*o,cp2y:n.y-(e.cp1y-r.y)*s,cp3x:n.x,cp3y:n.y};case"step":return{type:"step",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:n.x,y1:n.y,stepX:n.x-(e.stepX-r.x)*o};case"multi-line":return{type:"multi-line",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:n.x,y1:n.y,midPoints:e.midPoints.map(a=>({x:t.x+(a.x-r.x)*o,y:t.y+(a.y-r.y)*s}))}}}function hg(e,t,n){const{moveTo:r}=e,[i,o]=ug(e),{x:s,y:a}=i,{x:l,y:c}=o;if(nl)return $i(e,o,o);switch(e.type){case"linear":{const u=a===c?void 0:(c-a)/(l-s),f=u==null?a:u*(t-s)+a,h=u==null?a:u*(n-s)+a;return{type:"linear",moveTo:r,x0:t,y0:f,x1:n,y1:h}}case"step":if(n<=e.stepX){const u=e.y0;return{type:"step",moveTo:r,x0:t,y0:u,x1:n,y1:u,stepX:n}}else if(t>=e.stepX){const u=e.y1;return{type:"step",moveTo:r,x0:t,y0:u,x1:n,y1:u,stepX:t}}else{const{y0:u,y1:f,stepX:h}=e;return{type:"step",moveTo:r,x0:t,y0:u,x1:n,y1:f,stepX:h}}case"cubic":{const u=Di(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[f,h]=rr(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,u);const d=Di(h[0].x,h[1].x,h[2].x,h[3].x,n);return[h,f]=rr(h[0].x,h[0].y,h[1].x,h[1].y,h[2].x,h[2].y,h[3].x,h[3].y,d),{type:"cubic",moveTo:r,cp0x:h[0].x,cp0y:h[0].y,cp1x:h[1].x,cp1y:h[1].y,cp2x:h[2].x,cp2y:h[2].y,cp3x:h[3].x,cp3y:h[3].y}}case"multi-line":{const{midPoints:u}=e,f=u.findLastIndex(I=>I.x<=t);let h=u.findIndex(I=>I.x>=n);h===-1&&(h=u.length);const d=f>=0?u[f]:void 0,g=d?.x??s,y=d?.y??a,v=h(e[e.MoveTo=0]="MoveTo",e[e.LineTo=1]="LineTo",e[e.Skip=2]="Skip",e))(La||{});function dg(e){const t=[];let n=0,r=Number.NaN,i=Number.NaN;for(const{x:o,y:s}of e){if(n>0){const a=n===1;t.push({type:"linear",moveTo:a,x0:r,y0:i,x1:o,y1:s})}n+=1,r=o,i=s}return t}var gg={start:0,middle:.5,end:1};function pg(e,t){const n=[];let r=0,i=Number.NaN,o=Number.NaN;const s=typeof t=="number"?t:gg[t];for(const{x:a,y:l}of e){if(r>0){const c=r===1,u=i+(a-i)*s;n.push({type:"step",moveTo:c,x0:i,y0:o,x1:a,y1:l,stepX:u})}r+=1,i=a,o=l}return n}function yg(e,t){const n=Array.isArray(e)?e:Array.from(e);if(n.length<=1)return[];const r=.05,i=n.map((s,a)=>{const l=a===0?s:n[a-1],c=a===n.length-1?s:n[a+1],u=a===0||a===n.length-1;if(Math.sign(l.y-s.y)===Math.sign(c.y-s.y))return 0;if(!u){const f=Math.abs(l.y-c.y),h=Math.abs(s.y-l.y)/f,d=Math.abs(s.y-c.y)/f;if(h<=r||1-h<=r||d<=r||1-d<=r)return 0}return(c.y-l.y)/(c.x-l.x)});i[1]===0&&(i[0]*=2),i.at(-2)===0&&(i[i.length-1]*=2);const o=[];for(let s=1;sMath.abs(h)&&(d*=Math.abs(h/g),g=Math.sign(g)*Math.abs(h)),l===0&&Math.abs(v)>Math.abs(h)&&(y*=Math.abs(h/v),v=Math.sign(v)*Math.abs(h)),o.push({type:"cubic",moveTo:s===1,cp0x:a.x,cp0y:a.y,cp1x:a.x+d,cp1y:a.y+g,cp2x:c.x-y,cp2y:c.y-v,cp3x:c.x,cp3y:c.y})}return o}var Li=0,Ci=1;function mg(e){return{x:{min:e?.x?.min??Li,max:e?.x?.max??Ci},y:{min:e?.y?.min??Li,max:e?.y?.max??Ci}}}var bg=class extends gt{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},or={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 Ii(e,t=new Date(e.getFullYear(),0,1)){const n=e.getTimezoneOffset()-t.getTimezoneOffset(),r=e.getTime()-t.getTime()+n*6e4,i=36e5*24;return Math.floor(r/i)}function Ca(e,t){const r=new Date(e.getFullYear(),0,1).getDay(),i=(t-r+7)%7,o=new Date(e.getFullYear(),0,i+1);return o<=e?Math.floor(Ii(e,o)/7)+1:0}var vg=0,Ia=1,Ra=4;function Na(e,t=e.getFullYear()){const r=new Date(t,0,1).getDay(),i=(Ra-r+7)%7,o=new Date(t,0,i-(Ra-Ia)+1);return o<=e?Math.floor(Ii(e,o)/7)+1:Na(e,t-1)}function wg(e){const t=e.getTimezoneOffset(),n=Math.abs(t);return`${t>0?"-":"+"}${K(Math.floor(n/60),2,"0")}${K(Math.floor(n%60),2,"0")}`}var xg={a:e=>or.shortDays[e.getDay()],A:e=>or.days[e.getDay()],b:e=>or.shortMonths[e.getMonth()],B:e=>or.months[e.getMonth()],c:"%x, %X",d:(e,t)=>K(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>K(e.getMilliseconds()*1e3,6,t??"0"),H:(e,t)=>K(e.getHours(),2,t??"0"),I:(e,t)=>{const n=e.getHours()%12;return n===0?"12":K(n,2,t??"0")},j:(e,t)=>K(Ii(e)+1,3,t??"0"),m:(e,t)=>K(e.getMonth()+1,2,t??"0"),M:(e,t)=>K(e.getMinutes(),2,t??"0"),L:(e,t)=>K(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)=>K(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>K(Ca(e,vg),2,t??"0"),V:(e,t)=>K(Na(e),2,t??"0"),w:(e,t)=>K(e.getDay(),2,t??"0"),W:(e,t)=>K(Ca(e,Ia),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>K(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>K(e.getFullYear(),4,t??"0"),Z:e=>wg(e),"%":()=>"%"},Eg={_:" ",0:"0","-":""};function K(e,t,n){const r=String(Math.floor(e));return r.length>=t?r:`${n.repeat(t-r.length)}${r}`}function _a(e){const t=[];for(;e.length>0;){let n=e.indexOf("%");if(n!==0){const a=n>0?e.substring(0,n):e;t.push(a)}if(n<0)break;const r=e[n+1],i=Eg[r];i!=null&&n++;const o=e[n+1],s=xg[o];if(typeof s=="function")t.push([s,i]);else if(typeof s=="string"){const a=_a(s);t.push([a,i])}else t.push(`${i??""}${o}`);e=e.substring(n+2)}return n=>{const r=typeof n=="number"?new Date(n):n;return t.map(i=>typeof i=="string"?i:i[0](r,i[1])).join("")}}function Tg(e,t){const n=Ce("button",sr("ag-charts-input ag-charts-button",t));return e.label===void 0?(n.append(Pa(e.icon)),n.ariaLabel=e.altText):n.append(e.label),n.addEventListener("click",e.onPress),Jt(n,t),n}function Ag(e,t){const n=Ce("input",sr("ag-charts-input ag-charts-checkbox",t));return n.type="checkbox",n.checked=e.checked,n.addEventListener("change",r=>e.onChange(n.checked,r)),n.addEventListener("keydown",r=>{Js(r)&&(r.preventDefault(),n.click())}),Jt(n,t),n}function Og(e,t){const n=Ce("select",sr("ag-charts-input ag-charts-select",t));return n.append(...e.options.map(r=>{const i=Ce("option");return i.value=r.value,i.textContent=r.label,i})),yt(n,"data-preventdefault",!1),n.value=e.value,n.addEventListener("change",r=>e.onChange(n.value,r)),Jt(n,t),n}function Sg(e,t){const n=Ce("textarea",sr("ag-charts-input ag-charts-textarea",t));return n.value=e.value,n.addEventListener("input",r=>e.onChange(n.value,r)),Jt(n,t),yt(n,"data-preventdefault",!1),n}function Pa(e){const t=Ce("span",`ag-charts-icon ag-charts-icon-${e}`);return yt(t,"aria-hidden",!0),t}function sr(e,t){return t==null?e:`${e} ${t.class}`}var Mg=e=>e,Dg=e=>1-Math.cos(e*Math.PI/2),Fg=e=>Math.sin(e*Math.PI/2),kg=e=>-(Math.cos(e*Math.PI)-1)/2,$g=e=>e*e,Lg=e=>1-(1-e)**2,Cg=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,Ig=e=>2*Math.asin(e)/Math.PI,Ga=(e,t)=>e===t;function ar(e){return function(t,n){const r=`__${n}`;t[n]||Ri(t,n,r,e)}}function Rg(e){return ar(e)}function Ng(e){return ar(e)}function _g(e){const t=e??{};return t.equals=rt,ar(e)}function Pg(e){return function(t,n){const r=`__${n}`;t[n]||Ri(t,n,r,e)}}function Gg(e){return function(t,n){const r=`__${n}`;t[n]||Ri(t,n,r,e)}}function Ri(e,t,n,r){const{changeCb:i,convertor:o,checkDirtyOnAssignment:s=!1}=r??{},a={changeCb:i,checkDirtyOnAssignment:s,convertor:o},l=jg(n,Bg(Ug(Hg(n,a),a),a),a);function c(){return this[n]}Object.defineProperty(e,t,{set:l,get:c,enumerable:!0,configurable:!0})}function Ug(e,t){const{convertor:n}=t;if(n){let i=function(s){e.call(this,o(s))};var r=i;const o=n;return i}return e}var Ua=Symbol("no-change");function Bg(e,t){const{changeCb:n}=t;if(n){let i=function(s){const a=e.call(this,s);return a!==Ua&&o.call(this,this),a};var r=i;const o=n;return i}return e}function jg(e,t,n){const{checkDirtyOnAssignment:r}=n;if(r){let o=function(s){const a=t.call(this,s);return s?._dirty===!0&&this.markDirty(e),a};var i=o;return o}return t}function Hg(e,t){const{equals:n=Ga}=t;function r(i){const o=this[e];return n(i,o)?Ua:(this[e]=i,this.onChangeDetection(e),i)}return r}export{jn as AGGREGATION_INDEX_UNSET,ke as AGGREGATION_INDEX_X_MAX,Te as AGGREGATION_INDEX_X_MIN,Ve as AGGREGATION_INDEX_Y_MAX,We as AGGREGATION_INDEX_Y_MIN,ku as AGGREGATION_MAX_POINTS,Bn as AGGREGATION_MIN_RANGE,ze as AGGREGATION_SPAN,Jr as AGGREGATION_THRESHOLD,Fl as AbstractModuleInstance,ii as ActionOnSet,gh as AdjacencyListGraph,xf as AgDocument,$f as AsyncAwaitQueue,je as BASE_FONT_SIZE,$n as BREAK_TRANSFORM_CHAIN,gt as BaseProperties,Qt as Border,qf as CANVAS_HEIGHT,Kf as CANVAS_TO_BUFFER_DEFAULTS,zf as CANVAS_WIDTH,fs as CARTESIAN_AXIS_TYPE,us as CARTESIAN_POSITION,wf as CallbackCache,bg as ChangeDetectableProperties,ms as ChartAxisDirection,bs as ChartUpdateType,yr as CleanupRegistry,Nn as Color,Yf as ConfiguredCanvasMixin,lf as DEFAULT_ANNOTATION_HANDLE_FILL,ff as DEFAULT_ANNOTATION_STATISTICS_COLOR,hf as DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,df as DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,gf as DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,cf as DEFAULT_ANNOTATION_STATISTICS_FILL,uf as DEFAULT_ANNOTATION_STATISTICS_STROKE,ju as DEFAULT_CAPTION_ALIGNMENT,Bu as DEFAULT_CAPTION_LAYOUT_STYLE,of as DEFAULT_FIBONACCI_STROKES,af as DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,rf as DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,tf as DEFAULT_POLAR_SERIES_STROKE,Uu as DEFAULT_SHADOW_COLOUR,nf as DEFAULT_SPARKLINE_CROSSHAIR_STROKE,mf as DEFAULT_TEXTBOX_COLOR,pf as DEFAULT_TEXTBOX_FILL,yf as DEFAULT_TEXTBOX_STROKE,sf as DEFAULT_TEXT_ANNOTATION_COLOR,bf as DEFAULT_TOOLBAR_POSITION,eu as DIRECTION_SWAP_AXES,ji as Debug,eo as DebugMetrics,Pg as DeclaredSceneChangeDetection,Gg as DeclaredSceneObjectChangeDetection,th as Deprecated,nh as DeprecatedAndRenamedTo,Lt as EllipsisChar,wo as ErrorType,za as EventEmitter,iu as FILL_GRADIENT_BLANK_DEFAULTS,fu as FILL_GRADIENT_CONIC_SERIES_DEFAULTS,Kt as FILL_GRADIENT_LINEAR_DEFAULTS,ou as FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS,au as FILL_GRADIENT_LINEAR_KEYED_DEFAULTS,su as FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS,_n as FILL_GRADIENT_RADIAL_DEFAULTS,lu as FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS,uu as FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS,cu as FILL_GRADIENT_RADIAL_SERIES_DEFAULTS,yu as FILL_IMAGE_BLANK_DEFAULTS,ys as FILL_IMAGE_DEFAULTS,du as FILL_PATTERN_BLANK_DEFAULTS,Yt as FILL_PATTERN_DEFAULTS,gu as FILL_PATTERN_HIERARCHY_DEFAULTS,pu as FILL_PATTERN_KEYED_DEFAULTS,hu as FILL_PATTERN_SINGLE_DEFAULTS,cs as FONT_SIZE,Zc as FONT_SIZE_RATIO,Gu as IS_DARK_THEME,Gn as InterpolationProperties,bu as LABEL_BOXING_DEFAULTS,Tu as LEGEND_CONTAINER_THEME,ur as LRUCache,fn as LineSplitter,qi as Logger,wu as MARKER_SERIES_HIGHLIGHT_STYLE,vu as MULTI_SERIES_HIGHLIGHT_STYLE,Ou as MementoCaretaker,ro as ModuleRegistry,Ui as ModuleType,Gf as ObserveChanges,Qu as PALETTE_ALT_DOWN_FILL,Xu as PALETTE_ALT_DOWN_STROKE,Zu as PALETTE_ALT_NEUTRAL_FILL,ef as PALETTE_ALT_NEUTRAL_STROKE,Ju as PALETTE_ALT_UP_FILL,Yu as PALETTE_ALT_UP_STROKE,zu as PALETTE_DOWN_FILL,Wu as PALETTE_DOWN_STROKE,Ku as PALETTE_NEUTRAL_FILL,qu as PALETTE_NEUTRAL_STROKE,Vu as PALETTE_UP_FILL,Hu as PALETTE_UP_STROKE,xu as PART_WHOLE_HIGHLIGHT_STYLE,ds as POLAR_AXIS_SHAPE,hs as POLAR_AXIS_TYPE,tn as Padding,Uh as ParallelStateMachine,Es as PolarZIndexMap,Yr as PropertiesArray,oe as Property,Pf as ProxyOnWrite,_f as ProxyProperty,ri as ProxyPropertyOnWrite,nu as SAFE_FILLS_OPERATION,tu as SAFE_FILL_OPERATION,ru as SAFE_RANGE2_OPERATION,ps as SAFE_STROKE_FILL_OPERATION,Au as SEGMENTATION_DEFAULTS,Eu as SINGLE_SERIES_HIGHLIGHT_STYLE,Hr as SKIP_JS_BUILTINS,Bi as ScaleAlignment,_g as SceneArrayChangeDetection,ar as SceneChangeDetection,Ng as SceneObjectChangeDetection,Rg as SceneRefChangeDetection,xs as SeriesContentZIndexMap,ws as SeriesZIndexMap,Jf as SimpleCache,La as SpanJoin,Gh as StateMachine,Ph as StateMachineProperty,Ga as TRIPLE_EQ,ta as TextMeasurer,Ai as TickIntervals,so as TrimCharsRegex,Ct as TrimEdgeGuard,Ci as UNIT_MAX,Li as UNIT_MIN,xr as UnknownError,_e as ValidationError,Ea as Vec2,Oa as Vec4,Vs as Vertex,Qf as WeakCache,vs as ZIndexMap,qs as addEscapeEventListener,oe as addFakeTransformToInstanceProperty,bh as addMouseCloseListener,Pr as addObserverToInstanceProperty,wh as addOverrideFocusVisibleEventListener,vh as addTouchCloseListener,De as addTransformToInstanceProperty,Ru as aggregationBucketForDatum,Nu as aggregationDatumMatchesIndex,Iu as aggregationDomain,Ts as aggregationIndexForXRatio,ei as aggregationRangeFittingPoints,Hn as aggregationXRatioForDatumIndex,Wn as aggregationXRatioForXValue,ge as and,Df as angleBetween,Ff as angularPadding,br as appendEllipsis,Xf as applySkiaPatches,oh as arcDistanceSquared,lg as areScalingEqual,Tr as array,Gt as arrayLength,X as arrayOf,Se as arrayOfDefs,rt as arraysEqual,Jc as assignIfNotStrictlyEqual,$ as attachDescription,me as attachListener,Fn as autoSizedLabelOptionsDefs,Fc as barHighlightOptionsDef,rg as bezier2DDistance,ng as bezier2DExtrema,b as boolean,Ut as borderOptionsDef,Ls as boxCollides,Cs as boxContains,Uf as boxEmpty,Bf as boxesEqual,_a as buildDateFormatter,mt as cachedTextMeasurer,Xl as calcLineHeight,_h as calculatePlacement,Ss as callWithContext,R as callback,wn as callbackDefs,Ue as callbackOf,gc as ceilTo,xd as checkDatum,Ya as circularSliceArray,Z as clamp,Mu as clampArray,ia as clipLines,hg as clipSpanX,fg as collapseSpanToPoint,_u as collectAggregationLevels,F as color,Fr as colorStopsOrderValidator,An as colorUnion,ye as commonChartOptionsDefs,Dn as commonSeriesOptionsDefs,Ht as commonSeriesThemeableOptionsDefs,ni as compactAggregationIndices,Ns as compareDates,As as computeExtremesAggregation,Pu as computeExtremesAggregationPartial,Ge as constant,Yo as contextMenuItemsArray,Mo as countFractionDigits,ec as countLines,ti as createAggregationIndices,Tg as createButton,Is as createCanvasContext,Ag as createCheckbox,oi as createDeprecationWarning,Ce as createElement,Fh as createElementId,Pa as createIcon,Dh as createId,wd as createIdsGenerator,$o as createNumberFormatter,Og as createSelect,Bh as createSvgElement,Sg as createTextArea,ud as createTicks,ut as date,md as dateToNumber,vd as dateTruncationForDomain,_s as datesSortOrder,ic as debounce,Zh as decodeIntervalValue,qn as deepClone,os as deepFreeze,pa as defaultEpoch,ne as defined,mg as definedZoomState,rh as diffArrays,Za as distribute,jh as downloadUrl,Ja as dropFirstWhile,Qa as dropLastWhile,Ke as durationDay,qe as durationHour,Ie as durationMinute,wi as durationMonth,vt as durationSecond,aa as durationWeek,nn as durationYear,Dg as easeIn,kg as easeInOut,Cg as easeInOutQuad,$g as easeInQuad,Fg as easeOut,Lg as easeOutQuad,rd as encodedToTimestamp,pl as enterpriseRegistry,zt as entries,Pc as errorBarOptionsDefs,ts as errorBarThemeableOptionsDefs,yd as estimateTickCount,nr as evaluateBezier,Kc as every,Su as expandLegendPosition,Ps as extent,ns as extractDecoratedProperties,Va as extractDomain,re as fillCssOptionsDef,No as fillGradientDefaults,Po as fillImageDefaults,U as fillOptionsDef,_o as fillPatternDefaults,jf as findMaxIndex,Wf as findMaxValue,Hf as findMinIndex,Un as findMinMax,Vf as findMinValue,Du as findRangeExtent,Wc as first,no as flush,Ul as focusCursorAtEnd,Ho as fontFamilyFull,ie as fontOptionsDef,Wo as fontWeight,Bs as formatNumber,Jo as formatObjectValidator,ch as formatPercent,lh as formatValue,Yc as fromPairs,kh as generateUUID,dh as geoJson,Fs as getAngleRatioRadians,ks as getAttribute,rl as getDOMMatrix,ln as getDocument,Gl as getElementBBox,jl as getIconClassNames,il as getImage,Oh as getLastFocus,Ef as getMaxInnerRectSize,Vn as getMidpointsForIndices,Tf as getMinOuterRectSize,Hi as getOffscreenCanvas,jr as getPath,nl as getPath2D,Xs as getPrevNextKeys,ol as getResizeObserver,mu as getSequentialColors,hd as getTickTimeInterval,cn as getWindow,$r as googleFont,Tn as gradientColorStops,Sc as gradientStrict,Ee as graphemeSegments,vn as greaterThan,Ka as groupBy,go as guardTextEdges,fi as hasNoModifiers,xn as hasRequiredInPath,Uo as highlightOptionsDef,Eo as htmlElement,fc as inRange,Th as initRovingTabIndex,Zs as insertListItemsSorted,uc as instanceOf,Bc as interpolationOptionsDefs,sd as intervalAgo,qh as intervalCeil,ad as intervalEpoch,la as intervalExtent,Ye as intervalFloor,ca as intervalHierarchy,Qn as intervalMilliseconds,Yh as intervalNext,Kh as intervalPrevious,Jh as intervalRange,Xh as intervalRangeCount,Qh as intervalRangeNumeric,id as intervalRangeStartIndex,Ti as intervalStep,Ei as intervalUnit,Ig as inverseEaseOut,N as isArray,Ms as isBetweenAngles,co as isBoolean,Js as isButtonClickEvent,fo as isColor,xa as isContinuous,st as isDate,Cn as isDecoratedObject,dn as isDefined,gd as isDenseInterval,lo as isDirectionRtl,al as isDocumentFragment,hr as isElement,Vl as isEmptyObject,zl as isEnumKey,ql as isEnumValue,de as isFiniteNumber,xe as isFunction,Mi as isGradientFill,Qd as isGradientFillArray,tg as isGradientOrPatternFill,zi as isHTMLElement,mr as isHtmlElement,eg as isImageFill,Bl as isInputPending,dc as isInteger,Yl as isKeyOf,hc as isNegative,Vi as isNode,Rt as isNumber,Sr as isNumberEqual,wa as isNumberObject,q as isObject,Wl as isObjectLike,ss as isObjectWithProperty,Qc as isObjectWithStringProperty,Sa as isPatternFill,V as isPlainObject,og as isPointLabelDatum,pt as isProperties,uo as isRegExp,cg as isScaleValid,yo as isSegmentTruncated,we as isString,Zd as isStringFillArray,Oi as isStringObject,Kl as isSymbol,Nt as isTextTruncated,ld as isTimeInterval,cd as isTimeIntervalUnit,Zl as isTruncated,ir as isUnitTimeCategoryScaling,gn as isValidDate,ko as isValidNumberFormat,jc as iterate,lt as joinFormatted,zs as jsonApply,ai as jsonDiff,ph as jsonPropertyCompare,ci as jsonWalk,tc as kebabCase,Lr as labelBoxOptionsDef,Ir as legendPositionValidator,bn as lessThan,cc as lessThanOrEqual,bo as levenshteinDistance,j as lineDashOptionsDef,ih as lineDistanceSquared,kc as lineHighlightOptionsDef,jo as lineSegmentOptions,Cc as lineSegmentation,Mg as linear,Be as linearGaugeSeriesOptionsDef,as as linearGaugeSeriesThemeableOptionsDef,Vr as linearGaugeTargetOptionsDef,dg as linearPoints,Fe as listDecoratedProperties,ba as lowestGranularityForInterval,bd as lowestGranularityUnitForTicks,va as lowestGranularityUnitForValue,Ah as makeAccessibleClickListener,is as mapValues,_c as markerOptionsDefs,es as markerStyleOptionsDefs,na as measureTextSegments,Lh as memo,Br as merge,zc as mergeArrayDefaults,Ur as mergeDefaults,pc as modulus,$c as multiSeriesHighlightOptionsDef,Rh as nearestSquared,Nh as nearestSquaredInContainer,Xr as nextPowerOf2,pd as niceTicksDomain,Gs as normalisedExtentWithMetadata,sh as normalisedTimeExtentWithMetadata,Sf as normalizeAngle180,$e as normalizeAngle360,kf as normalizeAngle360FromDegrees,Of as normalizeAngle360Inclusive,m as number,jt as numberFormatValidator,Or as numberMin,To as numberRange,xo as object,Gr as objectsEqual,rs as objectsEqualWith,z as optionsDefs,G as or,Me as padding,Vo as paddingOptions,ao as parseColor,Dr as parseNumberFormat,Xc as partialAssign,Lf as pause,qc as pick,ag as placeLabels,p as positiveNumber,Ao as positiveNumberNonZero,vr as preserveArabicJoining,Fu as previousPowerOf2,Rn as radialGaugeSeriesOptionsDef,ls as radialGaugeSeriesThemeableOptionsDef,zr as radialGaugeTargetOptionsDef,ma as range,Sn as rangeValidator,C as ratio,Td as readIntegratedWrappedValue,to as record,A as required,$i as rescaleSpan,sa as rescaleVisibleRange,Mh as resetIds,Af as rotatePoint,Mr as roundTo,wr as safeCall,Wt as seriesLabelOptionsDefs,qo as seriesTooltipRangeValidator,yt as setAttribute,Jt as setAttributes,el as setDocument,Pl as setElementBBox,$s as setElementStyle,Nf as setElementStyles,Wr as setPath,tl as setWindow,Uc as shadowOptionsDefs,li as shallowClone,Go as shapeHighlightOptionsDef,Bo as shapeSegmentOptions,Lc as shapeSegmentation,ht as shapeValidator,Ih as simpleMemorize,Ch as simpleMemorize2,yg as smoothPoints,Di as solveBezier,eh as sortAndUniqueDates,Xa as sortBasedOnArray,ki as spanRange,rr as splitBezier2D,pg as stepPoints,Sh as stopPageScrolling,Vc as strictObjectKeys,Oo as strictUnion,O as string,Ar as stringLength,_t as stringifyValue,k as strokeOptionsDef,dt as textOrSegments,Ro as themeOperator,oc as throttle,dd as tickFormat,Zn as tickStep,Zo as timeInterval,Nr as timeIntervalUnit,fr as toArray,Mf as toDegrees,ho as toFontString,Hc as toIterable,rc as toPlainText,Ds as toRadians,at as toTextString,Xo as toolbarButtonOptionsDefs,kn as tooltipOptionsDefs,Gc as tooltipOptionsDefsWithArea,Ed as transformIntegratedCategoryValue,bt as truncateLine,Er as typeUnion,D as undocumented,po as unguardTextEdges,x as union,mn as unionSymbol,qa as unique,Pe as validate,Cf as withTimeout,qt as without,vi as wrapLines,Wh as wrapText,Hh as wrapTextOrSegments,oa as wrapTextSegments};