diff --git a/.nojekyll b/.nojekyll
new file mode 100644
index 0000000..e69de29
diff --git a/examples/assets/1601/valueIndicators1.png b/examples/assets/1601/valueIndicators1.png
new file mode 100644
index 0000000..1737460
Binary files /dev/null and b/examples/assets/1601/valueIndicators1.png differ
diff --git a/examples/assets/1601/valueIndicators2.png b/examples/assets/1601/valueIndicators2.png
new file mode 100644
index 0000000..3a6c9d2
Binary files /dev/null and b/examples/assets/1601/valueIndicators2.png differ
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..3a6eeca
--- /dev/null
+++ b/index.html
@@ -0,0 +1 @@
+
app
\ No newline at end of file
diff --git a/js/app.7975e44c76cff7854701.bundle.js b/js/app.7975e44c76cff7854701.bundle.js
new file mode 100644
index 0000000..42a5b6d
--- /dev/null
+++ b/js/app.7975e44c76cff7854701.bundle.js
@@ -0,0 +1 @@
+(self.webpackChunk=self.webpackChunk||[]).push([[524],{44:(e,t,s)=>{const a=s(377),{lightningChart:n,Themes:o}=a,r=n({resourcesBaseUrl:new URL(document.head.baseURI).origin+new URL(document.head.baseURI).pathname+"resources/"}).Gauge({theme:o[new URLSearchParams(window.location.search).get("theme")||"darkGold"]||void 0}).setTitle("Temperature").setUnitLabel("°C").setInterval(-20,20).setGapBetweenBarAndValueIndicators(2),h=[],c=r.getTheme().examples.coldHotColorPalette,i=40/c.length;c.forEach(((e,t)=>{h.push({start:Math.round(i*t-20),end:Math.round(i*(t+1)-20),color:e})})),r.setValueIndicators(h),r.onResize(((e,t,s)=>{const a=Math.min(t,s);r.setBarThickness(a/10).setNeedleLength(2*r.getBarThickness()).setValueIndicatorThickness(r.getBarThickness()/3).setNeedleThickness(r.getBarThickness()/10);const n=Math.round(a/10),o=Math.round(a/20);r.setUnitLabelFont((e=>e.setSize(o))),r.setTickFont((e=>e.setSize(o))),r.setValueLabelFont((e=>e.setSize(n)))})),setInterval((()=>{r.setValue(40*Math.random()-20)}),2e3)}},e=>{e.O(0,[502],(()=>e(e.s=44))),e.O()}]);
\ No newline at end of file
diff --git a/js/runtime.acfb680ff94592dde9f0.bundle.js b/js/runtime.acfb680ff94592dde9f0.bundle.js
new file mode 100644
index 0000000..cab9d41
--- /dev/null
+++ b/js/runtime.acfb680ff94592dde9f0.bundle.js
@@ -0,0 +1 @@
+(()=>{"use strict";var e,r={},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,e=[],o.O=(r,t,n,i)=>{if(!t){var l=1/0;for(s=0;s=i)&&Object.keys(o.O).every((e=>o.O[e](t[f])))?t.splice(f--,1):(a=!1,i0&&e[s-1][2]>i;s--)e[s]=e[s-1];e[s]=[t,n,i]},o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={121:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var n,i,[l,a,f]=t,u=0;if(l.some((r=>0!==e[r]))){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);if(f)var s=f(o)}for(r&&r(t);u{i.r(e),i.d(e,{EventError:()=>o,Eventer:()=>u,TokenFactory:()=>h});var s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},s(t,e)};function r(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var s,r,n=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o}var o=function(t){function e(i){var s,r="EventError: "+i+"}";return s=t.call(this,r)||this,Object.setPrototypeOf(s,e.prototype),s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e}(Error),h=function(t,e){return{token:t+"-"+e,ownerIndex:t,id:e}},a=0,l=function(t,e){return new o("Event listener with "+t.token+" id does not exist at Eventer with "+e+" id.")},u=function(){function t(){this.id=++a,this.lastEventIndex=0,this.topics=new Map}return t.prototype.on=function(t,e,i){var s=this.topics.get(t),r=i||h(this.id,this.lastEventIndex+=1);return s?s.set(r,e):this.topics.set(t,new Map([[r,e]])),r},t.prototype.has=function(t,e){var i,s;if(e)return(u=this.topics.get(e))?(c=u.get(t))||l(t,this.id):new o("Eventer with "+t.ownerIndex+" does not have "+e+".");try{for(var h=r(this.topics),a=h.next();!a.done;a=h.next()){var u,c,d=n(a.value,2);if(d[0],c=(u=d[1]).get(t))return c}}catch(t){i={error:t}}finally{try{a&&!a.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}return l(t,this.id)},t.prototype.off=function(t,e){var i,s;if(e)return!(!(a=this.topics.get(e))||!a.delete(t));try{for(var o=r(this.topics),h=o.next();!h.done;h=o.next()){var a,l=n(h.value,2);if(l[0],(a=l[1]).delete(t))return!0}}catch(t){i={error:t}}finally{try{h&&!h.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}return!1},t.prototype.allOff=function(){return this.topics.clear(),this},t.prototype.topicOff=function(t){return this.topics.delete(t)},t.prototype.emit=function(t){for(var e=[],i=1;i{function e(t,e,s){s=s||2;var n,o,h,a,c,d,g,y=e&&e.length,m=y?e[0]*s:t.length,p=i(t,0,m,s,!0),x=[];if(!p||p.next===p.prev)return x;if(y&&(p=function(t,e,s,r){var n,o,h,a=[];for(n=0,o=e.length;n80*s){n=h=t[0],o=a=t[1];for(var A=s;Ah&&(h=c),d>a&&(a=d);g=0!==(g=Math.max(h-n,a-o))?32767/g:0}return r(p,x,s,n,o,g,0),x}function i(t,e,i,s,r){var n,o;if(r===T(t,e,i,s)>0)for(n=e;n=e;n-=s)o=M(n,t[n],t[n+1],o);return o&&p(o,o.next)&&(w(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!p(s,s.next)&&0!==m(s.prev,s,s.next))s=s.next;else{if(w(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function r(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var r=t;do{0===r.z&&(r.z=d(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,s,r,n,o,h,a,l=1;do{for(i=t,t=null,n=null,o=0;i;){for(o++,s=i,h=0,e=0;e0||a>0&&s;)0!==h&&(0===a||!s||i.z<=s.z)?(r=i,i=i.nextZ,h--):(r=s,s=s.nextZ,a--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(o>1)}(r)}(t,l,u,c);for(var g,y,m=t;t.prev!==t.next;)if(g=t.prev,y=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(y.i/i|0),w(t),t=y.next,m=y.next;else if((t=y)===m){f?1===f?r(t=h(s(t),e,i),e,i,l,u,c,2):2===f&&a(t,e,i,l,u,c):r(s(t),e,i,l,u,c,1);break}}}function n(t){var e=t.prev,i=t,s=t.next;if(m(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,o=s.x,h=e.y,a=i.y,l=s.y,u=rn?r>o?r:o:n>o?n:o,f=h>a?h>l?h:l:a>l?a:l,y=s.next;y!==e;){if(y.x>=u&&y.x<=d&&y.y>=c&&y.y<=f&&g(r,h,n,a,o,l,y.x,y.y)&&m(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(m(r,n,o)>=0)return!1;for(var h=r.x,a=n.x,l=o.x,u=r.y,c=n.y,f=o.y,y=ha?h>l?h:l:a>l?a:l,A=u>c?u>f?u:f:c>f?c:f,S=d(y,p,e,i,s),v=d(x,A,e,i,s),b=t.prevZ,M=t.nextZ;b&&b.z>=S&&M&&M.z<=v;){if(b.x>=y&&b.x<=x&&b.y>=p&&b.y<=A&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,M.x>=y&&M.x<=x&&M.y>=p&&M.y<=A&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;b&&b.z>=S;){if(b.x>=y&&b.x<=x&&b.y>=p&&b.y<=A&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&m(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;M&&M.z<=v;){if(M.x>=y&&M.x<=x&&M.y>=p&&M.y<=A&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function h(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!p(n,o)&&x(n,r,r.next,o)&&v(n,o)&&v(o,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),w(r),w(r.next),r=t=o),r=r.next}while(r!==t);return s(r)}function a(t,e,i,n,o,h){var a=t;do{for(var l=a.next.next;l!==a.prev;){if(a.i!==l.i&&y(a,l)){var u=b(a,l);return a=s(a,a.next),u=s(u,u.next),r(a,e,i,n,o,h,0),void r(u,e,i,n,o,h,0)}l=l.next}a=a.next}while(a!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,r=t.x,n=t.y,o=-1/0;do{if(n<=s.y&&n>=s.next.y&&s.next.y!==s.y){var h=s.x+(n-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(h<=r&&h>o&&(o=h,i=s.x=s.x&&s.x>=u&&r!==s.x&&g(ni.x||s.x===i.x&&c(i,s)))&&(i=s,f=a)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var r=b(i,t);return s(r,r.next),s(i,i.next)}function c(t,e){return m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function d(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(n-h)&&(t-o)*(s-h)>=(i-o)*(e-h)&&(i-o)*(n-h)>=(r-o)*(s-h)}function y(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(v(t,e)&&v(e,t)&&function(t,e){var i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||p(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function p(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,s){var r=S(m(t,e,i)),n=S(m(t,e,s)),o=S(m(i,s,t)),h=S(m(i,s,e));return r!==n&&o!==h||!(0!==r||!A(t,i,e))||!(0!==n||!A(t,s,e))||!(0!==o||!A(i,t,s))||!(0!==h||!A(i,e,s))}function A(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function S(t){return t>0?1:t<0?-1:0}function v(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function b(t,e){var i=new C(t.i,t.x,t.y),s=new C(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function M(t,e,i,s){var r=new C(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function w(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function C(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(t,e,i,s){for(var r=0,n=e,o=i-s;n0&&(s+=t[r-1].length,i.holes.push(s))}return i}},568:(t,e,i)=>{i.r(e),i.d(e,{Collection:()=>C,Iterable:()=>Rs,List:()=>ai,Map:()=>ze,OrderedMap:()=>bi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>Hi,Record:()=>ys,Repeat:()=>bs,Seq:()=>Q,Set:()=>Ni,Stack:()=>Ei,default:()=>Es,fromJS:()=>Ms,get:()=>ae,getIn:()=>Wi,has:()=>he,hasIn:()=>Ki,hash:()=>pt,is:()=>ft,isAssociative:()=>w,isCollection:()=>A,isImmutable:()=>P,isIndexed:()=>M,isKeyed:()=>v,isList:()=>hi,isMap:()=>ut,isOrdered:()=>V,isOrderedMap:()=>ct,isOrderedSet:()=>Vi,isPlainObject:()=>re,isRecord:()=>D,isSeq:()=>I,isSet:()=>Li,isStack:()=>Ri,isValueObject:()=>dt,merge:()=>we,mergeDeep:()=>Te,mergeDeepWith:()=>Re,mergeWith:()=>Ce,remove:()=>ue,removeIn:()=>me,set:()=>ce,setIn:()=>ge,update:()=>xe,updateIn:()=>de,version:()=>Ts});var s="delete",r=5,n=1<>>0;if(""+i!==e||4294967295===i)return NaN;e=i}return e<0?u(t)+e:e}function d(){return!0}function f(t,e,i){return(0===t&&!p(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function g(t,e){return m(t,e,0)}function y(t,e){return m(t,e,e)}function m(t,e,i){return void 0===t?i:p(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function p(t){return t<0||0===t&&1/t==-1/0}var x="@@__IMMUTABLE_ITERABLE__@@";function A(t){return Boolean(t&&t[x])}var S="@@__IMMUTABLE_KEYED__@@";function v(t){return Boolean(t&&t[S])}var b="@@__IMMUTABLE_INDEXED__@@";function M(t){return Boolean(t&&t[b])}function w(t){return v(t)||M(t)}var C=function(t){return A(t)?t:Q(t)},T=function(t){function e(t){return v(t)?t:q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C),R=function(t){function e(t){return M(t)?t:J(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C),E=function(t){function e(t){return A(t)&&!w(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(C);C.Keyed=T,C.Indexed=R,C.Set=E;var k="@@__IMMUTABLE_SEQ__@@";function I(t){return Boolean(t&&t[k])}var F="@@__IMMUTABLE_RECORD__@@";function D(t){return Boolean(t&&t[F])}function P(t){return A(t)||D(t)}var L="@@__IMMUTABLE_ORDERED__@@";function V(t){return Boolean(t&&t[L])}var _=0,B=1,z=2,N="function"==typeof Symbol&&Symbol.iterator,O="@@iterator",U=N||O,Y=function(t){this.next=t};function G(t,e,i,s){var r=0===t?e:1===t?i:[e,i];return s?s.value=r:s={value:r,done:!1},s}function X(){return{value:void 0,done:!0}}function Z(t){return!!Array.isArray(t)||!!j(t)}function H(t){return t&&"function"==typeof t.next}function W(t){var e=j(t);return e&&e.call(t)}function j(t){var e=t&&(N&&t[N]||t[O]);if("function"==typeof e)return e}Y.prototype.toString=function(){return"[Iterator]"},Y.KEYS=_,Y.VALUES=B,Y.ENTRIES=z,Y.prototype.inspect=Y.prototype.toSource=function(){return this.toString()},Y.prototype[U]=function(){return this};var K=Object.prototype.hasOwnProperty;function $(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var Q=function(t){function e(t){return null==t?nt():P(t)?t.toSeq():function(t){var e,i,s=at(t);if(s)return(i=j(e=t))&&i===e.entries?s.fromEntrySeq():function(t){var e=j(t);return e&&e===t.keys}(t)?s.toSetSeq():s;if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var i=this._cache;if(i){for(var s=i.length,r=0;r!==s;){var n=i[e?s-++r:r++];if(!1===t(n[1],n[0],this))break}return r}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var i=this._cache;if(i){var s=i.length,r=0;return new Y((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return G(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(C),q=function(t){function e(t){return null==t?nt().toKeyedSeq():A(t)?v(t)?t.toSeq():t.fromEntrySeq():D(t)?t.toSeq():ot(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(Q),J=function(t){function e(t){return null==t?nt():A(t)?v(t)?t.entrySeq():t.toIndexedSeq():D(t)?t.toSeq().entrySeq():ht(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(Q),tt=function(t){function e(t){return(A(t)&&!w(t)?t:J(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(Q);Q.isSeq=I,Q.Keyed=q,Q.Set=tt,Q.Indexed=J,Q.prototype[k]=!0;var et=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[c(this,t)]:e},e.prototype.__iterate=function(t,e){for(var i=this._array,s=i.length,r=0;r!==s;){var n=e?s-++r:r++;if(!1===t(i[n],n,this))break}return r},e.prototype.__iterator=function(t,e){var i=this._array,s=i.length,r=0;return new Y((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return G(t,n,i[n])}))},e}(J),it=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return K.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var i=this._object,s=this._keys,r=s.length,n=0;n!==r;){var o=s[e?r-++n:n++];if(!1===t(i[o],o,this))break}return n},e.prototype.__iterator=function(t,e){var i=this._object,s=this._keys,r=s.length,n=0;return new Y((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return G(t,o,i[o])}))},e}(q);it.prototype[L]=!0;var st,rt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var i=W(this._collection),s=0;if(H(i))for(var r;!(r=i.next()).done&&!1!==t(r.value,s++,this););return s},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var i=W(this._collection);if(!H(i))return new Y(X);var s=0;return new Y((function(){var e=i.next();return e.done?e:G(t,s++,e.value)}))},e}(J);function nt(){return st||(st=new et([]))}function ot(t){var e=at(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ht(t){var e=at(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function at(t){return $(t)?new et(t):Z(t)?new rt(t):void 0}var lt="@@__IMMUTABLE_MAP__@@";function ut(t){return Boolean(t&&t[lt])}function ct(t){return ut(t)&&V(t)}function dt(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function ft(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(dt(t)&&dt(e)&&t.equals(e))}var gt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var i=65535&(t|=0),s=65535&(e|=0);return i*s+((t>>>16)*s+i*(e>>>16)<<16>>>0)|0};function yt(t){return t>>>1&1073741824|3221225471&t}var mt=Object.prototype.valueOf;function pt(t){if(null==t)return xt(t);if("function"==typeof t.hashCode)return yt(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==mt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return xt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return yt(e)}(r);case"string":return r.length>Et?(void 0===(s=Ft[i=r])&&(s=At(i),It===kt&&(It=0,Ft={}),It++,Ft[i]=s),s):At(r);case"object":case"function":return function(t){var e;if(wt&&void 0!==(e=Mt.get(t)))return e;if(void 0!==(e=t[Rt]))return e;if(!vt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Rt]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=bt(),wt)Mt.set(t,e);else{if(void 0!==St&&!1===St(t))throw new Error("Non-extensible objects are not allowed as keys.");if(vt)Object.defineProperty(t,Rt,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Rt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Rt]=e}}return e}(r);case"symbol":return function(t){var e=Ct[t];return void 0!==e||(e=bt(),Ct[t]=e),e}(r);default:if("function"==typeof r.toString)return At(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function xt(t){return null===t?1108378658:1108378659}function At(t){for(var e=0,i=0;i=0&&(a.get=function(e,i){return(e=c(this,e))>=0&&en)return{value:void 0,done:!0};var t=r.next();return s||e===B||t.done?t:G(e,a-1,e===_?void 0:t.value[1],t)}))},a}function Ut(t,e,i,s){var r=$t(t);return r.__iterateUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterate(r,n);var h=!0,a=0;return t.__iterate((function(t,n,l){if(!h||!(h=e.call(i,t,n,l)))return a++,r(t,s?n:a-1,o)})),a},r.__iteratorUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterator(r,n);var h=t.__iterator(z,n),a=!0,l=0;return new Y((function(){var t,n,u;do{if((t=h.next()).done)return s||r===B?t:G(r,l++,r===_?void 0:t.value[1],t);var c=t.value;n=c[0],u=c[1],a&&(a=e.call(i,u,n,o))}while(a);return r===z?t:G(r,n,u,t)}))},r}function Yt(t,e,i){var s=$t(t);return s.__iterateUncached=function(r,n){if(n)return this.cacheResult().__iterate(r,n);var o=0,h=!1;return function t(a,l){a.__iterate((function(n,a){return(!e||l0}function Ht(t,e,i,s){var r=$t(t),n=new et(i).map((function(t){return t.size}));return r.size=s?n.max():n.min(),r.__iterate=function(t,e){for(var i,s=this.__iterator(B,e),r=0;!(i=s.next()).done&&!1!==t(i.value,r++,this););return r},r.__iteratorUncached=function(t,r){var n=i.map((function(t){return t=C(t),W(r?t.reverse():t)})),o=0,h=!1;return new Y((function(){var i;return h||(i=n.map((function(t){return t.next()})),h=s?i.every((function(t){return t.done})):i.some((function(t){return t.done}))),h?{value:void 0,done:!0}:G(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function Wt(t,e){return t===e?t:I(t)?e:t.constructor(e)}function jt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Kt(t){return v(t)?T:M(t)?R:E}function $t(t){return Object.create((v(t)?q:M(t)?J:tt).prototype)}function Qt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Q.prototype.cacheResult.call(this)}function qt(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t0;)e[i]=arguments[i+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return Me(this,e,t)}function Me(t,e,i){for(var s=[],r=0;r0;)e[i]=arguments[i+1];return ke(t,e)}function Ce(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return ke(e,i,t)}function Te(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Ee(t,e)}function Re(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Ee(e,i,t)}function Ee(t,e,i){return ke(t,e,function(t){return function e(i,s,r){return ne(i)&&ne(s)&&(n=s,o=Q(i),h=Q(n),M(o)===M(h)&&v(o)===v(h))?ke(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function ke(t,e,i){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(P(t))return"function"==typeof i&&t.mergeWith?t.mergeWith.apply(t,[i].concat(e)):t.merge?t.merge.apply(t,e):t.concat.apply(t,e);for(var s=Array.isArray(t),r=t,n=s?R:T,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=K.call(r,s),o=n&&i?i(r[s],e,s):e;n&&o===r[s]||(r===t&&(r=le(r)),r[s]=o)},h=0;h0;)e[i]=arguments[i+1];return Ee(this,e,t)}function De(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,$e(),(function(t){return ke(t,e)}))}function Pe(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,$e(),(function(t){return Ee(t,e)}))}function Le(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Ve(){return this.__ownerID?this:this.__ensureOwner(new l)}function _e(){return this.__ensureOwner()}function Be(){return this.__altered}var ze=function(t){function e(e){return null==e?$e():ut(e)&&!V(e)?e:$e().withMutations((function(i){var s=t(e);ee(s.size),s.forEach((function(t,e){return i.set(e,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return $e().withMutations((function(e){for(var i=0;i=t.length)throw new Error("Missing value for key: "+t[i]);e.set(t[i],t[i+1])}}))},e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},e.prototype.set=function(t,e){return Qe(this,t,e)},e.prototype.remove=function(t){return Qe(this,t,h)},e.prototype.deleteAll=function(t){var e=C(t);return 0===e.size?this:this.withMutations((function(t){e.forEach((function(e){return t.remove(e)}))}))},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):$e()},e.prototype.sort=function(t){return bi(Gt(this,t))},e.prototype.sortBy=function(t,e){return bi(Gt(this,e,t))},e.prototype.map=function(t,e){var i=this;return this.withMutations((function(s){s.forEach((function(r,n){s.set(n,t.call(e,r,n,i))}))}))},e.prototype.__iterator=function(t,e){return new He(this,t,e)},e.prototype.__iterate=function(t,e){var i=this,s=0;return this._root&&this._root.iterate((function(e){return s++,t(e[1],e[0],i)}),e),s},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ke(this.size,this._root,t,this.__hash):0===this.size?$e():(this.__ownerID=t,this.__altered=!1,this)},e}(T);ze.isMap=ut;var Ne=ze.prototype;Ne[lt]=!0,Ne[s]=Ne.remove,Ne.removeAll=Ne.deleteAll,Ne.setIn=ye,Ne.removeIn=Ne.deleteIn=pe,Ne.update=Ae,Ne.updateIn=Se,Ne.merge=Ne.concat=ve,Ne.mergeWith=be,Ne.mergeDeep=Ie,Ne.mergeDeepWith=Fe,Ne.mergeIn=De,Ne.mergeDeepIn=Pe,Ne.withMutations=Le,Ne.wasAltered=Be,Ne.asImmutable=_e,Ne["@@transducer/init"]=Ne.asMutable=Ve,Ne["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ne["@@transducer/result"]=function(t){return t.asImmutable()};var Oe=function(t,e){this.ownerID=t,this.entries=e};Oe.prototype.get=function(t,e,i,s){for(var r=this.entries,n=0,o=r.length;n=si)return function(t,e,i,s){t||(t=new l);for(var r=new Xe(t,pt(i),[i,s]),n=0;n>>t)&o),h=this.bitmap;return h&n?this.nodes[ei(h&n-1)].get(t+r,e,i,s):s},Ue.prototype.update=function(t,e,i,s,a,l,u){void 0===i&&(i=pt(s));var c=(0===e?i:i>>>e)&o,d=1<=ri)return function(t,e,i,s,r){for(var o=0,h=new Array(n),a=0;0!==i;a++,i>>>=1)h[a]=1&i?e[o++]:void 0;return h[s]=r,new Ye(t,o+1,h)}(t,m,f,c,x);if(g&&!x&&2===m.length&&Je(m[1^y]))return m[1^y];if(g&&x&&1===m.length&&Je(x))return x;var A=t&&t===this.ownerID,S=g?x?f:f^d:f|d,v=g?x?ii(m,y,x,A):function(t,e,i){var s=t.length-1;if(i&&e===s)return t.pop(),t;for(var r=new Array(s),n=0,o=0;o>>t)&o,h=this.nodes[n];return h?h.get(t+r,e,i,s):s},Ye.prototype.update=function(t,e,i,s,n,a,l){void 0===i&&(i=pt(s));var u=(0===e?i:i>>>e)&o,c=n===h,d=this.nodes,f=d[u];if(c&&!f)return this;var g=qe(f,t,e+r,i,s,n,a,l);if(g===f)return this;var y=this.count;if(f){if(!g&&--y>>i)&o,l=(0===i?s:s>>>i)&o,u=a===l?[ti(t,e,i+r,s,n)]:(h=new Xe(e,s,n),a>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function ii(t,e,i,s){var r=s?t:Jt(t);return r[e]=i,r}var si=n/4,ri=n/2,ni=n/4,oi="@@__IMMUTABLE_LIST__@@";function hi(t){return Boolean(t&&t[oi])}var ai=function(t){function e(e){var i=yi();if(null==e)return i;if(hi(e))return e;var s=t(e),o=s.size;return 0===o?i:(ee(o),o>0&&o=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?Ai(t,e).set(0,i):Ai(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=Si(t._capacity)?s=mi(s,t.__ownerID,0,e,i,n):r=mi(r,t.__ownerID,t._level,e,i,n),n.value?t.__ownerID?(t._root=r,t._tail=s,t.__hash=void 0,t.__altered=!0,t):gi(t._origin,t._capacity,t._level,r,s):t}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=r,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):yi()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){Ai(i,0,e+t.length);for(var s=0;s>>e&o;if(s>=this.array.length)return new ui([],t);var n,h=0===s;if(e>0){var a=this.array[s];if((n=a&&a.removeBefore(t,e-r,i))===a&&h)return this}if(h&&!n)return this;var l=pi(this,t);if(!h)for(var u=0;u>>e&o;if(n>=this.array.length)return this;if(e>0){var h=this.array[n];if((s=h&&h.removeAfter(t,e-r,i))===h&&n===this.array.length-1)return this}var a=pi(this,t);return a.array.splice(n+1),s&&(a.array[n]=s),a};var ci,di={};function fi(t,e){var i=t._origin,s=t._capacity,o=Si(s),h=t._tail;return function t(a,l,u){return 0===l?function(t,r){var a=r===o?h&&h.array:t&&t.array,l=r>i?0:i-r,u=s-r;return u>n&&(u=n),function(){if(l===u)return di;var t=e?--u:l++;return a&&a[t]}}(a,u):function(o,h,a){var l,u=o&&o.array,c=a>i?0:i-a>>h,d=1+(s-a>>h);return d>n&&(d=n),function(){for(;;){if(l){var i=l();if(i!==di)return i;l=null}if(c===d)return di;var s=e?--d:c++;l=t(u&&u[s],h-r,a+(s<>>i&o,c=t&&u0){var d=t&&t.array[u],f=mi(d,e,i-r,s,n,h);return f===d?t:((l=pi(t,e)).array[u]=f,l)}return c&&t.array[u]===n?t:(h&&a(h),l=pi(t,e),void 0===n&&u===l.array.length-1?l.array.pop():l.array[u]=n,l)}function pi(t,e){return e&&t&&e===t.ownerID?t:new ui(t?t.array.slice():[],e)}function xi(t,e){if(e>=Si(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&o],s-=r;return i}}function Ai(t,e,i){void 0!==e&&(e|=0),void 0!==i&&(i|=0);var s=t.__ownerID||new l,n=t._origin,h=t._capacity,a=n+e,u=void 0===i?h:i<0?h+i:n+i;if(a===n&&u===h)return t;if(a>=u)return t.clear();for(var c=t._level,d=t._root,f=0;a+f<0;)d=new ui(d&&d.array.length?[void 0,d]:[],s),f+=1<<(c+=r);f&&(a+=f,n+=f,u+=f,h+=f);for(var g=Si(h),y=Si(u);y>=1<g?new ui([],s):m;if(m&&y>g&&ar;A-=r){var S=g>>>A&o;x=x.array[S]=pi(x.array[S],s)}x.array[g>>>r&o]=m}if(u=y)a-=y,u-=y,c=r,d=null,p=p&&p.removeBefore(s,0,a);else if(a>n||y>>c&o;if(v!==y>>>c&o)break;v&&(f+=(1<n&&(d=d.removeBefore(s,c,a-f)),d&&y>>r<=n&&a.size>=2*o.size?(s=(r=a.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=r.__ownerID=t.__ownerID)):(s=o.remove(e),r=l===a.size-1?a.pop():a.set(l,void 0))}else if(u){if(i===a.get(l)[1])return t;s=o,r=a.set(l,[e,i])}else s=o.set(e,a.size),r=a.set(a.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=r,t.__hash=void 0,t.__altered=!0,t):Mi(s,r)}bi.isOrderedMap=ct,bi.prototype[L]=!0,bi.prototype[s]=bi.prototype.remove;var Ti="@@__IMMUTABLE_STACK__@@";function Ri(t){return Boolean(t&&t[Ti])}var Ei=function(t){function e(t){return null==t?Di():Ri(t)?t:Di().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var i=this._head;for(t=c(this,t);i&&t--;)i=i.next;return i?i.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,i=this._head,s=arguments.length-1;s>=0;s--)i={value:t[s],next:i};return this.__ownerID?(this.size=e,this._head=i,this.__hash=void 0,this.__altered=!0,this):Fi(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&Ri(e))return e;ee(e.size);var i=this.size,s=this._head;return e.__iterate((function(t){i++,s={value:t,next:s}}),!0),this.__ownerID?(this.size=i,this._head=s,this.__hash=void 0,this.__altered=!0,this):Fi(i,s)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Di()},e.prototype.slice=function(e,i){if(f(e,i,this.size))return this;var s=g(e,this.size);if(y(i,this.size)!==this.size)return t.prototype.slice.call(this,e,i);for(var r=this.size-s,n=this._head;s--;)n=n.next;return this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Fi(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Fi(this.size,this._head,t,this.__hash):0===this.size?Di():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var i=this;if(e)return new et(this.toArray()).__iterate((function(e,s){return t(e,s,i)}),e);for(var s=0,r=this._head;r&&!1!==t(r.value,s++,this);)r=r.next;return s},e.prototype.__iterator=function(t,e){if(e)return new et(this.toArray()).__iterator(t,e);var i=0,s=this._head;return new Y((function(){if(s){var e=s.value;return s=s.next,G(t,i++,e)}return{value:void 0,done:!0}}))},e}(R);Ei.isStack=Ri;var ki,Ii=Ei.prototype;function Fi(t,e,i,s){var r=Object.create(Ii);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Di(){return ki||(ki=Fi(0))}Ii[Ti]=!0,Ii.shift=Ii.pop,Ii.unshift=Ii.push,Ii.unshiftAll=Ii.pushAll,Ii.withMutations=Le,Ii.wasAltered=Be,Ii.asImmutable=_e,Ii["@@transducer/init"]=Ii.asMutable=Ve,Ii["@@transducer/step"]=function(t,e){return t.unshift(e)},Ii["@@transducer/result"]=function(t){return t.asImmutable()};var Pi="@@__IMMUTABLE_SET__@@";function Li(t){return Boolean(t&&t[Pi])}function Vi(t){return Li(t)&&V(t)}function _i(t,e){if(t===e)return!0;if(!A(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||v(t)!==v(e)||M(t)!==M(e)||V(t)!==V(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!w(t);if(V(t)){var s=t.entries();return e.every((function(t,e){var r=s.next().value;return r&&ft(r[1],t)&&(i||ft(r[0],e))}))&&s.next().done}var r=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{r=!0;var n=t;t=e,e=n}var o=!0,a=e.__iterate((function(e,s){if(i?!t.has(e):r?!ft(e,t.get(s,h)):!ft(t.get(s,h),e))return o=!1,!1}));return o&&t.size===a}function Bi(t,e){var i=function(i){t.prototype[i]=e[i]};return Object.keys(e).forEach(i),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(i),t}function zi(t){if(!t||"object"!=typeof t)return t;if(!A(t)){if(!ne(t))return t;t=Q(t)}if(v(t)){var e={};return t.__iterate((function(t,i){e[i]=zi(t)})),e}var i=[];return t.__iterate((function(t){i.push(zi(t))})),i}var Ni=function(t){function e(e){return null==e?Xi():Li(e)&&!V(e)?e:Xi().withMutations((function(i){var s=t(e);ee(s.size),s.forEach((function(t){return i.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(T(t).keySeq())},e.intersect=function(t){return(t=C(t).toArray()).length?Ui.intersect.apply(e(t.pop()),t):Xi()},e.union=function(t){return(t=C(t).toArray()).length?Ui.union.apply(e(t.pop()),t):Xi()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Yi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Yi(this,this._map.remove(t))},e.prototype.clear=function(){return Yi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Yi(this,this._map.mapEntries((function(r){var n=r[1],o=t.call(e,n,n,i);return o!==n&&(s=!0),[o,o]}),e));return s?r:this},e.prototype.union=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(i){for(var s=0;s=0&&e=0&&i>>-15,461845907),e=gt(e<<13|e>>>-13,5),e=gt((e=e+3864292196^t)^e>>>16,2246822507),e=yt((e=gt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+as(pt(t),pt(e))|0}:function(t,e){s=s+as(pt(t),pt(e))|0}:e?function(t){s=31*s+pt(t)|0}:function(t){s=s+pt(t)|0}),s)}(this))}});var Qi=C.prototype;Qi[x]=!0,Qi[U]=Qi.values,Qi.toJSON=Qi.toArray,Qi.__toStringMapper=oe,Qi.inspect=Qi.toSource=function(){return this.toString()},Qi.chain=Qi.flatMap,Qi.contains=Qi.includes,Bi(T,{flip:function(){return Wt(this,_t(this))},mapEntries:function(t,e){var i=this,s=0;return Wt(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return Wt(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var qi=T.prototype;qi[S]=!0,qi[U]=Qi.entries,qi.toJSON=$i,qi.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Bi(R,{toKeyedSeq:function(){return new Dt(this,!1)},filter:function(t,e){return Wt(this,Nt(this,t,e,!1))},findIndex:function(t,e){var i=this.findEntry(t,e);return i?i[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Wt(this,zt(this,!1))},slice:function(t,e){return Wt(this,Ot(this,t,e,!1))},splice:function(t,e){var i=arguments.length;if(e=Math.max(e||0,0),0===i||2===i&&!e)return this;t=g(t,t<0?this.count():this.size);var s=this.slice(0,t);return Wt(this,1===i?s:s.concat(Jt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var i=this.findLastEntry(t,e);return i?i[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Wt(this,Yt(this,t,!1))},get:function(t,e){return(t=c(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,i){return i===t}),void 0,e)},has:function(t){return(t=c(this,t))>=0&&(void 0!==this.size?this.size===1/0||te?-1:0}function as(t,e){return t^e+2654435769+(t<<6)+(t>>2)}ts.has=Qi.includes,ts.contains=ts.includes,ts.keys=ts.values,Bi(q,qi),Bi(J,Ji),Bi(tt,ts);var ls=function(t){function e(t){return null==t?fs():Vi(t)?t:fs().withMutations((function(e){var i=E(t);ee(i.size),i.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(T(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Ni);ls.isOrderedSet=Vi;var us,cs=ls.prototype;function ds(t,e){var i=Object.create(cs);return i.size=t?t.size:0,i._map=t,i.__ownerID=e,i}function fs(){return us||(us=ds(wi()))}cs[L]=!0,cs.zip=Ji.zip,cs.zipWith=Ji.zipWith,cs.zipAll=Ji.zipAll,cs.__empty=fs,cs.__make=ds;var gs={LeftThenRight:-1,RightThenLeft:1},ys=function(t,e){var i;!function(t){if(D(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(P(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var s=function(n){var o=this;if(n instanceof s)return n;if(!(this instanceof s))return new s(n);if(!i){i=!0;var h=Object.keys(t),a=r._indices={};r._name=e,r._keys=h,r._defaultValues=t;for(var l=0;l2?[]:void 0,{"":t})}function ws(t,e,i,s,r,n){if("string"!=typeof i&&!P(i)&&($(i)||Z(i)||re(i))){if(~t.indexOf(i))throw new TypeError("Cannot convert circular structure to Immutable");t.push(i),r&&""!==s&&r.push(s);var o=e.call(n,s,Q(i).map((function(s,n){return ws(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function Cs(t,e){return M(e)?e.toList():v(e)?e.toMap():e.toSet()}var Ts="4.3.7",Rs=C;const Es={version:Ts,Collection:C,Iterable:C,Seq:Q,Map:ze,OrderedMap:bi,List:ai,Stack:Ei,Set:Ni,OrderedSet:ls,PairSorting:gs,Record:ys,Range:Hi,Repeat:bs,is:ft,fromJS:Ms,hash:pt,isImmutable:P,isCollection:A,isKeyed:v,isIndexed:M,isAssociative:w,isOrdered:V,isValueObject:dt,isPlainObject:re,isSeq:I,isList:hi,isMap:ut,isOrderedMap:ct,isStack:Ri,isSet:Li,isOrderedSet:Vi,isRecord:D,get:ae,getIn:Wi,has:he,hasIn:Ki,merge:we,mergeDeep:Te,mergeWith:Ce,mergeDeepWith:Re,remove:ue,removeIn:me,set:ce,setIn:ge,update:xe,updateIn:de}},377:(t,e,i)=>{Object.defineProperty(e,"o",{value:!0});var s=i(568),r=i(243),n=i(570),o=function(t){if(t&&t.o)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}(s),h=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(n);class a{constructor(){this.u=!0}S(){return this.u}}class l extends a{constructor(t,e){super(),this.M=t,this.u=e}_(t){return t!==this.M&&(this.M=t,this.u=!0),this}C(){return this.M}S(){return super.S()}}const u=(t,e)=>({x:t,y:e}),c=(t,e)=>({x:t,y:e}),d=(t,e,i)=>({position:t,high:e,low:i}),f=(t,e,i)=>({x:t,y:e,z:i}),g=t=>{const e=Array(0),i=Array(0);return t.length>0&&t.forEach((t=>{e.push(u(t.position,t.high)),i.push(u(t.position,t.low))})),[e,i]},y=(t,e)=>({min:t,max:e}),m=(t,e,i,s)=>({x:t,y:e,width:i,height:s}),p=(t,e=!0)=>new l(t,e),x=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),A=x,S=(t,e)=>({left:void 0!==e.left?e.left:t.left,top:void 0!==e.top?e.top:t.top,right:void 0!==e.right?e.right:t.right,bottom:void 0!==e.bottom?e.bottom:t.bottom}),v=s.Record({type:"color",r:1,g:1,b:1,a:1});class b extends v{constructor(t){super(t)}toUint32(){return void 0!==this.T||(this.T=I(this.getR(),this.getG(),this.getB(),this.getA())),this.T}toString(){return`color:${this.r},${this.g},${this.b},${this.a}`}setA(t){return this.set("a",t/255)}setR(t){return this.set("r",t/255)}setG(t){return this.set("g",t/255)}setB(t){return this.set("b",t/255)}getA(){return 255*this.get("a")}getR(){return 255*this.get("r")}getG(){return 255*this.get("g")}getB(){return 255*this.get("b")}getHighlight(){return this.F||(this.F=new b({r:this.r+.45*(1-this.r),g:this.g+.45*(1-this.g),b:this.b+.45*(1-this.b),a:this.a<1?this.a+.45*(1-this.a):1})),this.F}getLighter(){return this.I||(this.I=new b({r:this.r+.4*(1-this.r),g:this.g+.4*(1-this.g),b:this.b+.4*(1-this.b),a:this.a})),this.I}getDarker(){return this.P||(this.P=new b({r:this.r-.4*(1-this.r),g:this.g-.4*(1-this.g),b:this.b-.4*(1-this.b),a:this.a})),this.P}toRGBAString(){return`rgba( ${255*this.r}, ${255*this.g}, ${255*this.b}, ${255*this.a} )`}}const M=t=>!(!t||"object"!=typeof t||!("type"in t)||"color"!==t.type),w=(t,e,i,s=255)=>new b({r:t/255,g:e/255,b:i/255,a:s/255}),C=t=>{const e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new b({r:Number(`0x${e.substring(0,2)}`)/255,g:Number(`0x${e.substring(2,4)}`)/255,b:Number(`0x${e.substring(4,6)}`)/255,a:Number(`0x${e.substring(6,8)}`)/255});case 6:return new b({r:Number(`0x${e.substring(0,2)}`)/255,g:Number(`0x${e.substring(2,4)}`)/255,b:Number(`0x${e.substring(4,6)}`)/255});case 4:return new b({r:Number(`0x${e.charAt(0)}${e.charAt(0)}`)/255,g:Number(`0x${e.charAt(1)}${e.charAt(1)}`)/255,b:Number(`0x${e.charAt(2)}${e.charAt(2)}`)/255,a:Number(`0x${e.charAt(3)}${e.charAt(3)}`)/255});case 3:return new b({r:Number(`0x${e.charAt(0)}${e.charAt(0)}`)/255,g:Number(`0x${e.charAt(1)}${e.charAt(1)}`)/255,b:Number(`0x${e.charAt(2)}${e.charAt(2)}`)/255});default:throw new Error(`ColorHEX parsing error | input: ${t}`)}},T=(t,e=1,i=1)=>{let s,r,n;t/=360;const o=Math.floor(6*t),h=6*t-o,a=i*(1-e),l=i*(1-h*e),u=i*(1-(1-h)*e);switch(o%6){case 0:s=i,r=u,n=a;break;case 1:s=l,r=i,n=a;break;case 2:s=a,r=i,n=u;break;case 3:s=a,r=l,n=i;break;case 4:s=u,r=a,n=i;break;default:s=i,r=a,n=l}return new b({r:s,g:r,b:n})},R={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",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#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",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",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",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:"#d87093",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",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},E=new b({}),k=w(0,0,0,0),I=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,F=(t,e)=>t.value-e.value,D=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:w(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1}),P=t=>{const{steps:e}=t,i=e.length;e.sort(F);const[s,r]=i>0?[e[0].value,e[i-1].value]:[0,0],n=i>0?i-1:0,o=Array(n);for(let t=0;t0&&s!==r}};class L extends D{constructor(t){super(((t,e)=>({steps:t.steps,title:t.title,units:t.units,interpolate:t.interpolate,percentageValues:t.percentageValues,color:t.color,length:e.length,min:e.min,max:e.max,subranges:e.subranges,isValid:e.isValid}))(t,P(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(P({...this,steps:t}))}getSteps(){return this.get("steps")}setTitle(t){return this.set("title",t)}getTitle(){return this.get("title")}setUnits(t){return this.set("units",t)}getUnits(){return this.get("units")}setInterpolation(t){return this.set("interpolate",t)}getInterpolation(){return this.get("interpolate")}setFallbackColor(t){return this.set("color",t)}getFallbackColor(){return this.get("color")}setPercentageValues(t){return this.set("percentageValues",t)}getPercentageValues(){return this.get("percentageValues")}getColors(t){if(Array.isArray(t)){if(Array.isArray(t[0])){const e=t,i=e.length,s=e[0].length,r=[...Array(i)].map((()=>Array(s)));for(let t=0;t=a&&t<=l){if(a===l)return i.color;const e=(t-i.value)/(h.value-i.value);return s=i.color,r=h.color,n=e,new b({r:s.r+(r.r-s.r)*n,g:s.g+(r.g-s.g)*n,b:s.b+(r.b-s.b)*n,a:s.a+(r.a-s.a)*n})}}return t=0;s-=1)if(t>=e[s].value)return e[s].color;return e[0].color}}const V=s.Record({type:"fillstyle",fillType:"empty"});class _ extends V{toString(){return"emptyFill"}}const B=new _,z=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),N=s.Record({type:"fillstyle",fillType:"solid",color:w(255,255,255)});class O extends N{}class U extends O{constructor(t){super({...t,fillType:"solid"})}toString(){return`solidFill:${this.color.toString()}`}setColor(t){return M(t)?this.set("color",t):this.set("color",t(this.get("color")))}getColor(){return this.get("color")}setA(t){return this.setColor(this.getColor().setA(t))}setR(t){return this.setColor(this.getColor().setR(t))}setG(t){return this.setColor(this.getColor().setG(t))}setB(t){return this.setColor(this.getColor().setB(t))}}const Y=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType);class G extends O{constructor(t){super({...t,fillType:"individual"})}toString(){return`individualPointFill:${this.color.toString()}`}setFallbackColor(t){return M(t)?this.set("color",t):this.set("color",t(this.get("color")))}getFallbackColor(){return this.get("color")}}const X=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),Z=s.Record({type:"fillstyle",fillType:"palette",lut:new L({steps:[]}),lookUpProperty:"value"}),H=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),W={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=se(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.L)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.V=n,this.eases=t.map((([t,e])=>s(t,e,i)))}O(){this.R.emit("start")}start(){return this.V.includes(this)||this.V.push(this),this}addNextAnimations(t){return t instanceof Array?t.forEach((t=>this.nextAnimations.push(t))):this.nextAnimations.push(t),this}NextAnimation(t,e,i=this.duration,s=this.easing){const r=new j(t,e,i,s,this.V);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.R.on("start",t,e)}onAnimationEnd(t,e){return this.R.on("end",t,e)}onEveryAnimationEnd(t,e){return this.R.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.R.on("allEnd",t,e)}allOffAnimationEnd(){return this.R.topicOff("end"),this}allOffEveryAnimationEnd(){return this.R.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.R.topicOff("allEnd"),this}offAnimationEnd(t){return this.R.off(t,"end")}offEveryAnimationEnd(t){return this.R.off(t,"everyEnd")}offAllAnimationEnd(t){return this.R.off(t,"allEnd")}finish(t=!0){if(this.L=!0,this.V.splice(this.V.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.R.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.R.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.R.emit("end",e),this.R.emit("everyEnd",e)),e}t&&(this.R.emit("end",void 0),this.R.emit("everyEnd",void 0),this.R.emit("allEnd"))}finishAll(t=!0){let e=this;for(;e;)e=e.finish(t)}getFinalValues(){return this.nextAnimations.length>0?this.nextAnimations[this.nextAnimations.length-1].values.map(Rt):this.values.map(Rt)}getTimeUntilFinish(){let t=this.duration-this.delta;for(let e=0;e{e>60&&console.log("Note: Animator FPS is usually capped at 60 by the browser!");const i=[];let s,r,n=0;const o=()=>{s=void 0;const h=Date.now();r=r||h,n=h-r,n/1e3>=1/e&&(r=Date.now()-n%(1e3/e),i.forEach((t=>{0===t.delta&&t.O(),t.delta+=n-n%(1e3/e),t.delta>t.duration&&(t.delta=t.duration),t.action(t.eases.map((e=>e(t.delta)))),t.delta===t.duration&&t.finish()})),t()),i.length>0?s=wt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=W.linear)=>(r,n,h=t)=>{const a=new j(r,n,h,e,i).start();return s||(s=wt.requestAnimationFrame(o)),a}};var $,Q;e.GradientShape=void 0,($=e.GradientShape||(e.GradientShape={})).circle="circle",$.ellipse="ellipse",e.GradientExtent=void 0,(Q=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",Q.closestCorner="closest-corner",Q.farthestSide="farthest-side",Q.farthestCorner="farthest-corner";const q=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:C("#f00"),offset:0},{color:C("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class J extends q{constructor(t){if(super(t),null===t||t&&null===t.stops||t&&t.stops&&!Array.isArray(t.stops)||t&&t.stops&&Array.isArray(t.stops)&&t.stops.length<2)throw new Error("RadialGradientFill requires minimum two color stops to be defined.")}toString(){return`radialGradientFill:${this.shape},${this.extent},${this.position.x},${this.position.y},${this.stops.map((t=>`${t.offset},${t.color.toString()}`)).join(",")}`}setColorStops(t){if(t.length<2)throw new Error("Minimum of two color stops required");return this.set("stops",t)}getColorStops(){return this.get("stops")}setPosition(t){return this.set("position",t)}getPosition(){return this.get("position")}setShape(t){return this.set("shape",t)}getShape(){return this.get("shape")}setExtent(t){return this.set("extent",t)}getExtent(){return this.get("extent")}}const tt=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),et=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:C("#f00"),offset:0},{color:C("#0f0"),offset:1}],angle:0});class it extends et{constructor(t){if(super(t),null===t||t&&null===t.stops||t&&t.stops&&!Array.isArray(t.stops)||t&&t.stops&&Array.isArray(t.stops)&&t.stops.length<2)throw new Error("LinearGradientFill requires minimum two color stops to be defined.")}toString(){return`linearGradientFill:${this.angle},${this.stops.map((t=>`${t.offset},${t.color.toString()}`)).join(",")}`}setColorStops(t){if(t.length<2)throw new Error("Minimum of two color stops required");const e=t.sort(((t,e)=>t.offset-e.offset));return this.set("stops",e)}getColorStops(){return this.get("stops")}setAngle(t,e){return this.set("angle",e?function(t){return 180*t/Math.PI}(t):t)}getAngle(t){return t?xi(this.get("angle")):this.get("angle")}}const st=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),rt=s.Record({type:"linestyle",lineType:"empty"}),nt=new class extends rt{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}N(){return 0}setFillStyle(t){return this}getFillStyle(){return B}},ot=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class ht{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new at,this.y=new at,this.z=new at,this.R=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(He,0),this.cellIndex.x=t.reduce(((t,e,i)=>i>=n.x?t:t+e),0),this.cellSpan.x=t.reduce(((t,e,i)=>i>=n.x&&i{this.cellsAmount.y=t.reduce(He,0),this.cellIndex.y=t.reduce(((t,e,i)=>i>=n.y?t:t+e),0),this.cellSpan.y=t.reduce(((t,e,i)=>i>=n.y&&i{s.x.U(e),s.y.U(r)}}}Y(){return this.W&&(this.W(),this.W=void 0),this}H(t){return this.R.on("cell-resize",t)}$(t){return this.R.off(t,"cell-resize")}}class at extends a{constructor(){super(...arguments),this.X=0,this.j=10,this.Z=1}J(){return this.u=!1,this}K(){return this.u=!0,this}getInnerStart(){return this.X}getInnerEnd(){return this.j}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}q(t,e){return this.X=t,this.j=e,this.tt(),this}it(t){return this.Z=t,this.tt(),this}st(t){return t/this.Z}tt(){const t=this.st(this.j-this.X),e=this.Z;void 0!==this.et&&!1!==It(t,this.et)||(this.u=!0,this.ht=e,this.et=t)}rt(){return this.et}nt(){return this.ht}ot(){return this.jnew t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).ct({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new ht({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},ut=(t,e,i)=>e===i?t:i.dt(e.ft(t)),ct=(t,e,i)=>{if(e===i)return t;const s=e instanceof _i?e.x:e.x instanceof _i?e.x.x:e.x.At,r=e instanceof _i?e.y:e.y instanceof _i?e.y.y:e.y.At,n=i instanceof _i?i.x:i.x instanceof _i?i.x.x:i.x.At,o=i instanceof _i?i.y:i.y instanceof _i?i.y.y:i.y.At;return{...t,x:ut(t.x,s,n),y:ut(t.y,r,o)}},dt=(...t)=>{if(0===t.length)return{remove:kt};let e=!1;const i=t.map((i=>i.onIntervalChange(((s,r,n)=>((i,s,r)=>{e||(e=!0,t.filter((t=>t!==i)).forEach((t=>t.yt(s,r,!1,i.getStopped(),"synchronizedAxis"))),e=!1)})(i,r,n)))));let s=!1;const r=t.map((e=>e.onStoppedStateChanged(((i,r)=>((e,i)=>{s||(s=!0,t.filter((t=>t!==e)).forEach((t=>t.setStopped(i))),s=!1)})(e,r)))));return{remove:()=>{t.forEach(((t,e)=>{t.offIntervalChange(i[e]),t.offStoppedStateChanged(r[e])}))}}},ft=t=>t&&"object"==typeof t&&"column"in t&&"row"in t,gt=t=>t&&"object"==typeof t&&"z"in t&&"column"in t&&"row"in t,yt=t=>t&&"object"==typeof t&&"annulus"in t&&"sector"in t,mt=t=>t&&"object"==typeof t&&"index"in t;class pt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,pt.prototype)}}class xt extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&wt.alert(s),Object.setPrototypeOf(this,xt.prototype)}}class At extends xt{constructor(t){super(t),Object.setPrototypeOf(this,At.prototype)}}var St,vt,bt,Mt;e.UISpace=void 0,(St=e.UISpace||(e.UISpace={}))[St.Content=0]="Content",St[St.PaddedContent=1]="PaddedContent",St[St.PaddedBackground=2]="PaddedBackground",St[St.Everything=3]="Everything",e.UIVisibilityModes=void 0,(vt=e.UIVisibilityModes||(e.UIVisibilityModes={}))[vt.never=0]="never",vt[vt.always=1]="always",vt[vt.whenHovered=2]="whenHovered",vt[vt.whenDragged=3]="whenDragged",vt[vt.whenNotDragged=4]="whenNotDragged",vt[vt.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(bt=e.UIDraggingModes||(e.UIDraggingModes={}))[bt.notDraggable=0]="notDraggable",bt[bt.draggable=1]="draggable",bt[bt.onlyHorizontal=2]="onlyHorizontal",bt[bt.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(Mt=e.UIDirections||(e.UIDirections={}))[Mt.Up=0]="Up",Mt[Mt.Right=1]="Right",Mt[Mt.Down=2]="Down",Mt[Mt.Left=3]="Left";const wt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},Ct=(t,e)=>t.x===e.x&&t.y===e.y,Tt=t=>t!==Be&&t!==ze&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Rt=t=>t[1],Et=t=>t.dispose(),kt=()=>{},It=(t,e)=>t===e,Ft=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Dt=t=>Array.prototype.concat.apply([],t),Pt=(t,e)=>void 0===t||Number.isNaN(t)?e:t,Lt=t=>t.vt(),Vt=t=>t.St(),_t=t=>t.xt(),Bt=t=>t.bt(),zt=t=>t.min.x,Nt=t=>t.max.x,Ot=t=>t.min.y,Ut=t=>t.max.y,Yt=(t,e,i,s,r)=>{if(t.length>0){let n=r?s(r):void 0;for(let s=0;st.position===e.position&&t.high===e.high&&t.low===e.low,Xt=u(0,1),Zt=u(1,0),Ht=u(0,-1),Wt=u(-1,0),jt=u(0,0),Kt=t=>{switch(t){case e.UIDirections.Up:return Xt;case e.UIDirections.Right:return Zt;case e.UIDirections.Down:return Ht;case e.UIDirections.Left:return Wt;default:return jt}},$t=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Qt=t=>{t.stopPropagation(),t.preventDefault()},qt=(t,e)=>{if(!e)return t;const i=t.length,s=new Float32Array(2*i);let r=0;for(let e=0;e{if(!e){const e=t.length,s=new i(2*e);let r=0;for(let i=0;i{const e=t.length,i=new Float32Array(3*e);let s=0;for(let r=0;re=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)},ie=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},re=se(Math.E),ne=(t,e)=>{const i=e[t];return i?i():void 0},oe=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;iAi(ci(t,i))-Ai(ci(e,i))))},he=(t,e,i)=>{if(0===t.length)return!1===i.canReturnB?e.slice():e;const s=e.length;if(s<1e5)return t.push.apply(t,e),t;for(let i=0;ii<0?t:i>1?e:w(t.getR()+i*(e.getR()-t.getR()),t.getG()+i*(e.getG()-t.getG()),t.getB()+i*(e.getB()-t.getB()),t.getA()+i*(e.getA()-t.getA())),le=t=>255===t.getA()?t:t.setA(255),ue=(()=>{const t=w(0,0,0);return i=>(i=le(i),new J({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:ae(i,t,.5)}]}))})(),ce=(()=>{const t=t=>{var e;if(t){if(Y(t)){if(0===t.getColor().getA())return;return t.getColor()}if(tt(t)||st(t)){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}H(t)}};return(e,i,s,r)=>{var n;const o=[];if(r.fill&&o.push(r.fill),r.fill2&&o.push(r.fill2),r.stroke){const t=r.stroke.getFillStyle();t!==B&&("stroke"===(null===(n=r.behavior)||void 0===n?void 0:n.priority)?o.unshift(t):o.push(t))}if(r.point3D){const t=r.point3D;o.push(t.getFillStyle())}let h;if(r.behavior&&!0===r.behavior.colorStep){const[e,s]=o.reduce(((e,i)=>{if(e[0]&&e[1])return e;const s=t(i);return s&&(void 0===e[0]?e[0]=s:e[1]=s),e}),[void 0,void 0]);h=e&&s?(a=e)===(l=s)||a.getR()===l.getR()&&a.getG()===l.getG()&&a.getB()===l.getB()?ue(a):(a=le(a),l=le(l),new it({angle:0,stops:[{offset:0,color:l},{offset:.5,color:l},{offset:.5,color:a},{offset:1,color:a}]})):i.uiButtonFillStyle}else{const e=o.reduce(((e,i)=>e||t(i)),void 0);h=e?s?new U({color:e}):ue(e):i.uiButtonFillStyle}var a,l;e.setButtonOnFillStyle(h)}})(),de=t=>{const e=t;if(H(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},fe=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},ge=(t,e)=>{let i="string"==typeof t?t:String(t);const s=i.indexOf(".");let r=s>=0?s:i.length;for(;r"function"==typeof t?t(e):t,me=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),pe=(t,e)=>e(),xe=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new U({color:w(255,255,255,1)});const Ae=t=>t===Ne||t.min.x===Ne.min.x&&t.max.x===Ne.max.x&&t.min.y===Ne.min.y&&t.max.y===Ne.max.y,Se=t=>Array.from(new Set(t)),ve=t=>t.filter((t=>void 0!==t)),be=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,Me=(t,e,i)=>{e.length<=0||(t.setText(i.label).setOn(e[0].getVisible()),i.style&&t.setButtonOnFillStyle(i.style),i.toggleVisibilityOnClick&&t.onSwitch(((t,i)=>e.forEach((t=>t.setVisible(i))))),t.onMouseEnter((()=>e.forEach((t=>t.setHighlight(!0))))),t.onMouseLeave((()=>e.forEach((t=>t.setHighlight(!1))))),e.forEach((e=>e.onMouseEnter((()=>t.setHighlight(!0))))),e.forEach((e=>e.onMouseLeave((()=>t.setHighlight(!1))))),e.forEach((e=>e.onTouchStart((()=>t.setHighlight(!0))))),e.forEach((e=>e.onTouchEnd((()=>t.setHighlight(!1))))))},we=(t,e)=>{throw new Error(e)},Ce=t=>{let e;return()=>e||(e=t(),e)},Te=t=>{if(t===nt)return 0;const e=t.getThickness();return e<0?1:1*e},Re=(t,e,i,s)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please see https://lightningchart.com/js-charts/docs/troubleshooting/error-resources-not-found/`;if(s.shouldCrash)throw wt.alert(r),new Error(r);wt.console.warn(r)},Ee=(t,e,i,s=0)=>{if(t{const t=new Map;return{Mt:e=>(e.setMouseEnterEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n._t(e,i,s,r)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.wt(e,i,s)})),e.setMouseClickEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Ct(e,i,s,r)})),e.setMouseDoubleClickEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.kt(e,i,s,r)})),e.setMouseDownEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Tt(e,i,s,r)})),e.setMouseUpEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Ft(e,i,s,r)})),e.setMouseMoveEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.It(e,i,s,r)})),e.setMouseDragEventHandler(((e,i,s,r,n,o,h)=>{const a=o&&t.get(o);a&&a.Pt(e,i,s,r,n,o,h)})),e.setMouseDragStartEventHandler(((e,i,s,r,n)=>{const o=r&&t.get(r);o&&o.Dt(e,i,s,r,n)})),e.setMouseDragStopEventHandler(((e,i,s,r,n,o)=>{const h=n&&t.get(n);h&&h.Bt(e,i,s,r,n,o)})),e.setMouseWheelEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Lt(e,i,s,r)})),e.setTouchStartEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Rt(e,i,s,r)})),e.setTouchMoveEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.Et(e,i,s,r)})),e.setTouchEndEventHandler(((e,i,s,r)=>{const n=s&&t.get(s);n&&n.zt(e,i,s,r)})),e),Vt:(e,i)=>{t.set(e,i)},Ot:()=>{t.clear()}}},Ie={left:0,right:0,top:0,bottom:0},Fe=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),De=(t,e,i)=>{e&&e.Nt();const s=i();return{Gt:t,Nt:()=>{s.forEach((e=>t.Wt(e)))}}},Pe=(t,e,i)=>{let s;const r=()=>(s=i(),s),n={...t,resolve:()=>s||r()};for(const t of Object.keys(e))Object.defineProperty(n,t,{get:function(){return s?s[t]:r()[t]}});return n},Le=t=>{if(t)return"resolve"in t?t.resolve():t},Ve=t=>{let e=t;return{Ut:t=>{const i=e;return e=i+t,[i,t]}}},_e={add:(t,e)=>f(t.x+e,t.y+e,t.z+e),addVec(t,...e){const i={x:t.x,y:t.y,z:t.z};for(const t of e)i.x+=t.x,i.y+=t.y,i.z+=t.z;return i},subtract:(t,e)=>f(t.x-e,t.y-e,t.z-e),subtractVec(t,...e){const i={x:t.x,y:t.y,z:t.z};for(const t of e)i.x-=t.x,i.y-=t.y,i.z-=t.z;return i},multiply:(t,e)=>f(t.x*e,t.y*e,t.z*e),divide:(t,e)=>f(t.x/e,t.y/e,t.z/e),multiplyVec(t,...e){const i={x:t.x,y:t.y,z:t.z};for(const t of e)i.x*=t.x,i.y*=t.y,i.z*=t.z;return i},divideVec(t,...e){const i={x:t.x,y:t.y,z:t.z};for(const t of e)i.x/=t.x,i.y/=t.y,i.z/=t.z;return i},length:t=>Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),normalize:t=>_e.divide(t,_e.length(t)),dot:(t,e)=>t.x*e.x+t.y*e.y+t.z*e.z,cross:(t,e)=>f(t.y*e.z-t.z*e.y,t.z*e.x-t.x*e.z,t.x*e.y-t.y*e.x),angle:(t,e)=>Math.acos(_e.dot(t,e)/(_e.length(t)*_e.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=_e.dot(e,t),o=_e.cross(e,t);return _e.addVec(_e.multiply(t,s),_e.addVec(_e.multiply(e,(1-s)*n),_e.multiply(o,r)))},lerp:(t,e,i)=>(i=Ft(i,0,1),_e.addVec(_e.multiply(t,1-i),_e.multiply(e,i))),equals:(t,e)=>It(t.x,e.x)&&It(t.y,e.y)&&It(t.z,e.z),abs:t=>({x:Math.abs(t.x),y:Math.abs(t.y),z:Math.abs(t.z)}),sign:t=>({x:Math.sign(t.x),y:Math.sign(t.y),z:Math.sign(t.z)})},Be=Number.MAX_SAFE_INTEGER,ze=-Number.MAX_SAFE_INTEGER,Ne=y(u(Be,Be),u(ze,ze)),Oe=y(f(Be,Be,Be),f(ze,ze,ze)),Ue=(t,e)=>{const i=Math.log(t)/Math.log(e);return Math.floor((t=>(Math.ceil(t)-t<1e-4?t=Math.ceil(t):t-Math.floor(t)<1e-4&&(t=Math.floor(t)),t))(i))},Ye=(t,e)=>!(e.min.x>t.max.x||e.max.xt.max.y||e.max.y!(t[1].xe[1].x||t[3].ye[3].y),Xe=(t,e)=>({min:{x:Math.min(t[0].x,e[0].x),y:Math.min(t[0].y,e[0].y)},max:{x:Math.max(t[2].x,e[2].x),y:Math.max(t[2].y,e[2].y)}}),Ze=t=>{const e=t.length;for(let i=0;ie+t,We=(t,e,i)=>{const s=ci(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=ci(i,t),o=(n.x*s.x+n.y*s.y)/r;return o<=0?t:o>=1?e:u(t.x+o*s.x,t.y+o*s.y)},je=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,Ke=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},$e=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},Qe=(t,e,i)=>ui(t,li(ci(e,t),i)),qe=(t,e,i)=>_e.addVec(t,_e.multiply(_e.subtractVec(e,t),i));function Je(t){const e=t.length;if(e>0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y;for(let o=0;oi&&(i=e.x),e.xr&&(r=e.y),e.y0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y,o=t[0].z,h=t[0].z;for(let a=0;ai&&(i=e.x),e.xr&&(r=e.y),e.yo&&(o=e.z),e.z{const e={min:{x:Be,y:Be},max:{x:ze,y:ze}};for(const i of t)e.min.x=e.min.xi.max.x?e.max.x:i.max.x,e.min.y=e.min.yi.max.y?e.max.y:i.max.y;return e},ii=(t,e)=>y(f(t.min.xe.max.x?t.max.x:e.max.x,t.max.y>e.max.y?t.max.y:e.max.y,t.max.z>e.max.z?t.max.z:e.max.z));function si(t,e,i,s){const r=t.x-s.x,n=t.y-s.y,o=s.x-i.x,h=i.y-s.y,a=h*r+o*n,l=(s.y-e.y)*r+(e.x-s.x)*n,u=h*(e.x-s.x)+o*(e.y-s.y);return u<0?a<=0&&l<=0&&a+l>=u:a>=0&&l>=0&&a+l<=u}function ri(t,e,i){return u(Math.cos(i)*(t.x-e.x)+Math.sin(i)*(t.y-e.y)+e.x,-Math.sin(i)*(t.x-e.x)+Math.cos(i)*(t.y-e.y)+e.y)}function ni(t,e){return u(t.x-e.x,t.y-e.y)}function oi(t){const e=ai(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function hi(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=oi(i);const s=Math.PI/2,r=i.x;return i.x=-Math.sin(s)*i.y,i.y=r*Math.sin(s),i}function ai(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function li(t,e){return u(t.x*e,t.y*e)}function ui(t,e){return u(t.x+e.x,t.y+e.y)}function ci(t,e){return u(t.x-e.x,t.y-e.y)}function di(t,e){return u(t.x*e.x,t.y*e.y)}function fi(t,e){return u(t.x/e.x,t.y/e.y)}function gi(t){return li(t,-1)}function yi(t,e){return t.x*e.x+t.y*e.y}const mi=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},pi=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.x+(t-e.y)/s;return u(r,t)};function xi(t){return t*Math.PI/180}function Ai(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function Si(t){return u(Math.cos(t),Math.sin(t))}const vi=(t,e,i,s)=>{let r,n,o,h;if(e.x-t.x!=0||s.x-i.x!=0)return e.x-t.x==0?(o=e.x,n=(s.y-i.y)/(s.x-i.x),h=n*(o-i.x)+i.y):s.x-i.x==0?(o=s.x,r=(e.y-t.y)/(e.x-t.x),h=r*(o-t.x)+t.y):(r=(e.y-t.y)/(e.x-t.x),n=(s.y-i.y)/(s.x-i.x),o=(i.y-n*i.x+r*t.x-t.y)/(r-n),h=r*(o-t.x)+t.y),u(o,h)},bi=(t,e)=>{const i=t.length,s=e.length,r=new Uint16Array(i+s);return r.set(t,0),r.set(e,i),r};class Mi{constructor(){this.Yt=!0}getInnerStart(){return this.X}getInnerEnd(){return this.j}getInnerInterval(){return Math.abs(this.j-this.X)}q(t,e){return this.Yt=t!==this.X||e!==this.j,this.X=t,this.j=e,this}J(){return this.Yt=!1,this}K(){return this.Yt=!0,this}}class wi extends Mi{constructor(t,e,i,s){if(super(),this.Ht=!0,this.$t=!0,this.Xt=[0,0],this.jt=!0,this.Zt=t,this.Qt=e,this.Jt=i,this.Kt=t,this.qt=e,s){const t=s.G(this.ti.bind(this));this.ti(s.C()),this.ii=()=>s.U(t)}}it(t){return this.Z=t,this.$t=!0,this}si(t){return this.Xt=t.map(Math.abs),this.jt=!0,this}ei(){return this.Zt/this.Jt*this.Z+this.Xt[0]}hi(){return(this.Zt+this.Qt)/this.Jt*this.Z-this.Xt[1]}ri(){return this.getCellSize()-this.ni()}oi(){return this.Z}getCellSize(){return this.ai(this.Z)}ni(){return this.Xt[0]+this.Xt[1]}li(){return this.Xt}ti(t){this.Jt=t.reduce(He,0),this.Zt=t.reduce(((t,e,i)=>i>=this.Kt?t:t+e),0),this.Qt=t.reduce(((t,e,i)=>i>=this.Kt&&iki;return!n&&!o||!!r&&(e>t?{start:n?Ei:t,end:o?ki:e}:{start:o?ki:t,end:n?Ei:e})}ft(t){const e=this.ei(),i=this.hi(),s=Math.max(t,Ei);return e+(this.ci.function(s)-this.di.scaleStartLog)/this.di.scaleIntervalLog*(i-e)}dt(t){const e=this.ei(),i=(t-e)/(this.hi()-e),s=this.di.scaleStartLog+i*this.di.scaleIntervalLog;return this.ci.number**s}ui(){this.ci&&this.fi()}q(t,e){return super.q(t,e),this.ci&&this.fi(),this}si(t){return super.si(t),this.ci&&this.fi(),this}it(t){return super.it(t),this.ci&&this.fi(),this}Ai(t){return this.ci={internal:t,function:Ti(t),number:Ri(t)},this}gi(){return this.ci.internal}pi(t,e){const i=this.ft(t)+e;return this.dt(i)}yi(){return this.$t||this.Yt||this.jt||this.Ht}fi(){const t=this.ci.function(this.X),e=this.ci.function(this.j)-t,i=2*this.ei()/this.Z-1,s=2*this.hi()/this.Z-1-i;return this.di={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.di}mi(){return this.di}}const Ti=t=>"e"===t?re:se(t),Ri=t=>"e"===t?Math.E:t,Ei=.9*10**-4,ki=1.1*10**25,Ii=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],Fi=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Ue(s,10),0);return t.toFixed(r)},Di={Numeric:(t,e)=>Fi(t,e.getInnerStart(),e.getInnerEnd()),NumericUnits:(t,e)=>{const i=Math.abs(e.getInnerEnd()-e.getInnerStart()),s=t<0;t=Math.abs(t);let r="",n="";if(i>=1e3&&t>1e3){let e="";for(const i of Ii){const s=Math.round(1e3*t/i.unit)/1e3;if(s>=1){e=s.toString(),n=i.prefix;break}}r=(s?"-":"")+e}else{let e=String(Math.floor(t));const n=Ue(t,1e3);for(let t=1;t<=n;t+=1){const i=e.length-(3*t+(t-1));e=`${e.substring(0,i)} ${e.substring(i,e.length)}`}r=(s?"-":"")+e+(i<=10?((t,e)=>{if(0===e)return"";let i=(Math.abs(t)-Math.abs(Math.floor(t))).toString().substring(1);return i.length>e&&(i=i.substring(0,e+1)),i})(t,2-Ue(i,10)):"")}return r+=n,r},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const r=Ti(s)(t);return`${s}${Pi(r)}`},LogarithmicExponents:(t,e,i,s=10)=>{const r=Ti(s),n=Math.floor(r(t)),o=t/Ri(s)**n;return`${Math.round(o)}×${s}${Pi(n)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const r=Ti(s),n=Math.floor(r(t));return`${(t/Ri(s)**n).toFixed(2)}×${s}${Pi(n)}`},LogarithmicNoExponents:(t,e,i,s=10)=>{const r=Ti(s);if("e"===s)return`${Math.floor(r(t))}e`;const n=t.toString();if(t>1)return n;const o=Math.floor(r(t));return t.toFixed(Math.abs(o))},Scientific:(t,e)=>{const i=Math.max(Math.abs(e.getInnerStart()),Math.abs(e.getInnerEnd())),s=Math.floor(Math.log10(i));return 0===t?`0.00e${s<0?"":"+"}${s}`:t.toExponential(2)}},Pi=t=>Math.round(t).toString().split("").map((t=>{switch(t){case"0":return"⁰";case"1":return"¹";case"2":return"²";case"3":return"³";case"4":return"⁴";case"5":return"⁵";case"6":return"⁶";case"7":return"⁷";case"8":return"⁸";case"9":return"⁹";case"-":return"⁻";default:return t}})).join("");class Li extends wi{constructor(t,e,i,s){super(t,e,i,s),this.vi=!1,this.Si=!1,this.xi=0,this.Z=1e3,this.q(0,10),this.tt()}yi(){return this.Si}ut(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.vi){const i=((t,e,i)=>{const s=((t,e)=>{if(eze&&tze){const i=Math.abs(t/2**23),s=Math.abs(e/2**23),r=Math.min(i,s);return 10**Math.floor(Math.log10(r))}})(t,e);if(void 0!==s)return s*i})(t,e,this.getCellSize());if(void 0===i)return!1;if(o>i)return!0;const s=(e+t)/2,h=(r?i/2:n/2)*(t>e?-1:1);return{start:s-h,end:s+h}}const h=10**-(12-Math.log10(Math.max(Math.abs(t),1)));if(o>h)return!0;const a=(e+t)/2,l=(r?h/2:n/2)*(t>e?-1:1);return{start:a-l,end:a+l}}ui(){this.tt()}ft(t){return this.ei()+(t-this.X)/(this.j-this.X)*(this.hi()-this.ei())}dt(t){return this.X+(t-this.ei())/(this.hi()-this.ei())*(this.j-this.X)}q(t,e){return super.q(t,e),this.tt(),this}si(t){return super.si(t),this.tt(),this}it(t){return super.it(t),this.bi=Vi(this.j-this.X,this.Xt,this.Z,this.Qt,this.Jt),this.tt(),this}Mi(){return this.vi=!0,this}_i(){return this.vi}wi(){return Math.abs(this.Ci)}ki(){return this.wi()/this.bi}Ti(){return this.Fi}Ii(){return this.Pi}getPixelSize(){return this.bi}mi(){return this.di}K(){return super.K(),this.Si=!0,this}J(){return super.J(),this.Si=!1,this}Di(t,e=Di.Numeric){return e(t,this)}Bi(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}Li(t){return Vi(t,this.Xt,this.Z,this.Qt,this.Jt)}tt(){let t=this.X,e=this.j,i=0;this.vi&&(t=0,e=this.j-this.X,i=this.X);const s=e-t,r=Vi(s,this.Xt,this.Z,this.Qt,this.Jt);this.Pi=t-this.Xt[0]*r,this.Fi=e+this.Xt[1]*r;const n=this.Fi-this.Pi,o=n-this.Ci,h=Math.abs(o/r),a=s-this.xi,l=Math.abs(a/r);(!this.di||h>=.4||l>=.4)&&(this.xi=s,this.Ci=n,this.bi=r,this.Si=!0);const u=this.Ci*this.Jt/(2*this.Qt),c=-(this.Pi-this.Ci*this.Zt/this.Qt)-u,d=2*this.ei()/this.Z-1,f=2*this.hi()/this.Z-1-d;this.di={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}pi(t,e){return t+this.bi*e}}const Vi=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class _i{Ri(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}J(){return this.x.J(),this.y.J(),this}K(){return this.x.K(),this.y.K(),this}it(t,e){return"object"==typeof t?(this.x.it(t.x),this.y.it(t.y)):(this.x.it(t),this.y.it(e)),this}oi(){return u(this.x.oi(),this.y.oi())}Ei(t){return this.x.si(t),this}zi(t){return this.y.si(t),this}ni(){return u(this.x.ni(),this.y.ni())}Vi(t,e){return this.x.q(t,e),this}Oi(t,e){return this.y.q(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.ni(),y:e-this.y.ni()}}Ni(){return this.x.yi()||this.y.yi()}}class Bi extends _i{constructor(){super(...arguments),this.Gi="LinearScaleXY"}ct(t,e,i,s){return this.x=new Li(t.x,e.x,i.x,s?s.x:void 0),this.y=new Li(t.y,e.y,i.y,s?s.y:void 0),this}_i(){return this.x._i()||this.y._i()}Wi(){return u(this.x.getPixelSize(),this.y.getPixelSize())}mi(){return{x:this.x.mi(),y:this.y.mi()}}pi(t,e){const i=this.Wi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Ui(t,e,i,s){const r=this.Wi(),n=hi(t,e);return n.x*=s,n.y*=s,{x:t.x+i*r.x*n.x,y:t.y+i*r.y*n.y}}}class zi extends _i{constructor(){super(...arguments),this.Gi="MixedScaleXY"}_i(){return!1}pi(t,e){const i=this.x.ft(t.x),s=this.y.ft(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.dt(r.x),y:this.y.dt(r.y)}}Ui(t,e,i,s){const r={x:this.x.ft(t.x),y:this.y.ft(t.y)},n={x:this.x.ft(e.x),y:this.y.ft(e.y)},o=oi(ci(n,r)),h=hi(n,r),a={x:r.x+o.x*s+h.x*i,y:r.y+o.y*s+h.y*i};return{x:this.x.dt(a.x),y:this.y.dt(a.y)}}mi(){const t=this.x.mi(),e=this.y.mi();return{uScaleStart:[this.x.X,this.y.X],uScaleInterval:[this.x.getInnerInterval(),this.y.getInnerInterval()],uScaleStartLog:[t.scaleStartLog,e.scaleStartLog],uScaleIntervalLog:[t.scaleIntervalLog,e.scaleIntervalLog],uViewportStart:[t.viewportStart,e.viewportStart],uViewportSize:[t.viewportSize,e.viewportSize]}}}const Ni=(t,e)=>t instanceof Ci||e instanceof Ci?(new zi).Ri(t,e):(new Bi).Ri(t,e),Oi=t=>"client"===t,Ui=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),Yi=t=>"relative"===t,Gi=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y);var Xi;e.HighlightModes=void 0,(Xi=e.HighlightModes||(e.HighlightModes={}))[Xi.noHighlighting=0]="noHighlighting",Xi[Xi.onHover=1]="onHover";class Zi{constructor(t,i,s,n){this.Yi=!0,this.Hi=e.HighlightModes.onHover,this.$i=!1,this.Xi=!0,this.R=new r.Eventer,this.ji=[],this.Zi=[],this.onMouseEnter=t=>this.R.on("mouseEnter",t),this.onMouseLeave=t=>this.R.on("mouseLeave",t),this.onMouseClick=t=>this.R.on("mouseClick",t),this.onMouseDoubleClick=t=>this.R.on("mouseDoubleClick",t),this.onMouseDown=t=>this.R.on("mouseDown",t),this.onMouseUp=t=>this.R.on("mouseUp",t),this.onMouseMove=t=>this.R.on("mouseMove",t),this.offMouseEnter=t=>this.R.off(t,"mouseEnter"),this.offMouseLeave=t=>this.R.off(t,"mouseLeave"),this.offMouseClick=t=>this.R.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.R.off(t,"mouseDown"),this.offMouseUp=t=>this.R.off(t,"mouseUp"),this.offMouseMove=t=>this.R.off(t,"mouseMove"),this.offMouseDragStart=t=>this.R.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.R.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.R.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.R.off(t,"mouseWheel"),this._t=(t,i,s,r)=>{const n=this.Qi(r,i);this.R.emit("mouseEnter",this,i,n),this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.wt=(t,i,s)=>{this.R.emit("mouseLeave",this,i,void 0),this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.It=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseMove",this,e,r)},this.Ct=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseClick",this,e,r)},this.kt=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseDoubleClick",this,e,r)},this.Tt=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseDown",this,e,r)},this.Ft=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseUp",this,e,r)},this.Dt=(t,e,i,s,r)=>{const n=this.Qi(r,e);this.R.emit("mouseDragStart",this,e,i,n)},this.Pt=(t,e,i,s,r,n,o)=>{const h=this.Qi(o,e);this.R.emit("mouseDrag",this,e,i,s,r,h)},this.Bt=(t,e,i,s,r,n)=>{const o=this.Qi(n,e);this.R.emit("mouseDragStop",this,e,i,s,o)},this.Lt=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("mouseWheel",this,e,r)},this.Rt=(t,i,s,r)=>{const n=this.Qi(r,i);this.R.emit("touchStart",this,i,n),this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Et=(t,e,i,s)=>{const r=this.Qi(s,e);this.R.emit("touchMove",this,e,r)},this.zt=(t,i,s,r)=>{const n=this.Qi(r,i);this.R.emit("touchEnd",this,i,n),this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.chart=t,this.Ji=i,this.Ki=s,this.qi=new Map,this.ts=n,this.ss=this.ts.es(this,{hs:{themeEffectEnabled:this.Ki.effectsText},rs:{}}),this.chart.ls.os.ns(this,(t=>{this.qi.forEach(((e,i)=>i.us(t))),this.Zi.forEach((e=>e.setHighlight(t))),this.ji.forEach((e=>e.us(t)))}),{animationEnabled:this.chart.getAnimationsEnabled()})}cs(){}ds(t,e){const i=void 0===(null==e?void 0:e.setEventHandlers)||e.setEventHandlers,s=void 0!==(null==e?void 0:e.isText)&&e.isText;this.qi.set(t,{isText:s});const r=Array.from(this.qi);this.ss.hs.fs(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.ss.rs.fs(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Yi).setVisible(this.Xi).us(this.chart.ls.os.As(this,!0)),i&&t.setMouseEnterEventHandler(this._t).setMouseLeaveEventHandler(this.wt).setMouseClickEventHandler(this.Ct).setMouseDoubleClickEventHandler(this.kt).setMouseDownEventHandler(this.Tt).setMouseUpEventHandler(this.Ft).setMouseMoveEventHandler(this.It).setMouseDragStartEventHandler(this.Dt).setMouseDragEventHandler(this.Pt).setMouseDragStopEventHandler(this.Bt).setMouseWheelEventHandler(this.Lt).setTouchStartEventHandler(this.Rt).setTouchMoveEventHandler(this.Et).setTouchEndEventHandler(this.zt);const n=t.onDispose((()=>{t.offDispose(n),this.qi.delete(t)}))}gs(t){this.ji=t;const e=this.chart.ls.os.As(this,!0);t.forEach((t=>{t.us(e).ps(this.Xi)}))}Qi(t,e){}ys(t){const e=this.chart.ls.vs(t);if(e&&Array.from(this.qi.keys()).includes(e.entity))return this.Qi(e.info,t)}setEffect(t){return this.ss.hs.Ss(t&&this.Ki.effectsText),this.ss.rs.Ss(t),this.chart.ls.xs(),this}getEffect(){return this.ss.hs.bs()||this.ss.rs.bs()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setIcon(t){return this.Ms=t,this.chart.ls.xs(),this}getIcon(){return this.Ms}setName(t){return this._s=t,this.Zi.forEach((e=>e.setText(t))),this}getName(){return this._s||"Component"}dispose(){return this.$i||(this.$i=!0,this.qi.forEach(((t,e)=>e.dispose())),this.Ji(this),this.Zi.forEach((t=>{t.dispose()})),this.Zi.length=0,this.R.emit("dispose",this),this.chart.ls.xs()),this}setVisible(t){return t===this.Xi||(this.Xi=t,this.qi.forEach(((e,i)=>i.setVisible(t))),this.ji.forEach((e=>e.ps(t))),this.Zi.forEach((e=>e.setOn(t))),this.R.emit("visibleStateChanged",this,this.Xi),this.chart.ls.xs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}setHighlight(t){return this.chart.ls.os.ws(this,t),this.R.emit("highlight",this,t),this}getHighlight(){return this.chart.ls.os.As(this)}setAnimationHighlight(t){return this.chart.ls.os.Cs(this,t),this}getAnimationHighlight(){return this.chart.ls.os.ks(this)}setMouseInteractions(t){return this.Yi=t,this.qi.forEach(((e,i)=>i.setMouseInteractions(t))),this.chart.ls.xs(),this}getMouseInteractions(){return this.Yi}getIsUnderMouse(){for(const t of this.qi)if(t[0].Ts)return!0;return!1}setHighlightOnHover(t){return this.Hi=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Hi!==e.HighlightModes.noHighlighting}attach(t,e=!0,i=!1){return this.styleLegendEntry(t,i),Me(t,[this],{toggleVisibilityOnClick:e,label:this.getName(),style:void 0}),this.Zi.push(t),t.onDispose((()=>{const e=this.Zi.indexOf(t);e>=0&&this.Zi.splice(e,1)})),this}Fs(){return this.Ms}onMouseDragStart(t){return this.R.on("mouseDragStart",t)}onMouseDrag(t){return this.R.on("mouseDrag",t)}onMouseDragStop(t){return this.R.on("mouseDragStop",t)}onMouseWheel(t){return this.R.on("mouseWheel",t)}onTouchStart(t){return this.R.on("touchStart",t)}onTouchMove(t){return this.R.on("touchMove",t)}onTouchEnd(t){return this.R.on("touchEnd",t)}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offTouchStart(t){return this.R.off(t,"touchStart")}offTouchMove(t){return this.R.off(t,"touchMove")}offTouchEnd(t){return this.R.off(t,"touchEnd")}offDispose(t){return this.R.off(t,"dispose")}}class Hi extends Zi{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Is=t,this.axis=s,this.At=r,this.Ps=n,this.Ds()}}const Wi=t=>{const e=t.length;if(e>0){let i=0,s=0;for(let r=0;r{const e=t.length,i=new Array(e).fill(!1),s=(s,r)=>{for(let n=0;n=this.zs?(this.Es.splice(t,1),t-=1):this.Es[t].state&&(s=!0);return this.Rs?0===e.interactions.length&&(this.Es.push({state:!1,time:i}),this.Rs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Es.push({state:!0,time:i}),s=!0,this.Rs=!0),s}Ls(t,e,i){if(i){const i=this.Es.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Vs(t,e),this.Es.length=0)}}},$i=class{constructor(t,e,i,s=1,r=100){this.Os=t,this.Ns=e,this.Gs=i,this.Ws=s,this.Us=r}Bs(t,e){const i=e.interactions.length;if(i===this.Ws){if(void 0!==this.Ys)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=Wi(t);let s=0;for(let r=0;r!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class es{constructor(t,e){this.Zs=t,this.Qs=e,this.Js=e.rows*Fs,this.Ks=e.columns*Ds}}var is,ss;e.OnScreenMenuButtonType=void 0,(is=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[is.ZoomIn=0]="ZoomIn",is[is.ZoomInX=1]="ZoomInX",is[is.ZoomInY=2]="ZoomInY",is[is.ZoomOut=3]="ZoomOut",is[is.ZoomOutX=4]="ZoomOutX",is[is.ZoomOutY=5]="ZoomOutY",is[is.ZoomToFit=6]="ZoomToFit",is[is.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(ss=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[ss.Circle=0]="Circle",ss[ss.Rectangle=1]="Rectangle",ss[ss.RoundedRectangle=2]="RoundedRectangle";const rs={x:-43,y:0},ns={x:-65,y:0},os={x:-86,y:0},hs={x:-107,y:-1},as={x:-128,y:-3},ls={x:-150,y:0},us={x:-171,y:0},cs={x:-276,y:0},ds={x:-298,y:0},fs={x:0,y:0},gs={x:-21,y:0};class ys extends es{constructor(t,e,i,s){super(t,i),this.qs=wt.document.createElement("button"),this.te=wt.document.createElement("div"),this.ie=wt.document.createElement("label"),this.Qs=i,this.se=e,this.ee=s}he(t,e,i,s){this.re(t,s),this.ne(),this.oe(e),this.ae(),this.ie.textContent=i||"";const r=wt.document.createElement("div");this.le(r),this.qs.onclick=this.onClick.bind(this),r.appendChild(this.te),r.appendChild(this.ie),this.qs.appendChild(r)}ae(){this.qs.style.cursor="pointer"}le(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}oe(t){"string"==typeof t?(this.te.style.backgroundImage=`url(${t})`,this.te.style.backgroundSize="100%",this.te.style.backgroundRepeat="no-repeat",this.te.style.backgroundPosition="center",this.te.style.width="20px",this.te.style.height="20px"):this.applyStyleForSprite(t),this.te.style.margin="auto"}ne(){switch(this.se){case e.OnScreenMenuButtonShape.RoundedRectangle:this.qs.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.qs.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.qs.style.borderRadius="31px"}}re(t,e){this.qs.style.width=`${this.Ks.toString()}px`,this.qs.style.height=`${this.Js.toString()}px`,this.qs.style.backgroundColor=t,this.qs.style.opacity=e||Ps,this.qs.style.alignItems="center",this.qs.style.border="2px solid #707070",this.qs.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.te.style.backgroundImage=`url(${this.Zs}/${Ls})`,this.te.style.backgroundPositionX=`${t.x}px`,this.te.style.backgroundPositionY=`${t.y}px`,this.te.style.backgroundSize="1600%",this.te.style.backgroundRepeat="no-repeat",this.te.style.width="20px",this.te.style.height="20px"}ue(t){return t.appendChild(this.qs),t}ce(){return this.qs}}class ms extends ys{constructor(t,e,i,s){super(t,e,i,s),this.de="",this.fe="",this.Ae=!1,this.ee=s}ge(){this.pe(),this.onToggledStateAction()}ye(){this.me(),this.onInitialStateAction()}me(){this.ve(this.de)}pe(){this.ve(this.fe)}ve(t){"string"==typeof t?this.te.style.background=t:(this.te.style.backgroundImage=`url(${this.Zs}/${Ls})`,this.te.style.backgroundPositionX=`${t.x}px`,this.te.style.backgroundPositionY=`${t.y}px`)}onClick(){this.Ae?this.ye():this.ge(),this.Ae=!this.Ae}}class ps extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),rs)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:-1,y:-1})}}class xs extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),hs)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:-1,y:0})}}class As extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),ls)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:0,y:-1})}}class Ss extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),ns)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:1,y:1})}}class vs extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),as)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:1,y:0})}}class bs extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),us)}onClick(){const t=this.ee.Se();t&&this.ee.zoom(t,{x:0,y:1})}}class Ms extends ms{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.de=cs,this.fe=ds,this.he(s.onScreenMenuBackgroundColor.toRGBAString(),this.de)}onToggledStateAction(){this.ee.setAnimationsEnabled(!1)}onInitialStateAction(){this.ee.setAnimationsEnabled(!0)}}class ws extends ys{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.ee=e;const s=this.ee.getTheme();this.he(s.onScreenMenuBackgroundColor.toRGBAString(),os)}onClick(){this.ee.forEachAxis((t=>{t.fit(!0)}))}}class Cs extends ys{constructor(t,e,i){super(t,e.shape||Vs,e.dimensions||{rows:1,columns:1},i);const s=i.getTheme(),r=e.color||s.onScreenMenuBackgroundColor.toRGBAString(),n=e.icon||"",o=e.label||"",h=e.opacity||"";this.he(r,n,o,h),this.xe=e.action}onClick(){this.xe(this.ee)}}class Ts extends ms{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.ee=i,this.be=s,this.de=gs,this.fe=fs,this.he(_s,this.de)}me(){this.ve(this.de),this.qs.style.backgroundColor=_s,this.qs.style.border="2px solid #707070",this.qs.style.margin="0px"}pe(){this.ve(this.fe),this.qs.style.background="#FECC00 0% 0% no-repeat padding-box",this.qs.style.border="10px solid #BCBCBC12",this.qs.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.be)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.be)||void 0===t||t.style.setProperty("display","none")}}var Rs;e.MouseStyles=void 0,(Rs=e.MouseStyles||(e.MouseStyles={})).Move="move",Rs.ResizeColumn="col-resize",Rs.ResizeRow="row-resize",Rs.Horizontal="ew-resize",Rs.Vertical="ns-resize",Rs.NorthWest="nw-resize",Rs.NorthEast="ne-resize",Rs.Copy="copy",Rs.CrossHair="crosshair",Rs.Default="default",Rs.Help="help",Rs.Restricted="not-allowed",Rs.None="none",Rs.Point="pointer",Rs.Text="text",Rs.Wait="wait",Rs.ZoomIn="zoom-in",Rs.ZoomOut="zoom-out";const Es={LeftBottom:u(-1,-1),CenterBottom:u(0,-1),RightBottom:u(1,-1),LeftCenter:u(-1,0),Center:u(0,0),RightCenter:u(1,0),LeftTop:u(-1,1),CenterTop:u(0,1),RightTop:u(1,1)},ks=new U({color:w(255,255,255,0)}),Is=new Ji({thickness:1,fillStyle:ks}),Fs=60,Ds=60,Ps="1.0",Ls="osm/osm-sprite-transparent.png",Vs=e.OnScreenMenuButtonShape.Circle,_s="#363636";var Bs;e.OSMPosition=void 0,(Bs=e.OSMPosition||(e.OSMPosition={}))[Bs.TopRight=0]="TopRight",Bs[Bs.TopLeft=1]="TopLeft",Bs[Bs.BottomLeft=2]="BottomLeft",Bs[Bs.BottomRight=3]="BottomRight";class zs extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this._s="Band",this.Me=0,this._e=0,this.we=this.Ki.bandFillStyle,this.Ce=this.Ki.bandStrokeStyle,this.ke=!0,this.Te=this.Is.Pe(this.At).Ie(this.we).Fe(this.Ce).us(this.getHighlight()),this.ds(this.Te)}setValueStart(t){return this.Me=t,this.R.emit("valueChange",this,this.Me,this._e),this.Is.xs(),this}getValueStart(){return this.Me}setValueEnd(t){return this._e=t,this.R.emit("valueChange",this,this.Me,this._e),this.Is.xs(),this}getValueEnd(){return this._e}setFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;return this.Te.Ie(e),this.Is.xs(),this}getFillStyle(){return this.we}setStrokeStyle(t){this.Ce="function"==typeof t?t(this.Ce):t;const e=this.Ce;return this.Te.Fe(e),this.Is.xs(),this}getStrokeStyle(){return this.Ce}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}De(){return this.Te.Be(this.Ps.toVec2(this.Me,this.Ps.getHeight(this.At).getInnerStart())).it(this.Ps.toVec2(this._e-this.Me,this.Ps.getHeight(this.At).getInnerInterval())),this}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.Ce})}Le(t,e){t.us(e),this.Is.xs()}setDefaultMouseInteractions(t){return this.ke=t,this}Ds(){let t,i;const s=(e,s)=>{if(!this.ke)return;const r=ct(this.Is.ls.Re(s.x,s.y),this.Is.ls.At,this.At),n=this.Ps.getWidth(r),o=this.axis.At.ft(this.Me),h=this.axis.At.ft(this._e),a=(this.axis.At.ft(n)-o)/(h-o);t=!(a<.1||a>.9),!1===t&&(i=a<.5)},r=(e,s,r,n,o)=>{if(!this.ke)return;const h=this.Ps.getWidth(n);t?(this.Me=this.axis.At.pi(this.Me,h),this._e=this.axis.At.pi(this._e,h)):i?this.Me=this.axis.At.pi(this.Me,h):this._e=this.axis.At.pi(this._e,h),Qt(o),this.R.emit("valueChange",this,this.Me,this._e),this.Is.xs()};this.onMouseMove(((i,r)=>{if(!this.ke)return;s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.Ps.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Ee=this.chart.engine.setMouseStyle(n,this.Ee)})),this.onMouseLeave((()=>{this.ke&&(this.chart.engine.restoreMouseStyle(this.Ee),this.Ee=void 0)})),this.onMouseDrag(((t,e,i,s,n)=>{this.ke&&0===i&&r(0,0,0,n,e)}));const n=ji(new $i(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Ns extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this._s="Constant Line",this.M=0,this.Ce=this.Ki.constantLineStrokeStyle,this.ze=!0,this.ke=!0,this.Ve=this.Is.Ne(this.At).Oe(this.Ce).us(this.getHighlight()),this.ds(this.Ve)}setValue(t){return this.M=t,this.R.emit("valueChange",this,this.M),this.Is.xs(),this}getValue(){return this.M}setStrokeStyle(t){this.Ce="function"==typeof t?t(this.Ce):t;const e=this.Ce;return this.Ve.Oe(e),this.Is.xs(),this}getStrokeStyle(){return this.Ce}setInteractionMoveByDragging(t){return this.ze=t,this}getInteractionMoveByDragging(){return this.ze}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}De(){return this.Ve.We(this.Ps.toVec2(this.M,this.Ps.getHeight(this.At).getInnerStart())).Ge(this.Ps.toVec2(this.M,this.Ps.getHeight(this.At).getInnerEnd())),this}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.Ce})}Le(t,e){t.us(e),this.Is.xs()}setDefaultMouseInteractions(t){return this.ke=t,this}Ds(){const t=(t,e)=>{this.ke&&this.ze&&(this.M=this.axis.At.pi(this.M,this.Ps.getWidth(e)),this.R.emit("valueChange",this,this.M),this.Is.xs(),Qt(t))};this.onMouseMove((()=>{if(this.ke&&this.ze){const t=this.Ps.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Ee=this.chart.engine.setMouseStyle(t,this.Ee)}})),this.onMouseLeave((()=>{this.ke&&this.ze&&(this.chart.engine.restoreMouseStyle(this.Ee),this.Ee=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this.ke&&this.ze&&0===s&&t(i,n)}));const i=ji(new $i(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const Os={fitting:{start:(t,e,i,s)=>e>=t?i:s,end:(t,e,i,s)=>e>=t?s:i,allowIntervalLengthChange:!0},expansion:{start:(t,e,i,s)=>e>=t?it?s:t,end:(t,e,i,s)=>e>=t?s>e?s:e:ie>t?Os.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Os.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?Os.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Ue,Gs=t=>void 0!==t.Ye,Xs=(t,e)=>[t,e],Zs=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{It(t,0)&&(t=0),It(e,0)&&(e=0);const n=[];let o=void 0!==s?((t,e,i)=>t-(t-i)%e)(t,i,s):t;if(i<=0)throw new Error(`_getRegularGreatKeyValues unit less than or equal to 0, unit: ${i}`);for(;o{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r.push(n),r},js=(t,...e)=>{const i=e.length>0?e.length:t?1:0;return(s,r,n,o,h,a)=>{if(r>=i)return;const l=e[r]||1;let u=!1,c=!1,d=1;return t&&(u="ignore"in t?"first"===t.ignore||"both"===t.ignore:u,c="ignore"in t?"last"===t.ignore||"both"===t.ignore:c,d="offset"in t&&void 0!==t.offset?t.offset:d),((t,e,i,s,r)=>(i&&(t=t.filter(((t,e)=>e>0))),s&&(t=t.filter(((e,i)=>i(i+r)%e==0))))(s,l,u,c,d)}},Ks=(...t)=>{const e=t.length>0?t.length:0;return(i,s,r,n,o,h)=>{if(s>=e)return;const a=t[s]||1;return i.filter(((t,e)=>e%a==0))}},$s=s.Record({type:"empty-ticks",cursorFormatter:void 0});class Qs extends $s{He(t){return{$e:[],Xe:[],je:this.cursorFormatter?this.cursorFormatter:Di.Numeric,Ze:void 0,Qe:void 0}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}}const qs=t=>!(!t||"object"!=typeof t||!("type"in t)||"empty-ticks"!==t.type),Js=(t,e)=>{if(e.has(t))return e.get(t);const i=Je(t.Ke.Je());if(Ae(i))return i;const s=t.qe.pi(i.min,{x:-5,y:-5}),r=t.qe.pi(i.min,{x:5,y:5}),n=t.qe.pi(i.max,{x:-5,y:-5}),o=t.qe.pi(i.max,{x:5,y:5}),h={min:{x:Math.min(s.x,r.x,n.x,o.x),y:Math.min(s.y,r.y,n.y,o.y)},max:{x:Math.max(s.x,r.x,n.x,o.x),y:Math.max(s.y,r.y,n.y,o.y)}};return e.set(t,h),h},tr=t=>{const e=new Map;if(!qs(t)){for(const i of t.$e)e.set(i,new Map);for(const i of t.Xe)e.set(i,new Map)}return e},er=(new Qs).He({type:"linear"});class ir{constructor(t,e,i,s,n,o,h){this.R=new r.Eventer,this.th=er,this.ih=Us.Empty,this.sh=new Map,this.eh=new Map,this.hh=Os.fitting,this.rh=!0,this.oh=K((()=>this.chart.ls.xs()))(300,W.linear),this.ah=!0,this.Xi=!0,this.lh=!1,this.uh=ze,this.dh=!1,this.fh=!1,this.Ah=ze,this.gh=ze,this.ph=ze,this.yh=!1,this.mh="",this.Sh={},this.xh=()=>{this.bh.setMouseInteractions(!0).setMouseMoveEventHandler(((t,e)=>this.R.emit("mouseMoveTitle",this,e))).setMouseEnterEventHandler(((t,e)=>this.R.emit("mouseEnterTitle",this,e))).setMouseLeaveEventHandler(((t,e)=>this.R.emit("mouseLeaveTitle",this,e))).setMouseDownEventHandler(((t,e)=>this.R.emit("mouseDownTitle",this,e))).setMouseUpEventHandler(((t,e)=>this.R.emit("mouseUpTitle",this,e))).setMouseClickEventHandler(((t,e)=>this.R.emit("mouseClickTitle",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.R.emit("mouseDoubleClickTitle",this,e))).setMouseWheelEventHandler(((t,e)=>this.R.emit("mouseWheelTitle",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.R.emit("mouseDragStartTitle",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.R.emit("mouseDragTitle",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.R.emit("mouseDragStopTitle",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.R.emit("touchStartTitle",this,e))).setTouchMoveEventHandler(((t,e)=>this.R.emit("touchMoveTitle",this,e))).setTouchEndEventHandler(((t,e)=>this.R.emit("touchEndTitle",this,e))),this.xh=void 0},this.Mh=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.sh.get(e),l=(t?t.get(a):void 0)||this._h(a,e);l.wh=!1;const u=this.Ch(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.kh=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.Fh!==i||!!t.find((t=>t===e)))).map((t=>Ye(e,Js(t,a))?t:void 0)),y=p.some((t=>void 0!==t))}else y=!1;if(y){let t=!0;const e=p.filter((t=>void 0!==t));if(t&&e.every((t=>Ys(t.Fh)))&&(t=!1),t&&i.Ih&&i.Ih.Ph&&!1===i.Ih.Ph(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.th.je(t,this.At),this.Dh=!0,this.Bh=!0,this.chart=t,this.Lh=e,this.Ki=s,this.Rh=o,this.At=i,this.Eh=h,"logarithmic"===h.type&&this.setAnimationZoom(W.logarithmic(Ri(h.base))),this.zh=o.numeric,this.Vh("Numeric"),this.Oh=i.getInnerStart(),this.Nh=i.getInnerEnd(),this.setAnimationsEnabled(n)}setUnits(t,e={}){return this.Gh=t,this.Wh=e,this.Uh(),this}getUnits(){return this.Gh}setDefaultInterval(t,e){return this.Yh=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.yh=!0,this.chart.ls.xs()),this}getDefaultInterval(){return this.Yh}getTitle(){return this.mh}setTitle(t){return this.mh=t,this.Uh(),this}getTitleFillStyle(){return this.bh.Hh()}setIntervalRestrictions(t){return this.$h=t,this.chart.ls.xs(),this}getIntervalRestrictions(){return this.$h}setTitleFillStyle(t){return this.bh.Ie(t),this.chart.ls.xs(),this}getTitleFont(){return this.bh.Xh()}setTitleFont(t){return this.bh.jh(t),this.chart.ls.xs(),this}setTitleRotation(t){return this.bh.Zh(t),this.chart.ls.xs(),this}getTitleRotation(){return this.bh.Qh()}setTitleEffect(t){return this.Jh.Ss(t),this.chart.ls.xs(),this}getTitleEffect(){return this.Jh.bs()}Vh(t,e){if(this.sh.size>0&&this.Kh(),"Empty"===t){const i=e||(t=>t);this.zh=i(new Qs),this.th=this.zh.He(this.Eh),this.ih=t}else if("Numeric"===t){"Numeric"!==this.ih&&(this.zh=this.Rh.numeric);const i=e||(t=>t);this.zh=i(this.zh),this.th=this.zh.He(this.Eh),this.ih=t}else if("DateTime"===t){"DateTime"!==this.ih&&(this.zh=this.Rh.datetime);const i=e||(t=>t);this.zh=i(this.zh),this.th=this.zh.He(this.Eh),this.ih=t}else if("Time"===t){"Time"!==this.ih&&(this.zh=this.Rh.time);const i=e||(t=>t);this.zh=i(this.zh),this.th=this.zh.He(this.Eh),this.ih=t}return this.eh.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.eh=tr(this.th),this.chart.ls.xs(),this}qh(){return this.th}tr(t){this.th=t,this.eh.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.eh=tr(this.th),this.chart.ls.xs()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.yt(void 0!==e?e:this.Oh,void 0!==i?i:this.Nh,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}yt(t,e,i=!1,s=!0,r){let n={start:t,end:e};const o=!0,h=Math.abs(e-t);if(Math.abs(this.Nh-this.Oh),void 0!==this.th.Ze&&this.th.Ze>h){const i=(e+t)/2,s=this.th.Ze/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.th.Qe&&this.th.Qee?-1:1);n={start:i-s,end:i+s}}const a=this.At.ut(n.start,n.end,this.Oh,this.Nh,o);if(!1===a)return this;if(!0===a);else if(n=a,"zoomBandChart"===r)return this;let l;switch(r){case"userSetInterval":case"userFit":case"interactionSetInterval":case"interactionZoom":l=!0;break;case"zoomBandChart":case"synchronizedAxis":l=!1;break;default:return we(0,""),this}if(this.ir&&this.ir.finishAll(!1),this.oh&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.ir||this.ir.isOver()?this.oh:this.ir.NextAnimation.bind(this);this.ir=e([[this.Oh,n.start],[this.Nh,n.end]],(([t,e])=>{this.sr(t,e,o)}),t),this.ir.onAnimationEnd((()=>{this.ir=void 0,l&&(this.ph=wt.performance.now())})),this.ir.onAnimationEnd((()=>this.setStopped(s)))}else this.sr(n.start,n.end,o),this.setStopped(s),l&&(this.ph=wt.performance.now());return this}getInterval(){return{start:this.Oh,end:this.Nh}}setStopped(t){return t===this.lh||(t&&(this.ir&&this.ir.finishAll(!1),this.ir=void 0),this.lh=t,this.R.emit("stoppedStateChanged",this,this.lh),this.uh=wt.performance.now(),this.chart.ls.xs()),this}getStopped(){return this.lh}onStoppedStateChanged(t){return this.R.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.R.off(t,"stoppedStateChanged")}fit(t,e){const i=this.er(),s=this.Yh||hr,r="function"==typeof s?s({curStart:this.Oh,curEnd:this.Nh,dataMin:null==i?void 0:i.min,dataMax:null==i?void 0:i.max}):s;return this.yt(void 0!==r.start?r.start:this.Oh,void 0!==r.end?r.end:this.Nh,void 0!==r.animate?r.animate:void 0===t||t,void 0!==r.stopAxisAfter?r.stopAxisAfter:void 0===e||e,"userFit"),this}setScrollStrategy(t){return this.hh=t,this.chart.ls.xs(),this}getScrollStrategy(){return this.hh}setAnimationScroll(t){return this.rh=Boolean(t),this.chart.ls.xs(),this}setAnimationZoom(t,e=300){return this.ir&&(this.ir.finishAll(!1),this.ir=void 0),this.oh=t?K((()=>this.chart.ls.xs()))(e,t):void 0,this}setAnimationsEnabled(t){return this.ah=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(W.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.ah}setVisible(t){const e=this.Xi!==t;return this.Xi=t,this.bh.setVisible(t),this.hr((e=>{e.Ke.setVisible(t)})),e&&this.R.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onIntervalChange(t){return this.R.on("scaleChange",t)}offIntervalChange(t){return this.R.off(t,"scaleChange")}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}rr(t,e){this.xh&&this.xh();const i=new Map;if(qs(this.th)||!this.Xi)return this.Kh(),i;e=e||new Map;const s=this.nr(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.Sh.physicalAxisSize=h;const a=rr(this.th,r,n,this.Oh,this.Nh,h),l=[];if(this.ar(),l.push(...this.lr(this.th,r,n,a,e,t,i)),this.ur(this.th,r,n,a,e,t,l,i),this.cr(),a)for(const[t,e]of this.eh){const i=a.get(t);if(void 0!==i)for(const[t,s]of e)i.includes(t)||(null==s||s.dispose(),e.delete(t))}return this.Sh.min=r,this.Sh.max=n,this.Sh.scaleInterval=o,this.Sh.physicalAxisSize=h,i}dr(t){const e=t.Fh.Ar;t.Ke.gr(e(t.M,this.At)).Ls()}pr(t,e){const i=e.yr;t.Ke.Ie(i.getLabelFillStyle()).jh(i.getLabelFont()).Zh(i.getLabelRotation())}_h(t,e){const i=this.eh.get(e);let s=i.get(t);s?(i.delete(t),s.Fh=e,s.ps(!0)):s=this.mr(t,e);const r=this.sh.get(e)||new Map;return r.set(t,s),this.sh.set(e,r),this.pr(s,e),s}Ch(t,e){const i=this.vr(t,e);return this.dr(t),i}lr(t,e,i,s,r,n,o){const h=[];for(const a of t.$e){const t=s.get(a);for(const s of t){if(si)continue;const t=this.sh.get(a),l=(t?t.get(s):void 0)||this._h(s,a),u=this.Ch(l,n),c=Js(l,r);h.find((t=>Ye(c,Js(t,r))))&&l.Ke.setVisible(!1),l.wh=!1,o.set(l,u),h.push(l)}}return h}ur(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.Xe){const t=s.get(u);if(!t)break;let c;if(void 0===a)c=[{start:e,end:i,keyValues:t}];else{c=[];for(let e=0;e=i&&e0){if(void 0===u.Ih){p=!1;break}const t=u.Ih.Sr;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const m=this.kh(y.filter((t=>a.some((e=>It(t.M,e))))),g,u,d,n,h,e,i,r,o,l);!0!==m?t=t.concat(m):(d+=1,f=-1,t=[])}m=t,y.forEach((e=>{t.find((t=>t===e))||this.br(e)}))}if(l=m,!p)break}}br(t){const e=this.sh.get(t.Fh);null==e||e.delete(t.M);const i=this.eh.get(t.Fh);i&&i.has(t.M)?t.dispose():i&&(t.ps(!1),i.set(t.M,t))}hr(t){for(const e of this.sh.values())for(const i of e.values())t(i)}Mr(t,e){for(const i of this.sh.values())for(const s of i.values())e=t(e,s);return e}Kh(){this.sh.forEach(((t,e)=>{t.forEach((t=>this.br(t)))})),this.sh.clear()}ar(){for(const t of this.sh.values())for(const e of t.values())e.wh=!0}cr(){for(const t of this.sh.values())for(const[e,i]of t.entries())i.wh&&(i.dispose(),t.delete(e))}nr(){const t=this.At.getInnerStart()this.At.getInnerStart()?this.At.getInnerEnd():this.At.getInnerStart();return y(t,e)}Th(t,e){return!(t.wh||0===t.Ke._r().length||Ys(e)&&!0!==e.wr)}Cr(t,e){return qs(this.th)||(this.th.$e.forEach((i=>{e=t(e,i.yr)})),this.th.Xe.forEach((i=>{(t=>void 0!==t.Ar)(i)&&(e=t(e,i.yr))}))),e}er(){let t=this.Lh.kr();const e=this.Lh.Tr();let i;if(void 0!==t&&Tt(t)&&void 0!==e&&Tt(e)&&("logarithmic"===this.Eh.type&&(0===t&&(t=Math.min(1,e)),Math.sign(t)!==Math.sign(e)&&(t=Math.min(1,e-.1))),i?(i.min=Math.min(i.min,t),i.max=Math.max(i.max,e)):i=y(t,e)),i&&Tt(i.min)&&Tt(i.max))return It(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}Fr(){if(!this.Dh)return 0;let t=0;const e=this.Lh.Ir();return e&&(t=Math.max(t,e)),t}setAutoRegionsEnabled(t){return this.Dh=t,this.chart.ls.xs(),this}Pr(){var t;const e=this.dh;let i=!1;if(this.yh&&this.Yh){const t=this.er(),e="function"==typeof this.Yh?this.Yh({curStart:this.Oh,curEnd:this.Nh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.Yh;this.setInterval(e),this.yh=!1}if(this.hh&&!this.lh){const e=this.er();if(e){const s=this.Oh,r=this.Nh;let n=this.hh.start(s,r,e.min,e.max),o=this.hh.end(s,r,e.min,e.max);const h=null===(t=this.hh.allowIntervalLengthChange)||void 0===t||t,a=or(this.$h,e,{start:n,end:o},{start:s,end:r},h);n=a.start,o=a.end;const l=!1===It(s,n),u=!1===It(r,o);if(n=l?n:s,o=u?o:r,l||u){let t=!1;if(this.rh&&!this.Bh)if(this.rh){t=!0;const e=l?this.Dr(s,n):s,a=u?this.Dr(r,o):r;if(!0===this.sr(e,a,h)&&(l&&!1===It(e,n)||u&&!1===It(a,o))){this.chart.ls.xs(!0),i=!0;let t=Math.abs(o-n)/Math.abs(e-a);t<1&&(t=1/t),this.fh=t>=1.4}}else t=!1;t||this.sr(n,o,h),this.Bh=!1}}}return i?(this.dh!==i&&(this.dh=i,this.Ah=wt.performance.now()),this.Br&&(clearTimeout(this.Br),this.Br=void 0)):!0===e&&void 0===this.Br&&(this.fh=!1,this.Br=setTimeout((()=>{!1!==this.dh&&(this.dh=!1,this.Ah=wt.performance.now()),this.Br=void 0,this.chart.ls.xs()}),200)),this}sr(t,e,i){let s={start:t,end:e},r=!0;if(this.$h){const t=this.er();s=or(this.$h,t,s,{start:this.Oh,end:this.Nh},i)}const n=Math.abs(e-t),o=Math.abs(this.Nh-this.Oh);if(void 0!==this.th.Ze&&this.th.Ze>n){const n=(e+t)/2,h=(i?this.th.Ze/2:o/2)*(t>e?-1:1);s={start:n-h,end:n+h},r=!1}if(void 0!==this.th.Qe&&this.th.Qee?-1:1);s={start:n-h,end:n+h},r=!1}let h=this.At.ut(s.start,s.end,this.Oh,this.Nh,i);if(!1===h)return!1;!0!==h&&(s=h);const a=this.Fr(),l=this.Lr(Math.min(s.start,s.end),Math.max(s.start,s.end),a);return h=this.At.ut(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min,this.Oh,this.Nh,!1),!!h&&(!0===h?this.At.q(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min):this.At.q(s.start,s.end),this.Oh=s.start,this.Nh=s.end,this.R.emit("scaleChange",this,s.start,s.end),this.gh=wt.performance.now(),this.chart.ls.xs(),r)}Rr(){return this.dh}Er(){return void 0!==this.ir}Uh(){var t;const e=!1!==(null===(t=this.Wh)||void 0===t?void 0:t.displayOnAxis);this.bh.gr(this.Gh&&e&&this.mh?`${this.mh} (${this.Gh})`:this.mh),this.chart.ls.xs()}onTitleMouseEnter(t){return this.R.on("mouseEnterTitle",t)}offTitleMouseEnter(t){return this.R.off(t,"mouseEnterTitle")}onTitleMouseMove(t){return this.R.on("mouseMoveTitle",t)}offTitleMouseMove(t){return this.R.off(t,"mouseMoveTitle")}onTitleMouseLeave(t){return this.R.on("mouseLeaveTitle",t)}offTitleMouseLeave(t){return this.R.off(t,"mouseLeaveTitle")}onTitleMouseDown(t){return this.R.on("mouseDownTitle",t)}offTitleMouseDown(t){return this.R.off(t,"mouseDownTitle")}onTitleMouseUp(t){return this.R.on("mouseUpTitle",t)}offTitleMouseUp(t){return this.R.off(t,"mouseUpTitle")}onTitleMouseClick(t){return this.R.on("mouseClickTitle",t)}offTitleMouseClick(t){return this.R.off(t,"mouseClickTitle")}onTitleMouseDoubleClick(t){return this.R.on("mouseDoubleClickTitle",t)}offTitleMouseDoubleClick(t){return this.R.off(t,"mouseDoubleClickTitle")}onTitleMouseDragStart(t){return this.R.on("mouseDragStartTitle",t)}offTitleMouseDragStart(t){return this.R.off(t,"mouseDragStartTitle")}onTitleMouseDrag(t){return this.R.on("mouseDragTitle",t)}offTitleMouseDrag(t){return this.R.off(t,"mouseDragTitle")}onTitleMouseDragStop(t){return this.R.on("mouseDragStopTitle",t)}offTitleMouseDragStop(t){return this.R.off(t,"mouseDragStopTitle")}onTitleMouseWheel(t){return this.R.on("mouseWheelTitle",t)}offTitleMouseWheel(t){return this.R.off(t,"mouseWheelTitle")}onTitleTouchStart(t){return this.R.on("touchStartTitle",t)}offTitleMouseTouchStart(t){return this.R.off(t,"touchStartTitle")}onTitleTouchMove(t){return this.R.on("touchMoveTitle",t)}offTitleTouchMove(t){return this.R.off(t,"touchMoveTitle")}onTitleTouchEnd(t){return this.R.on("touchEndTitle",t)}offTitleTouchEnd(t){return this.R.off(t,"touchEndTitle")}}class sr{constructor(t,e,i,s,r=i.Or(s).Vr(Ie).zr(Ie).setMouseInteractions(!1)){this.wh=!1,this.$i=!1,this.qi=[],this.Fh=t,this.M=e,this.Nr=i,this.qe=s,this.Ke=r,this.qi.push(r)}ps(t){this.qi.forEach((e=>e.setVisible(t)))}dispose(){return this.$i||(this.$i=!0,this.qi.forEach((t=>t.dispose()))),this}}const rr=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.$e){let t=n.Gr(e,i,s,r);t=nr(t),o.set(n,t)}let h;for(const s of t.Xe){let t;if(void 0===h)t=s.Gr(e,i,e,i);else{let r=[];const o=h.filter((t=>e<=t&&t<=i)).length;if(o>0){const t=n/(o-1);if(void 0!==s.Wr&&s.Wr>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),or=(t,e,i,s,r)=>{const n="function"==typeof t?t({curStart:s.start,curEnd:s.end,dataMin:null==e?void 0:e.min,dataMax:null==e?void 0:e.max}):t;if(!n)return i;const o={start:i.start,end:i.end};let h=Math.abs(i.end-i.start);if(void 0!==n.intervalMin&&hn.intervalMax){const t=(o.start+o.end)/2;o.start=t+.5*Math.sign(i.start-t)*n.intervalMax,o.end=t+.5*Math.sign(i.end-t)*n.intervalMax}return h=Math.abs(i.end-i.start),void 0!==n.startMin&&(o.start=Math.max(o.start,n.startMin),r||It(Math.abs(o.start-o.end),h)||(o.end=o.start+Math.sign(i.end-i.start)*h)),h=Math.abs(i.end-i.start),void 0!==n.startMax&&(o.start=Math.min(o.start,n.startMax),r||It(Math.abs(o.start-o.end),h)||(o.end=o.start+Math.sign(i.end-i.start)*h)),h=Math.abs(i.end-i.start),void 0!==n.endMin&&(o.end=Math.max(o.end,n.endMin),r||It(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),h=Math.abs(i.end-i.start),void 0!==n.endMax&&(o.end=Math.min(o.end,n.endMax),r||It(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),o},hr=t=>{if(void 0===t.dataMin||void 0===t.dataMax)return{stopAxisAfter:!1};const e=t.curEnd>=t.curStart;return{start:e?t.dataMin:t.dataMax,end:e?t.dataMax:t.dataMin,stopAxisAfter:!1}},ar=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class lr extends ar{constructor(t){super(t)}setSize(t){return this.set("size",t)}setFamily(t){return this.set("family",t)}setWeight(t){return this.set("weight",t)}setStyle(t){return this.set("style",t)}setVariant(t){return this.set("variant",t)}getSize(){return this.get("size")}getFamily(){return this.get("family")}getWeight(){return this.get("weight")}getStyle(){return this.get("style")}getVariant(){return this.get("variant")}}const ur=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),cr=new lr,dr=new class{getFillStyle(){return B}},fr=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new U,wireframeStyle:nt});class gr extends fr{constructor(t){super(t)}setSize(t){return this.set("size",t)}getSize(){return this.get("size")}setFillStyle(t){return"function"==typeof t?this.set("fillStyle",t(this.get("fillStyle"))):this.set("fillStyle",t)}getFillStyle(){return this.get("fillStyle")}setWireframeStyle(t){return"function"==typeof t?this.set("wireframeStyle",t(this.get("wireframeStyle"))):this.set("wireframeStyle",t)}getWireframeStyle(){return this.get("wireframeStyle")}setShape(t){return this.set("shape",t)}getShape(){return this.get("shape")}}const yr=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),mr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new U});class pr extends mr{constructor(t){super(t)}setSize(t){return this.set("size",t)}getSize(){return this.get("size")}setFillStyle(t){return"function"==typeof t?this.set("fillStyle",t(this.get("fillStyle"))):this.set("fillStyle",t)}getFillStyle(){return this.get("fillStyle")}}const xr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),Ar={Triangulated:gr,Pixelated:pr};class Sr{constructor(t){this.Ur=new Map,this.ls=t}ns(t,e,i){const s=i.animationEnabled;this.Ur.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.Ur.delete(t),t.offDispose(r)}))}Yr(t,e){let i=e.animationEnabled;const s=[],r=t.onDispose((()=>{s.forEach((t=>{this.Ur.delete(t)})),t.offDispose(r)}));return{Hr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Ur.set(t,r)},$r:()=>{s.forEach((t=>{this.Ur.delete(t)})),s.length=0},Xr:t=>{i=t,s.forEach((t=>{this.Cs(t,i)}))},jr:()=>i}}ws(t,e){const i=this.Ur.get(t);i&&(i.curUnanimatedHighlightValue=be(e),this.ls.xs())}As(t,e=!1){const i=this.Ur.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}Cs(t,e){const i=this.Ur.get(t);i&&(i.animationEnabled=e)}ks(t){const e=this.Ur.get(t);return!!e&&e.animationEnabled}Ls(t){let e=!1;this.Ur.forEach(((i,s)=>{let r;if(i.animationEnabled){const s=1e3;if(i.curUnanimatedHighlightValue>0){const n=i.curAnimationPositionMillis/s;r=i.curUnanimatedHighlightValue*Math.abs(Math.sin(n*Math.PI/2+.5));const o=0===i.curAnimatedHighlightValue?1:t;i.curAnimationPositionMillis+=o,e=!0}else i.curAnimatedHighlightValue>0&&0===i.curUnanimatedHighlightValue?(r=Math.max(i.curAnimatedHighlightValue-t/s,0),e=e||r>0):r=0,i.curAnimationPositionMillis=0}else r=i.curUnanimatedHighlightValue;r!==i.curAnimatedHighlightValue&&(i.applyHighlight(r),i.curAnimatedHighlightValue=r)})),e&&this.ls.xs(!0)}}const vr=new Map,br=(t,e)=>{const i=t.getSize(),s=t.getFamily(),r=t.getWeight(),n=t.getStyle(),o=t.getVariant(),h=`${n} ${o?"small-caps":"normal"} ${r} ${i}px ${s}`,a=`${h} ${e.toFixed(2)}`;let l=vr.get(a);return l||(l=((t,e,i,s)=>({font:t,properties:e,dpr:i,id:s}))(h,{type:"font",size:i,family:s,style:n,variant:o,weight:r},e,a),vr.set(a,l)),l};var Mr,wr;!function(t){t[t.click=0]="click",t[t.dbclick=1]="dbclick",t[t.mouseDown=2]="mouseDown",t[t.mouseUp=3]="mouseUp",t[t.contextmenu=4]="contextmenu",t[t.wheel=5]="wheel"}(Mr||(Mr={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(wr||(wr={}));const Cr=t=>({container:t.Zr,setMouseStyle:(e,i)=>t.Qr(e,i),restoreMouseStyle:e=>t.Jr(e),captureFrame:(e,i,s)=>t.Kr(e,i,s),renderFrame:(e,i,s=!1)=>t.qr(e,i,s),layout:()=>{t.tn(),t.sn(),t.hn.en(),t.xs()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.rn(e,i),onRenderFrame:e=>t.nn(e),offRenderFrame:e=>t.an(e)}),Tr=[];let Rr;const Er=()=>{if(void 0!==Rr){const t=wt.getComputedStyle(wt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));Rr.style.height=wt.innerHeight-e+"px",(()=>{for(let t=0;tthis.xs()),60),this.cn=u(0,0),this.dn=!1,this.fn=kt,this.An=()=>{},this.gn=[],this.pn=-1,this.yn=[],this.mn=!0,this.$i=!1,this.vn=!1,this.sn=()=>{const{bottom:t,left:e}=this.Zr.getBoundingClientRect();return this.cn=u(Math.floor(e),Math.floor(t)),this},this.Sn=t=>{if(this.xn){const e=this.xn.entity.bn;e&&e(this.xn.entity,t,this.xn.button,this.xn.startLocation,this.xn.collectionMember,this.xn.info),this.xn=void 0}},this.tn=()=>{this.Mn&&this.Mn()},this.Qr=(t,e)=>{if(!e){this.Zr.style.cursor=t;const e=this.pn;return this.pn+=1,this.yn.push([e,t]),e}return this.Jr(e),this.Qr(t)},this.Jr=t=>{const e=t?this.yn.findIndex((e=>e[0]===t)):-1;e>=0?(this.yn.splice(e,1),this.yn.length>0?this.Zr.style.cursor=this.yn[this.yn.length-1][1]:this.Zr.style.cursor="default"):(this.yn.push([0,"default"]),this.Zr.style.cursor="default")},this._n=t=>(this.wn._(t),this),this.Cn=()=>this.wn.C(),this.kn=()=>{this.fn&&this.fn(1e3/60),this.Tn(),this.Fn(),this.An&&this.An()},this.In=t=>(this.ln.set(t.Pn(),t),this.ln=new Map([...this.ln.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.Dn=t=>(this.ln.delete(t),this),this.J=()=>(this.wn.u=!1,this),this.K=()=>(this.wn.u=!0,this),this.Bn=t=>{if(!this.mn)return;const e=this.Ln,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.vs({x:t.clientX,y:t.clientY});if(this.Rn&&((null==s?void 0:s.entity)!==this.Rn.entity||s.collectionMember!==this.Rn.collectionMember)&&!this.xn){this.Rn.entity.Ts=!1;const e=this.Rn.entity.En;e&&e(this.Rn.entity,t,this.Rn.collectionMember)}if(s&&s.entity.getMouseInteractions()&&!this.xn)if(s.entity.Ts){if(!i){const e=s.entity.zn;e&&e(s.entity,t,s.collectionMember,s.info)}}else{s.entity.Ts=!0;const e=s.entity.Vn;e&&e(s.entity,t,s.collectionMember,s.info)}if(this.xn){const i=this.xn.entity.On,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.xn.entity,t,this.xn.button,this.xn.startLocation,s,this.xn.collectionMember,this.xn.info)}this.Nn=t,this.Ln=t,this.Rn=s?{...s,event:t}:void 0},this.Gn=t=>{if(this.mn=!1,this.Nn=t,this.Rn&&!this.Wn&&!this.xn){this.Rn.entity.Ts=!1;const e=this.Rn.entity.En;e&&e(this.Rn.entity,t,this.Rn.collectionMember),this.Rn=void 0}},this.Un=t=>{if(this.mn=!0,this.Nn=t,this.xn&&t.buttons<=0){const e=this.xn.entity.bn;e&&e(this.xn.entity,t,this.xn.button,this.xn.startLocation,this.xn.collectionMember,this.xn.info),this.xn=void 0}if(this.Wn&&t.buttons<=0){const e=this.Wn.entity.Yn;e&&e(this.Wn.entity,t,this.Wn.collectionMember,this.Wn.info),this.Wn=void 0}},this.Hn=()=>this.Nn&&this.$n?this.Nn.timeStamp>this.$n.timeStamp?this.Nn:this.$n:this.Nn||this.$n,this.hn=t,this.Ki=e.theme,this.Xn=i.Xn,this.jn=i.jn,this.Zn=i.Zn,this.Qn={Jn:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,Zs:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:`${wt.location.origin}/resources`,Kn:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,qn:(()=>{const t=null==e?void 0:e.pickingPrecision;if("string"==typeof t){const e=t.toLowerCase();if("best"===e)return 1;if("high"===e)return.5;if("low"===e)return 1/8}return 1/4})(),io:void 0===(null==e?void 0:e.interactable)||e.interactable,so:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=wt.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.Zr=t}else this.Zr=s;wt.addEventListener("resize",this.tn),this.gn.push((()=>{wt.removeEventListener("resize",this.tn)}))}else{if(void 0===Rr){const t=wt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",wt.document.body.appendChild(t),Rr=t,wt.addEventListener("resize",Er)}let t=1;for(;null!==wt.document.getElementById(`chart-${t}`);)t+=1;this.Zr=wt.document.createElement("div"),this.Zr.id=`chart-${t}`,this.Zr.style.flex="1",this.Zr.style.height="100%",Rr.appendChild(this.Zr),Er(),Tr.push(this.tn),this.gn.push((()=>{Rr&&Rr.removeChild(this.Zr),Tr.includes(this.tn)&&Tr.splice(Tr.indexOf(this.tn),1),0===Tr.length&&Rr&&(wt.document.body.removeChild(Rr),Rr=void 0,wt.removeEventListener("resize",Er))}))}if(wt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Zr&&this.tn()};this.eo=new wt.ResizeObserver(t.bind(this)),this.eo.observe(this.Zr)}""===this.Zr.style.position&&(this.Zr.style.position="relative"),this.Zr.style.boxSizing="content-box",this.Zr.addEventListener("fullscreenchange",this.tn),this.Zr.addEventListener("webkitfullscreenchange",this.tn);const n=e?e.maxFps:void 0;this.ho=n?-1===n?-1:0!==n?1e3/n:0:0;const o=new Map;let h=!1;const a=(t,e)=>i=>{const s=function(t){return{x:t.clientX,y:t.clientY}}(i);switch(i.type){case"pointerover":case"pointerenter":case"pointermove":case"pointerdown":o.set(i.pointerId,s);break;default:o.delete(i.pointerId),h=!1}switch(i.interactions=Array.from(o.values()),i.pointerType){case"pen":case"mouse":default:t&&t(i);break;case"touch":e&&e(i)}i.defaultPrevented&&(h=!0)};this.Zr.onwheel=this.ro(Mr.wheel),this.Zr.oncontextmenu=this.ro(Mr.contextmenu),this.Zr.onclick=this.ro(Mr.click),this.Zr.ondblclick=this.ro(Mr.dbclick),this.Zr.onlostpointercapture=()=>{h=!1},this.Zr.ontouchmove=t=>{h&&t.preventDefault()},this.Zr.onpointerover=a(),this.Zr.onpointerenter=a(this.Un),this.Zr.onpointerdown=a(this.ro(Mr.mouseDown),this.no(wr.touchStart)),this.Zr.onpointermove=a(this.Bn,this.no(wr.touchMove)),this.Zr.onpointerup=a(this.ro(Mr.mouseUp),this.no(wr.touchEnd)),this.Zr.onpointercancel=a(),this.Zr.onpointerout=a(),this.Zr.onpointerleave=a(this.Gn,this.no(wr.touchEnd)),wt.addEventListener("dragstart",this.Sn),wt.addEventListener("scroll",this.sn,{passive:!0}),this.wn=p(new b({r:0,g:0,b:0,a:0})),this.os=new Sr(this)}oo(t,e){var i,s,r,n;(null===(i=this.Rn)||void 0===i?void 0:i.entity)===t.entity&&this.Rn.collectionMember===t.collectionMember&&(this.Rn={...e,info:this.Rn.info,event:this.Rn.event}),(null===(s=this.ao)||void 0===s?void 0:s.entity)===t.entity&&this.ao.collectionMember===t.collectionMember&&(this.ao={...e,info:this.ao.info}),(null===(r=this.Wn)||void 0===r?void 0:r.entity)===t.entity&&this.Wn.collectionMember===t.collectionMember&&(this.Wn={...e,info:this.Wn.info,event:this.Wn.event}),(null===(n=this.xn)||void 0===n?void 0:n.entity)===t.entity&&this.xn.collectionMember===t.collectionMember&&(this.xn={...e,info:this.xn.info,button:this.xn.button,startLocation:this.xn.startLocation})}lo(){this.vn=!0,this.fn=void 0,this.An=void 0}nn(t){return this.R.on("render",t)}an(t){return this.R.off(t)}uo(){return this.co}do(){return this.fo}setBackgroundFillStyle(t){return this.Ao.Ie(t),this}getBackgroundFillStyle(){return this.Ao.Hh()}setBackgroundStrokeStyle(t){return this.Ao.Fe(t),this}getBackgroundStrokeStyle(){return this.Ao.po()}yo(t){return this.An=t,this}mo(t){return this.fn=t,this}vo(t){return this.ln.get(t)}So(){return Array.from(this.ln.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}ro(t){return e=>this.xo(t,e)}xo(t,e){if(!this.mn)return;t===Mr.contextmenu&&Qt(e);const i=this.vs({x:e.clientX,y:e.clientY});if(t===Mr.mouseUp){if(this.xn){const t=this.xn.entity.bn;if(t&&t(this.xn.entity,e,this.xn.button,this.xn.startLocation,this.xn.collectionMember,this.xn.info),(null==i?void 0:i.entity)!==this.xn.entity||i.collectionMember!==this.xn.collectionMember){this.xn.entity.Ts=!1;const t=this.xn.entity.En;t&&t(this.xn.entity,e,this.xn.collectionMember)}this.xn=void 0}if(this.Wn){const t=this.Wn.entity.getMouseInteractions()&&this.Wn.entity.Yn;t&&t(this.Wn.entity,e,this.Wn.collectionMember,this.Wn.info),this.Wn=void 0}}else if(i&&i.entity.getMouseInteractions()){const s=t===Mr.click?i.entity.bo:t===Mr.dbclick?i.entity.Mo:t===Mr.mouseDown?i.entity._o:t===Mr.wheel?i.entity.wo:t===Mr.contextmenu?i.entity.Co:void 0;if(s&&s(i.entity,e,i.collectionMember,i.info),t===Mr.mouseDown){this.Wn={entity:i.entity,collectionMember:i.collectionMember,event:e,info:i.info};const t=this.Wn.event.button,s=i.entity.ko;s&&s(i.entity,e,t,i.collectionMember,i.info),this.xn={entity:i.entity,collectionMember:i.collectionMember,button:t,startLocation:u(e.clientX,e.clientY),info:i.info}}}this.Nn=e,this.Rn=i?{...i,event:e}:void 0}no(t){return e=>this.To(t,e)}To(t,e){const i=e.interactions.length;if(this.$n=e,this.ao){const s=t===wr.touchMove?this.ao.entity.Fo:t===wr.touchEnd?this.ao.entity.Io:t===wr.touchStart?this.ao.entity.Po:void 0;s&&s(this.ao.entity,e,this.ao.collectionMember,this.ao.info),t===wr.touchEnd&&0===i&&(this.ao.entity.Ts=!1,this.ao=void 0)}else if(t===wr.touchStart){for(let t=0;t{t()})),this.gn.length=0}}Re(t,e){return u(t-this.cn.x,this.cn.y-e)}zo(t,e){return u(t+this.cn.x,this.cn.y-e)}Vo(t){const e=this.Re(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Oo(t){const e=this.zo(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const Dr=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=li(i,s*t),n=Math.abs(r.x),o=e.length,h=[];let a=0,l=0,c=e[0].x+n;for(;ls&&(s=e[l].y),e[l].y({type:"horizontalRegressive",packager:(e,i,s)=>{if(e.length>1){const r=li(i,s*t),n=Math.abs(r.x),o=e.length,h=[];let a=0,l=0,c=e[0].x-n;for(;lc&&l=c;)e[l].y>s&&(s=e[l].y),e[l].y({type:"verticalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=li(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y+n;for(;ls&&(s=e[l].x),e[l].x({type:"verticalRegressive",packager:(e,i,s)=>{if(e.length>1){const r=li(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y-n;for(;lc&&l=c;)e[l].x>s&&(s=e[l].x),e[l].x{const u=t.length;if(0===u)return;const c=s?1:0,d=u-(r?2:1);if(i===zr.Nearest)return Or(t,e,n,o,c,d);if(i===zr.NearestX||i===zr.NearestY){if("boolean"==typeof l&&("x"===a&&i===zr.NearestX||"y"===a&&i===zr.NearestY))return Gr(t,ct(e,o,n),a,l,c,d);if(i===zr.NearestX)return Ur(t,ct(e,o,n),h,c,d);if(i===zr.NearestY)return Yr(t,ct(e,o,n),h,c,d)}},Or=(t,e,i,s,r,n)=>{let o,h=Number.MAX_VALUE;for(let a=r;a<=n;a+=1){const r=t[a];if(!Number.isNaN(r.x)&&!Number.isNaN(r.y)){const t=ct(r,i,s),n=(t.x-e.x)**2+(t.y-e.y)**2;n{if(e.xi.max.x)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.x>e.x?s.x-e.x:e.x-s.x;r{if(e.yi.max.y)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.y>e.y?s.y-e.y:e.y-s.y;r{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,y=Math.floor((r+n)/2),m=n,p=-1;for(;;){const e=h-(o?t[y].x:t[y].y);if(e*(s?-1:1)>0)g=Math.min(y+1,m),p=Math.floor((g+m)/2);else{if(0===Math.abs(e))return y;m=Math.max(y-1,g),p=Math.floor((g+m)/2)}if(p===y){const i=y>r?Math.abs(h-(o?t[y-1].x:t[y-1].y)):Be,s=y{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,y=Math.floor((r+n)/2),m=n,p=-1;for(;;){const i=h-(o?t[y].x:t[y].y);if(i*(s?-1:1)>0)g=Math.min(y+1,m),p=Math.floor((g+m)/2);else{if(0===Math.abs(i))return{a:y,b:y,lerpAmount:0};m=Math.max(y-1,g),p=Math.floor((g+m)/2)}if(p===y){if(i*(s?-1:1)<0&&y>r){const i=t[y-1],s=t[y];return{a:y-1,b:y,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(ythis.R.on("dispose",t),this.offDispose=t=>this.R.off(t,"dispose"),this.ls=t,this.Ho=e,this.$o=i,this.Xo=Zr,Zr+=1,this.jo=t.Ki.highlightColorOffset}Zo(){let t;return this.Qo("DataPattern",(e=>(t=e.pattern,!0))),"ProgressiveX"===t||"RegressiveX"===t?zr.NearestX:"ProgressiveY"===t||"RegressiveY"===t?zr.NearestY:zr.Nearest}Jo(t){return void 0!==this.$o.find((e=>e.type===t))}Qo(t,e){var i;return!!this.Jo(t)&&!0===e(null===(i=this.$o.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.$i||(this.Ts&&this.En&&this.En(this,void 0,void 0),this.$i=!0,this.Ho(this),this.R.emit("dispose",this)),this}isDisposed(){return this.$i}setVisible(t){const e=this.Xi;return this.Xi=t,!t&&e&&(this.Ts&&this.En&&this.En(this,void 0,void 0),this.Ts=!1),this}getVisible(){return this.Xi}setMouseInteractions(t){const e=this.No.C();return this.No._(t),t||(e&&this.Ts&&this.En&&this.En(this,void 0,void 0),this.Ts=!1),this}getMouseInteractions(){return this.No.C()}getIsUnderMouse(){return this.Ts}getIsGrabbed(){return this.Wo}setMouseMoveEventHandler(t){return this.zn=t,this}setMouseEnterEventHandler(t){return this.Vn=t,this}setMouseLeaveEventHandler(t){return this.En=t,this}setMouseClickEventHandler(t){return this.bo=t,this}setMouseDoubleClickEventHandler(t){return this.Mo=t,this}setMouseDownEventHandler(t){return this._o=t,this}setMouseUpEventHandler(t){return this.Yn=t,this}setMouseWheelEventHandler(t){return this.wo=t,this}setMouseContextMenuEventHandler(t){return this.Co=t,this}setMouseDragEventHandler(t){return this.On=t,this}setMouseDragStartEventHandler(t){return this.ko=t,this}setMouseDragStopEventHandler(t){return this.bn=t,this}setTouchStartEventHandler(t){return this.Po=t,this}setTouchMoveEventHandler(t){return this.Fo=t,this}setTouchEndEventHandler(t){return this.Io=t,this}Ko(t){return this.Uo=t,this}qo(){return this.Uo?this.Uo:Wr}us(t){return this.Yo=t,this}ta(){return this.Yo}ia(t){return this.jo=t,this}sa(){return this.jo}}const Wr=y(u(0,0),u(0,0));class jr extends Hr{constructor(t,e,i,s){super(t,i,s),this.ea=0,this.Is=e,this.Is.ha=!0}ra(t){return this.ea===t||(this.ea=t,this.Is.ha=!0),this}na(){return this.ea}}class Kr extends jr{constructor(t,e,i,s,r){super(t,e,s,r),this.oa=!0,this.At=i}}const $r=(t,e,i)=>{if(i instanceof Bi){const s=i.Wi(),r=di(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return y(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return y(i.pi(u(t.min.x,t.min.y),li(e,-1)),i.pi(u(t.max.x,t.max.y),e))},Qr=(t,e)=>"function"==typeof e?e(t):e,qr=(t,e)=>!t||t!==e,Jr=t=>t!==B;class tn extends Kr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.we=Ir.fillStyle,this.ls=t}Ie(t){return this.we=Qr(this.we,t),this}Hh(){return this.we}aa(){return qr(this.la,this.we)}ua(){return((t,e)=>t===B&&e!==B)(this.la,this.we)}ca(){return Jr(this.we)}da(t){this.la=t}}class en extends tn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ce=Ir.lineStyle,this.ls=t}Fe(t){return this.Ce="function"==typeof t?t(this.Ce):t,this}po(){return this.Ce}fa(){return!this.Aa||this.Aa!==this.Ce}ga(t){return!this.Aa||this.Aa.getThickness()!==t}ca(){return this.Ce!==nt||super.ca()}ua(){return(this.Ce!==nt||this.we!==B)&&this.Aa===nt&&this.la===B}pa(t){this.Aa=t}}class sn extends tn{constructor(t,e,i,s,r,n=p(5)){super(t,e,i,s,r),this.size=p(5),this.size=n}it(t){return this.size._(t),this}}class rn extends tn{constructor(t,e,i,s,r,n=p(Ir.font)){super(t,e,i,s,r),this.ya=p(""),this.ma=p(u(0,0)),this.va=p(0),this.Sa=p(0),this.xa=p(u(0,0)),this.ba=p(0),this.Ma=p(cr),this._a=u(0,0),this.Xt=p(x(1,1,1,1)),this.wa=p(A(4,4,4,4)),this.font=p(Ir.font),this.Ca=!1,this.font=n}ca(){return Jr(this.we)&&this.ya.C().length>0}ua(){return!1===this.Ca&&this.ca()}gr(t){return this.ya._(t),this}_r(){return this.ya.C()}jh(t){return ur(t)?this.Ma._(t):this.Ma._(t(this.Ma.C())),this}Xh(){return this.Ma.C()}ka(t){return this.Ma._(this.Ma.C().setFamily(t)),this}Ta(){return this.Ma.C().getFamily()}Fa(t){return this.Ma._(this.Ma.C().setSize(t)),this}Ia(){return this.Ma.C().getSize()}Pa(t){return this.Ma._(this.Ma.C().setWeight(t)),this}Da(){return this.Ma.C().getWeight()}Ba(t){return this.Ma._(this.Ma.C().setStyle(t)),this}La(){return this.Ma.C().getStyle()}Ra(t){return this.Ma._(this.Ma.C().setVariant(t)),this}Ea(){return this.Ma.C().getVariant()}Be(t){return this.ma._(t),this}za(){return this.ma.C()}Zh(t){return this.ba._(t),this}Qh(){return this.ba.C()}Va(t,e){return this.xa._(u(t,e)),this}Oa(){return this.xa.C()}Na(t){return this.Sa._(t),this}Ga(){return this.Sa.C()}Wa(t){return this.va._(t),this}Ua(){return this.va.C()}Ya(t){return this.Sa._(t.x),this.va._(t.y),this}zr(t){return this.Xt._(t),this}Ha(){return this.Xt.C()}Vr(t){return this.wa._(t),this}$a(){return this.wa.C()}}class nn extends sn{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,p(o)),this.Xa=[],this.ja=p(e.PointShape.Square),this.ba=p(0),this.Za=p(!1),this.Qa=p(!1),this.Ja=p(!1),this.Ka=Ne,this.qa=0,this.tl=[],this.il=0,this.sl=Ne,this.el=!1,this.hl=void 0}rl(){return this.tl}nl(){return this.Xa}ol(t){return this.ja._(t),this}al(){return this.ja.C()}Zh(t){return this.ba._(t),this}Qh(){return this.ba.C()}ll(t){return this.Za._(t),this}ul(t){return this.Qa._(t),this}cl(t){return this.Ja._(t),this}dl(t,e){return Array.isArray(t)||(t=[t]),this.il+=t.length,this.tl=he(this.tl,t,{canReturnB:!0}),this.sl&&(this.sl=e?ei(this.sl,e):void 0),this.hl=void 0,this}Ot(){return this.el=!0,this.Xa.length=0,this.qa=0,this.Ka=Ne,this.tl=[],this.il=0,this.hl=void 0,this}fl(){return this.qa}Al(){return this.il}}class on extends en{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ma=p(u(0,0)),this.Z=p(u(100,100)),this.ba=p(0),this._a=p(u(0,0)),this.pl=!1}Ls(){return this.yl(),this}Be(t){const e=this.ma.C();return t.x===e.x&&t.y===e.y||(this.ma._(t),this.yl()),this}za(){return this.ma.C()}ml(t){const e=this.ma.C();return t!==e.x&&(this.ma._(u(t,e.y)),this.yl()),this}vl(t){const e=this.ma.C();return t!==e.y&&(this.ma._(u(e.x,t)),this.yl()),this}it(t){const e=this.Z.C();return t.x===e.x&&t.y===e.y||(this.Z._(u(t.x,t.y)),this.yl()),this}oi(){return this.Z.C()}Sl(t){const e=this.Z.C();return t!==e.x&&(this.Z._(u(t,e.y)),this.yl()),this}xl(t){const e=this.Z.C();return t!==e.x&&(this.Z._(u(e.x,t)),this.yl()),this}Zh(t){return this.ba._(t),this}Qh(){return this.ba.C()}bl(t){const e=this._a.C();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.pl=!1,this.yl()):(this.pl=!0,this._a._(t))),this}yl(){if(!this.pl){const t=this.ma.C(),e=this.Z.C(),i=u(t.x+e.x/2,t.y+e.y/2),s=this._a.C();i.x===s.x&&i.y===s.y||this._a._(i)}}}class hn extends en{constructor(){super(...arguments),this.Xa=[],this.ma=p(u(0,0)),this.Ka=Ne,this.Ml=!1}_l(t){return t=ie(t),this.Xa=t,this.Ml=!0,this}wl(){return this.Xa}St(){return this.Ka.max.x}vt(){return this.Ka.min.x}bt(){return this.Ka.max.y}xt(){return this.Ka.min.y}Cl(){return 0}kl(){return 0}}class an extends hn{}class ln extends tn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Tl=new Array,this.Fl=new Array,this.Il=p({type:"disabled",packager:(t,e,i)=>t.slice()}),this.Ka=Ne,this.Pl=0,this.Dl=!1,this.tl=[Array(),Array()],this.Bl=!1,this.Ll=(new U).setColor(w(42,171,240)),this.el=!1,this.Rl=!1,this.El=!1}dl(t,e){const i=this.Pl-1,s=i>0&&!this.Bl;let[r,n]=s?[[this.Tl[i]],[this.Fl[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=he(r,e,{canReturnB:!0}),n=he(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Bl?(this.tl[0]=he(this.tl[0],r,{canReturnB:!0}),this.tl[1]=he(this.tl[1],n,{canReturnB:!0})):(this.tl=[r,n],this.Bl=!0),this.Ka=ei(this.Ka,e||ei(Je(r),Je(n))),this}Ot(){return this.el=!0,this.Tl.length=0,this.Fl.length=0,this.Pl=0,this.Ka=Ne,this}nl(){return[this.Tl,this.Fl]}rl(){return[this.tl[0],this.tl[1]]}zl(t){return this.Il._(t),this}Vl(){return this.Il.C()}Ol(t){return this.Ll="function"==typeof t?t(this.Ll):t,this}Nl(){return this.Ll}fl(){return this.Pl-(Number(this.Rl)+Number(this.El))}Al(){return this.tl.length}Gl(t){return this.Rl=t,this}Wl(){return this.Rl}Ul(t){return this.El=t,this}Yl(){return this.El}ua(){return this.la===B&&this.Hl===B&&(this.we!==B||this.Ll!==B)}$l(t){this.Hl=t}ca(){return this.Ll!==B||super.ca()}aa(){return super.aa()||!this.Hl||this.Hl!==this.Ll}}class un extends en{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ma=p(u(0,0)),this.Xl=p(0),this.Fi=p(360),this.jl=p(100),this.Zl=p(100),this.Ql=p(0),this.Jl=p(void 0),this.Kl=u(0,0),this.ql=u(0,0),this.tu=u(0,0)}iu(){return this.jl.C()}su(){return this.Zl.C()}za(){return this.ma.C()}eu(){return this.Xl.C()}Ti(){return this.Fi.C()}hu(){return this.Ql.C()}ru(){return this.Jl.C()}nu(){return this.Kl}ou(){return this.ql}au(){return this.tu}Be(t){return this.ma._(t),this}lu(t){return this.Xl._(t),this}Ge(t){return this.Fi._(t),this}uu(t){return this.Zl._(t),this.jl._(t),this}cu(t){return this.jl._(t),this}du(t){return this.Zl._(t),this}fu(t){return this.Ql._(t<0?0:t),this}Au(t){return this.Jl._(void 0!==t&&t<=0?void 0:t),this}}var cn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(cn||(cn={}));class dn extends Kr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.gu=Ir.lineStyle,this.engine=t}Oe(t){return this.gu=((t,e)=>"function"==typeof e?e(t):e)(this.gu,t),this}pu(){return this.gu}fa(){return((t,e)=>!t||t!==e)(this.yu,this.gu)}mu(t){return((t,e)=>!t||t.getThickness()!==e)(this.yu,t)}ua(){return((t,e)=>t===nt&&e!==nt)(this.yu,this.gu)}ca(){return(t=>t!==nt&&t.getFillStyle()!==B)(this.gu)}vu(t){this.yu=t}}class fn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Pi=u(0,0),this.Fi=u(0,0),this.Su=!1}_({min:t,max:e}){return t.x===this.Pi.x&&t.y===this.Pi.y&&e.x===this.Fi.x&&e.y===this.Fi.y||(this.Su=!0,this.Pi=t,this.Fi=e),this}Ii(){return this.Pi}Ti(){return this.Fi}We(t){return t.x===this.Pi.x&&t.y===this.Pi.y||(this.Su=!0,this.Pi=t),this}Ge(t){return t.x===this.Fi.x&&t.y===this.Fi.y||(this.Su=!0,this.Fi=t),this}}class gn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.xu=void 0}}class yn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.bu=[],this.Ka=Ne,this.tl=new Array,this.qa=0,this.el=!1,this.Mu=p(void 0),this.Rl=!1,this.El=!1}_u(t){return this.Mu._(t),this}wu(){return this.Mu.C()}rl(){return this.tl}nl(){return this.bu}Ot(){return this.el=!0,this.bu.length=0,this.qa=0,this.tl=[],this.Ka=Ne,this}fl(){return this.qa-(Number(this.Rl)+Number(this.El))}Al(){return this.tl.length}Gl(t){return this.Rl=t,this}Wl(){return this.Rl}Ul(t){return this.El=t,this}Yl(){return this.El}}const mn=t=>{const i=t.getDraggingMode();return void 0!==i&&i!==e.UIDraggingModes.notDraggable?i===e.UIDraggingModes.draggable?e.MouseStyles.Move:i===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical:void 0};class pn{constructor(){this.Xi=!0,this.R=new r.Eventer,this.Cu=0,this._t=(t,e,i)=>{0===this.Cu&&this.R.emit("mouseEnter",this,e),this.Cu+=1},this.wt=(t,e,i)=>{this.Cu-=1,this.Cu<1&&(this.R.emit("mouseLeave",this,e),this.Cu=0)},this.Ct=(t,e,i)=>{this.R.emit("mouseClick",this,e)},this.kt=(t,e,i)=>{this.R.emit("mouseDoubleClick",this,e)},this.Tt=(t,e,i)=>{this.R.emit("mouseDown",this,e)},this.Ft=(t,e,i)=>{this.R.emit("mouseUp",this,e)},this.It=(t,e,i)=>{this.R.emit("mouseMove",this,e)},this.Dt=(t,e,i,s)=>{this.R.emit("mouseDragStart",this,e,i)},this.Pt=(t,e,i,s,r,n)=>{this.R.emit("mouseDrag",this,e,i,s,r)},this.Bt=(t,e,i,s,r)=>{this.R.emit("mouseDragStop",this,e,i,s)},this.Lt=(t,e,i)=>{this.R.emit("mouseWheel",this,e)},this.Rt=(t,e)=>{this.Cu+=1,this.R.emit("touchStart",this,e)},this.Et=(t,e)=>{this.R.emit("touchMove",this,e)},this.zt=(t,e)=>{this.Cu-=1,this.R.emit("touchEnd",this,e)},this.ku=t=>(t instanceof Kr?t.setMouseEnterEventHandler(this._t).setMouseLeaveEventHandler(this.wt).setMouseClickEventHandler(this.Ct).setMouseDoubleClickEventHandler(this.kt).setMouseDownEventHandler(this.Tt).setMouseUpEventHandler(this.Ft).setMouseMoveEventHandler(this.It).setMouseDragEventHandler(this.Pt).setMouseDragStartEventHandler(this.Dt).setMouseDragStopEventHandler(this.Bt).setMouseWheelEventHandler(this.Lt).setTouchStartEventHandler(this.Rt).setTouchMoveEventHandler(this.Et).setTouchEndEventHandler(this.zt):(t.onMouseEnter(((t,e)=>this._t(t,e))),t.onMouseLeave(((t,e)=>this.wt(t,e))),t.onMouseClick(((t,e)=>this.Ct(t,e))),t.onMouseDoubleClick(((t,e)=>this.kt(t,e))),t.onMouseDown(((t,e)=>this.Tt(t,e))),t.onMouseUp(((t,e)=>this.Ft(t,e))),t.onMouseMove(((t,e)=>this.It(t,e))),t.onMouseDrag(((t,e,i,s,r)=>this.Pt(t,e,i,s,r))),t.onMouseDragStart(((t,e,i)=>this.Dt(t,e,i))),t.onMouseDragStop(((t,e,i,s)=>this.Bt(t,e,i,s))),t.onMouseWheel(((t,e)=>this.Lt(t,e))),t.onTouchStart(((t,e)=>this.Rt(t,e))),t.onTouchMove(((t,e)=>this.Et(t,e))),t.onTouchEnd(((t,e)=>this.zt(t,e)))),t)}onMouseEnter(t){return this.R.on("mouseEnter",t)}onMouseLeave(t){return this.R.on("mouseLeave",t)}onMouseClick(t){return this.R.on("mouseClick",t)}onMouseDoubleClick(t){return this.R.on("mouseDoubleClick",t)}onMouseDown(t){return this.R.on("mouseDown",t)}onMouseUp(t){return this.R.on("mouseUp",t)}onMouseMove(t){return this.R.on("mouseMove",t)}onMouseDragStart(t){return this.R.on("mouseDragStart",t)}onMouseDrag(t){return this.R.on("mouseDrag",t)}onMouseDragStop(t){return this.R.on("mouseDragStop",t)}onMouseWheel(t){return this.R.on("mouseWheel",t)}onTouchStart(t){return this.R.on("touchStart",t)}onTouchMove(t){return this.R.on("touchMove",t)}onTouchEnd(t){return this.R.on("touchEnd",t)}offMouseEnter(t){return this.R.off(t,"mouseEnter")}offMouseLeave(t){return this.R.off(t,"mouseLeave")}offMouseClick(t){return this.R.off(t,"mouseClick")}offMouseDoubleClick(t){return this.R.off(t,"mouseDoubleClick")}offMouseDown(t){return this.R.off(t,"mouseDown")}offMouseUp(t){return this.R.off(t,"mouseUp")}offMouseMove(t){return this.R.off(t,"mouseMove")}offMouseDragStart(t){return this.R.off(t,"mouseDragStart")}offMouseDrag(t){return this.R.off(t,"mouseDrag")}offMouseDragStop(t){return this.R.off(t,"mouseDragStop")}offMouseWheel(t){return this.R.off(t,"mouseWheel")}offTouchStart(t){return this.R.off(t,"touchStart")}offTouchMove(t){return this.R.off(t,"touchMove")}offTouchEnd(t){return this.R.off(t,"touchEnd")}getIsUnderMouse(){return this.Cu>0}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&this.R.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}}const xn=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.pi(t.getPosition(),{x:r!==e.UIDraggingModes.onlyVertical?i.x:0,y:r!==e.UIDraggingModes.onlyHorizontal?i.y:0}),o=t.scale,h=t.getSize(),a=t.getOrigin(),l=o.pi({x:o.x.getInnerStart(),y:o.y.getInnerStart()},di({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.pi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},di({x:(a.x-1)/2,y:(a.y-1)/2},h)),c={x:Math.min(Math.max(n.x,l.x),u.x),y:Math.min(Math.max(n.y,l.y),u.y)};t.setPosition(c),Qt(s)}},An=(t,e,i,s,r)=>{xn(t,r,e)},Sn=(t,e,i,s,r)=>{xn(t,s,r)};class vn extends pn{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.$i=!1,this.Tu=void 0,this.Fu=void 0,this.Iu=mn,this.Pu=void 0,this.No=!0,this.Du=()=>{const t="function"==typeof this.Iu?this.Iu(this):this.Iu;t&&(this.Fu=this.Is.ls.Qr(t))},this.Bu=()=>{this.Is.ls.Jr(this.Fu)},this.Xt=x(0,0,0,0),this.Is=t,this.renderingScale=e,this.scale=i,this.Ho=s,this.Ki=r,this.Is.xs(),this.onMouseEnter(this.Du),this.onMouseLeave(this.Bu),this.onMouseDrag(An);const n=ji(new $i(kt,Sn,kt));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.Ki=r}setMouseInteractions(t){return this.Lu().forEach((e=>e.setMouseInteractions(t))),this.No=t,this}getMouseInteractions(){return this.No}setEffect(t){return this.ss=this.ss||this.Is.ls.ss.es(this,{Ru:{shapes:this.Lu()}}),this.ss.Ru.Ss(t),this}getEffect(){return!!this.ss&&this.ss.Ru.bs()}setAutoDispose(t){return this.Pu=t,this.Is.xs(),this}getAutoDispose(){return this.Pu}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this.Xt.left+this.Xt.right),this.size.y+(this.Xt.bottom+this.Xt.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this.Xt="object"==typeof t?S(this.Xt,t):{left:t,top:t,right:t,bottom:t},this.Is.xs(),this}getMargin(){return this.Xt}De(){if(this.Pu){const t=this.size,e=this.renderingScale.oi(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.Pu.type&&i.x>=this.Pu.maxWidth||"max-height"===this.Pu.type&&i.y>=this.Pu.maxHeight)&&this.dispose()}return this}Ls(){return this}dispose(){return this.$i||(this.Is.xs(),this.$i=!0,this.Ho(this),this.R.emit("dispose",this),this.Lu().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.Lu().forEach((e=>e.setVisible(t))),this.Is.xs(),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setPosition(t){return this.position=t,this.Is.xs(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.pi(this.position,di({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.pi(r,di({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.pi(r,{x:this.Xt.left,y:this.Xt.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.pi(n,di({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Is.xs(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Tu=t,this.Is.xs(),this}getDraggingMode(){return void 0!==this.Tu?this.Tu:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Iu=t,this}getMouseStyle(){return this.Iu}}class bn extends vn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.wa=x(),this.Eu=0,this.Is=t,this.zu=s,this.backgroundElement=new this.zu(this.Is,this.renderingScale,this.scale,kt,n),this.ku(this.backgroundElement)}Lu(){return this.backgroundElement.Lu()}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}De(){return super.De(),this.$i||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).De(),this}Ls(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.Vu(t).Ls(),super.Ls()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.wa="object"==typeof t?S(this.wa,t):{left:t,top:t,right:t,bottom:t},this.Is.xs(),this}getPadding(){return this.wa}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.wa.left+this.wa.right,i.y+this.wa.bottom+this.wa.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Ou()+this.backgroundElement.Nu(),i.y+this.backgroundElement.Gu()+this.backgroundElement.Wu())),i}getPosition(t=this.origin,i=e.UISpace.Everything){if(i===e.UISpace.Everything)return super.getPosition(t,i);const s=super.getPosition(u(-1,-1),e.UISpace.Everything),r=this.getMargin(),n=this.scale.pi(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.pi(n,di({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.pi(n,{x:this.backgroundElement.Ou(),y:this.backgroundElement.Gu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.pi(o,di({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.pi(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.pi(a,di({x:(t.x+1)/2,y:(t.y+1)/2},l))}setMouseInteractions(t){return super.setMouseInteractions(t),this.backgroundElement.setMouseInteractions(t),this}getHighlight(){return this.Eu}setHighlight(t){return this.Eu=be(t),this.backgroundElement.setHighlight(t),this.R.emit("highlight",this,t),this}}const Mn=t=>"setBackground"in t;class wn extends pn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.M=0,this.Uu=1,this.Yu=!0,this.Hu=new lr,this.$u=!0,this.$i=!1,this.axisScale=s,this.renderingScale=r,this.Xu=o,this.ju=h,this.Zu=a,this.Ho=l,this.Qu=e,this.Ju=i,this.Ku=this.ku(this.Qu.Ne(this.renderingScale)),this.Ki=u,this.qu=this.ku(this.Zu.setDirection(this.ju).tc(this.Ju,this.renderingScale,n,kt,this.Ki,!1).setOrigin(Kt(this.ju))),this.axis=t,this.setMouseInteractions(!1),"major"===this.qu.ic?this.Ku.Oe(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.qu.ic?this.Ku.Oe(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.qu.ic&&this.Ku.Oe(u.cursorGridStrokeStyleX)}setValue(t){return this.M=t,this.Ju.xs(),this.R.emit("valueChange",this,this.M),this}getValue(){return this.M}setTextFormatter(t){return this.sc=t,this.Ju.xs(),this}setTickLength(t){return this.qu.setPointerLength(t),this.Qu.xs(),this}getTickLength(){return this.qu.getPointerLength()}setTickLabelPadding(t){return this.qu.setTickLabelPadding(t),this.Qu.xs(),this}setTickLabelRotation(t){return this.qu.setTextRotation(t),this.Qu.xs(),this}getTickLabelRotation(){return this.qu.getTextRotation()}getTickLabelPadding(){return this.qu.getTickLabelPadding()}setGridStrokeLength(t){return this.Uu=t,this.Qu.xs(),this}getGridStrokeLength(){return this.Uu}setGridStrokeStyle(t){return this.Ku.Oe(t),this.Qu.xs(),this}getGridStrokeStyle(){return this.Ku.pu()}dispose(){return this.$i||(this.$i=!0,this.Ku.dispose(),this.qu.dispose(),this.Ho(this),this.Qu.ls.xs(),this.R.emit("dispose",this)),this}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setMarkerVisible(t){return this.Yu=t,this.Ju.xs(),this}getMarkerVisible(){return this.Yu}setMarker(t){return t(this.qu),this.Ju.xs(),this}getMarker(){return this.qu}setMouseInteractions(t){return this.qu.setMouseInteractions(t),this.Ku.setMouseInteractions(t),this}getMouseInteractions(){return this.Ku.getMouseInteractions()}setAllocatesAxisSpace(t){return this.$u=t,this.Ju.xs(),this}getAllocatesAxisSpace(){return this.$u}isInScale(){return je(this.M,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}}class Cn extends wn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,u,a,l),this.hc=!1,this.Ho=a,this.Qu=e,this.Ju=i}dispose(){return this.hc=!1,super.dispose()}update(){return this}plot(t,e,i,s,r){if(this.isInScale()&&this.getVisible()&&t){this.hc=!1;const t=ut(this.M,this.axisScale,this.Xu.getWidth(this.renderingScale));this.Ku.setVisible(!0).We(this.Xu.toPoint(t,e)).Ge(this.Xu.toPoint(t,e-(s+i*this.Uu))),this.Yu?(this.sc&&this.qu.setText(this.sc(this.M,this)),this.qu.setVisible(!0).setPosition(this.Xu.toPoint(t,r))):this.qu.setVisible(!1)}else this.Ku.setVisible(!1),this.qu.setVisible(!1);return this.qu.Ls().De(),this}rc(){const t=this.qu.Ls().getSize();return this.Xu.getHeight(t)}}const Tn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),Rn=(t,e)=>(ce(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),En=(t,e,i)=>{i&&Mn(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},kn={uiElement:void 0,stylers:o.List(),addStyler(t){return{...this,stylers:this.stylers.push(t)}},applyStylers(t,e){return this.stylers.forEach((i=>void 0!==i?i(t,e):void 0)),t}},In={background:void 0,setBackground(t){return{...this,background:t}}},Fn={tc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return En(o,r,n),o}},Dn={tc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return En(o,r,n),o}};class Pn extends vn{constructor(){super(...arguments),this.nc=!0}De(){return super.De(),this}setMouseInteractions(t){return this.nc=t,this}getMouseInteractions(){return this.nc}Lu(){return[]}}class Ln extends Pn{onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}Vu(t){return this.size=t,this}Ou(){return 0}Nu(){return 0}Wu(){return 0}Gu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return B}setStrokeStyle(){return this}getStrokeStyle(){return nt}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Vn extends vn{constructor(){super(...arguments),this.R=new r.Eventer,this.Eu=0}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}getHighlight(){return this.Eu}setHighlight(t){return this.Eu=t,this.Lu().forEach((e=>e.us(t))),this.R.emit("highlight",this,t),this.Is.xs(),this}}class _n extends Vn{}class Bn extends _n{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Is=t,this.ja=this.Is.oc(this.renderingScale,cn.Simple).setVisible(!1).Ie(B).Fe(nt),this.ku(this.ja)}ac(){const t=this.lc();if(t.length>2){const e=Je(t),i=u(e.max.x-e.min.x,e.max.y-e.min.y);this.setContentSize(i);const s=t.map((t=>{const s=ui(t,li(e.min,-1));return this.scale.pi(this.position,ui(s,di(li(ui(this.origin,u(1,1)),-.5),i)))})).map((t=>ct(t,this.scale,this.renderingScale)));this.ja._l(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.ja&&this.ja.setVisible(!1),this.setContentSize(u(0,0))}De(){return super.De(),this.$i||this.ac(),this}Ls(){return this.ac(),super.Ls()}setVisible(t){return super.setVisible(t),this.ja.setVisible(t),this}}const zn=(t,e,i)=>t*(1-i)+e*i,Nn=(t,e,i,s,r)=>{if(void 0===e.value||void 0===i.value||void 0===s.value||void 0===r.value)return;const n=(t.x-i.point.x)/(r.point.x-i.point.x),o=(r.point.y-i.point.y)*n+i.point.y,h=(t.x-e.point.x)/(s.point.x-e.point.x),a=(s.point.y-e.point.y)*h+e.point.y,l=(t.y-a)/(o-a),u=zn(i.value,r.value,n),c=zn(e.value,s.value,h);return zn(c,u,l)},On={warm:t=>e=>T(60/(t-1)*e,.8,.8),cold:t=>e=>T(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>T(360/t*e,.8,.8),reverseSpectrum:t=>e=>T(360/t*(t-e),.8,.8),flatUI:t=>e=>T(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return T(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return T(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return T(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return T(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return T(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>T(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return T(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return T(e%2?i[0]:i[1],.7,.5+.5/(t-1)*e)},crayons:t=>e=>{let i=180+230/(t-1)*e;return i>360&&(i-=360),T(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return T(0,0,s);const r=e.getR()/255,n=e.getG()/255,o=e.getB()/255,h=Math.max(r,n,o),a=Math.min(r,n,o);let l=0;if(h!==a){const t=h-a;switch(h){case r:l=(n-o)/t+(nr=>n=>T(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>Un([{value:0,hex:"#23FF7A"},{value:1/9,hex:"#03E65D"},{value:2/9,hex:"#04D155"},{value:3/9,hex:"#00B849"},{value:4/9,hex:"#00A869"},{value:5/9,hex:"#008F68"},{value:6/9,hex:"#00815E"},{value:7/9,hex:"#017153"},{value:8/9,hex:"#704A85"},{value:1,hex:"#743A70"}],t,e),blueSciFi:t=>e=>Un([{value:0,hex:"#FFFFFF"},{value:1/9,hex:"#E2E7FF"},{value:2/9,hex:"#ACB9F8"},{value:3/9,hex:"#889DFF"},{value:4/9,hex:"#547EEF"},{value:5/9,hex:"#4068D8"},{value:6/9,hex:"#2B50B7"},{value:7/9,hex:"#1B3E9F"},{value:8/9,hex:"#8D1395"},{value:1,hex:"#780A74"}],t,e),light:t=>e=>Un([{value:0,hex:"#FECC00"},{value:1/9,hex:"#F7B300"},{value:2/9,hex:"#EF9900"},{value:3/9,hex:"#E88000"},{value:4/9,hex:"#E06600"},{value:5/9,hex:"#DD5A00"},{value:6/9,hex:"#D94D00"},{value:7/9,hex:"#D13300"},{value:8/9,hex:"#C91A00"},{value:1,hex:"#C10000"}],t,e),monochrome:t=>e=>Un([{value:0,hex:"#FFFFFF"},{value:1/9,hex:"#EEEEEE"},{value:2/9,hex:"#DCDCDC"},{value:3/9,hex:"#C1C1C1"},{value:4/9,hex:"#A4A2A2"},{value:5/9,hex:"#8B8B8B"},{value:6/9,hex:"#787878"},{value:7/9,hex:"#656565"},{value:8/9,hex:"#565555"},{value:1,hex:"#434343"}],t,e),night:t=>e=>Un([{value:0,hex:"#F0F9E0"},{value:1/9,hex:"#C9DFA4"},{value:2/9,hex:"#B5C796"},{value:3/9,hex:"#8998B7"},{value:4/9,hex:"#6E7E9E"},{value:5/9,hex:"#5C6D8F"},{value:6/9,hex:"#47587A"},{value:7/9,hex:"#374B72"},{value:8/9,hex:"#273C65"},{value:1,hex:"#192847"}],t,e),sunset2:t=>e=>Un([{value:0,hex:"#22334D"},{value:1/9,hex:"#82062C"},{value:2/9,hex:"#AB001D"},{value:3/9,hex:"#D80428"},{value:4/9,hex:"#CF5D1B"},{value:5/9,hex:"#CF8229"},{value:6/9,hex:"#CF9D29"},{value:7/9,hex:"#C4BE25"},{value:8/9,hex:"#E1DC49"},{value:1,hex:"#FFFA67"}],t,e)},Un=(t,e,i)=>{const s=Gn(e,i),[r,n]=Xn(s,t),o=Yn(t[r]),h=Yn(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:zn(o.h,h.h,a),s:zn(o.s,h.s,a),v:zn(o.v,h.v,a)};return T(l.h,l.s,l.v)},Yn=t=>{const e=(t=>{const e=t.r,i=t.g,s=t.b,r=Math.max(e,i,s),n=Math.min(e,i,s);let o=0;const h=r,a=r-n,l=0===r?0:a/r;if(r===n)o=0;else{switch(r){case e:o=(i-s)/a+(i{const i=e/t;return i<0?0:i>1?1:i},Xn=(t,e)=>{if(e.length<2)throw new Error("Invalid palette size");for(let i=0;i!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"image"===t.fillType),to={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},eo=s.Record({type:"linestyle",lineType:"dashed",pattern:to.DashedEqual,fillStyle:new U({color:w(255,255,255)}),thickness:1,patternScale:3});class io extends eo{constructor(t){super({...t,lineType:"dashed"})}setFillStyle(t){return"function"==typeof t?this.set("fillStyle",t(this.getFillStyle())):this.set("fillStyle",t)}getFillStyle(){return this.get("fillStyle")}setThickness(t){return"function"==typeof t?this.set("thickness",t(this.getThickness())):this.set("thickness",t)}getThickness(){return this.get("thickness")}N(){const t=this.getThickness();return t<0?1:t}setPattern(t){return"function"==typeof t?this.set("pattern",t(this.getPattern())):this.set("pattern",t)}getPattern(){return this.get("pattern")}setPatternScale(t){return"function"==typeof t?this.set("patternScale",t(this.getPatternScale())):this.set("patternScale",t)}getPatternScale(){return this.get("patternScale")}}const so=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),ro=s.Record({type:"icon",width:void 0,height:void 0,uc:void 0,cc:kt,dc:kt});class no extends ro{constructor(t,e,i,s){super({...s,uc:t,cc:e,dc:i})}dispose(){return this.dc(this),this}setWidth(t){const e=this.set("width",t);return this.cc(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this.cc(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this.cc(i),i}oi(){if(!this.uc)return{x:0,y:0};const t=this.uc.width,e=this.uc.height;if(0===t||0===e)return{x:0,y:0};const i=this.width,s=this.height;return"number"==typeof i&&"number"==typeof s?{x:i,y:s}:"number"==typeof i?{x:i,y:e*i/t}:"number"==typeof s?{x:t*s/e,y:s}:{x:t,y:e}}}const oo=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),ho=s.Record({type:"glow",color:w(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class ao extends ho{constructor(t){super(t)}setSpread(t){return this.set("spread","function"==typeof t?t(this.get("spread")):t)}getSpread(){return this.get("spread")}setBlur(t){return this.set("blur","function"==typeof t?t(this.get("blur")):t)}getBlur(){return this.get("blur")}setColor(t){return this.set("color","function"==typeof t?t(this.get("color")):t)}getColor(){return this.get("color")}setOffset(t){return this.set("offset","function"==typeof t?t(this.get("offset")):t)}getOffset(){return this.get("offset")}}class lo{constructor(t){this.fc=0,this.Ac=0,this.gc=0,this.yc=!1,this.mc=!0,this.vc=!1,this.Sc={warningDisplayed:!1,expandEvents:[]},this.R=new r.Eventer,this.mc=!t||void 0===t.autoSortingEnabled||t.autoSortingEnabled,void 0!==(null==t?void 0:t.dataPattern)&&(this.xc={userSpecified:null===t.dataPattern?void 0:t.dataPattern}),this.bc=void 0!==(null==t?void 0:t.lookupValues)&&t.lookupValues,this.Mc=void 0!==(null==t?void 0:t.colors)&&t.colors,this._c=void 0!==(null==t?void 0:t.ids)&&t.ids,this.wc=void 0!==(null==t?void 0:t.sizes)&&t.sizes,this.Cc=void 0!==(null==t?void 0:t.rotations)&&t.rotations,this.kc=(null==t?void 0:t.dataStorage)?t.dataStorage:Float64Array,this.Tc=!1!==(null==t?void 0:t.allowInputModification)}add(t){return Array.isArray(t)?this.appendJSON(t,{x:"x",y:"y"}):this.appendSample(t),this}addArraysXY(t,e){return this.appendSamples({xValues:t,yValues:e}),this}appendJSON(t,e={x:"x",y:"y"}){const i=t.length,s=e.x,r=e.y,n=e.lookupValue,o=e.size,h=e.rotation,a=e.color,l=e.id;let u,c,d,f,g,y,m;if(s){u=new this.kc(i);const e=t[0]&&t[0][s]instanceof Date;if(t[0]&&"string"==typeof t[0][s])for(let e=0;ea-1&&(this.fc=0,this.yc=!0),this.Ac=Math.min(this.Ac+1,a),this.gc+=1,this}appendSamples(t){const{lookupValues:e,colors:i,ids:s,sizes:r,rotations:n,start:o,step:h}=t;let a=t.offset,l=t.count;const u=t.xValues||t.yValues;if(!u)return this;const c=u.length;if(a=void 0!==a?a:0,l=void 0!==l?l:c-a,l<=0)return this;const d=void 0!==t.offsetLookupValues?t.offsetLookupValues:a,f=void 0!==t.offsetColors?t.offsetColors:a,g=void 0!==t.offsetIds?t.offsetIds:a,y=void 0!==t.offsetSizes?t.offsetSizes:a,m=void 0!==t.offsetRotations?t.offsetRotations:a,p=this.zc(!0),[x,A]=this.Vc(l,t.xValues,"x","ProgressiveX"===p||"RegressiveX"===p||void 0===p?o:void 0,"ProgressiveX"===p||"RegressiveX"===p||void 0===p?h:void 0,a),[S,v]=this.Vc(l,t.yValues,"y","ProgressiveY"===p||"RegressiveY"===p?o:void 0,"ProgressiveY"===p||"RegressiveY"===p?h:void 0,a),b=this.Rc(i),{samplesCacheX:M,samplesCacheY:w,samplesCacheLookup:C,samplesCacheColors:T,samplesCacheIDs:R,samplesCacheSize:E,samplesCacheRotation:k,maxSampleCount:I,dataPattern:F,incomingDataReplacedCache:D}=this.Fc({appendCount:l,...0===A&&0===v&&0===a&&0===d&&0===f&&0===g&&0===y&&0===m?{incomingDataX:x,incomingDataY:S,incomingDataLookup:e,incomingDataIDs:s,incomingDataColors:b,incomingDataSize:r,incomingDataRotation:n}:{}});if(!D&&F&&this.mc&&this.Pc&&this.Dc){const t=x[A],i=S[v];if(!this.Bc(F,t,i)&&!this.vc)return this.Lc(this.Pc,this.Dc,mo(x,A,A+l),mo(S,v,v+l),mo(e,d,d+l),mo(b,f,f+l),mo(s,g,g+l),mo(r,y,y+l),mo(n,m,m+l),F),this}const P=I-this.fc,L=Math.min(l,P);if(L>0&&(D||(go(M,x,A,L,this.fc),go(w,S,v,L,this.fc),e&&C&&go(C,e,d,L,this.fc),s&&R&&go(R,s,g,L,this.fc),b&&T&&go(T,b,f,L,this.fc),r&&E&&go(E,r,y,L,this.fc),n&&k&&go(k,n,m,L,this.fc)),this.Ec(this.fc,this.fc+L-1),this.fc+=L,this.fc>I-1&&(this.fc=0,this.yc=!0)),this.Ac=Math.min(this.Ac+L,I),this.gc+=L,this.zc(),l-L>0){const t={xValues:x?mo(x,A+L,void 0):void 0,yValues:S?mo(S,v+L,void 0):void 0,lookupValues:e?mo(e,d+L,void 0):void 0,ids:s?mo(s,g+L,void 0):void 0,colors:b?mo(b,f+L,void 0):void 0,sizes:r?mo(r,y+L,void 0):void 0,rotations:n?mo(n,m+L,void 0):void 0};this.appendSamples(t)}return this}setSamples(t){return this.clear().appendSamples(t)}fill(t){const e=this.Pc||this.Dc;if(!e)return this;const i=e.length;if(void 0!==t.x&&(this.Pc=this.Pc||new this.kc(i),this.Pc.fill(t.x)),void 0!==t.y&&(this.Dc=this.Dc||new this.kc(i),this.Dc.fill(t.y)),void 0!==t.lookupValue&&(this.Oc=this.Oc||new Float32Array(i),this.Oc.fill(t.lookupValue)),void 0!==t.color){const e=this.Rc([t.color]);e&&(this.Nc=this.Nc||new Uint32Array(i),this.Nc.fill(e[0]))}return void 0!==t.size&&(this.Gc=this.Gc||new Float32Array(i),this.Gc.fill(t.size)),void 0!==t.rotation&&(this.Wc=this.Wc||new Float32Array(i),this.Wc.fill(t.rotation)),this.R.emit("cleared"),this}alterSamples(t,e){const{xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a}=e;let l=e.offset,u=e.count;const c=i||s||r||n||o||h||a,d=c?c.length:void 0!==e.x||void 0!==e.y?1:0;if(l=void 0!==l?l:0,u=void 0!==u?u:d-l,u<=0)return this;const f=void 0!==e.offsetLookupValues?e.offsetLookupValues:l,g=void 0!==e.offsetColors?e.offsetColors:l,y=void 0!==e.offsetIds?e.offsetIds:l,m=void 0!==e.offsetSizes?e.offsetSizes:l,p=void 0!==e.offsetRotations?e.offsetRotations:l,x=this.Rc(n),A=this.gc-1,S=void 0!==this.Uc?Math.max(this.gc-this.Uc,0):0,v=t+u-1,b=Math.max(t,S),M=Math.min(v,A),w=M-b+1;if(this.gc>0&&w>0){const{samplesCacheX:n,samplesCacheY:u,samplesCacheColors:c,samplesCacheIDs:d,samplesCacheLookup:A,samplesCacheSize:v,samplesCacheRotation:C}=this.Fc({appendCount:0}),T=n.length;if(void 0!==this.Uc&&this.yc&&this.gc%this.Uc!=0){const S=this.gc-this.gc%this.Uc,w=this.gc-1,R=this.gc-this.Ac,E=S-1,k=Math.max(b,R),I=Math.min(M,E)-k+1;if(I>0){const S=k-t,b=uo(k,this.gc,T,this.fc);if(void 0!==e.x)for(let t=b;t0){const S=F-t,b=uo(F,this.gc,T,this.fc);if(void 0!==e.x)for(let t=b;t0){const e=M+1-t;this.appendSamples({xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:l+e,offsetLookupValues:f+e,offsetColors:g+e,offsetIds:y+e,offsetSizes:m+e,offsetRotations:p+e,count:C})}return this}alterSamplesByID(t,e){if(!this._c)throw new Error("LightningChart JS attempted to use alterSamplesByID on DataSetXY that doesn't have IDs enabled.");const i=t.length,s=this.Yc;if(i<=0||!s)return this;const r=(("object"==typeof e.color?this.Rc([e.color]):"number"==typeof e.color?[e.color]:[])||[])[0],n=Array.isArray(e.xValues)?new this.kc(e.xValues):e.xValues,o=Array.isArray(e.yValues)?new this.kc(e.yValues):e.yValues,h=Array.isArray(e.yValues)?new Float32Array(e.yValues):e.yValues,a=this.Rc(e.colors),l=Array.isArray(e.sizes)?new Float32Array(e.sizes):e.sizes,u=Array.isArray(e.rotations)?new Float32Array(e.rotations):e.rotations,c=s.length,d=this.Ac,f=this.gc-1,g=Math.max(f-d+1,0);for(let d=0;ds[uo(t,this.gc,c,this.fc)])),m=uo(y,this.gc,c,this.fc);s[m]===i&&(void 0!==e.x&&this.Pc&&(this.Pc[m]=e.x),void 0!==e.y&&this.Dc&&(this.Dc[m]=e.y),void 0!==e.lookupValue&&this.Oc&&(this.Oc[m]=e.lookupValue),void 0!==e.size&&this.Gc&&(this.Gc[m]=e.size),void 0!==e.rotation&&this.Wc&&(this.Wc[m]=e.rotation),void 0!==r&&this.Nc&&(this.Nc[m]=r),n&&this.Pc&&(this.Pc[m]=n[d]),o&&this.Dc&&(this.Dc[m]=o[d]),h&&this.Oc&&(this.Oc[m]=h[d]),a&&this.Nc&&(this.Nc[m]=a[d]),l&&this.Gc&&(this.Gc[m]=l[d]),u&&this.Wc&&(this.Wc[m]=u[d]))}return this.R.emit("cleared"),this}clear(){return this.fc=0,this.Ac=0,this.gc=0,this.yc=!1,this.R.emit("cleared"),this}getSampleCount(){return this.Ac}getNextSampleIndex(){return this.gc}setMaxSampleCount(t){if("object"==typeof t){this.Hc&&this.offMaxSampleCountExceeded(this.Hc);const e=t.max,i=t.initial,s=()=>{const t=this.Uc||0;if(void 0!==e&&t>=e)return;let i=2*t;void 0!==e&&(i=Math.min(i,e)),this.setMaxSampleCount(i)};this.Hc=this.onMaxSampleCountExceeded(((t,e,i,r)=>{s()})),void 0===this.Uc&&(void 0!==i?this.setMaxSampleCount(i):this.setMaxSampleCount(Math.min(2*this.Ac,void 0!==e?e:Number.MAX_SAFE_INTEGER)))}else if("number"==typeof t){const e=t;if(void 0!==this.Uc&&this.Uc>e)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to shrink data set. This is currently not supported.");if(!this.Pc||!this.Dc)return this.Uc=e,this;if(e===this.Uc)return this;if(this.yc&&0!==this.fc)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to expand data set that has exceeded its max sample count. This is currently not supported.");this.Uc=e,this.Act+e.count),0),n=new this.kc(r),o=new this.kc(r),h=this.Mc?new Uint32Array(r):void 0,a=this.bc?new Float32Array(r):void 0,l=this._c?new Uint32Array(r):void 0,u=this.wc?new Float32Array(r):void 0,c=this.Cc?new Float32Array(r):void 0;let d=0;for(const t of s)n.set(this.Pc.subarray(t.offset,t.offset+t.count),d),o.set(this.Dc.subarray(t.offset,t.offset+t.count),d),this.Mc&&h&&this.Nc&&h.set(this.Nc.subarray(t.offset,t.offset+t.count),d),this.bc&&a&&this.Oc&&a.set(this.Oc.subarray(t.offset,t.offset+t.count),d),this._c&&l&&this.Yc&&l.set(this.Yc.subarray(t.offset,t.offset+t.count),d),this.wc&&u&&this.Gc&&u.set(this.Gc.subarray(t.offset,t.offset+t.count),d),this.Cc&&c&&this.Wc&&c.set(this.Wc.subarray(t.offset,t.offset+t.count),d),d+=t.count;return{xValues:n,yValues:o,iSampleFirst:i,lookupValues:a,colors:h,ids:l,sizes:u,rotations:c}}onMaxSampleCountExceeded(t){return this.R.on("maxSampleCountExceeded",t)}offMaxSampleCountExceeded(t){return this.R.off(t)}Vc(t,e,i,s,r,n){if(void 0===e){const e=this.Ic();r=void 0!==r?r:1,s=void 0!==s?s:e?e[i]+r:0;const n=new this.kc(t);for(let e=0;et){e=s;break}const l={xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:e};this.vc=!0,this.appendSamples(l),this.vc=!1}else{const l=t.length,u=this.Ac,f=this.gc-1,g=Math.max(f-u+1,0),y=fo(d,g,f,(e=>t[uo(e,this.gc,l,this.fc)])),m=y-1,p=y+1,x=t[uo(y,this.gc,l,this.fc)],A=p<=this.gc-1?t[uo(p,this.gc,l,this.fc)]:void 0,S=void 0!==A&&A0&&!t){const t=void 0!==this.Uc&&this.yc?this.fc:0,i=this.Ac-1,s=void 0!==this.Uc&&this.yc?0:void 0,r=void 0!==this.Uc&&this.yc?this.fc-1:void 0,[n,o]=void 0!==s&&void 0!==r&&Math.abs(r-s)>Math.abs(i-t)?[s,r]:[t,i];if(1+o-n>=2){let t,i,s=this.Pc[n],r=this.Dc[n];for(let e=n+1;e<=o;e+=1){if(!1!==t){const i=this.Pc[e],r=Math.sign(i-s);0!==r&&t&&t.direction!==r?t=!1:0===r||t||(t={direction:r}),s=i}if(!1!==i){const t=this.Dc[e],s=Math.sign(t-r);0!==s&&i&&i.direction!==s?i=!1:0===s||i||(i={direction:s}),r=t}}e=t&&t.direction>0?Br.ProgressiveX:t&&t.direction<0?Br.RegressiveX:i&&i.direction>0?Br.ProgressiveY:i&&i.direction<0?Br.RegressiveY:void 0,this.xc={autoDetectResult:e},e&&wt.console.warn(`LightningChart JS DataSetXY warning | Data pattern was detected automatically (DataPatterns.${e}).\nAutomatic detection is only intended for kick-starting application development, not for production use.\nAdd { dataPattern: '${e}'} } to your application when creating series or DataSetXY to get clear this warning.`)}}if(e&&"ProgressiveX"!==e)throw new Error("LightningChart JS New XY rework beta features do not yet support other data patterns than ProgressiveX. This will be introduced in near future.");return e}Bc(t,e,i){const s=this.Ic();return!s||("ProgressiveX"===t?e>s.x:"RegressiveX"===t?es.y:"RegressiveY"!==t||ii-t.timestamp<5e3)),e>1e3&&this.Sc.expandEvents.push({timestamp:i}),this.Sc.expandEvents.length>5)return wt.console.warn("LightningChart JS warning - DataSetXY append operation was performed more than 5 times in 5 seconds.\nAutomatic max sample count control was enabled.\nFor streaming applications, DataSetXY.setMaxSampleCount() or Series.setMaxSampleCount() should be configured explicitly to get rid of this warning."),this.Sc.warningDisplayed=!0,this.setMaxSampleCount({mode:"auto"}),this.Fc(t)}const i=new this.kc(e);i.set(this.Pc),this.Pc=i;const s=new this.kc(e);if(s.set(this.Dc),this.Dc=s,this.bc){const t=new Float32Array(e);this.Oc&&t.set(this.Oc),this.Oc=t}if(this._c){const t=new Uint32Array(e);this.Yc&&t.set(this.Yc),this.Yc=t}if(this.Mc){const t=new Uint32Array(e);this.Nc&&t.set(this.Nc),this.Nc=t}if(this.wc){const t=new Float32Array(e);this.Gc&&t.set(this.Gc),this.Gc=t}if(this.Cc){const t=new Float32Array(e);this.Wc&&t.set(this.Wc),this.Wc=t}return this.fc=this.Ac,{dataPattern:this.zc(),samplesCacheX:this.Pc,samplesCacheY:this.Dc,samplesCacheLookup:this.Oc,samplesCacheIDs:this.Yc,samplesCacheColors:this.Nc,samplesCacheSize:this.Gc,samplesCacheRotation:this.Wc,maxSampleCount:e}}if(i>4*e){const t=new this.kc(e);t.set(this.Pc.subarray(0,this.Ac)),this.Pc=t;const i=new this.kc(e);if(i.set(this.Dc.subarray(0,this.Ac)),this.Dc=i,this.bc){const t=new Float32Array(e);this.Oc&&t.set(this.Oc.subarray(0,this.Ac)),this.Oc=t}if(this._c){const t=new Uint32Array(e);this.Yc&&t.set(this.Yc.subarray(0,this.Ac)),this.Yc=t}if(this.Mc){const t=new Uint32Array(e);this.Nc&&t.set(this.Nc.subarray(0,this.Ac)),this.Nc=t}if(this.wc){const t=new Float32Array(e);this.Gc&&t.set(this.Gc.subarray(0,this.Ac)),this.Gc=t}if(this.Cc){const t=new Float32Array(e);this.Wc&&t.set(this.Wc.subarray(0,this.Ac)),this.Wc=t}return{dataPattern:this.zc(),samplesCacheX:this.Pc,samplesCacheY:this.Dc,samplesCacheLookup:this.Oc,samplesCacheIDs:this.Yc,samplesCacheColors:this.Nc,samplesCacheSize:this.Gc,samplesCacheRotation:this.Wc,maxSampleCount:e}}return{dataPattern:this.zc(),samplesCacheX:this.Pc,samplesCacheY:this.Dc,samplesCacheLookup:this.Oc,samplesCacheIDs:this.Yc,samplesCacheColors:this.Nc,samplesCacheSize:this.Gc,samplesCacheRotation:this.Wc,maxSampleCount:i}}return t.appendCount+this.Ac>this.Uc&&this.R.emit("maxSampleCountExceeded",this,this.Ac,this.Uc,this.Ac+t.appendCount),this.Pc=this.Pc||new this.kc(this.Uc),this.Dc=this.Dc||new this.kc(this.Uc),this.Oc=this.Oc||(this.bc?new Float32Array(this.Uc):void 0),this.Yc=this.Yc||(this._c?new Uint32Array(this.Uc):void 0),this.Nc=this.Nc||(this.Mc?new Uint32Array(this.Uc):void 0),this.Gc=this.Gc||(this.wc?new Float32Array(this.Uc):void 0),this.Wc=this.Wc||(this.Cc?new Float32Array(this.Uc):void 0),{dataPattern:this.zc(),samplesCacheX:this.Pc,samplesCacheY:this.Dc,samplesCacheLookup:this.Oc,samplesCacheIDs:this.Yc,samplesCacheColors:this.Nc,samplesCacheSize:this.Gc,samplesCacheRotation:this.Wc,maxSampleCount:this.Uc}}Zc(){if(!this.Pc||!this.Dc||0===this.Ac)return;if(void 0===this.Uc)return this.gc>0?{x:this.Pc[0],y:this.Dc[0]}:void 0;if(!this.yc)return{x:this.Pc[0],y:this.Dc[0]};let t=this.fc-this.Ac;return t<0&&(t+=this.Uc),{x:this.Pc[t],y:this.Dc[t]}}Ic(){if(!this.Pc||!this.Dc||0===this.Ac)return;if(void 0===this.Uc){const t=this.Ac-1;return t>=0?{x:this.Pc[t],y:this.Dc[t]}:void 0}let t=this.fc-1;return t<0&&(t+=this.Uc),{x:this.Pc[t],y:this.Dc[t]}}Qc(t){if(!this.Pc||!this.Dc)return;const e=this.Pc.length,i=this.Ac,s=this.gc-1,r=Math.max(s-i+1,0)+t,n=uo(r,this.gc,e,this.fc);return{x:this.Pc[n],y:this.Dc[n],lookupValue:this.bc&&this.Oc?this.Oc[n]:void 0,id:this._c&&this.Yc?this.Yc[n]:void 0,color:this.Mc&&this.Nc?this.Nc[n]:void 0,size:this.wc&&this.Gc?this.Gc[n]:void 0,rotation:this.Cc&&this.Wc?this.Wc[n]:void 0,iSample:r}}Jc(t,e,i,s){const r=this.zc(),n=this.Pc,o=this.Dc;if(!n||!o)return;const h=(t,e)=>({x:n[t],y:o[t],lookupValue:this.bc&&this.Oc?this.Oc[t]:void 0,id:this._c&&this.Yc?this.Yc[t]:void 0,color:this.Mc&&this.Nc?this.Nc[t]:void 0,size:this.wc&&this.Gc?this.Gc[t]:void 0,rotation:this.Cc&&this.Wc?this.Wc[t]:void 0,iSample:e}),a=n.length,l=this.Ac,u=this.gc-1,c=Math.max(u-l+1,0);if(r){const i=this.Zc(),s=this.Ic();if(!(i&&s&&this.Pc&&this.Dc))return;const n="ProgressiveX"===r||"RegressiveX"===r?"x":"y",o="x"===n?"y":"x",l="x"===n?this.Pc:this.Dc,d="x"===o?this.Pc:this.Dc,f=t[n],g=Math.min(i[n],s[n]),y=Math.max(i[n],s[n]);if(fy)return;const m=fo(f,c,u,(t=>l[uo(t,this.gc,a,this.fc)])),p=uo(m,this.gc,a,this.fc);if(!e)return h(p,m);const x=m-1,A=m+1,S=f>=l[p]&&("ProgressiveX"===r||"ProgressiveY"===r)?A<=u?A:void 0:x>=c?x:void 0;if(void 0===S)return;const v=uo(S,this.gc,a,this.fc),b=l[p],M=d[p],w=l[v],C=d[v],T=Math.min(b,w),R=T===b?M:C,E=Math.max(b,w),k=T===b?m:S,I=(f-T)/(E-T),F=zn(R,E===b?M:C,I);return"ProgressiveX"===r||"RegressiveX"===r?{x:f,y:F,iSample:k+I}:{x:F,y:f,iSample:k+I}}let d,f=Number.MAX_VALUE;const g=ct(t,i,s),y=this.Ac-1;for(let t=0;t<=y;t+=1){const e=n[t],r=o[t];if(!Number.isNaN(e)&&!Number.isNaN(r)){const n=ut(e,i.x,s.x),o=ut(r,i.y,s.y),h=(n-g.x)**2+(o-g.y)**2;ht%i,co=(t,e,i,s,r,n,o,h)=>{if(0===s||0===r)return;const a=i.length,l=s-1,u=Math.max(l-r+1,0),c=fo(t,u,l,(t=>i[uo(t,s,a)])),d=fo(e,u,l,(t=>i[uo(t,s,a)])),f=Math.max(c-h,u),g=Math.min(d+h,l),y=uo(f,s,a),m=uo(g,s,a);return y>m?{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:y,iLastSampleDataArray:m,dataRanges:[{offset:y,count:a-y},{offset:0,count:m+1}]}:{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:y,iLastSampleDataArray:m,dataRanges:[{offset:y,count:m-y+1}]}},fo=(t,e,i,s)=>{const r=i;for(;e!==i;){const r=Math.ceil((e+i)/2);t{const n=e.length;if(Array.isArray(e))for(let n=0;nvoid 0===t?void 0:Array.isArray(t)?new e(t):t instanceof e?t:new e(t),mo=(t,e,i)=>{if(void 0!==t)return Array.isArray(t)?t.slice(e,i):t.subarray(e,i)};class po extends Vn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ya="label",this.ja=this.Is.Or(this.renderingScale).gr(this.ya).Ie(B).zr(Ie).Vr(Ie),this.setMargin(5),this.ku(this.ja)}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}De(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=ct(t,this.scale,this.renderingScale);return this.ja.Be(i),this}Ls(){this.ja.Ls();const t=0===this.ya.length?u(0,0):this.ja.td();return this.setContentSize(t),super.Ls()}setText(t){return this.ya=t,this.ja.gr(this.ya),this.Is.xs(),this}getText(){return this.ya}setFont(t){return this.ja.jh(t),this.Is.xs(),this}getFont(){return this.ja.Xh()}setTextRotation(t){return this.ja.Zh(t),this.Is.xs(),this}getTextRotation(){return this.ja.Qh()}}const xo={...kn,...Fn,uiElement:po};class Ao extends _n{constructor(t,e,i,s,r){super(t,e,i,s,r),this.sd=!1,this.fitTo=this.Vu.bind(this),this.setSize=this.fitTo,this.ja=this.Is.oc(e).Ie(B).Fe(nt),this.ku(this.ja)}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}setStrokeStyle(t){return this.ja.Fe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.po()}De(){const t=Je([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>ct(t,this.scale,this.renderingScale))));return this.sd?this.ja._l([{x:(t.min.x+t.max.x)/2,y:t.min.y},{x:t.min.x,y:(t.min.y+t.max.y)/2},{x:(t.min.x+t.max.x)/2,y:t.max.y},{x:t.max.x,y:(t.min.y+t.max.y)/2}]):this.ja._l([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Vu(t){return this.setContentSize(t),this.Is.xs(),this}Ou(){return 0}Nu(){return 0}Wu(){return 0}Gu(){return 0}}class So extends _n{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ed=u(0,0),this.ja=t.hd(e).lu(0).Ge(360).Ie(B).Fe(nt),this.ku(this.ja)}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}setStrokeStyle(t){return this.ja.Fe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.po()}De(){const t=this.getSize(e.UISpace.Content).x/2;return this.ja.cu(t*this.renderingScale.Wi().x).du(t*this.renderingScale.Wi().y).Be(ct(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).Au(255).Ls(),this}Vu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.ed=t,this.Is.xs(),this}Ou(){return(this.getSize(e.UISpace.Content).x-this.ed.x)/2}Nu(){return(this.getSize(e.UISpace.Content).x-this.ed.x)/2}Wu(){return(this.getSize(e.UISpace.Content).y-this.ed.y)/2}Gu(){return(this.getSize(e.UISpace.Content).y-this.ed.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.ed=t,this}}class vo extends Bn{constructor(t,e,i,s,r){super(t,e,i,cn.Simple,s,r),this.rd=p(u(0,0)),this.nd=!1,this.Is=t,this.ac()}lc(){const t=this.rd.C();if(this.nd){const e=Math.min(t.x,t.y);return[u(0,0),u(e/2,e/2),u(0,e),u(-e/2,e/2)]}const e=2*Math.sqrt(this.rd.C().x*this.rd.C().x/4+this.rd.C().y*this.rd.C().y/4),i=u(Math.cos(Math.PI/4)*e,0),s=u(0,Math.sin(Math.PI/4)*e),r=u(0,0),n=ui(r,ui(i,s)),o=ui(n,ui(s,li(i,-1)));return[r,n,o,ci(o,ui(i,s))]}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}setStrokeStyle(t){return this.ja.Fe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.po()}Vu(t){return this.rd._(t),this.nd=!1,this.Is.xs(),this}Ou(){return this.nd?0:(this.getSize(e.UISpace.Content).x-this.rd.C().x)/2}Nu(){return this.nd?0:(this.getSize(e.UISpace.Content).x-this.rd.C().x)/2}Wu(){return this.nd?0:(this.getSize(e.UISpace.Content).y-this.rd.C().y)/2}Gu(){return this.nd?0:(this.getSize(e.UISpace.Content).y-this.rd.C().y)/2}fitTo(t){return this.rd._(t),this.nd=!0,this.Is.xs(),this}}class bo extends Bn{constructor(t,i,s,r,n){super(t,i,s,cn.Simple,r,n),this.od=p(u(0,0)),this.ad=p(10),this.ld=p(void 0),this.ju=p(e.UIDirections.Right),this.ac()}Lu(){return[this.ja]}setFillStyle(t){return this.ja.Ie(t),this.Is.xs(),this}getFillStyle(){return this.ja.Hh()}setStrokeStyle(t){return this.ja.Fe(t),this.Is.xs(),this}getStrokeStyle(){return this.ja.po()}setDirection(t){return this.ju._(t),this.Is.xs(),this}getDirection(){return this.ju.C()}setPointerLength(t){return this.ad._(t),this.Is.xs(),this}getPointerLength(){return this.ad.C()}setPointerAngle(t){return this.ld._(t),this.Is.xs(),this}getPointerAngle(){let t=this.ld.C();if(void 0===t){const e=this.ud();if(0===e)return 0;t=0!==e?180*Math.atan(2*this.getPointerLength()/e)/Math.PI:0}return Math.min(Math.max(t,1),89)}Vu(t){return this.od._(t),this.Is.xs(),this}dd(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}fd(){return $t(this.ju.C())?this.od.C().x:this.od.C().y}ud(){return $t(this.ju.C())?this.od.C().y:this.od.C().x}Ou(){switch(this.ju.C()){case e.UIDirections.Right:return 0;case e.UIDirections.Left:return this.getPointerLength();case e.UIDirections.Up:case e.UIDirections.Down:return Math.max(0,this.dd()-this.ud());default:return 0}}Nu(){switch(this.ju.C()){case e.UIDirections.Right:return this.getPointerLength();case e.UIDirections.Left:return 0;case e.UIDirections.Up:case e.UIDirections.Down:return Math.max(0,this.dd()-this.ud());default:return 0}}Wu(){switch(this.ju.C()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.dd()-this.ud());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}Gu(){switch(this.ju.C()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.dd()-this.ud());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}lc(){const t=Kt(this.ju.C()),e=hi(u(0,0),t),i=this.getPointerLength(),s=this.dd(),r=this.fd(),n=this.ud();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=ui(ui(o,li(t,-i)),li(e,s/2)),a=ui(h,li(e,(n-s)/2)),l=ui(a,li(t,-r)),c=ui(ui(o,li(t,-i)),li(e,-s/2)),d=ui(c,li(e,-(n-s)/2)),f=ui(d,li(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:It(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class Mo extends Vn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.Vu.bind(this),this.setSize=this.fitTo,this.Ad=new lo,this.ja=this.Is.md(e).Oe(nt).yd(B).pd(B).gd(this.Ad),this.ku(this.ja)}Lu(){return[this.ja]}setShape(t){return this.ja.vd(t),this}getShape(){return this.ja.Sd()}setRotation(t){return this.ja.xd(t),this}getRotation(){return this.ja.bd()}setFillStyle(t){return this.ja.pd(t),this.Is.xs(),this}getFillStyle(){return this.ja.Md()}De(){const t=ct(this.getPosition({x:0,y:0},e.UISpace.Content),this.scale,this.renderingScale),i=Math.max(this.size.x,this.size.y);if(this.Ad.clear(),i>0){const e=this.ja.Sd(),s=this.ja.Md(),r=oo(e)&&e,n=Jn(s)&&s;if(r){const t=i/r.oi().y;this.ja._d(t)}else if(n){const t=n.source;if(t instanceof Image){const e=i/t.height;this.ja._d(e)}}else this.ja._d(i);this.Ad.appendSample(t)}return this}Vu(t){return this.setContentSize(t),this.Is.xs(),this}Ou(){return 0}Nu(){return 0}Wu(){return 0}Gu(){return 0}}const wo={...kn,...Fn,uiElement:Mo};class Co extends Pn{setSize(t){return this.setContentSize(t),this.Is.xs(),this}}class To extends bn{constructor(){super(...arguments),this.wd=[],this.Cd=0,this.kd=t=>{const e=this.wd.indexOf(t);e>=0&&this.wd.splice(e,1)}}getMembers(){return this.wd}getMemberCount(){return this.wd.length}setMinimumSize(t){return this.Td=t,this.Is.xs(),this}getMinimumSize(){return this.Td}addElement(t,e=-1){const i=t.tc(this.Is,this.renderingScale,this.scale,this.kd,this.Ki,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.wd.splice(e,0,i):this.wd.push(i),i.setVisible(this.getVisible()),this.ku(i),this.$i&&(pe(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.wd.slice().forEach(Et),this}setVisible(t){return super.setVisible(t),this.wd.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof Co)),0),s=i>0?(this.size.x-this.Cd)/i:0;return this.wd.reduce(((e,i)=>i instanceof Co?this.scale.pi({x:e,y:t.y},{x:s+i.getSize().x,y:0}).x:i.setOrigin(u(-1,1)).setPosition(u(e,t.y)).De().getPosition(u(1,0)).x),t.x),this}Ls(){for(let t=0;tt+ +(e instanceof Co)),0),s=i>0?(this.size.y-this.Cd)/i:0;return this.wd.reduce(((e,i)=>i instanceof Co?this.scale.pi({x:t.x,y:e},{x:0,y:-(s+i.getSize().y)}).y:i.setOrigin(u(-1,1)).setPosition(u(t.x,e)).De().getPosition(u(0,-1)).y),t.y),this}Ls(){for(let t=0;t{const i={},s=`stylable${t}s`;return i[s]=e,i[`set${t}FillStyle`]=function(t){return this[s].forEach((e=>e.setFillStyle(t))),this},i[`get${t}FillStyle`]=function(){return this[s][0].getFillStyle()},i[`set${t}Font`]=function(t){return this[s].forEach((e=>e.setFont(t))),this},i[`get${t}Font`]=function(){return this[s][0].getFont()},i[`set${t}Rotation`]=function(t){return this[s].forEach((e=>e.setTextRotation(t))),this},i[`get${t}Rotation`]=function(){return this[s][0].getTextRotation()},i},_o=Vo("Text",[]),Bo={button:void 0,isLocked:!1,setOn(t){const e=this.button.getOn()!==t;return this.button.setOn(t),e&&this.R.emit("switch",t),this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.R.on("switch",(e=>t(this,e)))},offSwitch(t){return this.R.off(t,"switch")},setButtonOffFillStyle(t){return this.button.setOffFillStyle(t),this},getButtonOffFillStyle(){return this.button.getOffFillStyle()},setButtonOnFillStyle(t){return this.button.setOnFillStyle(t),this},getButtonOnFillStyle(){return this.button.getOnFillStyle()},setButtonSize(t){return this.button.setSize(t),this},getButtonSize(){return this.button.getSize()},setButtonShape(t){return this.button.setButtonShape(t),this},getButtonShape(){return this.button.getButtonShape()}},zo={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},No={pointable:void 0,setDirection(t){return this.pointable.setDirection(t),this},getDirection(){return this.pointable.getDirection()},setPointerLength(t){return this.pointable.setPointerLength(t),this},getPointerLength(){return this.pointable.getPointerLength()}},Oo={...kn,...In,background:Ao,tc(t,e,i,s,r,n){const o=new Ro(t,e,i,this.background,s,r),h=o.addElement(xo,void 0),a=Object.assign(o,Lo,{setTextLabel:h},_o,{stylableTexts:[h]});return En(a,r,n),this.applyStylers(a,r)}}.addStyler(Tn),Uo={...kn,...In,background:bo,direction:e.UIDirections.Up,setDirection(t){return this.direction=t,this},tc(t,i,s,r,n,o){const h=this.direction,a=new Ro(t,i,s,this.background,r,n),l=a.addElement(xo,void 0),u=a.getBackground().setDirection(h),c=Object.assign(a,Lo,{setTextLabel:l},_o,{stylableTexts:[l]},No,{pointable:u},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?(this.setPadding({top:t}),l.setMargin({top:0})):this.getDirection()===e.UIDirections.Down?(this.setPadding({bottom:t}),l.setMargin({bottom:0})):this.getDirection()===e.UIDirections.Right?(this.setPadding({right:t}),l.setMargin({right:0})):this.getDirection()===e.UIDirections.Left&&(this.setPadding({left:t}),l.setMargin({left:0})),this},getTickLabelPadding(){return this.getDirection()===e.UIDirections.Up?this.getPadding().top:this.getDirection()===e.UIDirections.Down?this.getPadding().bottom:this.getDirection()===e.UIDirections.Right?this.getPadding().right:this.getPadding().left}});return c.ic="other",c.setPointerLength(n.xAxisNumericTicks.majorTickStyle.getTickLength()).setTickLabelPadding(n.xAxisNumericTicks.majorTickStyle.getTickPadding()).setTextFont(n.uiTextFont).setTextFillStyle(n.uiTextFillStyle).setBackground((t=>t.setFillStyle(n.uiBackgroundFillStyle).setStrokeStyle(n.uiBackgroundStrokeStyle))),En(c,n,o),this.applyStylers(c,n)}};class Yo extends vn{constructor(t,e,i,s,n,o){super(t,e,i,n,o),this.Rs=!1,this.R=new r.Eventer,this.Id=B,this.Pd=B,this.getOn=()=>this.Rs,this.Pd=o.uiButtonFillStyleHidden||o.uiButtonFillStyle,this.Dd=this.ku(new Mo(this.Is,this.renderingScale,this.scale,kt,o).setShape(s)).setFillStyle(this.Pd)}Lu(){return[...this.Dd.Lu()]}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}setOn(t){return this.Rs=t,this.Dd.setFillStyle(t?this.Id:this.Pd),this.Is.xs(),this}setOffFillStyle(t){return this.Pd="function"==typeof t?t(this.Pd):t,this.Rs||this.Dd.setFillStyle(this.Pd),this}getOffFillStyle(){return this.Pd}setSize(t){return this.Dd.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.Dd.getSize()}setOnFillStyle(t){return this.Id="function"==typeof t?t(this.Id):t,this.Rs&&this.Dd.setFillStyle(this.Id),this}getOnFillStyle(){return this.Id}setButtonShape(t){return this.Dd.setShape(t),this.Is.xs(),this}getButtonShape(){return this.Dd.getShape()}De(){return super.De(),this.Dd.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).De(),this}Ls(){const t=this.Dd.Ls().getSize();return this.setContentSize(t),super.Ls()}dispose(){return super.dispose(),this.Dd.dispose(),this}setMouseInteractions(t){return this.Dd.setMouseInteractions(t),this}getMouseInteractions(){return this.Dd.getMouseInteractions()}setHighlight(t){const e=be(t);return this.Dd.setHighlight(e),this.R.emit("highlight",this,t),this.Is.xs(),this}getHighlight(){return this.Dd.getHighlight()}}const Go={...kn,uiElement:Yo,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},tc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.buttonShape,s,r),r);return En(o,r,n),o}},Xo={...kn,...In,background:Ao,buttonBuilder:Go,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},tc(t,i,s,r,n,o){const h=new Ro(t,i,s,this.background,r,n),a=h.addElement(Do);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Do);u.addGap();const c=u.addElement(xo);u.addGap(),h.addGap();const d=Object.assign(h,Lo,{setTextLabel:c},_o,{stylableTexts:[c]},Bo,{button:l},zo);let f;return d.onMouseClick(((t,e)=>{d.getLocked()||d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),d.onSwitch(((t,e)=>{e?f&&d.setTextFillStyle(f):(f=d.getTextFillStyle(),d.setTextFillStyle(d.getTextFillStyleHidden()))})),d.setPadding({left:5}),En(d,n,o),this.applyStylers(d,n)}}.addStyler(Tn).addStyler(Rn);class Zo extends vn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Bd=[],this.Ld=2,this.Rd="",this.Ed=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:Fi(t.value,e.min,e.max),this.zd=0,this.Vd=0,this.Od=!1,this.Is=t,this.Nd=n,this.Gd=this.ku(t.Pe(e).Fe(nt)),this.Wd=this.ku(t.Or(e).Ie(r.uiTextFillStyle).jh(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.Ud=140,this.Yd=25):(this.Ud=160,this.Yd=15)}Lu(){return[this.Gd,this.Wd]}Hd(t){this.$d=t;const e=jo(t,"vertical"===this.Nd?0:90,this.Od);return this.Gd.Ie(e),this.Is.xs(),this}Xd(){return this.$d}jd(t){return this.Ud=t,this.Is.xs(),this}Zd(){return this.Ud}Qd(t){return this.Yd=t,this.Is.xs(),this}Jd(){return this.Yd}Kd(t){return this.Rd=t,this.Is.xs(),this}qd(){return this.Rd}tf(t){return this.Ed=t,this.Is.xs(),this}setLUTDisplayProportionalSteps(t){if(this.Od=t,this.$d){const t=jo(this.$d,"vertical"===this.Nd?0:90,this.Od);this.Gd.Ie(t)}return this.Is.xs(),this}getLUTDisplayProportionalSteps(){return this.Od}setFillStyle(t){return this.Wd.Ie(t),this.Is.xs(),this}getFillStyle(){return this.Wd.Hh()}setFont(t){return this.Wd.jh(t),this.Is.xs(),this}getFont(){return this.Wd.Xh()}setTextRotation(t){return this.Vd=t,this.Wd.Zh(t),this.Is.xs(),this}getTextRotation(){return this.Wd.Qh()}De(){var t,i,s,r;if(super.De(),this.$i||!this.getVisible())return this;const n=this.$d;if(n){const o=this.renderingScale.Wi(),h=n.min,a=n.max;if("vertical"===this.Nd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=ui(s,{x:this.Gd.oi().x+this.Ld*o.x,y:0}),l={x:r.x,y:r.y+(this.Rd.length>0?this.zd*o.y+this.Wd.oi().y:0)+.5*((null===(t=this.Bd[0])||void 0===t?void 0:t.oi().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Bd[this.Bd.length-1])||void 0===i?void 0:i.oi().y)||0)};this.Gd.Be({x:s.x,y:l.y}),this.Wd.Ya({x:-1,y:-1}).Be(r),n.getSteps().forEach(((t,e)=>{const i=Qe(l,u,this.Od?!0===n.getInterpolation()?(t.value-h)/(a-h):.9*(t.value-h)/(a-h):!0===n.getInterpolation()?e/(n.getSteps().length-1):e/n.getSteps().length);this.Bd[e].Ya({x:-1,y:0}).Be(i)}))}else{const t=this.getPosition({x:-1,y:-1},e.UISpace.Content),i=this.getPosition({x:1,y:1},e.UISpace.Content),l=this.Bd.reduce(((t,e)=>Math.max(t,e.oi().y)),0),u=ui(t,{x:.5*((null===(s=this.Bd[0])||void 0===s?void 0:s.oi().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Bd[this.Bd.length-1])||void 0===r?void 0:r.oi().x)||0)+(this.Rd.length>0?this.zd*o.x+this.Wd.oi().x:0)),y:u.y},f={x:u.x,y:u.y+this.Ld*o.y};this.Gd.Be(f),this.Wd.Ya({x:1,y:1}).Be(c),n.getSteps().forEach(((t,e)=>{const i=Qe(u,d,this.Od?!0===n.getInterpolation()?(t.value-h)/(a-h):.9*(t.value-h)/(a-h):!0===n.getInterpolation()?e/(n.getSteps().length-1):e/n.getSteps().length);this.Bd[e].Ya({x:0,y:1}).Be(i)}))}}return this}Ls(){if(this.$d&&this.getVisible()){const t=this.$d.getSteps();for(let e=this.Bd.length;eMath.max(t,e.Ls().td().x)),0),this.Wd.Ls().td().x),s=(this.Rd.length>0?this.zd+this.Wd.Ls().td().y:0)+e+.5*this.Bd[0].Ls().td().y+.5*this.Bd[this.Bd.length-1].Ls().td().y;this.setContentSize({x:i,y:s})}else{const t=this.Ud,e=this.Yd;this.Gd.it({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Rd.length>0?this.zd+this.Wd.Ls().td().x:0,.5*this.Bd[this.Bd.length-1].Ls().td().x),s=t+.5*this.Bd[0].Ls().td().x+i,r=e+this.Ld+this.Bd.reduce(((t,e)=>Math.max(t,e.Ls().td().y)),0);this.setContentSize({x:s,y:r})}}else this.Bd.forEach((t=>t.dispose())),this.Bd.length=0,this.Wd.setVisible(!1),this.Gd.setVisible(!1),this.setContentSize({x:0,y:0});return super.Ls()}dispose(){return super.dispose(),this.Gd.dispose(),this.Bd.forEach(Et),this.Wd.dispose(),this}setMouseInteractions(t){return this.Gd.setMouseInteractions(t),this}getMouseInteractions(){return this.Gd.getMouseInteractions()}}const Ho={lutElement:{},setLUT(t){return this.lutElement.Hd(t),this},getLUT(){return this.lutElement.Xd()},setLUTLength(t){return this.lutElement.jd(t),this},getLUTLength(){return this.lutElement.Zd()},setLUTThickness(t){return this.lutElement.Qd(t),this},getLUTThickness(){return this.lutElement.Jd()},setLookUpUnit(t){return this.lutElement.Kd(t),this},getLookUpUnit(){return this.lutElement.qd()},setLUTStepValueFormatter(t){return this.lutElement.tf(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},Wo={...kn,...In,background:Ao,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},tc(t,e,i,s,r,n){const o=new Eo(t,e,i,this.background,s,r),h=o.addElement({tc:()=>new Zo(t,e,i,kt,r,this.alignment)}),a=Object.assign(o,_o,{stylableTexts:[h]},Ho,{lutElement:h});return En(a,r,n),this.applyStylers(a,r)}}.addStyler(Tn),jo=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new it({angle:e,stops:s.map(((e,o)=>({offset:i?(e.value-r)/n:o/(s.length-1),color:e.color||t.color})))});const o=[];for(let e=0;enew Zo(t,i,s,kt,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,Lo,{setTextLabel:c},_o,{stylableTexts:[c,d]},Vo("LUTText",[d]),Bo,{button:l},Ho,{lutElement:d},zo);let g;return f.onMouseClick((()=>{f.getLocked()||f.setOn(!f.getOn())})),f.onMouseEnter((()=>f.setHighlight(!0))),f.onMouseLeave((()=>f.setHighlight(!1))),f.setMouseStyle(e.MouseStyles.Point),f.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),f.onSwitch(((t,e)=>{e?g&&f.setTextFillStyle(g):(g=f.getTextFillStyle(),f.setTextFillStyle(f.getTextFillStyleHidden()))})),f.setPadding({left:5}),this.applyStylers(f,n)}}.addStyler(Tn).addStyler(Rn),$o={alignment:null,title:null,entryStylers:null,legendBoxDisposed:null,entries:[],add(t,e){const i=!e||"object"!=typeof e||void 0===e.toggleVisibilityOnClick||e.toggleVisibilityOnClick,s=null==e?void 0:e.matchStyleExactly,r=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return this.legendBoxDisposed()||(t instanceof na?this.addChart(t,i,r,s):"attach"in t?this.addAttachable(t,i,r,s):t&&this.addDashboard(t,i,r,s)),this},addAttachable(t,e,i,s){const r=t.Xd&&t.Xd(),n=t.Fs&&t.Fs(),o=void 0!==s&&s;let h=i;if(!h){let t=r?Ko.setAlignment(this.alignment):Xo;void 0!==n&&(t=t.setButtonShape(n)),h=t}const a=this.addElement(h);if(r&&"setLUT"in a){a.setLUT(r.lut);const t=r.lut.getUnits(),e=r.lookUpProperty,i=t.length>0?t:"x"===e?"x":"y"===e?"y":"z"===e?"z":"";a.setLookUpUnit(i)}return this.entryStylers.forEach((t=>t(a))),this.entries.push({entry:a,component:t}),t.attach(a,e,o),e||a.setLocked(!0),this},addChart(t,e,i,s){return t.if().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof na)).forEach((t=>this.addChart(t.panel,e,i,s))),this},setTitle(t){return this.title.setText(t),this},getTitle(){return this.title.getText()},setTitleFillStyle(t){return this.title.setTextFillStyle(t),this},getTitleFillStyle(){return this.title.getTextFillStyle()},setTitleFont(t){return this.title.setTextFont(t),this},getTitleFont(){return this.title.getTextFont()},setTitleRotation(t){return this.title.setTextRotation(t),this},getTitleRotation(){return this.title.getTextRotation()},setEntries(t){return this.entries.forEach((e=>t(e.entry,e.component))),this}},Qo={alignment:"vertical",layoutBuilder:Do,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Po:Do}},getAlignment(){return this.alignment},titleBuilder:Oo,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},qo={...kn,...In,...Qo,background:Ao,tc(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).tc(t,e,i,s,r,!1);let h=Object.assign(o,$o,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.$i});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Do:Po),l=a.addElement(this.titleBuilder).setText("Legend").setTextFillStyle(r.legendTitleFillStyle).setTextFont(r.legendTitleFont);return a.addGap(),h=Object.assign(h,{title:l}),"horizontal"===this.alignment&&l.setMargin({right:6}),En(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class Jo extends vn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.sf=10,this.ef=e.UIDirections.Up,this.hf=0,this.ic="major",this.ya=this.ku(t.Or(this.renderingScale).zr(Ie).Vr(Ie)),this.Ve=this.ku(t.Ne(this.renderingScale))}Lu(){return[this.ya]}De(){if(super.De(),this.$i)return this;const t=ct(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.pi(t,{x:this.ef===e.UIDirections.Right?-this.sf:this.ef===e.UIDirections.Left?this.sf:0,y:this.ef===e.UIDirections.Up?-this.sf:this.ef===e.UIDirections.Down?this.sf:0}),s=this.renderingScale.pi(i,{x:this.ef===e.UIDirections.Right?-this.hf:this.ef===e.UIDirections.Left?this.hf:0,y:this.ef===e.UIDirections.Up?-this.hf:this.ef===e.UIDirections.Down?this.hf:0});return this.Ve.We(t).Ge(i),this.ya.Be(s).Ya(this.ef===e.UIDirections.Up?{x:0,y:1}:this.ef===e.UIDirections.Down?{x:0,y:-1}:this.ef===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Ls(){const t=this.Ve.pu().getThickness();return this.size=this.ef===e.UIDirections.Left||this.ef===e.UIDirections.Right?{x:this.sf+this.hf+this.ya.Ls().td().x,y:t}:{y:this.sf+this.hf+this.ya.Ls().td().y,x:t},super.Ls()}dispose(){return super.dispose(),this.ya.dispose(),this.Ve.dispose(),this}setVisible(t){return super.setVisible(t),this.ya.setVisible(t),this.Ve.setVisible(t),this}setMouseInteractions(t){return this.ya.setMouseInteractions(t),this.Ve.setMouseInteractions(t),this}getMouseInteractions(){return this.ya.getMouseInteractions()}getText(){return this.ya._r()}setTextFillStyle(t){return this.ya.Ie(t),this.Is.xs(),this}getTextFillStyle(){return this.ya.Hh()}setTextFont(t){return this.ya.jh(t),this}setTextRotation(t){return this.ya.Zh(t),this}getTextRotation(){return this.ya.Qh()}getTextFont(){return this.ya.Xh()}setText(t){return this.ya.gr(t),this.Is.xs(),this}setDirection(t){return this.ef=t,this.Is.xs(),this}getDirection(){return this.ef}setPointerLength(t){return this.sf=t,this.Is.xs(),this}getPointerLength(){return this.sf}setTickLabelPadding(t){return this.hf=t,this.Is.xs(),this}getTickLabelPadding(){return this.hf}setTickStyle(t){return this.Ve.Oe(t),this.Is.xs(),this}getTickStyle(){return this.Ve.pu()}}const th={...kn,direction:e.UIDirections.Up,setDirection(t){return this.direction=t,this},tc(t,e,i,s,r,n){const o=this.direction,h=new Jo(t,e,i,s,r);return En(h,r,n),h.setDirection(o),this.applyStylers(h,r)}}.addStyler(Tn),eh=th.addStyler(((t,e)=>(t.ic="major",t.setPointerLength(e.xAxisNumericTicks.majorTickStyle.tickLength).setTickLabelPadding(e.xAxisNumericTicks.majorTickStyle.tickPadding).setTickStyle(e.xAxisNumericTicks.majorTickStyle.tickStyle).setTextFont(e.xAxisNumericTicks.majorTickStyle.labelFont).setTextFillStyle(e.xAxisNumericTicks.majorTickStyle.labelFillStyle)))),ih=th.addStyler(((t,e)=>(t.ic="minor",t.setPointerLength(e.xAxisNumericTicks.minorTickStyle.tickLength).setTickLabelPadding(e.xAxisNumericTicks.minorTickStyle.tickPadding).setTickStyle(e.xAxisNumericTicks.minorTickStyle.tickStyle).setTextFont(e.xAxisNumericTicks.minorTickStyle.labelFont).setTextFillStyle(e.xAxisNumericTicks.minorTickStyle.labelFillStyle)))),sh=Xo.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),rh=qo.setAlignment("horizontal"),nh=qo.setAlignment("vertical"),oh={TextBox:Oo,CheckBox:Xo,ButtonBox:sh,PointableTextBox:Uo,AxisTickMajor:eh,AxisTickMinor:ih,LUTRange:Wo},hh={HorizontalLegendBox:rh,VerticalLegendBox:nh},ah=(t,e)=>{var i;return e?"string"==typeof e?`${t} ${e}`:!1!==(null===(i=e.Wh)||void 0===i?void 0:i.displayInCursor)&&e.getUnits()?`${t} ${e.getUnits()}`:t:t},lh=t=>{let e=!1,i={type:"linear"};if(t&&(void 0!==t.opposite&&(e=t.opposite),t.type&&"linear-highPrecision"===t.type&&(i={type:"linear-highPrecision"}),t.type&&"logarithmic"===t.type)){let s=10;if(t.base)if("E"===t.base||"e"===t.base||"natural"===t.base)s="e";else if("number"==typeof t.base)s=t.base;else if("string"==typeof t.base)try{s=Number(t.base)}catch(e){console.warn(`Unidentified logarithmic base "${t.base}"`)}i={base:s,type:"logarithmic"}}return{opposite:e,type:i}},uh=(t,e,i,s=1)=>Ft(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),ch=(t,e,i,s=1)=>{const r=i.ft(t),n=i.ft(e);return Ft(i.dt(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)},dh={rf:0,nf:1,af:2,lf:3,uf:4,cf:5,df:6,ff:7,Af:8,gf:9,pf:10,yf:11,mf:12,vf:13,Sf:14,xf:15,bf:16,Mf:17,_f:18,wf:19,Cf:20,kf:21,Tf:22,Ff:23};class fh extends sr{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.If=r}}class gh extends ir{constructor(t,i,s,n,o,h,a,l,c,d,f,g,y,m,p,x){var A,S,v;super(d,c,a,m,p,{numeric:c.getWidth({x:m.xAxisNumericTicks,y:m.yAxisNumericTicks}),datetime:c.getWidth({x:m.xAxisDateTimeTicks,y:m.yAxisDateTimeTicks}),time:c.getWidth({x:m.xAxisTimeTicks,y:m.yAxisTimeTicks})},x),this.Pf=new Map,this.Df=void 0,this.Bf=0,this.Lf=[],this.Rf=[],this.hh=Os.fitting,this.Ef=!0,this.zf=8,this.Vf=void 0,this.Of=void 0,this.Nf=20,this.Gf=1,this.Wf=!0,this.Uf=!0,this.Yf=!0,this.Hf=!0,this.$f=!0,this.Xf=!0,this.jf=!0,this.Zf=!0,this.Qf=!0,this.Jf=!0,this.Kf=this.Lh.defaultDragMouseStyle,this.qf=this.Lh.defaultDragMouseStyle,this.tA=this.Lh.defaultDragMouseStyle,this.iA=this.Lh.defaultDragMouseStyle,this.sA=this.Lh.defaultDragMouseStyle,this.R=new r.Eventer,this.eA=[],this.hA=t=>{const e=this.Rf.indexOf(t);e>=0&&this.Rf.splice(e,1)},this.rA=t=>(this.Rf.indexOf(t)<0&&this.Rf.push(t),this.hA),this.nA="center",this.Rt=(t,e)=>this.R.emit("axisAreaTouch",this,e),this.oA=ee(this.eA),this.onAxisInteractionAreaMouseClick=t=>this.R.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.R.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.R.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.R.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.R.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.R.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.R.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.R.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.R.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.R.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.R.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.R.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.R.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.R.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.R.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.R.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.R.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.R.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.R.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.R.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.R.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.R.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.R.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.R.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.R.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.R.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.R.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.R.off(t,"axisAreaTouchEnd"),this.Ud={relative:1},this.aA=0,this.lA=0,this.uA=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().rc()):t,this.cA=t=>{const e=this.Lf.indexOf(t);-1!==e&&this.Lf.splice(e,1)},this.dA=(t,e)=>{this.R.emit("axisAreaDoubleClick",this,e),this.Hf&&(this.setStopped(!1),Qt(e))},this.fA=t=>{this.R.emit("axisAreaMouseEnter",this),(this.Uf||this.Wf||this.Yf||this.Hf)&&this.AA(t)},this.gA=t=>{this.pA(t),this.R.emit("axisAreaMouseLeave",this)},this.yA=(t,e,i)=>{var s,r;this.R.emit("axisAreaMouseDragStart",this,e,i);const n=Pt(null===(s=this.chart.mA.Jn)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Pt(null===(r=this.chart.mA.Jn)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Uf?(this.vA(t),Qt(e)):i===n&&this.Wf&&(this.SA(t,h),Qt(e))},this.xA=(t,e,i,s,r)=>{var n,o;this.R.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Pt(null===(n=this.chart.mA.Jn)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Pt(null===(o=this.chart.mA.Jn)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Uf?(this.bA(t,r),Qt(e)):i===h&&this.Wf&&(this.MA(t,s,l,r),Qt(e))},this._A=(t,e,i,s)=>{var r,n;this.R.emit("axisAreaMouseDragStop",this,e,i,s);const o=Pt(null===(r=this.chart.mA.Jn)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Pt(null===(n=this.chart.mA.Jn)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Uf?(this.wA(t),Qt(e)):i===o&&this.Wf&&(this.CA(t,s,a),Qt(e)),t.getIsUnderMouse()&&(this.Uf||this.Wf||this.Yf||this.Hf)&&this.AA(t)},this.kA=(t,e)=>{if(this.R.emit("axisAreaMouseWheel",this,e),this.Yf){this.setStopped(!0);const t=this.Lh.getWidth(this.TA.ls.Re(e.clientX,e.clientY)),i=this.At.dt(t);this.zoom(i,me(e)),Qt(e)}},this.FA=(t,e)=>this.R.emit("axisAreaMouseClick",this,e),this.IA=(t,e)=>this.R.emit("axisAreaMouseDown",this,e),this.PA=(t,e)=>this.R.emit("axisAreaMouseUp",this,e),this.DA=(t,e)=>this.R.emit("axisAreaMouseMove",this,e),this.BA=(t,e,i)=>{this.R.emit("axisAreaTouchStart",this,i),this.Wf&&(this.AA(t),this.SA(t,e),Qt(i))},this.LA=(t,e,i,s,r)=>{this.R.emit("axisAreaTouch",this,r),this.Wf&&(this.MA(t,e,i,s),Qt(r))},this.RA=(t,e,i,s)=>{this.R.emit("axisAreaTouchEnd",this,s),this.Wf&&(this.CA(t,e,i),this.pA(t),Qt(s))},this.EA=(t,e,i,s)=>{(this.Uf||this.Yf)&&(this.AA(t),this.vA(t),Qt(s))},this.zA=(t,e,i,s,r,n)=>{if(this.Uf){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.bA(t,e),Qt(n)}if(this.Yf){const t=this.TA.ls.Re(e.x,e.y),o=this.TA.ls.Re(i.x,i.y),h=Math.abs(this.Lh.getWidth(ci(t,s))-this.Lh.getWidth(ci(o,r)))-Math.abs(this.Lh.getWidth(t)-this.Lh.getWidth(o)),a=this.At.pi(this.Oh,-h),l=this.At.pi(this.Nh,h);this.sr(a,l,!0),Qt(n)}},this.VA=(t,e,i,s)=>{(this.Uf||this.Yf)&&(this.wA(t),this.pA(t),Qt(s))},this.OA=(t,e)=>{(this.$f||this.Xf)&&this.NA(t)},this.GA=(t,e)=>{this.WA(t)},this.UA=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.$f&&this.YA(t,s)},this.HA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.$f&&this.$A(t,n,s,r)},this.XA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.$f&&this.jA(t,n,s,r)},this.ZA=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.$f||this.Xf)&&this.QA(t,r,s),(this.$f||this.Xf)&&this.NA(t)},this.JA=(t,e)=>{this.Xf&&(this.setStopped(!0),this.zoom(this.Oh,me(e)),Qt(e))},this.KA=(t,e)=>{this.Xf&&(this.setStopped(!0),this.zoom(this.Nh,me(e)),Qt(e))},this.qA=(t,e,i)=>{this.$f&&(this.NA(t),this.YA(t,e),Qt(i))},this.tg=(t,e,i,s,r)=>{this.$f&&(this.$A(t,e,i,s),Qt(r))},this.ig=(t,e,i,s,r)=>{this.$f&&(this.jA(t,e,i,s),Qt(r))},this.sg=(t,e,i,s)=>{this.$f&&(this.QA(t,e,i),this.WA(t),Qt(s))},this.eg=t,this.TA=i,this.hg=n,this.rg=o,this.chart=d,this.ng=g,this.og=s,this.ts=h,"logarithmic"===x.type&&this.chart.ls.Xn(dh.wf),y(this,this.rA),a.ag=this,this.lg=f,this.ug=this.lg>50?1:-1,this.cg=(v=this.Lh.toPoint(0,-this.ug),Math.abs(v.x)>=Math.abs(v.y)?v.x>=0?e.UIDirections.Right:e.UIDirections.Left:v.y>=0?e.UIDirections.Up:e.UIDirections.Down),this.dg=l,this.Ag=this.At instanceof Li?(new Bi).Ri(this.Lh.toVec2(this.At,this.dg)):(new zi).Ri(this.Lh.toVec2(this.At,this.dg)),this.gg=this.chart.pg,this.yg=(new Bi).Ri(this.Lh.toVec2(this.Lh.getWidth(this.gg),this.dg)),this.mg=this.TA.Ne(this.Ag).setMouseInteractions(!1),this.vg=this.TA.Ne(this.Ag).setMouseInteractions(!1),this.Sg=this.TA.Ne(this.Ag).setMouseInteractions(!1),this.xg=this.og.Pe(this.gg).Ie(c.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).Fe(nt).ia(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.bg=this.og.Pe(this.gg).Ie(c.getWidth({x:m.xAxisZoomingBandFillStyle,y:m.yAxisZoomingBandFillStyle})).Fe(c.getWidth({x:m.xAxisZoomingBandStrokeStyle,y:m.yAxisZoomingBandStrokeStyle})),this.Mg=this.og.Pe(this.gg).Ie(c.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).Fe(nt).ia(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this._g=this.og.Pe(this.gg).Ie(c.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).Fe(nt).ia(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.bh=this.og.Or(this.Ag).setMouseInteractions(!1).Zh(this.Lh.getTitleTextRotation(this.ug)).Vr(Ie).zr(Ie),this.chart.ls.os.ns(this.xg,(t=>this.xg.us(t)),{animationEnabled:this.ah}),this.chart.ls.os.ns(this.Mg,(t=>this.Mg.us(t)),{animationEnabled:this.ah}),this.chart.ls.os.ns(this._g,(t=>this._g.us(t)),{animationEnabled:this.ah});const b=ji(new $i(this.BA,this.LA,this.RA,1),new Qi(this.EA,this.zA,this.VA),new Ki(this.dA)),M=ji(new $i(this.qA,this.tg,this.sg)),w=ji(new $i(this.qA,this.ig,this.sg));this.xg.setMouseEnterEventHandler(this.fA).setMouseLeaveEventHandler(this.gA).setMouseDragStartEventHandler(this.yA).setMouseDragEventHandler(this.xA).setMouseDragStopEventHandler(this._A).setMouseWheelEventHandler(this.kA).setMouseDoubleClickEventHandler(this.dA).setMouseClickEventHandler(this.FA).setMouseDownEventHandler(this.IA).setMouseUpEventHandler(this.PA).setMouseMoveEventHandler(this.DA).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.Mg.setMouseEnterEventHandler(this.OA).setMouseLeaveEventHandler(this.GA).setMouseDragStartEventHandler(this.UA).setMouseDragEventHandler(this.HA).setMouseDragStopEventHandler(this.ZA).setMouseWheelEventHandler(this.JA).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this._g.setMouseEnterEventHandler(this.OA).setMouseLeaveEventHandler(this.GA).setMouseDragStartEventHandler(this.UA).setMouseDragEventHandler(this.XA).setMouseDragStopEventHandler(this.ZA).setMouseWheelEventHandler(this.KA).setTouchStartEventHandler(w.onTouchStart).setTouchMoveEventHandler(w.onTouchMove).setTouchEndEventHandler(w.onTouchEnd),this.mg.Oe(c.getWidth({x:m.xAxisStrokeStyle,y:m.yAxisStrokeStyle})),this.vg.Oe(c.getWidth({x:m.xAxisNibStyle,y:m.yAxisNibStyle})),this.Sg.Oe(c.getWidth({x:m.xAxisNibStyle,y:m.yAxisNibStyle})),this.bh.Ie(c.getWidth({x:m.xAxisTitleFillStyle,y:m.yAxisTitleFillStyle})).jh(c.getWidth({x:m.xAxisTitleFont,y:m.yAxisTitleFont})),this.ss=h.es(this,{}),this.Jh=this.ss.wg([this.bh]).Ss(m.effectsText),this.Cg=null!==(A=c.getWidth({x:m.xAxisMarginAfterTicks,y:m.yAxisMarginAfterTicks}))&&void 0!==A?A:7,this.kg=null!==(S=c.getWidth({x:m.xAxisMarginAfterTitle,y:m.yAxisMarginAfterTitle}))&&void 0!==S?S:7}Rr(){return this.dh}Er(){return void 0!==this.ir}setTickStrategy(t,e){return super.Vh(t,e)}getTickStrategy(){return this.ih}addBand(t=!0){const e=t?this.rg:this.hg,i=new zs(e,this.chart,this.oA,this,this.Ag,this.Lh,this.Ki,this.ts);return this.eA.push(i),i}addConstantLine(t=!0){const e=t?this.rg:this.hg,i=new Ns(e,this.chart,this.oA,this,this.Ag,this.Lh,this.Ki,this.ts);return this.eA.push(i),i}Tg(t){this.eA.forEach(t)}Fg(t){return this.eA.map(t)}getHighlighters(){return this.eA}setThickness(t){return"number"==typeof t?(this.Ig=t,this.Pg=t):"object"==typeof t&&(this.Ig=t.min,this.Pg=t.max),this.chart.ls.xs(),this}getThickness(){return{min:this.Ig,max:this.Pg}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}Dg(){return this.Rf}mr(t,e){return new fh(e,t,this.TA,this.Ag,this.Ag)}Kh(){if(this.Pf){for(const t of this.Pf)t[1].grid.dispose(),t[1].tick.dispose();this.Pf.clear()}super.Kh()}vr(t,e){const{tickStart:i}=e,s=t.Fh.yr,r=i+s.getTickLength()*this.ug+s.getTickPadding()*this.ug;t.Ke.Be(this.Lh.toPoint(t.M,r)).Ya(this.Lh.toPoint(s.getLabelAlignment(),-this.ug)).Zh(s.labelRotation).setVisible(this.getVisible())}Bg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.Fh.yr,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.ug;return{gridStroke:{start:this.Lh.toPoint(t.M,r),end:this.Lh.toPoint(t.M,h)},tickStroke:{start:this.Lh.toPoint(t.M,n),end:this.Lh.toPoint(t.M,a)}}}Dr(t,e){return"linear"===this.Eh.type?uh(t,e,this.At):ch(t,e,this.At)}Lg(t,e){return e instanceof Li?uh:ch}Lr(t,e,i){if("logarithmic"!==this.Eh.type){const s=this.At.Li(e-t);return{min:t-i*s,max:e+i*s}}const s=this.At;return{min:s.pi(t,-i),max:s.pi(e,i)}}Ls(){if(!this.Xi)return{Rg:0,Eg:0,Yd:0};const t=!(this.sh.size>0),e=this.bh&&this.bh._r().length>0&&this.getTitleFillStyle()!==B,i=this.Lh.getHeight(e?this.chart.ls.Vg.zg(this.bh._r(),this.getTitleFont(),this.getTitleRotation()):{x:0,y:0})+(e?this.kg:0),s=qs(this.th)?new Map:rr(this.th,Math.min(this.Oh,this.Nh),Math.max(this.Oh,this.Nh),this.Oh,this.Nh,0),r=this.At;let n=0;s.forEach(((e,i)=>{if((t=>void 0!==t.yr&&void 0!==t.Ar)(i)){const s=Math.max(...e.map((e=>{if(!je(e,this.Oh,this.Nh))return 0;const s=this.chart.ls.Vg.zg(i.Ar(e,r),i.yr.labelFont,i.yr.labelRotation);return t||!s.isEstimate?this.Lh.getHeight(s):0})))+i.yr.tickLength+i.yr.tickPadding;n=Math.max(n,s)}}));const o=this.Lf.reduce(this.uA,0);n=Math.max(n,o),n+=this.Cg;const h=Ft(i+n,void 0!==this.Ig?this.Ig:0,void 0!==this.Pg?this.Pg:Be);return this.Bf=h,{Rg:n,Eg:i,Yd:h}}De(t){const e=this.getVisible()&&t.Og>0;this.Ng=t;const i=this.mg.pu(),s=this.At.getInnerStart()this.At.getInnerStart()?this.At.getInnerEnd():this.At.getInnerStart(),n=i.getThickness()*this.ug/2,o=this.dg.getInnerInterval(),h=this.lg/100*o,a=h+t.Gg,l=o*this.ug,u=a+n;if(e||this.Kh(),!qs(this.th)&&e){const t=this.At.ri();this.rr({physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});for(const[e,i]of this.sh){let s=this.Pf.get(e);if(!s)if(e.Ue)s={grid:this.eg[0].Wg(this.Ag).setMouseInteractions(!1),tick:this.eg[0].Wg(this.Ag).setMouseInteractions(!1)};else if("Ug"in e){const t=Array.from(this.sh.keys()).filter((t=>"Ug"in t)).reverse().indexOf(e),i=this.eg[t];if(!i)throw new Error("Not enough tick layers. This is an internal LCJS error - if you see this, please contact Arction support.");s={grid:i.Wg(this.Ag).setMouseInteractions(!1),tick:i.Wg(this.Ag).setMouseInteractions(!1)}}if(s){s.grid.Ot(),s.tick.Ot();for(const[e,r]of i){const e=this.Bg(r,{physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});s.grid.Hr().Yg(e.gridStroke.start,e.gridStroke.end),s.tick.Hr().Yg(e.tickStroke.start,e.tickStroke.end)}s.grid.Oe(e.yr.getGridStrokeStyle()),s.tick.Oe(e.yr.getTickStyle()),this.Pf.set(e,s)}}}const c=u,d=c+this.ug*t.Hg,f=this.$f||this.Xf?Math.min(this.Nf,.25*t.Og):0,g={start:this.Lh.toVec2(this.At.pi(this.At.getInnerStart(),f),c),end:this.Lh.toVec2(this.At.pi(this.At.getInnerEnd(),-f),d)},y=ct(this.Lh.toVec2(this.At.getInnerStart(),d),this.Ag,this.gg),m=ct(g.start,this.Ag,this.gg),p=ct(g.end,this.Ag,this.gg),x=ct(this.Lh.toVec2(this.At.getInnerEnd(),c),this.Ag,this.gg);this.mg.We(this.Lh.toPoint(s,a)).Ge(this.Lh.toPoint(r,a)).setVisible(e),this.vg.We(this.Lh.toPoint(this.At.pi(this.At.getInnerStart(),this.zf),a)).Ge(this.Lh.toPoint(this.At.getInnerStart(),a)).setVisible(e),this.Sg.We(this.Lh.toPoint(this.At.pi(this.At.getInnerEnd(),-this.zf),a)).Ge(this.Lh.toPoint(this.At.getInnerEnd(),a)).setVisible(e);const A=a+t.Rg*this.ug;if(this.bh.Be(this.Lh.toPoint(this.Lh.getWidth(ct("center"===this.nA?li(ui(y,x),.5):"start"===this.nA?y:x,this.gg,this.Ag)),A)).Ya(this.Lh.toPoint("center"===this.nA?0:"start"===this.nA?-1:1,-1*this.ug)).setVisible(e).setMouseInteractions(void 0!==["mouseEnterTitle","mouseMoveTitle","mouseLeaveTitle","mouseDownTitle","mouseUpTitle","mouseClickTitle","mouseDoubleClickTitle","mouseDragStartTitle","mouseDragTitle","mouseDragStopTitle","mouseWheelTitle","touchStartTitle","touchMoveTitle","touchEndTitle"].find((t=>this.R.listeners(t).size>0))),this.Df){const e=this.lg/100*o+t.Gg,i=-this.ug*o-t.Gg,s={start:this.Lh.toVec2(this.Df.min,u+this.ug*this.Bf),end:this.Lh.toVec2(this.Df.max,e+i)},r=ct(s.start,this.Ag,this.gg),n=ct(s.end,this.Ag,this.gg);this.bg.Be(r).it(ci(n,r)).setVisible(!0)}else this.bg.setVisible(!1);this.xg.Be(m).it(ci(p,m)).setVisible(e),this.Mg.Be(y).it(ci(m,y)).setVisible(e),this._g.Be(p).it(ci(x,p)).setVisible(e);for(const i of this.Lf)i.update().plot(e,a,l,t.Gg,u);for(const t of this.eA)t.De()}setLength(t){return this.Ud=t,this.chart.ls.xs(),this}getLength(){return this.Ud}setMargins(t,e){return this.aA=t,this.lA=e,this.chart.ls.xs(),this}getMargins(){return{start:this.aA,end:this.lA}}getStackIndex(){var t,e;return null!==(e=null===(t=[...this.chart.$g,...this.chart.Xg,...this.chart.jg,...this.chart.Zg].find((t=>t.axis===this)))||void 0===t?void 0:t.iStack)&&void 0!==e?e:0}getParallelIndex(){var t,e;return null!==(e=null===(t=[...this.chart.$g,...this.chart.Xg,...this.chart.jg,...this.chart.Zg].find((t=>t.axis===this)))||void 0===t?void 0:t.iParallel)&&void 0!==e?e:0}Qg(){const t=this.Ng;if(!t)return;const e=this.getVisible()&&t.Og>0,i=this.mg.pu().getThickness()*this.ug/2,s=this.dg.getInnerInterval(),r=this.lg/100*s+t.Gg,n=s*this.ug,o=r+i;for(const i of this.Lf)i.update().plot(e,r,n,t.Gg,o);for(const t of this.eA)t.De()}Jg(){return this.Bf}Kg(t,e){e=e||oh.AxisTickMajor;const i=new Cn(this,t?this.eg[0]:this.og,this.og,this.At,this.yg,this.yg,this.Lh,this.cg,this.cA,this.Ki,e).setTextFormatter(this.formatValue);return this.Lf.push(i),i}AA(t){this.chart.ls.os.ws(t,1),this.Vf=t.ls.Qr(this.Kf,this.Vf)}pA(t){this.chart.ls.os.ws(t,0),t.ls.Jr(this.Vf)}vA(t){this.setStopped(!0),t.ls.Jr(this.Vf)}bA(t,e){const i=-this.Lh.getWidth(e);this.pan(i),this.Vf=t.ls.Qr(this.qf,this.Vf)}pan(t){const e=this.Oh,i=this.Nh,s=this.At.pi(e,t),r=this.At.pi(i,t);this.sr(s,r,!1)}zoom(t,e){const i=this.At.ft(this.Oh),s=this.At.ft(this.Nh),r=this.At.ft(t),n=Ft((r-i)/(s-i),0,1),o=.2*this.At.ri(),h=n*this.Gf*o*-e,a=(1-n)*this.Gf*o*e,l=this.At.pi(this.Oh,h),u=this.At.pi(this.Nh,a);this.sr(l,u,!0)}wA(t){this.Df=void 0,t.ls.Jr(this.Vf)}SA(t,e){this.setStopped(!0),t.ls.Jr(this.Vf),this.chart.ls.os.ws(this.xg,0)}MA(t,e,i,s){const r=ct(this.TA.ls.Re(i.x,i.y),this.TA.ls.At,this.Ag),n=Ft(this.Lh.getWidth(r),this.Oh,this.Nh),o=this.Lh.getWidth(ct(this.TA.ls.Re(e.x,e.y),this.TA.ls.At,this.Ag));Math.abs(this.At.ft(n)-this.At.ft(o))>10?(this.Df=y(Math.min(n,o),Math.max(n,o)),this.Vf=t.ls.Qr(this.tA,this.Vf)):(this.Df=void 0,this.Vf=t.ls.Qr(this.Kf,this.Vf)),this.TA.xs()}CA(t,e,i){if(this.Df){const t=this.Df.min,e=this.Df.max,i=this.Nh{e.ps(t)}));for(const e of this.Pf.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.chart.ls.xs(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.ah),this}}var yh;e.AxisXYTitlePositionOptions=void 0,(yh=e.AxisXYTitlePositionOptions||(e.AxisXYTitlePositionOptions={})).Start="start",yh.Center="center",yh.End="end";const mh={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},ph={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},xh=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof gh&&"y"in t&&t.y instanceof gh),Ah=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new Ji,tickLength:7,tickStyle:new Ji,tickPadding:0,labelFont:new lr,labelFillStyle:new U,labelAlignment:0,labelRotation:0});class Sh extends Ah{constructor(t){super(t)}setGridStrokeLength(t){return this.set("gridStrokeLength",t)}getGridStrokeLength(){return this.get("gridStrokeLength")}setGridStrokeStyle(t){return this.set("gridStrokeStyle","function"==typeof t?t(this.get("gridStrokeStyle")):t)}getGridStrokeStyle(){return this.get("gridStrokeStyle")}setTickLength(t){return this.set("tickLength",t)}getTickLength(){return this.get("tickLength")}setTickStyle(t){return this.set("tickStyle","function"==typeof t?t(this.get("tickStyle")):t)}getTickStyle(){return this.get("tickStyle")}setTickPadding(t){return this.set("tickPadding",t)}getTickPadding(){return this.get("tickPadding")}setLabelFillStyle(t){return this.set("labelFillStyle","function"==typeof t?t(this.get("labelFillStyle")):t)}getLabelFillStyle(){return this.get("labelFillStyle")}setLabelFont(t){return this.set("labelFont","function"==typeof t?t(this.get("labelFont")):t)}getLabelFont(){return this.get("labelFont")}setLabelAlignment(t){return this.set("labelAlignment",t)}getLabelAlignment(){return this.get("labelAlignment")}setLabelRotation(t){return this.set("labelRotation",t)}getLabelRotation(){return this.get("labelRotation")}}const vh=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),bh=new Sh({labelFillStyle:B,gridStrokeStyle:nt,tickStyle:nt}),Mh=t=>vh(t)&&z(t.labelFillStyle)&&ot(t.gridStrokeStyle)&&ot(t.tickStyle),wh=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new Sh,minorTickStyle:new Sh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Ch=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=9e4?"MajorMinutes":i>=10500?"MajorSeconds15":i>=1e3?"MajorSeconds":i>=100?"MajorMilliseconds100":i>=10?"MajorMilliseconds10":i>=1?"MajorMilliseconds":i>=.1?"MajorMicroseconds100":i>=.01?"MajorMicroseconds10":i>=.001?"MajorMicroseconds":i<=.001?"MajorNanoseconds100":"Unknown"},Th={hhmmss:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);return`${i}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}`},hhmmssmmm:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);e%=1e3;const o=Math.floor(e/1);return`${i}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(o,3)}`},hhmmssmmmuuu:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}).split(".")[1];return`${i}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(o,3)}${h}`},hhmmssmmmuuunnn:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:6,maximumFractionDigits:6}).split(".")[1];return`${i}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(o,3)}${h}`}},Rh={MajorHours12:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Hs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,4)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,36e5,1e6),fitKeyValues:js({},2,3,4,6)},defaultValueFormatter:Th.hhmmss},MajorHours:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Hs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,6,12)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,3e5,1e6),fitKeyValues:js({},2,4,6)},defaultValueFormatter:Th.hhmmss},MajorMinutes15:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Hs(t,e,9e5,void 0,1e6)),fitKeyValues:js({ignore:"first"},2)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,6e4,1e6),fitKeyValues:js({},3,5)},defaultValueFormatter:Th.hhmmss},MajorMinutes:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Hs(t,e,6e4,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,5e3,1e6),fitKeyValues:js({},2,3,4,6)},defaultValueFormatter:Th.hhmmss},MajorSeconds15:{major:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Hs(t,e,15e3,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,4)},minor:{format:Th.hhmmss,getKeyValues:(t,e,i,s)=>Zs(t,e,1e3,1e6),fitKeyValues:js({},3,5)},defaultValueFormatter:Th.hhmmss},MajorSeconds:{major:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Hs(t,e,1e3,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>Zs(t,e,100,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmm},MajorMilliseconds100:{major:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Hs(t,e,100,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>Zs(t,e,10,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmm},MajorMilliseconds10:{major:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Hs(t,e,10,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmm,getKeyValues:(t,e,i,s)=>Zs(t,e,1,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmm},MajorMilliseconds:{major:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Hs(t,e,1,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Zs(t,e,.1,1e6),fitKeyValues:js({},2)},defaultValueFormatter:Th.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Hs(t,e,.1,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Zs(t,e,.01,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Hs(t,e,.01,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Zs(t,e,.001,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Th.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Hs(t,e,.001,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Zs(t,e,100*1e-6,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Th.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Hs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Th.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Zs(t,e,10*1e-6,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Th.hhmmssmmmuuunnn},Unknown:{major:{format:(t,e,i)=>"",getKeyValues:(t,e,i,s)=>[],fitKeyValues:void 0},minor:{format:(t,e,i)=>"",getKeyValues:(t,e,i,s)=>[],fitKeyValues:void 0},defaultValueFormatter:(t,e,i)=>""}};class Eh extends wh{He(t){const e=this.timeOrigin||0,i=[{Ke:"Major ticks",Ug:0,yr:this.majorTickStyle,Ar:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Ch(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Rh[r].major.format)(t+e,i,s)},Gr:(t,e,i,s)=>{const r=Ch(i,s);return(0,Rh[r].major.getKeyValues)(t,e,i,s)},Ih:{Sr:(t,e,i,s,r,n)=>{const o=Ch(r,n),h=Rh[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Wr:void 0}];return vh(this.minorTickStyle)&&i.push({Ke:"Minor ticks",Ug:1,yr:this.minorTickStyle,Ar:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Ch(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Rh[r].minor.format)(t+e,i,s)},Gr:(t,e,i,s)=>{const r=Ch(i,s);return(0,Rh[r].minor.getKeyValues)(t,e,i,s)},Ih:{Sr:(t,e,i,s,r,n)=>{const o=Ch(r,n),h=Rh[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Wr:void 0}),{$e:[],Xe:i,je:this.cursorFormatter||((t,i,s)=>{const r=Ch(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Rh[r].defaultValueFormatter(t+e,i,s)}),Ze:1e-4,Qe:864e6}}setTickStyle(t){return this.setMajorTickStyle(t).setMinorTickStyle(t)}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setTimeOrigin(t){return this.set("timeOrigin",t)}getTimeOrigin(){return this.get("timeOrigin")}setFormattingFunction(t){return this.withMutations((e=>e.set("majorFormattingFunction",t).set("minorFormattingFunction",t).set("cursorFormatter",t)))}getMajorFormattingFunction(){return this.get("majorFormattingFunction")}setMajorFormattingFunction(t){return this.set("majorFormattingFunction",t)}getMinorFormattingFunction(){return this.get("minorFormattingFunction")}setMinorFormattingFunction(t){return this.set("minorFormattingFunction",t)}}const kh=(t,e,i,s,r)=>(n,o)=>h=>{const a=new Date(h+n),l={year:o?a.getUTCFullYear():a.getFullYear(),monthIndex:o?a.getUTCMonth():a.getMonth(),day:o?a.getUTCDate():a.getDate(),hours:o?a.getUTCHours():a.getHours(),minutes:o?a.getUTCMinutes():a.getMinutes(),seconds:o?a.getUTCSeconds():a.getSeconds(),millis:o?a.getUTCMilliseconds():a.getMilliseconds()},u=s?s(l):void 0;if(0===t&&!0===u)return h;const c=l[e];r.includes("year")&&(l.year=Math.floor(l.year/i)*i),r.includes("monthIndex")&&(l.monthIndex=0),r.includes("day")&&(l.day=1),r.includes("hours")&&(l.hours=0),r.includes("minutes")&&(l.minutes=0),r.includes("seconds")&&(l.seconds=0),r.includes("millis")&&(l.millis=0);let d=(0===t?1:t)*i;return-1===t&&!1===u&&(d=0),0!==d&&(l[e]=i*(d>0?Math.floor((c+d)/i):Math.ceil((c+d)/i))),o?Date.UTC(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis)-n:new Date(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis).getTime()-n},Ih=(t,e,i,...s)=>kh(-1,t,e,i,s),Fh=(t,e,i,...s)=>kh(-1,t,e,i,s),Dh=(t,e,i,...s)=>kh(0,t,e,i,s),Ph=(t,e,...i)=>kh(1,t,e,void 0,i),Lh=t=>(e,i)=>s=>{const r=new Date(s+e),n=i?r.getUTCDay():r.getDay(),o=1===n&&0===(i?r.getUTCHours():r.getHours())&&0===(i?r.getUTCMinutes():r.getMinutes())&&0===r.getSeconds()&&0===r.getMilliseconds();if(0===t&&!0===o)return s;let h=i?r.getUTCDate():r.getDate();return-1===t&&1===n&&!1===o||(-1===t?h-=n>=2?n-1:n+6:h+=n>0?8-n:1),i?Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),h,0,0,0,0)-e:new Date(r.getFullYear(),r.getMonth(),h,0,0,0,0).getTime()-e},Vh=[{label:"MilliSecond1",unit:1,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:js({offset:0},2,5)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"MilliSecond10",unit:10,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("millis",10,(t=>t.millis%10==0),"millis")},majorTicks:{fitFunction:js({offset:0},2,5)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("millis",100,(t=>t.millis%100==0),"millis")},majorTicks:{fitFunction:js({offset:0},2,5)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Ks(5,10,15,30)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Ks(5,10,15,30)},minorTicks:{amount:12,fitFunction:js(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Ks(3,6,12)},minorTicks:{amount:8,fitFunction:js(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:Ih("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:js({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:js({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:Lh(-1),getNextKeyValueIncludingRef:Lh(0),getNextKeyValue:Lh(1),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:Fh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Dh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:Ph("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2,3)},minorTicks:{fitFunction:js(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:Fh("year",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Dh("year",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Ph("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js({ignore:"first"},2,5)},minorTicks:{fitFunction:js(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:Fh("year",10,(t=>t.year%10==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Dh("year",10,(t=>t.year%10==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Ph("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2,4)},minorTicks:{fitFunction:js(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:Fh("year",100,(t=>t.year%100==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Dh("year",100,(t=>t.year%100==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Ph("year",100,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0},{label:"Millennium",unit:316224e8,irregular:!0,getPrevKeyValue:Fh("year",1e3,(t=>t.year%1e3==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:Dh("year",1e3,(t=>t.year%1e3==0&&1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"year","monthIndex","day","hours","minutes","seconds","millis"),getNextKeyValue:Ph("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],_h=(t,e,i,s,r)=>{const n=e-t;let o;for(let t=r?0:Vh.length-1;r?t=0;r?t+=1:t-=1){const e=n/Vh[t].unit;if((void 0===i||e>=i)&&(void 0===s||e<=s)){o=Vh[t];break}}return o},Bh=(t,e,i)=>{let s=_h(e,i,void 0,1,!0);if(void 0!==s&&0===Vh.indexOf(s)&&(s=Vh[1]),void 0===s)return;if("great"===t)return s;const r="major"===t?1:2,n=Vh[Vh.indexOf(s)-r];return void 0===n?Vh[0]:n},zh=(t,e,i)=>(s,r,n,o)=>{const h=Bh("great",s,r);if(void 0===h)return[];if("Decade"===h.label||"Century"===h.label||"Millennium"===h.label)return[];const a=o>n?s:r,l=(s+r)/2,u=o>n?r:s;if(Vh.indexOf(h)<=Vh.findIndex((t=>"Hour"===t.label)))return"left"===i?[a]:[];let c;if(!0===h.irregular)c=Ws(s,r,h.getPrevKeyValue(t,e),h.getNextKeyValue(t,e));else{const i=h.greatTicks.getReferenceKeyValue(t,e)(s);c=Hs(s,r,h.unit,i,1)}const d=((t,e,i)=>{for(const s of i)if(s>=t&&s<=e)return s})(s,r,c);return"left"===i?void 0===d||je(d,l,u)?[a]:[d]:void 0!==d&&je(d,l,u)?[d]:[u]},Nh=(t,e,i)=>(s,r,n,o)=>{const h=Bh(t,n,o);let a;if(void 0===h)return[];if("great"===t&&void 0!==h.greatTicks)if(!0===h.irregular)a=Ws(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i));else{const t=h.greatTicks.getReferenceKeyValue(e,i)(s);a=Hs(s,r,h.unit,t,1)}else if("major"===t&&void 0!==h.majorTicks)a=!0===h.irregular?((t,e,i,s)=>{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r.push(n),r})(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i)):((t,e,i)=>{const s=[];let r=t,n=0;for(;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return s.push(r),s})(s,r,h.unit);else{if("minor"!==t||void 0===h.minorTicks)return[];if(!0===h.irregular)a=((t,e,i,s)=>{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r})(s,r,h.getNextKeyValueIncludingRef(e,i),h.getNextKeyValue(e,i));else{const t=(t=>{if(void 0!==t)return Vh[Vh.indexOf(t)+1]})(h);if(void 0===t)return[];a=Zs(s,r,t.unit/h.minorTicks.amount,1)}}return a},Oh=t=>(e,i,s,r,n,o)=>{const h=Bh(t,n,o);if(void 0===h)return;let a;return"major"===t?a=h.majorTicks.fitFunction:h.minorTicks&&(a=h.minorTicks.fitFunction),a?a(e,i,s,r,n,o):void 0},Uh=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new Sh,majorTickStyle:new Sh,minorTickStyle:new Sh,formatOptionsMajorCentury:{year:"numeric",hour12:!1},formatOptionsMinorDecade:{year:"numeric",hour12:!1},formatOptionsMajorDecade:{year:"numeric",hour12:!1},formatOptionsMinorYear:{year:"numeric",hour12:!1},formatOptionsMajorYear:{year:"numeric",hour12:!1},formatOptionsMinorMonth:{month:"short",hour12:!1},formatOptionsGreatYear:{year:"numeric",hour12:!1},formatOptionsMajorMonth:{month:"long",hour12:!1},formatOptionsMinorWeek:{day:"numeric",hour12:!1},formatOptionsGreatMonth:{year:"numeric",month:"long",hour12:!1},formatOptionsMajorWeek:{day:"numeric",weekday:"short",hour12:!1},formatOptionsMinorDay:{day:"numeric",weekday:"short",hour12:!1},formatOptionsGreatWeek:(t,e,i)=>{const s=new Date(t),r=(t=>{const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const i=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-i.getTime())/864e5+1)/7)})(s);return`${new Intl.DateTimeFormat(i,{year:"numeric",month:"long",hour12:!1}).format(s)} Week ${r}`},formatOptionsMajorDay:{weekday:"long",day:"numeric",hour12:!1},formatOptionsMinorHour:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsGreatDay:{year:"numeric",month:"long",day:"numeric",hour12:!1},formatOptionsMajorHour:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsMinorMinute:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsGreatHour:{year:"numeric",month:"long",day:"numeric",hour12:!1},formatOptionsMajorMinute:{hour:"2-digit",minute:"2-digit",hour12:!1},formatOptionsMinorSecond:{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},formatOptionsGreatMinute:{year:"numeric",month:"long",day:"numeric",hour12:!1},formatOptionsMajorSecond:{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},formatOptionsMinorMillisecond:t=>{const e=new Date(t);return e.setHours(0,0,0,0),Th.hhmmssmmm(t-e.getTime())},formatMillisecondRange:t=>{const e=new Date(t);return e.setHours(0,0,0,0),Th.hhmmssmmm(t-e.getTime())},formatOptionsGreatSecond:{},formatOptionsMajorMilliSecond:{}});class Yh extends Uh{He(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>Vh.map((e=>{const i=((t,e,i)=>{switch(i.label){case"MilliSecond1":case"MilliSecond10":case"MilliSecond100":return"Great"===e?t.formatOptionsGreatMinute:t.formatMillisecondRange;case"Second":return"Great"===e?t.formatOptionsGreatMinute:"Major"===e?t.formatOptionsMajorSecond:t.formatOptionsMinorSecond;case"Minute":return"Great"===e?t.formatOptionsGreatMinute:"Major"===e?t.formatOptionsMajorMinute:t.formatOptionsMinorMinute;default:case"Hour":return"Great"===e?t.formatOptionsGreatHour:"Major"===e?t.formatOptionsMajorHour:t.formatOptionsMinorHour;case"Day":return"Great"===e?t.formatOptionsGreatDay:"Major"===e?t.formatOptionsMajorDay:t.formatOptionsMinorDay;case"Week":return"Great"===e?t.formatOptionsGreatWeek:"Major"===e?t.formatOptionsMajorWeek:t.formatOptionsMinorWeek;case"Month":return"Great"===e?t.formatOptionsGreatMonth:"Major"===e?t.formatOptionsMajorMonth:t.formatOptionsMinorMonth;case"Year":return"Great"===e?t.formatOptionsGreatYear:"Major"===e?t.formatOptionsMajorYear:t.formatOptionsMinorYear;case"Decade":return"Great"===e?void 0:"Major"===e?t.formatOptionsMajorDecade:t.formatOptionsMinorDecade;case"Century":return"Great"===e?void 0:"Major"===e?t.formatOptionsMajorCentury:void 0;case"Millennium":return}})(this,t,e);if("object"!=typeof i)return i;try{return new Intl.DateTimeFormat(this.locale,i)}catch(t){let e="";for(const t in i)e+=` ${t}: ${i[t]},`;wt.console.error(`Invalid Intl.DateTimeFormat ( locale: ${this.locale}, formatOptions {${e}} )`)}})),s=new Map;s.set("great",i("Great")),s.set("major",i("Major")),s.set("minor",i("Minor"));const r=t=>String(t),n=(t,i)=>(n,o)=>{let h=n+e;const a=o.getInnerStart(),l=o.getInnerEnd(),u=a>l,c=Bh(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){const t=It(n,"left"===i?a:l);let s;if(s=!1===t?n:!1===c.irregular?"left"===i&&!1===u||"right"===i&&!0===u?c.greatTicks.getReferenceKeyValue(e,this.utc)(n):c.greatTicks.getReferenceKeyValue(e,this.utc)(n+1*c.unit):"left"===i&&!1===u||"right"===i&&!0===u?c.getPrevKeyValue(e,this.utc)(n):c.getNextKeyValue(e,this.utc)(n),h=s+e,"right"===i&&!0===t)return""}const d=s.get(t);if(void 0===d)return r(h);const f=d[Vh.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{Ke:"Great ticks (directive)",Ug:0,Ye:!0,Gr:Nh("great",e,this.utc),Wr:void 0},{Ke:"Major ticks",Ug:1,yr:this.majorTickStyle,Ar:n("major"),Gr:Nh("major",e,this.utc),Ih:{Sr:Oh("major")},Wr:void 0}];Mh(this.greatTickStyle)||(o.push({Ke:"Great ticks (left)",yr:this.greatTickStyle.setLabelAlignment(-1),Ar:n("great","left"),Gr:zh(e,this.utc,"left"),Ue:!0,wr:!1}),o.push({Ke:"Great ticks (right)",yr:this.greatTickStyle.setLabelAlignment(1),Ar:n("great","right"),Gr:zh(e,this.utc,"right"),Ue:!0,wr:!1})),Mh(this.minorTickStyle)||h.push({Ke:"Minor ticks",Ug:2,yr:this.minorTickStyle,Ar:n("minor"),Gr:Nh("minor",e,this.utc),Ih:{Sr:Oh("minor"),Ph:(t,e,i,s,r,n)=>{const o=Bh("minor",r,n);return!o||"Week"!==o.label}},Wr:void 0});const a=this.cursorFormatter;return{$e:o,Xe:h,je:a?(t,i,s)=>a(e+t,i,s):(t,i,s)=>{const r=_h(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()),void 0,1,!0),n=r&&r.unit<=6e4,o=new Date(e+t),h=new Date(e+t);h.setHours(0,0,0,0);const a=n?Th.hhmmssmmm:Th.hhmmss;return`${new Intl.DateTimeFormat(s,{year:"numeric",month:"numeric",day:"numeric"}).format(o)} ${a(o.getTime()-h.getTime())}`},Ze:1,Qe:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setTickStyle(t){return this.setGreatTickStyle(t).setMajorTickStyle(t).setMinorTickStyle(t)}setGreatTickStyle(t){if("function"==typeof t){const e=this.get("greatTickStyle");return this.set("greatTickStyle",t(e))}return this.set("greatTickStyle",t)}getGreatTickStyle(){return this.get("greatTickStyle")}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setUTC(t){return this.set("utc",t)}getUTC(){return this.get("utc")}setLocale(t){return this.set("locale",t)}getLocale(){return this.get("locale")}setDateOrigin(t){return this.set("dateOrigin",t)}getDateOrigin(){return this.get("dateOrigin")}setFormatting(t,e,i){return this.withMutations((s=>s.set("formatOptionsGreatYear",t||this.formatOptionsGreatYear).set("formatOptionsGreatMonth",t||this.formatOptionsGreatMonth).set("formatOptionsGreatWeek",t||this.formatOptionsGreatWeek).set("formatOptionsGreatDay",t||this.formatOptionsGreatDay).set("formatOptionsGreatHour",t||this.formatOptionsGreatHour).set("formatOptionsGreatMinute",t||this.formatOptionsGreatMinute).set("formatOptionsMajorCentury",e||this.formatOptionsMajorCentury).set("formatOptionsMajorDecade",e||this.formatOptionsMajorDecade).set("formatOptionsMajorYear",e||this.formatOptionsMajorYear).set("formatOptionsMajorMonth",e||this.formatOptionsMajorMonth).set("formatOptionsMajorWeek",e||this.formatOptionsMajorWeek).set("formatOptionsMajorDay",e||this.formatOptionsMajorDay).set("formatOptionsMajorHour",e||this.formatOptionsMajorHour).set("formatOptionsMajorMinute",e||this.formatOptionsMajorMinute).set("formatOptionsMajorSecond",e||this.formatOptionsMajorSecond).set("formatOptionsMinorDecade",i||this.formatOptionsMinorDecade).set("formatOptionsMinorYear",i||this.formatOptionsMinorYear).set("formatOptionsMinorMonth",i||this.formatOptionsMinorMonth).set("formatOptionsMinorWeek",i||this.formatOptionsMinorWeek).set("formatOptionsMinorDay",i||this.formatOptionsMinorDay).set("formatOptionsMinorHour",i||this.formatOptionsMinorHour).set("formatOptionsMinorMinute",i||this.formatOptionsMinorMinute).set("formatOptionsMinorSecond",i||this.formatOptionsMinorSecond)))}setFormattingDecade(t,e){return this.withMutations((i=>(t&&(i=i.set("formatOptionsMajorDecade",t)),e&&(i=i.set("formatOptionsMinorYear",e)),i)))}setFormattingYear(t,e){return this.withMutations((i=>(t&&(i=i.set("formatOptionsMajorYear",t)),e&&(i=i.set("formatOptionsMinorMonth",e)),i)))}setFormattingMonth(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatYear",t)),e&&(s=s.set("formatOptionsMajorMonth",e)),i&&(s=s.set("formatOptionsMinorWeek",i)),s)))}setFormattingWeek(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatMonth",t)),e&&(s=s.set("formatOptionsMajorWeek",e)),i&&(s=s.set("formatOptionsMinorDay",i)),s)))}setFormattingDay(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatWeek",t)),e&&(s=s.set("formatOptionsMajorDay",e)),i&&(s=s.set("formatOptionsMinorHour",i)),s)))}setFormattingHour(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatDay",t)),e&&(s=s.set("formatOptionsMajorHour",e)),i&&(s=s.set("formatOptionsMinorMinute",i)),s)))}setFormattingMinute(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatHour",t)),e&&(s=s.set("formatOptionsMajorMinute",e)),i&&(s=s.set("formatOptionsMinorSecond",i)),s)))}setFormattingSecond(t,e,i){return this.withMutations((s=>(t&&(s=s.set("formatOptionsGreatMinute",t)),e&&(s=s.set("formatOptionsMajorSecond",e)),i&&(s=s.set("formatOptionsMinorMillisecond",i)),s)))}setFormattingMilliSecond(t,e){return this.withMutations((i=>(t&&(i=i.set("formatOptionsGreatSecond",t)),e&&(i=i.set("formatOptionsMajorMilliSecond",e)),i)))}}const Gh=(t,e)=>(i,s)=>{const r=s-i;if(e){const e=Math.log10(r/2);let n=10**Math.floor(e-t);const o=1/n;n=Math.round(n*o)/o;const h=Math.round(Math.floor(i/(10*n))*n*10*o)/o;return Hs(h,s,n,void 0,o)}const n=Math.log10(r);let o=10**Math.round(n-t);const h=1/o;return o=Math.round(o*h)/h,Zs(i,s,o,h)},Xh=(t,e,i,s,r,n)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%5==0)):void 0,Zh=(t,e,i,s,r,n)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%3==0)):2===e?t.filter(((t,e)=>e%4==0)):3===e?t.filter(((t,e)=>e%5==0)):void 0,Hh=js(void 0,2,5),Wh=(t,e,i,s,r,n)=>0===e?[t[1],t[3],t[5]]:1===e?[t[0],t[3]]:2===e?[t[1]]:void 0,jh=(t,e)=>{const i=Ti(t),s=Ri(t);if(e)return(t,e)=>{const r=[],n=Math.floor(i(t)),o=Math.ceil(i(e));for(let t=n-1;t<=o+1;t+=1){const e=s**t;r.push(e)}return r};const r=10===t?9:4;return(t,e)=>{const n=Math.round(i(t)),o=Math.round(i(e)),h=[],a=s**n,l=(s**o-a)/r;for(let i=1;i<=r;i+=1){const s=a+l*i;s>t&&sDi.LogarithmicNoExponents(e,i,void 0,t.base):Di.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Di.LogarithmicNoExponents(e,i,void 0,t.base):Di.Numeric),r=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Di.LogarithmicNoExponents(e,i,void 0,t.base):Di.Numeric),n=[],o=[];Mh(this.extremeTickStyle)||n.push({Ke:"Extreme ticks",yr:this.extremeTickStyle,Ar:void 0===e?i:(t,s,r)=>i(e+t,s,r),Gr:Xs,Ue:!0,wr:!0}),o.push({Ke:"Major ticks",Ug:0,yr:this.majorTickStyle,Ar:void 0===e?s:(t,i,r)=>s(e+t,i,r),Gr:"logarithmic"===t.type?jh(t.base,!0):Gh(0,!0),Ih:"logarithmic"===t.type?{Sr:Zh}:{Sr:Xh},Wr:void 0}),Mh(this.minorTickStyle)||o.push({Ke:"Minor ticks",Ug:1,yr:this.minorTickStyle,Ar:void 0===e?r:(t,i,s)=>r(e+t,i,s),Gr:"logarithmic"===t.type?jh(t.base,!1):Gh(1,!1),Ih:"logarithmic"===t.type?{Sr:Wh}:{Sr:Hh},Wr:50});const h=this.cursorFormatter?this.cursorFormatter:Di.Numeric;return{$e:n,Xe:o,je:void 0===e?h:(t,i,s)=>h(e+t,i,s),Ze:1e-9,Qe:void 0}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setExtremeTickStyle(t){if("function"==typeof t){const e=this.get("extremeTickStyle");return this.set("extremeTickStyle",t(e))}return this.set("extremeTickStyle",t)}getExtremeTickStyle(){return this.get("extremeTickStyle")}setFormattingOffset(t){return this.set("formattingOffset",t)}getFormattingOffset(){return this.get("formattingOffset")}setTickStyle(t){const e=this.setMajorTickStyle(t).setMinorTickStyle(t);return e.extremeTickStyle!==bh?e.setExtremeTickStyle(t):e}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setFormattingFunction(t){return this.withMutations((e=>e.set("extremeFormattingFunction",t).set("majorFormattingFunction",t).set("minorFormattingFunction",t).set("cursorFormatter",t)))}getExtremeFormattingFunction(){return this.get("extremeFormattingFunction")}setExtremeFormattingFunction(t){return this.set("extremeFormattingFunction",t)}getMajorFormattingFunction(){return this.get("majorFormattingFunction")}setMajorFormattingFunction(t){return this.set("majorFormattingFunction",t)}getMinorFormattingFunction(){return this.get("minorFormattingFunction")}setMinorFormattingFunction(t){return this.set("minorFormattingFunction",t)}}const Qh=(t,e,i="image/png",s)=>{e+=`.${i.slice(i.indexOf("image/")+6)}`;const r=t.captureFrame(i,s);if("image/png"!==i&&r.type.includes("image/png"))throw new Error(`saveToFile | type not supported by browser: ${i}\nCheck support table for HTMLCanvasElement.toDataURL`);if(wt.navigator.msSaveBlob)wt.navigator.msSaveBlob(r,e);else{const t=wt.document.createElement("a");wt.document.body.appendChild(t);const i=wt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{wt.URL.revokeObjectURL(i),wt.document.body.removeChild(t)}),0)}},qh=(t,i,s,r,n,o)=>{const h=t.tc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},Jh=(t,e)=>{if("relative"===t)return e;if(t instanceof _i)return t;const i=t.x instanceof ir?t.x.At:t.x.x,s=t.y instanceof ir?t.y.At:t.y.y;return Ni(i,s)},ta=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=xh(o)?o:Yi(o)?s:void 0;if(h&&Oi(i)){const t=ct(n,h,r.At);return r.Oo({engineX:t.x,engineY:t.y})}if(h&&Yi(i))return ct(n,h,s);if(h&&xh(i))return ct(n,h,i)}else{const i=t;if(Yi(e)){const t=r.Vo(i);return ct({x:t.engineX,y:t.engineY},r.At,s)}if(xh(e)){const t=e,s=r.Vo(i);return ct({x:s.engineX,y:s.engineY},r.At,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class ea{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.qg=[],this.tp=[],this.R=new r.Eventer,this.ip=void 0,this.sp=void 0,this.ep=void 0,this.Xt=x(0,0,0,0),this.hp=!1,this.$i=!1,this.rp=()=>{this.np=!0,this.op.xs()},this.ap=t=>e=>{const i=this.qg.indexOf(e);-1!==i&&this.qg.splice(i,1),this.ls.xs(),t.Y()},this.lp=t=>{const e=this.tp.indexOf(t);-1!==e&&this.tp.splice(e,1),this.ls.xs()},this.np=!0,this.onInViewChange=t=>this.R.on("inViewChange",t),this.offInViewChange=t=>this.R.off(t,"inViewChange"),this.mA=t,this.up=i,this.op=s,this.removePanel=n,this.Ki=e.ls.Ki;const l=e.ls.oi();if(this.uiScale=i.d2({scaleXYConstructor:Bi}).Vi(0,100).Oi(0,100).it(l),this.pg=i.d2({scaleXYConstructor:Bi}).Vi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).it(l),this.engine=e.ls.cp,this.ls=e.ls.dp,this.ss=this.ls.ss.es(this,{}),this.fp=()=>e.Ap("unidentified ui"),this.gp=e.pp(),this.yp=this.op.Pe(this.uiScale).Be(u(0,0)).it(u(100,100)).Ie(o).Fe(h).setMouseMoveEventHandler(((t,e)=>this.R.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.R.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.R.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.R.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.R.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.R.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.R.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.R.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.R.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.R.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.R.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.R.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.R.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.R.emit("touchEndPanelBackground",this,e))),a){const t=a.on(this.rp);this.mp=()=>a.off(t)}else{const t=e.ls.Do(this.rp);this.vp=e.ls.Bo.bind(e.ls,t)}const c=e.ls.Ro((t=>{this.hp=t,this.R.emit("inViewChange",this,t)}));this.Sp=e.ls.Eo.bind(e.ls,c),this.ip=n}getTheme(){return this.Ki}getSizePixels(){return this.pg.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.yp.Ie(t),this.op.xs(),this}getBackgroundFillStyle(){return this.yp.Hh()}setBackgroundStrokeStyle(t){return this.yp.Fe(t),this.op.xs(),this}getBackgroundStrokeStyle(){return this.yp.po()}translateCoordinate(t,e,i){return ta(t,e,i,this.pg,this.ls)}xp(t){return this.qg.push(t),this.ls.xs(),t}bp(t){return this.tp.push(t),this.ls.xs(),t}addUIElement(t=Oo,e=this.uiScale){e=Jh(e,this.pg);const i=this.fp();return this.xp(qh(t,i,this.uiScale,e,this.ap(i),this.Ki))}addLegendBox(t=qo,i=this.uiScale){i=Jh(i,this.pg);const s=this.bp(qh(t,this.gp,this.uiScale,i,this.lp,this.Ki));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Es.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Es.CenterBottom).setPosition(this.uiScale.pi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.tp}dispose(){return this.$i||(this.$i=!0,this.vp&&this.vp(),this.mp&&this.mp(),ia(this.uiScale),ia(this.pg),this.Sp&&this.Sp(),this.sp&&this.sp(),this.op.Y(),this.gp.Y(),this.qg.slice().forEach((t=>{t.dispose()})),this.tp.slice().forEach((t=>{t.dispose()})),this.ls.xs(),this.ip&&this.ip(this),this.R.emit("dispose",this)),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}saveToFile(t,e,i){return Qh(this.engine,t,e,i),this}zr(t){this.Xt=t,this.rp()}J(){return this.pg.J(),this.uiScale.J(),this}K(){return this.pg.K(),this.uiScale.K(),this}De(t){if(this.np){const t=this.op.ls.oi(),e=t.x,i=t.y;this.uiScale.it(e,i),this.pg.it(e,i);const s=[this.Xt.left,this.Xt.right],r=[this.Xt.bottom,this.Xt.top];this.uiScale.Ei(s),this.uiScale.zi(r);const n=this.uiScale.getInnerIntervalPixels();this.pg.Vi(0,n.x).Ei(s).Oi(0,n.y).zi(r),this.R.emit("resize",this,n.x,n.y,e,i)}this.np=!1}Mp(){for(let t=0;t{t.ii&&t.ii()};class sa extends ea{constructor(t,e,i,s,r,n){super(t,e,i,e.wp("uipanel bg",0),s,e.ls.Ki.uiPanelBackgroundFillStyle,e.ls.Ki.uiPanelBackgroundStrokeStyle,n),this._p(r,this.pg)}setMinimumSize(t){return this.Td=t,this.ls.xs(),this}getMinimumSize(){return this.Td}De(t){super.De(t),super.Mp()}}const ra=x(10,10,10,10);class na extends ea{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.Cp={},this.wa=ra,this.ah=!0,this.kp=e.Tp("chart internal ui",0),this.mh=this.kp.Or(this.uiScale).gr("Chart").Be(u(50,100)).Ya(u(0,1)).jh(h).Ie(a).setMouseInteractions(!1),this.Fp=this.ss.wg([this.mh]).Ss(this.Ki.effectsText)}setAnimationsEnabled(t){return this.ah=t,this}getAnimationsEnabled(){return this.ah}setTitle(t){return this.mh.gr(t),this.ls.xs(),this}getTitle(){return this.mh._r()}getTitleSize(){return this.mh.Ls().td()}setTitleFillStyle(t){return this.mh.Ie(t),this.rp(),this}getTitleFillStyle(){return this.mh.Hh()}setTitleFont(t){return this.mh.jh(t),this.rp(),this}getTitleFont(){return this.mh.Xh()}setTitleRotation(t){return this.mh.Zh(t),this.ls.xs(),this}getTitleRotation(){return this.mh.Qh()}setTitleEffect(t){return this.Fp.Ss(t),this.ls.xs(),this}getTitleEffect(){return this.Fp.bs()}setTitleMargin(t){var e,i;return this.Cp="object"==typeof t?this.Cp?(e=this.Cp,{left:void 0!==(i=t).left?i.left:e.left,top:void 0!==i.top?i.top:e.top,right:void 0!==i.right?i.right:e.right,bottom:void 0!==i.bottom?i.bottom:e.bottom}):t:{left:t,top:t,right:t,bottom:t},this.rp(),this}getTitleMargin(){return this.Cp}setPadding(t){return this.wa="object"==typeof t?S(this.wa,t):{left:t,top:t,right:t,bottom:t},this.rp(),this}getPadding(){return this.wa}Ip(t){const e=t.Pp(),i=null==e?void 0:e.height,s=null==e?void 0:e.width;if(void 0!==i&&void 0!==s)return{x:i/2,y:s/2}}dispose(){return super.dispose(),this.kp.Y(),this}}const oa={Dp:(t,e)=>t.Hh()!==B&&0!==t._r().length&&t.getVisible()?t.Ls().td().y:0,Bp(t,e){t.Be(u(50,100)).zr({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}},ha=t=>"show-all-interpolated"===t||"show-nearest-interpolated"===t||"show-pointed-interpolated"===t,aa=(t,e)=>{const i="series"in t?t.series:void 0;if(!i||!("getCursorFormattingOverride"in i))return e;const s=i.getCursorFormattingOverride();return s?s(t,e):e},la=(t,e,i,s,n,o,h)=>{let a,l,u=n,c=o,d=null,f=!0;const g=new r.Eventer;if(s){f=!1;const e=()=>{f=!0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},i=()=>{t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},r=()=>{f=!1,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},n=()=>{f=!0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},o=()=>{t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())},h=()=>{f=!1,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())};s.onSeriesBackgroundMouseEnter(e),s.onSeriesBackgroundMouseMove(i),s.onSeriesBackgroundMouseLeave(r),s.onSeriesBackgroundTouchStart(n),s.onSeriesBackgroundTouchMove(o),s.onSeriesBackgroundTouchEnd(h),s.Lp(((e,i)=>{i.onMouseEnter(((e,s,r)=>{i.getCursorEnabled()?(a=r||void 0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())):l||t.ls.xs()})),i.onMouseMove(((e,s,r)=>{i.getCursorEnabled()?(a=r||void 0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())):l||t.ls.xs()})),i.onMouseLeave((()=>{i.getCursorEnabled()?(a=void 0,t.getCursorMode()&&(l&&y?m.De(...y):t.ls.xs())):l||t.ls.xs()}))}))}let y;const m={setCursor:e=>(e(i),t),getCursor:()=>i,setCursorMode:e=>(u=e,t.ls.xs(),t),getCursorMode:()=>u,setCustomCursor:t=>{l=t},onCursorTargetChanged:t=>g.on("cursorTargetChanged",t),offCursorTargetChanged:t=>{g.off(t)},setCursorFormatting:e=>(c=e,t.ls.xs(),t),getCursorFormatting:()=>c,Y:()=>{i.dispose(),e.Y()},De:(e,s,r,n)=>{y=[e,s,r,n];const o=t.ls.Hn();let m=[];if((null==n?void 0:n.explicitTarget)&&u)m=[n.explicitTarget];else if(!e&&u){const t=s.find((t=>t.getIsUnderMouse())),e=o&&t&&t.getCursorEnabled&&t.getCursorEnabled()&&t.ys?t.ys(o):void 0;if(a=e||a,a&&"show-all"!==u&&"show-all-interpolated"!==u)m=[a];else if("show-all"===u||"show-all-interpolated"===u||"show-nearest"===u||"show-nearest-interpolated"===u){if((f||void 0!==t)&&o&&r){for(const t of s){if(t.getCursorEnabled&&!t.getCursorEnabled()||!t.getVisible())continue;const e=r(t,o,u);e&&m.push(e)}"show-nearest"!==u&&"show-nearest-interpolated"!==u||(m.sort(((t,e)=>h(t,o)-h(e,o))),m.length=1)}}else if(("show-pointed"===u||"show-pointed-interpolated"===u)&&o&&t&&t.getCursorEnabled&&t.getCursorEnabled()&&r){const e=r(t,o,u);e&&(m=[e])}}m=ve(m.map((t=>Le(t))));const p=(null==n?void 0:n.overrideCursorPositions)||((t,e)=>e),x=m[0],A=m.length>0?m:void 0;if(x!==d&&o&&(l&&l(x,A,o),g.emit("cursorTargetChanged",x,A,o),d=x),l)i.getVisible()&&(i.setVisible(!1),i.Ls().De());else{if(m&&m.length>0){const e=c(t,m[0],m);i.setVisible(!0).setPosition(...p(m,m.map((t=>t.cursorPosition)))).setResultTable((t=>t.setContent(e)))}else i.setVisible(!1);(null==n?void 0:n.afterCursorPointedAt)&&n.afterCursorPointedAt(m),i.Ls().De()}},solveNearest:(e,i,s,r)=>{const n=e||t.ls.Hn();if(!n)return[];let o=[];if("show-all"===i||"show-all-interpolated"===i||"show-nearest"===i||"show-nearest-interpolated"===i){for(const t of s){if(!t.getCursorEnabled()||!t.getVisible())continue;const e=r(t,n,i);e&&o.push(e)}"show-nearest"!==i&&"show-nearest-interpolated"!==i||(o.sort(((t,e)=>h(t,n)-h(e,n))),o.length=1)}return o=ve(o.map((t=>Le(t)))),o},Rp:i};return m};class ua{constructor(t,e){this.Ep=t,this.zp=e}alter(t){this.Vp=void 0!==this.Vp?this.Vp:this.zp(),this.Op=t,this.Ep(t)}resetValue(){void 0!==this.Op&&(void 0!==this.Vp&&this.isAltered()&&this.Ep(this.Vp),this.Vp=void 0,this.Op=void 0)}getNormalValue(){return void 0!==this.Vp?this.Vp:this.zp()}isAltered(){return void 0!==this.Op&&this.zp()===this.Op}}class ca{constructor(t,e){this.Np=[],this.Gp=t,this.At=e}update(){return this.Gp.getVisible()?!(this.Wp()&&(!this.Yp()||(this.resetTable(),this.Gp.Ls(),this.Wp()))&&(this.Hp(),this.Gp.Ls(),this.Wp()&&(this.resetTable(),this.Gp.Ls(),1))):(this.Yp()&&this.resetTable(),!0)}Yp(){for(let t=0;t{const s=ct(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ct(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.Gp,this.At)}$p(){return((t,i)=>{const s=ct(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ct(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.Gp,this.At)}Xp(){return((t,i)=>{const s=ct(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=ct(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.Gp,this.At)}jp(t){return this.Np.push(t),t}}class da extends ca{constructor(){super(...arguments),this._a=this.jp(new ua((t=>this.Gp.setOrigin(t)),(()=>this.Gp.getOrigin())))}Hp(){const t=this._a.getNormalValue(),e=u(this.$p()?-t.x:t.x,this.Xp()?-t.y:t.y);this._a.alter(e)}}class fa extends ca{constructor(t,e,i,s){super(t,e),this.Zp=this.jp(new ua((t=>this.Gp.setTextFont((e=>e.setSize(t)))),(()=>this.Gp.getTextFont().getSize()))),this.Qp=i,this.Jp=s}Hp(){const t=this.Zp.getNormalValue(),e=this.Qp;if(enew da(t,e),FontSize:(t=5,e=5)=>(i,s)=>new fa(i,s,t,e)},ya={None:Ln,Rectangle:Ao,Circle:So,Diamond:vo,Pointer:bo};class ma extends Io{constructor(){super(...arguments),this.Hu=this.Ki.cursorResultTableTextFont,this.Vd=0,this.Kp=this.Ki.cursorResultTableTextFillStyle}setContent(t){let e;void 0===t?e=[]:Array.isArray(t)?(e=[],t.forEach((t=>{e.push(Array.isArray(t)?t:[t])}))):e=[[t]];for(let t=0;t0||n||o)){s=!0;break}}s||(i.unshift(""),i.push(""))}const i=e.length;let s=this.getMembers().length;for(let t=0;t=i)this.getMembers()[t].dispose(),t-=1,s-=1;else{const i=e[t].length;let s=n.getMembers().length;for(let o=0;o=i)n.getMembers()[o].dispose(),o-=1,s-=1;else if(void 0!==u&&u.length>0||c||d){const t=a?this.Hu.withMutations((t=>{for(const e of Object.keys(a)){const i=a[e];void 0!==i&&t.set(e,i)}return t})):this.Hu,e=l||this.Kp,i=f[o];if(u){let s;i&&i instanceof po?s=i:(i&&i.dispose(),s=n.addElement(xo,o)),s.setFont(t).setFillStyle(e).setText(u).setTextRotation(this.Vd)}else if(c){let s;i&&i instanceof Mo?s=i:(i&&i.dispose(),s=n.addElement(wo,o)),s.setFillStyle(e).setShape(c).setSize({y:t.size,x:t.size}),s.setMargin(5)}else if(d){let t;i&&"setTextFillStyleHidden"in(r=i)&&"setText"in r?t=i:(i&&i.dispose(),t=n.addElement(Xo.setBackground(ya.None),o).setOn(!0));const e=d.Fs();void 0!==e&&t.setButtonShape(e),t.setText(d.getName()),d.styleLegendEntry(t)}}else{const t=f[o];t&&t instanceof Co||(t&&t.dispose(),n.addGap(void 0,o))}}}}var r;return this.Is.xs(),this}setTextFillStyle(t){this.Kp="function"==typeof t?t(this.Kp):t;for(let t=0;tt.setFillStyle(o.cursorResultTableFillStyle).setStrokeStyle(o.cursorResultTableStrokeStyle))).setTextFillStyle(o.cursorResultTableTextFillStyle).setTextFont(o.cursorResultTableTextFont),this.oy=ga.Flip(this.Gp,this.scale)}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t)}setPointMarkerVisible(t){return this.iy=t,this.ty.forEach((e=>e.pointMarker.setVisible(e.targetVisible&&t))),this.Is.xs(),this}getPointMarkerVisible(){return this.iy}setPointMarker(t){return this.ty.forEach((e=>t(e.pointMarker))),this.ey.push(t),this.Is.xs(),this}setResultTableVisible(t){return this.sy=t,this.Is.xs(),this}getResultTableVisible(){return this.sy}setResultTable(t){return t(this.Gp),this.Is.xs(),this}setAutoFitStrategy(t){return this.oy&&this.oy.resetTable(),this.oy=t?t(this.Gp,this.Is.ls.At):void 0,this.Is.xs(),this}getAutoFitStrategy(){return void 0!==this.oy}setVisible(t){return this.Xi=t,this.Is.xs(),this}getVisible(){return this.Xi}dispose(){return this.ty.forEach((t=>t.pointMarker.dispose())),this.Gp.dispose(),this.ey.length=0,this.hy(this),this.R.emit("dispose"),this}De(){return this.oy&&this.oy.update(),this.Gp.setVisible(this.hp&&this.Xi&&this.sy),this.ty.forEach((t=>t.pointMarker.setVisible(t.targetVisible&&this.hp&&this.Xi&&this.iy))),this.ty.forEach((t=>t.pointMarker.De())),this.Gp.De(),this}Ls(){return this.ty.forEach((t=>t.pointMarker.Ls())),this.Gp.Ls(),this}ly(t,e){const i=e===this.scale?t:ct(t,e,this.scale);this.Gp.setPosition(i)}}const xa=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5)));class Aa extends pa{constructor(){super(...arguments),this.ma={x:0,y:0}}setPosition(t){const e=this.renderingScale,i=Jh(t.resultTableScale,e),s=i===this.scale?t.resultTable:ct(t.resultTable,i,this.scale),r=Jh(t.pointMarkerScale,e),n=r===this.scale?t.pointMarker:ct(t.pointMarker,r,this.scale);this.ma=n;let o=this.ty[0];if(!o){const t=new Mo(this.Is,this.renderingScale,this.scale,kt,this.Ki).setMouseInteractions(!1).setFillStyle(this.Ki.cursorPointMarkerFillStyle).setSize(this.Ki.cursorPointMarkerSize).setShape(this.Ki.cursorPointMarkerShape);o={pointMarker:t,targetVisible:!0},this.ty.push(o),this.ey.forEach((e=>e(t)))}return o.pointMarker.setPosition(n),this.Gp.setPosition(s),this.Is.xs(),this}Ls(){return super.Ls(),this.hp=((t,e,i=e)=>{const s=e!==i?ct(t,e,i):t;return s.x>=i.x.getInnerStart()&&s.x<=i.x.getInnerEnd()&&s.y>=i.y.getInnerStart()&&s.y<=i.y.getInnerEnd()})(this.ma,this.scale),this}}class Sa{constructor(t,e=[]){this.uy=[],this.Ay=(t,e)=>(this.uy.forEach((i=>i(t,e))),t),this.addStyler=t=>new Sa(this.ny,this.uy.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new Sa(t,this.uy.map((t=>t))),this.gy=(t,e,i,s,r)=>this.Ay(new Aa(t,e,i,s,this.ny,r),r),this.ny=t,this.uy=e}}const va=new Sa(Ao,[xa]),ba=new Sa(bo,[xa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof bo&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),Ma=va,wa=va,Ca=va,Ta=ba,Ra=new Sa(Ao,[xa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(Es.LeftBottom)))]);var Ea;e.SliceLabelIndices=void 0,(Ea=e.SliceLabelIndices||(e.SliceLabelIndices={}))[Ea.LabelsInsideSlices=0]="LabelsInsideSlices",Ea[Ea.LabelsOnSides=1]="LabelsOnSides";const ka={SortByName:(t,e)=>t.getName().localeCompare(e.getName(),void 0,{numeric:!0}),SortByValueAscending:(t,e)=>t.getAnimatedValue()-e.getAnimatedValue(),SortByValueDescending:(t,e)=>e.getAnimatedValue()-t.getAnimatedValue(),None:()=>0},Ia={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class Fa extends Zi{constructor(){super(...arguments),this._s="Slice",this.M=0}}const Da=(t,e)=>{Qt(e),t.setExploded(!t.getExploded())};class Pa extends Fa{}class La extends Pa{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.py=!1,this.yy=B,this.my=B,this.vy=this.M,this.Sy=this.py?1:0,this.xy=this.getVisible(),this.by=K((()=>this.chart.ls.xs())),this.My=K((()=>this.chart.ls.xs())),this._y=()=>{this.wy=void 0},this.Cy=()=>{this.ky=void 0},this.index=t,this.chart=s,this.scale=r,this.Ji=n,this.Ty=e.hd(r).us(this.getHighlight()),this.ds(this.Ty),this.Ke=i.Or(r).us(this.getHighlight()),this.ds(this.Ke,{isText:!0}),this.onMouseClick(Da),this.onTouchEnd(Da)}setValue(t){return this.chart.getAnimationsEnabled()?this.xy&&this.Fy(this.vy,t):this.vy=t,this.M=t,this.chart.ls.xs(),this}getValue(){return this.M}setExploded(t){if(t&&!1===this.chart.getMultipleSliceExplosion()){const t=this.chart.getSlices();for(let e=0;e{this.Sy=t,this.chart.ls.xs()})),this.ky.onEveryAnimationEnd(this.Cy),this.py=!this.py):!1!==this.chart.getMultipleSliceExplosion()||t?(this.Sy=this.py?0:1,this.py=!this.py):(this.Sy=0,this.py=!this.py),this.chart.ls.xs(),this}getExploded(){return this.py}setVisible(t){return this.xy=t,!1===t?this.chart.getAnimationsEnabled()&&this.vy>0?(this.wy&&(this.wy.finish(!1),this.wy=void 0),this.Fy(this.vy,0,(()=>super.setVisible(!1)))):(this.vy=0,super.setVisible(!1)):this.chart.getAnimationsEnabled()?(this.wy&&(this.wy.finish(!1),this.wy=void 0),super.setVisible(!0),this.Fy(this.vy,this.M)):(this.vy=this.M,super.setVisible(!0)),this}Fy(t,e,i){this.wy=this.by(300,W.ease)([[t,e]],(([t])=>{this.vy=t,this.chart.ls.xs()})),this.wy.onEveryAnimationEnd(this._y),i&&this.wy.onAnimationEnd(i)}setStyle(t,e,i,s){this.yy=t,this.my=i,this.Ty.Ie(this.yy).Fe(e),this.Ke.Ie(this.my).jh(s);for(let t=0;tui(e,li(Si(.5*(t.eu()+t.Ti())*Math.PI/180),i)),_a=(t,e,i,s,r,n)=>{const o=t.length;let h=90;for(let a=0;a{const e=t.getSlices();for(let t=0;t{const e=this.Iy.indexOf(t);e>=0&&(this.Iy.splice(e,1),this.Uy())},this.ls.Xn(dh.Af),this.Yy=e.Hy("pieChart bottom",0),this.$y=e.Hy("pieChart top",1),this.mh.gr("Pie Chart"),this._p(r,this.pg),this.onBackgroundMouseDoubleClick(Ba);const h=ji(new Ki(Ba));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd);const a=e.Xy(),l=Pt(o?o.cursorBuilder:void 0,wa);this.jy=la(this,a,l.gy(a,this.uiScale,this.uiScale,kt,this.Ki),void 0,"show-pointed",Na,(()=>0)),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled))}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=wa){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}addSlice(t,e){const i=new La(this.zy,this.Yy,this.$y,this,this.pg,this.Wy,this.Ki,this.ls.ss);this.zy+=1,i.setName(t);const s=this.ah;return this.ah=!1,i.setValue(e),this.ah=s,i.setEffect(this.Ny),this.Zy(i),this.Iy.push(i),this.Uy(),i.setHighlightOnHover(this.Ly),i.onMouseMove((()=>{this.getCursorMode()&&this.ls.xs()})),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.Ss(t))),this.ls.xs(),this}getSliceEffect(){return this.Ny}setSliceSorter(t){return this.Py=t,this.Iy=this.Iy.sort(this.Py),this.ls.xs(),this}getSliceSorter(){return this.Py}setLabelFillStyle(t){this.Ey="function"==typeof t?t(this.Ey):t;for(let t=0;te.ss.hs.Ss(t))),this.ls.xs(),this}getLabelEffect(){return this.Gy}setLabelFormatter(t){return this.Qy=t,this.ls.xs(),this}getLabelFormatter(){return this.Qy}setSliceHighlightOnHover(t){return this.Ly=t,this.Iy.forEach((e=>e.setHighlightOnHover(t))),this}De(t){super.De(t),oa.Bp(this.mh,this.Cp),super.Mp();const e=oa.Dp(this.mh,this.Cp),i=u(this.pg.x.getInnerInterval()-(this.wa.left+this.wa.right),this.pg.y.getInnerInterval()-(this.wa.bottom+this.wa.top+e)),s=u(this.wa.left+i.x/2,this.wa.bottom+i.y/2);if(this.$d){const t=this.$d;this.Iy.forEach((e=>{this.Zy(e,new U({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Iy[t].Ty.setVisible(e),this.Iy[t].Ke.setVisible(e)}this.Iy=this.Iy.sort(this.Py);const r=this.Iy.filter((t=>t.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;t{const s=o[r.indexOf(t)]||0,n=this.ls.Vo(e);return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.ls.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.ls.At},slice:t,category:t.getName(),value:t.getValue(),relativeValue:s}})),this.Jy(r,o,s,i)}Zy(t,e=this.Dy(t.index,t)){t.setStyle(e,this.By,this.Ey,this.Ry)}Uy(){this.Iy=this.Iy.sort(this.Py),this.ls.xs()}if(){return this.Iy}dispose(){return super.dispose(),this.Iy.slice().forEach((t=>t.dispose())),this.jy.Y(),this.$y.Y(),this.Yy.Y(),this}}const Na=(t,e,i)=>[[e.slice],[{text:e.value.toString(),font:{weight:"bold"}}]],Oa={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Ua=(...t)=>{const e=[];return t.forEach((t=>{var i;t&&"object"==typeof(i=t)&&i&&"pattern"in i&&e.push({type:"DataPattern",args:t})})),e};class Ya extends za{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Qy=Ia.NamePlusValue,this.Ky=[],this.qy=40,this.tm=5,this.im=10,this.sm=this.Ki.pieChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.sm=t;for(let t=0;tt.Ke.setVisible(!1))),this.Ky.forEach((t=>t.setVisible(!1)))}else{_a(t,e,i,u,this.Ql,a);let s=90;const r=t.map(((t,r)=>{const h=360*e[r],a=s-h,l=Si(xi(.5*(s+a))),c=l.x>=0?-1:1,d=ui(ui(i,li(l,u+n)),{x:c*-o,y:0});s=a;const f={x:c,y:0};t.Ke.Be(d).Ya(f),t.Ke.Ls();const g=Je(t.Ke.Je());return{position:d,alignment:f,shape:t.Ke,boundaries:g,sliceAngleVec:l,slice:t}})),l=[];for(let t=0;t{const s=t.slice.Ty,r=Va(s,i,u+h+a*t.slice.getAnimatedExplosion()),n=pi(t.position.y,r,i),o=t.position;this.hm([r,n,o])}))}}getMinimumSize(){return u(500,300)}hm(t){let e;for(let t=0;t{if(ts(t)){const e=t.getThickness(),i=t.getFillStyle();if(Y(i))return 1===e?dr:new gr({size:e,fillStyle:i,shape:"sphere"})}return dr};class Ha{constructor(t,e,i,s,n,o,h,a,l,u){this.R=new r.Eventer,this.M=0,this.Xi=!0,this.$i=!1,this.xs=t,this.om=e,this.am=i,this.lm=s,this.um=n,this.dm=o,this.Vd=h,this.Kp=a,this.fm=l,this.sc=u}setValue(t){return t===this.M||(this.M=t,this.xs(),this.R.emit("valueChange",this,this.M)),this}getValue(){return this.M}setTickStyle(t){return this.am="function"==typeof t?t(this.am):t,this.xs(),this}getTickStyle(){return this.am}setTickLength(t){return this.lm=t,this.xs(),this}getTickLength(){return this.lm}setGridStrokeStyle(t){return this.um="function"==typeof t?t(this.um):t,this.xs(),this}getGridStrokeStyle(){return this.um}setTextPadding(t){return this.dm=t,this.xs(),this}getTextPadding(){return this.dm}setTextRotation(t){return this.Vd=t,this.xs(),this}getTextRotation(){return this.Vd}setTextFillStyle(t){return this.Kp="function"==typeof t?t(this.Kp):t,this.xs(),this}getTextFillStyle(){return this.Kp}setTextFont(t){return this.fm="function"==typeof t?t(this.fm):t,this.xs(),this}getTextFont(){return this.fm}setTextFormatter(t){return this.sc=t,this.xs(),this}onValueChange(t){return this.R.on("valueChange",t)}offValueChange(t){return this.R.off(t,"valueChange")}dispose(){return this.$i||(this.$i=!0,this.om(),this.xs(),this.R.emit("dispose",this)),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&(this.R.emit("visibleStateChanged",this,this.Xi),this.xs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.R.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.R.off(t,"visibleStateChanged")}}class Wa extends Ha{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,a,l),this.Am=u,this.gm=c,this.wa=d}setBackgroundFillStyle(t){return this.Am="function"==typeof t?t(this.Am):t,this.xs(),this}getBackgroundFillStyle(){return this.Am}setBackgroundStrokeStyle(t){return this.gm="function"==typeof t?t(this.gm):t,this.xs(),this}getBackgroundStrokeStyle(){return this.gm}setPadding(t){return this.wa="number"==typeof t?{left:t,top:t,right:t,bottom:t}:{...this.wa,...t},this.xs(),this}getPadding(){return this.wa}}class ja{constructor(t,e,i,s){this.pm=[],this.ym=new Map,this.vm=t,this.Sm=e,this.xm=i,this.bm=s}Mm(){this.xm&&this.xm();const t=[];return{add:(e,i)=>{t.push({instanceUniqueProperties:e,instanceSharedProperties:i})},finishPlot:()=>{const e=[];let i=[];t.forEach((t=>{const i=e.find((e=>((t,e)=>{const i=Object.keys(t);for(const s of i)if(t[s]!==e[s])return!1;return!0})(e.sharedProperties,t.instanceSharedProperties)));i?i.instances.push(t.instanceUniqueProperties):e.push({sharedProperties:t.instanceSharedProperties,instances:[t.instanceUniqueProperties]})}));const s=this.pm.slice(),r=[];e.forEach((t=>{let e=s.pop();e||(e=this.vm(),this.pm.push(e));const n=[],o=e._m().slice();t.instances.forEach(((t,e)=>{const i=o.shift();n.push({...t,existingMember:i})}));const h=this.Sm(e,n,t.sharedProperties);i=he(i,h,{canReturnB:!0});for(let i=0;i{null==e||e.kd(t)}))})),s.forEach((t=>{t.dispose();const e=this.pm.indexOf(t);e<0?pe(0,(()=>{})):this.pm.splice(e,1)})),r.forEach((t=>{const e=this.ym.get(t.Xo);e&&t.collection.ls.oo({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.ym.clear(),r.forEach((t=>{this.ym.set(t.Xo,t)})),this.bm&&this.bm(this.pm,i)}}}wm(){this.pm.forEach((t=>{t.dispose()})),this.pm.length=0}}class Ka{constructor(t){this.Cm=[],this.km=t}Mm(){return this.Tm(),{add:()=>this.al(),finishPlot:()=>{this.Fm()}}}al(){let t=this.Cm.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.km()},this.Cm.push(t)),t.isFree=!1,t.shape}Tm(){this.Cm.forEach((t=>{t.isFree=!0}))}Fm(){this.Cm.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.Cm.splice(this.Cm.indexOf(t),1)}))}wm(){this.Cm.forEach((t=>t.shape.dispose())),this.Cm.length=0}}class $a extends ir{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Im({x:t.ls.Ki.xAxis3DNumericTicks,y:t.ls.Ki.yAxis3DNumericTicks,z:t.ls.Ki.zAxis3DNumericTicks}),datetime:e.Im({x:t.ls.Ki.xAxis3DDateTimeTicks,y:t.ls.Ki.yAxis3DDateTimeTicks,z:t.ls.Ki.zAxis3DDateTimeTicks}),time:e.Im({x:t.ls.Ki.xAxis3DTimeTicks,y:t.ls.Ki.yAxis3DTimeTicks,z:t.ls.Ki.zAxis3DTimeTicks})},{type:"linear"}),this.Lf=[],this.Pm=()=>{},this.Dm=()=>{},this.Bm=()=>{},this.Lm=()=>{},this.chart=t,this.Rm=r,this.Em=n,this.zm=o,this.Vm=this.Rm.At;const l=this.Lh.Im({x:this.Ki.xAxis3DStrokeStyle,y:this.Ki.yAxis3DStrokeStyle,z:this.Ki.zAxis3DStrokeStyle});this.Om=this.Rm.rm([Oa.InternalUI]).Oe(l).Nm(Za(l)).setMouseInteractions(!1),this.bh=this.Em.Or(this.zm).setMouseInteractions(!1).Ie(e.Im({x:t.ls.Ki.xAxis3DTitleFillStyle,y:t.ls.Ki.yAxis3DTitleFillStyle,z:t.ls.Ki.zAxis3DTitleFillStyle})).jh(e.Im({x:t.ls.Ki.xAxis3DTitleFont,y:t.ls.Ki.yAxis3DTitleFont,z:t.ls.Ki.zAxis3DTitleFont})).ra(3),this.Gm=new Ka((()=>this.Em.Or(this.zm).ra(2).Vr(Ie).zr(Ie))),this.Wm=new ja((()=>this.Em.Um(this.zm).setMouseInteractions(!1).ra(1)),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((({positions:e,existingMember:i})=>{const s=i||t.Hr();return s._l(e),s}))))),this.Ym=new ja((()=>this.Rm.Wg().setMouseInteractions(!1)),((t,e,i)=>(t.Ot().Oe(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t.dl(e)))))),this.ss=a,this.Jh=this.ss.wg([this.bh]).Ss(s.effectsText),this.Om.setMouseEnterEventHandler(this.Pm).setMouseLeaveEventHandler(this.Dm).setMouseDragEventHandler(this.Bm).setMouseDragStopEventHandler(this.Lm),i.ag=this}setTickStrategy(t,e){return super.Vh(t,e)}getTickStrategy(){return this.ih}addCustomTick(){const t=new Wa((()=>this.chart.ls.xs()),(()=>{const e=this.Lf.indexOf(t);e>=0&&this.Lf.splice(e,1)}),this.Ki.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.Ki.xAxis3DNumericTicks.majorTickStyle.tickLength,this.Ki.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.Ki.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.Ki.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.Ki.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.Ki.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)),B,nt,{left:4,right:4,top:4,bottom:4});return this.Lf.push(t),this.chart.ls.xs(),t}setStrokeStyle(t){return this.Om.Oe(t).Nm(Za(this.Om.pu())),this.chart.ls.xs(),this}getStrokeStyle(){return this.Om.pu()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.Om.setVisible(t),!1===t&&(this.Ym.wm(),this.Gm.wm(),this.Wm.wm()),this.Rm.xs(),this}Dg(){return this.chart.getSeries()}Hm(t){return Math.abs(this.At.st(t)*this.Rm.$m(1))}Lr(t,e,i){const s=Math.abs(this.At.st(e-t)*this.Rm.$m(1));return{min:t-i*s,max:e+i*s}}mr(t,e){const i=new Qa(e,t,this.Em,this.zm,this.Rm);return i.Ke.ra(0),i}vr(t,e){const i=this.Xm(e,t.M,t.Fh.yr.tickLength,t.Fh.yr.tickPadding);return t.Ke.Be(i.labelPosition).Ya(i.labelAlignment),i}Xm(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.At.getInnerStart())/(this.At.getInnerEnd()-this.At.getInnerStart()),c=_e.addVec(qe(n,o,l),_e.multiplyVec(_e.multiply(h,this.Rm.$m(.5*this.Om.pu().getThickness())),r)),d=_e.addVec(c,_e.multiplyVec(_e.multiply(h,this.Rm.$m(i)),r)),f=this.Rm.jm(d)||u(0,0);return{labelPosition:ui(ct(f,this.chart.ls.At,this.zm),li(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}Zm(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.At.getInnerStart())/(this.At.getInnerEnd()-this.At.getInnerStart()),a=_e.addVec(qe(r,n,h),_e.multiplyVec(_e.multiply(o,this.Rm.$m(.5*this.Om.pu().getThickness())),s)),l=_e.addVec(a,_e.multiplyVec(_e.multiply(o,this.Rm.$m(10)),s)),c=this.Rm.jm(a)||u(0,0),d=this.Rm.jm(l)||u(0,0);return this.Em.Ne(this.zm).We(c).Ge(d).Oe(new Ji({fillStyle:new U({color:T(120*i)}),thickness:1}))}Dr(t,e){return qa(t,e,this.At)}De(t){if(!this.Xi)return;const e=Math.min(this.Oh,this.Nh),i=Math.max(this.Oh,this.Nh),s=this.Vm,r=f(s.x.rt(),s.y.rt(),s.z.rt());let n,o;this.Qm()?(n=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerStart()),o=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerEnd())):(n=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),o=this.Lh.Jm(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.Lh.ef,a=this.Rm.jm(n)||u(0,0),l=this.Rm.jm(o)||u(0,0),c=qe(n,o,.5),d=_e.addVec(c,_e.multiplyVec(_e.multiply(h,-1),r)),g=this.Rm.jm(c)||u(0,0),y=this.Rm.jm(d)||u(0,0),m=oi(ci(ct(g,this.chart.ls.At,this.zm),ct(y,this.chart.ls.At,this.zm)));this.Om.Ot().dl([n,o]);const{gridlinePositionA:p,gridlinePositionB:x,gridlinePositionC:A}=this.Lh.Km(t),S=t=>({x:-1===t.x?this.Vm.x.getInnerStart():1===t.x?this.Vm.x.getInnerEnd():0,y:-1===t.y?this.Vm.y.getInnerStart():1===t.y?this.Vm.y.getInnerEnd():0,z:-1===t.z?this.Vm.z.getInnerStart():1===t.z?this.Vm.z.getInnerEnd():0}),v=S(p),b=S(x),M=S(A),w={physicalAxisSize:ai(ci(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:m,gridlinePositionA:v,gridlinePositionB:b,gridlinePositionC:M},C=this.rr(w),T=this.Ym.Mm();for(const[t,e]of this.sh)for(const[,i]of e){const e=C.get(i);if(!e)continue;const s=this.qm(w,e);T.add({Xo:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.yr.tickStyle}),s.gridStroke&&T.add({Xo:0,positions:s.gridStroke},{lineStyle:t.yr.gridStrokeStyle})}const R=this.Gm.Mm(),E=this.Wm.Mm(),k={x:0,y:0};this.Lf.forEach((t=>{if(!t.Xi||t.Mi)return;const s=this.Xm(w,t.M,t.lm,t.dm),r=this.qm(w,s);if(t.Kp!==B){const e=R.add().Be(s.labelPosition).Ya(s.labelAlignment).Ie(t.Kp).jh(t.fm).gr(t.sc(t.M)).Zh(t.Vd),i=e.Ls().oi();if(k.x=Math.max(k.x,i.x),k.y=Math.max(k.y,i.y),t.Am!==B){const i=e.Je(),s=[{x:i[0].x-t.wa.left,y:i[0].y+t.wa.top},{x:i[1].x+t.wa.right,y:i[1].y+t.wa.top},{x:i[2].x+t.wa.right,y:i[2].y-t.wa.bottom},{x:i[3].x-t.wa.left,y:i[3].y-t.wa.bottom}];E.add({Xo:0,positions:s},{fillStyle:t.Am,strokeStyle:t.gm})}}T.add({Xo:0,positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.am}),r.gridStroke&&T.add({Xo:0,positions:r.gridStroke},{lineStyle:t.um})})),R.finishPlot(),E.finishPlot(),T.finishPlot();const I=this.Mr(((t,e)=>{const i=e.Ke.oi();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:k.x,y:k.y}),F=Math.atan((l.y-a.y)/(l.x-a.x));this.bh.Ya({x:0,y:0}).Zh(180*-F/Math.PI);const D=_e.addVec(c,_e.multiplyVec(_e.multiply(h,this.Rm.$m(.5*this.Om.pu().getThickness()+this.Cr(((t,e)=>Math.max(t,e.tickLength)),0))),r)),P=this.Rm.jm(D)||u(0,0),L=ui(ct(P,this.chart.ls.At,this.zm),ui(ui(di(I,m),li(m,this.Cr(((t,e)=>Math.max(t)),0))),di(li(this.bh.Ls().oi(),.5),m)));this.bh.Be(L),this.Om.tv={overrideFollowing:!1,skipMousePicking:!1}}qm(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return It(h,0)||It(h,1)||(a=[this.sv()?{...i,x:n.x}:this.ev()?{...i,y:n.y}:this.Qm()?{...i,z:n.z}:{x:0,y:0,z:0},this.sv()?{...s,x:n.x}:this.ev()?{...s,y:n.y}:this.Qm()?{...s,z:n.z}:{x:0,y:0,z:0},this.sv()?{...r,x:n.x}:this.ev()?{...r,y:n.y}:this.Qm()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}Kh(){super.Kh(),this.Ym.wm(),this.Gm.wm(),this.Wm.wm()}sv(){return this.Lh.sv()}ev(){return this.Lh.ev()}Qm(){return this.Lh.Qm()}}class Qa extends sr{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.hv=r}}const qa=(t,e,i)=>Ft(t+.1*(e-t)+Math.abs(i.rt())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),Ja=(t,e,i,s)=>({kr:()=>{const i=t();let s;for(const t of i){if(!t.rv())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},Tr:()=>{const e=t();let s;for(const t of e){if(!t.rv())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Ir:()=>{const e=t();let i;for(const t of e){if(!t.rv())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),tl=t=>({...Ja(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Ir().y)),Im:t=>t.y,Jm:(t,e)=>({x:e.x,y:t.y,z:e.z}),ef:f(-1,0,0),Km:t=>{const e={x:t.x>=0?1:-1,y:t.y>=0?1:-1,z:t.z>=0?1:-1};return{gridlinePositionA:f(e.x,0,e.z),gridlinePositionB:f(e.x,0,-e.z),gridlinePositionC:f(-e.x,0,-e.z)}},sv:()=>!1,ev:()=>!0,Qm:()=>!1}),el=t=>({...Ja(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Ir().z)),Im:t=>t.z,Jm:(t,e)=>({x:e.x,y:e.y,z:t.z}),ef:f(1,0,0),Km:t=>{const e={x:t.x>=0?1:-1,y:t.y>=0?1:-1,z:t.z>=0?1:-1};return{gridlinePositionA:f(e.x,-e.y,0),gridlinePositionB:f(e.x,e.y,0),gridlinePositionC:f(-e.x,e.y,0)}},sv:()=>!1,ev:()=>!1,Qm:()=>!0});class il extends Zi{constructor(t,e,i,s,r){super(t,e,s,r),this.nv=jn,this.ov=!0,this.av=!0,this.lv=!0,this.chart=t,this.Rm=i,this.qi=new Map,this.onMouseWheel(this.chart.uv),this.onMouseDrag(this.chart.cv),this.onMouseDragStop(this.chart.dv),this.onTouchStart(this.chart.fv.onTouchStart),this.onTouchMove(this.chart.fv.onTouchMove),this.onTouchEnd(this.chart.fv.onTouchEnd)}Qi(t,e){const i=null==t?void 0:t.dataPoint;if(i)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart.pg,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ()}}setCursorEnabled(t){return this.ov=t,this}getCursorEnabled(){return this.ov}setCursorFormattingOverride(t){return this.Av=t,this}getCursorFormattingOverride(){return this.Av}setAutoScrollingEnabled(t){return this.av=t,this.chart.ls.xs(),this}getAutoScrollingEnabled(){return this.av}setColorShadingStyle(t){return this.nv=t,this.qi.forEach(((e,i)=>i.gv(t))),this.Rm.xs(),this}getColorShadingStyle(){return this.nv}setDepthTestEnabled(t){return this.lv=t,this.qi.forEach(((e,i)=>i.pv(t))),this.Rm.xs(),this}getDepthTestEnabled(){return this.lv}yv(){}De(){}bm(){}getXMax(){const t=this.ja;return t?t.St():void 0}getXMin(){const t=this.ja;return t?t.vt():void 0}getYMax(){const t=this.ja;return t?t.bt():void 0}getYMin(){const t=this.ja;return t?t.xt():void 0}getZMax(){const t=this.ja;return t?t.mv():void 0}getZMin(){const t=this.ja;return t?t.vv():void 0}Ir(){const t=this.ja;return t?f(t.Cl(),t.kl(),t.Sv()):f(0,0,0)}}class sl extends il{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Box Series 3D",this.xv=.25,this.bv=!1,this.Xd=()=>de(this.we),this.we=ye(this.Ki.boxSeries3DFillStyle,r),this.ja=this.Rm._v().pv(this.lv).Ie(this.we).Mv(this.xv).us(this.getHighlight()),this.ds(this.ja)}invalidateData(t){const e=t.length;if(0===e)return this;this.bv&&this.chart.ls.Xn(dh.Cf);const i=t[0];if(!i)return this;let s;if("xMin"in i||"yMin"in i||"zMin"in i||"xMax"in i||"yMax"in i||"zMax"in i){s=[];for(let i=0;ide(this.gu.getFillStyle())}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;return this.ja.Oe(e),this.Rm.xs(),this}getStrokeStyle(){return this.gu}add(t){return this.bv&&this.chart.ls.Xn(dh.Cf),this.bv=!0,(t=Array.isArray(t)?t:[t])?(this.ja.dl(t.slice()),this.Rm.xs(),this):this}clear(){return this.ja.Ot(),this}getPointAmount(){const t=this.ja;return t.fl()+t.Al()}rv(){return this.av&&this.getPointAmount()>0&&this.getVisible()}Le(t,e){t.us(e),this.Rm.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.gu})}}class nl extends rl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Line Series 3D",this.gu=ye(s.lineSeries3DStrokeStyle,r),this.Cv=Ir.pointStyle3D,this.kv(this.gu),this.ja=this.Rm.rm([Oa.UserSeries]).pv(this.lv).Oe(this.gu).Nm(this.Cv).us(this.getHighlight()),this.ds(this.ja)}setStrokeStyle(t){super.setStrokeStyle(t),this.kv(this.gu);const e=this.Cv;return this.ja.Nm(e),this}kv(t){const e=new Ar.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.Cv=e}}class ol extends rl{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Point Line Series 3D",this.Xd=()=>de(this.gu.getFillStyle())||de(this.Cv.getFillStyle()),this.Cv=ye(s.pointLineSeries3DPointStyle,r),this.gu=ye(s.lineSeries3DStrokeStyle,r),this.Tv(),this.ja=this.Rm.rm([Oa.UserSeries]).pv(this.lv).Oe(this.gu).Nm(this.Cv).us(this.getHighlight()),this.ds(this.ja)}setPointStyle(t){return this.Cv="function"==typeof t?t(this.Cv):t,this.Tv(),this.ja.Nm(this.Cv),this.Rm.xs(),this}getPointStyle(){return this.Cv}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.gu,i=Math.abs(e.getThickness()),s=this.Cv,r=s.getSize();i>("object"==typeof r?Math.max(r.x,r.y,r.z):r)&&(this.Cv=s.setSize(i)),this.Tv();const n=this.Cv;return this.ja.Nm(n),this.Rm.xs(),this}Tv(){const t=this.Cv,e=t.getSize();this.Cv=t.setSize(e)}Le(t,e){t.us(e),this.Rm.xs()}}class hl extends il{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.bv=!1,((null==n?void 0:n.individualPointSizeAxisEnabled)||(null==n?void 0:n.individualPointSizeEnabled))&&this.chart.ls.Xn(dh.kf)}add(t){return this.bv&&this.chart.ls.Xn(dh.Cf),this.bv=!0,(t=Array.isArray(t)?t:[t])?(this.ja.dl(t.slice()),this.Rm.xs(),this):this}clear(){return this.ja.Ot(),this}getPointAmount(){const t=this.ja;return t.fl()+t.Al()}rv(){return this.av&&this.getPointAmount()>0&&this.getVisible()}Le(t,e){t.us(e),this.Rm.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{point3D:this.Fv})}}class al extends hl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._s="Point Series 3D",this.Xd=()=>de(this.Fv.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.chart.getSeries().length;this.Fv=ye(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.ja=this.Rm.Pv(h).pv(this.lv).Iv(this.Fv).us(this.getHighlight()),this.ds(this.ja)}setPointStyle(t){this.Fv="function"==typeof t?t(this.Fv):t;const e=this.Fv;return this.ja.Iv(e),this.Rm.xs(),this}getPointStyle(){return this.Fv}}class ll extends hl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this._s="Point Cloud Series 3D",this.Xd=()=>de(this.Fv.getFillStyle());const o=this.chart.getSeries().length;this.Fv=ye(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.ja=this.Rm.Pv(h).Iv(this.Fv).us(this.getHighlight()),this.ds(this.ja)}setPointStyle(t){this.Fv="function"==typeof t?t(this.Fv):t;const e=this.Fv;return this.ja.Iv(e),this.Rm.xs(),this}getPointStyle(){return this.Fv}}const ul={Triangulated:al,Pixelated:ll};class cl extends na{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Dv=[],this.Bv=0,this.Lv=t=>{const e=this.Dv.indexOf(t);e>=0&&(this.Dv.splice(e,1),this.R.emit("seriesDispose",this,t))},this.onSeriesBackgroundMouseEnter=t=>this.R.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.R.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.R.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.R.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.R.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.R.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.R.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.R.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.R.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.R.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.R.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.R.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.R.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.R.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.R.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.R.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.R.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.R.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.R.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.R.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.R.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.R.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.R.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.R.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.R.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.R.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.R.off(t,"touchEndSeriesBackground"),this.Rv=this.ss.wg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.Dv.forEach((e=>e.setAnimationHighlight(t))),this}Ev(t,e){this.Rv.fs([e]),t.setMouseMoveEventHandler(((t,e)=>{this.R.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.R.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.R.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.R.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.R.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.R.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.R.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.R.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.R.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.R.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.R.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.R.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.R.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.R.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.zv.Ie(t),this.ls.xs(),this}getSeriesBackgroundFillStyle(){return this.zv.Hh()}setSeriesBackgroundStrokeStyle(t){return this.Vv.Fe(t),this.ls.xs(),this}getSeriesBackgroundStrokeStyle(){return this.Vv.po()}setSeriesBackgroundEffect(t){return this.Rv.Ss(t),this.ls.xs(),this}getSeriesBackgroundEffect(){return this.Rv.bs()}Ov(t){this.Dv.push(t),void 0!==this.Nv&&t.setHighlightOnHover(this.Nv),this.R.emit("seriesAdded",this,t)}if(){return this.Dv}setSeriesHighlightOnHover(t){return this.Nv=t,this.Dv.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.Dv.slice().forEach(Et),super.dispose()}Lp(t){return this.R.on("seriesAdded",t)}Gv(t){return this.R.off(t)}Wv(t){return this.R.on("seriesDispose",t)}Uv(t){return this.R.off(t)}}const dl=_e.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class fl{constructor(t,e,i,s){this.Yv=!0,this.Hv=!0,this.$v=2*-Math.PI/2160,this.Xv=2*Math.PI/2160,this.jv=.1,this.Zv=1*Math.PI/180,this.Qv=t,this.Jv=e,this.Kv=i,this.jm=s}getDefaultCameraConfiguration(t){const e={direction:dl,location:_e.multiply(dl,-1)};return this.cameraLocationChanged({boundingBox:t,cameraDirection:e.direction,cameraLocation:e.location})||e}applyCameraInteractions(t,e){let i={direction:t.cameraDirection,location:t.cameraLocation};return e.forEach((t=>{"rotate"===t.type?i=this.qv(i,t):"wheel-zoom"===t.type?i=this.tS(i,t):"rotate+zoom"===t.type?i=this.iS(i,t):"fixed-rotate"===t.type?i=this.sS(i,t):"move"===t.type&&(i=this.eS(i,t))})),this.Yv?i=this.hS(t.boundingBox,i):this.Hv&&(i=this.rS(t.boundingBox,i)),i}qv(t,e){const{rotation:i}=e,s=t.location,r=_e.multiply(_e.normalize(t.location),-1),{Right:n,Up:o}=this.nS(r);let h=s;const a=this.oS(r),l=i.x*this.$v*a;h=_e.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.Xv,a-this.Zv);return 0!==u&&(h=_e.rotateAroundAxis(h,n,u)),{location:h,direction:_e.multiply(_e.normalize(h),-1)}}tS(t,e){const{deltaY:i}=e;this.Yv&&this.aS(!1);const s=t.location,r=_e.multiply(_e.normalize(s),-1),n=i*this.jv,o=_e.length(s)*-n;return{direction:r,location:_e.addVec(s,_e.multiply(r,o))}}iS(t,e){const{rotation:i,cameraDistance:s}=e;this.Yv&&this.aS(!1);let r=this.qv(t,{type:"rotate",rotation:i});const n=r.location,o=_e.multiply(_e.normalize(n),-1),h=_e.multiply(o,-s);return r={direction:_e.multiply(_e.normalize(h),-1),location:h},r}sS(t,e){this.Yv&&this.aS(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.nS(r),h=i.x*this.$v;let a=_e.normalize(_e.rotateAroundAxis(r,o,h));const l=i.y*this.Xv;return a=_e.normalize(_e.rotateAroundAxis(a,n,l)),{location:s,direction:a}}eS(t,e){this.Yv&&this.aS(!1),this.Hv=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.nS(n);return{location:_e.addVec(r,_e.multiply(n,.01*s),_e.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:_e.multiply(_e.normalize(t.cameraLocation),-1)};return this.Yv?this.hS(t.boundingBox,e):this.rS(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:_e.multiply(_e.normalize(t.cameraLocation),-1)};return this.Yv?this.hS(t.boundingBox,e):this.rS(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:_e.multiply(_e.normalize(t.cameraLocation),-1)};if(this.Yv)return this.hS(t.boundingBox,e)}hS(t,e,i){let s=e;i=void 0!==i?i:0,s=this.lS(t,s,100,20,1,i,5);const r=this.oS(s.direction);return s=this.uS(s,this.cS(t,s,100,1),r),s}lS(t,e,i,s,r,n,o){return gl(n,o,(t=>({direction:e.direction,location:_e.multiply(e.direction,-t)})),(e=>this.dS(t,e)),i,r,"linear",s)}cS(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.nS(e.direction),a=this.fS(t,!1,e);let l=e;const u=s,c=.1;return Math.abs(a.bottom-a.top)>u&&(l=a.bottom({location:l.location,direction:_e.normalize(_e.lerp(l.direction,h,t))})),(e=>this.AS(t,e)),0,u,!0,i):yl(0,c,(t=>({location:l.location,direction:_e.normalize(_e.lerp(l.direction,o,t))})),(e=>this.AS(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:_e.normalize(_e.lerp(l.direction,n,t))})),(e=>this.gS(t,e)),0,u,!0,i):yl(0,c,(t=>({location:l.location,direction:_e.normalize(_e.lerp(l.direction,r,t))})),(e=>this.gS(t,e)),0,u,!0,i)),l}dS(t,e){const i=this.fS(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}gS(t,e){const i=this.fS(t,!1,e);return Math.abs(i.left-i.right)}AS(t,e){const i=this.fS(t,!1,e);return Math.abs(i.top-i.bottom)}fS(t,e,i){const s=Je(this.pS(t,e,i).map((t=>ct(t,this.Qv,this.Jv))));return{left:s.min.x,right:this.Jv.x.getInnerEnd()-s.max.x,top:this.Jv.y.getInnerEnd()-s.max.y,bottom:s.min.y}}pS(t,e,i){const s=this.Kv,r=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),n=f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),o=[],h=e?16:4,a=(r.x+n.x)/2,l=(r.z+n.z)/2,u=Math.sqrt(2)*(n.x-a),c=Math.sqrt(2)*(n.z-l);return[r.y,n.y].forEach((t=>{for(let e=0;ethis.jm(t,i))).filter((t=>void 0!==t))}rS(t,e){const i=_e.length(e.location),s=this.yS(t);return i{let a,l=0,u=(e+t)/2;do{const h=i(u);if(a={value:u,result:h,score:s(h)},Math.abs(a.score-r)<=n)break;const c=a.score>r;c&&"linear"===o||!c&&"reversed"===o?(u=(a.value+t)/2,e=a.value):(u=(a.value+e)/2,t=a.value),l+=1}while(l{let a,l=0,u=t;do{const c=i(u),d=s(c);if(void 0===a||Math.abs(d-r)de(this.we),this.nv=Hn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.chart.getSeries().length;this.we=ye(this.Ki.surfaceGridSeries3DFillStyle,o),this.SS=ye(this.Ki.surfaceGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.Qn=h,this.ja=this.Rm.bS(h).Ie(this.we).xS(this.SS).gv(this.nv).us(this.getHighlight()),this.ds(this.ja),this.setHighlightOnHover(!1)}Qi(t,e){const i=null==t?void 0:t.dataPoint;if(i)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart.pg,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:H(this.we)?this.we.lut:void 0}}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}MS(){const t=this.vS.start||{x:0,z:0};let e;e=this.vS.end?{x:(this.vS.end.x-t.x)/this.Qn.columns,z:(this.vS.end.z-t.z)/this.Qn.rows}:this.vS.step?this.vS.step:{x:1,z:1},this.ja._S(t,e),this.chart.ls.xs()}setStart(t){return this.vS.start=t,this.MS(),this}getStart(){return this.ja.wS().start}setStep(t){return this.vS.step=t,this.MS(),this}getStep(){return this.ja.wS().step}setEnd(t){return this.vS.end=t,this.MS(),this}getEnd(){return this.ja.wS().end}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.ja.Ie(this.we),this.Rm.xs(),this}getFillStyle(){return this.we}setWireframeStyle(t){return this.SS="function"==typeof t?t(this.SS):t,this.ja.xS(this.SS),this.Rm.xs(),this}getWireframeStyle(){return this.ja.CS()}setIntensityInterpolation(t){return t=t||"disabled",this.ja.kS(t),this.Rm.xs(),this}getIntensityInterpolation(){return this.ja.TS()}invalidateIntensityValues(t){if(this.bv&&this.chart.ls.Xn(dh.Cf),Array.isArray(t)){if(0===t.length||0===t[0].length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Qn.dataOrder?t.length:t[0].length,rows:"rows"===this.Qn.dataOrder?t.length:t[0].length},i="columns"===this.Qn.dataOrder?this.Qn.columns:this.Qn.rows,s="columns"===this.Qn.dataOrder?this.Qn.rows:this.Qn.columns;if(e.x>i||e.y>s){if(!0===this.chart.mA.Kn){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Qn.columns}x${this.Qn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.mA.Kn){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Qn.columns}x${this.Qn.rows}, input ${e.columns}x${e.rows} starting at [${t.iColumn},${t.iRow}].\n Out of bounds data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(i)}const a=Math.max(-i,0),l=Math.max(-r,0),u=Math.max(s-o,0),c=Math.max(n-h,0),d=e.primary-(a+u),f=[];if(0===l&&0===c)for(let e=0;ei||e.y>s){if(!0===this.chart.mA.Kn){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Qn.columns}x${this.Qn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.mA.Kn){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Qn.columns}x${this.Qn.rows}, input ${e.columns}x${e.rows} starting at [${t.iColumn},${t.iRow}].\n Out of bounds data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(i)}const a=Math.max(-i,0),l=Math.max(-r,0),u=Math.max(s-o,0),c=Math.max(n-h,0),d=e.primary-(a+u),f=[];if(0===l&&0===c)for(let e=0;ede(this.we),this.chart.ls.Xn(dh.Cf),this.nv=Hn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.chart.getSeries().length;this.we=ye(this.Ki.surfaceScrollingGridSeries3DFillStyle,o),this.SS=ye(this.Ki.surfaceScrollingGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.Qn=h,this.ja=this.Rm.BS(h).Ie(this.we).xS(this.SS).gv(this.nv).us(this.getHighlight()),this.ds(this.ja),this.setHighlightOnHover(!1)}Qi(t,e){const i=null==t?void 0:t.dataPoint;if(i)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart.pg,axisLocation:i},...i,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:H(this.we)?this.we.lut:void 0}}MS(){const t=this.vS.start||{x:0,z:0};let e;e=this.vS.step?this.vS.step:{x:1,z:1},this.ja._S(t,e),this.chart.ls.xs()}setStart(t){return this.vS.start=t,this.MS(),this}getStart(){return this.ja.wS().start}setStep(t){return this.vS.step=t,this.MS(),this}getStep(){return this.ja.wS().step}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.ja.Ie(this.we),this.Rm.xs(),this}getFillStyle(){return this.we}setWireframeStyle(t){return this.SS="function"==typeof t?t(this.SS):t,this.ja.xS(this.SS),this.Rm.xs(),this}getWireframeStyle(){return this.ja.CS()}setIntensityInterpolation(t){return t=t||"disabled",this.ja.kS(t),this.Rm.xs(),this}getIntensityInterpolation(){return this.ja.TS()}clear(){return this.ja.Ot(),this.Rm.xs(),this}addValues(t){if(!t)return this;let e=t.yValues,i=t.intensityValues;if(!e&&!i)return this;if(e&&0===e.length&&(e=void 0),i&&0===i.length&&(i=void 0),e){const t=e[0].length,i=0+t-1,s="columns"===this.Qn.scrollDimension?this.Qn.rows:this.Qn.columns;if(i>s-1){if(!0===this.chart.mA.Kn){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.Qn.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.chart.mA.Kn){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.Qn.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(e)}const e=[];for(let t=0;ts?e=e.slice(0,s):i=i.slice(0,t)}}const s=e?e.length:null==i?void 0:i.length,r=e?e[0].length:null==i?void 0:i[0].length;return this.ja.LS({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.Rm.xs(),this}setCullMode(t){return this.ja.PS("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.ja.DS()}yv(){}De(){}bm(){}rv(){return this.av&&this.getVisible()}Le(t,e){t.us(e),this.Rm.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}}const xl=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof wl),Al=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y&&"z"in t&&"number"==typeof t.z);class Sl extends il{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._s="Mesh Model 3D",this.RS=new Float32Array,this.At={x:1,y:1,z:1},this.ES={x:0,y:0,z:0},this.zS={x:0,y:0,z:0},this.VS={x:0,y:0,z:0},this.OS={x:0,y:0,z:0},this.Ka=Oe,this.Xd=()=>de(this.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.chart.getSeries().length;this.ja=this.Rm.NS().pv(this.lv).Ie(ye(this.Ki.meshModel3DFillStyle||this.Ki.pointSeriesFillStyle,o)).us(this.getHighlight()),this.ds(this.ja)}Qi(t,e){const i=this.getFillStyle();return Pe({series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:H(i)?i.lut:void 0},{cursorPosition:0,index:0,x:0,y:0,z:0,value:0},(()=>{const s=this.ja.GS(t,e);if(s)return{cursorPosition:{resultTable:this.chart.translateCoordinate(e,this.chart.coordsRelative),resultTableScale:this.chart.pg,axisLocation:s.coordAxis},...s.coordAxis,index:s.index,value:s.value,series:this,axisX:this.chart.getDefaultAxisX(),axisY:this.chart.getDefaultAxisY(),axisZ:this.chart.getDefaultAxisZ(),lut:H(i)?i.lut:void 0}}))}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let r=ze,n=Be,o=ze,h=Be,a=ze,l=Be;for(let t=0;te(t)))}return r.pointMarker.setPosition(s),this.chart.ls.xs(),this}}class bl{constructor(t,e){this.uy=[],this.Ay=(t,e)=>(this.uy.forEach((i=>i(t,e))),t),this.addStyler=t=>new bl(this.ny,this.uy.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new bl(t,this.uy.map((t=>t))),this.gy=(t,e,i,s,r,n)=>this.Ay(new vl(t,e,i,s,this.ny,r,n),r),this.ny=t,this.uy=e}}const Ml=new bl(Ao,[(t,e)=>{xa(t)}]);class wl extends cl{constructor(t,e,i,s,r,n,o){var h;super(t,e,i,e.wp("chart3D bg",0),s,e.ls.Ki.chart3DBackgroundFillStyle,e.ls.Ki.chart3DBackgroundStrokeStyle,e.ls.Ki.chart3DTitleFont,e.ls.Ki.chart3DTitleFillStyle,n),this.qS=1,this.tx=[],this.ix=2,this.sx=!0,this.hx=!0,this.nx=!0,this.ox=0,this.coordsAxis={id:"axes",chart:this},this.coordsWorld={id:"world",chart:this},this.gn=[],this.Mn=()=>{const t=this.Rm.lx();this.Ax.ux(t),this.gx.ux(t);const e=this.yx.viewportChanged(this.mx());e&&this.vx(e),this.ls.xs()},this.Sx=!1,this.cv=(t,e,i,s,r)=>{if(this.Sx=!0,this.nx){const t=r;this.tx.push({type:"rotate",rotation:t}),this.ls.xs(),Qt(e)}},this.dv=(t,e,i,s,r)=>{this.Sx=!1},this.uv=(t,e)=>{if(this.hx){if(this.sx)Math.sign(this.ox)!==Math.sign(e.deltaY)?this.ox=me(e):this.ox+=me(e);else{const t=me(e);this.tx.push({type:"wheel-zoom",deltaY:t})}this.ls.xs(),Qt(e)}},this.ls.Xn(dh.mf),this.mh.gr("Chart3D"),this.xx=i.d3(),this.xx.x.q(-1,1),this.xx.y.q(-1,1),this.xx.z.q(-1,1),this.Rm=e.bx("chart3D layer3D",0,this.xx),this.Ax=e.Mx("chart3D series bg",0),this.gx=e.Hy("chart3D axis ui",1),this._x={x:new $a(this,(h=()=>this.Dv,{...Ja(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Ir().x)),Im:t=>t.x,Jm:(t,e)=>({x:t.x,y:e.y,z:e.z}),ef:f(0,-1,0),Km:t=>{const e={x:t.x>=0?1:-1,y:t.y>=0?1:-1,z:t.z>=0?1:-1};return{gridlinePositionA:f(0,e.y,e.z),gridlinePositionB:f(0,e.y,-e.z),gridlinePositionC:f(0,-e.y,-e.z)}},sv:()=>!0,ev:()=>!1,Qm:()=>!1}),this.xx.x,this.Ki,this.Rm,this.gx,this.pg,!1,this.ss),y:new $a(this,tl((()=>this.Dv)),this.xx.y,this.Ki,this.Rm,this.gx,this.pg,!1,this.ss),z:new $a(this,el((()=>this.Dv)),this.xx.z,this.Ki,this.Rm,this.gx,this.pg,!1,this.ss)},this.wx=this.Rm.rm([Oa.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.Ki.chart3DBoundingBoxStrokeStyle),this.zv=this.Ax.oc(this.ls.At,cn.Simple).Ie(this.Ki.chart3DSeriesBackgroundFillStyle).Fe(nt).setMouseInteractions(!0),this.Vv=this.Ax.oc(this.ls.At,cn.Simple).Ie(B).Fe(this.Ki.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Ev(this.zv,this.Vv),this.Cx({x:1,y:1,z:1},!0),this.yx=new fl(this.ls.At,this.pg,this.xx,((t,e)=>(e&&this.vx(e),this.Rm.jm(t)))),this.kx=this.yx.getDefaultCameraConfiguration(this.Tx(this.Fx)),this.vx(this.kx);const a=Pt(o?o.cursorBuilder:void 0,Ml),l=e.Xy();let c;this.jy=la(this,l,a.gy(l,this.pg,this.pg,kt,this.Ki,this),this,"show-pointed",Cl,(()=>0)),this.fv=ji(new Qi(((t,e,i)=>{c={locationOne:e,locationTwo:i,cameraLocation:this.Rm.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.nx&&!this.hx)return;const o=(c.locationOne.x-c.locationTwo.x)**2+(c.locationOne.y-c.locationTwo.y)**2,h=(e.x-i.x)**2+(e.y-i.y)**2,a=_e.length(c.cameraLocation),l=o/h*a,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.tx.push({type:"rotate+zoom",rotation:this.nx?d:{x:0,y:0},cameraDistance:this.hx?l:a}),this.ls.xs(),Qt(n)}),(t=>{})),new $i((t=>{}),((t,e,i,s,r)=>{if(this.nx){const t=s;this.tx.push({type:"rotate",rotation:t}),this.ls.xs(),Qt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.fv.onTouchStart),this.onBackgroundTouchMove(this.fv.onTouchMove),this.onBackgroundTouchEnd(this.fv.onTouchEnd),this.onSeriesBackgroundTouchStart(this.fv.onTouchStart),this.onSeriesBackgroundTouchMove(this.fv.onTouchMove),this.onSeriesBackgroundTouchEnd(this.fv.onTouchEnd),this.onBackgroundMouseDrag(this.cv),this.onBackgroundMouseDragStop(this.dv),this.onBackgroundMouseWheel(this.uv),this.onBackgroundMouseDown(((t,e)=>{Qt(e)})),this.onSeriesBackgroundMouseDrag(this.cv),this.onSeriesBackgroundMouseDragStop(this.dv),this.onSeriesBackgroundMouseWheel(this.uv),this.onSeriesBackgroundMouseDown(((t,e)=>{Qt(e)})),this.setAnimationsEnabled(!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.Mn),this.Mn(),this._p(r,this.pg)}setProjection(t){this.Rm.Ix(t);const e=this.yx.viewportChanged(this.mx());return e&&this.vx(e),this.ls.xs(),this}getProjection(){return this.Rm.Px()}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=Ml){const e=this.fp(),i=t.gy(e,this.pg,this.pg,this.ap(e),this.Ki,this);return this.xp(i),i}addPointSeries(t){const e=new(t&&t.type||al)(this,this.Lv,this.Rm,this.Ki,this.ls.ss,t);return this.Ov(e),e}addLineSeries(t){const e=new nl(this,this.Lv,this.Rm,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addPointLineSeries(t){const e=new ol(this,this.Lv,this.Rm,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addSurfaceGridSeries(t){const e=new ml(this,this.Lv,this.Rm,t,this.Ki,this.ls.ss);return this.Ov(e),e}addSurfaceScrollingGridSeries(t){const e=new pl(this,this.Lv,this.Rm,t,this.Ki,this.ls.ss);return this.Ov(e),e}addBoxSeries(t){const e=new sl(this,this.Lv,this.Rm,this.Ki,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Dv.length,this.ls.ss);return this.Ov(e),e}addMeshModel(t){const e=new Sl(this,this.Lv,this.Rm,this.Ki,t,this.ls.ss);return this.Ov(e),e}translateCoordinate(t,e,i){if(xl(e)||xl(i)||Al(t)){if(xl(e)&&xl(i)&&Al(t)){if("axes"===e.id&&"world"===i.id)return this.Rm.Dx(t);if("world"===e.id&&"axes"===i.id)return this.Rm.Bx(t);if(e.id===i.id)return t}if(xl(e)&&Oi(i)&&Al(t)){const e=this.Rm.jm(t);return e?this.ls.Oo({engineX:e.x,engineY:e.y}):{clientX:-1,clientY:-1}}if(xl(e)&&Yi(i)&&Al(t)){const e=this.Rm.jm(t);return e?ct(e,this.ls.At,this.pg):{clientX:-1,clientY:-1}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return ta(t,e,i,this.pg,this.ls)}getDefaultAxisX(){return this._x.x}getDefaultAxisY(){return this._x.y}getDefaultAxisZ(){return this._x.z}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}get axisZ(){return this.getDefaultAxisZ()}get zAxis(){return this.getDefaultAxisZ()}getDefaultAxes(){return[this._x.x,this._x.y,this._x.z]}setCameraLocation(t){let e={location:t,direction:_e.normalize(_e.multiply(t,-1))};const i=this.yx.cameraLocationChanged(this.mx(e));return i&&(e=i),this.vx(e),this.ls.xs(),this}getCameraLocation(){return this.Rm.getCameraLocation()}getCameraDirection(){return this.Rm.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.yx.aS(t);const e=this.yx.cameraLocationChanged(this.mx());return e&&this.vx(e),this}getCameraAutomaticFittingEnabled(){return this.yx.mS()}onCameraChange(t){return this.R.on("cameraChange",t)}offCameraChange(t){return this.R.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.wx.Oe(t).Nm(Za(this.wx.pu())),this.Rm.xs(),this}getBoundingBoxStrokeStyle(){return this.wx.pu()}setBoundingBox(t){return this.Cx(t,!1),this}Cx(t,e){this.Fx=t;const i=this.Tx(t);if(this.xx.x.it(i.x),this.xx.y.it(i.y),this.xx.z.it(-i.z),!e){const t=this.yx.boundingBoxChanged(this.mx());t&&this.vx(t)}this.ls.xs()}getBoundingBox(){return this.Fx}De(t){if(oa.Bp(this.mh,this.Cp),0!==this.ox){const e=this.ox*t*.006;this.tx.push({type:"wheel-zoom",deltaY:e}),this.ox=Math.sign(this.ox)*Math.max(Math.abs(this.ox)-.01*t,0),0!==this.ox&&this.ls.xs(!0)}const e=this.getCameraDirection();if(this.tx.length>0){const t=this.yx.applyCameraInteractions(this.mx(),this.tx);t&&this.vx(t),this.tx.length=0}this.Lx&&_e.equals(this.Lx.location,this.kx.location)&&_e.equals(this.Lx.direction,this.kx.direction)||this.R.emit("cameraChange",this,this.getCameraLocation()),this.Lx=this.kx,super.De(t);for(let t=0;tthis.Rm.jm(t))),o=this.Rm.jm(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=oe(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.gn.length=0,this.xx.Y(),this.Rm.Y(),this.gx.Y(),this.Ax.Y(),this.jy.Y(),super.dispose()}J(){return this.xx.x.J(),this.xx.y.J(),this.xx.z.J(),super.J()}K(){return super.K()}vx(t){this.Rm.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(_e.addVec(t.location,_e.multiply(t.direction,-this.ix))),this.kx=t,this.ls.xs()}Tx(t){return _e.divide(t,_e.length(t)/this.qS)}mx(t=this.kx){return{boundingBox:this.Tx(this.Fx),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.hx=t,this}getMouseInteractionZoom(){return this.hx}setMouseInteractionRotate(t){return this.nx=t,this}getMouseInteractionRotate(){return this.nx}forEachAxis(t){return t(this._x.x),t(this._x.y),t(this._x.z),this}getSeries(){return this.Dv}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.sx=!!t,this}getAnimationZoom(){return this.sx}}const Cl=(t,e,i)=>{var s,r;return gt(e)?aa(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:ah(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:ah(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],[t.getDefaultAxisZ().getTitle()||"Z","",{text:ah(e.axisZ.formatValue(e.z),e.axisZ),font:{weight:"bold"}}],void 0!==e.intensity?["Value","",{text:ah(e.intensity.toFixed(2),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}]:[]]):mt(e)?aa(e,[[e.series],void 0!==e.value?["Value","",{text:ah(e.value.toFixed(2),null===(r=e.lut)||void 0===r?void 0:r.units),font:{weight:"bold"}}]:[]]):aa(e,[[e.series],[t.getDefaultAxisX().getTitle()||"X","",{text:ah(e.axisX.formatValue(e.x),e.axisX),font:{weight:"bold"}}],[t.getDefaultAxisY().getTitle()||"Y","",{text:ah(e.axisY.formatValue(e.y),e.axisY),font:{weight:"bold"}}],[t.getDefaultAxisZ().getTitle()||"Z","",{text:ah(e.axisZ.formatValue(e.z),e.axisZ),font:{weight:"bold"}}]])},Tl={Column:Do,Row:Po};class Rl extends sa{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Rx=new Map,this.Ex=this.addUIElement(Tl.Row).setPosition({x:0,y:100}).setOrigin(Es.LeftTop).setBackground((t=>t.setFillStyle(B).setStrokeStyle(nt)))}add(t,e){return(t instanceof na?[t]:t instanceof vf?t.getCells().filter((t=>t.panel instanceof na)).map((t=>t.panel)):[]).forEach((t=>{const i=this.Ex.addElement(hh.VerticalLegendBox).setBackground((t=>t.setFillStyle(B).setStrokeStyle(nt))).add(t,e).setTitle(t.getTitle());this.Rx.set(t,i)})),this.ls.xs(),this}setLegendBoxes(t){return this.Rx.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.Ex.getSize()}}const El={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},kl=(t,e)=>!(!e.name||t.name.toLowerCase()!==e.name.toLowerCase())||"ISO_A3"in t&&"ISO_A3"in e&&t.ISO_A3.toLowerCase()===e.ISO_A3.toLowerCase(),Il=(t,e)=>{let i=e.geometry;return i=Fl(t,e,i),i=Dl(t,e,i),i},Fl=(t,e,i)=>{if(t===El.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===El.USA&&("alaska"===s?r={translate:{x:55,y:-25},scale:{x:.16,y:.16}}:"hawaii"===s&&(r={translate:{x:48,y:7},scale:{x:1,y:1}})),r){const{translate:t,scale:n}=r,o=Je(Dt(i)),h=[];for(let e=0;ethis.R.on("mouseEnter",t),this.onMouseLeave=t=>this.R.on("mouseLeave",t),this.onMouseClick=t=>this.R.on("mouseClick",t),this.onMouseDoubleClick=t=>this.R.on("mouseDoubleClick",t),this.onMouseDown=t=>this.R.on("mouseDown",t),this.onMouseUp=t=>this.R.on("mouseUp",t),this.onMouseMove=t=>this.R.on("mouseMove",t),this.offMouseEnter=t=>this.R.off(t,"mouseEnter"),this.offMouseLeave=t=>this.R.off(t,"mouseLeave"),this.offMouseClick=t=>this.R.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.R.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.R.off(t,"mouseDown"),this.offMouseUp=t=>this.R.off(t,"mouseUp"),this.offMouseMove=t=>this.R.off(t,"mouseMove"),this.offMouseDragStart=t=>this.R.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.R.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.R.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.R.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.R.on("mapDataReady",t);return this.Ux&&wt.setTimeout((()=>t())),e},this.onViewChange=t=>this.R.on("viewChange",t),this.Yx=(t,e,i,s,r)=>{this.At.x.it(s).si([this.Xt.left+this.wa.left,this.Xt.right+this.wa.right]),this.At.y.it(r).si([this.Xt.bottom+this.wa.bottom,this.Xt.top+this.wa.top+oa.Dp(this.mh,this.Cp)]),this.Hx&&this.$x(this.Xx,this.At,this.Hx)},this._t=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;r&&(this.getCursorMode()&&(this.Zx(s),Qt(t)),this.Gx&&this.ls.os.ws(r,!0),this.Qx=r,this.R.emit("mouseEnter",this,t,s))},this.wt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;this.Jx(),r&&(this.Gx&&this.ls.os.ws(r,!1),this.Qx=void 0,this.R.emit("mouseLeave",this,t,s),t&&Qt(t))},this.It=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;r&&(this.getCursorMode()&&(this.Zx(s),Qt(t)),this.Qx=r,this.R.emit("mouseMove",this,t,s))},this.Ct=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseClick",this,t,s)},this.kt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseDoubleClick",this,t,s)},this.Tt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseDown",this,t,s)},this.Ft=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseUp",this,t,s)},this.Dt=(t,e,i)=>{const s=i;if(!s||!this.Ux)return;const r=this.jx(this.Ux,s);this.R.emit("mouseDragStart",this,t,e,r)},this.Pt=(t,e,i,s,r)=>{const n=r;if(!n||!this.Ux)return;const o=this.jx(this.Ux,n);this.R.emit("mouseDrag",this,t,e,i,s,o)},this.Bt=(t,e,i,s)=>{const r=s;if(!r||!this.Ux)return;const n=this.jx(this.Ux,r);this.R.emit("mouseDragStop",this,t,e,i,n)},this.Lt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i);this.R.emit("mouseWheel",this,t,s)},this.Rt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;r&&(this.Zx(s),this.Gx&&this.ls.os.ws(r,!0),this.Qx=r,this.R.emit("touchStart",this,t,s),Qt(t))},this.Et=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;r&&(this.Zx(s),this.Qx=r,this.R.emit("touchMove",this,t,s),Qt(t))},this.zt=(t,e)=>{const i=e;if(!i||!this.Ux)return;const s=this.jx(this.Ux,i),r=null==s?void 0:s.region;this.Jx(),r&&(this.Gx&&this.ls.os.ws(r,!1),this.Qx=void 0,this.R.emit("touchEnd",this,t,s),Qt(t))},this.ls.Xn(dh.Sf),this.ah=!1!==(null==n?void 0:n.animationsEnabled),this.Kx=e.Hy("mapChart plotting",0),this.onResize(this.Yx),this.mh.gr("Map Chart");const h=e.Xy(),a=Pt(n?n.cursorBuilder:void 0,Ra);this.jy=la(this,h,a.gy(h,this.uiScale,this.uiScale,kt,this.Ki),void 0,"show-pointed",Bl,(()=>0)),this.qx=this.ss.wg(),this._p(r,this.uiScale),this.tb=this.Kx.Um(this.At).setMouseInteractions(this.Yi).setMouseEnterEventHandler(((t,e,i)=>this._t(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.wt(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.kt(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.It(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Dt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Pt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Bt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Lt(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Rt(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Et(e,i))).setTouchEndEventHandler(((t,e,i)=>this.zt(e,i))).Ie(this.Ki.mapChartFillStyle).Fe(this.Ki.mapChartStrokeStyle),this.ib=this.Kx.Um(this.At).setMouseInteractions(this.Yi).Ie(this.Ki.mapChartOutlierRegionFillStyle).Fe(this.Ki.mapChartOutlierRegionStrokeStyle);const l=Pt(n&&n.type,El.World);this.Xx=l,this.sb(l).then((()=>{this.R.emit("mapDataReady")}))}getRegionUnderMouse(){return this.Qx}setFillStyle(t){return this.tb.Ie(t),this.ls.xs(),this}getFillStyle(){return this.tb.Hh()}setStrokeStyle(t){return this.tb.Fe(t),this.ls.xs(),this}getStrokeStyle(){return this.tb.po()}setEffect(t){return this.qx.Ss(t),this.ls.xs(),this}getEffect(){return this.qx.bs()}setOutlierRegionFillStyle(t){return this.ib.Ie(t),this.ls.xs(),this}getOutlierRegionFillStyle(){return this.ib.Hh()}setOutlierRegionStrokeStyle(t){return this.ib.Fe(t),this.ls.xs(),this}getOutlierRegionStrokeStyle(){return this.ib.po()}setSeparateRegionFillStyle(t){return this.Vx="function"==typeof t?t(this.Vx):t,this.zx.forEach((t=>t.Ie(this.Vx))),this.ls.xs(),this}getSeparateRegionFillStyle(){return this.Vx}setSeparateRegionStrokeStyle(t){return this.Ox="function"==typeof t?t(this.Ox):t,this.zx.forEach((t=>t.Fe(this.Ox))),this.ls.xs(),this}getSeparateRegionStrokeStyle(){return this.Ox}invalidateRegionValues(t){if(!this.Ux||!this.eb)return this.hb=this.hb||[],this.hb.push(t),this;if("function"==typeof t)for(let e=0;e{t.rb(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.rb(e.value)}))}}return this.ls.xs(),this}onMouseDragStart(t){return this.R.on("mouseDragStart",t)}onMouseDrag(t){return this.R.on("mouseDrag",t)}onMouseDragStop(t){return this.R.on("mouseDragStop",t)}onMouseWheel(t){return this.R.on("mouseWheel",t)}onTouchStart(t){return this.R.on("touchStart",t)}onTouchMove(t){return this.R.on("touchMove",t)}onTouchEnd(t){return this.R.on("touchEnd",t)}offTouchStart(t){return this.R.off(t,"touchStart")}offTouchMove(t){return this.R.off(t,"touchMove")}offTouchEnd(t){return this.R.off(t,"touchEnd")}setMouseInteractions(t){return this.Yi=t,this.tb.setMouseInteractions(t),this}getMouseInteractions(){return this.Yi}setHighlight(t){var e;return t=be(t),this.Nx=t,null===(e=this.Ux)||void 0===e||e.regions.forEach((e=>{this.ls.os.ws(e,t)})),this.R.emit("highlight",this,t),this}getHighlight(){return this.Nx}setAnimationHighlight(t){var e;return null===(e=this.Ux)||void 0===e||e.regions.forEach((e=>{this.ls.os.Cs(e,t)})),this}getAnimationHighlight(){var t;return this.ls.os.ks(null===(t=this.Ux)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.Gx=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Gx}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}offMapDataReady(t){return this.R.off(t,"mapDataReady")}offViewChange(t){return this.R.off(t,"viewChange")}async sb(t){const e=await((t,e)=>{let i;if(t===El.World)i="countries_world.json";else if(t===El.NorthAmerica)i="countries_northAmerica.json";else if(t===El.SouthAmerica)i="countries_southAmerica.json";else if(t===El.Africa)i="countries_africa.json";else if(t===El.Europe)i="countries_europe.json";else if(t===El.Asia)i="countries_asia.json";else if(t===El.USA)i="states_usa.json";else if(t===El.Canada)i="territoriesProvinces_canada.json";else{if(t!==El.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw wt.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return wt.fetch(s).then((t=>t.json())).catch((t=>{Re(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.mA.Zs);this.eb=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=Pl[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.ib.Hr()._l(e);if(t===El.USA){const t=25.8,e=29.7;this.zx.push(this.Kx.Pe(this.At).setMouseInteractions(!1).Ie(this.Vx).Fe(this.Ox).Be({x:-126,y:t}).it({x:10,y:e-t}),this.Kx.Pe(this.At).setMouseInteractions(!1).Ie(this.Vx).Fe(this.Ox).Be({x:-113,y:t}).it({x:7,y:e-t}))}const s=this.ls.os.Yr(this.tb,{animationEnabled:this.ah});for(let i=0;i{o.forEach((e=>e.us(t)))}))}if(this.qx.fs([this.tb]),this.Hx=i,this.$x(t,this.At,i),this.Ux=e,this.hb){for(const t of this.hb)this.invalidateRegionValues(t);this.hb=void 0}this.ls.xs()}$x(t,e,i){const s=Ll[t],r=e.x.getCellSize(),n=e.y.getCellSize()/r,o={min:{x:i.min.x,y:i.min.y},max:{x:i.max.x,y:i.max.y}};if(ns){const t=(o.max.y-o.min.y)*(n/s-1);o.min.y-=t/2,o.max.y+=t/2}e.x.q(o.min.x,o.max.x),e.y.q(o.min.y,o.max.y);const h=this.At.x.li(),a=this.At.y.li();this.R.emit("viewChange",{latitudeRange:{start:o.min.y,end:o.max.y},longitudeRange:{start:o.min.x,end:o.max.x},margin:{top:a[1],bottom:a[0],left:h[0],right:h[1]}})}Zx(t){this.nb=t,this.ls.xs()}Jx(){this.nb=void 0,this.ls.xs()}jx(t,e){const i=Array.from(this.Wx.entries()).findIndex((([t,i])=>i.includes(e))),s=null==t?void 0:t.regions[i],r=this.ls.Hn();if(!r)return;const n=this.ls.Vo(r),o=this.eb&&this.eb[i];let h=ct({x:n.engineX,y:n.engineY},this.ls.At,this.At);h={x:Ft(h.x,this.At.x.getInnerStart(),this.At.x.getInnerEnd()),y:Ft(h.y,this.At.y.getInnerStart(),this.At.y.getInnerEnd())};let a=h.x,l=h.y;const u=s.transform;s.outlier&&u&&(a=(a-u.translate.x-u.vertexBoundaries.min.x)/u.scale.x+u.vertexBoundaries.min.x,l=(l-u.translate.y-u.vertexBoundaries.min.y)/u.scale.y+u.vertexBoundaries.min.y);const c=this.getFillStyle();return{cursorPosition:{pointMarker:{x:n.engineX,y:n.engineY},pointMarkerScale:this.ls.At,resultTable:{x:n.engineX,y:n.engineY},resultTableScale:this.ls.At},region:s,value:o,longitude:l,latitude:a,lut:H(c)?c.lut:void 0}}setCursor(t){return this.jy.setCursor(t),this}getCursor(){return this.jy.getCursor()}setCursorMode(t){return this.jy.setCursorMode(t),this}getCursorMode(){return this.jy.getCursorMode()}setCustomCursor(t){return this.jy.setCustomCursor(t?(e,i,s)=>t(this,e,i,s):void 0),this}onCursorTargetChanged(t){return this.jy.onCursorTargetChanged(((e,i,s)=>t(this,e,i,s)))}offCursorTargetChanged(t){this.jy.offCursorTargetChanged(t)}setCursorFormatting(t){return this.jy.setCursorFormatting(t),this}getCursorFormatting(){return this.jy.getCursorFormatting()}addCursor(t=Ra){const e=this.fp(),i=t.gy(e,this.uiScale,this.uiScale,this.ap(e),this.Ki);return this.xp(i),i}setAnimationsEnabled(t){return this.ah=!t,this}getAnimationsEnabled(){return this.ah}getMinimumSize(){}if(){return[this]}De(t){super.De(t),super.Mp(),oa.Bp(this.mh,this.Cp);const e=m(this.At.x.ei(),this.At.y.ei(),this.At.x.ri(),this.At.y.ri());return this.Kx.ux(e),this.jy.De(!1,[],void 0,{explicitTarget:this.nb}),this}dispose(){return this.Kx.Y(),this.jy.Y(),ia(this.At),super.dispose()}J(){return super.J(),this.At.J(),this}K(){return super.K(),this.At.K(),this}Xd(){return de(this.getFillStyle())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),t.onMouseEnter((()=>{this.setHighlight(!0)})),t.onMouseLeave((()=>{this.setHighlight(!1)})),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),this.styleLegendEntry(t,i),this}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.getFillStyle()})}}const _l=(t,e)=>{const i=t>0,s=e>0;return`${[ge(Math.abs(0|t),2),"° ",ge(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[ge(Math.abs(0|e),2),"° ",ge(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`},Bl=(t,e,i)=>{var s;const r=[[e.region.name],[_l(e.longitude,e.latitude)]];return void 0!==e.value&&r.push({text:ah(e.value.toFixed(1),null===(s=e.lut)||void 0===s?void 0:s.units),font:{weight:"bold"}}),r};class zl extends ir{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.ob(i),s,r,{numeric:e.ab({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.ab({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.ab({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.lb=n,this.ub=o,this.cb=h,this.ss=a,this.fb=i,this.Ab=e.ab({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.bh=h.Or(i).setMouseInteractions(!1).jh(e.ab({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).Ie(e.ab({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Jh=this.ss.wg([this.bh]).Ss(s.effectsText)}setTickStrategy(t,e){return super.Vh(t,e)}setStrokeStyle(t){return this.Ab="function"==typeof t?t(this.Ab):t,this.ub.xs(),this}getStrokeStyle(){return this.Ab}mr(t,e){return new Nl(e,t,this.fb,this.cb,this.gb(this.lb,this.fb),this.cb.Ne(this.fb).setMouseInteractions(!1))}vr(t,e){const i=this.pb(this.fb,t);this.yb&&!1===this.yb(t)?t.Ke.setVisible(!1):t.Ke.setVisible(!0).Be(ui(this.mb(this.fb,t.M),i.padding)).Ya(i.alignment).Zh(i.rotation).Va(i.offset.x,i.offset.y),this.vb(this.fb,t.Sb,t.xb,t)}setMouseInteractions(t){return this}De(){this.rr({physicalAxisSize:0});const t=this.Mr(((t,e)=>{const i=e.Fh.yr,s=.5*this.Ab.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Ke.Ls().td().y);return Math.max(t,s)}),0);return this.bb(this.fb,this.Ab,t),this.Mb(this.fb,this.bh,t),t}}class Nl extends sr{constructor(t,e,i,s,r,n,o){super(t,e,s,i,o),this.Sb=r,this.xb=n,r.setMouseInteractions(!1),this.qi.push(r,n)}}class Ol extends zl{constructor(t,e,i,s,r,n,o,h,a){super(t,Ul((()=>this.Dg())),e,i,s,r,n,o,h),this.Om=this.ub.Ne(this.fb).setMouseInteractions(!1),this._b=a,this.setScrollStrategy(Os.expansion),this.setTickStrategy(Us.Numeric),this.setTitle("Amplitude")}Dg(){return this._b()}Dr(t,e){return uh(t,e,this.fb.y)}Lr(t,e,i){const s=2*(e-t),r=this.fb.x.Li(s);return{min:t-i*r,max:e+i*r}}mb(t,e){return{x:t.wb()?e-t.Cb().start:t.Cb().start-e,y:0}}gb(t,e){return t.hd(e)}vb(t,e,i,s){const r=s.Fh.yr,n=t.wb()?s.M-t.Cb().start:t.Cb().start-s.M;It(s.M,t.Cb().start)||It(s.M,t.Cb().end)?e.setVisible(!1):e.setVisible(!0).lu(0).Ge(360).Au(void 0).fu(0).uu(n).Au(60).Ie(B).Fe(r.gridStrokeStyle);const o=.5*this.Ab.getThickness();i.We({x:n,y:-o*t.Wi().y}).Ge({x:n,y:-(o+r.tickLength)*t.Wi().y}).Oe(r.tickStyle)}pb(t,e){const i=e.Fh.yr;return{alignment:{x:0,y:1},padding:{x:0,y:t.Wi().y*-(.5*this.Ab.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}bb(t,e,i){const s=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end;this.Om.We({x:0,y:0}).Ge({x:s,y:0}).Oe(e)}Mb(t,e,i){const s=t.wb()?(t.Cb().start+t.Cb().end)/2-t.Cb().start:t.Cb().start-(t.Cb().start+t.Cb().end)/2;e.Ya({x:0,y:1}).Be({x:s,y:-i*t.Wi().y})}}const Ul=t=>({...Ja(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),ob:t=>({getInnerStart:()=>t.Cb().start,getInnerEnd:()=>t.Cb().end,q:(e,i)=>t.kb(e,i),ut:(e,i,s,r,n)=>t.y.ut(e,i,s,r,n)}),ab:t=>t.amplitude});class Yl extends zl{constructor(t,e,i,s,r,n,o,h){super(t,Xl,e,i,s,r,n,o,h),this.Tb=90,this.Fb=12,this.Ib=Gl,this.Om=this.ub.hd(this.fb).setMouseInteractions(!1),this.yb=t=>{let e=180*(t.M-this.fb.Pb())/Math.PI%360;for(;e<0;)e+=360;for(;e>360;)e-=360;if(e>=0&&e<=20||e>=340&&e<=360)return!1},this.hh=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Tb)}setTickStyle(t){return this.Db="function"==typeof t?t(this.Db):t,this.Bb(),this.ub.xs(),this}getTickStyle(){return this.Db}setTickFormattingFunction(t){return this.Ib=t,this.Bb(),this.ub.xs(),this}getTickFormattingFunction(){return this.Ib}setClockwise(t){this.fb.Lb(t);const e=this.Tb*Math.PI/180;return t?this.fb.Rb(e+Math.PI/2):this.fb.Rb(e-Math.PI/2),this.ub.xs(),this}getClockwise(){return!this.fb.Eb()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Tb=t;const e=t*Math.PI/180;return this.getClockwise()?this.fb.Rb(e+Math.PI/2):this.fb.Rb(e-Math.PI/2),this.ub.xs(),this}getNorth(){return 180*this.fb.Pb()/Math.PI}setDivision(t){return this.Fb=t,this.Bb(),this.ub.xs(),this}getDivision(){return this.Fb}Dg(){return[]}Dr(t,e){return e}Lr(t,e,i){return{min:t,max:e}}mb(t,e){const i=t.Eb()?1:-1,s=t.Pb(),r=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}gb(t,e){return t.Ne(e)}vb(t,e,i,s){const r=this.Db,n=t.Eb()?1:-1,o=t.Pb(),h=(s.M-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end,c={x:a*u,y:l*u};e.We({x:0,y:0}).Ge(c);const d={x:c.x+a*r.tickLength*t.Wi().x,y:c.y+l*r.tickLength*t.Wi().y};i.We(c).Ge(d),e.Oe(r.gridStrokeStyle),i.Oe(r.tickStyle)}pb(t,e){const i=this.Db,s=t.Eb()?1:-1,r=t.Pb();let n,o=(e.M-r)*s;for(;o<0;)o+=2*Math.PI;for(;o>=2*Math.PI;)o-=2*Math.PI;n=o>0&&o<=Math.PI?-o+Math.PI/2:-o-Math.PI/2;const h=i.tickLength+i.tickPadding,a=Math.cos(o)*h*t.Wi().x,l=Math.sin(o)*h*t.Wi().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}bb(t,e,i){const s=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end;this.Om.lu(0).Ge(360).fu(0).uu(s+.5*e.getThickness()*t.Wi().x).Au(360).Ie(B).Fe(e)}Mb(t,e,i){const s=t.Pb(),r=this.pb(t,{M:0+s}),n=t.wb()?t.Cb().end-t.Cb().start:t.Cb().start-t.Cb().end;e.Ya(r.alignment).Zh(r.rotation).Va(r.offset.x,r.offset.y).Be(ui({x:n,y:0},r.padding))}Bb(){this.tr({$e:[],Xe:[{Ke:"Radial ticks",Ug:0,yr:this.Db,Ar:this.Ib,Gr:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Fb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},Ih:{Sr:()=>{},Ph:()=>!1},Wr:void 0}],je:Gl,Ze:void 0,Qe:void 0})}}const Gl=(t,e,i)=>(180*t/Math.PI).toFixed(0),Xl={kr:()=>{},Tr:()=>{},Ir:()=>{},ob:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,q:(t,e)=>{},ut:(e,i,s,r,n)=>t.x.ut(e,i,s,r,n)}),ab:t=>t.radial},Zl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),Hl=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class Wl extends Zi{constructor(t,e,i,s,r,n){super(e,i,r,n),this._s="Sector",this.zb=0,this.Vb=1*Math.PI/2,this.Ob=void 0,this.Nb=void 0,this.Is=t,this.fb=s,this.Ty=this.Is.hd(this.fb).us(this.getHighlight()),this.ds(this.Ty),this.we=r.polarSectorFillStyle,this.Ce=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.zb=Ft(t,0,360),this.Is.xs(),this}getAngleStart(){return this.zb}setAngleEnd(t){return this.Vb=Ft(t,0,360),this.Is.xs(),this}getAngleEnd(){return this.Vb}setAmplitudeStart(t){return this.Ob=t,this.Is.xs(),this}getAmplitudeStart(){return this.Ob}setAmplitudeEnd(t){return this.Nb=t,this.Is.xs(),this}getAmplitudeEnd(){return this.Nb}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.Is.xs(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.Is.xs(),this}getStrokeStyle(){return this.Ce}De(){const t=this.fb.Cb(),e=180*this.fb.Pb()/Math.PI,i=void 0!==this.Ob?Ft(this.Ob,t.start,t.end):t.start,s=void 0!==this.Nb?Ft(this.Nb,t.start,t.end):t.end,r=this.fb.wb()?i-t.start:t.start-i,n=this.fb.wb()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.fb.Eb()?1:-1,l=Math.abs(this.Vb-this.zb);this.Ty.lu((this.zb-e)*a).Ge((this.Vb-e)*a).fu(100*o/h).uu(h).Ie(this.we).Fe(this.Ce).Au(Math.ceil(l/2))}Le(t,e){t.us(e),this.Is.xs()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.Ce})}}class jl extends Zi{constructor(){super(...arguments),this.av=!0,this.ov=!0}setAutoScrollingEnabled(t){return this.av=t,this.chart.ls.xs(),this}getAutoScrollingEnabled(){return this.av}yv(){}De(){}bm(){}setCursorEnabled(t){return this.ov=t,this}getCursorEnabled(){return this.ov}setCursorFormattingOverride(t){return this.Av=t,this}getCursorFormattingOverride(){return this.Av}}class Kl extends jl{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Is=t,this.chart=e,this.scale=s}getAmplitudeMin(){return this.Gb?this.Gb.min:void 0}getAmplitudeMax(){return this.Gb?this.Gb.max:void 0}}const $l=(t,e)=>{const i=[],s=e.Cb().start,r=e.Cb().end,n=e.wb(),o=e.Eb()?1:-1,h=e.Pb(),a=Math.abs(r-s),l=Math.min(s,r)+.001*a,u=Math.max(s,r)-.001*a;for(const e of t){const t=Ft(e.amplitude,l,u),r=e.angle*Math.PI/180-h,a=Math.cos(r*o)*(n?t-s:s-t),c=Math.sin(r*o)*(n?t-s:s-t),d=e.color;i.push({x:a,y:c,color:d})}return i},Ql=t=>{const e={min:Be,max:ze};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},ql=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),Jl=(t,e)=>{let i=Ai(t);for(e.Eb()||(i*=-1),i+=180*e.Pb()/Math.PI;i<0;)i+=360;i%=360;const s=ai(t),r=e.Cb(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:zn(r.start,r.end,s/n)}};class tu extends Kl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this._s="Heatmap Series",this.Wb=!0,this.bv=!1,this.Xd=()=>de(this.we);const h=this.chart.getSeries().length;this.we=ye(this.Ki.polarHeatmapSeriesFillStyle||this.Ki.heatmapGridSeriesFillStyle,h);const a=o.amplitudeStart||0,l=o.amplitudeEnd?(o.amplitudeEnd-a)/(o.annuli-1):o.amplitudeStep||1,u={sectors:o.sectors,annuli:o.annuli,amplitudeStart:a,amplitudeStep:l,heatmapDataType:"intensity",dataOrder:o.dataOrder||"annuli"};this.Qn=u,this.Ub=t.Yb(s,[],u).Ie(this.we).us(this.getHighlight()),this.ds(this.Ub);const c=Math.min(u.amplitudeStart,u.amplitudeStart+(u.annuli-1)*u.amplitudeStep),d=Math.max(u.amplitudeStart,u.amplitudeStart+(u.annuli-1)*u.amplitudeStep);this.Gb={min:c,max:d},this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=ct(s,this.chart.ls.At,this.scale),n=Jl(r,this.scale),o=ha(e)?this.Ub.Hb(n):this.Ub.Jc(n);if(!o)return;const h=$l([o],this.scale)[0];return{cursorPosition:{pointMarker:h,pointMarkerScale:this.scale,resultTable:h,resultTableScale:this.scale},series:this,angle:o.angle,amplitude:o.amplitude,intensity:o.cellValue,annulus:o.iAnnulus,sector:o.iSector,lut:H(this.we)?this.we.lut:void 0}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0,intensity:0,sector:0,annulus:0,lut:H(this.we)?this.we.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}invalidateIntensityValues(t){if(this.bv&&this.chart.ls.Xn(dh.Cf),Array.isArray(t)){if(0===t.length||0===t[0].length)return this;const e={x:t.length,y:t[0].length,sectors:"annuli"===this.Qn.dataOrder?t[0].length:t.length,annuli:"annuli"===this.Qn.dataOrder?t.length:t[0].length},i="annuli"===this.Qn.dataOrder?this.Qn.annuli:this.Qn.sectors,s="annuli"===this.Qn.dataOrder?this.Qn.sectors:this.Qn.annuli;if(e.x>i||e.y>s){if(!0===this.chart.mA.Kn){const t=`PolarHeatmapSeries.invalidateIntensityValues intensity matrix overflow.\nHeatmap ${i}x${s}, input ${e.x}x${e.y}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.mA.Kn){const t=`PolarHeatmapSeries.invalidateIntensityValues intensity matrix overflow.\nMax indexes ${o}x${h}, input ${e.primary}x${e.secondary} starting at [${i},${r}].\nOut of bounds data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const a=Math.max(s-o,0),l=e.primary-a,u=Math.max(n-h,0),c=[];for(let e=0;e0?-u:void 0);if(0===(t={iSector:t.iSector,iAnnulus:t.iAnnulus,values:c}).values.length||0===t.values[0].length)return this}this.Ub.FS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.Is.xs(),this.bv=!0,this}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.Ub.Ie(this.we),this.Is.xs(),this}getFillStyle(){return this.we}clear(){return this.Ub.Ot(),this.Is.xs(),this}setIntensityInterpolation(t){return t=t||"disabled",this.Ub.kS(t),this.Is.xs(),this}getIntensityInterpolation(){return this.Ub.TS()}rv(){return this.av&&this.getVisible()}Le(t,e){t.us(e),this.Is.xs()}De(){}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}}class eu extends Kl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this._s="Line Series",this.$b=[],this.Xb=!1,this.jb=!1,this.gu=ye(this.Ki.polarLineSeriesStrokeStyle,n),this.Zb=t.rm(s,void 0,[Oa.UserSeries]).Oe(this.gu).us(this.getHighlight()),this.ds(this.Zb)}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=this.Zb.Qb(s);if(!r)return;const n=Jl(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,"show-nearest")))}setData(t){return 0!==this.$b.length&&this.chart.ls.Xn(dh.Cf),this.$b=ql(t),this.Xb=!0,this.Gb=Ql(this.$b),this.Is.xs(),this}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;return this.Zb.Oe(e),this.Is.xs(),this}getStrokeStyle(){return this.gu}setConnectDataAutomaticallyEnabled(t){return this.jb=t,this.Is.xs(),this}getConnectDataAutomaticallyEnabled(){return this.jb}rv(){return this.av&&this.$b.length>0&&this.getVisible()}Le(t,e){t.us(e),this.Is.xs()}De(){if(this.Xb||this.scale.Jb()){const t=$l(this.$b,this.scale),e=Je(t);this.jb?(t.push({...t[0]}),this.Zb.Ul(!0)):this.Zb.Ul(!1),this.Zb.Ot().dl(t).Ko(e),this.Xb=!1,this.Zb.Ls()}}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.gu})}}class iu extends Kl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this._s="Point Line Series",this.$b=[],this.Xb=!1,this.jb=!1,this.Kb=3,this.ba=0,this.qb=e.PointShape.Circle,this.we=ye(this.Ki.polarPointLineSeriesFillStyle,o),this.gu=ye(this.Ki.polarPointLineSeriesStrokeStyle,o),this.Zb=t.rm(r,void 0,[Oa.UserSeries]).Oe(this.gu).us(this.getHighlight()),this.ds(this.Zb),this.tM=t.Pv(r).Ie(this.we).ol(this.qb).it(this.Kb).us(this.getHighlight()),this.ds(this.tM)}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=this.Zb.Qb(s);if(!r)return;const n=Jl(r,this.scale);return{cursorPosition:{pointMarker:r,pointMarkerScale:this.scale,resultTable:r,resultTableScale:this.scale},series:this,...n}}Qi(t,e){return Pe({series:this},{cursorPosition:0,amplitude:0,angle:0,color:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}setData(t){return 0!==this.$b.length&&this.chart.ls.Xn(dh.Cf),this.$b=ql(t),this.Xb=!0,this.Gb=Ql(this.$b),this.Is.xs(),this}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;return this.Zb.Oe(e),this.Is.xs(),this}getStrokeStyle(){return this.gu}setPointFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;return this.tM.Ie(e),this.Is.xs(),this}getPointFillStyle(){return this.we}setPointSize(t){return this.Kb=t,this.tM.it(t),this.Is.xs(),this}getPointSize(){return this.Kb}setPointShape(t){return this.qb=t,this.tM.ol(this.qb),this}getPointShape(){return this.qb}setPointRotation(t){return this.ba=t,this.tM.Zh(t),this.Is.xs(),this}getPointRotation(){return this.ba}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we,stroke:this.gu})}setConnectDataAutomaticallyEnabled(t){return this.jb=t,this.Is.xs(),this}getConnectDataAutomaticallyEnabled(){return this.jb}rv(){return this.av&&this.$b.length>0&&this.getVisible()}Le(t,e){t.us(e),this.Is.xs()}De(){if(this.Xb||this.scale.Jb()){const t=$l(this.$b,this.scale),e=Je(t);this.jb?(t.push({...t[0]}),this.Zb.Ul(!0)):this.Zb.Ul(!1),this.Zb.Ot().dl(t).Ko(e),this.tM.Ot().dl(t).Ko(e),this.Xb=!1,this.Zb.Ls(),this.tM.Ls()}}Fs(){return this.Ms||this.qb}}class su extends pn{constructor(t,e,i,s,n,o,h,a,l){super(),this.Xo=Fe(),this.R=new r.Eventer,this.$i=!1,this.iM=s,this.sM=n,this.eM=o,this.hM=h,this.rM=a,this.Is=t,this.scale=e,this.nM=i,this.Ki=l}onHighlight(t){return this.R.on("highlight",t)}offHighlight(t){return this.R.off(t)}dispose(){return this.nM&&this.nM(this),this.Is.ls.xs(),this.R.emit("dispose",this),this.$i=!0,this}setVisible(t){return super.setVisible(t),this.eM(),this.Is.ls.xs(),this}isDisposed(){return this.$i}onDispose(t){return this.R.on("dispose",t)}offDispose(t){return this.R.off(t,"dispose")}setMouseInteractions(t){return this.hM(this,t),this}getMouseInteractions(){return this.rM(this)}}class ru extends su{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g,m,p){super(t,e,i,s,r,n,o,h,p),this.oM=1,this.aM=1,this.Is=t,this.scale=e,this.dimensionStrategy=a,this.start=l,this.end=u,this.lowerExtreme=c,this.lowerQuartile=d,this.median=f,this.upperQuartile=g,this.upperExtreme=m,this.boundaries=y(this.dimensionStrategy.toPoint(l,c),this.dimensionStrategy.toPoint(u,m)),this.lM=this.Ki.boxSeriesBodyFillStyle,this.uM=this.Ki.boxSeriesBodyStrokeStyle,this.gu=this.Ki.boxSeriesStrokeStyle,this.cM=this.Ki.boxSeriesMedianStrokeStyle,this.Ls()}getBoundaries(){return this.boundaries}setBodyWidth(t){return this.oM=t,this.Ls(),this}getBodyWidth(){return this.oM}setBodyFillStyle(t){return this.lM="function"==typeof t?t(this.lM):t,this.sM(),this}getBodyFillStyle(){return this.lM}setBodyStrokeStyle(t){return this.uM="function"==typeof t?t(this.uM):t,this.sM(),this}getBodyStrokeStyle(){return this.uM}setTailWidth(t){return this.aM=t,this.Ls(),this}getTailWidth(){return this.aM}setStrokeStyle(t){return this.gu="function"==typeof t?t(this.gu):t,this.sM(),this}getStrokeStyle(){return this.gu}setMedianStrokeStyle(t){return this.cM="function"==typeof t?t(this.cM):t,this.sM(),this}getMedianStrokeStyle(){return this.cM}Ls(){this.iM()}getDominantStyle(){return this.getBodyFillStyle()}}class nu extends jl{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.dM=!0,this.qi=new Map,this.chart=t,this.Is=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.fM=h,this.scale=Ni(s.At,r.At),this.AM=t.gM,t.gM+=1,this.pM(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.yM),this.onMouseLeave(this.chart.mM),this.onMouseWheel(this.chart.uv),this.onMouseDragStart(this.chart.vM),this.onMouseDrag(this.chart.cv),this.onMouseDragStop(this.chart.dv),this.onTouchStart(this.chart.fv.onTouchStart),this.onTouchMove(this.chart.fv.onTouchMove),this.onTouchEnd(this.chart.fv.onTouchEnd)}get xAxis(){return this.axisX}get yAxis(){return this.axisY}SM(){const t=Array.from(this.qi.keys());for(const e of t)if(e.xM)return e.xM}setClipping(t){return this.dM=t,this.Is.xs(),this}getClipping(){return this.dM}attacheAxis(){this.bM=this.axisXAttachHandler(this),this.MM=this.axisYAttachHandler(this)}ds(t,e){super.ds(t,e),t.ra(this.AM)}getName(){const t=this.cs(),e="ProgressiveY"===t||"RegressiveY"===t?this.axisX.getTitle():this.axisY.getTitle();return this._s||e.length>0&&e||"Series"}setDrawOrder(t){return this.AM=t.seriesDrawOrderIndex,this.qi.forEach(((t,e)=>{e.ra(this.AM)})),this.chart.ls.xs(),this}dispose(){return super.dispose(),this.bM(this),this.MM(this),this}bm(){if(super.bm(),this.dM){const t={x:this.scale.x.ei(),y:this.scale.y.ei(),width:this.scale.x.ri(),height:this.scale.y.ri()};this.qi.forEach(((e,i)=>{i._M=t}))}else this.qi.forEach(((t,e)=>{e._M=void 0}))}getBoundaries(){return y(u(this.getXMin()||0,this.getYMin()||0),u(this.getXMax()||0,this.getYMax()||0))}setCursorEnabled(t){return super.setCursorEnabled(t)}}const ou=(t,e,i,s)=>{const r=t.length;let n=0;if(void 0!==e){const r=i-e;if(r>0){const e=t.slice(n,r);n+=r,s(e,!0)}}for(;nt)=>{const i=[];let s;for(let r=0;r{const e=this.wM.findIndex((e=>e===t));e>=0&&this.wM.splice(e,1),this.kM=!0,this.CM=void 0,this.Is.xs()},this.iM=()=>{this.CM=void 0,this.kM=!0,this.chart.ls.xs()},this.sM=()=>{this.kM=!0,this.chart.ls.xs()},this.eM=()=>{this.CM=void 0,this.kM=!0,this.chart.ls.xs()},this.hM=(t,e)=>{this.setMouseInteractions(e)},this.TM=t=>this.getMouseInteractions()}De(){super.De(),this.kM&&(this.FM(this.wM),this.kM=!1)}clear(){return this.wM.slice().forEach(Et),this.wM.length=0,this.kM=!0,this.CM=void 0,this.Is.xs(),this}IM(t,e){void 0!==e?this.wM.splice(e,0,t):this.wM.push(t),this.kM=!0,this.PM&&this.PM(t),t.onMouseEnter(((t,e)=>this._t(t,e,void 0,{}))),t.onMouseLeave(((t,e)=>this.wt(t,e,void 0))),t.onMouseClick(((t,e)=>this.Ct(t,e,void 0,{}))),t.onMouseDoubleClick(((t,e)=>this.kt(t,e,void 0,{}))),t.onMouseDown(((t,e)=>this.Tt(t,e,void 0,{}))),t.onMouseUp(((t,e)=>this.Ft(t,e,void 0,{}))),t.onMouseMove(((t,e)=>this.It(t,e,void 0,{}))),t.onMouseDragStart(((t,e,i)=>this.Dt(t,e,i,void 0,{}))),t.onMouseDrag(((t,e,i,s,r)=>this.Pt(t,e,i,s,r,void 0,{}))),t.onMouseDragStop(((t,e,i,s)=>this.Bt(t,e,i,s,void 0,{}))),t.onMouseWheel(((t,e)=>this.Lt(t,e,void 0,{}))),t.onTouchStart(((t,e)=>this.Rt(t,e,void 0,{}))),t.onTouchMove(((t,e)=>this.Et(t,e,void 0,{}))),t.onTouchEnd(((t,e)=>this.zt(t,e,void 0,{}))),this.Is.xs()}rv(){return this.av&&this.wM.length>0&&this.getVisible()}setDefaultStyle(t){this.PM=t,this.wM.forEach(t),t(this.DM);for(let t=0;t0?this.wM[0].getDominantStyle():this.DM.getDominantStyle()})}}const lu=(t,e=1,i)=>{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i0?e:0,this.Is.xs(),this}add(t){if(0!==this.LM.length&&this.chart.ls.Xn(dh.Cf),Array.isArray(t)?this.zM(t):this.zM([t]),this.bu.length>0){const t=this.bu[this.bu.length-1];this.VM={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.VM?this.VM.y+e:0),this.add(((t,e=1,i)=>{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i{const i=new Array(t.length);for(let s=0;st+e.fl()+e.Al()),this.bu.length)}clear(){this.OM=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.EM.getXMax(this.LM,this.OM)||0}getXMin(){return this.EM.getXMin(this.LM,this.OM)||0}getYMax(){return this.EM.getYMax(this.LM,this.OM)||0}getYMin(){return this.EM.getYMin(this.LM,this.OM)||0}Ir(){const t=u(0,0);for(const e of this.LM)t.x=Math.max(t.x,e.Cl()),t.y=Math.max(t.y,e.kl());return t}NM(t,e,i,s){this.EM.NM(t,e,i,s,this.scale,(t=>{}))}yv(){super.yv(),this.GM&&this.NM(this.LM,this.getPointAmount(),this.GM,this.RM)}De(){super.De();const t=this.getBoundaries();this.bu.length>0&&(this.WM(this.bu),this.bu=[]);for(const e of this.LM)e.Ko(t);return super.De()}bm(){super.bm(),this.OM=void 0,this.bu.length=0}zM(t){0!==t.length&&(this.OM?this.OM=ei(this.OM,Je(t)):this.OM=Je(t),this.R.emit("dataAdd",this,t,this.OM),this.bu=he(this.bu,t,{canReturnB:!1}),this.Is.xs())}UM(){return hu(this.LM)}YM(t){return this.R.on("dataAdd",t)}HM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}XM(t){return this.R.off(t)}}const cu=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;hct(this.Ps.toPoint((t.start+t.end)/2,t.median),this.scale,this.Is.ls.At),this.chart.ls.Xn(dh._f),this.Ps=a,this.DM=new ru(this.Is,this.scale,this.nM,kt,kt,kt,kt,(t=>!1),this.Ps,0,0,0,0,0,0,0,this.Ki).dispose(),this.QM=new ja((()=>{const t=this.Is.Wg(this.scale);return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Oe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i.Yg(e.start,e.end),i}))))),this.JM=new ja((()=>{const t=this.jM.Mt(this.Is.Um(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],start:r[1].start,end:r[1].end,lowerExtreme:r[1].lowerExtreme,lowerQuartile:r[1].lowerQuartile,median:r[1].median,upperQuartile:r[1].upperQuartile,upperExtreme:r[1].upperExtreme,series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,median:0,lowerQuartile:0,upperQuartile:0,lowerExtreme:0,upperExtreme:0,start:0,end:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}pM(t){if(!(t instanceof Bi||t instanceof zi))throw new Error("BoxSeries only supports Linear Axes")}FM(t){const e=this.JM.Mm(),i=this.QM.Mm();t.forEach((t=>{if(!t.getVisible())return;const s=this.Ps.toPoint((t.start+t.end-t.oM*(t.end-t.start))/2,t.lowerQuartile),r=this.Ps.toPoint((t.end-t.start)*t.oM,t.upperQuartile-t.lowerQuartile),n=this.Ps.toPoint((t.start+t.end)/2,t.lowerQuartile),o=this.Ps.toPoint((t.start+t.end)/2,t.lowerExtreme),h=this.Ps.toPoint((t.start+t.end)/2,t.upperQuartile),a=this.Ps.toPoint((t.start+t.end)/2,t.upperExtreme),l=this.Ps.toPoint((t.start+t.end-t.aM*(t.end-t.start))/2,t.lowerExtreme),u=this.Ps.toPoint((t.start+t.end+t.aM*(t.end-t.start))/2,t.lowerExtreme),c=this.Ps.toPoint((t.start+t.end-t.aM*(t.end-t.start))/2,t.upperExtreme),d=this.Ps.toPoint((t.start+t.end+t.aM*(t.end-t.start))/2,t.upperExtreme),f=this.Ps.toPoint((t.start+t.end-t.oM*(t.end-t.start))/2,t.median),g=this.Ps.toPoint((t.start+t.end+t.oM*(t.end-t.start))/2,t.median);e.add({Xo:t.Xo,vertices:[{x:s.x,y:s.y},{x:s.x,y:s.y+r.y},{x:s.x+r.x,y:s.y+r.y},{x:s.x+r.x,y:s.y}],figure:t},{fillStyle:t.lM,strokeStyle:t.uM}),i.add({Xo:0,start:n,end:o,figure:t},{strokeStyle:t.gu}),i.add({Xo:0,start:h,end:a,figure:t},{strokeStyle:t.gu}),i.add({Xo:0,start:l,end:u,figure:t},{strokeStyle:t.gu}),i.add({Xo:0,start:c,end:d,figure:t},{strokeStyle:t.gu}),i.add({Xo:0,start:f,end:g,figure:t},{strokeStyle:t.cM})})),e.finishPlot(),i.finishPlot()}add(t){const e=new ru(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ps,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.Ki);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class fu extends su{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.Ka=y(u(0,0),u(0,0)),this.Is=t,this.scale=e,this.we=ye(a.ellipseSeriesFillStyle,l),this.Ce=ye(a.ellipseSeriesStrokeStyle,l)}getBoundaries(){return this.Ka}setDimensions(t){return this.dimensions=t,this.Ka=y(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.iM(),this.Is.xs(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.sM(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.sM(),this}getStrokeStyle(){return this.Ce}getDominantStyle(){return this.we}}class gu extends au{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this._s="Ellipse Series",this.jM=ke(),this.ZM=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return ct(i,this.scale,this.Is.ls.At)},this.chart.ls.Xn(dh._f),this.KM=c,this.DM=new fu(this.Is,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.Ki,this.KM).dispose(),this.JM=new ja((()=>{const t=this.jM.Mt(this.Is.Um(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],...r[1].getDimensions(),series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,radiusX:0,radiusY:0,drawSteps:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}pM(t){if(!(t instanceof Bi||t instanceof zi))throw new Error("EllipseSeries only supports Linear Axes")}FM(t){const e=this.JM.Mm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=[],r=void 0!==i.drawSteps?i.drawSteps:72;for(let t=0;t<=r;t+=1){const e=t/r*2*Math.PI,n=i.x+i.radiusX*Math.cos(e),o=i.y+i.radiusY*Math.sin(e);s.push({x:n,y:o})}const n=t.getFillStyle(),o=t.getStrokeStyle();e.add({Xo:t.Xo,vertices:s,figure:t},{fillStyle:n,strokeStyle:o})})),e.finishPlot()}add(t){const e=new fu(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ki,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class yu extends su{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.qM=[],this.Ka=Ne,this.Is=t,this.scale=e,this.we=ye(a.polygonSeriesFillStyle,l),this.Ce=ye(a.polygonSeriesStrokeStyle,l)}getBoundaries(){return this.Ka}setDimensions(t){return this.qM=t,this.Ka=Je(this.qM),this.iM(),this.Is.xs(),this}getDimensions(){return this.qM}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.sM(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.sM(),this}getStrokeStyle(){return this.Ce}getDominantStyle(){return this.we}}class mu extends au{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this._s="Polygon Series",this.jM=ke(),this.ZM=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return ct(i,this.scale,this.Is.ls.At)},this.chart.ls.Xn(dh._f),this.KM=c,this.DM=new yu(this.Is,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.Ki,this.KM).dispose(),this.JM=new ja((()=>{const t=this.jM.Mt(this.Is.Um(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],coordinates:r[1].getDimensions(),series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,coordinates:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}pM(t){}FM(t){const e=this.JM.Mm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=t.getFillStyle(),r=t.getStrokeStyle();e.add({Xo:t.Xo,vertices:i,figure:t},{fillStyle:s,strokeStyle:r})})),e.finishPlot()}add(t){const e=new yu(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ki,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class pu extends su{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.t_={x:0,y:0,width:0,height:0},this.i_={x1:0,y1:0,x2:0,y2:0},this.Ka=y(u(0,0),u(0,0)),this.we=ye(a.rectangleSeriesFillStyle,l),this.Is=t,this.scale=e,this.Ce=ye(a.rectangleSeriesStrokeStyle,l)}getBoundaries(){return this.Ka}setDimensions(t){return"x"in t?(this.t_=t,this.i_={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.i_=t,this.t_={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.Ka=Je([this.t_,u(this.t_.x+this.t_.width,this.t_.y+this.t_.height)]),this.iM(),this.Is.xs(),this}getDimensionsPositionAndSize(){return this.t_}getDimensionsTwoPoints(){return this.i_}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.sM(),this}getFillStyle(){return this.we}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.sM(),this}getStrokeStyle(){return this.Ce}getDominantStyle(){return this.we}}class xu extends au{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this._s="Rectangle Series",this.jM=ke(),this.ZM=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return ct(i,this.scale,this.Is.ls.At)},this.chart.ls.Xn(dh._f),this.KM=c,this.DM=new pu(this.Is,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.Ki,this.KM).dispose(),this.JM=new ja((()=>{const t=this.jM.Mt(this.Is.Um(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ie(i.fillStyle).Fe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i._l(e.vertices),this.jM.Vt(i,e.figure),i})))),(()=>{this.jM.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],...r[1].getDimensionsPositionAndSize(),...r[1].getDimensionsTwoPoints(),series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,x1:0,y1:0,x2:0,y2:0,width:0,height:0,multiHit:0,figure:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}pM(t){}FM(t){const e=this.JM.Mm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensionsTwoPoints(),s=[{x:i.x1,y:i.y1},{x:i.x1,y:i.y2},{x:i.x2,y:i.y2},{x:i.x2,y:i.y1}],r=t.getFillStyle(),n=t.getStrokeStyle();e.add({Xo:t.Xo,vertices:s,figure:t},{fillStyle:r,strokeStyle:n})})),e.finishPlot()}add(t){const e=new pu(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ki,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class Au extends su{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.Ka=y(u(0,0),u(0,0)),this.Ki=a,this.Is=t,this.scale=e,this.Ce=ye(a.segmentSeriesStrokeStyle,l)}getBoundaries(){return this.Ka}setDimensions(t){return this.dimensions=t,this.Ka=y(u(Math.min(t.startX,t.endX),Math.min(t.startY,t.endY)),u(Math.max(t.startX,t.endX),Math.max(t.startY,t.endY))),this.iM(),this.Is.xs(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Ce="function"==typeof t?t(this.Ce):t,this.sM(),this}getStrokeStyle(){return this.Ce}getDominantStyle(){const t=this.Ce;return t!==nt?t.getFillStyle():B}}class Su extends au{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this._s="Segment Series",this.s_=ke(),this.ZM=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return ct(i,this.scale,this.Is.ls.At)},this.chart.ls.Xn(dh._f),this.KM=c,this.DM=new Au(this.Is,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.Ki,this.KM).dispose(),this.QM=new ja((()=>{const t=this.s_.Mt(this.Is.Wg(this.scale));return this.ds(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Oe(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Hr();return i.Yg(e.start,e.end),this.s_.Vt(i,e.figure),i})))),(()=>{this.s_.Ot()}),((t,e)=>{this.gs(e)}))}solveNearest(t,e){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.wM.length)return;const r=cu(s,this.wM.filter((t=>t.getVisible())),this.ZM,Ke);if(!r)return;const n=ct(r[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},...n,figure:r[1],...r[1].getDimensions(),series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,figure:0,startX:0,startY:0,endX:0,endY:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}pM(t){}FM(t){const e=this.QM.Mm();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s={x:i.startX,y:i.startY},r={x:i.endX,y:i.endY},n=t.getStrokeStyle();e.add({Xo:t.Xo,start:s,end:r,figure:t},{strokeStyle:n})})),e.finishPlot()}add(t){const e=new Au(this.Is,this.scale,this.nM,this.iM,this.sM,this.eM,this.hM,this.TM,this.Ki,this.KM).setDimensions(t);return this.IM(e),this.kM=!0,this.chart.ls.xs(),e}}class vu extends nu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this._s="Heatmap Grid Series",this.vS={},this.chart.ls.Xn(dh.Mf),this.e_=a,this.Ki=l;const d=c;this.we=ye(l.heatmapGridSeriesFillStyle,d),this.SS=ye(this.Ki.heatmapGridSeriesWireframeStyle,d);const f={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows};this.Qn=f,this.h_=this.Is.r_(this.scale,[],f).Ie(this.we).xS(this.SS).us(this.getHighlight()),this.ds(this.h_),this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=ct(s,this.Is.ls.At,this.scale),n=ha(e)?this.h_.Hb(r):this.h_.Jc(r);if(n)return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},x:n.x,y:n.y,column:n.column,row:n.row,intensity:n.cellValue,series:this,axisX:this.axisX,axisY:this.axisY,lut:H(this.we)?this.we.lut:void 0}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,intensity:0,column:0,row:0,lut:H(this.we)?this.we.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}MS(){const t=this.vS.start||{x:0,y:0};let e;e=this.vS.end?{x:(this.vS.end.x-t.x)/this.Qn.columns,y:(this.vS.end.y-t.y)/this.Qn.rows}:this.vS.step?this.vS.step:{x:1,y:1},this.h_._S(t,e),this.chart.ls.xs()}setStart(t){return this.vS.start=t,this.MS(),this}getStart(){return this.h_.wS().start}setStep(t){return this.vS.step=t,this.MS(),this}getStep(){return this.h_.wS().step}setEnd(t){return this.vS.end=t,this.MS(),this}getEnd(){return this.h_.wS().end}clear(){return this.h_.Ot(),this.Is.xs(),this.R.emit("dataClear",this),this}setWireframeStyle(t){return this.SS="function"==typeof t?t(this.SS):t,this.h_.xS(this.SS),this.Is.xs(),this.R.emit("styleChange",this),this}getWireframeStyle(){return this.SS}setIntensityInterpolation(t){return t=t||"disabled",this.h_.kS(t),this.Is.xs(),this.R.emit("styleChange",this),this}getIntensityInterpolation(){return this.h_.TS()}rv(){return this.av&&this.getVisible()}Xd(){return de(this.we)}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}n_(t){this.h_.n_().forEach((e=>{t.h_.FS(e)}))}XM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}o_(t){return this.R.on("styleChange",t)}a_(t){return this.R.off(t)}getXMax(){const t=this.h_;return t?t.St():void 0}getXMin(){const t=this.h_;return t?t.vt():void 0}getYMax(){const t=this.h_;return t?t.bt():void 0}getYMin(){const t=this.h_;return t?t.xt():void 0}Ir(){const t=u(0,0);return t.x=Math.max(t.x,this.h_.Cl()),t.y=Math.max(t.y,this.h_.kl()),t}pM(t){if(!(t instanceof Bi))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Bi&&t._i())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}Le(t,e){t.us(e),this.Is.xs()}De(){return super.De(),this.h_.Ko(this.getBoundaries()),this}}class bu extends vu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u,c),this.bv=!1}invalidateIntensityValues(t){if(this.bv&&this.chart.ls.Xn(dh.Cf),Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Qn.dataOrder?t.length:t[0].length,rows:"rows"===this.Qn.dataOrder?t.length:t[0].length},i="columns"===this.Qn.dataOrder?this.Qn.columns:this.Qn.rows,s="columns"===this.Qn.dataOrder?this.Qn.rows:this.Qn.columns;if(e.x>i||e.y>s){if(!0===this.chart.mA.Kn){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Qn.columns}x${this.Qn.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.mA.Kn){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Qn.columns}x${this.Qn.rows}, input ${e.columns}x${e.rows} starting at [${t.iColumn},${t.iRow}].\nOut of bounds data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(i)}const i=Math.max(s-o,0),r=e.primary-i,a=Math.max(n-h,0),l=[];for(let e=0;e0?-a:void 0);t={iColumn:t.iColumn,iRow:t.iRow,values:l}}this.h_.FS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.R.emit("invalidateIntensity",this,t),this.Is.xs(),this.bv=!0,this}setFillStyle(t){return this.we="function"==typeof t?t(this.we):t,this.h_.Ie(this.we),this.R.emit("styleChange",this),this.Is.xs(),this}getFillStyle(){return this.we}l_(t){return this.R.on("invalidateIntensity",t)}u_(t){return this.R.off(t)}}class Mu extends nu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this._s="Scrolling Heatmap Grid Series",this.vS={},this.chart.ls.Xn(dh.Mf),this.chart.ls.Xn(dh.Cf);const d=c;this.we=ye(l.heatmapScrollingGridSeriesFillStyle,d),this.SS=ye(this.Ki.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",...a};this.Qn=f,this.c_=this.Is.d_(this.scale,[],f).Ie(this.we).xS(this.SS).us(this.getHighlight()),this.ds(this.c_),this.setHighlightOnHover(!1)}solveNearest(t,e="show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=ct(s,this.Is.ls.At,this.scale),n=ha(e)?this.c_.Hb(r):this.c_.Jc(r);if(n)return{cursorPosition:{resultTable:n,resultTableScale:this.scale,pointMarker:n,pointMarkerScale:{x:this.axisX,y:this.axisY}},x:n.x,y:n.y,column:n.column,row:n.row,intensity:n.cellValue,series:this,axisX:this.axisX,axisY:this.axisY,lut:H(this.we)?this.we.lut:void 0}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,intensity:0,multiHit:0,column:0,row:0,lut:H(this.we)?this.we.lut:void 0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}MS(){const t=this.vS.start||{x:0,y:0};let e;e=this.vS.step?this.vS.step:{x:1,y:1},this.c_._S(t,e),this.chart.ls.xs()}setStart(t){return this.vS.start=t,this.MS(),this}getStart(){return this.c_.wS().start}setStep(t){return this.vS.step=t,this.MS(),this}getStep(){return this.c_.wS().step}clear(){return this.c_.Ot(),this.Is.xs(),this}setWireframeStyle(t){return this.SS="function"==typeof t?t(this.SS):t,this.c_.xS(this.SS),this.Is.xs(),this}getWireframeStyle(){return this.SS}setPixelInterpolationMode(t){return t=t||"disabled",this.c_.kS(t),this.Is.xs(),this}getPixelInterpolationMode(){return this.c_.TS()}setDataCleaning(t){return this.c_._u(t),this.Is.xs(),this}rv(){return this.av&&this.getVisible()}Xd(){return de(this.we)}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}Ie(t){return this.we="function"==typeof t?t(this.we):t,this.c_.Ie(this.we),this.Is.xs(),this}pM(t){if(!(t instanceof Bi))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Bi&&t._i())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.c_.St()||0}getXMin(){return this.c_.vt()||0}getYMax(){return this.c_.bt()||0}getYMin(){return this.c_.xt()||0}Ir(){const t=u(0,0);return t.x=Math.max(t.x,this.c_.Cl()),t.y=Math.max(t.y,this.c_.kl()),t}Le(t,e){t.us(e),this.Is.xs()}}class wu extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u,c)}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.Qn.scrollDimension?t.length:t[0].length,"rows"===this.Qn.scrollDimension?t.length:t[0].length,0+i-1),r=this.Qn.resolution-1;if(s>r){if(!0===this.chart.mA.Kn){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.Qn.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;wt.console.warn(t)}const s=[];for(let i=0;i{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.slice()},this.p_=[],this.y_=[],this.m_=!1,this.v_=(t,e)=>{const i=t.Qb(e);if(i)return[ct(i[0],this.scale,this.Is.ls.At),ct(i[1],this.scale,this.Is.ls.At)]},this.S_=(t,e)=>{const i=t.x_(e);if(i)return[ct(i[0],this.scale,this.Is.ls.At),ct(i[1],this.scale,this.Is.ls.At)]},this.Xd=()=>de(this.b_)||de(this.M_),this.__=t=>{const e=t.length;if(this.LM.length>0){const i=this.LM.length-1,s=this.LM[i];if(e>0){const[e,i]=s.nl(),[r,n]=s.rl();if((r?e.length+r.length:e.length)>=this.GM){const o=r&&r.length>0?r[r.length-1]:e[e.length-1],h=n&&n.length>0?n[n.length-1]:i[e.length-1],a=(o.x+t[0].position)/2,l=mi(a,o,u(t[0].position,t[0].high)).y,c=mi(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.dl(f,y(u(a,c),u(a,l))).Ul(!0),this.w_([f].concat(t)).Gl(!0)}else s.dl(t)}}else e>0&&this.w_(t)},this.C_=t=>{const e=this.p_,i=t.length;if(this.p_.length>0){if(i>0){const i=e[e.length-1],s=i.nl(),r=i.rl();if(s.length+r.length>=this.GM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=mi(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.dl(a,y(u(o,h),u(o,h))).Ul(!0),e.push(this.k_([a].concat(t),this.OM).Gl(!0))}else i.dl(t)}}else i>0&&e.push(this.k_(t))},this.T_=t=>{const e=this.y_,i=t.length;if(this.y_.length>0){if(i>0){const i=e[e.length-1],s=i.nl(),r=i.rl();if(s.length+r.length>=this.GM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=mi(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.dl(a,y(u(o,h),u(o,h))).Ul(!0),e.push(this.F_([a].concat(t)).Gl(!0))}else i.dl(t)}}else i>0&&e.push(this.F_(t))}}cs(){return"ProgressiveX"}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.RM=void 0!==e&&e>0?e:0,this.Is.xs(),this}clear(){for(let t=0;tt+e.fl()+e.Al()),this.bu.length)}getXMax(){return Yt(this.LM,Vt,Math.max,Nt,this.OM)||0}getXMin(){return Yt(this.LM,Lt,Math.min,zt,this.OM)||0}getYMax(){return Yt(this.LM,Bt,Math.max,Ut,this.OM)||0}getYMin(){return Yt(this.LM,_t,Math.min,Ot,this.OM)||0}Ir(){const t=u(0,0);for(const e of this.LM)t.x=Math.max(t.x,e.Cl()),t.y=Math.max(t.y,e.kl());return t}rv(){return this.av&&this.getPointAmount()>0&&this.getVisible()}pM(t){}zM(t,e,i){this.bu=he(this.bu,t,{canReturnB:!1}),this.A_=he(this.A_,e,{canReturnB:!1}),this.g_=he(this.g_,i,{canReturnB:!1}),this.Is.xs()}I_(t,e,i,s){this.P_(e,i,s),this.zM(Array.isArray(t)?t:[t],e,i)}P_(t,e,i){const s=ei(Je(t),Je(e));this.OM?this.OM=ei(this.OM,s):this.OM=s,i&&(this.OM=ei(this.OM,i))}D_(){const t=this.LM.length,e=Math.min(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd());let i=0;if(t>1)for(let s=0;s0){const r=Math.ceil(i/e),n=t.length-r;if(n>0&&s>0){const e=n-s>0?s:n;if(e>0){for(let i=0;i0?this.LM[this.LM.length-1]:void 0,i=e?e.nl()[0].length+(e.rl()[0]?e.rl()[0].length:0):void 0;ou(t,i,this.GM,this.__)}L_(t){const e=this.p_.length>0?this.p_[this.p_.length-1].nl().length+this.p_[this.p_.length-1].rl().length:void 0;ou(t,e,this.GM,this.C_)}R_(t,e){const i=this.p_.length>0?this.p_[this.p_.length-1].nl().length+this.p_[this.p_.length-1].rl().length:void 0;ou(t,i,this.GM,this.C_),ou(e,i,this.GM,this.T_)}w_(t,e){const i=this.Is.E_(this.scale).dl(t,e).Ie(this.b_).Ol(this.M_).zl(this.Il).us(this.getHighlight());return this.LM.push(i),this.ds(i),i}z_(t,e,i){const s=this.Is.rm(this.scale,void 0,[Oa.UserSeries]).dl(t,i).setMouseInteractions(!1).Oe(e).us(this.getHighlight());return this.ds(s),s}k_(t,e){return this.z_(t,this.V_,e)}F_(t,e){return this.z_(t,this.O_,e)}N_(t){this.b_="function"==typeof t?t(this.b_):t;const e=this.b_;for(let t=0;t0){const t=this.D_();this.NM(this.LM,this.GM,this.RM,t),this.p_.length>0&&this.NM(this.p_,this.GM,this.RM,t),this.y_.length>0&&this.NM(this.y_,this.GM,this.RM,t),this.m_=!0}}De(){if(super.De(),this.bu.length>0&&(this.B_(this.bu),this.Z_(this.A_,this.g_),this.m_=!0),this.m_){const t=this.getBoundaries();for(const e of this.LM)e.Ko(t);for(const e of this.p_)e.Ko(t);for(const e of this.y_)e.Ko(t)}}bm(){this.OM=void 0,this.bu.length=0,this.A_.length=0,this.g_.length=0}}class Ru extends Tu{constructor(t,e,i,s,r,n,o,h,a=0,l,u){super(t,e,i,s,r,n,o,h,l,u),this.chart.ls.Xn(dh.bf),this.Q_=a}add(t){0!==this.LM.length&&this.chart.ls.Xn(dh.Cf);const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.J_(e),[i,s]=this.K_(t);this.I_(t,i,s,y(u(Be,this.Q_),u(ze,this.Q_)));const r=this.bu[this.bu.length-1];this.VM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.R.emit("dataAdd",this,e,this.OM)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.VM?this.VM.position+e:0),this.add(lu(t,e,s)),this}YM(t){return this.R.on("dataAdd",t)}HM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}XM(t){return this.R.off(t)}}class Eu extends Ru{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l,u);const c=t.getSeries().length;this.b_=ye(this.Ki.areaSeriesBipolarHighFillStyle,c),this.V_=ye(this.Ki.areaSeriesBipolarHighStrokeStyle,c),this.M_=ye(this.Ki.areaSeriesBipolarLowFillStyle,c),this.O_=ye(this.Ki.areaSeriesBipolarLowStrokeStyle,c)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=Cu(s,this.LM,ha(e)?this.S_:this.v_);if(void 0!==r&&void 0!==r[0]){const t=ct(r[0][0],this.Is.ls.At,this.scale),e=ct(r[0][1],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY,multiHit:[t,e]}}}J_(t){return this.q_(t)}Z_(t,e){return this.R_(t,e)}q_(t){let e=0;const i=[],s=t.length,r=this.Q_;return s>0&&(this.tw&&(this.tw.y<=r&&r<=t[0].y||this.tw.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.tw.x+t[0].x),r,r),e+=1),this.tw=t[s-1],1===s?this.iw(t[0],i,e):this.sw(t,i)),i}iw(t,e,i=0){return e[i]=d(t.x,t.y,this.Q_),i+1}sw(t,e){let i=0,s=0;const r=t.length-1,n=this.Q_;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:zn(r.x,o.x,(h-t)/(s-t));e[i]=d(a,n,n),i+=1}e[i]=d(o.x,o.y,n),i+=1}return i}K_(t){const e=t.length,i=Array(e),s=Array(e),r=this.Q_;for(let n=0;nr?(i[n]=u(e.position,e.high),s[n]=u(e.position,r)):e.hight[0]))}setPositiveFillStyle(t){return this.N_(t),this}setNegativeFillStyle(t){return this.G_(t),this}setPositiveStrokeStyle(t){return this.U_(t),this}setNegativeStrokeStyle(t){return this.Y_(t),this}getPositiveFillStyle(){return this.W_()}getNegativeFillStyle(){return this.Nl()}getPositiveStrokeStyle(){return this.H_()}getNegativeStrokeStyle(){return this.X_()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.b_,fill2:this.M_,behavior:{colorStep:!0}})}}class ku extends Ru{constructor(){super(...arguments),this.O_=nt}Z_(t){return this.L_(t)}K_(t){const e=t.length,i=Array(e);for(let s=0;ss?d(t.x,s,s):d(t.x,t.y,s),i+1}sw(t,e,i=0){let s=0;const r=t.length-1,n=this.Q_;for(;sn){const t=vi(u(ze,n),u(Be,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,n,n),i+=1}else e[i]=d(o.x,o.y,n),i+=1}else{const t=d(r.x,n,n);if(0!==i&&Gt(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=vi(u(ze,n),u(Be,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,o.y,n),i+=1}else e[i]=d(o.x,n,n),i+=1}}return i}UM(){return hu(this.LM,(t=>t[1]))}setFillStyle(t){return this.G_(t),this}getFillStyle(){return this.Nl()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.M_,stroke:this.V_})}}class Fu extends ku{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u);const d=c;this.b_=ye(this.Ki.areaSeriesPositiveFillStyle,d),this.M_=B,this.V_=ye(this.Ki.areaSeriesPositiveStrokeStyle,d)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=Cu(s,this.LM,ha(e)?this.S_:this.v_);if(void 0!==r&&void 0!==r[0]){const t=ct(r[0][0],this.Is.ls.At,this.scale),e=ct(r[0][1],this.Is.ls.At,this.scale),i=t.y=n){const t=d(r.x,r.y,n);if(0!==i&&Gt(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=vi(u(ze,n),u(Be,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,o.y,n),i+=1}else e[i]=d(o.x,n,n),i+=1}}return i}UM(){return hu(this.LM,(t=>t[0]||[]))}setFillStyle(t){return this.N_(t),this}getFillStyle(){return this.W_()}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.b_,stroke:this.V_})}}const Du={Positive:Fu,Negative:Iu,Bipolar:Eu};class Pu extends Tu{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.chart.ls.Xn(dh.bf);const c=u;this.b_=ye(this.Ki.areaRangeSeriesFillStyle,c),this.V_=ye(this.Ki.areaRangeSeriesStrokeStyle,c),this.M_=ye(this.Ki.areaRangeSeriesFillStyleInverted,c),this.O_=ye(this.Ki.areaRangeSeriesStrokeStyleInverted,c)}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=Cu(s,this.LM,ha(e)?this.S_:this.v_);if(void 0!==r&&void 0!==r[0]){const t=ct(r[0][0],this.Is.ls.At,this.scale),e=ct(r[0][1],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY,multiHit:[t,e]}}}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.I_(t,i,s);const r=this.bu[this.bu.length-1];return this.VM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.R.emit("dataAdd",this,e,this.OM),this}addArraysHighLow(t,e,i=1,s=0){if(t.length!==e.length)throw new Error("arrayHigh and arrayLow lengths are not equal");{let r=s;r||(r=this.VM?this.VM.position+i:0),this.add(((t,e,i=1,s)=>{const r=void 0!==s?s:0,n=new Array(t.length);for(let s=0;s{const e=t[0],i=t[1];if(!e||!i)return[];const s=[],r=e.length;for(let t=0;t{const i=[],s=t.length,r=e;if(s>0){let e=0,n=t[0];i[e]=n,e+=1;for(let o=1;o{const i=t*t,s=i*t,r=1-t,n=r*r,o=n*r;return u(o*e[0].x+3*t*n*e[1].x+3*i*r*e[2].x+s*e[3].x,o*e[0].y+3*t*n*e[1].y+3*i*r*e[2].y+s*e[3].y)},Bu=(t,e=32)=>{if(2===t.length)return[t[0],t[1]];const i=(t=>{const e=1e-5,i=t.length-1,s=Array(i);if(i>1){let r=u(0,0),n=u(0,0),o=u(0,0),h=oi(ci(t[1],t[0]));const a=3;let l=0,c=0;for(let d=0;de?Math.abs(i/(a*r.x)):1,c=Math.abs(n.x)>e?Math.abs(i/(a*n.x)):1}f[1]=ui(li(r,l),f[1]),f[2]=ci(f[2],li(n,c)),s[d]=f}}return s.length>0?s:[]})(t),s=i.length,r=Array(s*e);let n=0;for(let t=0;t{const i=t.Jc(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.aw=(t,e)=>{const i=t.x_(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.lw=t=>{if(this.LM.length>0){const e=this.LM[this.LM.length-1];if(t.length>0){const i=e.nl(),s=e.rl(),r=i.length+s.length-+e.Wl();if(r>=this.GM){const n=s.length>0?s[s.length-1]:i[e.Wl()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.dl(o,y(u(o.x,o.y),u(o.x,o.y))).Ul(!0),this.uw([o].concat(t)).Gl(!0)}else e.dl(t,this.OM)}}else t.length>0&&this.uw(t)},this.cw=t=>{if(this.nw.length>0){const e=this.nw[this.nw.length-1];t.length>0&&((e.nl().length+e.rl().length)*this.rw>=this.GM?this.dw(t):e.dl(t))}else t.length>0&&this.dw(t)},this.Qn=m,this.qb=l,this.fw=f,this.Aw=ye(c.pointLineSeriesFillStyle,g),this.gu=ye(this.Ki.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}UM(){return hu(this.nw)}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;for(let t=0;te.setVisible(t))),this}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.LM.length)return;const r=this.LM[0].Zo()||zr.NearestX,n=ha(e)?cu(s,this.LM,this.aw,r===zr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===zr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):cu(s,this.nw,this.ow,r===zr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===zr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==n){const t=ct(n[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY}}}Xd(){return de(this.Aw)||de(this.gu.getFillStyle())}Fs(){return this.Ms||this.qb}pM(t){}Le(t,e){t.us(e),this.Is.xs()}WM(t){const e=this.LM.length>0?this.LM[this.LM.length-1].nl().length+this.LM[this.LM.length-1].rl().length-+this.LM[this.LM.length-1].Wl():void 0;ou(t,e,this.GM,this.lw),ou(t,e,this.GM,this.cw)}dw(t,e){const i=this.Is.Pv(this.scale).dl(t,e).setMouseInteractions(this.Yi).Ie(this.Aw).ol(this.qb).it(this.Kb).Zh(this.ba).ll(this.Za).ul(this.Qa).cl(this.Ja).us(this.getHighlight());return this.ds(i),this.nw.push(i),i}uw(t,e){const i=this.Is.rm(this.scale,void 0,[Oa.UserSeries,...this.fw]).dl(t,e).setMouseInteractions(this.Yi).Oe(this.gu).us(this.getHighlight());return this.ds(i),this.LM.push(i),i}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.gu,fill:this.Aw})}getPointAmount(){return this.nw.reduce(((t,e)=>t+e.fl()+e.Al()),this.bu.length)}clear(){super.clear();for(let t=0;t{}))}}const Nu=(t,e)=>t.rl().length>=e?t.rl().slice(-e):Array.prototype.concat(t.nl(),t.rl()).slice(-e),Ou=(t,e,i)=>{const s=Array.prototype.concat(t.nl(),t.rl()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Ot().dl(s).Ls()};class Uu extends zu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g){super(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g),this.rw=32,this.GM=8e3,this.gw=t=>{if(0===t.length)return;const e=this.nw.length;if(e>0){const i=e>1,s=this.nw[e-1];if(i){const i=Array.prototype.concat(s.nl(),s.rl()),r=i.length;if(32*r>=this.GM){const i=Nu(s,3),r=Array.prototype.concat(i,t),n=Bu(r,32);Ou(this.LM[e-1],n,32),this.uw(n.slice(66))}else if(r<5){const s=this.nw[e-2],r=Nu(s,3),n=Array.prototype.concat(r,i,t),o=Bu(n,32),h=this.LM[e-1],a=o.slice(66);h.Ot().dl(a).Ls()}else{const i=this.LM[e-1],r=Array.prototype.concat(i.nl(),i.rl()),n=Nu(s,4),o=Array.prototype.concat(n,t),h=Bu(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Ot().dl(a).Ls()}}else{const i=Array.prototype.concat(s.nl(),s.rl()),r=i.length,n=this.LM[e-1];if(32*r>=this.GM){const e=Nu(s,3),i=Array.prototype.concat(e,t),r=Bu(i,32);Ou(this.LM[0],r,32),this.uw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=Bu(e,32);n.Ot().dl(s).Ls()}else n.dl(t)}}else{const e=t.length>0?Bu(t,32):t,i=Je(e);this.uw(e,i)}this.cw(t)}}WM(t){const e=this.nw.length,i=this.nw.length>0?this.nw[e-1].nl().length+this.nw[e-1].rl().length:void 0;ou(t,i,Math.ceil(this.GM/this.rw),this.gw)}}class Yu{constructor(){this.Gi="FreeformPattern",this.Il={type:"disabled",packager:(t,e,i)=>t.slice()}}NM(t,e,i,s,r,n){if(s>0){const r=Math.trunc((e-s)/i);if(r>0&&t.length>1){const e=t.splice(0,r);for(let t=0;t{switch(t){case"normal":default:return 1;case"high":return.25}},Xu=s.Record({Il:{type:"disabled",packager:(t,e,i)=>t.slice()}});class Zu extends Xu{NM(t,e,i,s,r,n){if(s>0){const e=Math.ceil(s/i),o=t.length-e;if(o>0){const e=this.D_(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.xt();return t?Math.min(i,t):i},Wu=(t,e)=>{const i=e.bt();return t?Math.max(i,t):i};class ju extends Zu{pw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(Wu,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(Hu,e?e.min.y:void 0)}}const Ku=(t,e)=>{const i=e.vt();return t?Math.min(i,t):i},$u=(t,e)=>{const i=e.St();return t?Math.max(i,t):i};class Qu extends Zu{pw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce($u,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(Ku,e?e.min.x:void 0)}}const qu={horizontalProgressive:new class extends ju{constructor(){super({Il:Dr()}),this.Gi="HorizontalProgressivePattern"}D_(t,e){const i=t.length,s=Math.min(e.x.getInnerStart(),e.x.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1].St():void 0}getXMin(t=[],e){return t.length>0&&t[0].fl()>0?t[0].vt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",Dr(Gu(t)))}},horizontalRegressive:new class extends ju{constructor(){super({Il:Pr()}),this.Gi="HorizontalRegressivePattern"}D_(t,e){const i=t.length,s=Math.max(e.x.getInnerStart(),e.x.getInnerEnd());let r=0;if(i>1)for(let n=0;n0&&t[0].fl()>0?t[0].St():e?e.max.x:void 0}getXMin(t=[],e){return void 0!==e?e?e.min.x:void 0:t.length>0?t[t.length-1].vt():void 0}setPrecision(t){return this.set("_columnPackaging",Pr(Gu(t)))}},verticalProgressive:new class extends Qu{constructor(){super({Il:Lr()}),this.Gi="VerticalProgressivePattern"}D_(t,e){const i=t.length,s=Math.min(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1].bt():void 0}getYMin(t=[],e){return t.length>0&&t[0].fl()>0?t[0].xt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",Lr(Gu(t)))}},verticalRegressive:new class extends Qu{constructor(){super({Il:Vr()}),this.Gi="VerticalRegressivePattern"}D_(t,e){const i=t.length,s=Math.max(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0&&t[0].fl()>0?t[0].bt():e?e.max.y:void 0}getYMin(t=[],e){return void 0!==e?e?e.min.y:void 0:t.length>0?t[t.length-1].xt():void 0}setPrecision(t){return this.set("_columnPackaging",Vr(Gu(t)))}},freeform:new Yu};class Ju extends zu{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g,m){super(t,e,i,s,r,n,o,h,qu.horizontalProgressive,a,c,d,f,g,m),this.lw=t=>{const e=this.LM.length>0?this.LM[this.LM.length-1].nl().length+this.LM[this.LM.length-1].rl().length:void 0;ou(t,e,this.GM,this.yw)},this.yw=t=>{const e=t.length;if(this.LM.length>0){const i=this.LM[this.LM.length-1];if(e>0){const e=i.nl(),s=i.rl(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Vu([r].concat(t),this.mw);n.shift();const o=u((r.x+n[0].x)/2,(r.y+n[0].y)/2),h=Array.prototype.concat(o,n);(s.length>0?e.length+s.length:e.length)>=this.GM?(i.dl(o,y(u(o.x,o.y),u(o.x,o.y))).Ul(!0),this.uw(h).Gl(!0),this.dw(t)):i.dl(h)}}else e>0&&this.uw(Vu(t,this.mw));this.cw(t)},this.mw=l,void 0===this.fw.find((t=>"DataPattern"===t.type))&&this.fw.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class tc extends nu{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Sw=t=>t[4]>=t[1],this.CM=y(c(Be,Be),c(ze,ze)),this.xw=[],this.bw=!1,this.Mw=-1,this._w=[],this.ww=!0,this.Cw=!1,this.kw=4,this.Tw=[1e-7,1e-6,1e-5,1e-4,.001,.01,.1,1,5,10,30,60,300,600,1800,3600,7200,14400,28800,36e3,43200,50400,57600,64800,72e3,86400,172800,259200,345600,432e3,604800,1209600,2592e3,7776e3,10368e3,15552e3,31536e3,15768e4,31536e4,63072e4,7884e5,15768e5,31536e5,3942e6,47304e5,63072e5,7884e6,15768e6,31536e6,3942e7,47304e6,63072e6,7884e7,15768e7,31536e7,63072e7,7884e8,15768e8,31536e8,47304e8,63072e8],this.chart.ls.Xn(dh.df)}UM(){return this._w}YM(t){return this.R.on("dataAdd",t)}HM(t){return this.R.off(t)}$M(t){return this.R.on("dataClear",t)}XM(t){return this.R.off(t)}rv(){return this.av&&this._w.length>0&&this.getVisible()}Fw(t){if(!(this._w.length<1))return[this._w[t][0],this._w[t][1],this._w[t][2],this._w[t][3],this._w[t][4]]}solveNearest(t,e){if(0===this._w.length)return;const i=this.chart.translateCoordinate(t,{x:this.axisX,y:this.axisY}).x,s=void 0!==this.getPackDataState();let r,n,o,h,a;if(s){const t=this.Iw;if(!t)return;const e=Ee(i,t.length-1,(e=>t[e][0])),s=void 0!==e&&t[e];if(!s)return;h=s[3],o=s[2],n=s[1],a=s[4],r=s[0]}else{const t=Ee(i,this._w.length-1,(t=>this._w[t][0])),e=void 0!==t&&this._w[t];if(!e)return;r=e[0],n=e[1],o=e[2],h=e[3],a=e[4]}return{cursorPosition:{resultTable:u(r,a),resultTableScale:this.scale,pointMarker:u(r,a),pointMarkerScale:{x:this.axisX,y:this.axisY}},x:r,y:a,open:n,high:o,low:h,close:a,position:r,isPacked:s,series:this,axisX:this.axisX,axisY:this.axisY}}Qi(t,e){return Pe({series:this,axisX:this.axisX,axisY:this.axisY},{cursorPosition:0,x:0,y:0,multiHit:0,open:0,high:0,low:0,close:0,position:0,isPacked:0},(()=>this.solveNearest(e,this.chart.getCursorMode())))}pM(t){if(!(t.x instanceof Li))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.Pw=t.x}Ir(){return u(5,5)}m_(t){const e=t.length-1;if(e<0)return this;for(let i=0;i<=e;i+=1)t[i][3]0&&this.chart.ls.Xn(dh.Cf);const e=Array.isArray(t[0])?t:[t[0]];if(e.length>0){this.bw=!0;const t=this._w.length,i=this.xw.length,s=e.length;this._w.length=t+s,this.xw.length=i+s;for(let r=0;rthis.Tw[t]));return void 0===i?i=e=1){for(let e=0;e=1&&(t!==this.Mw||this.bw||this.Cw)){this.Cw=!1,this.Mw=t,this.bw=!1,this.Bw(),this.Iw=[];const e=this._w.length;let i=this._w[0][0]-this._w[0][0]%(t/2)+t,s=0;for(;s({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...Ja(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Ir().x))}),nc=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...Ja(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Ir().y))});class oc extends pa{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,h),this.iC=!1,this.sC=!1,this.eC=!1,this.hC=!1,this.rC=new Map,this.nC=new Map,this.oC=[],this.aC=[],this.lC=!0,this.uC=!0,this.cC=new Set,this.dC=!1,this.ny=r,this.fC=n,this.AC=o,this.gC=h.cursorGridStrokeStyleX,this.pC=h.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.rC.forEach((t=>t.forEach((t=>t.dispose())))),this.nC.forEach((t=>t.forEach((t=>t.dispose())))),this.oC.length=0,this.aC.length=0,this.ey.length=0,this}De(){return this.oC.forEach((t=>t.setVisible(this.Xi&&this.hp).setMarkerVisible(this.Xi&&this.hp&&this.lC))),this.aC.forEach((t=>t.setVisible(this.Xi&&this.hp).setMarkerVisible(this.Xi&&this.hp&&this.uC))),super.De()}setPosition(...t){if(this.oC.forEach((t=>t.setVisible(!1))),this.aC.forEach((t=>t.setVisible(!1))),this.oC.length=0,this.aC.length=0,0===t.length)return this;const e=this.renderingScale,i=t[0].resultTable,s=Jh(t[0].resultTableScale,e),r=s===this.scale?i:ct(i,s,this.scale);this.Gp.setPosition(r),this.hp=!1,this.ty.forEach((t=>{t.targetVisible=!1}));const n=new Map;return t.forEach(((t,i)=>{const s=t.pointMarkerScale.x,r=t.pointMarkerScale.y,o=n.get(s)||[],h=n.get(r)||[],a=!o.includes(t.pointMarker.x),l=!h.includes(t.pointMarker.y);o.push(t.pointMarker.x),h.push(t.pointMarker.y),n.set(s,o),n.set(r,h);const c=t.pointMarker,d=lc(u(c.x,c.y),s,r);if(a){const t=this._h(s,!0);t.setValue(c.x),t.setGridStrokeLength(this.iC?d.x:1).setAllocatesAxisSpace(this.dC),this.oC.push(t)}if(l){const t=this._h(r,!1);t.setValue(c.y),t.setGridStrokeLength(this.sC?d.y:1).setAllocatesAxisSpace(this.dC),this.aC.push(t)}let f=this.ty[i];if(!f){const t=new Mo(this.Is,this.renderingScale,this.scale,kt,this.Ki).setMouseInteractions(!1).setFillStyle(this.Ki.cursorPointMarkerFillStyle).setSize(this.Ki.cursorPointMarkerSize).setShape(this.Ki.cursorPointMarkerShape);f={pointMarker:t,targetVisible:!0},this.ty.push(f),this.ey.forEach((e=>e(t)))}const g=Jh(t.pointMarkerScale,e),y=g===this.scale?t.pointMarker:ct(t.pointMarker,g,this.scale);f.pointMarker.setPosition(y),f.targetVisible=!0;const m=s.getInterval(),p=r.getInterval(),x=Math.min(m.start,m.end),A=Math.max(m.start,m.end),S=Math.min(p.start,p.end),v=Math.max(p.start,p.end);c.x>=x&&c.x<=A&&c.y>=S&&c.y<=v&&(this.hp=!0)})),this}setTickMarkersAllocateAxisSpace(t){return this.dC=t,this.Is.xs(),this}getTickMarkersAllocateAxisSpace(){return this.dC}_h(t,e){this.cC.has(t)||(t.onDispose((()=>{var e;null===(e=i.get(t))||void 0===e||e.forEach((t=>t.dispose())),i.delete(t)})),this.cC.add(t));const i=e?this.rC:this.nC,s=e?this.oC:this.aC,r=i.get(t)||[];i.set(t,r);let n=r.find((t=>!s.includes(t)));return n||(n=e?t.Kg(!1,this.fC):t.Kg(!1,this.AC),r.push(n),this.pr(n,e),n.setMouseInteractions(!1)),n}pr(t,e){const i=e?this.gC:this.pC;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.lC:this.uC)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.iC=t,this.Is.xs(),this}getGridStrokeXCut(){return this.iC}setGridStrokeYCut(t){return this.sC=t,this.Is.xs(),this}getGridStrokeYCut(){return this.sC}setGridStrokeXStyle(t){return this.gC=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.rC.forEach((t=>t.forEach((t=>t.setGridStrokeStyle(this.gC))))),this}getGridStrokeXStyle(){return this.gC}setGridStrokeYStyle(t){return this.pC=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.nC.forEach((t=>t.forEach((t=>t.setGridStrokeStyle(this.pC))))),this}getGridStrokeYStyle(){return this.pC}setTickMarkerXVisible(t){return this.lC=t,this.Is.xs(),this}getTickMarkerXVisible(){return this.lC}setTickMarkerYVisible(t){return this.uC=t,this.Is.xs(),this}getTickMarkerYVisible(){return this.uC}setTickMarkerX(t){return this.rC.forEach((e=>e.forEach((e=>e.setMarker(t))))),this.fC=this.fC.addStyler(t),this.Is.xs(),this}setTickMarkerY(t){return this.nC.forEach((e=>e.forEach((e=>e.setMarker(t))))),this.AC=this.AC.addStyler(t),this.Is.xs(),this}}class hc{constructor(t,e,i,s){this.uy=[],this.Ay=(t,e)=>(this.uy.forEach((i=>i(t,e))),t),this.addStyler=t=>new hc(this.ny,this.fC,this.AC,this.uy.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new hc(t,this.fC,this.AC,this.uy.map((t=>t))),this.gy=(t,e,i,s,r)=>this.Ay(new oc(t,e,i,s,this.ny,this.fC,this.AC,r),r),this.ny=t,this.uy=s,this.fC=e,this.AC=i}}const ac=new hc(Ao,oh.PointableTextBox,oh.PointableTextBox,[(t,e)=>{xa(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),Mn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Mn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),lc=(t,e,i)=>{const s=e.At,r=i.At;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.ug&&(n=1-n),1===e.ug&&(o=1-o),u(o,n)};class uc extends uu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f){super(t,e,i,s,r,n,o,h,a,l,u),this.LM=[],this.Wb=!0,this.GM=void 0,this.Mu=void 0,this.yC=(t,e)=>{const i=t.Qb(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.aw=(t,e)=>{const i=t.x_(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.Xd=()=>de(this.gu.getFillStyle()),this.fw=c,this.Qn=f,this.gu=ye(this.Ki.lineSeriesStrokeStyle,d),this.mC={individualLookupValuesEnabled:void 0!==(null==f?void 0:f.individualLookupValuesEnabled)&&f.individualLookupValuesEnabled}}cs(){var t,e;return null===(e=null===(t=this.Qn)||void 0===t?void 0:t.dataPattern)||void 0===e?void 0:e.pattern}add(t){return super.add(t),this}setMouseInteractions(t){return super.setMouseInteractions(t)}setStrokeStyle(t){this.gu="function"==typeof t?t(this.gu):t;const e=this.gu;for(let t=0;tt._u(this.Mu))),this.Is.xs(),this}setCursorInterpolationEnabled(t){return this.Wb=t,this.Is.ls.xs(),this}getCursorInterpolationEnabled(){return this.Wb}pM(t){}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY};if(0===this.LM.length)return;const r=this.LM[0].Zo()||zr.NearestX,n=cu(s,this.LM,ha(e)?this.aw:this.yC,r===zr.NearestX?(t,e)=>Math.abs(t.x-e.x):r===zr.NearestY?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==n){const t=ct(n[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY}}}WM(t){let e=this.LM[0];e||(e=this.uw(),this.LM.push(e),this.ds(e)),e.dl(t,this.OM)}uw(){return this.Is.rm(this.scale,this.mC,[Oa.UserSeries,...this.fw]).Oe(this.gu)._u(this.Mu).us(this.getHighlight())}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{stroke:this.gu})}Le(t,e){t.us(e),this.Is.xs()}NM(t,e,i,s){}}class cc extends uu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,new Yu,l,u),this.LM=[],this.Kb=5,this.ba=0,this.Za=!1,this.Qa=!1,this.Ja=!1,this.GM=void 0,this.ow=(t,e)=>{const i=t.Jc(e);if(i)return ct(i,this.scale,this.Is.ls.At)},this.Qn=d,this.qb=a,this.we=ye(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}solveNearest(t,e=this.chart.getCursorMode()||"show-nearest"){const i=this.chart.ls.Vo(t),s={x:i.engineX,y:i.engineY},r=cu(s,this.LM,this.ow,Ke);if(void 0!==r){const t=ct(r[0],this.Is.ls.At,this.scale);return{cursorPosition:{resultTable:t,resultTableScale:this.scale,pointMarker:t,pointMarkerScale:{x:this.axisX,y:this.axisY}},...t,series:this,axisX:this.axisX,axisY:this.axisY}}}Xd(){return de(this.we)}Fs(){return this.Ms||this.qb}pM(t){}styleLegendEntry(t,e=!1){ce(t,this.Ki,e,{fill:this.we})}Le(t,e){t.us(e),this.Is.xs()}setPointFillStyle(t){this.we="function"==typeof t?t(this.we):t;const e=this.we;for(let t=0;t