From c7995f67894af1ad6759ec6403b5874aefd5ed1f Mon Sep 17 00:00:00 2001 From: Snekw Date: Wed, 13 Mar 2024 09:30:43 +0000 Subject: [PATCH] deploy: 4b3275cdf39ee78e3d91fb9f6e806f73b24d20d7 --- index.html | 2 +- js/app.9b9a877432929ad66433.bundle.js | 1 + js/app.f1b307fd8793627bd02e.bundle.js | 1 - js/vendor.6a96960e1c2891f4e109.bundle.js | 2 -- js/vendor.97217f65b8a4b1f61999.bundle.js | 2 ++ ...SE.txt => vendor.97217f65b8a4b1f61999.bundle.js.LICENSE.txt} | 0 6 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 js/app.9b9a877432929ad66433.bundle.js delete mode 100644 js/app.f1b307fd8793627bd02e.bundle.js delete mode 100644 js/vendor.6a96960e1c2891f4e109.bundle.js create mode 100644 js/vendor.97217f65b8a4b1f61999.bundle.js rename js/{vendor.6a96960e1c2891f4e109.bundle.js.LICENSE.txt => vendor.97217f65b8a4b1f61999.bundle.js.LICENSE.txt} (100%) diff --git a/index.html b/index.html index 65850af..9131347 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -app \ No newline at end of file +app \ No newline at end of file diff --git a/js/app.9b9a877432929ad66433.bundle.js b/js/app.9b9a877432929ad66433.bundle.js new file mode 100644 index 0000000..289a622 --- /dev/null +++ b/js/app.9b9a877432929ad66433.bundle.js @@ -0,0 +1 @@ +(self.webpackChunk=self.webpackChunk||[]).push([[524],{44:(e,s,t)=>{const o=t(89),a=t(650),{lightningChart:d,Themes:l}=o,n=d().Chart3D({theme:l[new URLSearchParams(window.location.search).get("theme")||"darkGold"]||void 0}).setTitle("Asteroid 3D Model");fetch(document.head.baseURI+"examples/assets/1501/asteroid.obj").then((e=>e.text())).then((e=>{console.log(e,"data");const s=new a.Mesh(e);console.log(s,"modelParsed"),n.addMeshModel().setScale(.2).setModelRotation({x:45,y:0,z:0}).setModelGeometry({vertices:s.vertices,indices:s.indices,normals:s.vertexNormals})}))}},e=>{e.O(0,[502],(()=>(44,e(e.s=44)))),e.O()}]); \ No newline at end of file diff --git a/js/app.f1b307fd8793627bd02e.bundle.js b/js/app.f1b307fd8793627bd02e.bundle.js deleted file mode 100644 index e8bc87c..0000000 --- a/js/app.f1b307fd8793627bd02e.bundle.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk=self.webpackChunk||[]).push([[524],{44:(e,s,t)=>{const o=t(89),a=t(650),{lightningChart:l,Themes:n}=o,d=l().Chart3D({}).setTitle("Asteroid 3D Model");fetch(document.head.baseURI+"examples/assets/1501/asteroid.obj").then((e=>e.text())).then((e=>{console.log(e,"data");const s=new a.Mesh(e);console.log(s,"modelParsed"),d.addMeshModel().setScale(.2).setModelRotation({x:45,y:0,z:0}).setModelGeometry({vertices:s.vertices,indices:s.indices,normals:s.vertexNormals})}))}},e=>{e.O(0,[502],(()=>(44,e(e.s=44)))),e.O()}]); \ No newline at end of file diff --git a/js/vendor.6a96960e1c2891f4e109.bundle.js b/js/vendor.6a96960e1c2891f4e109.bundle.js deleted file mode 100644 index 2084716..0000000 --- a/js/vendor.6a96960e1c2891f4e109.bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendor.6a96960e1c2891f4e109.bundle.js.LICENSE.txt */ -(self.webpackChunk=self.webpackChunk||[]).push([[502],{613:(t,e,i)=>{"use strict";i.r(e),i.d(e,{EventError:()=>o,Eventer:()=>u,Token:()=>a});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 n(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 r(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var s,n,r=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(s=r.next()).done;)o.push(s.value)}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}return o}var o=function(t){function e(i){var s,n="EventError: "+i+"}";return s=t.call(this,n)||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),a=function(t,e){return{token:t+"-"+e,ownerIndex:t,id:e}},h=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=++h,this.lastEventIndex=0,this.topics=new Map}return t.prototype.on=function(t,e,i){var s=this.topics.get(t),n=i||a(this.id,++this.lastEventIndex);return s?s.set(n,e):this.topics.set(t,new Map([[n,e]])),n},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 a=n(this.topics),h=a.next();!h.done;h=a.next()){var u,c,d=r(h.value,2);if(d[0],c=(u=d[1]).get(t))return c}}catch(t){i={error:t}}finally{try{h&&!h.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}return l(t,this.id)},t.prototype.off=function(t,e){var i,s;if(e)return!(!(h=this.topics.get(e))||!h.delete(t));try{for(var o=n(this.topics),a=o.next();!a.done;a=o.next()){var h,l=r(a.value,2);if(l[0],(h=l[1]).delete(t))return!0}}catch(t){i={error:t}}finally{try{a&&!a.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{"use strict";function e(t,e,s){s=s||2;var r,o,a,h,c,d,g,m=e&&e.length,p=m?e[0]*s:t.length,y=i(t,0,p,s,!0),A=[];if(!y||y.next===y.prev)return A;if(m&&(y=function(t,e,s,n){var r,o,a,h=[];for(r=0,o=e.length;r80*s){r=a=t[0],o=h=t[1];for(var x=s;xa&&(a=c),d>h&&(h=d);g=0!==(g=Math.max(a-r,h-o))?32767/g:0}return n(y,A,s,r,o,g,0),A}function i(t,e,i,s,n){var r,o;if(n===E(t,e,i,s)>0)for(r=e;r=e;r-=s)o=M(r,t[r],t[r+1],o);return o&&y(o,o.next)&&(T(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||!y(s,s.next)&&0!==p(s.prev,s,s.next))s=s.next;else{if(T(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function n(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var n=t;do{0===n.z&&(n.z=d(n.x,n.y,e,i,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,s,n,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,s=i,a=0,e=0;e0||h>0&&s;)0!==a&&(0===h||!s||i.z<=s.z)?(n=i,i=i.nextZ,a--):(n=s,s=s.nextZ,h--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,l*=2}while(o>1)}(n)}(t,l,u,c);for(var g,m,p=t;t.prev!==t.next;)if(g=t.prev,m=t.next,c?o(t,l,u,c):r(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),T(t),t=m.next,p=m.next;else if((t=m)===p){f?1===f?n(t=a(s(t),e,i),e,i,l,u,c,2):2===f&&h(t,e,i,l,u,c):n(s(t),e,i,l,u,c,1);break}}}function r(t){var e=t.prev,i=t,s=t.next;if(p(e,i,s)>=0)return!1;for(var n=e.x,r=i.x,o=s.x,a=e.y,h=i.y,l=s.y,u=nr?n>o?n:o:r>o?r:o,f=a>h?a>l?a:l:h>l?h:l,m=s.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=f&&g(n,a,r,h,o,l,m.x,m.y)&&p(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,i,s){var n=t.prev,r=t,o=t.next;if(p(n,r,o)>=0)return!1;for(var a=n.x,h=r.x,l=o.x,u=n.y,c=r.y,f=o.y,m=ah?a>l?a:l:h>l?h:l,x=u>c?u>f?u:f:c>f?c:f,S=d(m,y,e,i,s),b=d(A,x,e,i,s),v=t.prevZ,M=t.nextZ;v&&v.z>=S&&M&&M.z<=b;){if(v.x>=m&&v.x<=A&&v.y>=y&&v.y<=x&&v!==n&&v!==o&&g(a,u,h,c,l,f,v.x,v.y)&&p(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,M.x>=m&&M.x<=A&&M.y>=y&&M.y<=x&&M!==n&&M!==o&&g(a,u,h,c,l,f,M.x,M.y)&&p(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;v&&v.z>=S;){if(v.x>=m&&v.x<=A&&v.y>=y&&v.y<=x&&v!==n&&v!==o&&g(a,u,h,c,l,f,v.x,v.y)&&p(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;M&&M.z<=b;){if(M.x>=m&&M.x<=A&&M.y>=y&&M.y<=x&&M!==n&&M!==o&&g(a,u,h,c,l,f,M.x,M.y)&&p(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function a(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!y(r,o)&&A(r,n,n.next,o)&&b(r,o)&&b(o,r)&&(e.push(r.i/i|0),e.push(n.i/i|0),e.push(o.i/i|0),T(n),T(n.next),n=t=o),n=n.next}while(n!==t);return s(n)}function h(t,e,i,r,o,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&m(h,l)){var u=v(h,l);return h=s(h,h.next),u=s(u,u.next),n(h,e,i,r,o,a,0),void n(u,e,i,r,o,a,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,n=t.x,r=t.y,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){var a=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(a<=n&&a>o&&(o=a,i=s.x=s.x&&s.x>=u&&n!==s.x&&g(ri.x||s.x===i.x&&c(i,s)))&&(i=s,f=h)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var n=v(i,t);return s(n,n.next),s(i,i.next)}function c(t,e){return p(t.prev,t,e.prev)<0&&p(e.next,t,t.next)<0}function d(t,e,i,s,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(r-a)&&(t-o)*(s-a)>=(i-o)*(e-a)&&(i-o)*(r-a)>=(n-o)*(s-a)}function m(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&&A(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(p(t.prev,t,e.prev)||p(t,e.prev,e))||y(t,e)&&p(t.prev,t,t.next)>0&&p(e.prev,e,e.next)>0)}function p(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function A(t,e,i,s){var n=S(p(t,e,i)),r=S(p(t,e,s)),o=S(p(i,s,t)),a=S(p(i,s,e));return n!==r&&o!==a||!(0!==n||!x(t,i,e))||!(0!==r||!x(t,s,e))||!(0!==o||!x(i,t,s))||!(0!==a||!x(i,e,s))}function x(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 b(t,e){return p(t.prev,t,t.next)<0?p(t,e,t.next)>=0&&p(t,t.prev,e)>=0:p(t,e,t.prev)<0||p(t,t.next,e)<0}function v(t,e){var i=new w(t.i,t.x,t.y),s=new w(e.i,e.x,e.y),n=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function M(t,e,i,s){var n=new w(t,e,i);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function T(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 w(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 E(t,e,i,s){for(var n=0,r=e,o=i-s;r0&&(s+=t[n-1].length,i.holes.push(s))}return i}},568:(t,e,i)=>{"use strict";i.r(e),i.d(e,{Collection:()=>w,Iterable:()=>ks,List:()=>hi,Map:()=>Be,OrderedMap:()=>vi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>Xi,Record:()=>ms,Repeat:()=>vs,Seq:()=>K,Set:()=>Oi,Stack:()=>Ci,default:()=>Cs,fromJS:()=>Ms,get:()=>he,getIn:()=>ji,has:()=>ae,hasIn:()=>qi,hash:()=>yt,is:()=>ft,isAssociative:()=>T,isCollection:()=>x,isImmutable:()=>L,isIndexed:()=>M,isKeyed:()=>b,isList:()=>ai,isMap:()=>ut,isOrdered:()=>P,isOrderedMap:()=>ct,isOrderedSet:()=>Pi,isPlainObject:()=>ne,isRecord:()=>F,isSeq:()=>I,isSet:()=>zi,isStack:()=>ki,isValueObject:()=>dt,merge:()=>Te,mergeDeep:()=>Ee,mergeDeepWith:()=>ke,mergeWith:()=>we,remove:()=>ue,removeIn:()=>pe,set:()=>ce,setIn:()=>ge,update:()=>Ae,updateIn:()=>de,version:()=>Es});var s="delete",n=5,r=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&&!y(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function g(t,e){return p(t,e,0)}function m(t,e){return p(t,e,e)}function p(t,e,i){return void 0===t?i:y(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function y(t){return t<0||0===t&&1/t==-1/0}var A="@@__IMMUTABLE_ITERABLE__@@";function x(t){return Boolean(t&&t[A])}var S="@@__IMMUTABLE_KEYED__@@";function b(t){return Boolean(t&&t[S])}var v="@@__IMMUTABLE_INDEXED__@@";function M(t){return Boolean(t&&t[v])}function T(t){return b(t)||M(t)}var w=function(t){return x(t)?t:K(t)},E=function(t){function e(t){return b(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),k=function(t){function e(t){return M(t)?t:Q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),C=function(t){function e(t){return x(t)&&!T(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w);w.Keyed=E,w.Indexed=k,w.Set=C;var D="@@__IMMUTABLE_SEQ__@@";function I(t){return Boolean(t&&t[D])}var _="@@__IMMUTABLE_RECORD__@@";function F(t){return Boolean(t&&t[_])}function L(t){return x(t)||F(t)}var z="@@__IMMUTABLE_ORDERED__@@";function P(t){return Boolean(t&&t[z])}var R=0,V=1,B=2,O="function"==typeof Symbol&&Symbol.iterator,N="@@iterator",U=O||N,G=function(t){this.next=t};function W(t,e,i,s){var n=0===t?e:1===t?i:[e,i];return s?s.value=n:s={value:n,done:!1},s}function Y(){return{value:void 0,done:!0}}function H(t){return!!Array.isArray(t)||!!$(t)}function X(t){return t&&"function"==typeof t.next}function j(t){var e=$(t);return e&&e.call(t)}function $(t){var e=t&&(O&&t[O]||t[N]);if("function"==typeof e)return e}G.prototype.toString=function(){return"[Iterator]"},G.KEYS=R,G.VALUES=V,G.ENTRIES=B,G.prototype.inspect=G.prototype.toSource=function(){return this.toString()},G.prototype[U]=function(){return this};var q=Object.prototype.hasOwnProperty;function J(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 K=function(t){function e(t){return null==t?rt():L(t)?t.toSeq():function(t){var e,i,s=ht(t);if(s)return(i=$(e=t))&&i===e.entries?s.fromEntrySeq():function(t){var e=$(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,n=0;n!==s;){var r=i[e?s-++n:n++];if(!1===t(r[1],r[0],this))break}return n}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var i=this._cache;if(i){var s=i.length,n=0;return new G((function(){if(n===s)return{value:void 0,done:!0};var r=i[e?s-++n:n++];return W(t,r[0],r[1])}))}return this.__iteratorUncached(t,e)},e}(w),Z=function(t){function e(t){return null==t?rt().toKeyedSeq():x(t)?b(t)?t.toSeq():t.fromEntrySeq():F(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}(K),Q=function(t){function e(t){return null==t?rt():x(t)?b(t)?t.entrySeq():t.toIndexedSeq():F(t)?t.toSeq().entrySeq():at(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}(K),tt=function(t){function e(t){return(x(t)&&!T(t)?t:Q(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}(K);K.isSeq=I,K.Keyed=Z,K.Set=tt,K.Indexed=Q,K.prototype[D]=!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,n=0;n!==s;){var r=e?s-++n:n++;if(!1===t(i[r],r,this))break}return n},e.prototype.__iterator=function(t,e){var i=this._array,s=i.length,n=0;return new G((function(){if(n===s)return{value:void 0,done:!0};var r=e?s-++n:n++;return W(t,r,i[r])}))},e}(Q),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 q.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var i=this._object,s=this._keys,n=s.length,r=0;r!==n;){var o=s[e?n-++r:r++];if(!1===t(i[o],o,this))break}return r},e.prototype.__iterator=function(t,e){var i=this._object,s=this._keys,n=s.length,r=0;return new G((function(){if(r===n)return{value:void 0,done:!0};var o=s[e?n-++r:r++];return W(t,o,i[o])}))},e}(Z);it.prototype[z]=!0;var st,nt=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=j(this._collection),s=0;if(X(i))for(var n;!(n=i.next()).done&&!1!==t(n.value,s++,this););return s},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var i=j(this._collection);if(!X(i))return new G(Y);var s=0;return new G((function(){var e=i.next();return e.done?e:W(t,s++,e.value)}))},e}(Q);function rt(){return st||(st=new et([]))}function ot(t){var e=ht(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 at(t){var e=ht(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function ht(t){return J(t)?new et(t):H(t)?new nt(t):void 0}var lt="@@__IMMUTABLE_MAP__@@";function ut(t){return Boolean(t&&t[lt])}function ct(t){return ut(t)&&P(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 mt(t){return t>>>1&1073741824|3221225471&t}var pt=Object.prototype.valueOf;function yt(t){if(null==t)return At(t);if("function"==typeof t.hashCode)return mt(t.hashCode(t));var e,i,s,n=(e=t).valueOf!==pt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==n)return At(n);switch(typeof n){case"boolean":return n?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 mt(e)}(n);case"string":return n.length>Ct?(void 0===(s=_t[i=n])&&(s=xt(i),It===Dt&&(It=0,_t={}),It++,_t[i]=s),s):xt(n);case"object":case"function":return function(t){var e;if(Tt&&void 0!==(e=Mt.get(t)))return e;if(void 0!==(e=t[kt]))return e;if(!bt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[kt]))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=vt(),Tt)Mt.set(t,e);else{if(void 0!==St&&!1===St(t))throw new Error("Non-extensible objects are not allowed as keys.");if(bt)Object.defineProperty(t,kt,{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[kt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[kt]=e}}return e}(n);case"symbol":return function(t){var e=wt[t];return void 0!==e||(e=vt(),wt[t]=e),e}(n);default:if("function"==typeof n.toString)return xt(n.toString());throw new Error("Value type "+typeof n+" cannot be hashed.")}}function At(t){return null===t?1108378658:1108378659}function xt(t){for(var e=0,i=0;i=0&&(l.get=function(e,i){return(e=c(this,e))>=0&&ea)return{value:void 0,done:!0};var t=n.next();return s||e===V||t.done?t:W(e,h-1,e===R?void 0:t.value[1],t)}))},l}function Ut(t,e,i,s){var n=Jt(t);return n.__iterateUncached=function(n,r){var o=this;if(r)return this.cacheResult().__iterate(n,r);var a=!0,h=0;return t.__iterate((function(t,r,l){if(!a||!(a=e.call(i,t,r,l)))return h++,n(t,s?r:h-1,o)})),h},n.__iteratorUncached=function(n,r){var o=this;if(r)return this.cacheResult().__iterator(n,r);var a=t.__iterator(B,r),h=!0,l=0;return new G((function(){var t,r,u;do{if((t=a.next()).done)return s||n===V?t:W(n,l++,n===R?void 0:t.value[1],t);var c=t.value;r=c[0],u=c[1],h&&(h=e.call(i,u,r,o))}while(h);return n===B?t:W(n,r,u,t)}))},n}function Gt(t,e,i){var s=Jt(t);return s.__iterateUncached=function(n,r){if(r)return this.cacheResult().__iterate(n,r);var o=0,a=!1;return function t(h,l){h.__iterate((function(r,h){return(!e||l0}function Xt(t,e,i,s){var n=Jt(t),r=new et(i).map((function(t){return t.size}));return n.size=s?r.max():r.min(),n.__iterate=function(t,e){for(var i,s=this.__iterator(V,e),n=0;!(i=s.next()).done&&!1!==t(i.value,n++,this););return n},n.__iteratorUncached=function(t,n){var r=i.map((function(t){return t=w(t),j(n?t.reverse():t)})),o=0,a=!1;return new G((function(){var i;return a||(i=r.map((function(t){return t.next()})),a=s?i.every((function(t){return t.done})):i.some((function(t){return t.done}))),a?{value:void 0,done:!0}:W(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},n}function jt(t,e){return t===e?t:I(t)?e:t.constructor(e)}function $t(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function qt(t){return b(t)?E:M(t)?k:C}function Jt(t){return Object.create((b(t)?Z:M(t)?Q:tt).prototype)}function Kt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):K.prototype.cacheResult.call(this)}function Zt(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=[],n=0;n0;)e[i]=arguments[i+1];return De(t,e)}function we(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return De(e,i,t)}function Ee(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Ce(t,e)}function ke(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Ce(e,i,t)}function Ce(t,e,i){return De(t,e,function(t){return function e(i,s,n){return re(i)&&re(s)&&(r=s,o=K(i),a=K(r),M(o)===M(a)&&b(o)===b(a))?De(i,[s],e):t?t(i,s,n):s;var r,o,a}}(i))}function De(t,e,i){if(!re(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(L(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),n=t,r=s?k:E,o=s?function(e){n===t&&(n=le(n)),n.push(e)}:function(e,s){var r=q.call(n,s),o=r&&i?i(n[s],e,s):e;r&&o===n[s]||(n===t&&(n=le(n)),n[s]=o)},a=0;a0;)e[i]=arguments[i+1];return Ce(this,e,t)}function Fe(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Je(),(function(t){return De(t,e)}))}function Le(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Je(),(function(t){return Ce(t,e)}))}function ze(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Pe(){return this.__ownerID?this:this.__ensureOwner(new l)}function Re(){return this.__ensureOwner()}function Ve(){return this.__altered}var Be=function(t){function e(e){return null==e?Je():ut(e)&&!P(e)?e:Je().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 Je().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 Ke(this,t,e)},e.prototype.remove=function(t){return Ke(this,t,a)},e.prototype.deleteAll=function(t){var e=w(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):Je()},e.prototype.sort=function(t){return vi(Wt(this,t))},e.prototype.sortBy=function(t,e){return vi(Wt(this,e,t))},e.prototype.map=function(t,e){var i=this;return this.withMutations((function(s){s.forEach((function(n,r){s.set(r,t.call(e,n,r,i))}))}))},e.prototype.__iterator=function(t,e){return new Xe(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?qe(this.size,this._root,t,this.__hash):0===this.size?Je():(this.__ownerID=t,this.__altered=!1,this)},e}(E);Be.isMap=ut;var Oe=Be.prototype;Oe[lt]=!0,Oe[s]=Oe.remove,Oe.removeAll=Oe.deleteAll,Oe.setIn=me,Oe.removeIn=Oe.deleteIn=ye,Oe.update=xe,Oe.updateIn=Se,Oe.merge=Oe.concat=be,Oe.mergeWith=ve,Oe.mergeDeep=Ie,Oe.mergeDeepWith=_e,Oe.mergeIn=Fe,Oe.mergeDeepIn=Le,Oe.withMutations=ze,Oe.wasAltered=Ve,Oe.asImmutable=Re,Oe["@@transducer/init"]=Oe.asMutable=Pe,Oe["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Oe["@@transducer/result"]=function(t){return t.asImmutable()};var Ne=function(t,e){this.ownerID=t,this.entries=e};Ne.prototype.get=function(t,e,i,s){for(var n=this.entries,r=0,o=n.length;r=si)return function(t,e,i,s){t||(t=new l);for(var n=new Ye(t,yt(i),[i,s]),r=0;r>>t)&o),a=this.bitmap;return 0==(a&r)?s:this.nodes[ei(a&r-1)].get(t+n,e,i,s)},Ue.prototype.update=function(t,e,i,s,h,l,u){void 0===i&&(i=yt(s));var c=(0===e?i:i>>>e)&o,d=1<=ni)return function(t,e,i,s,n){for(var o=0,a=new Array(r),h=0;0!==i;h++,i>>>=1)a[h]=1&i?e[o++]:void 0;return a[s]=n,new Ge(t,o+1,a)}(t,p,f,c,A);if(g&&!A&&2===p.length&&Qe(p[1^m]))return p[1^m];if(g&&A&&1===p.length&&Qe(A))return A;var x=t&&t===this.ownerID,S=g?A?f:f^d:f|d,b=g?A?ii(p,m,A,x):function(t,e,i){var s=t.length-1;if(i&&e===s)return t.pop(),t;for(var n=new Array(s),r=0,o=0;o>>t)&o,a=this.nodes[r];return a?a.get(t+n,e,i,s):s},Ge.prototype.update=function(t,e,i,s,r,h,l){void 0===i&&(i=yt(s));var u=(0===e?i:i>>>e)&o,c=r===a,d=this.nodes,f=d[u];if(c&&!f)return this;var g=Ze(f,t,e+n,i,s,r,h,l);if(g===f)return this;var m=this.count;if(f){if(!g&&--m>>i)&o,l=(0===i?s:s>>>i)&o,u=h===l?[ti(t,e,i+n,s,r)]:(a=new Ye(e,s,r),h>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function ii(t,e,i,s){var n=s?t:Qt(t);return n[e]=i,n}var si=r/4,ni=r/2,ri=r/4,oi="@@__IMMUTABLE_LIST__@@";function ai(t){return Boolean(t&&t[oi])}var hi=function(t){function e(e){var i=mi();if(null==e)return i;if(ai(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?xi(t,e).set(0,i):xi(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,n=t._root,r={value:!1};return e>=Si(t._capacity)?s=pi(s,t.__ownerID,0,e,i,r):n=pi(n,t.__ownerID,t._level,e,i,r),r.value?t.__ownerID?(t._root=n,t._tail=s,t.__hash=void 0,t.__altered=!0,t):gi(t._origin,t._capacity,t._level,n,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=n,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):mi()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){xi(i,0,e+t.length);for(var s=0;s>>e&o;if(s>=this.array.length)return new ui([],t);var r,a=0===s;if(e>0){var h=this.array[s];if((r=h&&h.removeBefore(t,e-n,i))===h&&a)return this}if(a&&!r)return this;var l=yi(this,t);if(!a)for(var u=0;u>>e&o;if(r>=this.array.length)return this;if(e>0){var a=this.array[r];if((s=a&&a.removeAfter(t,e-n,i))===a&&r===this.array.length-1)return this}var h=yi(this,t);return h.array.splice(r+1),s&&(h.array[r]=s),h};var ci,di={};function fi(t,e){var i=t._origin,s=t._capacity,o=Si(s),a=t._tail;return function t(h,l,u){return 0===l?function(t,n){var h=n===o?a&&a.array:t&&t.array,l=n>i?0:i-n,u=s-n;return u>r&&(u=r),function(){if(l===u)return di;var t=e?--u:l++;return h&&h[t]}}(h,u):function(o,a,h){var l,u=o&&o.array,c=h>i?0:i-h>>a,d=1+(s-h>>a);return d>r&&(d=r),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],a-n,h+(s<>>i&o,c=t&&u0){var d=t&&t.array[u],f=pi(d,e,i-n,s,r,a);return f===d?t:((l=yi(t,e)).array[u]=f,l)}return c&&t.array[u]===r?t:(a&&h(a),l=yi(t,e),void 0===r&&u===l.array.length-1?l.array.pop():l.array[u]=r,l)}function yi(t,e){return e&&t&&e===t.ownerID?t:new ui(t?t.array.slice():[],e)}function Ai(t,e){if(e>=Si(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&o],s-=n;return i}}function xi(t,e,i){void 0!==e&&(e|=0),void 0!==i&&(i|=0);var s=t.__ownerID||new l,r=t._origin,a=t._capacity,h=r+e,u=void 0===i?a:i<0?a+i:r+i;if(h===r&&u===a)return t;if(h>=u)return t.clear();for(var c=t._level,d=t._root,f=0;h+f<0;)d=new ui(d&&d.array.length?[void 0,d]:[],s),f+=1<<(c+=n);f&&(h+=f,r+=f,u+=f,a+=f);for(var g=Si(a),m=Si(u);m>=1<g?new ui([],s):p;if(p&&m>g&&hn;x-=n){var S=g>>>x&o;A=A.array[S]=yi(A.array[S],s)}A.array[g>>>n&o]=p}if(u=m)h-=m,u-=m,c=n,d=null,y=y&&y.removeBefore(s,0,h);else if(h>r||m>>c&o;if(b!==m>>>c&o)break;b&&(f+=(1<r&&(d=d.removeBefore(s,c,h-f)),d&&m>>n<=r&&h.size>=2*o.size?(s=(n=h.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=n.__ownerID=t.__ownerID)):(s=o.remove(e),n=l===h.size-1?h.pop():h.set(l,void 0))}else if(u){if(i===h.get(l)[1])return t;s=o,n=h.set(l,[e,i])}else s=o.set(e,h.size),n=h.set(h.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=n,t.__hash=void 0,t.__altered=!0,t):Mi(s,n)}vi.isOrderedMap=ct,vi.prototype[z]=!0,vi.prototype[s]=vi.prototype.remove;var Ei="@@__IMMUTABLE_STACK__@@";function ki(t){return Boolean(t&&t[Ei])}var Ci=function(t){function e(t){return null==t?Fi():ki(t)?t:Fi().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):_i(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&ki(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):_i(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):Fi()},e.prototype.slice=function(e,i){if(f(e,i,this.size))return this;var s=g(e,this.size);if(m(i,this.size)!==this.size)return t.prototype.slice.call(this,e,i);for(var n=this.size-s,r=this._head;s--;)r=r.next;return this.__ownerID?(this.size=n,this._head=r,this.__hash=void 0,this.__altered=!0,this):_i(n,r)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?_i(this.size,this._head,t,this.__hash):0===this.size?Fi():(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,n=this._head;n&&!1!==t(n.value,s++,this);)n=n.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 G((function(){if(s){var e=s.value;return s=s.next,W(t,i++,e)}return{value:void 0,done:!0}}))},e}(k);Ci.isStack=ki;var Di,Ii=Ci.prototype;function _i(t,e,i,s){var n=Object.create(Ii);return n.size=t,n._head=e,n.__ownerID=i,n.__hash=s,n.__altered=!1,n}function Fi(){return Di||(Di=_i(0))}Ii[Ei]=!0,Ii.shift=Ii.pop,Ii.unshift=Ii.push,Ii.unshiftAll=Ii.pushAll,Ii.withMutations=ze,Ii.wasAltered=Ve,Ii.asImmutable=Re,Ii["@@transducer/init"]=Ii.asMutable=Pe,Ii["@@transducer/step"]=function(t,e){return t.unshift(e)},Ii["@@transducer/result"]=function(t){return t.asImmutable()};var Li="@@__IMMUTABLE_SET__@@";function zi(t){return Boolean(t&&t[Li])}function Pi(t){return zi(t)&&P(t)}function Ri(t,e){if(t===e)return!0;if(!x(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||b(t)!==b(e)||M(t)!==M(e)||P(t)!==P(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!T(t);if(P(t)){var s=t.entries();return e.every((function(t,e){var n=s.next().value;return n&&ft(n[1],t)&&(i||ft(n[0],e))}))&&s.next().done}var n=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{n=!0;var r=t;t=e,e=r}var o=!0,h=e.__iterate((function(e,s){if(i?!t.has(e):n?!ft(e,t.get(s,a)):!ft(t.get(s,a),e))return o=!1,!1}));return o&&t.size===h}function Vi(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 Bi(t){if(!t||"object"!=typeof t)return t;if(!x(t)){if(!re(t))return t;t=K(t)}if(b(t)){var e={};return t.__iterate((function(t,i){e[i]=Bi(t)})),e}var i=[];return t.__iterate((function(t){i.push(Bi(t))})),i}var Oi=function(t){function e(e){return null==e?Yi():zi(e)&&!P(e)?e:Yi().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(E(t).keySeq())},e.intersect=function(t){return(t=w(t).toArray()).length?Ui.intersect.apply(e(t.pop()),t):Yi()},e.union=function(t){return(t=w(t).toArray()).length?Ui.union.apply(e(t.pop()),t):Yi()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Gi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Gi(this,this._map.remove(t))},e.prototype.clear=function(){return Gi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,n=Gi(this,this._map.mapEntries((function(n){var r=n[1],o=t.call(e,r,r,i);return o!==r&&(s=!0),[o,o]}),e));return s?n: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|0)^t)^e>>>16,2246822507),e=mt((e=gt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+hs(yt(t),yt(e))|0}:function(t,e){s=s+hs(yt(t),yt(e))|0}:e?function(t){s=31*s+yt(t)|0}:function(t){s=s+yt(t)|0}),s)}(this))}});var Ki=w.prototype;Ki[A]=!0,Ki[U]=Ki.values,Ki.toJSON=Ki.toArray,Ki.__toStringMapper=oe,Ki.inspect=Ki.toSource=function(){return this.toString()},Ki.chain=Ki.flatMap,Ki.contains=Ki.includes,Vi(E,{flip:function(){return jt(this,Rt(this))},mapEntries:function(t,e){var i=this,s=0;return jt(this,this.toSeq().map((function(n,r){return t.call(e,[r,n],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return jt(this,this.toSeq().flip().map((function(s,n){return t.call(e,s,n,i)})).flip())}});var Zi=E.prototype;Zi[S]=!0,Zi[U]=Ki.entries,Zi.toJSON=Ji,Zi.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Vi(k,{toKeyedSeq:function(){return new Ft(this,!1)},filter:function(t,e){return jt(this,Ot(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 jt(this,Bt(this,!1))},slice:function(t,e){return jt(this,Nt(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 jt(this,1===i?s:s.concat(Qt(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 jt(this,Gt(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 hs(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}ts.has=Ki.includes,ts.contains=ts.includes,ts.keys=ts.values,Vi(Z,Zi),Vi(Q,Qi),Vi(tt,ts);var ls=function(t){function e(t){return null==t?fs():Pi(t)?t:fs().withMutations((function(e){var i=C(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(E(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Oi);ls.isOrderedSet=Pi;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(Ti()))}cs[z]=!0,cs.zip=Qi.zip,cs.zipWith=Qi.zipWith,cs.zipAll=Qi.zipAll,cs.__empty=fs,cs.__make=ds;var gs={LeftThenRight:-1,RightThenLeft:1},ms=function(t,e){var i;!function(t){if(F(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(L(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(r){var o=this;if(r instanceof s)return r;if(!(this instanceof s))return new s(r);if(!i){i=!0;var a=Object.keys(t),h=n._indices={};n._name=e,n._keys=a,n._defaultValues=t;for(var l=0;l2?[]:void 0,{"":t})}function Ts(t,e,i,s,n,r){if("string"!=typeof i&&!L(i)&&(J(i)||H(i)||ne(i))){if(~t.indexOf(i))throw new TypeError("Cannot convert circular structure to Immutable");t.push(i),n&&""!==s&&n.push(s);var o=e.call(r,s,K(i).map((function(s,r){return Ts(t,e,s,r,n,i)})),n&&n.slice());return t.pop(),n&&n.pop(),o}return i}function ws(t,e){return M(e)?e.toList():b(e)?e.toMap():e.toSet()}var Es="4.3.5",ks=w;const Cs={version:Es,Collection:w,Iterable:w,Seq:K,Map:Be,OrderedMap:vi,List:hi,Stack:Ci,Set:Oi,OrderedSet:ls,PairSorting:gs,Record:ms,Range:Xi,Repeat:vs,is:ft,fromJS:Ms,hash:yt,isImmutable:L,isCollection:x,isKeyed:b,isIndexed:M,isAssociative:T,isOrdered:P,isValueObject:dt,isPlainObject:ne,isSeq:I,isList:ai,isMap:ut,isOrderedMap:ct,isStack:ki,isSet:zi,isOrderedSet:Pi,isRecord:F,get:he,getIn:ji,has:ae,hasIn:qi,merge:Te,mergeDeep:Ee,mergeWith:we,mergeDeepWith:ke,remove:ue,removeIn:pe,set:ce,setIn:ge,update:Ae,updateIn:de}},650:function(module){var t;"undefined"!=typeof self&&self,t=function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(s,n,function(e){return t[e]}.bind(null,n));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i(i.s=0)}({"./src/index.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OBJ", function() { return OBJ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });\n/* harmony import */ var _mesh__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mesh */ "./src/mesh.ts");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Mesh", function() { return _mesh__WEBPACK_IMPORTED_MODULE_0__["default"]; });\n\n/* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "./src/material.ts");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Material", function() { return _material__WEBPACK_IMPORTED_MODULE_1__["Material"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MaterialLibrary", function() { return _material__WEBPACK_IMPORTED_MODULE_1__["MaterialLibrary"]; });\n\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layout */ "./src/layout.ts");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Attribute", function() { return _layout__WEBPACK_IMPORTED_MODULE_2__["Attribute"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DuplicateAttributeException", function() { return _layout__WEBPACK_IMPORTED_MODULE_2__["DuplicateAttributeException"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Layout", function() { return _layout__WEBPACK_IMPORTED_MODULE_2__["Layout"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TYPES", function() { return _layout__WEBPACK_IMPORTED_MODULE_2__["TYPES"]; });\n\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./src/utils.ts");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "downloadModels", function() { return _utils__WEBPACK_IMPORTED_MODULE_3__["downloadModels"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "downloadMeshes", function() { return _utils__WEBPACK_IMPORTED_MODULE_3__["downloadMeshes"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initMeshBuffers", function() { return _utils__WEBPACK_IMPORTED_MODULE_3__["initMeshBuffers"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deleteMeshBuffers", function() { return _utils__WEBPACK_IMPORTED_MODULE_3__["deleteMeshBuffers"]; });\n\n\n\n\n\nconst version = "2.0.3";\nconst OBJ = {\n Attribute: _layout__WEBPACK_IMPORTED_MODULE_2__["Attribute"],\n DuplicateAttributeException: _layout__WEBPACK_IMPORTED_MODULE_2__["DuplicateAttributeException"],\n Layout: _layout__WEBPACK_IMPORTED_MODULE_2__["Layout"],\n Material: _material__WEBPACK_IMPORTED_MODULE_1__["Material"],\n MaterialLibrary: _material__WEBPACK_IMPORTED_MODULE_1__["MaterialLibrary"],\n Mesh: _mesh__WEBPACK_IMPORTED_MODULE_0__["default"],\n TYPES: _layout__WEBPACK_IMPORTED_MODULE_2__["TYPES"],\n downloadModels: _utils__WEBPACK_IMPORTED_MODULE_3__["downloadModels"],\n downloadMeshes: _utils__WEBPACK_IMPORTED_MODULE_3__["downloadMeshes"],\n initMeshBuffers: _utils__WEBPACK_IMPORTED_MODULE_3__["initMeshBuffers"],\n deleteMeshBuffers: _utils__WEBPACK_IMPORTED_MODULE_3__["deleteMeshBuffers"],\n version,\n};\n/**\n * @namespace\n */\n\n\n\n//# sourceURL=webpack:///./src/index.ts?')},"./src/layout.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPES", function() { return TYPES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DuplicateAttributeException", function() { return DuplicateAttributeException; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribute", function() { return Attribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Layout", function() { return Layout; });\nvar TYPES;\n(function (TYPES) {\n TYPES["BYTE"] = "BYTE";\n TYPES["UNSIGNED_BYTE"] = "UNSIGNED_BYTE";\n TYPES["SHORT"] = "SHORT";\n TYPES["UNSIGNED_SHORT"] = "UNSIGNED_SHORT";\n TYPES["FLOAT"] = "FLOAT";\n})(TYPES || (TYPES = {}));\n/**\n * An exception for when two or more of the same attributes are found in the\n * same layout.\n * @private\n */\nclass DuplicateAttributeException extends Error {\n /**\n * Create a DuplicateAttributeException\n * @param {Attribute} attribute - The attribute that was found more than\n * once in the {@link Layout}\n */\n constructor(attribute) {\n super(`found duplicate attribute: ${attribute.key}`);\n }\n}\n/**\n * Represents how a vertex attribute should be packed into an buffer.\n * @private\n */\nclass Attribute {\n /**\n * Create an attribute. Do not call this directly, use the predefined\n * constants.\n * @param {string} key - The name of this attribute as if it were a key in\n * an Object. Use the camel case version of the upper snake case\n * const name.\n * @param {number} size - The number of components per vertex attribute.\n * Must be 1, 2, 3, or 4.\n * @param {string} type - The data type of each component for this\n * attribute. Possible values:
\n * "BYTE": signed 8-bit integer, with values in [-128, 127]
\n * "SHORT": signed 16-bit integer, with values in\n * [-32768, 32767]
\n * "UNSIGNED_BYTE": unsigned 8-bit integer, with values in\n * [0, 255]
\n * "UNSIGNED_SHORT": unsigned 16-bit integer, with values in\n * [0, 65535]
\n * "FLOAT": 32-bit floating point number\n * @param {boolean} normalized - Whether integer data values should be\n * normalized when being casted to a float.
\n * If true, signed integers are normalized to [-1, 1].
\n * If true, unsigned integers are normalized to [0, 1].
\n * For type "FLOAT", this parameter has no effect.\n */\n constructor(key, size, type, normalized = false) {\n this.key = key;\n this.size = size;\n this.type = type;\n this.normalized = normalized;\n switch (type) {\n case "BYTE":\n case "UNSIGNED_BYTE":\n this.sizeOfType = 1;\n break;\n case "SHORT":\n case "UNSIGNED_SHORT":\n this.sizeOfType = 2;\n break;\n case "FLOAT":\n this.sizeOfType = 4;\n break;\n default:\n throw new Error(`Unknown gl type: ${type}`);\n }\n this.sizeInBytes = this.sizeOfType * size;\n }\n}\n/**\n * A class to represent the memory layout for a vertex attribute array. Used by\n * {@link Mesh}\'s TBD(...) method to generate a packed array from mesh data.\n *

\n * Layout can sort of be thought of as a C-style struct declaration.\n * {@link Mesh}\'s TBD(...) method will use the {@link Layout} instance to\n * pack an array in the given attribute order.\n *

\n * Layout also is very helpful when calling a WebGL context\'s\n * vertexAttribPointer method. If you\'ve created a buffer using\n * a Layout instance, then the same Layout instance can be used to determine\n * the size, type, normalized, stride, and offset parameters for\n * vertexAttribPointer.\n *

\n * For example:\n *

\n *\n * const index = glctx.getAttribLocation(shaderProgram, "pos");\n * glctx.vertexAttribPointer(\n *   layout.position.size,\n *   glctx[layout.position.type],\n *   layout.position.normalized,\n *   layout.position.stride,\n *   layout.position.offset);\n * 
\n * @see {@link Mesh}\n */\nclass Layout {\n /**\n * Create a Layout object. This constructor will throw if any duplicate\n * attributes are given.\n * @param {Array} ...attributes - An ordered list of attributes that\n * describe the desired memory layout for each vertex attribute.\n *

\n *\n * @see {@link Mesh}\n */\n constructor(...attributes) {\n this.attributes = attributes;\n this.attributeMap = {};\n let offset = 0;\n let maxStrideMultiple = 0;\n for (const attribute of attributes) {\n if (this.attributeMap[attribute.key]) {\n throw new DuplicateAttributeException(attribute);\n }\n // Add padding to satisfy WebGL\'s requirement that all\n // vertexAttribPointer calls have an offset that is a multiple of\n // the type size.\n if (offset % attribute.sizeOfType !== 0) {\n offset += attribute.sizeOfType - (offset % attribute.sizeOfType);\n console.warn("Layout requires padding before " + attribute.key + " attribute");\n }\n this.attributeMap[attribute.key] = {\n attribute: attribute,\n size: attribute.size,\n type: attribute.type,\n normalized: attribute.normalized,\n offset: offset,\n };\n offset += attribute.sizeInBytes;\n maxStrideMultiple = Math.max(maxStrideMultiple, attribute.sizeOfType);\n }\n // Add padding to the end to satisfy WebGL\'s requirement that all\n // vertexAttribPointer calls have a stride that is a multiple of the\n // type size. Because we\'re putting differently sized attributes into\n // the same buffer, it must be padded to a multiple of the largest\n // type size.\n if (offset % maxStrideMultiple !== 0) {\n offset += maxStrideMultiple - (offset % maxStrideMultiple);\n console.warn("Layout requires padding at the back");\n }\n this.stride = offset;\n for (const attribute of attributes) {\n this.attributeMap[attribute.key].stride = this.stride;\n }\n }\n}\n// Geometry attributes\n/**\n * Attribute layout to pack a vertex\'s x, y, & z as floats\n *\n * @see {@link Layout}\n */\nLayout.POSITION = new Attribute("position", 3, TYPES.FLOAT);\n/**\n * Attribute layout to pack a vertex\'s normal\'s x, y, & z as floats\n *\n * @see {@link Layout}\n */\nLayout.NORMAL = new Attribute("normal", 3, TYPES.FLOAT);\n/**\n * Attribute layout to pack a vertex\'s normal\'s x, y, & z as floats.\n *

\n * This value will be computed on-the-fly based on the texture coordinates.\n * If no texture coordinates are available, the generated value will default to\n * 0, 0, 0.\n *\n * @see {@link Layout}\n */\nLayout.TANGENT = new Attribute("tangent", 3, TYPES.FLOAT);\n/**\n * Attribute layout to pack a vertex\'s normal\'s bitangent x, y, & z as floats.\n *

\n * This value will be computed on-the-fly based on the texture coordinates.\n * If no texture coordinates are available, the generated value will default to\n * 0, 0, 0.\n * @see {@link Layout}\n */\nLayout.BITANGENT = new Attribute("bitangent", 3, TYPES.FLOAT);\n/**\n * Attribute layout to pack a vertex\'s texture coordinates\' u & v as floats\n *\n * @see {@link Layout}\n */\nLayout.UV = new Attribute("uv", 2, TYPES.FLOAT);\n// Material attributes\n/**\n * Attribute layout to pack an unsigned short to be interpreted as a the index\n * into a {@link Mesh}\'s materials list.\n *

\n * The intention of this value is to send all of the {@link Mesh}\'s materials\n * into multiple shader uniforms and then reference the current one by this\n * vertex attribute.\n *

\n * example glsl code:\n *\n *

\n *  // this is bound using MATERIAL_INDEX\n *  attribute int materialIndex;\n *\n *  struct Material {\n *    vec3 diffuse;\n *    vec3 specular;\n *    vec3 specularExponent;\n *  };\n *\n *  uniform Material materials[MAX_MATERIALS];\n *\n *  // ...\n *\n *  vec3 diffuse = materials[materialIndex];\n *\n * 
\n * TODO: More description & test to make sure subscripting by attributes even\n * works for webgl\n *\n * @see {@link Layout}\n */\nLayout.MATERIAL_INDEX = new Attribute("materialIndex", 1, TYPES.SHORT);\nLayout.MATERIAL_ENABLED = new Attribute("materialEnabled", 1, TYPES.UNSIGNED_SHORT);\nLayout.AMBIENT = new Attribute("ambient", 3, TYPES.FLOAT);\nLayout.DIFFUSE = new Attribute("diffuse", 3, TYPES.FLOAT);\nLayout.SPECULAR = new Attribute("specular", 3, TYPES.FLOAT);\nLayout.SPECULAR_EXPONENT = new Attribute("specularExponent", 3, TYPES.FLOAT);\nLayout.EMISSIVE = new Attribute("emissive", 3, TYPES.FLOAT);\nLayout.TRANSMISSION_FILTER = new Attribute("transmissionFilter", 3, TYPES.FLOAT);\nLayout.DISSOLVE = new Attribute("dissolve", 1, TYPES.FLOAT);\nLayout.ILLUMINATION = new Attribute("illumination", 1, TYPES.UNSIGNED_SHORT);\nLayout.REFRACTION_INDEX = new Attribute("refractionIndex", 1, TYPES.FLOAT);\nLayout.SHARPNESS = new Attribute("sharpness", 1, TYPES.FLOAT);\nLayout.MAP_DIFFUSE = new Attribute("mapDiffuse", 1, TYPES.SHORT);\nLayout.MAP_AMBIENT = new Attribute("mapAmbient", 1, TYPES.SHORT);\nLayout.MAP_SPECULAR = new Attribute("mapSpecular", 1, TYPES.SHORT);\nLayout.MAP_SPECULAR_EXPONENT = new Attribute("mapSpecularExponent", 1, TYPES.SHORT);\nLayout.MAP_DISSOLVE = new Attribute("mapDissolve", 1, TYPES.SHORT);\nLayout.ANTI_ALIASING = new Attribute("antiAliasing", 1, TYPES.UNSIGNED_SHORT);\nLayout.MAP_BUMP = new Attribute("mapBump", 1, TYPES.SHORT);\nLayout.MAP_DISPLACEMENT = new Attribute("mapDisplacement", 1, TYPES.SHORT);\nLayout.MAP_DECAL = new Attribute("mapDecal", 1, TYPES.SHORT);\nLayout.MAP_EMISSIVE = new Attribute("mapEmissive", 1, TYPES.SHORT);\n\n\n//# sourceURL=webpack:///./src/layout.ts?')},"./src/material.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Material", function() { return Material; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaterialLibrary", function() { return MaterialLibrary; });\n/**\n * The Material class.\n */\nclass Material {\n constructor(name) {\n this.name = name;\n /**\n * Constructor\n * @param {String} name the unique name of the material\n */\n // The values for the following attibutes\n // are an array of R, G, B normalized values.\n // Ka - Ambient Reflectivity\n this.ambient = [0, 0, 0];\n // Kd - Defuse Reflectivity\n this.diffuse = [0, 0, 0];\n // Ks\n this.specular = [0, 0, 0];\n // Ke\n this.emissive = [0, 0, 0];\n // Tf\n this.transmissionFilter = [0, 0, 0];\n // d\n this.dissolve = 0;\n // valid range is between 0 and 1000\n this.specularExponent = 0;\n // either d or Tr; valid values are normalized\n this.transparency = 0;\n // illum - the enum of the illumination model to use\n this.illumination = 0;\n // Ni - Set to "normal" (air).\n this.refractionIndex = 1;\n // sharpness\n this.sharpness = 0;\n // map_Kd\n this.mapDiffuse = emptyTextureOptions();\n // map_Ka\n this.mapAmbient = emptyTextureOptions();\n // map_Ks\n this.mapSpecular = emptyTextureOptions();\n // map_Ns\n this.mapSpecularExponent = emptyTextureOptions();\n // map_d\n this.mapDissolve = emptyTextureOptions();\n // map_aat\n this.antiAliasing = false;\n // map_bump or bump\n this.mapBump = emptyTextureOptions();\n // disp\n this.mapDisplacement = emptyTextureOptions();\n // decal\n this.mapDecal = emptyTextureOptions();\n // map_Ke\n this.mapEmissive = emptyTextureOptions();\n // refl - when the reflection type is a cube, there will be multiple refl\n // statements for each side of the cube. If it\'s a spherical\n // reflection, there should only ever be one.\n this.mapReflections = [];\n }\n}\nconst SENTINEL_MATERIAL = new Material("sentinel");\n/**\n * https://en.wikipedia.org/wiki/Wavefront_.obj_file\n * http://paulbourke.net/dataformats/mtl/\n */\nclass MaterialLibrary {\n constructor(data) {\n this.data = data;\n /**\n * Constructs the Material Parser\n * @param mtlData the MTL file contents\n */\n this.currentMaterial = SENTINEL_MATERIAL;\n this.materials = {};\n this.parse();\n }\n /* eslint-disable camelcase */\n /* the function names here disobey camelCase conventions\n to make parsing/routing easier. see the parse function\n documentation for more information. */\n /**\n * Creates a new Material object and adds to the registry.\n * @param tokens the tokens associated with the directive\n */\n parse_newmtl(tokens) {\n const name = tokens[0];\n // console.info(\'Parsing new Material:\', name);\n this.currentMaterial = new Material(name);\n this.materials[name] = this.currentMaterial;\n }\n /**\n * See the documenation for parse_Ka below for a better understanding.\n *\n * Given a list of possible color tokens, returns an array of R, G, and B\n * color values.\n *\n * @param tokens the tokens associated with the directive\n * @return {*} a 3 element array containing the R, G, and B values\n * of the color.\n */\n parseColor(tokens) {\n if (tokens[0] == "spectral") {\n throw new Error("The MTL parser does not support spectral curve files. You will " +\n "need to convert the MTL colors to either RGB or CIEXYZ.");\n }\n if (tokens[0] == "xyz") {\n throw new Error("The MTL parser does not currently support XYZ colors. Either convert the " +\n "XYZ values to RGB or create an issue to add support for XYZ");\n }\n // from my understanding of the spec, RGB values at this point\n // will either be 3 floats or exactly 1 float, so that\'s the check\n // that i\'m going to perform here\n if (tokens.length == 3) {\n const [x, y, z] = tokens;\n return [parseFloat(x), parseFloat(y), parseFloat(z)];\n }\n // Since tokens at this point has a length of 3, we\'re going to assume\n // it\'s exactly 1, skipping the check for 2.\n const value = parseFloat(tokens[0]);\n // in this case, all values are equivalent\n return [value, value, value];\n }\n /**\n * Parse the ambient reflectivity\n *\n * A Ka directive can take one of three forms:\n * - Ka r g b\n * - Ka spectral file.rfl\n * - Ka xyz x y z\n * These three forms are mutually exclusive in that only one\n * declaration can exist per material. It is considered a syntax\n * error otherwise.\n *\n * The "Ka" form specifies the ambient reflectivity using RGB values.\n * The "g" and "b" values are optional. If only the "r" value is\n * specified, then the "g" and "b" values are assigned the value of\n * "r". Values are normally in the range 0.0 to 1.0. Values outside\n * of this range increase or decrease the reflectivity accordingly.\n *\n * The "Ka spectral" form specifies the ambient reflectivity using a\n * spectral curve. "file.rfl" is the name of the ".rfl" file containing\n * the curve data. "factor" is an optional argument which is a multiplier\n * for the values in the .rfl file and defaults to 1.0 if not specified.\n *\n * The "Ka xyz" form specifies the ambient reflectivity using CIEXYZ values.\n * "x y z" are the values of the CIEXYZ color space. The "y" and "z" arguments\n * are optional and take on the value of the "x" component if only "x" is\n * specified. The "x y z" values are normally in the range of 0.0 to 1.0 and\n * increase or decrease ambient reflectivity accordingly outside of that\n * range.\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Ka(tokens) {\n this.currentMaterial.ambient = this.parseColor(tokens);\n }\n /**\n * Diffuse Reflectivity\n *\n * Similar to the Ka directive. Simply replace "Ka" with "Kd" and the rules\n * are the same\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Kd(tokens) {\n this.currentMaterial.diffuse = this.parseColor(tokens);\n }\n /**\n * Spectral Reflectivity\n *\n * Similar to the Ka directive. Simply replace "Ks" with "Kd" and the rules\n * are the same\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Ks(tokens) {\n this.currentMaterial.specular = this.parseColor(tokens);\n }\n /**\n * Emissive\n *\n * The amount and color of light emitted by the object.\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Ke(tokens) {\n this.currentMaterial.emissive = this.parseColor(tokens);\n }\n /**\n * Transmission Filter\n *\n * Any light passing through the object is filtered by the transmission\n * filter, which only allows specific colors to pass through. For example, Tf\n * 0 1 0 allows all of the green to pass through and filters out all of the\n * red and blue.\n *\n * Similar to the Ka directive. Simply replace "Ks" with "Tf" and the rules\n * are the same\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Tf(tokens) {\n this.currentMaterial.transmissionFilter = this.parseColor(tokens);\n }\n /**\n * Specifies the dissolve for the current material.\n *\n * Statement: d [-halo] `factor`\n *\n * Example: "d 0.5"\n *\n * The factor is the amount this material dissolves into the background. A\n * factor of 1.0 is fully opaque. This is the default when a new material is\n * created. A factor of 0.0 is fully dissolved (completely transparent).\n *\n * Unlike a real transparent material, the dissolve does not depend upon\n * material thickness nor does it have any spectral character. Dissolve works\n * on all illumination models.\n *\n * The dissolve statement allows for an optional "-halo" flag which indicates\n * that a dissolve is dependent on the surface orientation relative to the\n * viewer. For example, a sphere with the following dissolve, "d -halo 0.0",\n * will be fully dissolved at its center and will appear gradually more opaque\n * toward its edge.\n *\n * "factor" is the minimum amount of dissolve applied to the material. The\n * amount of dissolve will vary between 1.0 (fully opaque) and the specified\n * "factor". The formula is:\n *\n * dissolve = 1.0 - (N*v)(1.0-factor)\n *\n * @param tokens the tokens associated with the directive\n */\n parse_d(tokens) {\n // this ignores the -halo option as I can\'t find any documentation on what\n // it\'s supposed to be.\n this.currentMaterial.dissolve = parseFloat(tokens.pop() || "0");\n }\n /**\n * The "illum" statement specifies the illumination model to use in the\n * material. Illumination models are mathematical equations that represent\n * various material lighting and shading effects.\n *\n * The illumination number can be a number from 0 to 10. The following are\n * the list of illumination enumerations and their summaries:\n * 0. Color on and Ambient off\n * 1. Color on and Ambient on\n * 2. Highlight on\n * 3. Reflection on and Ray trace on\n * 4. Transparency: Glass on, Reflection: Ray trace on\n * 5. Reflection: Fresnel on and Ray trace on\n * 6. Transparency: Refraction on, Reflection: Fresnel off and Ray trace on\n * 7. Transparency: Refraction on, Reflection: Fresnel on and Ray trace on\n * 8. Reflection on and Ray trace off\n * 9. Transparency: Glass on, Reflection: Ray trace off\n * 10. Casts shadows onto invisible surfaces\n *\n * Example: "illum 2" to specify the "Highlight on" model\n *\n * @param tokens the tokens associated with the directive\n */\n parse_illum(tokens) {\n this.currentMaterial.illumination = parseInt(tokens[0]);\n }\n /**\n * Optical Density (AKA Index of Refraction)\n *\n * Statement: Ni `index`\n *\n * Example: Ni 1.0\n *\n * Specifies the optical density for the surface. `index` is the value\n * for the optical density. The values can range from 0.001 to 10. A value of\n * 1.0 means that light does not bend as it passes through an object.\n * Increasing the optical_density increases the amount of bending. Glass has\n * an index of refraction of about 1.5. Values of less than 1.0 produce\n * bizarre results and are not recommended\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Ni(tokens) {\n this.currentMaterial.refractionIndex = parseFloat(tokens[0]);\n }\n /**\n * Specifies the specular exponent for the current material. This defines the\n * focus of the specular highlight.\n *\n * Statement: Ns `exponent`\n *\n * Example: "Ns 250"\n *\n * `exponent` is the value for the specular exponent. A high exponent results\n * in a tight, concentrated highlight. Ns Values normally range from 0 to\n * 1000.\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Ns(tokens) {\n this.currentMaterial.specularExponent = parseInt(tokens[0]);\n }\n /**\n * Specifies the sharpness of the reflections from the local reflection map.\n *\n * Statement: sharpness `value`\n *\n * Example: "sharpness 100"\n *\n * If a material does not have a local reflection map defined in its material\n * defintions, sharpness will apply to the global reflection map defined in\n * PreView.\n *\n * `value` can be a number from 0 to 1000. The default is 60. A high value\n * results in a clear reflection of objects in the reflection map.\n *\n * Tip: sharpness values greater than 100 introduce aliasing effects in\n * flat surfaces that are viewed at a sharp angle.\n *\n * @param tokens the tokens associated with the directive\n */\n parse_sharpness(tokens) {\n this.currentMaterial.sharpness = parseInt(tokens[0]);\n }\n /**\n * Parses the -cc flag and updates the options object with the values.\n *\n * @param values the values passed to the -cc flag\n * @param options the Object of all image options\n */\n parse_cc(values, options) {\n options.colorCorrection = values[0] == "on";\n }\n /**\n * Parses the -blendu flag and updates the options object with the values.\n *\n * @param values the values passed to the -blendu flag\n * @param options the Object of all image options\n */\n parse_blendu(values, options) {\n options.horizontalBlending = values[0] == "on";\n }\n /**\n * Parses the -blendv flag and updates the options object with the values.\n *\n * @param values the values passed to the -blendv flag\n * @param options the Object of all image options\n */\n parse_blendv(values, options) {\n options.verticalBlending = values[0] == "on";\n }\n /**\n * Parses the -boost flag and updates the options object with the values.\n *\n * @param values the values passed to the -boost flag\n * @param options the Object of all image options\n */\n parse_boost(values, options) {\n options.boostMipMapSharpness = parseFloat(values[0]);\n }\n /**\n * Parses the -mm flag and updates the options object with the values.\n *\n * @param values the values passed to the -mm flag\n * @param options the Object of all image options\n */\n parse_mm(values, options) {\n options.modifyTextureMap.brightness = parseFloat(values[0]);\n options.modifyTextureMap.contrast = parseFloat(values[1]);\n }\n /**\n * Parses and sets the -o, -s, and -t u, v, and w values\n *\n * @param values the values passed to the -o, -s, -t flag\n * @param {Object} option the Object of either the -o, -s, -t option\n * @param {Integer} defaultValue the Object of all image options\n */\n parse_ost(values, option, defaultValue) {\n while (values.length < 3) {\n values.push(defaultValue.toString());\n }\n option.u = parseFloat(values[0]);\n option.v = parseFloat(values[1]);\n option.w = parseFloat(values[2]);\n }\n /**\n * Parses the -o flag and updates the options object with the values.\n *\n * @param values the values passed to the -o flag\n * @param options the Object of all image options\n */\n parse_o(values, options) {\n this.parse_ost(values, options.offset, 0);\n }\n /**\n * Parses the -s flag and updates the options object with the values.\n *\n * @param values the values passed to the -s flag\n * @param options the Object of all image options\n */\n parse_s(values, options) {\n this.parse_ost(values, options.scale, 1);\n }\n /**\n * Parses the -t flag and updates the options object with the values.\n *\n * @param values the values passed to the -t flag\n * @param options the Object of all image options\n */\n parse_t(values, options) {\n this.parse_ost(values, options.turbulence, 0);\n }\n /**\n * Parses the -texres flag and updates the options object with the values.\n *\n * @param values the values passed to the -texres flag\n * @param options the Object of all image options\n */\n parse_texres(values, options) {\n options.textureResolution = parseFloat(values[0]);\n }\n /**\n * Parses the -clamp flag and updates the options object with the values.\n *\n * @param values the values passed to the -clamp flag\n * @param options the Object of all image options\n */\n parse_clamp(values, options) {\n options.clamp = values[0] == "on";\n }\n /**\n * Parses the -bm flag and updates the options object with the values.\n *\n * @param values the values passed to the -bm flag\n * @param options the Object of all image options\n */\n parse_bm(values, options) {\n options.bumpMultiplier = parseFloat(values[0]);\n }\n /**\n * Parses the -imfchan flag and updates the options object with the values.\n *\n * @param values the values passed to the -imfchan flag\n * @param options the Object of all image options\n */\n parse_imfchan(values, options) {\n options.imfChan = values[0];\n }\n /**\n * This only exists for relection maps and denotes the type of reflection.\n *\n * @param values the values passed to the -type flag\n * @param options the Object of all image options\n */\n parse_type(values, options) {\n options.reflectionType = values[0];\n }\n /**\n * Parses the texture\'s options and returns an options object with the info\n *\n * @param tokens all of the option tokens to pass to the texture\n * @return {Object} a complete object of objects to apply to the texture\n */\n parseOptions(tokens) {\n const options = emptyTextureOptions();\n let option;\n let values;\n const optionsToValues = {};\n tokens.reverse();\n while (tokens.length) {\n // token is guaranteed to exists here, hence the explicit "as"\n const token = tokens.pop();\n if (token.startsWith("-")) {\n option = token.substr(1);\n optionsToValues[option] = [];\n }\n else if (option) {\n optionsToValues[option].push(token);\n }\n }\n for (option in optionsToValues) {\n if (!optionsToValues.hasOwnProperty(option)) {\n continue;\n }\n values = optionsToValues[option];\n const optionMethod = this[`parse_${option}`];\n if (optionMethod) {\n optionMethod.bind(this)(values, options);\n }\n }\n return options;\n }\n /**\n * Parses the given texture map line.\n *\n * @param tokens all of the tokens representing the texture\n * @return a complete object of objects to apply to the texture\n */\n parseMap(tokens) {\n // according to wikipedia:\n // (https://en.wikipedia.org/wiki/Wavefront_.obj_file#Vendor_specific_alterations)\n // there is at least one vendor that places the filename before the options\n // rather than after (which is to spec). All options start with a \'-\'\n // so if the first token doesn\'t start with a \'-\', we\'re going to assume\n // it\'s the name of the map file.\n let optionsString;\n let filename = "";\n if (!tokens[0].startsWith("-")) {\n [filename, ...optionsString] = tokens;\n }\n else {\n filename = tokens.pop();\n optionsString = tokens;\n }\n const options = this.parseOptions(optionsString);\n options.filename = filename.replace(/\\\\/g, "/");\n return options;\n }\n /**\n * Parses the ambient map.\n *\n * @param tokens list of tokens for the map_Ka direcive\n */\n parse_map_Ka(tokens) {\n this.currentMaterial.mapAmbient = this.parseMap(tokens);\n }\n /**\n * Parses the diffuse map.\n *\n * @param tokens list of tokens for the map_Kd direcive\n */\n parse_map_Kd(tokens) {\n this.currentMaterial.mapDiffuse = this.parseMap(tokens);\n }\n /**\n * Parses the specular map.\n *\n * @param tokens list of tokens for the map_Ks direcive\n */\n parse_map_Ks(tokens) {\n this.currentMaterial.mapSpecular = this.parseMap(tokens);\n }\n /**\n * Parses the emissive map.\n *\n * @param tokens list of tokens for the map_Ke direcive\n */\n parse_map_Ke(tokens) {\n this.currentMaterial.mapEmissive = this.parseMap(tokens);\n }\n /**\n * Parses the specular exponent map.\n *\n * @param tokens list of tokens for the map_Ns direcive\n */\n parse_map_Ns(tokens) {\n this.currentMaterial.mapSpecularExponent = this.parseMap(tokens);\n }\n /**\n * Parses the dissolve map.\n *\n * @param tokens list of tokens for the map_d direcive\n */\n parse_map_d(tokens) {\n this.currentMaterial.mapDissolve = this.parseMap(tokens);\n }\n /**\n * Parses the anti-aliasing option.\n *\n * @param tokens list of tokens for the map_aat direcive\n */\n parse_map_aat(tokens) {\n this.currentMaterial.antiAliasing = tokens[0] == "on";\n }\n /**\n * Parses the bump map.\n *\n * @param tokens list of tokens for the map_bump direcive\n */\n parse_map_bump(tokens) {\n this.currentMaterial.mapBump = this.parseMap(tokens);\n }\n /**\n * Parses the bump map.\n *\n * @param tokens list of tokens for the bump direcive\n */\n parse_bump(tokens) {\n this.parse_map_bump(tokens);\n }\n /**\n * Parses the disp map.\n *\n * @param tokens list of tokens for the disp direcive\n */\n parse_disp(tokens) {\n this.currentMaterial.mapDisplacement = this.parseMap(tokens);\n }\n /**\n * Parses the decal map.\n *\n * @param tokens list of tokens for the map_decal direcive\n */\n parse_decal(tokens) {\n this.currentMaterial.mapDecal = this.parseMap(tokens);\n }\n /**\n * Parses the refl map.\n *\n * @param tokens list of tokens for the refl direcive\n */\n parse_refl(tokens) {\n this.currentMaterial.mapReflections.push(this.parseMap(tokens));\n }\n /**\n * Parses the MTL file.\n *\n * Iterates line by line parsing each MTL directive.\n *\n * This function expects the first token in the line\n * to be a valid MTL directive. That token is then used\n * to try and run a method on this class. parse_[directive]\n * E.g., the `newmtl` directive would try to call the method\n * parse_newmtl. Each parsing function takes in the remaining\n * list of tokens and updates the currentMaterial class with\n * the attributes provided.\n */\n parse() {\n const lines = this.data.split(/\\r?\\n/);\n for (let line of lines) {\n line = line.trim();\n if (!line || line.startsWith("#")) {\n continue;\n }\n const [directive, ...tokens] = line.split(/\\s/);\n const parseMethod = this[`parse_${directive}`];\n if (!parseMethod) {\n console.warn(`Don\'t know how to parse the directive: "${directive}"`);\n continue;\n }\n // console.log(`Parsing "${directive}" with tokens: ${tokens}`);\n parseMethod.bind(this)(tokens);\n }\n // some cleanup. These don\'t need to be exposed as public data.\n delete this.data;\n this.currentMaterial = SENTINEL_MATERIAL;\n }\n}\nfunction emptyTextureOptions() {\n return {\n colorCorrection: false,\n horizontalBlending: true,\n verticalBlending: true,\n boostMipMapSharpness: 0,\n modifyTextureMap: {\n brightness: 0,\n contrast: 1,\n },\n offset: { u: 0, v: 0, w: 0 },\n scale: { u: 1, v: 1, w: 1 },\n turbulence: { u: 0, v: 0, w: 0 },\n clamp: false,\n textureResolution: null,\n bumpMultiplier: 1,\n imfChan: null,\n filename: "",\n };\n}\n\n\n//# sourceURL=webpack:///./src/material.ts?')},"./src/mesh.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Mesh; });\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./layout */ "./src/layout.ts");\n\n/**\n * The main Mesh class. The constructor will parse through the OBJ file data\n * and collect the vertex, vertex normal, texture, and face information. This\n * information can then be used later on when creating your VBOs. See\n * OBJ.initMeshBuffers for an example of how to use the newly created Mesh\n */\nclass Mesh {\n /**\n * Create a Mesh\n * @param {String} objectData - a string representation of an OBJ file with\n * newlines preserved.\n * @param {Object} options - a JS object containing valid options. See class\n * documentation for options.\n * @param {bool} options.enableWTextureCoord - Texture coordinates can have\n * an optional "w" coordinate after the u and v coordinates. This extra\n * value can be used in order to perform fancy transformations on the\n * textures themselves. Default is to truncate to only the u an v\n * coordinates. Passing true will provide a default value of 0 in the\n * event that any or all texture coordinates don\'t provide a w value.\n * Always use the textureStride attribute in order to determine the\n * stride length of the texture coordinates when rendering the element\n * array.\n * @param {bool} options.calcTangentsAndBitangents - Calculate the tangents\n * and bitangents when loading of the OBJ is completed. This adds two new\n * attributes to the Mesh instance: `tangents` and `bitangents`.\n */\n constructor(objectData, options) {\n this.name = "";\n this.indicesPerMaterial = [];\n this.materialsByIndex = {};\n this.tangents = [];\n this.bitangents = [];\n options = options || {};\n options.materials = options.materials || {};\n options.enableWTextureCoord = !!options.enableWTextureCoord;\n // the list of unique vertex, normal, texture, attributes\n this.vertexNormals = [];\n this.textures = [];\n // the indicies to draw the faces\n this.indices = [];\n this.textureStride = options.enableWTextureCoord ? 3 : 2;\n /*\n The OBJ file format does a sort of compression when saving a model in a\n program like Blender. There are at least 3 sections (4 including textures)\n within the file. Each line in a section begins with the same string:\n * \'v\': indicates vertex section\n * \'vn\': indicates vertex normal section\n * \'f\': indicates the faces section\n * \'vt\': indicates vertex texture section (if textures were used on the model)\n Each of the above sections (except for the faces section) is a list/set of\n unique vertices.\n\n Each line of the faces section contains a list of\n (vertex, [texture], normal) groups.\n\n **Note:** The following documentation will use a capital "V" Vertex to\n denote the above (vertex, [texture], normal) groups whereas a lowercase\n "v" vertex is used to denote an X, Y, Z coordinate.\n\n Some examples:\n // the texture index is optional, both formats are possible for models\n // without a texture applied\n f 1/25 18/46 12/31\n f 1//25 18//46 12//31\n\n // A 3 vertex face with texture indices\n f 16/92/11 14/101/22 1/69/1\n\n // A 4 vertex face\n f 16/92/11 40/109/40 38/114/38 14/101/22\n\n The first two lines are examples of a 3 vertex face without a texture applied.\n The second is an example of a 3 vertex face with a texture applied.\n The third is an example of a 4 vertex face. Note: a face can contain N\n number of vertices.\n\n Each number that appears in one of the groups is a 1-based index\n corresponding to an item from the other sections (meaning that indexing\n starts at one and *not* zero).\n\n For example:\n `f 16/92/11` is saying to\n - take the 16th element from the [v] vertex array\n - take the 92nd element from the [vt] texture array\n - take the 11th element from the [vn] normal array\n and together they make a unique vertex.\n Using all 3+ unique Vertices from the face line will produce a polygon.\n\n Now, you could just go through the OBJ file and create a new vertex for\n each face line and WebGL will draw what appears to be the same model.\n However, vertices will be overlapped and duplicated all over the place.\n\n Consider a cube in 3D space centered about the origin and each side is\n 2 units long. The front face (with the positive Z-axis pointing towards\n you) would have a Top Right vertex (looking orthogonal to its normal)\n mapped at (1,1,1) The right face would have a Top Left vertex (looking\n orthogonal to its normal) at (1,1,1) and the top face would have a Bottom\n Right vertex (looking orthogonal to its normal) at (1,1,1). Each face\n has a vertex at the same coordinates, however, three distinct vertices\n will be drawn at the same spot.\n\n To solve the issue of duplicate Vertices (the `(vertex, [texture], normal)`\n groups), while iterating through the face lines, when a group is encountered\n the whole group string (\'16/92/11\') is checked to see if it exists in the\n packed.hashindices object, and if it doesn\'t, the indices it specifies\n are used to look up each attribute in the corresponding attribute arrays\n already created. The values are then copied to the corresponding unpacked\n array (flattened to play nice with WebGL\'s ELEMENT_ARRAY_BUFFER indexing),\n the group string is added to the hashindices set and the current unpacked\n index is used as this hashindices value so that the group of elements can\n be reused. The unpacked index is incremented. If the group string already\n exists in the hashindices object, its corresponding value is the index of\n that group and is appended to the unpacked indices array.\n */\n const verts = [];\n const vertNormals = [];\n const textures = [];\n const materialNamesByIndex = [];\n const materialIndicesByName = {};\n // keep track of what material we\'ve seen last\n let currentMaterialIndex = -1;\n let currentObjectByMaterialIndex = 0;\n // unpacking stuff\n const unpacked = {\n verts: [],\n norms: [],\n textures: [],\n hashindices: {},\n indices: [[]],\n materialIndices: [],\n index: 0,\n };\n const VERTEX_RE = /^v\\s/;\n const NORMAL_RE = /^vn\\s/;\n const TEXTURE_RE = /^vt\\s/;\n const FACE_RE = /^f\\s/;\n const WHITESPACE_RE = /\\s+/;\n const USE_MATERIAL_RE = /^usemtl/;\n // array of lines separated by the newline\n const lines = objectData.split("\\n");\n for (let line of lines) {\n line = line.trim();\n if (!line || line.startsWith("#")) {\n continue;\n }\n const elements = line.split(WHITESPACE_RE);\n elements.shift();\n if (VERTEX_RE.test(line)) {\n // if this is a vertex\n verts.push(...elements);\n }\n else if (NORMAL_RE.test(line)) {\n // if this is a vertex normal\n vertNormals.push(...elements);\n }\n else if (TEXTURE_RE.test(line)) {\n let coords = elements;\n // by default, the loader will only look at the U and V\n // coordinates of the vt declaration. So, this truncates the\n // elements to only those 2 values. If W texture coordinate\n // support is enabled, then the texture coordinate is\n // expected to have three values in it.\n if (elements.length > 2 && !options.enableWTextureCoord) {\n coords = elements.slice(0, 2);\n }\n else if (elements.length === 2 && options.enableWTextureCoord) {\n // If for some reason W texture coordinate support is enabled\n // and only the U and V coordinates are given, then we supply\n // the default value of 0 so that the stride length is correct\n // when the textures are unpacked below.\n coords.push("0");\n }\n textures.push(...coords);\n }\n else if (USE_MATERIAL_RE.test(line)) {\n const materialName = elements[0];\n // check to see if we\'ve ever seen it before\n if (!(materialName in materialIndicesByName)) {\n // new material we\'ve never seen\n materialNamesByIndex.push(materialName);\n materialIndicesByName[materialName] = materialNamesByIndex.length - 1;\n // push new array into indices\n // already contains an array at index zero, don\'t add\n if (materialIndicesByName[materialName] > 0) {\n unpacked.indices.push([]);\n }\n }\n // keep track of the current material index\n currentMaterialIndex = materialIndicesByName[materialName];\n // update current index array\n currentObjectByMaterialIndex = currentMaterialIndex;\n }\n else if (FACE_RE.test(line)) {\n // if this is a face\n /*\n split this face into an array of Vertex groups\n for example:\n f 16/92/11 14/101/22 1/69/1\n becomes:\n [\'16/92/11\', \'14/101/22\', \'1/69/1\'];\n */\n const triangles = triangulate(elements);\n for (const triangle of triangles) {\n for (let j = 0, eleLen = triangle.length; j < eleLen; j++) {\n const hash = triangle[j] + "," + currentMaterialIndex;\n if (hash in unpacked.hashindices) {\n unpacked.indices[currentObjectByMaterialIndex].push(unpacked.hashindices[hash]);\n }\n else {\n /*\n Each element of the face line array is a Vertex which has its\n attributes delimited by a forward slash. This will separate\n each attribute into another array:\n \'19/92/11\'\n becomes:\n Vertex = [\'19\', \'92\', \'11\'];\n where\n Vertex[0] is the vertex index\n Vertex[1] is the texture index\n Vertex[2] is the normal index\n Think of faces having Vertices which are comprised of the\n attributes location (v), texture (vt), and normal (vn).\n */\n const vertex = triangle[j].split("/");\n // it\'s possible for faces to only specify the vertex\n // and the normal. In this case, vertex will only have\n // a length of 2 and not 3 and the normal will be the\n // second item in the list with an index of 1.\n const normalIndex = vertex.length - 1;\n /*\n The verts, textures, and vertNormals arrays each contain a\n flattend array of coordinates.\n\n Because it gets confusing by referring to Vertex and then\n vertex (both are different in my descriptions) I will explain\n what\'s going on using the vertexNormals array:\n\n vertex[2] will contain the one-based index of the vertexNormals\n section (vn). One is subtracted from this index number to play\n nice with javascript\'s zero-based array indexing.\n\n Because vertexNormal is a flattened array of x, y, z values,\n simple pointer arithmetic is used to skip to the start of the\n vertexNormal, then the offset is added to get the correct\n component: +0 is x, +1 is y, +2 is z.\n\n This same process is repeated for verts and textures.\n */\n // Vertex position\n unpacked.verts.push(+verts[(+vertex[0] - 1) * 3 + 0]);\n unpacked.verts.push(+verts[(+vertex[0] - 1) * 3 + 1]);\n unpacked.verts.push(+verts[(+vertex[0] - 1) * 3 + 2]);\n // Vertex textures\n if (textures.length) {\n const stride = options.enableWTextureCoord ? 3 : 2;\n unpacked.textures.push(+textures[(+vertex[1] - 1) * stride + 0]);\n unpacked.textures.push(+textures[(+vertex[1] - 1) * stride + 1]);\n if (options.enableWTextureCoord) {\n unpacked.textures.push(+textures[(+vertex[1] - 1) * stride + 2]);\n }\n }\n // Vertex normals\n unpacked.norms.push(+vertNormals[(+vertex[normalIndex] - 1) * 3 + 0]);\n unpacked.norms.push(+vertNormals[(+vertex[normalIndex] - 1) * 3 + 1]);\n unpacked.norms.push(+vertNormals[(+vertex[normalIndex] - 1) * 3 + 2]);\n // Vertex material indices\n unpacked.materialIndices.push(currentMaterialIndex);\n // add the newly created Vertex to the list of indices\n unpacked.hashindices[hash] = unpacked.index;\n unpacked.indices[currentObjectByMaterialIndex].push(unpacked.hashindices[hash]);\n // increment the counter\n unpacked.index += 1;\n }\n }\n }\n }\n }\n this.vertices = unpacked.verts;\n this.vertexNormals = unpacked.norms;\n this.textures = unpacked.textures;\n this.vertexMaterialIndices = unpacked.materialIndices;\n this.indices = unpacked.indices[currentObjectByMaterialIndex];\n this.indicesPerMaterial = unpacked.indices;\n this.materialNames = materialNamesByIndex;\n this.materialIndices = materialIndicesByName;\n this.materialsByIndex = {};\n if (options.calcTangentsAndBitangents) {\n this.calculateTangentsAndBitangents();\n }\n }\n /**\n * Calculates the tangents and bitangents of the mesh that forms an orthogonal basis together with the\n * normal in the direction of the texture coordinates. These are useful for setting up the TBN matrix\n * when distorting the normals through normal maps.\n * Method derived from: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-13-normal-mapping/\n *\n * This method requires the normals and texture coordinates to be parsed and set up correctly.\n * Adds the tangents and bitangents as members of the class instance.\n */\n calculateTangentsAndBitangents() {\n console.assert(!!(this.vertices &&\n this.vertices.length &&\n this.vertexNormals &&\n this.vertexNormals.length &&\n this.textures &&\n this.textures.length), "Missing attributes for calculating tangents and bitangents");\n const unpacked = {\n tangents: [...new Array(this.vertices.length)].map(_ => 0),\n bitangents: [...new Array(this.vertices.length)].map(_ => 0),\n };\n // Loop through all faces in the whole mesh\n const indices = this.indices;\n const vertices = this.vertices;\n const normals = this.vertexNormals;\n const uvs = this.textures;\n for (let i = 0; i < indices.length; i += 3) {\n const i0 = indices[i + 0];\n const i1 = indices[i + 1];\n const i2 = indices[i + 2];\n const x_v0 = vertices[i0 * 3 + 0];\n const y_v0 = vertices[i0 * 3 + 1];\n const z_v0 = vertices[i0 * 3 + 2];\n const x_uv0 = uvs[i0 * 2 + 0];\n const y_uv0 = uvs[i0 * 2 + 1];\n const x_v1 = vertices[i1 * 3 + 0];\n const y_v1 = vertices[i1 * 3 + 1];\n const z_v1 = vertices[i1 * 3 + 2];\n const x_uv1 = uvs[i1 * 2 + 0];\n const y_uv1 = uvs[i1 * 2 + 1];\n const x_v2 = vertices[i2 * 3 + 0];\n const y_v2 = vertices[i2 * 3 + 1];\n const z_v2 = vertices[i2 * 3 + 2];\n const x_uv2 = uvs[i2 * 2 + 0];\n const y_uv2 = uvs[i2 * 2 + 1];\n const x_deltaPos1 = x_v1 - x_v0;\n const y_deltaPos1 = y_v1 - y_v0;\n const z_deltaPos1 = z_v1 - z_v0;\n const x_deltaPos2 = x_v2 - x_v0;\n const y_deltaPos2 = y_v2 - y_v0;\n const z_deltaPos2 = z_v2 - z_v0;\n const x_uvDeltaPos1 = x_uv1 - x_uv0;\n const y_uvDeltaPos1 = y_uv1 - y_uv0;\n const x_uvDeltaPos2 = x_uv2 - x_uv0;\n const y_uvDeltaPos2 = y_uv2 - y_uv0;\n const rInv = x_uvDeltaPos1 * y_uvDeltaPos2 - y_uvDeltaPos1 * x_uvDeltaPos2;\n const r = 1.0 / Math.abs(rInv < 0.0001 ? 1.0 : rInv);\n // Tangent\n const x_tangent = (x_deltaPos1 * y_uvDeltaPos2 - x_deltaPos2 * y_uvDeltaPos1) * r;\n const y_tangent = (y_deltaPos1 * y_uvDeltaPos2 - y_deltaPos2 * y_uvDeltaPos1) * r;\n const z_tangent = (z_deltaPos1 * y_uvDeltaPos2 - z_deltaPos2 * y_uvDeltaPos1) * r;\n // Bitangent\n const x_bitangent = (x_deltaPos2 * x_uvDeltaPos1 - x_deltaPos1 * x_uvDeltaPos2) * r;\n const y_bitangent = (y_deltaPos2 * x_uvDeltaPos1 - y_deltaPos1 * x_uvDeltaPos2) * r;\n const z_bitangent = (z_deltaPos2 * x_uvDeltaPos1 - z_deltaPos1 * x_uvDeltaPos2) * r;\n // Gram-Schmidt orthogonalize\n //t = glm::normalize(t - n * glm:: dot(n, t));\n const x_n0 = normals[i0 * 3 + 0];\n const y_n0 = normals[i0 * 3 + 1];\n const z_n0 = normals[i0 * 3 + 2];\n const x_n1 = normals[i1 * 3 + 0];\n const y_n1 = normals[i1 * 3 + 1];\n const z_n1 = normals[i1 * 3 + 2];\n const x_n2 = normals[i2 * 3 + 0];\n const y_n2 = normals[i2 * 3 + 1];\n const z_n2 = normals[i2 * 3 + 2];\n // Tangent\n const n0_dot_t = x_tangent * x_n0 + y_tangent * y_n0 + z_tangent * z_n0;\n const n1_dot_t = x_tangent * x_n1 + y_tangent * y_n1 + z_tangent * z_n1;\n const n2_dot_t = x_tangent * x_n2 + y_tangent * y_n2 + z_tangent * z_n2;\n const x_resTangent0 = x_tangent - x_n0 * n0_dot_t;\n const y_resTangent0 = y_tangent - y_n0 * n0_dot_t;\n const z_resTangent0 = z_tangent - z_n0 * n0_dot_t;\n const x_resTangent1 = x_tangent - x_n1 * n1_dot_t;\n const y_resTangent1 = y_tangent - y_n1 * n1_dot_t;\n const z_resTangent1 = z_tangent - z_n1 * n1_dot_t;\n const x_resTangent2 = x_tangent - x_n2 * n2_dot_t;\n const y_resTangent2 = y_tangent - y_n2 * n2_dot_t;\n const z_resTangent2 = z_tangent - z_n2 * n2_dot_t;\n const magTangent0 = Math.sqrt(x_resTangent0 * x_resTangent0 + y_resTangent0 * y_resTangent0 + z_resTangent0 * z_resTangent0);\n const magTangent1 = Math.sqrt(x_resTangent1 * x_resTangent1 + y_resTangent1 * y_resTangent1 + z_resTangent1 * z_resTangent1);\n const magTangent2 = Math.sqrt(x_resTangent2 * x_resTangent2 + y_resTangent2 * y_resTangent2 + z_resTangent2 * z_resTangent2);\n // Bitangent\n const n0_dot_bt = x_bitangent * x_n0 + y_bitangent * y_n0 + z_bitangent * z_n0;\n const n1_dot_bt = x_bitangent * x_n1 + y_bitangent * y_n1 + z_bitangent * z_n1;\n const n2_dot_bt = x_bitangent * x_n2 + y_bitangent * y_n2 + z_bitangent * z_n2;\n const x_resBitangent0 = x_bitangent - x_n0 * n0_dot_bt;\n const y_resBitangent0 = y_bitangent - y_n0 * n0_dot_bt;\n const z_resBitangent0 = z_bitangent - z_n0 * n0_dot_bt;\n const x_resBitangent1 = x_bitangent - x_n1 * n1_dot_bt;\n const y_resBitangent1 = y_bitangent - y_n1 * n1_dot_bt;\n const z_resBitangent1 = z_bitangent - z_n1 * n1_dot_bt;\n const x_resBitangent2 = x_bitangent - x_n2 * n2_dot_bt;\n const y_resBitangent2 = y_bitangent - y_n2 * n2_dot_bt;\n const z_resBitangent2 = z_bitangent - z_n2 * n2_dot_bt;\n const magBitangent0 = Math.sqrt(x_resBitangent0 * x_resBitangent0 +\n y_resBitangent0 * y_resBitangent0 +\n z_resBitangent0 * z_resBitangent0);\n const magBitangent1 = Math.sqrt(x_resBitangent1 * x_resBitangent1 +\n y_resBitangent1 * y_resBitangent1 +\n z_resBitangent1 * z_resBitangent1);\n const magBitangent2 = Math.sqrt(x_resBitangent2 * x_resBitangent2 +\n y_resBitangent2 * y_resBitangent2 +\n z_resBitangent2 * z_resBitangent2);\n unpacked.tangents[i0 * 3 + 0] += x_resTangent0 / magTangent0;\n unpacked.tangents[i0 * 3 + 1] += y_resTangent0 / magTangent0;\n unpacked.tangents[i0 * 3 + 2] += z_resTangent0 / magTangent0;\n unpacked.tangents[i1 * 3 + 0] += x_resTangent1 / magTangent1;\n unpacked.tangents[i1 * 3 + 1] += y_resTangent1 / magTangent1;\n unpacked.tangents[i1 * 3 + 2] += z_resTangent1 / magTangent1;\n unpacked.tangents[i2 * 3 + 0] += x_resTangent2 / magTangent2;\n unpacked.tangents[i2 * 3 + 1] += y_resTangent2 / magTangent2;\n unpacked.tangents[i2 * 3 + 2] += z_resTangent2 / magTangent2;\n unpacked.bitangents[i0 * 3 + 0] += x_resBitangent0 / magBitangent0;\n unpacked.bitangents[i0 * 3 + 1] += y_resBitangent0 / magBitangent0;\n unpacked.bitangents[i0 * 3 + 2] += z_resBitangent0 / magBitangent0;\n unpacked.bitangents[i1 * 3 + 0] += x_resBitangent1 / magBitangent1;\n unpacked.bitangents[i1 * 3 + 1] += y_resBitangent1 / magBitangent1;\n unpacked.bitangents[i1 * 3 + 2] += z_resBitangent1 / magBitangent1;\n unpacked.bitangents[i2 * 3 + 0] += x_resBitangent2 / magBitangent2;\n unpacked.bitangents[i2 * 3 + 1] += y_resBitangent2 / magBitangent2;\n unpacked.bitangents[i2 * 3 + 2] += z_resBitangent2 / magBitangent2;\n // TODO: check handedness\n }\n this.tangents = unpacked.tangents;\n this.bitangents = unpacked.bitangents;\n }\n /**\n * @param layout - A {@link Layout} object that describes the\n * desired memory layout of the generated buffer\n * @return The packed array in the ... TODO\n */\n makeBufferData(layout) {\n const numItems = this.vertices.length / 3;\n const buffer = new ArrayBuffer(layout.stride * numItems);\n buffer.numItems = numItems;\n const dataView = new DataView(buffer);\n for (let i = 0, vertexOffset = 0; i < numItems; i++) {\n vertexOffset = i * layout.stride;\n // copy in the vertex data in the order and format given by the\n // layout param\n for (const attribute of layout.attributes) {\n const offset = vertexOffset + layout.attributeMap[attribute.key].offset;\n switch (attribute.key) {\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].POSITION.key:\n dataView.setFloat32(offset, this.vertices[i * 3], true);\n dataView.setFloat32(offset + 4, this.vertices[i * 3 + 1], true);\n dataView.setFloat32(offset + 8, this.vertices[i * 3 + 2], true);\n break;\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].UV.key:\n dataView.setFloat32(offset, this.textures[i * 2], true);\n dataView.setFloat32(offset + 4, this.textures[i * 2 + 1], true);\n break;\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].NORMAL.key:\n dataView.setFloat32(offset, this.vertexNormals[i * 3], true);\n dataView.setFloat32(offset + 4, this.vertexNormals[i * 3 + 1], true);\n dataView.setFloat32(offset + 8, this.vertexNormals[i * 3 + 2], true);\n break;\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].MATERIAL_INDEX.key:\n dataView.setInt16(offset, this.vertexMaterialIndices[i], true);\n break;\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].AMBIENT.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.ambient[0], true);\n dataView.setFloat32(offset + 4, material.ambient[1], true);\n dataView.setFloat32(offset + 8, material.ambient[2], true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].DIFFUSE.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.diffuse[0], true);\n dataView.setFloat32(offset + 4, material.diffuse[1], true);\n dataView.setFloat32(offset + 8, material.diffuse[2], true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].SPECULAR.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.specular[0], true);\n dataView.setFloat32(offset + 4, material.specular[1], true);\n dataView.setFloat32(offset + 8, material.specular[2], true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].SPECULAR_EXPONENT.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.specularExponent, true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].EMISSIVE.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.emissive[0], true);\n dataView.setFloat32(offset + 4, material.emissive[1], true);\n dataView.setFloat32(offset + 8, material.emissive[2], true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].TRANSMISSION_FILTER.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.transmissionFilter[0], true);\n dataView.setFloat32(offset + 4, material.transmissionFilter[1], true);\n dataView.setFloat32(offset + 8, material.transmissionFilter[2], true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].DISSOLVE.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.dissolve, true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].ILLUMINATION.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setInt16(offset, material.illumination, true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].REFRACTION_INDEX.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.refractionIndex, true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].SHARPNESS.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.sharpness, true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].ANTI_ALIASING.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setInt16(offset, material.antiAliasing ? 1 : 0, true);\n break;\n }\n }\n }\n }\n return buffer;\n }\n makeIndexBufferData() {\n const buffer = new Uint16Array(this.indices);\n buffer.numItems = this.indices.length;\n return buffer;\n }\n makeIndexBufferDataForMaterials(...materialIndices) {\n const indices = new Array().concat(...materialIndices.map(mtlIdx => this.indicesPerMaterial[mtlIdx]));\n const buffer = new Uint16Array(indices);\n buffer.numItems = indices.length;\n return buffer;\n }\n addMaterialLibrary(mtl) {\n for (const name in mtl.materials) {\n if (!(name in this.materialIndices)) {\n // This material is not referenced by the mesh\n continue;\n }\n const material = mtl.materials[name];\n // Find the material index for this material\n const materialIndex = this.materialIndices[material.name];\n // Put the material into the materialsByIndex object at the right\n // spot as determined when the obj file was parsed\n this.materialsByIndex[materialIndex] = material;\n }\n }\n}\nfunction* triangulate(elements) {\n if (elements.length <= 3) {\n yield elements;\n }\n else if (elements.length === 4) {\n yield [elements[0], elements[1], elements[2]];\n yield [elements[2], elements[3], elements[0]];\n }\n else {\n for (let i = 1; i < elements.length - 1; i++) {\n yield [elements[0], elements[i], elements[i + 1]];\n }\n }\n}\n\n\n//# sourceURL=webpack:///./src/mesh.ts?')},"./src/utils.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downloadModels", function() { return downloadModels; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downloadMeshes", function() { return downloadMeshes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initMeshBuffers", function() { return initMeshBuffers; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deleteMeshBuffers", function() { return deleteMeshBuffers; });\n/* harmony import */ var _mesh__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mesh */ "./src/mesh.ts");\n/* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "./src/material.ts");\n\n\nfunction downloadMtlTextures(mtl, root) {\n const mapAttributes = [\n "mapDiffuse",\n "mapAmbient",\n "mapSpecular",\n "mapDissolve",\n "mapBump",\n "mapDisplacement",\n "mapDecal",\n "mapEmissive",\n ];\n if (!root.endsWith("/")) {\n root += "/";\n }\n const textures = [];\n for (const materialName in mtl.materials) {\n if (!mtl.materials.hasOwnProperty(materialName)) {\n continue;\n }\n const material = mtl.materials[materialName];\n for (const attr of mapAttributes) {\n const mapData = material[attr];\n if (!mapData || !mapData.filename) {\n continue;\n }\n const url = root + mapData.filename;\n textures.push(fetch(url)\n .then(response => {\n if (!response.ok) {\n throw new Error();\n }\n return response.blob();\n })\n .then(function (data) {\n const image = new Image();\n image.src = URL.createObjectURL(data);\n mapData.texture = image;\n return new Promise(resolve => (image.onload = resolve));\n })\n .catch(() => {\n console.error(`Unable to download texture: ${url}`);\n }));\n }\n }\n return Promise.all(textures);\n}\nfunction getMtl(modelOptions) {\n if (!(typeof modelOptions.mtl === "string")) {\n return modelOptions.obj.replace(/\\.obj$/, ".mtl");\n }\n return modelOptions.mtl;\n}\n/**\n * Accepts a list of model request objects and returns a Promise that\n * resolves when all models have been downloaded and parsed.\n *\n * The list of model objects follow this interface:\n * {\n * obj: \'path/to/model.obj\',\n * mtl: true | \'path/to/model.mtl\',\n * downloadMtlTextures: true | false\n * mtlTextureRoot: \'/models/suzanne/maps\'\n * name: \'suzanne\'\n * }\n *\n * The `obj` attribute is required and should be the path to the\n * model\'s .obj file relative to the current repo (absolute URLs are\n * suggested).\n *\n * The `mtl` attribute is optional and can either be a boolean or\n * a path to the model\'s .mtl file relative to the current URL. If\n * the value is `true`, then the path and basename given for the `obj`\n * attribute is used replacing the .obj suffix for .mtl\n * E.g.: {obj: \'models/foo.obj\', mtl: true} would search for \'models/foo.mtl\'\n *\n * The `name` attribute is optional and is a human friendly name to be\n * included with the parsed OBJ and MTL files. If not given, the base .obj\n * filename will be used.\n *\n * The `downloadMtlTextures` attribute is a flag for automatically downloading\n * any images found in the MTL file and attaching them to each Material\n * created from that file. For example, if material.mapDiffuse is set (there\n * was data in the MTL file), then material.mapDiffuse.texture will contain\n * the downloaded image. This option defaults to `true`. By default, the MTL\'s\n * URL will be used to determine the location of the images.\n *\n * The `mtlTextureRoot` attribute is optional and should point to the location\n * on the server that this MTL\'s texture files are located. The default is to\n * use the MTL file\'s location.\n *\n * @returns {Promise} the result of downloading the given list of models. The\n * promise will resolve with an object whose keys are the names of the models\n * and the value is its Mesh object. Each Mesh object will automatically\n * have its addMaterialLibrary() method called to set the given MTL data (if given).\n */\nfunction downloadModels(models) {\n const finished = [];\n for (const model of models) {\n if (!model.obj) {\n throw new Error(\'"obj" attribute of model object not set. The .obj file is required to be set \' +\n "in order to use downloadModels()");\n }\n const options = {\n indicesPerMaterial: !!model.indicesPerMaterial,\n calcTangentsAndBitangents: !!model.calcTangentsAndBitangents,\n };\n // if the name is not provided, dervive it from the given OBJ\n let name = model.name;\n if (!name) {\n const parts = model.obj.split("/");\n name = parts[parts.length - 1].replace(".obj", "");\n }\n const namePromise = Promise.resolve(name);\n const meshPromise = fetch(model.obj)\n .then(response => response.text())\n .then(data => {\n return new _mesh__WEBPACK_IMPORTED_MODULE_0__["default"](data, options);\n });\n let mtlPromise;\n // Download MaterialLibrary file?\n if (model.mtl) {\n const mtl = getMtl(model);\n mtlPromise = fetch(mtl)\n .then(response => response.text())\n .then((data) => {\n const material = new _material__WEBPACK_IMPORTED_MODULE_1__["MaterialLibrary"](data);\n if (model.downloadMtlTextures !== false) {\n let root = model.mtlTextureRoot;\n if (!root) {\n // get the directory of the MTL file as default\n root = mtl.substr(0, mtl.lastIndexOf("/"));\n }\n // downloadMtlTextures returns a Promise that\n // is resolved once all of the images it\n // contains are downloaded. These are then\n // attached to the map data objects\n return Promise.all([Promise.resolve(material), downloadMtlTextures(material, root)]);\n }\n return Promise.all([Promise.resolve(material), undefined]);\n })\n .then((value) => {\n return value[0];\n });\n }\n const parsed = [namePromise, meshPromise, mtlPromise];\n finished.push(Promise.all(parsed));\n }\n return Promise.all(finished).then(ms => {\n // the "finished" promise is a list of name, Mesh instance,\n // and MaterialLibary instance. This unpacks and returns an\n // object mapping name to Mesh (Mesh points to MTL).\n const models = {};\n for (const model of ms) {\n const [name, mesh, mtl] = model;\n mesh.name = name;\n if (mtl) {\n mesh.addMaterialLibrary(mtl);\n }\n models[name] = mesh;\n }\n return models;\n });\n}\n/**\n * Takes in an object of `mesh_name`, `\'/url/to/OBJ/file\'` pairs and a callback\n * function. Each OBJ file will be ajaxed in and automatically converted to\n * an OBJ.Mesh. When all files have successfully downloaded the callback\n * function provided will be called and passed in an object containing\n * the newly created meshes.\n *\n * **Note:** In order to use this function as a way to download meshes, a\n * webserver of some sort must be used.\n *\n * @param {Object} nameAndAttrs an object where the key is the name of the mesh and the value is the url to that mesh\'s OBJ file\n *\n * @param {Function} completionCallback should contain a function that will take one parameter: an object array where the keys will be the unique object name and the value will be a Mesh object\n *\n * @param {Object} meshes In case other meshes are loaded separately or if a previously declared variable is desired to be used, pass in a (possibly empty) json object of the pattern: { \'\': OBJ.Mesh }\n *\n */\nfunction downloadMeshes(nameAndURLs, completionCallback, meshes) {\n if (meshes === undefined) {\n meshes = {};\n }\n const completed = [];\n for (const mesh_name in nameAndURLs) {\n if (!nameAndURLs.hasOwnProperty(mesh_name)) {\n continue;\n }\n const url = nameAndURLs[mesh_name];\n completed.push(fetch(url)\n .then(response => response.text())\n .then(data => {\n return [mesh_name, new _mesh__WEBPACK_IMPORTED_MODULE_0__["default"](data)];\n }));\n }\n Promise.all(completed).then(ms => {\n for (const [name, mesh] of ms) {\n meshes[name] = mesh;\n }\n return completionCallback(meshes);\n });\n}\nfunction _buildBuffer(gl, type, data, itemSize) {\n const buffer = gl.createBuffer();\n const arrayView = type === gl.ARRAY_BUFFER ? Float32Array : Uint16Array;\n gl.bindBuffer(type, buffer);\n gl.bufferData(type, new arrayView(data), gl.STATIC_DRAW);\n buffer.itemSize = itemSize;\n buffer.numItems = data.length / itemSize;\n return buffer;\n}\n/**\n * Takes in the WebGL context and a Mesh, then creates and appends the buffers\n * to the mesh object as attributes.\n *\n * @param {WebGLRenderingContext} gl the `canvas.getContext(\'webgl\')` context instance\n * @param {Mesh} mesh a single `OBJ.Mesh` instance\n *\n * The newly created mesh attributes are:\n *\n * Attrbute | Description\n * :--- | ---\n * **normalBuffer** |contains the model's Vertex Normals\n * normalBuffer.itemSize |set to 3 items\n * normalBuffer.numItems |the total number of vertex normals\n * |\n * **textureBuffer** |contains the model's Texture Coordinates\n * textureBuffer.itemSize |set to 2 items\n * textureBuffer.numItems |the number of texture coordinates\n * |\n * **vertexBuffer** |contains the model's Vertex Position Coordinates (does not include w)\n * vertexBuffer.itemSize |set to 3 items\n * vertexBuffer.numItems |the total number of vertices\n * |\n * **indexBuffer** |contains the indices of the faces\n * indexBuffer.itemSize |is set to 1\n * indexBuffer.numItems |the total number of indices\n *\n * A simple example (a lot of steps are missing, so don\'t copy and paste):\n *\n * const gl = canvas.getContext(\'webgl\'),\n * mesh = OBJ.Mesh(obj_file_data);\n * // compile the shaders and create a shader program\n * const shaderProgram = gl.createProgram();\n * // compilation stuff here\n * ...\n * // make sure you have vertex, vertex normal, and texture coordinate\n * // attributes located in your shaders and attach them to the shader program\n * shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");\n * gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n *\n * shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, "aVertexNormal");\n * gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\n *\n * shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");\n * gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n *\n * // create and initialize the vertex, vertex normal, and texture coordinate buffers\n * // and save on to the mesh object\n * OBJ.initMeshBuffers(gl, mesh);\n *\n * // now to render the mesh\n * gl.bindBuffer(gl.ARRAY_BUFFER, mesh.vertexBuffer);\n * gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, mesh.vertexBuffer.itemSize, gl.FLOAT, false, 0, 0);\n * // it\'s possible that the mesh doesn\'t contain\n * // any texture coordinates (e.g. suzanne.obj in the development branch).\n * // in this case, the texture vertexAttribArray will need to be disabled\n * // before the call to drawElements\n * if(!mesh.textures.length){\n * gl.disableVertexAttribArray(shaderProgram.textureCoordAttribute);\n * }\n * else{\n * // if the texture vertexAttribArray has been previously\n * // disabled, then it needs to be re-enabled\n * gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n * gl.bindBuffer(gl.ARRAY_BUFFER, mesh.textureBuffer);\n * gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, mesh.textureBuffer.itemSize, gl.FLOAT, false, 0, 0);\n * }\n *\n * gl.bindBuffer(gl.ARRAY_BUFFER, mesh.normalBuffer);\n * gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, mesh.normalBuffer.itemSize, gl.FLOAT, false, 0, 0);\n *\n * gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, model.mesh.indexBuffer);\n * gl.drawElements(gl.TRIANGLES, model.mesh.indexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n */\nfunction initMeshBuffers(gl, mesh) {\n mesh.normalBuffer = _buildBuffer(gl, gl.ARRAY_BUFFER, mesh.vertexNormals, 3);\n mesh.textureBuffer = _buildBuffer(gl, gl.ARRAY_BUFFER, mesh.textures, mesh.textureStride);\n mesh.vertexBuffer = _buildBuffer(gl, gl.ARRAY_BUFFER, mesh.vertices, 3);\n mesh.indexBuffer = _buildBuffer(gl, gl.ELEMENT_ARRAY_BUFFER, mesh.indices, 1);\n return mesh;\n}\nfunction deleteMeshBuffers(gl, mesh) {\n gl.deleteBuffer(mesh.normalBuffer);\n gl.deleteBuffer(mesh.textureBuffer);\n gl.deleteBuffer(mesh.vertexBuffer);\n gl.deleteBuffer(mesh.indexBuffer);\n}\n\n\n//# sourceURL=webpack:///./src/utils.ts?')},0:function(module,exports,__webpack_require__){eval('module.exports = __webpack_require__(/*! /home/aaron/google_drive/projects/webgl-obj-loader/src/index.ts */"./src/index.ts");\n\n\n//# sourceURL=webpack:///multi_./src/index.ts?')}})},module.exports=t()},89:(t,e,i)=>{"use strict";Object.defineProperty(e,"i",{value:!0});var s=i(568),n=i(613),r=i(570),o=function(t){if(t&&t.i)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),a=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(r);class h{constructor(){this.o=!0}u(){return this.o}}class l extends h{constructor(t,e){super(),this.S=t,this.o=e}M(t){return t!==this.S&&(this.S=t,this.o=!0),this}_(){return this.S}u(){return super.u()}}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]},m=(t,e)=>({min:t,max:e}),p=(t,e,i,s)=>({x:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(s)}),y=(t,e=!0)=>new l(t,e),A=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),x=A,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}),b=s.Record({type:"color",r:1,g:1,b:1,a:1});class v extends b{constructor(t){super(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.C||(this.C=new v({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.C}getLighter(){return this.T||(this.T=new v({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.T}getDarker(){return this.F||(this.F=new v({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.F}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),T=(t,e,i,s=255)=>new v({r:t/255,g:e/255,b:i/255,a:s/255}),w=t=>{const e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new v({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 v({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 v({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 v({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}`)}},E=(t,e=1,i=1)=>{let s,n,r;t/=360;const o=Math.floor(6*t),a=6*t-o,h=i*(1-e),l=i*(1-a*e),u=i*(1-(1-a)*e);switch(o%6){case 0:s=i,n=u,r=h;break;case 1:s=l,n=i,r=h;break;case 2:s=h,n=i,r=u;break;case 3:s=h,n=l,r=i;break;case 4:s=u,n=h,r=i;break;default:s=i,n=h,r=l}return new v({r:s,g:n,b:r})},k={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"},C=new v({}),D=T(0,0,0,0),I=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,_=(t,e)=>t.value-e.value,F=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:T(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1}),L=t=>{const{steps:e}=t,i=e.length;e.sort(_);const[s,n]=i>0?[e[0].value,e[i-1].value]:[0,0],r=i>0?i-1:0,o=Array(r);for(let t=0;t0&&s!==n}};class z extends F{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,L(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(L({...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,n=[...Array(i)].map((()=>Array(s)));for(let t=0;t=h&&t<=l){if(h===l)return i.color;const e=(t-i.value)/(a.value-i.value);return s=i.color,n=a.color,r=e,new v({r:s.r+(n.r-s.r)*r,g:s.g+(n.g-s.g)*r,b:s.b+(n.b-s.b)*r,a:s.a+(n.a-s.a)*r})}}return t=0;s-=1)if(t>=e[s].value)return e[s].color;return e[0].color}}const P=s.Record({type:"fillstyle",fillType:"empty"});class R extends P{toString(){return"emptyFill"}}const V=new R,B=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),O=s.Record({type:"fillstyle",fillType:"solid",color:T(255,255,255)});class N extends O{}class U extends N{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 G=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType),W=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),Y=s.Record({type:"fillstyle",fillType:"palette",lut:new z({steps:[]}),lookUpProperty:"value"}),H=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),X={linear:(t,e,i)=>{const s=e-t;return n=>ns=>ss=>ss=>s{const e=Qt(t);return(i,s,n)=>{const r=e(i),o=e(s);return e=>e(this.delta===this.duration||this.P)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.L=r,this.eases=t.map((([t,e])=>s(t,e,i)))}R(){this.D.emit("start")}start(){return this.L.includes(this)||this.L.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 n=new j(t,e,i,s,this.L);return this.nextAnimations.push(n),n}onAnimationStart(t,e){return this.D.on("start",t,e)}onAnimationEnd(t,e){return this.D.on("end",t,e)}onEveryAnimationEnd(t,e){return this.D.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.D.on("allEnd",t,e)}allOffAnimationEnd(){return this.D.topicOff("end"),this}allOffEveryAnimationEnd(){return this.D.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.D.topicOff("allEnd"),this}offAnimationEnd(t){return this.D.off(t,"end")}offEveryAnimationEnd(t){return this.D.off(t,"everyEnd")}offAllAnimationEnd(t){return this.D.off(t,"allEnd")}finish(t=!0){if(this.P=!0,this.L.splice(this.L.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.D.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.D.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.D.emit("end",e),this.D.emit("everyEnd",e)),e}t&&(this.D.emit("end",void 0),this.D.emit("everyEnd",void 0),this.D.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(Mt):this.values.map(Mt)}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,n,r=0;const o=()=>{s=void 0;const a=Date.now();n=n||a,r=a-n,r/1e3>=1/e&&(n=Date.now()-r%(1e3/e),i.forEach((t=>{0===t.delta&&t.R(),t.delta+=r-r%(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=St.requestAnimationFrame(o):(s=void 0,n=void 0)};return(t=1e3,e=X.linear)=>(n,r,a=t)=>{const h=new j(n,r,a,e,i).start();return s||(s=St.requestAnimationFrame(o)),h}};var q,J;e.GradientShape=void 0,(q=e.GradientShape||(e.GradientShape={})).circle="circle",q.ellipse="ellipse",e.GradientExtent=void 0,(J=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",J.closestCorner="closest-corner",J.farthestSide="farthest-side",J.farthestCorner="farthest-corner";const K=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class Z extends K{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 Q=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),tt=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],angle:0});class et extends tt{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?fi(t):t)}getAngle(t){return t?di(this.get("angle")):this.get("angle")}}const it=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),st=s.Record({type:"linestyle",lineType:"empty"}),nt=new class extends st{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}V(){return 0}setFillStyle(t){return this}getFillStyle(){return V}},rt=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class ot{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.D=new n.Eventer;const r={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Ne,0),this.cellIndex.x=t.reduce(((t,e,i)=>i>=r.x?t:t+e),0),this.cellSpan.x=t.reduce(((t,e,i)=>i>=r.x&&i{this.cellsAmount.y=t.reduce(Ne,0),this.cellIndex.y=t.reduce(((t,e,i)=>i>=r.y?t:t+e),0),this.cellSpan.y=t.reduce(((t,e,i)=>i>=r.y&&i{s.x.G(e),s.y.G(n)}}}W(){return this.N&&(this.N(),this.N=void 0),this}U(t){return this.D.on("cell-resize",t)}Y(t){return this.D.off(t,"cell-resize")}}class at extends h{constructor(){super(...arguments),this.H=0,this.$=10,this.X=1}j(){return this.o=!1,this}Z(){return this.o=!0,this}getInnerStart(){return this.H}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}J(t,e){return this.H=t,this.$=e,this.K(),this}q(t){return this.X=t,this.K(),this}tt(t){return t/this.X}K(){const t=this.tt(this.$-this.H),e=this.X;void 0!==this.it&&!1!==Et(t,this.it)||(this.o=!0,this.st=e,this.it=t)}et(){return this.it}ht(){return this.st}rt(){return this.$new t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).ot({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new ot({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},lt=(t,e,i)=>e===i?t:i.ut(e.ct(t)),ut=(t,e,i)=>{if(e===i)return t;const s=e instanceof Fi?e.x:e.x instanceof Fi?e.x.x:e.x.dt,n=e instanceof Fi?e.y:e.y instanceof Fi?e.y.y:e.y.dt,r=i instanceof Fi?i.x:i.x instanceof Fi?i.x.x:i.x.dt,o=i instanceof Fi?i.y:i.y instanceof Fi?i.y.y:i.y.dt;return{...t,x:lt(t.x,s,r),y:lt(t.y,n,o)}},ct=(t,e,i)=>{if("axes"===e.id&&"world"===i.id)return e.chart.At.ft(t);if("world"===e.id&&"axes"===i.id)return e.chart.At.yt(t);if(e.id===i.id)return t;throw new Error("LC JS translatePoint3D misusage | originCoordinateSystem and targetCoordinateSystem arguments must be either Chart3D.coordsWorld or Chart3D.coordsAxis")},dt=(...t)=>{if(0===t.length)return{remove:wt};let e=!1;const i=t.map((i=>i.onIntervalChange(((s,n,r)=>((i,s,n)=>{e||(e=!0,t.filter((t=>t!==i)).forEach((t=>t.St(s,n,!1,!1,"synchronizedAxis"))),e=!1)})(i,n,r)))));let s=!1;const n=t.map((e=>e.onStoppedStateChanged(((i,n)=>((e,i)=>{s||(s=!0,t.filter((t=>t!==e)).forEach((t=>t.setStopped(i))),s=!1)})(e,n)))));return{remove:()=>{t.forEach(((t,e)=>{t.offIntervalChange(i[e]),t.offStoppedStateChanged(n[e])}))}}};class ft extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,ft.prototype)}}class gt extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&St.alert(s),Object.setPrototypeOf(this,gt.prototype)}}class mt extends gt{constructor(t){super(t),Object.setPrototypeOf(this,mt.prototype)}}var pt,yt,At,xt;e.UISpace=void 0,(pt=e.UISpace||(e.UISpace={}))[pt.Content=0]="Content",pt[pt.PaddedContent=1]="PaddedContent",pt[pt.PaddedBackground=2]="PaddedBackground",pt[pt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(yt=e.UIVisibilityModes||(e.UIVisibilityModes={}))[yt.never=0]="never",yt[yt.always=1]="always",yt[yt.whenHovered=2]="whenHovered",yt[yt.whenDragged=3]="whenDragged",yt[yt.whenNotDragged=4]="whenNotDragged",yt[yt.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(At=e.UIDraggingModes||(e.UIDraggingModes={}))[At.notDraggable=0]="notDraggable",At[At.draggable=1]="draggable",At[At.onlyHorizontal=2]="onlyHorizontal",At[At.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(xt=e.UIDirections||(e.UIDirections={}))[xt.Up=0]="Up",xt[xt.Right=1]="Right",xt[xt.Down=2]="Down",xt[xt.Left=3]="Left";const St="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},bt=(t,e)=>t.x===e.x&&t.y===e.y,vt=t=>t!==_e&&t!==Fe&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Mt=t=>t[1],Tt=t=>t.dispose(),wt=()=>{},Et=(t,e)=>t===e,kt=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Ct=t=>Array.prototype.concat.apply([],t),Dt=(t,e)=>void 0!==t?t:e,It=t=>t.vt(),_t=t=>t.xt(),Ft=t=>t.bt(),Lt=t=>t.Mt(),zt=t=>t.min.x,Pt=t=>t.max.x,Rt=t=>t.min.y,Vt=t=>t.max.y,Bt=(t,e,i,s,n)=>{if(t.length>0){let r=n?s(n):void 0;for(let s=0;st.position===e.position&&t.high===e.high&&t.low===e.low,Nt=u(0,1),Ut=u(1,0),Gt=u(0,-1),Wt=u(-1,0),Yt=u(0,0),Ht=t=>{switch(t){case e.UIDirections.Up:return Nt;case e.UIDirections.Right:return Ut;case e.UIDirections.Down:return Gt;case e.UIDirections.Left:return Wt;default:return Yt}},Xt=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,jt=t=>{t.stopPropagation(),t.preventDefault()},$t=(t,e)=>{if(!e)return t;const i=t.length,s=new Float32Array(2*i);let n=0;for(let e=0;e{if(!e){const e=t.length,i=new Float32Array(2*e);let s=0;for(let n=0;n{const e=t.length,i=new Float32Array(3*e);let s=0;for(let n=0;ne=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)},Zt=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},te=Qt(Math.E),ee=(t,e)=>{const i=e[t];return i?i():void 0},ie=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;igi(ri(t,i))-gi(ri(e,i))))},se=(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:T(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())),re=t=>255===t.getA()?t:t.setA(255),oe=(()=>{const t=T(0,0,0);return i=>(i=re(i),new Z({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:ne(i,t,.5)}]}))})(),ae=(()=>{const t=t=>{var e;if(t){if(G(t)){if(0===t.getColor().getA())return;return t.getColor()}if(Q(t)||it(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,n)=>{const r=[];if(n.fill&&r.push(n.fill),n.fill2&&r.push(n.fill2),n.stroke){const t=n.stroke.getFillStyle();t!==V&&r.push(t)}if(n.point3D){const t=n.point3D;r.push(t.getFillStyle())}let o;if(n.behavior&&!0===n.behavior.colorStep){const[e,s]=r.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]);o=e&&s?(a=e)===(h=s)||a.getR()===h.getR()&&a.getG()===h.getG()&&a.getB()===h.getB()?oe(a):(a=re(a),h=re(h),new et({angle:0,stops:[{offset:0,color:h},{offset:.5,color:h},{offset:.5,color:a},{offset:1,color:a}]})):i.uiButtonFillStyle}else{const e=r.reduce(((e,i)=>e||t(i)),void 0);o=e?s?new U({color:e}):oe(e):i.uiButtonFillStyle}var a,h;e.setButtonOnFillStyle(o)}})(),he=t=>{const e=t;if(H(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},le=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},ue=(t,e)=>{let i="string"==typeof t?t:String(t);const s=i.indexOf(".");let n=s>=0?s:i.length;for(;n"function"==typeof t?t(e):t,de=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),fe=(t,e)=>e(),ge=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new U({color:T(255,255,255,1)});const me=t=>t===Le||t.min.x===Le.min.x&&t.max.x===Le.max.x&&t.min.y===Le.min.y&&t.max.y===Le.max.y,pe=t=>Array.from(new Set(t)),ye=t=>t.filter((t=>void 0!==t)),Ae=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,xe=(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))))))},Se=(t,e)=>{throw new Error(e)},be=()=>{const t=$((()=>{}));let e;return(i,s,n,r)=>{const o=null==r?void 0:r.onStart,a=null==r?void 0:r.onCompleted,h=(null==r?void 0:r.easing)||X.ease,l=(null==r?void 0:r.durationMs)||1e3;let u;if(e)if(0===e.nextAnimations.length){const t=e.NextAnimation([[i,s]],(([i])=>{e=t,n(i)}),l,h);u=t}else{i=e.nextAnimations.pop().values[0][0];const t=e.NextAnimation([[i,s]],(([i])=>{e=t,n(i)}),l,h);u=t}else u=t(l,h)([[i,s]],(([t])=>{n(t)})),e=u;u.onAnimationEnd((()=>{e=void 0})),o&&u.onAnimationStart(o),a&&u.onAnimationEnd(a)}},ve=t=>{let e;return()=>e||(e=t(),e)},Me=t=>{if(t===nt)return 0;const e=t.getThickness();return e<0?1:1*e},Te=(t,e,i,s)=>{const n=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please find the FAQ from API documentation at below link:\nhttps://lightningchart.com/js-charts/api-documentation/\nand read section "What is LightningChart JS Resources not found error?"`;if(s.shouldCrash)throw St.alert(n),new Error(n);St.console.warn(n)},we=(t,e,i,s=0)=>{if(t{const t=new Map;return{_t:e=>(e.setMouseEnterEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.wt(e,i,s)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Ct(e,i,s)})),e.setMouseClickEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.kt(e,i,s)})),e.setMouseDoubleClickEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Tt(e,i,s)})),e.setMouseDownEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Ft(e,i,s)})),e.setMouseUpEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.It(e,i,s)})),e.setMouseMoveEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Pt(e,i,s)})),e.setMouseDragEventHandler(((e,i,s,n,r,o)=>{const a=o&&t.get(o);a&&a.Dt(e,i,s,n,r,o)})),e.setMouseDragStartEventHandler(((e,i,s,n)=>{const r=n&&t.get(n);r&&r.Bt(e,i,s,n)})),e.setMouseDragStopEventHandler(((e,i,s,n,r)=>{const o=r&&t.get(r);o&&o.Lt(e,i,s,n,r)})),e.setMouseWheelEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Rt(e,i,s)})),e.setTouchStartEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Et(e,i,s)})),e.setTouchMoveEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Vt(e,i,s)})),e.setTouchEndEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.zt(e,i,s)})),e),Ot:(e,i)=>{t.set(e,i)},Nt:()=>{t.clear()}}},ke={left:0,right:0,top:0,bottom:0},Ce=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),De=(t,e,i)=>{e&&e.Gt();const s=i();return{Wt:t,Gt:()=>{s.forEach((e=>t.Ut(e)))}}},Ie={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=>Ie.divide(t,Ie.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(Ie.dot(t,e)/(Ie.length(t)*Ie.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),n=Math.sin(i),r=Ie.dot(e,t),o=Ie.cross(e,t);return Ie.addVec(Ie.multiply(t,s),Ie.addVec(Ie.multiply(e,(1-s)*r),Ie.multiply(o,n)))},lerp:(t,e,i)=>(i=kt(i,0,1),Ie.addVec(Ie.multiply(t,1-i),Ie.multiply(e,i))),equals:(t,e)=>Et(t.x,e.x)&&Et(t.y,e.y)&&Et(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)})},_e=Number.MAX_SAFE_INTEGER,Fe=-Number.MAX_SAFE_INTEGER,Le=m(u(_e,_e),u(Fe,Fe)),ze=m(f(_e,_e,_e),f(Fe,Fe,Fe)),Pe=(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))},Re=(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),Be=(t,e)=>m(u(Math.max(Math.min(t[0].x,t[2].x),Math.min(e[0].x,e[2].x)),Math.max(Math.min(t[0].y,t[2].y),Math.min(e[0].y,e[2].y))),u(Math.min(Math.max(t[0].x,t[2].x),Math.max(e[0].x,e[2].x)),Math.min(Math.max(t[0].y,t[2].y),Math.max(e[0].y,e[2].y)))),Oe=t=>{const e=t.length;for(let i=0;ie+t,Ue=(t,e,i)=>{const s=ri(e,t),n=s.x*s.x+s.y*s.y;if(0===n)return t;const r=ri(i,t),o=(r.x*s.x+r.y*s.y)/n;return o<=0?t:o>=1?e:u(t.x+o*s.x,t.y+o*s.y)},Ge=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,We=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},Ye=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},He=(t,e,i)=>ni(t,si(ri(e,t),i)),Xe=(t,e,i)=>Ie.addVec(t,Ie.multiply(Ie.subtractVec(e,t),i));function je(t){const e=t.length;if(e>0){let i=t[0].x,s=t[0].x,n=t[0].y,r=t[0].y;for(let o=0;oi&&(i=e.x),e.xn&&(n=e.y),e.y0){let i=t[0].x,s=t[0].x,n=t[0].y,r=t[0].y,o=t[0].z,a=t[0].z;for(let h=0;hi&&(i=e.x),e.xn&&(n=e.y),e.yo&&(o=e.z),e.z{const e={min:{x:_e,y:_e},max:{x:Fe,y:Fe}};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},Je=(t,e)=>m(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 Ke(t,e,i,s){const n=t.x-s.x,r=t.y-s.y,o=s.x-i.x,a=i.y-s.y,h=a*n+o*r,l=(s.y-e.y)*n+(e.x-s.x)*r,u=a*(e.x-s.x)+o*(e.y-s.y);return u<0?h<=0&&l<=0&&h+l>=u:h>=0&&l>=0&&h+l<=u}function Ze(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 Qe(t,e){return u(t.x-e.x,t.y-e.y)}function ti(t){const e=ii(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function ei(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=ti(i);const s=Math.PI/2,n=i.x;return i.x=-Math.sin(s)*i.y,i.y=n*Math.sin(s),i}function ii(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function si(t,e){return u(t.x*e,t.y*e)}function ni(t,e){return u(t.x+e.x,t.y+e.y)}function ri(t,e){return u(t.x-e.x,t.y-e.y)}function oi(t,e){return u(t.x*e.x,t.y*e.y)}function ai(t,e){return u(t.x/e.x,t.y/e.y)}function hi(t){return si(t,-1)}function li(t,e){return t.x*e.x+t.y*e.y}const ui=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),n=e.y+(t-e.x)*s;return u(t,n)},ci=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),n=e.x+(t-e.y)/s;return u(n,t)};function di(t){return t*Math.PI/180}function fi(t){return 180*t/Math.PI}function gi(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function mi(t){return u(Math.cos(t),Math.sin(t))}function pi(t){let e=-1;const i=Math.cos(t),s=Math.sin(t);return i>0&&i<1&&s>0&&s<1?e=1:i<0&&i>-1&&s>0&&s<1?e=2:i<0&&i>-1&&s<0&&s>-1?e=3:i>0&&i<1&&s<0&&s>-1&&(e=4),e}const yi=(t,e,i,s)=>{let n,r,o,a;if(e.x-t.x!=0||s.x-i.x!=0)return e.x-t.x==0?(o=e.x,r=(s.y-i.y)/(s.x-i.x),a=r*(o-i.x)+i.y):s.x-i.x==0?(o=s.x,n=(e.y-t.y)/(e.x-t.x),a=n*(o-t.x)+t.y):(n=(e.y-t.y)/(e.x-t.x),r=(s.y-i.y)/(s.x-i.x),o=(i.y-r*i.x+n*t.x-t.y)/(n-r),a=n*(o-t.x)+t.y),u(o,a)},Ai=(t,e)=>{const i=t.length,s=e.length,n=new Uint16Array(i+s);return n.set(t,0),n.set(e,i),n};class xi{constructor(){this.Yt=!0}getInnerStart(){return this.H}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.$-this.H)}J(t,e){return this.Yt=t!==this.H||e!==this.$,this.H=t,this.$=e,this}j(){return this.Yt=!1,this}Z(){return this.Yt=!0,this}}class Si extends xi{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.O(this.ti.bind(this));this.ti(s._()),this.ii=()=>s.G(t)}}q(t){return this.X=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.X+this.Xt[0]}hi(){return(this.Zt+this.Qt)/this.Jt*this.X-this.Xt[1]}ri(){return this.getCellSize()-this.ni()}oi(){return this.X}getCellSize(){return this.ai(this.X)}ni(){return this.Xt[0]+this.Xt[1]}li(){return this.Xt}ti(t){this.Jt=t.reduce(Ne,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&&iwi;return!r&&!o||!!n&&(e>t?{start:r?Ti:t,end:o?wi:e}:{start:o?wi:t,end:r?Ti:e})}ct(t){const e=this.ei(),i=this.hi(),s=Math.max(t,Ti);return e+(this.ci.function(s)-this.di.scaleStartLog)/this.di.scaleIntervalLog*(i-e)}ut(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()}J(t,e){return super.J(t,e),this.ci&&this.fi(),this}si(t){return super.si(t),this.ci&&this.fi(),this}q(t){return super.q(t),this.ci&&this.fi(),this}Ai(t){return this.ci={internal:t,function:vi(t),number:Mi(t)},this}gi(){return this.ci.internal}pi(t,e){const i=this.ct(t)+e;return this.ut(i)}mi(){return this.$t||this.Yt||this.jt||this.Ht}fi(){const t=this.ci.function(this.H),e=this.ci.function(this.$)-t,i=2*this.ei()/this.X-1,s=2*this.hi()/this.X-1-i;return this.di={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.di}yi(){return this.di}}const vi=t=>"e"===t?te:Qt(t),Mi=t=>"e"===t?Math.E:t,Ti=.9*10**-4,wi=1.1*10**25,Ei=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],ki=(t,e,i)=>{const s=Math.abs(i-e),n=Math.max(2-Pe(s,10),0);return t.toFixed(n)},Ci={Numeric:(t,e)=>ki(t,e.getInnerStart(),e.getInnerEnd()),NumericUnits:(t,e)=>{const i=Math.abs(e.getInnerEnd()-e.getInnerStart()),s=t<0;t=Math.abs(t);let n="",r="";if(i>=1e3&&t>1e3){let e="";for(const i of Ei){const s=Math.round(1e3*t/i.unit)/1e3;if(s>=1){e=s.toString(),r=i.prefix;break}}n=(s?"-":"")+e}else{let e=String(Math.floor(t));const r=Pe(t,1e3);for(let t=1;t<=r;t+=1){const i=e.length-(3*t+(t-1));e=`${e.substring(0,i)} ${e.substring(i,e.length)}`}n=(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-Pe(i,10)):"")}return n+=r,n},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const n=vi(s)(t);return`${s}${Di(n)}`},LogarithmicExponents:(t,e,i,s=10)=>{const n=vi(s),r=Math.floor(n(t)),o=t/Mi(s)**r;return`${Math.round(o)}×${s}${Di(r)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const n=vi(s),r=Math.floor(n(t));return`${(t/Mi(s)**r).toFixed(2)}×${s}${Di(r)}`},LogarithmicNoExponents:(t,e,i,s=10)=>{const n=vi(s);if("e"===s)return`${Math.floor(n(t))}e`;const r=t.toString();if(t>1)return r;const o=Math.floor(n(t));return t.toFixed(Math.abs(o))}},Di=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 Ii extends Si{constructor(t,e,i,s){super(t,e,i,s),this.Si=!1,this.vi=!1,this.xi=0,this.X=1e3,this.J(0,10),this.K()}mi(){return this.vi}nt(t,e,i,s,n){if(t===e)return!1;const r=Math.abs(s-i),o=Math.abs(e-t);if(!this.Si){const i=((t,e,i)=>{const s=((t,e)=>{if(e<_e&&e>Fe&&t<_e&&t>Fe){const i=Math.abs(t/2**23),s=Math.abs(e/2**23),n=Math.min(i,s);return 10**Math.floor(Math.log10(n))}})(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,a=(n?i/2:r/2)*(t>e?-1:1);return{start:s-a,end:s+a}}const a=10**-(12-Math.log10(Math.max(Math.abs(t),1)));if(o>a)return!0;const h=(e+t)/2,l=(n?a/2:r/2)*(t>e?-1:1);return{start:h-l,end:h+l}}ui(){this.K()}ct(t){return this.ei()+(t-this.H)/(this.$-this.H)*(this.hi()-this.ei())}ut(t){return this.H+(t-this.ei())/(this.hi()-this.ei())*(this.$-this.H)}J(t,e){return super.J(t,e),this.K(),this}si(t){return super.si(t),this.K(),this}q(t){return super.q(t),this.bi=_i(this.$-this.H,this.Xt,this.X,this.Qt,this.Jt),this.K(),this}Mi(){return this.Si=!0,this}_i(){return this.Si}wi(){return Math.abs(this.Ci)}ki(){return this.wi()/this.bi}Ti(){return this.Fi}Ii(){return this.Pi}getPixelSize(){return this.bi}yi(){return this.di}Z(){return super.Z(),this.vi=!0,this}j(){return super.j(),this.vi=!1,this}Di(t,e=Ci.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 _i(t,this.Xt,this.X,this.Qt,this.Jt)}K(){let t=this.H,e=this.$,i=0;this.Si&&(t=0,e=this.$-this.H,i=this.H);const s=e-t,n=_i(s,this.Xt,this.X,this.Qt,this.Jt);this.Pi=t-this.Xt[0]*n,this.Fi=e+this.Xt[1]*n;const r=this.Fi-this.Pi,o=r-this.Ci,a=Math.abs(o/n),h=s-this.xi,l=Math.abs(h/n);(!this.di||a>=.4||l>=.4)&&(this.xi=s,this.Ci=r,this.bi=n,this.vi=!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.X-1,f=2*this.hi()/this.X-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 _i=(t,e,i,s=1,n=1)=>t/(i*s/n-(e[0]+e[1]));class Fi{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}Z(){return this.x.Z(),this.y.Z(),this}q(t,e){return"object"==typeof t?(this.x.q(t.x),this.y.q(t.y)):(this.x.q(t),this.y.q(e)),this}oi(){return u(this.x.oi(),this.y.oi())}Ei(t){return this.x.si(t),this}Vi(t){return this.y.si(t),this}ni(){return u(this.x.ni(),this.y.ni())}zi(t,e){return this.x.J(t,e),this}Oi(t,e){return this.y.J(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.mi()||this.y.mi()}}class Li extends Fi{constructor(){super(...arguments),this.Gi="LinearScaleXY"}ot(t,e,i,s){return this.x=new Ii(t.x,e.x,i.x,s?s.x:void 0),this.y=new Ii(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())}yi(){return{x:this.x.yi(),y:this.y.yi()}}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 n=this.Wi(),r=ei(t,e);return r.x*=s,r.y*=s,{x:t.x+i*n.x*r.x,y:t.y+i*n.y*r.y}}}class zi extends Fi{constructor(){super(...arguments),this.Gi="MixedScaleXY"}_i(){return!1}pi(t,e){const i=this.x.ct(t.x),s=this.y.ct(t.y),n={x:i+e.x,y:s+e.y};return{x:this.x.ut(n.x),y:this.y.ut(n.y)}}Ui(t,e,i,s){const n={x:this.x.ct(t.x),y:this.y.ct(t.y)},r={x:this.x.ct(e.x),y:this.y.ct(e.y)},o=ti(ri(r,n)),a=ei(r,n),h={x:n.x+o.x*s+a.x*i,y:n.y+o.y*s+a.y*i};return{x:this.x.ut(h.x),y:this.y.ut(h.y)}}yi(){const t=this.x.yi(),e=this.y.yi();return{uScaleStart:[this.x.H,this.y.H],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 Pi=(t,e)=>t instanceof bi||e instanceof bi?(new zi).Ri(t,e):(new Li).Ri(t,e),Ri=t=>"client"===t,Vi=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),Bi=t=>"relative"===t,Oi=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y);var Ni;e.HighlightModes=void 0,(Ni=e.HighlightModes||(e.HighlightModes={}))[Ni.noHighlighting=0]="noHighlighting",Ni[Ni.onHover=1]="onHover";class Ui{constructor(t,i,s,r){this.Yi=!0,this.Hi=e.HighlightModes.onHover,this.$i=!1,this.Xi=!0,this.ji=!1,this.D=new n.Eventer,this.Zi=[],this.Qi=[],this.onMouseEnter=t=>this.D.on("mouseEnter",t),this.onMouseLeave=t=>this.D.on("mouseLeave",t),this.onMouseClick=t=>this.D.on("mouseClick",t),this.onMouseDoubleClick=t=>this.D.on("mouseDoubleClick",t),this.onMouseDown=t=>this.D.on("mouseDown",t),this.onMouseUp=t=>this.D.on("mouseUp",t),this.onMouseMove=t=>this.D.on("mouseMove",t),this.offMouseEnter=t=>this.D.off(t,"mouseEnter"),this.offMouseLeave=t=>this.D.off(t,"mouseLeave"),this.offMouseClick=t=>this.D.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.D.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.D.off(t,"mouseDown"),this.offMouseUp=t=>this.D.off(t,"mouseUp"),this.offMouseMove=t=>this.D.off(t,"mouseMove"),this.offMouseDragStart=t=>this.D.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.D.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.D.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.D.off(t,"mouseWheel"),this.wt=(t,i,s)=>{this.D.emit("mouseEnter",this,i),this.ji=!0,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Ct=(t,i,s)=>{this.D.emit("mouseLeave",this,i),this.ji=!1,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Pt=(t,e,i)=>{this.D.emit("mouseMove",this,e)},this.kt=(t,e,i)=>this.D.emit("mouseClick",this,e),this.Tt=(t,e,i)=>this.D.emit("mouseDoubleClick",this,e),this.Ft=(t,e,i)=>this.D.emit("mouseDown",this,e),this.It=(t,e,i)=>this.D.emit("mouseUp",this,e),this.Bt=(t,e,i,s)=>{this.D.emit("mouseDragStart",this,e,i)},this.Dt=(t,e,i,s,n,r)=>{this.D.emit("mouseDrag",this,e,i,s,n)},this.Lt=(t,e,i,s,n)=>{this.D.emit("mouseDragStop",this,e,i,s)},this.Rt=(t,e,i)=>{this.D.emit("mouseWheel",this,e)},this.Et=(t,i,s)=>{this.D.emit("touchStart",this,i),this.ji=!0,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Vt=(t,e,i)=>{this.D.emit("touchMove",this,e)},this.zt=(t,i,s)=>{this.D.emit("touchEnd",this,i),this.ji=!1,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Ji=t,this.Ki=i,this.qi=s,this.ts=new Map,this.ss=r,this.es=this.ss.hs(this,{rs:{themeEffectEnabled:this.qi.effectsText},ns:{}}),this.Ji.us.ls.os(this,(t=>{this.ts.forEach(((e,i)=>i.cs(t))),this.Qi.forEach((e=>e.setHighlight(t))),this.Zi.forEach((e=>e.cs(t)))}),{animationEnabled:this.Ji.getAnimationsEnabled()})}ds(t){const e=t(this.Ji.fs);e&&this.Ji.us.As(e)}gs(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.ts.set(t,{isText:s});const n=Array.from(this.ts);this.es.rs.ps(n.filter((t=>t[1].isText)).map((t=>t[0]))),this.es.ns.ps(n.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Yi).setVisible(this.Xi).cs(this.Ji.us.ls.ys(this,!0)),i&&t.setMouseEnterEventHandler(this.wt).setMouseLeaveEventHandler(this.Ct).setMouseClickEventHandler(this.kt).setMouseDoubleClickEventHandler(this.Tt).setMouseDownEventHandler(this.Ft).setMouseUpEventHandler(this.It).setMouseMoveEventHandler(this.Pt).setMouseDragStartEventHandler(this.Bt).setMouseDragEventHandler(this.Dt).setMouseDragStopEventHandler(this.Lt).setMouseWheelEventHandler(this.Rt).setTouchStartEventHandler(this.Et).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.zt);const r=t.onDispose((()=>{t.offDispose(r),this.ts.delete(t)}))}Ss(t){this.Zi=t;const e=this.Ji.us.ls.ys(this,!0);t.forEach((t=>{t.cs(e).vs(this.Xi)}))}setEffect(t){return this.es.rs.xs(t&&this.qi.effectsText),this.es.ns.xs(t),this.Ji.us.bs(),this}getEffect(){return this.es.rs.Ms()||this.es.ns.Ms()}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}setName(t){return this._s=t,this.Qi.forEach((t=>t.setText(this._s))),this}getName(){return this._s}dispose(){return this.$i||(this.$i=!0,this.ts.forEach(((t,e)=>e.dispose())),this.Ki(this),this.Qi.forEach((t=>{t.dispose()})),this.Qi.length=0,this.D.emit("dispose",this),this.Ji.us.bs()),this}setVisible(t){return t===this.Xi||(this.Xi=t,this.ts.forEach(((e,i)=>i.setVisible(t))),this.Zi.forEach((e=>e.vs(t))),this.Qi.forEach((e=>e.setOn(t))),this.D.emit("visibleStateChanged",this,this.Xi),this.Ji.us.bs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}setHighlight(t){return this.Ji.us.ls.ws(this,t),this.D.emit("highlight",this,t),this}getHighlight(){return this.Ji.us.ls.ys(this)}setAnimationHighlight(t){return this.Ji.us.ls.Cs(this,t),this}getAnimationHighlight(){return this.Ji.us.ls.ks(this)}setMouseInteractions(t){return this.Yi=t,this.ts.forEach(((e,i)=>i.setMouseInteractions(t))),this.Ji.us.bs(),this}getMouseInteractions(){return this.Yi}getIsUnderMouse(){return this.ji}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 xe(t,[this],{toggleVisibilityOnClick:e,label:this._s,style:void 0}),this.Qi.push(t),t.onDispose((()=>{const e=this.Qi.indexOf(t);e>=0&&this.Qi.splice(e,1)})),this}onMouseDragStart(t){return this.D.on("mouseDragStart",t)}onMouseDrag(t){return this.D.on("mouseDrag",t)}onMouseDragStop(t){return this.D.on("mouseDragStop",t)}onMouseWheel(t){return this.D.on("mouseWheel",t)}onTouchStart(t){return this.D.on("touchStart",t)}onTouchMove(t){return this.D.on("touchMove",t)}onTouchEnd(t){return this.D.on("touchEnd",t)}onDispose(t){return this.D.on("dispose",t)}offTouchStart(t){return this.D.off(t,"touchStart")}offTouchMove(t){return this.D.off(t,"touchMove")}offTouchEnd(t){return this.D.off(t,"touchEnd")}offDispose(t){return this.D.off(t,"dispose")}}class Gi extends Ui{constructor(t,e,i,s,n,r,o,a){super(e,i,o,a),this.Ts=t,this.axis=s,this.dt=n,this.Fs=r,this.Is()}}const Wi=t=>{const e=t.length;if(e>0){let i=0,s=0;for(let n=0;n{const e=t.length,i=new Array(e).fill(!1),s=(s,n)=>{for(let r=0;r=this.Rs?(this.Ls.splice(t,1),t-=1):this.Ls[t].state&&(s=!0);return this.Bs?0===e.interactions.length&&(this.Ls.push({state:!1,time:i}),this.Bs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Ls.push({state:!0,time:i}),s=!0,this.Bs=!0),s}Ds(t,e,i){if(i){const i=this.Ls.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Es(t,e),this.Ls.length=0)}}},Xi=class{constructor(t,e,i,s=1,n=100){this.Vs=t,this.zs=e,this.Os=i,this.Ns=s,this.Gs=n}Ps(t,e){const i=e.interactions.length;if(i===this.Ns){if(void 0!==this.Ws)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 n=0;n!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class Ki{constructor(t,e){this.Xs=t,this.js=e,this.Zs=e.rows*ks,this.Qs=e.columns*Cs}}var Zi,Qi;e.OnScreenMenuButtonType=void 0,(Zi=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[Zi.ZoomIn=0]="ZoomIn",Zi[Zi.ZoomInX=1]="ZoomInX",Zi[Zi.ZoomInY=2]="ZoomInY",Zi[Zi.ZoomOut=3]="ZoomOut",Zi[Zi.ZoomOutX=4]="ZoomOutX",Zi[Zi.ZoomOutY=5]="ZoomOutY",Zi[Zi.ZoomToFit=6]="ZoomToFit",Zi[Zi.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(Qi=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[Qi.Circle=0]="Circle",Qi[Qi.Rectangle=1]="Rectangle",Qi[Qi.RoundedRectangle=2]="RoundedRectangle";const ts={x:-43,y:0},es={x:-65,y:0},is={x:-86,y:0},ss={x:-107,y:-1},ns={x:-128,y:-3},rs={x:-150,y:0},os={x:-171,y:0},as={x:-276,y:0},hs={x:-298,y:0},ls={x:0,y:0},us={x:-21,y:0};class cs extends Ki{constructor(t,e,i,s){super(t,i),this.Js=St.document.createElement("button"),this.Ks=St.document.createElement("div"),this.qs=St.document.createElement("label"),this.js=i,this.te=e,this.Ji=s}ie(t,e,i,s){this.se(t,s),this.ee(),this.he(e),this.re(),this.qs.textContent=i||"";const n=St.document.createElement("div");this.ne(n),this.Js.onclick=this.onClick.bind(this),n.appendChild(this.Ks),n.appendChild(this.qs),this.Js.appendChild(n)}re(){this.Js.style.cursor="pointer"}ne(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}he(t){"string"==typeof t?(this.Ks.style.backgroundImage=`url(${t})`,this.Ks.style.backgroundSize="100%",this.Ks.style.backgroundRepeat="no-repeat",this.Ks.style.backgroundPosition="center",this.Ks.style.width="20px",this.Ks.style.height="20px"):this.applyStyleForSprite(t),this.Ks.style.margin="auto"}ee(){switch(this.te){case e.OnScreenMenuButtonShape.RoundedRectangle:this.Js.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.Js.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.Js.style.borderRadius="31px"}}se(t,e){this.Js.style.width=`${this.Qs.toString()}px`,this.Js.style.height=`${this.Zs.toString()}px`,this.Js.style.backgroundColor=t,this.Js.style.opacity=e||Ds,this.Js.style.alignItems="center",this.Js.style.border="2px solid #707070",this.Js.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.Ks.style.backgroundImage=`url(${this.Xs}/${Is})`,this.Ks.style.backgroundPositionX=`${t.x}px`,this.Ks.style.backgroundPositionY=`${t.y}px`,this.Ks.style.backgroundSize="1600%",this.Ks.style.backgroundRepeat="no-repeat",this.Ks.style.width="20px",this.Ks.style.height="20px"}oe(t){return t.appendChild(this.Js),t}ae(){return this.Js}}class ds extends cs{constructor(t,e,i,s){super(t,e,i,s),this.le="",this.ue="",this.ce=!1,this.Ji=s}de(){this.fe(),this.onToggledStateAction()}Ae(){this.ge(),this.onInitialStateAction()}ge(){this.pe(this.le)}fe(){this.pe(this.ue)}pe(t){"string"==typeof t?this.Ks.style.background=t:(this.Ks.style.backgroundImage=`url(${this.Xs}/${Is})`,this.Ks.style.backgroundPositionX=`${t.x}px`,this.Ks.style.backgroundPositionY=`${t.y}px`)}onClick(){this.ce?this.Ae():this.de(),this.ce=!this.ce}}class fs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ts)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:-1,y:-1})}}class gs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ss)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:-1,y:0})}}class ms extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),rs)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:0,y:-1})}}class ps extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),es)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:1,y:1})}}class ys extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ns)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:1,y:0})}}class As extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),os)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:0,y:1})}}class xs extends ds{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.le=as,this.ue=hs,this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),this.le)}onToggledStateAction(){this.Ji.setAnimationsEnabled(!1)}onInitialStateAction(){this.Ji.setAnimationsEnabled(!0)}}class Ss extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),is)}onClick(){this.Ji.forEachAxis((t=>{t.fit(!0)}))}}class bs extends cs{constructor(t,e,i){super(t,e.shape||_s,e.dimensions||{rows:1,columns:1},i);const s=i.getTheme(),n=e.color||s.onScreenMenuBackgroundColor.toRGBAString(),r=e.icon||"",o=e.label||"",a=e.opacity||"";this.ie(n,r,o,a),this.ye=e.action}onClick(){this.ye(this.Ji)}}class vs extends ds{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.Ji=i,this.Se=s,this.le=us,this.ue=ls,this.ie(Fs,this.le)}ge(){this.pe(this.le),this.Js.style.backgroundColor=Fs,this.Js.style.border="2px solid #707070",this.Js.style.margin="0px"}fe(){this.pe(this.ue),this.Js.style.background="#FECC00 0% 0% no-repeat padding-box",this.Js.style.border="10px solid #BCBCBC12",this.Js.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.Se)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.Se)||void 0===t||t.style.setProperty("display","none")}}var Ms;e.MouseStyles=void 0,(Ms=e.MouseStyles||(e.MouseStyles={})).Move="move",Ms.ResizeColumn="col-resize",Ms.ResizeRow="row-resize",Ms.Horizontal="ew-resize",Ms.Vertical="ns-resize",Ms.NorthWest="nw-resize",Ms.NorthEast="ne-resize",Ms.Copy="copy",Ms.CrossHair="crosshair",Ms.Default="default",Ms.Help="help",Ms.Restricted="not-allowed",Ms.None="none",Ms.Point="pointer",Ms.Text="text",Ms.Wait="wait",Ms.ZoomIn="zoom-in",Ms.ZoomOut="zoom-out";const Ts={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)},ws=new U({color:T(255,255,255,0)}),Es=new qi({thickness:1,fillStyle:ws}),ks=60,Cs=60,Ds="1.0",Is="osm/osm-sprite-transparent.png",_s=e.OnScreenMenuButtonShape.Circle,Fs="#363636";var Ls;e.OSMPosition=void 0,(Ls=e.OSMPosition||(e.OSMPosition={}))[Ls.TopRight=0]="TopRight",Ls[Ls.TopLeft=1]="TopLeft",Ls[Ls.BottomLeft=2]="BottomLeft",Ls[Ls.BottomRight=3]="BottomRight";class zs extends Gi{constructor(t,e,i,s,n,r,o,a){super(t,e,i,s,n,r,o,a),this._s="Band",this.ve=0,this.xe=0,this.be=this.qi.bandFillStyle,this.Me=this.qi.bandStrokeStyle,this._e=!0,this.we=this.Ts.Te(this.dt).ke(this.be).Ce(this.Me).cs(this.getHighlight()),this.gs(this.we)}setValueStart(t){return this.ve=t,this.D.emit("valueChange",this,this.ve,this.xe),this.Ts.bs(),this}getValueStart(){return this.ve}setValueEnd(t){return this.xe=t,this.D.emit("valueChange",this,this.ve,this.xe),this.Ts.bs(),this}getValueEnd(){return this.xe}setFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.we.ke(e),this.Ts.bs(),this}getFillStyle(){return this.be}setStrokeStyle(t){this.Me="function"==typeof t?t(this.Me):t;const e=this.Me;return this.we.Ce(e),this.Ts.bs(),this}getStrokeStyle(){return this.Me}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}Fe(){return this.we.Ie(this.Fs.toVec2(this.ve,this.Fs.getHeight(this.dt).getInnerStart())).q(this.Fs.toVec2(this.xe-this.ve,this.Fs.getHeight(this.dt).getInnerInterval())),this}attach(t,e=!0,i=!1){return super.attach(t,e),ae(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}Pe(t,e){t.cs(e),this.Ts.bs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){let t,i;const s=(e,s)=>{if(!this._e)return;const n=ut(this.Ts.us.De(s.x,s.y),this.Ts.us.dt,this.dt),r=this.Fs.getWidth(n),o=this.axis.dt.ct(this.ve),a=this.axis.dt.ct(this.xe),h=(this.axis.dt.ct(r)-o)/(a-o);t=!(h<.1||h>.9),!1===t&&(i=h<.5)},n=(e,s,n,r,o)=>{if(!this._e)return;const a=this.Fs.getWidth(r);t?(this.ve=this.axis.dt.pi(this.ve,a),this.xe=this.axis.dt.pi(this.xe,a)):i?this.ve=this.axis.dt.pi(this.ve,a):this.xe=this.axis.dt.pi(this.xe,a),jt(o),this.D.emit("valueChange",this,this.ve,this.xe),this.Ts.bs()};this.onMouseMove(((i,n)=>{if(!this._e)return;s(0,u(n.clientX,n.clientY));const r=t?e.MouseStyles.Point:this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ji.engine.setMouseStyle(r,this.Be)})),this.onMouseLeave((()=>{this._e&&(this.Ji.engine.restoreMouseStyle(this.Be),this.Be=void 0)})),this.onMouseDrag(((t,e,i,s,r)=>{this._e&&0===i&&n(0,0,0,r,e)}));const r=Yi(new Xi(s,n));this.onTouchStart(r.onTouchStart),this.onTouchMove(r.onTouchMove),this.onTouchEnd(r.onTouchEnd)}}class Ps extends Gi{constructor(t,e,i,s,n,r,o,a){super(t,e,i,s,n,r,o,a),this._s="Constant Line",this.S=0,this.Me=this.qi.constantLineStrokeStyle,this.Le=!0,this._e=!0,this.Re=this.Ts.Ve(this.dt).Ee(this.Me).cs(this.getHighlight()),this.gs(this.Re)}setValue(t){return this.S=t,this.D.emit("valueChange",this,this.S),this.Ts.bs(),this}getValue(){return this.S}setStrokeStyle(t){this.Me="function"==typeof t?t(this.Me):t;const e=this.Me;return this.Re.Ee(e),this.Ts.bs(),this}getStrokeStyle(){return this.Me}setInteractionMoveByDragging(t){return this.Le=t,this}getInteractionMoveByDragging(){return this.Le}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}Fe(){return this.Re.Oe(this.Fs.toVec2(this.S,this.Fs.getHeight(this.dt).getInnerStart())).ze(this.Fs.toVec2(this.S,this.Fs.getHeight(this.dt).getInnerEnd())),this}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{stroke:this.Me}),this}Pe(t,e){t.cs(e),this.Ts.bs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){const t=(t,e)=>{this._e&&this.Le&&(this.S=this.axis.dt.pi(this.S,this.Fs.getWidth(e)),this.D.emit("valueChange",this,this.S),this.Ts.bs(),jt(t))};this.onMouseMove((()=>{if(this._e&&this.Le){const t=this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ji.engine.setMouseStyle(t,this.Be)}})),this.onMouseLeave((()=>{this._e&&this.Le&&(this.Ji.engine.restoreMouseStyle(this.Be),this.Be=void 0)})),this.onMouseDrag(((e,i,s,n,r)=>{this._e&&this.Le&&0===s&&t(i,r)}));const i=Yi(new Xi(void 0,((e,i,s,n,r)=>t(r,n))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const Rs={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?Rs.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Rs.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?Rs.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Ne,Os=t=>void 0!==t.Ge,Ns={We:Ci.Numeric},Us=(t,e)=>[t,e],Gs=(t,e,i,s)=>{const n=[],r=Math.round(Math.abs((t-e)/i));for(let o=1;o{Et(t,0)&&(t=0),Et(e,0)&&(e=0);const r=[];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 n=[];let r=i(t),o=0;for(;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return n.push(r),n},Hs=(t,...e)=>{const i=e.length>0?e.length:t?1:0;return(s,n,r,o,a,h)=>{if(n>=i)return;const l=e[n]||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,n)=>(i&&(t=t.filter(((t,e)=>e>0))),s&&(t=t.filter(((e,i)=>i(i+n)%e==0))))(s,l,u,c,d)}},Xs=(...t)=>{const e=t.length>0?t.length:0;return(i,s,n,r,o,a)=>{if(s>=e)return;const h=t[s]||1;return i.filter(((t,e)=>e%h==0))}},js=(t,e)=>{if(e.has(t))return e.get(t);const i=je(t.Ye.Ue());return e.set(t,i),i},$s=t=>{const e=new Map;if(t!==Ns){for(const i of t.He)e.set(i,new Map);for(const i of t.$e)e.set(i,new Map)}return e};class qs{constructor(t,e,i,s,r,o,a){this.D=new n.Eventer,this.Xe=Ns,this.je=Vs.Empty,this.Ze=new Map,this.Qe=new Map,this.Je=Rs.fitting,this.Ke=!0,this.qe=$((()=>this.chart.us.bs()))(300,X.linear),this.th=!0,this.Xi=!0,this.ih=!1,this.sh=Fe,this.eh=!1,this.hh=!1,this.rh=Fe,this.oh=Fe,this.ah=Fe,this.lh=!1,this.uh=()=>{this.ih||void 0===this.Je||this.chart.us.bs(!0)},this.dh={},this.fh=(t,e,i,s,n,r)=>{const o=[],a=[];for(const h of t){if(hs){o.push(h);continue}const t=this.Ze.get(e),l=(t?t.get(h):void 0)||this.Ah(h,e);l.gh=!1;const u=this.ph(l,n);r.set(l,u),o.push(h),a.push(l)}return{displayedKeyValues:o,createdTicks:a}},this.mh=(t,e,i,s,n,r,o,a,h,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.Sh!==i||!!t.find((t=>t===e)))).map((t=>Re(e,js(t,h))?t:void 0)),m=y.some((t=>void 0!==t))}else m=!1;if(m){let t=!0;const e=y.filter((t=>void 0!==t));if(t&&e.every((t=>Bs(t.Sh)))&&(t=!1),t&&i.xh&&i.xh.bh&&!1===i.xh.bh(g,s,n,r,o,a)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.Xe.We(t,this.dt),this.chart=t,this.Mh=e,this.qi=s,this._h=o,this.dt=i,this.wh=a,"logarithmic"===a.type&&this.setAnimationZoom(X.logarithmic(Mi(a.base))),this.Ch=o.numeric,this.kh("Numeric"),this.Th=i.getInnerStart(),this.Fh=i.getInnerEnd(),this.setAnimationsEnabled(r)}setDefaultInterval(t,e){return this.Ih=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.lh=!0,this.chart.us.bs()),this}getDefaultInterval(){return this.Ih}getTitle(){return this.Dh.Ph()}setTitle(t){return this.Dh.Bh(t),this.chart.us.bs(),this}getTitleFillStyle(){return this.Dh.Lh()}setIntervalRestrictions(t){return this.Rh=t,this.chart.us.bs(),this}getIntervalRestrictions(){return this.Rh}setTitleFillStyle(t){return this.Dh.ke(t),this.chart.us.bs(),this}getTitleFont(){return this.Dh.Eh()}setTitleFont(t){return this.Dh.Vh(t),this.chart.us.bs(),this}setTitleRotation(t){return this.Dh.zh(t),this.chart.us.bs(),this}getTitleRotation(){return this.Dh.Oh()}setTitleEffect(t){return this.Nh.xs(t),this.chart.us.bs(),this}getTitleEffect(){return this.Nh.Ms()}kh(t,e){if(this.Ze.size>0&&this.Gh(),"Empty"===t)this.Xe=Ns,this.je=t;else if("Numeric"===t){"Numeric"!==this.je&&(this.Ch=this._h.numeric);const i=e||(t=>t);this.Ch=i(this.Ch),this.Xe=this.Ch.Wh(this.wh),this.je=t}else if("DateTime"===t){"DateTime"!==this.je&&(this.Ch=this._h.datetime);const i=e||(t=>t);this.Ch=i(this.Ch),this.Xe=this.Ch.Wh(this.wh),this.je=t}else if("Time"===t){"Time"!==this.je&&(this.Ch=this._h.time);const i=e||(t=>t);this.Ch=i(this.Ch),this.Xe=this.Ch.Wh(this.wh),this.je=t}return this.Qe.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Qe=$s(this.Xe),this.chart.us.bs(),this}Uh(){return this.Xe}Yh(t){this.Xe=t,this.Qe.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Qe=$s(this.Xe),this.chart.us.bs()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:n}=t;return this.St(void 0!==e?e:this.Th,void 0!==i?i:this.Fh,void 0!==s&&s,void 0===n||n,"userSetInterval"),this}St(t,e,i=!1,s=!0,n){let r={start:t,end:e};const o=!0,a=Math.abs(e-t);if(Math.abs(this.Fh-this.Th),void 0!==this.Xe.Hh&&this.Xe.Hh>a){const i=(e+t)/2,s=this.Xe.Hh/2*(t>e?-1:1);r={start:i-s,end:i+s}}if(void 0!==this.Xe.$h&&this.Xe.$he?-1:1);r={start:i-s,end:i+s}}const h=this.dt.nt(r.start,r.end,this.Th,this.Fh,o);if(!1===h)return this;if(!0===h);else if(r=h,"zoomBandChart"===n)return this;let l;switch(n){case"userSetInterval":case"userFit":case"interactionSetInterval":case"interactionZoom":l=!0;break;case"zoomBandChart":case"synchronizedAxis":l=!1;break;default:return Se(0,""),this}if(this.Xh&&this.Xh.finishAll(!1),this.qe&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.Xh||this.Xh.isOver()?this.qe:this.Xh.NextAnimation.bind(this);this.Xh=e([[this.Th,r.start],[this.Fh,r.end]],(([t,e])=>{this.jh(t,e,o)}),t),this.Xh.onAnimationEnd((()=>{this.Xh=void 0,l&&(this.ah=St.performance.now())})),this.Xh.onAnimationEnd((()=>this.setStopped(s)))}else this.jh(r.start,r.end,o),this.setStopped(s),l&&(this.ah=St.performance.now());return this}getInterval(){return{start:this.Th,end:this.Fh}}setStopped(t){return t===this.ih||(t&&(this.Xh&&this.Xh.finishAll(!1),this.Xh=void 0),this.ih=t,this.D.emit("stoppedStateChanged",this,this.ih),this.sh=St.performance.now(),this.chart.us.bs()),this}getStopped(){return this.ih}onStoppedStateChanged(t){return this.D.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.D.off(t,"stoppedStateChanged")}fit(t,e){const i=this.Zh(),s=this.Ih||tn,n="function"==typeof s?s({curStart:this.Th,curEnd:this.Fh,dataMin:null==i?void 0:i.min,dataMax:null==i?void 0:i.max}):s;return this.St(void 0!==n.start?n.start:this.Th,void 0!==n.end?n.end:this.Fh,void 0!==n.animate?n.animate:void 0===t||t,void 0!==n.stopAxisAfter?n.stopAxisAfter:void 0===e||e,"userFit"),this}setScrollStrategy(t){return this.Je=t,this.chart.us.bs(),this}getScrollStrategy(){return this.Je}setAnimationScroll(t){return this.Ke=Boolean(t),this.chart.us.bs(),this}setAnimationZoom(t,e=300){return this.Xh&&(this.Xh.finishAll(!1),this.Xh=void 0),this.qe=t?$((()=>this.chart.us.bs()))(e,t):void 0,this}setAnimationsEnabled(t){return this.th=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(X.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.th}setVisible(t){const e=this.Xi!==t;return this.Xi=t,this.Dh.setVisible(t),this.Qh((e=>{e.Ye.setVisible(t)})),e&&this.D.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onIntervalChange(t){return this.D.on("scaleChange",t)}offIntervalChange(t){return this.D.off(t,"scaleChange")}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}Jh(t,e){const i=new Map;if(this.Xe===Ns||!this.Xi)return this.Gh(),i;e=e||new Map;const s=this.Kh(),n=s.min,r=s.max,o=r-n,a=t.physicalAxisSize;this.dh.physicalAxisSize=a;const h=Ks(this.Xe,n,r,this.Th,this.Fh,a),l=[];if(this.qh(),l.push(...this.tr(this.Xe,n,r,h,e,t,i)),this.ir(this.Xe,n,r,h,e,t,l,i),this.sr(),h)for(const[t,e]of this.Qe){const i=h.get(t);if(void 0!==i)for(const[t,s]of e)i.includes(t)||(null==s||s.dispose(),e.delete(t))}return this.dh.min=n,this.dh.max=r,this.dh.scaleInterval=o,this.dh.physicalAxisSize=a,i}er(t){const e=t.Sh.hr;t.Ye.Bh(e(t.S,this.dt)).Ds()}rr(t,e){const i=e.nr;t.Ye.ke(i.getLabelFillStyle()).Vh(i.getLabelFont()).zh(i.getLabelRotation())}Ah(t,e){const i=this.Qe.get(e);let s=i.get(t);s?(i.delete(t),s.Sh=e,s.vs(!0)):s=this.ar(t,e);const n=this.Ze.get(e)||new Map;return n.set(t,s),this.Ze.set(e,n),this.rr(s,e),s}ph(t,e){const i=this.lr(t,e);return this.er(t),i}tr(t,e,i,s,n,r,o){const a=[];for(const h of t.He){const t=s.get(h);for(const s of t){if(si)continue;const t=this.Ze.get(h),l=(t?t.get(s):void 0)||this.Ah(s,h),u=this.ph(l,r),c=js(l,n);a.find((t=>Re(c,js(t,n))))&&l.Ye.setVisible(!1),l.gh=!1,o.set(l,u),a.push(l)}}return a}ir(t,e,i,s,n,r,o,a){let h,l=[];for(const u of t.$e){const t=s.get(u);if(!t)break;let c;if(void 0===h)c=[{start:e,end:i,keyValues:t}];else{c=[];for(let e=0;e=i&&e0){if(void 0===u.xh){y=!1;break}const t=u.xh.ur;if(h=t(h,d-1,r,a,e,i),void 0===h)break}const p=this.mh(m.filter((t=>h.some((e=>Et(t.S,e))))),g,u,d,r,a,e,i,n,o,l);!0!==p?t=t.concat(p):(d+=1,f=-1,t=[])}p=t,m.forEach((e=>{t.find((t=>t===e))||this.cr(e)}))}if(l=p,!y)break}}cr(t){const e=this.Ze.get(t.Sh);null==e||e.delete(t.S);const i=this.Qe.get(t.Sh);i&&i.has(t.S)?t.dispose():i&&(t.vs(!1),i.set(t.S,t))}Qh(t){for(const e of this.Ze.values())for(const i of e.values())t(i)}dr(t,e){for(const i of this.Ze.values())for(const s of i.values())e=t(e,s);return e}Gh(){this.Ze.forEach(((t,e)=>{t.forEach((t=>this.cr(t)))})),this.Ze.clear()}qh(){for(const t of this.Ze.values())for(const e of t.values())e.gh=!0}sr(){for(const t of this.Ze.values())for(const[e,i]of t.entries())i.gh&&(i.dispose(),t.delete(e))}Kh(){const t=this.dt.getInnerStart()this.dt.getInnerStart()?this.dt.getInnerEnd():this.dt.getInnerStart();return m(t,e)}yh(t,e){return!(t.gh||0===t.Ye.Ph().length||Bs(e)&&!0!==e.Ar)}gr(t,e){return this.Xe===Ns||(this.Xe.He.forEach((i=>{e=t(e,i.nr)})),this.Xe.$e.forEach((i=>{(t=>void 0!==t.hr)(i)&&(e=t(e,i.nr))}))),e}Zh(){let t=this.Mh.pr();const e=this.Mh.mr();let i;if(void 0!==t&&vt(t)&&void 0!==e&&vt(e)&&("logarithmic"===this.wh.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=m(t,e)),i&&vt(i.min)&&vt(i.max))return Et(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}yr(){let t=0;const e=this.Mh.Sr();return e&&(t=Math.max(t,e)),t}vr(){var t;const e=this.eh;let i=!1;if(this.lh&&this.Ih){const t=this.Zh(),e="function"==typeof this.Ih?this.Ih({curStart:this.Th,curEnd:this.Fh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.Ih;this.setInterval(e),this.lh=!1}if(this.Je&&!this.ih){const e=this.Zh();if(e){const s=this.Th,n=this.Fh;let r=this.Je.start(s,n,e.min,e.max),o=this.Je.end(s,n,e.min,e.max);const a=null===(t=this.Je.allowIntervalLengthChange)||void 0===t||t,h=Qs(this.Rh,e,{start:r,end:o},{start:s,end:n},a);r=h.start,o=h.end;const l=!1===Et(s,r),u=!1===Et(n,o);if(r=l?r:s,o=u?o:n,l||u){let t=!1;if(this.Ke)if(this.Ke){t=!0;const e=l?this.br(s,r):s,h=u?this.br(n,o):n;if(!0===this.jh(e,h,a)&&(l&&!1===Et(e,r)||u&&!1===Et(h,o))){this.chart.us.bs(!0),i=!0;let t=Math.abs(o-r)/Math.abs(e-h);t<1&&(t=1/t),this.hh=t>=1.4}}else t=!1;t||this.jh(r,o,a)}}}i?(this.eh!==i&&(this.eh=i,this.rh=St.performance.now()),this.Mr&&(clearTimeout(this.Mr),this.Mr=void 0)):!0===e&&void 0===this.Mr&&(this.hh=!1,this.Mr=setTimeout((()=>{!1!==this.eh&&(this.eh=!1,this.rh=St.performance.now()),this.Mr=void 0,this.chart.us.bs()}),200))}jh(t,e,i){let s={start:t,end:e},n=!0;if(this.Rh){const t=this.Zh();s=Qs(this.Rh,t,s,{start:this.Th,end:this.Fh},i)}const r=Math.abs(e-t),o=Math.abs(this.Fh-this.Th);if(void 0!==this.Xe.Hh&&this.Xe.Hh>r){const r=(e+t)/2,a=(i?this.Xe.Hh/2:o/2)*(t>e?-1:1);s={start:r-a,end:r+a},n=!1}if(void 0!==this.Xe.$h&&this.Xe.$he?-1:1);s={start:r-a,end:r+a},n=!1}let a=this.dt.nt(s.start,s.end,this.Th,this.Fh,i);if(!1===a)return!1;!0!==a&&(s=a);const h=this.yr(),l=this._r(Math.min(s.start,s.end),Math.max(s.start,s.end),h);return a=this.dt.nt(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min,this.Th,this.Fh,!1),!!a&&(!0===a?this.dt.J(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min):this.dt.J(s.start,s.end),this.Th=s.start,this.Fh=s.end,this.D.emit("scaleChange",this,s.start,s.end),this.oh=St.performance.now(),this.chart.us.bs(),n)}wr(){return this.eh}Cr(){return void 0!==this.Xh}}class Js{constructor(t,e,i,s,n=i.kr(s).setMouseInteractions(!1)){this.gh=!1,this.$i=!1,this.ts=[],this.Sh=t,this.S=e,this.Tr=i,this.Fr=s,this.Ye=n,this.ts.push(n)}vs(t){this.ts.forEach((e=>e.setVisible(t)))}dispose(){return this.$i||(this.$i=!0,this.ts.forEach((t=>t.dispose()))),this}}const Ks=(t,e,i,s,n,r)=>{const o=new Map;for(const r of t.He){let t=r.Ir(e,i,s,n);t=Zs(t),o.set(r,t)}let a;for(const s of t.$e){let t;if(void 0===a)t=s.Ir(e,i,e,i);else{let n=[];const o=a.filter((t=>e<=t&&t<=i)).length;if(o>0){const t=r/(o-1);if(void 0!==s.Pr&&s.Pr>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let n=0;for(let r=0;rt-e)),Qs=(t,e,i,s,n)=>{const r="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(!r)return i;const o={start:i.start,end:i.end};let a=Math.abs(i.end-i.start);if(void 0!==r.intervalMin&&ar.intervalMax){const t=(o.start+o.end)/2;o.start=t+.5*Math.sign(i.start-t)*r.intervalMax,o.end=t+.5*Math.sign(i.end-t)*r.intervalMax}return a=Math.abs(i.end-i.start),void 0!==r.startMin&&(o.start=Math.max(o.start,r.startMin),n||Et(Math.abs(o.start-o.end),a)||(o.end=o.start+Math.sign(i.end-i.start)*a)),a=Math.abs(i.end-i.start),void 0!==r.startMax&&(o.start=Math.min(o.start,r.startMax),n||Et(Math.abs(o.start-o.end),a)||(o.end=o.start+Math.sign(i.end-i.start)*a)),a=Math.abs(i.end-i.start),void 0!==r.endMin&&(o.end=Math.max(o.end,r.endMin),n||Et(Math.abs(o.start-o.end),a)||(o.start=o.end+Math.sign(i.start-i.end)*a)),a=Math.abs(i.end-i.start),void 0!==r.endMax&&(o.end=Math.min(o.end,r.endMax),n||Et(Math.abs(o.start-o.end),a)||(o.start=o.end+Math.sign(i.start-i.end)*a)),o},tn=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}},en=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class sn extends en{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 nn=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),rn=new sn,on=new class{getFillStyle(){return V}},an=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new U,wireframeStyle:nt});class hn extends an{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 ln=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),un=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new U});class cn extends un{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 dn=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),fn={Triangulated:hn,Pixelated:cn};class gn{constructor(t){this.Dr=new Map,this.us=t}os(t,e,i){const s=i.animationEnabled;this.Dr.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const n=t.onDispose((()=>{this.Dr.delete(t),t.offDispose(n)}))}Br(t,e){const i=e.animationEnabled,s=[],n=t.onDispose((()=>{s.forEach((t=>{this.Dr.delete(t)})),t.offDispose(n)}));return{Lr:(t,e)=>{const n={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Dr.set(t,n)}}}ws(t,e){const i=this.Dr.get(t);i&&(i.curUnanimatedHighlightValue=Ae(e),this.us.bs())}ys(t,e=!1){const i=this.Dr.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}Cs(t,e){const i=this.Dr.get(t);i&&(i.animationEnabled=e)}ks(t){const e=this.Dr.get(t);return!!e&&e.animationEnabled}Ds(t){let e=!1;this.Dr.forEach(((i,s)=>{let n;if(i.animationEnabled){const s=1e3;if(i.curUnanimatedHighlightValue>0){const r=i.curAnimationPositionMillis/s;n=i.curUnanimatedHighlightValue*Math.abs(Math.sin(r*Math.PI/2+.5));const o=0===i.curAnimatedHighlightValue?1:t;i.curAnimationPositionMillis+=o,e=!0}else i.curAnimatedHighlightValue>0&&0===i.curUnanimatedHighlightValue?(n=Math.max(i.curAnimatedHighlightValue-t/s,0),e=e||n>0):n=0,i.curAnimationPositionMillis=0}else n=i.curUnanimatedHighlightValue;n!==i.curAnimatedHighlightValue&&(i.applyHighlight(n),i.curAnimatedHighlightValue=n)})),e&&this.us.bs(!0)}}const mn=new Map,pn=t=>{const e=t.getSize(),i=t.getFamily(),s=t.getWeight(),n=t.getStyle(),r=t.getVariant(),o=`${n} ${r?"small-caps":"normal"} ${s} ${e}px ${i}`;let a=mn.get(o);return a||(a=((t,e)=>({font:t,properties:e}))(o,{type:"font",size:e,family:i,style:n,variant:r,weight:s}),mn.set(o,a)),a};var yn,An;!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"}(yn||(yn={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(An||(An={}));const xn=t=>({container:t.Rr,scale:t.dt,setMouseStyle:(e,i)=>t.Er(e,i),restoreMouseStyle:e=>t.Vr(e),clientLocation2Engine:(e,i)=>t.De(e,i),engineLocation2Client:(e,i)=>t.zr(e,i),captureFrame:(e,i,s)=>t.Or(e,i,s),renderFrame:(e,i,s=!1)=>t.Nr(e,i,s),layout:()=>{t.Gr(),t.Wr(),t.Yr.Ur(),t.bs()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.Hr(e,i),onRenderFrame:e=>t.$r(e),offRenderFrame:e=>t.Xr(e)}),Sn=[];let bn;const vn=()=>{if(void 0!==bn){const t=St.getComputedStyle(St.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));bn.style.height=St.innerHeight-e+"px",(()=>{for(let t=0;tthis.bs()),60),this.Qr=u(0,0),this.Jr=!1,this.Kr=wt,this.qr=()=>{},this.tn=[],this.sn=-1,this.en=[],this.hn=!0,this.$i=!1,this.rn=!1,this.Wr=()=>{const{bottom:t,left:e}=this.Rr.getBoundingClientRect();return this.Qr=u(Math.floor(e),Math.floor(t)),this},this.Gr=()=>{this.nn&&this.nn()},this.Er=(t,e)=>{if(!e){this.Rr.style.cursor=t;const e=this.sn;return this.sn+=1,this.en.push([e,t]),e}return this.Vr(e),this.Er(t)},this.Vr=t=>{const e=t?this.en.findIndex((e=>e[0]===t)):-1;e>=0?(this.en.splice(e,1),this.en.length>0?this.Rr.style.cursor=this.en[this.en.length-1][1]:this.Rr.style.cursor="default"):(this.en.push([0,"default"]),this.Rr.style.cursor="default")},this.an=t=>(this.ln.M(t),this),this.un=()=>this.ln._(),this.cn=()=>{this.Kr&&this.Kr(1e3/60),this.dn(),this.fn(),this.qr&&this.qr()},this.An=t=>(this.jr.set(t.gn(),t),this.jr=new Map([...this.jr.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.pn=t=>(this.jr.delete(t),this),this.j=()=>(this.ln.o=!1,this),this.Z=()=>(this.ln.o=!0,this),this.mn=t=>{if(!this.hn)return;const e=this.yn,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.De(t.clientX,t.clientY),n=this.Sn(t,{x:t.clientX,y:t.clientY});if(this.vn&&((null==n?void 0:n.entity)!==this.vn.entity||n.collectionMember!==this.vn.collectionMember)&&!this.xn){this.vn.entity.ji=!1;const e=this.vn.entity.bn;e&&e(this.vn.entity,t,this.vn.collectionMember)}if(n&&n.entity.getMouseInteractions()&&!this.xn)if(n.entity.ji){if(!i){const e=n.entity.Mn;e&&e(n.entity,t,n.collectionMember)}}else{n.entity.ji=!0;const e=n.entity._n;e&&e(n.entity,t,n.collectionMember)}if(this.xn){const i=this.xn.entity.wn,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.Cn=t,this.yn=t,this.kn=s,this.vn=n},this.Tn=t=>{if(this.hn=!1,this.kn=void 0,this.Cn=t,this.vn&&!this.Fn&&!this.xn){this.vn.entity.ji=!1;const e=this.vn.entity.bn;e&&e(this.vn.entity,t,this.vn.collectionMember),this.vn=void 0}},this.In=t=>{if(this.hn=!0,this.Cn=t,this.xn&&t.buttons<=0){const e=this.xn.entity.Pn;e&&e(this.xn.entity,t,this.xn.button,this.xn.startLocation,this.xn.collectionMember),this.xn=void 0}if(this.Fn&&t.buttons<=0){const e=this.Fn.entity.Dn;e&&e(this.Fn.entity,t,this.Fn.collectionMember),this.Fn=void 0}},this.Bn=()=>this.kn,this.Yr=t,this.qi=e.theme,this.As=i.As,this.Ln=i.Ln,this.Rn=i.Rn,this.En={Vn:i.Vn,zn:i.zn,On:i.On,Nn:i.Nn,Gn:i.Gn,Wn:i.Wn,Un:i.Un,Yn:i.Yn,Hn:i.Hn,$n:i.$n,Xn:i.Xn,jn:i.jn,Zn:i.Zn,Qn:i.Qn,Jn:i.Jn,Kn:i.Kn,qn:i.qn,io:i.io,so:i.so,eo:i.eo,ho:i.ho,ro:i.ro,no:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,Xs:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:`${St.location.origin}/resources`,oo:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,ao:(()=>{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})(),lo:void 0===(null==e?void 0:e.interactable)||e.interactable,uo:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=St.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.Rr=t}else this.Rr=s;St.addEventListener("resize",this.Gr),this.tn.push((()=>{St.removeEventListener("resize",this.Gr)}))}else{if(void 0===bn){const t=St.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",St.document.body.appendChild(t),bn=t,St.addEventListener("resize",vn)}let t=1;for(;null!==St.document.getElementById(`chart-${t}`);)t+=1;this.Rr=St.document.createElement("div"),this.Rr.id=`chart-${t}`,this.Rr.style.flex="1",this.Rr.style.height="100%",bn.appendChild(this.Rr),vn(),Sn.push(this.Gr),this.tn.push((()=>{bn&&bn.removeChild(this.Rr),Sn.includes(this.Gr)&&Sn.splice(Sn.indexOf(this.Gr),1),0===Sn.length&&bn&&(St.document.body.removeChild(bn),bn=void 0,St.removeEventListener("resize",vn))}))}if(St.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Rr&&this.Gr()};this.co=new St.ResizeObserver(t.bind(this)),this.co.observe(this.Rr)}""===this.Rr.style.position&&(this.Rr.style.position="relative"),this.Rr.style.boxSizing="content-box",this.Rr.addEventListener("fullscreenchange",this.Gr),this.Rr.addEventListener("webkitfullscreenchange",this.Gr);const r=e?e.maxFps:void 0;this.do=r?-1===r?-1:0!==r?1e3/r:0:0;const o=new Map;let a=!1;const h=(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),a=!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&&(a=!0)};this.Rr.onwheel=this.fo(yn.wheel),this.Rr.oncontextmenu=this.fo(yn.contextmenu),this.Rr.onclick=this.fo(yn.click),this.Rr.ondblclick=this.fo(yn.dbclick),this.Rr.onlostpointercapture=()=>{a=!1},this.Rr.ontouchmove=t=>{a&&t.preventDefault()},this.Rr.onpointerover=h(),this.Rr.onpointerenter=h(this.In),this.Rr.onpointerdown=h(this.fo(yn.mouseDown),this.Ao(An.touchStart)),this.Rr.onpointermove=h(this.mn,this.Ao(An.touchMove)),this.Rr.onpointerup=h(this.fo(yn.mouseUp),this.Ao(An.touchEnd)),this.Rr.onpointercancel=h(),this.Rr.onpointerout=h(),this.Rr.onpointerleave=h(this.Tn,this.Ao(An.touchEnd)),St.addEventListener("scroll",this.Wr,{passive:!0}),this.ln=y(new v({r:0,g:0,b:0,a:0})),this.ls=new gn(this)}po(t,e){var i,s,n,r;(null===(i=this.vn)||void 0===i?void 0:i.entity)===t.entity&&this.vn.collectionMember===t.collectionMember&&(this.vn=e),(null===(s=this.mo)||void 0===s?void 0:s.entity)===t.entity&&this.mo.collectionMember===t.collectionMember&&(this.mo=e),(null===(n=this.Fn)||void 0===n?void 0:n.entity)===t.entity&&this.Fn.collectionMember===t.collectionMember&&(this.Fn={...e,event:this.Fn.event}),(null===(r=this.xn)||void 0===r?void 0:r.entity)===t.entity&&this.xn.collectionMember===t.collectionMember&&(this.xn={...e,button:this.xn.button,startLocation:this.xn.startLocation})}yo(){this.rn=!0,this.Kr=void 0,this.qr=void 0}$r(t){return this.D.on("render",t)}Xr(t){return this.D.off(t)}So(){return this.vo}xo(){return this.bo}setBackgroundFillStyle(t){return this.Mo.ke(t),this}getBackgroundFillStyle(){return this.Mo.Lh()}setBackgroundStrokeStyle(t){return this.Mo.Ce(t),this}getBackgroundStrokeStyle(){return this.Mo._o()}wo(t){return this.qr=t,this}Co(t){return this.Kr=t,this}ko(t){return this.jr.get(t)}To(){return Array.from(this.jr.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}fo(t){return e=>this.Fo(t,e)}Fo(t,e){if(!this.hn)return;t===yn.contextmenu&&jt(e);const i=this.De(e.clientX,e.clientY),s=this.Sn(e,{x:e.clientX,y:e.clientY});if(t===yn.mouseUp){if(this.xn){const t=this.xn.entity.Pn;if(t&&t(this.xn.entity,e,this.xn.button,this.xn.startLocation,this.xn.collectionMember),(null==s?void 0:s.entity)!==this.xn.entity||s.collectionMember!==this.xn.collectionMember){this.xn.entity.ji=!1;const t=this.xn.entity.bn;t&&t(this.xn.entity,e,this.xn.collectionMember)}this.xn=void 0}if(this.Fn){const t=this.Fn.entity.getMouseInteractions()&&this.Fn.entity.Dn;t&&t(this.Fn.entity,e,this.Fn.collectionMember),this.Fn=void 0}}else if(s&&s.entity.getMouseInteractions()){const i=t===yn.click?s.entity.Io:t===yn.dbclick?s.entity.Po:t===yn.mouseDown?s.entity.Do:t===yn.wheel?s.entity.Bo:t===yn.contextmenu?s.entity.Lo:void 0;if(i&&i(s.entity,e,s.collectionMember),t===yn.mouseDown){this.Fn={entity:s.entity,collectionMember:s.collectionMember,event:e};const t=this.Fn.event.button,i=s.entity.Ro;i&&i(s.entity,e,t,s.collectionMember),this.xn={entity:s.entity,collectionMember:s.collectionMember,button:t,startLocation:u(e.clientX,e.clientY)}}}this.Cn=e,this.kn=i,this.vn=s}Ao(t){return e=>this.Eo(t,e)}Eo(t,e){const i=e.interactions.length;if(this.Vo=e,this.mo){const s=t===An.touchMove?this.mo.entity.zo:t===An.touchEnd?this.mo.entity.Oo:t===An.touchStart?this.mo.entity.No:void 0;s&&s(this.mo.entity,e,this.mo.collectionMember),t===An.touchEnd&&0===i&&(this.mo.entity.ji=!1,this.mo=void 0)}else if(t===An.touchStart){for(let t=0;t{t()})),this.tn.length=0}De(t,e){return u(t-this.Qr.x,this.Qr.y-e)}zr(t,e){return u(t+this.Qr.x,this.Qr.y-e)}$o(t){const e=this.De(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Xo(t){const e=this.zr(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const En=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const n=si(i,s*t),r=Math.abs(n.x),o=e.length,a=[];let h=0,l=0,c=e[0].x+r;for(;ls&&(s=e[l].y),e[l].y({type:"horizontalRegressive",packager:(e,i,s)=>{if(e.length>1){const n=si(i,s*t),r=Math.abs(n.x),o=e.length,a=[];let h=0,l=0,c=e[0].x-r;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 n=si(i,s*t),r=Math.abs(n.y),o=e.length,a=[];let h=0,l=0,c=e[0].y+r;for(;ls&&(s=e[l].x),e[l].x({type:"verticalRegressive",packager:(e,i,s)=>{if(e.length>1){const n=si(i,s*t),r=Math.abs(n.y),o=e.length,a=[];let h=0,l=0,c=e[0].y-r;for(;lc&&l=c;)e[l].x>s&&(s=e[l].x),e[l].x{const e="nearest"===t?Fn.Nearest:"nearest-x"===t?Fn.NearestX:"nearest-y"===t?Fn.NearestY:void 0;return void 0!==e?e:Fn.NearestX},zn=(t,e,i,s,n,r,o,a,h,l)=>{const u=t.length;if(0===u)return;const c=s?1:0,d=u-(n?2:1);if(i===Fn.Nearest)return Pn(t,e,r,o,c,d);if(i===Fn.NearestX||i===Fn.NearestY){if("boolean"==typeof l&&("x"===h&&i===Fn.NearestX||"y"===h&&i===Fn.NearestY))return Bn(t,ut(e,o,r),h,l,c,d);if(i===Fn.NearestX)return Rn(t,ut(e,o,r),a,c,d);if(i===Fn.NearestY)return Vn(t,ut(e,o,r),a,c,d)}},Pn=(t,e,i,s,n,r)=>{let o,a=Number.MAX_VALUE;for(let h=n;h<=r;h+=1){const n=t[h];if(!Number.isNaN(n.x)&&!Number.isNaN(n.y)){const t=ut(n,i,s),r=(t.x-e.x)**2+(t.y-e.y)**2;r{if(e.xi.max.x)return;let r,o=Number.MAX_VALUE;for(let i=s;i<=n;i+=1){const s=t[i],n=s.x>e.x?s.x-e.x:e.x-s.x;n{if(e.yi.max.y)return;let r,o=Number.MAX_VALUE;for(let i=s;i<=n;i+=1){const s=t[i],n=s.y>e.y?s.y-e.y:e.y-s.y;n{const o="x"===i,a=o?e.x:e.y,h=t[n],l=t[r],u=h.xl.x?h.x:l.x,f=h.y>l.y?h.y:l.y;if(o&&(ad)||!o&&(af))return;let g=n,m=Math.floor((n+r)/2),p=r,y=-1;for(;;){const e=a-(o?t[m].x:t[m].y);if(e*(s?-1:1)>0)g=Math.min(m+1,p),y=Math.floor((g+p)/2);else{if(0===Math.abs(e))return m;p=Math.max(m-1,g),y=Math.floor((g+p)/2)}if(y===m){const i=m>n?Math.abs(a-(o?t[m-1].x:t[m-1].y)):_e,s=m{const o="x"===i,a=o?e.x:e.y,h=t[n],l=t[r],u=h.xl.x?h.x:l.x,f=h.y>l.y?h.y:l.y;if(o&&(ad)||!o&&(af))return;let g=n,m=Math.floor((n+r)/2),p=r,y=-1;for(;;){const i=a-(o?t[m].x:t[m].y);if(i*(s?-1:1)>0)g=Math.min(m+1,p),y=Math.floor((g+p)/2);else{if(0===Math.abs(i))return{a:m,b:m,lerpAmount:0};p=Math.max(m-1,g),y=Math.floor((g+p)/2)}if(y===m){if(i*(s?-1:1)<0&&m>n){const i=t[m-1],s=t[m];return{a:m-1,b:m,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(mthis.D.on("dispose",t),this.offDispose=t=>this.D.off(t,"dispose"),this.us=t,this.qo=e,this.ta=i,this.ia=Nn,Nn+=1,this.sa=t.qi.highlightColorOffset}ea(t){return void 0!==this.ta.find((e=>e.type===t))}ha(t,e){var i;return!!this.ea(t)&&!0===e(null===(i=this.ta.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.$i||(this.ji&&this.bn&&this.bn(this,void 0,void 0),this.$i=!0,this.qo(this),this.D.emit("dispose",this)),this}setVisible(t){const e=this.Xi;return this.Xi=t,!t&&e&&(this.ji&&this.bn&&this.bn(this,void 0,void 0),this.ji=!1),this}getVisible(){return this.Xi}setMouseInteractions(t){const e=this.jo._();return this.jo.M(t),t||(e&&this.ji&&this.bn&&this.bn(this,void 0,void 0),this.ji=!1),this}getMouseInteractions(){return this.jo._()}getIsUnderMouse(){return this.ji}getIsGrabbed(){return this.Qo}setMouseMoveEventHandler(t){return this.Mn=t,this}setMouseEnterEventHandler(t){return this._n=t,this}setMouseLeaveEventHandler(t){return this.bn=t,this}setMouseClickEventHandler(t){return this.Io=t,this}setMouseDoubleClickEventHandler(t){return this.Po=t,this}setMouseDownEventHandler(t){return this.Do=t,this}setMouseUpEventHandler(t){return this.Dn=t,this}setMouseWheelEventHandler(t){return this.Bo=t,this}setMouseContextMenuEventHandler(t){return this.Lo=t,this}setMouseDragEventHandler(t){return this.wn=t,this}setMouseDragStartEventHandler(t){return this.Ro=t,this}setMouseDragStopEventHandler(t){return this.Pn=t,this}setTouchStartEventHandler(t){return this.No=t,this}setTouchMoveEventHandler(t){return this.zo=t,this}setTouchEndEventHandler(t){return this.Oo=t,this}ra(t){return this.Jo=t,this}na(){return this.Jo?this.Jo:Gn}cs(t){return this.Ko=t,this}oa(){return this.Ko}aa(t){return this.sa=t,this}la(){return this.sa}}const Gn=m(u(0,0),u(0,0));class Wn extends Un{constructor(t,e,i,s){super(t,i,s),this.ua=0,this.Ts=e,this.Ts.ca=!0}da(t){return this.ua===t||(this.ua=t,this.Ts.ca=!0),this}fa(){return this.ua}}class Yn extends Wn{constructor(t,e,i,s,n){super(t,e,s,n),this.Aa=!0,this.dt=i}}const Hn=(t,e,i)=>{if(i instanceof Li){const s=i.Wi(),n=oi(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return m(u(t.min.x-n.x,t.min.y-n.y),u(t.max.x+n.x,t.max.y+n.y))}return m(i.pi(u(t.min.x,t.min.y),si(e,-1)),i.pi(u(t.max.x,t.max.y),e))},Xn=(t,e)=>"function"==typeof e?e(t):e,jn=(t,e)=>!t||t!==e,$n=t=>t!==V;class qn extends Yn{constructor(t,e,i,s,n){super(t,e,i,s,n),this.be=Tn.fillStyle,this.us=t}ke(t){return this.be=Xn(this.be,t),this}Lh(){return this.be}ga(){return jn(this.pa,this.be)}ma(){return((t,e)=>t===V&&e!==V)(this.pa,this.be)}ya(){return $n(this.be)}Sa(t){this.pa=t}}class Jn extends qn{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Me=Tn.lineStyle,this.us=t}Ce(t){return this.Me="function"==typeof t?t(this.Me):t,this}_o(){return this.Me}va(){return!this.xa||this.xa!==this.Me}ba(t){return!this.xa||this.xa.getThickness()!==t}ya(){return this.Me!==nt||super.ya()}ma(){return(this.Me!==nt||this.be!==V)&&this.xa===nt&&this.pa===V}Ma(t){this.xa=t}}class Kn extends qn{constructor(t,e,i,s,n,r=y(5)){super(t,e,i,s,n),this.size=y(5),this.size=r}q(t){return this.size.M(t),this}}class Zn extends qn{constructor(t,e,i,s,n,r=y(Tn.font)){super(t,e,i,s,n),this._a=y(""),this.wa=y(u(0,0)),this.Ca=y(0),this.ka=y(0),this.Ta=y(u(0,0)),this.Fa=y(0),this.Ia=y(rn),this.Pa=u(0,0),this.Xt=y(A(1,1,1,1)),this.Da=y(x(4,4,4,4)),this.font=y(Tn.font),this.Ba=!1,this.font=r}ya(){return $n(this.be)&&this._a._().length>0}ma(){return!1===this.Ba&&this.ya()}Bh(t){return this._a.M(t),this}Ph(){return this._a._()}Vh(t){return nn(t)?this.Ia.M(t):this.Ia.M(t(this.Ia._())),this}Eh(){return this.Ia._()}La(t){return this.Ia.M(this.Ia._().setFamily(t)),this}Ra(){return this.Ia._().getFamily()}Ea(t){return this.Ia.M(this.Ia._().setSize(t)),this}Va(){return this.Ia._().getSize()}za(t){return this.Ia.M(this.Ia._().setWeight(t)),this}Oa(){return this.Ia._().getWeight()}Na(t){return this.Ia.M(this.Ia._().setStyle(t)),this}Ga(){return this.Ia._().getStyle()}Wa(t){return this.Ia.M(this.Ia._().setVariant(t)),this}Ua(){return this.Ia._().getVariant()}Ie(t){return this.wa.M(t),this}Ya(){return this.wa._()}zh(t){return this.Fa.M(t),this}Oh(){return this.Fa._()}Ha(t,e){return this.Ta.M(u(t,e)),this}$a(){return this.Ta._()}Xa(t){return this.ka.M(t),this}ja(){return this.ka._()}Za(t){return this.Ca.M(t),this}Qa(){return this.Ca._()}Ja(t){return this.ka.M(t.x),this.Ca.M(t.y),this}Ka(t){return this.Xt.M(t),this}qa(){return this.Xt._()}tl(t){return this.Da.M(t),this}il(){return this.Da._()}}class Qn extends Kn{constructor(t,i,s,n,r,o=5){super(t,i,s,n,r,y(o)),this.sl=[],this.el=y(e.PointShape.Square),this.Fa=y(0),this.hl=y(!1),this.rl=y(!1),this.nl=y(!1),this.ol=Le,this.al=0,this.ll=[],this.ul=0,this.cl=Le,this.dl=Fn.Nearest,this.fl=!1,this.Al=void 0}pl(t){return this.dl=t,this}ml(){return this.ll}yl(){return this.sl}Sl(t){return this.el.M(t),this}vl(){return this.el._()}zh(t){return this.Fa.M(t),this}Oh(){return this.Fa._()}xl(t){return this.hl.M(t),this}bl(t){return this.rl.M(t),this}Ml(t){return this.nl.M(t),this}_l(t,e){return Array.isArray(t)||(t=[t]),this.ul+=t.length,this.ll=se(this.ll,t,{canReturnB:!0}),this.cl&&(this.cl=e?qe(this.cl,e):void 0),this.Al=void 0,this}Nt(){return this.fl=!0,this.sl.length=0,this.al=0,this.ol=Le,this.ll=[],this.ul=0,this.Al=void 0,this}wl(){return this.al}Cl(){return this.ul}}class tr extends Jn{constructor(t,e,i,s,n){super(t,e,i,s,n),this.wa=y(u(0,0)),this.X=y(u(100,100)),this.Fa=y(0),this.Pa=y(u(0,0)),this.kl=!1}Ds(){return this.Tl(),this}Ie(t){const e=this.wa._();return t.x===e.x&&t.y===e.y||(this.wa.M(t),this.Tl()),this}Ya(){return this.wa._()}Fl(t){const e=this.wa._();return t!==e.x&&(this.wa.M(u(t,e.y)),this.Tl()),this}Il(t){const e=this.wa._();return t!==e.y&&(this.wa.M(u(e.x,t)),this.Tl()),this}q(t){const e=this.X._();return t.x===e.x&&t.y===e.y||(this.X.M(u(t.x,t.y)),this.Tl()),this}oi(){return this.X._()}Pl(t){const e=this.X._();return t!==e.x&&(this.X.M(u(t,e.y)),this.Tl()),this}Dl(t){const e=this.X._();return t!==e.x&&(this.X.M(u(e.x,t)),this.Tl()),this}zh(t){return this.Fa.M(t),this}Oh(){return this.Fa._()}Bl(t){const e=this.Pa._();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.kl=!1,this.Tl()):(this.kl=!0,this.Pa.M(t))),this}Tl(){if(!this.kl){const t=this.wa._(),e=this.X._(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.Pa._();i.x===s.x&&i.y===s.y||this.Pa.M(i)}}}class er extends Jn{constructor(){super(...arguments),this.sl=[],this.wa=y(u(0,0)),this.ol=Le,this.Ll=!1}Rl(t){return t=Zt(t),this.sl=t,this.Ll=!0,this}El(){return this.sl}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return 0}zl(){return 0}}class ir extends er{}class sr extends qn{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Ol=new Array,this.Nl=new Array,this.Gl=y({type:"disabled",packager:(t,e,i)=>t.slice()}),this.ol=Le,this.Wl=0,this.Ul=!1,this.ll=[Array(),Array()],this.Yl=!1,this.Hl=(new U).setColor(T(42,171,240)),this.fl=!1,this.$l=!1,this.Xl=!1}_l(t,e){const i=this.Wl-1,s=i>0&&!this.Yl;let[n,r]=s?[[this.Ol[i]],[this.Nl[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);n=se(n,e,{canReturnB:!0}),r=se(r,i,{canReturnB:!0})}else{const e=t.position;n.push(u(e,t.high)),r.push(u(e,t.low))}return this.Yl?(this.ll[0]=se(this.ll[0],n,{canReturnB:!0}),this.ll[1]=se(this.ll[1],r,{canReturnB:!0})):(this.ll=[n,r],this.Yl=!0),this.ol=qe(this.ol,e||qe(je(n),je(r))),this}Nt(){return this.fl=!0,this.Ol.length=0,this.Nl.length=0,this.Wl=0,this.ol=Le,this}yl(){return[this.Ol,this.Nl]}ml(){return[this.ll[0],this.ll[1]]}jl(t){return this.Gl.M(t),this}Zl(){return this.Gl._()}Ql(t){return this.Hl="function"==typeof t?t(this.Hl):t,this}Jl(){return this.Hl}wl(){return this.Wl-(Number(this.$l)+Number(this.Xl))}Cl(){return this.ll.length}Kl(t){return this.$l=t,this}ql(){return this.$l}tu(t){return this.Xl=t,this}iu(){return this.Xl}ma(){return this.pa===V&&this.su===V&&(this.be!==V||this.Hl!==V)}eu(t){this.su=t}ya(){return this.Hl!==V||super.ya()}ga(){return super.ga()||!this.su||this.su!==this.Hl}}class nr extends Jn{constructor(t,e,i,s,n){super(t,e,i,s,n),this.wa=y(u(0,0)),this.hu=y(0),this.Fi=y(360),this.ru=y(100),this.nu=y(100),this.ou=y(0),this.au=y(void 0),this.lu=u(0,0),this.uu=u(0,0),this.cu=u(0,0)}du(){return this.ru._()}fu(){return this.nu._()}Ya(){return this.wa._()}Au(){return this.hu._()}Ti(){return this.Fi._()}gu(){return this.ou._()}pu(){return this.au._()}mu(){return this.lu}yu(){return this.uu}Su(){return this.cu}Ie(t){return this.wa.M(t),this}vu(t){return this.hu.M(t),this}ze(t){return this.Fi.M(t),this}xu(t){return this.nu.M(t),this.ru.M(t),this}bu(t){return this.ru.M(t),this}Mu(t){return this.nu.M(t),this}_u(t){return this.ou.M(t<0?0:t),this}wu(t){return this.au.M(void 0!==t&&t<=0?void 0:t),this}}var rr;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(rr||(rr={}));class or extends Yn{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Cu=Tn.lineStyle,this.engine=t}Ee(t){return this.Cu=((t,e)=>"function"==typeof e?e(t):e)(this.Cu,t),this}ku(){return this.Cu}va(){return((t,e)=>!t||t!==e)(this.Tu,this.Cu)}Fu(t){return((t,e)=>!t||t.getThickness()!==e)(this.Tu,t)}ma(){return((t,e)=>t===nt&&e!==nt)(this.Tu,this.Cu)}ya(){return(t=>t!==nt&&t.getFillStyle()!==V)(this.Cu)}Iu(t){this.Tu=t}}class ar extends or{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Pi=u(0,0),this.Fi=u(0,0),this.Pu=!1}M({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.Pu=!0,this.Pi=t,this.Fi=e),this}Ii(){return this.Pi}Ti(){return this.Fi}Oe(t){return t.x===this.Pi.x&&t.y===this.Pi.y||(this.Pu=!0,this.Pi=t),this}ze(t){return t.x===this.Fi.x&&t.y===this.Fi.y||(this.Pu=!0,this.Fi=t),this}}class hr extends or{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Du=void 0,this.Bu=!1}}class lr extends or{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Lu=[],this.ol=Le,this.ll=new Array,this.al=0,this.dl=Fn.NearestX,this.fl=!1,this.Ru=y(void 0),this.$l=!1,this.Xl=!1}Eu(t){return this.Ru.M(t),this}Vu(){return this.Ru._()}ml(){return this.ll}yl(){return this.Lu}pl(t){return this.dl=t,this}Nt(){return this.fl=!0,this.Lu.length=0,this.al=0,this.ll=[],this.ol=Le,this}wl(){return this.al-(Number(this.$l)+Number(this.Xl))}Cl(){return this.ll.length}Kl(t){return this.$l=t,this}ql(){return this.$l}tu(t){return this.Xl=t,this}iu(){return this.Xl}}const ur=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 cr{constructor(){this.Xi=!0,this.D=new n.Eventer,this.zu=0,this.wt=(t,e,i)=>{0===this.zu&&this.D.emit("mouseEnter",this,e),this.zu+=1},this.Ct=(t,e,i)=>{this.zu-=1,this.zu<1&&(this.D.emit("mouseLeave",this,e),this.zu=0)},this.kt=(t,e,i)=>{this.D.emit("mouseClick",this,e)},this.Tt=(t,e,i)=>{this.D.emit("mouseDoubleClick",this,e)},this.Ft=(t,e,i)=>{this.D.emit("mouseDown",this,e)},this.It=(t,e,i)=>{this.D.emit("mouseUp",this,e)},this.Pt=(t,e,i)=>{this.D.emit("mouseMove",this,e)},this.Bt=(t,e,i,s)=>{this.D.emit("mouseDragStart",this,e,i)},this.Dt=(t,e,i,s,n,r)=>{this.D.emit("mouseDrag",this,e,i,s,n)},this.Lt=(t,e,i,s,n)=>{this.D.emit("mouseDragStop",this,e,i,s)},this.Rt=(t,e,i)=>{this.D.emit("mouseWheel",this,e)},this.Et=(t,e)=>{this.zu+=1,this.D.emit("touchStart",this,e)},this.Vt=(t,e)=>{this.D.emit("touchMove",this,e)},this.zt=(t,e)=>{this.zu-=1,this.D.emit("touchEnd",this,e)},this.Ou=t=>(t instanceof Yn?t.setMouseEnterEventHandler(this.wt).setMouseLeaveEventHandler(this.Ct).setMouseClickEventHandler(this.kt).setMouseDoubleClickEventHandler(this.Tt).setMouseDownEventHandler(this.Ft).setMouseUpEventHandler(this.It).setMouseMoveEventHandler(this.Pt).setMouseDragEventHandler(this.Dt).setMouseDragStartEventHandler(this.Bt).setMouseDragStopEventHandler(this.Lt).setMouseWheelEventHandler(this.Rt).setTouchStartEventHandler(this.Et).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.zt):(t.onMouseEnter(this.wt),t.onMouseLeave(this.Ct),t.onMouseClick(this.kt),t.onMouseDoubleClick(this.Tt),t.onMouseDown(this.Ft),t.onMouseUp(this.It),t.onMouseMove(this.Pt),t.onMouseDrag(this.Dt),t.onMouseDragStart(this.Bt),t.onMouseDragStop(this.Lt),t.onMouseWheel(this.Rt),t.onTouchStart(this.Et),t.onTouchMove(this.Vt),t.onTouchEnd(this.zt)),t)}onMouseEnter(t){return this.D.on("mouseEnter",t)}onMouseLeave(t){return this.D.on("mouseLeave",t)}onMouseClick(t){return this.D.on("mouseClick",t)}onMouseDoubleClick(t){return this.D.on("mouseDoubleClick",t)}onMouseDown(t){return this.D.on("mouseDown",t)}onMouseUp(t){return this.D.on("mouseUp",t)}onMouseMove(t){return this.D.on("mouseMove",t)}onMouseDragStart(t){return this.D.on("mouseDragStart",t)}onMouseDrag(t){return this.D.on("mouseDrag",t)}onMouseDragStop(t){return this.D.on("mouseDragStop",t)}onMouseWheel(t){return this.D.on("mouseWheel",t)}onTouchStart(t){return this.D.on("touchStart",t)}onTouchMove(t){return this.D.on("touchMove",t)}onTouchEnd(t){return this.D.on("touchEnd",t)}offMouseEnter(t){return this.D.off(t,"mouseEnter")}offMouseLeave(t){return this.D.off(t,"mouseLeave")}offMouseClick(t){return this.D.off(t,"mouseClick")}offMouseDoubleClick(t){return this.D.off(t,"mouseDoubleClick")}offMouseDown(t){return this.D.off(t,"mouseDown")}offMouseUp(t){return this.D.off(t,"mouseUp")}offMouseMove(t){return this.D.off(t,"mouseMove")}offMouseDragStart(t){return this.D.off(t,"mouseDragStart")}offMouseDrag(t){return this.D.off(t,"mouseDrag")}offMouseDragStop(t){return this.D.off(t,"mouseDragStop")}offMouseWheel(t){return this.D.off(t,"mouseWheel")}offTouchStart(t){return this.D.off(t,"touchStart")}offTouchMove(t){return this.D.off(t,"touchMove")}offTouchEnd(t){return this.D.off(t,"touchEnd")}getIsUnderMouse(){return this.zu>0}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&this.D.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}}const dr=(t,i,s)=>{const n=t.getDraggingMode();if(n!==e.UIDraggingModes.notDraggable){const r=t.scale.pi(t.getPosition(),{x:n!==e.UIDraggingModes.onlyVertical?i.x:0,y:n!==e.UIDraggingModes.onlyHorizontal?i.y:0}),o=t.scale,a=t.getSize(),h=t.getOrigin(),l=o.pi({x:o.x.getInnerStart(),y:o.y.getInnerStart()},oi({x:(1+h.x)/2,y:(1+h.y)/2},a)),u=o.pi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},oi({x:(h.x-1)/2,y:(h.y-1)/2},a)),c={x:Math.min(Math.max(r.x,l.x),u.x),y:Math.min(Math.max(r.y,l.y),u.y)};t.setPosition(c),jt(s)}},fr=(t,e,i,s,n)=>{dr(t,n,e)},gr=(t,e,i,s,n)=>{dr(t,s,n)};class mr extends cr{constructor(t,e,i,s,n){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.$i=!1,this.Nu=void 0,this.Gu=void 0,this.Wu=ur,this.Uu=void 0,this.jo=!0,this.Yu=()=>{const t="function"==typeof this.Wu?this.Wu(this):this.Wu;t&&(this.Gu=this.Ts.us.Er(t))},this.Hu=()=>{this.Ts.us.Vr(this.Gu)},this.Xt=A(0,0,0,0),this.Ts=t,this.renderingScale=e,this.scale=i,this.qo=s,this.qi=n,this.Ts.bs(),this.onMouseEnter(this.Yu),this.onMouseLeave(this.Hu),this.onMouseDrag(fr);const r=Yi(new Xi(wt,gr,wt));this.onTouchStart(r.onTouchStart),this.onTouchMove(r.onTouchMove),this.onTouchEnd(r.onTouchEnd),this.qi=n}setMouseInteractions(t){return this.$u().forEach((e=>e.setMouseInteractions(t))),this.jo=t,this}getMouseInteractions(){return this.jo}setEffect(t){return this.es=this.es||this.Ts.us.es.hs(this,{Xu:{shapes:this.$u()}}),this.es.Xu.xs(t),this}getEffect(){return!!this.es&&this.es.Xu.Ms()}setAutoDispose(t){return this.Uu=t,this.Ts.bs(),this}getAutoDispose(){return this.Uu}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.Ts.bs(),this}getMargin(){return this.Xt}Fe(){if(this.Uu){const t=this.size,e=this.renderingScale.oi(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.Uu.type&&i.x>=this.Uu.maxWidth||"max-height"===this.Uu.type&&i.y>=this.Uu.maxHeight)&&this.dispose()}return this}Ds(){return this}dispose(){return this.$i||(this.Ts.bs(),this.$i=!0,this.qo(this),this.D.emit("dispose",this),this.$u().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.$u().forEach((e=>e.setVisible(t))),this.Ts.bs(),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setPosition(t){return this.position=t,this.Ts.bs(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),n=this.scale.pi(this.position,oi({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.pi(n,oi({x:(t.x+1)/2,y:(t.y+1)/2},s));const r=this.scale.pi(n,{x:this.Xt.left,y:this.Xt.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.pi(r,oi({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Ts.bs(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Nu=t,this.Ts.bs(),this}getDraggingMode(){return void 0!==this.Nu?this.Nu:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Wu=t,this}getMouseStyle(){return this.Wu}}class pr extends mr{constructor(t,e,i,s,n,r){super(t,e,i,n,r),this.Da=A(),this.ju=0,this.Ts=t,this.Zu=s,this.backgroundElement=new this.Zu(this.Ts,this.renderingScale,this.scale,wt,r),this.Ou(this.backgroundElement)}$u(){return this.backgroundElement.$u()}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}Fe(){return super.Fe(),this.$i||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).Fe(),this}Ds(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.Qu(t).Ds(),super.Ds()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.Da="object"==typeof t?S(this.Da,t):{left:t,top:t,right:t,bottom:t},this.Ts.bs(),this}getPadding(){return this.Da}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.Da.left+this.Da.right,i.y+this.Da.bottom+this.Da.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Ju()+this.backgroundElement.Ku(),i.y+this.backgroundElement.qu()+this.backgroundElement.tc())),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),n=this.getMargin(),r=this.scale.pi(s,{x:n.left,y:n.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.pi(r,oi({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.pi(r,{x:this.backgroundElement.Ju(),y:this.backgroundElement.qu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.pi(o,oi({x:(t.x+1)/2,y:(t.y+1)/2},i))}const a=this.getPadding(),h=this.scale.pi(o,{x:a.left,y:a.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.pi(h,oi({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.ju}setHighlight(t){return this.ju=Ae(t),this.backgroundElement.setHighlight(t),this.D.emit("highlight",this,t),this}}const yr=t=>"setBackground"in t;class Ar extends cr{constructor(t,e,i,s,n,r,o,a,h,l,u){super(),this.S=0,this.ic=1,this.sc=!0,this.hc=new sn,this.rc=!0,this.$i=!1,this.axisScale=s,this.renderingScale=n,this.nc=o,this.oc=a,this.ac=h,this.qo=l,this.lc=e,this.uc=i,this.cc=this.Ou(this.lc.Ve(this.renderingScale)),this.qi=u,this.dc=this.Ou(this.ac.fc(this.uc,this.renderingScale,r,wt,this.qi,!1).setOrigin(Ht(this.oc)).setDirection(this.oc)),this.axis=t,this.setMouseInteractions(!1),"major"===this.dc.Ac?this.cc.Ee(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.dc.Ac?this.cc.Ee(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.dc.Ac&&this.cc.Ee(u.cursorGridStrokeStyleX)}setValue(t){return this.S=t,this.uc.bs(),this.D.emit("valueChange",this,this.S),this}getValue(){return this.S}setTextFormatter(t){return this.gc=t,this.uc.bs(),this}setTickLength(t){return this.dc.setPointerLength(t),this.lc.bs(),this}getTickLength(){return this.dc.getPointerLength()}setTickLabelPadding(t){return this.dc.setTickLabelPadding(t),this.lc.bs(),this}setTickLabelRotation(t){return this.dc.setTextRotation(t),this.lc.bs(),this}getTickLabelRotation(){return this.dc.getTextRotation()}getTickLabelPadding(){return this.dc.getTickLabelPadding()}setGridStrokeLength(t){return this.ic=t,this.lc.bs(),this}getGridStrokeLength(){return this.ic}setGridStrokeStyle(t){return this.cc.Ee(t),this.lc.bs(),this}getGridStrokeStyle(){return this.cc.ku()}dispose(){return this.$i||(this.$i=!0,this.cc.dispose(),this.dc.dispose(),this.qo(this),this.lc.us.bs(),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setMarkerVisible(t){return this.sc=t,this.uc.bs(),this}getMarkerVisible(){return this.sc}setMarker(t){return t(this.dc),this.uc.bs(),this}getMarker(){return this.dc}setMouseInteractions(t){return this.dc.setMouseInteractions(t),this.cc.setMouseInteractions(t),this}getMouseInteractions(){return this.cc.getMouseInteractions()}setAllocatesAxisSpace(t){return this.rc=t,this.uc.bs(),this}getAllocatesAxisSpace(){return this.rc}isInScale(){return Ge(this.S,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}}class xr extends Ar{constructor(t,e,i,s,n,r,o,a,h,l,u){super(t,e,i,s,n,r,o,a,u,h,l),this.mc=!1,this.qo=h,this.lc=e,this.uc=i}dispose(){return this.mc=!1,super.dispose()}update(){return this}plot(t,e,i,s){if(this.isInScale()&&this.getVisible()){this.mc=!1;const n=lt(this.S,this.axisScale,this.nc.getWidth(this.renderingScale));this.cc.setVisible(!0).Oe(this.nc.toPoint(n,t)).ze(this.nc.toPoint(n,t-(i+e*this.ic))),this.sc?(this.gc&&this.dc.setText(this.gc(this.S,this)),this.dc.setVisible(!0).setPosition(this.nc.toPoint(n,s))):this.dc.setVisible(!1)}else this.cc.setVisible(!1),this.dc.setVisible(!1);return this.dc.Ds().Fe(),this}yc(){const t=this.dc.Ds().getSize();return this.nc.getHeight(t)}}const Sr=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),br=(t,e)=>(ae(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),vr=(t,e,i)=>{i&&yr(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},Mr={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}},Tr={background:void 0,setBackground(t){return{...this,background:t}}},wr={fc(t,e,i,s,n,r){const o=this.applyStylers(new this.uiElement(t,e,i,s,n),n);return vr(o,n,r),o}},Er={fc(t,e,i,s,n,r){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,n),n);return vr(o,n,r),o}};class kr extends mr{constructor(){super(...arguments),this.Sc=!0}Fe(){return super.Fe(),this}setMouseInteractions(t){return this.Sc=t,this}getMouseInteractions(){return this.Sc}$u(){return[]}}class Cr extends kr{onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}Qu(t){return this.size=t,this}Ju(){return 0}Ku(){return 0}tc(){return 0}qu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return V}setStrokeStyle(){return this}getStrokeStyle(){return nt}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Dr extends mr{constructor(){super(...arguments),this.D=new n.Eventer,this.ju=0}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}getHighlight(){return this.ju}setHighlight(t){return this.ju=t,this.$u().forEach((e=>e.cs(t))),this.D.emit("highlight",this,t),this.Ts.bs(),this}}class Ir extends Dr{}class _r extends Ir{constructor(t,e,i,s,n,r){super(t,e,i,n,r),this.Ts=t,this.el=this.Ts.vc(this.renderingScale,rr.Simple).setVisible(!1).ke(V).Ce(nt),this.Ou(this.el)}xc(){const t=this.bc();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=ni(t,si(e.min,-1));return this.scale.pi(this.position,ni(s,oi(si(ni(this.origin,u(1,1)),-.5),i)))})).map((t=>ut(t,this.scale,this.renderingScale)));this.el.Rl(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.el&&this.el.setVisible(!1),this.setContentSize(u(0,0))}Fe(){return super.Fe(),this.$i||this.xc(),this}Ds(){return this.xc(),super.Ds()}setVisible(t){return super.setVisible(t),this.el.setVisible(t),this}}const Fr=(t,e,i)=>t*(1-i)+e*i,Lr=(t,e,i,s,n)=>{if(void 0===e.value||void 0===i.value||void 0===s.value||void 0===n.value)return;const r=(t.x-i.point.x)/(n.point.x-i.point.x),o=(n.point.y-i.point.y)*r+i.point.y,a=(t.x-e.point.x)/(s.point.x-e.point.x),h=(s.point.y-e.point.y)*a+e.point.y,l=(t.y-h)/(o-h),u=Fr(i.value,n.value,r),c=Fr(e.value,s.value,a);return Fr(c,u,l)},zr={warm:t=>e=>E(60/(t-1)*e,.8,.8),cold:t=>e=>E(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>E(360/t*e,.8,.8),reverseSpectrum:t=>e=>E(360/t*(t-e),.8,.8),flatUI:t=>e=>E(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return E(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return E(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return E(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return E(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return E(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>E(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return E(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return E(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),E(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return E(0,0,s);const n=e.getR()/255,r=e.getG()/255,o=e.getB()/255,a=Math.max(n,r,o),h=Math.min(n,r,o);let l=0;if(a!==h){const t=a-h;switch(a){case n:l=(r-o)/t+(rn=>r=>E(t+(e-t)/n*r,i,s),auroraBorealis:t=>e=>Pr([{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=>Pr([{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=>Pr([{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=>Pr([{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=>Pr([{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=>Pr([{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)},Pr=(t,e,i)=>{const s=Vr(e,i),[n,r]=Br(s,t),o=Rr(t[n]),a=Rr(t[r]),h=0!==o.value?(a.value-s)/o.value:0,l={value:h,h:Fr(o.h,a.h,h),s:Fr(o.s,a.s,h),v:Fr(o.v,a.v,h)};return E(l.h,l.s,l.v)},Rr=t=>{const e=(t=>{const e=t.r,i=t.g,s=t.b,n=Math.max(e,i,s),r=Math.min(e,i,s);let o=0;const a=n,h=n-r,l=0===n?0:h/n;if(n===r)o=0;else{switch(n){case e:o=(i-s)/h+(i{const i=e/t;return i<0?0:i>1?1:i},Br=(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),$r={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},qr=s.Record({type:"linestyle",lineType:"dashed",pattern:$r.DashedEqual,fillStyle:new U({color:T(255,255,255)}),thickness:1,patternScale:3});class Jr extends qr{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")}V(){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 Kr=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),Zr=s.Record({type:"icon",width:void 0,height:void 0,Mc:void 0,_c:wt,wc:wt});class Qr extends Zr{constructor(t,e,i,s){super({...s,Mc:t,_c:e,wc:i})}dispose(){return this.wc(this),this}setWidth(t){const e=this.set("width",t);return this._c(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this._c(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this._c(i),i}oi(){if(!this.Mc)return{x:0,y:0};const t=this.Mc.width,e=this.Mc.height,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 to=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),eo=s.Record({type:"glow",color:T(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class io extends eo{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 so extends Dr{constructor(t,e,i,s,n){super(t,e,i,s,n),this._a="label",this.el=this.Ts.kr(this.renderingScale).Bh(this._a).ke(V),this.Ou(this.el)}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}Fe(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=ut(t,this.scale,this.renderingScale);return this.el.Ie(i),this}Ds(){this.el.Ds();const t=0===this._a.length?u(0,0):this.el.Cc();return this.setContentSize(t),super.Ds()}setText(t){return this._a=t,this.el.Bh(this._a),this.Ts.bs(),this}getText(){return this._a}setFont(t){return this.el.Vh(t),this.Ts.bs(),this}getFont(){return this.el.Eh()}setTextRotation(t){return this.el.zh(t),this.Ts.bs(),this}getTextRotation(){return this.el.Oh()}}const no={...Mr,...wr,uiElement:so};class ro extends Ir{constructor(t,e,i,s,n){super(t,e,i,s,n),this.kc=!1,this.fitTo=this.Qu.bind(this),this.setSize=this.fitTo,this.el=this.Ts.vc(e).ke(V).Ce(nt),this.Ou(this.el)}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}Fe(){const t=je([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>ut(t,this.scale,this.renderingScale))));return this.kc?this.el.Rl([{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.el.Rl([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Qu(t){return this.setContentSize(t),this.Ts.bs(),this}Ju(){return 0}Ku(){return 0}tc(){return 0}qu(){return 0}}class oo extends Ir{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Tc=u(0,0),this.el=t.Fc(e).vu(0).ze(360).ke(V).Ce(nt),this.Ou(this.el)}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}Fe(){const t=this.getSize(e.UISpace.Content).x/2;return this.el.bu(t*this.renderingScale.Wi().x).Mu(t*this.renderingScale.Wi().y).Ie(ut(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).wu(255).Ds(),this}Qu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.Tc=t,this.Ts.bs(),this}Ju(){return(this.getSize(e.UISpace.Content).x-this.Tc.x)/2}Ku(){return(this.getSize(e.UISpace.Content).x-this.Tc.x)/2}tc(){return(this.getSize(e.UISpace.Content).y-this.Tc.y)/2}qu(){return(this.getSize(e.UISpace.Content).y-this.Tc.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.Tc=t,this}}class ao extends _r{constructor(t,e,i,s,n){super(t,e,i,rr.Simple,s,n),this.Ic=y(u(0,0)),this.Pc=!1,this.Ts=t,this.xc()}bc(){const t=this.Ic._();if(this.Pc){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.Ic._().x*this.Ic._().x/4+this.Ic._().y*this.Ic._().y/4),i=u(Math.cos(Math.PI/4)*e,0),s=u(0,Math.sin(Math.PI/4)*e),n=u(0,0),r=ni(n,ni(i,s)),o=ni(r,ni(s,si(i,-1)));return[n,r,o,ri(o,ni(i,s))]}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}Qu(t){return this.Ic.M(t),this.Pc=!1,this.Ts.bs(),this}Ju(){return this.Pc?0:(this.getSize(e.UISpace.Content).x-this.Ic._().x)/2}Ku(){return this.Pc?0:(this.getSize(e.UISpace.Content).x-this.Ic._().x)/2}tc(){return this.Pc?0:(this.getSize(e.UISpace.Content).y-this.Ic._().y)/2}qu(){return this.Pc?0:(this.getSize(e.UISpace.Content).y-this.Ic._().y)/2}fitTo(t){return this.Ic.M(t),this.Pc=!0,this.Ts.bs(),this}}class ho extends _r{constructor(t,i,s,n,r){super(t,i,s,rr.Simple,n,r),this.Dc=y(u(0,0)),this.Bc=y(10),this.Lc=y(void 0),this.oc=y(e.UIDirections.Right),this.xc()}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}setDirection(t){return this.oc.M(t),this.Ts.bs(),this}getDirection(){return this.oc._()}setPointerLength(t){return this.Bc.M(t),this.Ts.bs(),this}getPointerLength(){return this.Bc._()}setPointerAngle(t){return this.Lc.M(t),this.Ts.bs(),this}getPointerAngle(){let t=this.Lc._();if(void 0===t){const e=this.Rc();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)}Qu(t){return this.Dc.M(t),this.Ts.bs(),this}Ec(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}Vc(){return Xt(this.oc._())?this.Dc._().x:this.Dc._().y}Rc(){return Xt(this.oc._())?this.Dc._().y:this.Dc._().x}Ju(){switch(this.oc._()){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.Ec()-this.Rc());default:return 0}}Ku(){switch(this.oc._()){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.Ec()-this.Rc());default:return 0}}tc(){switch(this.oc._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Ec()-this.Rc());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}qu(){switch(this.oc._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Ec()-this.Rc());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}bc(){const t=Ht(this.oc._()),e=ei(u(0,0),t),i=this.getPointerLength(),s=this.Ec(),n=this.Vc(),r=this.Rc();if(!(0!==i&&0!==s||0!==n&&0!==r))return[];const o=u(0,0),a=ni(ni(o,si(t,-i)),si(e,s/2)),h=ni(a,si(e,(r-s)/2)),l=ni(h,si(t,-n)),c=ni(ni(o,si(t,-i)),si(e,-s/2)),d=ni(c,si(e,-(r-s)/2)),f=ni(d,si(t,-n));let g;return g=0===n||0===r?[o,a,c]:0===i||0===s?[h,l,f,d]:Et(r,s)?[o,a,l,f,c]:[o,a,h,l,f,d,c],g}}class lo extends Dr{constructor(t,i,s,n,r){super(t,i,s,n,r),this.fitTo=this.Qu.bind(this),this.setSize=this.fitTo,this.zc=this.Ts.Oc(i).Sl(e.PointShape.Plus).ke(V),this.Ou(this.zc)}$u(){return[this.zc]}setShape(t){return this.zc.Sl(t),this}getShape(){return this.zc.vl()}setRotation(t){return this.zc.zh(t),this}getRotation(){return this.zc.Oh()}setFillStyle(t){return this.zc.ke(t),this.Ts.bs(),this}getFillStyle(){return this.zc.Lh()}Fe(){const t=ut(this.getPosition({x:0,y:0},e.UISpace.Content),this.scale,this.renderingScale),i=Math.max(this.size.x,this.size.y);return this.zc.Nt(),i>0&&this.zc.q(i)._l(t),this}Qu(t){return this.setContentSize(t),this.Ts.bs(),this}Ju(){return 0}Ku(){return 0}tc(){return 0}qu(){return 0}}class uo extends kr{setSize(t){return this.setContentSize(t),this.Ts.bs(),this}}class co extends pr{constructor(){super(...arguments),this.Nc=[],this.Gc=0,this.Wc=t=>{const e=this.Nc.indexOf(t);e>=0&&this.Nc.splice(e,1)}}getMembers(){return this.Nc}getMemberCount(){return this.Nc.length}setMinimumSize(t){return this.Uc=t,this.Ts.bs(),this}getMinimumSize(){return this.Uc}addElement(t,e=-1){const i=t.fc(this.Ts,this.renderingScale,this.scale,this.Wc,this.qi,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.Nc.splice(e,0,i):this.Nc.push(i),i.setVisible(this.getVisible()),this.Ou(i),this.$i&&(fe(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.Nc.slice().forEach(Tt),this}setVisible(t){return super.setVisible(t),this.Nc.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof uo)),0),s=i>0?(this.size.x-this.Gc)/i:0;return this.Nc.reduce(((e,i)=>i instanceof uo?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)).Fe().getPosition(u(1,0)).x),t.x),this}Ds(){for(let t=0;tt+ +(e instanceof uo)),0),s=i>0?(this.size.y-this.Gc)/i:0;return this.Nc.reduce(((e,i)=>i instanceof uo?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)).Fe().getPosition(u(0,-1)).y),t.y),this}Ds(){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},vo=bo("Text",[]),Mo={button:void 0,isLocked:!1,setOn(t){if(!this.isLocked){const e=this.button.getOn()!==t;this.button.setOn(t),e&&this.D.emit("switch",t)}return this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.D.on("switch",(e=>t(this,e)))},offSwitch(t){return this.D.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()}},To={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},wo={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()}},Eo={...Mr,...Tr,background:ro,fc(t,e,i,s,n,r){const o=new fo(t,e,i,this.background,s,n),a=o.addElement(no,void 0),h=Object.assign(o,So,{setTextLabel:a},vo,{stylableTexts:[a]});return vr(h,n,r),this.applyStylers(h,n)}}.addStyler(Sr),ko={...Mr,...Tr,background:ho,fc(t,i,s,n,r,o){const a=new fo(t,i,s,this.background,n,r),h=a.addElement(no,void 0),l=a.getBackground(),u=Object.assign(a,So,{setTextLabel:h},vo,{stylableTexts:[h]},wo,{pointable:l},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?this.setPadding({top:t}):this.getDirection()===e.UIDirections.Down?this.setPadding({bottom:t}):this.getDirection()===e.UIDirections.Right?this.setPadding({right:t}):this.getDirection()===e.UIDirections.Left&&this.setPadding({left:t}),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 u.Ac="other",u.setPointerLength(r.xAxisNumericTicks.majorTickStyle.getTickLength()).setTickLabelPadding(r.xAxisNumericTicks.majorTickStyle.getTickPadding()).setTextFont(r.uiTextFont).setTextFillStyle(r.uiTextFillStyle).setBackground((t=>t.setFillStyle(r.uiBackgroundFillStyle).setStrokeStyle(r.uiBackgroundStrokeStyle))),vr(u,r,o),this.applyStylers(u,r)}};class Co extends mr{constructor(t,e,i,s,r,o){super(t,e,i,r,o),this.Bs=!1,this.D=new n.Eventer,this.Hc=V,this.$c=V,this.getOn=()=>this.Bs,this.Xc=this.Ou(new lo(this.Ts,this.renderingScale,this.scale,wt,o).setShape(s)),this.$c=o.uiButtonFillStyleHidden||o.uiButtonFillStyle}$u(){return[...this.Xc.$u()]}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}setOn(t){return t===this.Bs||(this.Bs=t,this.Xc.setFillStyle(t?this.Hc:this.$c),this.Ts.bs()),this}setOffFillStyle(t){return this.$c="function"==typeof t?t(this.$c):t,this.Bs||this.Xc.setFillStyle(this.$c),this}getOffFillStyle(){return this.$c}setSize(t){return this.Xc.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.Xc.getSize()}setOnFillStyle(t){return this.Hc="function"==typeof t?t(this.Hc):t,this.Bs&&this.Xc.setFillStyle(this.Hc),this}getOnFillStyle(){return this.Hc}setButtonShape(t){return this.Xc.setShape(t),this.Ts.bs(),this}getButtonShape(){return this.Xc.getShape()}Fe(){return super.Fe(),this.Xc.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).Fe(),this}Ds(){const t=this.Xc.Ds().getSize();return this.setContentSize(t),super.Ds()}dispose(){return super.dispose(),this.Xc.dispose(),this}setMouseInteractions(t){return this.Xc.setMouseInteractions(t),this}getMouseInteractions(){return this.Xc.getMouseInteractions()}setHighlight(t){const e=Ae(t);return this.Xc.setHighlight(e),this.D.emit("highlight",this,t),this.Ts.bs(),this}getHighlight(){return this.Xc.getHighlight()}}const Do={...Mr,uiElement:Co,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},fc(t,e,i,s,n,r){const o=this.applyStylers(new this.uiElement(t,e,i,this.buttonShape,s,n),n);return vr(o,n,r),o}},Io={...Mr,...Tr,background:ro,buttonBuilder:Do,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},fc(t,i,s,n,r,o){const a=new fo(t,i,s,this.background,n,r),h=a.addElement(Ao);h.addGap();const l=h.addElement(this.buttonBuilder);h.addGap();const u=a.addElement(Ao);u.addGap();const c=u.addElement(no);u.addGap(),a.addGap();const d=Object.assign(a,So,{setTextLabel:c},vo,{stylableTexts:[c]},Mo,{button:l},To);let f;return d.onMouseClick(((t,e)=>{d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setTextFillStyleHidden(r.uiTextFillStyleHidden||r.uiTextFillStyle),d.onSwitch(((t,e)=>{e?f&&d.setTextFillStyle(f):(f=d.getTextFillStyle(),d.setTextFillStyle(d.getTextFillStyleHidden()))})),d.setPadding({left:6}),vr(d,r,o),this.applyStylers(d,r)}}.addStyler(Sr).addStyler(br);class _o extends mr{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.jc=[],this.Zc=2,this.Qc="",this.Jc=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:ki(t.value,e.min,e.max),this.Kc=0,this.qc=0,this.td=!1,this.Ts=t,this.sd=r,this.ed=this.Ou(t.Te(e).Ce(nt)),this.hd=this.Ou(t.kr(e).ke(n.uiTextFillStyle).Vh(n.uiTextFont).setMouseInteractions(!1)),"vertical"===r?(this.rd=140,this.nd=25):(this.rd=160,this.nd=15)}$u(){return[this.ed,this.hd]}od(t){this.ad=t;const e=zo(t,"vertical"===this.sd?0:90,this.td);return this.ed.ke(e),this.Ts.bs(),this}ld(){return this.ad}ud(t){return this.rd=t,this.Ts.bs(),this}dd(){return this.rd}fd(t){return this.nd=t,this.Ts.bs(),this}Ad(){return this.nd}gd(t){return this.Qc=t,this.Ts.bs(),this}pd(){return this.Qc}md(t){return this.Jc=t,this.Ts.bs(),this}setLUTDisplayProportionalSteps(t){if(this.td=t,this.ad){const t=zo(this.ad,"vertical"===this.sd?0:90,this.td);this.ed.ke(t)}return this.Ts.bs(),this}getLUTDisplayProportionalSteps(){return this.td}setFillStyle(t){return this.hd.ke(t),this.Ts.bs(),this}getFillStyle(){return this.hd.Lh()}setFont(t){return this.hd.Vh(t),this.Ts.bs(),this}getFont(){return this.hd.Eh()}setTextRotation(t){return this.qc=t,this.hd.zh(t),this.Ts.bs(),this}getTextRotation(){return this.hd.Oh()}Fe(){var t,i,s,n;if(super.Fe(),this.$i||!this.getVisible())return this;const r=this.ad;if(r){const o=this.renderingScale.Wi(),a=r.min,h=r.max;if("vertical"===this.sd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),n=ni(s,{x:this.ed.oi().x+this.Zc*o.x,y:0}),l={x:n.x,y:n.y+(this.Qc.length>0?this.Kc*o.y+this.hd.oi().y:0)+.5*((null===(t=this.jc[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.jc[this.jc.length-1])||void 0===i?void 0:i.oi().y)||0)};this.ed.Ie({x:s.x,y:l.y}),this.hd.Ja({x:-1,y:-1}).Ie(n),r.getSteps().forEach(((t,e)=>{const i=He(l,u,this.td?!0===r.getInterpolation()?(t.value-a)/(h-a):.9*(t.value-a)/(h-a):!0===r.getInterpolation()?e/(r.getSteps().length-1):e/r.getSteps().length);this.jc[e].Ja({x:-1,y:0}).Ie(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.jc.reduce(((t,e)=>Math.max(t,e.oi().y)),0),u=ni(t,{x:.5*((null===(s=this.jc[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===(n=this.jc[this.jc.length-1])||void 0===n?void 0:n.oi().x)||0)+(this.Qc.length>0?this.Kc*o.x+this.hd.oi().x:0)),y:u.y},f={x:u.x,y:u.y+this.Zc*o.y};this.ed.Ie(f),this.hd.Ja({x:1,y:1}).Ie(c),r.getSteps().forEach(((t,e)=>{const i=He(u,d,this.td?!0===r.getInterpolation()?(t.value-a)/(h-a):.9*(t.value-a)/(h-a):!0===r.getInterpolation()?e/(r.getSteps().length-1):e/r.getSteps().length);this.jc[e].Ja({x:0,y:1}).Ie(i)}))}}return this}Ds(){if(this.ad&&this.getVisible()){const t=this.ad.getSteps();for(let e=this.jc.length;eMath.max(t,e.Ds().Cc().x)),0),this.hd.Ds().Cc().x),s=(this.Qc.length>0?this.Kc+this.hd.Ds().Cc().y:0)+e+.5*this.jc[0].Ds().Cc().y+.5*this.jc[this.jc.length-1].Ds().Cc().y;this.setContentSize({x:i,y:s})}else{const t=this.rd,e=this.nd;this.ed.q({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Qc.length>0?this.Kc+this.hd.Ds().Cc().x:0,.5*this.jc[this.jc.length-1].Ds().Cc().x),s=t+.5*this.jc[0].Ds().Cc().x+i,n=e+this.Zc+this.jc.reduce(((t,e)=>Math.max(t,e.Ds().Cc().y)),0);this.setContentSize({x:s,y:n})}}else this.jc.forEach((t=>t.dispose())),this.jc.length=0,this.hd.setVisible(!1),this.ed.setVisible(!1),this.setContentSize({x:0,y:0});return super.Ds()}dispose(){return super.dispose(),this.ed.dispose(),this.jc.forEach(Tt),this.hd.dispose(),this}setMouseInteractions(t){return this.ed.setMouseInteractions(t),this}getMouseInteractions(){return this.ed.getMouseInteractions()}}const Fo={lutElement:{},setLUT(t){return this.lutElement.od(t),this},getLUT(){return this.lutElement.ld()},setLUTLength(t){return this.lutElement.ud(t),this},getLUTLength(){return this.lutElement.dd()},setLUTThickness(t){return this.lutElement.fd(t),this},getLUTThickness(){return this.lutElement.Ad()},setLookUpUnit(t){return this.lutElement.gd(t),this},getLookUpUnit(){return this.lutElement.pd()},setLUTStepValueFormatter(t){return this.lutElement.md(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},Lo={...Mr,...Tr,background:ro,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},fc(t,e,i,s,n,r){const o=new go(t,e,i,this.background,s,n),a=o.addElement({fc:()=>new _o(t,e,i,wt,n,this.alignment)}),h=Object.assign(o,vo,{stylableTexts:[a]},Fo,{lutElement:a});return vr(h,n,r),this.applyStylers(h,n)}}.addStyler(Sr),zo=(t,e,i)=>{const s=t.getSteps(),n=t.min,r=t.max-n;if(!0===t.getInterpolation())return new et({angle:e,stops:s.map(((e,o)=>({offset:i?(e.value-n)/r:o/(s.length-1),color:e.color||t.color})))});const o=[];for(let e=0;enew _o(t,i,s,wt,r,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:r.uiButtonSize+6});const f=Object.assign(o,So,{setTextLabel:c},vo,{stylableTexts:[c,d]},bo("LUTText",[d]),Mo,{button:l},Fo,{lutElement:d},To);let g;return f.onMouseClick((()=>{f.setOn(!f.getOn())})),f.onMouseEnter((()=>f.setHighlight(!0))),f.onMouseLeave((()=>f.setHighlight(!1))),f.setMouseStyle(e.MouseStyles.Point),f.setTextFillStyleHidden(r.uiTextFillStyleHidden||r.uiTextFillStyle),f.onSwitch(((t,e)=>{e?g&&f.setTextFillStyle(g):(g=f.getTextFillStyle(),f.setTextFillStyle(f.getTextFillStyleHidden()))})),f.setPadding({left:6}),this.applyStylers(f,r)}}.addStyler(Sr).addStyler(br),Ro={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,n=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return this.legendBoxDisposed()||(t instanceof Ga?this.addChart(t,i,n,s):"attach"in t?this.addAttachable(t,i,n,s):t&&this.addDashboard(t,i,n,s)),this},addAttachable(t,e,i,s){const n=t.ld&&t.ld(),r=t.yd&&t.yd(),o=void 0!==s&&s;let a=i;if(!a){let t=n?Po.setAlignment(this.alignment):Io;void 0!==r&&(t=t.setButtonShape(r)),a=t}const h=this.addElement(a);if(n&&"setLUT"in h){h.setLUT(n.lut);const t=n.lut.getUnits(),e=n.lookUpProperty,i=t.length>0?t:"x"===e?"x":"y"===e?"y":"z"===e?"z":"";h.setLookUpUnit(i)}return this.entryStylers.forEach((t=>t(h))),this.entries.push({entry:h,component:t}),t.attach(h,e,o),this},addChart(t,e,i,s){return t.Sd().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof Ga)).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}},Vo={alignment:"vertical",layoutBuilder:Ao,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?xo:Ao}},getAlignment(){return this.alignment},titleBuilder:Eo,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},Bo={...Mr,...Tr,...Vo,background:ro,fc(t,e,i,s,n,r){const o=this.layoutBuilder.setBackground(this.background).fc(t,e,i,s,n,!1);let a=Object.assign(o,Ro,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.$i});a.entries=[];const h=a.addElement("horizontal"===this.alignment?Ao:xo),l=h.addElement(this.titleBuilder).setText("Legend").setTextFillStyle(n.legendTitleFillStyle).setTextFont(n.legendTitleFont);return h.addGap(),a=Object.assign(a,{title:l}),"horizontal"===this.alignment&&l.setMargin({right:6}),vr(a,n,r),this.applyStylers(a,n)}}.addStyler(((t,e)=>t.setPadding(5)));class Oo extends mr{constructor(t,i,s,n,r){super(t,i,s,n,r),this.vd=10,this.xd=e.UIDirections.Up,this.bd=0,this.Ac="major",this._a=this.Ou(t.kr(this.renderingScale)),this.Re=this.Ou(t.Ve(this.renderingScale))}$u(){return[this._a]}Fe(){if(super.Fe(),this.$i)return this;const t=ut(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.pi(t,{x:this.xd===e.UIDirections.Right?-this.vd:this.xd===e.UIDirections.Left?this.vd:0,y:this.xd===e.UIDirections.Up?-this.vd:this.xd===e.UIDirections.Down?this.vd:0}),s=this.renderingScale.pi(i,{x:this.xd===e.UIDirections.Right?-this.bd:this.xd===e.UIDirections.Left?this.bd:0,y:this.xd===e.UIDirections.Up?-this.bd:this.xd===e.UIDirections.Down?this.bd:0});return this.Re.Oe(t).ze(i),this._a.Ie(s).Ja(this.xd===e.UIDirections.Up?{x:0,y:1}:this.xd===e.UIDirections.Down?{x:0,y:-1}:this.xd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Ds(){const t=this.Re.ku().getThickness();return this.size=this.xd===e.UIDirections.Left||this.xd===e.UIDirections.Right?{x:this.vd+this.bd+this._a.Ds().Cc().x,y:t}:{y:this.vd+this.bd+this._a.Ds().Cc().y,x:t},super.Ds()}dispose(){return super.dispose(),this._a.dispose(),this.Re.dispose(),this}setVisible(t){return super.setVisible(t),this._a.setVisible(t),this.Re.setVisible(t),this}setMouseInteractions(t){return this._a.setMouseInteractions(t),this.Re.setMouseInteractions(t),this}getMouseInteractions(){return this._a.getMouseInteractions()}getText(){return this._a.Ph()}setTextFillStyle(t){return this._a.ke(t),this.Ts.bs(),this}getTextFillStyle(){return this._a.Lh()}setTextFont(t){return this._a.Vh(t),this}setTextRotation(t){return this._a.zh(t),this}getTextRotation(){return this._a.Oh()}getTextFont(){return this._a.Eh()}setText(t){return this._a.Bh(t),this.Ts.bs(),this}setDirection(t){return this.xd=t,this.Ts.bs(),this}getDirection(){return this.xd}setPointerLength(t){return this.vd=t,this.Ts.bs(),this}getPointerLength(){return this.vd}setTickLabelPadding(t){return this.bd=t,this.Ts.bs(),this}getTickLabelPadding(){return this.bd}setTickStyle(t){return this.Re.Ee(t),this.Ts.bs(),this}getTickStyle(){return this.Re.ku()}}const No={...Mr,fc(t,e,i,s,n,r){const o=new Oo(t,e,i,s,n);return vr(o,n,r),this.applyStylers(o,n)}}.addStyler(Sr),Uo=No.addStyler(((t,e)=>(t.Ac="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)))),Go=No.addStyler(((t,e)=>(t.Ac="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)))),Wo=Io.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),Yo=Bo.setAlignment("horizontal"),Ho=Bo.setAlignment("vertical"),Xo={TextBox:Eo,CheckBox:Io,ButtonBox:Wo,PointableTextBox:ko,AxisTickMajor:Uo,AxisTickMinor:Go,LUTRange:Lo},jo={HorizontalLegendBox:Yo,VerticalLegendBox:Ho},$o=(t,e)=>{if(Vi(t)){const i=e.$o(t);return{x:i.engineX,y:i.engineY}}return t},qo=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}},Jo=(t,e,i,s=1)=>kt(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),Ko=(t,e,i,s=1)=>{const n=i.ct(t),r=i.ct(e);return kt(i.ut(n+.1*s*(r-n)+.5*s*Math.sign(r-n)),t,e)};class Zo extends Js{constructor(t,e,i,s,n,r,o){super(t,e,i,s,o),this.Md=n,this._d=r}}class Qo extends qs{constructor(t,i,s,r,o,a,h,l,c,d,f,g,m,p,y,A,x){var S;super(f,d,l,y,A,{numeric:d.getWidth({x:y.xAxisNumericTicks,y:y.yAxisNumericTicks}),datetime:d.getWidth({x:y.xAxisDateTimeTicks,y:y.yAxisDateTimeTicks}),time:d.getWidth({x:y.xAxisTimeTicks,y:y.yAxisTimeTicks})},x),this.wd=new Map,this.Cd=void 0,this.kd=0,this.Td=[],this.Fd=[],this.Je=Rs.fitting,this.Id=!0,this.Pd=0,this.Dd=8,this.Bd=void 0,this.Ld=void 0,this.Rd=20,this.Ed=1,this.Vd=!0,this.zd=!0,this.Od=!0,this.Nd=!0,this.Gd=!0,this.Wd=!0,this.Ud=!0,this.Yd=!0,this.Hd=!0,this.$d=!0,this.Xd=this.Mh.defaultDragMouseStyle,this.jd=this.Mh.defaultDragMouseStyle,this.Zd=this.Mh.defaultDragMouseStyle,this.Qd=this.Mh.defaultDragMouseStyle,this.Jd=this.Mh.defaultDragMouseStyle,this.D=new n.Eventer,this.Kd=[],this.qd=t=>{const e=this.Fd.indexOf(t);e>=0&&this.Fd.splice(e,1)},this.tf=t=>(this.Fd.indexOf(t)<0&&this.Fd.push(t),this.qd),this.Et=(t,e)=>this.D.emit("axisAreaTouch",this,e),this.if=Kt(this.Kd),this.onAxisInteractionAreaMouseClick=t=>this.D.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.D.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.D.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.D.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.D.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.D.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.D.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.D.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.D.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.D.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.D.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.D.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.D.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.D.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.D.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.D.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.D.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.D.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.D.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.D.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.D.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.D.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.D.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.D.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.D.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.D.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.D.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.D.off(t,"axisAreaTouchEnd"),this.sf=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().yc()):t,this.ef=t=>{const e=this.Td.indexOf(t);-1!==e&&this.Td.splice(e,1)},this.hf=(t,e)=>{this.D.emit("axisAreaDoubleClick",this,e),this.Nd&&(this.setStopped(!1),jt(e))},this.rf=t=>{this.D.emit("axisAreaMouseEnter",this),(this.zd||this.Vd||this.Od||this.Nd)&&this.nf(t)},this.af=t=>{this.lf(t),this.D.emit("axisAreaMouseLeave",this)},this.uf=(t,e,i)=>{var s,n;this.D.emit("axisAreaMouseDragStart",this,e,i);const r=Dt(null===(s=this.chart.fs.no)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Dt(null===(n=this.chart.fs.no)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===o&&this.zd?(this.cf(t),jt(e)):i===r&&this.Vd&&(this.df(t,a),jt(e))},this.ff=(t,e,i,s,n)=>{var r,o;this.D.emit("axisAreaMouseDrag",this,e,i,s,n);const a=Dt(null===(r=this.chart.fs.no)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Dt(null===(o=this.chart.fs.no)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===h&&this.zd?(this.Af(t,n),jt(e)):i===a&&this.Vd&&(this.gf(t,s,l,n),jt(e))},this.pf=(t,e,i,s)=>{var n,r;this.D.emit("axisAreaMouseDragStop",this,e,i,s);const o=Dt(null===(n=this.chart.fs.no)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Dt(null===(r=this.chart.fs.no)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===a&&this.zd?(this.mf(t),jt(e)):i===o&&this.Vd&&(this.yf(t,s,h),jt(e)),t.getIsUnderMouse()&&(this.zd||this.Vd||this.Od||this.Nd)&&this.nf(t)},this.Sf=(t,e)=>{if(this.D.emit("axisAreaMouseWheel",this,e),this.Od){this.setStopped(!0);const t=this.Mh.getWidth(this.vf.us.De(e.clientX,e.clientY)),i=this.dt.ut(t);this.zoom(i,de(e)),jt(e)}},this.xf=(t,e)=>this.D.emit("axisAreaMouseClick",this,e),this.bf=(t,e)=>this.D.emit("axisAreaMouseDown",this,e),this.Mf=(t,e)=>this.D.emit("axisAreaMouseUp",this,e),this._f=(t,e)=>this.D.emit("axisAreaMouseMove",this,e),this.wf=(t,e,i)=>{this.D.emit("axisAreaTouchStart",this,i),this.Vd&&(this.nf(t),this.df(t,e),jt(i))},this.Cf=(t,e,i,s,n)=>{this.D.emit("axisAreaTouch",this,n),this.Vd&&(this.gf(t,e,i,s),jt(n))},this.kf=(t,e,i,s)=>{this.D.emit("axisAreaTouchEnd",this,s),this.Vd&&(this.yf(t,e,i),this.lf(t),jt(s))},this.Tf=(t,e,i,s)=>{(this.zd||this.Od)&&(this.nf(t),this.cf(t),jt(s))},this.Ff=(t,e,i,s,n,r)=>{if(this.zd){const e=u((s.x+n.x)/2,(s.y+n.y)/2);this.Af(t,e),jt(r)}if(this.Od){const t=this.vf.us.De(e.x,e.y),o=this.vf.us.De(i.x,i.y),a=Math.abs(this.Mh.getWidth(ri(t,s))-this.Mh.getWidth(ri(o,n)))-Math.abs(this.Mh.getWidth(t)-this.Mh.getWidth(o)),h=this.dt.pi(this.Th,-a),l=this.dt.pi(this.Fh,a);this.jh(h,l,!0),jt(r)}},this.If=(t,e,i,s)=>{(this.zd||this.Od)&&(this.mf(t),this.lf(t),jt(s))},this.Pf=(t,e)=>{(this.Gd||this.Wd)&&this.Df(t)},this.Bf=(t,e)=>{this.Lf(t)},this.Rf=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Gd&&this.Ef(t,s)},this.Vf=(t,e,i,s,n)=>{const r=u(e.clientX,e.clientY);this.Gd&&this.zf(t,r,s,n)},this.Of=(t,e,i,s,n)=>{const r=u(e.clientX,e.clientY);this.Gd&&this.Nf(t,r,s,n)},this.Gf=(t,e,i,s)=>{const n=u(e.clientX,e.clientY);(this.Gd||this.Wd)&&this.Wf(t,n,s),(this.Gd||this.Wd)&&this.Df(t)},this.Uf=(t,e)=>{this.Wd&&(this.setStopped(!0),this.zoom(this.Th,de(e)),jt(e))},this.Yf=(t,e)=>{this.Wd&&(this.setStopped(!0),this.zoom(this.Fh,de(e)),jt(e))},this.Hf=(t,e,i)=>{this.Gd&&(this.Df(t),this.Ef(t,e),jt(i))},this.$f=(t,e,i,s,n)=>{this.Gd&&(this.zf(t,e,i,s),jt(n))},this.Xf=(t,e,i,s,n)=>{this.Gd&&(this.Nf(t,e,i,s),jt(n))},this.jf=(t,e,i,s)=>{this.Gd&&(this.Wf(t,e,i),this.Lf(t),jt(s))},this.Md=t,this.Zf=i,this.vf=s,this.Qf=o,this.Jf=a,this.chart=f,this.Kf=m,this.qf=r,this.ss=h,"logarithmic"!==x.type||this.chart.fs.Vn||this.chart.fs.zn||this.chart.fs.eo||this.chart.us.As(St.atob("bG9nIGF4aXM=")),p(this,this.tf),l.tA=this,this.iA=g,this.sA=this.iA>50?1:-1,this.eA=(S=this.Mh.toPoint(0,-this.sA),Math.abs(S.x)>=Math.abs(S.y)?S.x>=0?e.UIDirections.Right:e.UIDirections.Left:S.y>=0?e.UIDirections.Up:e.UIDirections.Down),this.hA=c,this.rA=this.dt instanceof Ii?(new Li).Ri(this.Mh.toVec2(this.dt,this.hA)):(new zi).Ri(this.Mh.toVec2(this.dt,this.hA)),this.nA=this.chart.pixelScale,this.oA=(new Li).Ri(this.Mh.toVec2(this.Mh.getWidth(this.nA),this.hA)),this.aA=this.vf.Ve(this.rA).setMouseInteractions(!1),this.lA=this.vf.Ve(this.rA).setMouseInteractions(!1),this.uA=this.vf.Ve(this.rA).setMouseInteractions(!1),this.cA=this.qf.Te(this.nA).ke(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(nt).aa(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.dA=this.qf.Te(this.nA).ke(d.getWidth({x:y.xAxisZoomingBandFillStyle,y:y.yAxisZoomingBandFillStyle})).Ce(d.getWidth({x:y.xAxisZoomingBandStrokeStyle,y:y.yAxisZoomingBandStrokeStyle})),this.fA=this.qf.Te(this.nA).ke(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(nt).aa(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.AA=this.qf.Te(this.nA).ke(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(nt).aa(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.Dh=this.qf.kr(this.rA).setMouseInteractions(!1).zh(this.Mh.getTitleTextRotation(this.sA)),this.chart.us.ls.os(this.cA,(t=>this.cA.cs(t)),{animationEnabled:this.th}),this.chart.us.ls.os(this.fA,(t=>this.fA.cs(t)),{animationEnabled:this.th}),this.chart.us.ls.os(this.AA,(t=>this.AA.cs(t)),{animationEnabled:this.th});const b=Yi(new Xi(this.wf,this.Cf,this.kf,1),new ji(this.Tf,this.Ff,this.If),new Hi(this.hf)),v=Yi(new Xi(this.Hf,this.$f,this.jf)),M=Yi(new Xi(this.Hf,this.Xf,this.jf));this.cA.setMouseEnterEventHandler(this.rf).setMouseLeaveEventHandler(this.af).setMouseDragStartEventHandler(this.uf).setMouseDragEventHandler(this.ff).setMouseDragStopEventHandler(this.pf).setMouseWheelEventHandler(this.Sf).setMouseDoubleClickEventHandler(this.hf).setMouseClickEventHandler(this.xf).setMouseDownEventHandler(this.bf).setMouseUpEventHandler(this.Mf).setMouseMoveEventHandler(this._f).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.fA.setMouseEnterEventHandler(this.Pf).setMouseLeaveEventHandler(this.Bf).setMouseDragStartEventHandler(this.Rf).setMouseDragEventHandler(this.Vf).setMouseDragStopEventHandler(this.Gf).setMouseWheelEventHandler(this.Uf).setTouchStartEventHandler(v.onTouchStart).setTouchMoveEventHandler(v.onTouchMove).setTouchEndEventHandler(v.onTouchEnd),this.AA.setMouseEnterEventHandler(this.Pf).setMouseLeaveEventHandler(this.Bf).setMouseDragStartEventHandler(this.Rf).setMouseDragEventHandler(this.Of).setMouseDragStopEventHandler(this.Gf).setMouseWheelEventHandler(this.Yf).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.aA.Ee(d.getWidth({x:y.xAxisStrokeStyle,y:y.yAxisStrokeStyle})),this.lA.Ee(d.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.uA.Ee(d.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.Dh.ke(d.getWidth({x:y.xAxisTitleFillStyle,y:y.yAxisTitleFillStyle})).Vh(d.getWidth({x:y.xAxisTitleFont,y:y.yAxisTitleFont})),this.es=h.hs(this,{}),this.Nh=this.es.gA([this.Dh]).xs(y.effectsText)}wr(){return this.eh}Cr(){return void 0!==this.Xh}setTickStrategy(t,e){return super.kh(t,e)}getTickStrategy(){return this.je}addBand(t=!0){const e=t?this.Jf:this.Qf,i=new zs(e,this.chart,this.if,this,this.rA,this.Mh,this.qi,this.ss);return this.Kd.push(i),i}addConstantLine(t=!0){const e=t?this.Jf:this.Qf,i=new Ps(e,this.chart,this.if,this,this.rA,this.Mh,this.qi,this.ss);return this.Kd.push(i),i}pA(t){this.Kd.forEach(t)}mA(t){return this.Kd.map(t)}getHighlighters(){return this.Kd}setThickness(t){return"number"==typeof t?(this.yA=t,this.SA=t):"object"==typeof t&&(this.yA=t.min,this.SA=t.max),this.Md.bs(),this}getThickness(){return{min:this.yA,max:this.SA}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}vA(){return this.Fd}ar(t,e){return new Zo(e,t,this.vf,this.rA,this.Md,this.rA)}Gh(){if(this.wd){for(const t of this.wd)t[1].grid.dispose(),t[1].tick.dispose();this.wd.clear()}super.Gh()}lr(t,e){const{tickStart:i}=e,s=t.Sh.nr,n=i+s.getTickLength()*this.sA+s.getTickPadding()*this.sA;t.Ye.Ie(this.Mh.toPoint(t.S,n)).Ja(this.Mh.toPoint(s.getLabelAlignment(),-this.sA)).zh(s.labelRotation).setVisible(this.getVisible())}xA(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:n,tickStart:r}=e,o=t.Sh.nr,a=i-s*o.getGridStrokeLength(),h=r+o.getTickLength()*this.sA;return{gridStroke:{start:this.Mh.toPoint(t.S,n),end:this.Mh.toPoint(t.S,a)},tickStroke:{start:this.Mh.toPoint(t.S,r),end:this.Mh.toPoint(t.S,h)}}}bA(t,e,i,s){return this.Md.Ve(this.rA).Ee(new qi({fillStyle:new U({color:E(360*(1-s))}),thickness:5})).Oe(this.Mh.toVec2(t,0)).ze(this.Mh.toVec2(t,this.sA*(50*s)))}br(t,e){return"linear"===this.wh.type?Jo(t,e,this.dt):Ko(t,e,this.dt)}MA(t,e){return e instanceof Ii?Jo:Ko}_r(t,e,i){if("logarithmic"!==this.wh.type){const s=this.dt.Li(e-t);return{min:t-i*s,max:e+i*s}}const s=this.dt;return{min:s.pi(t,-i),max:s.pi(e,i)}}Fe(t,e,i){const s=this.aA.ku(),n=this.dt.getInnerStart()this.dt.getInnerStart()?this.dt.getInnerEnd():this.dt.getInnerStart(),o=this.dt.ri(),a=this.hA.getInnerInterval(),h=s.getThickness()*this.sA/2,l=this.iA/100*a,u=l+t,c=a*this.sA,d=u+h,f=this.Td.reduce(this.sf,0);let g,m=0;if(this.Xi||this.Gh(),this.Xe!==Ns&&this.Xi){const t=this.dt.ri();this.Jh({physicalAxisSize:t,startPosition:l,gridStrokeLen:c,gridStrokeStart:u,tickStart:d});for(const[e,i]of this.Ze){let s=this.wd.get(e);if(!s)if(e.Ne)s={grid:this.Md._A(this.rA).setMouseInteractions(!1),tick:this.Md._A(this.rA).setMouseInteractions(!1)};else if("wA"in e){const t=Array.from(this.Ze.keys()).filter((t=>"wA"in t)).reverse().indexOf(e),i=this.Zf[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._A(this.rA).setMouseInteractions(!1),tick:i._A(this.rA).setMouseInteractions(!1)}}if(s){s.grid.Nt(),s.tick.Nt();for(const[e,n]of i){const e=this.xA(n,{physicalAxisSize:t,startPosition:l,gridStrokeLen:c,gridStrokeStart:u,tickStart:d});s.grid.Lr().CA(e.gridStroke.start,e.gridStroke.end),s.tick.Lr().CA(e.tickStroke.start,e.tickStroke.end)}s.grid.Ee(e.nr.getGridStrokeStyle()),s.tick.Ee(e.nr.getTickStyle()),this.wd.set(e,s)}}for(const t of this.Ze.values()){let e=Fe;for(const i of t.values()){const t=i.Sh.nr,s=this.Mh.getHeight(i.Ye.oi()),n=t.getTickLength()+t.getTickPadding()+s+t.getLabelPadding();e=Math.max(e,n)}m=Math.max(m,e)}g=d+Math.max(m,f)*this.sA}else m=0,g=d+f*this.sA;this.aA.Oe(this.Mh.toPoint(n,u)).ze(this.Mh.toPoint(r,u)),this.lA.Oe(this.Mh.toPoint(this.dt.pi(this.dt.getInnerStart(),this.Dd),u)).ze(this.Mh.toPoint(this.dt.getInnerStart(),u)),this.uA.Oe(this.Mh.toPoint(this.dt.pi(this.dt.getInnerEnd(),-this.Dd),u)).ze(this.Mh.toPoint(this.dt.getInnerEnd(),u));const p=this.Dh&&this.Dh.Ph().length>0?this.Mh.getHeight(this.Dh.Ds().oi()):0,y=g+.5*p*this.sA;this.Dh.Ie(this.Mh.toPoint(this.dt.pi(this.dt.getInnerStart(),o/2),y));const A=d,x=A+this.sA*this.kd,S=this.Gd||this.Wd?Math.min(this.Rd,.25*o):0,b={start:this.Mh.toVec2(this.dt.pi(this.dt.getInnerStart(),S),A),end:this.Mh.toVec2(this.dt.pi(this.dt.getInnerEnd(),-S),x)};if(this.Cd){const e=this.iA/100*a+t,i=-this.sA*a-t,s={start:this.Mh.toVec2(this.Cd.min,d+this.sA*this.kd),end:this.Mh.toVec2(this.Cd.max,e+i)},n=ut(s.start,this.rA,this.nA),r=ut(s.end,this.rA,this.nA);this.dA.Ie(n).q(ri(r,n)).setVisible(!0)}else this.dA.setVisible(!1);const v=ut(this.Mh.toVec2(this.dt.getInnerStart(),x),this.rA,this.nA),M=ut(b.start,this.rA,this.nA),T=ut(b.end,this.rA,this.nA),w=ut(this.Mh.toVec2(this.dt.getInnerEnd(),A),this.rA,this.nA);this.cA.Ie(M).q(ri(T,M)),this.fA.Ie(v).q(ri(M,v)),this.AA.Ie(T).q(ri(w,T));for(const e of this.Td)e.update().plot(u,c,t,d);for(const t of this.Kd)t.Fe();const E=s.getThickness()+Math.max(m,f)+(this.Dh&&this.Dh.Ph().length>0?p+this.Pd:0);return this.kd=this.Xi?kt(E,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:_e):0,this}kA(t){const e=this.aA.ku().getThickness()*this.sA/2,i=this.hA.getInnerInterval(),s=this.iA/100*i+t,n=s+e,r=i*this.sA,o=n+e;for(const e of this.Td)e.update().plot(s,r,t,o);for(const t of this.Kd)t.Fe()}TA(){return this.kd}FA(t,e){e=e||Xo.AxisTickMajor;const i=new xr(this,t?this.Md:this.qf,this.qf,this.dt,this.oA,this.oA,this.Mh,this.eA,this.ef,this.qi,e).setTextFormatter(this.formatValue);return this.Td.push(i),i}nf(t){this.chart.us.ls.ws(t,1),this.Bd=t.us.Er(this.Xd,this.Bd)}lf(t){this.chart.us.ls.ws(t,0),t.us.Vr(this.Bd)}cf(t){this.setStopped(!0),t.us.Vr(this.Bd)}Af(t,e){const i=-this.Mh.getWidth(e);this.pan(i),this.Bd=t.us.Er(this.jd,this.Bd)}pan(t){const e=this.Th,i=this.Fh,s=this.dt.pi(e,t),n=this.dt.pi(i,t);this.jh(s,n,!1)}zoom(t,e){const i=this.dt.ct(this.Th),s=this.dt.ct(this.Fh),n=this.dt.ct(t),r=kt((n-i)/(s-i),0,1),o=.2*this.dt.ri(),a=r*this.Ed*o*-e,h=(1-r)*this.Ed*o*e,l=this.dt.pi(this.Th,a),u=this.dt.pi(this.Fh,h);this.jh(l,u,!0)}mf(t){this.Cd=void 0,t.us.Vr(this.Bd)}df(t,e){this.setStopped(!0),t.us.Vr(this.Bd),this.chart.us.ls.ws(this.cA,0)}gf(t,e,i,s){const n=ut(this.vf.us.De(i.x,i.y),this.vf.us.dt,this.rA),r=kt(this.Mh.getWidth(n),this.Th,this.Fh),o=this.Mh.getWidth(ut(this.vf.us.De(e.x,e.y),this.vf.us.dt,this.rA));Math.abs(this.dt.ct(r)-this.dt.ct(o))>10?(this.Cd=m(Math.min(r,o),Math.max(r,o)),this.Bd=t.us.Er(this.Zd,this.Bd)):(this.Cd=void 0,this.Bd=t.us.Er(this.Xd,this.Bd)),this.vf.bs()}yf(t,e,i){if(this.Cd){const t=this.Cd.min,e=this.Cd.max,i=this.Fh{e.vs(t)}));for(const e of this.wd.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.Md.bs(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.th),this}}const ta={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},ea={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},ia=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof Qo&&"y"in t&&t.y instanceof Qo),sa=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new qi,tickLength:7,tickStyle:new qi,tickPadding:0,labelFont:new sn,labelFillStyle:new U,labelPadding:0,labelAlignment:0,labelRotation:0});class na extends sa{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")}setLabelPadding(t){return this.set("labelPadding",t)}getLabelPadding(){return this.get("labelPadding")}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 ra=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),oa=new na({labelFillStyle:V,gridStrokeStyle:nt,tickStyle:nt}),aa=t=>ra(t)&&B(t.labelFillStyle)&&rt(t.gridStrokeStyle)&&rt(t.tickStyle),ha=(t,e,i,s,n)=>(r,o)=>a=>{const h=new Date(a+r),l={year:o?h.getUTCFullYear():h.getFullYear(),monthIndex:o?h.getUTCMonth():h.getMonth(),day:o?h.getUTCDate():h.getDate(),hours:o?h.getUTCHours():h.getHours(),minutes:o?h.getUTCMinutes():h.getMinutes(),seconds:o?h.getUTCSeconds():h.getSeconds(),millis:o?h.getUTCMilliseconds():h.getMilliseconds()},u=s?s(l):void 0;if(0===t&&!0===u)return a;const c=l[e];n.includes("year")&&(l.year=Math.floor(l.year/i)*i),n.includes("monthIndex")&&(l.monthIndex=0),n.includes("day")&&(l.day=1),n.includes("hours")&&(l.hours=0),n.includes("minutes")&&(l.minutes=0),n.includes("seconds")&&(l.seconds=0),n.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)-r:new Date(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis).getTime()-r},la=(t,e,i,...s)=>ha(-1,t,e,i,s),ua=(t,e,i,...s)=>ha(-1,t,e,i,s),ca=(t,e,i,...s)=>ha(0,t,e,i,s),da=(t,e,...i)=>ha(1,t,e,void 0,i),fa=t=>(e,i)=>s=>{const n=new Date(s+e),r=i?n.getUTCDay():n.getDay(),o=1===r&&0===(i?n.getUTCHours():n.getHours())&&0===(i?n.getUTCMinutes():n.getMinutes())&&0===n.getSeconds()&&0===n.getMilliseconds();if(0===t&&!0===o)return s;let a=i?n.getUTCDate():n.getDate();return-1===t&&1===r&&!1===o||(-1===t?a-=r>=2?r-1:r+6:a+=r>0?8-r:1),i?Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),a,0,0,0,0)-e:new Date(n.getFullYear(),n.getMonth(),a,0,0,0,0).getTime()-e},ga=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:Hs({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:Hs(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:la("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Xs(5,10,15,30)},minorTicks:{amount:4,fitFunction:Hs(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:la("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Xs(5,10,15,30)},minorTicks:{amount:12,fitFunction:Hs(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:la("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Xs(3,6,12)},minorTicks:{amount:8,fitFunction:Hs(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:la("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:Hs({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:Hs({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:fa(-1),getNextKeyValueIncludingRef:fa(0),getNextKeyValue:fa(1),greatTicks:!0,majorTicks:{fitFunction:Hs(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:ua("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:ca("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:da("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Hs(void 0,2,3)},minorTicks:{fitFunction:Hs(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:ua("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:ca("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:da("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Hs({ignore:"first"},2,5)},minorTicks:{fitFunction:Hs(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:ua("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:ca("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:da("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Hs(void 0,2,4)},minorTicks:{fitFunction:Hs(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:ua("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:ca("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:da("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:ua("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:ca("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:da("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],ma=(t,e,i)=>{let s=((t,e,i,s,n)=>{const r=e-t;let o;for(let t=0;t(s,n,r,o)=>{const a=ma("great",s,n);if(void 0===a)return[];if("Decade"===a.label||"Century"===a.label||"Millennium"===a.label)return[];const h=o>r?s:n,l=(s+n)/2,u=o>r?n:s;if(ga.indexOf(a)<=ga.findIndex((t=>"Hour"===t.label)))return"left"===i?[h]:[];let c;if(!0===a.irregular)c=Ys(s,n,a.getPrevKeyValue(t,e),a.getNextKeyValue(t,e));else{const i=a.greatTicks.getReferenceKeyValue(t,e)(s);c=Ws(s,n,a.unit,i,1)}const d=((t,e,i)=>{for(const s of i)if(s>=t&&s<=e)return s})(s,n,c);return"left"===i?void 0===d||Ge(d,l,u)?[h]:[d]:void 0!==d&&Ge(d,l,u)?[d]:[u]},ya=(t,e,i)=>(s,n,r,o)=>{const a=ma(t,r,o);let h;if(void 0===a)return[];if("great"===t&&void 0!==a.greatTicks)if(!0===a.irregular)h=Ys(s,n,a.getPrevKeyValue(e,i),a.getNextKeyValue(e,i));else{const t=a.greatTicks.getReferenceKeyValue(e,i)(s);h=Ws(s,n,a.unit,t,1)}else if("major"===t&&void 0!==a.majorTicks)h=!0===a.irregular?((t,e,i,s)=>{const n=[];let r=i(t),o=0;for(;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return n.push(r),n})(s,n,a.getPrevKeyValue(e,i),a.getNextKeyValue(e,i)):((t,e,i)=>{const s=[];let n=t,r=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return s.push(n),s})(s,n,a.unit);else{if("minor"!==t||void 0===a.minorTicks)return[];if(!0===a.irregular)h=((t,e,i,s)=>{const n=[];let r=i(t),o=0;for(;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return n})(s,n,a.getNextKeyValueIncludingRef(e,i),a.getNextKeyValue(e,i));else{const t=(t=>{if(void 0!==t)return ga[ga.indexOf(t)+1]})(a);if(void 0===t)return[];h=Gs(s,n,t.unit/a.minorTicks.amount,1)}}return h},Aa=t=>(e,i,s,n,r,o)=>{const a=ma(t,r,o);if(void 0===a)return;let h;return"major"===t?h=a.majorTicks.fitFunction:a.minorTicks&&(h=a.minorTicks.fitFunction),h?h(e,i,s,n,r,o):void 0},xa=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new na,majorTickStyle:new na,minorTickStyle:new na,formatOptionsMajorCentury:{year:"numeric"},formatOptionsMinorDecade:{year:"numeric"},formatOptionsMajorDecade:{year:"numeric"},formatOptionsMinorYear:{year:"numeric"},formatOptionsMajorYear:{year:"numeric"},formatOptionsMinorMonth:{month:"short"},formatOptionsGreatYear:{year:"numeric"},formatOptionsMajorMonth:{month:"long"},formatOptionsMinorWeek:{day:"numeric"},formatOptionsGreatMonth:{year:"numeric",month:"long"},formatOptionsMajorWeek:{day:"numeric",weekday:"short"},formatOptionsMinorDay:{day:"numeric",weekday:"short"},formatOptionsGreatWeek:(t,e,i)=>{const s=new Date(t),n=(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"}).format(s)} Week ${n}`},formatOptionsMajorDay:{weekday:"long",day:"numeric"},formatOptionsMinorHour:{hour:"2-digit",minute:"2-digit"},formatOptionsGreatDay:{year:"numeric",month:"long",day:"numeric"},formatOptionsMajorHour:{hour:"2-digit",minute:"2-digit"},formatOptionsMinorMinute:{hour:"2-digit",minute:"2-digit"},formatOptionsGreatHour:{year:"numeric",month:"long",day:"numeric"},formatOptionsMajorMinute:{hour:"2-digit",minute:"2-digit"},formatOptionsMinorSecond:{hour:"2-digit",minute:"2-digit",second:"2-digit"},formatOptionsGreatMinute:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"},formatOptionsMajorSecond:{second:"2-digit"},formatOptionsMinorMillisecond:t=>{const e=new Date(t);return`${(e.getSeconds()+e.getUTCMilliseconds()/1e3).toFixed(2)}`},formatOptionsGreatSecond:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},formatOptionsMajorMilliSecond:t=>{const e=new Date(t);return`${(e.getSeconds()+e.getUTCMilliseconds()/1e3).toFixed(1)}`}});class Sa extends xa{Wh(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>ga.map((e=>{const i=((t,e,i)=>{switch(i.label){case"MilliSecond100":return"Great"===e?void 0:"Major"===e?t.formatOptionsMajorMilliSecond:t.formatOptionsMinorMillisecond;case"Second":return"Great"===e?t.formatOptionsGreatSecond:"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]},`;St.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 n=t=>String(t),r=(t,i)=>(r,o)=>{let a=r+e;const h=o.getInnerStart(),l=o.getInnerEnd(),u=h>l,c=ma(t,u?l:h,u?h:l);if(void 0===c)return n(a);if("great"===t){const t=Et(r,"left"===i?h:l);let s;if(s=!1===t?r:!1===c.irregular?"left"===i&&!1===u||"right"===i&&!0===u?c.greatTicks.getReferenceKeyValue(e,this.utc)(r):c.greatTicks.getReferenceKeyValue(e,this.utc)(r+1*c.unit):"left"===i&&!1===u||"right"===i&&!0===u?c.getPrevKeyValue(e,this.utc)(r):c.getNextKeyValue(e,this.utc)(r),a=s+e,"right"===i&&!0===t)return""}const d=s.get(t);if(void 0===d)return n(a);const f=d[ga.indexOf(c)];return void 0===f?"":"function"==typeof f?f(a,o,this.locale):f.format(a)},o=[],a=[{Ye:"Great ticks (directive)",wA:0,Ge:!0,Ir:ya("great",e,this.utc),Pr:void 0},{Ye:"Major ticks",wA:1,nr:this.majorTickStyle,hr:r("major"),Ir:ya("major",e,this.utc),xh:{ur:Aa("major")},Pr:void 0}];aa(this.greatTickStyle)||(o.push({Ye:"Great ticks (left)",nr:this.greatTickStyle.setLabelAlignment(-1),hr:r("great","left"),Ir:pa(e,this.utc,"left"),Ne:!0,Ar:!1}),o.push({Ye:"Great ticks (right)",nr:this.greatTickStyle.setLabelAlignment(1),hr:r("great","right"),Ir:pa(e,this.utc,"right"),Ne:!0,Ar:!1})),aa(this.minorTickStyle)||a.push({Ye:"Minor ticks",wA:2,nr:this.minorTickStyle,hr:r("minor"),Ir:ya("minor",e,this.utc),xh:{ur:Aa("minor"),bh:(t,e,i,s,n,r)=>{const o=ma("minor",n,r);return!o||"Week"!==o.label}},Pr:void 0});const h=this.cursorFormatter;return{He:o,$e:a,We:h?(t,i,s)=>h(e+t,i,s):(t,i,s)=>{const n=new Date(e+t);return`${new Intl.DateTimeFormat(s,{year:"numeric",month:"numeric",day:"numeric",minute:"2-digit",hour:"2-digit"}).format(n)} `},Hh:1e3,$h:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}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("formatOptionsGreatSecond",t||this.formatOptionsGreatSecond).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("formatOptionsMajorMilliSecond",e||this.formatOptionsMajorMilliSecond).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 ba=(t,e)=>(i,s)=>{const n=s-i;if(e){const e=Math.log10(n/2);let r=10**Math.floor(e-t);const o=1/r;r=Math.round(r*o)/o;const a=Math.round(Math.floor(i/(10*r))*r*10*o)/o;return Ws(a,s,r,void 0,o)}const r=Math.log10(n);let o=10**Math.round(r-t);const a=1/o;return o=Math.round(o*a)/a,Gs(i,s,o,a)},va=(t,e,i,s,n,r)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%5==0)):void 0,Ma=(t,e,i,s,n,r)=>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,Ta=Hs(void 0,2,5),wa=(t,e,i,s,n,r)=>0===e?[t[1],t[3],t[5]]:1===e?[t[0],t[3]]:2===e?[t[1]]:void 0,Ea=(t,e)=>{const i=vi(t),s=Mi(t);if(e)return(t,e)=>{const n=[],r=Math.floor(i(t)),o=Math.ceil(i(e));for(let t=r-1;t<=o+1;t+=1){const e=s**t;n.push(e)}return n};const n=10===t?9:4;return(t,e)=>{const r=Math.round(i(t)),o=Math.round(i(e)),a=[],h=s**r,l=(s**o-h)/n;for(let i=1;i<=n;i+=1){const s=h+l*i;s>t&&sCi.LogarithmicNoExponents(e,i,void 0,t.base):Ci.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ci.LogarithmicNoExponents(e,i,void 0,t.base):Ci.Numeric),n=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ci.LogarithmicNoExponents(e,i,void 0,t.base):Ci.Numeric),r=[],o=[];aa(this.extremeTickStyle)||r.push({Ye:"Extreme ticks",nr:this.extremeTickStyle,hr:void 0===e?i:(t,s,n)=>i(e+t,s,n),Ir:Us,Ne:!0,Ar:!0}),o.push({Ye:"Major ticks",wA:0,nr:this.majorTickStyle,hr:void 0===e?s:(t,i,n)=>s(e+t,i,n),Ir:"logarithmic"===t.type?Ea(t.base,!0):ba(0,!0),xh:"logarithmic"===t.type?{ur:Ma}:{ur:va},Pr:void 0}),aa(this.minorTickStyle)||o.push({Ye:"Minor ticks",wA:1,nr:this.minorTickStyle,hr:void 0===e?n:(t,i,s)=>n(e+t,i,s),Ir:"logarithmic"===t.type?Ea(t.base,!1):ba(1,!1),xh:"logarithmic"===t.type?{ur:wa}:{ur:Ta},Pr:50});const a=this.cursorFormatter?this.cursorFormatter:Ci.Numeric;return{He:r,$e:o,We:void 0===e?a:(t,i,s)=>a(e+t,i,s),Hh:1e-9,$h: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")}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 Da=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new na,minorTickStyle:new na,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Ia=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=6e4?"MajorMinutes":i>=1e4?"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"},_a={hhmmss:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const n=Math.floor(e/6e4);e%=6e4;const r=Math.floor(e/1e3);return`${i}${ue(s,2)}:${ue(n,2)}:${ue(r,2)}`},hhmmssmmm:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const n=Math.floor(e/6e4);e%=6e4;const r=Math.floor(e/1e3);e%=1e3;const o=Math.floor(e/1);return`${i}${ue(s,2)}:${ue(n,2)}:${ue(r,2)}.${ue(o,3)}`},hhmmssmmmuuu:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),n=Math.floor(e/6e4)%60,r=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,a=t.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}).split(".")[1];return`${i}${ue(s,2)}:${ue(n,2)}:${ue(r,2)}.${ue(o,3)}${a}`},hhmmssmmmuuunnn:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),n=Math.floor(e/6e4)%60,r=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,a=t.toLocaleString("en-US",{minimumFractionDigits:6,maximumFractionDigits:6}).split(".")[1];return`${i}${ue(s,2)}:${ue(n,2)}:${ue(r,2)}.${ue(o,3)}${a}`}},Fa={MajorHours12:{major:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>{const n=432e5;return t=Math.floor(t/(4*n))*n*4,Ws(t,e,n,void 0,1e6)},fitKeyValues:Hs({ignore:"first"},2,4)},minor:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,36e5,1e6),fitKeyValues:Hs({},2,3,4,6)},defaultValueFormatter:_a.hhmmss},MajorHours:{major:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>{const n=36e5;return t=Math.floor(t/(12*n))*n*12,Ws(t,e,n,void 0,1e6)},fitKeyValues:Hs({ignore:"first"},2,6,12)},minor:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,3e5,1e6),fitKeyValues:Hs({},2,4,6)},defaultValueFormatter:_a.hhmmss},MajorMinutes15:{major:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Ws(t,e,9e5,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2)},minor:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,6e4,1e6),fitKeyValues:Hs({},3,5)},defaultValueFormatter:_a.hhmmss},MajorMinutes:{major:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Ws(t,e,6e4,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,5e3,1e6),fitKeyValues:Hs({},2,3,4,6)},defaultValueFormatter:_a.hhmmss},MajorSeconds15:{major:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Ws(t,e,15e3,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,4)},minor:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,1e3,1e6),fitKeyValues:Hs({},3,5)},defaultValueFormatter:_a.hhmmss},MajorSeconds:{major:{format:_a.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Ws(t,e,1e3,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmm,getKeyValues:(t,e,i,s)=>Gs(t,e,100,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.hhmmssmmm},MajorMilliseconds100:{major:{format:_a.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Ws(t,e,100,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmm,getKeyValues:(t,e,i,s)=>Gs(t,e,10,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.hhmmssmmm},MajorMilliseconds10:{major:{format:_a.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Ws(t,e,10,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmm,getKeyValues:(t,e,i,s)=>Gs(t,e,1,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.hhmmssmmm},MajorMilliseconds:{major:{format:_a.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Ws(t,e,1,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Gs(t,e,.1,1e6),fitKeyValues:Hs({},2)},defaultValueFormatter:_a.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:_a.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Ws(t,e,.1,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Gs(t,e,.01,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:_a.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Ws(t,e,.01,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Gs(t,e,.001,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.hhmmssmmmuuu},MajorMicroseconds:{major:{format:_a.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Ws(t,e,.001,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Gs(t,e,100*1e-6,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:_a.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const n=100*1e-6;return t=Math.floor(t/.001)*n*10,Ws(t,e,n,void 0,1e6)},fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Gs(t,e,10*1e-6,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.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 La extends Da{Wh(t){const e=this.timeOrigin||0,i=[{Ye:"Major ticks",wA:0,nr:this.majorTickStyle,hr:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const n=Ia(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Fa[n].major.format)(t+e,i,s)},Ir:(t,e,i,s)=>{const n=Ia(i,s);return(0,Fa[n].major.getKeyValues)(t,e,i,s)},xh:{ur:(t,e,i,s,n,r)=>{const o=Ia(n,r),a=Fa[o].major.fitKeyValues;if(a)return a(t,e,i,s,n,r)}},Pr:void 0}];return ra(this.minorTickStyle)&&i.push({Ye:"Minor ticks",wA:1,nr:this.minorTickStyle,hr:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const n=Ia(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Fa[n].minor.format)(t+e,i,s)},Ir:(t,e,i,s)=>{const n=Ia(i,s);return(0,Fa[n].minor.getKeyValues)(t,e,i,s)},xh:{ur:(t,e,i,s,n,r)=>{const o=Ia(n,r),a=Fa[o].minor.fitKeyValues;if(a)return a(t,e,i,s,n,r)}},Pr:void 0}),{He:[],$e:i,We:this.cursorFormatter||((t,i,s)=>{const n=Ia(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Fa[n].defaultValueFormatter(t+e,i,s)}),Hh:1e-4,$h:864e6}}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 za=(t,e,i="image/png",s)=>{e+=`.${i.slice(i.indexOf("image/")+6)}`;const n=t.captureFrame(i,s);if("image/png"!==i&&n.type.includes("image/png"))throw new Error(`saveToFile | type not supported by browser: ${i}\nCheck support table for HTMLCanvasElement.toDataURL`);if(St.navigator.msSaveBlob)St.navigator.msSaveBlob(n,e);else{const t=St.document.createElement("a");St.document.body.appendChild(t);const i=St.URL.createObjectURL(n);t.href=i,t.download=e,t.click(),setTimeout((()=>{St.URL.revokeObjectURL(i),St.document.body.removeChild(t)}),0)}},Pa=(t,i,s,n,r,o)=>{const a=t.fc(i,s,n,r,o,!0);return a.setDraggingMode(e.UIDraggingModes.draggable),a},Ra=(t,e)=>{if("relative"===t)return e;if(t instanceof Fi)return t;const i=t.x instanceof qs?t.x.dt:t.x.x,s=t.y instanceof qs?t.y.dt:t.y.y;return Pi(i,s)},Va=(t,e,i,s,n)=>{if(i){const r=t,o=e,a=ia(o)?o:Bi(o)?s:void 0;if(a&&Ri(i)){const t=ut(r,a,n.dt);return n.Xo({engineX:t.x,engineY:t.y})}if(a&&Bi(i))return ut(r,a,s);if(a&&ia(i))return ut(r,a,i)}else{const i=t;if(Bi(e)){const t=n.$o(i);return ut({x:t.engineX,y:t.engineY},n.dt,s)}if(ia(e)){const t=e,s=n.$o(i);return ut({x:s.engineX,y:s.engineY},n.dt,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class Ba{constructor(t,e,i,s,r,o,a,h){this.coordsRelative="relative",this.coordsClient="client",this.IA=[],this.PA=[],this.D=new n.Eventer,this.DA=void 0,this.BA=void 0,this.LA=void 0,this.Xt=A(0,0,0,0),this.RA=!1,this.$i=!1,this.EA=()=>{this.VA=!0,this.zA.bs()},this.OA=t=>e=>{const i=this.IA.indexOf(e);-1!==i&&this.IA.splice(i,1),this.us.bs(),t.W()},this.NA=t=>{const e=this.PA.indexOf(t);-1!==e&&this.PA.splice(e,1),this.us.bs()},this.VA=!0,this.onInViewChange=t=>this.D.on("inViewChange",t),this.offInViewChange=t=>this.D.off(t,"inViewChange"),this.fs=t,this.GA=i,this.zA=s,this.removePanel=r,this.qi=e.us.qi;const l=e.us.oi();if(this.uiScale=i.d2({scaleXYConstructor:Li}).zi(0,100).Oi(0,100).q(l),this.pixelScale=i.d2({scaleXYConstructor:Li}).zi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).q(l),this.engine=e.us.WA,this.us=e.us.UA,this.es=this.us.es.hs(this,{}),this.YA=()=>e.HA("unidentified ui"),this.$A=e.XA(),this.jA=this.zA.Te(this.uiScale).Ie(u(0,0)).q(u(100,100)).ke(o).Ce(a).setMouseMoveEventHandler(((t,e)=>this.D.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.D.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.D.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.D.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.D.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.D.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.D.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.D.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.D.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,n)=>this.D.emit("mouseDragPanelBackground",this,e,i,s,n))).setMouseDragStopEventHandler(((t,e,i,s)=>this.D.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.D.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.D.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.D.emit("touchEndPanelBackground",this,e))),h){const t=h.on(this.EA);this.ZA=()=>h.off(t)}else{const t=e.us.Go(this.EA);this.QA=e.us.Wo.bind(e.us,t)}const c=e.us.Yo((t=>{this.RA=t,this.D.emit("inViewChange",this,t)}));this.JA=e.us.Ho.bind(e.us,c),this.DA=r}getTheme(){return this.qi}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.jA.ke(t),this.zA.bs(),this}getBackgroundFillStyle(){return this.jA.Lh()}setBackgroundStrokeStyle(t){return this.jA.Ce(t),this.zA.bs(),this}getBackgroundStrokeStyle(){return this.jA._o()}translateCoordinate(t,e,i){return Va(t,e,i,this.pixelScale,this.us)}KA(t){return this.IA.push(t),this.us.bs(),t}qA(t){return this.PA.push(t),this.us.bs(),t}addUIElement(t=Eo,e=this.uiScale){e=Ra(e,this.pixelScale);const i=this.YA();return this.KA(Pa(t,i,this.uiScale,e,this.OA(i),this.qi))}addLegendBox(t=Bo,i=this.uiScale){i=Ra(i,this.pixelScale);const s=this.qA(Pa(t,this.$A,this.uiScale,i,this.NA,this.qi));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Ts.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Ts.CenterBottom).setPosition(this.uiScale.pi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.PA}dispose(){return this.$i||(this.$i=!0,this.QA&&this.QA(),this.ZA&&this.ZA(),Oa(this.uiScale),Oa(this.pixelScale),this.JA&&this.JA(),this.BA&&this.BA(),this.zA.W(),this.$A.W(),this.IA.slice().forEach((t=>{t.dispose()})),this.PA.slice().forEach((t=>{t.dispose()})),this.us.bs(),this.DA&&this.DA(this),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}saveToFile(t,e,i){return za(this.engine,t,e,i),this}Ka(t){this.Xt=t,this.EA()}j(){return this.pixelScale.j(),this.uiScale.j(),this}Z(){return this.pixelScale.Z(),this.uiScale.Z(),this}Fe(t){if(this.VA){const t=this.zA.us.oi(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=[this.Xt.left,this.Xt.right],n=[this.Xt.bottom,this.Xt.top];this.uiScale.Ei(s),this.uiScale.Vi(n);const r=this.uiScale.getInnerIntervalPixels();this.pixelScale.zi(0,r.x).Ei(s).Oi(0,r.y).Vi(n),this.D.emit("resize",this,r.x,r.y,e,i)}this.VA=!1}tg(){for(let t=0;t{t.ii&&t.ii()};class Na extends Ba{constructor(t,e,i,s,n,r){super(t,e,i,e.sg("uipanel bg",0),s,e.us.qi.uiPanelBackgroundFillStyle,e.us.qi.uiPanelBackgroundStrokeStyle,r),this.ig(n,this.pixelScale)}setMinimumSize(t){return this.Uc=t,this.us.bs(),this}getMinimumSize(){return this.Uc}Fe(t){super.Fe(t),super.tg()}}const Ua=A(10,10,10,10);class Ga extends Ba{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,i,s,n,r,o,l),this.eg={},this.Da=Ua,this.th=!0,this.hg=e.rg("chart internal ui",0),this.ng=this.hg.kr(this.uiScale).Bh("Chart").Ie(u(50,100)).Ja(u(0,1)).Vh(a).ke(h).setMouseInteractions(!1),this.og=this.es.gA([this.ng]).xs(this.qi.effectsText)}setAnimationsEnabled(t){return this.th=t,this}getAnimationsEnabled(){return this.th}setTitle(t){return this.ng.Bh(t),this.us.bs(),this}getTitle(){return this.ng.Ph()}getTitleSize(){return this.ng.Ds().Cc()}setTitleFillStyle(t){return this.ng.ke(t),this.EA(),this}getTitleFillStyle(){return this.ng.Lh()}setTitleFont(t){return this.ng.Vh(t),this.EA(),this}getTitleFont(){return this.ng.Eh()}setTitleRotation(t){return this.ng.zh(t),this.us.bs(),this}getTitleRotation(){return this.ng.Oh()}setTitleEffect(t){return this.og.xs(t),this.us.bs(),this}getTitleEffect(){return this.og.Ms()}setTitleMargin(t){var e,i;return this.eg="object"==typeof t?this.eg?(e=this.eg,{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.EA(),this}getTitleMargin(){return this.eg}setPadding(t){return this.Da="object"==typeof t?S(this.Da,t):{left:t,top:t,right:t,bottom:t},this.EA(),this}getPadding(){return this.Da}ag(t){const e=t.lg(),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.hg.W(),this}}const Wa={ug:(t,e)=>t.Lh()!==V&&0!==t.Ph().length&&t.getVisible()?t.Ds().Cc().y:0,cg(t,e){t.Ie(u(50,100)).Ka({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var Ya;e.AutoCursorModes=void 0,(Ya=e.AutoCursorModes||(e.AutoCursorModes={}))[Ya.disabled=0]="disabled",Ya[Ya.snapToClosest=1]="snapToClosest",Ya[Ya.onHover=2]="onHover";const Ha={dg(t,i,s,n,r,o){let a;const h=t.getAutoCursorMode();if(!s&&h!==e.AutoCursorModes.disabled){const s=t.us.Bn(),l=n.find((t=>t.getIsUnderMouse()));h===e.AutoCursorModes.snapToClosest&&r?(i||void 0!==l)&&(a=s&&r(s)):void 0===l||l.getCursorEnabled&&!l.getCursorEnabled()||(a=s&&o(l,s))}a?t.Ag.pointAt(a).setVisible(!0):t.Ag.setVisible(!1),t.Ag.Ds().Fe()},gg(t,e,i){if(e.xt.uiScale.x.hi()||e.yt.uiScale.y.hi())return;let s,n=Number.MAX_VALUE;for(const r of i)if(r.getCursorEnabled()&&r.getVisible()){const i=r.gg(e);if(i){const r=ut(i.location,i.scale,t.engine.scale),o=We(e,r);Number.isNaN(o)||s&&!(o{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundMouseMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundTouchStart((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundTouchMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundTouchEnd((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()}))},mg(t,i){i.onMouseEnter(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),i.onMouseMove(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),i.onMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()}))}};class Xa{constructor(t,e){this.yg=t,this.Sg=e}alter(t){this.vg=void 0!==this.vg?this.vg:this.Sg(),this.xg=t,this.yg(t)}resetValue(){void 0!==this.xg&&(void 0!==this.vg&&this.isAltered()&&this.yg(this.vg),this.vg=void 0,this.xg=void 0)}getNormalValue(){return void 0!==this.vg?this.vg:this.Sg()}isAltered(){return void 0!==this.xg&&this.Sg()===this.xg}}class ja{constructor(t,e){this.bg=[],this.Mg=t,this.dt=e}update(){return this.Mg.getVisible()?!(this._g()&&(!this.wg()||(this.resetTable(),this.Mg.Ds(),this._g()))&&(this.Cg(),this.Mg.Ds(),this._g()&&(this.resetTable(),this.Mg.Ds(),1))):(this.wg()&&this.resetTable(),!0)}wg(){for(let t=0;t{const s=ut(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),n=ut(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.Mg,this.dt)}kg(){return((t,i)=>{const s=ut(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),n=ut(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.Mg,this.dt)}Tg(){return((t,i)=>{const s=ut(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),n=ut(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.Mg,this.dt)}Fg(t){return this.bg.push(t),t}}class $a extends ja{constructor(){super(...arguments),this.Pa=this.Fg(new Xa((t=>this.Mg.setOrigin(t)),(()=>this.Mg.getOrigin())))}Cg(){const t=this.Pa.getNormalValue(),e=u(this.kg()?-t.x:t.x,this.Tg()?-t.y:t.y);this.Pa.alter(e)}}class qa extends ja{constructor(t,e,i,s){super(t,e),this.Ig=this.Fg(new Xa((t=>this.Mg.setTextFont((e=>e.setSize(t)))),(()=>this.Mg.getTextFont().getSize()))),this.Pg=i,this.Dg=s}Cg(){const t=this.Ig.getNormalValue(),e=this.Pg;if(enew $a(t,e),FontSize:(t=5,e=5)=>(i,s)=>new qa(i,s,t,e)};class Ka{constructor(){this.Bg=[]}addRow(...t){return this.Bg.push(t),this}}class Za extends Ka{fc(){const t=this.Bg;return this.Bg=[],t}Lg(){return this.Bg.length=0,this}}class Qa extends po{constructor(){super(...arguments),this.hc=this.qi.cursorResultTableTextFont,this.qc=0,this.Rg=this.qi.cursorResultTableTextFillStyle}setContent(t){for(let e=0;e=e)this.getMembers()[s].dispose(),s-=1,i-=1;else{const e=t[s].length;let i=n.getMembers().length;for(let r=0;r=e)n.getMembers()[r].dispose(),r-=1,i-=1;else if(void 0!==l&&l.length>0){for(let t=u.length;t=u.length)t=n.addElement(no,void 0);else{const e=u[r];e instanceof uo?(n.getMembers()[r].dispose(),t=n.addElement(no,r)):t=e}const e=a?this.hc.withMutations((t=>{for(const e of Object.keys(a)){const i=a[e];t.set(e,i)}return t})):this.hc,i=h||this.Rg;t.setFont(e).setFillStyle(i).setText(l).setTextRotation(this.qc)}else{for(let t=u.length;t=u.length?n.addGap(void 0,void 0):u[r]instanceof so&&(n.getMembers()[r].dispose(),n.addGap(void 0,r))}}}}return this.Ts.bs(),this}setTextFillStyle(t){this.Rg="function"==typeof t?t(this.Rg):t;for(let t=0;tt.setFillStyle(n.cursorResultTableFillStyle).setStrokeStyle(n.cursorResultTableStrokeStyle))).setTextFillStyle(n.cursorResultTableTextFillStyle).setTextFont(n.cursorResultTableTextFont),this.Gg=Ja.Flip(this.Mg,this.scale)}dispose(){return this.Ng.dispose(),this.Mg.dispose(),this}pointAt(t){return this.wa=t.scale===this.scale?t.location:ut(t.location,t.scale,this.scale),this.Ng.setPosition(this.wa),this.Mg.setPosition(this.wa).setContent(t.resultTableContent),this.Ts.bs(),this}getPosition(){return this.wa}setVisible(t){return this.Xi=t,this.Ts.bs(),this}getVisible(){return this.Xi}setPointMarkerVisible(t){return this.Vg=t,this.Ts.bs(),this}getPointMarkerVisible(){return this.Vg}setPointMarker(t){return t(this.Ng),this.Ts.bs(),this}getPointMarker(){return this.Ng}setResultTableVisible(t){return this.zg=t,this.Ts.bs(),this}getResultTableVisible(){return this.zg}setResultTable(t){return t(this.Mg),this.Ts.bs(),this}getResultTable(){return this.Mg}setAutoFitStrategy(t){return this.Gg&&this.Gg.resetTable(),this.Gg=t?t(this.Mg,this.Ts.us.dt):void 0,this.Ts.bs(),this}getAutoFitStrategy(){return void 0!==this.Gg}Fe(){return this.Gg&&this.Gg.update(),this.Mg.setVisible(this.RA&&this.Xi&&this.zg),this.Ng.setVisible(this.RA&&this.Xi&&this.Vg),this.Ng.Fe(),this.Mg.Fe(),this}Ds(){return this.Ng.Ds(),this.Mg.Ds(),this.RA=((t,e,i=e)=>{const s=e!==i?ut(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.wa,this.scale),this}}class eh extends th{constructor(){super(...arguments),this.Wg=!1}pointAt(t){return this.Ug(t.fillStyle),super.pointAt(t)}Ug(t){t&&this.Wg&&this.Mg.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.Wg=t,this.Ts.bs(),this}getResultTableAutoTextStyle(){return this.Wg}}class ih extends th{setPosition(t){return this.wa=t,this.Ng.setPosition(t),this.Mg.setPosition(t),this.Ts.bs(),this}}class sh{constructor(t,e=[]){this.Yg=[],this.Hg=(t,e)=>(this.Yg.forEach((i=>i(t,e))),t),this.Og=t,this.Yg=e}}class nh extends sh{constructor(){super(...arguments),this.$g=(t,e,i,s)=>this.Hg(new eh(t,e,i,this.Og,s),s),this.addStyler=t=>new nh(this.Og,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new nh(t,this.Yg.map((t=>t)))}}class rh extends sh{constructor(){super(...arguments),this.Xg=(t,e,i,s)=>this.Hg(new ih(t,e,i,this.Og,s),s),this.addStyler=t=>new rh(this.Og,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new rh(t,this.Yg.map((t=>t)))}}const oh=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),ah=(t,e)=>t.setPointMarker((t=>t.setFillStyle(e.chartMarkerPointMarkerFillStyle).setSize(e.chartMarkerPointMarkerSize).setShape(e.chartMarkerPointMarkerShape))).setResultTable((t=>t.setEffect(!0).setBackground((t=>t)).setOrigin(u(-1,-1)).setMargin(10))),hh=new nh(ro,[oh]),lh=new nh(ho,[oh,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof ho&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),uh=hh,ch=hh,dh=lh,fh=new rh(ro,[ah,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(Ts.LeftBottom)))]),gh=(t,e,i,s,n)=>({location:t,scale:e,resultTableContent:i,owner:s,fillStyle:n});var mh;e.SliceLabelIndices=void 0,(mh=e.SliceLabelIndices||(e.SliceLabelIndices={}))[mh.LabelsInsideSlices=0]="LabelsInsideSlices",mh[mh.LabelsOnSides=1]="LabelsOnSides";const ph={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},yh={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`},Ah=(t,e,i,s)=>t.addRow(i.getName()).addRow(i.getAnimatedValue().toString());class xh extends Ui{constructor(){super(...arguments),this._s="Slice",this.S=0}}const Sh=(t,e)=>{jt(e),t.setExploded(!t.getExploded())};class bh extends xh{}class vh extends bh{constructor(t,e,i,s,n,r,o,a){super(s,r,o,a),this.jg=!1,this.Zg=V,this.Qg=V,this.Jg=this.S,this.Kg=this.jg?1:0,this.qg=this.getVisible(),this.tp=$((()=>this.Ji.us.bs())),this.ip=$((()=>this.Ji.us.bs())),this.sp=()=>{this.ep=void 0},this.hp=()=>{this.rp=void 0},this.index=t,this.Ji=s,this.scale=n,this.Ki=r,this.np=e.Fc(n).cs(this.getHighlight()),this.gs(this.np),this.Ye=i.kr(n).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0}),this.onMouseClick(Sh),this.onTouchEnd(Sh)}setValue(t){return this.Ji.getAnimationsEnabled()?this.qg&&this.op(this.Jg,t):this.Jg=t,this.S=t,this.Ji.us.bs(),this}getValue(){return this.S}setExploded(t){if(t&&!1===this.Ji.getMultipleSliceExplosion()){const t=this.Ji.getSlices();for(let e=0;e{this.Kg=t,this.Ji.us.bs()})),this.rp.onEveryAnimationEnd(this.hp),this.jg=!this.jg):!1!==this.Ji.getMultipleSliceExplosion()||t?(this.Kg=this.jg?0:1,this.jg=!this.jg):(this.Kg=0,this.jg=!this.jg),this.Ji.us.bs(),this}getExploded(){return this.jg}setVisible(t){return this.qg=t,!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?(this.ep&&(this.ep.finish(!1),this.ep=void 0),this.op(this.Jg,0,(()=>super.setVisible(!1)))):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(this.ep&&(this.ep.finish(!1),this.ep=void 0),super.setVisible(!0),this.op(this.Jg,this.S)):(this.Jg=this.S,super.setVisible(!0)),this}op(t,e,i){this.ep=this.tp(300,X.ease)([[t,e]],(([t])=>{this.Jg=t,this.Ji.us.bs()})),this.ep.onEveryAnimationEnd(this.sp),i&&this.ep.onAnimationEnd(i)}setStyle(t,e,i,s){this.Zg=t,this.Qg=i,this.np.ke(this.Zg).Ce(e),this.Ye.ke(this.Qg).Vh(s);for(let t=0;tni(e,si(mi(.5*(t.Au()+t.Ti())*Math.PI/180),i)),Th=(t,e,i,s,n,r)=>{const o=t.length;let a=90;for(let h=0;h{const e=t.getSlices();for(let t=0;t{const e=this.ap.indexOf(t);e>=0&&(this.ap.splice(e,1),this.Mp())},this.fs.zn||this.fs.Vn||this.fs.Hn||this.us.As(7),this._p=i.wp("pieChart bottom",0),this.Cp=i.wp("pieChart top",1),this.ng.Bh("Pie Chart"),this.ig(r,this.pixelScale),this.onBackgroundMouseDoubleClick(wh);const h=Yi(new Hi(wh));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),this.kp=i.Tp();const l=Dt(a?a.autoCursorBuilder:void 0,ch);this.Ag=l.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.setAnimationsEnabled(!0!==(null==a?void 0:a.disableAnimations)&&!1!==(null==a?void 0:a.animationsEnabled))}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}addSlice(t,e){const i=new vh(this.gp,this._p,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);this.gp+=1,i.setName(t);const s=this.th;return this.th=!1,i.setValue(e),this.th=s,i.setEffect(this.yp),this.Fp(i),this.ap.push(i),this.Mp(),i.setHighlightOnHover(this.dp),i}addSlices(t){const e=[];for(let i=0;ie.es.ns.xs(t))),this.us.bs(),this}getSliceEffect(){return this.yp}setSliceSorter(t){return this.lp=t,this.ap=this.ap.sort(this.lp),this.us.bs(),this}getSliceSorter(){return this.lp}setLabelFillStyle(t){this.Ap="function"==typeof t?t(this.Ap):t;for(let t=0;te.es.rs.xs(t))),this.us.bs(),this}getLabelEffect(){return this.Sp}setLabelFormatter(t){return this.Ip=t,this.us.bs(),this}getLabelFormatter(){return this.Ip}setSliceHighlightOnHover(t){return this.dp=t,this.ap.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),Wa.cg(this.ng,this.eg),super.tg();const e=Wa.ug(this.ng,this.eg),i=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+e)),s=u(this.Da.left+i.x/2,this.Da.bottom+i.y/2);if(this.ad){const t=this.ad;this.ap.forEach((e=>{this.Fp(e,new U({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.ap[t].np.setVisible(e),this.ap[t].Ye.setVisible(e)}this.ap=this.ap.sort(this.lp);const n=this.ap.filter((t=>t.getAnimatedValue()>0));let r=0;for(let t=0;t0?a/r:0);var a;for(let t=0;tgh(e,this.engine.scale,this.xp(new Za,this,t,o[n.indexOf(t)]||0).fc(),t,void 0))),this.Pp(n,o,s,i)}Fp(t,e=this.up(t.index)){t.setStyle(e,this.cp,this.Ap,this.fp)}Mp(){this.ap=this.ap.sort(this.lp),this.us.bs()}Sd(){return this.ap}dispose(){return super.dispose(),this.ap.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this.Cp.W(),this._p.W(),this.kp.W(),this}}const kh={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Ch=(...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 Dh extends Eh{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,r,o),this.Ip=yh.NamePlusValue,this.Dp=[],this.Bp=40,this.Lp=5,this.Rp=10,this.Ep=this.qi.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.Ep=t;for(let t=0;t{const n=360*e[s],a=c-n,h=mi(di(.5*(c+a))),l=h.x>=0?-1:1,d=ni(ni(i,si(h,u+r)),{x:l*-o,y:0});c=a;const f={x:l,y:0};t.Ye.Ie(d).Ja(f),t.Ye.Ds();const g=je(t.Ye.Ue());return{position:d,alignment:f,shape:t.Ye,boundaries:g,sliceAngleVec:h,slice:t}})),f=[];for(let t=0;t{const s=t.slice.np,n=Mh(s,i,u+a+h*t.slice.getAnimatedExplosion()),r=ci(t.position.y,n,i),o=t.position;this.Vp([n,r,o])}))}getMinimumSize(){return u(500,300)}Vp(t){let e;for(let t=0;t{if(Ji(t)){const e=t.getThickness(),i=t.getFillStyle();if(G(i))return 1===e?on:new hn({size:e,fillStyle:i,shape:"sphere"})}return on};class Lh{constructor(t,e,i,s){this.Np=[],this.Gp=new Map,this.Wp=t,this.Yp=e,this.Hp=i,this.$p=s}Xp(){this.Hp&&this.Hp();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.Np.slice(),n=[];e.forEach((t=>{let e=s.pop();e||(e=this.Wp(),this.Np.push(e));const r=[],o=e.jp().slice();t.instances.forEach(((t,e)=>{const i=o.shift();r.push({...t,existingMember:i})}));const a=this.Yp(e,r,t.sharedProperties);i=se(i,a,{canReturnB:!0});for(let i=0;i{null==e||e.Wc(t)}))})),s.forEach((t=>{t.dispose();const e=this.Np.indexOf(t);e<0?fe(0,(()=>{})):this.Np.splice(e,1)})),n.forEach((t=>{const e=this.Gp.get(t.ia);e&&t.collection.us.po({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.Gp.clear(),n.forEach((t=>{this.Gp.set(t.ia,t)})),this.$p&&this.$p(this.Np,i)}}}Zp(){this.Np.forEach((t=>{t.dispose()})),this.Np.length=0}}class zh{constructor(t){this.Qp=[],this.Jp=t}Xp(){return this.Kp(),{add:()=>this.vl(),finishPlot:()=>{this.qp()}}}vl(){let t=this.Qp.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.Jp()},this.Qp.push(t)),t.isFree=!1,t.shape}Kp(){this.Qp.forEach((t=>{t.isFree=!0}))}qp(){this.Qp.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.Qp.splice(this.Qp.indexOf(t),1)}))}Zp(){this.Qp.forEach((t=>t.shape.dispose())),this.Qp.length=0}}class Ph{constructor(t,e,i,s,r,o,a,h,l,u){this.D=new n.Eventer,this.S=0,this.Xi=!0,this.$i=!1,this.bs=t,this.tm=e,this.im=i,this.sm=s,this.hm=r,this.rm=o,this.qc=a,this.Rg=h,this.nm=l,this.gc=u}setValue(t){return t===this.S||(this.S=t,this.bs(),this.D.emit("valueChange",this,this.S)),this}getValue(){return this.S}setTickStyle(t){return this.im="function"==typeof t?t(this.im):t,this.bs(),this}getTickStyle(){return this.im}setTickLength(t){return this.sm=t,this.bs(),this}getTickLength(){return this.sm}setGridStrokeStyle(t){return this.hm="function"==typeof t?t(this.hm):t,this.bs(),this}getGridStrokeStyle(){return this.hm}setTextPadding(t){return this.rm=t,this.bs(),this}getTextPadding(){return this.rm}setTextRotation(t){return this.qc=t,this.bs(),this}getTextRotation(){return this.qc}setTextFillStyle(t){return this.Rg="function"==typeof t?t(this.Rg):t,this.bs(),this}getTextFillStyle(){return this.Rg}setTextFont(t){return this.nm="function"==typeof t?t(this.nm):t,this.bs(),this}getTextFont(){return this.nm}setTextFormatter(t){return this.gc=t,this.bs(),this}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}dispose(){return this.$i||(this.$i=!0,this.tm(),this.bs(),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&(this.D.emit("visibleStateChanged",this,this.Xi),this.bs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}}class Rh extends qs{constructor(t,e,i,s,n,r,o,a,h){super(t,e,i,s,a,{numeric:e.om({x:t.us.qi.xAxis3DNumericTicks,y:t.us.qi.yAxis3DNumericTicks,z:t.us.qi.zAxis3DNumericTicks}),datetime:e.om({x:t.us.qi.xAxis3DDateTimeTicks,y:t.us.qi.yAxis3DDateTimeTicks,z:t.us.qi.zAxis3DDateTimeTicks}),time:e.om({x:t.us.qi.xAxis3DTimeTicks,y:t.us.qi.yAxis3DTimeTicks,z:t.us.qi.zAxis3DTimeTicks})},{type:"linear"}),this.Td=[],this.am=()=>{},this.lm=()=>{},this.um=()=>{},this.dm=()=>{},this.chart=t,this.At=n,this.fm=r,this.Am=o,this.gm=this.At.dt;const l=this.Mh.om({x:this.qi.xAxis3DStrokeStyle,y:this.qi.yAxis3DStrokeStyle,z:this.qi.zAxis3DStrokeStyle});this.pm=this.At.zp([kh.InternalUI]).Ee(l).ym(Fh(l)).setMouseInteractions(!1),this.Dh=this.fm.kr(this.Am).setMouseInteractions(!1).ke(e.om({x:t.us.qi.xAxis3DTitleFillStyle,y:t.us.qi.yAxis3DTitleFillStyle,z:t.us.qi.zAxis3DTitleFillStyle})).Vh(e.om({x:t.us.qi.xAxis3DTitleFont,y:t.us.qi.yAxis3DTitleFont,z:t.us.qi.zAxis3DTitleFont})),this.Sm=new zh((()=>this.fm.kr(this.Am))),this.vm=new Lh((()=>this.At._A().setMouseInteractions(!1)),((t,e,i)=>(t.Nt().Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t._l(e)))))),this.es=h,this.Nh=this.es.gA([this.Dh]).xs(s.effectsText),this.pm.setMouseEnterEventHandler(this.am).setMouseLeaveEventHandler(this.lm).setMouseDragEventHandler(this.um).setMouseDragStopEventHandler(this.dm),i.tA=this}setTickStrategy(t,e){return super.kh(t,e)}getTickStrategy(){return this.je}addCustomTick(){const t=new Ph((()=>this.chart.us.bs()),(()=>{const e=this.Td.indexOf(t);e>=0&&this.Td.splice(e,1)}),this.qi.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.qi.xAxis3DNumericTicks.majorTickStyle.tickLength,this.qi.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.qi.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.qi.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.qi.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.qi.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)));return this.Td.push(t),this.chart.us.bs(),t}setStrokeStyle(t){return this.pm.Ee(t).ym(Fh(this.pm.ku())),this.chart.us.bs(),this}getStrokeStyle(){return this.pm.ku()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.pm.setVisible(t),!1===t&&(this.vm.Zp(),this.Sm.Zp()),this.fm.bs(),this}vA(){return this.chart.getSeries()}xm(t){return Math.abs(this.dt.tt(t)*this.At.bm(1))}_r(t,e,i){const s=Math.abs(this.dt.tt(e-t)*this.At.bm(1));return{min:t-i*s,max:e+i*s}}ar(t,e){return new Vh(e,t,this.fm,this.Am,this.At)}lr(t,e){const i=this.Mm(e,t.S,t.Sh.nr.tickLength,t.Sh.nr.tickPadding);return t.Ye.Ie(i.labelPosition).Ja(i.labelAlignment),i}Mm(t,e,i,s){const{wuSize:n,start:r,end:o,tickDirection3D:a,tickDirection2D:h}=t,l=(e-this.dt.getInnerStart())/(this.dt.getInnerEnd()-this.dt.getInnerStart()),c=Ie.addVec(Xe(r,o,l),Ie.multiplyVec(Ie.multiply(a,this.At.bm(.5*this.pm.ku().getThickness())),n)),d=Ie.addVec(c,Ie.multiplyVec(Ie.multiply(a,this.At.bm(i)),n)),f=this.At._m(d)||u(0,0);return{labelPosition:ni(ut(f,this.chart.engine.scale,this.Am),si(h,s)),labelAlignment:{x:-h.x,y:-h.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}bA(t,e,i){const{wuSize:s,start:n,end:r,tickDirection3D:o}=e,a=(t-this.dt.getInnerStart())/(this.dt.getInnerEnd()-this.dt.getInnerStart()),h=Ie.addVec(Xe(n,r,a),Ie.multiplyVec(Ie.multiply(o,this.At.bm(.5*this.pm.ku().getThickness())),s)),l=Ie.addVec(h,Ie.multiplyVec(Ie.multiply(o,this.At.bm(10)),s)),c=this.At._m(h)||u(0,0),d=this.At._m(l)||u(0,0);return this.fm.Ve(this.Am).Oe(c).ze(d).Ee(new qi({fillStyle:new U({color:E(120*i)}),thickness:1}))}br(t,e){return Bh(t,e,this.dt)}Fe(t){if(!this.Xi)return;const e=Math.min(this.Th,this.Fh),i=Math.max(this.Th,this.Fh),s=this.gm,n=f(s.x.et(),s.y.et(),s.z.et());let r,o;this.wm()?(r=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerStart()),o=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerEnd())):(r=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),o=this.Mh.Cm(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),r));const a=this.Mh.xd,h=this.At._m(r)||u(0,0),l=this.At._m(o)||u(0,0),c=Xe(r,o,.5),d=Ie.addVec(c,Ie.multiplyVec(Ie.multiply(a,-1),n)),g=this.At._m(c)||u(0,0),m=this.At._m(d)||u(0,0),p=ti(ri(ut(g,this.chart.engine.scale,this.Am),ut(m,this.chart.engine.scale,this.Am)));this.pm.Nt()._l([r,o]);const{gridlinePositionA:y,gridlinePositionB:A,gridlinePositionC:x}=this.Mh.km(t),S=t=>({x:-1===t.x?this.gm.x.getInnerStart():1===t.x?this.gm.x.getInnerEnd():0,y:-1===t.y?this.gm.y.getInnerStart():1===t.y?this.gm.y.getInnerEnd():0,z:-1===t.z?this.gm.z.getInnerStart():1===t.z?this.gm.z.getInnerEnd():0}),b=S(y),v=S(A),M=S(x),T={physicalAxisSize:ii(ri(h,l)),wuSize:n,start:r,end:o,tickDirection3D:a,tickDirection2D:p,gridlinePositionA:b,gridlinePositionB:v,gridlinePositionC:M},w=this.Jh(T),E=this.vm.Xp();for(const[t,e]of this.Ze)for(const[,i]of e){const e=w.get(i);if(!e)continue;const s=this.Tm(T,e);E.add({ia:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.nr.tickStyle}),s.gridStroke&&E.add({ia:0,positions:s.gridStroke},{lineStyle:t.nr.gridStrokeStyle})}const k=this.Sm.Xp(),C={x:0,y:0};this.Td.forEach((t=>{if(!t.Xi||t.Si)return;const s=this.Mm(T,t.S,t.sm,t.rm),n=this.Tm(T,s),r=k.add().Ie(s.labelPosition).Ja(s.labelAlignment).ke(t.Rg).Vh(t.nm).Bh(t.gc(t.S)).zh(t.qc).Ds().oi();C.x=Math.max(C.x,r.x),C.y=Math.max(C.y,r.y),E.add({ia:0,positions:[n.tickStroke.start,n.tickStroke.end]},{lineStyle:t.im}),n.gridStroke&&E.add({ia:0,positions:n.gridStroke},{lineStyle:t.hm})})),k.finishPlot(),E.finishPlot();const D=this.dr(((t,e)=>{const i=e.Ye.oi();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:C.x,y:C.y}),I=Math.atan((l.y-h.y)/(l.x-h.x));this.Dh.Ja({x:0,y:0}).zh(180*-I/Math.PI);const _=Ie.addVec(c,Ie.multiplyVec(Ie.multiply(a,this.At.bm(.5*this.pm.ku().getThickness()+this.gr(((t,e)=>Math.max(t,e.tickLength)),0))),n)),F=this.At._m(_)||u(0,0),L=ni(ut(F,this.chart.engine.scale,this.Am),ni(ni(oi(D,p),si(p,this.gr(((t,e)=>Math.max(t,e.labelPadding)),0))),oi(si(this.Dh.Ds().oi(),.5),p)));this.Dh.Ie(L),this.pm.Fm={overrideFollowing:!1,skipMousePicking:!1}}Tm(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:n}=t,r=e.posTickStart3D,o=e.posTickEnd3D,a=e.tickPositionRelative;let h;return Et(a,0)||Et(a,1)||(h=[this.Im()?{...i,x:r.x}:this.Pm()?{...i,y:r.y}:this.wm()?{...i,z:r.z}:{x:0,y:0,z:0},this.Im()?{...s,x:r.x}:this.Pm()?{...s,y:r.y}:this.wm()?{...s,z:r.z}:{x:0,y:0,z:0},this.Im()?{...n,x:r.x}:this.Pm()?{...n,y:r.y}:this.wm()?{...n,z:r.z}:{x:0,y:0,z:0}]),{gridStroke:h,tickStroke:{start:r,end:o}}}Gh(){super.Gh(),this.vm.Zp(),this.Sm.Zp()}Im(){return this.Mh.Im()}Pm(){return this.Mh.Pm()}wm(){return this.Mh.wm()}}class Vh extends Js{constructor(t,e,i,s,n,r){super(t,e,i,s,r),this.Md=n}}const Bh=(t,e,i)=>kt(t+.1*(e-t)+Math.abs(i.et())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),Oh=(t,e,i,s)=>({pr:()=>{const i=t();let s;for(const t of i){if(!t.Dm())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},mr:()=>{const e=t();let s;for(const t of e){if(!t.Dm())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Sr:()=>{const e=t();let i;for(const t of e){if(!t.Dm())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),Nh=t=>({...Oh(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Sr().y)),om:t=>t.y,Cm:(t,e)=>({x:e.x,y:t.y,z:e.z}),xd: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)}},Im:()=>!1,Pm:()=>!0,wm:()=>!1}),Uh=t=>({...Oh(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Sr().z)),om:t=>t.z,Cm:(t,e)=>({x:e.x,y:e.y,z:t.z}),xd: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)}},Im:()=>!1,Pm:()=>!1,wm:()=>!0});class Gh extends Ui{constructor(t,e,i,s,n){super(t,e,s,n),this.Bm=Gr,this.Lm=!0,this.Rm=!0,this.Ji=t,this.At=i,this.ts=new Map,this.onMouseWheel(this.Ji.Em),this.onMouseDrag(this.Ji.Vm),this.onTouchStart(this.Ji.zm.onTouchStart),this.onTouchMove(this.Ji.zm.onTouchMove),this.onTouchEnd(this.Ji.zm.onTouchEnd)}setAutoScrollingEnabled(t){return this.Lm=t,this.Ji.us.bs(),this}getAutoScrollingEnabled(){return this.Lm}setColorShadingStyle(t){return this.Bm=t,this.ts.forEach(((e,i)=>i.Om(t))),this.At.bs(),this}getColorShadingStyle(){return this.Bm}setDepthTestEnabled(t){return this.Rm=t,this.ts.forEach(((e,i)=>i.Nm(t))),this.At.bs(),this}getDepthTestEnabled(){return this.Rm}Gm(){}Fe(){}$p(){}getXMax(){const t=this.el;return t?t.xt():void 0}getXMin(){const t=this.el;return t?t.vt():void 0}getYMax(){const t=this.el;return t?t.Mt():void 0}getYMin(){const t=this.el;return t?t.bt():void 0}getZMax(){const t=this.el;return t?t.Wm():void 0}getZMin(){const t=this.el;return t?t.Um():void 0}Sr(){const t=this.el;return t?f(t.Vl(),t.zl(),t.Ym()):f(0,0,0)}}class Wh extends Gh{constructor(t,e,i,s,n,r){super(t,e,i,s,r),this._s="Box Series 3D",this.Hm=.25,this.$m=!1,this.ld=()=>he(this.be),this.be=ce(this.qi.boxSeries3DFillStyle,n),this.el=this.At.jm().Nm(this.Rm).ke(this.be).Xm(this.Hm).cs(this.getHighlight()),this.gs(this.el)}invalidateData(t){const e=t.length;if(0===e)return this;this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));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;ihe(this.Cu.getFillStyle())}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;return this.el.Ee(e),this.At.bs(),this}getStrokeStyle(){return this.Cu}add(t){return this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.$m=!0,(t=Array.isArray(t)?t:[t])?(this.el._l(t.slice()),this.At.bs(),this):this}clear(){return this.el.Nt(),this}getPointAmount(){const t=this.el;return t.wl()+t.Cl()}Dm(){return this.Lm&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.cs(e),this.At.bs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{stroke:this.Cu}),this}}class Hh extends Yh{constructor(t,e,i,s,n,r){super(t,e,i,s,r),this._s="Line Series 3D",this.Cu=ce(s.lineSeries3DStrokeStyle,n),this.Qm=Tn.pointStyle3D,this.Jm(this.Cu),this.el=this.At.zp([kh.UserSeries]).Nm(this.Rm).Ee(this.Cu).ym(this.Qm).cs(this.getHighlight()),this.gs(this.el)}setStrokeStyle(t){super.setStrokeStyle(t),this.Jm(this.Cu);const e=this.Qm;return this.el.ym(e),this}Jm(t){const e=new fn.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.Qm=e}}class Xh extends Yh{constructor(t,e,i,s,n,r){super(t,e,i,s,r),this._s="Point Line Series 3D",this.ld=()=>he(this.Cu.getFillStyle())||he(this.Qm.getFillStyle()),this.Qm=ce(s.pointLineSeries3DPointStyle,n),this.Cu=ce(s.lineSeries3DStrokeStyle,n),this.Km(),this.el=this.At.zp([kh.UserSeries]).Nm(this.Rm).Ee(this.Cu).ym(this.Qm).cs(this.getHighlight()),this.gs(this.el)}setPointStyle(t){return this.Qm="function"==typeof t?t(this.Qm):t,this.Km(),this.el.ym(this.Qm),this.At.bs(),this}getPointStyle(){return this.Qm}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.Cu,i=Math.abs(e.getThickness()),s=this.Qm;i>s.getSize()&&(this.Qm=s.setSize(i)),this.Km();const n=this.Qm;return this.el.ym(n),this.At.bs(),this}Km(){const t=this.Qm,e=t.getSize();this.Qm=t.setSize(e)}Pe(t,e){t.cs(e),this.At.bs()}}class jh extends Gh{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.$m=!1,((null==r?void 0:r.individualPointSizeAxisEnabled)||(null==r?void 0:r.individualPointSizeEnabled))&&this.ds((t=>t.Vn||t.zn||t.ro?void 0:"bubble chart"))}add(t){return this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.$m=!0,(t=Array.isArray(t)?t:[t])?(this.el._l(t.slice()),this.At.bs(),this):this}clear(){return this.el.Nt(),this}getPointAmount(){const t=this.el;return t.wl()+t.Cl()}Dm(){return this.Lm&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.cs(e),this.At.bs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{point3D:this.qm}),this}}class $h extends jh{constructor(t,e,i,s,n,r){super(t,e,i,s,n,r),this._s="Point Series 3D",this.ld=()=>he(this.qm.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.Ji.getSeries().length;this.qm=ce(s.pointSeries3DPointStyle,o);const a={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...r};this.el=this.At.Oc(a).Nm(this.Rm).ty(this.qm).cs(this.getHighlight()),this.gs(this.el)}setPointStyle(t){this.qm="function"==typeof t?t(this.qm):t;const e=this.qm;return this.el.ty(e),this.At.bs(),this}getPointStyle(){return this.qm}}class qh extends jh{constructor(t,e,i,s,n,r){super(t,e,i,s,n,r),this._s="Point Cloud Series 3D",this.ld=()=>he(this.qm.getFillStyle());const o=this.Ji.getSeries().length;this.qm=ce(s.pointCloudSeries3DPointStyle,o);const a={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...r};this.el=this.At.Oc(a).ty(this.qm).cs(this.getHighlight()),this.gs(this.el)}setPointStyle(t){this.qm="function"==typeof t?t(this.qm):t;const e=this.qm;return this.el.ty(e),this.At.bs(),this}getPointStyle(){return this.qm}}const Jh={Triangulated:$h,Pixelated:qh};class Kh extends Ga{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,i,s,n,r,o,a,h,l),this.iy=[],this.sy=0,this.ey=t=>{const e=this.iy.indexOf(t);e>=0&&(this.iy.splice(e,1),this.D.emit("seriesDispose",this,t))},this.hy=()=>{this.sy+=1},this.ny=()=>{this.sy-=1},this.onSeriesBackgroundMouseEnter=t=>this.D.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.D.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.D.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.D.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.D.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.D.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.D.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.D.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.D.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.D.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.D.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.D.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.D.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.D.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.D.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.D.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.D.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.D.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.D.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.D.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.D.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.D.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.D.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.D.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.D.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.D.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.D.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.D.off(t,"touchEndSeriesBackground"),this.oy=this.es.gA()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.iy.forEach((e=>e.setAnimationHighlight(t))),this}ly(t,e){this.oy.ps([e]),t.setMouseMoveEventHandler(((t,e)=>{this.D.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.D.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.D.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.D.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.D.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.D.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.D.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.D.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.D.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,n)=>this.D.emit("mouseDragSeriesBackground",this,e,i,s,n))).setMouseDragStopEventHandler(((t,e,i,s)=>this.D.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.D.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.D.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.D.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.uy.ke(t),this.us.bs(),this}getSeriesBackgroundFillStyle(){return this.uy.Lh()}setSeriesBackgroundStrokeStyle(t){return this.Ay.Ce(t),this.us.bs(),this}getSeriesBackgroundStrokeStyle(){return this.Ay._o()}setSeriesBackgroundEffect(t){return this.oy.xs(t),this.us.bs(),this}getSeriesBackgroundEffect(){return this.oy.Ms()}gy(t){this.iy.push(t),t.onMouseEnter(this.hy),t.onMouseLeave(this.ny),void 0!==this.py&&t.setHighlightOnHover(this.py),this.D.emit("seriesAdded",this,t)}Sd(){return this.iy}my(){return this.sy}setSeriesHighlightOnHover(t){return this.py=t,this.iy.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.iy.slice().forEach(Tt),super.dispose()}yy(t){return this.D.on("seriesAdded",t)}Sy(t){return this.D.off(t)}vy(t){return this.D.on("seriesDispose",t)}xy(t){return this.D.off(t)}}const Zh=Ie.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class Qh{constructor(t,e,i,s){this.by=!0,this.My=!0,this._y=2*-Math.PI/2160,this.wy=2*Math.PI/2160,this.Cy=.1,this.ky=1*Math.PI/180,this.Ty=t,this.Fy=e,this.Iy=i,this._m=s}getDefaultCameraConfiguration(t){const e={direction:Zh,location:Ie.multiply(Zh,-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.Py(i,t):"wheel-zoom"===t.type?i=this.Dy(i,t):"rotate+zoom"===t.type?i=this.By(i,t):"fixed-rotate"===t.type?i=this.Ly(i,t):"move"===t.type&&(i=this.Ry(i,t))})),this.by?i=this.Ey(t.boundingBox,i):this.My&&(i=this.Vy(t.boundingBox,i)),i}Py(t,e){const{rotation:i}=e,s=t.location,n=Ie.multiply(Ie.normalize(t.location),-1),{Right:r,Up:o}=this.zy(n);let a=s;const h=this.Oy(n),l=i.x*this._y*h;a=Ie.rotateAroundAxis(a,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.wy,h-this.ky);return 0!==u&&(a=Ie.rotateAroundAxis(a,r,u)),{location:a,direction:Ie.multiply(Ie.normalize(a),-1)}}Dy(t,e){const{deltaY:i}=e;this.by&&this.Ny(!1);const s=t.location,n=Ie.multiply(Ie.normalize(s),-1),r=i*this.Cy,o=Ie.length(s)*-r;return{direction:n,location:Ie.addVec(s,Ie.multiply(n,o))}}By(t,e){const{rotation:i,cameraDistance:s}=e;this.by&&this.Ny(!1);let n=this.Py(t,{type:"rotate",rotation:i});const r=n.location,o=Ie.multiply(Ie.normalize(r),-1),a=Ie.multiply(o,-s);return n={direction:Ie.multiply(Ie.normalize(a),-1),location:a},n}Ly(t,e){this.by&&this.Ny(!1);const{rotation:i}=e,s=t.location,n=t.direction,{Right:r,Up:o}=this.zy(n),a=i.x*this._y;let h=Ie.normalize(Ie.rotateAroundAxis(n,o,a));const l=i.y*this.wy;return h=Ie.normalize(Ie.rotateAroundAxis(h,r,l)),{location:s,direction:h}}Ry(t,e){this.by&&this.Ny(!1),this.My=!1;const{amountRight:i,amountForward:s}=e,n=t.location,r=t.direction,{Right:o}=this.zy(r);return{location:Ie.addVec(n,Ie.multiply(r,.01*s),Ie.multiply(o,.01*i)),direction:r}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:Ie.multiply(Ie.normalize(t.cameraLocation),-1)};return this.by?this.Ey(t.boundingBox,e):this.Vy(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:Ie.multiply(Ie.normalize(t.cameraLocation),-1)};return this.by?this.Ey(t.boundingBox,e):this.Vy(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:Ie.multiply(Ie.normalize(t.cameraLocation),-1)};if(this.by)return this.Ey(t.boundingBox,e)}Ey(t,e,i){let s=e;i=void 0!==i?i:0,s=this.Gy(t,s,100,20,1,i,5);const n=this.Oy(s.direction);return s=this.Wy(s,this.Uy(t,s,100,1),n),s}Gy(t,e,i,s,n,r,o){return tl(r,o,(t=>({direction:e.direction,location:Ie.multiply(e.direction,-t)})),(e=>this.Yy(t,e)),i,n,"linear",s)}Uy(t,e,i,s){const{Right:n,Left:r,Up:o,Down:a}=this.zy(e.direction),h=this.Hy(t,!1,e);let l=e;const u=s,c=.1;return Math.abs(h.bottom-h.top)>u&&(l=h.bottom({location:l.location,direction:Ie.normalize(Ie.lerp(l.direction,a,t))})),(e=>this.$y(t,e)),0,u,!0,i):el(0,c,(t=>({location:l.location,direction:Ie.normalize(Ie.lerp(l.direction,o,t))})),(e=>this.$y(t,e)),0,u,!0,i)),Math.abs(h.left-h.right)>u&&(l=h.left({location:l.location,direction:Ie.normalize(Ie.lerp(l.direction,r,t))})),(e=>this.Xy(t,e)),0,u,!0,i):el(0,c,(t=>({location:l.location,direction:Ie.normalize(Ie.lerp(l.direction,n,t))})),(e=>this.Xy(t,e)),0,u,!0,i)),l}Yy(t,e){const i=this.Hy(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}Xy(t,e){const i=this.Hy(t,!1,e);return Math.abs(i.left-i.right)}$y(t,e){const i=this.Hy(t,!1,e);return Math.abs(i.top-i.bottom)}Hy(t,e,i){const s=je(this.jy(t,e,i).map((t=>ut(t,this.Ty,this.Fy))));return{left:s.min.x,right:this.Fy.x.getInnerEnd()-s.max.x,top:this.Fy.y.getInnerEnd()-s.max.y,bottom:s.min.y}}jy(t,e,i){const s=this.Iy,n=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),r=f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),o=[],a=e?16:4,h=(n.x+r.x)/2,l=(n.z+r.z)/2,u=Math.sqrt(2)*(r.x-h),c=Math.sqrt(2)*(r.z-l);return[n.y,r.y].forEach((t=>{for(let e=0;ethis._m(t,i))).filter((t=>void 0!==t))}Vy(t,e){const i=Ie.length(e.location),s=this.Zy(t);return i{let h,l=0,u=(e+t)/2;do{const a=i(u);if(h={value:u,result:a,score:s(a)},Math.abs(h.score-n)<=r)break;const c=h.score>n;c&&"linear"===o||!c&&"reversed"===o?(u=(h.value+t)/2,e=h.value):(u=(h.value+e)/2,t=h.value),l+=1}while(l{let h,l=0,u=t;do{const c=i(u),d=s(c);if(void 0===h||Math.abs(d-n)he(this.be),this.Bm=Nr;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ji.getSeries().length;this.be=ce(this.qi.surfaceGridSeries3DFillStyle,o),this.Ky=ce(this.qi.surfaceGridSeries3DWireframeStyle,o);const a={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.En=a,this.el=this.At.tS(a).ke(this.be).qy(this.Ky).Om(this.Bm).cs(this.getHighlight()),this.gs(this.el),s.start&&this.setStart(s.start),s.end&&this.setEnd(s.end),s.step&&this.setStep(s.step)}iS(){const t=this.Jy.start||{x:0,z:0};let e;e=this.Jy.end?{x:(this.Jy.end.x-t.x)/this.En.columns,z:(this.Jy.end.z-t.z)/this.En.rows}:this.Jy.step?this.Jy.step:{x:1,z:1},this.el.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.el.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.el.eS().step}setEnd(t){return this.Jy.end=t,this.iS(),this}getEnd(){return this.el.eS().end}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.el.ke(this.be),this.At.bs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.el.qy(this.Ky),this.At.bs(),this}getWireframeStyle(){return this.el.hS()}setIntensityInterpolation(t){return t=t||"disabled",this.el.rS(t),this.At.bs(),this}getIntensityInterpolation(){return this.el.nS()}invalidateIntensityValues(t){if(this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),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.En.dataOrder?t.length:t[0].length,rows:"rows"===this.En.dataOrder?t.length:t[0].length},i="columns"===this.En.dataOrder?this.En.columns:this.En.rows,s="columns"===this.En.dataOrder?this.En.rows:this.En.columns;if(e.x>i||e.y>s){if(!0===this.Ji.fs.oo){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.En.columns}x${this.En.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const n=[];for(let e=0;eo||r>a){if(!0===this.Ji.fs.oo){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.En.columns}x${this.En.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.`;St.console.warn(i)}const h=Math.max(-i,0),l=Math.max(-n,0),u=Math.max(s-o,0),c=Math.max(r-a,0),d=e.primary-(h+u),f=[];if(0===l&&0===c)for(let e=0;et.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),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.En.dataOrder?t.length:t[0].length,rows:"rows"===this.En.dataOrder?t.length:t[0].length},i="columns"===this.En.dataOrder?this.En.columns:this.En.rows,s="columns"===this.En.dataOrder?this.En.rows:this.En.columns;if(e.x>i||e.y>s){if(!0===this.Ji.fs.oo){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.En.columns}x${this.En.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const n=[];for(let e=0;eo||r>a){if(!0===this.Ji.fs.oo){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.En.columns}x${this.En.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.`;St.console.warn(i)}const h=Math.max(-i,0),l=Math.max(-n,0),u=Math.max(s-o,0),c=Math.max(r-a,0),d=e.primary-(h+u),f=[];if(0===l&&0===c)for(let e=0;ehe(this.be),this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.Bm=Nr;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ji.getSeries().length;this.be=ce(this.qi.surfaceScrollingGridSeries3DFillStyle,o),this.Ky=ce(this.qi.surfaceScrollingGridSeries3DWireframeStyle,o);const a={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.En=a,this.el=this.At.cS(a).ke(this.be).qy(this.Ky).Om(this.Bm).cs(this.getHighlight()),this.gs(this.el),s.start&&this.setStart(s.start),s.step&&this.setStep(s.step)}iS(){const t=this.Jy.start||{x:0,z:0};let e;e=this.Jy.step?this.Jy.step:{x:1,z:1},this.el.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.el.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.el.eS().step}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.el.ke(this.be),this.At.bs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.el.qy(this.Ky),this.At.bs(),this}getWireframeStyle(){return this.el.hS()}setIntensityInterpolation(t){return t=t||"disabled",this.el.rS(t),this.At.bs(),this}getIntensityInterpolation(){return this.el.nS()}clear(){return this.el.Nt(),this.At.bs(),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.En.scrollDimension?this.En.rows:this.En.columns;if(i>s-1){if(!0===this.Ji.fs.oo){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.En.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.Ji.fs.oo){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.En.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.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,n=e?e[0].length:null==i?void 0:i[0].length;return this.el.dS({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:n,heightMapValues:e,intensityValues:i}),this.At.bs(),this}setCullMode(t){return this.el.lS("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.el.uS()}Gm(){}Fe(){}$p(){}Dm(){return this.Lm&&this.getVisible()}Pe(t,e){t.cs(e),this.At.bs()}}const nl=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof hl),rl=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),ol={translation:(t,e,i)=>[1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1],xRotation(t){const e=Math.cos(t),i=Math.sin(t);return[1,0,0,0,0,e,i,0,0,-i,e,0,0,0,0,1]},yRotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,0,-i,0,0,1,0,0,i,0,e,0,0,0,0,1]},zRotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,i,0,0,-i,e,0,0,0,0,1,0,0,0,0,1]},scaling:(t,e,i)=>[t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1],translate:(t,e,i,s)=>ol.multiply(t,ol.translation(e,i,s)),xRotate:(t,e)=>ol.multiply(t,ol.xRotation(e)),yRotate:(t,e)=>ol.multiply(t,ol.yRotation(e)),zRotate:(t,e)=>ol.multiply(t,ol.zRotation(e)),rotateXYZ(t,e){let i=ol.xRotate(t,e.x);return i=ol.yRotate(i,e.y),i=ol.zRotate(i,e.z),i},scale:(t,e,i,s)=>ol.multiply(t,ol.scaling(e,i,s)),multiply(t,e){const i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],g=e[12],m=e[13],p=e[14],y=e[15],A=t[0],x=t[1],S=t[2],b=t[3],v=t[4],M=t[5],T=t[6],w=t[7],E=t[8],k=t[9],C=t[10],D=t[11],I=t[12],_=t[13],F=t[14],L=t[15],z=[];return z[0]=i*A+s*v+n*E+r*I,z[1]=i*x+s*M+n*k+r*_,z[2]=i*S+s*T+n*C+r*F,z[3]=i*b+s*w+n*D+r*L,z[4]=o*A+a*v+h*E+l*I,z[5]=o*x+a*M+h*k+l*_,z[6]=o*S+a*T+h*C+l*F,z[7]=o*b+a*w+h*D+l*L,z[8]=u*A+c*v+d*E+f*I,z[9]=u*x+c*M+d*k+f*_,z[10]=u*S+c*T+d*C+f*F,z[11]=u*b+c*w+d*D+f*L,z[12]=g*A+m*v+p*E+y*I,z[13]=g*x+m*M+p*k+y*_,z[14]=g*S+m*T+p*C+y*F,z[15]=g*b+m*w+p*D+y*L,z},inverse(t){const e=[],i=t[0],s=t[1],n=t[2],r=t[3],o=t[4],a=t[5],h=t[6],l=t[7],u=t[8],c=t[9],d=t[10],f=t[11],g=t[12],m=t[13],p=t[14],y=t[15],A=d*y,x=p*f,S=h*y,b=p*l,v=h*f,M=d*l,T=n*y,w=p*r,E=n*f,k=d*r,C=n*l,D=h*r,I=u*m,_=g*c,F=o*m,L=g*a,z=o*c,P=u*a,R=i*m,V=g*s,B=i*c,O=u*s,N=i*a,U=o*s,G=A*a+b*c+v*m-(x*a+S*c+M*m),W=x*s+T*c+k*m-(A*s+w*c+E*m),Y=S*s+w*a+C*m-(b*s+T*a+D*m),H=M*s+E*a+D*c-(v*s+k*a+C*c),X=1/(i*G+o*W+u*Y+g*H);return e[0]=X*G,e[1]=X*W,e[2]=X*Y,e[3]=X*H,e[4]=X*(x*o+S*u+M*g-(A*o+b*u+v*g)),e[5]=X*(A*i+w*u+E*g-(x*i+T*u+k*g)),e[6]=X*(b*i+T*o+D*g-(S*i+w*o+C*g)),e[7]=X*(v*i+k*o+C*u-(M*i+E*o+D*u)),e[8]=X*(I*l+L*f+z*y-(_*l+F*f+P*y)),e[9]=X*(_*r+R*f+O*y-(I*r+V*f+B*y)),e[10]=X*(F*r+V*l+N*y-(L*r+R*l+U*y)),e[11]=X*(P*r+B*l+U*f-(z*r+O*l+N*f)),e[12]=X*(F*d+P*p+_*h-(z*p+I*h+L*d)),e[13]=X*(B*p+I*n+V*d-(R*d+O*p+_*n)),e[14]=X*(R*h+U*p+L*n-(N*p+F*n+V*h)),e[15]=X*(N*d+z*n+O*h-(B*h+U*d+P*n)),e},projectionPerspective(t,e,i,s){const n=1/Math.tan(t*Math.PI/180/2),r=1/(i-s);return[n/e,0,0,0,0,n,0,0,0,0,(i+s)*r,-1,0,0,i*s*r*2,0]},projectionOrthographic:(t,e,i,s,n,r)=>[2/(e-t),0,0,-(e+t)/(e-t),0,2/(s-i),0,-(s+i)/(s-i),0,0,-2/(r-n),-(r+n)/(r-n),0,0,0,1]};class al extends Gh{constructor(t,e,i,s,n,r){super(t,e,i,s,r),this._s="Mesh Model 3D",this.fS=new Float32Array,this.dt={x:1,y:1,z:1},this.AS={x:0,y:0,z:0},this.gS={x:0,y:0,z:0},this.pS={x:0,y:0,z:0},this.mS={x:0,y:0,z:0},this.ol=ze,this.ld=()=>he(this.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.Ji.getSeries().length;this.el=this.At.yS().Nm(this.Rm).ke(ce(this.qi.meshModel3DFillStyle||this.qi.pointSeriesFillStyle,o)).cs(this.getHighlight()),this.gs(this.el)}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let n=Fe,r=_e,o=Fe,a=_e,h=Fe,l=_e;for(let t=0;t{const t=this.At.RS();this.VS.ES(t),this.zS.ES(t);const e=this.OS.viewportChanged(this.NS());e&&this.GS(e),this.us.bs()},this.Vm=(t,e,i,s,n)=>{if(this.BS){const t=n;this.FS.push({type:"rotate",rotation:t}),this.us.bs(),jt(e)}},this.Em=(t,e)=>{if(this.DS){if(this.PS)Math.sign(this.LS)!==Math.sign(e.deltaY)?this.LS=de(e):this.LS+=de(e);else{const t=de(e);this.FS.push({type:"wheel-zoom",deltaY:t})}this.us.bs(),jt(e)}},this.fs.zn||this.fs.Vn||this.fs.Zn||this.us.As(1),this.ng.Bh("Chart3D"),this.WS=i.d3(),this.WS.x.J(-1,1),this.WS.y.J(-1,1),this.WS.z.J(-1,1),this.At=e.US("chart3D layer3D",0,this.WS),this.VS=e.YS("chart3D series bg",0),this.zS=e.wp("chart3D axis ui",1),this.HS={x:new Rh(this,(a=()=>this.iy,{...Oh(a,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Sr().x)),om:t=>t.x,Cm:(t,e)=>({x:t.x,y:e.y,z:e.z}),xd: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)}},Im:()=>!0,Pm:()=>!1,wm:()=>!1}),this.WS.x,this.qi,this.At,this.zS,this.pixelScale,!1,this.es),y:new Rh(this,Nh((()=>this.iy)),this.WS.y,this.qi,this.At,this.zS,this.pixelScale,!1,this.es),z:new Rh(this,Uh((()=>this.iy)),this.WS.z,this.qi,this.At,this.zS,this.pixelScale,!1,this.es)},this.$S=this.At.zp([kh.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.qi.chart3DBoundingBoxStrokeStyle),this.uy=this.VS.vc(this.engine.scale,rr.Simple).ke(this.qi.chart3DSeriesBackgroundFillStyle).Ce(nt).setMouseInteractions(!0),this.Ay=this.VS.vc(this.engine.scale,rr.Simple).ke(V).Ce(this.qi.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.ly(this.uy,this.Ay),this.XS({x:1,y:1,z:1},!0),this.OS=new Qh(this.engine.scale,this.pixelScale,this.WS,((t,e)=>(e&&this.GS(e),this.At._m(t)))),this.jS=this.OS.getDefaultCameraConfiguration(this.ZS(this.QS)),this.GS(this.jS),this.zm=Yi(new ji(((t,e,i)=>{h={locationOne:e,locationTwo:i,cameraLocation:this.At.getCameraLocation()}}),((t,e,i,s,n,r)=>{if(!this.BS&&!this.DS)return;const o=(h.locationOne.x-h.locationTwo.x)**2+(h.locationOne.y-h.locationTwo.y)**2,a=(e.x-i.x)**2+(e.y-i.y)**2,l=Ie.length(h.cameraLocation),c=o/a*l,d=u((s.x+n.x)/2,(s.y+n.y)/2);this.FS.push({type:"rotate+zoom",rotation:this.BS?d:{x:0,y:0},cameraDistance:this.DS?c:l}),this.us.bs(),jt(r)}),(t=>{})),new Xi((t=>{}),((t,e,i,s,n)=>{if(this.BS){const t=s;this.FS.push({type:"rotate",rotation:t}),this.us.bs(),jt(n)}}),(t=>{}))),this.onBackgroundTouchStart(this.zm.onTouchStart),this.onBackgroundTouchMove(this.zm.onTouchMove),this.onBackgroundTouchEnd(this.zm.onTouchEnd),this.onSeriesBackgroundTouchStart(this.zm.onTouchStart),this.onSeriesBackgroundTouchMove(this.zm.onTouchMove),this.onSeriesBackgroundTouchEnd(this.zm.onTouchEnd),this.onBackgroundMouseDrag(this.Vm),this.onBackgroundMouseWheel(this.Em),this.onBackgroundMouseDown(((t,e)=>{jt(e)})),this.onSeriesBackgroundMouseDrag(this.Vm),this.onSeriesBackgroundMouseWheel(this.Em),this.onSeriesBackgroundMouseDown(((t,e)=>{jt(e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.nn),this.nn(),this.ig(n,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||$h)(this,this.ey,this.At,this.qi,this.us.es,t);return this.gy(e),e}addLineSeries(t){const e=new Hh(this,this.ey,this.At,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPointLineSeries(t){const e=new Xh(this,this.ey,this.At,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addSurfaceGridSeries(t){const e=new il(this,this.ey,this.At,t,this.qi,this.us.es);return this.gy(e),e}addSurfaceScrollingGridSeries(t){const e=new sl(this,this.ey,this.At,t,this.qi,this.us.es);return this.gy(e),e}addBoxSeries(t){const e=new Wh(this,this.ey,this.At,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addMeshModel(t){const e=new al(this,this.ey,this.At,this.qi,t,this.us.es);return this.gy(e),e}translateCoordinate(t,e,i){if(nl(e)||nl(i)||rl(t)){if(nl(e)&&nl(i)&&rl(t)){if("axes"===e.id&&"world"===i.id)return this.At.ft(t);if("world"===e.id&&"axes"===i.id)return this.At.yt(t);if(e.id===i.id)return t}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return Va(t,e,i,this.pixelScale,this.us)}getDefaultAxisX(){return this.HS.x}getDefaultAxisY(){return this.HS.y}getDefaultAxisZ(){return this.HS.z}getDefaultAxes(){return[this.HS.x,this.HS.y,this.HS.z]}setCameraLocation(t){let e={location:t,direction:Ie.normalize(Ie.multiply(t,-1))};const i=this.OS.cameraLocationChanged(this.NS(e));return i&&(e=i),this.GS(e),this.us.bs(),this}getCameraLocation(){return this.At.getCameraLocation()}getCameraDirection(){return this.At.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.OS.Ny(t);const e=this.OS.cameraLocationChanged(this.NS());return e&&this.GS(e),this}getCameraAutomaticFittingEnabled(){return this.OS.Qy()}onCameraChange(t){return this.D.on("cameraChange",t)}offCameraChange(t){return this.D.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.$S.Ee(t).ym(Fh(this.$S.ku())),this.At.bs(),this}getBoundingBoxStrokeStyle(){return this.$S.ku()}setBoundingBox(t){return this.XS(t,!1),this}XS(t,e){this.QS=t;const i=this.ZS(t);if(this.WS.x.q(i.x),this.WS.y.q(i.y),this.WS.z.q(-i.z),!e){const t=this.OS.boundingBoxChanged(this.NS());t&&this.GS(t)}this.us.bs()}getBoundingBox(){return this.QS}Fe(t){if(Wa.cg(this.ng,this.eg),0!==this.LS){const e=this.LS*t*.006;this.FS.push({type:"wheel-zoom",deltaY:e}),this.LS=Math.sign(this.LS)*Math.max(Math.abs(this.LS)-.01*t,0),0!==this.LS&&this.us.bs(!0)}const e=this.getCameraDirection();if(this.FS.length>0){const t=this.OS.applyCameraInteractions(this.NS(),this.FS);t&&this.GS(t),this.FS.length=0}this.JS&&Ie.equals(this.JS.location,this.jS.location)&&Ie.equals(this.JS.direction,this.jS.direction)||this.D.emit("cameraChange",this,this.getCameraLocation()),this.JS=this.jS,super.Fe(t);for(let t=0;tthis.At._m(t))),o=this.At._m(f((s.x+n.x)/2,(s.y+n.y)/2,(s.z+n.z)/2)),a=ie(r,o),h=[];for(let t=0;t0?t-1:a.length-1],a[t{t()})),this.tn.length=0,this.WS.W(),this.At.W(),this.zS.W(),this.VS.W(),super.dispose()}j(){return this.WS.x.j(),this.WS.y.j(),this.WS.z.j(),super.j()}Z(){return super.Z()}GS(t){this.At.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(Ie.addVec(t.location,Ie.multiply(t.direction,-this.IS))),this.jS=t,this.us.bs()}ZS(t){return Ie.divide(t,Ie.length(t)/this.TS)}NS(t=this.jS){return{boundingBox:this.ZS(this.QS),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.DS=t,this}getMouseInteractionZoom(){return this.DS}setMouseInteractionRotate(t){return this.BS=t,this}getMouseInteractionRotate(){return this.BS}forEachAxis(t){return t(this.HS.x),t(this.HS.y),t(this.HS.z),this}getSeries(){return this.iy}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.PS=!!t,this}getAnimationZoom(){return this.PS}}const ll={Column:Ao,Row:xo};class ul extends Na{constructor(t,e,i,s,n,r){super(t,e,i,s,n,r),this.KS=new Map,this.qS=this.addUIElement(ll.Row).setPosition({x:0,y:100}).setOrigin(Ts.LeftTop).setBackground((t=>t.setFillStyle(V).setStrokeStyle(nt)))}add(t,e){return(t instanceof Ga?[t]:t instanceof Cf?t.getCells().filter((t=>t.panel instanceof Ga)).map((t=>t.panel)):[]).forEach((t=>{const i=this.qS.addElement(jo.VerticalLegendBox).setBackground((t=>t.setFillStyle(V).setStrokeStyle(nt))).add(t,e).setTitle(t.getTitle());this.KS.set(t,i)})),this.us.bs(),this}setLegendBoxes(t){return this.KS.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.qS.getSize()}}const cl={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},dl=(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(),fl=(t,e)=>{let i=e.geometry;return i=gl(t,e,i),i=ml(t,e,i),i},gl=(t,e,i)=>{if(t===cl.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let n;if(t===cl.USA&&("alaska"===s?n={translate:{x:55,y:-25},scale:{x:.16,y:.16}}:"hawaii"===s&&(n={translate:{x:48,y:7},scale:{x:1,y:1}})),n){const{translate:t,scale:r}=n,o=je(Ct(i)),a=[];for(let e=0;ethis.D.on("mouseEnter",t),this.onMouseLeave=t=>this.D.on("mouseLeave",t),this.onMouseClick=t=>this.D.on("mouseClick",t),this.onMouseDoubleClick=t=>this.D.on("mouseDoubleClick",t),this.onMouseDown=t=>this.D.on("mouseDown",t),this.onMouseUp=t=>this.D.on("mouseUp",t),this.onMouseMove=t=>this.D.on("mouseMove",t),this.offMouseEnter=t=>this.D.off(t,"mouseEnter"),this.offMouseLeave=t=>this.D.off(t,"mouseLeave"),this.offMouseClick=t=>this.D.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.D.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.D.off(t,"mouseDown"),this.offMouseUp=t=>this.D.off(t,"mouseUp"),this.offMouseMove=t=>this.D.off(t,"mouseMove"),this.offMouseDragStart=t=>this.D.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.D.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.D.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.D.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.D.on("mapDataReady",t);return this.av&&St.setTimeout((()=>t())),e},this.onViewChange=t=>this.D.on("viewChange",t),this.lv=(t,e,i,s,n)=>{this.dt.x.q(s).si([this.Xt.left+this.Da.left,this.Xt.right+this.Da.right]),this.dt.y.q(n).si([this.Xt.bottom+this.Da.bottom,this.Xt.top+this.Da.top+Wa.ug(this.ng,this.eg)]),this.uv&&this.cv(this.dv,this.dt,this.uv)},this.wt=(t,i)=>{const s=i;if(!s||!this.av)return;const{iRegion:n,region:r}=this.fv(this.av,s);this.hv!==e.AutoCursorModes.disabled&&(this.Av(r,n),jt(t)),this.nv&&this.us.ls.ws(r,!0),this.gv=r,this.D.emit("mouseEnter",this,t)},this.Ct=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:n}=this.fv(this.av,i);this.pv(n,s),this.nv&&this.us.ls.ws(n,!1),this.gv=void 0,this.D.emit("mouseLeave",this,t),t&&jt(t)},this.Pt=(t,i)=>{const s=i;if(!s||!this.av)return;const{iRegion:n,region:r}=this.fv(this.av,s);this.hv!==e.AutoCursorModes.disabled&&(this.Av(r,n),jt(t)),this.gv=r,this.D.emit("mouseMove",this,t)},this.kt=(t,e)=>this.D.emit("mouseClick",this,t),this.Tt=(t,e)=>this.D.emit("mouseDoubleClick",this,t),this.Ft=(t,e)=>this.D.emit("mouseDown",this,t),this.It=(t,e)=>this.D.emit("mouseUp",this,t),this.Bt=(t,e,i)=>{this.D.emit("mouseDragStart",this,t,e)},this.Dt=(t,e,i,s,n)=>{this.D.emit("mouseDrag",this,t,e,i,s)},this.Lt=(t,e,i,s)=>{this.D.emit("mouseDragStop",this,t,e,i)},this.Rt=(t,e)=>{this.D.emit("mouseWheel",this,t)},this.Et=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:n}=this.fv(this.av,i);this.mv=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Av(n,s),this.nv&&this.us.ls.ws(n,!0),this.gv=n,this.D.emit("touchStart",this,t),jt(t)},this.Vt=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:n}=this.fv(this.av,i);this.mv=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Av(n,s),this.gv=n,this.D.emit("touchMove",this,t),jt(t)},this.zt=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:n}=this.fv(this.av,i);this.mv=void 0,this.pv(n,s),this.nv&&this.us.ls.ws(n,!1),this.gv=void 0,this.D.emit("touchEnd",this,t),jt(t)},this.fs.zn||this.fs.Vn||this.fs.Jn||this.us.As(3),this.th=!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.yv=i.wp("mapChart plotting",0),this.onResize(this.lv),this.ng.Bh("Map Chart");const h=Dt(o?o.autoCursorBuilder:void 0,fh);this.Sv=h.Xg(i.Tp(),this.dt,this.dt,this.qi).setVisible(!1),this.vv=this.es.gA(),this.ig(r,this.uiScale),this.xv=this.yv.bv(this.dt).setMouseInteractions(this.Yi).setMouseEnterEventHandler(((t,e,i)=>this.wt(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseClickEventHandler(((t,e,i)=>this.kt(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseUpEventHandler(((t,e,i)=>this.It(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.Pt(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Bt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,n,r)=>this.Dt(e,i,s,n,r))).setMouseDragStopEventHandler(((t,e,i,s,n)=>this.Lt(e,i,s,n))).setMouseWheelEventHandler(((t,e,i)=>this.Rt(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Et(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Vt(e,i))).setTouchEndEventHandler(((t,e,i)=>this.zt(e,i))).ke(this.qi.mapChartFillStyle).Ce(this.qi.mapChartStrokeStyle),this.Mv=this.yv.bv(this.dt).setMouseInteractions(this.Yi).ke(this.qi.mapChartOutlierRegionFillStyle).Ce(this.qi.mapChartOutlierRegionStrokeStyle);const l=Dt(o&&o.type,cl.World);this.dv=l,this._v(l).then((()=>{this.D.emit("mapDataReady")}))}getRegionUnderMouse(){return this.gv}setFillStyle(t){return this.xv.ke(t),this.us.bs(),this}getFillStyle(){return this.xv.Lh()}setStrokeStyle(t){return this.xv.Ce(t),this.us.bs(),this}getStrokeStyle(){return this.xv._o()}setEffect(t){return this.vv.xs(t),this.us.bs(),this}getEffect(){return this.vv.Ms()}setOutlierRegionFillStyle(t){return this.Mv.ke(t),this.us.bs(),this}getOutlierRegionFillStyle(){return this.Mv.Lh()}setOutlierRegionStrokeStyle(t){return this.Mv.Ce(t),this.us.bs(),this}getOutlierRegionStrokeStyle(){return this.Mv._o()}setSeparateRegionFillStyle(t){return this.sv="function"==typeof t?t(this.sv):t,this.tv.forEach((t=>t.ke(this.sv))),this.us.bs(),this}getSeparateRegionFillStyle(){return this.sv}setSeparateRegionStrokeStyle(t){return this.ev="function"==typeof t?t(this.ev):t,this.tv.forEach((t=>t.Ce(this.ev))),this.us.bs(),this}getSeparateRegionStrokeStyle(){return this.ev}invalidateRegionValues(t){if(!this.av||!this.wv)return this.Cv=this.Cv||[],this.Cv.push(t),this;if("function"==typeof t)for(let e=0;e{t.kv(n)}))}}else for(const e of t)if(e)for(let t=0;t{t.kv(e.value)}))}}return this.us.bs(),this}setAutoCursor(t){return this.Sv&&t(this.Sv),this.us.bs(),this}getAutoCursor(){return this.Sv}setAutoCursorMode(t){return this.hv=t,this.us.bs(),this}getAutoCursorMode(){return this.hv}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}getCursorResultTableFormatter(){return this.xp}onMouseDragStart(t){return this.D.on("mouseDragStart",t)}onMouseDrag(t){return this.D.on("mouseDrag",t)}onMouseDragStop(t){return this.D.on("mouseDragStop",t)}onMouseWheel(t){return this.D.on("mouseWheel",t)}onTouchStart(t){return this.D.on("touchStart",t)}onTouchMove(t){return this.D.on("touchMove",t)}onTouchEnd(t){return this.D.on("touchEnd",t)}offTouchStart(t){return this.D.off(t,"touchStart")}offTouchMove(t){return this.D.off(t,"touchMove")}offTouchEnd(t){return this.D.off(t,"touchEnd")}setMouseInteractions(t){return this.Yi=t,this.xv.setMouseInteractions(t),this}getMouseInteractions(){return this.Yi}setHighlight(t){var e;return t=Ae(t),this.rv=t,null===(e=this.av)||void 0===e||e.regions.forEach((e=>{this.us.ls.ws(e,t)})),this.D.emit("highlight",this,t),this}getHighlight(){return this.rv}setAnimationHighlight(t){var e;return null===(e=this.av)||void 0===e||e.regions.forEach((e=>{this.us.ls.Cs(e,t)})),this}getAnimationHighlight(){var t;return this.us.ls.ks(null===(t=this.av)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.nv=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.nv}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}offMapDataReady(t){return this.D.off(t,"mapDataReady")}offViewChange(t){return this.D.off(t,"viewChange")}async _v(t){const e=await((t,e)=>{let i;if(t===cl.World)i="countries_world.json";else if(t===cl.NorthAmerica)i="countries_northAmerica.json";else if(t===cl.SouthAmerica)i="countries_southAmerica.json";else if(t===cl.Africa)i="countries_africa.json";else if(t===cl.Europe)i="countries_europe.json";else if(t===cl.Asia)i="countries_asia.json";else if(t===cl.USA)i="states_usa.json";else if(t===cl.Canada)i="territoriesProvinces_canada.json";else{if(t!==cl.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw St.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return St.fetch(s).then((t=>t.json())).catch((t=>{Te(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.fs.Xs);this.wv=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.Mv.Lr().Rl(e);if(t===cl.USA){const t=25.8,e=29.7;this.tv.push(this.yv.Te(this.dt).setMouseInteractions(!1).ke(this.sv).Ce(this.ev).Ie({x:-126,y:t}).q({x:10,y:e-t}),this.yv.Te(this.dt).setMouseInteractions(!1).ke(this.sv).Ce(this.ev).Ie({x:-113,y:t}).q({x:7,y:e-t}))}const s=this.us.ls.Br(this.xv,{animationEnabled:this.th});for(let i=0;i{o.forEach((e=>e.cs(t)))}))}if(this.vv.ps([this.xv]),this.uv=i,this.cv(t,this.dt,i),this.av=e,this.Cv){for(const t of this.Cv)this.invalidateRegionValues(t);this.Cv=void 0}this.us.bs()}cv(t,e,i){const s=yl[t],n=e.x.getCellSize(),r=e.y.getCellSize()/n,o={min:{x:i.min.x,y:i.min.y},max:{x:i.max.x,y:i.max.y}};if(rs){const t=(o.max.y-o.min.y)*(r/s-1);o.min.y-=t/2,o.max.y+=t/2}e.x.J(o.min.x,o.max.x),e.y.J(o.min.y,o.max.y);const a=this.dt.x.li(),h=this.dt.y.li();this.D.emit("viewChange",{latitudeRange:{start:o.min.y,end:o.max.y},longitudeRange:{start:o.min.x,end:o.max.x},margin:{top:h[1],bottom:h[0],left:a[0],right:a[1]}})}Av(t,e){this.Tv={region:t,iRegion:e},this.us.bs()}pv(t,e){this.Tv&&t===this.Tv.region&&(this.Tv=void 0,this.us.bs())}fv(t,e){const i=Array.from(this.ov.entries()).findIndex((([t,i])=>i.includes(e)));return{iRegion:i,region:null==t?void 0:t.regions[i]}}setAnimationsEnabled(t){return this.th=!t,this}getAnimationsEnabled(){return this.th}getMinimumSize(){}Sd(){return[this]}Fe(t){super.Fe(t),super.tg(),Wa.cg(this.ng,this.eg);const e=p(this.dt.x.ei(),this.dt.y.ei(),this.dt.x.ri(),this.dt.y.ri());this.yv.ES(e);const i=this.us.Bn()||this.mv;if(this.Tv&&i){const t=this.wv&&this.wv[this.Tv.iRegion];let e=ut(i,this.engine.scale,this.dt);e={x:kt(e.x,this.dt.x.getInnerStart(),this.dt.x.getInnerEnd()),y:kt(e.y,this.dt.y.getInnerStart(),this.dt.y.getInnerEnd())};let s=e.x,n=e.y;const r=this.Tv.region.transform;this.Tv.region.outlier&&r&&(s=(s-r.translate.x-r.vertexBoundaries.min.x)/r.scale.x+r.vertexBoundaries.min.x,n=(n-r.translate.y-r.vertexBoundaries.min.y)/r.scale.y+r.vertexBoundaries.min.y),this.Sv.setPosition(e).setVisible(!0).getResultTable().setContent(this.xp(new Za,this.Tv.region,t,s,n,this).fc())}else this.Sv.setVisible(!1);return this.Sv.Ds().Fe(),this}dispose(){return this.yv.W(),this.Sv.dispose(),Oa(this.dt),super.dispose()}j(){return super.j(),this.dt.j(),this}Z(){return super.Z(),this.dt.Z(),this}ld(){return he(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))),ae(t,this.qi,i,{fill:this.getFillStyle()}),this}}const xl=(t,e,i,s,n,r)=>(t.addRow(`${e.name}`).addRow(Sl(s,n)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),Sl=(t,e)=>{const i=t>0,s=e>0;return`${[ue(Math.abs(0|t),2),"° ",ue(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[ue(Math.abs(0|e),2),"° ",ue(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`};class bl extends qs{constructor(t,e,i,s,n,r,o,a,h){super(t,e,e.Fv(i),s,n,{numeric:e.Iv({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.Iv({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.Iv({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.Pv=r,this.Dv=o,this.Bv=a,this.es=h,this.Lv=i,this.Rv=e.Iv({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.Dh=a.kr(i).setMouseInteractions(!1).Vh(e.Iv({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).ke(e.Iv({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Nh=this.es.gA([this.Dh]).xs(s.effectsText)}setTickStrategy(t,e){return super.kh(t,e)}setStrokeStyle(t){return this.Rv="function"==typeof t?t(this.Rv):t,this.Dv.bs(),this}getStrokeStyle(){return this.Rv}ar(t,e){return new vl(e,t,this.Lv,this.Bv,this.Bv,this.Ev(this.Pv,this.Lv),this.Bv.Ve(this.Lv).setMouseInteractions(!1))}lr(t,e){const i=this.Vv(this.Lv,t);this.zv&&!1===this.zv(t)?t.Ye.setVisible(!1):t.Ye.setVisible(!0).Ie(ni(this.Ov(this.Lv,t.S),i.padding)).Ja(i.alignment).zh(i.rotation).Ha(i.offset.x,i.offset.y),this.Nv(this.Lv,t.Gv,t.Wv,t)}setMouseInteractions(t){return this}Fe(){this.Jh({physicalAxisSize:0});const t=this.dr(((t,e)=>{const i=e.Sh.nr,s=.5*this.Rv.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Ye.Ds().oi().y/this.Lv.Wi().y)+i.labelPadding;return Math.max(t,s)}),0);return this.Uv(this.Lv,this.Rv,t),this.Yv(this.Lv,this.Dh,t),t}}class vl extends Zo{constructor(t,e,i,s,n,r,o,a){super(t,e,s,i,n,i,a),this.Gv=r,this.Wv=o,r.setMouseInteractions(!1),this.ts.push(r,o)}}class Ml extends bl{constructor(t,e,i,s,n,r,o,a,h){super(t,Tl((()=>this.vA())),e,i,s,n,r,o,a),this.pm=this.Dv.Ve(this.Lv).setMouseInteractions(!1),this.Hv=h,this.setScrollStrategy(Rs.expansion),this.setTickStrategy(Vs.Numeric),this.setTitle("Amplitude")}vA(){return this.Hv()}br(t,e){return Jo(t,e,this.Lv.y)}_r(t,e,i){const s=2*(e-t),n=this.Lv.x.Li(s);return{min:t-i*n,max:e+i*n}}Ov(t,e){return{x:t.$v()?e-t.Xv().start:t.Xv().start-e,y:0}}Ev(t,e){return t.Fc(e)}Nv(t,e,i,s){const n=s.Sh.nr,r=t.$v()?s.S-t.Xv().start:t.Xv().start-s.S;Et(s.S,t.Xv().start)||Et(s.S,t.Xv().end)?e.setVisible(!1):e.setVisible(!0).vu(0).ze(360).wu(void 0)._u(0).xu(r).wu(60).ke(V).Ce(n.gridStrokeStyle);const o=.5*this.Rv.getThickness();i.Oe({x:r,y:-o*t.Wi().y}).ze({x:r,y:-(o+n.tickLength)*t.Wi().y}).Ee(n.tickStyle)}Vv(t,e){const i=e.Sh.nr;return{alignment:{x:0,y:1},padding:{x:0,y:t.Wi().y*-(.5*this.Rv.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}Uv(t,e,i){const s=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;this.pm.Oe({x:0,y:0}).ze({x:s,y:0}).Ee(e)}Yv(t,e,i){const s=t.$v()?(t.Xv().start+t.Xv().end)/2-t.Xv().start:t.Xv().start-(t.Xv().start+t.Xv().end)/2;e.Ja({x:0,y:1}).Ie({x:s,y:-i*t.Wi().y})}}const Tl=t=>({...Oh(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),Fv:t=>({getInnerStart:()=>t.Xv().start,getInnerEnd:()=>t.Xv().end,J:(e,i)=>t.jv(e,i),nt:(e,i,s,n,r)=>t.y.nt(e,i,s,n,r)}),Iv:t=>t.amplitude});class wl extends bl{constructor(t,e,i,s,n,r,o,a){super(t,kl,e,i,s,n,r,o,a),this.Zv=90,this.Qv=12,this.Jv=El,this.pm=this.Dv.Fc(this.Lv).setMouseInteractions(!1),this.zv=t=>{let e=180*(t.S-this.Lv.Kv())/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.Je=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Zv)}setTickStyle(t){return this.qv="function"==typeof t?t(this.qv):t,this.tx(),this.Dv.bs(),this}getTickStyle(){return this.qv}setTickFormattingFunction(t){return this.Jv=t,this.tx(),this.Dv.bs(),this}getTickFormattingFunction(){return this.Jv}setClockwise(t){this.Lv.ix(t);const e=this.Zv*Math.PI/180;return t?this.Lv.sx(e+Math.PI/2):this.Lv.sx(e-Math.PI/2),this.Dv.bs(),this}getClockwise(){return!this.Lv.hx()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Zv=t;const e=t*Math.PI/180;return this.getClockwise()?this.Lv.sx(e+Math.PI/2):this.Lv.sx(e-Math.PI/2),this.Dv.bs(),this}getNorth(){return 180*this.Lv.Kv()/Math.PI}setDivision(t){return this.Qv=t,this.tx(),this.Dv.bs(),this}getDivision(){return this.Qv}vA(){return[]}br(t,e){return e}_r(t,e,i){return{min:t,max:e}}Ov(t,e){const i=t.hx()?1:-1,s=t.Kv(),n=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;return{x:Math.cos((e-s)*i)*n,y:Math.sin((e-s)*i)*n}}Ev(t,e){return t.Ve(e)}Nv(t,e,i,s){const n=this.qv,r=t.hx()?1:-1,o=t.Kv(),a=(s.S-o)*r,h=Math.cos(a),l=Math.sin(a),u=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end,c={x:h*u,y:l*u};e.Oe({x:0,y:0}).ze(c);const d={x:c.x+h*n.tickLength*t.Wi().x,y:c.y+l*n.tickLength*t.Wi().y};i.Oe(c).ze(d),e.Ee(n.gridStrokeStyle),i.Ee(n.tickStyle)}Vv(t,e){const i=this.qv,s=t.hx()?1:-1,n=t.Kv();let r,o=(e.S-n)*s;for(;o<0;)o+=2*Math.PI;for(;o>=2*Math.PI;)o-=2*Math.PI;r=o>0&&o<=Math.PI?-o+Math.PI/2:-o-Math.PI/2;const a=i.tickLength+i.tickPadding,h=Math.cos(o)*a*t.Wi().x,l=Math.sin(o)*a*t.Wi().y;return{alignment:{x:0,y:0},padding:{x:h,y:l},rotation:180*r/Math.PI,offset:{x:h,y:l}}}Uv(t,e,i){const s=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;this.pm.vu(0).ze(360)._u(0).xu(s+.5*e.getThickness()*t.Wi().x).wu(360).ke(V).Ce(e)}Yv(t,e,i){const s=t.Kv(),n=this.Vv(t,{S:0+s}),r=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;e.Ja(n.alignment).zh(n.rotation).Ha(n.offset.x,n.offset.y).Ie(ni({x:r,y:0},n.padding))}tx(){this.Yh({He:[],$e:[{Ye:"Radial ticks",wA:0,nr:this.qv,hr:this.Jv,Ir:(t,e,i,s)=>{const n=[],r=2*Math.PI/this.Qv;for(let t=0;t<2*Math.PI;t+=r)n.push(t);return n},xh:{ur:()=>{},bh:()=>!1},Pr:void 0}],We:El,Hh:void 0,$h:void 0})}}const El=(t,e,i)=>(180*t/Math.PI).toFixed(0),kl={pr:()=>{},mr:()=>{},Sr:()=>{},Fv:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,J:(t,e)=>{},nt:(e,i,s,n,r)=>t.x.nt(e,i,s,n,r)}),Iv:t=>t.radial},Cl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),Dl=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class Il extends Ui{constructor(t,e,i,s,n,r){super(e,i,n,r),this._s="Sector",this.nx=0,this.ox=1*Math.PI/2,this.lx=void 0,this.ux=void 0,this.Ts=t,this.Lv=s,this.np=this.Ts.Fc(this.Lv).cs(this.getHighlight()),this.gs(this.np),this.be=n.polarSectorFillStyle,this.Me=n.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.nx=kt(t,0,360),this.Ts.bs(),this}getAngleStart(){return this.nx}setAngleEnd(t){return this.ox=kt(t,0,360),this.Ts.bs(),this}getAngleEnd(){return this.ox}setAmplitudeStart(t){return this.lx=t,this.Ts.bs(),this}getAmplitudeStart(){return this.lx}setAmplitudeEnd(t){return this.ux=t,this.Ts.bs(),this}getAmplitudeEnd(){return this.ux}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ts.bs(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ts.bs(),this}getStrokeStyle(){return this.Me}Fe(){const t=this.Lv.Xv(),e=180*this.Lv.Kv()/Math.PI,i=void 0!==this.lx?kt(this.lx,t.start,t.end):t.start,s=void 0!==this.ux?kt(this.ux,t.start,t.end):t.end,n=this.Lv.$v()?i-t.start:t.start-i,r=this.Lv.$v()?s-t.start:t.start-s,o=Math.min(n,r),a=Math.max(n,r),h=this.Lv.hx()?1:-1,l=Math.abs(this.ox-this.nx);this.np.vu((this.nx-e)*h).ze((this.ox-e)*h)._u(100*o/a).xu(a).ke(this.be).Ce(this.Me).wu(Math.ceil(l/2))}Pe(t,e){t.cs(e),this.Ts.bs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}}class _l extends Ui{constructor(){super(...arguments),this.Lm=!0,this.Ax=!0}setAutoScrollingEnabled(t){return this.Lm=t,this.Ji.us.bs(),this}getAutoScrollingEnabled(){return this.Lm}Gm(){}Fe(){}$p(){}setCursorEnabled(t){return this.Ax=t,this}getCursorEnabled(){return this.Ax}}class Fl extends _l{constructor(t,e,i,s,n,r){super(e,i,n,r),this.Ts=t,this.Ji=e,this.scale=s}getAmplitudeMin(){return this.gx?this.gx.min:void 0}getAmplitudeMax(){return this.gx?this.gx.max:void 0}}const Ll=(t,e,i,s,n)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",n(s)),zl=(t,e)=>{const i=[],s=e.Xv().start,n=e.Xv().end,r=e.$v(),o=e.hx()?1:-1,a=e.Kv(),h=Math.abs(n-s),l=Math.min(s,n)+.001*h,u=Math.max(s,n)-.001*h;for(const e of t){const t=kt(e.amplitude,l,u),n=e.angle*Math.PI/180-a,h=Math.cos(n*o)*(r?t-s:s-t),c=Math.sin(n*o)*(r?t-s:s-t),d=e.color;i.push({x:h,y:c,color:d})}return i},Pl=t=>{const e={min:_e,max:Fe};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},Rl=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),Vl=(t,e)=>{let i=gi(t);for(e.hx()||(i*=-1),i+=180*e.Kv()/Math.PI;i<0;)i+=360;i%=360;const s=ii(t),n=e.Xv(),r=Math.abs(n.end-n.start);return{angle:i,amplitude:Fr(n.start,n.end,s/r)}};class Bl extends Fl{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,r),this._s="Heatmap Series",this.mx=!0,this.$m=!1,this.xp=Ol,this.ld=()=>he(this.be);const a=this.Ji.getSeries().length;this.be=ce(this.qi.polarHeatmapSeriesFillStyle||this.qi.heatmapGridSeriesFillStyle,a);const h=o.amplitudeStart||0,l=o.amplitudeEnd?(o.amplitudeEnd-h)/(o.annuli-1):o.amplitudeStep||1,u={sectors:o.sectors,annuli:o.annuli,amplitudeStart:h,amplitudeStep:l,heatmapDataType:"intensity",dataOrder:o.dataOrder||"annuli"};this.En=u,this.yx=t.Sx(s,[],u).ke(this.be).cs(this.getHighlight()),this.gs(this.yx);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.gx={min:c,max:d},this.setHighlightOnHover(!1)}invalidateIntensityValues(t){if(this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),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.En.dataOrder?t[0].length:t.length,annuli:"annuli"===this.En.dataOrder?t.length:t[0].length},i="annuli"===this.En.dataOrder?this.En.annuli:this.En.sectors,s="annuli"===this.En.dataOrder?this.En.sectors:this.En.annuli;if(e.x>i||e.y>s){if(!0===this.Ji.fs.oo){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.`;St.console.warn(t)}const n=[];for(let e=0;eo||r>a){if(!0===this.Ji.fs.oo){const t=`PolarHeatmapSeries.invalidateIntensityValues intensity matrix overflow.\nMax indexes ${o}x${a}, input ${e.primary}x${e.secondary} starting at [${i},${n}].\nOut of bounds data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const h=Math.max(s-o,0),l=e.primary-h,u=Math.max(r-a,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.yx.oS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:n,values:t.values})}return this.Ts.bs(),this.$m=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.yx.ke(this.be),this.Ts.bs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}clear(){return this.yx.Nt(),this.Ts.bs(),this}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.yx.rS(t),this.Ts.bs(),this}getIntensityInterpolation(){return this.yx.nS()}Dm(){return this.Lm&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){const i=ut(t,this.Ji.engine.scale,this.scale),s=Vl(i,this.scale),n=this.mx?this.yx.vx(s):this.yx.gg(s);if(n)return gh(zl([n],this.scale)[0],this.scale,this.xp(new Za,this,{angleDeg:n.angle,amplitude:n.amplitude,intensity:n.cellValue,iAnnulus:n.iAnnulus,iSector:n.iSector},this.Ji.getAmplitudeAxis().formatValue).fc(),this,this.be)}solveNearestFromScreen(t){return this.gg($o(t,this.Ji.us),!1)}Fe(){}attach(t,e=!0,i=!1){return super.attach(t,e),ae(t,this.qi,i,{fill:this.be}),this}}const Ol=(t,e,i,s)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i.angleDeg).toString()).addRow("Amplitude","",s(i.amplitude)).addRow("Intensity","",i.intensity.toFixed(1));class Nl extends Fl{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,o),this._s="Line Series",this.xx=[],this.bx=!1,this.Mx=!1,this.xp=Ll,this.Cu=ce(this.qi.polarLineSeriesStrokeStyle,r),this._x=t.zp(s,void 0,[kh.UserSeries]).Ee(this.Cu).cs(this.getHighlight()).pl(Fn.Nearest),this.gs(this._x)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){return 0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.xx=Rl(t),this.bx=!0,this.gx=Pl(this.xx),this.Ts.bs(),this}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;return this._x.Ee(e),this.Ts.bs(),this}getStrokeStyle(){return this.Cu}setConnectDataAutomaticallyEnabled(t){return this.Mx=t,this.Ts.bs(),this}getConnectDataAutomaticallyEnabled(){return this.Mx}Dm(){return this.Lm&&this.xx.length>0&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){return this.wx(t,this._x)}solveNearestFromScreen(t){return this.wx($o(t,this.Ji.us),this._x)}wx(t,e){const i=e.Cx(t);if(!i)return;const{angle:s,amplitude:n}=Vl(i,this.scale);return gh(i,this.scale,this.xp(new Za,this,s,n,this.Ji.getAmplitudeAxis().formatValue).fc(),this,this.Cu.getFillStyle())}Fe(){if(this.bx||this.scale.kx()){const t=zl(this.xx,this.scale),e=je(t);this.Mx?(t.push({...t[0]}),this._x.tu(!0)):this._x.tu(!1),this._x.Nt()._l(t).ra(e),this.bx=!1,this._x.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{stroke:this.Cu}),this}}class Ul extends Fl{constructor(t,i,s,n,r,o,a){super(t,i,s,n,r,a),this._s="Point Line Series",this.xx=[],this.bx=!1,this.Mx=!1,this.Tx=3,this.Fa=0,this.Fx=e.PointShape.Circle,this.xp=Ll,this.be=ce(this.qi.polarPointLineSeriesFillStyle,o),this.Cu=ce(this.qi.polarPointLineSeriesStrokeStyle,o),this._x=t.zp(n,void 0,[kh.UserSeries]).Ee(this.Cu).cs(this.getHighlight()).pl(Fn.Nearest),this.gs(this._x),this.zc=t.Oc(n).ke(this.be).Sl(this.Fx).q(this.Tx).cs(this.getHighlight()).pl(Fn.Nearest),this.gs(this.zc)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){return 0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.xx=Rl(t),this.bx=!0,this.gx=Pl(this.xx),this.Ts.bs(),this}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;return this._x.Ee(e),this.Ts.bs(),this}getStrokeStyle(){return this.Cu}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.zc.ke(e),this.Ts.bs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.Tx=t,this.zc.q(t),this.Ts.bs(),this}getPointSize(){return this.Tx}setPointShape(t){return this.Fx=t,this.zc.Sl(this.Fx),this}getPointShape(){return this.Fx}setPointRotation(t){return this.Fa=t,this.zc.zh(t),this.Ts.bs(),this}getPointRotation(){return this.Fa}setConnectDataAutomaticallyEnabled(t){return this.Mx=t,this.Ts.bs(),this}getConnectDataAutomaticallyEnabled(){return this.Mx}Dm(){return this.Lm&&this.xx.length>0&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){return this.wx(t,this._x)}solveNearestFromScreen(t){return this.wx($o(t,this.Ji.us),this._x)}wx(t,e){const i=e instanceof Qn?e.gg(t):e.Cx(t);if(!i)return;const{angle:s,amplitude:n}=Vl(i,this.scale);return gh(i,this.scale,this.xp(new Za,this,s,n,this.Ji.getAmplitudeAxis().formatValue).fc(),this,"color"in i&&W(this.be)?new U({color:i.color}):this.be)}Fe(){if(this.bx||this.scale.kx()){const t=zl(this.xx,this.scale),e=je(t);this.Mx?(t.push({...t[0]}),this._x.tu(!0)):this._x.tu(!1),this._x.Nt()._l(t).ra(e),this.zc.Nt()._l(t).ra(e),this.bx=!1,this._x.Ds(),this.zc.Ds()}}yd(){return this.Fx}}class Gl extends Fl{constructor(t,i,s,n,r,o,a){super(t,i,s,n,r,a),this._s="Point Series",this.xx=[],this.bx=!1,this.Tx=3,this.Fa=0,this.Fx=e.PointShape.Circle,this.xp=Ll,this.be=ce(this.qi.polarPointSeriesFillStyle,o),this.zc=t.Oc(n).ke(this.be).Sl(this.Fx).q(this.Tx).cs(this.getHighlight()).pl(Fn.Nearest),this.gs(this.zc)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){return 0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.xx=Rl(t),this.bx=!0,this.gx=Pl(this.xx),this.Ts.bs(),this}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.zc.ke(e),this.Ts.bs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.Tx=t,this.zc.q(t),this.Ts.bs(),this}getPointSize(){return this.Tx}setPointShape(t){return this.Fx=t,this.zc.Sl(this.Fx),this}getPointShape(){return this.Fx}setPointRotation(t){return this.Fa=t,this.zc.zh(t),this.Ts.bs(),this}getPointRotation(){return this.Fa}Dm(){return this.Lm&&this.xx.length>0&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){const i=this.zc.gg(t);if(!i)return;const{angle:s,amplitude:n}=Vl(i,this.scale);return gh(i,this.scale,this.xp(new Za,this,s,n,this.Ji.getAmplitudeAxis().formatValue).fc(),this,"color"in i&&W(this.be)?new U({color:i.color}):this.be)}solveNearestFromScreen(t){return this.gg($o(t,this.Ji.us),!1)}Fe(){if(this.bx||this.scale.kx()){const t=zl(this.xx,this.scale),e=je(t);this.zc.Nt()._l(t).ra(e),this.bx=!1,this.zc.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.be}),this}yd(){return this.Fx}}class Wl{constructor(t,e,i,s){this.D=new n.Eventer,this.Ix=!1,this.Ji=t,this.Px=e,this.iy=i,this.el=s}setGeometry(t){return this.Dx=t,this.Ix=!0,this.Ji.us.bs(),this}getGeometry(){return this.Dx}setMouseInteractions(t){return this.el.setMouseInteractions(t),this}dispose(){return this.el.dispose(),this.Px(this),this.D.emit("dispose",this),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setVisible(t){const e=this.el.getVisible()!==t;return this.el.setVisible(t),e&&this.D.emit("visibleStateChanged",this,t),this.Ji.us.bs(),this}getVisible(){return this.el.getVisible()}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}}const Yl=(t,e,i)=>{const s=e.dt,n=i.dt;let r=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-n.getInnerStart())/(n.getInnerEnd()-n.getInnerStart());return 1===i.sA&&(r=1-r),1===e.sA&&(o=1-o),u(o,r)};class Hl extends ih{constructor(t,e,i,s,n,r,o,a){super(t,e,Pi(i.dt,s.dt),n,a),this.Bx=!1,this.Lx=!1,this.Rx=!0,this.Ex=!0,this.Vx=!1,this.zx=!1,this.setGridStrokeYStyle=t=>(this.Ox.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.Ox.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.Nx=r,this.Gx=o,this.Wx=this.axisX.FA(!1,this.Nx).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.Ox=this.axisY.FA(!1,this.Gx).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.Wx.dispose(),this.Ox.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(ut(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.Wx.setValue(t.x),this.Ox.setValue(t.y);const e=Yl(u(this.Wx.getValue(),this.Ox.getValue()),this.axisX,this.axisY);return this.Wx.setGridStrokeLength(this.Vx?e.x:1),this.Ox.setGridStrokeLength(this.zx?e.y:1),this}Fe(){this.Wx.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Bx),this.Ox.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Lx);const t=Yl(u(this.Wx.getValue(),this.Ox.getValue()),this.axisX,this.axisY);return this.Wx.setGridStrokeLength(this.Vx?t.x:1),this.Ox.setGridStrokeLength(this.zx?t.y:1),super.Fe()}setGridStrokeXCut(t){return this.Vx=t,this.Ts.bs(),this}getGridStrokeXCut(){return this.Vx}setGridStrokeYCut(t){return this.zx=t,this.Ts.bs(),this}getGridStrokeYCut(){return this.zx}setGridStrokeXStyle(t){return this.Wx.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.Wx.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.Bx=t,this.Ts.bs(),this}getTickMarkerXVisible(){return this.Bx}setTickMarkerYVisible(t){return this.Lx=t,this.Ts.bs(),this}getTickMarkerYVisible(){return this.Lx}setTickMarkerX(t){return this.Wx.setMarker(t),this}setTickMarkerY(t){return this.Ox.setMarker(t),this}getTickMarkerX(){return this.Wx.getMarker()}getTickMarkerY(){return this.Ox.getMarker()}}class Xl extends eh{constructor(t,e,i,s,n,r,o){super(t,e,i,s,o),this.Vx=!1,this.zx=!1,this.Ux=!1,this.Yx=!1,this.Hx=new Map,this.$x=new Map,this.Bx=!0,this.Lx=!0,this.Og=s,this.Nx=n,this.Gx=r,this.Xx=o.cursorGridStrokeStyleX,this.jx=o.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.Hx.forEach((t=>t.dispose())),this.$x.forEach((t=>t.dispose())),this.Zx=void 0,this.Qx=void 0,this}Fe(){return this.Zx&&this.Zx.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Bx),this.Qx&&this.Qx.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Lx),super.Fe()}pointAt(t){const{location:e}=t,i=t.owner instanceof ru&&t.owner;if(!i)return this;const{axisX:s}=i,{axisY:n}=i,r=this.Ah(s,!0),o=this.Ah(n,!1);r!==this.Zx&&this.Zx&&this.Zx.setVisible(!1),o!==this.Qx&&this.Qx&&this.Qx.setVisible(!1),r.setValue(e.x),o.setValue(e.y);const a=Yl(u(e.x,e.y),s,n);return r.setGridStrokeLength(this.Vx?a.x:1),o.setGridStrokeLength(this.zx?a.y:1),this.Zx=r,this.Qx=o,super.pointAt(t)}Ug(t){if(super.Ug(t),t){const e=e=>e.setTextFillStyle(t);this.Zx&&this.Ux&&this.Zx.setMarker(e),this.Qx&&this.Yx&&this.Qx.setMarker(e)}}Ah(t,e){let i=(e?this.Hx:this.$x).get(t);return i||(e?(i=t.FA(!1,this.Nx),this.Hx.set(t,i)):(i=t.FA(!1,this.Gx),this.$x.set(t,i)),this.rr(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}rr(t,e){const i=e?this.Xx:this.jx;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.Bx:this.Lx)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.Vx=t,this.Ts.bs(),this}getGridStrokeXCut(){return this.Vx}setGridStrokeYCut(t){return this.zx=t,this.Ts.bs(),this}getGridStrokeYCut(){return this.zx}setGridStrokeXStyle(t){return this.Xx=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.Hx.forEach((t=>t.setGridStrokeStyle(this.Xx))),this}getGridStrokeXStyle(){return this.Xx}setGridStrokeYStyle(t){return this.jx=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.$x.forEach((t=>t.setGridStrokeStyle(this.jx))),this}getGridStrokeYStyle(){return this.jx}setTickMarkerXVisible(t){return this.Bx=t,this.Ts.bs(),this}getTickMarkerXVisible(){return this.Bx}setTickMarkerYVisible(t){return this.Lx=t,this.Ts.bs(),this}getTickMarkerYVisible(){return this.Lx}setTickMarkerX(t){return this.Hx.forEach((e=>e.setMarker(t))),this.Nx=this.Nx.addStyler(t),this.Ts.bs(),this}setTickMarkerY(t){return this.$x.forEach((e=>e.setMarker(t))),this.Gx=this.Gx.addStyler(t),this.Ts.bs(),this}setTickMarkerXAutoTextStyle(t){return this.Ux=t,this.Ts.bs(),this}getTickMarkerXAutoTextStyle(){return this.Ux}setTickMarkerYAutoTextStyle(t){return this.Yx=t,this.Ts.bs(),this}getTickMarkerYAutoTextStyle(){return this.Yx}}class jl extends sh{constructor(t,e,i,s){super(t,s),this.Og=t,this.Nx=e,this.Gx=i,this.Yg=s}}class $l extends jl{constructor(){super(...arguments),this.$g=(t,e,i,s)=>this.Hg(new Xl(t,e,i,this.Og,this.Nx,this.Gx,s),s),this.addStyler=t=>new $l(this.Og,this.Nx,this.Gx,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new $l(t,this.Nx,this.Gx,this.Yg.map((t=>t)))}}class ql extends jl{constructor(){super(...arguments),this.Xg=(t,e,i,s,n)=>this.Hg(new Hl(t,e,i,s,this.Og,this.Nx,this.Gx,n),n),this.addStyler=t=>new ql(this.Og,this.Nx,this.Gx,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ql(t,this.Nx,this.Gx,this.Yg.map((t=>t)))}}const Jl=new $l(ro,Xo.PointableTextBox,Xo.PointableTextBox,[(t,e)=>{oh(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),yr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),yr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Kl=new ql(ro,Xo.PointableTextBox,Xo.PointableTextBox,[(t,e)=>{ah(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),yr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),yr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Zl=new ql(ro,Xo.PointableTextBox,Xo.PointableTextBox,[(t,e)=>{((t,e)=>{t.setPointMarker((t=>t.setFillStyle(e.seriesMarkerPointMarkerFillStyle).setSize(e.seriesMarkerPointMarkerSize).setShape(e.seriesMarkerPointMarkerShape))).setResultTable((t=>t.setEffect(!0).setBackground((t=>t)).setOrigin(u(-1,-1)).setMargin(10)))})(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),yr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),yr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Ql=(t,i,s)=>{switch(t){case e.UIVisibilityModes.always:return!0;case e.UIVisibilityModes.never:return!1;case e.UIVisibilityModes.whenDragged:return s;case e.UIVisibilityModes.whenHovered:return i&&!s;case e.UIVisibilityModes.whenHoveredOrDragged:return s||i;case e.UIVisibilityModes.whenNotDragged:return!s;default:return!1}},tu=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class eu{constructor(t,i,s,r,o,a){this.Jx=e.UIVisibilityModes.always,this.Kx=e.UIVisibilityModes.always,this.jo=!0,this.$i=!1,this.qx=!1,this.tb=!1,this.wa=u(0,0),this.Nu=e.UIDraggingModes.draggable,this.Gu=void 0,this.D=new n.Eventer,this.Xi=!0,this.ib=(t,i,s)=>{this.qx=!0,this.Ts.bs();const n=this.Nu===e.UIDraggingModes.notDraggable?this.Nu:s||this.Nu;this.Gu=this.Ts.us.Er(n===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:n===e.UIDraggingModes.draggable?e.MouseStyles.Move:n===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical)},this.sb=()=>{this.qx=!1,this.Ts.bs(),this.Ts.us.Vr(this.Gu)},this.eb=(t,e)=>{this.tb=!0,jt(e),this.Ts.bs()},this.hb=(t,i)=>{if(this.Nu!==e.UIDraggingModes.notDraggable){const s=i||this.Nu,n=ut(this.Ts.us.De(t.x,t.y),this.Ts.us.dt,this.scale),r=u(s!==e.UIDraggingModes.onlyVertical?tu(n.x,this.scale.x):this.wa.x,s!==e.UIDraggingModes.onlyHorizontal?tu(n.y,this.scale.y):this.wa.y);return this.setPosition(r),!0}return!1},this.rb=(t,e)=>{this.tb=!1,jt(e),this.Ts.bs()},this.onDispose=t=>this.D.on("dispose",t),this.offDispose=t=>this.D.off(t,"dispose"),this.Ts=t,this.renderingScale=i,this.scale=s,this.Sv=r,this.nb=o,this.qi=a;const h=r.getPointMarker().setMouseInteractions(!0);h.onMouseEnter(((t,e)=>this.ib(t,e))),h.onMouseLeave(this.sb),h.onMouseDragStart(this.eb),h.onMouseDrag(((t,e)=>this.hb(u(e.clientX,e.clientY))&&jt(e))),h.onMouseDragStop(this.rb),h.onTouchStart(this.eb),h.onTouchMove(((t,e)=>this.hb(u(e.clientX,e.clientY))&&jt(e))),h.onTouchEnd(this.rb),r.getResultTable().setMouseInteractions(!0),this.setPosition(this.wa)}setPosition(t){return this.wa=t,this.Sv.setPosition(t),this.D.emit("positionChange",this,this.wa),this}getPosition(){return this.wa}onPositionChange(t){return this.D.on("positionChange",t)}offPositionChange(t){return this.D.off(t,"positionChange")}setPointMarkerVisibility(t){return this.Jx=t,this.Ts.bs(),this}getPointMarkerVisibility(){return this.Jx}setResultTableVisibility(t){return this.Kx=t,this.Ts.bs(),this}getResultTableVisibility(){return this.Kx}setMouseInteractions(t){return this.jo=t,this.Sv.getPointMarker().setMouseInteractions(t),this.Sv.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.jo}setAutoFitStrategy(t){return this.Sv.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.Sv.getAutoFitStrategy()}isAttached(){return!0}Fe(){const t=this.isAttached();return Ql(this.Jx,this.qx,this.tb)?this.Sv.setPointMarkerVisible(!0):this.Sv.setPointMarkerVisible(!1),t&&Ql(this.Kx,this.qx,this.tb)?this.Sv.setResultTableVisible(!0):this.Sv.setResultTableVisible(!1),this.Sv.Fe(),this}Ds(){return this.Sv.Ds(),this}pointAt(t){return this.Sv.pointAt(t),this}dispose(){return this.$i||(this.$i=!0,this.nb(this),this.Sv.dispose(),this.D.emit("dispose")),this}setVisible(t){const e=this.Xi!==t;return this.Xi=t,this.Sv.setVisible(t),e&&this.D.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}setPointMarker(t){return this.Sv.setPointMarker(t),this}getPointMarker(){return this.Sv.getPointMarker()}setResultTable(t){return this.Sv.setResultTable(t),this}getResultTable(){return this.Sv.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Nu=t,this.Ts.bs(),this}getDraggingMode(){return this.Nu}}class iu extends eu{constructor(t,i,s,n,r,o,a){super(t,i,Pi(s.dt,n.dt),r.Xg(t,i,s,n,a),o,a),this.ob=e.UIVisibilityModes.always,this.ab=e.UIVisibilityModes.always,this.lb=e.UIVisibilityModes.always,this.ub=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.Sv.getGridStrokeXStyle(),this.gridStrokeStyleY=this.Sv.getGridStrokeYStyle(),this.Ts=t,this.axisX=s,this.axisY=n,this.nb=o;const h=this.Sv.getTickMarkerX().setMouseInteractions(!0);h.onMouseEnter(((t,i)=>this.ib(t,i,e.UIDraggingModes.onlyHorizontal))),h.onMouseLeave(this.sb),h.onMouseDragStart(this.eb),h.onMouseDrag(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&jt(i))),h.onMouseDragStop(this.rb),h.onTouchStart(this.eb),h.onTouchMove(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&jt(i)));const l=this.Sv.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.ib(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.sb),l.onMouseDragStart(this.eb),l.onMouseDrag(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&jt(i))),l.onMouseDragStop(this.rb),l.onTouchStart(this.eb),l.onTouchMove(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&jt(i)))}Fe(){const t=this.isAttached();return this.Xi&&t&&Ql(this.lb,this.qx,this.tb)?this.Sv.setTickMarkerXVisible(!0):this.Sv.setTickMarkerXVisible(!1),this.Xi&&t&&Ql(this.ub,this.qx,this.tb)?this.Sv.setTickMarkerYVisible(!0):this.Sv.setTickMarkerYVisible(!1),this.Sv.setGridStrokeXStyle(this.Xi&&t&&Ql(this.ob,this.qx,this.tb)?this.gridStrokeStyleX:nt),this.Sv.setGridStrokeYStyle(this.Xi&&t&&Ql(this.ab,this.qx,this.tb)?this.gridStrokeStyleY:nt),super.Fe()}setGridStrokeXVisibility(t){return this.ob=t,this.Ts.bs(),this}getGridStrokeXVisibility(){return this.ob}setGridStrokeYVisibility(t){return this.ab=t,this.Ts.bs(),this}getGridStrokeYVisibility(){return this.ab}setTickMarkerXVisibility(t){return this.lb=t,this.Ts.bs(),this}getTickMarkerXVisibility(){return this.lb}setTickMarkerYVisibility(t){return this.ub=t,this.Ts.bs(),this}getTickMarkerYVisibility(){return this.ub}setGridStrokeXCut(t){return this.Sv.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.Sv.getGridStrokeXCut()}setGridStrokeYCut(t){return this.Sv.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.Sv.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.Sv.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.Sv.getGridStrokeYStyle()}setTickMarkerX(t){return this.Sv.setTickMarkerX(t),this}getTickMarkerX(){return this.Sv.getTickMarkerX()}setTickMarkerY(t){return this.Sv.setTickMarkerY(t),this}getTickMarkerY(){return this.Sv.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.Sv.getTickMarkerX().setMouseInteractions(t),this.Sv.getTickMarkerY().setMouseInteractions(t),this}}class su extends iu{}class nu extends su{constructor(t,e,i,s,n,r){super(t,e,i.axisX,i.axisY,s,n,r),this.cb=!1,this.Ts=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.cb=!1,this.Ts.bs(),this}Ds(){if(!this.cb){const t=this.owningSeries.solveNearestFromScreen(ut(this.wa,this.scale,this.Ts.us.dt));t?(this.wa=ut(t.location,this.owningSeries.scale,this.scale),this.Sv.pointAt(t),this.cb=!0):this.Sv.setPosition(this.wa)}return super.Ds()}isAttached(){return this.cb}}class ru extends _l{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,h,l),this.fb=[],this.addMarker=(t=Zl)=>{const e=new nu(this.Ab(),this.Ji.uiScale,this,t,this.removeMarker,this.qi);return this.fb.push(e),e},this.removeMarker=t=>{const e=this.fb.indexOf(t);-1!==e&&this.fb.splice(e,1)},this.ts=new Map,this.chart=t,this.Ts=i,this.axisX=s,this.axisY=n,this.axisXAttachHandler=r,this.axisYAttachHandler=o,this.Ab=a,this.scale=Pi(s.dt,n.dt),this.gb=t.pb,t.pb+=1,this.mb(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.yb),this.onMouseLeave(this.chart.Sb),this.onMouseWheel(this.chart.Em),this.onMouseDragStart(this.chart.vb),this.onMouseDrag(this.chart.Vm),this.onMouseDragStop(this.chart.xb),this.onTouchStart(this.chart.zm.onTouchStart),this.onTouchMove(this.chart.zm.onTouchMove),this.onTouchEnd(this.chart.zm.onTouchEnd)}attacheAxis(){this.bb=this.axisXAttachHandler(this),this.Mb=this.axisYAttachHandler(this)}Fe(){super.Fe();for(let t=0;t{e.da(this.gb)})),this.Ji.us.bs(),this}dispose(){return super.dispose(),this.fb.slice().forEach((t=>t.dispose())),this.bb(this),this.Mb(this),this}_b(){for(let t=0;t{const n=t.length;let r=0;if(void 0!==e){const n=i-e;if(n>0){const e=t.slice(r,n);r+=n,s(e,!0)}}for(;rt))=>{const i=[];let s;for(let n=0;n{const s=void 0!==i?i:0,n=new Array(t.length);for(let i=0;it.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i)).addRow("Y","",e.axisY.formatValue(s));class uu extends ru{constructor(t,i,s,n,r,o,a,h,l,u,c){super(t,i,s,n,r,o,a,h,u,c),this.wb=[],this.Lu=[],this.Cb=0,this.ji=!1,this.Hi=e.HighlightModes.onHover,this.xp=lu,this.ds((t=>t.Vn||t.zn||t.qn?void 0:"xy series")),this.kb=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.Cb=void 0!==e&&e>0?e:0,this.Ts.bs(),this}add(t){if(0!==this.wb.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),Array.isArray(t)?this.Tb(t):this.Tb([t]),this.Lu.length>0){const t=this.Lu[this.Lu.length-1];this.Fb={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.Fb?this.Fb.y+e:0),this.add(((t,e=1,i)=>{const s=void 0!==i?i:0,n=new Array(t.length);for(let i=0;i{const i=new Array(t.length);for(let s=0;st+e.wl()+e.Cl()),this.Lu.length)}clear(){this.Ib=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.kb.getXMax(this.wb,this.Ib)||0}getXMin(){return this.kb.getXMin(this.wb,this.Ib)||0}getYMax(){return this.kb.getYMax(this.wb,this.Ib)||0}getYMin(){return this.kb.getYMin(this.wb,this.Ib)||0}Sr(){const t=u(0,0);for(const e of this.wb)t.x=Math.max(t.x,e.Vl()),t.y=Math.max(t.y,e.zl());return t}Pb(t,e,i,s){this.kb.Pb(t,e,i,s,this.scale,(t=>{}))}Gm(){super.Gm();const t=this.wb.length;this.Db&&this.Pb(this.wb,this.getPointAmount(),this.Db,this.Cb),t!==this.wb.length&&this._b()}Fe(){super.Fe();const t=this.getBoundaries();this.Lu.length>0&&(this.Bb(this.Lu),this.Lu=[]);for(const e of this.wb)e.ra(t);return super.Fe()}$p(){super.$p(),this.Ib=void 0,this.Lu.length=0}Tb(t){0!==t.length&&(this.Ib?this.Ib=qe(this.Ib,je(t)):this.Ib=je(t),this.D.emit("dataAdd",this,t,this.Ib),this.Lu=se(this.Lu,t,{canReturnB:!1}),this.Ts.bs())}Lb(){return au(this.wb)}Rb(t){return this.D.on("dataAdd",t)}Eb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}zb(t){return this.D.off(t)}}const cu=(t,e,i,s)=>{let n,r,o=Number.MAX_VALUE;for(let a=0;a{const e=this.Nb.indexOf(t);e>=0&&this.Nb.splice(e,1);const i=this.Ob.findIndex((e=>e===t.el));i>=0&&this.Ob.splice(i,1),this.Ts.bs()},this.be=ce(this.qi.polarPolygonSeriesFillStyle,r),this.Me=ce(this.qi.polarPolygonSeriesStrokeStyle,r)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}addPolygon(){const t=new Wl(this.Ji,this.Gb,this,this.Wb());return this.Nb.push(t),t}setFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(const t of this.Ob)t.ke(e);return this.Ts.bs(),this}getFillStyle(){return this.be}setStrokeStyle(t){this.Me="function"==typeof t?t(this.Me):t;const e=this.Me;for(const t of this.Ob)t.Ce(e);return this.Ts.bs(),this}getStrokeStyle(){return this.Me}Dm(){return this.Lm&&void 0!==this.Nb.find((t=>void 0!==t.Ub))&&this.getVisible()}Fe(){this.Nb.forEach((t=>{(t.Ix||this.scale.kx())&&t.Yb&&(t.el.Rl(zl(t.Yb,this.scale)),t.Ix=!1,t.el.Ds())}))}Gm(){super.Gm();const t=m(_e,Fe);this.Nb.forEach((e=>{if(!e.Dx)return;const i=!e.Ix&&e.Yb?e.Yb:Rl(e.Dx);e.Yb=i;const s=!e.Ix&&e.Ub?e.Ub:Pl(i);e.Ub=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.gx=t}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){const i=cu(t,this.Ob,((t,e)=>{const i=t.gg(e);if(i)return ut(i,this.scale,t.us.dt)}),We);if(!i)return;const s=ut(i[0],i[1].us.dt,this.scale),n=this.Hb(i[1]);if(!n)return;const{angle:r,amplitude:o}=Vl(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.xp(new Za,this,r,o,this.Ji.getAmplitudeAxis().formatValue).fc(),owner:this,fillStyle:this.be,polarPolygon:n}}solveNearestFromScreen(t){return this.gg($o(t,this.Ji.us),!1)}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}Wb(){const t=this.Ts.vc(this.scale,rr.Simple).ke(this.be).Ce(this.Me).cs(this.getHighlight());return this.Ob.push(t),this.gs(t),t}Hb(t){return this.Nb.find((e=>e.el===t))}}class fu extends Fl{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,o),this._s="Area Series",this.xx=[],this.bx=!1,this.Mx=!1,this.$b=!1,this.xp=Ll,this.be=ce(this.qi.polarAreaSeriesFillStyle,r),this.Me=ce(this.qi.polarAreaSeriesStrokeStyle,r)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const e=(t=>{const e=[];let i,s,n=!1;for(let r=0;r0&&this.getVisible()}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}}class gu extends fu{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,r,o),this.Xb=this.Ts.vc(this.scale,rr.Simple).cs(this.getHighlight()),this.gs(this.Xb)}Fe(){if(this.bx||this.scale.kx()){const t=this.xx,e=!0===this.Mx?zl(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(Et(e.angle,i.angle))return t;const s=1*Math.sign(i.angle-e.angle);let n=0;const r=[];for(let t=i.angle+s;!Et(t%360,e.angle%360);t+=s)if(r.push({angle:t,amplitude:0}),n+=1,n>360)return[];for(let t=0;t=this.jb.start}ix(t){this.Zb=t,this.tM=!0}hx(){return!1===this.Zb}sx(t){this.Qb=t,this.tM=!0}Kv(){return this.Qb}mi(){return this.vi}_i(){return!1}ot(t,e,i,s){return this.x=new Ii(t.x,e.x,i.x,s?s.x:void 0),this.y=new Ii(t.y,e.y,i.y,s?s.y:void 0),this}yi(){return this.di}kx(){return this.qb}eM(){return this.tM}Wi(){return this.iM}j(){return this.o=!1,this.vi=!1,this.qb=!1,this.tM=!1,this}Z(){return this.o=!0,this.vi=!0,this.qb=!0,this.tM=!0,this}q(t,e){return"object"==typeof t?(this.X.x=t.x,this.X.y=t.y):(this.X.x=t,this.X.y=e),this.sM(),this}Ei(t){return this.Jb=t,this.sM(),this}Vi(t){return this.Kb=t,this.sM(),this}ni(){return u(this.Jb[0]+this.Jb[1],this.Kb[0]+this.Kb[1])}oi(){return this.X}sM(){const t=this.jb,e=u(this.x.ai(this.X.x),this.y.ai(this.X.y)),i=this.Jb[0]+this.Jb[1],s=this.Kb[0]+this.Kb[1],n=Math.max(e.x-i,0),r=Math.max(e.y-s,0),o=.5*(n>r?r:n),a=[this.Jb[0]+Math.max((n-2*o)/2,0),this.Jb[1]+Math.max((n-2*o)/2,0)],h=[this.Kb[0]+Math.max((r-2*o)/2,0),this.Kb[1]+Math.max((r-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.q(this.X.x).si(a).J(-l,l),this.y.q(this.X.y).si(h).J(-l,l),this.iM={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.di={x:this.x.yi(),y:this.y.yi()},this.Z()}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 n=this.Wi(),r=ei(t,e);return r.x*=s,r.y*=s,{x:t.x+i*n.x*r.x,y:t.y+i*n.y*r.y}}}class pu extends Kh{constructor(t,i,s,n,r,o,a){super(t,i,s,i.sg("polarChart bg",0),n,i.us.qi.polarChartBackgroundFillStyle,i.us.qi.polarChartBackgroundStrokeStyle,i.us.qi.polarChartTitleFont,i.us.qi.polarChartTitleFillStyle,a),this.coordsClient="client",this.Kd=[],this.jo=!0,this.vp=e.AutoCursorModes.onHover,this.hM=(t,e,i,s,n)=>{this.Lv.q(s,n)},this.if=Kt(this.Kd),this.rM=t=>{this.Kd.push(t)},this.nM=()=>this.iy,this.fs.zn||this.fs.Vn||this.fs.jn||this.us.As(4),this.oM=i.YS("polarChart series bg",0),this.aM=i.wp("polarChart axis gridlines",0),this.lM=i.wp("polarChart series",1),this.uM=i.wp("polarChart axis lines",2),this.cM=i.wp("polarChart axis ticks",3),this.Lv=s.d2({scaleXYConstructor:mu}),this.onResize(this.hM),this.ng.Bh("Polar Chart"),this.uy=this.oM.Fc(this.Lv).ke(this.qi.polarChartSeriesBackgroundFillStyle).Ce(nt).vu(0).ze(360)._u(0),this.Ay=this.oM.Fc(this.Lv).ke(V).Ce(this.qi.polarChartSeriesBackgroundStrokeStyle).vu(0).ze(360)._u(0),super.ly(this.uy,this.Ay),this.ig(r,this.pixelScale),this.dM=new Ml(this,this.Lv,this.qi,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.aM,this.uM,this.cM,this.es,this.nM),this.fM=new wl(this,this.Lv,this.qi,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.aM,this.uM,this.cM,this.es),this.coordsAxis={axisAmplitude:this.dM,axisRadial:this.fM},this.kp=i.Tp();const h=Dt(o?o.autoCursorBuilder:void 0,dh);this.Ag=h.$g(this.kp,this.uiScale,this.uiScale,this.qi),Ha.pg(this),this.yy(((t,e)=>{Ha.mg(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled))}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}solveNearest(t){const e=t||this.us.Bn();if(e)return Ha.gg(this,$o(e,this.us),this.iy)}translateCoordinate(t,e,i){if(i){const e=t,s=this.pixelScale,n=i;if(Ri(n)){const t=ut(e,s,this.engine.scale);return this.us.Xo({engineX:t.x,engineY:t.y})}if(Bi(n))return e;if(Cl(n)){const t=ut(e,s,this.Lv);return Vl(t,this.Lv)}}else{const i=t,s=e;if(Vi(i)){if(Cl(s)){const t=this.us.$o(i),e=ut({x:t.engineX,y:t.engineY},this.engine.scale,this.Lv);return Vl(e,this.Lv)}if(Ri(s))return i;if(Bi(s)){const t=this.us.$o(i);return ut({x:t.engineX,y:t.engineY},this.us.dt,this.pixelScale)}}else if(Dl(i)){if(Cl(s))return i;const t=zl([i],this.Lv)[0];if(Ri(s)){const e=ut(t,this.Lv,this.engine.scale),i={engineX:e.x,engineY:e.y};return this.us.Xo(i)}if(Bi(s))return ut(t,this.Lv,this.pixelScale)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new Nl(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPointSeries(t){const e=new Gl(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPointLineSeries(t){const e=new Ul(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addAreaSeries(t){const e=new gu(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPolygonSeries(t){const e=new du(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addHeatmapSeries(t){const e=new Bl(this.lM,this,this.ey,this.Lv,this.qi,this.us.es,t);return this.gy(e),e}addSector(){const t=new Il(this.lM,this,this.if,this.Lv,this.qi,this.us.es);return this.rM(t),t}getAmplitudeAxis(){return this.dM}getRadialAxis(){return this.fM}Fe(t){var e,i;super.Fe(t),Wa.cg(this.ng,this.eg);for(const t of this.iy)t.Gm();this.dM.vr(),this.fM.vr();for(const t of this.iy)t.Fe();for(let t=1;t<=2;t+=1){const e=this.dM.Fe(),i=this.fM.Fe(),s=Wa.ug(this.ng,this.eg),n=[this.Da.left+i,this.Da.right+i],r=[this.Da.bottom+i,this.Da.top+i+s];this.Lv.Ei(n).Vi(r);const o=4;if(!(!this.AM||Math.abs(this.AM.amplitude-e)>=o||Math.abs(this.AM.radial-i)>=o)||1!==t){this.AM={amplitude:e,radial:i};break}}const s=this.Lv.Xv().start,n=this.Lv.Xv().end,r=this.Lv.$v()?((null===(e=this.AM)||void 0===e?void 0:e.radial)||0)*this.Lv.x.getPixelSize()+n-s:((null===(i=this.AM)||void 0===i?void 0:i.radial)||0)*this.Lv.x.getPixelSize()+s-n;this.uy.xu(r).wu(360),this.Ay.xu(r).wu(360);for(const t of this.Kd)t.Fe();Ha.dg(this,this.uy.getIsUnderMouse(),!1,this.iy,(t=>Ha.gg(this,t,this.iy)),((t,e)=>t.gg(e,!0)));for(const t of this.iy)t.$p();return super.tg(),this.gM(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.dM.setAnimationsEnabled(t),this.fM.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.jo=t,this}getMouseInteractions(){return this.jo}getMinimumSize(){return u(yu,yu)}gM(){}forEachAxis(t){return t(this.dM),t(this.fM),this}dispose(){return this.Kd.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this.oM.W(),this.aM.W(),this.lM.W(),this.uM.W(),this.cM.W(),this.kp.W(),super.dispose()}Sd(){return[...this.iy,...this.Kd]}}const yu=300;class Au extends xh{}class xu extends Au{constructor(t,e,i,s,n,r,o,a){super(s,r,o,a),this._s="Slice",this.S=0,this.jg=!1,this.pM=V,this.Qg=V,this.Jg=this.S,this.tp=$((()=>this.Ji.us.bs())),this.sp=()=>{this.ep=void 0},this.index=t,this.Ji=s,this.scale=n,this.Ki=r,this.Xb=e.vc(n,rr.Simple).cs(this.getHighlight()),this.gs(this.Xb),this.Ye=i.kr(n).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0})}setValue(t){return this.Ji.getAnimationsEnabled()?this.getVisible()&&this.op(this.Jg,t):this.Jg=t,this.S=t,this.Ji.us.bs(),this}getValue(){return this.S}setVisible(t){return!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?(this.ep&&(this.ep.finish(!1),this.ep=void 0),this.op(this.Jg,0,(()=>super.setVisible(!1)))):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(this.ep&&(this.ep.finish(!1),this.ep=void 0),super.setVisible(!0),this.op(this.Jg,this.S)):(this.Jg=this.S,super.setVisible(!0)),this}op(t,e,i){this.ep=this.tp(300,X.ease)([[t,e]],(([t])=>{this.Jg=t,this.Ji.us.bs()})),this.ep.onEveryAnimationEnd(this.sp),i&&this.ep.onAnimationEnd(i)}setStyle(t,e,i,s){this.pM=t,this.Qg=i,this.Xb.ke(this.pM).Ce(e),this.Ye.ke(this.Qg).Vh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},vu=(t,i,s,n,r,o=0,a=e.FunnelSliceModes.VariableHeight,h)=>{i=bu(i,n.x),s=bu(s,n.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:h-i/2,y:n.y+r.bottom},f={x:h+i/2,y:n.y+r.bottom},g={x:0,y:r.bottom},m={x:0,y:r.bottom},p=0,y=0;if(o)for(let i=0;i0&&(d={x:g.x+A*o,y:g.y-o},f={x:m.x-A*o,y:m.y-o}),S=(i+c/u*(s-i))/2,g={x:h-S,y:parseInt(`${a===e.FunnelSliceModes.VariableWidth?d.y-x:x}`,10)},m={x:h+S,y:parseInt(`${a===e.FunnelSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&m.x>g.x&&y.Xb.Rl([g,d,f,m])}};class Mu extends Ga{constructor(t,i,s,n,r,o,a){super(t,i,s,i.sg("funnelChart bg",0),n,i.us.qi.funnelChartBackgroundFillStyle,i.us.qi.funnelChartBackgroundStrokeStyle,i.us.qi.funnelChartTitleFont,i.us.qi.funnelChartTitleFillStyle,o),this.ap=[],this.lp=ph.None,this.dp=!0,this.gp=0,this.mM=80,this.yM=20,this.SM=0,this.vM=e.FunnelSliceModes.VariableHeight,this.yp=!0,this.vp=e.AutoCursorModes.onHover,this.xp=Ah,this.bp=t=>{const e=this.ap.indexOf(t);e>=0&&(this.ap.splice(e,1),this.Mp())},this.fs.zn||this.fs.Vn||this.fs.Hn||this.us.As(5),this.Sp=this.qi.effectsText,this._p=i.wp("funnelChart bottom",0),this.Cp=i.wp("funnelChart top",1),this.ng.Bh("Funnel Chart"),this.up=this.qi.funnelChartSliceFillStylePalette,this.cp=this.qi.funnelChartSliceStrokeStyle,this.fp=this.qi.funnelChartSliceLabelFont,this.Ap=this.qi.funnelChartSliceLabelFillStyle,this.kp=i.Tp();const h=Dt(a?a.autoCursorBuilder:void 0,ch);this.Ag=h.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.setAnimationsEnabled(!0!==(null==a?void 0:a.disableAnimations)&&!1!==(null==a?void 0:a.animationsEnabled)),this.ig(r,this.pixelScale)}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}addSlice(t,e){const i=new xu(this.gp,this._p,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);return this.gp+=1,i.setName(t),i.setValue(e),i.es.rs.xs(this.Sp),i.es.ns.xs(this.yp),this.ap.push(i),this.us.bs(),i.setHighlightOnHover(this.dp),i}addSlices(t){const e=[];for(let i=0;ie.es.ns.xs(t))),this.us.bs(),this}getSliceEffect(){return this.yp}setSliceSorter(t){return this.lp=t,this.ap=this.ap.sort(this.lp),this.us.bs(),this}getSliceSorter(){return this.lp}setLabelFillStyle(t){return this.Ap="function"==typeof t?t(this.Ap):t,this.us.bs(),this}getLabelFillStyle(){return this.Ap}setLabelFont(t){return this.fp="function"==typeof t?t(this.fp):t,this.us.bs(),this}getLabelFont(){return this.fp}setLabelEffect(t){return this.Sp=t,this.ap.forEach((e=>e.es.rs.xs(t))),this.us.bs(),this}getLabelEffect(){return this.Sp}setLabelFormatter(t){return this.Ip=t,this.us.bs(),this}getLabelFormatter(){return this.Ip}setSliceHighlightOnHover(t){return this.dp=t,this.ap.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),Wa.cg(this.ng,this.eg),super.tg();const e=Wa.ug(this.ng,this.eg),i=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+e)),s=u(this.Da.left+i.x/2,this.Da.bottom+i.y/2);this.ap=this.ap.sort(this.lp);for(let t=0,{length:e}=this.ap;tt.getAnimatedValue()>0));let r=0;for(let t=0;t0?a/r:0);var a;for(let t=0;tgh(e,this.engine.scale,this.xp(new Za,this,t,o[n.indexOf(t)]||0).fc(),t,void 0))),this.Pp(n,o,s,i)}Fp(t,e){t.setStyle(this.ad?new U({color:this.ad.getColors(t.getAnimatedValue())}):this.up(e),this.cp,this.Ap,this.fp)}Mp(){this.ap=this.ap.sort(this.lp),this.us.bs()}Sd(){return this.ap}dispose(){return this.ap.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this._p.W(),this.Cp.W(),this.kp.W(),super.dispose()}}const Tu=(t,i,s)=>{const n=t.El();if(n.length>0){let t;const r=(n[1].y-n[0].y)/2+n[0].y;return t=i===e.FunnelLabelSide.Left?(n[0].x-n[1].x)/2+n[1].x-s:(n[2].x-(4===n.length?n[3].x:n[1].x))/2+(4===n.length?n[3].x:n[1].x)+s,{x:t,y:r}}},wu=t=>{const e=t.El();if(e.length>0)return{x:(e[2].x-e[1].x)/2+e[1].x,y:(e[1].y-e[0].y)/2+e[0].y}};class Eu extends Mu{constructor(){super(...arguments),this.Ip=yh.NamePlusValue,this.xM=10,this.bM=e.FunnelLabelSide.Left,this.MM=e.SliceLabelIndices.LabelsOnSides,this.Dp=[],this.Ep=this.qi.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Ep=t;for(let t=0;t{const e=this.ap.indexOf(t);e>=0&&this.ap.splice(e,1)},this.fs.zn||this.fs.Vn||this.fs.$n||this.us.As(6),this.Ts=e.wp("gaugeChart layer",0),this.Cp=e.wp("gaugeChart top layer",1),this.ng.Bh("Gauge Chart"),this.ig(n,this.pixelScale);const a=Yi();this.onBackgroundTouchStart(a.onTouchStart),this.onBackgroundTouchMove(a.onTouchMove),this.onBackgroundTouchEnd(a.onTouchEnd),this.setAnimationsEnabled(void 0===o||o)}dispose(){return this.Ts.W(),this.Cp.W(),this.ap.slice().forEach((t=>t.dispose())),super.dispose()}}class Fu extends _u{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,r,o),this.uu=90,this.cu=-270,this.CM={min:this.uu,max:this.cu},this.kM=$((()=>this.Ts.bs())),this.TM=()=>{this.FM=void 0},this.IM=e.wp("radialGaugeChart bg arc",2),this.PM=this.Ts.Fc(this.pixelScale).ke(this.qi.gaugeChartEmptyGaugeFillStyle).Ce(this.qi.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.uu,s=this.cu,n=this.CM;return this.getAnimationsEnabled()?this.DM(n,{min:t,max:e}):(n.min=t,n.max=e,this.uu=t,this.cu=e),this.D.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.us.bs(),this}getAngleInterval(){return{min:this.uu,max:this.cu}}setGaugeFillStyle(t){return this.PM.ke(t),this.us.bs(),this}setGaugeStrokeStyle(t){return this.PM.Ce(t),this.us.bs(),this}DM(t,e,i){this.FM=this.kM(1e3,X.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.CM={min:t,max:e},this.uu=t,this.cu=e,this.Ts.bs()})),this.FM.onEveryAnimationEnd(this.TM),i&&this.FM.onAnimationEnd(i)}onAngleIntervalChange(t){return this.D.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.D.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.IM.W(),this}}class Lu extends xh{BM(t){return this.D.on("valueChange",t)}LM(t){return this.D.on("valueIntervalChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}offIntervalChange(t){return this.D.off(t,"valueIntervalChange")}attach(t,e=!0,i=!1){return super.attach(t,e,i),this.styleAttachedEntry(t,e,i),this}styleAttachedEntry(t,e=!0,i=!1){ae(t,this.qi,i,{fill:this.RM})}}class zu extends Lu{onValueChange(t){return this.BM(t)}onIntervalChange(t){return this.LM(t)}}class Pu extends zu{constructor(t,e,i,s,n,r,o){super(i,n,r,o),this.uu=0,this.cu=0,this.EM=0,this.VM=0,this.zM=0,this.OM=100,this.NM=!0,this.Jg=this.S,this.qg=this.getVisible(),this.tp=be(),this.GM=t=>{this.Jg=t,this.Ji.us.bs()},this.WM=t,this.Tr=e,this.Ji=i,this.scale=s,this.RM=this.qi.gaugeChartGaugeFillStyle,this.np=t.Fc(s).ke(this.RM).Ce(nt).cs(this.getHighlight()),this.gs(this.np),this.UM=e.kr(s).cs(this.getHighlight()),this.gs(this.UM,{isText:!0}),this.YM=e.kr(s).cs(this.getHighlight()),this.gs(this.YM,{isText:!0}),this.Ye=e.kr(s).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0}),this.UM.ke(r.gaugeChartIntervalLabelsFillStyle).Vh(r.gaugeChartIntervalLabelsFont),this.YM.ke(r.gaugeChartIntervalLabelsFillStyle).Vh(r.gaugeChartIntervalLabelsFont),this.Ye.ke(r.gaugeChartValueLabelFillStyle).Vh(r.gaugeChartValueLabelFont),this.setName("Gauge Slice")}Fe(){const t=this.Ji.getDataLabelFormatter(),e=this.uu/90n&&(i=n);const r=this.cu-e*this.VM,o=this.uu+e*this.EM,a=this.OM-this.zM,h=(0!==a?(r-o)/a:1/0)*(i-this.zM);this.np.vu(o).ze(o+h);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>n}):t.format(i);this.Ye.Bh(l)}HM(){const t=this.Ji.getIntervalLabelFormatter(),e="function"==typeof t?t(this.zM,{getInnerStart:()=>this.zM,getInnerEnd:()=>this.OM}):t.format(this.zM);return this.UM.Bh(e).Ds(),this.UM.oi()}$M(){const t=this.Ji.getIntervalLabelFormatter(),e="function"==typeof t?t(this.OM,{getInnerStart:()=>this.zM,getInnerEnd:()=>this.OM}):t.format(this.OM);return this.YM.Bh(e).Ds(),this.YM.oi()}setName(t){return super.setName(t),this.Ji.us.bs(),this}setValue(t){const e=this.S;return this.Ji.getAnimationsEnabled()?this.qg&&this.tp(e,t,this.GM):this.Jg=t,this.S=t,this.D.emit("valueChange",this,e,t),this.Ji.us.bs(),this}getValue(){return this.S}setVisible(t){return this.qg=t,!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?this.tp(this.Jg,0,this.GM,{onCompleted:()=>super.setVisible(!1)}):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(super.setVisible(!0),this.tp(this.Jg,this.S,this.GM)):(this.Jg=this.S,super.setVisible(!0)),this}setInterval(t,e){const i=this.zM,s=this.OM;return this.D.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.zM=t,this.OM=e,this.Ji.us.bs(),this}setIntervalLabelsFont(t){return this.UM.Vh(t),this.YM.Vh(t),this.Ji.us.bs(),this}getIntervalLabelsFont(){return this.UM.Eh()}setIntervalLabelsFillStyle(t){return this.UM.ke(t),this.YM.ke(t),this.Ji.us.bs(),this}getIntervalLabelsFillStyle(){return this.UM.Lh()}setIntervalLabelsVisible(t){return t?(this.UM.setVisible(!0),this.YM.setVisible(!0)):(this.UM.setVisible(!1),this.YM.setVisible(!1)),this.NM=t,this}getIntervalLabelsVisible(){return this.NM}setAngleInterval(t,e){return this.uu=t,this.cu=e,this.Ji.us.bs(),this}setMinAngle(t){return this.uu=t,this.Ji.us.bs(),this}setMaxAngle(t){return this.cu=t,this.Ji.us.bs(),this}setMarginInDegrees(t=this.EM,e=this.VM){return t!==this.EM&&(this.EM=t),e!==this.VM&&(this.VM=e),this.Ji.us.bs(),this}setFillStyle(t){this.RM="function"==typeof t?t(this.RM):t;const e=this.RM;this.np.ke(e);for(let t=0;tn?25*s:25*n))){const o=Array(r+2),a=Math.PI;let h=0,l=0;const c=e*a/180,d=(i*a/180-c)/r;for(o[h]=u(t.x,t.y),h+=1;h<=r+1;)o[h]=u(t.x+s*Math.cos(c+l*d),t.y+n*Math.sin(c+l*d)),h+=1,l+=1;return[o,r]}class Vu extends Fu{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,r,o),this.nd=20,this.ZM=new Intl.NumberFormat,this.QM=new Intl.NumberFormat,this.JM=!1,this.KM=5;const a=new Pu(this.Ts,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);this.qM=a,this.ap.push(a),this.setPadding(10)}Fe(t){super.Fe(t),Wa.cg(this.ng,this.eg),super.tg();const e=Wa.ug(this.ng,this.eg),i=je([this.qM.HM(),this.qM.$M()]),s=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right+2*i.max.x),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+1*i.max.y+e)),n=Math.max(.5*Math.min(s.x,s.y),0),r=u(this.Da.left+i.max.x+.5*s.x,this.Da.bottom+i.max.y+.5*s.y),o=this.JM?this.t_(r,n):r,a=this.PM.Me.getThickness(),h=n-.5*a,l=n-this.nd;let c=l/n*100;c=c>100||c<0?99:c;const d=100*(1-(this.nd-a)/n);this.i_(o,l)&&(this.PM.xu(n)._u(c),this.qM.np.xu(h)._u(d));const f=.5*(g=n,(m=this.cu-this.uu)/(2*Math.PI*g*(m/360))*a);var g,m;this.PM.vu(this.uu).ze(this.cu).Ie(o),this.qM.np.Ie(o),this.qM.Ye.Ie(o),this.ad&&this.qM.setFillStyle(new U({color:this.ad.getColors(this.qM.getAnimatedValue())})),this.qM.setMinAngle(this.uu).setMaxAngle(this.cu).setMarginInDegrees(f,f).Fe();const p=this.PM.du();if(this.qM.getIntervalLabelsVisible()){this.s_(this.uu,this.cu,o,p+this.KM);const t=this.qM.UM.Ds().Ue(),e=this.qM.YM.Ds().Ue();Ve(t,e)&&this.e_(t,e,o,p+this.KM)}}i_(t,e){const i=si(this.qM.Ye.Ds().oi(),.5),s=t.x+e,n=t.x-e,r=t.y+e,o=t.y-e;return!(t.x+i.x>s||t.x-i.xr||t.y-i.y=0?i=-s:s=-i),[i,s]}t_(t,e){const[i]=Ru(t,this.uu,this.cu,e,e),s=je(i),n=.5*(s.max.x-s.min.x),r=.5*(s.max.y-s.min.y);return ni(ri(t,u(s.min.x+n,s.min.y+r)),t)}s_(t,e,i,s){const n=di(t),r=di(e);this.qM.UM.Ie(Ze(u(i.x+s,i.y),i,-n)),this.qM.YM.Ie(Ze(u(i.x+s,i.y),i,-r)),this.qM.UM.Ja(u(-Math.cos(n),-Math.sin(n))),this.qM.YM.Ja(u(-Math.cos(r),-Math.sin(r)))}getDefaultSlice(){return this.qM}setAutoScaling(t){return this.JM=t,this.us.bs(),this}getAutoScaling(){return this.JM}setDataLabelFormatter(t){return this.QM=t,this.us.bs(),this}getDataLabelFormatter(){return this.QM}setIntervalLabelFormatter(t){return this.ZM=t,this.us.bs(),this}getIntervalLabelFormatter(){return this.ZM}setIntervalLabelPadding(t){return this.KM=t,this.us.bs(),this}getIntervalLabelPadding(){return this.KM}setThickness(t){return this.nd=t,this}setLUT(t){return this.ad=t,this.us.bs(),this}setDataLabelFont(t){return this.qM.Ye.Vh(t),this.us.bs(),this}getDataLabelFont(){return this.qM.Ye.Eh()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.qM.XM(t),this.us.bs(),this}getDataLabelFillStyle(){return this.qM.jM()}Sd(){return this.ap}dispose(){return this.qM.dispose(),super.dispose()}}class Bu extends xh{}class Ou extends Bu{constructor(t,e,i,s,n,r,o,a){super(s,r,o,a),this._s="Slice",this.S=0,this.jg=!1,this.pM=V,this.Qg=V,this.Jg=this.S,this.tp=$((()=>this.Ji.us.bs())),this.sp=()=>{this.ep=void 0},this.index=t,this.Ji=s,this.scale=n,this.Ki=r,this.Xb=e.vc(n,rr.Simple).cs(this.getHighlight()),this.gs(this.Xb),this.Ye=i.kr(n).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0})}setValue(t){return this.Ji.getAnimationsEnabled()?this.getVisible()&&this.op(this.Jg,t):this.Jg=t,this.S=t,this.Ji.us.bs(),this}getValue(){return this.S}setVisible(t){return!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?(this.ep&&(this.ep.finish(!1),this.ep=void 0),this.op(this.Jg,0,(()=>super.setVisible(!1)))):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(this.ep&&(this.ep.finish(!1),this.ep=void 0),super.setVisible(!0),this.op(this.Jg,this.S)):(this.Jg=this.S,super.setVisible(!0)),this}op(t,e,i){this.ep=this.tp(300,X.ease)([[t,e]],(([t])=>{this.Jg=t,this.Ji.us.bs()})),this.ep.onEveryAnimationEnd(this.sp),i&&this.ep.onAnimationEnd(i)}setStyle(t,e,i,s){this.pM=t,this.Qg=i,this.Xb.ke(this.pM).Ce(e),this.Ye.ke(this.Qg).Vh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Uu=(t,i,s,n,r,o=0,a=e.PyramidSliceModes.VariableHeight,h)=>{i=Nu(i,n.x),s=Nu(s,n.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:h-i/2,y:n.y+r.bottom},f={x:h+i/2,y:n.y+r.bottom},g={x:0,y:r.bottom},m={x:0,y:r.bottom},p=0,y=0;if(o)for(let i=0;i0&&(d={x:g.x+A*o,y:g.y-o},f={x:m.x-A*o,y:m.y-o}),S=(i+c/u*(s-i))/2,g={x:h-S,y:parseInt(`${a===e.PyramidSliceModes.VariableWidth?d.y-x:x}`,10)},m={x:h+S,y:parseInt(`${a===e.PyramidSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&m.x>=g.x&&y.Xb.Rl([g,d,f,m])}};class Gu extends Ga{constructor(t,i,s,n,r,o,a){super(t,i,s,i.sg("pyramidChart bg",0),n,i.us.qi.pyramidChartBackgroundFillStyle,i.us.qi.pyramidChartBackgroundStrokeStyle,i.us.qi.pyramidChartTitleFont,i.us.qi.pyramidChartTitleFillStyle,o),this.ap=[],this.lp=ph.None,this.up=this.qi.pyramidChartSliceFillStylePalette,this.cp=this.qi.pyramidChartSliceStrokeStyle,this.dp=!0,this.fp=this.qi.pyramidChartSliceLabelFont,this.Ap=this.qi.pyramidChartSliceLabelFillStyle,this.gp=0,this.mM=0,this.yM=80,this.SM=0,this.vM=e.PyramidSliceModes.VariableHeight,this.yp=!0,this.vp=e.AutoCursorModes.onHover,this.xp=Ah,this.bp=t=>{const e=this.ap.indexOf(t);e>=0&&(this.ap.splice(e,1),this.Mp())},this.fs.zn||this.fs.Vn||this.fs.Hn||this.us.As(8),this.Sp=this.qi.effectsText,this._p=i.wp("pyramidChart bottom",0),this.Cp=i.wp("pyramidChart top",1),this.ng.Bh("Pyramid Chart"),this.kp=i.Tp();const h=Dt(a?a.autoCursorBuilder:void 0,ch);this.Ag=h.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.ig(r,this.pixelScale),this.setAnimationsEnabled(!0!==(null==a?void 0:a.disableAnimations)&&!1!==(null==a?void 0:a.animationsEnabled))}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}addSlice(t,e){const i=new Ou(this.gp,this._p,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);return this.gp+=1,i.setName(t),i.setValue(e),i.es.rs.xs(this.Sp),i.es.ns.xs(this.yp),this.ap.push(i),this.us.bs(),i}addSlices(t){const e=[];for(let i=0;ie.es.ns.xs(t))),this.us.bs(),this}getSliceEffect(){return this.yp}setSliceSorter(t){return this.lp=t,this.ap=this.ap.sort(this.lp),this.us.bs(),this}getSliceSorter(){return this.lp}setLabelFillStyle(t){return this.Ap="function"==typeof t?t(this.Ap):t,this.us.bs(),this}getLabelFillStyle(){return this.Ap}setLabelFont(t){return this.fp="function"==typeof t?t(this.fp):t,this.us.bs(),this}getLabelFont(){return this.fp}setLabelEffect(t){return this.Sp=t,this.ap.forEach((e=>e.es.rs.xs(t))),this.us.bs(),this}getLabelEffect(){return this.Sp}setLabelFormatter(t){return this.Ip=t,this.us.bs(),this}getLabelFormatter(){return this.Ip}setSliceHighlightOnHover(t){return this.dp=t,this.ap.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),Wa.cg(this.ng,this.eg),super.tg();const e=Wa.ug(this.ng,this.eg),i=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+e)),s=u(this.Da.left+i.x/2,this.Da.bottom+i.y/2);this.ap=this.ap.sort(this.lp);for(let t=0,{length:e}=this.ap;tt.getAnimatedValue()>0));let r=0;for(let t=0;t0?a/r:0);var a;for(let t=0;tgh(e,this.engine.scale,this.xp(new Za,this,t,o[n.indexOf(t)]||0).fc(),t,void 0))),this.Pp(n,o,s,i)}Fp(t,e){t.setStyle(this.ad?new U({color:this.ad.getColors(t.getAnimatedValue())}):this.up(e),this.cp,this.Ap,this.fp)}Mp(){this.ap=this.ap.sort(this.lp),this.us.bs()}Sd(){return this.ap}dispose(){return this.ap.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this._p.W(),this.Cp.W(),this.kp.W(),super.dispose()}}const Wu=(t,i,s)=>{const n=t.El();if(n.length>0){let t;const r=(n[1].y-n[0].y)/2+n[0].y;return t=i===e.PyramidLabelSide.Left?(n[0].x-n[1].x)/2+n[1].x-s:(n[2].x-(4===n.length?n[3].x:n[1].x))/2+(4===n.length?n[3].x:n[1].x)+s,{x:t,y:r}}},Yu=t=>{const e=t.El();if(e.length>0)return{x:(e[2].x-e[1].x)/2+e[1].x,y:(e[1].y-e[0].y)/2+e[0].y}};class Hu extends Gu{constructor(){super(...arguments),this.Ip=yh.NamePlusValue,this.xM=10,this.bM=e.PyramidLabelSide.Left,this.MM=e.SliceLabelIndices.LabelsOnSides,this.Dp=[],this.Ep=this.qi.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Ep=t;for(let t=0;t(t.alignmentX=(n+Math.PI/2)%(2*Math.PI)<=Math.PI?-1:1,t.alignmentY=n%(2*Math.PI)<=Math.PI?-1:1,t.paddingX=Math.cos(n)*r,t.paddingY=Math.sin(n)*r,t),Ju=(t,e,i,s,n,r,o,a)=>{if(0===e)return t.paddingX=a,t.alignmentX=-1,t};var Ku;e.SpiderWebMode=void 0,(Ku=e.SpiderWebMode||(e.SpiderWebMode={}))[Ku.Normal=0]="Normal",Ku[Ku.Circle=1]="Circle";class Zu{constructor(t,e,i,s,r,o,a,h){this.D=new n.Eventer,this.r_=t,this.Tr=e,this.scale=i,this.chart=s,this.tag=r,this.axisScale=o,this.n_=a,this.o_=h,this.a_=this.r_.Ve(this.scale).setMouseInteractions(!1),this.l_=this.Tr.kr(this.scale).Bh(this.tag).setMouseInteractions(!1),this.u_=this.n_(this,this.r_.zp(this.scale,void 0,[kh.InternalUI])).Ee(this.chart.getNibStyle()),this.o_.ps([this.l_])}Pp(t,i,s,n,r,o,a){const h=i.length,l=i[s>0?s-1:h-1],c=i[s],d=i[s{const r=s/i,o=[];for(let a=-s/2;a<=s/2;a+=n){const n=r*(a/s)+e,h=u(t.x+Math.cos(n)*i,t.y+Math.sin(n)*i);o.push(h)}return o})(t,n,r,f)),a?this.l_.setVisible(!0).Ie(ni(c,u(a.paddingX,a.paddingY))).Xa(a.alignmentX).Za(a.alignmentY):this.l_.setVisible(!1)}getLabelSize(){return this.l_.Vh(this.chart.getAxisLabelFont()).ke(this.chart.getAxisLabelStyle()).Ds().oi()}dispose(){this.a_&&this.a_.dispose(),this.l_&&this.l_.dispose(),this.u_&&this.u_.dispose()}}const Qu=(t,e,i,s,n)=>t.addRow(e.getName()).addRow("Axis:","",s).addRow("Value:","",n(i));class tc extends _l{constructor(t,i,s,n,r,o,a,h,l,u,c,d){super(t,l,u,d),this._s="Spider Series",this.Lu=new Map,this.Hi=e.HighlightModes.onHover,this.xp=Qu,this.Tx=8,this.Fa=0,this.c_=be(),this.d_={},this.f_={},this.qg=this.getVisible(),this.A_=1,this.g_=((t,e)=>{const i=$((()=>{}));let s,n,r=1;return(o,a,h)=>{if(o===n)return;n=o;const l=(null==h?void 0:h.easing)||X.ease,u=(null==h?void 0:h.durationMs)||1e3;s&&(s.finish(!1),s=void 0),!1===o?a&&r?(s=i(u,l)([[r,0]],(([e])=>{r=e,t(r)})),s.onAnimationEnd((()=>{s=void 0,e(!1)}))):(r=0,e(!1)):a?(e(!0),s=i(u,l)([[r,1]],(([e])=>{r=e,t(r)})),s.onAnimationEnd((()=>{s=void 0}))):(r=1,e(!0))}})((t=>{this.A_=t,this.Ts.us.bs()}),(t=>{super.setVisible(t)})),this.Ji=t,this.Ts=i,this.Fx=n,this.p_=r,this.HS=o,this.m_=a,this.y_=h,this.scale=s,this.S_=ce(u.spiderSeriesFillStyle,c),this.v_=ce(u.spiderSeriesStrokeStyle,c),this.x_=ce(u.spiderSeriesPointFillStyle,c)}Dm(){return this.Lm&&this.Lu.size>0&&this.getVisible()}addPoints(...t){this.Lu.size>0&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.c_(0,1,(t=>{e.forEach(((e,s)=>{const n=(null==i?void 0:i.get(s))||0;this.Lu.set(s,n+t*(e-n)),this.Ts.us.bs()}))}),{easing:this.d_.easing,durationMs:this.d_.durationMs,onStart:()=>{i=new Map(this.Lu)}})}else for(let e=0;e=3&&(this.Xb||(this.Xb=this.Ts.vc(this.scale,rr.Simple).Ce(this.v_).ke(this.S_).cs(this.getHighlight()),this.gs(this.Xb)),this.Xb.Rl(t),this.zc||(this.zc=this.Ts.Oc(this.scale).q(this.Tx).Sl(this.Fx).zh(this.Fa).ke(this.x_).cs(this.getHighlight()),this.gs(this.zc)),this.zc.Nt()._l(t))}}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.S_,stroke:this.v_}),this}yd(){return this.Fx}b_(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},ic=t=>je(t.l_.Ue()),sc=t=>je(t.Ue()),nc=(t,i,s,n)=>t._u(0).Ie(s).vu(90).ze(-270).wu(i===e.SpiderWebMode.Circle?void 0:n.length),rc={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},oc={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},ac=()=>{oc.alignmentX=0,oc.alignmentY=0,oc.paddingX=0,oc.paddingY=0};class hc extends Kh{constructor(t,i,s,n,r,o,a){super(t,i,s,i.sg("spiderChart bg",0),n,i.us.qi.spiderChartBackgroundFillStyle,i.us.qi.spiderChartBackgroundStrokeStyle,i.us.qi.spiderChartTitleFont,i.us.qi.spiderChartTitleFillStyle,a),this.Da=A(20,20,20,20),this.axisScale=ht.d1({scale1DConstructor:Ii,dimension:"x"}).J(0,1),this.HS=[],this.M_=[],this.__=[],this.w_=Rs.expansion,this.C_=!0,this.k_=Ju,this.T_=qu,this.jo=!0,this.F_=e.SpiderWebMode.Normal,this.I_=4,this.P_=this.qi.spiderChartWebStyle,this.D_=this.qi.spiderChartScaleLabelFillStyle,this.B_=this.qi.spiderChartScaleLabelFont,this.L_=5,this.R_=this.qi.spiderChartAxisLabelFillStyle,this.E_=this.qi.spiderChartAxisLabelFont,this.V_=5,this.z_=this.qi.spiderChartAxisStrokeStyle,this.O_=this.qi.spiderChartAxisNibStrokeStyle,this.Dd=10,this.N_=A(),this.vp=e.AutoCursorModes.onHover,this.hasAxis=t=>this.HS.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.Di(t,Ci.Numeric),this.G_=()=>{const t=this.HS.map(ic).concat(this.__.map(sc));return Oe(t)},this.W_=()=>this.U_.Fc(this.pixelScale).setMouseInteractions(!1),this.Y_=t=>t.dispose(),this.H_=()=>this.vf.kr(this.pixelScale).setMouseInteractions(!1),this.X_=t=>t.dispose(),this.j_=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.Z_=(t,e)=>{let i,s;const n=()=>{void 0!==this.Q_&&this.Q_.finish(),i=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.w_,this.w_=void 0},r=(e,s,n,r,o)=>{const a=u(n.x-s.x,s.y-n.y),h=this.HS.findIndex((e=>e===t));if(h>=0&&void 0!==i){const e=ec(h,this.HS.length),s=u(Math.cos(e),Math.sin(e)),n=a.x*s.x+a.y*s.y,r=ii(ri(t.a_.Ii(),t.a_.Ti())),l=i.min+(i.max-i.min)*Math.max(1+n/r,.01);this.axisScale.J(i.min,l),jt(o),this.us.bs()}},o=()=>{if(i=void 0,void 0!==s)if(this.th){const t=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.J_(),i=s;if(void 0!==e){const s=i.start(t.min,t.max,e.min,e.max),n=i.end(t.min,t.max,e.min,e.max);this.Q_=this.zA.us.Zr(300,X.ease)([[0,1]],(([e])=>{this.axisScale.J(t.min+e*(s-t.min),t.max+e*(n-t.max))})),this.Q_.onAnimationEnd((()=>{this.Q_=void 0,this.w_=i}))}else this.w_=s}else this.w_=s;s=void 0};e.setMouseEnterEventHandler(this.K_).setMouseLeaveEventHandler(this.q_).setMouseDragStartEventHandler(n).setMouseDragEventHandler(((t,e,i,s,n)=>r(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const a=Yi(new Xi(((t,e,i)=>{this.K_(t),n(),jt(i)}),r,((t,e,i,s)=>{this.q_(t),o(),jt(s)})));return e.setTouchStartEventHandler(a.onTouchStart).setTouchMoveEventHandler(a.onTouchMove).setTouchEndEventHandler(a.onTouchEnd)},this.tw=t=>{this.C_&&!this.hasAxis(t)&&this.addAxis(t)},this.m_=(t,e)=>{for(const i of this.HS)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return He(i.a_.Ii(),i.a_.Ti(),t)}},this.y_=t=>{if(0===this.HS.length)return;const e=ri(ut(t,this.engine.scale,this.pixelScale),this.HS[0].a_.Ii()),i=Math.atan2(e.y,e.x);let s,n=_e;for(const t of this.HS){const e=ri(t.a_.Ti(),t.a_.Ii()),r=Math.atan2(e.y,e.x),o=Math.abs(i-r);o{this.jo&&(t.Ee(this.O_),this.us.bs())},this.q_=t=>{t.Ee(this.O_),this.us.bs()},this.fs.zn||this.fs.Vn||this.fs.Xn||this.us.As(9),this.oM=i.YS("spiderChart series bg",0),this.U_=i.wp("spiderChart web shapes",0),this.iw=i.wp("spiderChart axis bg",1),this.yv=i.wp("spiderChart plotting",2),this.vf=i.wp("spiderChart fg",3),this.o_=this.es.gA().xs(this.qi.effectsText),this.ng.Bh("Spider Chart"),this.uy=this.oM.Fc(this.pixelScale).ke(this.qi.spiderChartSeriesBackgroundFillStyle).Ce(nt).vu(90).ze(-270)._u(0),this.Ay=this.oM.Fc(this.pixelScale).ke(V).Ce(this.qi.spiderChartSeriesBackgroundStrokeStyle).vu(90).ze(-270)._u(0),super.ly(this.uy,this.Ay),this.kp=i.Tp();const h=Dt(o?o.autoCursorBuilder:void 0,lh);this.Ag=h.$g(this.kp,this.uiScale,this.uiScale,this.qi),Ha.pg(this),this.yy(((t,e)=>{Ha.mg(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.ig(r,this.pixelScale)}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}solveNearest(t){const e=t||this.us.Bn();if(e)return Ha.gg(this,$o(e,this.us),this.iy)}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Zu(this.iw,this.vf,this.pixelScale,this,t,this.axisScale,this.Z_,this.o_);this.HS.push(e)}}else t&&this.HS.push(t);return this.o_.ps(this.HS.map((t=>t.l_))),this.us.bs(),this}addSeries(t){const i="object"==typeof t?t.pointShape?t.pointShape:e.PointShape.Circle:t||e.PointShape.Circle,s="object"==typeof t&&t.automaticColorIndex?t.automaticColorIndex:this.iy.length,n=new tc(this,this.yv,this.pixelScale,i,this.tw,this.HS,this.m_,this.y_,this.ey,this.qi,s,this.us.es);return this.gy(n),n}getSeriesCount(){return this.iy.length}setWebMode(t){return this.F_=t,this.us.bs(),this}getWebMode(){return this.F_}setWebCount(t){return this.I_=t,this.us.bs(),this}getWebCount(){return this.I_}setWebStyle(t){return this.P_="function"==typeof t?t(this.P_):t,this.us.bs(),this}getWebStyle(){return this.P_}setScaleLabelStyle(t){return this.D_="function"==typeof t?t(this.D_):t,this.us.bs(),this}getScaleLabelStyle(){return this.D_}setScaleLabelFont(t){return this.B_="function"==typeof t?t(this.B_):t,this.us.bs(),this}getScaleLabelFont(){return this.B_}setScaleLabelPadding(t){return this.L_=t,this.us.bs(),this}getScaleLabelPadding(){return this.L_}setScaleLabelStrategy(t){return this.k_=t,this.us.bs(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.us.bs(),this}setAxisLabelStyle(t){return this.R_="function"==typeof t?t(this.R_):t,this.us.bs(),this}getAxisLabelStyle(){return this.R_}setAxisLabelFont(t){return this.E_="function"==typeof t?t(this.E_):t,this.us.bs(),this}getAxisLabelFont(){return this.E_}setAxisLabelEffect(t){return this.o_.xs(t),this.us.bs(),this}getAxisLabelEffect(){return this.o_.Ms()}setAxisLabelPadding(t){return this.V_=t,this.us.bs(),this}getAxisLabelPadding(){return this.V_}setAxisLabelStrategy(t){return this.T_=t,this.us.bs(),this}setAxisStyle(t){return this.z_="function"==typeof t?t(this.z_):t,this.us.bs(),this}getAxisStyle(){return this.z_}setNibStyle(t){return this.O_="function"==typeof t?t(this.O_):t,this.us.bs(),this}getNibStyle(){return this.O_}setNibLength(t){return this.Dd=t,this.us.bs(),this}getNibLength(){return this.Dd}setAutoAxis(t){return this.C_=t,this}getAutoAxis(){return this.C_}setMouseInteractions(t){return this.jo=t,this}getMouseInteractions(){return this.jo}setAxisScrollStrategy(t){return this.w_=t,this.us.bs(),this}getAxisScrollStrategy(){return this.w_}setAxisInterval(t,e=0){return this.axisScale.J(e,t),this.us.bs(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}Fe(t){super.Fe(t),Wa.cg(this.ng,this.eg);const e=this.HS.length,i=Wa.ug(this.ng,this.eg),s=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+i)),n=((t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}))(0,0,0,0);if(void 0!==this.T_){const t=Math.min(s.x,s.y)/2;for(let i=0;i0?n.right=Math.max(n.right,l.x+.5*(1-h.alignmentX)*a.x-t):n.left=Math.max(n.left,-l.x+.5*(h.alignmentX+1)*a.x-t),o>0?n.top=Math.max(n.top,l.y+.5*(1-h.alignmentY)*a.y-t):n.bottom=Math.max(n.bottom,-l.y+.5*(h.alignmentY+1)*a.y-t)}}if(this.w_){const t=this.J_();if(void 0!==t){const e=this.w_.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.w_.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.J(e,i)}}const r=u(this.pixelScale.x.getInnerStart()+(n.left+this.pixelScale.x.getInnerInterval()-n.right)/2,this.pixelScale.y.getInnerStart()+(n.bottom+this.pixelScale.y.getInnerInterval()-n.top)/2),o=Math.min(s.x/2-(n.left+n.right)/2,s.y/2-(n.bottom+n.top)/2);this.N_=A(this.Xt.left+this.Da.left+n.left,this.Xt.top+this.Da.top+i+n.top,this.Xt.right+this.Da.right+n.right,this.Xt.bottom+this.Da.bottom+n.bottom),this.Pp(r,o);for(const t of this.iy)t.Gm();for(const t of this.iy)t.Fe();super.tg(),Ha.dg(this,this.uy.getIsUnderMouse(),!1,this.iy,(t=>Ha.gg(this,t,this.iy)),((t,e)=>t.gg(e,!0)));for(const t of this.iy)t.$p()}dispose(){return this.oM.W(),this.U_.W(),this.iw.W(),this.yv.W(),this.vf.W(),this.Ag.dispose(),this.kp.W(),super.dispose()}getMinimumSize(){return u(this.N_.left+this.N_.right+100,this.N_.bottom+this.N_.top+100)}Pp(t,e){const i=this.HS.length,s=[];for(let n=0;n{const h=t.length,l=r.length,u=e>0&&l>1;for(let l=0;l=h&&t.push(o());const a=t[l];nc(a,i,s,r);const u=n*((l+1)/e);a.xu(u)}else l{const c=n.length,d=t.length;let f=0;if(void 0!==e)for(let h=0;h=d&&t.push(a());const e=t[f];f+=1;const s=(i-n)/i,c=He(r,o[h],s);e.Ie(ni(c,u(p.paddingX,p.paddingY))).Xa(p.alignmentX).Za(p.alignmentY).Bh(l(s))}}}for(let e=f;e1;for(const s of this.HS)for(const n of this.iy){const r=n.getValue(s.tag,i);void 0!==r&&(t=void 0===t?r:Math.min(t,r),e=void 0===e?r:Math.max(e,r))}if(void 0!==t&&void 0!==e)return m(t,e)}}const lc=t=>({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...Oh(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Sr().x))}),uc=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...Oh(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Sr().y))});var cc;e.StepOptions=void 0,(cc=e.StepOptions||(e.StepOptions={}))[cc.before=0]="before",cc[cc.middle=.5]="middle",cc[cc.after=1]="after";const dc=(t,e)=>{const i=[],s=t.length,n=e;if(s>0){let e=0,r=t[0];i[e]=r,e+=1;for(let o=1;o{const i=t*t,s=i*t,n=1-t,r=n*n,o=r*n;return u(o*e[0].x+3*t*r*e[1].x+3*i*n*e[2].x+s*e[3].x,o*e[0].y+3*t*r*e[1].y+3*i*n*e[2].y+s*e[3].y)},gc=(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 n=u(0,0),r=u(0,0),o=u(0,0),a=ti(ri(t[1],t[0]));const h=3;let l=0,c=0;for(let d=0;de?Math.abs(i/(h*n.x)):1,c=Math.abs(r.x)>e?Math.abs(i/(h*r.x)):1}f[1]=ni(si(n,l),f[1]),f[2]=ri(f[2],si(r,c)),s[d]=f}}return s.length>0?s:[]})(t),s=i.length,n=Array(s*e);let r=0;for(let t=0;t{if(this.wb.length>0){const e=this.wb[this.wb.length-1];if(t.length>0){const i=e.yl(),s=e.ml(),n=i.length+s.length-+e.ql();if(n>=this.Db){const r=s.length>0?s[s.length-1]:i[e.ql()?n:n-1],o=u((r.x+t[0].x)/2,(r.y+t[0].y)/2);e._l(o,m(u(o.x,o.y),u(o.x,o.y))).tu(!0),this.nw([o].concat(t)).Kl(!0)}else e._l(t,this.Ib)}}else t.length>0&&this.nw(t)},this.ow=t=>{if(this.hw.length>0){const e=this.hw[this.hw.length-1];t.length>0&&((e.yl().length+e.ml().length)*this.ew>=this.Db?this.aw(t):e._l(t))}else t.length>0&&this.aw(t)},this.lw=(t,e)=>{const i=t.gg(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.uw=(t,e)=>{const i=t.cw(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.En=p,this.Fx=l,this.dw=f,this.fw=ce(c.pointLineSeriesFillStyle,g),this.Cu=ce(this.qi.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}Lb(){return au(this.hw)}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;for(let t=0;tt.Vn||t.zn||t.ro?void 0:"bubble chart"));for(let e=0;ee.setVisible(t))),this}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorSolveBasis(t){return this.sw=t,this.wb.forEach((e=>e.pl(Ln(t)))),this.hw.forEach((e=>e.pl(Ln(t)))),this.Ts.bs(),this}getCursorSolveBasis(){return this.sw}ld(){return he(this.fw)||he(this.Cu.getFillStyle())}yd(){return this.Fx}mb(t){}Pe(t,e){t.cs(e),this.Ts.bs()}Bb(t){const e=this.wb.length>0?this.wb[this.wb.length-1].yl().length+this.wb[this.wb.length-1].ml().length-+this.wb[this.wb.length-1].ql():void 0;ou(t,e,this.Db,this.rw),ou(t,e,this.Db,this.ow)}aw(t,e){const i=this.Ts.Oc(this.scale)._l(t,e).setMouseInteractions(this.Yi).ke(this.fw).Sl(this.Fx).q(this.Tx).zh(this.Fa).xl(this.hl).bl(this.rl).Ml(this.nl).pl(Ln(this.sw)).cs(this.getHighlight());return this.gs(i),this.hw.push(i),i}nw(t,e){const i=this.Ts.zp(this.scale,void 0,[kh.UserSeries,...this.dw])._l(t,e).setMouseInteractions(this.Yi).Ee(this.Cu).pl(Ln(this.sw)).cs(this.getHighlight());return this.gs(i),this.wb.push(i),i}attach(t,e=!0,i=!1){return ae(t,this.qi,i,{stroke:this.Cu,fill:this.fw}),super.attach(t,e,i)}getPointAmount(){return this.hw.reduce(((t,e)=>t+e.wl()+e.Cl()),this.Lu.length)}clear(){super.clear();for(let t=0;t{}))}gg(t,e,i=this.mx){const s=i?cu(t,e?this.wb.filter((t=>t.getIsUnderMouse())):this.wb,this.uw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):cu(t,e?this.hw.filter((t=>t.getIsUnderMouse())):this.hw,this.lw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==s){const t=ut(s[0],this.Ts.us.dt,this.scale),e=s[1]instanceof lr?s[1].ku():s[1].Lh(),i=s[1]instanceof Qn?s[1].Lh():void 0,n=s[1]instanceof lr?s[1].ku().getFillStyle():void 0,r=W(e)?s[0].color?new U({color:s[0].color}):new U({color:e.getFallbackColor()}):void 0;return gh(t,this.scale,this.xp(new Za,this,t.x,t.y,t).fc(),this,n||r||i)}}solveNearestFromScreen(t,e=this.mx){return this.gg($o(t,this.Ji.us),!1,e)}}const pc=(t,e)=>t.ml().length>=e?t.ml().slice(-e):Array.prototype.concat(t.yl(),t.ml()).slice(-e),yc=(t,e,i)=>{const s=Array.prototype.concat(t.yl(),t.ml()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Nt()._l(s).Ds()};class Ac extends mc{constructor(t,e,i,s,n,r,o,a,h,l,u,c,d,f,g){super(t,e,i,s,n,r,o,a,h,l,u,c,d,f,g),this._s="Spline Series",this.ew=32,this.Db=8e3,this.Aw=t=>{if(0===t.length)return;const e=this.hw.length;if(e>0){const i=e>1,s=this.hw[e-1];if(i){const i=Array.prototype.concat(s.yl(),s.ml()),n=i.length;if(32*n>=this.Db){const i=pc(s,3),n=Array.prototype.concat(i,t),r=gc(n,32);yc(this.wb[e-1],r,32),this.nw(r.slice(66))}else if(n<5){const s=this.hw[e-2],n=pc(s,3),r=Array.prototype.concat(n,i,t),o=gc(r,32),a=this.wb[e-1],h=o.slice(66);a.Nt()._l(h).Ds()}else{const i=this.wb[e-1],n=Array.prototype.concat(i.yl(),i.ml()),r=pc(s,4),o=Array.prototype.concat(r,t),a=gc(o,32),h=n.slice(0,-66).concat(a.slice(33));i.Nt()._l(h).Ds()}}else{const i=Array.prototype.concat(s.yl(),s.ml()),n=i.length,r=this.wb[e-1];if(32*n>=this.Db){const e=pc(s,3),i=Array.prototype.concat(e,t),n=gc(i,32);yc(this.wb[0],n,32),this.nw(n.slice(66))}else if(n+t.length>1){const e=Array.prototype.concat(i,t),s=gc(e,32);r.Nt()._l(s).Ds()}else r._l(t)}}else{const e=t.length>0?gc(t,32):t,i=je(e);this.nw(e,i)}this.ow(t)}}setCursorInterpolationEnabled(t){return super.setCursorInterpolationEnabled(t)}Bb(t){const e=this.hw.length,i=this.hw.length>0?this.hw[e-1].yl().length+this.hw[e-1].ml().length:void 0;ou(t,i,Math.ceil(this.Db/this.ew),this.Aw)}solveNearestFromScreen(t,e=this.mx){if(e)return super.solveNearestFromScreen($o(t,this.Ji.us),e);const i=cu($o(t,this.Ji.us),this.hw,this.lw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==i){const t=ut(i[0],this.Ts.us.dt,this.scale);return gh(t,this.scale,this.xp(new Za,this,t.x,t.y,t).fc(),this,i[1].Lh())}}}class xc{constructor(){this.Gi="FreeformPattern",this.Gl={type:"disabled",packager:(t,e,i)=>t.slice()}}Pb(t,e,i,s,n,r){if(s>0){const n=Math.trunc((e-s)/i);if(n>0&&t.length>1){const e=t.splice(0,n);for(let t=0;t{switch(t){case"normal":default:return 1;case"high":return.25}},bc=s.Record({Gl:{type:"disabled",packager:(t,e,i)=>t.slice()}});class vc extends bc{Pb(t,e,i,s,n,r){if(s>0){const e=Math.ceil(s/i),o=t.length-e;if(o>0){const e=this.pw(t,n);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.bt();return t?Math.min(i,t):i},Tc=(t,e)=>{const i=e.Mt();return t?Math.max(i,t):i};class wc extends vc{gw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(Tc,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(Mc,e?e.min.y:void 0)}}const Ec=(t,e)=>{const i=e.vt();return t?Math.min(i,t):i},kc=(t,e)=>{const i=e.xt();return t?Math.max(i,t):i};class Cc extends vc{gw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(kc,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(Ec,e?e.min.x:void 0)}}const Dc={horizontalProgressive:new class extends wc{constructor(){super({Gl:En()}),this.Gi="HorizontalProgressivePattern"}pw(t,e){const i=t.length,s=Math.min(e.x.getInnerStart(),e.x.getInnerEnd());let n=0;if(i>1)for(let r=0;r0?t[t.length-1].xt():void 0}getXMin(t=[],e){return t.length>0&&t[0].wl()>0?t[0].vt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",En(Sc(t)))}},horizontalRegressive:new class extends wc{constructor(){super({Gl:kn()}),this.Gi="HorizontalRegressivePattern"}pw(t,e){const i=t.length,s=Math.max(e.x.getInnerStart(),e.x.getInnerEnd());let n=0;if(i>1)for(let r=0;r0&&t[0].wl()>0?t[0].xt():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",kn(Sc(t)))}},verticalProgressive:new class extends Cc{constructor(){super({Gl:Cn()}),this.Gi="VerticalProgressivePattern"}pw(t,e){const i=t.length,s=Math.min(e.y.getInnerStart(),e.y.getInnerEnd());let n=0;if(i>1)for(let r=0;r0?t[t.length-1].Mt():void 0}getYMin(t=[],e){return t.length>0&&t[0].wl()>0?t[0].bt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",Cn(Sc(t)))}},verticalRegressive:new class extends Cc{constructor(){super({Gl:Dn()}),this.Gi="VerticalRegressivePattern"}pw(t,e){const i=t.length,s=Math.max(e.y.getInnerStart(),e.y.getInnerEnd());let n=0;if(i>1)for(let r=0;r0&&t[0].wl()>0?t[0].Mt():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].bt():void 0}setPrecision(t){return this.set("_columnPackaging",Dn(Sc(t)))}},freeform:new xc};class Ic extends mc{constructor(t,e,i,s,n,r,o,a,h,l,c,d,f,g,p){super(t,e,i,s,n,r,o,a,Dc.horizontalProgressive,h,c,d,f,g,p),this._s="Step Series",this.rw=t=>{const e=this.wb.length>0?this.wb[this.wb.length-1].yl().length+this.wb[this.wb.length-1].ml().length:void 0;ou(t,e,this.Db,this.mw)},this.mw=t=>{const e=t.length;if(this.wb.length>0){const i=this.wb[this.wb.length-1];if(e>0){const e=i.yl(),s=i.ml(),n=s.length>0?s[s.length-1]:e[e.length-1],r=dc([n].concat(t),this.yw);r.shift();const o=u((n.x+r[0].x)/2,(n.y+r[0].y)/2),a=Array.prototype.concat(o,r);(s.length>0?e.length+s.length:e.length)>=this.Db?(i._l(o,m(u(o.x,o.y),u(o.x,o.y))).tu(!0),this.nw(a).Kl(!0),this.aw(t)):i._l(a)}}else e>0&&this.nw(dc(t,this.yw));this.ow(t)},this.yw=l,void 0===this.dw.find((t=>"DataPattern"===t.type))&&this.dw.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class _c extends uu{constructor(t,e,i,s,n,r,o,a,h,l,u,c,d,f){super(t,e,i,s,n,r,o,a,h,l,u),this.wb=[],this._s="Line Series",this.mx=!0,this.Db=void 0,this.sw="nearest-x",this.Ru=void 0,this.ld=()=>he(this.Cu.getFillStyle()),this.Sw=(t,e)=>{const i=t.Cx(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.uw=(t,e)=>{const i=t.cw(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.dw=c,this.En=f,this.Cu=ce(this.qi.lineSeriesStrokeStyle,d),this.xw={individualLookupValuesEnabled:void 0!==(null==f?void 0:f.individualLookupValuesEnabled)&&f.individualLookupValuesEnabled}}add(t){return super.add(t),this}setMouseInteractions(t){return super.setMouseInteractions(t)}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;for(let t=0;tt.Eu(this.Ru))),this.Ts.bs(),this}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorSolveBasis(t){return this.sw=t,this.wb.forEach((e=>e.pl(Ln(t)))),this.Ts.bs(),this}getCursorSolveBasis(){return this.sw}mb(t){}Bb(t){let e=this.wb[0];e||(e=this.nw(),this.wb.push(e),this.gs(e)),e._l(t,this.Ib)}nw(){return this.Ts.zp(this.scale,this.xw,[kh.UserSeries,...this.dw]).Ee(this.Cu).Eu(this.Ru).pl(Ln(this.sw)).cs(this.getHighlight())}attach(t,e=!0,i=!1){return ae(t,this.qi,i,{stroke:this.Cu}),super.attach(t,e,i)}Pe(t,e){t.cs(e),this.Ts.bs()}Pb(t,e,i,s){}gg(t,e,i=this.mx){const s=cu(t,e?this.wb.filter((t=>t.getIsUnderMouse())):this.wb,i?this.uw:this.Sw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==s){const t=ut(s[0],this.Ts.us.dt,this.scale),e=s[1].ku();return gh(t,this.scale,this.xp(new Za,this,t.x,t.y,t).fc(),this,e.getFillStyle())}}solveNearestFromScreen(t,e=this.mx){return this.gg($o(t,this.Ji.us),!1,e)}}class Fc extends cr{constructor(t,e,i,s,r,o,a,h,l){super(),this.ia=Ce(),this.D=new n.Eventer,this.bw=s,this.Mw=r,this._w=o,this.ww=a,this.Cw=h,this.Ts=t,this.scale=e,this.kw=i,this.qi=l}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}dispose(){return this.kw&&this.kw(this),this.Ts.us.bs(),this.D.emit("dispose",this),this}setVisible(t){return super.setVisible(t),this._w(),this.Ts.us.bs(),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setMouseInteractions(t){return this.ww(this,t),this}getMouseInteractions(){return this.Cw(this)}}class Lc extends ru{constructor(){super(...arguments),this.Tw=[],this.Fw=void 0,this.Iw=!1,this.kw=t=>{const e=this.Tw.findIndex((e=>e===t));e>=0&&this.Tw.splice(e,1),this.Iw=!0,this.Fw=void 0,this.Ts.bs()},this.bw=()=>{this.Fw=void 0,this.Iw=!0,this.Ji.us.bs()},this.Mw=()=>{this.Iw=!0,this.Ji.us.bs()},this._w=()=>{this.Fw=void 0,this.Iw=!0,this.chart.us.bs()},this.ww=(t,e)=>{this.setMouseInteractions(e)},this.Pw=t=>this.getMouseInteractions()}Fe(){super.Fe(),this.Iw&&(this.Dw(this.Tw),this.Iw=!1)}clear(){return this.Tw.slice().forEach(Tt),this.Tw.length=0,this.Iw=!0,this.Fw=void 0,this.Ts.bs(),this}Bw(t,e){void 0!==e?this.Tw.splice(e,0,t):this.Tw.push(t),this.Iw=!0,this.Lw&&this.Lw(t),t.onMouseEnter(((t,e)=>this.wt(t,e))),t.onMouseLeave(((t,e)=>this.Ct(t,e))),t.onMouseClick(((t,e)=>this.kt(t,e))),t.onMouseDoubleClick(((t,e)=>this.Tt(t,e))),t.onMouseDown(((t,e)=>this.Ft(t,e))),t.onMouseUp(((t,e)=>this.It(t,e))),t.onMouseMove(((t,e)=>this.Pt(t,e))),t.onMouseDragStart(((t,e,i)=>this.Bt(t,e,i))),t.onMouseDrag(((t,e,i,s,n)=>this.Dt(t,e,i,s,n))),t.onMouseDragStop(((t,e,i,s)=>this.Lt(t,e,i,s))),t.onMouseWheel(((t,e)=>this.Rt(t,e))),t.onTouchStart(((t,e)=>this.Et(t,e))),t.onTouchMove(((t,e)=>this.Vt(t,e))),t.onTouchEnd(((t,e)=>this.zt(t,e))),this.Ts.bs()}Dm(){return this.Lm&&this.Tw.length>0&&this.getVisible()}setDefaultStyle(t){this.Lw=t,this.Tw.forEach(t),t(this.Rw);for(let t=0;tt.getVisible()&&t.getIsUnderMouse())):this.Tw.filter((t=>t.getVisible())),this.Vw,We);if(void 0!==i)return{location:ut(i[0],this.Ts.us.dt,this.scale),scale:this.scale,resultTableContent:this.xp(new Za,this,i[1]).fc(),owner:this,fillStyle:i[1].getDominantStyle(),figure:i[1]}}solveNearestFromScreen(t){return this.gg($o(t,this.Ji.us),!1)}getXMax(){return this.Fw||(this.Fw=this.zw()),this.Fw.max.x}getXMin(){return this.Fw||(this.Fw=this.zw()),this.Fw.min.x}getYMax(){return this.Fw||(this.Fw=this.zw()),this.Fw.max.y}getYMin(){return this.Fw||(this.Fw=this.zw()),this.Fw.min.y}Sr(){return u(0,0)}zw(){const t=m(c(_e,_e),c(Fe,Fe));for(let e=0;e0?this.Tw[0].getDominantStyle():this.Rw.getDominantStyle()})}}class zc extends Fc{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,i,s,n,r,o,a,h),this.Ow={x:0,y:0,width:0,height:0},this.Nw={x1:0,y1:0,x2:0,y2:0},this.ol=m(u(0,0),u(0,0)),this.be=ce(h.rectangleSeriesFillStyle,l),this.Ts=t,this.scale=e,this.Me=ce(h.rectangleSeriesStrokeStyle,l)}getBoundaries(){return this.ol}setDimensions(t){return"x"in t?(this.Ow=t,this.Nw={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.Nw=t,this.Ow={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.ol=je([this.Ow,u(this.Ow.x+this.Ow.width,this.Ow.y+this.Ow.height)]),this.bw(),this.Ts.bs(),this}getDimensionsPositionAndSize(){return this.Ow}getDimensionsTwoPoints(){return this.Nw}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Mw(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Mw(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Pc extends Lc{constructor(t,e,i,s,n,r,o,a,h,l,c){super(t,e,i,s,n,r,o,a,h,l),this._s="Rectangle Series",this.xp=(t,e,i)=>{const s=i.getDimensionsPositionAndSize();return t.addRow(e._s).addRow("X","",e.axisX.formatValue(s.x)).addRow("Y","",e.axisX.formatValue(s.y)).addRow("Width","",e.axisX.formatValue(s.width)).addRow("Height","",e.axisX.formatValue(s.height))},this.Gw=Ee(),this.Vw=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return ut(i,this.scale,this.Ts.us.dt)},this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Ww=c,this.Rw=new zc(this.Ts,this.scale,wt,wt,wt,wt,wt,(t=>!1),this.qi,this.Ww).dispose(),this.Uw=new Lh((()=>{const t=this.Gw._t(this.Ts.bv(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.figure),i})))),(()=>{this.Gw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){}Dw(t){const e=this.Uw.Xp();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}],n=t.getFillStyle(),r=t.getStrokeStyle();e.add({ia:t.ia,vertices:s,figure:t},{fillStyle:n,strokeStyle:r})})),e.finishPlot()}add(t){const e=new zc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.qi,this.Ww).setDimensions(t);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Rc extends Fc{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,i,s,n,r,o,a,h),this.Yw=[],this.ol=Le,this.Ts=t,this.scale=e,this.be=ce(h.polygonSeriesFillStyle,l),this.Me=ce(h.polygonSeriesStrokeStyle,l)}getBoundaries(){return this.ol}setDimensions(t){return this.Yw=t,this.ol=je(this.Yw),this.bw(),this.Ts.bs(),this}getDimensions(){return this.Yw}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Mw(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Mw(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Vc extends Lc{constructor(t,e,i,s,n,r,o,a,h,l,c){super(t,e,i,s,n,r,o,a,h,l),this._s="Polygon Series",this.xp=(t,e,i)=>t.addRow(e.getName()),this.Gw=Ee(),this.Vw=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return ut(i,this.scale,this.Ts.us.dt)},this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Ww=c,this.Rw=new Rc(this.Ts,this.scale,wt,wt,wt,wt,wt,(t=>!1),this.qi,this.Ww).dispose(),this.Uw=new Lh((()=>{const t=this.Gw._t(this.Ts.bv(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.figure),i})))),(()=>{this.Gw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){}Dw(t){const e=this.Uw.Xp();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=t.getFillStyle(),n=t.getStrokeStyle();e.add({ia:t.ia,vertices:i,figure:t},{fillStyle:s,strokeStyle:n})})),e.finishPlot()}add(t){const e=new Rc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.qi,this.Ww).setDimensions(t);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Bc extends Fc{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,i,s,n,r,o,a,h),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.ol=m(u(0,0),u(0,0)),this.qi=h,this.Ts=t,this.scale=e,this.Me=ce(h.segmentSeriesStrokeStyle,l)}getBoundaries(){return this.ol}setDimensions(t){return this.dimensions=t,this.ol=m(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.bw(),this.Ts.bs(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Mw(),this}getStrokeStyle(){return this.Me}getDominantStyle(){const t=this.Me;return t!==nt?t.getFillStyle():V}}class Oc extends Lc{constructor(t,e,i,s,n,r,o,a,h,l,c){super(t,e,i,s,n,r,o,a,h,l),this._s="Segment Series",this.xp=(t,e,i)=>t.addRow(e._s).addRow("Start",e.axisX.formatValue(i.getDimensions().startX),",",e.axisY.formatValue(i.getDimensions().startY)).addRow("End",e.axisX.formatValue(i.getDimensions().endX),",",e.axisY.formatValue(i.getDimensions().endY)),this.Hw=Ee(),this.Vw=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return ut(i,this.scale,this.Ts.us.dt)},this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Ww=c,this.Rw=new Bc(this.Ts,this.scale,wt,wt,wt,wt,wt,(t=>!1),this.qi,this.Ww).dispose(),this.$w=new Lh((()=>{const t=this.Hw._t(this.Ts._A(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ee(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.CA(e.start,e.end),this.Hw.Ot(i,e.figure),i})))),(()=>{this.Hw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){}Dw(t){const e=this.$w.Xp();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s={x:i.startX,y:i.startY},n={x:i.endX,y:i.endY},r=t.getStrokeStyle();e.add({ia:t.ia,start:s,end:n,figure:t},{strokeStyle:r})})),e.finishPlot()}add(t){const e=new Bc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.qi,this.Ww).setDimensions(t);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Nc extends Fc{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,i,s,n,r,o,a,h),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.ol=m(u(0,0),u(0,0)),this.Ts=t,this.scale=e,this.be=ce(h.ellipseSeriesFillStyle,l),this.Me=ce(h.ellipseSeriesStrokeStyle,l)}getBoundaries(){return this.ol}setDimensions(t){return this.dimensions=t,this.ol=m(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.bw(),this.Ts.bs(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Mw(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Mw(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Uc extends Lc{constructor(t,e,i,s,n,r,o,a,h,l,c){super(t,e,i,s,n,r,o,a,h,l),this._s="Ellipse Series",this.xp=(t,e,i)=>t.addRow(e._s).addRow("X","",e.axisX.formatValue(i.getDimensions().x)).addRow("Y","",e.axisY.formatValue(i.getDimensions().y)).addRow("Radius X","",e.axisX.formatValue(i.getDimensions().radiusX)).addRow("Radius Y","",e.axisY.formatValue(i.getDimensions().radiusY)),this.Gw=Ee(),this.Vw=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return ut(i,this.scale,this.Ts.us.dt)},this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Ww=c,this.Rw=new Nc(this.Ts,this.scale,wt,wt,wt,wt,wt,(t=>!1),this.qi,this.Ww).dispose(),this.Uw=new Lh((()=>{const t=this.Gw._t(this.Ts.bv(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.figure),i})))),(()=>{this.Gw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){if(!(t instanceof Li||t instanceof zi))throw new Error("EllipseSeries only supports Linear Axes")}Dw(t){const e=this.Uw.Xp();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=[],n=void 0!==i.drawSteps?i.drawSteps:72;for(let t=0;t<=n;t+=1){const e=t/n*2*Math.PI,r=i.x+i.radiusX*Math.cos(e),o=i.y+i.radiusY*Math.sin(e);s.push({x:r,y:o})}const r=t.getFillStyle(),o=t.getStrokeStyle();e.add({ia:t.ia,vertices:s,figure:t},{fillStyle:r,strokeStyle:o})})),e.finishPlot()}add(t){const e=new Nc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.qi,this.Ww).setDimensions(t);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Gc extends Fc{constructor(t,e,i,s,n,r,o,a,h,l,u,c,d,f,g,p,y){super(t,e,i,s,n,r,o,a,y),this.Xw=1,this.jw=1,this.Ts=t,this.scale=e,this.dimensionStrategy=h,this.start=l,this.end=u,this.lowerExtreme=c,this.lowerQuartile=d,this.median=f,this.upperQuartile=g,this.upperExtreme=p,this.boundaries=m(this.dimensionStrategy.toPoint(l,c),this.dimensionStrategy.toPoint(u,p)),this.Zw=this.qi.boxSeriesBodyFillStyle,this.Qw=this.qi.boxSeriesBodyStrokeStyle,this.Cu=this.qi.boxSeriesStrokeStyle,this.Jw=this.qi.boxSeriesMedianStrokeStyle,this.Ds()}getBoundaries(){return this.boundaries}setBodyWidth(t){return this.Xw=t,this.Ds(),this}getBodyWidth(){return this.Xw}setBodyFillStyle(t){return this.Zw="function"==typeof t?t(this.Zw):t,this.Mw(),this}getBodyFillStyle(){return this.Zw}setBodyStrokeStyle(t){return this.Qw="function"==typeof t?t(this.Qw):t,this.Mw(),this}getBodyStrokeStyle(){return this.Qw}setTailWidth(t){return this.jw=t,this.Ds(),this}getTailWidth(){return this.jw}setStrokeStyle(t){return this.Cu="function"==typeof t?t(this.Cu):t,this.Mw(),this}getStrokeStyle(){return this.Cu}setMedianStrokeStyle(t){return this.Jw="function"==typeof t?t(this.Jw):t,this.Mw(),this}getMedianStrokeStyle(){return this.Jw}Ds(){this.bw()}getDominantStyle(){return this.getBodyFillStyle()}}const Wc=(t,e,i)=>t.addRow(e.getName()).addRow("Lower extreme","",i.lowerExtreme.toFixed(2)).addRow("Lower quartile","",i.lowerQuartile.toFixed(2)).addRow("Median","",i.median.toFixed(2)).addRow("Upper quartile","",i.upperQuartile.toFixed(2)).addRow("Upper extreme","",i.upperExtreme.toFixed(2));class Yc extends Lc{constructor(t,e,i,s,n,r,o,a,h,l,u,c){super(t,e,i,s,n,r,o,a,l,u),this._s="Box Series",this.xp=Wc,this.Gw=Ee(),this.Vw=t=>ut(this.Fs.toPoint((t.start+t.end)/2,t.median),this.scale,this.Ts.us.dt),this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Fs=h,this.Rw=new Gc(this.Ts,this.scale,this.kw,wt,wt,wt,wt,(t=>!1),this.Fs,0,0,0,0,0,0,0,this.qi).dispose(),this.$w=new Lh((()=>{const t=this.Ts._A(this.scale);return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ee(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.CA(e.start,e.end),i}))))),this.Uw=new Lh((()=>{const t=this.Gw._t(this.Ts.bv(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.figure),i})))),(()=>{this.Gw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){if(!(t instanceof Li||t instanceof zi))throw new Error("BoxSeries only supports Linear Axes")}Dw(t){const e=this.Uw.Xp(),i=this.$w.Xp();t.forEach((t=>{if(!t.getVisible())return;const s=this.Fs.toPoint((t.start+t.end-t.Xw*(t.end-t.start))/2,t.lowerQuartile),n=this.Fs.toPoint((t.end-t.start)*t.Xw,t.upperQuartile-t.lowerQuartile),r=this.Fs.toPoint((t.start+t.end)/2,t.lowerQuartile),o=this.Fs.toPoint((t.start+t.end)/2,t.lowerExtreme),a=this.Fs.toPoint((t.start+t.end)/2,t.upperQuartile),h=this.Fs.toPoint((t.start+t.end)/2,t.upperExtreme),l=this.Fs.toPoint((t.start+t.end-t.jw*(t.end-t.start))/2,t.lowerExtreme),u=this.Fs.toPoint((t.start+t.end+t.jw*(t.end-t.start))/2,t.lowerExtreme),c=this.Fs.toPoint((t.start+t.end-t.jw*(t.end-t.start))/2,t.upperExtreme),d=this.Fs.toPoint((t.start+t.end+t.jw*(t.end-t.start))/2,t.upperExtreme),f=this.Fs.toPoint((t.start+t.end-t.Xw*(t.end-t.start))/2,t.median),g=this.Fs.toPoint((t.start+t.end+t.Xw*(t.end-t.start))/2,t.median);e.add({ia:t.ia,vertices:[{x:s.x,y:s.y},{x:s.x,y:s.y+n.y},{x:s.x+n.x,y:s.y+n.y},{x:s.x+n.x,y:s.y}],figure:t},{fillStyle:t.Zw,strokeStyle:t.Qw}),i.add({ia:0,start:r,end:o,figure:t},{strokeStyle:t.Cu}),i.add({ia:0,start:a,end:h,figure:t},{strokeStyle:t.Cu}),i.add({ia:0,start:l,end:u,figure:t},{strokeStyle:t.Cu}),i.add({ia:0,start:c,end:d,figure:t},{strokeStyle:t.Cu}),i.add({ia:0,start:f,end:g,figure:t},{strokeStyle:t.Jw})})),e.finishPlot(),i.finishPlot()}add(t){const e=new Gc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.Fs,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.qi);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Hc extends ru{constructor(){super(...arguments),this.wb=[],this.Lu=[],this.Kw=[],this.qw=[],this.Db=1e3,this.Cb=0,this.Hi=e.HighlightModes.onHover,this.Gl={type:"disabled",packager:(t,e,i)=>t.slice()},this.mx=!0,this.tC=[],this.iC=[],this.sC=!1,this.ld=()=>he(this.eC)||he(this.hC),this.rC=t=>{const e=t.length;if(this.wb.length>0){const i=this.wb.length-1,s=this.wb[i];if(e>0){const[e,i]=s.yl(),[n,r]=s.ml();if((n?e.length+n.length:e.length)>=this.Db){const o=n&&n.length>0?n[n.length-1]:e[e.length-1],a=r&&r.length>0?r[r.length-1]:i[e.length-1],h=(o.x+t[0].position)/2,l=ui(h,o,u(t[0].position,t[0].high)).y,c=ui(h,a,u(t[0].position,t[0].low)).y,f=d(h,l,c);s._l(f,m(u(h,c),u(h,l))).tu(!0),this.nC([f].concat(t)).Kl(!0)}else s._l(t)}}else e>0&&this.nC(t)},this.oC=t=>{const e=this.tC,i=t.length;if(this.tC.length>0){if(i>0){const i=e[e.length-1],s=i.yl(),n=i.ml();if(s.length+n.length>=this.Db){const r=n.length>0?n[n.length-1]:s[s.length-1],o=(r.x+t[0].x)/2,a=ui(o,r,u(t[0].x,t[0].y)).y,h=u(o,a);i._l(h,m(u(o,a),u(o,a))).tu(!0),e.push(this.aC([h].concat(t),this.Ib).Kl(!0))}else i._l(t)}}else i>0&&e.push(this.aC(t))},this.lC=t=>{const e=this.iC,i=t.length;if(this.iC.length>0){if(i>0){const i=e[e.length-1],s=i.yl(),n=i.ml();if(s.length+n.length>=this.Db){const r=n.length>0?n[n.length-1]:s[s.length-1],o=(r.x+t[0].x)/2,a=ui(o,r,u(t[0].x,t[0].y)).y,h=u(o,a);i._l(h,m(u(o,a),u(o,a))).tu(!0),e.push(this.uC([h].concat(t)).Kl(!0))}else i._l(t)}}else i>0&&e.push(this.uC(t))},this.cC=(t,e)=>{const i=t.Cx(e);if(i)return[ut(i[0],this.scale,this.Ts.us.dt),ut(i[1],this.scale,this.Ts.us.dt)]},this.dC=(t,e)=>{const i=t.cw(e);if(i)return[ut(i[0],this.scale,this.Ts.us.dt),ut(i[1],this.scale,this.Ts.us.dt)]}}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.Cb=void 0!==e&&e>0?e:0,this.Ts.bs(),this}clear(){for(let t=0;tt+e.wl()+e.Cl()),this.Lu.length)}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}setCursorEnabled(t){return super.setCursorEnabled(t)}getCursorResultTableFormatter(){return this.xp}getXMax(){return Bt(this.wb,_t,Math.max,Pt,this.Ib)||0}getXMin(){return Bt(this.wb,It,Math.min,zt,this.Ib)||0}getYMax(){return Bt(this.wb,Lt,Math.max,Vt,this.Ib)||0}getYMin(){return Bt(this.wb,Ft,Math.min,Rt,this.Ib)||0}Sr(){const t=u(0,0);for(const e of this.wb)t.x=Math.max(t.x,e.Vl()),t.y=Math.max(t.y,e.zl());return t}Dm(){return this.Lm&&this.getPointAmount()>0&&this.getVisible()}mb(t){}Tb(t,e,i){this.Lu=se(this.Lu,t,{canReturnB:!1}),this.Kw=se(this.Kw,e,{canReturnB:!1}),this.qw=se(this.qw,i,{canReturnB:!1}),this.Ts.bs()}fC(t,e,i,s){this.AC(e,i,s),this.Tb(Array.isArray(t)?t:[t],e,i)}AC(t,e,i){const s=qe(je(t),je(e));this.Ib?this.Ib=qe(this.Ib,s):this.Ib=s,i&&(this.Ib=qe(this.Ib,i))}pw(){const t=this.wb.length,e=Math.min(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd());let i=0;if(t>1)for(let s=0;s0){const n=Math.ceil(i/e),r=t.length-n;if(r>0&&s>0){const e=r-s>0?s:r;if(e>0){for(let i=0;i0?this.wb[this.wb.length-1]:void 0,i=e?e.yl()[0].length+(e.ml()[0]?e.ml()[0].length:0):void 0;ou(t,i,this.Db,this.rC)}pC(t){const e=this.tC.length>0?this.tC[this.tC.length-1].yl().length+this.tC[this.tC.length-1].ml().length:void 0;ou(t,e,this.Db,this.oC)}mC(t,e){const i=this.tC.length>0?this.tC[this.tC.length-1].yl().length+this.tC[this.tC.length-1].ml().length:void 0;ou(t,i,this.Db,this.oC),ou(e,i,this.Db,this.lC)}nC(t,e){const i=this.Ts.yC(this.scale)._l(t,e).ke(this.eC).Ql(this.hC).jl(this.Gl).cs(this.getHighlight());return this.wb.push(i),this.gs(i),i}SC(t,e,i){const s=this.Ts.zp(this.scale,void 0,[kh.UserSeries])._l(t,i).setMouseInteractions(!1).Ee(e).cs(this.getHighlight());return this.gs(s),s}aC(t,e){return this.SC(t,this.vC,e)}uC(t,e){return this.SC(t,this.xC,e)}bC(t){this.eC="function"==typeof t?t(this.eC):t;const e=this.eC;for(let t=0;t0){const t=this.wb.length,e=this.pw();this.Pb(this.wb,this.Db,this.Cb,e);const i=this.wb.length;this.tC.length>0&&this.Pb(this.tC,this.Db,this.Cb,e),this.iC.length>0&&this.Pb(this.iC,this.Db,this.Cb,e),t!==i&&this._b(),this.sC=!0}}Fe(){if(super.Fe(),this.Lu.length>0&&(this.gC(this.Lu),this.IC(this.Kw,this.qw),this.sC=!0),this.sC){const t=this.getBoundaries();for(const e of this.wb)e.ra(t);for(const e of this.tC)e.ra(t);for(const e of this.iC)e.ra(t)}}$p(){this.Ib=void 0,this.Lu.length=0,this.Kw.length=0,this.qw.length=0}gg(t,e,i=this.mx){const s=((t,e,i)=>{let s,n,r=Number.MAX_VALUE;for(let o=0;ot.getIsUnderMouse())):this.wb,i?this.dC:this.cC);if(void 0!==s&&void 0!==s[0]){const t=ut(s[0][0],this.Ts.us.dt,this.scale),e=ut(s[0][1],this.Ts.us.dt,this.scale);return gh(t,this.scale,this.xp(new Za,this,t.x,t.y,e.y).fc(),this,s[1].Lh())}}solveNearestFromScreen(t,e=this.mx){return this.gg($o(t,this.Ji.us),!1,e)}}const Xc=(t,e,i,s,n)=>t.addRow(e.getName()).addRow("Position","",e.axisX.formatValue(i)).addRow("Value","",e.axisY.formatValue(s)).addRow("Base","",e.axisY.formatValue(n));class jc extends Hc{constructor(t,e,i,s,n,r,o,a,h=0,l,u){super(t,e,i,s,n,r,o,a,l,u),this._s="Area Series",this.xp=Xc,this.ds((t=>t.Vn||t.zn||t.qn?void 0:"area series")),this.PC=h}add(t){0!==this.wb.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.DC(e),[i,s]=this.BC(t);this.fC(t,i,s,m(u(_e,this.PC),u(Fe,this.PC)));const n=this.Lu[this.Lu.length-1];this.Fb=n?{position:n.position,high:n.high,low:n.low}:void 0,this.D.emit("dataAdd",this,e,this.Ib)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.Fb?this.Fb.position+e:0),this.add(hu(t,e,s)),this}Rb(t){return this.D.on("dataAdd",t)}Eb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}zb(t){return this.D.off(t)}}class $c extends jc{constructor(){super(...arguments),this.xC=nt}IC(t){return this.pC(t)}BC(t){const e=t.length,i=Array(e);for(let s=0;s=r){const t=d(n.x,n.y,r);if(0!==i&&Ot(e[i-1],t)||(e[i]=t,i+=1),o.y=r){const t=yi(u(Fe,r),u(_e,r),n,o);t&&(e[i]=d(t.x,t.y,r),i+=1),e[i]=d(o.x,o.y,r),i+=1}else e[i]=d(o.x,r,r),i+=1}}return i}Lb(){return au(this.wb,(t=>t[0]||[]))}setFillStyle(t){return this.bC(t),this}getFillStyle(){return this._C()}attach(t,e=!0,i=!1){return ae(t,this.qi,i,{fill:this.eC,stroke:this.vC}),super.attach(t,e,i)}}class Jc extends $c{constructor(t,e,i,s,n,r,o,a,h,l,u){super(t,e,i,s,n,r,o,a,h,l,u);const c=t.getSeries().length;this.eC=V,this.hC=ce(this.qi.areaSeriesNegativeFillStyle,c),this.vC=ce(this.qi.areaSeriesNegativeStrokeStyle,c)}DC(t){return this.VC(t)}VC(t){const e=[];return 1===t.length?this.RC(t[0],e):this.EC(t,e),e}RC(t,e,i=0){const s=this.PC;return e[i]=t.y>s?d(t.x,s,s):d(t.x,t.y,s),i+1}EC(t,e,i=0){let s=0;const n=t.length-1,r=this.PC;for(;sr){const t=yi(u(Fe,r),u(_e,r),n,o);t&&(e[i]=d(t.x,t.y,r),i+=1),e[i]=d(o.x,r,r),i+=1}else e[i]=d(o.x,o.y,r),i+=1}else{const t=d(n.x,r,r);if(0!==i&&Ot(e[i-1],t)||(e[i]=t,i+=1),o.y<=r){const t=yi(u(Fe,r),u(_e,r),n,o);t&&(e[i]=d(t.x,t.y,r),i+=1),e[i]=d(o.x,o.y,r),i+=1}else e[i]=d(o.x,r,r),i+=1}}return i}Lb(){return au(this.wb,(t=>t[1]))}setFillStyle(t){return this.MC(t),this}getFillStyle(){return this.Jl()}attach(t,e=!0,i=!1){return ae(t,this.qi,i,{fill:this.hC,stroke:this.vC}),super.attach(t,e,i)}}class Kc extends jc{constructor(t,e,i,s,n,r,o,a,h,l,u){super(t,e,i,s,n,r,o,a,h,l,u);const c=t.getSeries().length;this.eC=ce(this.qi.areaSeriesBipolarHighFillStyle,c),this.vC=ce(this.qi.areaSeriesBipolarHighStrokeStyle,c),this.hC=ce(this.qi.areaSeriesBipolarLowFillStyle,c),this.xC=ce(this.qi.areaSeriesBipolarLowStrokeStyle,c)}DC(t){return this.zC(t)}IC(t,e){return this.mC(t,e)}zC(t){let e=0;const i=[],s=t.length,n=this.PC;return s>0&&(this.OC&&(this.OC.y<=n&&n<=t[0].y||this.OC.y>=n&&n>=t[0].y)&&(i[e]=d(.5*(this.OC.x+t[0].x),n,n),e+=1),this.OC=t[s-1],1===s?this.RC(t[0],i,e):this.EC(t,i)),i}RC(t,e,i=0){return e[i]=d(t.x,t.y,this.PC),i+1}EC(t,e){let i=0,s=0;const n=t.length-1,r=this.PC;for(;s=r&&r>=o.y){const t=n.y,s=o.y,a=r,h=t===s?o.x:Fr(n.x,o.x,(a-t)/(s-t));e[i]=d(h,r,r),i+=1}e[i]=d(o.x,o.y,r),i+=1}return i}BC(t){const e=t.length,i=Array(e),s=Array(e),n=this.PC;for(let r=0;rn?(i[r]=u(e.position,e.high),s[r]=u(e.position,n)):e.hight[0]))}setPositiveFillStyle(t){return this.bC(t),this}setNegativeFillStyle(t){return this.MC(t),this}setPositiveStrokeStyle(t){return this.wC(t),this}setNegativeStrokeStyle(t){return this.CC(t),this}getPositiveFillStyle(){return this._C()}getNegativeFillStyle(){return this.Jl()}getPositiveStrokeStyle(){return this.kC()}getNegativeStrokeStyle(){return this.TC()}attach(t,e=!0,i=!1){return ae(t,this.qi,i,{fill:this.eC,fill2:this.hC,behavior:{colorStep:!0}}),super.attach(t,e,i)}}const Zc={Positive:qc,Negative:Jc,Bipolar:Kc},Qc=(t,e,i,s,n)=>t.addRow(e.getName()).addRow("Position","",e.axisX.formatValue(i)).addRow("High","",e.axisY.formatValue(s)).addRow("Low","",e.axisY.formatValue(n));class td extends Hc{constructor(t,e,i,s,n,r,o,a,h,l,u){super(t,e,i,s,n,r,o,a,h,l),this._s="Area Range Series",this.xp=Qc,this.ds((t=>t.Vn||t.zn||t.qn?void 0:"area range series"));const c=u;this.eC=ce(this.qi.areaRangeSeriesFillStyle,c),this.vC=ce(this.qi.areaRangeSeriesStrokeStyle,c),this.hC=ce(this.qi.areaRangeSeriesFillStyleInverted,c),this.xC=ce(this.qi.areaRangeSeriesStrokeStyleInverted,c)}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.fC(t,i,s);const n=this.Lu[this.Lu.length-1];return this.Fb=n?{position:n.position,high:n.high,low:n.low}:void 0,this.D.emit("dataAdd",this,e,this.Ib),this}addArraysHighLow(t,e,i=1,s=0){if(t.length!==e.length)throw new Error("arrayHigh and arrayLow lengths are not equal");{let n=s;n||(n=this.Fb?this.Fb.position+i:0),this.add(((t,e,i=1,s)=>{const n=void 0!==s?s:0,r=new Array(t.length);for(let s=0;s{const e=t[0],i=t[1];if(!e||!i)return[];const s=[],n=e.length;for(let t=0;t{const i=t.gg(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.En=d,this.Fx=h,this.be=ce(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}ld(){return he(this.be)}yd(){return this.Fx}mb(t){}attach(t,e=!0,i=!1){return ae(t,this.qi,i,{fill:this.be}),super.attach(t,e)}Pe(t,e){t.cs(e),this.Ts.bs()}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(let t=0;tt.Vn||t.zn||t.ro?void 0:"bubble chart"));for(let e=0;et.getIsUnderMouse())):this.wb,this.lw,We);if(void 0!==i){const t=ut(i[0],this.Ts.us.dt,this.scale),e=i[1].Lh(),s=W(e)?i[0].color?new U({color:i[0].color}):new U({color:e.getFallbackColor()}):e;return gh(t,this.scale,this.xp(new Za,this,t.x,t.y,t).fc(),this,s)}}solveNearestFromScreen(t){return this.gg($o(t,this.Ji.us),!1)}setCursorResultTableFormatter(t){return super.setCursorResultTableFormatter(t)}}class id{constructor(t,e,i,s){this.NC=!1,this.D=new n.Eventer,this.chart=i,this.GC=s,this.Xs=t.Xs,this.te=s||_s,this.WC=St.document.createElement("div"),this.WC.style.position="absolute",this.WC.style.pointerEvents="none",St.document.body.append(this.WC);const r=()=>{const t=i.engine.container.getBoundingClientRect();this.WC.style.left=`${t.left}px`,this.WC.style.top=`${t.top}px`,this.WC.style.width=`${t.width}px`,this.WC.style.height=`${t.height}px`};r(),i.onResize(r),this.UC(this.WC),this.YC(),this.HC(),this.$C(),this.XC(e),this.chart.jC().push(this)}UC(t){this.ZC=St.document.createElement("div"),this.ZC.style.pointerEvents="all",t.append(this.ZC),this.QC=St.document.createElement("div"),this.JC=new vs(this.Xs,this.te,this.chart,this.QC),this.KC=St.document.createElement("table"),this.KC.style.borderSpacing="0",this.ZC.appendChild(this.JC.ae()),this.ZC.appendChild(this.QC),this.QC.appendChild(this.KC)}HC(){let t=0,e=0,i=0,s=0,n=!1;this.NC=!1,this.ZC.onmousedown=r=>{r=r||St.event,i=r.clientX,s=r.clientY,n=!0,St.document.onmouseup=t=>{this.NC?this.ZC.addEventListener("click",jt,!0):this.ZC.removeEventListener("click",jt,!0),n=!1,this.NC=!1,St.document.onmouseup=null,St.document.onmousemove=null},St.document.onmousemove=r=>{r=r||St.event,n&&(t=i-r.clientX,e=s-r.clientY,i=r.clientX,s=r.clientY,this.NC=!0,this.ZC.style.top=this.ZC.offsetTop-e+"px",this.ZC.style.left=this.ZC.offsetLeft-t+"px",this.ZC.style.removeProperty("right"),this.ZC.style.removeProperty("bottom"))}}}$C(){let t=0,e=0,i=0,s=0,n=!1;this.ZC.ontouchstart=r=>{r=r||St.event,i=r.touches[0].clientX,s=r.touches[0].clientY,n=!0,this.ZC.ontouchend=()=>{n=!1,St.document.ontouchend=null,St.document.ontouchmove=null},this.ZC.ontouchmove=r=>{n&&(jt(r),r=r||St.event,t=i-r.touches[0].clientX,e=s-r.touches[0].clientY,i=r.touches[0].clientX,s=r.touches[0].clientY,this.ZC.style.top=this.ZC.offsetTop-e+"px",this.ZC.style.left=this.ZC.offsetLeft-t+"px",this.ZC.style.removeProperty("right"),this.ZC.style.removeProperty("bottom"))}}}YC(){this.ZC.style.setProperty("top","10px"),this.ZC.style.setProperty("left","10px"),this.ZC.style.position="absolute",this.ZC.style.display="flex",this.ZC.style.alignItems="flex-start",this.QC.style.setProperty("display","none")}removePositionProperty(){this.ZC.style.removeProperty("top"),this.ZC.style.removeProperty("left"),this.ZC.style.removeProperty("bottom"),this.ZC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.ZC.style.setProperty("bottom","10px"),this.ZC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.ZC.style.setProperty("top","10px"),this.ZC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.ZC.style.setProperty("bottom","10px"),this.ZC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.ZC.style.setProperty("top","10px"),this.ZC.style.setProperty("right","10px")}}XC(t){for(let e=0;et.addRow(e.getName()).addRow("X:","",e.axisX.formatValue(i.x)).addRow("Y:","",e.axisY.formatValue(i.y)).addRow("Intensity:","",i.intensity.toFixed(1));class nd extends ru{constructor(t,e,i,s,n,r,o,a,h,l,u,c){super(t,e,i,s,n,r,o,a,l,u),this._s="Heatmap Grid Series",this.xp=sd,this.mx=!1,this.Jy={},this.ds((t=>t.Vn||t.zn||t.io?void 0:"heatmap series")),this.ik=h,this.qi=l;const d=c;this.be=ce(l.heatmapGridSeriesFillStyle,d),this.Ky=ce(this.qi.heatmapGridSeriesWireframeStyle,d);const f={heatmapDataType:"intensity",dataOrder:h.dataOrder||"columns",columns:h.columns,rows:h.rows};this.En=f,this.sk=this.Ts.ek(this.scale,[],f).ke(this.be).qy(this.Ky).cs(this.getHighlight()),this.gs(this.sk),h.start&&this.setStart(h.start),h.end&&this.setEnd(h.end),h.step&&this.setStep(h.step),this.setHighlightOnHover(!1)}iS(){const t=this.Jy.start||{x:0,y:0};let e;e=this.Jy.end?{x:(this.Jy.end.x-t.x)/this.En.columns,y:(this.Jy.end.y-t.y)/this.En.rows}:this.Jy.step?this.Jy.step:{x:1,y:1},this.sk.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.sk.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.sk.eS().step}setEnd(t){return this.Jy.end=t,this.iS(),this}getEnd(){return this.sk.eS().end}clear(){return this.sk.Nt(),this.Ts.bs(),this.D.emit("dataClear",this),this}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.sk.qy(this.Ky),this.Ts.bs(),this.D.emit("styleChange",this),this}getWireframeStyle(){return this.Ky}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.sk.rS(t),this.Ts.bs(),this.D.emit("styleChange",this),this}getIntensityInterpolation(){return this.sk.nS()}Dm(){return this.Lm&&this.getVisible()}ld(){return he(this.be)}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.be}),this}hk(t){this.sk.hk().forEach((e=>{t.sk.oS(e)}))}zb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}rk(t){return this.D.on("styleChange",t)}nk(t){return this.D.off(t)}gg(t,e,i=this.mx){const s=ut(t,this.Ts.us.dt,this.scale),n=e?this.sk.getIsUnderMouse()?this.sk:void 0:this.sk;if(!n)return;const r=i?n.vx(s):n.gg(s);if(r){const t={x:r.x,y:r.y,column:r.column,row:r.column,intensity:r.cellValue};return{location:t,scale:this.scale,resultTableContent:this.xp(new Za,this,t).fc(),owner:this}}}solveNearestFromScreen(t,e=this.mx){return this.gg($o(t,this.Ji.us),!1,e)}getXMax(){const t=this.sk;return t?t.xt():void 0}getXMin(){const t=this.sk;return t?t.vt():void 0}getYMax(){const t=this.sk;return t?t.Mt():void 0}getYMin(){const t=this.sk;return t?t.bt():void 0}Sr(){const t=u(0,0);return t.x=Math.max(t.x,this.sk.Vl()),t.y=Math.max(t.y,this.sk.zl()),t}mb(t){if(!(t instanceof Li))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Li&&t._i())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}Pe(t,e){t.cs(e),this.Ts.bs()}Fe(){return super.Fe(),this.sk.ra(this.getBoundaries()),this}}class rd extends nd{constructor(t,e,i,s,n,r,o,a,h,l,u,c){super(t,e,i,s,n,r,o,a,h,l,u,c),this.$m=!1,this.xp=sd}invalidateIntensityValues(t){if(this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.En.dataOrder?t.length:t[0].length,rows:"rows"===this.En.dataOrder?t.length:t[0].length},i="columns"===this.En.dataOrder?this.En.columns:this.En.rows,s="columns"===this.En.dataOrder?this.En.rows:this.En.columns;if(e.x>i||e.y>s){if(!0===this.chart.fs.oo){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.En.columns}x${this.En.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const n=[];for(let e=0;eo||r>a){if(!0===this.chart.fs.oo){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.En.columns}x${this.En.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.`;St.console.warn(i)}const i=Math.max(s-o,0),n=e.primary-i,h=Math.max(r-a,0),l=[];for(let e=0;e0?-h:void 0);t={iColumn:t.iColumn,iRow:t.iRow,values:l}}this.sk.oS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:n,values:t.values})}return this.D.emit("invalidateIntensity",this,t),this.Ts.bs(),this.$m=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.sk.ke(this.be),this.D.emit("styleChange",this),this.Ts.bs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}ak(t){return this.D.on("invalidateIntensity",t)}lk(t){return this.D.off(t)}}class od extends ru{constructor(t,e,i,s,n,r,o,a,h,l,u,c){super(t,e,i,s,n,r,o,a,l,u),this._s="Scrolling Heatmap Grid Series",this.xp=sd,this.mx=!1,this.Jy={},this.ds((t=>t.Vn||t.zn||t.io?void 0:"heatmap series")),this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const d=c;this.be=ce(l.heatmapScrollingGridSeriesFillStyle,d),this.Ky=ce(this.qi.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",...h};this.En=f,this.uk=this.Ts.ck(this.scale,[],f).ke(this.be).qy(this.Ky).cs(this.getHighlight()),this.gs(this.uk),h.start&&this.setStart(h.start),h.step&&this.setStep(h.step),this.setHighlightOnHover(!1)}iS(){const t=this.Jy.start||{x:0,y:0};let e;e=this.Jy.step?this.Jy.step:{x:1,y:1},this.uk.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.uk.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.uk.eS().step}clear(){return this.uk.Nt(),this.Ts.bs(),this}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.uk.qy(this.Ky),this.Ts.bs(),this}getWireframeStyle(){return this.Ky}setPixelInterpolationMode(t){return t=t||"disabled",this.uk.rS(t),this.Ts.bs(),this}getPixelInterpolationMode(){return this.uk.nS()}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorEnabled(t){return super.setCursorEnabled(t)}setDataCleaning(t){return this.uk.Eu(t),this.Ts.bs(),this}Dm(){return this.Lm&&this.getVisible()}ld(){return he(this.be)}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.be}),this}ke(t){return this.be="function"==typeof t?t(this.be):t,this.uk.ke(this.be),this.Ts.bs(),this}gg(t,e,i=this.mx){const s=ut(t,this.Ts.us.dt,this.scale),n=e?this.uk.getIsUnderMouse()?this.uk:void 0:this.uk;if(!n)return;const r=i?n.vx(s):n.gg(s);return r?gh(r,this.scale,this.xp(new Za,this,{x:r.x,y:r.y,column:r.column,row:r.column,intensity:r.cellValue}).fc(),this):void 0}solveNearestFromScreen(t,e=this.mx){return this.gg($o(t,this.Ji.us),!1,e)}mb(t){if(!(t instanceof Li))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Li&&t._i())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.uk.xt()||0}getXMin(){return this.uk.vt()||0}getYMax(){return this.uk.Mt()||0}getYMin(){return this.uk.bt()||0}Sr(){const t=u(0,0);return t.x=Math.max(t.x,this.uk.Vl()),t.y=Math.max(t.y,this.uk.zl()),t}Pe(t,e){t.cs(e),this.Ts.bs()}}class ad extends od{constructor(t,e,i,s,n,r,o,a,h,l,u,c){super(t,e,i,s,n,r,o,a,h,l,u,c),this.xp=sd}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.En.scrollDimension?t.length:t[0].length,"rows"===this.En.scrollDimension?t.length:t[0].length,0+i-1),n=this.En.resolution-1;if(s>n){if(!0===this.chart.fs.oo){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.En.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const s=[];for(let i=0;it[4]>=t[1],this.Fw=m(c(_e,_e),c(Fe,Fe)),this.Ak=[],this.gk=!1,this.pk=-1,this.mk=[],this.yk=!0,this.Sk=!1,this.vk=4,this.xp=(t,e,i)=>(t.addRow(e.getName()).addRow("Time","",e.axisX.formatValue(i.position)).addRow("Open","",i.open.toFixed(3)).addRow("High","",i.high.toFixed(3)).addRow("Low","",i.low.toFixed(3)).addRow("Close","",i.close.toFixed(3)),t),this.xk=[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.fs.Vn||this.chart.fs.Un||this.chart.us.As(10)}Lb(){return this.mk}Rb(t){return this.D.on("dataAdd",t)}Eb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}zb(t){return this.D.off(t)}Dm(){return this.Lm&&this.mk.length>0&&this.getVisible()}bk(t){if(!(this.mk.length<1))return[this.mk[t][0],this.mk[t][1],this.mk[t][2],this.mk[t][3],this.mk[t][4]]}gg(t){if(0===this.mk.length)return;const e=ut(t,this.Ts.us.dt,this.scale).x,i=void 0!==this.getPackDataState();let s,n,r,o,a;if(i){const t=this.Mk;if(!t)return;const i=we(e,t.length-1,(e=>t[e][0])),h=void 0!==i&&t[i];if(!h)return;o=h[3],r=h[2],n=h[1],a=h[4],s=h[0]}else{const t=we(e,this.mk.length-1,(t=>this.mk[t][0])),i=void 0!==t&&this.mk[t];if(!i)return;s=i[0],n=i[1],r=i[2],o=i[3],a=i[4]}const h={position:s,open:n,high:r,low:o,close:a,isPacked:i};return{location:u(h.position,h.close),scale:this.scale,resultTableContent:this.xp(new Za,this,h).fc(),owner:this,isPacked:i,position:s,open:n,high:r,low:o,close:a}}mb(t){if(!(t.x instanceof Ii))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this._k=t.x}Sr(){return u(5,5)}sC(t){const e=t.length-1;if(e<0)return this;for(let i=0;i<=e;i+=1)t[i][3]0&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const e=Array.isArray(t[0])?t:[t[0]];if(e.length>0){this.gk=!0;const t=this.mk.length,i=this.Ak.length,s=e.length;this.mk.length=t+s,this.Ak.length=i+s;for(let n=0;nthis.xk[t]));return void 0===i?i=e=1){for(let e=0;e=1&&(t!==this.pk||this.gk||this.Sk)){this.Sk=!1,this.pk=t,this.gk=!1,this.Ck(),this.Mk=[];const e=this.mk.length;let i=this.mk[0][0]-this.mk[0][0]%(t/2)+t,s=0;for(;s{0!==this.iy.size&&void 0!==[...this.iy.values()].find((({series:t})=>!0===t.getVisible()))||this.Jk.St(e,i,!1,!1,"zoomBandChart"),this.Kk.us.bs()},t.zn||t.Vn||t.Qn||i.us.As(St.atob("em9vbSBiYW5kIGNoYXJ0")),this.fs=t,this.qk=(null==a?void 0:a.orientation)||"x",this.tT=void 0!==(null==a?void 0:a.useSharedValueAxis)&&a.useSharedValueAxis,this.iT=r,this.nc="x"===this.qk?ta:ea;const l={...a,defaultAxisX:this.nc.getWidth({x:null==a?void 0:a.defaultAxis,y:void 0}),defaultAxisY:this.nc.getHeight({x:null==a?void 0:a.defaultAxis,y:void 0})};this.Kk=new Pd(t,i,s,wt,o,l,h).setTitle("Zoom Band Chart").setMouseInteractions(!1).setAutoCursorMode(e.AutoCursorModes.disabled),this.engine=this.Kk.engine;const u=this.Kk.getDefaultAxisX().setMouseInteractions(!1),c=this.Kk.getDefaultAxisY().setMouseInteractions(!1);this.Jk=this.nc.getWidth({x:u,y:c}).setScrollStrategy(Rs.fitting).setAnimationScroll(!1).setStrokeStyle(nt).setTickStrategy(Vs.Empty),(null==a?void 0:a.useSharedValueAxis)?this.sT=this.nc.getHeight({x:u,y:c}):this.nc.getHeight({x:u,y:c}).dispose();const d=this.getTheme().zoomBandChartDefocusOverlayFillStyle||new U({color:this.getTheme().isDark?T(0,0,0,180):T(255,255,255,180)});this.eT=[this.Kk.vf.Te(this.Jk.rA).ke(d).Ce(nt),this.Kk.vf.Te(this.Jk.rA).ke(d).Ce(nt)];const f=this.Kk.vf._A(this.Jk.rA).Ee(this.getTheme().zoomBandChartSplitterStrokeStyle||this.getTheme().chartXYSeriesBackgroundStrokeStyle);this.hT={collection:f,members:new Array(5).fill(0).map((t=>f.Lr()))};const g=this.getTheme(),m="function"==typeof g.zoomBandChartKnobFillStyle?g.zoomBandChartKnobFillStyle(this.fs.Xs):g.zoomBandChartKnobFillStyle||V;this.rT=[this.Kk.vf.Te(this.Kk.pixelScale).ke(m).Ce(nt),this.Kk.vf.Te(this.Kk.pixelScale).ke(m).Ce(nt)],this.nT=this.getTheme().zoomBandChartKnobSize||{x:0,y:0},this.oT()}add(t){var e,i,s,n,r;const o=this.jk.map((t=>t.axis)),a="x"===this.qk?t.axisX:t.axisY;if(!o.includes(a)){const t=a.onIntervalChange(this.Qk);this.jk.push({axis:a,deattach:()=>{a.offIntervalChange(t)}}),this.Jk.Yh(a.Uh()),this.aT&&this.aT.remove(),this.aT=dt(...this.jk.map((t=>t.axis)))}const h=this.nc.getHeight({x:t.axisX,y:t.axisY});let l;if(this.tT)l=this.sT;else{const t=this.Zk.get(h);t?l=t:(l=this.nc.getHeight({x:this.Kk.addAxisX.bind(this.Kk),y:this.Kk.addAxisY.bind(this.Kk)})(),this.lT(l)),this.Zk.set(h,l)}const u=this.nc.getWidth({x:this.Jk,y:l}),c=this.nc.getHeight({x:this.Jk,y:l});let d;const f=[],g=(t,e)=>{const i=t=>{if(0!==t.length)if("x"in t[0]){const i=t;e.add(i)}else{const i=t,s=[];for(let t=0;ti(e)));f.push((()=>t.Eb(n)));const r=t.Vb((()=>e.clear()));f.push((()=>{t.zb(r)}))};if(t instanceof bd)d=this.Kk.addPointLineAreaSeries({...t.En,xAxis:u,yAxis:c}).setStrokeStyle(t.getStrokeStyle()).setAreaFillStyle(t.getAreaFillStyle()).setPointFillStyle(t.getPointFillStyle()).setCurvePreprocessing(t.getCurvePreprocessing()),d.setDataSet(t.uT());else if(t instanceof _c||t instanceof hd){const i=this.Kk.addLineSeries({xAxis:u,yAxis:c,dataPattern:t instanceof _c?null===(e=t.En)||void 0===e?void 0:e.dataPattern:void 0});if(t instanceof _c)i.setStrokeStyle(t.getStrokeStyle());else{const e=fd(t);e&&i.setStrokeStyle(e)}g(t,i),d=i}else if(t instanceof $c){const e=this.Kk.addAreaSeries({xAxis:u,yAxis:c,baseline:t.PC}).setFillStyle(t.getFillStyle()).setStrokeStyle(t.getStrokeStyle());g(t,e),d=e}else if(t instanceof ed){const e=this.Kk.addPointSeries({xAxis:u,yAxis:c,pointShape:null===(i=t.En)||void 0===i?void 0:i.pointShape}).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof Ic){const e=this.Kk.addStepSeries({xAxis:u,yAxis:c,pointShape:null===(s=t.En)||void 0===s?void 0:s.pointShape,mode:t.yw}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof Ac){const e=this.Kk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(n=t.En)||void 0===n?void 0:n.pointShape}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof mc){const e=this.Kk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(r=t.En)||void 0===r?void 0:r.pointShape}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof td){const e=this.Kk.addAreaRangeSeries({xAxis:u,yAxis:c}).setLowFillStyle(t.getLowFillStyle()).setHighFillStyle(t.getHighFillStyle()).setLowStrokeStyle(t.getLowStrokeStyle()).setHighStrokeStyle(t.getHighStrokeStyle()).add(t.Lb()),i=t.Rb(((t,i)=>e.add(i)));f.push((()=>t.Eb(i))),d=e;const s=t.Vb((()=>e.clear()));f.push((()=>{t.zb(s)}))}else{if(!(t instanceof nd))throw new Error("LightningChart JS Zoom Band Chart unsupported series type");{const e=this.Kk.addHeatmapGridSeries({xAxis:u,yAxis:c,...t.ik}),i=()=>{e.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};i(),d=e,t.hk(d);const s=t.ak(((t,i)=>e.invalidateIntensityValues(i))),n=t.rk(i);f.push((()=>{t.lk(s),t.nk(n)}));const r=t.Vb((()=>e.clear()));f.push((()=>{t.zb(r)}))}}d.setMouseInteractions(!1);const m=t.onVisibleStateChanged(((t,e)=>{d.setVisible(e)}));f.push((()=>{t.offVisibleStateChanged(m)}));const p=t.onHighlight(((t,e)=>d.setHighlight(e)));f.push((()=>{t.offHighlight(p)}));const y=t.onDispose((()=>{this.disposeSeries(t)}));return f.push((()=>{t.offDispose(y)})),this.iy.set(t,{series:d,clearReferences:()=>f.forEach((t=>t()))}),d}disposeSeries(t){const e=this.iy.get(t);if(e){const{clearReferences:i}=e;i(),this.iy.delete(t),e.series.dispose();const s=this.nc.getHeight({x:t.axisX,y:t.axisY}),n=this.Zk.get(s);n&&0===n.vA().length&&(this.Zk.delete(s),n.dispose())}const i="x"===this.qk?t.axisX:t.axisY;if(!Array.from(this.iy.keys()).find((t=>i===("x"===this.qk?t.axisX:t.axisY)))){const t=this.jk.findIndex((t=>t.axis===i));this.jk[t].deattach(),this.jk.splice(t,1)}return this}setDefocusOverlayFillStyle(t){return this.eT.forEach((e=>e.ke(t))),this.Kk.us.bs(),this}getDefocusOverlayFillStyle(){return this.eT[0].Lh()}setSplitterStrokeStyle(t){return this.hT.collection.Ee(t),this.Kk.us.bs(),this}getSplitterStrokeStyle(){return this.hT.collection.ku()}setKnobFillStyle(t){return this.rT.forEach((e=>e.ke(t))),this.Kk.us.bs(),this}getKnobFillStyle(){return this.rT[0].Lh()}setKnobStrokeStyle(t){return this.rT.forEach((e=>e.Ce(t))),this.Kk.us.bs(),this}getKnobStrokeStyle(){return this.rT[0]._o()}setKnobSize(t){return this.nT=t,this.Kk.us.bs(),this}getKnobSize(){return this.nT}getDefaultAxisX(){return this.Kk.getDefaultAxisX()}getDefaultAxisY(){return this.Kk.getDefaultAxisY()}lT(t){t.setTickStrategy(Vs.Empty).setMouseInteractions(!1).setNibStyle(nt).setStrokeStyle(nt)}oT(){let t;const i=(t,e,i)=>{var s,n;const r="x"===this.qk?null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisX:null===(n=Array.from(this.iy.keys())[0])||void 0===n?void 0:n.axisY;if(!r)return;const o=r.getInterval(),a=this.Jk.getInterval();Math.abs(this.Jk.dt.ct(t)-this.Jk.dt.ct(e))<10||Math.sign(e-t)!==Math.sign(o.end-o.start)||Math.min(t,e)Math.max(a.start,a.end)&&Math.max(o.start,o.end){s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(this.nc.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical}),t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const r=t=>{var e,s;const r="x"===this.qk?null===(e=Array.from(this.iy.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisY;if(!r)return;const o=this.nc.getWidth(this.Kk.translateCoordinate(t,this.Kk.coordsAxis)),a=r.getInterval(),h=0===n?o:a.start,l=1===n?o:a.end;i(h,l,!1),jt(t)};s.setMouseDragEventHandler(((t,e,i,s,n)=>r(e)));const o=Yi(new Xi(void 0,((t,e,i,s,n)=>r(n))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)})),this.Kk.onSeriesBackgroundMouseEnter((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Move,t)})),this.Kk.onSeriesBackgroundMouseLeave((()=>{this.engine.restoreMouseStyle(t)}));const s=(t,e)=>{var s,n;const r="x"===this.qk?null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisX:null===(n=Array.from(this.iy.keys())[0])||void 0===n?void 0:n.axisY;if(!r)return;const o=r.getInterval(),a=this.Jk.dt.pi(o.start,this.nc.getWidth(t)),h=this.Jk.dt.pi(o.end,this.nc.getWidth(t));i(a,h,!1),jt(e)};this.Kk.onSeriesBackgroundMouseDrag(((t,e,i,n,r)=>s(r,e)));const n=Yi(new Xi(void 0,((t,e,i,n,r)=>s(n,r))));this.Kk.onSeriesBackgroundMouseWheel(((t,e)=>{var s,n;const r="x"===this.qk?null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisX:null===(n=Array.from(this.iy.keys())[0])||void 0===n?void 0:n.axisY;if(!r)return;const o=r.getInterval(),a=this.Jk.getInterval(),h=this.nc.getWidth(this.Kk.translateCoordinate(e,this.Kk.coordsAxis)),l=this.Jk.dt.ct(o.start),u=this.Jk.dt.ct(o.end),c=this.Jk.dt.ct(h),d=kt((c-l)/(u-l),0,1),f=.2*Math.abs(u-l)*r.Ed,g=d*f*-Math.sign(e.deltaY),m=(1-d)*f*Math.sign(e.deltaY),p=kt(this.Jk.dt.pi(o.start,g),a.start,a.end),y=kt(this.Jk.dt.pi(o.end,m),a.start,a.end);i(p,y,!1),jt(e)})),this.Kk.onSeriesBackgroundTouchStart(n.onTouchStart),this.Kk.onSeriesBackgroundTouchMove(n.onTouchMove),this.Kk.onSeriesBackgroundTouchEnd(n.onTouchEnd),this.eT.forEach(((s,n)=>{s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Point,t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const r=t=>{var e,s;const n="x"===this.qk?null===(e=Array.from(this.iy.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisY;if(!n)return;const r=this.nc.getWidth(this.Kk.translateCoordinate(t,this.Kk.coordsAxis)),o=n.getInterval(),a=this.Jk.getInterval(),h=kt(r-(o.end-o.start)/2,Math.min(a.start,a.end),Math.max(a.start,a.end)-Math.abs(o.end-o.start)),l=h+(o.end-o.start);i(h,l,!0),jt(t)};s.setMouseClickEventHandler(((t,e)=>r(e)));const o=Yi(new class{constructor(t,e=300){this.Bs=!1,this.Ls=[],this.Rs=300,this.Es=t,this.Rs=e}Ps(t,e){const i=St.performance.now();let s=!1;for(let t=0;t=this.Rs?(this.Ls.splice(t,1),t-=1):this.Ls[t].state&&(s=!0);return this.Bs?0===e.interactions.length&&(this.Ls.push({state:!1,time:i}),this.Bs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Ls.push({state:!0,time:i}),s=!0,this.Bs=!0),s}Ds(t,e,i){if(i&&!this.Bs){const i=this.Ls.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=1&&i.off>=1&&(this.Es(t,e),this.Ls.length=0)}}}(((t,e)=>r(e))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)}))}getSizePixels(){return this.Kk.getSizePixels()}onResize(t){return this.Kk.onResize(((e,i,s,n,r)=>t(this,i,s,n,r)))}offResize(t){return this.Kk.offResize(t)}Ka(t){this.Kk.Ka(t)}getMinimumSize(){return this.Kk.getMinimumSize()}j(){return this.Kk.j()}Z(){return this.Kk.Z()}Fe(t){var e,i,s,n;const r=pe(Array.from(this.iy.keys()).map((t=>t.chart))),o="x"===this.qk?null===(e=Array.from(this.iy.keys())[0])||void 0===e?void 0:e.axisX:null===(i=Array.from(this.iy.keys())[0])||void 0===i?void 0:i.axisY;if("x"===this.qk){const t=r.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=0===t.iA?t.TA():0})),Math.max(t,i)}),0),e=r.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=100===t.iA?t.TA():0})),Math.max(t,i)}),0),i=r.reduce(((t,e)=>Math.max(t,e.getPadding().left)),0),n=r.reduce(((t,e)=>Math.max(t,e.getPadding().right)),0);null===(s=this.getDefaultAxisY())||void 0===s||s.setThickness(t),this.Kk.setPadding({left:i+(0===r.length?10:0),right:n+e+(0===r.length?10:0)})}else{const t=r.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=0===t.iA?t.TA():0})),Math.max(t,i)}),0),e=r.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=100===t.iA?t.TA():0})),Math.max(t,i)}),0),i=r.reduce(((t,e)=>Math.max(t,e.getPadding().bottom)),0),s=r.reduce(((t,e)=>Math.max(t,e.getPadding().top)),0);null===(n=this.getDefaultAxisX())||void 0===n||n.setThickness(t),this.Kk.setPadding({bottom:i+(0===r.length?10:0),top:s+e+(0===r.length?10:0)})}this.Kk.Fe(t);const a=this.Jk.getInterval().start,h=this.Jk.getInterval().end,l=kt(o?o.getInterval().start:a,a,h),u=kt(o?o.getInterval().end:h,a,h),c=this.nc.getHeight(this.Kk.cT.getInnerIntervalPixels());this.eT[0].Ie(this.nc.toPoint(a,0)).q(this.nc.toPoint(l-a,c)),this.eT[1].Ie(this.nc.toPoint(u,0)).q(this.nc.toPoint(h-u,c)),this.hT.members[0].CA(this.nc.toPoint(a,c),this.nc.toPoint(l,c)),this.hT.members[1].CA(this.nc.toPoint(l,c),this.nc.toPoint(l,0)),this.hT.members[2].CA(this.nc.toPoint(l,0),this.nc.toPoint(u,0)),this.hT.members[3].CA(this.nc.toPoint(u,0),this.nc.toPoint(u,c)),this.hT.members[4].CA(this.nc.toPoint(u,c),this.nc.toPoint(h,c));const d=ut(this.nc.toPoint(l,c/2),this.Jk.rA,this.Kk.pixelScale),f=ut(this.nc.toPoint(u,c/2),this.Jk.rA,this.Kk.pixelScale),g=this.nT;this.rT[0].Ie({x:d.x-g.x/2,y:d.y-g.y/2}).q({x:g.x,y:g.y}).zh(this.nc.getWidth({x:0,y:90})),this.rT[1].Ie({x:f.x-g.x/2,y:f.y-g.y/2}).q({x:g.x,y:g.y}).zh(this.nc.getWidth({x:0,y:90}))}setSeriesBackgroundFillStyle(t){return this.Kk.setSeriesBackgroundFillStyle(t),this.Kk.us.bs(),this}getSeriesBackgroundFillStyle(){return this.Kk.getSeriesBackgroundFillStyle()}setSeriesBackgroundStrokeStyle(t){return this.Kk.setSeriesBackgroundStrokeStyle(t),this.Kk.us.bs(),this}getSeriesBackgroundStrokeStyle(){return this.Kk.getSeriesBackgroundStrokeStyle()}setSeriesBackgroundEffect(t){return this.Kk.setSeriesBackgroundEffect(t),this.Kk.us.bs(),this}getSeriesBackgroundEffect(){return this.Kk.getSeriesBackgroundEffect()}getTheme(){return this.Kk.getTheme()}setTitle(t){return this.Kk.setTitle(t),this}getTitle(){return this.Kk.getTitle()}setTitleFillStyle(t){return this.Kk.setTitleFillStyle(t),this}getTitleFillStyle(){return this.Kk.getTitleFillStyle()}setTitleFont(t){return this.Kk.setTitleFont(t),this}getTitleFont(){return this.Kk.getTitleFont()}setTitleMargin(t){return this.Kk.setTitleMargin(t),this}getTitleMargin(){return this.Kk.getTitleMargin()}setPadding(t){return this.Kk.setPadding(t),this}getPadding(){return this.Kk.getPadding()}setBackgroundFillStyle(t){return this.Kk.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.Kk.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.Kk.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.Kk.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return Va(t,e,i,this.Kk.pixelScale,this.Kk.us)}addUIElement(t,e){return this.Kk.addUIElement(t,e)}addLegendBox(t,e){return this.Kk.addLegendBox(t,e)}getLegendBoxes(){return this.Kk.getLegendBoxes()}saveToFile(t,e,i){return this.Kk.saveToFile(t,e,i),this}dispose(){return this.Kk.dispose(),this.Zk.clear(),this.iy.clear(),this.iT(this),this}onDispose(t){return this.Kk.onDispose((()=>t(this)))}offDispose(t){return this.Kk.offDispose(t)}}const fd=t=>{if("getStrokeStyle"in t)return t.getStrokeStyle();const e=(t=>t instanceof _c||t instanceof $c?t.getStrokeStyle().getFillStyle():t instanceof ed||t instanceof mc?t.getPointFillStyle():void 0)(t);return e?new qi({thickness:2,fillStyle:e}):void 0};class gd{constructor(t){this.dT=0,this.fT=0,this.AT=0,this.gT=!1,this.pT=!0,this.mT=!1,this.yT={warningDisplayed:!1,expandEvents:[]},this.D=new n.Eventer,this.pT=!t||void 0===t.autoSortingEnabled||t.autoSortingEnabled,void 0!==(null==t?void 0:t.dataPattern)&&(this.ST={userSpecified:null===t.dataPattern?void 0:t.dataPattern}),this.vT=void 0!==(null==t?void 0:t.lookupValues)&&t.lookupValues,this.xT=void 0!==(null==t?void 0:t.colors)&&t.colors,this.bT=void 0!==(null==t?void 0:t.ids)&&t.ids,this.MT=void 0!==(null==t?void 0:t.sizes)&&t.sizes,this._T=void 0!==(null==t?void 0:t.rotations)&&t.rotations,this.wT=(null==t?void 0:t.dataStorage)?t.dataStorage:Float64Array,this.CT=!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,n=e.y,r=e.lookupValue,o=e.size,a=e.rotation,h=e.color,l=e.id;let u,c,d,f,g,m,p;if(s){u=new this.wT(i);for(let e=0;eh-1&&(this.dT=0,this.gT=!0),this.fT=Math.min(this.fT+1,h),this.AT+=1,this}appendSamples(t){const{lookupValues:e,colors:i,ids:s,sizes:n,rotations:r,start:o,step:a}=t;let h=t.offset,l=t.count;const u=t.xValues||t.yValues;if(!u)return this;const c=u.length;if(h=void 0!==h?h:0,l=void 0!==l?l:c-h,l<=0)return this;const d=void 0!==t.offsetLookupValues?t.offsetLookupValues:h,f=void 0!==t.offsetColors?t.offsetColors:h,g=void 0!==t.offsetIds?t.offsetIds:h,m=void 0!==t.offsetSizes?t.offsetSizes:h,p=void 0!==t.offsetRotations?t.offsetRotations:h,[y,A]=this.RT(l,t.xValues,"x",o,a,h),[x,S]=this.RT(l,t.yValues,"y",o,a,h),b=this.BT(i),{samplesCacheX:v,samplesCacheY:M,samplesCacheLookup:T,samplesCacheColors:w,samplesCacheIDs:E,samplesCacheSize:k,samplesCacheRotation:C,maxSampleCount:D,dataPattern:I,incomingDataReplacedCache:_}=this.kT({appendCount:l,...0===A&&0===S&&0===h&&0===d&&0===f&&0===g&&0===m&&0===p?{incomingDataX:y,incomingDataY:x,incomingDataLookup:e,incomingDataIDs:s,incomingDataColors:b,incomingDataSize:n,incomingDataRotation:r}:{}});if(!_&&I&&this.pT&&this.FT&&this.IT){const t=y[A],i=x[S];if(!this.PT(I,t,i)&&!this.mT)return this.DT(this.FT,this.IT,Sd(y,A,A+l),Sd(x,S,S+l),Sd(e,d,d+l),Sd(b,f,f+l),Sd(s,g,g+l),Sd(n,m,m+l),Sd(r,p,p+l),I),this}const F=D-this.dT,L=Math.min(l,F);if(L>0&&(_||(Ad(v,y,A,L,this.dT),Ad(M,x,S,L,this.dT),e&&T&&Ad(T,e,d,L,this.dT),s&&E&&Ad(E,s,g,L,this.dT),b&&w&&Ad(w,b,f,L,this.dT),n&&k&&Ad(k,n,m,L,this.dT),r&&C&&Ad(C,r,p,L,this.dT)),this.LT(this.dT,this.dT+L-1),this.dT+=L,this.dT>D-1&&(this.dT=0,this.gT=!0)),this.fT=Math.min(this.fT+L,D),this.AT+=L,this.ET(),l-L>0){const t={xValues:y?Sd(y,A+L,void 0):void 0,yValues:x?Sd(x,S+L,void 0):void 0,lookupValues:e?Sd(e,d+L,void 0):void 0,ids:s?Sd(s,g+L,void 0):void 0,colors:b?Sd(b,f+L,void 0):void 0,sizes:n?Sd(n,m+L,void 0):void 0,rotations:r?Sd(r,p+L,void 0):void 0};this.appendSamples(t)}return this}setSamples(t){return this.clear().appendSamples(t)}alterSamples(t,e){const{xValues:i,yValues:s,lookupValues:n,colors:r,ids:o,sizes:a,rotations:h}=e;let l=e.offset,u=e.count;const c=i||s||n||r||o;if(!c)return this;const d=c.length;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,m=void 0!==e.offsetIds?e.offsetIds:l,p=void 0!==e.offsetSizes?e.offsetSizes:l,y=void 0!==e.offsetRotations?e.offsetRotations:l,A=this.BT(r),x=this.AT-1,S=void 0!==this.VT?Math.max(this.AT-this.VT,0):0,b=t+u-1,v=Math.max(t,S),M=Math.min(b,x),T=M-v+1;if(this.AT>0&&T>0){const{samplesCacheX:e,samplesCacheY:r,samplesCacheColors:u,samplesCacheIDs:c,samplesCacheLookup:d,samplesCacheSize:x,samplesCacheRotation:b}=this.kT({appendCount:0}),w=e.length;if(void 0!==this.VT&&this.gT&&this.AT%this.VT!=0){const S=this.AT-this.AT%this.VT,T=this.AT-1,E=this.AT-this.fT,k=S-1,C=Math.max(v,E),D=Math.min(M,k)-C+1;if(D>0){const S=C-t,v=md(C,this.AT,w,this.dT);i&&Ad(e,i,l+S,D,v),s&&Ad(r,s,l+S,D,v),n&&d&&Ad(d,n,f+S,D,v),o&&c&&Ad(c,o,m+S,D,v),A&&u&&Ad(u,A,g+S,D,v),a&&x&&Ad(x,a,p+S,D,v),h&&b&&Ad(b,h,y+S,D,v)}const I=Math.max(v,S),_=Math.min(M,T)-I+1;if(_>0){const S=I-t,v=md(I,this.AT,w,this.dT);i&&Ad(e,i,l+S,_,v),s&&Ad(r,s,l+S,_,v),n&&d&&Ad(d,n,f+S,_,v),o&&c&&Ad(c,o,m+S,_,v),A&&u&&Ad(u,A,g+S,_,v),a&&x&&Ad(x,a,p+S,_,v),h&&b&&Ad(b,h,y+S,_,v)}}else{const t=v-S;i&&Ad(e,i,l,T,t),s&&Ad(r,s,l,T,t),n&&d&&Ad(d,n,f,T,t),o&&c&&Ad(c,o,m,T,t),A&&u&&Ad(u,A,g,T,t),a&&x&&Ad(x,a,p,T,t),h&&b&&Ad(b,h,y,T,t)}this.D.emit("cleared")}const w=t+u-1-x;if(w>0){const e=M+1-t;this.appendSamples({xValues:i,yValues:s,lookupValues:n,colors:r,ids:o,sizes:a,rotations:h,offset:l+e,offsetLookupValues:f+e,offsetColors:g+e,offsetIds:m+e,offsetSizes:p+e,offsetRotations:y+e,count:w})}return this}alterSamplesByID(t,e){if(!this.bT)throw new Error("LightningChart JS attempted to use alterSamplesByID on DataSetXY that doesn't have IDs enabled.");const i=t.length,s=this.zT;if(i<=0||!s)return this;const n=Array.isArray(e.xValues)?new this.wT(e.xValues):e.xValues,r=Array.isArray(e.yValues)?new this.wT(e.yValues):e.yValues,o=Array.isArray(e.yValues)?new Float32Array(e.yValues):e.yValues,a=this.BT(e.colors),h=Array.isArray(e.sizes)?new Float32Array(e.sizes):e.sizes,l=Array.isArray(e.rotations)?new Float32Array(e.rotations):e.rotations,u=s.length,c=this.fT,d=this.AT-1,f=Math.max(d-c+1,0);for(let e=0;es[md(t,this.AT,u,this.dT)])),g=md(c,this.AT,u,this.dT);s[g]===i&&(n&&this.FT&&(this.FT[g]=n[e]),r&&this.IT&&(this.IT[g]=r[e]),o&&this.OT&&(this.OT[g]=o[e]),a&&this.NT&&(this.NT[g]=a[e]),h&&this.GT&&(this.GT[g]=h[e]),l&&this.WT&&(this.WT[g]=l[e]))}return this.D.emit("cleared"),this}clear(){return this.dT=0,this.fT=0,this.AT=0,this.gT=!1,this.D.emit("cleared"),this}getSampleCount(){return this.fT}getNextSampleIndex(){return this.AT}setMaxSampleCount(t){if("object"==typeof t){this.UT&&this.offMaxSampleCountExceeded(this.UT);const e=t.max;this.UT=this.onMaxSampleCountExceeded(((t,i,s,n)=>{if(void 0!==e&&s>=e)return;let r=2*s;void 0!==e&&(r=Math.min(r,e)),this.setMaxSampleCount(r)})),void 0===this.VT&&this.setMaxSampleCount(1e5)}else if("number"==typeof t){const e=t;if(void 0!==this.VT&&this.VT>e)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to shrink data set. This is currently not supported.");if(!this.FT||!this.IT)return this.VT=e,this;if(e===this.VT)return this;if(this.gT&&0!==this.dT)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.VT=e,this.fTt+e.count),0),n=new this.wT(s),r=new this.wT(s),o=this.xT?new Uint32Array(s):void 0,a=this.vT?new Float32Array(s):void 0,h=this.bT?new Uint32Array(s):void 0,l=this.MT?new Float32Array(s):void 0,u=this._T?new Float32Array(s):void 0;let c=0;for(const t of i)n.set(this.FT.subarray(t.offset,t.offset+t.count),c),r.set(this.IT.subarray(t.offset,t.offset+t.count),c),this.xT&&o&&this.NT&&o.set(this.NT.subarray(t.offset,t.offset+t.count),c),this.vT&&a&&this.OT&&a.set(this.OT.subarray(t.offset,t.offset+t.count),c),this.bT&&h&&this.zT&&h.set(this.zT.subarray(t.offset,t.offset+t.count),c),this.MT&&l&&this.GT&&l.set(this.GT.subarray(t.offset,t.offset+t.count),c),this._T&&u&&this.WT&&u.set(this.WT.subarray(t.offset,t.offset+t.count),c),c+=t.count;return{xValues:n,yValues:r,lookupValues:a,colors:o,ids:h,sizes:l,rotations:u}}onMaxSampleCountExceeded(t){return this.D.on("maxSampleCountExceeded",t)}offMaxSampleCountExceeded(t){return this.D.off(t)}RT(t,e,i,s,n,r){if(void 0===e){const e=this.TT();n=void 0!==n?n:1,s=void 0!==s?s:e?e[i]+n:0;const r=new this.wT(t);for(let e=0;et[md(e,this.AT,d,this.dT)])),y=p-1,A=p+1,x=t[md(p,this.AT,d,this.dT)],S=A<=this.AT-1?t[md(A,this.AT,d,this.dT)]:void 0,b=void 0!==S&&S0){const e=void 0!==this.VT&&this.gT?this.dT:0,i=this.fT-1,s=void 0!==this.VT&&this.gT?0:void 0,n=void 0!==this.VT&&this.gT?this.dT-1:void 0,[r,o]=void 0!==s&&void 0!==n&&Math.abs(n-s)>Math.abs(i-e)?[s,n]:[e,i];if(1+o-r>=2){let e,i,s=this.FT[r],n=this.IT[r];for(let t=r+1;t<=o;t+=1){if(!1!==e){const i=this.FT[t],n=Math.sign(i-s);0!==n&&e&&e.direction!==n?e=!1:0===n||e||(e={direction:n}),s=i}if(!1!==i){const e=this.IT[t],s=Math.sign(e-n);0!==s&&i&&i.direction!==s?i=!1:0===s||i||(i={direction:s}),n=e}}t=e&&e.direction>0?_n.ProgressiveX:e&&e.direction<0?_n.RegressiveX:i&&i.direction>0?_n.ProgressiveY:i&&i.direction<0?_n.RegressiveY:void 0,this.ST={autoDetectResult:t},t&&St.console.warn(`LightningChart JS DataSetXY warning | Data pattern was detected automatically (DataPatterns.${t}).\nAutomatic detection is only intended for kick-starting application development, not for production use.\nAdd { dataPattern: '${t}'} } to your application when creating series or DataSetXY to get clear this warning.`)}}if(t&&"ProgressiveX"!==t)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 t}PT(t,e,i){const s=this.TT();return!s||("ProgressiveX"===t?e>=s.x:"RegressiveX"===t?e<=s.x:"ProgressiveY"===t?i>=s.y:"RegressiveY"!==t||i<=s.y)}kT(t){if(t.incomingDataX&&t.incomingDataY&&0===this.fT&&!this.FT&&!this.IT&&(void 0===this.VT||this.VT===t.appendCount)&&this.CT)return this.FT=xd(t.incomingDataX,this.wT),this.IT=xd(t.incomingDataY,this.wT),this.OT=this.vT?xd(t.incomingDataLookup,Float32Array):void 0,this.zT=this.bT?xd(t.incomingDataIDs,Uint32Array):void 0,this.NT=this.xT?xd(t.incomingDataColors,Uint32Array):void 0,this.GT=this.MT?xd(t.incomingDataSize,Float32Array):void 0,this.WT=this._T?xd(t.incomingDataRotation,Float32Array):void 0,{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:t.appendCount,incomingDataReplacedCache:!0};if(void 0===this.VT){const e=this.fT+t.appendCount;if(!this.FT||!this.IT)return this.FT=new this.wT(e),this.IT=new this.wT(e),this.OT=this.vT?new Float32Array(e):void 0,this.zT=this.bT?new Uint32Array(e):void 0,this.NT=this.xT?new Uint32Array(e):void 0,this.GT=this.MT?new Float32Array(e):void 0,this.WT=this._T?new Float32Array(e):void 0,{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:e};const i=this.FT.length;if(ii-t.timestamp<5e3)),e>1e3&&this.yT.expandEvents.push({timestamp:i}),this.yT.expandEvents.length>5)return St.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.yT.warningDisplayed=!0,this.setMaxSampleCount({mode:"auto"}),this.kT(t)}const i=new this.wT(e);i.set(this.FT),this.FT=i;const s=new this.wT(e);if(s.set(this.IT),this.IT=s,this.vT){const t=new Float32Array(e);this.OT&&t.set(this.OT),this.OT=t}if(this.bT){const t=new Uint32Array(e);this.zT&&t.set(this.zT),this.zT=t}if(this.xT){const t=new Uint32Array(e);this.NT&&t.set(this.NT),this.NT=t}if(this.MT){const t=new Float32Array(e);this.GT&&t.set(this.GT),this.GT=t}if(this._T){const t=new Float32Array(e);this.WT&&t.set(this.WT),this.WT=t}return this.dT=this.fT,{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:e}}if(i>4*e){const t=new this.wT(e);t.set(this.FT.subarray(0,this.fT)),this.FT=t;const i=new this.wT(e);if(i.set(this.IT.subarray(0,this.fT)),this.IT=i,this.vT){const t=new Float32Array(e);this.OT&&t.set(this.OT.subarray(0,this.fT)),this.OT=t}if(this.bT){const t=new Uint32Array(e);this.zT&&t.set(this.zT.subarray(0,this.fT)),this.zT=t}if(this.xT){const t=new Uint32Array(e);this.NT&&t.set(this.NT.subarray(0,this.fT)),this.NT=t}if(this.MT){const t=new Float32Array(e);this.GT&&t.set(this.GT.subarray(0,this.fT)),this.GT=t}if(this._T){const t=new Float32Array(e);this.WT&&t.set(this.WT.subarray(0,this.fT)),this.WT=t}return{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:e}}return{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:i}}return t.appendCount+this.fT>this.VT&&this.D.emit("maxSampleCountExceeded",this,this.fT,this.VT,this.fT+t.appendCount),this.FT=this.FT||new this.wT(this.VT),this.IT=this.IT||new this.wT(this.VT),this.OT=this.OT||(this.vT?new Float32Array(this.VT):void 0),this.zT=this.zT||(this.bT?new Uint32Array(this.VT):void 0),this.NT=this.NT||(this.xT?new Uint32Array(this.VT):void 0),this.GT=this.GT||(this.MT?new Float32Array(this.VT):void 0),this.WT=this.WT||(this._T?new Float32Array(this.VT):void 0),{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:this.VT}}XT(){if(!this.FT||!this.IT||0===this.fT)return;if(void 0===this.VT)return this.AT>0?{x:this.FT[0],y:this.IT[0]}:void 0;if(!this.gT)return{x:this.FT[0],y:this.IT[0]};let t=this.dT-this.fT;return t<0&&(t+=this.VT),{x:this.FT[t],y:this.IT[t]}}TT(){if(!this.FT||!this.IT||0===this.fT)return;if(void 0===this.VT){const t=this.fT-1;return t>=0?{x:this.FT[t],y:this.IT[t]}:void 0}let t=this.dT-1;return t<0&&(t+=this.VT),{x:this.FT[t],y:this.IT[t]}}gg(t,e,i,s){const n=this.ET(),r=this.FT,o=this.IT;if(!r||!o)return;const a=t=>({x:r[t],y:o[t],lookupValue:this.vT&&this.OT?this.OT[t]:void 0,id:this.bT&&this.zT?this.zT[t]:void 0,color:this.xT&&this.NT?this.NT[t]:void 0,size:this.MT&&this.GT?this.GT[t]:void 0,rotation:this._T&&this.WT?this.WT[t]:void 0}),h=r.length,l=this.fT,u=this.AT-1,c=Math.max(u-l+1,0);if(n){const i=this.XT(),s=this.TT();if(!(i&&s&&this.FT&&this.IT))return;const r="ProgressiveX"===n||"RegressiveX"===n?"x":"y",o="x"===r?"y":"x",l="x"===r?this.FT:this.IT,d="x"===o?this.FT:this.IT,f=t[r],g=Math.min(i[r],s[r]),m=Math.max(i[r],s[r]);if(fm)return;const p=yd(f,c,u,(t=>l[md(t,this.AT,h,this.dT)])),y=md(p,this.AT,h,this.dT);if(!e)return a(y);const A=p-1,x=p+1,S=f>=l[y]&&("ProgressiveX"===n||"ProgressiveY"===n)?x<=u?md(x,this.AT,h,this.dT):void 0:A>=c?md(A,this.AT,h,this.dT):void 0;if(void 0===S)return;const b=l[y],v=d[y],M=l[S],T=d[S],w=Math.min(b,M),E=w===b?v:T,k=Math.max(b,M),C=Fr(E,k===b?v:T,(f-w)/(k-w));return"ProgressiveX"===n||"RegressiveX"===n?{x:f,y:C}:{x:C,y:f}}let d,f=Number.MAX_VALUE;const g=ut(t,i,s),m=this.fT-1;for(let t=0;t<=m;t+=1){const e=r[t],n=o[t];if(!Number.isNaN(e)&&!Number.isNaN(n)){const r=lt(e,i.x,s.x),o=lt(n,i.y,s.y),a=(r-g.x)**2+(o-g.y)**2;at%i,pd=(t,e,i,s,n,r,o,a)=>{if(0===s||0===n)return;const h=i.length,l=s-1,u=Math.max(l-n+1,0),c=yd(t,u,l,(t=>i[md(t,s,h)])),d=yd(e,u,l,(t=>i[md(t,s,h)])),f=Math.max(c-a,u),g=Math.min(d+a,l),m=md(f,s,h),p=md(g,s,h);return m>p?{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:m,iLastSampleDataArray:p,dataRanges:[{offset:m,count:h-m},{offset:0,count:p+1}]}:{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:m,iLastSampleDataArray:p,dataRanges:[{offset:m,count:p-m+1}]}},yd=(t,e,i,s)=>{const n=i;for(;e!==i;){const n=Math.ceil((e+i)/2);t{const r=e.length;if(Array.isArray(e))for(let r=0;rvoid 0===t?new e:Array.isArray(t)?new e(t):t instanceof e?t:new e(t),Sd=(t,e,i)=>{if(void 0!==t)return Array.isArray(t)?t.slice(e,i):t.subarray(e,i)};class bd extends ru{constructor(t,e,i,s,n,r,o,a,h,l,u,c){var d;super(t,e,i,s,n,r,o,a,h,l),this._s="Point Line Area Series",this.xp=vd,this.mx=!1,this.En=c,this.el=this.Ts.tF(this.scale).Ee(ce(this.qi.lineSeriesStrokeStyle,u)).qT(ce(this.qi.pointSeriesFillStyle,u)).KT(ce(this.qi.areaSeriesPositiveFillStyle,u)).JT(void 0).QT(7),this.el.iF=!1!==(null===(d=this.En)||void 0===d?void 0:d.allowDataGrouping),this.gs(this.el)}setDataSet(t){var e;return t===(null===(e=this.sF)||void 0===e?void 0:e.Wt)||(this.sF=De(t,this.sF,(()=>[t.jT((()=>this.Ji.us.bs())),t.ZT((()=>this.Ji.us.bs()))])),this.el.eF(t),this.chart.us.bs()),this}getDataSet(){return this.hF()}setStrokeStyle(t){return this.el.Ee(t),this.Ts.bs(),this}getStrokeStyle(){return this.el.ku()}setAreaFillStyle(t){return this.el.KT(t),this.Ts.bs(),this}getAreaFillStyle(){return this.el.rF()}setPointFillStyle(t){return this.el.qT(t),this.Ts.bs(),this}getPointFillStyle(){return this.el.nF()}setPointSize(t){return this.el.QT(t),this.Ts.bs(),this}getPointSize(){return this.el.oF()}setPointShape(t){return this.el.aF(t),this.Ts.bs(),this}getPointShape(){return this.el.lF()}setPointRotation(t){return this.el.uF(t),this.Ts.bs(),this}getPointRotation(){return this.el.cF()}setCurvePreprocessing(t){return this.el.JT(t),this.Ts.bs(),this}getCurvePreprocessing(){return this.el.dF()}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}add(t){return this.hF().add(t),this.Ts.bs(),this}addArraysXY(t,e){return this.hF().addArraysXY(t,e),this.Ts.bs(),this}appendJSON(t,e){return this.hF().appendJSON(t,e),this.Ts.bs(),this}appendSample(t){return this.hF().appendSample(t),this.Ts.bs(),this}appendSamples(t){return this.hF().appendSamples(t),this.Ts.bs(),this}setSamples(t){return this.hF().setSamples(t),this.Ts.bs(),this}alterSamples(t,e){return this.hF().alterSamples(t,e),this.Ts.bs(),this}alterSamplesByID(t,e){return this.hF().alterSamplesByID(t,e),this.Ts.bs(),this}getSampleCount(){return this.hF().getSampleCount()}getNextSampleIndex(){return this.hF().getNextSampleIndex()}clear(){return this.hF().clear(),this.Ts.bs(),this}setMaxSampleCount(t){return this.hF().setMaxSampleCount(t),this.Ts.bs(),this}getMaxSampleCount(){return this.hF().getMaxSampleCount()}readBack(t){return this.hF().readBack(t)}onMaxSampleCountExceeded(t){return this.hF().onMaxSampleCountExceeded(t)}offMaxSampleCountExceeded(t){return this.hF().offMaxSampleCountExceeded(t)}uT(){return this.hF()}ld(){return he(this.getPointFillStyle())||he(this.getStrokeStyle().getFillStyle())||he(this.getAreaFillStyle())}Dm(){var t;const e=null===(t=this.sF)||void 0===t?void 0:t.Wt;return this.getAutoScrollingEnabled()&&void 0!==e&&e.AT>0}mb(t){}getXMax(){return this.el.xt()}getXMin(){return this.el.vt()}getYMax(){return this.el.Mt()}getYMin(){return this.el.bt()}Sr(){return{x:this.el.Vl(),y:this.el.zl()}}hF(){if(!this.sF){const t=new gd(this.En);this.sF=De(t,this.sF,(()=>[t.jT((()=>this.Ji.us.bs())),t.ZT((()=>this.Ji.us.bs()))])),this.el.eF(t)}return this.sF.Wt}attach(t,e=!0,i=!1){super.attach(t,e,i);const s=this.getPointFillStyle(),n=this.getAreaFillStyle();return ae(t,this.qi,i,{stroke:this.getStrokeStyle(),fill:s!==V?s:n}),super.attach(t,e)}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e,i=this.mx){void 0!==this.getCurvePreprocessing()&&(i=!1);const s=this.uT(),n=ut(t,this.Ji.us.dt,this.scale),r=!e||this.el.getIsUnderMouse()?s.gg(n,i,this.scale,this.Ji.pixelScale):void 0;if(void 0!==r){const t=[this.getStrokeStyle().getFillStyle(),this.getPointFillStyle(),this.getAreaFillStyle()];return gh(r,this.scale,this.xp(new Za,this,r).fc(),this,t.filter((t=>!B(t)))[0])}}solveNearestFromScreen(t,e=!1){return this.gg($o(t,this.Ji.us),!1,e)}}const vd=(t,e,i)=>(t.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i.x)).addRow("Y","",e.axisY.formatValue(i.y)),void 0!==i.lookupValue&&t.addRow("Value","",i.lookupValue.toFixed(1)),t),Md=(...t)=>(e,i)=>t.forEach((t=>t.forEach((t=>{t.dt.q(e),t.hA.q(i)})))),Td=(t,e)=>{const i=t.indexOf(e);-1!==i&&t.splice(i,1)},wd=u(10,10);var Ed;e.AxisPosition=void 0,(Ed=e.AxisPosition||(e.AxisPosition={}))[Ed.Top=0]="Top",Ed[Ed.Bottom=1]="Bottom",Ed[Ed.Left=2]="Left",Ed[Ed.Right=3]="Right";const kd=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),Cd=t=>t.vr(),Dd=t=>t.setStopped(!0),Id=t=>t.getChartInteractionFitByDrag()?t.fit(!0):void 0,_d=(t,e)=>{const i="linear-highPrecision"===t.wh.type||"linear-highPrecision"===e.wh.type,s="logarithmic"===t.wh.type||"logarithmic"===e.wh.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.wh.type}, y: ${e.wh.type})`;throw new Error(i)}};var Fd,Ld,zd;!function(t){t[t.seriesBackground=0]="seriesBackground",t[t.gridLine0=1]="gridLine0",t[t.gridLine1=2]="gridLine1",t[t.gridLine2=3]="gridLine2",t[t.highlightersBelow=4]="highlightersBelow"}(Fd||(Fd={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(Ld||(Ld={}));class Pd extends Kh{constructor(t,i,s,n,r,o,a){super(t,i,s,i.sg("chartXY bg",0),n,i.us.qi.chartXYBackgroundFillStyle,i.us.qi.chartXYBackgroundStrokeStyle,i.us.qi.chartXYTitleFont,i.us.qi.chartXYTitleFillStyle,a),this.cT=this.GA.d2({scaleXYConstructor:Li}),this.fF=[],this.AF=[],this.gF=[],this.pF=[],this.mF=new Map,this.yF=!0,this.SF=!0,this.vF=!0,this.Ed=2,this.xF=!0,this.bF=!0,this.MF=[],this._F=this.hg.Te(this.cT).ke(V).Ce(nt).setMouseInteractions(!1),this.wF=this.hg.Ve(this.cT).Ee(nt).setMouseInteractions(!1),this.CF=this.hg.Ve(this.cT).Ee(nt).setMouseInteractions(!1),this.kF=this.qi.chartXYZoomingRectangleFillStyle,this.TF=this.qi.chartXYZoomingRectangleStrokeStyle,this.FF=this.qi.chartXYFittingRectangleFillStyle,this.IF=this.qi.chartXYFittingRectangleStrokeStyle,this.PF=e.MouseStyles.Default,this.DF=e.MouseStyles.Move,this.BF=e.MouseStyles.ZoomIn,this.LF=e.MouseStyles.Default,this.RF=void 0,this.EF=Rd,this.pb=0,this.vp=e.AutoCursorModes.snapToClosest,this.VF=Md(this.AF,this.fF),this.zF=Md(this.gF,this.pF),this.OF=(t,e,i,s,n)=>{this.VF(s,n),this.zF(n,s),this.cT.q(s,n);const r=this.AF.map((t=>t.TA())),o=this.fF.map((t=>t.TA())),a=this.gF.map((t=>t.TA())),h=this.pF.map((t=>t.TA())),l=r.reduce(Ne,0),c=o.reduce(Ne,0),d=a.reduce(Ne,0),f=h.reduce(Ne,0),g=this.NF(d,f,c,l),m=this.cT.x.getCellSize()-(g.left+g.right),p=this.cT.y.getCellSize()-(g.bottom+g.top),y=[g.left,g.right],A=[g.bottom,g.top];this.cT.x.J(0,m),this.cT.y.J(0,p),this.cT.Ei(y),this.cT.Vi(A),this.uy.q(u(m,p));for(let t=0;t{this.mF.set(t,e)},this.Kf=t=>{this.AF.includes(t)?Td(this.AF,t):this.fF.includes(t)?Td(this.fF,t):this.gF.includes(t)?Td(this.gF,t):this.pF.includes(t)&&Td(this.pF,t),this.mF.delete(t),this.us.bs()},this.WF=(t=!1)=>{const e=t=>(e,i,s,n)=>(i.Fe(e,s,n.length),e+i.TA()*t),i=this.AF.reduce(e(-1),0),s=this.fF.reduce(e(1),0),n=this.gF.reduce(e(-1),0),r=this.pF.reduce(e(1),0),o=this.NF(n,r,s,i),a=this.cT.x.getCellSize()-(o.left+o.right),h=this.cT.y.getCellSize()-(o.bottom+o.top),l=[o.left,o.right],c=[o.bottom,o.top];this.cT.x.J(0,a),this.cT.y.J(0,h),this.cT.x.si(l),this.cT.y.si(c);for(const t of this.AF)t.dt.si(l);for(const t of this.fF)t.dt.si(l);for(const t of this.gF)t.dt.si(c);for(const t of this.pF)t.dt.si(c);if((!this.AM||Math.abs(this.AM.bottom-i)>=4||Math.abs(this.AM.left-n)>=4||Math.abs(this.AM.right-r)>=4||Math.abs(this.AM.top-s)>=4)&&!t)return void this.WF(!0);this.AM={bottom:i,left:n,top:s,right:r},this.uy.Ie(u(0,0)).q(u(a,h)),this.Ay.Ie(u(0,0)).q(u(a,h));const d=this.getDefaultAxisX(),f=this.getDefaultAxisY();if(!d||!f)return;const g=p(d.dt.ei(),f.dt.ei(),d.dt.ri(),f.dt.ri());this.yv.ES(g),this.Qf.ES(g),this.Jf.ES(g),this.LA&&this.LA();const m=t=>(e,i,s,n)=>(i.kA(e),e+i.TA()*t);return this.AF.reduce(m(-1),0),this.fF.reduce(m(1),0),this.gF.reduce(m(-1),0),this.pF.reduce(m(1),0),g},this.addAreaSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();_d(e,i);const s=t&&t.baseline?t.baseline:0,n=new(t&&t.type?t.type:Zc.Positive)(this,this.ey,this.yv,e,i,this.UF(e),this.UF(i),this.YA,s,this.qi,this.us.es,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length);return this.gy(n),n},this.addAreaRangeSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();_d(e,i);const s=new td(this,this.ey,this.yv,e,i,this.UF(e),this.UF(i),this.YA,this.qi,this.us.es,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length);return this.gy(s),s},this.YF=!1,this.HF=!1,this.yb=()=>{(this.yF||this.SF)&&(this.RF=this.engine.setMouseStyle(this.PF))},this.Sb=()=>{this.YF=!1,this.engine.restoreMouseStyle(this.RF)},this.vb=(t,e,i)=>{var s,n;const r=Dt(null===(s=this.fs.no)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Dt(null===(n=this.fs.no)||void 0===n?void 0:n.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.RF);const a=this.hg.us.De(e.clientX,e.clientY);i===r&&(this.yF||this.SF)?(this.$F(t,a),jt(e)):i===o&&this.xF&&(this.RF=this.engine.setMouseStyle(this.DF),this.HF=!0,jt(e))},this.Vm=(t,e,i,s,n)=>{var r,o;const a=u(e.clientX,e.clientY),h=Dt(null===(r=this.fs.no)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),l=Dt(null===(o=this.fs.no)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===h&&(this.yF||this.SF)?(this.XF(t,s,a),jt(e)):i===l&&this.xF&&(this.jF(si(n,-1)),jt(e)),this.us.bs()},this.xb=(t,e,i,s)=>{var n,r;const o=Dt(null===(n=this.fs.no)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),a=Dt(null===(r=this.fs.no)||void 0===r?void 0:r.chartXYPanMouseButton,2);if(i===o&&(this.yF||this.SF)){const i=u(e.clientX,e.clientY);this.ZF(t,s,i),jt(e)}else i===a&&this.xF&&jt(e);this.engine.restoreMouseStyle(this.RF),this.uy.getIsUnderMouse()&&(this.RF=this.engine.setMouseStyle(this.PF)),this.YF=!1,this.HF=!1},this.Em=(t,e)=>{if(this.vF){const t=this.hg.us.De(e.clientX,e.clientY);this.QF(t,u(de(e),de(e))),jt(e)}},this.JF=(t,e,i,s)=>{},this.KF=(t,e,i,s,n,r)=>{if(this.xF){const t=u(-(s.x+n.x)/2,-(s.y+n.y)/2);this.jF(t),jt(r),this.HF=!0}if(this.vF){const t=this.engine.clientLocation2Engine(e.x,e.y),o=this.engine.clientLocation2Engine(i.x,i.y),a=ri(u(Math.abs(t.x-s.x-(o.x-n.x)),Math.abs(t.y-s.y-(o.y-n.y))),u(Math.abs(t.x-o.x),Math.abs(t.y-o.y)));this.forEachAxisX((t=>{t.getChartInteractionZoomByWheel()&&t.St(t.dt.pi(t.getInterval().start,-a.x),t.dt.pi(t.getInterval().end,a.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.St(t.dt.pi(t.getInterval().start,-a.y),t.dt.pi(t.getInterval().end,a.y),!1,!0,"interactionZoom")})),jt(r),this.YF=!0}},this.qF=(t,e,i,s)=>{this.HF=!1,this.YF=!1},this.tI=(t,e,i)=>{(this.SF||this.yF)&&(this.$F(t,e),jt(i))},this.iI=(t,e,i,s,n)=>{(this.SF||this.yF)&&(this.XF(t,e,i),jt(n))},this.sI=(t,e,i,s)=>{(this.SF||this.yF)&&(this.ZF(t,e,i),jt(s))},this.fs.zn||this.fs.Vn||this.fs.Kn||this.us.As(0),this.setPadding({right:24}),this.oM=i.YS("chartXY series bg",Fd.seriesBackground),this.eI=[Fd.gridLine0,Fd.gridLine1,Fd.gridLine2].map((t=>i.YS(`chartXY gridline #${t}`,t))),this.Qf=i.YS("chartXY highlighters below",Fd.highlightersBelow),this.yv=i.wp("chartXY plotting",Ld.plotting),this.Jf=i.wp("chartXY highlighters above",Ld.highlightersAbove),this.vf=i.wp("chartXY fg",Ld.fg),this.cT.x.J(0,this.uiScale.x.getCellSize()-(this.Xt.left+this.Xt.right+this.Da.left+this.Da.right)),this.cT.y.J(0,this.uiScale.y.getCellSize()-(this.Xt.bottom+this.Xt.top+this.Da.bottom+this.Da.top)),this.cT.q(this.uiScale.oi().x,this.uiScale.oi().y),this.uy=this.oM.Te(this.cT).ke(this.qi.chartXYSeriesBackgroundFillStyle).Ce(nt),this.Ay=this.vf.Te(this.cT).ke(V).Ce(this.qi.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.ly(this.uy,this.Ay),this.setSeriesBackgroundEffect(!1),this.kp=i.Tp();const h=Dt(o?o.autoCursorBuilder:void 0,Jl);this.Ag=h.$g(this.kp,this.cT,this.cT,this.qi),Ha.pg(this),this.yy(((t,e)=>{Ha.mg(this,e)})),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.OF),this.ng.Bh("ChartXY"),this.zm=Yi(new Xi(this.tI,this.iI,this.sI,1),new ji(this.JF,this.KF,this.qF)),this.onSeriesBackgroundMouseEnter(this.yb),this.onSeriesBackgroundMouseLeave(this.Sb),this.onSeriesBackgroundMouseWheel(this.Em),this.onSeriesBackgroundMouseDragStart(this.vb),this.onSeriesBackgroundMouseDrag(this.Vm),this.onSeriesBackgroundMouseDragStop(this.xb),this.onSeriesBackgroundTouchStart(this.zm.onTouchStart),this.onSeriesBackgroundTouchMove(this.zm.onTouchMove),this.onSeriesBackgroundTouchEnd(this.zm.onTouchEnd),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.ig(r,this.cT)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}solveNearest(t){const e=t||this.us.Bn();if(e)return Ha.gg(this,$o(e,this.us),this.iy)}getMinimumSize(){const t={x:0,y:0};t.x+=this.Xt.left+this.Xt.right+this.Da.left+this.Da.right,t.y+=this.Xt.top+this.Xt.bottom+this.Da.top+this.Da.bottom;const e=this.ng.Ds().Cc(),i=S(Vd(this.EF||Rd),this.eg);t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom;const s={x:0,y:0};return this.forEachAxisX((t=>{s.x=Math.max(s.x,t.TA())})),this.forEachAxisY((t=>{s.y=Math.max(s.y,t.TA())})),t.x+=s.x,t.y+=s.y,t.x+=wd.x,t.y+=wd.y,t}addChartMarkerXY(t=Kl,e,i){const s=this.YA(),n=new su(s,this.uiScale,e||this.getDefaultAxisX(),i||this.getDefaultAxisY(),t,this.OA(s),this.qi);return this.KA(n),n}addAxisX(t){const{opposite:e,type:i}=qo(t);let s;s="linear"===i.type?this.GA.d1({dimension:"x",scale1DConstructor:Ii}):"linear-highPrecision"===i.type?this.GA.d1({dimension:"x",scale1DConstructor:Ii}).Mi():this.GA.d1({dimension:"x",scale1DConstructor:bi}).Ai(i.base),s.q(this.cT.x.oi());const n=e?this.fF:this.AF,r=new Qo(this.Qf,this.eI,this.vf,this.hg,this.Qf,this.Jf,this.us.es,s,this.cT.y,(o=()=>r.vA(),{...ta,...lc(o)}),this,e?100:0,this.Kf,this.GF,this.qi,this.th,i);var o;return n.push(r),this.us.bs(),r}addAxisY(t){const{opposite:e,type:i}=qo(t);let s;s="linear"===i.type?this.GA.d1({dimension:"y",scale1DConstructor:Ii}):"linear-highPrecision"===i.type?this.GA.d1({dimension:"y",scale1DConstructor:Ii}).Mi():this.GA.d1({dimension:"y",scale1DConstructor:bi}).Ai(i.base),s.q(this.cT.y.oi());const n=e?this.pF:this.gF,r=new Qo(this.Qf,this.eI,this.vf,this.hg,this.Qf,this.Jf,this.us.es,s,this.cT.x,(o=()=>r.vA(),{...ea,...uc(o)}),this,e?100:0,this.Kf,this.GF,this.qi,this.th,i);var o;return n.push(r),this.us.bs(),r}dispose(){return this.Ag.dispose(),this.oM.W(),this.yv.W(),this.vf.W(),this.eI.forEach((t=>t.W())),this.Jf.W(),this.Qf.W(),this.kp.W(),this.jC().forEach((t=>t.dispose())),Oa(this.cT),this.forEachAxis((t=>{t.dispose()})),this.iy.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){return[...this.AF,...this.fF].find((t=>t.getVisible()))}getDefaultAxisY(){return[...this.gF,...this.pF].find((t=>t.getVisible()))}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):kd;return Ct(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.fF;case e.AxisPosition.Bottom:return this.AF;case e.AxisPosition.Left:return this.gF;case e.AxisPosition.Right:return this.pF}})))}hI(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.AF.slice().forEach(t),this.fF.slice().forEach(t)}forEachAxisY(t){this.gF.slice().forEach(t),this.pF.slice().forEach(t)}setTitlePosition(t){return this.EF=t,this.us.bs(),this}getTitlePosition(){return this.EF}NF(t,e,i,s){const n=this.EF||Rd;let r,o=S(Vd(n),this.eg);this.getTitleFillStyle()===V||0===this.getTitle().length?(r={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):r=this.ng.Ds().Cc();const a=Math.abs(s)+this.Da.bottom+this.Xt.bottom,h=Math.abs(i)+this.Da.top+this.Xt.top,l={left:Math.abs(t)+this.Da.left+this.Xt.left,right:Math.abs(e)+this.Da.right+this.Xt.right,top:h,bottom:a},u=this.uiScale.Wi(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=Bd(n,u,l,r,o,this.Da);return this.ng.Ie(f).Xa(c).Za(d),g}Fe(t){super.Fe(t);for(const t of this.iy)t.Gm();for(const t of this.iy)t.Fe();this.forEachAxis(Cd);let e=!1;this.forEachAxis((t=>{(t.wr()||t.Cr())&&(e=!0)}));const i=this.YF||this.HF||!this.bF&&e;Ha.dg(this,this.uy.getIsUnderMouse(),i,this.iy,(t=>Ha.gg(this,t,this.iy)),((t,e)=>t.gg(e,!0))),this.WF(),super.tg();for(const t of this.iy)t.$p()}j(){for(let t=0;t=10;r&&h&&a.x===s.x&&this.SF?(this.YF=!0,this._F.ke(this.FF).Ce(this.IF),this.wF.Ee(this.IF).Oe(s).ze(n),this.CF.Ee(this.IF).Oe(u(s.x,n.y)).ze(u(n.x,s.y)),this.RF=this.engine.setMouseStyle(this.LF,this.RF)):r&&h&&(this.yF||this.SF)?(this.YF=!0,this._F.ke(this.kF).Ce(this.TF),this.wF.Ee(nt),this.CF.Ee(nt),this.RF=this.engine.setMouseStyle(this.BF,this.RF)):(this.YF=!1,this._F.Ce(nt).ke(V),this.wF.Ee(nt),this.CF.Ee(nt),this.engine.restoreMouseStyle(this.RF)),this.us.bs()}ZF(t,e,i){if(this.YF){const t=ut(this.engine.clientLocation2Engine(i.x,i.y),this.hg.us.dt,this.cT),s=Ge(t.x,this.cT.x.getInnerStart(),this.cT.x.getInnerEnd())&&Ge(t.y,this.cT.y.getInnerStart(),this.cT.y.getInnerEnd()),n=i.x>=e.x||!this.SF?"zoom":"fit",r=this._F.Ya(),o=ni(r,this._F.oi()),a=Math.min(this._F.oi().x,this._F.oi().y)>=10;s&&a&&"zoom"===n&&this.yF?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=ut(r,this.cT,t.rA).x,i=ut(o,this.cT,t.rA).x;t.St(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=ut(r,this.cT,t.rA).y,i=ut(o,this.cT,t.rA).y;t.St(e,i,!0,!0,"interactionSetInterval")}}))):s&&a&&"fit"===n&&this.SF&&this.forEachAxis(Id)}this._F.Ce(nt).ke(V),this.wF.Ee(nt),this.CF.Ee(nt),this.us.bs()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}jF(t){this.forEachAxisX((e=>{e.getChartInteractionPanByDrag()&&e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.getChartInteractionPanByDrag()&&e.setStopped(!0).pan(t.y)}))}zoom(t,e){this.forEachAxis(Dd),this.forEachAxisX((i=>{i.zoom(i.dt.ut(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.dt.ut(t.y),e.y)}))}QF(t,e){this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&(Dd(i),i.zoom(i.dt.ut(t.x),e.x))})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&(Dd(i),i.zoom(i.dt.ut(t.y),e.y))}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}Sd(){const t=[];return this.forEachAxis((e=>e.pA((e=>t.push(e))))),super.Sd().concat(t)}jC(){return this.MF}me(){return this.ag(this.yv)}setAutoCursorEnabledDuringAxisAnimation(t){return this.bF=t,this}getAutoCursorEnabledDuringAxisAnimation(){return this.bF}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,n=e,r=ia(n)?n:Bi(n)?this.pixelScale:void 0;if(r&&Ri(i)){const t=ut(s,r,this.engine.scale);return this.us.Xo({engineX:t.x,engineY:t.y})}if(r&&Bi(i))return ut(s,r,this.pixelScale);if(r&&ia(i))return ut(s,r,i)}else{const i=t;if(Bi(e)){const t=this.us.$o(i);return ut({x:t.engineX,y:t.engineY},this.engine.scale,this.pixelScale)}if(ia(e)){const t=e,s=this.us.$o(i);return ut({x:s.engineX,y:s.engineY},this.engine.scale,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}}e.ChartXYTitlePositionOptions=void 0,(zd=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",zd.RightTop="right-top",zd.LeftTop="left-top",zd.CenterBottom="center-bottom",zd.RightBottom="right-bottom",zd.LeftBottom="left-bottom",zd.SeriesCenterTop="series-center-top",zd.SeriesRightTop="series-right-top",zd.SeriesLeftTop="series-left-top",zd.SeriesCenterBottom="series-center-bottom",zd.SeriesRightBottom="series-right-bottom",zd.SeriesLeftBottom="series-left-bottom";const Rd=e.ChartXYTitlePositionOptions.CenterTop,Vd=t=>{switch(t){case"center-top":case"series-center-bottom":return{left:0,right:0,top:0,bottom:5};case"left-top":return{left:20,right:0,top:0,bottom:5};case"right-top":return{left:0,right:20,top:0,bottom:5};case"center-bottom":return{left:0,right:0,top:0,bottom:0};case"left-bottom":return{left:20,right:0,top:0,bottom:0};case"right-bottom":return{left:0,right:20,top:0,bottom:0};case"series-center-top":return{left:0,right:0,top:5,bottom:0};case"series-left-top":return{left:5,right:0,top:5,bottom:0};case"series-right-top":return{left:0,right:5,top:5,bottom:0};case"series-left-bottom":return{left:5,right:0,top:0,bottom:5};case"series-right-bottom":return{left:0,right:5,top:0,bottom:5}}return Se(0,`Unexpected ChartXY title position selection ${t}`)},Bd=(t,e,i,s,n,r)=>{s.x,n.left,n.right;const o=s.y+n.bottom+n.top,a=(n.left-n.right)*e.x,h=(n.bottom-n.top)*e.y;switch(t){case"center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+a,y:100-(r.top+n.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:a,y:100-(r.top-n.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100+a,y:100-(r.top-n.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50+a,y:(r.bottom+n.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:a,y:(r.bottom+n.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100+a,y:(r.bottom+n.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"series-center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+a,y:100-i.top*e.y+h},marginsWithTitle:i};case"series-left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:i.left*e.x+a,y:100-i.top*e.y+h},marginsWithTitle:i};case"series-right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100-i.right*e.x+a,y:100-i.top*e.y+h},marginsWithTitle:i};case"series-center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50,y:i.bottom*e.y+h},marginsWithTitle:i};case"series-left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:i.left*e.x+a,y:i.bottom*e.y+h},marginsWithTitle:i};case"series-right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100-i.right*e.x+a,y:i.bottom*e.y+h},marginsWithTitle:i}}return Se(0,`Unexpected ChartXY title position selection ${t}`)},Od=(t,e)=>{const i=Math.floor(99999/e),s=Math.floor(99999/e),n=Math.floor(99998/e),r=Math.floor(99999/(e+1)),o=Math.floor(89999/(e+1)),a=410001+e*o;let h=0;return{rI:()=>{const e=t.nI("dashboard ui",a+h);return h+=1,e},oI:()=>t.nI("dashboard legend",41e4),aI:e=>{const a=1+e*i,h=100001+e*s,l=200002+e*n,u=300001+e*r,c=410001+e*o;let d=0;return{us:t,sg:(e,i)=>{const s=a+i;return t.nI(e,s)},YS:(e,i)=>{const s=h+i;return t.nI(e,s)},wp:(e,i)=>{const s=l+i;return t.nI(e,s)},US:(e,i,s)=>{const n=l+i;return t.lI(e,n,s)},rg:(e,i)=>{const s=u+i;return t.nI(e,s)},HA:e=>{const i=c+d,s=t.nI(e,i);return d+=1,s},XA:()=>t.nI("panel legend",400002+e),Tp:()=>t.nI("panel cursor",500001+e)}}}};class Nd{constructor(t){this.D=new n.Eventer,this.S=t}M(t){return this.S=t,this.D.emit("set",t),this}_(){return this.S}O(t){return this.D.on("set",t)}G(t){return this.D.off(t,"set")}}const Ud={uh:()=>{},ih:!1,sh:0,eh:!1,rh:0,hh:!1,oh:0,ah:0,Je:Rs.fitting},Gd=t=>{if(!t||"object"!=typeof t||null===t)return!1;const e=t.type;return!(!e||!["spark-line","spark-bar","spark-win-loss","spark-area","spark-pie"].includes(e))},Wd=(t,e,i,s,n,r,o,a)=>{const{type:h,data:l}=t;if(0===l.length)return;const u=[s,n];"spark-line"===h&&Zd(t,e,u,r,o,a),"spark-bar"===h&&Qd({...t,winLoss:!1},e,u,r,o,a),"spark-win-loss"===h&&Qd({...t,winLoss:!0},e,u,r,o,a),"spark-area"===h&&tf(t,e,u,r,o,a),"spark-pie"===h&&ef(t,e,u,r,o,a)},Yd=(t,e,i,s)=>({x:Xd(t.x,e.x,i.x,s),y:jd(t.y,e.y,i.y,s)}),Hd=(t,e,i,s)=>({position:Xd(t.position,e.x,i.x,s),high:jd(t.high,e.y,i.y,s),low:jd(t.low,e.y,i.y,s)}),Xd=(t,e,i,s)=>{const n=kt(t,e,e+i);return s[0].x+s[1].x*(n-e)/i},jd=(t,e,i,s)=>{const n=kt(t,e,e+i);return s[0].y+s[1].y*(n-e)/i},$d=(t,e,i,s,n,r,o,a)=>{for(const h of t)"point"===h.type&&qd(h,e,i,n,r,o,a),"axis-band"===h.type&&Jd(h,i,n,r,o,a),"constant-line"===h.type&&Kd(h,i,s,n,r,o,a)},qd=(t,i,s,n,r,o,a)=>{const{value:h,fillStyle:l,shape:u,size:c,rotation:d}=t;let f={x:NaN,y:NaN};if("start"===h&&(f=i[0]),"end"===h&&(f=i[i.length-1]),"min"===h){f=i[0];for(const t of i)f=f.yt.y?f:t}("object"!=typeof h||(f=Yd(h,s,n,r),((t,e)=>{const i=e[0],s=e[1],n=t.x,r=t.y;return i.x<=n&&n<=i.x+s.x&&i.y<=r&&r<=i.y+s.y})(f,r)))&&o.pointSet.add().Nt().Sl(void 0!==u?u:e.PointShape.Circle).zh(d||0).q(c||5).ke(l||a.sparkPointChartFillStyle)._l(f)},Jd=(t,e,i,s,n,r)=>{const{axis:o,start:a,end:h,fillStyle:l,strokeStyle:c}=t;let d=u(Fe,_e),f=u(Fe,_e);"x"===o&&(d=Yd({x:a,y:Fe},e,i,s),f=Yd({x:h,y:_e},e,i,s)),"y"===o&&(d=Yd({x:Fe,y:a},e,i,s),f=Yd({x:_e,y:h},e,i,s));const g=s[0],m=s[1],p=kt(d.x,g.x,g.x+m.x),y=kt(d.y,g.y,g.y+m.y),A=kt(f.x,g.x,g.x+m.x),x=kt(f.y,g.y,g.y+m.y);n.rect.add().Fl(p).Il(y).q(u(A-p,x-y)).ke(l||r.sparkChartBandFillStyle).Ce(c||r.sparkChartBandStrokeStyle).Ce(nt)},Kd=(t,e,i,s,n,r,o)=>{const{axis:a,value:h,strokeStyle:l}=t,c=h||0,d=e.y,f=i.y,g=e.x,m=i.x,p=[];if("y"===a&&d<=c&&c<=f){const t=Yd(u(g,c),{x:g,y:d},s,n),e=Yd(u(m,c),{x:g,y:d},s,n);p.push([t,e])}if("x"===a&&g<=c&&c<=m){const t=Yd(u(c,d),{x:g,y:d},s,n),e=Yd(u(c,f),{x:g,y:d},s,n);p.push([t,e])}p.length>0&&r.line.add().Ee(l||o.sparkChartConstantLineStrokeStyle).Oe(p[0][0]).ze(p[0][1])},Zd=(t,e,i,s,n,r)=>{const{strokeStyle:o,data:a,markers:h}=t,l=a.length;l>1e4&&n.oo&&St.console.warn("LightningChart JS warning: SparkLineChart has over 10000 data points. This feature is not designed for large data sets which might show as performance drop. If you want to request improvements to this, contact https://lightningchart.com/js-charts/docs/contact. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let u=_e,c=Fe,d=_e,f=Fe;for(let t=0;tYd(t,{x:u,y:d},g,i)));e.lineSet.add().cs(r).Ee(o||s.sparkLineChartStrokeStyle).Nt()._l(m),h&&$d(h,m,{x:u,y:d},{x:c,y:f},g,i,e,s)},Qd=(t,e,i,s,n,r)=>{const{data:o,fillStyle:a,strokeStyle:h,threshold:l,winFillStyle:u,lossFillStyle:c}=t,d=t.barSize||1,f=t.gap||1,g=t.winLoss,m=l||0,p=f/d*1;let y=_e,A=Fe;if(g)y=-1,A=1;else for(const t of o)y=Math.min(y,t),A=Math.max(A,t);const x={x:0,y:g?-1:Math.min(0,y)},S={x:1*o.length+(o.length-1)*p,y:g?2:Math.max(A,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*p,y:g?t>=m?1:0:t},n=Yd({x:1*e+e*p,y:g?t>=m?0:-1:0},x,S,i),r=Yd(s,x,S,i);return{value:t,position:n,width:r.x-n.x,height:r.y-n.y}})).forEach((t=>{var i;e.rect.add().cs(r).Ie(t.position).Dl(t.height).Pl(t.width).ke((i=t.value,g?(i>=m?u:c)||s.sparkBarChartFillStyle:a||s.sparkBarChartFillStyle)).Ce(h||s.sparkBarChartStrokeStyle)}))},tf=(t,e,i,s,n,r)=>{const{data:o,fillStyle:a,strokeStyle:h,markers:l}=t,u=o.length;u>1e4&&n.oo&&St.console.warn("LightningChart JS warning: SparkAreaChart has over 10000 data points. This feature is not designed for large data sets which might show as performance drop. If you want to request improvements to this, contact https://lightningchart.com/js-charts/docs/contact. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let c=_e,f=Fe,g=_e,m=Fe;for(let t=0;t{const{data:o,strokeStyle:a}=t,h=o.map((t=>"number"==typeof t?t:t.value)),l=o.map((t=>"object"==typeof t?t.fillStyle:void 0)),c=h.reduce(((t,e)=>t+e),0),d=Yd(u(50,50),{x:0,y:0},{x:100,y:100},i),f=i[1],g=f.x<=f.y?f.x/2:f.y/2;let m=90;h.forEach(((t,i)=>{const n=t/c*360;e.arc.add().cs(r).Ie(d).xu(g)._u(0).vu(m).ze(m+n).ke(l[i]||ce(s.sparkPieChartFillStyle,i)).Ce(a||s.sparkPieChartStrokeStyle),m+=n}))};var sf,nf,rf;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(sf||(sf={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(nf||(nf={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(rf||(rf={}));class of extends cr{constructor(t,e,i,s,n){super(),this.Bs=!1,this.Ow={x:0,y:0,height:20,width:20},this.uI={x:10,y:10},this.Ts=t,this.cI=n,this.dI=new ro(t,e,i,wt,s).setMouseInteractions(!0),this.fI=t.vc(e,rr.Simple).ke(s.dataGridScrollBarButtonArrowFillStyle).Ce(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.Ou(this),this.dI.onMouseEnter((t=>t.setHighlight(1))),this.dI.onMouseLeave((t=>t.setHighlight(0)))}AI(){switch(this.cI){case rf.Up:this.fI.Rl([{x:this.Ow.x,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y-this.uI.y/2},{x:this.Ow.x-this.uI.x/2,y:this.Ow.y-this.uI.y/2}]);break;case rf.Down:this.fI.Rl([{x:this.Ow.x-this.uI.x/2,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x,y:this.Ow.y-this.uI.y/2}]);break;case rf.Left:this.fI.Rl([{x:this.Ow.x-this.uI.x/2,y:this.Ow.y},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y-this.uI.y/2}]);break;case rf.Right:this.fI.Rl([{x:this.Ow.x-this.uI.x/2,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y},{x:this.Ow.x-this.uI.x/2,y:this.Ow.y-this.uI.y/2}])}}Ie(t){return this.Ow.x=t.x,this.Ow.y=t.y,this}Ya(){return u(this.Ow.x,this.Ow.y)}q(t){return this.Ow.height=t.x,this.Ow.width=t.y,this}oi(){return{x:this.Ow.height,y:this.Ow.width}}onMouseDown(t){return this.dI.onMouseDown(t)}onMouseUp(t){return this.dI.onMouseUp(t)}setFillStyle(t){return this.dI.setFillStyle(t),this}getFillStyle(){return this.dI.getFillStyle()}setStrokeStyle(t){return this.dI.setStrokeStyle(t),this}getStrokeStyle(){return this.dI.getStrokeStyle()}Fe(){return this.dI.Fe(),this.AI(),this}Ds(){return this.dI.setSize(u(this.Ow.height,this.Ow.width)).setPosition(u(this.Ow.x,this.Ow.y)),this}setVisible(t){return this.dI.setVisible(t),this.fI.setVisible(t),this}dispose(){return this.dI.dispose(),this.fI.dispose(),this}setMouseInteractions(t){return this.dI.setMouseInteractions(t),this}getMouseInteractions(){return this.dI.getMouseInteractions()}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}getHighlight(){return this.dI.getHighlight()}setHighlight(t){return this.dI.setHighlight(Ae(t)),this.D.emit("highlight",this,Boolean(t)),this.Ts.bs(),this}}const af=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class hf{constructor(t,i,s,r,o,a,h){this.Ic={x:0,y:0},this.Ow={x:0,y:0,height:0,width:0},this.D=new n.Eventer,this.gI={min:u(0,0),max:u(0,0)},this.qx=!1,this.tb=!1,this.pI={x:0,y:0},this.Gu=void 0,this.mI=u(0,0),this.yI={x:0,y:0},this.SI=0,this.vI=15,this.ib=(t,i)=>{this.qx=!0,this.vf.bs();const s=this.xI.getDraggingMode();this.Gu=this.vf.us.Er(s===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:s===e.UIDraggingModes.draggable?e.MouseStyles.Move:s===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical),this.bI&&clearInterval(this.bI)},this.sb=()=>{this.qx=!1,this.vf.bs(),this.vf.us.Vr(this.Gu)},this.eb=t=>(this.tb=!0,this.pI=ut(this.vf.us.De(t.x,t.y),this.vf.us.dt,this.scale),!0),this.MI=(t,e)=>(this._I(e),this.bI=setInterval((()=>this._I(e)),300),!0),this.wI=()=>(clearInterval(this.bI),!0),this.hb=(t,i)=>{const s=this.xI.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const n=i||s,r=ut(this.vf.us.De(t.x,t.y),this.vf.us.dt,this.scale),o=u(n!==e.UIDraggingModes.onlyVertical?af(r.x,this.scale.x):this.Ow.x,n!==e.UIDraggingModes.onlyHorizontal?af(r.y,this.scale.y):this.Ow.y),a=u(o.x-this.pI.x,o.y-this.pI.y),h=u(this.xI.getPosition().x+a.x,this.xI.getPosition().y+a.y),l=this.CI(h),c={x:Math.abs(this.mI.x-l.x),y:Math.abs(this.mI.y-l.y)};return this.kI(c),this.yI.y>a.y&&(this.pI=r),this.Fe(),!0}return!1},this.rb=(t,e)=>{this.tb=!1,jt(e),this.vf.bs()},this.vf=t,this.zA=i,this.scale=r,this.contentScale=o,this.TI=h,this.FI=new of(t,s,r,a,h===sf.UpToDown?rf.Up:rf.Left).setStrokeStyle(a.dataGridScrollBarButtonStrokeStyle).setFillStyle(a.dataGridScrollBarButtonFillStyle),this.II=new of(t,s,r,a,h===sf.UpToDown?rf.Down:rf.Right).setStrokeStyle(a.dataGridScrollBarButtonStrokeStyle).setFillStyle(a.dataGridScrollBarButtonFillStyle),this.xI=new ro(t,s,r,wt,a).setFillStyle(a.dataGridScrollBarFillStyle).setStrokeStyle(a.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(h===sf.UpToDown?e.UIDraggingModes.onlyVertical:h===sf.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.DI=new ro(i,s,r,wt,a).setFillStyle(a.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(a.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.xI.onMouseEnter(this.ib),this.xI.onMouseLeave(this.sb),this.xI.onMouseDragStart(((t,e)=>this.eb(u(e.clientX,e.clientY))&&jt(e))),this.xI.onMouseDrag(((t,e)=>this.hb(u(e.clientX,e.clientY))&&jt(e))),this.xI.onMouseDragStop(this.rb),this.xI.onTouchStart(((t,e)=>this.eb(u(e.clientX,e.clientY))&&jt(e))),this.xI.onTouchMove(((t,e)=>this.hb(u(e.clientX,e.clientY))&&jt(e))),this.xI.onTouchEnd(this.rb),this.FI.onMouseDown(((t,e)=>this.MI(t,e)&&jt(e))),this.II.onMouseDown(((t,e)=>this.MI(t,e)&&jt(e))),this.FI.onMouseUp(((t,e)=>this.wI()&&jt(e))),this.II.onMouseUp(((t,e)=>this.wI()&&jt(e))),this.DI.onMouseWheel(((t,e)=>this.BI(e))),this.xI.onMouseWheel(((t,e)=>this.BI(e))),this.DI.onMouseDown(((t,e)=>this.MI(t,e)&&jt(e))),this.DI.onMouseUp(((t,e)=>this.wI()&&jt(e)))}LI(t){return this.Ow=t,this}Pl(t){return this.Ow.width=t,this}RI(){return this.Ow.width}EI(t){return this.mI=t,this}VI(t){return this.Ic=t,this}zI(){return this.Ic}OI(t){return this.vI=t,this}NI(){return this.TI}GI(t){let e;switch(this.TI){case sf.UpToDown:return e=t>0?Math.min(this.mI.y-this.gI.max.y,this.yI.y+t):Math.max(0,this.yI.y+t),e!==this.yI.y&&(this.kI({x:0,y:e}),this.Fe(),!0);case sf.LeftToRight:return e=Math.min(this.gI.max.x-this.mI.x,this.yI.x+t),e!==this.yI.x&&(this.kI({y:0,x:e}),this.Fe(),!0);default:return!1}}WI(t){let e;switch(this.TI){case sf.UpToDown:return e=Math.max(0,this.yI.y-t),e!==this.yI.y&&(this.kI({x:0,y:e}),this.Fe(),!0);case sf.LeftToRight:return e=t>0?Math.max(0,this.yI.x-t):Math.min(this.gI.max.x-this.mI.x,this.yI.x-t),e!==this.yI.x&&(this.kI({x:e,y:0}),this.Fe(),!0);default:return!0}}UI(t){switch(this.TI){case sf.UpToDown:return this.D.on("scrollY",t);case sf.LeftToRight:return this.D.on("scrollX",t)}return this.D.on("scrollY",t)}CI(t){switch(this.TI){case sf.UpToDown:if(t.y>this.gI.min.y)return u(t.x,this.gI.min.y);if(t.ythis.gI.max.x)return u(this.gI.max.x,t.y)}return t}BI(t){t.deltaY>0&&this.YI()&&jt(t),t.deltaY<0&&this.HI()&&jt(t)}_I(t){const e=ut(this.vf.us.De(t.clientX,t.clientY),this.vf.us.dt,this.scale);let i;const s=this.xI.getPosition(),n=this.xI.getSize();this.$I(e,s,n)?clearInterval(this.bI):(i=this.TI===sf.UpToDown?u(0,e.y-s.y>0?this.vI:-this.vI):u(s.x-e.x>0?this.vI:-this.vI,0),(i.x>0||i.y>0)&&this.XI(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.jI(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}$I(t,e,i){return this.TI===sf.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.Ow.height?Math.min(this.mI.y-this.gI.max.y,this.yI.y+t):0,e!==this.yI.y&&(this.kI({x:0,y:e}),this.Fe(),!0)}case sf.LeftToRight:{const e=Math.min(this.gI.max.x-this.mI.x,this.yI.x+t);return e!==this.yI.x&&(this.kI({y:0,x:e}),this.Fe(),!0)}default:return!1}}HI(){return this.XI(this.vI)}YI(){return this.jI(this.vI)}kI(t){if(t.x===this.yI.x&&t.y===this.yI.y)return;let e;switch(this.yI=t,this.TI){case sf.UpToDown:e=this.yI.y*this.SI*this.contentScale.Wi().y,this.D.emit("scrollY",nf.Vertical,e),this.vf.us.bs();break;case sf.LeftToRight:e=this.yI.x*this.SI*this.contentScale.Wi().x,this.D.emit("scrollX",nf.Horizontal,e)}}setVisible(t){return this.FI.setVisible(t),this.II.setVisible(t),this.DI.setVisible(t),this.xI.setVisible(t),this}dispose(){return this.FI.dispose(),this.II.dispose(),this.DI.dispose(),this.xI.dispose(),this.bI&&clearInterval(this.bI),this}Ds(){switch(this.QI(),this.JI(),this.TI){case sf.UpToDown:this.FI.Ie({x:this.Ow.x,y:this.Ow.y+this.Ow.height-this.FI.oi().x/2}).q(u(this.Ow.width,this.Ow.width)).Ds(),this.II.Ie({x:this.Ow.x,y:this.Ow.y+10}).q(u(this.Ow.width,this.Ow.width)).Ds(),this.DI.setSize({x:this.Ow.width,y:this.Ow.height-2*this.FI.oi().x}).setPosition({x:this.Ow.x,y:this.Ow.y+this.II.oi().y+this.DI.getSize().y/2}),this.xI.setSize(u(this.Ow.width,this.KI())),this.mI={x:this.Ow.x,y:this.FI.Ya().y-this.FI.oi().y/2-this.xI.getSize().y/2},this.ZI({min:{x:this.Ow.x,y:this.FI.Ya().y-this.FI.oi().y/2-this.xI.getSize().y/2},max:{x:this.Ow.x,y:this.II.Ya().y+this.II.oi().x/2+this.xI.getSize().y/2}});break;case sf.LeftToRight:this.FI.Ie({x:this.Ow.x,y:this.Ow.y}).q(u(this.Ow.height,this.Ow.height)).Ds(),this.II.Ie({x:this.Ow.x+this.Ow.width-this.II.oi().x,y:this.Ow.y}).q(u(this.Ow.height,this.Ow.height)).Ds(),this.DI.setSize({y:this.Ow.height,x:this.Ow.width-2*this.FI.oi().y}).setPosition({x:this.Ow.x+this.FI.oi().x/2+this.DI.getSize().x/2,y:this.Ow.y}),this.xI.setSize(u(this.KI(),this.Ow.height)),this.mI={x:this.FI.Ya().x+this.FI.oi().x/2+this.xI.getSize().x/2,y:this.Ow.y},this.ZI({min:{x:this.FI.Ya().x+this.FI.oi().x/2+this.xI.getSize().x/2,y:this.Ow.y},max:{x:this.II.Ya().x-this.II.oi().x/2-this.xI.getSize().x/2,y:this.Ow.y}})}return this.qI(),this}QI(){switch(this.TI){case sf.UpToDown:this.tP()||this.setVisible(!1),this.tP()&&this.setVisible(!0);break;case sf.LeftToRight:this.iP()||this.setVisible(!1),this.iP()&&this.setVisible(!0)}}JI(){switch(this.TI){case sf.UpToDown:this.tP()||this.kI({x:0,y:0});break;case sf.LeftToRight:this.iP()||this.kI({x:0,y:0})}}tP(){return this.Ic.x>this.Ow.height}iP(){return this.Ic.y>this.Ow.width}KI(){switch(this.TI){case sf.UpToDown:return this.Ow.height*(this.Ow.height-2*this.FI.oi().x)/this.Ic.x;case sf.LeftToRight:return this.Ow.width*(this.Ow.width-2*this.FI.oi().y)/this.Ic.y;default:return 0}}qI(){switch(this.TI){case sf.UpToDown:this.SI=(this.Ic.x-this.Ow.height)/(this.gI.min.y-this.gI.max.y);break;case sf.LeftToRight:this.SI=(this.Ic.y-this.Ow.width)/(this.gI.max.x-this.gI.min.x)}}Fe(){switch(this.FI.Fe(),this.II.Fe(),this.DI.Fe(),this.TI){case sf.UpToDown:this.xI.setPosition({x:this.Ow.x,y:this.FI.Ya().y-this.FI.oi().y/2-this.xI.getSize().y/2-this.yI.y}).Fe();break;case sf.LeftToRight:this.xI.setPosition({y:this.Ow.y,x:this.FI.Ya().x+this.FI.oi().x/2+this.xI.getSize().x/2+this.yI.x}).Fe()}return this}}class lf{constructor(t,e,i,s,n,r,o){switch(this.vf=t,this.zA=e,this.scale=s,this.contentScale=n,o){case nf.Vertical:this.sP=this.eP(i,r,sf.UpToDown);break;case nf.Horizontal:this.hP=this.eP(i,r,sf.LeftToRight);break;case nf.Both:this.sP=this.eP(i,r,sf.UpToDown),this.hP=this.eP(i,r,sf.LeftToRight)}this.rP=Yi(new Xi(void 0,((t,e,i,s,n)=>{var r,o;0!==s.x&&(null===(r=this.hP)||void 0===r?void 0:r.WI(s.x))&&jt(n),0!==s.y&&(null===(o=this.sP)||void 0===o?void 0:o.GI(s.y))&&jt(n)})))}eP(t,e,i){return new hf(this.vf,this.zA,t,this.scale,this.contentScale,e,i)}RI(){return 20}VI(t){var e,i;return null===(e=this.sP)||void 0===e||e.VI(t),null===(i=this.hP)||void 0===i||i.VI(t),this}nP(t){var e;return null===(e=this.hP)||void 0===e||e.OI(t),this}oP(t){var e;return null===(e=this.sP)||void 0===e||e.OI(t),this}aP(t){const e=this.sP;return e&&e.BI(t),this}lP(t){return this.rP.onTouchStart(this,t),this}uP(t){return this.rP.onTouchMove(this,t),this}cP(t){return this.rP.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.hP)||void 0===e||e.UI(t),null===(i=this.sP)||void 0===i||i.UI(t),this}dispose(){var t,e;return null===(t=this.sP)||void 0===t||t.dispose(),null===(e=this.hP)||void 0===e||e.dispose(),this}Fe(){var t,e;return null===(t=this.sP)||void 0===t||t.Fe(),null===(e=this.hP)||void 0===e||e.Fe(),this}Ds(){var t,e,i,s;const n=this.scale.x,r=this.scale.y;return null===(t=this.sP)||void 0===t||t.LI({x:n.getInnerEnd()-10,y:r.getInnerStart()+20,height:r.getInnerEnd()-20,width:20}),null===(e=this.hP)||void 0===e||e.LI({x:n.getInnerStart()+10,y:r.getInnerStart()+10,height:20,width:n.getInnerEnd()-20}),null===(i=this.sP)||void 0===i||i.Ds(),null===(s=this.hP)||void 0===s||s.Ds(),this}}class uf extends Ga{constructor(t,e,i,s,n,r){super(t,e,i,e.sg("dataGrid bg",0),s,e.us.qi.dataGridBackgroundFillStyle,e.us.qi.dataGridBackgroundStrokeStyle,e.us.qi.dataGridTitleFont,e.us.qi.dataGridTitleFillStyle,r),this.dP=[],this.fP=[],this.AP=[],this.gP=new Map,this.pP=!0,this.mP=!0,this.yP=!0,this.SP=!0,this.vP=!0,this.xP=!0,this.bP=!0,this.MP=!0,this._P=!0,this.wP=!0,this.CP=!0,this.kP=!0,this.TP=!0,this.FP=!0,this.IP=!0,this.PP=!0,this.DP=new Set,this.BP=new Set,this.LP=!0,this.RP=!0,this.EP=(t,e)=>{t.borders=void 0===e?mf:{...t.borders,...e},this.VP(t),this.kP=!0,this.us.bs()},this.VP=t=>{t.borders&&(!1===t.borders.top&&this.zP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.OP,bottom:!1}})),!1===t.borders.bottom&&this.zP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.OP,top:!1}})),!1===t.borders.left&&this.zP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.OP,right:!1}})),!1===t.borders.right&&this.zP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.OP,left:!1}})),!0===t.borders.top&&this.zP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.OP,bottom:!0}})),!0===t.borders.bottom&&this.zP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.OP,top:!0}})),!0===t.borders.left&&this.zP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.OP,right:!0}})),!0===t.borders.right&&this.zP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.OP,left:!0}})))},this.NP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseEnter,i,e)},this.GP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseLeave,i,e)},this.WP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseClick,i,e)},this.UP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDoubleClick,i,e)},this.YP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDown,i,e)},this.HP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseUp,i,e)},this.$P=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseMove,i,e)},this.XP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDrag,i,e)},this.jP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDragStart,i,e)},this.ZP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDragStop,i,e)},this.QP=(t,e)=>{const i=this.gP.get(t);i&&(this.D.emit(cf.cellMouseWheel,i,e),!e.defaultPrevented&&this.LP&&this.JP.aP(e))},this.KP=(t,e)=>{const i=this.gP.get(t);i&&(this.D.emit(cf.cellTouchStart,i,e),!e.defaultPrevented&&this.RP&&this.JP.lP(e))},this.qP=(t,e)=>{const i=this.gP.get(t);i&&(this.D.emit(cf.cellTouchMove,i,e),!e.defaultPrevented&&this.RP&&this.JP.uP(e))},this.tD=(t,e)=>{const i=this.gP.get(t);i&&(this.D.emit(cf.cellTouchEnd,i,e),!e.defaultPrevented&&this.RP&&this.JP.cP(e))},this.fs.Vn||this.fs.On||this.us.As(2),this.ng.Bh("Data Grid"),this.iD=i.d2({scaleXYConstructor:Li}),this.iD.x.tA=Ud,this.sD=i.d2({scaleXYConstructor:Li}),this.eD={x:0,y:0},this.hD=this.qi.dataGridTextFont,this.rD=this.qi.dataGridTextFillStyle,this.OP={top:!0,bottom:!0,left:!0,right:!0},this.nD=this.qi.dataGridCellBackgroundFillStyle,this.oD=this.qi.dataGridBorderStrokeStyle,this.aD="left-center",this.lD={left:5,right:5,bottom:5,top:5},this.uD=e.YS("dataGrid grid bg",0),this.cD=e.YS("dataGrid cell bg",1),this.dD=e.wp("dataGrid cell content",0),this.fD=e.wp("dataGrid scrollbar bg",1),this.AD=e.wp("dataGrid scrollbar fg",2),this.JP=this.gD(),this.onBackgroundMouseWheel(((t,e)=>{this.LP&&this.JP.aP(e)})),this.onBackgroundTouchStart(((t,e)=>{this.RP&&this.JP.lP(e)})),this.onBackgroundTouchMove(((t,e)=>{this.RP&&this.JP.uP(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.RP&&this.JP.cP(e)})),this.pD=this.uD.Te(this.iD).ke(this.qi.dataGridBackgroundFillStyle).Ce(nt).setMouseInteractions(!1),this.mD=this.dD._A(this.iD).setMouseInteractions(!1),this.yD=new zh((()=>this.cD.Te(this.iD).setMouseInteractions(!0).setMouseEnterEventHandler(this.NP).setMouseLeaveEventHandler(this.GP).setMouseClickEventHandler(this.WP).setMouseDoubleClickEventHandler(this.UP).setMouseDownEventHandler(this.YP).setMouseUpEventHandler(this.HP).setMouseMoveEventHandler(this.$P).setMouseDragEventHandler(this.XP).setMouseDragStartEventHandler(this.jP).setMouseDragStopEventHandler(this.ZP).setMouseWheelEventHandler(this.QP).setTouchStartEventHandler(this.KP).setTouchMoveEventHandler(this.qP).setTouchEndEventHandler(this.tD))),this.SD=new zh((()=>this.dD.Te(this.iD).setMouseInteractions(!1))),this.vD=new zh((()=>this.dD.kr(this.iD).setMouseInteractions(!1))),this.xD=new zh((()=>this.dD.zp(this.iD,{},[kh.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.bD=new zh((()=>this.dD.Ve(this.iD).setMouseInteractions(!1))),this.MD=new zh((()=>this.dD.Oc(this.iD).setMouseInteractions(!1))),this._D=new zh((()=>this.dD.Te(this.iD).setMouseInteractions(!1))),this.wD=new zh((()=>this.dD.yC(this.iD).setMouseInteractions(!1))),this.CD=new zh((()=>this.dD.Fc(this.iD).setMouseInteractions(!1))),this.ig(n,this.uiScale),this.onResize((()=>{this.pP=!0,this.us.bs(),this.iD.q(this.pixelScale.oi()),this.sD.q(this.pixelScale.oi())})),this.kD=this.es.gA([this.pD])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}Sd(){return[]}dispose(){return super.dispose(),this.uD.W(),this.cD.W(),this.dD.W(),this.fD.W(),this.AD.W(),Oa(this.iD),Oa(this.sD),this.JP.dispose(),this.vD.Zp(),this.yD.Zp(),this.SD.Zp(),this.xD.Zp(),this.bD.Zp(),this.MD.Zp(),this._D.Zp(),this.wD.Zp(),this.CD.Zp(),this}j(){return super.j(),this.iD.j(),this.sD.j(),this}Z(){return super.Z(),this.iD.Z(),this.sD.Z(),this}setBackgroundEffect(t){return this.kD.xs(t),this.us.bs(),this}getBackgroundEffect(){return this.kD.Ms()}setInteractionScrollOnWheel(t){return this.LP=t,this}getInteractionScrollOnWheel(){return this.LP}setInteractionPanOnTouch(t){return this.RP=t,this}getInteractionPanOnTouch(){return this.RP}onCellMouseEnter(t){return this.D.on(cf.cellMouseEnter,t)}offCellMouseEnter(t){return this.D.off(t)}onCellMouseLeave(t){return this.D.on(cf.cellMouseLeave,t)}offCellMouseLeave(t){return this.D.off(t)}onCellMouseClick(t){return this.D.on(cf.cellMouseClick,t)}offCellMouseClick(t){return this.D.off(t)}onCellMouseDoubleClick(t){return this.D.on(cf.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.D.off(t)}onCellMouseDown(t){return this.D.on(cf.cellMouseDown,t)}offCellMouseDown(t){return this.D.off(t)}onCellMouseUp(t){return this.D.on(cf.cellMouseUp,t)}offCellMouseUp(t){return this.D.off(t)}onCellMouseMove(t){return this.D.on(cf.cellMouseMove,t)}offCellMouseMove(t){return this.D.off(t)}onCellMouseDrag(t){return this.D.on(cf.cellMouseDrag,t)}offCellMouseDrag(t){return this.D.off(t)}onCellMouseDragStart(t){return this.D.on(cf.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.D.off(t)}onCellMouseDragStop(t){return this.D.on(cf.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.D.off(t)}onCellMouseWheel(t){return this.D.on(cf.cellMouseWheel,t)}offCellMouseWheel(t){return this.D.off(t)}onCellTouchStart(t){return this.D.on(cf.cellTouchStart,t)}offCellTouchStart(t){return this.D.off(t)}onCellTouchMove(t){return this.D.on(cf.cellTouchMove,t)}offCellTouchMove(t){return this.D.off(t)}onCellTouchEnd(t){return this.D.on(cf.cellTouchEnd,t)}offCellTouchEnd(t){return this.D.off(t)}setGridBackgroundFillStyle(t){return this.pD.ke(t),this.us.bs(),this}getGridBackgroundFillStyle(){return this.pD.Lh()}setCellContent(t,e,i,s,n){if("number"==typeof i&&void 0!==s&&void 0!==n){const r=i,o=s,a=n;let h=[];for(let i=t;ie.column===t));return i||(i={column:t,min:void 0,max:void 0},this.fP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.fP.splice(this.fP.indexOf(i),1):(i.min=e,i.max=e),this.xP=!0,this.us.bs(),this}setRowHeight(t,e){let i=this.AP.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.AP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.AP.splice(this.AP.indexOf(i),1):(i.min=e,i.max=e),this.xP=!0,this.us.bs(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.FD(t,(t=>this.ID(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.PD(t,(t=>this.ID(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=x(i,i,i,i)),this.zP(t,e,(t=>this.ID(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=x(t,t,t,t)),this.lD={...this.lD,...t},this.DD((t=>this.ID(t,this.lD))),this}setCellBorders(t,e,i){return this.zP(t,e,(t=>this.EP(t,i))),this}setRowBorders(t,e){return this.PD(t,(t=>this.EP(t,e))),this}setColumnBorders(t,e){return this.FD(t,(t=>this.EP(t,e))),this}setCellsBorders(t){return this.OP=void 0===t?mf:t,this.DD((t=>this.EP(t,this.OP))),this}setCellsBorderStrokeStyle(t){return this.oD="function"==typeof t?t(this.oD):t,this.FP=!0,this.us.bs(),this}setColumnTextFillStyle(t,e){return this.FD(t,(t=>this.BD(t,e))),this}setRowTextFillStyle(t,e){return this.PD(t,(t=>this.BD(t,e))),this}setCellTextFillStyle(t,e,i){return this.zP(t,e,(t=>this.BD(t,i))),this}setCellsTextFillStyle(t){return this.rD="function"==typeof t?t(this.rD):t,this.DD((t=>this.BD(t,this.rD))),this}setColumnTextFont(t,e){return this.FD(t,(t=>this.LD(t,e))),this}setRowTextFont(t,e){return this.PD(t,(t=>this.LD(t,e))),this}setCellTextFont(t,e,i){return this.zP(t,e,(t=>this.LD(t,i))),this}setCellsTextFont(t){return this.hD="function"==typeof t?t(this.hD):t,this.DD((t=>this.LD(t,this.hD))),this}setColumnContentAlignment(t,e){return this.FD(t,(t=>this.RD(t,e))),this}setRowContentAlignment(t,e){return this.PD(t,(t=>this.RD(t,e))),this}setCellContentAlignment(t,e,i){return this.zP(t,e,(t=>this.RD(t,i))),this}setCellsContentAlignment(t){return this.aD=t,this.DD((t=>this.RD(t,this.aD))),this}setCellBackgroundFillStyle(t,e,i){return this.zP(t,e,(t=>this.ED(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.FD(t,(t=>this.ED(t,e))),this}setRowBackgroundFillStyle(t,e){return this.PD(t,(t=>this.ED(t,e))),this}setCellsBackgroundFillStyle(t){return this.nD="function"==typeof t?t(this.nD):t,this.DD((t=>this.ED(t,this.nD))),this}setCellHighlight(t,e,i){return this.zP(t,e,(t=>{t.highlight=Ae(i)})),this.TP=!0,this.us.bs(),this}setColumnHighlight(t,e){const i=Ae(e);return this.FD(t,(t=>{t.highlight=i})),this.TP=!0,this.us.bs(),this}setRowHighlight(t,e){const i=Ae(e);return this.PD(t,(t=>{t.highlight=i})),this.TP=!0,this.us.bs(),this}removeCell(t,e){return this.zP(t,e,(t=>this.dP.splice(this.dP.indexOf(t),1))),this.vP=!0,this.us.bs(),this}removeRow(t){return this.PD(t,(t=>this.dP.splice(this.dP.indexOf(t),1))),this.dP.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.vP=!0,this.us.bs(),this}removeColumn(t){return this.FD(t,(t=>this.dP.splice(this.dP.indexOf(t),1))),this.dP.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.vP=!0,this.us.bs(),this}removeCells(){return this.dP.splice(0),this.vP=!0,this.us.bs(),this}getColumnMax(){return 0===this.dP.length?0:this.dP.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.dP.length?0:this.dP.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}Fe(t){super.Fe(t),Wa.cg(this.ng,this.eg),super.tg();const e=Math.round(this.oD.V()),i=e/2;let s=this.mP||this.yP||this.SP||this.vP||this.xP||this.bP||this.CP||this.kP||this.FP||this.PP;if(s){this.dP.forEach((t=>{this.BP.add(t.column)})),this.dP.forEach((t=>{this.DP.add(t.row)}));const t=this.vD.Xp(),n=this.VD(i,t);t.finishPlot();const r=this.zD(this.BP.size,n),o=this.OD(this.DP.size,n),a=r.reduce(Ne,0)+e,h=o.reduce(Ne,0)+e,l=new Array(r.length+1).fill(0).map(((t,e)=>r.reduce(((t,i,s)=>t+(so.reduce(((t,i,s)=>t+(st===r[e])),e=this.ND.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.ND={columnWidths:r,rowHeights:o,dataGridWidth:a,dataGridHeight:h,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:n}}const n=s||this.yP||this.SP||this.vP||this.MP||this._P||this.wP||this.kP||this.TP||this.FP||this.pP||this.PP;if((n||this.IP)&&this.ND){const t=this.pixelScale.getInnerIntervalPixels(),s=Wa.ug(this.ng,this.eg),r=[this.Da.left+i,this.Da.right+i],o=[this.Da.bottom+i,this.Da.top+s+i],a={x:t.x-r[0]-r[1],y:t.y-o[0]-o[1]},h=[this.Da.left,this.Da.right],l=[this.Da.bottom,this.Da.top+s],u={x:Math.round(t.x-h[0]-h[1]),y:Math.round(t.y-l[0]-l[1])},c={x:Math.ceil(i),y:Math.floor(u.y-i)};this.sD.Ei(r).Vi(o).zi(0,a.x).Oi(0,a.y),this.JP.VI({x:this.ND.dataGridHeight,y:this.ND.dataGridWidth}).Ds().Fe();const d={x:Math.round(this.eD.x),y:Math.round(Math.min(0,this.eD.y))};this.iD.Ei(h).Vi(l).zi(d.x,u.x+d.x).Oi(d.y,u.y+d.y),this.pD.Ie({x:c.x,y:c.y});const f={x:this.iD.x.ei(),y:this.iD.y.ei()+this.JP.RI(),width:this.iD.x.ri()+e-this.JP.RI(),height:this.iD.y.ri()+e};this.dD.ES(f),this.cD.ES(f),this.uD.ES(f);const g=this.ND,m=[{x:this.iD.x.getInnerStart(),y:this.iD.y.getInnerStart()},{x:this.iD.x.getInnerEnd(),y:this.iD.y.getInnerStart()},{x:this.iD.x.getInnerEnd(),y:this.iD.y.getInnerEnd()},{x:this.iD.x.getInnerStart(),y:this.iD.y.getInnerEnd()}];g.cellsContentSizes.forEach((t=>{var e;const i={x:c.x+g.columnWidthsCumulative[t.cell.column],y:c.y-g.rowHeightsCumulative[t.cell.row+t.cell.rowSpan]},s={x:i.x+g.columnWidths[t.cell.column],y:i.y+g.rowHeights[t.cell.row]},n=Ve([i,{x:s.x,y:i.y},s,{x:i.x,y:s.y}],m);null===(e=t.text)||void 0===e||e.setVisible(n)})),n&&this.GD(c,this.ND,e)}this.pP=!1,this.mP=!1,this.yP=!1,this.SP=!1,this.vP=!1,this.xP=!1,this.bP=!1,this.MP=!1,this._P=!1,this.wP=!1,this.CP=!1,this.kP=!1,this.TP=!1,this.FP=!1,this.IP=!1,this.PP=!1}VD(t,e){const i=[],s={left:Math.ceil(t),right:Math.ceil(t),top:Math.ceil(t),bottom:Math.ceil(t)};for(const t of this.dP){const{content:n}=t,r={...this.lD,...t.padding};let o,a,h,l={x:0,y:0};if("string"==typeof n||"number"==typeof n){const i=String(n);o=e.add(),l=o.Bh(i).Vh(t.textFont||this.hD).Ds().Cc()}if(Gd(n)&&(a=n,l={x:200,y:50}),to(n)){const t=this.us.WD(n);t.UD()?(h=n,l=h.oi()):t.YD((()=>{this.PP=!0,this.us.bs()}))}if(o||a||h){r.top=Math.round(r.top),r.left=Math.round(r.left),r.right=Math.round(r.right),r.bottom=Math.round(r.bottom);const e={x:Math.round(l.x+r.left+r.right+s.left+s.right),y:Math.round(l.y+r.top+r.bottom+s.top+s.bottom)};i.push({cell:t,contentSize:e,text:o,sparkChart:a,icon:h,cellPadding:r,cellMargin:s})}}return i}GD(t,i,s){const{dataGridWidth:n,dataGridHeight:r,cellsContentSizes:o,columnWidths:a,columnWidthsCumulative:h,rowHeights:l,rowHeightsCumulative:u}=i,c={x:n-s,y:-r+s};this.pD.q(c),this.mD.Ee(this.oD),this.gP.clear();const d={cellBackground:this.yD.Xp(),cellIconRect:this.SD.Xp(),lineSet:this.xD.Xp(),line:this.bD.Xp(),pointSet:this.MD.Xp(),rect:this._D.Xp(),junction:this.wD.Xp(),arc:this.CD.Xp()},f=[];for(const i of o){const{cell:n,text:r,sparkChart:o,icon:c,cellPadding:g,cellMargin:m}=i,p={column:n.column,row:n.row},y={x:t.x+h[n.column],y:t.y-u[n.row+n.rowSpan]},A={x:y.x+m.left,y:y.y+m.bottom},x={x:A.x+g.left,y:A.y+g.bottom},S={x:new Array(n.columnSpan).fill(0).reduce(((t,e,i)=>t+a[n.column+i]),0),y:new Array(n.rowSpan).fill(0).reduce(((t,e,i)=>t+l[n.row+i]),0)},b={x:S.x-m.left-m.right,y:S.y-m.top-m.bottom},v={x:b.x-g.left-g.right,y:b.y-g.top-g.bottom};if(r){const t=gf(x,v,n.contentAlignment||this.aD);r.Ie(t[0]).Ja({x:t[1],y:t[2]}).ke(this.HD(n.textFillStyle||this.rD,n.content,this.rD)).cs(n.highlight)}const M=this.HD(n.backgroundFillStyle||this.nD,n.content);if(M!==V){const t=d.cellBackground.add();t.Ie(y).q(S).ke(M).Ce(nt).cs(n.highlight),this.gP.set(t,p)}const T=n.borders||this.OP;if(T&&ff(y,S,T,s,f),o){const t=x,e=v;Wd(o,d,this.iD,t,e,this.qi,this.fs,n.highlight)}if(c){const t=c.oi(),i=gf(x,v,n.contentAlignment||this.aD);d.cellIconRect.add().Ie({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).q(t).ke(new Xr({source:c.Mc,fitMode:e.ImageFitMode.Stretch})).Ce(nt).cs(n.highlight)}}this.mD.Nt();for(const t of f)this.mD.Lr().CA(t[0],t[1]);d.cellBackground.finishPlot(),d.cellIconRect.finishPlot(),d.lineSet.finishPlot(),d.line.finishPlot(),d.pointSet.finishPlot(),d.rect.finishPlot(),d.junction.finishPlot(),d.arc.finishPlot()}zD(t,e){const i=new Array(t).fill(0);for(const t of this.BP.values()){const s=e.filter((e=>t>=e.cell.column&&t+1<=e.cell.column+e.cell.columnSpan)).reduce(((t,e)=>{const i=e.contentSize.x/e.cell.columnSpan;return Math.max(t,i)}),0),n=this.fP.find((e=>e.column===t)),r=n?kt(s,void 0!==n.min?n.min:Fe,void 0!==n.max?n.max:_e):s;i[t]=r}return i}OD(t,e){const i=new Array(t).fill(0);for(const t of this.DP.values()){const s=e.filter((e=>t>=e.cell.row&&t+1<=e.cell.row+e.cell.rowSpan)).reduce(((t,e)=>{const i=e.contentSize.y/e.cell.rowSpan;return Math.max(t,i)}),0),n=this.AP.find((e=>e.row===t)),r=n?kt(s,void 0!==n.min?n.min:Fe,void 0!==n.max?n.max:_e):s;i[t]=r}return i}HD(t,e,i){if(H(t)){try{const i=Number(e);return new U({color:t.getPalette().getColors(i)})}catch(t){}return i||V}return t}BD(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.rD):e,this.wP=!0,this.us.bs()}LD(t,e){t.textFont="function"==typeof e?e(t.textFont||this.hD):e,this.CP=!0,this.us.bs()}ED(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.nD):e,this._P=!0,this.us.bs()}RD(t,e){t.contentAlignment=e,this.MP=!0,this.us.bs()}ID(t,e){t.padding={...t.padding,...e},this.bP=!0,this.us.bs()}TD(t,e,i){let s=this.zP(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.dP.push(s),this.SP=!0),"string"==typeof s.content||"number"==typeof s.content?this.mP=!0:this.yP=!0,this.us.bs()}DD(t){this.dP.forEach((e=>t(e)))}zP(t,e,i){const s=this.dP.find((i=>t>=i.column&&t+1<=i.column+i.columnSpan&&e>=i.row&&e+1<=i.row+i.rowSpan));return s&&i&&i(s),s}FD(t,e){const i=this.dP.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}PD(t,e){const i=this.dP.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}gD(){return new lf(this.AD,this.fD,this.sD,this.sD,this.iD,this.qi,nf.Both).onScroll(((t,e)=>{this.ND&&(t===nf.Vertical&&(this.eD.y=-e),t===nf.Horizontal&&(this.eD.x=e),this.IP=!0,this.us.bs())})).nP(50).oP(12)}}const cf={cellMouseEnter:"cellMouseEnter",cellMouseLeave:"cellMouseLeave",cellMouseClick:"cellMouseClick",cellMouseDoubleClick:"cellMouseDoubleClick",cellMouseDown:"cellMouseDown",cellMouseUp:"cellMouseUp",cellMouseMove:"cellMouseMove",cellMouseDrag:"cellMouseDrag",cellMouseDragStart:"cellMouseDragStart",cellMouseDragStop:"cellMouseDragStop",cellMouseWheel:"cellMouseWheel",cellTouchStart:"cellTouchStart",cellTouchMove:"cellTouchMove",cellTouchEnd:"cellTouchEnd"};var df;e.DataGridCellContentAlignmentOptions=void 0,(df=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",df.RightCenter="right-center",df.LeftCenter="left-center",df.RightTop="right-top",df.LeftTop="left-top",df.RightBottom="right-bottom",df.LeftBottom="left-bottom",df.CenterTop="center-top",df.CenterBottom="center-bottom";const ff=(t,e,i,s,n)=>{const r={x:t.x,y:t.y},o={x:t.x,y:t.y+e.y},a={x:t.x+e.x,y:t.y},h={x:t.x+e.x,y:t.y+e.y};i.top&&n.push([o,h]),i.bottom&&n.push([r,a]),i.left&&n.push([r,o]),i.right&&n.push([a,h])},gf=(t,e,i)=>{const s=t.x,n=t.x+e.x,r=t.x+e.x/2,o=t.y+e.y,a=t.y,h=t.y+e.y/2;switch(i){case"left-center":return[u(s,h),-1,0];case"right-center":return[u(n,h),1,0];case"center":return[u(r,h),0,0];case"left-bottom":return[u(s,a),-1,-1];case"right-bottom":return[u(n,a),1,-1];case"center-bottom":return[u(r,a),0,-1];case"left-top":return[u(s,o),-1,1];case"right-top":return[u(n,o),1,1];case"center-top":return[u(r,o),0,1]}return Se(0,`Unidentified DataGrid cell content alignment option: ${i}`)},mf={top:!1,bottom:!1,left:!1,right:!1};class pf extends qs{constructor(t,e,i,s,n,r){super(t,{mr(){},pr(){},Sr(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.es=r,this.Ts=n,this.Dh=n.kr(t.$D).Vh(this.qi.barChartCategoryAxisTitleFont||this.qi.xAxisTitleFont).ke(this.qi.barChartCategoryAxisTitleFillStyle||this.qi.xAxisTitleFillStyle),this.setTitleRotation(this.chart.Fs.getWidth({x:0,y:-90})),this.Nh=this.es.gA([this.Dh]).xs(e.effectsText),this.XD=n.Ve(t.$D).Ee(e.barChartCategoryAxisStrokeStyle||e.xAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.yA=t,this.SA=t):"object"==typeof t&&(this.yA=t.min,this.SA=t.max),this.chart.us.bs(),this}getThickness(){return{min:this.yA,max:this.SA}}setStrokeStyle(t){return this.XD.Ee(t),this.chart.us.bs(),this}getStrokeStyle(){return this.XD.ku()}Ds(){if(!this.Xi)return{jD:0,ZD:0,nd:kt(0,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:_e)};const t=this.XD.ku().V()/2,e=this.chart.Fs.getHeight(this.Dh.Ds().Cc());return{jD:t,ZD:e,nd:t+e}}Fe(t,e,i,s){const n=this.getInterval(),r=this.chart.valueAxis.getInterval();this.XD.Oe(this.chart.Fs.toPoint(n.start,r.start)).ze(this.chart.Fs.toPoint(n.end,r.start)).setVisible(this.Xi),this.Dh.Ie(this.chart.Fs.toPoint(.5*(n.start+n.end),this.chart.valueAxis.dt.pi(r.start,-(t.jD+s.labelMarginBeforeCategoryAxisPixels)))).Ja(this.chart.Fs.toPoint(0,1)).setVisible(this.Xi)}setMouseInteractions(t){return this}ar(t,e){return new Js(e,t,this.Ts,this.chart.$D)}lr(t,e){return{}}br(t,e){return e}_r(t,e,i){return{min:t,max:e}}}class yf extends qs{constructor(t,e,i,s,n,r,o){super(t,{mr:()=>{var e;if(t.QD){if("positive"===t.JD||"bipolar"===t.JD){if("after-bar"===(null===(e=t.KD)||void 0===e?void 0:e.position)){const e=this.dt.ri();return this.dt.pi(t.QD.max,Math.min(this.chart.Fs.getHeight(this.chart.qD())+t.KD.labelMargin,.3*e))}return t.QD.max}return t.tB?kt(-1,-1e-6,t.QD.max):0}},pr:()=>{var e;if(t.QD){if("negative"===t.JD||"bipolar"===t.JD){if("after-bar"===(null===(e=t.KD)||void 0===e?void 0:e.position)){const e=this.dt.ri();return this.dt.pi(t.QD.min,-Math.min(this.chart.Fs.getHeight(this.chart.qD())+t.KD.labelMargin,.3*e))}return t.QD.min}return t.tB?kt(1,1e-6,t.QD.min):0}},Sr:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.es=r,this.Ts=n,this.Dh=n.kr(t.$D).Vh(this.qi.barChartValueAxisTitleFont||this.qi.yAxisTitleFont).ke(this.qi.barChartValueAxisTitleFillStyle||this.qi.yAxisTitleFillStyle),this.setTitleRotation(this.chart.Fs.getHeight({x:0,y:-90})),this.Nh=this.es.gA([this.Dh]).xs(e.effectsText),this.XD=n.Ve(t.$D).Ee(e.barChartValueAxisStrokeStyle||this.qi.yAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.yA=t,this.SA=t):"object"==typeof t&&(this.yA=t.min,this.SA=t.max),this.chart.us.bs(),this}getThickness(){return{min:this.yA,max:this.SA}}setStrokeStyle(t){return this.XD.Ee(t),this.chart.us.bs(),this}getStrokeStyle(){return this.XD.ku()}setTickStrategy(t,e){return super.kh(t,e)}Ds(t){if(!this.Xi)return this.Gh(),{jD:0,ZD:0,nd:kt(0,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:_e)};const e=this.chart.Fs.getWidth(this.chart.$D).ri(),i=this.dt.ri();this.Jh({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.Ze.values())for(const e of t.values()){const t=e.Sh.nr,i=this.chart.Fs.getWidth(e.Ye.Cc()),n=t.getTickLength()+t.getTickPadding()+i+t.getLabelPadding();s=Math.max(s,n)}const n=s+this.XD.ku().V()/2,r=this.chart.Fs.getWidth(this.Dh.Ds().Cc());return{jD:n,ZD:r,nd:kt(n+r,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:_e)}}Fe(t){const e=this.getInterval();this.XD.Oe(this.chart.Fs.toPoint(-.5,this.Th)).ze(this.chart.Fs.toPoint(-.5,this.Fh)).setVisible(this.Xi);const i="logarithmic"===this.wh.type?Math.sqrt(e.start+e.end):.5*(e.start+e.end),s=this.chart.Fs.toPoint(this.chart.categoryAxis.dt.pi(-.5,t.jD*this.chart.Fs.iB),i),n=this.chart.Fs.toPoint(this.chart.Fs.sB,0);this.Dh.Ie(s).Ja(n).setVisible(this.Xi)}setMouseInteractions(t){return this}ar(t,e){return new Js(e,t,this.Ts,this.chart.$D)}lr(t,e){const i=t.Sh.nr,s=this.chart.Fs.toPoint(-.5,t.S),n=this.chart.$D.pi(s,this.chart.Fs.toPoint(i.getTickLength()*this.chart.Fs.iB,0)),r=this.chart.$D.pi(s,this.chart.Fs.toPoint(i.gridStrokeLength*e.oppositeAxisSize*-this.chart.Fs.iB,0)),o=this.chart.$D.pi(n,this.chart.Fs.toPoint(i.getTickPadding()*this.chart.Fs.iB,0));t.Ye.Ie(o).Ja(this.chart.Fs.toPoint(this.chart.Fs.sB,i.getLabelAlignment())).zh(i.getLabelRotation()),i.tickStyle!==nt&&0!==i.tickLength&&e.plotLines.add({positions:[s,n]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==nt&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,r]},{lineStyle:i.gridStrokeStyle})}br(t,e){return"linear"===this.wh.type?Jo(t,e,this.dt):Ko(t,e,this.dt)}_r(t,e,i){return{min:t,max:e}}}class Af extends _l{constructor(t,e,i,s,n,r,o){super(t,e,i,s),this.ia=Ce(),this.S=0,this.eB=!1,this.chart=t,this.Ji=t,this.category=n,this.subCategory=r,this._s=n,this.be=ce(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,o),this.Me=ce(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,o),this.onVisibleStateChanged((()=>{this.Ji.hB()})),this.onDispose((()=>{this.Ji.hB(),this.Ji.rB.delete(this)}))}setValue(t){return this.eB=!0,this.S=t,this.Ji.hB(),this.Ji.us.bs(),this.Ji.rB.delete(this),this}getValue(){return this.S}get value(){return this.S}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ji.hB(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ji.hB(),this}getStrokeStyle(){return this.Me}Dm(){return this.Lm}gg(t,e){return gh(t,this.Ji.engine.scale,this.Ji.xp(new Za,this.category,this.S,this).fc(),this,void 0)}solveNearestFromScreen(t){}setEffect(t){return this.Ji.setBarsEffect(t),this}}const xf=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),Sf=(t,e,i)=>{const s=t.jc.filter((t=>void 0!==t)),n=s.map((t=>i(t.sizePixels))).reduce(((t,e)=>Math.max(t,e)),1),r=Math.ceil(n/(e/s.length));return r<=1?s:s.filter(((t,e)=>e%r==0))};class bf extends Kh{constructor(t,i,s,n,r,o,a){var h;let l;super(t,i,s,i.sg("barChart bg",0),n,i.us.qi.barChartBackgroundFillStyle||i.us.qi.chartXYBackgroundFillStyle,i.us.qi.barChartBackgroundStrokeStyle||i.us.qi.chartXYBackgroundStrokeStyle,i.us.qi.barChartTitleFont||i.us.qi.chartXYTitleFont,i.us.qi.barChartTitleFillStyle||i.us.qi.chartXYTitleFillStyle,o),this.coordsBars="barChart",this.nB=vf.Descending,this.oB=this.qi.barChartCategoryLabels,this.KD=this.qi.barChartValueLabelsAfterBars,this.aB=!1,this.Gw=Ee(),this.lB=new Map,this.rB=new Map,this.JD="positive",this.uB="columns",this.cB=!0,this.dB=new Map,this.fB={speed:1},this.ep={speed:1},this.AB=.08,this.vp=e.AutoCursorModes.snapToClosest,this.xp=(t,e,i,s)=>{this.categoryAxis.getTitle().length>0&&t.addRow(this.categoryAxis.getTitle()),t.addRow({text:e,font:{weight:"bold"}}),this.valueAxis.getTitle().length>0&&t.addRow(this.valueAxis.getTitle());const n=[];return s.subCategory&&s.subCategory.length>0&&n.push(s.subCategory),n.push(this.valueAxis.formatValue(i)),t.addRow(...n),t},this.nn=(t,e,i,s,n)=>{this.$D.q(s,n)},this.fs.zn||this.fs.Vn||this.fs.Yn||this.us.As(St.atob("YmFyIGNoYXJ0")),this.Fs="horizontal"===(null==a?void 0:a.type)?Tf:Mf,this.ng.Bh("Bar Chart"),this.gB=i.wp("barChart plotting 1",0),this.pB=i.wp("barChart plotting 2",1),this.tB="logarithmic"===(null===(h=null==a?void 0:a.valueAxis)||void 0===h?void 0:h.type),this.tB?"horizontal"===this.Fs.mB?(l=s.d1({scale1DConstructor:Ii,dimension:"y"}),this.$D=(new zi).Ri(s.d1({scale1DConstructor:bi,dimension:"x"}),l)):(l=s.d1({scale1DConstructor:Ii,dimension:"x"}),this.$D=(new zi).Ri(l,s.d1({scale1DConstructor:bi,dimension:"y"}))):(this.$D=s.d2({scaleXYConstructor:Li}),l=this.Fs.getWidth(this.$D)),this.yB=this.es.gA(),this.Uw=new Lh((()=>this.Gw._t(this.gB.bv(this.$D).da(0))),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.bar),e.bar.Ss([i]),i})))),(()=>{this.Gw.Nt()}),(t=>{this.yB.ps(t)})),this.uy=this.zA.Te(this.$D).ke(this.qi.barChartSeriesBackgroundFillStyle||V).Ce(nt),this.Ay=this.zA.Te(this.$D).ke(V).Ce(this.qi.barChartSeriesBackgroundStrokeStyle||nt).setMouseInteractions(!1),super.ly(this.uy,this.Ay),this.categoryAxis=new pf(this,this.qi,!0!==(null==a?void 0:a.disableAnimations)&&!1!==(null==a?void 0:a.animationsEnabled),l,this.pB,this.es);const u=qo(null==a?void 0:a.valueAxis);this.valueAxis=new yf(this,this.qi,!0!==(null==a?void 0:a.disableAnimations)&&!1!==(null==a?void 0:a.animationsEnabled),this.Fs.getHeight(this.$D),this.pB,this.es,u.type),this.SB=new zh((()=>this.pB.kr(this.$D).tl(ke).Ka(ke).da(1))),this.vB=new Lh((()=>this.zA._A(this.$D).setMouseInteractions(!1)),((t,e,i)=>(t.Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>(i||t.Lr()).CA(e[0],e[1])))))),this.kp=i.Tp();const c=Dt(a?a.autoCursorBuilder:void 0,uh);this.Ag=c.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.onResize(this.nn),this.ig(r,this.$D),this.setAutoCursorMode(e.AutoCursorModes.onHover),this.setAnimationsEnabled(!0!==(null==a?void 0:a.disableAnimations)&&!1!==(null==a?void 0:a.animationsEnabled)),this.yy(((t,e)=>{Ha.mg(this,e)}))}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}setBarsMargin(t){return this.AB=kt(t,0,.49),this.aB=!0,this.us.bs(),this}getBarsMargin(){return this.AB}setBarsEffect(t){return this.yB.xs(t),this.us.bs(),this}getBarsEffect(){return this.yB.Ms()}setData(t){let e;if(this.iy.length>0&&(this.fs.Vn||this.fs.zn||this.fs.ho||this.us.As(St.atob("cmVhbC10aW1lIGRhdGE="))),Array.isArray(t))e=[],t.forEach(((t,i)=>{"string"==typeof t?e.push({category:t}):"number"==typeof t?e.push({category:`Category ${i+1}`,value:t}):"object"==typeof t&&e.push(t)}));else{e=[];const i=Object.keys(t);for(const s of i){const i=t[s];e.push({category:s,value:"number"==typeof i?i:void 0})}}return this.xB("columns",e),this}setDataStacked(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:n}=e;n.forEach(((e,n)=>{const r=t[n];i.push({category:r,subCategory:s,value:e})}))})),this.xB("stacks",i),this}setDataGrouped(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:n}=e;n.forEach(((e,n)=>{const r=t[n];i.push({category:r,subCategory:s,value:e})}))})),this.xB("groups",i),this}xB(t,e){this.uB=t,this.bB(e);const i=pe(e.map((t=>t.category))),s=i.length,n=pe(e.map((t=>t.subCategory))).filter((t=>void 0!==t));if(e.forEach((t=>{let e=this.iy.find((e=>e.category===t.category&&e.subCategory===t.subCategory));if(!e){const s=i.indexOf(t.category),r=n.includes(t.subCategory)?n.indexOf(t.subCategory):void 0;e=new Af(this,this.ey,this.qi,this.us.es,t.category,t.subCategory,Dt(r,s)),this.gy(e),this.dB.set(e,{category:s,valueStart:this.tB?1e-6:0,valueEnd:void 0!==t.value?t.value:0})}void 0!==t.value&&e.setValue(t.value)})),this.iy.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category&&e.subCategory===t.subCategory))&&(t.dispose(),this.dB.delete(t))})),this.categoryAxis.setInterval(this.Fs.getWidth({x:{start:-.5,end:s-.5},y:{start:s-.5,end:-.5}})),this.QD=0===this.iy.length?void 0:"stacks"!==t?this.iy.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:_e,max:Fe}):{min:0,max:i.reduce(((t,i)=>Math.max(t,e.reduce(((t,e)=>e.category!==i?t:void 0!==e.value?t+e.value:t),0))),0)},this.QD&&(this.JD=this.QD.min>=0?"positive":this.QD.max<=0?"negative":"bipolar",("bipolar"===this.JD||"negative"===this.JD)&&this.tB))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");this.bB(this.iy),this.lB.clear(),this.rB.clear(),this.aB=!0,this.us.bs()}setCategoryLabels(t){const e="function"==typeof t?this.oB?t(this.oB):this.oB:t;return this.oB=e?{...this.qi.barChartCategoryLabels,...e}:void 0,this.lB.clear(),this.us.bs(),this}getCategoryLabels(){return this.oB}setValueLabels(t){var e;const i="function"==typeof t?this.KD?t(this.KD):this.KD:t,s=(null==i?void 0:i.position)||(null===(e=this.KD)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.KD={...this.qi.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.KD={...this.qi.barChartValueLabelsInsideBars,...i}):this.KD=void 0,this.rB.clear(),this.us.bs(),this}getValueLabels(){return this.KD}setLabelFittingEnabled(t){return this.cB=t,this.us.bs(),this}getLabelFittingEnabled(){return this.cB}getBar(t,e){if(("groups"===this.uB||"stacks"===this.uB)&&void 0===e)throw new Error("LightningChart JS BarChart.getBar() | `subCategory` parameter is required for grouped and stacked bar charts!");const i=this.iy.find((i=>i.category===t&&(void 0===e||e===i.subCategory)));if(!i)throw new Error(`BarChart.getBar() no such bar: "${t}" ${e?`"${e}"`:""}`);return i}getBars(){return this.iy}setSorting(t){return this.nB=t,this.bB(this.iy),this.us.bs(),this}getSorting(){return this.nB}setAnimationCategoryPosition(t,e=1){return this.fB=t?{speed:e}:void 0,this.us.bs(),this}setAnimationValues(t,e=1){return this.ep=t?{speed:e}:void 0,this.us.bs(),this}translateCoordinate(t,e,i){if(i&&Oi(t)&&Bi(e))return super.translateCoordinate(t,e,i);const s=e;let n;if(Vi(t))n=this.us.$o(t);else if(Oi(t)){const e=ut(t,this.pixelScale,this.us.dt);n={engineX:e.x,engineY:e.y}}else{if(!xf(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=ut(this.Fs.toPoint(t.iCategory,t.value),this.$D,this.us.dt);n={engineX:e.x,engineY:e.y}}}if(Ri(s))return this.us.Xo(n);if("barChart"===s){const t=ut({x:n.engineX,y:n.engineY},this.us.dt,this.$D);return{iCategory:this.Fs.getWidth(t),value:this.Fs.getHeight(t)}}if(Bi(s))return ut({x:n.engineX,y:n.engineY},this.us.dt,this.pixelScale);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}Sd(){if("columns"===this.uB)return this.iy;const t=pe(ye(this.iy.map((t=>t.subCategory))));return ye(t.map((t=>{const e=this.iy.filter((e=>e.subCategory===t)),i=e[0];if(i)return(t=>{let e=!1;t.forEach((i=>i.onHighlight(((s,n)=>{e||(e=!0,t.forEach((t=>i!==t?t.setHighlight(n):void 0)),e=!1)})))),t.forEach((e=>e.onDispose((()=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)}))))})(e),{attach(s,n){return xe(s,e,{toggleVisibilityOnClick:!0,label:t,style:i.getFillStyle()}),this}}})))}Fe(t){var e,i;super.Fe(t);const s=this.SB.Xp(),n=this.vB.Xp(),r=this.iy.filter((t=>t.getVisible()&&t.eB)),o=pe(r.map((t=>t.category))),a=pe(ye(r.map((t=>t.subCategory)))),h=5e-4*t*((null===(e=this.fB)||void 0===e?void 0:e.speed)||0),l=.003*t*((null===(i=this.fB)||void 0===i?void 0:i.speed)||0),u=this.valueAxis.dt,c=u instanceof Ii?(t,e)=>{var i;return Jo(t,e,u,(null===(i=this.ep)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return Ko(t,e,u,(null===(i=this.ep)||void 0===i?void 0:i.speed)||0)};let d;"columns"===this.uB?d=r.map((t=>({bar:t,position:{category:o.indexOf(t.category),valueStart:this.tB?1e-6:0,valueEnd:t.value}}))):"groups"===this.uB?d=r.map((t=>{const e=o.indexOf(t.category),i=a.indexOf(t.subCategory),s=1/(a.length+2*(a.length+1)*this.AB),n=this.AB*s;return{bar:t,position:{category:e+(i-(a.length-1)/2)*(s+n),valueStart:this.tB?1e-6:0,valueEnd:t.value}}})):(d=[],o.forEach(((t,e)=>{const i=r.filter((e=>e.category===t));let s=this.tB?1e-6:0;i.forEach(((e,i)=>{d.push({bar:e,position:{category:o.indexOf(t),valueStart:s,valueEnd:s+e.value}}),s+=e.value}))}))),d.forEach((t=>{const{bar:e,position:i}=t;let s,n,r=this.dB.get(e);void 0===r&&(r=i);const o=i.valueStart;if(this.fB&&r.category!==i.category){const t=Math.sign(i.category-r.category);s=r.category+h*t+l*(i.category-r.category),t!==Math.sign(i.category-s)&&(s=i.category)}else s=i.category;if(this.ep&&r.valueEnd!==i.valueEnd){const t=Math.sign(i.valueEnd-r.valueEnd);n=c(r.valueEnd,i.valueEnd),t!==Math.sign(i.valueEnd-n)&&(n=i.valueEnd)}else n=i.valueEnd;this.dB.set(e,{category:s,valueStart:o,valueEnd:n}),s===i.category&&n===i.valueEnd||this.us.bs(!0),s===r.category&&n===r.valueEnd||(this.aB=!0)})),Wa.cg(this.ng,this.eg);const f=r.length>0;this.categoryAxis.vr(),this.valueAxis.vr();const g=this.categoryAxis.setVisible(f).Ds(),m=this.valueAxis.setVisible(f).Ds(n),{labelMarginBeforeCategoryAxisPixels:p}=f?this.MB(o,r,s,n):{labelMarginBeforeCategoryAxisPixels:0};this.categoryAxis.Fe(g,s,n,{labelMarginBeforeCategoryAxisPixels:p}),this.valueAxis.Fe(m);const y=this.categoryAxis.getThickness(),A=kt(g.nd+p,void 0!==y.min?y.min:0,void 0!==y.max?y.max:_e),x={x:Math.min(this.$D.x.getInnerStart(),this.$D.x.getInnerEnd()),y:Math.min(this.$D.y.getInnerStart(),this.$D.y.getInnerEnd())},S=Math.max(this.$D.x.getInnerStart(),this.$D.x.getInnerEnd()),b=Math.max(this.$D.y.getInnerStart(),this.$D.y.getInnerEnd()),v={x:S-x.x,y:b-x.y};this.uy.Ie(x),this.uy.q(v),this.Ay.Ie(x),this.Ay.q(v),super.tg(),Ha.dg(this,this.uy.getIsUnderMouse(),!1,this.iy,void 0,((t,e)=>t.gg(e,!0)));const M=Wa.ug(this.ng,this.eg);if(this.$D.Vi([this.Xt.bottom+this.Da.bottom+("vertical"===this.Fs.mB?A:0),this.Xt.top+this.Da.top+M+("horizontal"===this.Fs.mB?m.nd:0)]),this.$D.Ei([this.Xt.left+this.Da.left+this.Fs.getHeight({x:A,y:m.nd}),this.Xt.right+this.Da.right]),this.gB.ES({x:this.$D.x.ei(),y:this.$D.y.ei(),width:this.$D.x.ri(),height:this.$D.y.ri()}),this.LA&&this.LA(),this.aB){const t=this.Uw.Xp(),e="groups"===this.uB?1/(a.length+2*(a.length+1)*this.AB):1-2*this.AB;r.forEach((i=>{const s=this.dB.get(i);if(void 0===s)return;const n=s.category-.5*e,r=s.category+.5*e,o=[this.Fs.toPoint(n,s.valueStart),this.Fs.toPoint(n,s.valueEnd),this.Fs.toPoint(r,s.valueEnd),this.Fs.toPoint(r,s.valueStart)];t.add({ia:i.ia,vertices:o,bar:i},{fillStyle:i.be,strokeStyle:i.Me})})),t.finishPlot()}s.finishPlot(),n.finishPlot(),this.aB=!1}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationCategoryPosition(!1),this.setAnimationValues(!1),this.valueAxis.setAnimationsEnabled(!1),this.categoryAxis.setAnimationsEnabled(!1),this}solveNearest(t){}dispose(){return this.pB.W(),this.gB.W(),this.Ag.dispose(),this.kp.W(),super.dispose()}bB(t){const e=this.nB;e&&t.sort(((i,s)=>e({category:i.category,value:t.reduce(((t,e)=>t+(e.category===i.category&&e.value||0)),0)},{category:s.category,value:t.reduce(((t,e)=>t+(e.category===s.category&&e.value||0)),0)})))}MB(t,e,i,s){let n=0;const r=this.oB,o=this.KD,a=this.valueAxis.getInterval(),h=this.Fs.getWidth({x:this.$D.x.ri(),y:this.$D.y.ri()});if(r&&r.labelFillStyle!==V){const o=r.tickLength+r.labelMargin,l=this.Fs.toPoint(0,1),u={jc:t.map(((t,i)=>{const s=e.reduce(((e,i)=>i.category!==t?e:e+i.value),0),n=r.formatter(t,s);if(!n)return;const h=i;return void 0!==h?{text:n,position:this.Fs.toPoint(h,this.valueAxis.dt.pi(a.start,-o)),alignment:l,rotation:r.labelRotation,sizePixels:this._B(t,s)}:void 0})),hc:r.labelFont,dt:this.$D},c=u?this.cB?Sf(u,h,this.Fs.getWidth):u.jc:[];c.forEach((t=>{t&&i.add().Bh(t.text).Ie(t.position).Ja(t.alignment).zh(t.rotation).ke(r.labelFillStyle).Vh(r.labelFont)})),r.tickStyle!==nt&&0!==r.tickLength&&c.forEach((t=>{if(!t)return;const e=this.Fs.getWidth(t.position);s.add({positions:[this.Fs.toPoint(e,this.valueAxis.dt.getInnerStart()),this.Fs.toPoint(e,this.valueAxis.dt.pi(a.start,-r.tickLength))]},{lineStyle:r.tickStyle})})),n=c.reduce(((t,e)=>e?Math.max(t,this.Fs.getHeight(e.sizePixels)):t),0)+r.tickLength+r.labelMargin}if(o&&o.labelFillStyle!==V){let t;"after-bar"===o.position?t={jc:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.dB.get(t);return void 0!==s?{text:i,position:this.Fs.toPoint(s.category,this.valueAxis.dt.pi(s.valueEnd,o.labelMargin*Math.sign(s.valueEnd))),alignment:this.Fs.toPoint(0,-1*Math.sign(s.valueEnd)),rotation:o.labelRotation,sizePixels:this.wB(t)}:void 0})),hc:o.labelFont,dt:this.$D}:"inside-bar"!==o.position&&"inside-bar-start"!==o.position&&"inside-bar-centered"!==o.position&&"inside-bar-end"!==o.position||(t={jc:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.dB.get(t);if(void 0===s)return;const n="bipolar"===this.JD?Math.sign(s.valueEnd):"negative"===this.JD?-1:1,r=this.Fs.toPoint(0,"inside-bar"===o.position||"inside-bar-end"===o.position?1*n:"inside-bar-centered"===o.position?0:-1*n);return{text:i,position:this.Fs.toPoint(s.category,"inside-bar"===o.position||"inside-bar-end"===o.position?this.valueAxis.dt.pi(s.valueEnd,-o.labelMargin*n):"inside-bar-centered"===o.position?(s.valueStart+s.valueEnd)/2:this.valueAxis.dt.pi(s.valueStart,o.labelMargin*n)),alignment:r,rotation:o.labelRotation,sizePixels:this.wB(t)}})),hc:o.labelFont,dt:this.$D}),t&&(t?this.cB?Sf(t,h,this.Fs.getWidth):t.jc:[]).forEach((t=>{t&&i.add().Bh(t.text).Ie(t.position).Ja(t.alignment).zh(t.rotation).ke(o.labelFillStyle).Vh(o.labelFont).setMouseInteractions(!1)}))}return{labelMarginBeforeCategoryAxisPixels:n}}_B(t,e){if(!this.oB||this.oB.labelFillStyle===V)return{x:0,y:0};const i=this.lB.get(t);if(i)return i;const s=this.oB.formatter(t,e),n=this.us.kB.CB(s,this.oB.labelFont,this.oB.labelRotation);return n.isEstimate?this.us.bs(!0):this.lB.set(t,n),n}wB(t){if(!this.KD||this.KD.labelFillStyle===V)return{x:0,y:0};const e=this.rB.get(t);if(e)return e;const i=this.us.kB.CB(this.KD.formatter(t,t.category,t.value),this.KD.labelFont,this.KD.labelRotation);return i.isEstimate?this.us.bs(!0):this.rB.set(t,i),i}qD(){return this.iy.reduce(((t,e)=>{const i=this.wB(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}hB(){this.aB=!0,this.us.bs()}getMinimumSize(){return{x:200,y:200}}}const vf={Disabled:void 0,None:void 0,Ascending:(t,e)=>t.value-e.value,Descending:(t,e)=>e.value-t.value,Alphabetical:(t,e)=>t.category.localeCompare(e.category)},Mf={...ta,mB:"vertical",iB:-1,sB:1},Tf={...ea,mB:"horizontal",iB:1,sB:-1},wf=(t,e)=>e?t.x:t.y,Ef=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),kf=(t,e,i,s,n,r)=>{const o=e.length,a=Math.sign(s),h=[],l=e.reduce(((t,e)=>t+e));for(let t=1;t<=o-1;t+=1)h.push(wf(n,r)*e.slice(0,t).reduce(((t,e)=>t+e),0)/l);const u=h.map((t=>0));let c=h[i-1]+s;for(let e=i;e>0&&eEf(t,a,r,e))).reduce(((t,e)=>Math.max(t,wf(e.panel.getMinimumSize()||{x:0,y:0},r))),20),o=h[e-1];if(1===a&&c>wf(n,r)-s||-1===a&&c<0+s){u.fill(0);break}if(e!==i&&(1===a?o>c:oh[e]+t)),f=d.map(((t,e)=>(t-(e>0?d[e-1]:0))/wf(n,r)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class Cf{constructor(t,e,i,s,r){this.coordsRelative="relative",this.coordsClient="client",this.$i=!1,this.dP=new Array,this.D=new n.Eventer,this.TB=[],this.PA=[],this.FB=void 0,this.IB=!0,this.PB=!0,this.DB=!0,this.RA=!1,this.BB=!0,this.LB=()=>{this.BB=!0,this.us.bs()},this.RB=[],this.onInViewChange=t=>this.D.on("inViewChange",t),this.offInViewChange=t=>this.D.off(t,"inViewChange"),this.EB=t=>{for(let e=0;e{const e=this.TB.indexOf(t);e>=0&&this.TB.splice(e,1)},this.NA=t=>{const e=this.PA.indexOf(t);e>=0&&this.PA.splice(e,1)},this.zB=(t,e,i,s,n)=>{if(this.OB(e,i,s,n)){const r={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:n};return this.dP.push(r),this.NB(r),this.IB=!0,t}throw new ft("Out of dashboard range.")},this.GB=e.numberOfRows,this.WB=e.numberOfColumns,this.fs=t,this.UB=e,this.YB=s;const o=this.WB*this.GB;this.HB={x:new Nd(new Array(this.WB).fill(1)),y:new Nd(new Array(this.GB).fill(1))},this.qi=i.qi,this.$B=this.qi.dashboardSplitterStyle,this.th=!0!==(null==e?void 0:e.disableAnimations)&&!1!==(null==e?void 0:e.animationsEnabled),this.XB=Od(i,o),this.jB=i.nI("dashboard splitters",400001),this.Ab=()=>this.XB.rI(),this.$A=this.XB.oI(),this.es=i.es.hs(this,{ZB:{}}),this.es.ZB.xs(this.qi.effectsDashboardSplitters);const a=i.oi();this.uiScale=ht.d2({scaleXYConstructor:Li}).zi(0,100).Oi(0,100).q(a),this.pixelScale=ht.d2({scaleXYConstructor:Li}).zi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).q(a),this.QB=i.JB.bind(i),this.KB=i.qB.bind(i),this.tL=i.iL.bind(i),this.sL=i.eL.bind(i),this.So=i.So.bind(i),this.xo=i.xo.bind(i),this.engine=i.WA,this.us=i.UA,i.Go((()=>this.LB())),i.bs();const h=i.Yo((t=>{this.RA=t,this.D.emit("inViewChange",this,t)}));this.JA=i.Ho.bind(i,h),this.hL(),this.setAnimationsEnabled(this.th);const l=((t,e)=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.D);this.createChartXY=t=>{const e=Df(t,this.UB,this.th);return this.zB(new Pd(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=Df(t,this.UB,this.th);return this.zB(new hc(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=Df(t,this.UB,this.th);return this.zB(new pu(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=Df(t,this.UB,this.th),i=e&&e.type?e.type:Dh;return this.zB(new i(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=Df(t,this.UB,this.th),i=e&&e.type?e.type:Vu;return this.zB(new i(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=Df(t,this.UB,this.th),i=e&&e.type?e.type:Eu;return this.zB(new i(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=Df(t,this.UB,this.th),i=t&&t.type?t.type:Hu;return this.zB(new i(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=Df(t,this.UB,this.th);return this.zB(new Na(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=Df(t,this.UB,this.th);return this.zB(new ul(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=Df(t,this.UB,this.th);return this.zB(new dd(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=Df(t,this.UB,this.th);return this.zB(new Al(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=Df(t,this.UB,this.th),i=new hl(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l,e);return this.zB(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=Df(t,this.UB,this.th),i=new uf(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l);return this.zB(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=Df(t,this.UB,this.th),i=new bf(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l,e);return this.zB(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}rL(t,e){return t+e*this.WB}nL(t,e){return{d1:i=>new i.scale1DConstructor("x"===i.dimension?t.columnIndex:t.rowIndex,"x"===i.dimension?t.columnSpan:t.rowSpan,"x"===i.dimension?this.WB:this.GB,"x"===i.dimension?e.x:e.y),d2:i=>(new i.scaleXYConstructor).ot({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.WB,y:this.GB},e),d3:()=>new ot({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.WB,y:this.GB},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.QB(t[0]),this.KB(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.tL(t[0]),this.sL(t[1]),this}getWidth(){return this.So()}getHeight(){return this.xo()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.jB.bs(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.jB.bs(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.qi}setSplitterStyle(t){const e=this.$B;return this.$B="function"==typeof t?t(this.$B):t,this.oL(e),this}getSplitterStyle(){return this.$B}setSplitterEffect(t){return this.es.ZB.xs(t),this.us.bs(),this}getSplitterEffect(){return this.es.ZB.Ms()}setAnimationHighlight(t){return this.DB=t,this.RB.forEach((e=>this.us.ls.Cs(e.line,t))),this}getAnimationHighlight(){return this.DB}oL(t){for(const t of this.RB)t.line.Ee(this.$B);this.hL()}setColumnWidth(t,e){const i=this.HB.x._();return t>=0&&t=e.length)throw new ft("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.HB.y._();return t>=0&&t=e.length)throw new ft("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}onResize(t){return this.D.on("resize",t)}offResize(t){return this.D.off(t,"resize")}aL(t,e,i){if(i&&Math.abs(t.x)>0)this.lL(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.uL(e,t.y)}for(const t of this.dP)t.panel.Z();this.LB()}uL(t,e){const i=kf(this.dP,this.HB.y._(),t,e,this.pixelScale.oi(),!1);this.HB.y.M(i),this.LB()}lL(t,e){const i=kf(this.dP,this.HB.x._(),t,e,this.pixelScale.oi(),!0);this.HB.x.M(i),this.LB()}cL(){this.RB.forEach((t=>t.line.dispose())),this.RB.length=0;for(let t=1;t<=this.WB-1;t+=1)for(let e=0;e<=this.GB-1;e+=1)if(void 0!==this.dP.find((i=>Ge(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=Yi(new Xi((()=>{this.dL(t)}),((e,i,s,n,r)=>{this.aL(n,t,!0),jt(r)}),(()=>{this.fL(t)}))),s=this.jB.Ve(this.pixelScale).Ee(this.$B).setMouseEnterEventHandler((()=>{this.dL(t)})).setMouseLeaveEventHandler((()=>{this.fL(t)})).setMouseDragEventHandler(((e,i,s,n,r)=>{this.aL(r,t,!0),jt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.us.ls.os(s,(t=>s.cs(t)),{animationEnabled:this.DB}),this.RB.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.GB-1;t+=1)for(let e=0;e<=this.WB-1;e+=1)if(void 0!==this.dP.find((i=>Ge(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=Yi(new Xi((()=>{this.AL(t)}),((e,i,s,n,r)=>{this.aL(n,t,!1),jt(r)}),(()=>{this.gL(t)}))),s=this.jB.Ve(this.pixelScale).Ee(this.$B).setMouseEnterEventHandler((()=>{this.AL(t)})).setMouseLeaveEventHandler((()=>{this.gL(t)})).setMouseDragEventHandler(((e,i,s,n,r)=>{this.aL(r,t,!1),jt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.us.ls.os(s,(t=>s.cs(t)),{animationEnabled:this.DB}),this.RB.push({row:t,column:e,line:s,alignment:"horizontal"})}this.es.ZB.ps(this.RB.map((t=>t.line)))}pL(){const t=this.pixelScale.oi(),e=this.HB.x._(),i=e.reduce(((t,e)=>t+e)),s=this.HB.y._(),n=s.reduce(((t,e)=>t+e));this.RB.forEach((r=>{if("vertical"===r.alignment){const o=u(t.x*e.slice(0,r.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,r.row).reduce(((t,e)=>t+e),0)/n),a=u(o.x,t.y*s.slice(0,r.row+1).reduce(((t,e)=>t+e),0)/n);r.line.Oe(o).ze(a)}else{const o=u(t.x*e.slice(0,r.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,r.row).reduce(((t,e)=>t+e),0)/n),a=u(t.x*e.slice(0,r.column+1).reduce(((t,e)=>t+e),0)/i,o.y);r.line.Oe(o).ze(a)}}))}dL(t){this.RB.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.us.ls.ws(e.line,1),this.jB.mL(e.line))})),this.FB=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.us.bs()}AL(t){this.RB.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.us.ls.ws(e.line,1),this.jB.mL(e.line))})),this.FB=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.us.bs()}fL(t){this.RB.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.us.ls.ws(e.line,0)})),this.engine.restoreMouseStyle(this.FB),this.us.bs()}gL(t){this.RB.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.us.ls.ws(e.line,0)})),this.engine.restoreMouseStyle(this.FB),this.us.bs()}setAnimationsEnabled(t){return this.th=t,this.getCells().filter((t=>t.panel instanceof Ga)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.th),this}getAnimationsEnabled(){return this.th}getCells(){return this.dP.slice()}dispose(){return this.$i||(this.JA&&this.JA(),this.dP.slice().forEach((t=>t.panel.dispose())),this.TB.slice().forEach((t=>t.dispose())),this.PA.slice().forEach((t=>t.dispose())),this.$i=!0,this.YB(),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}getIsInView(){return this.RA}saveToFile(t,e,i){return za(this.engine,t,e,i),this}yL(t){if(this.BB){const t=this.us.dt.oi(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=this.uiScale.getInnerIntervalPixels();this.pixelScale.zi(0,s.x).Oi(0,s.y),this.D.emit("resize",this,s.x,s.y,e,i),this.PB=!0}this.IB&&(this.cL(),this.IB=!1,this.PB=!0),this.PB&&(this.pL(),this.PB=!1);for(const e of this.dP)e.panel.Fe(t);return this.TB.forEach((t=>t.Ds())),this.TB.forEach((t=>t.Fe())),this.PA.forEach((t=>t.Ds())),this.PA.forEach((t=>t.Fe())),this.BB=!1,this}j(){for(const t of this.dP)t.panel.j();return this.pixelScale.x.j(),this.pixelScale.y.j(),this.uiScale.x.j(),this.uiScale.y.j(),this}Z(){for(const t of this.dP)t.panel.Z();return this.pixelScale.x.Z(),this.pixelScale.y.Z(),this.uiScale.x.Z(),this.uiScale.y.Z(),this}translateCoordinate(t,e,i){return Va(t,e,i,this.pixelScale,this.us)}addUIElement(t=Eo,e=this.uiScale){e=Ra(e,this.pixelScale);const i=Pa(t,this.Ab(),this.uiScale,e,this.VB,this.qi);return this.TB.push(i),i}addLegendBox(t=Bo,i=this.uiScale){i=Ra(i,this.pixelScale);const s=Pa(t,this.$A,this.uiScale,i,this.NA,this.qi);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.PA.push(s),s}getLegendBoxes(){return this.PA}OB(t,e,i,s){return e>=0&&t>=0&&e+s<=this.GB&&t+i<=this.WB}NB(t){const e=this.$B,i=e===nt?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Ka(s)}hL(){this.uiScale.x.si([0,0]),this.uiScale.y.si([0,0]),this.pixelScale.x.si([0,0]),this.pixelScale.y.si([0,0]);for(const t of this.dP)this.NB(t);this.us.bs()}}const Df=(t,e,i)=>{const s={...t,columnSpan:t.columnSpan||1,rowSpan:t.rowSpan||1,animationsEnabled:void 0!==t.disableAnimations?!t.disableAnimations:void 0!==t.animationsEnabled?t.animationsEnabled:i};var n,r;return s.rowIndex=(n=s.rowIndex,r=s.rowSpan,e.numberOfRows-(n+r)),s},If={None:Cr,Rectangle:ro,Circle:oo,Diamond:ao,Pointer:ho},_f={ChartMarkerXY:Kl,SeriesMarkerXY:Zl},Ff={XY:Jl,Spider:lh,BarChart:uh,Map:fh,Polar:lh},Lf={Angola:{name:"Angola",ISO_A3:"AGO"},Burundi:{name:"Burundi",ISO_A3:"BDI"},Benin:{name:"Benin",ISO_A3:"BEN"},"Burkina Faso":{name:"Burkina Faso",ISO_A3:"BFA"},Botswana:{name:"Botswana",ISO_A3:"BWA"},"Central African Republic":{name:"Central African Republic",ISO_A3:"CAF"},"Ivory Coast":{name:"Ivory Coast",ISO_A3:"CIV"},Cameroon:{name:"Cameroon",ISO_A3:"CMR"},"Democratic Republic of the Congo":{name:"Democratic Republic of the Congo",ISO_A3:"COD"},"Republic of Congo":{name:"Republic of Congo",ISO_A3:"COG"},Comoros:{name:"Comoros",ISO_A3:"COM"},"Cape Verde":{name:"Cape Verde",ISO_A3:"CPV"},Djibouti:{name:"Djibouti",ISO_A3:"DJI"},Algeria:{name:"Algeria",ISO_A3:"DZA"},Egypt:{name:"Egypt",ISO_A3:"EGY"},Eritrea:{name:"Eritrea",ISO_A3:"ERI"},Ethiopia:{name:"Ethiopia",ISO_A3:"ETH"},Gabon:{name:"Gabon",ISO_A3:"GAB"},Ghana:{name:"Ghana",ISO_A3:"GHA"},Guinea:{name:"Guinea",ISO_A3:"GIN"},Gambia:{name:"Gambia",ISO_A3:"GMB"},"Guinea Bissau":{name:"Guinea Bissau",ISO_A3:"GNB"},"Equatorial Guinea":{name:"Equatorial Guinea",ISO_A3:"GNQ"},Israel:{name:"Israel",ISO_A3:"ISR"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Kenya:{name:"Kenya",ISO_A3:"KEN"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},Liberia:{name:"Liberia",ISO_A3:"LBR"},Libya:{name:"Libya",ISO_A3:"LBY"},Lesotho:{name:"Lesotho",ISO_A3:"LSO"},Morocco:{name:"Morocco",ISO_A3:"MAR"},Madagascar:{name:"Madagascar",ISO_A3:"MDG"},Mali:{name:"Mali",ISO_A3:"MLI"},Malta:{name:"Malta",ISO_A3:"MLT"},Mozambique:{name:"Mozambique",ISO_A3:"MOZ"},Mauritania:{name:"Mauritania",ISO_A3:"MRT"},Mauritius:{name:"Mauritius",ISO_A3:"MUS"},Malawi:{name:"Malawi",ISO_A3:"MWI"},Namibia:{name:"Namibia",ISO_A3:"NAM"},Niger:{name:"Niger",ISO_A3:"NER"},Nigeria:{name:"Nigeria",ISO_A3:"NGA"},Oman:{name:"Oman",ISO_A3:"OMN"},Rwanda:{name:"Rwanda",ISO_A3:"RWA"},"Western Sahara":{name:"Western Sahara",ISO_A3:"ESH"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Sudan:{name:"Sudan",ISO_A3:"SDN"},"South Sudan":{name:"South Sudan",ISO_A3:"SSD"},Senegal:{name:"Senegal",ISO_A3:"SEN"},"Saint Helena":{name:"Saint Helena",ISO_A3:"SHN"},"Sierra Leone":{name:"Sierra Leone",ISO_A3:"SLE"},Somalia:{name:"Somalia",ISO_A3:"SOM"},Swaziland:{name:"Swaziland",ISO_A3:"SWZ"},Seychelles:{name:"Seychelles",ISO_A3:"SYC"},Syria:{name:"Syria",ISO_A3:"SYR"},Chad:{name:"Chad",ISO_A3:"TCD"},Togo:{name:"Togo",ISO_A3:"TGO"},Tunisia:{name:"Tunisia",ISO_A3:"TUN"},"United Republic of Tanzania":{name:"United Republic of Tanzania",ISO_A3:"TZA"},Uganda:{name:"Uganda",ISO_A3:"UGA"},Yemen:{name:"Yemen",ISO_A3:"YEM"},"South Africa":{name:"South Africa",ISO_A3:"ZAF"},Zambia:{name:"Zambia",ISO_A3:"ZMB"},Zimbabwe:{name:"Zimbabwe",ISO_A3:"ZWE"}},zf={Afghanistan:{name:"Afghanistan",ISO_A3:"AFG"},"United Arab Emirates":{name:"United Arab Emirates",ISO_A3:"ARE"},Armenia:{name:"Armenia",ISO_A3:"ARM"},Australia:{name:"Australia",ISO_A3:"AUS"},Azerbaijan:{name:"Azerbaijan",ISO_A3:"AZE"},Bangladesh:{name:"Bangladesh",ISO_A3:"BGD"},Bahrain:{name:"Bahrain",ISO_A3:"BHR"},Brunei:{name:"Brunei",ISO_A3:"BRN"},Bhutan:{name:"Bhutan",ISO_A3:"BTN"},China:{name:"China",ISO_A3:"CHN"},Georgia:{name:"Georgia",ISO_A3:"GEO"},Indonesia:{name:"Indonesia",ISO_A3:"IDN"},India:{name:"India",ISO_A3:"IND"},Iran:{name:"Iran",ISO_A3:"IRN"},Iraq:{name:"Iraq",ISO_A3:"IRQ"},Israel:{name:"Israel",ISO_A3:"ISR"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Japan:{name:"Japan",ISO_A3:"JPN"},Kazakhstan:{name:"Kazakhstan",ISO_A3:"KAZ"},Kyrgyzstan:{name:"Kyrgyzstan",ISO_A3:"KGZ"},Cambodia:{name:"Cambodia",ISO_A3:"KHM"},"South Korea":{name:"South Korea",ISO_A3:"KOR"},Kuwait:{name:"Kuwait",ISO_A3:"KWT"},Laos:{name:"Laos",ISO_A3:"LAO"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},"Sri Lanka":{name:"Sri Lanka",ISO_A3:"LKA"},Maldives:{name:"Maldives",ISO_A3:"MDV"},Myanmar:{name:"Myanmar",ISO_A3:"MMR"},Mongolia:{name:"Mongolia",ISO_A3:"MNG"},Malaysia:{name:"Malaysia",ISO_A3:"MYS"},Nepal:{name:"Nepal",ISO_A3:"NPL"},Oman:{name:"Oman",ISO_A3:"OMN"},Pakistan:{name:"Pakistan",ISO_A3:"PAK"},Philippines:{name:"Philippines",ISO_A3:"PHL"},"Papua New Guinea":{name:"Papua New Guinea",ISO_A3:"PNG"},"North Korea":{name:"North Korea",ISO_A3:"PRK"},Palestine:{name:"Palestine",ISO_A3:"PSE"},Qatar:{name:"Qatar",ISO_A3:"QAT"},Russia:{name:"Russia",ISO_A3:"RUS"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Singapore:{name:"Singapore",ISO_A3:"SGP"},Syria:{name:"Syria",ISO_A3:"SYR"},Thailand:{name:"Thailand",ISO_A3:"THA"},Tajikistan:{name:"Tajikistan",ISO_A3:"TJK"},Turkmenistan:{name:"Turkmenistan",ISO_A3:"TKM"},Turkey:{name:"Turkey",ISO_A3:"TUR"},Taiwan:{name:"Taiwan",ISO_A3:"TWN"},Uzbekistan:{name:"Uzbekistan",ISO_A3:"UZB"},Vietnam:{name:"Vietnam",ISO_A3:"VNM"},Yemen:{name:"Yemen",ISO_A3:"YEM"}},Pf={"New South Wales":{name:"New South Wales"},Victoria:{name:"Victoria"},Queensland:{name:"Queensland"},"South Australia":{name:"South Australia"},"Western Australia":{name:"Western Australia"},Tasmania:{name:"Tasmania"},"Northern Territory":{name:"Northern Territory"},"Australian Capital Territory":{name:"Australian Capital Territory"},"Other Territories":{name:"Other Territories"}},Rf={"British Columbia":{name:"British Columbia"},Quebec:{name:"Quebec"},Nunavut:{name:"Nunavut"},"Prince Edward Island":{name:"Prince Edward Island"},Saskatchewan:{name:"Saskatchewan"},Yukon:{name:"Yukon"},Manitoba:{name:"Manitoba"},Ontario:{name:"Ontario"},"New Brunswick":{name:"New Brunswick"},"Northwest Territories":{name:"Northwest Territories"},Alberta:{name:"Alberta"},"Newfoundland and Labrador":{name:"Newfoundland and Labrador"},"Nova Scotia":{name:"Nova Scotia"}},Vf={Albania:{name:"Albania",ISO_A3:"ALB"},Austria:{name:"Austria",ISO_A3:"AUT"},Belarus:{name:"Belarus",ISO_A3:"BLR"},Belgium:{name:"Belgium",ISO_A3:"BEL"},Bulgaria:{name:"Bulgaria",ISO_A3:"BGR"},"Bosnia and Herzegovina":{name:"Bosnia and Herzegovina",ISO_A3:"BIH"},Switzerland:{name:"Switzerland",ISO_A3:"CHE"},Cyprus:{name:"Cyprus",ISO_A3:"CYP"},"Czech Republic":{name:"Czech Republic",ISO_A3:"CZE"},Germany:{name:"Germany",ISO_A3:"DEU"},Denmark:{name:"Denmark",ISO_A3:"DNK"},Spain:{name:"Spain",ISO_A3:"ESP"},Estonia:{name:"Estonia",ISO_A3:"EST"},Finland:{name:"Finland",ISO_A3:"FIN"},France:{name:"France",ISO_A3:"FRA"},"United Kingdom":{name:"United Kingdom",ISO_A3:"GBR"},Greece:{name:"Greece",ISO_A3:"GRC"},Croatia:{name:"Croatia",ISO_A3:"HRV"},Hungary:{name:"Hungary",ISO_A3:"HUN"},Ireland:{name:"Ireland",ISO_A3:"IRL"},Iceland:{name:"Iceland",ISO_A3:"ISL"},Italy:{name:"Italy",ISO_A3:"ITA"},Kosovo:{name:"Kosovo",ISO_A3:"-99"},Lithuania:{name:"Lithuania",ISO_A3:"LTU"},Luxembourg:{name:"Luxembourg",ISO_A3:"LUX"},Latvia:{name:"Latvia",ISO_A3:"LVA"},Macedonia:{name:"Macedonia",ISO_A3:"MKD"},Malta:{name:"Malta",ISO_A3:"MLT"},Montenegro:{name:"Montenegro",ISO_A3:"MNE"},Netherlands:{name:"Netherlands",ISO_A3:"NLD"},Norway:{name:"Norway",ISO_A3:"NOR"},Poland:{name:"Poland",ISO_A3:"POL"},Portugal:{name:"Portugal",ISO_A3:"PRT"},Romania:{name:"Romania",ISO_A3:"ROU"},"Republic of Serbia":{name:"Republic of Serbia",ISO_A3:"SRB"},Slovakia:{name:"Slovakia",ISO_A3:"SVK"},Slovenia:{name:"Slovenia",ISO_A3:"SVN"},Sweden:{name:"Sweden",ISO_A3:"SWE"},Ukraine:{name:"Ukraine",ISO_A3:"UKR"},Moldova:{name:"Moldova",ISO_A3:"MDA"},Russia:{name:"Russia",ISO_A3:"RUS"},Turkey:{name:"Turkey",ISO_A3:"TUR"}},Bf={Aruba:{name:"Aruba",ISO_A3:"ABW"},Afghanistan:{name:"Afghanistan",ISO_A3:"AFG"},Angola:{name:"Angola",ISO_A3:"AGO"},Anguilla:{name:"Anguilla",ISO_A3:"AIA"},Albania:{name:"Albania",ISO_A3:"ALB"},Aland:{name:"Aland",ISO_A3:"ALA"},Andorra:{name:"Andorra",ISO_A3:"AND"},"United Arab Emirates":{name:"United Arab Emirates",ISO_A3:"ARE"},Argentina:{name:"Argentina",ISO_A3:"ARG"},Armenia:{name:"Armenia",ISO_A3:"ARM"},"American Samoa":{name:"American Samoa",ISO_A3:"ASM"},Antarctica:{name:"Antarctica",ISO_A3:"ATA"},"French Southern and Antarctic Lands":{name:"French Southern and Antarctic Lands",ISO_A3:"ATF"},"Antigua and Barbuda":{name:"Antigua and Barbuda",ISO_A3:"ATG"},Australia:{name:"Australia",ISO_A3:"AUS"},Austria:{name:"Austria",ISO_A3:"AUT"},Azerbaijan:{name:"Azerbaijan",ISO_A3:"AZE"},Burundi:{name:"Burundi",ISO_A3:"BDI"},Belgium:{name:"Belgium",ISO_A3:"BEL"},Benin:{name:"Benin",ISO_A3:"BEN"},"Burkina Faso":{name:"Burkina Faso",ISO_A3:"BFA"},Bangladesh:{name:"Bangladesh",ISO_A3:"BGD"},Bulgaria:{name:"Bulgaria",ISO_A3:"BGR"},Bahrain:{name:"Bahrain",ISO_A3:"BHR"},"The Bahamas":{name:"The Bahamas",ISO_A3:"BHS"},"Bosnia and Herzegovina":{name:"Bosnia and Herzegovina",ISO_A3:"BIH"},Belarus:{name:"Belarus",ISO_A3:"BLR"},Belize:{name:"Belize",ISO_A3:"BLZ"},Bermuda:{name:"Bermuda",ISO_A3:"BMU"},Bolivia:{name:"Bolivia",ISO_A3:"BOL"},Brazil:{name:"Brazil",ISO_A3:"BRA"},Barbados:{name:"Barbados",ISO_A3:"BRB"},Brunei:{name:"Brunei",ISO_A3:"BRN"},Bhutan:{name:"Bhutan",ISO_A3:"BTN"},Botswana:{name:"Botswana",ISO_A3:"BWA"},"Central African Republic":{name:"Central African Republic",ISO_A3:"CAF"},Canada:{name:"Canada",ISO_A3:"CAN"},Switzerland:{name:"Switzerland",ISO_A3:"CHE"},Chile:{name:"Chile",ISO_A3:"CHL"},China:{name:"China",ISO_A3:"CHN"},"Ivory Coast":{name:"Ivory Coast",ISO_A3:"CIV"},Cameroon:{name:"Cameroon",ISO_A3:"CMR"},"Cyprus No Mans Area":{name:"Cyprus No Mans Area",ISO_A3:"-99"},"Democratic Republic of the Congo":{name:"Democratic Republic of the Congo",ISO_A3:"COD"},"Republic of Congo":{name:"Republic of Congo",ISO_A3:"COG"},"Cook Islands":{name:"Cook Islands",ISO_A3:"COK"},Colombia:{name:"Colombia",ISO_A3:"COL"},Comoros:{name:"Comoros",ISO_A3:"COM"},"Cape Verde":{name:"Cape Verde",ISO_A3:"CPV"},"Costa Rica":{name:"Costa Rica",ISO_A3:"CRI"},Cuba:{name:"Cuba",ISO_A3:"CUB"},Curaçao:{name:"Curaçao",ISO_A3:"CUW"},"Cayman Islands":{name:"Cayman Islands",ISO_A3:"CYM"},"Northern Cyprus":{name:"Northern Cyprus",ISO_A3:"-99"},Cyprus:{name:"Cyprus",ISO_A3:"CYP"},"Czech Republic":{name:"Czech Republic",ISO_A3:"CZE"},Germany:{name:"Germany",ISO_A3:"DEU"},Djibouti:{name:"Djibouti",ISO_A3:"DJI"},Dominica:{name:"Dominica",ISO_A3:"DMA"},Denmark:{name:"Denmark",ISO_A3:"DNK"},"Dominican Republic":{name:"Dominican Republic",ISO_A3:"DOM"},Algeria:{name:"Algeria",ISO_A3:"DZA"},Ecuador:{name:"Ecuador",ISO_A3:"ECU"},Egypt:{name:"Egypt",ISO_A3:"EGY"},Eritrea:{name:"Eritrea",ISO_A3:"ERI"},"Dhekelia Sovereign Base Area":{name:"Dhekelia Sovereign Base Area",ISO_A3:"-99"},Spain:{name:"Spain",ISO_A3:"ESP"},Estonia:{name:"Estonia",ISO_A3:"EST"},Ethiopia:{name:"Ethiopia",ISO_A3:"ETH"},Finland:{name:"Finland",ISO_A3:"FIN"},Fiji:{name:"Fiji",ISO_A3:"FJI"},"Falkland Islands":{name:"Falkland Islands",ISO_A3:"FLK"},France:{name:"France",ISO_A3:"FRA"},"Faroe Islands":{name:"Faroe Islands",ISO_A3:"FRO"},"Federated States of Micronesia":{name:"Federated States of Micronesia",ISO_A3:"FSM"},Gabon:{name:"Gabon",ISO_A3:"GAB"},"United Kingdom":{name:"United Kingdom",ISO_A3:"GBR"},Georgia:{name:"Georgia",ISO_A3:"GEO"},Guernsey:{name:"Guernsey",ISO_A3:"GGY"},Ghana:{name:"Ghana",ISO_A3:"GHA"},Guinea:{name:"Guinea",ISO_A3:"GIN"},Gambia:{name:"Gambia",ISO_A3:"GMB"},"Guinea Bissau":{name:"Guinea Bissau",ISO_A3:"GNB"},"Equatorial Guinea":{name:"Equatorial Guinea",ISO_A3:"GNQ"},Greece:{name:"Greece",ISO_A3:"GRC"},Grenada:{name:"Grenada",ISO_A3:"GRD"},Greenland:{name:"Greenland",ISO_A3:"GRL"},Guatemala:{name:"Guatemala",ISO_A3:"GTM"},Guam:{name:"Guam",ISO_A3:"GUM"},Guyana:{name:"Guyana",ISO_A3:"GUY"},"Hong Kong S.A.R.":{name:"Hong Kong S.A.R.",ISO_A3:"HKG"},"Heard Island and McDonald Islands":{name:"Heard Island and McDonald Islands",ISO_A3:"HMD"},Honduras:{name:"Honduras",ISO_A3:"HND"},Croatia:{name:"Croatia",ISO_A3:"HRV"},Haiti:{name:"Haiti",ISO_A3:"HTI"},Hungary:{name:"Hungary",ISO_A3:"HUN"},Indonesia:{name:"Indonesia",ISO_A3:"IDN"},"Isle of Man":{name:"Isle of Man",ISO_A3:"IMN"},India:{name:"India",ISO_A3:"IND"},"Indian Ocean Territories":{name:"Indian Ocean Territories",ISO_A3:"-99"},"British Indian Ocean Territory":{name:"British Indian Ocean Territory",ISO_A3:"IOT"},Ireland:{name:"Ireland",ISO_A3:"IRL"},Iran:{name:"Iran",ISO_A3:"IRN"},Iraq:{name:"Iraq",ISO_A3:"IRQ"},Iceland:{name:"Iceland",ISO_A3:"ISL"},Israel:{name:"Israel",ISO_A3:"ISR"},Italy:{name:"Italy",ISO_A3:"ITA"},Jamaica:{name:"Jamaica",ISO_A3:"JAM"},Jersey:{name:"Jersey",ISO_A3:"JEY"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Japan:{name:"Japan",ISO_A3:"JPN"},"Baykonur Cosmodrome":{name:"Baykonur Cosmodrome",ISO_A3:"-99"},"Siachen Glacier":{name:"Siachen Glacier",ISO_A3:"-99"},Kazakhstan:{name:"Kazakhstan",ISO_A3:"KAZ"},Kenya:{name:"Kenya",ISO_A3:"KEN"},Kyrgyzstan:{name:"Kyrgyzstan",ISO_A3:"KGZ"},Cambodia:{name:"Cambodia",ISO_A3:"KHM"},Kiribati:{name:"Kiribati",ISO_A3:"KIR"},"Saint Kitts and Nevis":{name:"Saint Kitts and Nevis",ISO_A3:"KNA"},"South Korea":{name:"South Korea",ISO_A3:"KOR"},Kosovo:{name:"Kosovo",ISO_A3:"-99"},Kuwait:{name:"Kuwait",ISO_A3:"KWT"},Laos:{name:"Laos",ISO_A3:"LAO"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},Liberia:{name:"Liberia",ISO_A3:"LBR"},Libya:{name:"Libya",ISO_A3:"LBY"},"Saint Lucia":{name:"Saint Lucia",ISO_A3:"LCA"},Liechtenstein:{name:"Liechtenstein",ISO_A3:"LIE"},"Sri Lanka":{name:"Sri Lanka",ISO_A3:"LKA"},Lesotho:{name:"Lesotho",ISO_A3:"LSO"},Lithuania:{name:"Lithuania",ISO_A3:"LTU"},Luxembourg:{name:"Luxembourg",ISO_A3:"LUX"},Latvia:{name:"Latvia",ISO_A3:"LVA"},"Macao S.A.R":{name:"Macao S.A.R",ISO_A3:"MAC"},"Saint Martin":{name:"Saint Martin",ISO_A3:"MAF"},Morocco:{name:"Morocco",ISO_A3:"MAR"},Moldova:{name:"Moldova",ISO_A3:"MDA"},Madagascar:{name:"Madagascar",ISO_A3:"MDG"},Maldives:{name:"Maldives",ISO_A3:"MDV"},Mexico:{name:"Mexico",ISO_A3:"MEX"},"Marshall Islands":{name:"Marshall Islands",ISO_A3:"MHL"},Macedonia:{name:"Macedonia",ISO_A3:"MKD"},Mali:{name:"Mali",ISO_A3:"MLI"},Malta:{name:"Malta",ISO_A3:"MLT"},Myanmar:{name:"Myanmar",ISO_A3:"MMR"},Montenegro:{name:"Montenegro",ISO_A3:"MNE"},Mongolia:{name:"Mongolia",ISO_A3:"MNG"},"Northern Mariana Islands":{name:"Northern Mariana Islands",ISO_A3:"MNP"},Mozambique:{name:"Mozambique",ISO_A3:"MOZ"},Mauritania:{name:"Mauritania",ISO_A3:"MRT"},Montserrat:{name:"Montserrat",ISO_A3:"MSR"},Mauritius:{name:"Mauritius",ISO_A3:"MUS"},Malawi:{name:"Malawi",ISO_A3:"MWI"},Malaysia:{name:"Malaysia",ISO_A3:"MYS"},Namibia:{name:"Namibia",ISO_A3:"NAM"},"New Caledonia":{name:"New Caledonia",ISO_A3:"NCL"},Niger:{name:"Niger",ISO_A3:"NER"},Nigeria:{name:"Nigeria",ISO_A3:"NGA"},Nicaragua:{name:"Nicaragua",ISO_A3:"NIC"},Niue:{name:"Niue",ISO_A3:"NIU"},Netherlands:{name:"Netherlands",ISO_A3:"NLD"},Norway:{name:"Norway",ISO_A3:"NOR"},Nepal:{name:"Nepal",ISO_A3:"NPL"},"New Zealand":{name:"New Zealand",ISO_A3:"NZL"},Oman:{name:"Oman",ISO_A3:"OMN"},Pakistan:{name:"Pakistan",ISO_A3:"PAK"},Panama:{name:"Panama",ISO_A3:"PAN"},"Pitcairn Islands":{name:"Pitcairn Islands",ISO_A3:"PCN"},Peru:{name:"Peru",ISO_A3:"PER"},"Spratly Islands":{name:"Spratly Islands",ISO_A3:"-99"},Philippines:{name:"Philippines",ISO_A3:"PHL"},Palau:{name:"Palau",ISO_A3:"PLW"},"Papua New Guinea":{name:"Papua New Guinea",ISO_A3:"PNG"},Poland:{name:"Poland",ISO_A3:"POL"},"Puerto Rico":{name:"Puerto Rico",ISO_A3:"PRI"},"North Korea":{name:"North Korea",ISO_A3:"PRK"},Portugal:{name:"Portugal",ISO_A3:"PRT"},Paraguay:{name:"Paraguay",ISO_A3:"PRY"},Palestine:{name:"Palestine",ISO_A3:"PSE"},"French Polynesia":{name:"French Polynesia",ISO_A3:"PYF"},Qatar:{name:"Qatar",ISO_A3:"QAT"},Romania:{name:"Romania",ISO_A3:"ROU"},Russia:{name:"Russia",ISO_A3:"RUS"},Rwanda:{name:"Rwanda",ISO_A3:"RWA"},"Western Sahara":{name:"Western Sahara",ISO_A3:"ESH"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Sudan:{name:"Sudan",ISO_A3:"SDN"},"South Sudan":{name:"South Sudan",ISO_A3:"SSD"},Senegal:{name:"Senegal",ISO_A3:"SEN"},Singapore:{name:"Singapore",ISO_A3:"SGP"},"South Georgia and South Sandwich Islands":{name:"South Georgia and South Sandwich Islands",ISO_A3:"SGS"},"Saint Helena":{name:"Saint Helena",ISO_A3:"SHN"},"Solomon Islands":{name:"Solomon Islands",ISO_A3:"SLB"},"Sierra Leone":{name:"Sierra Leone",ISO_A3:"SLE"},"El Salvador":{name:"El Salvador",ISO_A3:"SLV"},Somalia:{name:"Somalia",ISO_A3:"SOM"},"Saint Pierre and Miquelon":{name:"Saint Pierre and Miquelon",ISO_A3:"SPM"},"Republic of Serbia":{name:"Republic of Serbia",ISO_A3:"SRB"},"Sao Tome and Principe":{name:"Sao Tome and Principe",ISO_A3:"STP"},Suriname:{name:"Suriname",ISO_A3:"SUR"},Slovakia:{name:"Slovakia",ISO_A3:"SVK"},Slovenia:{name:"Slovenia",ISO_A3:"SVN"},Sweden:{name:"Sweden",ISO_A3:"SWE"},Swaziland:{name:"Swaziland",ISO_A3:"SWZ"},Seychelles:{name:"Seychelles",ISO_A3:"SYC"},Syria:{name:"Syria",ISO_A3:"SYR"},"Turks and Caicos Islands":{name:"Turks and Caicos Islands",ISO_A3:"TCA"},Chad:{name:"Chad",ISO_A3:"TCD"},Togo:{name:"Togo",ISO_A3:"TGO"},Thailand:{name:"Thailand",ISO_A3:"THA"},Tajikistan:{name:"Tajikistan",ISO_A3:"TJK"},Turkmenistan:{name:"Turkmenistan",ISO_A3:"TKM"},"East Timor":{name:"East Timor",ISO_A3:"TLS"},Tonga:{name:"Tonga",ISO_A3:"TON"},"Trinidad and Tobago":{name:"Trinidad and Tobago",ISO_A3:"TTO"},Tunisia:{name:"Tunisia",ISO_A3:"TUN"},Turkey:{name:"Turkey",ISO_A3:"TUR"},Tuvalu:{name:"Tuvalu",ISO_A3:"TUV"},Taiwan:{name:"Taiwan",ISO_A3:"TWN"},"United Republic of Tanzania":{name:"United Republic of Tanzania",ISO_A3:"TZA"},Uganda:{name:"Uganda",ISO_A3:"UGA"},Ukraine:{name:"Ukraine",ISO_A3:"UKR"},"United States Minor Outlying Islands":{name:"United States Minor Outlying Islands",ISO_A3:"UMI"},Uruguay:{name:"Uruguay",ISO_A3:"URY"},"United States of America":{name:"United States of America",ISO_A3:"USA"},"US Naval Base Guantanamo Bay":{name:"US Naval Base Guantanamo Bay",ISO_A3:"-99"},Uzbekistan:{name:"Uzbekistan",ISO_A3:"UZB"},"Saint Vincent and the Grenadines":{name:"Saint Vincent and the Grenadines",ISO_A3:"VCT"},Venezuela:{name:"Venezuela",ISO_A3:"VEN"},"British Virgin Islands":{name:"British Virgin Islands",ISO_A3:"VGB"},"United States Virgin Islands":{name:"United States Virgin Islands",ISO_A3:"VIR"},Vietnam:{name:"Vietnam",ISO_A3:"VNM"},Vanuatu:{name:"Vanuatu",ISO_A3:"VUT"},"Wallis and Futuna":{name:"Wallis and Futuna",ISO_A3:"WLF"},"Akrotiri Sovereign Base Area":{name:"Akrotiri Sovereign Base Area",ISO_A3:"-99"},Samoa:{name:"Samoa",ISO_A3:"WSM"},Yemen:{name:"Yemen",ISO_A3:"YEM"},"South Africa":{name:"South Africa",ISO_A3:"ZAF"},Zambia:{name:"Zambia",ISO_A3:"ZMB"},Zimbabwe:{name:"Zimbabwe",ISO_A3:"ZWE"},"French Guyana":{name:"French Guyana",ISO_A3:"GUF"}},Of={Alabama:{name:"Alabama"},Alaska:{name:"Alaska"},Arizona:{name:"Arizona"},Arkansas:{name:"Arkansas"},California:{name:"California"},Colorado:{name:"Colorado"},Connecticut:{name:"Connecticut"},Delaware:{name:"Delaware"},"District of Columbia":{name:"District of Columbia"},Florida:{name:"Florida"},Georgia:{name:"Georgia"},Hawaii:{name:"Hawaii"},Idaho:{name:"Idaho"},Illinois:{name:"Illinois"},Indiana:{name:"Indiana"},Iowa:{name:"Iowa"},Kansas:{name:"Kansas"},Kentucky:{name:"Kentucky"},Louisiana:{name:"Louisiana"},Maine:{name:"Maine"},Maryland:{name:"Maryland"},Massachusetts:{name:"Massachusetts"},Michigan:{name:"Michigan"},Minnesota:{name:"Minnesota"},Mississippi:{name:"Mississippi"},Missouri:{name:"Missouri"},Montana:{name:"Montana"},Nebraska:{name:"Nebraska"},Nevada:{name:"Nevada"},"New Hampshire":{name:"New Hampshire"},"New Jersey":{name:"New Jersey"},"New Mexico":{name:"New Mexico"},"New York":{name:"New York"},"North Carolina":{name:"North Carolina"},"North Dakota":{name:"North Dakota"},Ohio:{name:"Ohio"},Oklahoma:{name:"Oklahoma"},Oregon:{name:"Oregon"},Pennsylvania:{name:"Pennsylvania"},"Rhode Island":{name:"Rhode Island"},"South Carolina":{name:"South Carolina"},"South Dakota":{name:"South Dakota"},Tennessee:{name:"Tennessee"},Texas:{name:"Texas"},Utah:{name:"Utah"},Vermont:{name:"Vermont"},Virginia:{name:"Virginia"},Washington:{name:"Washington"},"West Virginia":{name:"West Virginia"},Wisconsin:{name:"Wisconsin"},Wyoming:{name:"Wyoming"}},Nf={Anguilla:{name:"Anguilla",ISO_A3:"AIA"},"Antigua and Barbuda":{name:"Antigua and Barbuda",ISO_A3:"ATG"},"The Bahamas":{name:"The Bahamas",ISO_A3:"BHS"},Bermuda:{name:"Bermuda",ISO_A3:"BMU"},Barbados:{name:"Barbados",ISO_A3:"BRB"},Canada:{name:"Canada",ISO_A3:"CAN"},Cuba:{name:"Cuba",ISO_A3:"CUB"},"Cayman Islands":{name:"Cayman Islands",ISO_A3:"CYM"},Dominica:{name:"Dominica",ISO_A3:"DMA"},"Dominican Republic":{name:"Dominican Republic",ISO_A3:"DOM"},Grenada:{name:"Grenada",ISO_A3:"GRD"},Greenland:{name:"Greenland",ISO_A3:"GRL"},Haiti:{name:"Haiti",ISO_A3:"HTI"},Jamaica:{name:"Jamaica",ISO_A3:"JAM"},"Saint Kitts and Nevis":{name:"Saint Kitts and Nevis",ISO_A3:"KNA"},"Saint Lucia":{name:"Saint Lucia",ISO_A3:"LCA"},"Saint Martin":{name:"Saint Martin",ISO_A3:"MAF"},Mexico:{name:"Mexico",ISO_A3:"MEX"},Montserrat:{name:"Montserrat",ISO_A3:"MSR"},"Puerto Rico":{name:"Puerto Rico",ISO_A3:"PRI"},"Saint Pierre and Miquelon":{name:"Saint Pierre and Miquelon",ISO_A3:"SPM"},"Turks and Caicos Islands":{name:"Turks and Caicos Islands",ISO_A3:"TCA"},"Trinidad and Tobago":{name:"Trinidad and Tobago",ISO_A3:"TTO"},"United States of America":{name:"United States of America",ISO_A3:"USA"},"Saint Vincent and the Grenadines":{name:"Saint Vincent and the Grenadines",ISO_A3:"VCT"},"British Virgin Islands":{name:"British Virgin Islands",ISO_A3:"VGB"},"United States Virgin Islands":{name:"United States Virgin Islands",ISO_A3:"VIR"}},Uf={Argentina:{name:"Argentina",ISO_A3:"ARG"},Bolivia:{name:"Bolivia",ISO_A3:"BOL"},Brazil:{name:"Brazil",ISO_A3:"BRA"},Chile:{name:"Chile",ISO_A3:"CHL"},Colombia:{name:"Colombia",ISO_A3:"COL"},"Costa Rica":{name:"Costa Rica",ISO_A3:"CRI"},Ecuador:{name:"Ecuador",ISO_A3:"ECU"},"Falkland Islands":{name:"Falkland Islands",ISO_A3:"FLK"},Guyana:{name:"Guyana",ISO_A3:"GUY"},Nicaragua:{name:"Nicaragua",ISO_A3:"NIC"},Panama:{name:"Panama",ISO_A3:"PAN"},Peru:{name:"Peru",ISO_A3:"PER"},Paraguay:{name:"Paraguay",ISO_A3:"PRY"},Suriname:{name:"Suriname",ISO_A3:"SUR"},Uruguay:{name:"Uruguay",ISO_A3:"URY"},Venezuela:{name:"Venezuela",ISO_A3:"VEN"},"French Guyana":{name:"French Guyana",ISO_A3:"GUF"},Guatemala:{name:"Guatemala",ISO_A3:"GTM"},"El Salvador":{name:"El Salvador",ISO_A3:"SLV"},Honduras:{name:"Honduras",ISO_A3:"HND"}},Gf={World:Bf,USA:Of,NorthAmerica:Nf,SouthAmerica:Uf,Canada:Rf,Europe:Vf,Asia:zf,Africa:Lf,Australia:Pf},Wf={Solid:Vu},Yf=(t,i)=>{const s=(t=>{const i=new U({color:t.uiStrokeColorContrastHigh}),s=new U({color:t.uiStrokeColorContrastMedium}),n=new U({color:t.uiStrokeColorContrastLow}),r=new sn({family:t.fontFamily,weight:"normal",style:"normal"}),o=r.setSize(18*t.fontScaler),a=r.setSize(16*t.fontScaler),h=r.setSize(14*t.fontScaler),l=r.setSize(10*t.fontScaler),u=r.withMutations((e=>e.set("size",14*t.fontScaler).set("weight","bold"))),c=r.setSize(13*t.fontScaler),d=new qi({thickness:2,fillStyle:n}),f=new U({color:t.dataHighlightOverlayColor}),g=new qi({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),m=t.dataColorPalette.map((t=>new U({color:t.stroke}))),p=t=>m[t%m.length],y=m.map((t=>new qi({thickness:2,fillStyle:t}))),A=t=>y[t%y.length],x=t.dataColorPalette.map((t=>new U({color:t.border}))).map((t=>new qi({thickness:2,fillStyle:t}))),S=t=>x[t%x.length],b=t.dataColorPalette.map((t=>{const e=t.area;return new et({angle:180,stops:[{color:ne(e,T(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ne(e,T(0,0,0,e.getA()),.3),offset:1}]})})),v=t=>b[t%b.length],M=t.dataColorPaletteInverted.map((t=>{const e=t.area;return new et({angle:180,stops:[{color:ne(e,T(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ne(e,T(0,0,0,e.getA()),.3),offset:1}]})})),w=t=>M[t%M.length],E=t.dataColorPaletteInverted.map((t=>new U({color:t.border}))).map((t=>new qi({thickness:2,fillStyle:t}))),k=t=>E[t%E.length],C=new U({color:t.dataColorPositive}),D=new U({color:t.dataColorNegative}),I=new qi({thickness:1,fillStyle:new U({color:t.dataStrokeColorContrastHigh.setA(50)})}),_=new qi({thickness:2,fillStyle:t.axisLineFillStyle}),F=nt,L=new U({color:T(0,0,0,1)}),z=new qi({thickness:1,fillStyle:t.axisGridMajorFillStyle}),P=new qi({thickness:1,fillStyle:t.axisTickMajorFillStyle}),R=h,B=t.axisLabelMajorFillStyle,O=new qi({thickness:1,fillStyle:t.axisGridMajorFillStyle}),N=new qi({thickness:1,fillStyle:t.axisTickMajorFillStyle}),G=h,W=t.axisLabelMajorFillStyle,Y=new qi({thickness:1,fillStyle:t.axisGridMinorFillStyle}),H=new qi({thickness:1,fillStyle:t.axisTickMinorFillStyle}),X=l,j=t.axisLabelMinorFillStyle,$=oa,q=new na({gridStrokeStyle:z,tickStyle:P,tickLength:50,tickPadding:-14,labelFont:R,labelPadding:0,labelFillStyle:B}),J=new na({gridStrokeStyle:O,tickStyle:N,tickLength:7,tickPadding:0,labelFont:G,labelPadding:0,labelFillStyle:W}),K=new na({gridStrokeStyle:Y,tickStyle:H,tickLength:4,tickPadding:5,labelFont:X,labelPadding:0,labelFillStyle:j}),Z=new Ca({extremeTickStyle:$,majorTickStyle:J,minorTickStyle:K}),Q=new Sa({greatTickStyle:q,majorTickStyle:J,minorTickStyle:K}),tt=new La({majorTickStyle:J,minorTickStyle:K}),it=new U({color:t.dataHighlightOverlayColor}),st=new qi({thickness:1,fillStyle:s}),rt=new qi({thickness:2,fillStyle:s}),ot=t=>new fn.Triangulated({shape:"sphere",size:10,fillStyle:m[t%m.length]}),at=m[0],ht=t.uiTextFillStyle,lt=t.legendBackgroundFillStyle,ut=new qi({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),ct=oe(t.legendButtonDefaultColor),dt=oe(t.isDark?T(70,70,70,255):T(170,170,170,255)),ft=new U({color:t.isDark?T(70,70,70,255):T(170,170,170,255)}),gt=new qi({thickness:1,fillStyle:i}),mt=new Jr({thickness:1,fillStyle:t.cursorGridFillStyle,pattern:$r.DashedEqual,patternScale:3}),pt=t.zoomBandChartDefocusOverlayFillStyle,yt=new qi({thickness:2,fillStyle:new U({color:t.zoomBandChartSplitterColor})});let At={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:nt,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new qi({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:nt,chartXYTitleFont:o,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:d,chartXYZoomingRectangleFillStyle:f,chartXYZoomingRectangleStrokeStyle:g,chartXYFittingRectangleFillStyle:f,chartXYFittingRectangleStrokeStyle:g,lineSeriesStrokeStyle:A,pointLineSeriesStrokeStyle:A,pointLineSeriesFillStyle:p,pointSeriesFillStyle:p,ellipseSeriesFillStyle:p,ellipseSeriesStrokeStyle:A,polygonSeriesFillStyle:p,polygonSeriesStrokeStyle:A,rectangleSeriesFillStyle:p,rectangleSeriesStrokeStyle:nt,segmentSeriesStrokeStyle:A,boxSeriesBodyFillStyle:p(0),boxSeriesBodyStrokeStyle:nt,boxSeriesStrokeStyle:new qi({thickness:1,fillStyle:m[0]}),boxSeriesMedianStrokeStyle:new qi({thickness:1,fillStyle:new U({color:T(0,0,0)})}),ohlcCandleThicknessPixels:5,ohlcCandleBodyFillStylePositive:C,ohlcCandleBodyFillStyleNegative:D,ohlcCandleTailStrokeStylePositive:new qi({thickness:1,fillStyle:new U({color:t.uiStrokeColorContrastHigh})}),ohlcCandleTailStrokeStyleNegative:new qi({thickness:1,fillStyle:new U({color:t.uiStrokeColorContrastHigh})}),ohlcBarThicknessPixels:10,ohlcBarStrokeStylePositive:new qi({thickness:2,fillStyle:C}),ohlcBarStrokeStyleNegative:new qi({thickness:2,fillStyle:D}),heatmapGridSeriesFillStyle:p,heatmapGridSeriesWireframeStyle:I,heatmapScrollingGridSeriesFillStyle:p,heatmapScrollingGridSeriesWireframeStyle:I,areaRangeSeriesFillStyle:v,areaRangeSeriesStrokeStyle:S,areaRangeSeriesFillStyleInverted:w,areaRangeSeriesStrokeStyleInverted:k,areaSeriesBipolarHighFillStyle:v,areaSeriesBipolarHighStrokeStyle:S,areaSeriesBipolarLowFillStyle:w,areaSeriesBipolarLowStrokeStyle:k,areaSeriesPositiveFillStyle:v,areaSeriesPositiveStrokeStyle:S,areaSeriesNegativeFillStyle:w,areaSeriesNegativeStrokeStyle:k,xAxisTitleFont:a,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:_,xAxisNibStyle:F,xAxisOverlayStyle:L,xAxisZoomingBandFillStyle:f,xAxisZoomingBandStrokeStyle:nt,xAxisNumericTicks:Z,xAxisDateTimeTicks:Q,xAxisTimeTicks:tt,yAxisTitleFont:a,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:_,yAxisNibStyle:F,yAxisOverlayStyle:L,yAxisZoomingBandFillStyle:f,yAxisZoomingBandStrokeStyle:nt,yAxisNumericTicks:Z,yAxisDateTimeTicks:Q,yAxisTimeTicks:tt,bandFillStyle:it,bandStrokeStyle:st,constantLineStrokeStyle:rt,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:nt,barChartTitleFont:o,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:V,barChartSeriesBackgroundStrokeStyle:nt,barChartBarFillStyle:p,barChartBarStrokeStyle:new qi({thickness:1,fillStyle:n}),barChartValueAxisTitleFont:a,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:_,barChartValueAxisTicks:Z.setMajorTickStyle((t=>t.setGridStrokeStyle(nt))).setMinorTickStyle((t=>t.setGridStrokeStyle(nt))),barChartCategoryAxisTitleFont:a,barChartCategoryAxisTitleFillStyle:t.axisTitleFillStyle,barChartCategoryAxisStrokeStyle:_,barChartCategoryLabels:{formatter:(t,e)=>t,labelFillStyle:Z.majorTickStyle.labelFillStyle,labelFont:Z.majorTickStyle.labelFont,labelMargin:8,labelRotation:0,tickStyle:Z.majorTickStyle.tickStyle,tickLength:0},barChartValueLabelsAfterBars:{position:"after-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:Z.majorTickStyle.labelFillStyle,labelFont:Z.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},barChartValueLabelsInsideBars:{position:"inside-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:Z.majorTickStyle.labelFillStyle,labelFont:Z.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:nt,chart3DTitleFont:o,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:d,chart3DBoundingBoxStrokeStyle:nt,xAxis3DTitleFont:a,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:_,xAxis3DNumericTicks:Z,xAxis3DDateTimeTicks:Q,xAxis3DTimeTicks:tt,yAxis3DTitleFont:a,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:_,yAxis3DNumericTicks:Z,yAxis3DDateTimeTicks:Q,yAxis3DTimeTicks:tt,zAxis3DTitleFont:a,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:_,zAxis3DNumericTicks:Z,zAxis3DDateTimeTicks:Q,zAxis3DTimeTicks:tt,lineSeries3DStrokeStyle:A,pointLineSeries3DStrokeStyle:A,pointLineSeries3DPointStyle:ot,pointSeries3DPointStyle:ot,pointCloudSeries3DPointStyle:t=>new fn.Pixelated({size:5,fillStyle:m[t%m.length]}),surfaceGridSeries3DFillStyle:p,surfaceGridSeries3DWireframeStyle:I,surfaceScrollingGridSeries3DFillStyle:p,surfaceScrollingGridSeries3DWireframeStyle:I,boxSeries3DFillStyle:p,meshModel3DFillStyle:p(0),polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:nt,polarChartTitleFont:o,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:d,polarSectorFillStyle:it,polarSectorStrokeStyle:st,polarAmplitudeAxisTitleFont:a,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:_,polarAmplitudeAxisNumericTicks:Z,polarAmplitudeAxisDateTimeTicks:Q,polarAmplitudeAxisTimeTicks:tt,polarRadialAxisTitleFont:a,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:_,polarRadialAxisTickStyle:J,polarLineSeriesStrokeStyle:A,polarPointLineSeriesFillStyle:p,polarPointLineSeriesStrokeStyle:A,polarPointSeriesFillStyle:p,polarPolygonSeriesFillStyle:v,polarPolygonSeriesStrokeStyle:S,polarAreaSeriesFillStyle:v,polarAreaSeriesStrokeStyle:S,polarHeatmapSeriesFillStyle:p,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:nt,mapChartTitleFont:o,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:at,mapChartStrokeStyle:new qi({thickness:1,fillStyle:new U({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:V,mapChartOutlierRegionStrokeStyle:new qi({thickness:1,fillStyle:n}),mapChartSeparateRegionFillStyle:lt,mapChartSeparateRegionStrokeStyle:ut,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:nt,dataGridTitleFont:o,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:h,dataGridTextFillStyle:at,dataGridCellBackgroundFillStyle:new U({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new qi({thickness:.4,fillStyle:new U({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:nt,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ut,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ut,dataGridScrollBarButtonArrowFillStyle:ct,dataGridScrollBarButtonArrowStrokeStyle:ut,sparkLineChartStrokeStyle:A(0),sparkPointChartFillStyle:p(0),sparkBarChartFillStyle:p(0),sparkBarChartStrokeStyle:S(0),sparkAreaChartFillStyle:v(0),sparkAreaChartStrokeStyle:S(0),sparkPieChartFillStyle:p,sparkPieChartStrokeStyle:ut,sparkChartBandFillStyle:it,sparkChartBandStrokeStyle:st,sparkChartConstantLineStrokeStyle:rt,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:nt,spiderChartTitleFont:o,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:d,spiderChartWebStyle:new qi({thickness:2,fillStyle:n}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:h,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:a,spiderChartAxisStrokeStyle:new qi({thickness:2,fillStyle:s}),spiderChartAxisNibStrokeStyle:new qi({thickness:2,fillStyle:i}),spiderSeriesFillStyle:v,spiderSeriesStrokeStyle:S,spiderSeriesPointFillStyle:p,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:nt,pieChartTitleFont:o,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:p,pieChartSliceStrokeStyle:ut,pieChartSliceLabelFont:c,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:gt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:nt,funnelChartTitleFont:o,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:p,funnelChartSliceStrokeStyle:ut,funnelChartSliceLabelFont:c,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:gt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:nt,pyramidChartTitleFont:o,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:p,pyramidChartSliceStrokeStyle:ut,pyramidChartSliceLabelFont:c,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:gt,gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:nt,gaugeChartTitleFont:o,gaugeChartTitleFillStyle:t.titleFillStyle,gaugeChartEmptyGaugeFillStyle:new U({color:t.uiBackgroundColor}),gaugeChartEmptyGaugeStrokeStyle:ut,gaugeChartGaugeFillStyle:at,gaugeChartIntervalLabelsFillStyle:ht,gaugeChartIntervalLabelsFont:c,gaugeChartValueLabelFillStyle:ht,gaugeChartValueLabelFont:c,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:nt,zoomBandChartDefocusOverlayFillStyle:pt,zoomBandChartSplitterStrokeStyle:yt,zoomBandChartKnobFillStyle:t.zoomBandChartKnobFillStyle,zoomBandChartKnobSize:t.zoomBandChartKnobSize,onScreenMenuBackgroundColor:T(254,204,0,.7),uiButtonFillStyle:ct,uiButtonFillStyleHidden:dt,uiButtonStrokeStyle:ut,uiButtonSize:10,uiBackgroundFillStyle:lt,uiBackgroundStrokeStyle:ut,uiTextFillStyle:ht,uiTextFillStyleHidden:ft,uiTextFont:c,legendTitleFillStyle:ht,legendTitleFont:u,cursorTickMarkerXBackgroundFillStyle:lt,cursorTickMarkerXBackgroundStrokeStyle:ut,cursorTickMarkerXTextFillStyle:ht,cursorTickMarkerXTextFont:c,cursorTickMarkerYBackgroundFillStyle:lt,cursorTickMarkerYBackgroundStrokeStyle:ut,cursorTickMarkerYTextFillStyle:ht,cursorTickMarkerYTextFont:c,cursorPointMarkerFillStyle:mt.getFillStyle(),cursorPointMarkerSize:{x:9,y:9},cursorPointMarkerShape:e.PointShape.Cross,cursorResultTableFillStyle:lt,cursorResultTableStrokeStyle:ut,cursorResultTableTextFillStyle:ht,cursorResultTableTextFont:c,cursorGridStrokeStyleX:mt,cursorGridStrokeStyleY:mt,chartMarkerPointMarkerFillStyle:mt.getFillStyle(),chartMarkerPointMarkerSize:{x:20,y:20},chartMarkerPointMarkerShape:e.PointShape.Star,seriesMarkerPointMarkerFillStyle:mt.getFillStyle(),seriesMarkerPointMarkerSize:{x:9,y:9},seriesMarkerPointMarkerShape:e.PointShape.Cross};return t.overrideThemeProperties&&(At={...At,...t.overrideThemeProperties}),At})(t),n={...i,header1Font:s.xAxisTitleFont,header2Font:s.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:s.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...s,examples:n}},Hf=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/${e}`;return i.addEventListener("error",(e=>{Te(t,s,"Theme resource",{shouldCrash:!1})})),i.src=s,i},Xf=(t,e,i)=>s=>{const n=!0===t?e[s%e.length].stroke:ne(e[s%e.length].stroke,T(255,255,255),.5);return new Z({stops:[{color:ne(n,T(255,255,255),.5*i).setA(100),offset:0},{color:n.setA(100),offset:.5},{color:ne(n,T(30,30,30),.5*i).setA(100),offset:1}]})},jf=(t,e,i)=>s=>{const n=!0===t?e[s%e.length].stroke:ne(e[s%e.length].stroke,T(255,255,255),.2);return new Z({stops:[{color:ne(n,T(255,255,255),.2*i),offset:0},{color:n,offset:.5},{color:ne(n,T(0,0,0),.2*i),offset:1}]})},$f=(t,e,i)=>s=>{const n=!0===t?e[s%e.length].stroke:ne(e[s%e.length].stroke,T(255,255,255),.2);return new et({angle:90,stops:[{color:ne(n,T(255,255,255),.5*i),offset:0},{color:n,offset:.35},{color:ne(n,T(30,30,30),.5*i),offset:1}]})},qf=(t,e,i)=>(i=>{const s=new Map;return i=>{const n=s.get(i);if(n)return n;const r=(i=>{const s=!0===t?e[i%e.length].stroke:ne(e[i%e.length].stroke,T(255,255,255),.3);return new et({angle:90,stops:[{color:ne(s,T(255,255,255),.5),offset:0},{color:s,offset:.35},{color:ne(s,T(30,30,30),.5),offset:1}]})})(i);return s.set(i,r),r}})(),Jf=(t,i,s)=>{const n=i[0].stroke;return new Z({shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner,position:{x:.5,y:.5},stops:[{color:!0===t?n:ne(n,T(255,255,255),.5*s),offset:0},{color:n,offset:.5},{color:!0===t?n:ne(n,T(0,0,0),.5*s),offset:1}]})},Kf=ve((()=>{const t=T(255,255,255),i=new U({color:t}),s=!0,n=new io({spread:1,blur:9,offset:{x:0,y:0},color:T(0,0,0,150)}),r=new Z({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:T(50,51,52)},{offset:.5,color:T(14,15,16)},{offset:1,color:T(0,0,0)}]}),o=new U({color:T(45,45,45)}),a=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(120,120,120,100)},{offset:1,color:T(0,0,0,50)}]}),h=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(30,30,30,200)},{offset:1,color:T(0,0,0,255)}]}),l=new U({color:T(255,255,220)}),u=new U({color:T(255,255,166)}),c=new U({color:T(255,255,220)}),d=new U({color:T(255,255,220,130)}),f=new U({color:T(255,255,200)}),g=f,m=g,p=new et({angle:45,stops:[{offset:0,color:T(230,230,230)},{offset:1,color:T(150,150,150)}]}),y=new U({color:T(220,220,220)}),A=new U({color:T(200,200,200,50)}),x=new U({color:T(200,200,200,150)}),S=new U({color:T(200,200,200,20)}),b=new U({color:T(150,150,150)}),v=new et({angle:0,stops:[{offset:0,color:T(10,10,10,220)},{offset:1,color:T(30,30,30,220)}]}),M=i,E=T(255,255,200),k=v,C=M,D=T(20,20,20),I=T(0,0,0),_=t,F=T(150,150,150),L=T(50,50,50),z=T(50,50,50),P=T(100,100,100),R=T(200,200,200),V=[T(255,255,91,255),T(255,205,91,255),T(255,155,91,255),T(255,196,188,255),T(255,148,184,255),T(219,148,198,255),T(235,196,224,255),T(169,148,198,255),T(148,226,198,255),T(148,255,176,255),T(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),B=t.setA(20),O=T(176,255,157,255),N=T(255,112,76,255),G={mapChartFillStyle:new et({angle:135,stops:[{color:T(255,255,91,255),offset:0},{color:T(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,V,.5),pieChartSliceFillStylePalette:jf(s,V,1),funnelChartSliceFillStylePalette:$f(s,V,1),pyramidChartSliceFillStylePalette:$f(s,V,1),rectangleSeriesFillStyle:qf(s,V),gaugeChartGaugeFillStyle:Jf(s,V,1)},W=new U({color:T(176,255,157,255)}),Y=new U({color:T(255,146,146,255)}),H=new U({color:T(176,255,157,255)}),X=new U({color:T(230,63,63,255)}),j=new U({color:T(176,255,157,120)}),$=new U({color:T(229,63,63,180)}),q=new U({color:T(27,37,36,255)}),J=new U({color:T(62,27,27,255)}),K=[T(255,0,0),T(255,255,0),T(0,255,0)],Q=[T(10,10,255),T(10,190,255),T(251,255,0),T(255,38,0)],tt=[T(255,255,0),T(255,204,0),T(255,128,0),T(255,0,0)],it=[T(0,0,0),T(167,4,69,255),T(255,0,0),T(252,252,168,255)],st=new Z({stops:[{color:T(61,61,80,100),offset:0},{color:T(44,44,55,30),offset:1}]}),nt=new U({color:T(148,148,198,255)}),rt=j.getColor().setA(255),ot=T(100,100,100);return Yf({isDark:s,highlightColorOffset:T(60,60,60,60),highlightColorOffsetAxisOverlay:T(255,255,255,40),effect:n,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:r,dashboardSplitterFillStyle:o,panelBackgroundFillStyle:a,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:l,axisTitleFillStyle:u,axisLabelMajorFillStyle:c,axisLabelMinorFillStyle:d,uiTitleFillStyle:f,uiTextFillStyle:g,cursorTextFillStyle:m,axisLineFillStyle:p,axisTickMajorFillStyle:y,axisGridMajorFillStyle:A,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:b,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:E,resultTableBackgroundFillStyle:k,resultTableBackgroundBorderFillStyle:C,uiBackgroundColor:D,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:_,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:L,dataStrokeColorContrastHigh:z,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:R,dataColorPalette:V,dataColorPaletteInverted:[{area:T(190,50,50,100),border:T(210,80,80)}],dataHighlightOverlayColor:B,dataColorPositive:O,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new U({color:T(0,0,0,180)}),zoomBandChartSplitterColor:w("#FBFB5A"),zoomBandChartKnobFillStyle:t=>new Xr({source:Hf(t,"zoomBandChart/darkgold-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:G},{positiveTextFillStyle:W,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:j,negativeAreaFillStyle:$,positiveBackgroundFillStyle:q,negativeBackgroundFillStyle:J,badGoodColorPalette:K,coldHotColorPalette:Q,intensityColorPalette:tt,spectrogramColorPalette:it,bollingerFillStyle:st,bollingerBorderFillStyle:nt,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:ot})})),Zf=ve((()=>{const t=T(255,255,255),i=new U({color:t}),s=!0,n=new io({spread:0,blur:9,offset:{x:0,y:0},color:T(105,255,236,40)}),r=new U({color:T(2,21,30)}),o=new Z({stops:[{color:T(19,40,66,150),offset:0},{color:T(0,0,0,150),offset:1}]}),a=new U({color:T(0,5,8,150)}),h=i,l=i,u=i,c=new U({color:T(255,255,220,130)}),d=i,f=i,g=f,m=new U({color:T(20,224,250,255)}),p=i,y=new U({color:T(61,94,110,100)}),A=new U({color:T(61,94,110,255)}),x=new U({color:T(61,94,110,40)}),S=i,b=new U({color:T(0,18,23,255)}),v=i,M=t,E=new U({color:T(0,17,22,240)}),k=i,C=T(0,38,48,220),D=T(0,0,0),I=t,_=T(150,150,150),F=T(19,78,93),L=T(50,50,50),z=T(0,36,48),P=T(200,200,200),R=[T(45,253,253,255),T(44,172,247,255),T(46,100,248,255),T(96,84,199,255),T(184,104,245,255),T(98,160,218,255),T(43,238,245,255),T(38,140,206,255),T(112,96,224,255),T(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),V=t.setA(50),B=T(3,217,194,255),O=T(230,63,63,255),N={mapChartFillStyle:new et({angle:135,stops:[{color:T(118,248,231,255),offset:0},{color:T(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,R,1),pieChartSliceFillStylePalette:jf(s,R,1),funnelChartSliceFillStylePalette:$f(s,R,1),pyramidChartSliceFillStylePalette:$f(s,R,1),rectangleSeriesFillStyle:qf(s,R),gaugeChartGaugeFillStyle:Jf(s,R,1)},G=new U({color:T(45,253,253,255)}),W=new U({color:T(255,146,146,255)}),Y=new U({color:T(45,253,253,255)}),H=new U({color:T(230,63,63,255)}),X=new U({color:T(1,190,164,120)}),j=new U({color:T(229,63,63,180)}),$=new U({color:T(1,53,57,255)}),q=new U({color:T(62,27,27,255)}),J=[T(1,104,119,255),T(0,165,144,255),T(0,246,214,255)],K=[T(0,87,95,255),T(0,125,124,255),T(1,209,182,255),T(0,255,221,255),T(218,112,112,255),T(172,47,47,255)],Q=[T(126,255,253,255),T(50,233,230,255),T(0,196,193,255),T(62,138,178,255),T(139,88,191,255),T(162,55,143,255)],tt=[T(13,31,52,255),T(101,50,118,255),T(1,142,172,255),T(2,196,170,255),T(0,255,221,255)],it=new Z({stops:[{color:T(122,103,254,70),offset:0},{color:T(178,168,255,10),offset:1}]}),st=new U({color:T(122,103,254,255)}),nt=X.getColor().setA(255),rt=T(15,83,83);return Yf({isDark:s,highlightColorOffset:T(60,60,60,60),highlightColorOffsetAxisOverlay:T(255,255,255,40),effect:n,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new Xr({source:Hf(t,"themes/turquoiseHexagon.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:r,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:a,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:h,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:p,axisGridMajorFillStyle:y,axisTickMinorFillStyle:A,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:E,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:C,uiBackgroundBorderColor:D,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:_,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:z,dataStrokeColorContrastLow:P,dataColorPalette:R,dataColorPaletteInverted:[{area:T(170,60,210,100),border:T(210,100,250)}],dataHighlightOverlayColor:V,dataColorPositive:B,dataColorNegative:O,zoomBandChartDefocusOverlayFillStyle:new U({color:T(0,0,0,180)}),zoomBandChartSplitterColor:w("#2BF4F4"),zoomBandChartKnobFillStyle:t=>new Xr({source:Hf(t,"zoomBandChart/turquoise-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:W,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:q,badGoodColorPalette:J,coldHotColorPalette:K,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:rt})})),Qf=ve((()=>{const t=!1,i=new io({spread:0,blur:6,offset:{x:2,y:-2},color:T(0,0,0,30)}),s=new Z({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:T(255,255,255)},{offset:1,color:T(255,255,255)}]}),n=new U({color:T(219,227,233,255)}),r=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(255,255,255,200)},{offset:1,color:T(240,244,246,200)}]}),o=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(255,255,255,255)},{offset:1,color:T(255,255,255,255)}]}),a=new U({color:T(33,43,49)}),h=new U({color:T(33,43,49)}),l=new U({color:T(33,43,49)}),u=new U({color:T(33,43,49,150)}),c=new U({color:T(33,43,49)}),d=c,f=d,g=new et({angle:45,stops:[{offset:0,color:T(225,225,225)},{offset:1,color:T(225,225,225)}]}),m=new U({color:T(168,186,199,255)}),p=new U({color:T(168,186,199,120)}),y=new U({color:T(168,186,199,40)}),A=new U({color:T(168,186,199,40)}),x=new U({color:T(128,146,159,255)}),S=new et({angle:0,stops:[{offset:0,color:T(255,255,255,240)},{offset:1,color:T(255,255,255,240)}]}),b=new U({color:T(168,186,199)}),v=T(255,255,200),M=new U({color:T(255,255,255,240)}),E=new U({color:T(128,146,159,255)}),k=T(255,255,255,255),C=T(168,168,199,255),D=T(168,186,199,255),I=T(168,186,199,255),_=T(168,186,199,255),F=T(168,186,199,255),L=T(100,100,100),z=T(200,200,200),P=[T(28,181,140,255),T(255,132,0,255),T(240,39,39,255),T(86,121,251,255),T(2,181,213,255),T(13,212,158,255),T(22,167,3,255),T(234,103,232,255),T(62,183,179,255),T(140,93,3,255),T(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),R=T(150,150,150,80),V=T(46,182,120,255),B=T(255,66,66,255),O=new qi({thickness:2,fillStyle:new U({color:T(168,186,199,255)})}),N={mapChartFillStyle:new et({angle:-45,stops:[{color:T(2,181,213,255),offset:0},{color:T(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(t,P,.8),pieChartSliceFillStylePalette:jf(t,P,.8),funnelChartSliceFillStylePalette:$f(t,P,.5),pyramidChartSliceFillStylePalette:$f(t,P,.5),rectangleSeriesFillStyle:qf(t,P),gaugeChartGaugeFillStyle:Jf(t,P,.8),chartXYSeriesBackgroundStrokeStyle:O,chart3DSeriesBackgroundStrokeStyle:O,polarChartSeriesBackgroundStrokeStyle:O,spiderChartSeriesBackgroundStrokeStyle:O,dataGridTextFillStyle:new U({color:T(0,88,64,255)})},G=new U({color:T(4,146,108,255)}),W=new U({color:T(240,39,39,255)}),Y=new U({color:T(28,181,140,255)}),H=new U({color:T(230,88,88,255)}),X=new U({color:T(28,181,140,180)}),j=new U({color:T(230,88,88,180)}),$=new U({color:T(229,243,228)}),q=new U({color:T(232,225,216)}),J=[T(193,48,48,255),T(240,234,60,255),T(45,191,55,255)],K=[T(10,19,255,255),T(15,191,250,255),T(249,255,2,255),T(253,133,0,255),T(255,24,0,255)],Q=[T(50,99,213),T(8,179,77),T(255,246,0),T(255,126,0),T(189,36,30)],tt=[T(16,64,176),T(8,179,77),T(255,246,0),T(255,126,0),T(168,6,0)],it=new U({color:T(185,198,207,255)}),st=new Z({stops:[{color:T(151,190,220,10),offset:0},{color:T(151,190,220,50),offset:1}]}),nt=X.getColor().setA(255),rt=T(150,150,150);return Yf({isDark:t,highlightColorOffset:T(-60,-60,-60,60),highlightColorOffsetAxisOverlay:T(0,0,0,40),effect:i,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:s,dashboardSplitterFillStyle:n,panelBackgroundFillStyle:r,seriesBackgroundFillStyle:o,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:h,axisLabelMajorFillStyle:l,axisLabelMinorFillStyle:u,uiTitleFillStyle:c,uiTextFillStyle:d,cursorTextFillStyle:f,axisLineFillStyle:g,axisTickMajorFillStyle:m,axisGridMajorFillStyle:p,axisTickMinorFillStyle:y,axisGridMinorFillStyle:A,cursorGridFillStyle:x,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:k,uiBackgroundBorderColor:C,uiStrokeColorContrastHigh:D,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:_,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:z,dataColorPalette:P,dataColorPaletteInverted:[{area:T(190,50,50,100),border:T(210,80,80)}],dataHighlightOverlayColor:R,dataColorPositive:V,dataColorNegative:B,zoomBandChartDefocusOverlayFillStyle:new U({color:T(255,255,255,180)}),zoomBandChartSplitterColor:w("#505D65"),zoomBandChartKnobFillStyle:t=>new Xr({source:Hf(t,"zoomBandChart/light-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:W,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:q,badGoodColorPalette:J,coldHotColorPalette:K,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:st,bollingerBorderFillStyle:it,highlightPointColor:T(0,0,0),highlightDataGridColor:nt,unfocusedDataColor:rt})})),tg=ve((()=>{const t=!1,i=new Z({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:T(255,255,255)},{offset:1,color:T(255,255,255)}]}),s=new U({color:T(214,236,216,255)}),n=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(233,244,231,70)},{offset:1,color:T(233,244,231,200)}]}),r=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(255,255,255,255)},{offset:1,color:T(255,255,255,255)}]}),o=new U({color:T(1,61,53)}),a=new U({color:T(1,61,53)}),h=new U({color:T(1,61,53)}),l=new U({color:T(1,61,53,150)}),u=new U({color:T(1,61,53)}),c=u,d=c,f=new et({angle:45,stops:[{offset:0,color:T(225,225,225)},{offset:1,color:T(225,225,225)}]}),g=new U({color:T(188,211,186,255)}),m=new U({color:T(188,211,186,150)}),p=new U({color:T(188,211,186,50)}),y=new U({color:T(188,211,186,50)}),A=new U({color:T(104,148,111,255)}),x=new et({angle:0,stops:[{offset:0,color:T(255,255,255,240)},{offset:1,color:T(255,255,255,240)}]}),S=new U({color:T(104,148,111)}),b=T(255,255,200),v=new U({color:T(255,255,255,240)}),M=new U({color:T(104,148,111,255)}),E=T(255,255,255,255),k=T(179,201,183,255),C=T(188,211,186,255),D=T(188,211,186,255),I=T(188,211,186,255),_=T(188,211,186,255),F=T(100,100,100),L=T(200,200,200),z=[T(138,195,142,255),T(193,161,114,255),T(178,99,99,255),T(142,156,210,255),T(154,209,219,255),T(164,212,199,255),T(104,156,97,255),T(196,147,195,255),T(92,190,187,255),T(126,100,51,255),T(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),P=T(150,150,150,80),R=T(46,182,84,255),V=T(232,96,96,255),B=new qi({thickness:2,fillStyle:new U({color:T(188,211,186,255)})}),O={mapChartFillStyle:new et({angle:-45,stops:[{color:T(118,160,121,255),offset:0},{color:T(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:Xf(t,z,.8),pieChartSliceFillStylePalette:jf(t,z,.8),pyramidChartSliceFillStylePalette:$f(t,z,.5),funnelChartSliceFillStylePalette:$f(t,z,.5),rectangleSeriesFillStyle:qf(t,z),gaugeChartGaugeFillStyle:Jf(t,z,.8),chartXYSeriesBackgroundStrokeStyle:B,chart3DSeriesBackgroundStrokeStyle:B,polarChartSeriesBackgroundStrokeStyle:B,spiderChartSeriesBackgroundStrokeStyle:B,dataGridTextFillStyle:new U({color:T(77,66,21,255)})},N=new U({color:T(93,151,97,255)}),G=new U({color:T(178,99,99,255)}),W=new U({color:T(138,195,142,255)}),Y=new U({color:T(178,99,99,255)}),H=new U({color:T(138,195,142,180)}),X=new U({color:T(178,99,99,180)}),j=new U({color:T(224,240,237)}),$=new U({color:T(251,227,227)}),q=[T(178,99,99,255),T(215,224,111,255),T(80,186,88,255)],J=[T(62,64,142,255),T(66,131,77,255),T(250,250,135,255),T(202,161,78,255),T(179,53,53,255)],K=[T(64,86,138),T(123,192,205),T(255,252,149),T(220,155,92),T(184,78,74)],Q=[T(64,86,138),T(123,192,205),T(255,252,149),T(220,155,92),T(132,60,57)],tt=new U({color:T(185,198,207,255)}),it=new Z({stops:[{color:T(151,190,220,10),offset:0},{color:T(151,190,220,50),offset:1}]}),st=H.getColor().setA(255),nt=T(150,150,150);return Yf({isDark:t,highlightColorOffset:T(-60,-60,-60,60),highlightColorOffsetAxisOverlay:T(0,0,0,40),effect:void 0,effectsText:!1,effectsDashboardSplitters:!1,lcjsBackgroundFillStyle:i,dashboardSplitterFillStyle:s,panelBackgroundFillStyle:n,seriesBackgroundFillStyle:r,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:o,axisTitleFillStyle:a,axisLabelMajorFillStyle:h,axisLabelMinorFillStyle:l,uiTitleFillStyle:u,uiTextFillStyle:c,cursorTextFillStyle:d,axisLineFillStyle:f,axisTickMajorFillStyle:g,axisGridMajorFillStyle:m,axisTickMinorFillStyle:p,axisGridMinorFillStyle:y,cursorGridFillStyle:A,legendBackgroundFillStyle:x,legendBackgroundBorderFillStyle:S,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:v,resultTableBackgroundBorderFillStyle:M,uiBackgroundColor:E,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:C,uiStrokeColorContrastMedium:D,uiStrokeColorContrastLow:I,dataStrokeColorContrastHigh:_,dataStrokeColorContrastMedium:F,dataStrokeColorContrastLow:L,dataColorPalette:z,dataColorPaletteInverted:[{area:T(210,70,70,100),border:T(200,110,110)}],dataHighlightOverlayColor:P,dataColorPositive:R,dataColorNegative:V,zoomBandChartDefocusOverlayFillStyle:new U({color:T(255,255,255,180)}),zoomBandChartSplitterColor:w("#446A40"),zoomBandChartKnobFillStyle:t=>new Xr({source:Hf(t,"zoomBandChart/lightnature-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O},{positiveTextFillStyle:N,negativeTextFillStyle:G,positiveFillStyle:W,negativeFillStyle:Y,positiveAreaFillStyle:H,negativeAreaFillStyle:X,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:$,badGoodColorPalette:q,coldHotColorPalette:J,intensityColorPalette:K,spectrogramColorPalette:Q,bollingerFillStyle:it,bollingerBorderFillStyle:tt,highlightPointColor:T(0,0,0),highlightDataGridColor:st,unfocusedDataColor:nt})})),eg=ve((()=>{const t=T(255,255,255),i=new U({color:t}),s=!0,n=new io({spread:1,blur:9,offset:{x:0,y:0},color:T(255,255,255,30)}),r=new U({color:T(6,15,36)}),o=new Z({stops:[{color:T(46,13,87,50),offset:0},{color:T(0,0,0,150),offset:1}]}),a=new U({color:T(0,5,8,150)}),h=i,l=i,u=i,c=new U({color:T(255,255,220,130)}),d=i,f=i,g=f,m=new et({angle:45,stops:[{offset:0,color:T(241,133,255,255)},{offset:1,color:T(115,207,238,255)}]}),p=i,y=new U({color:T(61,94,110,100)}),A=new U({color:T(61,94,110,255)}),x=new U({color:T(61,94,110,40)}),S=i,b=new U({color:T(0,18,23,255)}),v=i,M=T(115,207,238,255),E=new U({color:T(0,17,22,240)}),k=i,C=T(0,38,48,255),D=T(0,0,0),I=t,_=T(150,150,150),F=T(19,57,93),L=T(50,50,50),z=T(0,17,48),P=T(200,200,200),R=[T(20,211,237,255),T(98,147,252,255),T(164,73,250,255),T(129,117,253,255),T(95,134,252,255),T(22,133,212,255),T(35,200,242,255),T(104,121,233,255),T(137,69,232,255),T(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),V=t.setA(50),B=T(3,217,194,255),O=T(243,21,110,255),N={mapChartFillStyle:new et({angle:135,stops:[{color:T(118,248,231,255),offset:0},{color:T(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,R,.5),pieChartSliceFillStylePalette:jf(s,R,2),funnelChartSliceFillStylePalette:$f(s,R,1),pyramidChartSliceFillStylePalette:$f(s,R,1),rectangleSeriesFillStyle:qf(s,R),gaugeChartGaugeFillStyle:Jf(s,R,1)},G=new U({color:T(20,211,237,255)}),W=new U({color:T(253,145,178,255)}),Y=new U({color:T(20,211,237,255)}),H=new U({color:T(239,68,121,255)}),X=new U({color:T(20,211,237,120)}),j=new U({color:T(239,68,121,180)}),$=new U({color:T(1,53,57,255)}),q=new U({color:T(94,19,42,255)}),J=[T(174,51,132,255),T(204,107,218,255),T(189,215,253,255)],K=[T(0,63,95,255),T(0,149,255,255),T(0,225,255,255),T(255,154,254,255),T(204,98,170,255),T(139,39,84,255)],Q=[T(197,241,255,255),T(70,210,255,255),T(0,164,217,255),T(90,99,222,255),T(138,75,192,255),T(151,27,162,255)],tt=[T(13,31,52,255),T(129,54,130,255),T(131,108,176,255),T(7,162,213,255),T(26,247,255,255)],it=new Z({stops:[{color:T(219,42,235,60),offset:0},{color:T(237,73,252,10),offset:1}]}),st=new U({color:T(237,73,252,255)}),nt=X.getColor().setA(255),rt=T(8,70,100);return Yf({isDark:s,highlightColorOffset:T(60,60,60,60),highlightColorOffsetAxisOverlay:T(255,255,255,40),effect:n,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new Xr({source:Hf(t,"themes/cyberSpace.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:r,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:a,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:h,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:p,axisGridMajorFillStyle:y,axisTickMinorFillStyle:A,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:E,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:C,uiBackgroundBorderColor:D,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:_,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:z,dataStrokeColorContrastLow:P,dataColorPalette:R,dataColorPaletteInverted:[{area:T(41,130,255,100),border:T(45,110,240)}],dataHighlightOverlayColor:V,dataColorPositive:B,dataColorNegative:O,zoomBandChartDefocusOverlayFillStyle:new U({color:T(0,0,0,180)}),zoomBandChartSplitterColor:w("#DB77FF"),zoomBandChartKnobFillStyle:t=>new Xr({source:Hf(t,"zoomBandChart/cyberspace-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:W,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:q,badGoodColorPalette:J,coldHotColorPalette:K,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:rt})})),ig={};Object.defineProperty(ig,"darkGold",{get:Kf,enumerable:!0}),Object.defineProperty(ig,"turquoiseHexagon",{get:Zf,enumerable:!0}),Object.defineProperty(ig,"light",{get:Qf,enumerable:!0}),Object.defineProperty(ig,"lightNature",{get:tg,enumerable:!0}),Object.defineProperty(ig,"cyberSpace",{get:eg,enumerable:!0});const sg=ig,ng=sg.darkGold,rg=(t,i)=>{i=i||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAgCAYAAADwkoGKAAAsa2NhQlgAACxranVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAALEVqdW1iAAAAR2p1bWRjMm1hABEAEIAAAKoAOJtxA3Vybjp1dWlkOjlmZDBkZjkzLTVmMDMtNDczYi1hZThhLTFhNDM4NmMzNmJhYQAAAAGzanVtYgAAAClqdW1kYzJhcwARABCAAACqADibcQNjMnBhLmFzc2VydGlvbnMAAAAA12p1bWIAAAAmanVtZGNib3IAEQAQgAAAqgA4m3EDYzJwYS5hY3Rpb25zAAAAAKljYm9yoWdhY3Rpb25zgaNmYWN0aW9ua2MycGEuZWRpdGVkbXNvZnR3YXJlQWdlbnRtQWRvYmUgRmlyZWZseXFkaWdpdGFsU291cmNlVHlwZXhTaHR0cDovL2N2LmlwdGMub3JnL25ld3Njb2Rlcy9kaWdpdGFsc291cmNldHlwZS9jb21wb3NpdGVXaXRoVHJhaW5lZEFsZ29yaXRobWljTWVkaWEAAACranVtYgAAAChqdW1kY2JvcgARABCAAACqADibcQNjMnBhLmhhc2guZGF0YQAAAAB7Y2JvcqVqZXhjbHVzaW9uc4GiZXN0YXJ0GCFmbGVuZ3RoGSx3ZG5hbWVuanVtYmYgbWFuaWZlc3RjYWxnZnNoYTI1NmRoYXNoWCBvErgv+J0u7bVCYViyMUgw5yMb8idAv1erA3/DALx9NWNwYWRIAAAAAAAAAAAAAAIDanVtYgAAACRqdW1kYzJjbAARABCAAACqADibcQNjMnBhLmNsYWltAAAAAddjYm9yqGhkYzp0aXRsZW9HZW5lcmF0ZWQgaW1hZ2VpZGM6Zm9ybWF0aWltYWdlL3BuZ2ppbnN0YW5jZUlEeCh4bXAuaWlkOjI3NEMxQjdDN0E0MDExRUVBQkZFQUNFQjJDOTA0NzVCb2NsYWltX2dlbmVyYXRvcng2QWRvYmVfUGhvdG9zaG9wLzI1LjIuMCBhZG9iZV9jMnBhLzAuNy42IGMycGEtcnMvMC4yNS4ydGNsYWltX2dlbmVyYXRvcl9pbmZvgb9kbmFtZW9BZG9iZSBQaG90b3Nob3BndmVyc2lvbmYyNS4yLjD/aXNpZ25hdHVyZXgZc2VsZiNqdW1iZj1jMnBhLnNpZ25hdHVyZWphc3NlcnRpb25zgqJjdXJseCdzZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmFjdGlvbnNkaGFzaFggSmnBvf+o3kEweL4k7cz4MTrB0WSVNFZxoA1rBrM31K+iY3VybHgpc2VsZiNqdW1iZj1jMnBhLmFzc2VydGlvbnMvYzJwYS5oYXNoLmRhdGFkaGFzaFggL2g6Dghd536quyA5vPlS/9NGA5WvLRkkKJmqn0VxCoFjYWxnZnNoYTI1NgAAKEBqdW1iAAAAKGp1bWRjMmNzABEAEIAAAKoAOJtxA2MycGEuc2lnbmF0dXJlAAAAKBBjYm9y0oREoQE4JKNmc2lnVHN0oWl0c3RUb2tlbnOBoWN2YWxZDjYwgg4yMAMCAQAwgg4pBgkqhkiG9w0BBwKggg4aMIIOFgIBAzEPMA0GCWCGSAFlAwQCAQUAMIGCBgsqhkiG9w0BCRABBKBzBHEwbwIBAQYJYIZIAYb9bAcBMDEwDQYJYIZIAWUDBAIBBQAEIHj4VpJDPzaO0x4hOPnj/w1GTHuwXU0IpBf4VVocIQzoAhB3SsxvHza2JR1fKj3Mjr0yGA8yMDIzMTEwMzExNTcyNloCCQCyOL6wAOGCbaCCC70wggUHMIIC76ADAgECAhAFHp6R1x6RCrvkPVzt0N3ZMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwgSW5jLjE7MDkGA1UEAxMyRGlnaUNlcnQgVHJ1c3RlZCBHNCBSU0E0MDk2IFNIQTI1NiBUaW1lU3RhbXBpbmcgQ0EwHhcNMjMwOTA4MDAwMDAwWhcNMzQxMjA3MjM1OTU5WjBYMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xMDAuBgNVBAMTJ0RpZ2lDZXJ0IEFkb2JlIEFBVEwgVGltZXN0YW1wIFJlc3BvbmRlcjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABE0srlH5A/+15/MFl1asNh8Q8TubOsEVfu0qlJrF0smjtwL1IeHZ/AB7J59u1Trpho1BDN85lfTY30rNBsfT+myjggGLMIIBhzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADAWBgNVHSUBAf8EDDAKBggrBgEFBQcDCDAgBgNVHSAEGTAXMAgGBmeBDAEEAjALBglghkgBhv1sBwEwHwYDVR0jBBgwFoAUuhbZbU2FL3MpdpovdYxqII+eyG8wHQYDVR0OBBYEFLA1qlbDIamLztO4vIsWJVed7zThMFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNFJTQTQwOTZTSEEyNTZUaW1lU3RhbXBpbmdDQS5jcmwwgZAGCCsGAQUFBwEBBIGDMIGAMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wWAYIKwYBBQUHMAKGTGh0dHA6Ly9jYWNlcnRzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNFJTQTQwOTZTSEEyNTZUaW1lU3RhbXBpbmdDQS5jcnQwDQYJKoZIhvcNAQELBQADggIBAHgrjELHhBCEWJSCyRX7lsL0C9LJgbX1ryVYySNRxHkMR2LqC7PQZRJgDNR+kJop8P5v2Bzp/jMrzw4U4pY6rYv3I8HpFlJa4uBwUTIUgHWpi8Xxd1JEEX94POODi7HySekX60A055BozFb7GGVaxb0LreQTRXnkr6ggPNUPX9Gh+2ScOxlTdQQLgZbkdYvxo3Ap6cy9riZijRxOZqiOyWSxMUhgKxeKzwrFW6Xbe0awNhOUXZzIxc4ixpKzWSItpPJ30ZiBQn49U3ADYTnshbN9ZkTA1pHf/Nov2ZUvvddkZ8UYvwo9vBvLTDvnmABnRMBKaXYAs3ZCvw9CkDPOWTeUJMFRAtmUx52ohaA3nD8bCJ6UfpQ2pFfOdShwpb6GKv0g+BgcdIG2LHPJ0Ufmr+XmpgZgq/HIge0hjcCADpjDgq2z4B0L4xtAA1M8MrUx02hxb7104nFKqMuv5zJTQl3sgwqXUyP+9zHQP9y/Z5Fx/AQWrOXCW56dV7P4cFBJl8zHqinlhkOStZ1m22+9Hlq+eC0hJ2lkF1LuzRdJJb/51LXoPKRnopFDng6XpoD7eG6w4YpAx9+P00JuUoBsYSrdsuFiyWyQQGBAnjI69ggbSLcW+hJytuinaxawVlItJkS2eV5Z4XsxPg7f82uRkdtN0hTHeI93CN3OWeRebnK7MIIGrjCCBJagAwIBAgIQBzY3tyRUfNhHrP0oZipeWzANBgkqhkiG9w0BAQsFADBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwHhcNMjIwMzIzMDAwMDAwWhcNMzcwMzIyMjM1OTU5WjBjMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xOzA5BgNVBAMTMkRpZ2lDZXJ0IFRydXN0ZWQgRzQgUlNBNDA5NiBTSEEyNTYgVGltZVN0YW1waW5nIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxoY1BkmzwT1ySVFVxyUDxPKRN6mXUaHW0oPRnkyibaCwzIP5WvYRoUQVQl+kiPNo+n3znIkLf50fng8zH1ATCyZzlm34V6gCff1DtITaEfFzsbPuK4CEiiIY3+vaPcQXf6sZKz5C3GeO6lE98NZW1OcoLevTsbV15x8GZY2UKdPZ7Gnf2ZCHRgB720RBidx8ald68Dd5n12sy+iEZLRS8nZH92GDGd1ftFQLIWhuNyG7QKxfst5Kfc71ORJn7w6lY2zkpsUdzTYNXNXmG6jBZHRAp8ByxbpOH7G1WE15/tePc5OsLDnipUjW8LAxE6lXKZYnLvWHpo9OdhVVJnCYJn+gGkcgQ+NDY4B7dW4nJZCYOjgRs/b2nuY7W+yB3iIU2YIqx5K/oN7jPqJz+ucfWmyU8lKVEStYdEAoq3NDzt9KoRxrOMUp88qqlnNCaJ+2RrOdOqPVA+C/8KI8ykLcGEh/FDTP0kyr75s9/g64ZCr6dSgkQe1CvwWcZklSUPRR8zZJTYsg0ixXNXkrqPNFYLwjjVj33GHek/45wPmyMKVM1+mYSlg+0wOI/rOP015LdhJRk8mMDDtbiiKowSYI+RQQEgN9XyO7ZONj4KbhPvbCdLI/Hgl27KtdRnXiYKNYCQEoAA6EVO7O6V3IXjASvUaetdN2udIOa5kM0jO0zbECAwEAAaOCAV0wggFZMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFLoW2W1NhS9zKXaaL3WMaiCPnshvMB8GA1UdIwQYMBaAFOzX44LScV1kTN8uZz/nupiuHA9PMA4GA1UdDwEB/wQEAwIBhjATBgNVHSUEDDAKBggrBgEFBQcDCDB3BggrBgEFBQcBAQRrMGkwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBBBggrBgEFBQcwAoY1aHR0cDovL2NhY2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZFJvb3RHNC5jcnQwQwYDVR0fBDwwOjA4oDagNIYyaHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZFJvb3RHNC5jcmwwIAYDVR0gBBkwFzAIBgZngQwBBAIwCwYJYIZIAYb9bAcBMA0GCSqGSIb3DQEBCwUAA4ICAQB9WY7Ak7ZvmKlEIgF+ZtbYIULhsBguEE0TzzBTzr8Y+8dQXeJLKftwig2qKWn8acHPHQfpPmDI2AvlXFvXbYf6hCAlNDFnzbYSlm/EUExiHQwIgqgWvalWzxVzjQEiJc6VaT9Hd/tydBTX/6tPiix6q4XNQ1/tYLaqT5Fmniye4Iqs5f2MvGQmh2ySvZ180HAKfO+ovHVPulr3qRCyXen/KFSJ8NWKcXZl2szwcqMj+sAngkSumScbqyQeJsG33irr9p6xeZmBo1aGqwpFyd/EjaDnmPv7pp1yr8THwcFqcdnGE4AJxLafzYeHJLtPo0m5d2aR8XKc6UsCUqc3fpNTrDsdCEkPlM05et3/JWOZJyw9P2un8WbDQc1PtkCbISFA0LcTJM3cHXg65J6t5TRxktcma+Q4c6umAU+9Pzt4rUyt+8SVe+0KXzM5h0F4ejjpnOHdI/0dKNPH+ejxmF/7K9h+8kaddSweJywm228Vex4Ziza4k9Tm8heZWcpw8De/mADfIBZPJ/tgZxahZrrdVcA6KYawmKAr7ZVBtzrVFZgxtGIJDwq9gdkT/r+k0fNX2bwE+oLeMt8EifAAzV3C+dAjfwAL5HYCJtnwZXZCpimHCUcr5n8apIUP/JiW9lVUKx+A+sDyDivl1vupL0QVSucTDh3bNzgaoSv27dZ8/DGCAbgwggG0AgEBMHcwYzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJbmMuMTswOQYDVQQDEzJEaWdpQ2VydCBUcnVzdGVkIEc0IFJTQTQwOTYgU0hBMjU2IFRpbWVTdGFtcGluZyBDQQIQBR6ekdcekQq75D1c7dDd2TANBglghkgBZQMEAgEFAKCB0TAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZIhvcNAQkFMQ8XDTIzMTEwMzExNTcyNlowKwYLKoZIhvcNAQkQAgwxHDAaMBgwFgQU2Rq5M/4XremCHqYT9aQ6cU4+fn0wLwYJKoZIhvcNAQkEMSIEIGmY+GsCefCDmP0PFcYjdxBUfi0EgKYuEZb9pUMyLNuVMDcGCyqGSIb3DQEJEAIvMSgwJjAkMCIEIILa8ZSVezaEAkWP1ScAaf5ixxRW+p4Lhqv4J+hTICfZMAoGCCqGSM49BAMCBEcwRQIgcxxuf7QHV9Fkpj1VhPrFqhNFh8dZzl8qUU/2N3Sr4eoCIQDKu0KGYL++CSsDAXjJciMDbr5ImTy3jw0yQU5GYYeLimd4NWNoYWluglkGMzCCBi8wggQXoAMCAQICEBtbCzvasORd8vMNnlTR2tIwDQYJKoZIhvcNAQELBQAwdTELMAkGA1UEBhMCVVMxIzAhBgNVBAoTGkFkb2JlIFN5c3RlbXMgSW5jb3Jwb3JhdGVkMR0wGwYDVQQLExRBZG9iZSBUcnVzdCBTZXJ2aWNlczEiMCAGA1UEAxMZQWRvYmUgUHJvZHVjdCBTZXJ2aWNlcyBHMzAeFw0yMzAyMDEwMDAwMDBaFw0yNDAyMDEyMzU5NTlaMIGhMREwDwYDVQQDDAhjYWktcHJvZDEcMBoGA1UECwwTQ29udGVudCBDcmVkZW50aWFsczETMBEGA1UECgwKQWRvYmUgSW5jLjERMA8GA1UEBwwIU2FuIEpvc2UxEzARBgNVBAgMCkNhbGlmb3JuaWExCzAJBgNVBAYTAlVTMSQwIgYJKoZIhvcNAQkBFhVncnAtY2FpLW9wc0BhZG9iZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDv0wCnfYY9lkHDsykrTG7FYlnYHBcyualuD5u9ULjzv+FsTWOLg8Nhrz9RTxI9EeBbu3Wm7f4vqPsQYfxkEp0wIa6DVmEOZhbAeRfbhybWQ/D4Wvvck4mEZR+QZmTpIn7HX61gbtMFHlJUxkYBctIoAt9TBAFbz9d5Ig2WG0bsH39b6/8USXnIIk4FB6dtBRT1xeEwSDtwOd1YBpXXNBJmRWHXNJZZ85of2tBTesg/kMvTrOJJxYDZ97U416wcvbVomlees+NXUY3/ZB4xH+NsZils7m1bL2v2hSnHiLoqZeUKklbHUmT4ZpjrZCdtuIsWm5j2PPXKr7HKUuCbZSXBAgMBAAWjggGMMIIBiDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAeBgNVHSUEFzAVBgkqhkiG9y8BAQwGCCsGAQUFBwMEMIGOBgNVHSAEgYYwgYMwgYAGCSqGSIb3LwECAzBzMHEGCCsGAQUFBwICMGUMY1lvdSBhcmUgbm90IHBlcm1pdHRlZCB0byB1c2UgdGhpcyBMaWNlbnNlIENlcnRpZmljYXRlIGV4Y2VwdCBhcyBwZXJtaXR0ZWQgYnkgdGhlIGxpY2Vuc2UgYWdyZWVtZW50LjBdBgNVHR8EVjBUMFKgUKBOhkxodHRwOi8vcGtpLWNybC5zeW1hdXRoLmNvbS9jYV83YTVjM2EwYzczMTE3NDA2YWRkMTkzMTJiYzFiYzIzZi9MYXRlc3RDUkwuY3JsMDcGCCsGAQUFBwEBBCswKTAnBggrBgEFBQcwAYYbaHR0cDovL3BraS1vY3NwLnN5bWF1dGguY29tMB8GA1UdIwQYMBaAFFcpejJNzP7kNU7AHyRzznNTq99qMA0GCSqGSIb3DQEBCwUAA4ICAQBXjlGa3yAK/Gijn6n/JNU9FZm72MP6vc5czrWe9y0T+EawuRvhpD5Edi1TnXkrpe8sMkgSjTGdbY+yGhq8zlCWQeXN1/aWo3L9Xr1uNxY/oVpLn0uWWfnfJ7yR9gKl/yoMfhjydT4t1fXHi/MhfhrWSVRHqX2U31UFGz/e298P2kv+vqhzpIUo1bj+jibtoPLMMQcCOTtKiJOTh4o3VSZpwQDERCzo91NkF+LnZjwYl6fE5USIkg/oCoomXxSPpowybDrcRJ9ilbtJcER48/LGgwzv/c7OYdron4PnEXm1FkOaVj+QRf7OwiNTizonhIzLR5Vfp0QHOWv/bPzvCjPQd+Xr0Q4032WlSxQwostNTAPtoVAU4OCwVH3Ech38emJ00/6fkDCdr7MN8/4n2LSNrMUvaBEZdmLqDCBnO02dbFrmpg3pTc0FqRQ4GL/88pjRNSMy5tU9SoQnSCGYqIsjfL8AzgPEGiXXRgABYc1uXecf4/eayb3K2MPs7hnWTbUKpHHJIwxpdN3vTGdZNWpz9Oxfuo3eELQlkTvACHgqkaXi/FAanHe5PChn6fr1/4cNF8goD0buPApgS3zzwqjRhxrH8ISwPfJn8JqzurMaLDMnnc18tHzUiMtX73jf6oXh7voCxX/T4D3nFPlxU3om2cpcLQ1Wd4026x18rlSGR1kGpTCCBqEwggSJoAMCAQICEAyotlR7iebSBol1zYubieIwDQYJKoZIhvcNAQELBQAwbDELMAkGA1UEBhMCVVMxIzAhBgNVBAoTGkFkb2JlIFN5c3RlbXMgSW5jb3Jwb3JhdGVkMR0wGwYDVQQLExRBZG9iZSBUcnVzdCBTZXJ2aWNlczEZMBcGA1UEAxMQQWRvYmUgUm9vdCBDQSBHMjAeFw0xNjExMjkwMDAwMDBaFw00MTExMjgyMzU5NTlaMHUxCzAJBgNVBAYTAlVTMSMwIQYDVQQKExpBZG9iZSBTeXN0ZW1zIEluY29ycG9yYXRlZDEdMBsGA1UECxMUQWRvYmUgVHJ1c3QgU2VydmljZXMxIjAgBgNVBAMTGUFkb2JlIFByb2R1Y3QgU2VydmljZXMgRzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC3Hy69vQmzXEhs/gyDrmwB6lF4JaSAPomnsbKIZNr2iXaB+fkd85X8eJiNmI7P5O4cVT4Nc1p3zrESqBV4ZUyW8gcZ78QdwoHG8QNd2VNcHnMgSR+XT9Iafsnq9Nfww3Jt9KL3l5ANQ5n1+MJqr48EWNLll942bOL/JH4ywDSMoqhZqtJEIUUUGlQVBZ8CAvJc7LE6ddA5C52PE2Ppa7RfQgHXf4gfXVZwpxYRZcziPiOHqEvLb0J3cShUbejFxV6cwX8QyAPa1ePHg1RtM0HX+D34xHo3DkyGnmT+Ddq00TEDGG26AL5PdINKFIQl+zaq6KJFQe1fdGE5wrWzU4mBPmzaz3EbLn+7FWlwAhorYqIMldbfHE3ydc+aTU1JW7+bG19qmvhO9IluGtTtQDeqFBj2fg6faxsfVfVPD7stN6TwoIDlkOCE4RE+Iin8m3z3eqi/VsTmsmRqBxWDRaqOHz02EJoEDxXJG3ei+UbIIp01XZQvdufm90WxOTuqqan2ZqTPX9K5VdjEh/ovr7xFc5q1dZo+Sa5y4sTVM854/tLU3klOgUKzzSXYPYS3GhBcYJHjwr9xNRHnNX99D6F0g7OijScWfvtjxh13aTv/H0ETvymah4yfDpVdh9cK5YSCPqnuOlsujFAyhYwJXOWDvZZU2EkWVLDhoPx9zp7N4QIDAQABo4IBNDCCATAwEgYDVR0TAQH/BAgwBgEB/wIBADA1BgNVHR8ELjAsMCqgKKAmhiRodHRwOi8vY3JsLmFkb2JlLmNvbS9hZG9iZXJvb3RnMi5jcmwwDgYDVR0PAQH/BAQDAgEGMBQGA1UdJQQNMAsGCSqGSIb3LwEBBzBXBgNVHSAEUDBOMEwGCSqGSIb3LwECAzA/MD0GCCsGAQUFBwIBFjFodHRwczovL3d3dy5hZG9iZS5jb20vbWlzYy9wa2kvcHJvZF9zdmNlX2Nwcy5odG1sMCQGA1UdEQQdMBukGTAXMRUwEwYDVQQDEwxTWU1DLTQwOTYtMzMwHQYDVR0OBBYEFFcpejJNzP7kNU7AHyRzznNTq99qMB8GA1UdIwQYMBaAFKYc4W1UJEyoj0hyv26pjNXk7DHUMA0GCSqGSIb3DQEBCwUAA4ICAQBxzuUHjKbcLdzI4DtlXgCSgZXrlSAkr59pOF3JfPG42qVNAGU7JcEYXJ6+WbfcGwY7WYMl+jO7IvJPb7shXFYW9bnJgxX7lLU14KExchmcLNY1ee6IhBJ2Y8PzZMRUKSd5CkURPg0PBLGjz/KR/DofHx+G4rPTCOGORYxeYrd01lci5hVxvKccvIk7MD69ZTewfZPSM+0WnsU3f0Zmd7hgbRpUyWceG0eHFpdUKK/ZFWhHjDVC28odCnN885tHncKXviItK0ZUUo/AIthFKlhEXsnq9VL9fFbgvO83ZvpUQo5y8mY3cuGnEVGXdhjNb53CfC1u4dbpYmWaN99subUzEsUaUb3loLPfVfzDOpg2y9v37kBdy/wuXr20teY7U62xj/fAgs1QSnhUtlMTfCqbefyEycKVmKIrJkJLsvgTSYKVvH4FFIwfd5WjqOC97jX98rcVAzhAI0iSkazsWOMvL6m0L4nLJapx+85GsVX8Y6AHmEP4bmCElwil6KAP+UewJFiw5rmwV2pESHAhYuZJa03B8tl0nd2QJzvJGmbeBqXqpF9ORinFM3HErK8puRokOjFH2+1asLeI2tB31W/ELdNe27Ogduq6Z6qBwCp59YX27qydDhD0WRfN64kCs25K88iGAGNW2CAfTDS+b+WYJBiIL9jXYZ4LF+BiUvfdu2NwYWRZC70AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZZAQBKX2Q2ihN2fLDLReHISpfOF0xIqNpOZXbBwZ0XanWG98erbIBdawl7r9nVma/uZjYH457wp00TVpKYUTJHMnzJMKskvM2Df4K6t5pUKGtJqEvMXLUy3g9kJq53aYDwikcUE+8wv+CYtu/+vii4XYSXQIxT4NN+JKoTDXmrNH1G46Nmpfq6SKk0g9GQ2brbkW3fzGR0xDxY3BXRy71guSBxN9TAbQGqUjMnkIyBcwV9wUQ2oCW9oIMNKASjW0CRkcFEzzmrQ+y+zHYpNvUaG7QehHcyhvOec3plzlyP6DZeQWp3PHA5bmonI8t5j6Qj15X1KnQiXuJ0rW+xoMA89aIVmpx4VgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAOSaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjYyYTdmYWExLWJmZTMtMjE0Ny04MjAwLWMxM2NlMGU4ZTc1NCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyNzRDMUI3RDdBNDAxMUVFQUJGRUFDRUIyQzkwNDc1QiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyNzRDMUI3QzdBNDAxMUVFQUJGRUFDRUIyQzkwNDc1QiIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMiAoMjAyMzEwMjQubS4yMzc0IDRhYjk0MzkpICAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphYjQzZjNjYy1hNTY4LTRkNGQtOTdiZC1iYjk0YjBlZjhjYmQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NjJhN2ZhYTEtYmZlMy0yMTQ3LTgyMDAtYzEzY2UwZThlNzU0Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+HNvo5wAADZFJREFUeNrsXFtPVUkW3gc4yP0qDigKON517FFbHRGn1TamjaOJvvhsjIkvPplgfEKe1AefNDE+GP+AmWTszPTYcbpn2piJzc1GWwlOekRBEBFQ7jeZ9ZVrnVkUtfc5CGp3h5VU9qUuu3bVV9+67DonND4+7omEQiHPJaWlpYlxcXGLKX8epTCdB5aXNnHU6c2bN5POcaREp+O9dHxSX1/f5s3KL1ImYCkasMrKyvIISJspD+AyZSTpOrodDSaIBpQCkwtgSM8oVd2/f39M2quoqAijmcrKyjG/l7L77vde+v6sfCRgbdu2LY3AtJNSgg0qDa5oTOViKQtM9nXTgQMHaqmpPEoLKXUQqJpcYIqPj/cSEhLMUZgUbYyNjZkjRPpu50n+VEUvKtditMEb7Xom5OrVqzvpkOXIukFps5XXTunO4cOHR7heKp1/ye1gEX9BCcdv6H4330cbCyh9iXrRgJUQ1FmarFWUIqDS4ApiCT9AobxMpj24uI/209LSvMLCwiLKz6fyQModAlW73TeAac6cOV5SUpIBlasv9qKRvgBYIyMj3tDQkDmPdaLRPzwrHA6bhGsNWr9xsMfEZnC7XDSg+tzv4lRCCRPfjJtHjhzpu3LlCkDVx4BKZICsx9gy4PT4rmFQQbIpdfM5ynX7gWrS/Phl7NixI0SDWCCD52Is14vqAXIByoluAkl+fr43f/58Lyvr7cIaHh4OJSYmfkug6rXZApOamprqUb6vned3X4CBujj29/cbkEl/7EUj74o+og4S2gh6xkypk6mUPXnyZN25c+fCDKzm8vLyOuQzqCAtJ06cuH/+/PkwAytMLCR57VjQFy5cmKeAiXJZGOeLFy/iPBVt4Nqeb60dogKLBm9O/FvxXIwVxBAaUBpgixYt8np7e7329vYJZUtKSkwSefHihVdTU9N2586dXrtfmNj09HQz0dMRvAsYD0dhLryrvG8s7/w+ZCrPcJSdx8duAb+6l0WgWqeu/8uMZMoDWCTr+BpMVoZ8jLUq18XXgdohEFg0cXF6kF2s5Uf9NqBwxL0FCxaYSXz58qWZSNzr6+vzioqKIm01NTV5ZLgbT9HuExgGAzBdUOmJEeb6EKD5AJKt1KJ9TwAFNrpz6tSpljNnzgiQuuh8DbNSNx9HlF0mx26/cbTHLy6AsSKGcVCyjWepJwnS2trqbdiwwZyDJaDyUBbslZmZGTG6Hz9+7D18+NDdUSqTkpIyY6B6V5b4mYsBAIGm27rXR/f+DFXGKm5Ega6P7a5lqvw6sbMIcFkKlCUAI6esQI0QBCwBjxirNqCkDACSkZFhQKLVCSassbHR27Jli6kvsnDhQnN8/vy5t3Hjxsj95ubmSQ6CVoEA5a8IBO+LsSKgoskPKxaC1DKo1mmDXF1/AwAyCO+rNoX1FrANVqLA6V6sfuGGgwcPphBovrCBIuwCgRp7+vSpAUd2dra5bmtrM6pvdHTUu3fvnrGdNHhEbt265XV1dXn79+9/y8V0XltbGwkDkKpsqqqqqhG2AmgBrFn5+Qo0Uyw21gRm0kwCLwqAAgC2b99u2AQCVYWyACtUGkRUoC2bNm0yYBIBe/l5ncKaWmg1hrj/47TCRu32ebUam4LyAweEymK1QG+PUdk3PmXCrGZicrej9e99CD0znvs4NsPtRh2fmMMNLmBBYHgDmTC4ly1bNslWAbhu375tyh06dGgCw2kB+yDEAIEh39HR4RsjE+/NkgJKf0DwlNJ3jkndi2Yo/QXOZ5RxWElpOaUqSk99QLWPErzUr2OcD+j7T+GPUKqZocldyu2mWWbMv1mt4T3q2OObSVnNz46MD49xMfelE85ArOGGiA2FSR0cHDRggVe3fv16Lzc317cXCBeUlZUZu8sVBLUF7YrnaDMWygsjWpLJx1eOvCS8LKX+GFeYdPS1T356wLOC7NcOK/g4HSbaSmku2zZtlo0D6l8U5R2mIxmO91/F79iP8aY+lmhAR2Us09PXr439hAles2ZNoK2Tl5dnwgorV66clHfz5k1v165dk8CFuJYfWwm4/Twgn4FMZqO0U00OPg/lsgck0k3Ae6JACq8HamsAJgPl9fOAzef8VLpey1HtVGXUQoZ45b7QawzgojqpauJNZIYnpEXUFpWZw8ZxMqsdEdgUixlUqPMt1RlygE8mv4jO5/M7tFHZXs4HI+uJG4YFQvldnF+sAPRGjd8SSjl8fzGVG6I6Dxk76GcKl8uOlbESh4eHDVOBpWCcQ/1F88qQv2fPnknlnjx5YsIJOBYXF/9/NqhtANcV8ZbYlc8zswJYJJ8H5Eem7A3WxEYmjdVcigycyltBeV/RsVANbDKDrJnL5jom+Dsa+A5e0WDOn7g/Kx3PR/06qpPDjBS28gG6e6pfDT6gimeV5LF6iqh4focxHo84Ne8hzv8ng2sJA6tfjUedROkZbPkqRhbie8JauTEBi7y6ePncAQaaO3fulKLaWgDQgYEBoxrh+WlgiW3l9znFNtp5IBN5kv0YS6vJYgYVVlU120mfUPot58sqbeaBxJh8zqs7TIN+i573R2aMfykGQD2w21dcfx2DMI3yXjOosLqH6Fr6U8VqDHGhzVw2ns8T2BaTWNMefrc09a7PA1R1iNuuYibZwfXmUB8Qq/qrZa9tZjs1i65fcRswHf5O1zuYgZ7yeG1jdq3SbM9gauFF8yimOBYABaN66dKlUwKVS0TVQT2+evVqgjcIYAWxXxQ12O/jcWUq0MlqvwtQsIeo8zOUWoQHOcCTNMbqQsqPcTARE5PCk/+a64woB6HPYf/JMzq57KgqW8AAaKa8Jn4fbfOlKe92wGeoMq13GFQqdwD95aDmZ5Q+Z9AJwwwoYL5Wn3vqHH2JCOU9pkMjg7jWMgH8GYtspVx8cIwW6QYDrV271rccgATGAkhgm8GTfPDggbd161YTWIUqdLGVnPt4lQKsQQebJTCVj7CNlO4YmAwFlCUaBAo0XVR/nK6T+RqTNh5g7GuwLrTyMxlMfY760r/eKI4J+hJSffA1rlm9o989DK5SLtOmnpOm+pCr6zNoojpJVK6HnxFbuKGiomI5u5hRQVVdXW0+0UjowGa97u6Jn5ewewExMIAN3mA0lepjX8nLgsYXMy2P8SAmWJM6zGoJhnkrr7BEBRwbJLYHJJ/zQ5gwZhx7IkMMkEFWfZF8BcxOFU9zAes33L9+yzERMKLP66nMM8V4HjNFpgPI0r9kft4AmwLjzE4wD0Z58S0OMCvk/RMDgB1zHGtZtIoIgopKe/TokRNYnZ2dzroAIsAFo93Vrq0OAxgLdPZ7TZBsLOtBAl2vZbvqE1VWT4JWM/YkDfJk4P4+GtxqR5l07otrYjMdk6Ydj24ebxjwO23CZ6A+YGegiJOn+vY3xcC9jncY5TwA7E92+zGEW/r5+CnbUjdijbXYbJXs8E6ck11aWmp2G+B7oC1Qc2AsP+AAVHqT3RR3Vd5nQ9dO93hw6ik95hX9H7jonF/PIQBjj7ARC9f5rhUTQrlWrt/L9e/y/XbOq1ce0ihfy0A85useZop6K2gJ8P8A0FACo/7De7tV5Qd4sgIa8QDp2IBoDTNOvU7Mlo1sQ44rwNSzwS3t19l14WWq/tb4qLW76rn3Yp2gSd8KCVjwWMqC1JP6nmei8Ddu3DBRdgmI4jshDHbkByVpQ5+rY9P3339fk5OT46m9RVMNLGLQf2cxdCGff62M3I8m1EcY73nqVg4nhBYe/FK+EwJH+E4cpAozgxoQlhEQwGNctWqVUW2rV6+OGOx++96jbcm193bJBrx3lBQV3NRu8o+xgCrWvervsoddWD8pKamQ40Py9QEM00htNrzrnvxY3yeW/kUTIRlbO7kYa4OlxyMsZG87loQ8Yhdv9+7dJkIPYGk28mOrFStWGOMeux+wdx0foq9fvx7Z3QDGgmeK9D63y8j74D2QpI+unZHTAZdsgJzKxE33vfQzowEuluC3q57eyx/EWBn2DQQ3MdDa9bd/xrV8+fLIpx8beH4/HigoKHgbKi4u9s6ePeuVl5cbYOkOIxwB0M30Bj+0DRDhy4LE7KSfszJ9SbAMd0+5vxEjG6EB+SWMRq3eepycnGwMdq0mfX7aNWHbsrAhovvXrl2bpCKRB2DDSZjuKpd2AVa0qX9EMSszK3GOmEWCjopLgBMJE4GEyZajVh8OA9zJXBpUOL98+bJ37Ngxr6WlRbPbuIABrILPS+8KAtRD/3t6ekzsTBbLLKg+HLC0GrxLkzCmAaWTDSptm0QDGf92cMKvdy5duuQdPXpU6+sB7TAAWFCzOI8VTCiLOoinIeaGNqbyO8JZmXlg3a2srPyJANQqQHIBTIPLBlYQc8GTxM5SAdHevXvNr3NgSylGe2Z7owAG2AZHcSbshHJgOJQDoCSeNgumj2hjMbAMqHBBE/IAv0imiU6AjSUGvN9Pv1z2lAtc2AiILTg4r6mpMfGP48ePew0NDdJGU21t7SuXaysAt3e26l85z7LSx5cJ4YbTp0/PJVBN2G6wb9++PJrAzdif5fpBhTaK/f70I1qygPeMrqvq6upi0nmuPyWZlY8XJPWNY7mEVJX5GyNK8yiFg34J7fM3RYEgIyCN09H8jVF1dfXs3xj9CoD1PwEGAKorJqR4atjIAAAAAElFTkSuQmCC";let s,n=150,r=32;const o=[],a=t.Ln((t=>{const i=new St.Image;i.src=t,i.onload=()=>{o.forEach((t=>{var s;const o=new Xr({source:i,fitMode:e.ImageFitMode.Stretch});null===(s=t.ed)||void 0===s||s.ke(o),n=i.width,r=i.height,l(t)}))}}));let h;if(new St.Image instanceof St.HTMLImageElement){const t=new St.Image;t.src=i,h=new Xr({source:t,fitMode:e.ImageFitMode.Stretch})}else if(St.lcjs_setup){const t=new St.Image;t.src=i;const s=St.lcjs_setup(t.naturalWidth,t.naturalHeight);s.getContext("2d").drawImage(t,0,0),h=new Xr({source:s,fitMode:e.ImageFitMode.Stretch})}else h=new U({color:w("#f00")});const l=t=>{if(t.ed){const e=t.dt.pi({x:t.dt.x.getInnerEnd(),y:t.dt.y.getInnerStart()},{x:-(3+n),y:3}),i=t.dt.pi({x:t.dt.x.getInnerEnd(),y:t.dt.y.getInnerStart()},{x:-3,y:3+r}),s={x:i.x-e.x,y:i.y-e.y};t.ed.Ie(e).q(s)}s&&s.bs()};return s=t.nI("logo",Number.MAX_SAFE_INTEGER),i=>{const n={dt:i};return(i=>{i.ed&&i.ed.dispose(),s&&(i.ed=s.Te(i.dt).ke(h).setMouseInteractions(!0).Ce(nt).setMouseEnterEventHandler((()=>{t.Er(e.MouseStyles.Point)})).setMouseLeaveEventHandler((()=>{t.Er(e.MouseStyles.None)})).setMouseClickEventHandler(og).setTouchEndEventHandler(og),l(i))})(n),o.push(n),{Ds:()=>l(n),W:()=>(e=>{e.ed&&(e.ed.dispose(),e.ed=void 0);const i=o.indexOf(e);i>=0&&o.splice(i,1),o.length<=0&&t.Rn(a)})(n)}}},og=()=>St.open("https://lightningchart.com/lightningchart-js/");class ag{constructor(){this.SL=this.UI.bind(this),St.addEventListener("scroll",this.SL,{passive:!0})}W(){this.SL&&St.removeEventListener("scroll",this.SL),this.SL=void 0}}class hg{constructor(t,e){this.Pa=t,this.X=e,this.vL=!0,this.xL=null,this.bL=null}}class lg{constructor(t){this.ML=!1,this._L=1,this.wL=t,this.CL={Pa:u(0,0),X:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),vL:!0,xL:null,bL:null},this.kL=u(64,64),this.TL=new Uint8ClampedArray(this.kL.x*this.kL.y*this._L)}FL(t,e){if(!t.vL)return null;if(t.xL&&t.bL){const i=this.FL(t.xL,e);return null!==i?i:this.FL(t.bL,e)}const i=c(t.X.x,t.X.y);if(t.Pa.x+t.X.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.kL.x-t.Pa.x-1),t.Pa.y+t.X.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.kL.y-t.Pa.y-1),t.X.x===e.x&&t.X.y===e.y)return t.vL=!1,t;if(i.xt.X.y)),a?(s=new hg(ni(t.Pa,{x:0,y:1}),u(t.X.x,e.y)),n=new hg(ni(t.Pa,{x:0,y:e.y+1}),u(t.X.x,t.X.y-1-e.y))):(s=new hg(ni(t.Pa,{x:1,y:0}),u(e.x,t.X.y)),n=new hg(ni(t.Pa,{x:e.x+1,y:0}),u(t.X.x-1-e.x,t.X.y))),t.xL=s,t.bL=n,this.FL(t.xL,e)}IL(t,e){const i={PL:!1,Pa:null};let s=this.FL(this.CL,e);if(null===s)for(;null===s&&this.kL.xthis.wL||t.y>this.wL)return!1;const e=new Uint8ClampedArray(t.x*t.y*this._L);for(let i=0;i{this.zL.WL(t)})),this.VL.clear(),this}UL(t,e){const i=this.EL.get(e);if(i)return i.get(t)}YL(t,e,i){let s=this.EL.get(e);if(s||(s=new Map,this.EL.set(e,s)),s.has(t.glyph))return cg.Success;const n=this.OL.IL(i,t.size);if(!n||!n.Pa)return cg.Fail;n.PL&&this.HL();const r=this.OL.LL(n.RL);if(!r)return cg.Fail;let o=this.VL.get(n.RL);if(!o){const t=this.zL.gl.createTexture();if(!t)throw new gt("Failed to create texture for font!");o=t,this.VL.set(n.RL,t)}const a=n.Pa,h=r.kL.x,l=r.kL.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=a.x/h,m=(a.y+t.size.y)/l,p=(a.x+t.size.x)/h,y=a.y/l,A=[g,m,p,m,g,y,g,y,p,m,p,y],x=[u,c,d,c,u,f,u,f,d,c,d,f],S={origin:a,size:t.size,advanceX:t.advance,baseline:t.baseline,vertices:x,texCoords:A,packerId:n.RL,texture:o};s.set(t.glyph,S);const b=this.zL.gl;return b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),b.bindTexture(b.TEXTURE_2D,o),b.texImage2D(b.TEXTURE_2D,0,b.LUMINANCE,r.kL.x,r.kL.y,0,b.LUMINANCE,b.UNSIGNED_BYTE,this.zL.$L?r.TL:new Uint8Array(r.TL)),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),b.bindTexture(b.TEXTURE_2D,null),n.PL?cg.Resize:cg.Success}HL(){this.EL.forEach((t=>{t.forEach(((e,i)=>{const s=this.OL.LL(e.packerId);if(!s)return;const n=e.origin,r=s.kL.x,o=s.kL.y,a=n.x/r,h=(n.y+e.size.y)/o,l=(n.x+e.size.x)/r,u=n.y/o,c=[a,h,l,h,a,u,a,u,l,h,l,u];e.texCoords=c,t.set(i,e)}))}))}}const gg=t=>{if(t instanceof Li||t instanceof mu)return t._i()?"linear-highPrecision":"linear";if(t instanceof zi){const e={};return t.x instanceof bi&&(e.x={base:t.x.gi()}),t.y instanceof bi&&(e.y={base:t.y.gi()}),["logarithmic",e]}return"linear"},mg=t=>{const e=Object.keys(t),i={};return e.forEach((e=>{const s=t[e];let n=!1;i[e]=t=>{if(!t)return n;const e=s();return n=e,e}})),i},pg=(t,e,i)=>"value"===t.getLookUpProperty()?i:"x"===t.getLookUpProperty()?{min:e.vt(),max:e.xt()}:"y"===t.getLookUpProperty()?{min:e.bt(),max:e.Mt()}:"z"===t.getLookUpProperty()?{min:e.Um(),max:e.Wm()}:void 0,yg=t=>!(!t||"value"!==t.lookUpProperty||!t.lut.percentageValues),Ag=t=>(e,i)=>i%2?e:e+t;class xg{constructor(t){this.XL=new Map,this.jL=le("font"),this.ZL=new Map,this.QL=new Set,this.zL=t}GL(t=!1){return(t||0===this.QL.size)&&(this.XL.forEach(((t,e)=>{t.GL(),this.XL.delete(e)})),this.QL.clear()),this}JL(t){this.QL.add(t)}KL(t){this.QL.delete(t)}qL(t,e,i,s){const n=`${s?"dark":"light"} - ${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let r=this.ZL.get(n);r||(r=this.jL(),this.XL.set(r,new fg(this.zL)),this.ZL.set(n,r));const o=this.XL.get(r);if(!o)throw new gt("Failed to get font texture!");let a=0,h=0,l=0;const u=t.split(""),c=e.size,d=.7*e.size,f=Math.round(1*e.size);let g=!1;for(let t=0;t{if(0===i||360===i||180===i||i%180==0)return{x:t,y:e};if(90===i||-90===i||(i+90)%180==0)return{x:e,y:t};const s=i*Math.PI/180,n=Math.cos(s),r=Math.sin(s);return{x:Math.abs(t*n)+Math.abs(e*r),y:Math.abs(t*r)+Math.abs(e*n)}})(l,h-a+1,i);return{x:m.x,y:m.y,isEstimate:g}}tR(t,e,i){const s=`${i?"dark":"light"} - ${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let n=this.ZL.get(s);n||(n=this.jL(),this.XL.set(n,new fg(this.zL)),this.ZL.set(s,n));const r=this.XL.get(n);if(!r)throw new gt("Failed to get font texture!");let o=0,a=0,h=0;const l=t.split(""),c=new Map;let d=0;const f=e.size;for(let t=0;t{t._a.o=!0})),t=-1,d=0,a=0,o=0,c.clear();continue}if(l===cg.Fail)throw new gt("Failed to create glyph");if(h=r.UL(s,f),!h)throw new gt("Failed to get glyph after creation")}if(""!==s.trim()){let t=c.get(h.texture);t||(t={vertices:[],texCoords:[]},c.set(h.texture,t)),t.vertices.push(...h.vertices.map(Ag(n))),t.texCoords.push(...h.texCoords),a=Math.max(a,h.baseline),o=Math.min(o,h.baseline-(h.size.y-1))}d+=h.advanceX}h=d;const g=m(u(0,o),u(h,a)),p=[];return c.forEach(((t,e)=>{p.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[p,g]}}class Sg{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>bg(t)));for(const i of e)t=i(t);return`${pe(this.modifiers.filter((t=>vg(t)))).map((t=>t.eR)).join("\n")}\n${t}`}}const bg=t=>"function"==typeof t,vg=t=>t&&"object"==typeof t&&"hR"in t,Mg=(...t)=>e=>{t=t.reverse();for(let i of t)"string"==typeof i&&(i=i.includes("{")||i.endsWith(";")?i:`${i};`,i=i.trim(),e=e.replace("void main(void)",`${i}\nvoid main(void)`));return e},Tg=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),wg=(...t)=>e=>{const i=t.filter((t=>!1!==t));for(let t=0;ti=>{for(let t=0;t{if(!r.includes(e))throw new Error(`ShaderBefore misusage (not found: \n${e}\nmatch: \n${t}\nresult: \n${r}\n)`)})),r},kg=(t,...e)=>i=>{const s=e.filter((t=>"string"==typeof t));for(let t=0;t{if(!l.includes(e))throw new Error(`ShaderAfter misusage (not found: "${e}", match: "${t}", result: "${l}")`)})),l},Cg=(...t)=>e=>{for(let i of t)if("string"==typeof i){i=i.endsWith(";")?i:`${i};`,i=i.trim(),i=i.startsWith("\t")?i:`\t${i}`;const t=e.lastIndexOf("}");e=`${e.substring(0,t-1)}\n${i}\n}`}return e},Dg=(t,e)=>i=>{let s,n;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Mg(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Mg(t)(i),n=e.split(" ")[2].replace(";","")}else n=e;return Cg(`\t${n} = ${s};`)(i)},Ig=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e},_g={roundUnsigned:{hR:"roundUnsigned",eR:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{hR:"linearStep",eR:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{hR:"decodeUbyteRGBAEncodedFloat",eR:"\n // Denormalize 8-bit color channels to integers in the range 0 to 255.\n ivec4 floatsToBytes(vec4 inputFloats, bool littleEndian) {\n ivec4 bytes = ivec4(inputFloats * 255.0);\n return (\n littleEndian\n ? bytes.abgr\n : bytes\n );\n }\n \n // Break the four bytes down into an array of 32 bits.\n void bytesToBits(const in ivec4 bytes, out bool bits[32]) {\n for (int channelIndex = 0; channelIndex < 4; ++channelIndex) {\n float acc = float(bytes[channelIndex]);\n for (int indexInByte = 7; indexInByte >= 0; --indexInByte) {\n float powerOfTwo = exp2(float(indexInByte));\n bool bit = acc >= powerOfTwo;\n bits[channelIndex * 8 + (7 - indexInByte)] = bit;\n acc = mod(acc, powerOfTwo);\n }\n }\n }\n \n // Compute the exponent of the 32-bit float.\n float getExponent(bool bits[32]) {\n const int startIndex = 1;\n const int bitStringLength = 8;\n const int endBeforeIndex = startIndex + bitStringLength;\n float acc = 0.0;\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n \n // Compute the mantissa of the 32-bit float.\n float getMantissa(bool bits[32], bool subnormal) {\n const int startIndex = 9;\n const int bitStringLength = 23;\n const int endBeforeIndex = startIndex + bitStringLength;\n // Leading/implicit/hidden bit convention:\n // If the number is not subnormal (with exponent 0), we add a leading 1 digit.\n float acc = float(!subnormal) * exp2(float(bitStringLength));\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n \n // Parse the float from its 32 bits.\n float bitsToFloat(bool bits[32]) {\n float signBit = float(bits[0]) * -2.0 + 1.0;\n float exponent = getExponent(bits);\n bool subnormal = abs(exponent - 0.0) < 0.01;\n float mantissa = getMantissa(bits, subnormal);\n float exponentBias = 127.0;\n return signBit * mantissa * exp2(exponent - exponentBias - 23.0);\n }\n \n // Decode a 32-bit float from the RGBA color channels of a texel.\n float decodeUbyteRGBAEncodedFloat(vec4 rgba, bool littleEndian) {\n ivec4 rgbaBytes = floatsToBytes(rgba, littleEndian);\n bool bits[32];\n bytesToBits(rgbaBytes, bits);\n return bitsToFloat(bits);\n }\n "},texelFetchWithFallback:{webgl2:{hR:"texelFetchWithFallback",eR:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{hR:"texelFetchWithFallback",eR:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (vec2(iTexel) * 2.0 + 1.0) * halfTexel);\n}"}},texelFetchUnsignedWithFallback:{webgl2:{hR:"texelFetchUnsignedWithFallback",eR:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{hR:"texelFetchUnsignedWithFallback",eR:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (vec2(iTexel) * 2.0 + 1.0) * halfTexel);\n}"}},modulus:{hR:"modulus",eR:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{hR:"computeScreenSpaceWireframe",eR:"#extension GL_OES_standard_derivatives : enable\nfloat computeScreenSpaceWireframe (vec3 barycentric, float lineWidth) {\n vec3 dist = fwidth(barycentric);\n vec3 smoothed = smoothstep(dist * ((lineWidth * 0.5) - 0.5), dist * ((lineWidth * 0.5) + 0.5), barycentric);\n return 1.0 - min(min(smoothed.x, smoothed.y), smoothed.z);\n}"}},Fg=(t,e)=>{const i=e.steps,s=i.length-1,n=[Mg("uniform vec4 uFallbackColor")],r=[],o=[];for(let t=0;t= uLUTValue${s}) {\n colorLookup = uLUTColor${s};\n }`,...i.slice(0,-1).map(((t,e)=>`if (value >= uLUTValue${e} && value <= uLUTValue${e+1}) { colorLookup = uLUTColor${e} + vec4(\n uLUTColor${e+1}[0] - uLUTColor${e}[0],\n uLUTColor${e+1}[1] - uLUTColor${e}[1],\n uLUTColor${e+1}[2] - uLUTColor${e}[2],\n uLUTColor${e+1}[3] - uLUTColor${e}[3]\n ) * (value - uLUTValue${e})/(uLUTValue${e+1} - uLUTValue${e});}`)),"vec4 colorFragment = colorLookup")):n.push(Eg("colorFragment","vec4 colorLookup = vec4(uLUTValue0)",`if (${t} <= -340282346638528859811704183484516925440.0) {\n colorLookup = uFallbackColor;\n }`,"float value = "+(e.percentageValues?`clamp((${t} - uMinValue) / (uMaxValue - uMinValue), 0.0, 1.0);`:`${t}`),`if (${t} >= uLUTValue${s}) { colorLookup = uLUTColor${s};}`,...i.slice(1).reverse().map((t=>{const e=i[i.indexOf(t)-1];return`if (value < uLUTValue${i.indexOf(t)}) { colorLookup = uLUTColor${i.indexOf(e)};}`})),"vec4 colorFragment = colorLookup")),n},Lg=[Mg("uniform sampler2D uMaskTexture"),Mg("varying vec2 vMaskTextureCoord"),kg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],zg=[Mg("varying vec3 vPosWorld;","varying vec3 vNormal;","uniform vec3 uCameraLoc;","uniform vec3 uLightLoc;","uniform vec4 uLightColor;","uniform vec4 uAmbientColor;","uniform float uShininess;","uniform float uAmbientReflection;","uniform float uDiffuseReflection;","uniform float uSpecularReflection;"),kg("colorFragment =","float ambientReflection = uAmbientReflection","float diffuseReflection = uDiffuseReflection","float specularReflection = uSpecularReflection","vec3 ambientColor = uAmbientColor.rgb","vec3 diffuseColor = colorFragment.rgb","vec3 specularColor = uLightColor.rgb","vec3 vNormalNormalized = normalize(vNormal)","vNormalNormalized = (float(gl_FrontFacing) * 2.0 - 1.0) * vNormalNormalized","vec3 lightDir = normalize( uLightLoc - vPosWorld )","float lambertian = abs(dot(vNormalNormalized, lightDir))","float specular = 0.0","vec3 R = reflect(-lightDir, vNormalNormalized)","vec3 V = normalize(uCameraLoc - vPosWorld)","float specAngle = max(dot(R,V),0.0)","specular = pow(specAngle, uShininess)","colorFragment = vec4(ambientReflection * ambientColor + diffuseReflection * lambertian * diffuseColor + specularReflection * specular * specularColor, colorFragment.a)")];class Pg extends Error{constructor(t,e,i){super(`Dynamic shader generation error\n(id: ${e})\n ${i?`when applying feature: ${i.idVertex?`vert: ${i.idVertex}`:""} ${i.idFragment?`frag: ${i.idFragment}`:""}`:""} | ${t}`)}}const Rg=(...t)=>{let e="";for(const i of t){if("object"!=typeof i){e+=`${String(i)},`;continue}const t=[{prefix:"",obj:i}];for(;t.length>0;){const{prefix:i,obj:s}=t.shift();e+=`${i}:`;const n=Object.keys(s).sort();for(const i of n){const n=s[i];"object"==typeof n&&n.__proto__===Object.prototype||Array.isArray(n)?t.push({prefix:i,obj:n}):e+=`${i}=${String(n)},`}}}return e},Vg=t=>void 0!==t.find((t=>{var e;return null===(e=t.rR)||void 0===e?void 0:e.nR})),Bg=t=>void 0!==t.find((t=>{var e;return null===(e=t.rR)||void 0===e?void 0:e.oR})),Og=(t,e,...i)=>{const s=[],n=e?"vec3":"vec2",{axisWorldTranslation:r,scaling:o,translation:a,offset:h,flipXY:l,flipXZ:u,splitPosAttribute:c,normalSource:d}=t,f=[];if("attribute"===d&&s.push(Mg("attribute vec3 aNormal"),wg("vec3 normal = aNormal")),"linear-highPrecision"!==r?i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&void 0!==t.variableNameAxisCoord&&(!0!==c?s.push(wg(`${n} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(wg(`${n} ${t.variableNameAxisCoord} = ${e?`vec3(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y, ${t.attributeNameAxisCoord}Z)`:`vec2(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y)`}`)))})):i.forEach((e=>{!0!==t.splitPosAttribute?s.push(wg(`${n} ${e.variableNameAxisCoord}_highpart = ${e.attributeNameAxisCoord}_highpart`),wg(`${n} ${e.variableNameAxisCoord}_lowpart = ${e.attributeNameAxisCoord}_lowpart`)):s.push(wg(`${n} ${e.variableNameAxisCoord}_highpart = vec2(${e.attributeNameAxisCoord}_highpartX, ${e.attributeNameAxisCoord}_highpartY)`),wg(`${n} ${e.variableNameAxisCoord}_lowpart = vec2(${e.attributeNameAxisCoord}_lowpartX, ${e.attributeNameAxisCoord}_lowpartY)`))})),h&&h.rotation){const t=h.rotation.dataType,e="uniform"===t?"u":"a";if("attribute-deg"===t){s.push(Mg("attribute float aRotDeg"),Mg("uniform float uBaseRotDeg"));const t="cRot",e="aInstanceGeo";s.push(wg(`vec2 ${t} = vec2(sin((aRotDeg + uBaseRotDeg) * 0.01745329252), cos((aRotDeg + uBaseRotDeg) * 0.01745329252))`,`vec2 rotatedGeo = vec2(${e}.x * ${t}.y + ${e}.y * ${t}.x, ${e}.y * ${t}.y - ${e}.x * ${t}.x)`))}else{const i=`${e}Rot`;s.push(Mg(`${t} vec2 ${i}`));const n="aInstanceGeo";s.push(wg(`vec2 rotatedGeo = vec2(${n}.x * ${i}.y + ${n}.y * ${i}.x, ${n}.y * ${i}.y - ${n}.x * ${i}.x)`))}}if(h&&s.push(Mg(`attribute ${n} aInstanceGeo`)),!0===l){if("linear-highPrecision"===r)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + flipXY");i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${e?`vec3(${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x, ${t.variableNameAxisCoord}.z)`:`vec2(${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x)`}`)}))}if(!0===u){if("linear-highPrecision"===r)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + flipXZ");i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = vec3(${t.variableNameAxisCoord}.z, ${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x)`)}))}if(o){if("linear-highPrecision"===r)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + scaling");const t=("attribute"===o.dataType?"a":"u")+"Scaling",n=e?"vec3":"vec2";s.push(Mg(`${o.dataType} ${n} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} * ${t}`)}))}if(a&&"axis"===a.sizeUnit){if("linear-highPrecision"===r)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + translation (axis)");const t=("attribute"===a.dataType?"a":"u")+"TranslationAxis",n=e?"vec3":"vec2";s.push(Mg(`${a.dataType} ${n} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} + ${t}`)}))}if(h&&"axis"===h.sizeUnit){if("linear-highPrecision"===r)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + offset (axis)");const t=("attribute"===h.dataType?"a":"u")+"OffsetAxis",o=!0===h.symmetric?"float":n;s.push(Mg(`${h.dataType} ${o} ${t}`));const a=h.halved?" * 0.5":"",l=h.rotation?"rotatedGeo":"aInstanceGeo",u="offsetGeometry";f.push(`${n} ${u} = ${t} * ${l}${a} * sign(uScale)`),e&&"gpu-calculate"===d&&f.push(`${n} normal = ${l}`),i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${t.variableNameAxisCoord} + ${u}`)}))}if(void 0===r||"linear"===r)s.push(Mg(`uniform ${n} uDisp`,`uniform ${n} uScale`)),i.forEach((t=>{f.push(`${n} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord} - uDisp) / uScale`)}));else if("linear-highPrecision"===r)s.push(Mg(`uniform ${n} uDisp`,`uniform ${n} uScale`,`uniform ${n} uScaleStart_highpart`,`uniform ${n} uScaleStart_lowpart`)),i.forEach((t=>{f.push(`${n} ${t.variableNameAxisCoord}_hprecision = (${t.variableNameAxisCoord}_highpart - uScaleStart_highpart) + (${t.variableNameAxisCoord}_lowpart - uScaleStart_lowpart)`,`${n} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord}_hprecision - uDisp) / uScale`,`${n} ${t.variableNameAxisCoord} = ${t.variableNameAxisCoord}_highpart + ${t.variableNameAxisCoord}_lowpart`)}));else if("matrix"===r)s.push(Mg("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("matrix4"===r)s.push(Mg("uniform mat4 uMatrix")),i.forEach((t=>{f.push(`vec4 ${t.variableNameWorldCoord} = uMatrix * ${t.attributeNameAxisCoord}`)}));else if("logarithmic"===r[0]){s.push(Mg(`uniform ${n} uScaleStart`,`uniform ${n} uScaleStartLog`,`uniform ${n} uScaleInterval`,`uniform ${n} uScaleIntervalLog`,`uniform ${n} uViewportStart`,`uniform ${n} uViewportSize`));const t=e?["x","y","z"]:["x","y"],o=[];t.forEach((t=>{const e=r[1][t];if(void 0!==e){const t=e.base;if("e"===t)return;const i=`float cLog${t} = 1.0 / log(${Mi(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(Mg(...o)),i.forEach(((e,i)=>{const s=`${i}`,o=[];t.forEach((t=>{const i=t.toUpperCase(),n=r[1][t];if(void 0===n)f.push(`float posPercent${i}${s} = (${e.variableNameAxisCoord}.${t} - uScaleStart.${t}) / uScaleInterval.${t}`);else{const r=n.base,o="e"===r;f.push(`float posLog${i}${s} = log(${e.variableNameAxisCoord}.${t})${o?"":` * cLog${r}`}`,`float posPercent${i}${s} = (posLog${i}${s} - uScaleStartLog.${t}) / uScaleIntervalLog.${t}`)}o.push(`posPercent${i}${s}`)})),f.push(`${n} ${e.variableNameWorldCoord} = uViewportStart + ${n}(${o.join(", ")}) * uViewportSize`)}))}if(h&&"px"===h.sizeUnit){s.push(Mg("uniform vec2 uRatioPxClip"));const t=("attribute"===h.dataType?"a":"u")+"OffsetPixels",e=!0===h.symmetric?"float":n;s.push(Mg(`${h.dataType} ${e} ${t}`));const r=h.halved?" * 0.5":"",o=`${t} * ${h.rotation?"rotatedGeo":"aInstanceGeo"}${r}`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${o} * uRatioPxClip`)}))}if(h&&"wu"===h.sizeUnit){const t=("attribute"===h.dataType?"a":"u")+"OffsetWU",r=!0===h.symmetric?"float":n;s.push(Mg(`${h.dataType} ${r} ${t}`));const o=h.halved?" * 0.5":"",a=h.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${n} ${l} = ${t} * ${a}${o}`),e&&"gpu-calculate"===d&&f.push(`${n} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l}`)}))}if(h&&"nwu"===h.sizeUnit){s.push(Mg("uniform float uRatioNwuWu"));const t=("attribute"===h.dataType?"a":"u")+"OffsetNWU",r=!0===h.symmetric?"float":n;s.push(Mg(`${h.dataType} ${r} ${t}`));const o=h.halved?" * 0.5":"",a=h.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${n} ${l} = ${t} * ${a}${o}`),e&&"gpu-calculate"===d&&f.push(`${n} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l} * uRatioNwuWu`)}))}return t.snapToNearestPixel&&(s.push(Mg("uniform vec2 uViewportSizePx")),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = 2.0 * floor(((${t.variableNameWorldCoord} + 1.0) * 0.5) * uViewportSizePx + 0.5) / uViewportSizePx - 1.0`)}))),s.push(Eg("gl_Position =",...f)),s},Ng=(t,e,i,s)=>{const n=[],r=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===r)n.push(kg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===r)n.push(kg(i,`${o} ${s} = ${i} * uScale + uDisp + uScaleStart_highpart + uScaleStart_lowpart`));else{if("matrix"===r)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("matrix4"===r)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("logarithmic"!==r[0])throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");{const t=[`${o} ${i}_percent = (${i} - uViewportStart) / uViewportSize`];(e?["x","y","z"]:["x","y"]).forEach((e=>{const s=e.toUpperCase(),n=r[1][e];if(void 0===n)t.push(`float pos${s}Back = ${i}_percent.${e} * uScaleInterval.${e} + uScaleStart.${e}`);else{const r=n.base,o="e"===r?"1.0":`cLog${r}`;t.push(`float pos${s}Back = pow(2.71828, (${i}_percent.${e} * uScaleIntervalLog.${e} + uScaleStartLog.${e}) / ${o})`)}})),t.push(`${o} ${s} = ${o}(posXBack, posYBack${e?", posZBack":""})`),n.push(kg(i,...t))}}return n},Ug=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.rR)||void 0===e?void 0:e.aR})))(t)?[Tg("attribute vec4 aColor"),Tg("vColor = aColor"),Mg("attribute vec4 aColorA"),Mg("attribute vec4 aColorB"),Cg("vColor = mix(aColorA, aColorB, aSegmentSide)")]:[],Gg=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.rR)||void 0===e?void 0:e.lR})))(t)?[Tg("attribute float aLookupValue"),Tg("vLookupValue = aLookupValue"),Mg("attribute float aLookupValueA"),Mg("attribute float aLookupValueB"),Cg("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],Wg={"2D":{idFeature:"2D",apply:t=>({idVertex:"2D",idFragment:"2D",defaultVertexShader:"2D",defaultFragmentShader:"FragmentShader"})},"2DCompose":{idFeature:"2DCompose",apply:t=>({idVertex:"2DCompose",idFragment:"2DCompose",defaultVertexShader:"2DMatrix",defaultFragmentShader:"Empty"})},"3D":{idFeature:"3D",rR:{nR:!0},apply:t=>({idVertex:"3D",idFragment:"3D",defaultVertexShader:"3D",defaultFragmentShader:"FragmentShader"})},PointSize:t=>({idFeature:"PointSize",apply:e=>{const i="uniform"===t?"u":"a";return{idVertex:`SizePrimitive:${Rg(t)}`,idFragment:void 0,vertexShaderModifiers:[Mg(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Cg(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTexture,n=t&&t.overrideOpacity;return{idFeature:"Color",rR:{oR:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,lR:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0,aR:"attribute"===t.dataType||void 0},apply:(r,o)=>{let a,h=`Color:${Rg(t)}`;const l=[];let u="FragmentShader";const c=[];if("uniform"===i)c.push(Mg("uniform vec4 uColor"),wg("vec4 colorFragment = uColor"),...s?Lg:[]);else if("attribute"===i)a="colorAttribute",l.push(Dg("attribute vec4 aColor","varying vec4 vColor")),c.push(Mg("varying vec4 vColor"),wg("vec4 colorFragment = vColor"));else if("texture"===i)a="colorTexCoord",l.push(Dg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),c.push(Mg("varying vec2 vTextureCoord"),Mg("uniform sampler2D uColorTexture"),Mg("uniform vec4 uColor"),wg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.) {\n colorFragment = uColor;\n }"));else if("texture-coord-calc-gpu"===i)a="colorTexCoord",u="Empty",l.push(Mg("attribute vec2 aTextureCoord"),Mg("varying vec2 vTextureCoord"),Cg("vTextureCoord = gl_Position.xy * 0.5 + 0.5")),c.push(Mg("varying vec2 vTextureCoord"),Mg("uniform sampler2D uColorTexture"),wg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","gl_FragColor = colorFragment;"));else if(Array.isArray(i)&&"image"===i[0])a="colorTexCoord",l.push(Dg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1]===e.ImageFitMode.Tile?c.push(Mg("uniform sampler2D uColorTexture"),Mg("varying vec2 vTextureCoord"),wg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);")):c.push(Mg("uniform sampler2D uColorTexture"),Mg("varying vec2 vTextureCoord"),Mg("uniform vec4 uColor"),wg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.){\n colorFragment = uColor;\n }"));else if(Array.isArray(i)&&"lookup"===i[0]){const t=i[1];if("value"===t)a="lookup:value",l.push(Dg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;a=`lookup:${t}`,l.push(Dg(e,"varying float vLookupValue"))}c.push(Mg("varying float vLookupValue"),...Fg("vLookupValue",i[2]))}else if(Array.isArray(i)&&"gradient"===i[0]){h=`Color:${Rg(t)}`;const e=i[1],n=e.getColorStops();Q(e)?c.push(Mg("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Mg(...Ct(n.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),_g.linearStep,wg("vec2 uv = vec2((((gl_FragCoord.x)-uBounds.x)/(uBounds.z))*uAspect,((gl_FragCoord.y)-uBounds.y)/(uBounds.w))","float mixVal = distance(uv/uDistance, uCenter/uDistance)","vec4 color = mix(color_0, color_1, linearStep(stop_0, stop_1, mixVal))",...n.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, mixVal));`)),"vec4 colorFragment = color"),...s?Lg:[]):it(e)&&c.push(Mg("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Mg(...Ct(n.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),_g.linearStep,wg("vec2 uv = gl_FragCoord.xy - uBounds.xy","float magnitude = ((uv.x-uStartPoint.x) * (uEndPoint.x-uStartPoint.x) + (uv.y-uStartPoint.y) * (uEndPoint.y-uStartPoint.y)) / (pow(uEndPoint.x - uStartPoint.x, 2.0) + pow(uEndPoint.y-uStartPoint.y,2.0))","vec4 color = mix(color_0, color_1, linearStep(stop_0, stop_1, magnitude))",...n.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, magnitude))`)),"vec4 colorFragment = color"),...s?Lg:[])}if(!0===s){const t="maskTexture";a=a?`${a} ${t}`:`Color:${t}`,l.push(Dg("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return n&&c.push(Mg("uniform float uOpacity"),kg("colorFragment =","colorFragment.a *= uOpacity")),{vertexShaderModifiers:l,fragmentShader:u,fragmentShaderModifiers:c,idVertex:a,idFragment:h}}}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let n;const r=`ColorShaded3D:${Rg(t)}`;return{idFeature:"ColorShaded3D",rR:{oR:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,lR:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const a=[],h=[];if(a.push("phong"===i&&Dg("normal","varying vec3 vNormal"),Dg("posWorld","varying vec3 vPosWorld")),"uniform"===e)h.push(Mg("uniform vec4 uColorDiffuse"),wg("vec4 colorFragment = uColorDiffuse"));else if("attribute"===e)n="per-vertex-color",a.push(Dg("attribute vec4 aColor","varying vec4 vColor")),h.push(Mg("varying vec4 vColor"),wg("vec4 colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)n="lookup:value",a.push(Dg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;n=`lookup:${t}`,a.push(Dg(e,"varying float vLookupValue"))}h.push(Mg("varying float vLookupValue"),...Fg("vLookupValue",e[2]))}if(s){const t="wireframe";n=n?`${n},${t}`:t,a.push(Dg("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),h.push(Mg("varying vec3 vTriangleBary"),Mg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),_g.computeScreenSpaceWireframe,kg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&h.push(...zg),{idVertex:n,idFragment:r,vertexShaderModifiers:a,fragmentShader:"FragmentShader",fragmentShaderModifiers:h}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=[],s=Vg(e),n=t.coordType?t.coordType:s?"vec3":"vec2";return"linear-highPrecision"!==t.axisWorldTranslation?!0!==t.splitPosAttribute?i.push(Mg(`attribute ${n} aPos`)):i.push(Mg("attribute float aPosX"),Mg("attribute float aPosY"),s&&Mg("attribute float aPosZ")):!0===t.splitPosAttribute?i.push(Mg("attribute float aPos_highpartX"),Mg("attribute float aPos_lowpartX"),Mg("attribute float aPos_highpartY"),Mg("attribute float aPos_lowpartY")):i.push(Mg(`attribute ${n} aPos_highpart`),Mg(`attribute ${n} aPos_lowpart`)),i.push(...Og(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"vec4"===t.coordType?void 0:"posAxis",variableNameWorldCoord:"posWorld"})),{idVertex:`VertexLocation:${Rg(t)}`,idFragment:void 0,vertexShaderModifiers:i}}}),Model3D:t=>({idFeature:"Model3D",apply:e=>{const i=[];return i.push(Mg("attribute vec3 aGeoPos"),Mg("uniform mat4 uModelRotation"),Mg("uniform mat4 uModelRotationNormals"),Mg("uniform vec3 uLocationAxis"),Mg("uniform vec3 uModelAlignment"),Mg("uniform vec3 uModelScale"),Mg("uniform vec3 uModelSize"),...Og({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,{attributeNameAxisCoord:"uLocationAxis",variableNameAxisCoord:"locationAxis",variableNameWorldCoord:"locationWorld"}),Eg("gl_Position =","vec3 posWorld = locationWorld + ((uModelRotation * vec4(aGeoPos, 1.0)).xyz - (uModelAlignment + 1.0) * uModelSize/2.0) * uModelScale;"),"attribute"===t.normalSource&&kg("vec3 normal ="," normal = (uModelRotationNormals * vec4(normal, 1.0)).xyz;"),...Bg(e)?Ng({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,"posWorld","posAxis"):[]),{vertexShaderModifiers:i,idVertex:`Model3D:${Rg(t)}`,idFragment:void 0}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",apply:e=>({idVertex:`LineInstanced2D:${Rg(t)}`,idFragment:void 0,vertexShaderModifiers:[Mg("uniform float uThicknessPixels"),Mg("uniform vec2 uRatioPxClip"),..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Mg("attribute vec2 aLocationA"),Mg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Mg("attribute vec2 aLocationA_highpart"),Mg("attribute vec2 aLocationB_highpart"),Mg("attribute vec2 aLocationA_lowpart"),Mg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Mg("attribute float aLocationAX"),Mg("attribute float aLocationAY"),Mg("attribute float aLocationBX"),Mg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Mg("attribute float aLocationA_highpartX"),Mg("attribute float aLocationA_highpartY"),Mg("attribute float aLocationB_highpartX"),Mg("attribute float aLocationB_highpartY"),Mg("attribute float aLocationA_lowpartX"),Mg("attribute float aLocationA_lowpartY"),Mg("attribute float aLocationB_lowpartX"),Mg("attribute float aLocationB_lowpartY")]:[],Mg("attribute vec2 aSegmentPosition"),Mg("attribute float aSegmentSide"),...Og(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),t.ensureMinimumSegmentLength&&Mg("uniform vec2 uMinSegmentPixelVector"),kg("worldB = ",t.ensureMinimumSegmentLength&&"float segmentLengthPixels = sqrt(pow(worldB.x - worldA.x, 2.0) + pow(worldB.y - worldA.y, 2.0)) / length(uRatioPxClip)",t.ensureMinimumSegmentLength&&"if (segmentLengthPixels == 0.0 || segmentLengthPixels < length(uMinSegmentPixelVector)) {\n worldB = worldA + uMinSegmentPixelVector * uRatioPxClip;\n }","vec2 directionBasis = worldB - worldA","vec2 directionBasisNorm = normalize(directionBasis)","vec2 perpendBasisNorm = vec2(-directionBasisNorm.y, directionBasisNorm.x)","vec2 offset = mix(worldA, worldB, aSegmentSide)","vec2 thicknessDirection = aSegmentPosition.x * directionBasisNorm + aSegmentPosition.y * perpendBasisNorm","vec2 posWorld = offset + thicknessDirection * uThicknessPixels * uRatioPxClip"),...Gg(e),...Ug(e),...Bg(e)?Ng(t,!1,"posWorld","posAxis"):[]]})}),Area2D:t=>({idFeature:"Area2D",apply:e=>({idVertex:`Area2D:${Rg(t)}`,idFragment:void 0,vertexShaderModifiers:[..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Mg("attribute vec2 aLocationA"),Mg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Mg("attribute vec2 aLocationA_highpart"),Mg("attribute vec2 aLocationB_highpart"),Mg("attribute vec2 aLocationA_lowpart"),Mg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Mg("attribute float aLocationAX"),Mg("attribute float aLocationAY"),Mg("attribute float aLocationBX"),Mg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Mg("attribute float aLocationA_highpartX"),Mg("attribute float aLocationA_highpartY"),Mg("attribute float aLocationB_highpartX"),Mg("attribute float aLocationB_highpartY"),Mg("attribute float aLocationA_lowpartX"),Mg("attribute float aLocationA_lowpartY"),Mg("attribute float aLocationB_lowpartX"),Mg("attribute float aLocationB_lowpartY")]:[],Mg("attribute float aCurveOrBaseline"),Mg("attribute float aSegmentSide"),...Og(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),kg("worldB = ","vec2 posCoord = mix(worldA, worldB, aSegmentSide)","float baseline = min(posCoord.y, -1.0)","vec2 posWorld = vec2(posCoord.x, mix(posCoord.y, baseline, aCurveOrBaseline))"),...Gg(e),...Ug(e),...Bg(e)?Ng(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${Rg(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Mg("uniform float uOffsetWU"),Mg("attribute vec3 aLocationA"),Mg("attribute vec3 aLocationB"),Mg("attribute float aSegmentPosition"),Mg("attribute float aPerpendHorizontal"),Mg("attribute float aPerpendVertical"),...Og({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Vg(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),kg("worldB = ","vec3 directionBasis = worldB - worldA","vec3 directionBasisNorm = normalize(directionBasis)","vec3 notParallel = normalize(mix( vec3( 0.0, 1.0, 0.0 ), vec3( 0.2, 0.8, 0.0 ), step( abs(directionBasis.y), 0.9 ) ))","vec3 horizontalBasis = normalize( cross( notParallel, directionBasisNorm ) )","vec3 verticalBasis = normalize( cross( horizontalBasis, directionBasisNorm ) )","vec3 normal = aPerpendHorizontal * horizontalBasis + aPerpendVertical * verticalBasis","vec3 posWorld = worldA + aSegmentPosition * directionBasis + normal * uOffsetWU * 0.5"),...Bg(e)?Ng({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[Mg("attribute vec3 aEdge"),Mg("uniform float uEdgeRoundness"),kg("posWorld =","vec3 boxSizeWorld = abs( aOffsetAxis / uScale )","float boxMinDimensionWorldXZ = min( boxSizeWorld.x, boxSizeWorld.z )","vec3 edgeRoundAmount = uEdgeRoundness * vec3( boxMinDimensionWorldXZ, min( boxMinDimensionWorldXZ, boxSizeWorld.y ), boxMinDimensionWorldXZ )","posWorld = posWorld + aEdge * edgeRoundAmount")]})},ColorGrid2D:t=>{const e=t.flipXY,i=t.intensityTextureType,s=t.littleEndian;return{idFeature:"ColorGrid2D",apply:(n,r)=>({idVertex:void 0,idFragment:`ColorGrid2D:${Rg(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[Mg("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&_g.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?wg("vec2 cellSizePx = uTileBounds.zw / (uTileDimensions - 1.0)","vec2 cellIndex = (gl_FragCoord.xy - uTileBounds.xy) / cellSizePx","vec2 cellStart = floor(cellIndex)","vec2 cellEnd = ceil(cellIndex)","vec2 cellStartNormalized = cellStart / (uTileDimensions - 1.0)","vec2 cellEndNormalized = cellEnd / (uTileDimensions - 1.0)",`vec4 sample00 = texture2D(uTileIntensityValues, ${e?"cellStartNormalized":"vec2(cellStartNormalized.y, cellStartNormalized.x)"})`,`vec4 sample01 = texture2D(uTileIntensityValues, ${e?"vec2(cellStartNormalized.x, cellEndNormalized.y)":"vec2(cellStartNormalized.y, cellEndNormalized.x)"})`,`vec4 sample10 = texture2D(uTileIntensityValues, ${e?"vec2(cellEndNormalized.x, cellStartNormalized.y)":"vec2(cellEndNormalized.y, cellStartNormalized.x)"})`,`vec4 sample11 = texture2D(uTileIntensityValues, ${e?"cellEndNormalized":"vec2(cellEndNormalized.y, cellEndNormalized.x)"})`,"float intensity00 = "+("float"===i?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${s})`),"float intensity01 = "+("float"===i?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${s})`),"float intensity10 = "+("float"===i?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${s})`),"float intensity11 = "+("float"===i?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${s})`),"vec2 lerpFactors = cellIndex - cellStart",`float intensityR1 = mix(intensity00, intensity10, ${e?"lerpFactors.x":"lerpFactors.y"})`,`float intensityR2 = mix(intensity01, intensity11, ${e?"lerpFactors.x":"lerpFactors.y"})`,`float intensityP = mix(intensityR1, intensityR2, ${e?"lerpFactors.y":"lerpFactors.x"})`):wg("vec2 cellSizePx = uTileBounds.zw / (uTileDimensions)","vec2 cellIndex = (gl_FragCoord.xy - uTileBounds.xy) / cellSizePx","vec2 cellIndexNormalized = cellIndex / uTileDimensions",`vec4 sample0 = texture2D(uTileIntensityValues, ${e?"cellIndexNormalized":"vec2(cellIndexNormalized.y, cellIndexNormalized.x)"})`,"float intensityP = "+("float"===i?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${s})`)),...Fg("intensityP",t.lut)]})}},DrawToNormalTexture:t=>{const e=t.flipXZ,i=t.vertexIdSource,s=t.normalTextureType,n=t.heightmapTextureType,r=t.littleEndian;return{idFeature:"DrawToNormalTexture",apply:(o,a)=>{const h=[],l=[];return h.push(Mg("uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB","attribute"===i&&"attribute float aVertexID"),void 0!==i&&_g.roundUnsigned,_g.modulus,_g.texelFetchWithFallback[a],"ubyte"===n&&_g.decodeUbyteRGBAEncodedFloat,wg(void 0===i?"int iVertex = gl_VertexID":"int iVertex = int(roundUnsigned(aVertexID))","int iSecondary = modulus(iVertex, (uTileDimensions.y - 1))","int iPrimary = iVertex / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 uTileDimensionsMinus1 = vec2(uTileDimensions) - 1.0","vec2 halfTexelWorld = 2.0 / (uTileDimensionsMinus1 * 2.0)","vec2 posWorld = vec2(-1.0 + halfTexelWorld.y + iCell.y * 2.0 * halfTexelWorld.y, -1.0 + halfTexelWorld.x + iCell.x * 2.0 * halfTexelWorld.x)","vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)",`vec3 posAxis0 = vec3(\n uTileStartLocationAxisXZ.x + iCell.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===n?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${r})`} ,\n uTileStartLocationAxisXZ.y + iCell.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell1 = iCell + vec2(1.0, 0.0)",`vec3 posAxis1 = vec3(\n uTileStartLocationAxisXZ.x + iCell1.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===n?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${r})`},\n uTileStartLocationAxisXZ.y + iCell1.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell2 = iCell + vec2(0.0, 1.0)",`vec3 posAxis2 = vec3(\n uTileStartLocationAxisXZ.x + iCell2.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===n?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${r})`},\n uTileStartLocationAxisXZ.y + iCell2.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell3 = iCell + vec2(1.0, 1.0)",`vec3 posAxis3 = vec3(\n uTileStartLocationAxisXZ.x + iCell3.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===n?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${r})`},\n uTileStartLocationAxisXZ.y + iCell3.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec3 normal = normalize(cross(posAxis2 - posAxis0, posAxis1 - posAxis0) + cross(posAxis1 - posAxis3, posAxis2 - posAxis3))","uint"===s?"vNormalRGB = uvec3(((normal / 2.0) + 0.5) * float(-1u))":"vNormalRGB = (normal / 2.0) + 0.5","gl_PointSize = 1.0")),l.push(Mg("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),wg("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${Rg(t)}`,idFragment:`DrawToNormalTexture:${Rg(t)}`,vertexShaderModifiers:h,fragmentShaderModifiers:l,fragmentShader:"Empty",hints:["uint"===s&&{type:"fragOutput",fragOutput:"uvec4"}]}}}},SurfaceGrid:t=>{const e=t.fillColor,i=t.interpolation,s=t.flipXZ,n=t.shadingStyle,r=t.wireframe,o=t.instanceIdSource,a=t.normalTextureType,h=t.heightmapTextureType,l=t.intensityTextureType,u=t.littleEndian;return{idFeature:"SurfaceGrid",apply:(c,d)=>{const f=[],g=[];return f.push(Mg("attribute vec2 aGeoCellOffset","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","attribute"===o&&"attribute float aInstanceID"),void 0!==o&&_g.roundUnsigned,_g.modulus,_g.texelFetchWithFallback[d],"ubyte"===h&&_g.decodeUbyteRGBAEncodedFloat,wg(void 0===o?"int iInstance = gl_InstanceID":"int iInstance = int(roundUnsigned(aInstanceID))","iInstance = iInstance + uBaseInstance","int iSecondary = modulus(iInstance, (uTileDimensions.y - 1))","int iPrimary = iInstance / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 iCellVertex = iCell + aGeoCellOffset","vec2 uTileDimensionsMinus1 = vec2(float(uTileDimensions.x), float(uTileDimensions.y)) - 1.0","vec2 ySampleCoordinate = vec2(iCellVertex.y, iCellVertex.x) / vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x)","float y = "+("float"===h?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${u})`),"vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)","vec2 posAxisXZ = uTileStartLocationAxisXZ + cellSizeAxis * "+(s?"vec2(iCellVertex.y, iCellVertex.x)":"iCellVertex"),"vec3 posAxis = vec3(posAxisXZ.x, y, posAxisXZ.y)")),f.push(...Og({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===n&&f.push(Dg("posWorld","varying vec3 vPosWorld"),..."uint"===a?[_g.texelFetchUnsignedWithFallback[d],Cg("vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Cg("vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Cg("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),Mg("varying vec3 vNormal",..."uint"===a?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),g.push(Mg("varying vec3 vTriangleBary")),"uniform"===e?g.push(Mg("uniform vec4 uColorDiffuse"),wg("vec4 colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]?"value"===e[1]?(f.push(Dg("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),g.push(Mg("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===l&&_g.decodeUbyteRGBAEncodedFloat,"bilinear"===i?wg("vec2 cellSizeAxisXZ = uTileBoundsAxisXZ.zw / (uTileDimensionsXZ - 1.0)","vec2 cellIndex = (vVertexLocationAxisXZ - uTileBoundsAxisXZ.xy) / cellSizeAxisXZ","vec2 cellStart = floor(cellIndex)","vec2 cellEnd = ceil(cellIndex)","vec2 cellStartNormalized = cellStart / (uTileDimensionsXZ - 1.0)","vec2 cellEndNormalized = cellEnd / (uTileDimensionsXZ - 1.0)",`vec4 sample00 = texture2D(uTileIntensityValues, ${s?"cellStartNormalized":"vec2(cellStartNormalized.y, cellStartNormalized.x)"})`,`vec4 sample01 = texture2D(uTileIntensityValues, ${s?"vec2(cellStartNormalized.x, cellEndNormalized.y)":"vec2(cellStartNormalized.y, cellEndNormalized.x)"})`,`vec4 sample10 = texture2D(uTileIntensityValues, ${s?"vec2(cellEndNormalized.x, cellStartNormalized.y)":"vec2(cellEndNormalized.y, cellStartNormalized.x)"})`,`vec4 sample11 = texture2D(uTileIntensityValues, ${s?"cellEndNormalized":"vec2(cellEndNormalized.y, cellEndNormalized.x)"})`,"float intensity00 = "+("float"===l?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${u})`),"float intensity01 = "+("float"===l?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${u})`),"float intensity10 = "+("float"===l?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${u})`),"float intensity11 = "+("float"===l?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${u})`),"vec2 lerpFactors = cellIndex - cellStart",`float intensityR1 = mix(intensity00, intensity10, ${s?"lerpFactors.x":"lerpFactors.y"})`,`float intensityR2 = mix(intensity01, intensity11, ${s?"lerpFactors.x":"lerpFactors.y"})`,`float intensityP = mix(intensityR1, intensityR2, ${s?"lerpFactors.y":"lerpFactors.x"})`):wg("vec2 cellSizeAxisXZ = uTileBoundsAxisXZ.zw / (uTileDimensionsXZ - 1.0)","vec2 cellIndex = floor((vVertexLocationAxisXZ - uTileBoundsAxisXZ.xy) / cellSizeAxisXZ)","vec2 cellIndexNormalized = cellIndex / (uTileDimensionsXZ - 1.0)",`vec4 sample0 = texture2D(uTileIntensityValues, ${s?"cellIndexNormalized":"vec2(cellIndexNormalized.y, cellIndexNormalized.x)"})`,"float intensityP = sample0.x"),...Fg("intensityP",e[2]))):(f.push(Dg(`posAxis.${e[1]}`,"varying float vLookupValue")),g.push(Mg("varying float vLookupValue"),...Fg("vLookupValue",e[2]))):void 0===e&&g.push(wg("vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0)")),"phong"===n&&g.push(...zg),r&&(f.push(Mg("attribute vec3 aTriangleBary"),Dg("aTriangleBary","varying vec3 vTriangleBary")),g.push(Mg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),_g.computeScreenSpaceWireframe,kg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)",e?"if (edge > 0.0) {\n colorFragment = vec4(mix(colorFragment.rgb, uWireframeColor.rgb, edge * uWireframeColor.a), max(colorFragment.a, uWireframeColor.a));\n }":"if (edge > 0.0) {\n colorFragment = uWireframeColor;\n } else {\n discard;\n }"))),{idVertex:`SurfaceGrid:${Rg(t)}`,idFragment:`SurfaceGrid:${Rg(t)}`,vertexShaderModifiers:f,fragmentShader:"FragmentShader",fragmentShaderModifiers:g}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${Rg(t)}`,idFragment:`DebugSurfaceGridNormals:${Rg(t)}`,vertexShaderModifiers:[Mg("attribute float aNormalArrow","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","attribute"===t.instanceIdSource&&"attribute float aInstanceID",..."uint"===t.normalTextureType?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"]),_g.roundUnsigned,_g.modulus,_g.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&_g.decodeUbyteRGBAEncodedFloat,wg(void 0===t.instanceIdSource?"int iInstance = gl_InstanceID":"int iInstance = int(roundUnsigned(aInstanceID))","iInstance = iInstance + uBaseInstance","int iSecondary = modulus(iInstance, (uTileDimensions.y - 1))","int iPrimary = iInstance / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 uTileDimensionsMinus1 = vec2(float(uTileDimensions.x), float(uTileDimensions.y)) - 1.0","float y00 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y01 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y10 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y11 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y = (y00 + y01 + y10 + y11) / 4.0","vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)",`vec2 posAxisXZ = uTileStartLocationAxisXZ + cellSizeAxis * (0.5 + ${t.flipXZ?"vec2(iCell.y, iCell.x)":"iCell"})`,"vec3 posAxis = vec3(posAxisXZ.x, y, posAxisXZ.y)",..."uint"===t.normalTextureType?["vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)"]:["vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))"],"vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vec3 normalWorld = normalize(normalAxis * uScale)"),..."uint"===t.normalTextureType?[_g.texelFetchUnsignedWithFallback[i]]:[],...Og({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),kg("posWorld =","vec3 dirArrow = normalWorld","vec3 posArrowStart = posWorld","vec3 posArrowEnd = posWorld + dirArrow * 0.010","vec3 notParallel = normalize(mix( vec3( 0.0, 1.0, 0.0 ), vec3( 0.2, 0.8, 0.0 ), step( abs(dirArrow.y), 0.9 ) ))","vec3 dirArrowLeft = normalize(-dirArrow + 0.50 * normalize(cross(dirArrow, notParallel)))","vec3 dirArrowRight = normalize(-dirArrow + 0.50 * normalize(cross(notParallel, dirArrow)))","vec3 posArrowLeft = posArrowEnd + dirArrowLeft * 0.0025","vec3 posArrowRight = posArrowEnd + dirArrowRight * 0.0025","if (aNormalArrow == 0.0) {\n posWorld = posArrowStart;\n } else if (aNormalArrow == 1.0) {\n posWorld = posArrowEnd;\n } else if (aNormalArrow == 2.0) {\n posWorld = posArrowLeft;\n } else if (aNormalArrow == 3.0) {\n posWorld = posArrowRight;\n }")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Cg("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",apply:t=>({idVertex:"OffsetTowardsCamera",idFragment:void 0,vertexShaderModifiers:[Mg("uniform vec3 uCameraLoc"),kg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[Mg("attribute float aSegmentInside"),Mg("varying float vSegmentInside"),Mg("varying float vSegmentSide"),kg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[Ig("#extension GL_OES_standard_derivatives : enable"),Mg("uniform float uAALimit"),Mg("varying float vSegmentInside"),Mg("varying float vSegmentSide"),kg("antiAliasFactor = ","\n float dist = (uAALimit - vSegmentInside);\n vec2 ddist = vec2(dFdx(dist), dFdy(dist));\n float pixelDist = dist / length(ddist);\n // additional blurring\n pixelDist *= 0.5;\n\n float aa = clamp(0.5 - pixelDist, 0.0, 1.0);\n if((vSegmentSide <= 0.0 || vSegmentSide >= 1.0) && aa <=0.99){\n aa *= 0.5;\n }\n antiAliasFactor = aa;\n ")]})},Glow1D:t=>({idFeature:"Glow1D",apply:()=>{const e=Math.round(t.spreadPx),i=Math.round(t.blurPx),s=e+i,n=t.firstPass,r=[];for(let t=-s;t<=s;t+=1){const e=Math.abs(t);r.push(n?{x:t.toFixed(1),y:"0.0",distPx:e.toFixed(1)}:{x:"0.0",y:t.toFixed(1),distPx:e.toFixed(1)})}return{idVertex:`Glow1D:${Rg(t)}`,idFragment:`Glow1D:${Rg(t)}`,vertexShaderModifiers:[Dg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Mg("uniform sampler2D uTexture"),Mg("varying vec2 vTextureCoord"),Mg("uniform vec2 uTextureSize"),n&&Mg("uniform vec2 uOffsetPx"),!n&&Mg("uniform sampler2D uTextureFirstGlowPass"),!n&&Mg("uniform vec4 uGlowColor"),kg("antiAliasFactor =","vec2 oneTexel = vec2(1.0, 1.0) / uTextureSize",...n?[]:["float inverseIntensity =\n 0.25 * texture2D(uTexture, vTextureCoord).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, 0.0)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, 0.0)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(0.0, -oneTexel.y)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(0.0, oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, -oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, -oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, oneTexel.y)).a","antiAliasFactor *= 1.0 - (inverseIntensity * inverseIntensity)","if (antiAliasFactor <= 0.0) { discard; }"],"float distancePx = 255.0","vec2 sample_tx = vec2(0.0)",...n?["vec2 texCoordOffset = vTextureCoord - uOffsetPx * oneTexel",...r.map(((t,e)=>[`sample_tx = texCoordOffset + oneTexel * vec2(${t.x}, ${t.y})`,`if (distancePx > ${t.distPx} && sample_tx.x <= 1.0 && sample_tx.y <= 1.0 && sample_tx.x >= 0.0 && sample_tx.y >= 0.0 && texture2D(uTexture, sample_tx).a > 0.0) { distancePx = ${t.distPx}; }`])).flat(),"vec4 colorFragment = vec4(distancePx / 255.0, 0.0, 0.0, 1.0)"]:["vec4 sample_horizontal = vec4(0.0)","float horizontal_dist = 255.0","float min_horizontal_dist = 255.0",...r.map(((t,e)=>[`sample_tx = vTextureCoord + oneTexel * vec2(${t.x}, ${t.y})`,"if (sample_tx.x <= 1.0 && sample_tx.y <= 1.0 && sample_tx.x >= 0.0 && sample_tx.y >= 0.0) {\n sample_horizontal = texture2D(uTextureFirstGlowPass, sample_tx);\n horizontal_dist = sample_horizontal.r * 255.0;\n }","if (sample_horizontal.a < 0.9) { horizontal_dist = 255.0; }","min_horizontal_dist = min(min_horizontal_dist, horizontal_dist)",`distancePx = min(distancePx, pow(horizontal_dist * horizontal_dist + ${t.y} * ${t.y}, 0.5))`])).flat(),`if (distancePx > ${s.toFixed(1)}) { discard; }`,"vec4 pixelGlowColor = vec4(0.0, 0.0, 0.0, 0.0)",`if (distancePx > ${e.toFixed(1)}) {\n float lerpAmount = (distancePx - ${e.toFixed(1)}) / ${(i+1).toFixed(1)};\n pixelGlowColor = mix(uGlowColor, vec4(uGlowColor.rgb, 0.0), 1.0 - (1.0 - lerpAmount) * (1.0 - lerpAmount));\n } else {\n pixelGlowColor = uGlowColor;\n }`,"vec4 colorFragment = pixelGlowColor"])]}}}),MousePicking:{idFeature:"MousePicking",apply:t=>({idVertex:void 0,idFragment:"MousePicking",fragmentShaderModifiers:[Mg("uniform vec4 uColor"),wg("vec4 colorFragment = uColor"),t=>t.replace("gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor)","if (antiAliasFactor <= 0.0) { discard; }\ngl_FragColor = fragColorEnd")]})},MousePickingAttribute:{idFeature:"MousePickingAttribute",apply:t=>({idVertex:"MousePickingAttribute",idFragment:"MousePickingAttribute",vertexShaderModifiers:[Dg("attribute vec4 aColor","varying vec4 vColor")],fragmentShaderModifiers:[Mg("varying vec4 vColor"),wg("vec4 colorFragment = vColor"),t=>t.replace("gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor)","if (antiAliasFactor <= 0.0) { discard; }\ngl_FragColor = fragColorEnd")]})},AttributeHighlight:{idFeature:"AttributeHighlight",apply:t=>({idVertex:"AttributeHighlight",idFragment:"AttributeHighlight",vertexShaderModifiers:[Dg("attribute float aIsHighlighted","varying float vIsHighlighted")],fragmentShaderModifiers:[t=>t.replace("uniform float uIsHighlighted","varying float vIsHighlighted").replace("uIsHighlighted","vIsHighlighted")]})},StippleTexture:{idFeature:"StippleTexture",apply:(t,e)=>({idVertex:"StippleTexture",idFragment:"StippleTexture",vertexShaderModifiers:[Mg("attribute vec2 aLengthSoFar"),Mg("varying float vLengthSoFar"),Mg("uniform vec2 uStippleCount"),Cg("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Mg("uniform sampler2D uStippleTexture"),Mg("uniform float uStippleScale"),Mg("varying float vLengthSoFar"),"webgl1"===e&&Mg("uniform float uStippleTextureWidthLimiter"),kg("antiAliasFactor = ",`\n float stippleSampleY = texture2D(\n uStippleTexture, \n ${"webgl1"===e?"vec2(mod((vLengthSoFar / uStippleScale) , uStippleTextureWidthLimiter), 0)":"vec2((vLengthSoFar / uStippleScale), 0)"}\n ).r;\n float stippleAA = (stippleSampleY - 0.5) * 2.0;\n antiAliasFactor *= stippleAA;\n if (antiAliasFactor <= 0.0) { discard; }`)]})},StippleTextureInstanced:{idFeature:"StippleTextureInstanced",apply:(t,e)=>({idVertex:"StippleTextureInstanced",idFragment:"StippleTextureInstanced",vertexShaderModifiers:[Mg("attribute vec2 aLengthSoFarA"),Mg("attribute vec2 aLengthSoFarB"),Mg("varying float vLengthSoFar"),Mg("uniform vec2 uStippleCount"),Cg("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Mg("uniform sampler2D uStippleTexture"),Mg("uniform float uStippleScale"),Mg("varying float vLengthSoFar"),"webgl1"===e&&Mg("uniform float uStippleTextureWidthLimiter"),kg("antiAliasFactor = ",`\n float stippleSampleY = texture2D(\n uStippleTexture, \n ${"webgl1"===e?"vec2(mod((vLengthSoFar / uStippleScale) , uStippleTextureWidthLimiter), 0)":"vec2((vLengthSoFar / uStippleScale), 0)"}\n ).r;\n float stippleAA = (stippleSampleY - 0.5) * 2.0;\n antiAliasFactor *= stippleAA;\n if (antiAliasFactor <= 0.0) { discard; }`)]})},PolarHeatmap:t=>({idFeature:"PolarHeatmap",apply:(e,i)=>{const s="dataType"in t,n="interpolation"in t?t:void 0,r="bilinear"===(null==n?void 0:n.interpolation),o=null==n?void 0:n.intensityTextureType,a=null==n?void 0:n.littleEndian;return{idVertex:void 0,idFragment:`PolarHeatmap:${Rg(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[Mg("uniform vec2 uViewportSize","uniform vec2 uScale","uniform vec2 uDisp","uniform float uSectors","uniform float uAnnuli","uniform float uAmplitudeStart","uniform float uAmplitudeStep","uniform float uAmplitudeAxisStart","uniform float uAmplitudeAxisEnd","uniform float uAngleOffset","uniform float uAngleDirection",n&&"uniform sampler2D uTileIntensityValues",s&&"uniform vec4 uColor"),_g.texelFetchWithFallback[i],"ubyte"===o&&_g.decodeUbyteRGBAEncodedFloat,wg("vec2 posWorld = (2.0 * gl_FragCoord.xy / uViewportSize) - 1.0","vec2 posAxis = posWorld * uScale + uDisp","float amplitudeAxisInterval = uAmplitudeAxisEnd - uAmplitudeAxisStart","float amplitude = uAmplitudeAxisStart + sign(amplitudeAxisInterval) * sqrt(posAxis.x * posAxis.x + posAxis.y * posAxis.y)","float iAnnulus = (amplitude - uAmplitudeStart) / uAmplitudeStep","if (iAnnulus < 0.0 || iAnnulus > uAnnuli) { discard; }"),s&&wg("vec4 colorFragment = uColor"),n&&kg("if (iAnnulus","float angRad = atan(posAxis.y, posAxis.x) * uAngleDirection + uAngleOffset","if (angRad < 0.0) { angRad = angRad + 2.0 * 3.1415926538; }","if (angRad > 2.0 * 3.1415926538) { angRad = angRad - 2.0 * 3.1415926538; }","float iSector = uSectors * angRad / (2.0 * 3.1415926538)","vec2 cellIndex = vec2(iSector, iAnnulus)","ivec2 cellStart = ivec2(floor(cellIndex))","ivec2 cellEnd = cellStart + ivec2(1)","if (cellEnd.x >= int(uSectors)) { cellEnd = ivec2(0, cellEnd.y); }",n.flipXY&&"cellIndex = vec2(cellIndex.y, cellIndex.x)",n.flipXY&&"cellStart = ivec2(cellStart.y, cellStart.x)",n.flipXY&&"cellEnd = ivec2(cellEnd.y, cellEnd.x)","vec2 tileDimensions = "+(n.flipXY?"vec2(uAnnuli, uSectors)":"vec2(uSectors, uAnnuli)"),r&&"vec4 sample00 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",r&&"vec4 sample01 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellStart.x, cellEnd.y), tileDimensions)",r&&"vec4 sample10 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellEnd.x, cellStart.y), tileDimensions)",r&&"vec4 sample11 = texelFetchWithFallback(uTileIntensityValues, cellEnd, tileDimensions)",r&&"float intensity00 = "+("float"===o?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${a})`),r&&"float intensity01 = "+("float"===o?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${a})`),r&&"float intensity10 = "+("float"===o?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${a})`),r&&"float intensity11 = "+("float"===o?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${a})`),r&&"vec2 lerpFactors = cellIndex - vec2(cellStart)",r&&"float intensityR1 = mix(intensity00, intensity10, lerpFactors.x)",r&&"float intensityR2 = mix(intensity01, intensity11, lerpFactors.x)",r&&"float intensityP = mix(intensityR1, intensityR2, lerpFactors.y)",!r&&"vec4 sample0 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",!r&&"float intensityP = "+("float"===o?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${a})`)),...n?Fg("intensityP",n.lut):[]]}}})},Yg={"2D":"\nvoid main(void) {\n gl_Position = vec4(posWorld, 0.0, 1.0 );\n}\n","2DMatrix":"\nvoid main(void) {\n gl_Position = posWorld;\n}\n","3D":"\nuniform mat4 uViewProjectionMatrix;\nvoid main(void) {\n gl_Position = uViewProjectionMatrix * vec4(posWorld, 1.0);\n}\n"},Hg={FragmentShader:"\nuniform float uIsHighlighted;\nuniform vec4 uHighlightColorOffset;\nuniform float uRenderEffectMask;\nvoid main(void) {\n float antiAliasFactor = 1.0;\n vec4 fragColorEnd = colorFragment;\n if (fragColorEnd.a <= 0.0) { discard; }\n fragColorEnd = clamp(fragColorEnd + uIsHighlighted * uHighlightColorOffset, vec4(0.0), vec4(1.0));\n fragColorEnd = mix(fragColorEnd, vec4(1.0), uRenderEffectMask * fragColorEnd.a * 1000.0);\n gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor);\n}\n",Empty:"\nvoid main(void) {\n}\n"};class Xg{constructor(t,e,i,s,n){if(this.id=t,this.shader=i,this.gl=s,this.info=n,!e||!i)throw new mt(`Could not find ${this.uR()} ${this.cR()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}uR(){return this.id.toString()}cR(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class jg extends Xg{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class $g extends Xg{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class qg{constructor(t,e,i,s){this.dR=new Map,this.fR=new Map,this.AR=i,this.gR=i.createProgram(),this.pR=`${t.uR()} vertex`,this.mR=`${e.uR()} fragment`,i.attachShader(this.gR,t.shader),i.attachShader(this.gR,e.shader),i.bindAttribLocation(this.gR,0,"aPos"),i.linkProgram(this.gR),i.deleteShader(t.shader),i.deleteShader(e.shader),this.allAttributeNames=t.info.allAttributeNames,this.allUniformNames=Array.from(new Set(t.info.allUniformNames.concat(e.info.allUniformNames)).values()),this.vertexSharedRemovedVariables=t.info.removedVariableNames,this.fragmentSharedRemovedVariables=e.info.removedVariableNames}get vertexShaderSrc(){return""}get fragmentShaderSrc(){return""}yR(t){return fe(0,(()=>ge()))}SR(t){const e=this.vR(t);if(void 0===e)throw this.yR(`Could not get ${t} uniform from ${this.pR} and ${this.mR} shaders.`);return e}vR(t){const e=this.dR.get(t);if(e)return e;const i=this.AR.getUniformLocation(this.gR,t);return i?(this.dR.set(t,i),i):void 0}xR(t){const e=this.bR(t);if(void 0===e)throw this.yR(`Could not get ${t} attribute from ${this.pR} and ${this.mR} shaders.`);return e}bR(t){const e=this.fR.get(t);if(e||0===e)return e;const i=this.AR.getAttribLocation(this.gR,t);return i>=0?(this.fR.set(t,i),i):void 0}W(){this.AR.deleteProgram(this.gR)}}const Jg=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/,Kg=t=>{let e;try{e=St.getComputedStyle(t)}catch(t){return null}return e};function Zg(t){const e=Kg(t);return!!e&&("fixed"===e.position||!!("auto"!==e.zIndex&&"static"!==e.position||function(t){const e=Kg(im(t)),i=e?e.display:"auto";return"flex"===i||"inline-flex"===i}(t))||+e.opacity<1||"transform"in e&&"none"!==e.transform||"webkitTransform"in e&&"none"!==e.webkitTransform||"mixBlendMode"in e&&"normal"!==e.mixBlendMode||"filter"in e&&"none"!==e.filter||"webkitFilter"in e&&"none"!==e.webkitFilter||"isolation"in e&&"isolate"===e.isolation||!!Jg.test(e.willChange)||"touch"===e.webkitOverflowScrolling)}function Qg(t){let e=t.length;for(;e--;)if(Zg(t[e]))return t[e];return null}function tm(t){var e;return t&&Number((null===(e=Kg(t))||void 0===e?void 0:e.zIndex)||0)||0}function em(t){const e=[];for(;t;)e.push(t),t=im(t);return e}function im(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.host)||t.parentNode}class sm extends ag{constructor(t){if(super(),this.MR=new Map,this._R=new Map,this.wR=new Map,this.CR=!0,this.kR=null,this.TR=null,this.FR=null,this.IR=null,this.PR=0,this.DR=0,this.BR=0,this.LR=!1,this.RR=!0,this.$i=!1,this.ER=le(`chart-engine-${(new Date).getTime()}${Math.trunc(1e6*Math.random()).toString()}`),this.X={x:100,y:100},this.VR=()=>{this.zR&&clearTimeout(this.zR),this.zR=setTimeout((()=>this.Ur()),12)},this.OR=t=>{const e=t.intersectionRatio>0,i=t.target.getAttribute("data-lcjs-engine-id");if(i){const t=this.MR.get(i);if(t){const s=t.NR();t.GR(e),e?this._R.set(i,t):this._R.delete(i),s!==e&&t.bs()}}},this.WR=(t,e,i,s,n)=>{const r=n[0],o=this.gl;if(o.bindFramebuffer(null==o?void 0:o.FRAMEBUFFER,null),o.useProgram(this.TR.gR),o.clear(o.COLOR_BUFFER_BIT),r.Rr.getBoundingClientRect()){const t=r.UR();o.viewport(0,0,t.x,t.y),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,r.YR),o.uniform1i(this.PR,0),o.uniformMatrix4fv(this.DR,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o.bindBuffer(o.ARRAY_BUFFER,this.FR),o.enableVertexAttribArray(0),o.vertexAttribPointer(this.BR,2,o.FLOAT,!1,0,0),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),r.HR&&(r.HR.clearRect(0,0,r.HR.canvas.width,r.HR.canvas.height),r.HR.drawImage(this.$R,0,this.$R.height-t.y,t.x,t.y,0,0,r.HR.canvas.width,r.HR.canvas.height))}},this.XR=(t,e,i,s,n)=>{const r=this.gl;r.bindFramebuffer(null==r?void 0:r.FRAMEBUFFER,null),r.useProgram(this.TR.gR),r.clear(r.COLOR_BUFFER_BIT),n.forEach((i=>{const n=i.Rr.getBoundingClientRect();if(n){const i=n.right-n.left,o=n.bottom-n.top,a=n.left,h=s-n.bottom;r.viewport(a*this.jR-t*this.jR,h*this.jR+e*this.jR,i*this.jR,o*this.jR)}r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,i.YR),r.uniform1i(this.PR,0),r.uniformMatrix4fv(this.DR,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),r.bindBuffer(r.ARRAY_BUFFER,this.FR),r.enableVertexAttribArray(0),r.vertexAttribPointer(this.BR,2,r.FLOAT,!1,0,0),r.drawArrays(r.TRIANGLES,0,6)})),r.bindFramebuffer(r.FRAMEBUFFER,null)},this.ZR=(t,e,i,s,n)=>{const r=n[0],o=this.gl2.ctx;o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),o.clear(o.COLOR_BUFFER_BIT);const a=r.UR();o.bindFramebuffer(o.READ_FRAMEBUFFER,r.QR[1]),o.blitFramebuffer(0,0,a.x,a.y,0,this.$R.height-a.y,a.x,this.$R.height,o.COLOR_BUFFER_BIT,o.LINEAR),r.HR&&(r.HR.clearRect(0,0,r.HR.canvas.width,r.HR.canvas.height),r.HR.drawImage(this.$R,0,0)),o.bindFramebuffer(o.FRAMEBUFFER,null)},this.JR=(t,e,i,s,n)=>{const r=this.gl2.ctx;r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.clear(r.COLOR_BUFFER_BIT),n.forEach((i=>{const n=i.Rr.getBoundingClientRect();if(n){const o=n.right-n.left,a=n.bottom-n.top,h=n.left,l=s-n.bottom,u=i.UR();r.bindFramebuffer(r.READ_FRAMEBUFFER,i.QR[1]),r.blitFramebuffer(0,0,u.x,u.y,h*this.jR-t*this.jR,l*this.jR+e*this.jR,(h-t+o)*this.jR,(l+e+a)*this.jR,r.COLOR_BUFFER_BIT,r.LINEAR)}})),r.bindFramebuffer(r.FRAMEBUFFER,null)},this.zR=void 0,this.En=t,!St.requestAnimationFrame||!St.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");let e=1;if(t&&t.KR)e=!0===t.KR?St.devicePixelRatio||1:t.KR||1;else{const t=St.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(e=St.devicePixelRatio||1)}this.jR=e,t.oo=!0===t.oo,this.RR=!1!==t.qR,this.tE=!1!==t.iE,this.sE=t.sE||!1;let i=!1;if(t.$R)if("string"==typeof t.$R){const e=St.document.getElementById(t.$R);if(!e)throw new Error(`Canvas "${t.$R}" doesn't exist.`);this.$R=e,i=!0}else this.$R=t.$R,i=!0;else this.$R=St.document.createElement("canvas");const s={preserveDrawingBuffer:!0,alpha:!0,antialias:!1};if(2!==t.eE&&t.eE){const e=this.$R.getContext("webgl",{...s,antialias:!!t.qR})||this.$R.getContext("experimental-webgl",{...s,antialias:!!t.qR});this.gl=e,this.hE=!1}else{const t=this.$R.getContext("webgl2",s);this.gl2={ctx:t},this.gl=t,this.hE=!0}if(!this.gl)throw new gt("No WebGL context available."+((null==t?void 0:t.eE)?`\nSelected explicit target: WebGL ${t.eE}`:""));const n=[];if(this.rE={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.rE).forEach((t=>{null===this.rE[t]&&n.push(t)})),this.hE)this.nE=!0;else{const t={ANGLE_instanced_arrays:this.gl.getExtension("ANGLE_instanced_arrays"),EXT_blend_minmax:this.gl.getExtension("EXT_blend_minmax"),OES_element_index_uint:this.gl.getExtension("OES_element_index_uint"),OES_standard_derivatives:this.gl.getExtension("OES_standard_derivatives"),OES_vertex_array_object:this.gl.getExtension("OES_vertex_array_object")};t.OES_standard_derivatives||(this.CR=!1),Object.keys(t).forEach((e=>{null===t[e]&&n.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.nE=!!e.OES_texture_float,this.gl1={ctx:this.gl,rE:t,optional:e}}const r=n;if(r.length>0&&!1!==t.oo){const t=St.document.createElement("div");t.innerText="LightningChart JS: Some features might not work properly, due to missing WebGL features.",t.style.cssText="position:absolute;top:0;background:red;width:100%;padding:10px;text-align:center;color:white;z-index:1;";const e=St.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),St.document.body.appendChild(t),t.appendChild(e),St.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",r.join(", "))}if(this.oE=this.sE?this.aE(this.hE?this.ZR.bind(this):this.WR.bind(this)).bind(this):this.lE(this.hE?this.JR.bind(this):this.XR.bind(this)).bind(this),St.ResizeObserver){const t=t=>{for(const e of t)e.target===this.$R&&this.uE()};this.co=new St.ResizeObserver(t.bind(this)),this.co.observe(this.$R)}if(this.cE=((t,e)=>{const i=t,s=new Map,n=new Map,r=new Map,o={totalMs:0,vertexShaders:0,fragmentShaders:0,programs:0},a=(t,i,s=[])=>{const n=[],r=[],o={allAttributeNames:Array.from(t.matchAll(/attribute\s[^\s]*\s(.*);/g)).map((t=>t[1])),allUniformNames:Array.from(t.matchAll(/uniform\s[^\s]*\s(.*);/g)).map((t=>t[1])),allVaryingNames:Array.from(t.matchAll(/varying\s[^\s]*\s(.*);/g)).map((t=>t[1])),removedVariableNames:[]};if(e){const e=t.match(/#extension.*/g);e&&r.push(...e),t=t.replace(/#extension.*/g,"")}else if(n.push("#version 300 es"),(t=(t=(t=t.replace(/#extension.*/g,"")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).includes("usampler2D")&&n.push("precision highp usampler2D;"),"vertex"===i)t=t.replace(/varying/g,"out");else{t=t.replace(/varying/g,"in");const e=s.find((t=>"fragOutput"===t.type));t=(t=e?`out ${e.fragOutput} fragOutput;\n${t}`:`out vec4 fragOutput;\n${t}`).replace(/gl_FragColor/g,"fragOutput")}return r&&n.push(...r),n.push("precision highp float;"),n.push("precision highp int;"),{source:t=`${n.join("\n")}\n${t}`,info:o}};return(...t)=>{const h=e?"webgl1":"webgl2";let l,u,c,d,f,g,m,p,y;try{const e=St.performance.now();l=t.filter((t=>!1!==t&&void 0!==t)),u=((t,e)=>{const i=t.map((i=>i.apply(t,e))),s=i.map((t=>t.idVertex)).filter((t=>void 0!==t)).sort().join(" "),n=i.map((t=>t.idFragment)).filter((t=>void 0!==t)).sort().join(" "),r=`vert: ${s} frag: ${n}`;let o,a=!1,h=!1;const l=[];let u;const c=[],d=[];if(i.forEach((t=>{if(t.defaultVertexShader&&(a||(o=t.defaultVertexShader)),t.vertexShader){if(o&&a&&o!==t.vertexShader)throw new Pg(`Conflicting vertex shader templates ${o} vs ${t.vertexShader}`,r,t);o=t.vertexShader,a=!0}if(t.vertexShaderModifiers)for(const e of t.vertexShaderModifiers)void 0!==e&&!1!==e&&l.push(e);if(t.defaultFragmentShader&&(h||(u=t.defaultFragmentShader)),t.fragmentShader){if(u&&h&&u!==t.fragmentShader)throw new Pg(`Conflicting fragment shader templates ${u} vs ${t.fragmentShader}`,r,t);u=t.fragmentShader,h=!0}if(t.fragmentShaderModifiers)for(const e of t.fragmentShaderModifiers)void 0!==e&&!1!==e&&c.push(e);t.hints&&t.hints.forEach((t=>{t&&d.push(t)}))})),!o)throw new Pg("No vertex shader template defined",r);if(!u)throw new Pg("Fragment shader not defined",r);return{id:r,vertexShader:{id:s,template:o,modifiers:l},fragmentShader:{id:n,template:u,modifiers:c},hints:d}})(l,h);const A=r.get(u.id);if(c="new",A)return c="existing",g=A.vertexShaderSrc,m=A.fragmentShaderSrc,A;const x=u.vertexShader.id;let S=s.get(x);if(S)g=S.src,d="existing";else{d="new";const t=new Sg(u.vertexShader.modifiers).build(Yg[u.vertexShader.template]),{source:e,info:n}=a(t,"vertex");g=e,p=n,S=new jg(x,e,i,n),s.set(x,S),o.vertexShaders+=1}const b=u.fragmentShader;let v;const M=b.id;if(v=n.get(M),v)m=v.src,f="existing";else{f="new";const t=Hg[b.template],e=new Sg([...b.modifiers]).build(t),{source:s,info:r}=a(e,"fragment",u.hints);m=s,y=r,v=new $g(M,s,i,r),n.set(M,v),o.fragmentShaders+=1}const T=new qg(S,v,i,u);return r.set(u.id,T),o.programs+=1,o.totalMs+=St.performance.now()-e,T}catch(t){throw fe(0,(()=>{const t="Unexpected LightningChart JS rendering error.\nThis can mean a bug in the library, or that it is simply used in unsupported manner (passing wrong type to method, using disposed component, etc).";return St.alert(t),new Error(t)}))}}})(this.gl,!this.hE),this.iR=(()=>{const t=St.document.createElement("canvas"),e=t.getContext("2d",{willReadFrequently:!0});if(!e)throw new gt("Failed to get Text canvas rendering context");return e.fillStyle="#fff",(i,s,n,r)=>{const o=`${s.style} ${s.weight} ${s.size*n}px ${s.family}`;e.font=o,e.textBaseline="alphabetic",e.textAlign="left";const a=e.measureText(i);if(0===a.width)return;const h=void 0!==a.actualBoundingBoxLeft&&void 0!==a.actualBoundingBoxRight?Math.ceil(a.actualBoundingBoxLeft+a.actualBoundingBoxRight):Math.ceil(a.width),l=a.width,c=Math.round(s.size*n),d=void 0!==a.actualBoundingBoxLeft?a.actualBoundingBoxLeft:0;t.width=h>0?h:l,t.height=2*c,e.font=o,e.textBaseline="alphabetic",e.textAlign="left",r?(e.clearRect(0,0,t.width,t.height),e.fillStyle="#fff"):(e.fillStyle="rgba(255,255,255,0)",e.fillRect(0,0,t.width,t.height),e.fillStyle="#000"),e.fillText(i,d,c);const f=e.getImageData(0,0,t.width,t.height);let g=0,m=0;const p=f.width;for(let t=0;t=0;t-=1){for(let e=0;e{for(let e=0;ee/100))})),St.addEventListener("resize",this.VR,{passive:!0}),!this.hE){if(this.TR=this.cE(Wg["2DCompose"],Wg.Color({dataType:"texture-coord-calc-gpu"}),Wg.VertexLocation({axisWorldTranslation:"matrix4",normalSource:void 0,coordType:"vec4"})),!this.TR.gR)throw new gt("Unable to setup composition shader!");const t=this.gl,e=t.getUniformLocation(this.TR.gR,"uColorTexture");if(!e)throw new gt("Unable to setup composition shader! Failed to find uColorTexture");const i=t.getUniformLocation(this.TR.gR,"uMatrix");if(!i)throw new gt("Unable to setup composition shader! Failed to find uMatrix");this.PR=e,this.DR=i,this.BR=t.getAttribLocation(this.TR.gR,"aPos"),this.FR=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.FR),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this.IR=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.IR),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,0,0,1,1,1]),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null)}}aE(t){return e=>{this.kR=null;const i=this.gl.canvas,s=Array.from(this._R.values());this.LR=!1,s.forEach((s=>{const n=s.UR();(this.X.x{this.kR=null,"style"in this.gl.canvas&&!this.En.pE&&(this.gl.canvas.style.transform=`translateX(${window.scrollX}px) translateY(${window.scrollY}px)`);const i=this.gl.canvas,s=this.$R.clientHeight,n=this.$R.clientWidth;let r=0,o=0;if(i instanceof HTMLCanvasElement){i.width===n*this.jR&&i.height===s*this.jR||(i.width=n*this.jR,i.height=s*this.jR);const t=i.getBoundingClientRect();r=t.x,o=t.y}const a=Array.from(this._R.values());this.LR=!1,a.sort(((t,e)=>t.mE()-e.mE())).forEach((t=>{t.Jr&&t.gE(e)})),t(r,o,n,s,a),this.LR&&this.uE()}}uE(t){return!this.LR&&t&&(this.LR=!0),this.kR||this.$i||(this.kR=St.requestAnimationFrame(this.oE)),this}yE(t){const e=this.ER();return t.Rr.setAttribute("data-lcjs-engine-id",e),this.MR.set(e,t),t.SE(this.MR.size-1),t.GR(!0),this._R.set(e,t),this.AE&&this.AE.observe(t.Rr),this.zR&&clearTimeout(this.zR),this.zR=setTimeout((()=>this.Ur()),0),this}vE(t){const e=t.Rr.getAttribute("data-lcjs-engine-id");return e?(this.MR.delete(e),this._R.delete(e),this.AE&&this.AE.unobserve(t.Rr),t.Rr.removeAttribute("data-lcjs-engine-id"),this):this}Ur(){if(this.AE){const t=this.AE.takeRecords();for(let e=0;efunction(t,e){if(t===e)throw new Error("Cannot compare node with itself");const i={a:em(t),b:em(e)};let s;for(;i.a[i.a.length-1]===i.b[i.b.length-1];)t=i.a.pop(),e=i.b.pop(),s=t;const n=tm(Qg(i.a)),r=tm(Qg(i.b));if(n===r&&s){const t=s.childNodes,e={a:i.a[i.a.length-1],b:i.b[i.b.length-1]};let n=t.length;for(;n--;){const i=t[n];if(i===e.a)return 1;if(i===e.b)return-1}}return Math.sign(n-r)}(t.Rr,e.Rr))).forEach(((t,e)=>t.SE(e))),this.uE(!0),this}UI(){return this.uE(),this}W(){var t;if(this.$i)return;this.$i=!0,super.W(),this.kR&&(St.cancelAnimationFrame(this.kR),this.kR=null),this.LR=!1,this.co&&(this.co.disconnect(),this.co=void 0),this.AE&&(this.AE.disconnect(),this.AE=void 0),St.removeEventListener("resize",this.VR),this.VR=void 0,this.MR.forEach((t=>{t.W()})),this.MR.clear(),Array.from(this.wR.values()).forEach((t=>{t.GL(!0)})),this.wR.clear();const e=this.gl;e.deleteBuffer(this.FR),e.deleteBuffer(this.IR),this.$R&&!this.En.$R?(this.$R.width=1,this.$R.height=1,null===(t=this.$R.parentElement)||void 0===t||t.removeChild(this.$R),this.$R=void 0):this.$R=void 0,this.cE=void 0,this.iR=void 0,this.oE=()=>{},this.rE.WEBGL_lose_context&&this.rE.WEBGL_lose_context.loseContext()}}const nm=(t,e,i,s)=>n=>{const r={theme:ng,...i,...n},o=t(r),a=e||s?rg(o,s):void 0,h=new Cf(o.En,n,o,o.W.bind(o),a);return o.Co((t=>h.yL(t))).wo((()=>h.j())).bs(),h},rm=(t,e)=>{t.Co((t=>{e.Fe(t)})).wo((()=>e.j())).bs()},om=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new Na(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a);return rm(o,h),h},am=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new Pd(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,n);return rm(o,h),h},hm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new hc(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,n);return rm(o,h),h},lm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new pu(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,n);return rm(o,h),h},um=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new(n&&n.type?n.type:Dh)(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0,n);return rm(o,h),h},cm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new(n&&n.type?n.type:Vu)(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0,!0!==(null==n?void 0:n.disableAnimations)&&!1!==(null==n?void 0:n.animationsEnabled));return rm(o,h),h},dm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new(n&&n.type?n.type:Eu)(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0,n);return rm(o,h),h},fm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new(n&&n.type?n.type:Hu)(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0,n);return rm(o,h),h},gm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new Al(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,n,void 0);return rm(o,h),h},mm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new hl(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0,n);return rm(o,h),h},pm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new uf(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0);return rm(o,h),h},ym=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new bf(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0,n);return rm(o,h),h},Am=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new dd(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,n);return rm(o,h),h};function xm(t,i,s,n,r,o){let a=i.x.ct(t.max.x),h=i.x.ct(t.min.x),l=i.y.ct(t.max.y),u=i.y.ct(t.min.y),c=a-h,d=l-u;if(c<1){const t=(h+a)/2;h=t-.5,a=t+.5,c=1}if(d<1){const t=(u+l)/2;u=t-.5,l=t+.5,d=1}const f=c/d,g=c*s.x,m=d*s.y,p=c-g,y=d-m,A=g>p?[p,g]:[g,p],x=m>y?[y,m]:[m,y];let S,b,v=1,M=1;switch(n){default:case e.GradientExtent.closestSide:if(S=A[0]/c,b=x[0]/d,r===e.GradientShape.circle){const t=Math.min(S*f,b);v=t,M=t}else v=S*f,M=b;break;case e.GradientExtent.farthestSide:if(S=A[1]/c,b=x[1]/d,r===e.GradientShape.circle){const t=Math.max(S*f,b);v=t,M=t}else v=S*f,M=b;break;case e.GradientExtent.closestCorner:if(b=x[0]/d,r===e.GradientShape.circle){S=A[0]/c*f;const t=Math.sqrt(S*S+b*b);v=t,M=t}else{S=A[0]/c;const t=Math.sqrt(S*S+b*b);v=t*f,M=t}break;case e.GradientExtent.farthestCorner:if(b=x[1]/d,r===e.GradientShape.circle){S=A[1]/c*f;const t=Math.sqrt(S*S+b*b);v=t,M=t}else{S=A[1]/c;const t=Math.sqrt(S*S+b*b);v=t*f,M=t}}return{bounds:[h*o,u*o,c*o,d*o],center:[s.x*f,s.y],distance:[Math.max(v,1e-4),Math.max(M,1e-4)],aspectRatio:f}}function Sm(t,e,i,s){const n=e.x.ct(t.max.x),r=e.x.ct(t.min.x),o=e.y.ct(t.max.y),a=e.y.ct(t.min.y),h=n-r,l=o-a,c=Math.abs(h*Math.sin(i))+Math.abs(l*Math.cos(i)),d=u(h/2-Math.sin(i)*(c/2),l/2-Math.cos(i)*(c/2)),f=u(h/2+Math.sin(i)*(c/2),l/2+Math.cos(i)*(c/2));return{bounds:[r*s,a*s,h*s,l*s],startPoint:[d.x*s,d.y*s],endPoint:[f.x*s,f.y*s]}}class bm{constructor(t){this.zL=t}}class vm{constructor(){this.xE=new Array,this.bE=t=>(this.xE.push(t),t),this.ME=this.bE(new Map),this._E=this.bE(new Map),this.wE=this.bE(new Map),this.CE=this.bE(new Map),this.kE=this.bE(new Map),this.TE=this.bE(new Map),this.FE=this.bE(new Map)}IE(){this.xE.forEach((t=>{t.forEach((t=>t.IE())),t.clear()}))}}const Mm=(t,e,i)=>()=>{t.PE=e,i&&i()},Tm=(t,i,s,n,r)=>{const o=Math.min(s/t,n/i),a=t*o,h=i*o,l=s/a,u=n/h,c=a/s,d=h/n;let f=0,g=1,m=0,p=1;switch(r){case e.ImageFitMode.Fill:u{this.EE=!0,this.GE()})),this.Mc.addEventListener("error",(()=>{this.VE=!0})),this.Mc.complete&&(this.EE=!0,this.GE());else if(this.Mc instanceof St.HTMLVideoElement){const t=this;this.Mc.addEventListener("canplay",(function(){t.BE=this.videoHeight,t.DE=this.videoWidth,t.EE=!0,t.GE()}),!0),this.Mc.addEventListener("play",Mm(this,!0,(()=>this.GE()))),this.Mc.addEventListener("playing",Mm(this,!0,(()=>this.GE()))),this.Mc.addEventListener("pause",Mm(this,!1)),this.Mc.addEventListener("ended",Mm(this,!1)),this.Mc.readyState>=1&&(this.DE=this.Mc.videoWidth,this.BE=this.Mc.videoHeight,this.PE=!this.Mc.paused,this.EE=!0,this.GE())}else this.EE=!0,this.GE()}JL(t){0===this.OE.size&&this.EE&&this.GE(),this.OE.add(t)}KL(t){this.OE.delete(t),0===this.OE.size&&this.unbindResources()}WE(t){this.zE.add(t),this.RE&&(t(),this.UE(t))}UE(t){this.zE.delete(t)}GE(){if(this.VE||this.RE||!this.EE)return;const t=this.AR.gl;if(!this.NE&&this.Mc&&t){this.NE=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.NE),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,n=t.UNSIGNED_BYTE,r=this.Mc,o=this.DE>0?this.DE:r.width,a=this.BE>0?this.BE:r.height;t.texImage2D(t.TEXTURE_2D,e,i,s,n,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.DE=o,this.BE=a,t.bindTexture(t.TEXTURE_2D,null)}this.RE=!0,this.zE&&this.zE.forEach((t=>{t(),this.UE(t)}))}Ds(){const t=this.AR.gl;if(!this.VE&&this.RE&&this.NE){const e=0,i=t.RGBA,s=t.RGBA,n=t.UNSIGNED_BYTE,r=this.Mc;r&&(t.bindTexture(t.TEXTURE_2D,this.NE),t.texImage2D(t.TEXTURE_2D,e,i,s,n,r))}}YE(){return this.NE}unbindResources(){return this.RE&&(this.NE&&(this.AR.WL(this.NE),this.NE=null),this.RE=!1),this}}class Em extends Un{constructor(t,e,i){super(t.us,e,i),this.Rm=!0,this.Fm={},this.Bm=y(Nr),this.Ts=t,this.dt=t.dt}HE(){var t;return this.Bm.o&&this.Bm._().type!==(null===(t=this.$E)||void 0===t?void 0:t.type)}Nm(t){return this.Rm=t,this}XE(t){return this.Fm=t,this}}class km{constructor(t){this.vV=[],this.zL=t}xV(t,e){((t,e,i,s)=>{const n=t.sR(),r=Math.round(Math.min(i.spread,10)*n),o=Math.round(Math.min(i.blur,10)*n),a={x:Math.round(i.offset.x*n),y:Math.round(i.offset.y*n)},h=t.jE(),l=t.ZE(),u=t.QE(),c=t.JE(),d=t.KE();t.qE("disabled"),t.Nm(!1),t.tV(!1);const f=e.iV(),g=r+o/2;((t,e,i,s)=>{const n=t.gl,r=t.sR(),o=t.sV();t.eV(n.FRAMEBUFFER,s.frameBuffer),n.bindRenderbuffer(n.RENDERBUFFER,s.depthBuffer),n.bindTexture(n.TEXTURE_2D,s.texture),n.clearDepth(1),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT);const a=s.sizeDpr;t.hV(0,0,a.x,a.y),e.forEach((e=>{let s;if(e instanceof Wn?s=e.Ts.lg():e instanceof Em&&(s=e.Ts.RS()),s){const e=s.x+i.left,n=s.y+i.bottom,o=Math.max(s.width-(i.left+i.right),0),a=Math.max(s.height-(i.bottom+i.top),0);t.rV(e*r,n*r,o*r,a*r)}else t.tV(!1);e.yL(2)})),t.eV(n.FRAMEBUFFER,o),n.bindRenderbuffer(n.RENDERBUFFER,null),n.bindTexture(n.TEXTURE_2D,null),t.tV(!1)})(t,s,{left:g+(a.x<0?-a.x:0),top:g+(a.y>0?a.y:0),right:g+(a.x>0?a.x:0),bottom:g+(a.y<0?-a.y:0)},f);let m=f;const p=r+o+5,y=((t,e,i,s)=>{const n=(t=>{const e=[];for(let i=0;iRe(n,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),n=qe(n,s))}while(s);e.push(n)}return e})(e.map((t=>{const e=t instanceof Wn||t instanceof Em?t.Ts.nV(t):Le;if(me(e))return Le;const n={min:{x:Math.max(e.min.x-i.left,0),y:Math.max(e.min.y-i.bottom,0)},max:{x:Math.min(e.max.x+i.right,s.x),y:Math.min(e.max.y+i.top,s.y)}};return n.max.x<=n.min.x||n.max.y<=n.min.y?Le:n})).filter((t=>!me(t)))),r=6*n.length,o=new Float32Array(4*r);let a=0;return n.forEach((t=>{const e=ai(t.min,s),i=ai(t.max,s),n=e,r=i;o[a+0]=e.x,o[a+1]=e.y,o[a+2]=n.x,o[a+3]=n.y,o[a+4]=i.x,o[a+5]=e.y,o[a+6]=r.x,o[a+7]=n.y,o[a+8]=i.x,o[a+9]=i.y,o[a+10]=r.x,o[a+11]=r.y,o[a+12]=i.x,o[a+13]=i.y,o[a+14]=r.x,o[a+15]=r.y,o[a+16]=e.x,o[a+17]=i.y,o[a+18]=n.x,o[a+19]=r.y,o[a+20]=e.x,o[a+21]=e.y,o[a+22]=n.x,o[a+23]=n.y,a+=24})),{vertexBuffer:t.oV(o),vertexCount:r}})(t,s,{left:p+(a.x<0?-a.x:0),top:p+(a.y>0?a.y:0),right:p+(a.x>0?a.x:0),bottom:p+(a.y<0?-a.y:0)},e.aV()),A=e.iV(f,m),x=t.cE(Wg["2D"],Wg.Glow1D({spreadPx:r,blurPx:o,firstPass:!0}),Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,n,r)=>{const o=t.gl,a=t.sV();t.eV(o.FRAMEBUFFER,i.frameBuffer),o.bindRenderbuffer(o.RENDERBUFFER,i.depthBuffer),o.bindTexture(o.TEXTURE_2D,i.texture),o.clearDepth(1),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),t.hV(0,0,i.sizeDpr.x,i.sizeDpr.y),t.lV(s,((a,h,l,u)=>(t.JL(s),r&&r(a),t.fV(a("uIsHighlighted"),0).AV(a("uHighlightColorOffset"),C).fV(a("uRenderEffectMask"),0).dV(a("uTexture"),e.texture,0).cV(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).cV(a("uScale"),i.uniforms.gV()).cV(a("uDisp"),i.uniforms.pV()).cV(a("uScaling"),[i.size.x,i.size.y]).cV(a("uTranslationAxis"),[0,0]).uV(n.vertexBuffer,void 0,{location:h("aPos"),size:2},{location:h("aTextureCoord"),size:2}).Pp(o.TRIANGLES,n.vertexCount,0),!0))),t.eV(o.FRAMEBUFFER,a),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,m,A,x,y,((e,i,s,n)=>(t.cV(e("uOffsetPx"),[a.x,a.y]),!0))),m=A,t.tV(l),t.mV(d);const S=t.cE(Wg["2D"],Wg.Glow1D({spreadPx:r,blurPx:o,firstPass:!1}),Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,n)=>{const r=t.gl,o={x:t.us.oi().x,y:t.us.oi().y};t.hV(0,0,o.x*t.sR(),o.y*t.sR());const a=ht.d2({scaleXYConstructor:Li}).q(o).zi(0,o.x).Oi(0,o.y),h=new Im;h.yV(a),t.lV(i,((a,l,u,c)=>(t.JL(i),n&&n(a),t.fV(a("uIsHighlighted"),0).AV(a("uHighlightColorOffset"),C).fV(a("uRenderEffectMask"),0).dV(a("uTexture"),e.texture,0).cV(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).cV(a("uScale"),h.gV()).cV(a("uDisp"),h.pV()).cV(a("uScaling"),[o.x,o.y]).cV(a("uTranslationAxis"),[0,0]).uV(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).Pp(r.TRIANGLES,s.vertexCount,0),!0)))})(t,f,S,y,((e,s,n,r)=>(t.dV(e("uTextureFirstGlowPass"),A.texture,1).AV(e("uGlowColor"),i.color),!0))),t.hV(h.x,h.y,h.width,h.height),t.qE(u),t.Nm(c),t.SV(y.vertexBuffer)})(this.zL,this,e,t)}aV(){const t=this.zL.us.oi();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}iV(...t){const e=this.vV,i=this.aV(),s={x:Math.ceil(i.x*this.zL.sR()),y:Math.ceil(i.y*this.zL.sR())},n=this.zL.gl,r=e.find((e=>!t.includes(e)));if(r)return r.sizeDpr.x===s.x&&r.sizeDpr.y===s.y||(r.size=i,r.sizeDpr=s,n.bindTexture(n.TEXTURE_2D,r.texture),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,s.x,s.y,0,n.RGBA,n.UNSIGNED_BYTE,null),n.bindRenderbuffer(n.RENDERBUFFER,r.depthBuffer),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,s.x,s.y),n.bindTexture(n.TEXTURE_2D,null),n.bindRenderbuffer(n.RENDERBUFFER,null),r.scale.q(i).zi(0,i.x).Oi(0,i.y),r.uniforms.yV(r.scale)),r;const o=n.createTexture(),a=this.zL.bV(),h=this.zL.MV();n.bindTexture(n.TEXTURE_2D,o),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,s.x,s.y,0,n.RGBA,n.UNSIGNED_BYTE,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const l=this.zL.sV();this.zL.eV(n.FRAMEBUFFER,a),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,o,0),n.bindRenderbuffer(n.RENDERBUFFER,h),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,s.x,s.y),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,h),n.bindTexture(n.TEXTURE_2D,null),this.zL.eV(n.FRAMEBUFFER,l),n.bindRenderbuffer(n.RENDERBUFFER,null);const u=ht.d2({scaleXYConstructor:Li}).q(i).zi(0,i.x).Oi(0,i.y),c=new Im;c.yV(u);const d={size:i,sizeDpr:s,texture:o,frameBuffer:a,depthBuffer:h,scale:u,uniforms:c};return e.push(d),d}W(){[this.vV].forEach((t=>{t.forEach((t=>{this.zL._V(t.depthBuffer),this.zL.wV(t.frameBuffer),this.zL.WL(t.texture)})),t.length=0}))}}class Cm{constructor(t,i,s,n,r=!0){this.CV=new vm,this.kV=new Map,this.TV=new Map,this.FV=[],this.KR=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(St.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.Rm=!1,this.cV=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.IV=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.PV=(t,[e,i,s,n])=>(void 0===t||this.gl.uniform4f(t,e,i,s,n),this),this.DV=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.BV=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.LV=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.AV=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.fV=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.RV=(t,e)=>(this.gl.uniform1i(t,e),this),this.dV=(t,e,i)=>{if(void 0===t)return this;if(e){const s=this.gl.TEXTURE0+i;return this.gl.activeTexture(s),this.gl.bindTexture(this.gl.TEXTURE_2D,e),this.gl.uniform1i(t,i),this}throw new gt("Could not bind a texture.")},this.EV=t=>(((t,i)=>{i===e.ImageFitMode.Tile?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE))})(this.gl,t),this),this.oV=(t,e=!1,i)=>{const s=t.length,n=this.VV(s,i);if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof Float32Array?t:new Float32Array(t),e?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),n)return n;throw new gt("Could not create vertex buffer")},this.zV=(t,e,i,s=Float32Array)=>{const n=i||this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),e&&e.length===t?this.gl.bufferData(this.gl.ARRAY_BUFFER,e instanceof s?e:new s(e),this.gl.STATIC_DRAW):(this.gl.bufferData(this.gl.ARRAY_BUFFER,new s(t),this.gl.STATIC_DRAW),e&&this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,e instanceof s?e:new s(e))),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),n)return n;throw new gt("Could not create vertex buffer")},this.OV=(t,e,i,s=Float32Array)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferSubData(this.gl.ARRAY_BUFFER,e*s.BYTES_PER_ELEMENT,i instanceof s?i:new s(i)),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.NV=(t,e,i=!1)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferData(this.gl.ARRAY_BUFFER,e,i?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.GV=(t,e)=>{const i=t.length,s=this.VV(i,e);if(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,s),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),s)return s;throw new gt("Could not create index buffer")},this.WV=t=>{const e=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof Float32Array?t:new Float32Array(t),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),e)return e;throw new gt("Could not create float buffer")},this.UV=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,2,this.gl.FLOAT,!1,0,0)),this),this.YV=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.vertexAttribPointer(t,3,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(t)),this),this.uV=(t,e,...i)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t);const s=i.length;let n=0;for(let t=0;t-1&&this.gl.enableVertexAttribArray(e)}let r=0;for(let t=0;t-1&&this.gl.vertexAttribPointer(e.location,e.size,this.gl.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),r+=e.size}if(void 0!==e)for(let t=0;t-1&&this.HV(s,e)}return this},this.$V=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.XV=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,4,this.gl.FLOAT,!1,0,0)),this),this.jV=(t,e,i)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(t),void 0!==i&&this.HV(t,i)),this),this.ZV=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.QV=null,this.Pp=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.JV=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.KV=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.rE.ANGLE_instanced_arrays)return St.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.rE.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.qV=(t,e,i,s,n=this.gl.UNSIGNED_SHORT)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawElementsInstanced(t,e,n,i,s),this.gl1)){if(!this.gl1.rE.ANGLE_instanced_arrays)return St.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.rE.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,n,i,s)}return this},this.HV=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.rE.ANGLE_instanced_arrays)return St.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.rE.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.tz=(t,e,i,s=0)=>{const n=this.gl.TEXTURE0+s;this.gl.activeTexture(n);const r=this.sV();this.eV(this.gl.FRAMEBUFFER,e),this.gl.bindTexture(this.gl.TEXTURE_2D,i),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,i,0);const o=this.ZE();o&&this.tV(!1),t(),o&&this.tV(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.eV(this.gl.FRAMEBUFFER,r)},this.Nt=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this),this.iz=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.JL=t=>(this.gl.useProgram(t.gR),this),this.sz=!1,this.ez=[],this.us=t,this.fs=i,this.us=t,this.gl=s.ctx,this.hz=s.antialias,this.rz=!!this.us.Yr.CR&&s.lineAntialias,this.nE=this.us.Yr.nE,this.nz=new Map,this.gl1=this.us.Yr.gl1,this.gl2=this.us.Yr.gl2,r&&(this.mV(!0),this.oz()),this.rE=this.us.Yr.rE,this.NL=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.$L=this.az(),this.cE=this.us.Yr.cE,this.lz=new Fm(this),this.iR=this.us.Yr.iR,this.uz=new km(this),this.wR=this.us.Yr.wR,this.cz=this.oV([0,0,1,0,1,1,0,1]),this.dz=this.oV([0,0,1,0,0,1,0,1,1,0,1,1])}qE(t){return t!==this.fz&&(this.fz=t,"disabled"===t?this.gl.disable(this.gl.CULL_FACE):"cull-back"===t?(this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.BACK)):"cull-front"===t&&(this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.FRONT))),this}QE(){return this.fz||"disabled"}Nm(t){return t!==this.Rm&&(this.Rm=t,t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)),this}JE(){return this.Rm}Az(t){return this.KR=t,this}sR(){return this.KR}VV(t,e){let i;if(e){const s=this.nz.get(e);s&&s.size>=t&&s.size-t<1e6?i=e:this.SV(e)}return i||(i=this.gl.createBuffer(),this.nz.set(i,{size:t})),i}gz(t,e=this.gl.RGBA,i=!1,s,n,r=!1,o=this.gl.UNSIGNED_BYTE,a=e){const h=this.gl.createTexture();if(!h)throw new gt("Couldn't reserve Texture.");return this.gl.bindTexture(this.gl.TEXTURE_2D,h),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),t&&null===n?this.gl.texImage2D(this.gl.TEXTURE_2D,0,a,e,o,t):n&&this.gl.texImage2D(this.gl.TEXTURE_2D,0,a,n.x,n.y,0,e,o,t),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,s?this.gl.NEAREST:this.gl.LINEAR),i?(this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR_MIPMAP_LINEAR),this.gl.generateMipmap(this.gl.TEXTURE_2D)):this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,s?this.gl.NEAREST:this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),h}WL(t){this.gl.deleteTexture(t)}bV(){const t=this.gl.createFramebuffer();if(!t)throw new gt("Couldn't reserve Framebuffer.");return t}eV(t,e){this.QV=e,this.gl.bindFramebuffer(t,e)}sV(){return this.QV}wV(t){this.gl.deleteFramebuffer(t)}MV(){const t=this.gl.createRenderbuffer();if(!t)throw new gt("Couldn't reserve Render buffer.");return t}_V(t){this.gl.deleteRenderbuffer(t)}hV(t,e,i,s){return this.gl.viewport(t,e,i,s),this.pz&&t===this.pz.x&&e===this.pz.y&&i===this.pz.width&&s===this.pz.height||(this.pz={x:t,y:e,width:i,height:s}),this}jE(){return this.pz||{x:0,y:0,width:0,height:0}}rV(t,e,i,s){return this.tV(!0),this.gl.scissor(Math.max(t,0),Math.max(e,0),Math.max(i,0),Math.max(s,0)),this}tV(t){return t===this.mz||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.mz=t),this}mV(t){return t!==this.sz&&(this.sz=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}KE(){return this.sz}oz(t,e,i,s){return t?(void 0!==t&&void 0!==e&&(void 0!==i&&void 0!==s?this.gl.blendFuncSeparate(t,e,i,s):this.gl.blendFunc(t,e)),this):(this.gl.blendFuncSeparate(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA),this)}ZE(){return void 0!==this.mz&&this.mz}lV(t,e){const i=new Lm(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}SV(t){t&&(this.gl.deleteBuffer(t),this.nz.delete(t))}yz(t,e,i){this.cV(t.uniform("uCenter"),e.center).cV(t.uniform("uDistance"),e.distance).PV(t.uniform("uBounds"),e.bounds).fV(t.uniform("uAspect"),e.aspectRatio);const s=i.getColorStops();if(s.length<2)throw new Error("Minimum two color stops required");for(let e=0;e=t)return this.wz.buffer;this.wz&&(this.SV(this.wz.buffer),this.wz=void 0);const e=t,i=new Float32Array(e);for(let t=0;th)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.ez.splice(this.ez.indexOf(l),1)}))}Pz(t,e,i,s,n,r,o,a){const h=this.gl,l=this.sV();this.eV(h.FRAMEBUFFER,t),h.readPixels(e,i,s,n,r,o,a),this.eV(this.gl.FRAMEBUFFER,l)}Dz(t){const e=this.TV.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new gt("Couldn't reserve Texture.");this.gl.bindTexture(this.gl.TEXTURE_2D,e);const s=[];let n=255;for(let e=0;e{t-=1;for(let e=1;e<32;e<<=1)t|=t>>1;return t+1})(s.length);for(let e=s.length;e{})),this;this.fV(s("uMinValue"),i.min),this.fV(s("uMaxValue"),i.max)}return this}Vz(t,e,i,s){const n=t=>{t.texCoordsBuffer=this.oV(s(t.texture.DE,t.texture.BE,t.imageFill.getFitMode()),!1,t.texCoordsBuffer)};if(e){let s=t;const r=e.getSource();if((!t||e!==t.imageFill)&&r){t&&(t.texture.KL(this),this.SV(t.texCoordsBuffer));const i=this.vz(r);i.JL(this),s={texture:i,imageFill:e,texCoordsBuffer:this.oV([]),sourceMissingTexture:this.gz(new Uint8Array(Object.values(e.getSourceMissingColor().toJS()).map((t=>255*t))),this.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{s&&e&&(n(s),this.us.bs())}},i.WE(s.textureReadyCallback),n(s)}return s&&s.texture.RE&&s.texture.LE&&s.texture.PE&&(s.texture.Ds(),this.us.bs()),i&&s&&s.texture.RE&&n(s),s}t&&(t.texture.KL(this),this.SV(t.texCoordsBuffer))}zz(t){t&&(t.texture.KL(this),t.texture.UE(t.textureReadyCallback),this.WL(t.sourceMissingTexture),this.SV(t.texCoordsBuffer))}Oz(t,e,i,s){const{uniform:n,uniformOptional:r,attribute:o}=t,a=i.dt;this.fV(n("uIsHighlighted"),1===e||2===e?0:i.Ko).AV(n("uHighlightColorOffset"),1===e||2===e?D:i.sa).fV(n("uRenderEffectMask"),2===e?1:0).cV(r("uRatioPxClip"),[2/this.us.oi().x,2/this.us.oi().y]).fV(r("uDevicePixelRatio"),this.sR()),a instanceof Li?this.cV(n("uScale"),s.uniforms.gV()).cV(n("uDisp"),s.uniforms.pV()).cV(r("uScaleStart_highpart"),s.uniforms.Nz()).cV(r("uScaleStart_lowpart"),s.uniforms.Gz()):a instanceof zi&&this.cV(r("uScaleStart"),s.uniforms.MixedScaleXY.uScaleStart).cV(r("uScaleStartLog"),s.uniforms.MixedScaleXY.uScaleStartLog).cV(r("uScaleInterval"),s.uniforms.MixedScaleXY.uScaleInterval).cV(r("uScaleIntervalLog"),s.uniforms.MixedScaleXY.uScaleIntervalLog).cV(n("uViewportStart"),s.uniforms.MixedScaleXY.uViewportStart).cV(n("uViewportSize"),s.uniforms.MixedScaleXY.uViewportSize);const h=!0===s.coordsHighPrecision;if(s.coordsX)if(h){const t=o("aPos_highpartX"),e=o("aPos_lowpartX");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.coordsX),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(e,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,1*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(e)}else this.jV(o("aPosX"),s.coordsX);if(s.coordsY)if(h){const t=o("aPos_highpartY"),e=o("aPos_lowpartY");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.coordsY),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(e,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,1*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(e)}else this.jV(o("aPosY"),s.coordsY);if(1===e)this.AV(n("uColor"),s.mousePickingColor);else{if(s.fillStyleSolid&&this.AV(n("uColor"),s.fillStyleSolid.getColor()),s.fillStylePaletted){if("value"===s.fillStylePaletted.getLookUpProperty()&&null!==s.lookupValueBuffer){if(!s.lookupValueBuffer)return!1;const t=o("aLookupValue");this.jV(t,s.lookupValueBuffer),void 0!==s.lookupValueAttribDivisor&&this.HV(t,s.lookupValueAttribDivisor)}this.Ez(t,s.fillStylePaletted.lut,s.lookupValueRange)}if(s.fillStyleLinearGradient){if(!s.linearGradientInfo)return!1;this.Sz(t,s.linearGradientInfo,s.fillStyleLinearGradient)}if(s.fillStyleRadialGradient){if(!s.radialGradientInfo)return!1;this.yz(t,s.radialGradientInfo,s.fillStyleRadialGradient)}if(s.fillStyleIndividual&&null!==s.colorBuffer){if(!s.colorBuffer)return!1;const t=o("aColor");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.colorBuffer),this.gl.vertexAttribPointer(t,4,this.gl.UNSIGNED_BYTE,!0,0,0),this.gl.enableVertexAttribArray(t),void 0!==s.colorAttribDivisor&&this.HV(t,s.colorAttribDivisor)}}return!0}Wz(t,e,i){if(t)return Sm(i||e.na(),e.dt,t.getAngle(!0),this.sR())}Uz(t,e,i){if(t)return xm(i||e.na(),e.dt,t.getPosition(),t.getExtent(),t.getShape(),this.sR())}}const Dm=async(t,e,i,s,n,r,o)=>{const a=t.fenceSync(t.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),((t,e,i)=>{const s=void 0!==i.flags?i.flags:0,n=void 0!==i.retryTimeout?i.retryTimeout:10;return new Promise(((i,r)=>{const o=()=>{const a=t.clientWaitSync(e,s,0);return a===t.WAIT_FAILED?r(new Error(`WebGL Sync WAIT_FAILED ${t.getError()}`)):a!==t.TIMEOUT_EXPIRED?i(void 0):void St.setTimeout(o,n)};St.setTimeout(o,0)}))})(t,a,{retryTimeout:10}).then((()=>(t.deleteSync(a),t.bindBuffer(e,i),t.getBufferSubData(e,s,n,r,o),t.bindBuffer(e,null),n))).catch((t=>{throw t}))};class Im{yV(t){if(t instanceof Li||t instanceof mu){const e=t.yi();this.Yz=e.x.scaling,this.$z=-e.x.displacement,this.Xz=e.y.scaling,this.jz=-e.y.displacement,this.Zz=e.x.highPrecisionOffset,this.Qz=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.Jz=e.y.highPrecisionOffset,this.Kz=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof zi&&(this.MixedScaleXY=t.yi());return this}pV(){return[this.$z,this.jz]}gV(){return[this.Yz,this.Xz]}Nz(){return[this.Zz,this.Jz]}Gz(){return[this.Qz,this.Kz]}}class _m{constructor(){this.Yz=0,this.Xz=0,this.qz=0,this.$z=0,this.jz=0,this.tO=0}iO(t){return this.Yz=t.et(),this.$z=t.getInnerStart()+.5*this.Yz*t.ht(),this}sO(t){return this.Xz=t.et(),this.jz=t.getInnerStart()+.5*this.Xz*t.ht(),this}eO(t){return this.qz=t.et(),this.tO=t.getInnerStart()+.5*this.qz*t.ht(),this}gV(){return[this.Yz,this.Xz,this.qz]}pV(){return[this.$z,this.jz,this.tO]}hO(t,e,i,s,n){const r=u(2*(t-i.x)/(i.width-i.x)-1,2*(e-i.y)/(i.height-i.y)-1),o=ol.multiply(s,[r.x,r.y,n,1]);return f(o[0],o[1],o[2])}}class Fm{constructor(t){this.zL=t}yL(t,e,i,s,n,r=0){const o=this.zL,a=void 0===s;if(!(s=s||o.bV()))throw new gt("Could not bind a framebuffer.");const h=o.jE(),l=o.KE();o.mV(!1),o.tz((()=>{o.hV(0,0,i.x,i.y),t()}),s,e,r),a&&o.wV(s),this.zL.iz(n),this.zL.hV(h.x,h.y,h.width,h.height),o.mV(l)}}class Lm{constructor(t,e){this.rO=[],this.nO=[],this.uniform=t=>{const e=this.shader.SR(t);return this.nO.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.vR(t);return this.nO.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.xR(t);return this.rO.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.rO)this.glUtils.$V(t.location),this.glUtils.HV(t.location,0)}}class zm extends Wn{constructor(t,e,i,s,n){super(t,e,i,s),this.oO=new Map,this.aO=t,this.lO=e,this.zL=t.uO(),this.cO=n,this.lO=e}dO(t){return!1}GL(){return this}yL(t){if(!this.cO||0!==t||0===this.oO.size)return this;const e=Array.from(this.oO.values()).map((t=>t.fO.filter((t=>t.AO)).map((t=>t.ts)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===e.length)return this;const i=this.cO;return this.zL.uz.xV(e,i),this}Ds(){return this}xt(){return 0}vt(){return 0}Mt(){return 0}bt(){return 0}Vl(){return 0}zl(){return 0}hs(t,e){const i={fO:[]},s=(t,e)=>{const s={ts:t||[],AO:void 0===e||e};i.fO.push(s);const n={ps:t=>(s.ts=t,n),xs:t=>(s.AO=t,n),Ms:()=>s.AO};return n},n={};Object.keys(e).forEach((t=>{const i=e[t],r=i.shapes||[],o=void 0===i.themeEffectEnabled||i.themeEffectEnabled,a=s(r,o);n[t]=a}));const r={gA:s,...n};this.oO.set(t,i);const o=t.onDispose((()=>{this.oO.delete(t),t.offDispose(o)}));return r}}const Pm=(t,e,i)=>((t,e,i,s)=>{const n=[];let r=0;const o=si(e,i/2);let a,h,l,c,d=t[t.length-1],f=0;for(let i=0;i0&&(d=t[i-1]),bt(a,d)&&(d=ni(a,ti(si(ri(h,a),-1)))),bt(a,h)&&(h=ni(a,ti(si(ri(d,a),-1))));const s=ai(d,e),g=ai(a,e),m=ai(h,e),p=ti(ri(g,s)),y=ti(ri(m,g)),A=ni(p,y),x=u(-A.y,A.x),S=u(-p.y,p.x),b=1/li(x,S),v=ii(x),M=ti(ri(p,y)),T=Math.sign(li(x,M))||1,w=oi(x,si(o,b)),E=oi(x,si(o,-b));if(v<1||b===1/0){let t={x:0,y:0},e={x:0,y:0},i={x:0,y:0},s={x:0,y:0};const l=u(-y.y,y.x),c=Math.sign(li(p,x))||T,g=oi(S,si(o,c)),m=oi(l,si(o,c));1===T?(t=g,e=E,i=m,s=E):(t=w,e=g,i=w,s=m);const A=4*We(d,a),v=4*We(a,h);(b>A||b>v)&&(1===T?(t=g,e=m,i=m,s=g):(t=m,e=g,i=g,s=m));const M=ni(a,t),k=ni(a,e),C=ni(a,i),D=ni(a,s);n[r]=M,r+=1,n[r]=k,r+=1,n[r]=C,r+=1,n[r]=D,r+=1,f=4}else{const t=ni(a,w),e=ni(a,E);n[r]=t,r+=1,n[r]=e,r+=1,f=2}c=l,l=t[i]}return n[r]=n[0],r+=1,n[r]=n[1],r+=1,[n,f,[c,l]]})(t,e,i)[0];class Rm extends nr{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.dR=new Im,this.gO=Le,this.pO=Le,this.mO=mg({arcStyleSolid:()=>G(this.be)&&this.be,arcStyleRadialGradient:()=>Q(this.be)&&this.be,arcStyleLinearGradient:()=>it(this.be)&&this.be}),this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO()}vO(t,e){let i=0,s=Array(0),n=0;if(void 0!==e){const n=t.length,r=Array(n+e.length);let o=0,a=0;for(;o0?Ru(this.wa._(),this.hu._(),this.Fi._(),this.ru._()*l/100,this.nu._()*l/100,h)[0]:[this.wa._()],d=a.length-1;if(2===d){const t=(a[d-1].x+a[1].x)/2,e=(a[d-1].y+a[1].y)/2;this.lu=u(t,e)}else{const t=Math.floor(d/2);this.lu=u(a[t].x,a[t].y)}this.uu=a[1];const f=a.length-1;this.cu=a[f],this.ou._()&&(a.shift(),c.shift());let g=!1;(this.wa.o||this.hu.o||this.Fi.o||this.ru.o||this.nu.o||this.ou.o||this.au.o||s)&&(this.pO=m(u(this.Ya().x-r,this.Ya().y-o),u(this.Ya().x+r,this.Ya().y+o)),g=!0,this.wa.o=!1,this.hu.o=!1,this.Fi.o=!1,this.ru.o=!1,this.nu.o=!1,this.ou.o=!1,this.au.o=!1);const p=this.ga();(g||p)&&this.be!==V&&(this.ou._()?(this.bO&&this.zL.SV(this.bO),[this.MO,this.bO,this._O,this.wO]=this.vO(a,c)):(this.bO&&this.zL.SV(this.bO),[this.MO,this.bO,this._O,this.wO]=this.vO(a,void 0)),Q(this.be)?this.CO=xm(this.pO,this.dt,this.be.getPosition(),this.be.getExtent(),this.be.getShape(),this.zL.sR()):it(this.be)?this.kO=Sm(this.pO,this.dt,this.be.getAngle(!0),this.zL.sR()):(this.CO=void 0,this.kO=void 0));const y=this.mO.arcStyleSolid(p),A=this.mO.arcStyleLinearGradient(p),x=this.mO.arcStyleRadialGradient(p),S=y||A||x;p&&(this.TO=S?this.zL.cE(Wg["2D"],Wg.Color({dataType:Q(this.be)||it(this.be)?["gradient",this.be]:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.Sa(this.be));const b=this.Me;if(Ji(b)&&(g||this.ba(b.getThickness())||s)){this.ou._()?360===i?(a.pop(),c.pop(),[this.FO,this.IO]=this.xO(a,void 0,b.getThickness(),n),this.PO&&this.FO?this.zL.NV(this.PO,this.FO,!0):!this.PO&&this.FO?this.PO=this.zL.oV(this.FO,!0):this.PO&&!this.FO&&(this.zL.SV(this.PO),this.PO=void 0),[this.DO,this.BO]=this.xO(c,void 0,b.getThickness(),n),this.LO&&this.DO?this.zL.NV(this.LO,this.DO,!0):!this.LO&&this.DO?this.LO=this.zL.oV(this.DO,!0):this.LO&&!this.DO&&(this.zL.SV(this.LO),this.LO=void 0)):([this.FO,this.IO]=this.xO(a,c,b.getThickness(),n),this.PO&&this.FO?this.zL.NV(this.PO,this.FO,!0):!this.PO&&this.FO?this.PO=this.zL.oV(this.FO,!0):this.PO&&!this.FO&&(this.zL.SV(this.PO),this.PO=void 0),this.DO&&(this.LO&&this.zL.SV(this.LO),this.LO=void 0,this.BO=0)):(360===i&&(a.shift(),a.pop()),[this.FO,this.IO]=this.xO(a,void 0,b.getThickness(),n),this.PO&&this.FO?this.zL.NV(this.PO,this.FO,!0):!this.PO&&this.FO?this.PO=this.zL.oV(this.FO,!0):this.PO&&!this.FO&&(this.zL.SV(this.PO),this.PO=void 0));const t=b.getFillStyle();Q(t)?this.RO=xm(this.pO,this.dt,t.getPosition(),t.getExtent(),t.getShape(),this.zL.sR()):it(t)?this.EO=Sm(this.pO,this.dt,t.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),this.VO=t===V?void 0:this.zL.cE(Wg["2D"],Wg.Color({dataType:Q(t)||it(t)?["gradient",t]:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})),this.Ma(b)}if(g){let t=1,e=1;Ji(b)&&(t=b.getThickness()*n.x,e=b.getThickness()*n.y),this.gO=m(u(this.pO.min.x-t,this.pO.min.y-e),u(this.pO.max.x+t,this.pO.max.y+e))}this.zO=e&&S?this.zO||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.OO=e&&this.Me!==nt?this.OO||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0}return this}yL(t){if(this.ya()){const e=1===t?this.zO:this.TO,i=this.be,s=this.bO;e&&s&&this.zL.JL(e).lV(e,((e,n,r,o)=>{if(this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(o("uScaleStart_highpart"),this.dR.Nz()).cV(o("uScaleStart_lowpart"),this.dR.Gz()).bz(r,s,this.dt._i(),void 0).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1===t)this.zL.AV(e("uColor"),this.SO);else if(G(i))this.zL.AV(e("uColor"),i.getColor());else if(Q(i)){if(!this.CO)return!1;this.zL.yz(r,this.CO,i)}else if(it(i)){if(!this.kO)return!1;this.zL.Sz(r,this.kO,i)}return this.zL.Pp(this.wO,this._O),!0}));const n=this.Me;Ji(n)&&(void 0!==this.PO&&this.NO(t,this.PO,this.IO,n),void 0!==this.LO&&this.NO(t,this.LO,this.BO,n))}return this}NO(t,e,i,s){const n=1===t?this.OO:this.VO,r=s.getFillStyle();n&&this.zL.JL(n).lV(n,((n,o,a,h)=>{if(this.zL.cV(n("uScale"),this.dR.gV()).cV(n("uDisp"),this.dR.pV()).bz(a,e,this.dt._i(),void 0).fV(n("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(n("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(n("uRenderEffectMask"),2===t?1:0),1===t)this.zL.AV(n("uColor"),this.SO);else if(G(r))this.zL.AV(n("uColor"),r.getColor());else if(Q(r)){if(!this.RO)return!1;this.zL.yz(a,this.RO,r)}else if(it(r)){if(!this.EO)return!1;this.zL.Sz(a,this.EO,r)}const l=s.getThickness(),u=-1===l||1===l;return this.zL.Pp(u?this.zL.gl.LINE_LOOP:this.zL.gl.TRIANGLE_STRIP,i),!0}))}dO(t){return this.yO===t&&{}}GL(){return this.GO&&(this.zL.SV(this.GO),this.GO=void 0),this.WO&&(this.zL.SV(this.WO),this.WO=void 0),this.bO&&(this.zL.SV(this.bO),this.bO=void 0),this.PO&&(this.zL.SV(this.PO),this.PO=void 0),this.LO&&(this.zL.SV(this.LO),this.LO=void 0),this.TO=void 0,this.VO=void 0,this.zO=void 0,this.OO=void 0,this}xt(){return this.pO.max.x}vt(){return this.pO.min.x}Mt(){return this.pO.max.y}bt(){return this.pO.min.y}Vl(){return Me(this.Me)}zl(){return Me(this.Me)}}class Vm{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}UO(t){return this.first=t,this.second=t+1,this.third=t+2,this.fourth=t+3,this.fifth=t+4,this.sixth=t+5,t+=6,this}YO(){return this.first=this.second,this.second=this.third,this.third=this.fourth,this.fourth=this.fifth,this.fifth=this.sixth,this.sixth+=1,this}HO(){return this.first=this.third,this.second=this.fourth,this.third=this.fifth,this.fourth=this.sixth,this.fifth=this.fourth+1,this.sixth=this.fifth+1,this}$O(t){const e=t.buffer;let{position:i}=t;return e[i]=this.first,e[i+1]=this.second,e[i+2]=this.third,i+=3,t.position=i,t.next&&this.YO(),this}XO(t){const e=t.buffer;let{position:i}=t;return e[i]=this.first,e[i+1]=this.third,e[i+2]=this.second,e[i+3]=this.third,e[i+4]=this.fourth,e[i+5]=this.second,i+=6,t.position=i,t.next&&this.HO(),this}jO(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new Vm).UO(t))(),Om=(t,e,i,s,n,r,o,a,h,l)=>(void 0===a&&void 0===o||Bm.YO(),r.push(t,e),n.push(Bm.first,Bm.second,Bm.third),a=void 0,o=void 0,n.push(Bm.third,Bm.fourth,Bm.second),h=Bm.third,Bm.HO(),l&&r.push(i,s),[o,a,h]),Nm=(t,e,i,s,n,r,o,a,h,l,u)=>{void 0===h&&void 0===a||Bm.YO(),o.push(t,e),n.push(Bm.first,Bm.second,Bm.third);const c=yi(t,i,e,s);return h=void 0,void 0!==c&&(void 0===h&&(h=c),o.push(h),r.push(Bm.third,Bm.fourth,Bm.fifth),l=Bm.fourth),Bm.HO(),u&&o.push(i,s),[a,h,l]},Um=(t,e,i,s,n,r,o,a,h,l)=>(void 0===o&&void 0===r||Bm.YO(),n.push(t,e),s.push(Bm.first,Bm.second,Bm.third),r=i,o=void 0,a=Bm.third,l?n.push(i):h=!0,[r,o,a,h]),Gm=(t,e,i,s,n,r,o,a,h,l,u)=>(0!==r.length?(void 0===a&&void 0===o||Bm.YO(),Bm.YO()):h>0&&(Bm.YO(),u>0&&(u-=1)),r.push(t),n.push(Bm.first,Bm.second,Bm.third),h=Bm.second,o=t,a=void 0,l&&r.push(i,s),[o,a,h,u]),Wm=(t,e=0)=>{Bm.UO(e);const[i,s]=t,n=i.length,r=[],o=[],a=[];let h,l,u=e,c=0,d=i[c],f=s[c],g=i[c],m=s[c],p=!1,y=u>0?g.y!==m.y?2:1:0;if(n>1)for(;cm.y?d.y>f.y?[h,l,u]=Om(g,m,d,f,r,a,h,l,u,t):d.yf.y?[h,l,u]=Nm(g,m,d,f,o,r,a,h,l,u,t):[h,l,u,p]=Um(g,m,d,o,a,h,l,u,p,t):d.y===f.y?(h=g,p&&(a.push(g),p=!1,Bm.YO()),0===a.length&&u>0&&y>0&&(y-=1)):d.y>f.y?[h,l,u,y]=Gm(g,0,d,f,r,a,h,l,u,t,y):[h,l,u,y]=Gm(g,0,d,f,o,a,h,l,u,t,y)}return[a,new Uint16Array(r),new Uint16Array(o),u,y]};class Ym extends sr{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.dR=new Im,this.QO=0,this.sl=Array(),this.JO=0,this.KO=new Uint16Array(0),this.qO=new Uint16Array(0),this.mO=mg({hightFillSolid:()=>G(this.be)&&this.be,hightFillRadialGradient:()=>Q(this.be)&&this.be,hightFillLinearGradient:()=>it(this.be)&&this.be,hightFillPaletted:()=>H(this.be)&&this.be,lowFillSolid:()=>G(this.Hl)&&this.Hl,lowFillRadialGradient:()=>Q(this.Hl)&&this.Hl,lowFillLinearGradient:()=>it(this.Hl)&&this.Hl,lowFillPaletted:()=>H(this.Hl)&&this.Hl}),this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO()}Ds(){const t=this.ma(),e=this.jo._(),i=this.fl;if(this.ya()){this.dR.yV(this.dt);const s=this.dt instanceof zi==0,n=s?this.dt.Wi():void 0,r=this.Zl(),o=this.dt.Ni()||t,a=i||this.Gl.o||o&&"disabled"!==r.type;if(a){if(this.QO=0,this.KO=new Uint16Array(0),this.qO=new Uint16Array(0),this.sl.length=0,this.JO=0,this.Wl>1){const[t,e,i,o]=Wm([s?r.packager(this.Ol,n,.5):this.Ol,s?r.packager(this.Nl,n,.5):this.Nl]);this.QO=o,this.KO=e,this.qO=i,this.sl=t,this.JO=t.length}this.Gl.o=!1}if(this.Yl&&this.ll[0].length>1){const[t,e]=this.ll,i=t.length,[o,a,h,l,u]=Wm([s?r.packager(t,n,.5):t,s?r.packager(e,n,.5):e],this.QO);this.QO=l;const c=o.length;for(let t=u;t0||this.Wl>0?1:u;s{if(this.zL.bz(o,e,this.dt._i(),void 0).ZV(n).fV(s("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(s("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(s("uRenderEffectMask"),2===t?1:0),this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(s("uScale"),this.dR.gV()).cV(s("uDisp"),this.dR.pV()).cV(a("uScaleStart_highpart"),this.dR.Nz()).cV(a("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(a("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(a("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(a("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(a("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(s("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(s("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(s("uColor"),this.SO);else if(G(i))this.zL.AV(s("uColor"),i.getColor());else if(Q(i)){if(!this.sN)return!1;this.zL.yz(o,this.sN,i)}else if(it(i)){if(!this.eN)return!1;this.zL.Sz(o,this.eN,i)}else if(H(i)){const t=pg(i,this,void 0);if(!t&&i.lut.percentageValues)return!1;this.zL.Ez(o,i.lut,t)}return this.zL.JV(this.aN),!0}))}const n=1===t?this.zO:this.tN;if(n&&this.hN&&this.rN){const i=this.hN,s=this.rN;this.zL.JL(n).lV(n,((n,r,o,a)=>{if(this.zL.bz(o,i,this.dt._i(),void 0).ZV(s).fV(n("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(n("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(n("uRenderEffectMask"),2===t?1:0),this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(n("uScale"),this.dR.gV()).cV(n("uDisp"),this.dR.pV()).cV(a("uScaleStart_highpart"),this.dR.Nz()).cV(a("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(a("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(a("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(a("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(a("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(n("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(n("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(n("uColor"),this.SO);else if(G(e))this.zL.AV(n("uColor"),e.getColor());else if(Q(e)){if(!this.CO)return!1;this.zL.yz(o,this.CO,e)}else if(it(e)){if(!this.kO)return!1;this.zL.Sz(o,this.kO,e)}else if(H(e)){const t=pg(e,this,void 0);if(!t&&e.lut.percentageValues)return!1;this.zL.Ez(o,e.lut,t)}return this.zL.JV(this.nN),!0}))}return this}dO(t){return this.yO===t&&{}}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return 0}zl(){return 0}Cx(t){this.Cl()>0&&this.Ds();const[e,i]=this.yl(),s=e.length>2&&e[1].x0&&this.Ds();const[e,i]=this.yl(),s=e.length;if(0===s)return;const n=this.$l?1:0,r=s-(this.Xl?2:1),o=e.length>2&&e[1].x{const i=1===e?.5*Math.PI:1.5*Math.PI;for(let s=0;s<=this.lN;s+=1){const n=i-s*Math.PI/this.lN;t.push(.5*Math.cos(n),.5*Math.sin(n),e,0)}})),t.push(0,0,1,1),t.push(0,0,0,1);const e=t.length/4,i=[];for(let t=0;t((t,e)=>{let i=t.CV.wE.get(e);return i||(i=new Hm(t,e),t.CV.wE.set(e,i),i)})(t,i?e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2:1),jm={gN:(t,e,i,s,n,r)=>{const{attribute:o}=s,a=e.gl;if(a.bindBuffer(a.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),h=o("aLocationB_lowpart");a.vertexAttribPointer(t,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),e.HV(t,1),a.enableVertexAttribArray(t),a.vertexAttribPointer(i,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(r+2)*Float32Array.BYTES_PER_ELEMENT),e.HV(i,1),a.enableVertexAttribArray(i),a.vertexAttribPointer(s,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(r+n)*Float32Array.BYTES_PER_ELEMENT),e.HV(s,1),a.enableVertexAttribArray(s),a.vertexAttribPointer(h,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(r+n+2)*Float32Array.BYTES_PER_ELEMENT),e.HV(h,1),a.enableVertexAttribArray(h)}else{const t=o("aLocationA"),i=o("aLocationB");a.vertexAttribPointer(t,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),e.HV(t,1),a.enableVertexAttribArray(t),a.vertexAttribPointer(i,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(r+n)*Float32Array.BYTES_PER_ELEMENT),e.HV(i,1),a.enableVertexAttribArray(i)}},pN:(t,e,i,s,n,r,o)=>{const a=t.gl;a.bindBuffer(a.ARRAY_BUFFER,i),a.vertexAttribPointer(s,r,a.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.HV(s,1),a.enableVertexAttribArray(s),a.vertexAttribPointer(n,r,a.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(o+r)*Float32Array.BYTES_PER_ELEMENT),t.HV(n,1),a.enableVertexAttribArray(n)},mN:(t,e,i,s,n,r)=>{const{attribute:o}=s,a=e.gl;if(a.bindBuffer(a.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),h=o("aLocationB_lowpart");a.vertexAttribPointer(t,2,a.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),e.HV(t,1),a.enableVertexAttribArray(t),a.vertexAttribPointer(i,2,a.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(r+2)*Float32Array.BYTES_PER_ELEMENT),e.HV(i,1),a.enableVertexAttribArray(i),a.vertexAttribPointer(s,2,a.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(r+n)*Float32Array.BYTES_PER_ELEMENT),e.HV(s,1),a.enableVertexAttribArray(s),a.vertexAttribPointer(h,2,a.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(r+n+2)*Float32Array.BYTES_PER_ELEMENT),e.HV(h,1),a.enableVertexAttribArray(h)}else{const t=o("aLocationA"),i=o("aLocationB");a.vertexAttribPointer(t,2,a.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),e.HV(t,1),a.enableVertexAttribArray(t),a.vertexAttribPointer(i,2,a.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(r+n)*Float32Array.BYTES_PER_ELEMENT),e.HV(i,1),a.enableVertexAttribArray(i)}},yN:(t,e,i,s,n,r,o)=>{const a=t.gl;a.bindBuffer(a.ARRAY_BUFFER,i),a.vertexAttribPointer(s,r,a.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.HV(s,1),a.enableVertexAttribArray(s),a.vertexAttribPointer(n,r,a.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(o+r)*Float32Array.BYTES_PER_ELEMENT),t.HV(n,1),a.enableVertexAttribArray(n)},yL:(t,e,i,s,n,r,o)=>{const a=t.uO(),{uniform:h,uniformOptional:l}=i,u=1/t.En.ao,c=(n?Math.max(r,u):Math.max(r,0))+1;a.fV(h("uThicknessPixels"),c).fV(l("uAALimit"),1-(c-1)/c).cV(h("uRatioPxClip"),[2/t.oi().x,2/t.oi().y]),e.JL(i,s).Pp(o)}},$m={gN:(t,e,i,s,n,r)=>{const{attribute:o}=s,a=e.gl;if(a.bindBuffer(a.ARRAY_BUFFER,i),t){const t=o("aPos_highpart");a.vertexAttribPointer(t,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),a.enableVertexAttribArray(t);const e=o("aPos_lowpart");a.vertexAttribPointer(e,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(r+2)*Float32Array.BYTES_PER_ELEMENT),a.enableVertexAttribArray(e)}else{const t=o("aPos");a.vertexAttribPointer(t,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),a.enableVertexAttribArray(t)}},pN:(t,e,i,s,n,r)=>{const o=t.gl;o.bindBuffer(o.ARRAY_BUFFER,i),o.vertexAttribPointer(s,n,o.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),o.enableVertexAttribArray(s)},mN:(t,e,i,s,n,r)=>{const{attribute:o}=s,a=e.gl;if(a.bindBuffer(a.ARRAY_BUFFER,i),!t){const t=o("aPos");a.vertexAttribPointer(t,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),a.enableVertexAttribArray(t)}},SN:(t,e)=>{const i=t.uO();i.Pp(i.gl.LINE_STRIP,e,0)},vN:(t,e)=>{const i=t.uO();i.Pp(i.gl.LINES,2*e,0)}};class qm extends ar{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.dR=new Im,this.ol=Le,this.mO=mg({lineStyleSolid:()=>Ji(this.Cu)&&this.Cu,lineStyleDashed:()=>Kr(this.Cu)&&this.Cu,strokeFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},strokeFillLinearGradient:()=>{const t=this.Cu.getFillStyle();return it(t)&&t},strokeFillRadialGradient:()=>{const t=this.Cu.getFillStyle();return Q(t)&&t},strokeFillPaletted:()=>{const t=this.Cu.getFillStyle();return H(t)&&t}}),this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO(),this.xN=this.zL.rz}Ds(){const t=this.va(),e=this.Cu,i=this.mO.lineStyleSolid(t),s=this.mO.lineStyleDashed(t),n=i||s,r=this.mO.strokeFillSolid(t),o=this.mO.strokeFillLinearGradient(t),a=this.mO.strokeFillRadialGradient(t),h=this.mO.strokeFillPaletted(t),l=r||o||a||h&&["x","y"].includes(h.getLookUpProperty())&&h,c=this.Ii(),d=this.Ti(),f=this.jo._(),g=this.jo.o,p=e.V();if(s&&this.dt instanceof zi)return St.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.dR.yV(this.dt),this.Pu&&(this.bN=this.zL.oV(qt([c,d],this.dt._i()),!1,this.bN),this.ol=m(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.ya()&&n&&l&&p>0,e=o?["gradient",o]:a?["gradient",a]:h?["lookup",h.getLookUpProperty(),h.lut]:"uniform";this.MN=t?{type:"triangulated",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0}),this.xN?Wg.AliasedEdge:void 0,s&&Wg.StippleTextureInstanced),mousePickingShader:f?this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0}),s&&Wg.StippleTextureInstanced):void 0,geometry:Xm(this.zL,p),thickness:p,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:r,fillStyleLinearGradient:o,fillStyleRadialGradient:a,fillStylePaletted:h}:void 0}if(a?this.RO=xm(Hn(this.ol,{x:this.Vl(),y:this.zl()},this.dt),this.dt,a.getPosition(),a.getExtent(),a.getShape(),this.zL.sR()):o?this.EO=Sm(Hn(this.ol,{x:this.Vl(),y:this.zl()},this.dt),this.dt,o.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),s){if(t||this.Pu){const t=[0,0,Math.abs(d.x-c.x),Math.abs(d.y-c.y)];this._N=this.zL.oV(t,!1,this._N)}this.wN=this.zL.Dz(s.getPattern())}else this._N&&(this.zL.SV(this._N),this._N=void 0),this.wN=void 0;return this.Iu(e),this.Pu=!1,this.jo.o=!1,this}yL(t){var e,i;const s=this.bN;if(!s)return this;const n=this.MN;if(!n)return this;const{fillStyleSolid:r,fillStyleLinearGradient:o,fillStyleRadialGradient:a,fillStylePaletted:h,lineStyleDashed:l,thickness:u}=n,c=1===t?null===(e=this.MN)||void 0===e?void 0:e.mousePickingShader:null===(i=this.MN)||void 0===i?void 0:i.shader;return c?(this.zL.JL(c).lV(c,((e,i,c,d)=>{if(this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(d("uScaleStart_highpart"),this.dR.Nz()).cV(d("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(d("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(d("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(d("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(d("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(e("uColor"),this.SO);else if(r)this.zL.AV(e("uColor"),r.getColor());else if(a){if(!this.RO)return!1;this.zL.yz(c,this.RO,a)}else if(o){if(!this.EO)return!1;this.zL.Sz(c,this.EO,o)}else if(h){const t=pg(h,this,void 0);if(!t&&h.lut.percentageValues)return!1;this.zL.Ez(c,h.lut,t)}if(l){if(!this._N||!this.wN)return!1;jm.pN(this.zL,c,this._N,i("aLengthSoFarA"),i("aLengthSoFarB"),2,0),this.zL.cV(e("uStippleCount"),[this.us.oi().x/this.wN.Rz,this.us.oi().y/this.wN.Rz]).fV(d("uStippleTextureWidthLimiter"),this.wN.Lz/this.wN.Rz).fV(e("uStippleScale"),l.getPatternScale()).dV(e("uStippleTexture"),this.wN.Bz,1)}return jm.gN(this.dt._i(),this.zL,s,c,this.dt._i()?4:2,0),jm.yL(this.aO,n.geometry,c,this.xN&&1!==t,1===t,u,1),!0})),this):this}dO(t){return this.yO===t&&{}}dispose(){return super.dispose(),this.MN=void 0,this.bN&&(this.zL.SV(this.bN),this.bN=void 0),this._N&&(this.zL.SV(this._N),this._N=void 0),this.wN=void 0,this}GL(){return this}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return Me(this.Cu)}zl(){return Me(this.Cu)}}class Jm extends hr{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.CN=[],this.kN=!1,this.TN=!1,this.FN=!1,this.IN=!1,this.dR=new Im,this.ol=Le,this.mO=mg({lineStyleSolid:()=>Ji(this.Cu)&&this.Cu,lineStyleDashed:()=>Kr(this.Cu)&&this.Cu,lineFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},lineFillRadialGradient:()=>{const t=this.Cu.getFillStyle();return Q(t)&&t},lineFillLinearGradient:()=>{const t=this.Cu.getFillStyle();return it(t)&&t},lineIndividualPointFill:()=>{const t=this.Cu.getFillStyle();return W(t)&&t}}),this.aO=t,this.lO=e,this.PN=r,this.zL=t.uO(),this.xN=this.zL.rz,this.DN=t.En.uo;const{color:o,id:a}=this.PN();this.SO=o,this.yO=a}Lr(){const t=this.Bu?void 0:this.PN(),e={vs:t=>this.LN(e,t),cs:t=>this.RN(e,t),CA:(t,i)=>this.EN(e,t,i),AV:t=>this.VN(e,t),Pi:{x:0,y:0},Fi:{x:0,y:0},Ko:0,zN:void 0,yO:null==t?void 0:t.id,SO:null==t?void 0:t.color};return this.CN.push(e),e}Nt(){var t;return this.CN.length=0,this.kN=!0,this.ji&&this.bn&&(null===(t=this.us.vn)||void 0===t?void 0:t.entity)===this&&this.bn(this,void 0,this.us.vn.collectionMember),this}ON(){return this.CN.length}_(t){const e=this.CN[t];return[e.Pi,e.Fi]}jp(){return this.CN}Wc(t){var e;const i=this.CN.indexOf(t);i>=0&&(this.CN.splice(i,1),this.kN=!0,this.ji&&this.bn&&(null===(e=this.us.vn)||void 0===e?void 0:e.entity)===this&&this.bn(this,void 0,this.us.vn.collectionMember))}LN(t,e){if(e&&!this.CN.includes(t))this.CN.push(t);else if(!e){const e=this.CN.indexOf(t);this.CN.splice(e,1)}return this.FN=!0,t}RN(t,e){return t.Ko=e,this.TN=!0,t}EN(t,e,i){return t.Pi=e,t.Fi=i,this.kN=!0,t}VN(t,e){return t.zN=e,this.IN=!0,t}Ds(){const t=this.jo._(),e=this.jo.o,i=this.va(),s=this.Cu,n=this.CN,r=this.TN,o=this.kN,a=this.FN,h=this.IN,l=this.mO.lineStyleSolid(i),u=this.mO.lineStyleDashed(i),c=l||u,d=this.mO.lineFillSolid(i),f=this.mO.lineIndividualPointFill(i),g=this.mO.lineFillRadialGradient(i),m=this.mO.lineFillLinearGradient(i),p=d||f||m||g,y=s.V(),A=u?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(u&&this.dt instanceof zi)return St.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this.dR.yV(this.dt);const x=o||a;if(x){const t=[];for(let e=0;e0&&e;this.MN=i?"triangulated"===A?{type:"triangulated",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,snapToNearestPixel:this.DN,ensureMinimumSegmentLength:void 0!==this.Du}),this.xN?Wg.AliasedEdge:void 0,u&&Wg.StippleTextureInstanced,Wg.AttributeHighlight),mousePicking:t?{shader:this.zL.cE(Wg["2D"],this.Bu?Wg.MousePicking:Wg.MousePickingAttribute,Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,snapToNearestPixel:this.DN,ensureMinimumSegmentLength:void 0!==this.Du}),u&&Wg.StippleTextureInstanced,Wg.AttributeHighlight)}:void 0,geometry:Xm(this.zL,y,!1),thickness:y,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:m,fillStyleRadialGradient:g}:{type:"primitive",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0,snapToNearestPixel:this.DN}),Wg.AttributeHighlight),mousePicking:t?{shader:this.zL.cE(Wg["2D"],this.Bu?Wg.MousePicking:Wg.MousePickingAttribute,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0,snapToNearestPixel:this.DN}),Wg.AttributeHighlight)}:void 0,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:m,fillStyleRadialGradient:g}:void 0}if(u){if(i||x){const t=new Float32Array(4*n.length);let e=0;for(let i=0;i{t[e]=i.Ko,e+=1})),this.NN=this.zL.oV(t,!0,this.NN)}else{const t=new Float32Array(2*n.length);let e=0;n.forEach((i=>{for(let s=e;s{const s=i.zN||f.color;t[e]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=s.a,e+=4})),this.GN=this.zL.oV(t,!1,this.GN)}else{const t=new Float32Array(8*n.length);let e=0;n.forEach((i=>{const s=i.zN||f.color;for(let i=e;i{var s,n,r,o;t[e+0]=(null===(s=i.SO)||void 0===s?void 0:s.r)||0,t[e+1]=(null===(n=i.SO)||void 0===n?void 0:n.g)||0,t[e+2]=(null===(r=i.SO)||void 0===r?void 0:r.b)||0,t[e+3]=(null===(o=i.SO)||void 0===o?void 0:o.a)||0,e+=4})),this.WN=this.zL.oV(t,!0,this.WN)}else{const t=new Float32Array(8*n.length);let e=0;n.forEach((i=>{var s,n,r,o;for(let a=e;a{if(this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(g("uScaleStart_highpart"),this.dR.Nz()).cV(g("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(g("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(g("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(g("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(g("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),this.DN&&this.zL.cV(g("uViewportSizePx"),[this.us.oi().x*this.zL.sR(),this.us.oi().y*this.zL.sR()]),void 0!==this.Du&&this.zL.cV(e("uMinSegmentPixelVector"),[this.Du.x,this.Du.y]),this.zL.AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1===t)if(this.Bu)this.zL.AV(e("uColor"),this.SO);else{if(!n)return!1;"triangulated"===o?this.zL.uV(n,1,{location:d("aColor"),size:4}):this.zL.XV(d("aColor"),n)}else if(a)this.zL.AV(e("uColor"),a.getColor());else if(h){if(!this.GN)return!1;this.zL.uV(this.GN,"triangulated"===o?1:void 0,{location:d("aColor"),size:4})}else if(u){if(!this.CO)return!1;this.zL.yz(f,this.CO,u)}else if(l){if(!this.kO)return!1;this.zL.Sz(f,this.kO,l)}if(c){if(!this._N||!this.wN)return!1;jm.yN(this.zL,f,this._N,d("aLengthSoFarA"),d("aLengthSoFarB"),2,0),this.zL.cV(e("uStippleCount"),[this.us.oi().x/this.wN.Rz,this.us.oi().y/this.wN.Rz]).fV(g("uStippleTextureWidthLimiter"),this.wN.Lz/this.wN.Rz).fV(e("uStippleScale"),c.getPatternScale()).dV(e("uStippleTexture"),this.wN.Bz,0)}if("triangulated"===o){const{geometry:e,thickness:n}=r;jm.mN(this.dt._i(),this.zL,i,f,this.dt._i()?4:2,0),this.zL.uV(s,1,{location:d("aIsHighlighted"),size:1}),jm.yL(this.aO,e,f,this.xN&&1!==t,1===t,n,this.CN.length)}else $m.mN(this.dt._i(),this.zL,i,f,this.dt._i()?4:2,0),this.zL.jV(d("aIsHighlighted"),s),$m.vN(this.aO,this.CN.length);return!0})),this):this}dO(t){if(t===this.yO)return{};const e=this.CN.find((e=>e.yO===t));return!!e&&{collectionMember:e}}dispose(){return super.dispose(),this.MN=void 0,this.bN&&(this.zL.SV(this.bN),this.bN=void 0),this._N&&(this.zL.SV(this._N),this._N=void 0),this.NN&&(this.zL.SV(this.NN),this.NN=void 0),this.WN&&(this.zL.SV(this.WN),this.WN=void 0),this.GN&&(this.zL.SV(this.GN),this.GN=void 0),this.wN=void 0,this}GL(){return this}cs(t){super.cs(t);for(const e of this.CN)e.cs(t);return this}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return Me(this.Cu)}zl(){return Me(this.Cu)}}class Km{constructor(t,e){this.UN=!1,this.YN=!1,this.HN=!1,this.dt=t,this.$N=e,this.$N.ha("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.UN="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.UN="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.YN=!0),!0===t.regularProgressiveStep&&(this.HN=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.UN?t[0].x:t[0].y,end:"x"===this.UN?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.UN?"x"===this.UN?function(t){const e=t.length;if(e>0){const i=Math.max(t[e-1].x,t[0].x),s=Math.min(t[e-1].x,t[0].x);let n=t[0].y,r=t[0].y;for(let i=0;in&&(n=e.y),e.y0){const i=Math.max(t[e-1].y,t[0].y),s=Math.min(t[e-1].y,t[0].y);let n=t[0].x,r=t[0].x;for(let i=0;in&&(n=e.x),e.x{!1===t.allowDataGrouping&&(this.XN=!0)}))}JN(t,e=!1){if(this.XN||!this.UN||"linear"!==this.QN.type)return!1;!1===e&&this.KN&&(clearTimeout(this.KN),this.KN=void 0);const i="x"===this.UN?this.QN.scale.x.tA:this.QN.scale.y.tA;if(!i)throw new Error("CP helper has no information about Axis state.");const s=t.length;if(s<2)return!1;const n=t[0],r=t[s-1],o=this.calculateAvgStepBetweenDataPoints("x"===this.UN?n.x:n.y,"x"===this.UN?r.x:r.y,s),a=this.QN.scale,h=Math.abs("x"===this.UN?a.Wi().x:a.Wi().y),l=h/o,u=Math.floor(l*Zm),c=u*o,d=St.performance.now(),f=!(d-i.ah<500)&&(i.ih?d-i.oh<1e3:d-i.sh<2e3||i.hh),g=s>2*this.jN.totalDataPointsAtTime;if(f&&!g)return this.KN=setTimeout((()=>this.qN(t)),1e3),!1;const m=u>=10,p=this.jN.enabled?this.jN.columnWidthAxis/h<1.5:void 0,y=this.jN.enabled&&u>this.jN.dataPointsPerColumn?u/this.jN.dataPointsPerColumn>=2:void 0;let A;!0===this.jN.enabled?p?y&&(A={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):A=m?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:m&&(A={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const x=!1===e;return A?(x&&(this.jN=A),!0):(x&&(this.jN={...this.jN,totalDataPointsAtTime:s}),!1)}Lg(){this.tG=void 0,this.ZN.length=0,this.KN&&(clearTimeout(this.KN),this.KN=void 0)}iG(t){if(0===t.length)return t;if(this.XN||!this.UN||"linear"!==this.QN.type||!this.jN.enabled)return t;let e;e=this.ZN.length>0?se(this.ZN,t,{canReturnB:!0}):t;const i=e.length,s=[];let n,r,o=void 0===this.tG,a=-1,h=-1,l=0,u=0;if("x"!==this.UN||this.YN)if("x"===this.UN&&this.YN){const t=this.jN.columnWidthAxis;let c=this.tG?this.tG.x:e[0].x,d=c-t;for(let f=0;f=d?((!n||i.y>n.y)&&(n=i,a=f),(!r||i.y=d?((!n||i.x>n.x)&&(n=i,a=f),(!r||i.xn.x)&&(n=i,a=f),(!r||i.xn.y)&&(n=i,a=f),(!r||i.y0&&(this.tG=s[c-1]),s}sG(t){if(this.UN&&"linear"===this.QN.type){const e="x"===this.UN?this.QN.scale.x.tA:this.QN.scale.y.tA;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Je===Rs.progressive||e.Je===Rs.regressive){const e=Math.abs("x"===this.UN?this.QN.scale.x.getInnerInterval():this.QN.scale.y.getInnerInterval());if(this.jN.enabled)return 2*e/this.jN.columnWidthAxis;const i=t.length,s=t[0],n=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.UN?s.x:s.y,"x"===this.UN?n.x:n.y,i)}}}eG(t,e,i){if(!this.UN)return e;const s=i.length;let n=Bn(i,t.min,this.UN,this.YN,0,s-1);void 0===n&&(n=this.YN?s-1:0);let r=Bn(i,t.max,this.UN,this.YN,0,s-1);return void 0===r&&(r=this.YN?0:s-1),1+Math.abs(r-n)}hG(){this.KN&&(clearTimeout(this.KN),this.KN=void 0)}qN(t){this.JN(t,!0)&&this.bs()}}class tp extends Km{renderVisibleOnly(t,e){const i=this.dt.x.getInnerStart(),s=this.dt.x.getInnerEnd(),n=Math.min(i,s),r=Math.max(i,s),o=this.dt.y.getInnerStart(),a=this.dt.y.getInnerEnd(),h=Math.min(o,a),l=Math.max(o,a);t.forEach(((t,i)=>{t.existingCoordinatesCount<=1||t.boundaries.max.xr||t.boundaries.max.yl||e(t)}))}}class ep{constructor(t,e,i){this.rG=e,this.nG=i,this.oG=t,this.aG=[]}lG(t,e,i,s){const n=t.length;if(0===n)return;let r=t,o=n,a=this.oG[this.oG.length-1];do{const t=this.oG.length;let n;a||(a=this.uG(e,o)),a&&0==a.allocatedCoordinatesCount-a.existingCoordinatesCount&&(a=void 0);let h=0;if(this.nG&&t>0&&(void 0===a||0===a.existingCoordinatesCount)){const e=this.oG[t-1].lastDataPoint;e?(r.splice(0,0,e),h=1,o+=1):console.error("SegmentationHelper _connectSegments = true, but segment has no lastDataPoint information!")}if(a)n=Math.min(o,a.allocatedCoordinatesCount-a.existingCoordinatesCount),s(a,r.slice(0,n),n,h);else{const t=Math.ceil(e)+h;n=Math.min(t,o);const s={...i(t,r.slice(0,n),n,h),isDropped:!1};this.oG.push(s)}n>0&&(o>n?(r=r.slice(n),o=r.length):(r=[],o=0))}while(o>0);this.cG()}dG(t){const e=t,i=this.oG.indexOf(e);i>=0&&this.oG.splice(i,1),e.droppedTimestamp=St.performance.now(),this.aG.push(e)}fG(){this.oG.slice().forEach((t=>this.dG(t)))}AG(){this.oG.forEach((t=>this.rG(t))),this.aG.forEach((t=>this.rG(t))),this.oG.length=0,this.aG.length=0}uG(t,e){const i=2*t/3,s=4*t/3,n=this.aG.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(n>=0){const t=this.aG[n];return this.aG.splice(n,1),this.oG.push(t),t}}cG(){if(this.aG.length>5){const t=St.performance.now();for(let e=0;e=1e4)&&(this.rG(i),this.aG.splice(e,1),e-=1)}}}}class ip extends Km{gG(t,e){if(!e||"object"!=typeof e)return 0;const i=this.dt.x.getInnerStart(),s=this.dt.x.getInnerEnd(),n=Math.min(i,s),r=Math.max(i,s),o=this.dt.y.getInnerStart(),a=this.dt.y.getInnerEnd(),h=Math.min(o,a),l=Math.max(o,a);if("maxDataPointCount"in e)return this.pG(t,e.maxDataPointCount,n,r,h,l);if("minDataPointCount"in e)return this.mG(t,e.minDataPointCount,n,r,h,l);if("progressiveDataCleaningThreshold"in e)return this.yG(t,e.progressiveDataCleaningThreshold,n,r,h,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}pG(t,e,i,s,n,r){if(void 0===e||e<=0)return 0;const o=t.reduce(((t,e)=>t+e.existingDataPointsCount),0);if(o<=e)return 0;let a=0,h=o;for(let i=0;ie&&(a+=1,h-=s.existingDataPointsCount)}return a}yG(t,e,i,s,n,r){if(void 0===e||!this.UN)return 0;let o=0;for(let a=0;as:h.boundaries.min.y>r:"x"===this.UN?h.boundaries.max.xe:h.boundaries.min.y>e:"x"===this.UN?h.boundaries.max.x2))break;o+=1}return o}mG(t,e,i,s,n,r){if(void 0===e||0===e)return 0;let o=0,a=0;for(let h=t.length-1;h>=0;h-=1){const l=t[h];if(a>e)if(this.UN){if(this.YN?"x"===this.UN?l.boundaries.min.x>s:l.boundaries.min.y>r:"x"===this.UN?l.boundaries.max.xs||l.boundaries.max.yr?o+=1:o=0;a+=l.existingDataPointsCount}return o}SG(t,e){const i=t.reduce(((t,e)=>qe(t,e.boundaries)),Le);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.UN||this.YN?"x"===this.UN&&this.YN?i.max.x=Math.min(i.max.x,t):"y"!==this.UN||this.YN?"y"===this.UN&&this.YN&&(i.max.y=Math.min(i.max.y,t)):i.min.y=Math.max(i.min.y,t):i.min.x=Math.max(i.min.x,t)}return i}}class sp extends lr{constructor(t,e,i,s,n,r,o,a){super(t,e,i,s,n),this.dR=new Im,this.wb=[],this.vG=new tp(this.dt,this),this.xG=new Qm(this.dt,this,(()=>this.us.bs())),this.bG=new ep(this.wb,(t=>{t.coordsBuffer&&this.zL.SV(t.coordsBuffer),t._N&&this.zL.SV(t._N)}),!0),this.MG=new ip(this.dt,this),this._G=0,this.wG=0,this.CG=!1,this.mO=mg({lineStyleSolid:()=>Ji(this.Cu)&&this.Cu,lineStyleDashed:()=>Kr(this.Cu)&&this.Cu,strokeFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},strokeFillLinearGradient:()=>{const t=this.Cu.getFillStyle();return it(t)&&t},strokeFillRadialGradient:()=>{const t=this.Cu.getFillStyle();return Q(t)&&t},strokeFillPaletted:()=>{const t=this.Cu.getFillStyle();return H(t)&&t}}),this.lO=e,this.yO=r,this.SO=o,this.En=a,this.MN={type:"none"},this.zL=t.uO(),this.aO=t,this.xN=this.zL.rz;const h=this.dt._i(),l=!0===(null==a?void 0:a.individualLookupValuesEnabled);let u,c,d,f=0;h||(u=f,f+=2),h&&(c=f,f+=4),l&&(d=f,f+=1);const g=((t,e)=>e?(e,i)=>((t,e)=>{if(!e){const e=t.length,i=new Float32Array(3*e);for(let s=0,n=0;sqt(e,t))(h,l);this.kG={individualLookupValuesEnabled:l,attributesPerVertex:f,attributeOffsetCoordinateLowPrecision:u,attributeOffsetCoordinateHighPrecision:c,attributeOffsetLookUpValue:d,prepareRenderData:(t,e)=>g(t,this.Cu.getFillStyle())}}TG(t,e,i){const s=new Float32Array(2*e);let n=0,r=i||t[0];for(let i=0;i0,o=this.jo._(),a=this.jo.o,h=this.mO.lineStyleSolid(i),l=this.mO.lineStyleDashed(i),u=h||l,c=u&&u.getThickness(),d=this.mO.strokeFillSolid(i),f=this.mO.strokeFillLinearGradient(i),g=this.mO.strokeFillRadialGradient(i),m=this.mO.strokeFillPaletted(i),p=d||f||g||m,y=this.kG.individualLookupValuesEnabled;if(l&&this.dt instanceof zi)return St.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;r&&(this.Lu=se(this.Lu,s,{canReturnB:!0}),this.al+=n);let A=this.Ru.o;const x=this.MG.gG(this.wb,this.Ru._());if(x>0){let t=0;for(let e=0;e{t._N&&(this.zL.SV(t._N),t._N=void 0)})),this.CG=!1),b&&(this.xG.Lg(),this.wb.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=Le,t.lastDataPoint=void 0})),this.bG.fG(),S=this.Lu,this._G=0,this.wG=0);const v=this.xG.iG(S),M=v.length;if(M>0){let t=this.xG.sG(this.Lu)||(this.ha("ApplicationType",(t=>"InternalUI"===t.type))?this.al:1e5);M/t>10&&(t=M/10),this.bG.lG(v,t,((t,e,i,s)=>{const n=this.vG.calculateUserDataPointsBoundaries(e),r=this.xG.eG(n,i,this.Lu)-s;return this.FG=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:r,existingCoordinatesCount:i,jointPointsCount:s,boundaries:n,coordsBuffer:this.zL.zV(t*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i)),lastDataPoint:e[i-1],_N:this.CG?this.zL.zV(2*t,this.TG(e,i,this.FG)):void 0}}),((t,e,i,s)=>{const n=qe(t.boundaries,this.vG.calculateUserDataPointsBoundaries(e)),r=this.xG.eG(n,t.existingCoordinatesCount+i,this.Lu)-(t.jointPointsCount+s);this.zL.OV(t.coordsBuffer,t.existingCoordinatesCount*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i)),this.CG&&t._N&&this.zL.OV(t._N,2*t.existingCoordinatesCount,this.TG(e,i,this.FG)),this.FG=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=r,t.existingCoordinatesCount+=i,t.boundaries=n}))}if(A&&(this.ol=this.MG.SG(this.wb,this.Ru._())),this.dR.yV(this.dt),g?this.RO=xm(this.Jo||this.ol,this.dt,g.getPosition(),g.getExtent(),g.getShape(),this.zL.sR()):f?this.EO=Sm(this.Jo||this.ol,this.dt,f.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),i||a){if(m&&"value"===m.getLookUpProperty()&&!y){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw St.alert(t),new Error(t)}if(p&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=f?["gradient",f]:g?["gradient",g]:m?["lookup",m.getLookUpProperty(),m.lut]:"uniform";this.MN="primitive"===t?{type:t,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}),l&&Wg.StippleTexture),mousePickingShader:o?this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}),l&&Wg.StippleTexture):void 0,lineStyleSolid:h,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:"triangulated"===t?{type:t,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0}),this.xN?Wg.AliasedEdge:void 0,l&&Wg.StippleTextureInstanced),mousePickingShader:o?this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0}),l&&Wg.StippleTextureInstanced):void 0,geometry:Xm(this.zL,c),thickness:c,lineStyleSolid:h,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:{type:"none"}}else this.MN={type:"none"}}return this.wN=l?this.zL.Dz(l.getPattern()):void 0,this.Iu(e),this.fl=!1,this.ll=[],this.jo.o=!1,this.Ru.o=!1,this}yL(t){const e=this.zL.gl,i=this.MN;if(!i||"none"===i.type)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const{lineStyleDashed:n,fillStyleSolid:r,fillStyleLinearGradient:o,fillStyleRadialGradient:a,fillStylePaletted:h}=i;return this.zL.JL(s).lV(s,((s,l,u,c)=>{let d=!1;if(this.zL.fV(s("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(s("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(s("uRenderEffectMask"),2===t?1:0),this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(s("uScale"),this.dR.gV()).cV(s("uDisp"),this.dR.pV()).cV(c("uScaleStart_highpart"),this.dR.Nz()).cV(c("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(c("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(c("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(c("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(c("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(s("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(s("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(s("uColor"),this.SO);else if(r)this.zL.AV(s("uColor"),r.getColor());else if(a){if(!this.RO)return!1;this.zL.yz(u,this.RO,a)}else if(o){if(!this.EO)return!1;this.zL.Sz(u,this.EO,o)}else if(h){const t=pg(h,this,void 0);if(!t&&h.lut.percentageValues)return!1;this.zL.Ez(u,h.lut,t)}return this.vG.renderVisibleOnly(this.wb,(r=>{const{coordsBuffer:o}=r;if(!o)return;e.bindBuffer(e.ARRAY_BUFFER,o);const a="triangulated"===i.type?jm.gN:$m.gN;if(this.dt._i()||void 0===this.kG.attributeOffsetCoordinateLowPrecision?this.dt._i()&&void 0!==this.kG.attributeOffsetCoordinateHighPrecision&&a(!0,this.zL,o,u,this.kG.attributesPerVertex,this.kG.attributeOffsetCoordinateHighPrecision):a(!1,this.zL,o,u,this.kG.attributesPerVertex,this.kG.attributeOffsetCoordinateLowPrecision),n){if(!r._N||!this.wN)return;"triangulated"===i.type?jm.pN(this.zL,u,r._N,l("aLengthSoFarA"),l("aLengthSoFarB"),2,0):$m.pN(this.zL,u,r._N,l("aLengthSoFar"),2,0),this.zL.cV(s("uStippleCount"),[this.us.oi().x/this.wN.Rz,this.us.oi().y/this.wN.Rz]).fV(c("uStippleTextureWidthLimiter"),this.wN.Lz/this.wN.Rz).fV(s("uStippleScale"),n.getPatternScale()).dV(s("uStippleTexture"),this.wN.Bz,1)}if(h&&"value"===h.lookUpProperty&&void 0!==this.kG.attributeOffsetLookUpValue&&1!==t)if("triangulated"===i.type){const t=l("aLookupValueA");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(t,1),e.enableVertexAttribArray(t);const i=l("aLookupValueB");e.vertexAttribPointer(i,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.kG.attributeOffsetLookUpValue+this.kG.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(i,1),e.enableVertexAttribArray(i)}else{const t=l("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}if("triangulated"===i.type){const{thickness:e}=i;jm.yL(this.aO,i.geometry,u,this.xN&&1!==t,1===t,e,r.existingCoordinatesCount-1)}else $m.SN(this.aO,r.existingCoordinatesCount);d=!0})),e.bindBuffer(e.ARRAY_BUFFER,null),d})),this}dO(t){return this.yO===t&&{}}_l(t,e){return Array.isArray(t)||(t=[t]),this.ll=se(this.ll,t,{canReturnB:!0}),this.ol=qe(this.ol,e||e||this.vG.calculateUserDataPointsBoundaries(t)),this}Nt(){return super.Nt(),this._G=0,this.wG=0,this.FG=void 0,this}dispose(){return super.dispose(),this.bG.AG(),this.xG.hG(),this.MN={type:"none"},this.wN=void 0,this}GL(){return this}Cx(t){this.Cl()>0&&this.Ds();const e=this.yl(),i=zn(e,t,this.dl,this.$l,this.Xl,this.dt,this.engine.dt,this.ol,this.vG.UN,this.vG.YN);return void 0!==i?e[i]:void 0}cw(t){this.Cl()>0&&this.Ds();const e=this.yl(),i=e.length;if(0===i)return;const s=this.$l?1:0,n=i-(this.Xl?2:1);if(this.dl===Fn.Nearest){let s,n,r=_e;for(let o=0;o1}Pp(t,e,i,s){return i>1||e?(e?this.zL.jV(t.attribute("aOffsetPixels"),e,1):this.zL.fV(t.uniform("uOffsetPixels"),i),this.zL.uV(this.TL,0,{location:t.attribute("aInstanceGeo"),size:2}).KV(this.AN,0,this.DG,s)):this.zL.fV(t.uniform("uPointSize"),i).Pp(this.zL.gl.POINTS,s),this}IE(){this.zL.SV(this.TL)}}const rp=(t,e=0)=>{const i=[u(-.5,-.5),u(-.5,.5),u(.5,-.5),u(.5,-.5),u(-.5,.5),u(.5,.5)];return new np(t,i,t.gl.TRIANGLES,e)},op=(t,e=0)=>{const i=.05,s=[u(-.5,-.05),u(.5,-.05),u(.5,i),u(.5,i),u(-.5,i),u(-.5,-.05),u(-.05,-.5),u(i,-.5),u(i,.5),u(i,.5),u(-.05,.5),u(-.05,-.5)];return new np(t,s,t.gl.TRIANGLES,e)},ap=(t,i,s)=>{let n=i.CV.ME.get(t);if(t===e.PointShape.Circle){const t=s<=3?4:s<=5?8:s<=10?16:24;return n=i.CV._E.get(t)||((t,e,i=0)=>{const s=function(t=25){return Ru(u(0,0),0,360,.5,.5,t)[0]}(e);return new np(t,s,t.gl.TRIANGLE_FAN,i)})(i,t),i.CV._E.set(t,n),n}if(!n){switch(t){case e.PointShape.Triangle:n=((t,e=0)=>{const i=function(){const t=[],e=2/1.73205080757;return t.push(u(-e/2,.3333333333333333)),t.push(u(0,-.6666666666666666)),t.push(u(e/2,.3333333333333333)),t}();return new np(t,i,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Square:n=rp(i);break;case e.PointShape.Plus:n=op(i);break;case e.PointShape.Cross:n=op(i,45);break;case e.PointShape.Diamond:n=rp(i,45);break;case e.PointShape.Arrow:n=((t,e=0)=>{const i=.05,s=[u(-.05,-.5),u(i,-.5),u(i,.45),u(i,.45),u(-.05,.45),u(-.05,-.5),u(-.5,0),u(-.4,0),u(0,.4),u(0,.4),u(0,.5),u(-.5,0),u(.5,0),u(.4,0),u(0,.4),u(0,.4),u(0,.5),u(.5,0)];return new np(t,s,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Star:n=((t,e=0)=>new np(t,[{x:0,y:0},{x:0,y:.5},{x:.1,y:.1},{x:.5,y:.1},{x:.2,y:-.1},{x:.3,y:-.5},{x:0,y:-.25},{x:-.3,y:-.5},{x:-.2,y:-.1},{x:-.5,y:.1},{x:-.1,y:.1},{x:0,y:.5}],t.gl.TRIANGLE_FAN,e))(i);break;case e.PointShape.Minus:n=((t,e=0)=>{const i=.05,s=[u(-.5,-.05),u(.5,-.05),u(.5,i),u(.5,i),u(-.5,i),u(-.5,-.05)];return new np(t,s,t.gl.TRIANGLES,e)})(i);break;default:return Se(0,"LightningChart JS unidentified point shape")}i.CV.ME.set(t,n)}return n};class hp extends Qn{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.dR=new Im,this.gO=m(c(Fe,Fe),c(_e,_e)),this.mO=mg({pointStyleSolid:()=>G(this.be)&&this.be,pointStyleRadialGradient:()=>Q(this.be)&&this.be,pointStyleLinearGradient:()=>it(this.be)&&this.be,pointStylePaletted:()=>H(this.be)&&this.be,pointStyleIndividual:()=>W(this.be)&&this.be}),this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO()}Ds(){var t;const e=this.jo._(),i=this.jo.o,s=this.ll,n=s.length,r=n>0,o=this.el._(),a=this.be,h=this.size._(),l=this.el.o||this.Fa.o,u=this.dt.Ni(),c=this.size.o||this.el.o,d=this.fl||s&&s.length>0,f=u||c,g=this.ga(),m=this.mO.pointStyleSolid(g),p=this.mO.pointStyleRadialGradient(g),y=this.mO.pointStyleLinearGradient(g),A=this.mO.pointStylePaletted(g),x=this.mO.pointStyleIndividual(g),S=m||p||y||A||x;if(r&&(this.sl=se(this.sl,s,{canReturnB:!0}),this.al+=n),r||this.fl){this.ol=this.cl?qe(this.ol,this.cl):qe(this.ol,je(this.sl));const t=qt(this.sl,this.dt._i());this.EG=this.al,this.VG=this.zL.oV(t,!1,this.VG)}this.dR.yV(this.dt),a!==V?f&&(this.zG&&(this.zG=void 0),h>1||W(a)?h<=1?this.AN=this.zL.gl.POINTS:(this.zG=ap(o,this.zL,h),this.AN=this.zG.AN):this.AN=this.zL.gl.POINTS):this.zG&&(this.zG=void 0);const b=(null===(t=this.zG)||void 0===t?void 0:t.BG)||0,v=this.Fa._()+b;if(c||g||i||l){const t=this.hl._()?"attribute":"uniform",i=h<=1&&Wg.PointSize(t),s=Wg.VertexLocation({offset:h>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:(this.rl._()||v%360!=0)&&{dataType:this.rl._()?"attribute":"uniform"}}:void 0,axisWorldTranslation:gg(this.dt),normalSource:void 0});this.gR=S?this.zL.cE(Wg["2D"],i,s,m?Wg.Color({dataType:"uniform"}):x?Wg.Color({dataType:"attribute"}):A?Wg.Color({dataType:["lookup",A.getLookUpProperty(),A.lut]}):p?Wg.Color({dataType:["gradient",p]}):y?Wg.Color({dataType:["gradient",y]}):void 0):void 0,this.zO=e&&S?this.zL.cE(Wg["2D"],i,s,Wg.MousePicking):void 0}if(d||g){const t=this.sl.length;if(W(a)&&this.EG&&this.EG>0){const e=a.getFallbackColor(),i=new Float32Array(4*t);for(let s=0;s0&&h>1){const e=new Float32Array(t);for(let i=0;i0&&h>1){const e=new Float32Array(2*t),i=di(v),s=Math.sin(i),n=Math.cos(i);for(let i=0;i0){const e=new Float32Array(t);for(let i=0;it&&(t=s.value)}this.Al={min:e,max:t}}return this.pa=a,this.el.o=!1,this.size.o=!1,this.Fa.o=!1,this.jo.o=!1,this.fl=!1,this}yL(t){const e=1===t?this.zO:this.gR,i=this.VG,s=this.EG;return e&&i&&s&&(this.zL.JL(e),this.zL.lV(e,((e,n,r,o)=>{var a;if(this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(o("uScaleStart_highpart"),this.dR.Nz()).cV(o("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(o("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(o("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(o("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(o("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),this.zL.bz(r,i,this.dt._i(),this.zG?1:void 0).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).fV(o("uDevicePixelRatio"),this.zL.sR()),this.zG){const t=n("aInstanceGeo");this.zL.UV(t,this.zG.TL).HV(t,0)}if(1===t)this.zL.AV(e("uColor"),this.SO);else if(G(this.be))this.zL.AV(e("uColor"),this.be.getColor());else if(W(this.be)&&this.OG){const t=n("aColor");this.zL.XV(t,this.OG),this.AN!==this.zL.gl.POINTS&&this.zL.HV(t,1)}else if(H(this.be)){if("value"===this.be.getLookUpProperty()&&this.WG){const t=n("aLookupValue");this.zL.jV(t,this.WG),this.AN!==this.zL.gl.POINTS&&this.zL.HV(t,1)}const t=pg(this.be,this,this.Al);if(!t&&this.be.lut.percentageValues)return!1;this.zL.Ez(r,this.be.lut,t)}else if(Q(this.be)){if(!this.CO)return!1;this.zL.yz(r,this.CO,this.be)}else if(it(this.be)){if(!this.kO)return!1;this.zL.Sz(r,this.kO,this.be)}if(this.NG&&this.AN!==this.zL.gl.POINTS){const t=n("aOffsetPixels");this.zL.jV(t,this.NG),this.AN!==this.zL.gl.POINTS&&this.zL.HV(t,1)}else if(this.AN!==this.zL.gl.POINTS){const t=e("uOffsetPixels");this.zL.fV(t,this.size._())}const h=((null===(a=this.zG)||void 0===a?void 0:a.BG)||0)+this.Fa._();if(this.GG&&this.AN!==this.zL.gl.POINTS){const t=n("aRot");this.zL.UV(t,this.GG),this.AN!==this.zL.gl.POINTS&&this.zL.HV(t,1)}else if(this.AN!==this.zL.gl.POINTS&&h%360!=0){const t=di(h),i=Math.sin(t),s=Math.cos(t);this.zL.cV(e("uRot"),[i,s])}if(this.AN===this.zL.gl.POINTS)this.zL.fV(e("uPointSize"),this.size._());else{const t={x:2/this.us.oi().x,y:2/this.us.oi().y};this.zL.cV(e("uRatioPxClip"),[t.x,t.y])}let l=!1;return this.AN===this.zL.gl.POINTS?(this.zL.Pp(this.AN,s),l=!0):this.zG&&(this.zL.KV(this.AN,0,this.zG.DG,s),l=!0),l}))),this}dO(t){return this.yO===t&&{}}gg(t){this.Cl()>0&&this.Ds();const e=this.yl(),i=zn(e,t,this.dl,!1,!1,this.dt,this.us.dt,this.ol,void 0,void 0);return void 0!==i?e[i]:void 0}ke(t){return super.ke(t)}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return this.size._()}zl(){return this.size._()}GL(){return this.VG&&(this.zL.SV(this.VG),this.VG=void 0),this.zG&&(this.zG=void 0),this.OG&&(this.zL.SV(this.OG),this.OG=void 0),this.GG&&(this.zL.SV(this.GG),this.GG=void 0),this.WG&&(this.zL.SV(this.WG),this.WG=void 0),this}}class lp extends Jn{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.MN={fill:void 0,border:void 0},this.dR=new Im,this.ol=Le,this.UG=!1,this.YG=!1,this.HG=!1,this.$G=!1,this.Nc=[],this.mO=mg({polygonStyleSolid:()=>G(this.be)&&this.be,polygonStyleImage:()=>jr(this.be)&&this.be,polygonStyleRadialGradient:()=>Q(this.be)&&this.be,polygonStyleLinearGradient:()=>it(this.be)&&this.be,polygonStylePaletted:()=>H(this.be)&&this.be,lineStyleSolid:()=>Ji(this.Me)&&this.Me,lineStyleFilled:()=>{const t=this.Me&&this.Me.getFillStyle();return G(t)&&t}}),this.aO=t,this.lO=e,this.PN=r,this.zL=t.uO(),this.xN=this.zL.rz}Lr(){const t=this.PN(),e={vs:t=>this.LN(e,t),cs:t=>this.RN(e,t),Rl:t=>this.XG(e,t),kv:t=>this.jG(e,t),sl:[],S:void 0,Ko:0,ZG:!0,yO:t.id,SO:t.color};return this.Nc.push(e),e}Nt(){var t;return this.Nc.length=0,this.UG=!0,this.ji&&this.bn&&(null===(t=this.us.vn)||void 0===t?void 0:t.entity)===this&&this.bn(this,void 0,this.us.vn.collectionMember),this}jp(){return this.Nc}Wc(t){var e;const i=this.Nc.indexOf(t);i>=0&&(this.Nc.splice(i,1),this.$G=!0,this.ji&&this.bn&&(null===(e=this.us.vn)||void 0===e?void 0:e.entity)===this&&this.us.vn.collectionMember===t&&this.bn(this,void 0,this.us.vn.collectionMember))}LN(t,e){var i;return t.ZG=e,this.$G=!0,this.ji&&this.bn&&(null===(i=this.us.vn)||void 0===i?void 0:i.entity)===this&&this.us.vn.collectionMember===t&&this.bn(this,void 0,this.us.vn.collectionMember),t}RN(t,e){return t.Ko=e,this.HG=!0,t}XG(t,e){return t.sl=e,this.UG=!0,t}jG(t,e){return t.S=e,this.YG=!0,t}Ds(){const t=this.jo._(),e=this.jo.o,i=this.ga(),s=this.HG,n=this.UG,r=this.YG,o=this.$G,h=this.Me,l=this.va(),u=this.Nc.filter((t=>t.ZG&&t.sl.length>0));if(this.dR.yV(this.dt),(n||o)&&(this.ol=qe(...u.map((t=>je(t.sl))))),n||o){const t=qt(u.map((t=>[...t.sl,t.sl[0],{x:Number.NaN,y:Number.NaN}])).flat(),this.dt._i()),e=this.dt._i()?4:2;this.bN=this.zL.oV(t,!1,this.bN);let i=[];u.reduce(((s,n)=>{const r=s,o=(n.sl.length+1)*e,h=new Float32Array(t.buffer,r,o),l=a.default(h,void 0,e),u=s/(Float32Array.BYTES_PER_ELEMENT*e);for(let t=0;tt+e.sl.length+2),0),e=new Float32Array(t);let i=0;u.forEach((t=>{const s=t.sl.length+2;for(let n=i;nt+e.sl.length+2),0),e=new Float32Array(4*t);let i=0;u.forEach((t=>{const s=t.sl.length+2;for(let n=i;nt+e.sl.length+2),0),e=new Float32Array(t);let i=0;u.forEach((t=>{const s=void 0!==t.S?t.S:-34028234663852886e22,n=t.sl.length+2;for(let t=i;tthis.eW(t,e,i,u))),this.HG=!1,this.$G=!1,this.UG=!1,this.YG=!1,this.jo.o=!1,this.Sa(this.be),this.Ma(h),this}yL(t){var e,i;const{fill:s,border:n}=this.MN,r=this.bN,o=this.qG,a=this.tW;if(!r||!o)return this;if(s){const{fillStyleSolid:i,fillStyleLinearGradient:n,fillStyleRadialGradient:h,fillStylePaletted:l,fillStyleImage:u}=s,c=this.QG,d=this.JG,f=1===t?null===(e=s.mousePicking)||void 0===e?void 0:e.shader:s.shader;if(!f||!r||!c||void 0===d)return this;this.zL.JL(f).lV(f,((e,s,f,g)=>{if(this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(g("uScaleStart_highpart"),this.dR.Nz()).cV(g("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(g("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(g("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(g("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(g("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),this.zL.bz(f,r,this.dt._i(),void 0).ZV(c).jV(s("aIsHighlighted"),o).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1===t){if(!a)return!1;this.zL.XV(s("aColor"),a)}else if(i)this.zL.AV(e("uColor"),i.getColor());else if(h){if(!this.CO)return!1;this.zL.yz(f,this.CO,h)}else if(n){if(!this.kO)return!1;this.zL.Sz(f,this.kO,n)}else if(l){const t=pg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;if(this.zL.Ez(f,l.lut,t),"value"===l.getLookUpProperty()){if(!this.iW)return!1;this.zL.jV(s("aLookupValue"),this.iW)}}else if(u){if(!this.sW)return!1;this.zL.AV(g("uColor"),u.getSurroundingColor()).dV(e("uColorTexture"),this.sW.texture.YE()||this.sW.sourceMissingTexture,0).uV(this.sW.texCoordsBuffer,void 0,{location:s("aTextureCoord"),size:2}).EV(u.fitMode)}return this.zL.JV(d,void 0,void 0,this.zL.gl.UNSIGNED_INT),!0}))}if(n){const{geometry:e,fillStyleSolid:s,thickness:h}=n,l=this.KG,u=1===t?null===(i=n.mousePicking)||void 0===i?void 0:i.shader:n.shader;if(!u||!r||!l)return this;this.zL.JL(u).lV(u,((i,n,u,c)=>{if(this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(i("uScale"),this.dR.gV()).cV(i("uDisp"),this.dR.pV()).cV(c("uScaleStart_highpart"),this.dR.Nz()).cV(c("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(c("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(c("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(c("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(c("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(i("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(i("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),this.zL.uV(o,1,{location:n("aIsHighlighted"),size:1}).AV(i("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0),1===t){if(!a)return!1;this.zL.uV(a,1,{location:n("aColor"),size:4})}else s&&this.zL.AV(i("uColor"),s.getColor());return jm.gN(this.dt._i(),this.zL,r,u,this.dt._i()?4:2,0),jm.yL(this.aO,e,u,this.xN&&1!==t,1===t,h,l),!0}))}return this}eW(t,e,i,s){const n=ut({x:this.ol.min.x,y:this.ol.min.y},this.dt,this.us.dt),r=ut({x:this.ol.max.x,y:this.ol.max.y},this.dt,this.us.dt),o={x:Math.abs(n.x-r.x),y:Math.abs(n.y-r.y)},a=Tm(t,e,o.x,o.y,i),h=a[1],l=a[4],u=a[6],c=a[7],d=s.reduce(((t,e)=>t+e.sl.length+2),0),f=new Float32Array(2*d),g=this.ol.max.x-this.ol.min.x,m=this.ol.max.y-this.ol.min.y,p=l-u,y=c-h;let A=0;for(const t of s){for(const e of t.sl){const t=u+p*((e.x-this.ol.min.x)/g),i=h+y*((e.y-this.ol.min.y)/m);f[A]=t,f[A+1]=i,A+=2}const e=u+p*((t.sl[0].x-this.ol.min.x)/g),i=h+y*((t.sl[0].y-this.ol.min.y)/m);f[A]=e,f[A+1]=i,A+=2,f[A]=Number.NaN,f[A+1]=Number.NaN,A+=2}return f}dO(t){const e=this.Nc.find((e=>e.yO===t));return!!e&&{collectionMember:e}}GL(){return this.QG&&(this.zL.SV(this.QG),this.QG=void 0),this.bN&&(this.zL.SV(this.bN),this.bN=void 0),this.qG&&(this.zL.SV(this.qG),this.qG=void 0),this.tW&&(this.zL.SV(this.tW),this.tW=void 0),this.iW&&(this.zL.SV(this.iW),this.iW=void 0),this.MN={fill:void 0,border:void 0},this.sW=this.zL.zz(this.sW),this}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return Me(this.Me)}zl(){return Me(this.Me)}}class up extends tr{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.dR=new Im,this.hW=Le,this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStyleRadialGradient:()=>Q(this.be)&&this.be,fillStyleLinearGradient:()=>it(this.be)&&this.be,fillStyleImage:()=>jr(this.be)&&this.be,strokeStyleSolid:()=>Ji(this.Me)&&this.Me,strokeFillSolid:()=>{const t=this.Me.getFillStyle();return G(t)&&t},strokeFillLinearGradient:()=>{const t=this.Me.getFillStyle();return it(t)&&t},strokeFillRadialGradient:()=>{const t=this.Me.getFillStyle();return Q(t)&&t}}),this.eW=(t,e,i)=>{const s=ut(this.Ya(),this.dt,this.us.dt),n=ri(ut(ni(this.Ya(),this.oi()),this.dt,this.us.dt),s);return Tm(t,e,n.x,n.y,i)},this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO(),this.lO=e}Ds(){super.Ds();const t=this.jo._(),e=this.ga(),i=this.wa.o||this.X.o||this.Fa.o||this.Pa.o,s=this.Me,n=this.va(),r=s.getThickness(),o=this.Fa._();this.dR.yV(this.dt);const a=this.dt.Ni();if(i){const t=this.X._();this.sl=function(t,e,i,s,n){const r=((t,e,i)=>[t,u(t.x+e,t.y),u(t.x+e,t.y+i),u(t.x,t.y+i)])(t,e,i);if(0!==s||s%360!=0){const t=s*Math.PI/180;r[0]=Ze(r[0],n,t),r[1]=Ze(r[1],n,t),r[2]=Ze(r[2],n,t),r[3]=Ze(r[3],n,t)}return r}(this.wa._(),t.x,t.y,o,this.Pa._());const e=qt(this.sl,this.dt._i());this.bO=this.zL.oV(e,!1,this.bO),this._O=this.sl.length,this.hW=je(this.sl)}const h=this.mO.fillStyleSolid(e),l=this.mO.fillStyleRadialGradient(e),c=this.mO.fillStyleLinearGradient(e),d=this.mO.fillStyleImage(e),f=h||l||c||d;e&&(this.TO=f?this.zL.cE(Wg["2D"],h&&Wg.Color({dataType:"uniform"}),c&&Wg.Color({dataType:["gradient",c]}),l&&Wg.Color({dataType:["gradient",l]}),d&&Wg.Color({dataType:["image",d.getFitMode()]}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0),l?this.CO=xm(this.Jo||this.hW,this.dt,l.getPosition(),l.getExtent(),l.getShape(),this.zL.sR()):c?this.kO=Sm(this.Jo||this.hW,this.dt,c.getAngle(!0),this.zL.sR()):(this.CO=void 0,this.kO=void 0),this.sW=this.zL.Vz(this.sW,d,a||i,this.eW);const g=this.mO.strokeStyleSolid(n),m=this.mO.strokeFillSolid(n),p=this.mO.strokeFillLinearGradient(n),y=this.mO.strokeFillRadialGradient(n),A=g,x=m||p||y;if(A&&(i||n||a&&1!==r)){if(1===r||-1===r)[this.FO,this.rW]=[this.sl,void 0];else{const t=this.dt;[this.FO,this.rW]=t instanceof zi?((t,e,i)=>{const s=t[0],n=t[1],r=t[2],o=t[3],a=e/2;return[[i.Ui(s,n,a,-a),i.Ui(n,s,-a,-a),i.Ui(o,r,-a,-a),i.Ui(r,o,a,-a),i.Ui(s,n,-a,a),i.Ui(n,s,a,a),i.Ui(o,r,a,a),i.Ui(r,o,-a,a)],[0,4,5,0,5,1,1,5,7,1,3,7,3,7,6,3,2,6,2,4,0,2,6,4]]})(this.sl,r,t):((t,e,i)=>{const s=t[0],n=t[1],r=t[2],o=t[3],a=u(e.x*i*.5,e.y*i*.5),h=ti(Qe(n,s)),l=ti(Qe(o,s)),c=hi(h),d=hi(l);return[[ni(s,ni(si(c,a.x),si(d,a.y))),ni(n,ni(si(h,a.x),si(d,a.y))),ni(o,ni(si(c,a.x),si(l,a.y))),ni(r,ni(si(h,a.x),si(l,a.y))),ni(s,ni(si(h,a.x),si(l,a.y))),ni(n,ni(si(c,a.x),si(l,a.y))),ni(o,ni(si(h,a.x),si(d,a.y))),ni(r,ni(si(c,a.x),si(d,a.y)))],[0,4,5,0,5,1,1,5,7,1,3,7,3,7,6,3,2,6,2,4,0,2,6,4]]})(this.sl,t.Wi(),r)}this.PO=this.zL.oV(qt(this.FO,this.dt._i()),!1,this.PO),this.rW?(this.dN=this.zL.GV(new Uint16Array(this.rW),this.dN),this.IO=this.rW.length):(this.dN&&this.zL.SV(this.dN),this.dN=void 0,this.IO=this.FO.length)}return n&&(this.VO=A&&x?this.zL.cE(Wg["2D"],Wg.Color({dataType:y?["gradient",y]:p?["gradient",p]:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0),y?this.RO=xm(this.hW,this.dt,y.getPosition(),y.getExtent(),y.getShape(),this.zL.sR()):p?this.EO=Sm(this.hW,this.dt,p.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),this.zO=t&&f?this.zO||this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.OO=t&&this.Me!==nt?this.OO||this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.Sa(this.be),this.Ma(s),this.wa.o=!1,this.Fa.o=!1,this.X.o=!1,this.Pa.o=!1,this}dO(t){return this.yO===t&&{}}yL(t){const e=1===t?this.zO:this.TO,i=this.bO,s=this._O,n=this.mO.fillStyleSolid(!1),r=this.mO.fillStyleRadialGradient(!1),o=this.mO.fillStyleLinearGradient(!1),a=this.mO.fillStyleImage(!1);e&&i&&s&&this.be!==V&&(this.zL.JL(e),this.zL.lV(e,((e,h,l,u)=>{if(this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(u("uScaleStart_highpart"),this.dR.Nz()).cV(u("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(u("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(u("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(u("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(u("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(e("uColor"),this.SO);else if(n)this.zL.AV(e("uColor"),n.getColor());else if(r){if(!this.CO)return!1;this.zL.yz(l,this.CO,r)}else if(o){if(!this.kO)return!1;this.zL.Sz(l,this.kO,o)}else if(a){if(!this.sW)return!1;const t=this.sW&&this.sW.texture.YE();this.zL.AV(u("uColor"),a.getSurroundingColor()).dV(e("uColorTexture"),t||this.sW.sourceMissingTexture,0).uV(this.sW.texCoordsBuffer,void 0,{location:h("aTextureCoord"),size:2}).EV(a.fitMode)}return this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).bz(l,i,this.dt._i(),void 0).Pp(this.zL.gl.TRIANGLE_FAN,s),!0})));const h=1===t?this.OO:this.VO,l=this.mO.strokeStyleSolid(!1),u=this.mO.strokeFillSolid(!1),c=this.mO.strokeFillLinearGradient(!1),d=this.mO.strokeFillRadialGradient(!1),f=this.PO;return h&&f&&l&&(this.zL.JL(h),this.zL.lV(h,((e,i,s,n)=>{if(this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(n("uScaleStart_highpart"),this.dR.Nz()).cV(n("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(n("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(n("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(n("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(n("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(e("uColor"),this.SO);else if(u)this.zL.AV(e("uColor"),u.getColor());else if(d){if(!this.RO)return!1;this.zL.yz(s,this.RO,d)}else if(c){if(!this.EO)return!1;this.zL.Sz(s,this.EO,c)}return this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).bz(s,f,this.dt._i(),void 0),this.dN?this.zL.ZV(this.dN).JV(this.IO):this.zL.Pp(this.zL.gl.LINE_LOOP,this.IO),!0}))),this}GL(){return this.dN&&(this.zL.SV(this.dN),this.dN=void 0),this.bO&&(this.zL.SV(this.bO),this.bO=void 0),this.PO&&(this.zL.SV(this.PO),this.PO=void 0),this.sW=this.zL.zz(this.sW),this.TO=void 0,this.VO=void 0,this.zO=void 0,this.OO=void 0,this}xt(){return Math.max(this.wa._().x,this.wa._().x+this.X._().x)}vt(){return Math.min(this.wa._().x,this.wa._().x+this.X._().x)}Mt(){return Math.max(this.wa._().y,this.wa._().y+this.X._().y)}bt(){return Math.min(this.wa._().y,this.wa._().y+this.X._().y)}Vl(){return Me(this.Me)}zl(){return Me(this.Me)}}class cp extends ir{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.dR=new Im,this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be,fillStyleRadialGradient:()=>Q(this.be)&&this.be,fillStyleLinearGradient:()=>it(this.be)&&this.be,fillStyleImage:()=>jr(this.be)&&this.be,strokeLineStyleSolid:()=>Ji(this.Me)&&this.Me,strokeLineSolidFill:()=>{const t=this.Me.getFillStyle();return G(t)&&t},strokeLinearGradientFill:()=>{const t=this.Me.getFillStyle();return it(t)&&t},strokeRadialGradientFill:()=>{const t=this.Me.getFillStyle();return Q(t)&&t}}),this.eW=(t,e,i)=>{const s=ut({x:this.ol.min.x,y:this.ol.min.y},this.dt,this.us.dt),n=ut({x:this.ol.max.x,y:this.ol.max.y},this.dt,this.us.dt),r={x:Math.abs(s.x-n.x),y:Math.abs(s.y-n.y)},o=Tm(t,e,r.x,r.y,i),a=o[1],h=o[4],l=o[6],u=o[7],c=new Float32Array(2*this.sl.length),d=this.ol.max.x-this.ol.min.x,f=this.ol.max.y-this.ol.min.y,g=h-l,m=u-a;let p=0;for(const t of this.sl){const e=l+g*((t.x-this.ol.min.x)/d),i=a+m*((t.y-this.ol.min.y)/f);c[p]=e,c[p+1]=i,p+=2}return c},this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO(),this.lO=e}gg(t){let e,i=Number.MAX_VALUE;for(const s of this.sl){const n=We(ut(s,this.dt,this.us.dt),t);n=3,n=this.Me,r=this.va(),o=n.getThickness(),h=this.ba(o);this.dR.yV(this.dt),this.iM=this.dt.Wi();const l=this.dt.Ni();if(i&&(this.ol=je(this.sl)),i&&s){const t=qt(this.sl,this.dt._i());this.bO=this.zL.oV(t,!1,this.bO),this.nW=new Uint16Array(a.default(t)),this.oW=this.zL.GV(this.nW,this.oW),this._O=this.nW.length}const u=this.mO.fillStyleSolid(e),c=this.mO.fillStylePaletted(e),d=this.mO.fillStyleRadialGradient(e),f=this.mO.fillStyleLinearGradient(e),g=this.mO.fillStyleImage(e),m=u||c&&"value"!==c.getLookUpProperty()&&c||f||d||g;if(e&&(this.TO=m?this.zL.cE(Wg["2D"],u&&Wg.Color({dataType:"uniform"}),f&&Wg.Color({dataType:["gradient",f]}),d&&Wg.Color({dataType:["gradient",d]}),c&&Wg.Color({dataType:["lookup",c.getLookUpProperty(),c.lut]}),g&&Wg.Color({dataType:["image",g.getFitMode()]}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0),d?this.CO=xm(this.Jo||this.ol,this.dt,d.getPosition(),d.getExtent(),d.getShape(),this.zL.sR()):f?this.kO=Sm(this.Jo||this.ol,this.dt,f.getAngle(!0),this.zL.sR()):(this.CO=void 0,this.kO=void 0),this.sW=this.zL.Vz(this.sW,g,l||i,this.eW),(i||h||l&&1!==o)&&s){const t=1===o||-1===o?this.sl:Pm(this.sl,this.iM,o);this.FO=qt(t,this.dt._i()),this.PO=this.zL.oV(this.FO,!0,this.PO),this.IO=t.length}const p=this.mO.strokeLineStyleSolid(r),y=this.mO.strokeLineSolidFill(r),A=this.mO.strokeLinearGradientFill(r),x=this.mO.strokeRadialGradientFill(r),S=p,b=y||A||x;return r&&(this.VO=S&&b?this.zL.cE(Wg["2D"],Wg.Color({dataType:x?["gradient",x]:A?["gradient",A]:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0),x?this.RO=xm(this.Jo||this.ol,this.dt,x.getPosition(),x.getExtent(),x.getShape(),this.zL.sR()):A?this.EO=Sm(this.Jo||this.ol,this.dt,A.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),this.zO=t&&m?this.zO||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.OO=t&&this.Me!==nt?this.zO||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.Ll=!1,this.Sa(this.be),this.Ma(n),this}yL(t){const e=1===t?this.zO:this.TO,i=this.bO,s=this._O,n=this.mO.fillStyleSolid(!1),r=this.mO.fillStyleRadialGradient(!1),o=this.mO.fillStyleLinearGradient(!1),a=this.mO.fillStylePaletted(!1),h=this.mO.fillStyleImage(!1);e&&i&&s&&this.zL.JL(e).lV(e,((e,s,l,u)=>{if(this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(u("uScaleStart_highpart"),this.dR.Nz()).cV(u("uScaleStart_lowpart"),this.dR.Gz()).bz(l,i,this.dt._i(),void 0).ZV(this.oW).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1===t)this.zL.AV(e("uColor"),this.SO);else if(n)this.zL.AV(e("uColor"),n.getColor());else if(r){if(!this.CO)return!1;this.zL.yz(l,this.CO,r)}else if(o){if(!this.kO)return!1;this.zL.Sz(l,this.kO,o)}else if(a){const t=pg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.zL.Ez(l,a.lut,t)}else if(h){if(!this.sW)return!1;this.zL.AV(u("uColor"),h.getSurroundingColor()).dV(e("uColorTexture"),this.sW.texture.YE()||this.sW.sourceMissingTexture,0).uV(this.sW.texCoordsBuffer,void 0,{location:s("aTextureCoord"),size:2}).EV(h.fitMode)}return this.zL.JV(this._O),!0}));const l=1===t?this.OO:this.VO,u=this.Me,c=this.PO,d=this.IO;return l&&c&&d&&this.zL.JL(l).lV(l,((e,i,s,n)=>{this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).bz(s,c,this.dt._i(),void 0);const r=u.getFillStyle();if(1===t)this.zL.AV(e("uColor"),this.SO);else if(G(r))this.zL.AV(e("uColor"),r.getColor());else if(Q(r)){if(!this.RO)return!1;this.zL.yz(s,this.RO,r)}else if(it(r)){if(!this.EO)return!1;this.zL.Sz(s,this.EO,r)}const o=u.getThickness(),a=-1===o||1===o;return this.zL.Pp(a?this.zL.gl.LINE_LOOP:this.zL.gl.TRIANGLE_STRIP,this.IO),!0})),this}dO(t){return this.yO===t&&{}}GL(){return this.oW&&(this.zL.SV(this.oW),this.oW=void 0),this.bO&&(this.zL.SV(this.bO),this.bO=void 0),this.PO&&(this.zL.SV(this.PO),this.PO=void 0),this.TO=void 0,this.VO=void 0,this.zO=void 0,this.OO=void 0,this.sW=this.zL.zz(this.sW),this}}const dp=(t,e)=>{let i=0;const s=[];for(;i0;r-=o?1:0,r-=i+r{let i=0;const s=[];for(;i0;r-=o?1:0,r-=0;const a=Math.min(r,t-n),h=i-(o?1:0),l={start:h,startUnique:n,sizeData:Math.min(e,t-h),sizeUniqueData:a};s.push(l),i+=a}return s},gp=(t,e,i,s)=>{if(i){const t=new Map;return e.gridTiles.forEach((e=>{t.set(e,{type:i,dataInvalidationRanges:[{tileInvalidationOffset:{primary:0,secondary:0},tileInvalidationLength:e.sizeHeatmapDataVectors}]})})),t}const n=new Map;for(let i=0;i{const e=t.iFirstVector,i=s(t),o={x:e.primary+i.primary-1,y:e.secondary+i.secondary-1},a=[{x:e.primary,y:e.secondary},{x:o.x,y:e.secondary},o,{x:e.primary,y:o.y}];if(!Ve(h,a))return;let l=n.get(t);l||(l={type:r.type,dataInvalidationRanges:[]},n.set(t,l));const u=Be(h,a),c={primary:u.min.x-e.primary,secondary:u.min.y-e.secondary},d={primary:1+u.max.x-u.min.x,secondary:1+u.max.y-u.min.y};let f=!1;const g=[{x:c.primary,y:c.secondary},{x:c.primary+d.primary,y:c.secondary},{x:c.primary+d.primary,y:c.secondary+d.secondary},{x:c.primary,y:c.secondary+d.secondary}];for(let t=0;t{if(1!==t.length||0!==e.startPrimary||0!==e.startSecondary||e.lengthPrimary!==t[0].sizeHeatmapDataVectors.primary||e.lengthSecondary!==t[0].sizeHeatmapDataVectors.secondary)t.forEach((t=>{const s=i(t),n=Math.max(e.startPrimary,t.iFirstVector.primary),r=Math.min(e.startPrimary+e.lengthPrimary-1,t.iFirstVector.primary+t.sizeHeatmapDataVectors.primary-1),o=Math.max(e.startSecondary,t.iFirstVector.secondary),a=Math.min(e.startSecondary+e.lengthSecondary-1,t.iFirstVector.secondary+t.sizeHeatmapDataVectors.secondary-1);for(let i=n;i<=r;i+=1){const n=i-e.startPrimary,r=e.values[n],h=(i-t.iFirstVector.primary)*t.sizeHeatmapDataVectors.secondary;for(let i=o;i<=a;i+=1){const n=i-e.startSecondary,o=i-t.iFirstVector.secondary,a=r[n];s[h+o]=a}}}));else{const s=t[0],n=i(s);for(let t=0;t{var s,n;const r=null===(s=t.gl2)||void 0===s?void 0:s.ctx;if(r)return t.gz(null,r.RED,!1,!0,{x:e,y:i},!1,r.FLOAT,r.R32F);const o=t.gl;return(null===(n=t.gl1)||void 0===n?void 0:n.optional.OES_texture_float)?t.gz(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.gz(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},yp=(t,e,i,s)=>{e.forEach(((e,n)=>{var r,o;const a=i(n),h=s(n),l=t.gl;l.bindTexture(l.TEXTURE_2D,h),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const u=null===(r=t.gl2)||void 0===r?void 0:r.ctx,c=e.dataInvalidationRanges.length,d=e.dataInvalidationRanges.reduce(((t,e)=>t+e.tileInvalidationLength.primary),0)/n.sizeHeatmapDataVectors.primary;1===c&&d<1||d<.5&&c<10?e.dataInvalidationRanges.forEach((e=>{var i;const s=e.tileInvalidationOffset.primary*n.sizeHeatmapDataVectors.secondary,r=s+e.tileInvalidationLength.primary*n.sizeHeatmapDataVectors.secondary;if(u)u.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,n.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,u.RED,u.FLOAT,a.subarray(s,r));else if(null===(i=t.gl1)||void 0===i?void 0:i.optional.OES_texture_float)l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,n.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.LUMINANCE,l.FLOAT,a.subarray(s,r));else{const t=new Uint8Array(a.buffer).subarray(4*s,4*r);l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,n.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.RGBA,l.UNSIGNED_BYTE,t)}})):u?u.texImage2D(l.TEXTURE_2D,0,u.R32F,n.sizeHeatmapDataVectors.secondary,n.sizeHeatmapDataVectors.primary,0,u.RED,u.FLOAT,a):(null===(o=t.gl1)||void 0===o?void 0:o.optional.OES_texture_float)?l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,n.sizeHeatmapDataVectors.secondary,n.sizeHeatmapDataVectors.primary,0,l.LUMINANCE,l.FLOAT,a):l.texImage2D(l.TEXTURE_2D,0,l.RGBA,n.sizeHeatmapDataVectors.secondary,n.sizeHeatmapDataVectors.primary,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array(a.buffer)),l.bindTexture(l.TEXTURE_2D,null)}))};class Ap extends qn{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.aW=y("bilinear"),this.Pi={x:0,y:0},this.yw={x:1,y:1},this.Ky=Tn.lineStyle,this.engine=t;const o="columns"===r.dataOrder?r.columns:r.rows,a="columns"===r.dataOrder?r.rows:r.columns;this.En={...r,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:a}}rS(t){return this.aW.M(t),this}nS(){return this.aW._()}sS(t,e){return this.Pi=t,this.yw=e,this}eS(){return{start:this.Pi,step:this.yw,end:{x:this.Pi.x+this.yw.x*this.En.columns,y:this.Pi.y+this.yw.y*this.En.rows}}}qy(t){return this.Ky="function"==typeof t?t(this.Ky):t,this}hS(){return this.Ky}}class xp extends Ap{constructor(t,e,i,s,n,r,o,a){super(t,e,i,s,n,r),this.dR=new Im,this.MN={},this.lW=[],this.uW=!1,this.fl=!1,this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be,wireframeStyleLine:()=>Ji(this.Ky)&&this.Ky,wireframeStyleFill:()=>{const t=this.Ky&&this.Ky.getFillStyle();return G(t)&&t}}),this.cW=dp,this.aO=t,this.lO=e,this.yO=o,this.SO=a,this.zL=t.uO(),this.lO=e;const h=Math.min(this.zL.NL,void 0!==r.dW?r.dW:2048),l={x:Math.min(h,this.En.primaryDimensionVectorsCount),y:Math.min(h,this.En.secondaryDimensionVectorsCount)},u=((t,e,i,s)=>{const n=[],r=i(t.primaryDimensionVectorsCount,e.x),o=i(t.secondaryDimensionVectorsCount,e.y);let a;return r.forEach((t=>o.forEach((e=>{const i={iFirstVector:{primary:t.start,secondary:e.start},iFirstUniqueVector:{primary:t.startUnique,secondary:e.startUnique},sizeHeatmapDataVectors:{primary:t.sizeData,secondary:e.sizeData},sizeUniqueHeatmapDataVectors:{primary:t.sizeUniqueData,secondary:e.sizeUniqueData}};n.push(i)})))),a=[],n.forEach((t=>{let e=a.find((e=>e.sizeHeatmapData.primary===t.sizeHeatmapDataVectors.primary&&e.sizeHeatmapData.secondary===t.sizeHeatmapDataVectors.secondary));e||(e={sizeHeatmapData:t.sizeHeatmapDataVectors,tiles:[]},a.push(e)),e.tiles.push(t)})),{gridTiles:n,gridTileSizes:a}})(this.En,l,this.cW),c=u.gridTiles.map((t=>{const e=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary);return{...t,intensityData:e,hasIntensityData:!1}})),d=u.gridTileSizes.map((t=>({...t,tiles:c.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary))})));this.fW={gridTiles:c,gridTileSizes:d},this.sS(this.Pi,this.yw)}Ds(){const t=this.lW,e=this.be,i=this.ga(),s=this.Ky,n=s!==this.AW,r=this.mO.fillStylePaletted(i),o=this.mO.fillStyleSolid(i),a=this.aW.o,h=this.aW._(),l=this.fl,u=this.jo._();this.gW=this.gW||this.pW();const c=this.gW,d=gp(t,c,l?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));d.size>0&&(yp(this.zL,d,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.uW=!0),this.dR.yV(this.dt);const f=this.MN;if((i||a)&&(f.tile=r?{renderMode:"paletted",fillStylePaletted:r,shader:this.zL.cE(Wg["2D"],Wg.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===h&&"bilinear",flipXY:"rows"===this.En.dataOrder,intensityTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN,lut:r.lut}),Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),flipXY:"rows"===this.En.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),flipXY:"rows"===this.En.dataOrder,normalSource:void 0}))}:void 0),n){const t=this.mO.wireframeStyleLine(n),e=this.mO.wireframeStyleFill(n);f.wireframe=t&&e?-1===t.getThickness()?{renderMode:"primitive",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.En.dataOrder,axisWorldTranslation:gg(this.dt),normalSource:void 0})),fillStyleSolid:e}:{renderMode:"triangulated",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.En.dataOrder,axisWorldTranslation:gg(this.dt),normalSource:void 0})),geometry:Xm(this.zL,1),solidLine:t,fillStyleSolid:e}:void 0,f.wireframe?this.mW=this.mW||this.yW():this.mW&&(this.zL.SV(this.mW.wireframeCoordinatesBuffer),this.mW=void 0)}if(f.mousePicking=u?this.MN.mousePicking||{shader:this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),flipXY:"rows"===this.En.dataOrder,normalSource:void 0}))}:void 0,this.MN=f,void 0===this.Al&&r&&"value"===r.lookUpProperty&&r.lut.percentageValues){let t=_e,e=Fe;this.gW.gridTiles.forEach((i=>{for(let s=0;se&&(e=n)}})),this.Al={min:t,max:e}}return this.fl=!1,this.lW.length=0,this.Sa(e),this.AW=s,this.aW.o=!1,this}pW(){const t=this.fW.gridTiles.map((t=>{const e=pp(this.zL,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e,tileData:t}})),e=this.fW.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.zL.oV([0,0,1,0,0,1,1,1]),s=this.zL.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}yW(){const t=this.En.primaryDimensionVectorsCount+1+this.En.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{const e="columns"===this.En.dataOrder?{x:this.Pi.x+this.yw.x*t.iFirstVector.primary,y:this.Pi.y+this.yw.y*t.iFirstVector.secondary}:{x:this.Pi.x+this.yw.x*t.iFirstVector.secondary,y:this.Pi.y+this.yw.y*t.iFirstVector.primary},i="columns"===this.En.dataOrder?{x:this.yw.x*t.sizeHeatmapDataVectors.primary,y:this.yw.y*t.sizeHeatmapDataVectors.secondary}:{x:this.yw.x*t.sizeHeatmapDataVectors.secondary,y:this.yw.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.En.dataOrder?{x:this.Pi.x+this.yw.x*t.iFirstUniqueVector.primary,y:this.Pi.y+this.yw.y*t.iFirstUniqueVector.secondary}:{x:this.Pi.x+this.yw.x*t.iFirstUniqueVector.secondary,y:this.Pi.y+this.yw.y*t.iFirstUniqueVector.primary},r="columns"===this.En.dataOrder?{x:this.yw.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.yw.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.yw.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.yw.y*t.sizeUniqueHeatmapDataVectors.primary};n.set(t,{startLocationAxis:e,sizeAxis:i,startRenderLocationAxis:s,renderSizeAxis:r})})),this.SW={boundaries:s,tilesInfo:n},this}yL(t){var e,i;const s=this.gW,n=this.SW,r=1===t?null===(e=this.MN.mousePicking)||void 0===e?void 0:e.shader:null===(i=this.MN.tile)||void 0===i?void 0:i.shader;if(this.MN.tile&&r&&s&&n){const e=r,i=this.MN.tile,o={x:(n.boundaries.max.x-n.boundaries.min.x)*Math.sign(this.yw.x),y:(n.boundaries.max.y-n.boundaries.min.y)*Math.sign(this.yw.y)},a={x:o.x/this.En.columns,y:o.y/this.En.rows},h=this.dt.Wi(),l={x:a.x/h.x,y:a.y/h.y};if("solid"===i.renderMode||1===t)this.zL.JL(e).lV(e,((e,n,r)=>{if(1===t)this.zL.AV(e("uColor"),this.SO);else if("solid"===i.renderMode){const{fillStyleSolid:t}=i;this.zL.AV(e("uColor"),t.getColor())}return this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).uV(s.rectangleLocationsBuffer,void 0,{location:n("aPos"),size:2}).cV(e("uScaling"),[this.yw.x*this.En.columns,this.yw.y*this.En.rows]).cV(e("uTranslationAxis"),[this.Pi.x,this.Pi.y]).Pp(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),!0}));else if("paletted"===i.renderMode){const{fillStylePaletted:r}=i,o=this.Al;this.zL.lV(e,((i,a,h)=>{let u=!1;var c,d;return this.zL.JL(e).cV(i("uScale"),this.dR.gV()).cV(i("uDisp"),this.dR.pV()).Ez(h,r.lut,o).uV(s.rectangleLocationsBuffer,void 0,{location:a("aPos"),size:2}).fV(i("uIsHighlighted"),this.Ko).AV(i("uHighlightColorOffset"),2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0),c=t=>{this.zL.cV(i("uTileDimensions"),["columns"===this.En.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.En.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},d=(t,e)=>{const r=n.tilesInfo.get(t.tileData);if(!r)return;let o;const a=this.zL.sR();if("bilinear"===this.aW._()){const t=(this.dt.x.ct(r.startLocationAxis.x)+l.x/2)*a,e=(this.dt.y.ct(r.startLocationAxis.y)+l.y/2)*a;o=[t,e,(this.dt.x.ct(r.startLocationAxis.x+r.sizeAxis.x)-l.x/2)*a-t,(this.dt.y.ct(r.startLocationAxis.y+r.sizeAxis.y)-l.y/2)*a-e]}else{const t=this.dt.x.ct(r.startLocationAxis.x)*a,e=this.dt.y.ct(r.startLocationAxis.y)*a;o=[t,e,this.dt.x.ct(r.startLocationAxis.x+r.sizeAxis.x)*a-t,this.dt.y.ct(r.startLocationAxis.y+r.sizeAxis.y)*a-e]}this.zL.PV(i("uTileBounds"),o).cV(i("uScaling"),[r.renderSizeAxis.x,r.renderSizeAxis.y]).cV(i("uTranslationAxis"),[r.startRenderLocationAxis.x,r.startRenderLocationAxis.y]).dV(i("uTileIntensityValues"),t.intensityDataTexture,1).Pp(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),u=!0},s.gridTileSizes.forEach((t=>{c(t),t.tiles.forEach((t=>{d(t)}))})),u}))}}const o=this.mW,a=this.MN.wireframe,h=1===t||null==a?void 0:a.shader;if(o&&a&&h&&"primitive"===a.renderMode){const{fillStyleSolid:e}=a;this.zL.JL(h).lV(h,((i,s,n)=>((this.dt instanceof Li||this.dt instanceof mu)&&this.zL.cV(i("uScale"),this.dR.gV()).cV(i("uDisp"),this.dR.pV()),this.zL.fV(i("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(i("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0).AV(i("uColor"),e.getColor()).uV(o.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).cV(i("uScaling"),[this.yw.x,this.yw.y]).cV(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).Pp(this.zL.gl.LINES,2*o.wireframeSegmentsLength),!0)))}else if(o&&a&&h&&"triangulated"===a.renderMode){const{geometry:e,solidLine:i,fillStyleSolid:s}=a;this.zL.JL(h).lV(h,((n,r,a)=>((this.dt instanceof Li||this.dt instanceof mu)&&this.zL.cV(n("uScale"),this.dR.gV()).cV(n("uDisp"),this.dR.pV()),this.zL.fV(n("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(n("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(n("uRenderEffectMask"),2===t?1:0).AV(n("uColor"),s.getColor()).fV(n("uThicknessPixels"),i.getThickness()).cV(n("uRatioPxClip"),[2/this.us.oi().x,2/this.us.oi().y]).uV(o.wireframeCoordinatesBuffer,1,{location:r("aLocationA"),size:2},{location:r("aLocationB"),size:2}).cV(n("uScaling"),[this.yw.x,this.yw.y]).cV(n("uTranslationAxis"),[this.Pi.x,this.Pi.y]),e.JL(a,!1).Pp(o.wireframeSegmentsLength),!0)))}return this}oS(t){return this.lW.push(t),mp(this.fW.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this.Al=void 0,this}Nt(){return this.uW&&(this.fW.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.fl=!0,this.uW=!1,this.Al=void 0),this}dispose(){super.dispose();const t=this.gW;t&&(t.gridTiles.forEach((t=>{this.zL.WL(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.zL.SV(t.rectangleLocationsBuffer)),this.gW=void 0;const e=this.mW;return e&&this.zL.SV(e.wireframeCoordinatesBuffer),this.mW=void 0,this.MN={},this}GL(){return this.dispose(),this}dO(t){return this.yO===t&&{}}gg(t){const e=t,i="columns"===this.En.dataOrder?e.x:e.y,s="columns"===this.En.dataOrder?e.y:e.x,n="columns"===this.En.dataOrder?this.Pi.x:this.Pi.y,r="columns"===this.En.dataOrder?this.Pi.y:this.Pi.x;let o=(i-n)/("columns"===this.En.dataOrder?this.yw.x:this.yw.y),a=(s-r)/("columns"===this.En.dataOrder?this.yw.y:this.yw.x);o=Math.floor(kt(o,0,this.En.primaryDimensionVectorsCount-1)),a=Math.floor(kt(a,0,this.En.secondaryDimensionVectorsCount-1));const h=this.vW(o,a),l="columns"===this.En.dataOrder?{x:this.Pi.x+(o+.5)*this.yw.x,y:this.Pi.y+(a+.5)*this.yw.y}:{x:this.Pi.x+(a+.5)*this.yw.x,y:this.Pi.y+(o+.5)*this.yw.y},u="columns"===this.En.dataOrder?o:a,c="columns"===this.En.dataOrder?a:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:h}}vx(t){const e=this.SW;if(!e||t.xe.boundaries.max.x||t.ye.boundaries.max.y)return;const i=t,s="columns"===this.En.dataOrder?i.x:i.y,n="columns"===this.En.dataOrder?i.y:i.x,r="columns"===this.En.dataOrder?this.Pi.x:this.Pi.y,o="columns"===this.En.dataOrder?this.Pi.y:this.Pi.x,a="columns"===this.En.dataOrder?this.yw.x:this.yw.y,h="columns"===this.En.dataOrder?this.yw.y:this.yw.x,l=kt((s-r)/a-.5,0,this.En.primaryDimensionVectorsCount-1),u=kt((n-o)/h-.5,0,this.En.secondaryDimensionVectorsCount-1),c=kt(Math.ceil(l)-1,0,this.En.primaryDimensionVectorsCount-1),d=kt(Math.ceil(u)-1,0,this.En.secondaryDimensionVectorsCount-1),f={point:{x:c,y:d},value:this.vW(c,d)},g={point:{x:c,y:d+1},value:this.vW(c,d+1)},m={point:{x:c+1,y:d},value:this.vW(c+1,d)},p={point:{x:c+1,y:d+1},value:this.vW(c+1,d+1)},y=Lr({x:l,y:u},f,g,m,p);if(void 0===y)return;const A=kt(Math.floor(l+.5),0,this.En.primaryDimensionVectorsCount-1),x=kt(Math.floor(u+.5),0,this.En.secondaryDimensionVectorsCount-1),S="columns"===this.En.dataOrder?A:x,b="columns"===this.En.dataOrder?x:A,v=t;return{x:v.x,y:v.y,column:S,row:b,cellValue:y}}vW(t,e){for(let i=0;i=s.iFirstVector.primary&&t<=s.iFirstVector.primary+s.sizeHeatmapDataVectors.primary-1&&e>=s.iFirstVector.secondary&&e<=s.iFirstVector.secondary+s.sizeHeatmapDataVectors.secondary-1){const i=t-s.iFirstVector.primary,n=e-s.iFirstVector.secondary,r=i*s.sizeHeatmapDataVectors.secondary+n;return s.intensityData[r]}}return 0}xt(){var t;return(null===(t=this.SW)||void 0===t?void 0:t.boundaries.max.x)||0}vt(){var t;return(null===(t=this.SW)||void 0===t?void 0:t.boundaries.min.x)||0}Mt(){var t;return(null===(t=this.SW)||void 0===t?void 0:t.boundaries.max.y)||0}bt(){var t;return(null===(t=this.SW)||void 0===t?void 0:t.boundaries.min.y)||0}Vl(){return 0}zl(){return 0}hk(){const t=[];return this.fW.gridTiles.forEach((e=>{if(!e.hasIntensityData)return;const i=new Array(e.sizeUniqueHeatmapDataVectors.primary).fill(0).map((t=>new Array(e.sizeUniqueHeatmapDataVectors.secondary).fill(0)));for(let t=0;t0?"ProgressiveX":"RegressiveX":this.yw.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}),this.MG=new ip(this.dt,this));const t=this.MG.gG(this.wb,this.Ru._());if(t>0){for(let e=0;e0?this.wb[0].boundaries.min.x:_e:this.ol.min.y=this.wb.length>0?this.wb[0].boundaries.min.y:_e}this.wb.forEach((t=>t.shape.Ds()));const e=this.wb.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Dt(null===(i=e.shape.Al)||void 0===i?void 0:i.min,_e)),t.max=Math.max(t.max,Dt(null===(s=e.shape.Al)||void 0===s?void 0:s.max,Fe)),t}),{min:_e,max:Fe});return this.wb.forEach((t=>{t.shape.Al=e})),this.Ru.o=!1,this}yL(t){return this.wb.forEach((e=>e.shape.yL(t))),this}dS(t){if(0===t.length)return this;let e=0;const i=this.bW.dataPerSegment,s=t.length;do{let n=this.wb[this.wb.length-1],r=n?i-(n.existingDataPointsCount+(n.hasJoint?1:0)):0,o=!1;if(!n||0===r){const t={columns:"columns"===this.En.scrollDimension?i:this.En.resolution,rows:"rows"===this.En.scrollDimension?i:this.En.resolution,heatmapDataType:this.En.heatmapDataType,dataOrder:this.En.scrollDimension};let e="columns"===this.En.scrollDimension?{x:this.Pi.x+this.yw.x*this.xW,y:this.Pi.y}:{x:this.Pi.x,y:this.Pi.y+this.yw.y*this.xW};this.wb.length>0&&(e="columns"===this.En.scrollDimension?{x:e.x-1*this.yw.x,y:e.y}:{x:e.x,y:e.y-1*this.yw.y},o=!0);const s=new xp(this.aO,this.lO,this.dt,wt,[],t,this.yO,this.SO).rS(this.aW._()).ke(this.be).qy(this.Ky).sS(e,this.yw);n={shape:s,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.xW,hasJoint:!1,boundaries:{min:{x:s.vt(),y:s.bt()},max:{x:s.xt(),y:s.Mt()}}},this.wb.push(n),r=i-(o?1:0)}const a=s-e,h=Math.min(r,a),l=t.slice(e,e+h),u={type:"intensity",values:l,startPrimary:n.existingDataPointsCount+(n.hasJoint?1:0),startSecondary:0,lengthPrimary:h,lengthSecondary:this.En.resolution};o&&(u.values.unshift(this.MW),u.lengthPrimary+=1,n.hasJoint=!0),n.shape.oS(u),n.existingDataPointsCount+=h,n.existingCoordinatesCount+=h+(o?1:0),this.MW=l[l.length-1],this.xW+=h,e+=h}while(e{const r=t.dataStartIndex,o=t.dataStartIndex+t.existingDataPointsCount-1;if(so)return;const a=i-r,h=Math.min(s,o),l=h-a+1,u=e.slice(a-i,h-i+1),c={type:"intensity",startSecondary:0,lengthSecondary:n,startPrimary:a,lengthPrimary:l,values:u};t.shape.oS(c)}));const r=this.xW-1;if(s>r){const t=s-r,i=e.slice(-t);if(i.length{t.shape.dispose().GL()})),this.wb.length=0,this.ol="columns"===this.En.scrollDimension?m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.En.resolution*this.yw.y}):m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.En.resolution*this.yw.x,y:this.Pi.y}),this.xW=0,this.MW=void 0,this}sS(t,e){return super.sS(t,e),this.wb.forEach(((i,s)=>{const n={x:t.x+i.dataStartIndex*e.x,y:t.y+i.dataStartIndex*e.y};i.shape.sS(n,e),i.boundaries={min:{x:i.shape.vt(),y:i.shape.bt()},max:{x:i.shape.xt(),y:i.shape.Mt()}}})),this.wb.length>0?this.ol=qe(...this.wb.map((t=>t.boundaries))):this.ol="columns"===this.En.scrollDimension?m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.En.resolution*this.yw.y}):m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.En.resolution*this.yw.x,y:this.Pi.y}),this}ke(t){return super.ke(t),this.wb.forEach((t=>t.shape.ke(this.be))),this}qy(t){return super.qy(t),this.wb.forEach((t=>t.shape.qy(this.Ky))),this}rS(t){return super.rS(t),this.wb.forEach((e=>e.shape.rS(t))),this}dispose(){return super.dispose(),this.wb.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.wb.forEach((e=>e.shape.setVisible(t))),this}GL(){return this.wb.forEach((t=>t.shape.GL())),this}dO(t){return this.yO===t&&{}}gg(t){const e=ut(t,this.dt,this.engine.dt),i=this.wb.reduce(((i,s)=>{const n=s.shape.gg(t);if(n){const t=Ye(ut(n,this.dt,this.engine.dt),e);if(void 0===i||t=this.xW||"rows"===this.En.scrollDimension&&e>=this.xW)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}vx(t){const e=ut(t,this.dt,this.engine.dt),i=this.wb.reduce(((i,s)=>{const n=s.shape.vx(t);if(n){const t=Ye(ut(n,this.dt,this.engine.dt),e);if(void 0===i||t=this.xW||"rows"===this.En.scrollDimension&&e>=this.xW)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return 0}zl(){return 0}cs(t){return super.cs(t),this.wb.forEach((e=>e.shape.cs(t))),this}}class vp extends qn{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.aW=y("bilinear"),this.Ky=Tn.lineStyle,this.En=r}rS(t){return this.aW.M(t),this}nS(){return this.aW._()}qy(t){return this.Ky="function"==typeof t?t(this.Ky):t,this}hS(){return this.Ky}}class Mp extends vp{constructor(t,e,i,s,n,r,o,a){super(t,e,i,s,n,r),this.dR=new Im,this.MN={},this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be}),this.aO=t,this.lO=e,this.yO=o,this.SO=a,this.zL=t.uO(),this.lO=e,this.sk=new xp(this.aO,t._W,t.dt,wt,[],{columns:r.sectors,rows:r.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===r.dataOrder?"rows":"columns",dW:this.zL.NL},-1,C).qy(nt);const h=2*Math.PI/360,l=new Float32Array(724);let u=0;l[u+0]=0,l[u+1]=0,u+=2;for(let t=0;t<=360;t+=1){const e=t*h,i=Math.cos(e),s=Math.sin(e);l[u+0]=i,l[u+1]=s,u+=2}this.wW={vertexBuffer:this.zL.oV(l),drawMode:this.zL.gl.TRIANGLE_FAN,drawLength:362}}Ds(){const t=this.ga(),e=this.be,i=this.mO.fillStyleSolid(t),s=this.mO.fillStylePaletted(t),n=i||s,r=this.aW._(),o=this.aW.o,a=this.jo._(),h=this.jo.o;return this.dR.yV(this.dt),this.sk.Ds(),this.sk.gW?((t||o)&&(this.MN.fill=n?{shader:this.zL.cE(Wg["2D"],Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),normalSource:void 0}),s&&Wg.PolarHeatmap({interpolation:"bilinear"===r&&"bilinear",intensityTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this.En.dataOrder,lut:s.lut}),i&&Wg.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:s,fillStyleSolid:i}:void 0),h&&(this.MN.mousePicking=a?{shader:this.zL.cE(Wg["2D"],Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),normalSource:void 0}),Wg.Color({dataType:"uniform"}))}:void 0),this.Sa(e),this.aW.o=!1,this.jo.o=!1,this):this}yL(t){var e;const{vertexBuffer:i,drawLength:s,drawMode:n}=this.wW,r=this.sk.gW;if(!this.MN.fill||!r)return this;const{fillStylePaletted:o,fillStyleSolid:a}=this.MN.fill,h=1===t?null===(e=this.MN.mousePicking)||void 0===e?void 0:e.shader:this.MN.fill.shader;if(!h)return this;const l=this.dt.Xv(),u=Math.min(l.start,l.end),c=Math.max(l.start,l.end),d=Math.min(this.En.amplitudeStart,this.En.amplitudeStart+(this.En.annuli-1)*this.En.amplitudeStep),f=Math.max(this.En.amplitudeStart,this.En.amplitudeStart+(this.En.annuli-1)*this.En.amplitudeStep);let g;return g=l.end>l.start?Math.min(f,c)-l.start:Math.max(d,u)-l.start,this.zL.JL(h).lV(h,((e,h,l,u)=>{if(this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).cV(u("uViewportSize"),[this.aO.oi().x*this.zL.sR(),this.aO.oi().y*this.zL.sR()]).cV(e("uScaling"),[g,g]).cV(e("uTranslationAxis"),[0,0]).uV(i,void 0,{location:h("aPos"),size:2}).fV(u("uAngleOffset"),this.dt.Kv()%(2*Math.PI)).fV(u("uAngleDirection"),this.dt.hx()?1:-1).fV(u("uSectors"),this.En.sectors).fV(u("uAnnuli"),this.En.annuli),1===t)this.zL.AV(e("uColor"),this.SO);else{if(this.zL.fV(e("uAmplitudeStart"),this.En.amplitudeStart).fV(e("uAmplitudeStep"),this.En.amplitudeStep).fV(e("uAmplitudeAxisStart"),this.dt.Xv().start).fV(e("uAmplitudeAxisEnd"),this.dt.Xv().end),o){const t=this.sk.Al;this.zL.Ez(l,o.lut,t).dV(e("uTileIntensityValues"),r.gridTiles[0].intensityDataTexture,0)}a&&this.zL.AV(e("uColor"),a.getColor())}return this.zL.Pp(n,s),!0})),this}oS(t){return this.sk.oS(t),this}Nt(){return this.sk.Nt(),this}dispose(){return super.dispose(),this.sk.dispose(),this.MN={},this.zL.SV(this.wW.vertexBuffer),this}GL(){return this.dispose(),this}ke(t){return super.ke(t),this.sk.ke(this.be),this}dO(t){return this.yO===t&&{}}gg(t){const e=this.En.amplitudeStart,i=this.En.amplitudeStart+(this.En.annuli-1)*this.En.amplitudeStep,s=Math.min(e,i),n=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituden)return;let r=Math.round((t.angle-0)/360*this.En.sectors);r>=this.En.sectors&&(r=0);const o=Math.round((t.amplitude-e)/(i-e)*(this.En.annuli-1));return{iAnnulus:o,iSector:r,cellValue:this.vW(o,r),angle:r*(360/this.En.sectors),amplitude:e+o*(i-e)/(this.En.annuli-1)}}vx(t){const e=this.En.amplitudeStart,i=this.En.amplitudeStart+(this.En.annuli-1)*this.En.amplitudeStep,s=Math.min(e,i),n=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituden)return;const r=(t.angle-0)/360*this.En.sectors,o=(t.amplitude-e)/(i-e)*(this.En.annuli-1),a=Math.floor(r),h=Math.floor(o),l={point:{x:h,y:a},value:this.vW(h,a)},u={point:{x:h,y:a+1},value:this.vW(h,a+1)},c={point:{x:h+1,y:a},value:this.vW(h+1,a)},d={point:{x:h+1,y:a+1},value:this.vW(h+1,a+1)},f=Lr({x:o,y:r},l,u,c,d);return void 0!==f?{iAnnulus:h,iSector:a,cellValue:f,angle:t.angle,amplitude:t.amplitude}:void 0}vW(t,e){const i="annuli"===this.En.dataOrder?t:e,s="annuli"===this.En.dataOrder?e:t;for(let t=0;t=e.iFirstVector.primary&&i<=e.iFirstVector.primary+e.sizeHeatmapDataVectors.primary-1&&s>=e.iFirstVector.secondary&&s<=e.iFirstVector.secondary+e.sizeHeatmapDataVectors.secondary-1){const t=i-e.iFirstVector.primary,n=s-e.iFirstVector.secondary,r=t*e.sizeHeatmapDataVectors.secondary+n;return e.intensityData[r]}}return 0}xt(){return 0}vt(){return 0}Mt(){return 0}bt(){return 0}Vl(){return 0}zl(){return 0}}class Tp extends bm{constructor(t){super(t);const{vertices:e,drawMode:i,drawSize:s}=this.uN();this.cN=t.oV(e),this.fN=s,this.AN=i}JL(t){return this.zL.uV(this.cN,0,{location:t.attribute("aCurveOrBaseline"),size:1},{location:t.attribute("aSegmentSide"),size:1}),this}Pp(t,e,i){return this.zL.KV(void 0!==e?e:this.AN,i||0,this.fN,t),this}uN(){return{vertices:new Float32Array([1,0,0,0,0,1,0,1,1,1,1,0]),drawMode:this.zL.gl.TRIANGLES,drawSize:6}}IE(){this.zL.SV(this.cN)}}const wp=t=>{let e=t.CV.CE.get(void 0);return e||(e=new Tp(t),t.CV.CE.set(void 0,e),e)};class Ep extends or{constructor(t,i,s,n){super(t,i,s,n,[{type:"DataPattern",args:{pattern:"ProgressiveX"}}]),this.kW=Tn.fillStyle,this.TW=Tn.fillStyle,this.FW=y(e.PointShape.Circle),this.IW=y(5),this.PW=y(0),this.DW=y(void 0),this.iF=!0}KT(t){return this.kW=Xn(this.kW,t),this}rF(){return this.kW}BW(){return jn(this.LW,this.kW)}RW(){return jn(this.EW,this.TW)}qT(t){return this.TW=Xn(this.TW,t),this}nF(){return this.TW}aF(t){return this.FW.M(t),this}lF(){return this.FW._()}QT(t){return this.IW.M(t),this}oF(){return this.IW._()}uF(t){return this.PW.M(t),this}cF(){return this.PW._()}JT(t){return this.DW.M(t),this}dF(){return this.DW._()}}class kp extends Km{constructor(t,e){super(t,e),this.XN=!1,this.jN={enabled:!1,totalDataPointsAtTime:0},this.QN=t instanceof Li?{type:"linear",scale:t}:{type:"unknown"},this.$N.ha("DataPattern",(t=>{!1===t.allowDataGrouping&&(this.XN=!0)}))}VW(t,e){var i,s;const n=null==t?void 0:t.FT,r=null==t?void 0:t.IT,o=null==t?void 0:t.fT,a=null==t?void 0:t.dT;if(!t||this.XN||!this.UN||"linear"!==this.QN.type||!n||!r||void 0===o||void 0===a||!e)return{cpStateChanged:!1,cpActive:!1};const h=null===(i=t.TT())||void 0===i?void 0:i.x,l=null===(s=t.XT())||void 0===s?void 0:s.x;if(o<2||void 0===h||void 0===l)return{cpStateChanged:!1,cpActive:!1};const u=this.calculateAvgStepBetweenDataPoints(l,h,o),c=this.QN.scale,d=Math.abs("x"===this.UN?c.Wi().x:c.Wi().y),f=d/u,g=Math.floor(.8*f),m=g*u,p=g>=4,y=this.jN.enabled?this.jN.columnWidthAxis/d<1.5:void 0,A=this.jN.enabled&&g>this.jN.dataPointsPerColumn?g/this.jN.dataPointsPerColumn>=2:void 0;let x;return!0===this.jN.enabled?y?A&&(x={enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}):x=p?{enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}:{enabled:!1,totalDataPointsAtTime:o}:p&&(x={enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}),this.jN=x||{...this.jN,totalDataPointsAtTime:o},!!x&&this.Lg(),{cpStateChanged:!!x,cpActive:this.jN.enabled}}zW(t,e){var i,s,n;const r=t.FT,o=t.IT,a=t.AT,h=t.fT,l=t.dT;if(this.XN||!this.jN.enabled||!r||!o||void 0===e)return;const u=r.length,c=this.jN.columnWidthAxis,d=this.dt.x.getInnerStart(),f=this.dt.x.getInnerEnd(),g=pd(d,f,r,a,h,l,e,1);if(!g)return;const m=r[g.iFirstSampleDataArray];if(this.OW){if(this.OW.iFirstPackedSample0)if(this.OW.packedColumnsCount-=t,this.OW.packedColumnsCount>0){this.OW.packedDataX.splice(0,2*t),this.OW.packedDataY.splice(0,2*t),this.OW.packedDataColors&&this.OW.packedDataColors.splice(0,2*t),this.OW.packedDataLookupValues&&this.OW.packedDataLookupValues.splice(0,2*t),this.OW.origin+=t*c;const e=yd(this.OW.origin,Math.max(a-1-u+1,0),a-1,(t=>r[md(t,a,u)])),i=md(e,a,u);this.OW.iFirstPackedSample=r[i]>=this.OW.origin?e:e+1}else this.OW=void 0}if(void 0!==(null===(i=this.OW)||void 0===i?void 0:i.iLastPackedSample)&&this.OW.iLastPackedSample>g.iLastSample){const t=r[g.iLastSampleDataArray],e=Math.min(Math.floor((this.OW.origin+this.OW.packedColumnsCount*c-t)/c),this.OW.packedColumnsCount);if(e>0)if(this.OW.packedColumnsCount-=e,this.OW.packedColumnsCount>0){for(let t=0;t<2*e;t+=1)this.OW.packedDataX.pop(),this.OW.packedDataY.pop(),this.OW.packedDataColors&&this.OW.packedDataColors.pop(),this.OW.packedDataLookupValues&&this.OW.packedDataLookupValues.pop();const t=yd(this.OW.origin+this.OW.packedColumnsCount*c,Math.max(a-1-u+1,0),a-1,(t=>r[md(t,a,u)])),i=md(t,a,u);this.OW.iLastPackedSample=r[i]<=this.OW.origin+this.OW.packedColumnsCount*c?t:t-1}else this.OW=void 0}}const p=this.OW||{origin:m,packedColumnsCount:0,packedDataX:[],packedDataY:[],packedDataColors:t.NT?[]:void 0,packedDataLookupValues:t.OT?[]:void 0,packedDataSize:t.GT?[]:void 0,packedDataRotation:t.WT?[]:void 0,iFirstPackedSample:g.iFirstSample,iLastPackedSample:void 0},y=(t,e,i)=>{let s=Math.min(t,t+e*c),n=Math.max(t,t+e*c),h=i;const l=[];do{let t=Fe,i=Fe,d=-1,f=_e,m=_e,y=-1,A=0;for(;h<=g.iLastSample&&h>=g.iFirstSample;){const g=h%u,x=r[g],S=o[g];if(s<=x&&x<=n)A+=1,Number.isNaN(S)||(S>i&&(t=x,i=S,d=h),S0)t=t===Fe?Number.NaN:t,i=i===Fe?Number.NaN:i,f=f===_e?Number.NaN:f,m=m===_e?Number.NaN:m,d0?(p.packedDataX.push(t),p.packedDataY.push(i),p.packedDataX.push(f),p.packedDataY.push(m)):(p.packedDataX.unshift(f),p.packedDataY.unshift(m),p.packedDataX.unshift(t),p.packedDataY.unshift(i))):(l.push({iFirst:y,iSecond:d}),e>0?(p.packedDataX.push(f),p.packedDataY.push(m),p.packedDataX.push(t),p.packedDataY.push(i)):(p.packedDataX.unshift(t),p.packedDataY.unshift(i),p.packedDataX.unshift(f),p.packedDataY.unshift(m)));else{const t=e>0?p.iLastPackedSample:p.iFirstPackedSample;if(void 0===t)l.push({iFirst:0,iSecond:0}),e>0?(p.packedDataX.push(Number.NaN),p.packedDataY.push(Number.NaN),p.packedDataX.push(Number.NaN),p.packedDataY.push(Number.NaN)):(p.packedDataX.unshift(Number.NaN),p.packedDataY.unshift(Number.NaN),p.packedDataX.unshift(Number.NaN),p.packedDataY.unshift(Number.NaN));else{const i=md(t,a,u),h=r[i],d=o[i],f=(s+n)/2,g=f-e*c/6,m=d+(g-h)/(x-h)*(S-d),y=f+e*c/6,A=d+(y-h)/(x-h)*(S-d);l.push({iFirst:t,iSecond:t}),e>0?(p.packedDataX.push(g),p.packedDataY.push(m),p.packedDataX.push(y),p.packedDataY.push(A)):(p.packedDataX.unshift(g),p.packedDataY.unshift(m),p.packedDataX.unshift(y),p.packedDataY.unshift(A))}}p.packedColumnsCount+=1,e>0?p.iLastPackedSample=h-1:(p.iFirstPackedSample=h+1,p.origin=s),s+=e*c,n+=e*c,A=0,t=Fe,i=Fe,d=-1,f=_e,m=_e,y=-1}}s+=e*c,n+=e*c}while(s>=d&&n<=f);return l},A=y(p.origin+p.packedColumnsCount*c,1,void 0!==(null===(s=this.OW)||void 0===s?void 0:s.iLastPackedSample)?this.OW.iLastPackedSample+1:g.iFirstSample),x=y(p.origin,-1,void 0!==(null===(n=this.OW)||void 0===n?void 0:n.iFirstPackedSample)?this.OW.iFirstPackedSample-1:g.iFirstSample),S=t.NT&&p.packedDataColors?[t.NT,p.packedDataColors]:void 0,b=t.OT&&p.packedDataLookupValues?[t.OT,p.packedDataLookupValues]:void 0,v=t.GT&&p.packedDataSize?[t.GT,p.packedDataSize]:void 0,M=t.WT&&p.packedDataRotation?[t.WT,p.packedDataRotation]:void 0;if(S||b||v||M){for(const t of A){const e=md(t.iFirst,a,u),i=md(t.iSecond,a,u);S&&S[1].push(S[0][e],S[0][i]),b&&b[1].push(b[0][e],b[0][i]),v&&v[1].push(v[0][e],v[0][i]),M&&M[1].push(M[0][e],M[0][i])}for(const t of x){const e=md(t.iFirst,a,u),i=md(t.iSecond,a,u);S&&S[1].unshift(S[0][i],S[0][e]),b&&b[1].unshift(b[0][i],b[0][e]),v&&v[1].unshift(v[0][i],v[0][e]),M&&M[1].unshift(M[0][i],M[0][e])}}return this.OW=p.packedColumnsCount>0?p:void 0,{x:p.packedDataX,y:p.packedDataY,color:p.packedDataColors,lookup:p.packedDataLookupValues,size:p.packedDataSize,rotation:p.packedDataRotation}}Lg(){this.OW=void 0}sG(t){if(this.UN&&"linear"===this.QN.type){const e="x"===this.UN?this.QN.scale.x.tA:this.QN.scale.y.tA;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Je===Rs.progressive||e.Je===Rs.regressive){const e=Math.abs("x"===this.UN?this.QN.scale.x.getInnerInterval():this.QN.scale.y.getInnerInterval());if(this.jN.enabled)return 2*e/this.jN.columnWidthAxis;const i=t.length,s=t[0],n=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.UN?s.x:s.y,"x"===this.UN?n.x:n.y,i)}}}eG(t,e,i){if(!this.UN)return e;const s=i.length;let n=Bn(i,t.min,this.UN,this.YN,0,s-1);void 0===n&&(n=this.YN?s-1:0);let r=Bn(i,t.max,this.UN,this.YN,0,s-1);return void 0===r&&(r=this.YN?0:s-1),1+Math.abs(r-n)}hG(){}}class Cp extends Ep{constructor(t,e,i,s,n,r){super(t,e,i,s),this.dR=new Im,this.xG=new kp(this.dt,this),this.mO=mg({lineStyleSolid:()=>Ji(this.Cu)&&this.Cu,lineStyleDashed:()=>Kr(this.Cu)&&this.Cu,strokeFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},strokeFillLinearGradient:()=>{const t=this.Cu.getFillStyle();return it(t)&&t},strokeFillRadialGradient:()=>{const t=this.Cu.getFillStyle();return Q(t)&&t},strokeFillIndividual:()=>{const t=this.Cu.getFillStyle();return W(t)&&t},strokeFillPaletted:()=>{const t=this.Cu.getFillStyle();return H(t)&&t},areaFillSolid:()=>G(this.kW)&&this.kW,areaFillLinearGradient:()=>it(this.kW)&&this.kW,areaFillRadialGradient:()=>Q(this.kW)&&this.kW,areaFillIndividual:()=>W(this.kW)&&this.kW,areaFillPaletted:()=>H(this.kW)&&this.kW,markerFillSolid:()=>G(this.TW)&&this.TW,markerFillLinearGradient:()=>it(this.TW)&&this.TW,markerFillRadialGradient:()=>Q(this.TW)&&this.TW,markerFillPaletted:()=>H(this.TW)&&this.TW,markerFillIndividual:()=>W(this.TW)&&this.TW}),this.sF=y(void 0),this.NW=[],this.fl=!1,this.GW=[],this.WW=void 0,this.lO=e,this.MN={type:"none"},this.zL=t.uO(),this.aO=t,this.xN=this.zL.rz,this.yO=n,this.SO=r}eF(t){return this.sF.M(De(t,this.sF._(),(()=>[t.jT(((e,i)=>{this.NW.push({min:e,max:i}),void 0===t.YT()&&this.UW&&this.GW.push({min:e,max:i})})),t.ZT((()=>{this.fl=!0,this.UW=void 0,this.WW=void 0,this.xG.Lg()}))]))),this.WW=void 0,this}Ds(){var t,i,s,n,r,o,a,h,l,c,d;const f=null===(t=this.sF._())||void 0===t?void 0:t.Wt,g=this.sF.o,m=null==f?void 0:f.FT,p=null==f?void 0:f.IT;if(!f||!m||!p)return this;const y=f.OT,A=f.NT,x=f.GT,S=f.WT,b=f.AT,v=f.fT,M=f.dT,T=this.Cu,w=this.kW,E=g||this.va()||this.BW()||this.RW(),k=this.mO.lineStyleSolid(E),C=this.mO.lineStyleDashed(E),D=k||C,I=D&&D.getThickness(),_=this.mO.strokeFillSolid(E),F=this.mO.strokeFillLinearGradient(E),L=this.mO.strokeFillRadialGradient(E),z=this.mO.strokeFillIndividual(E),P=this.mO.strokeFillPaletted(E),R=_||F||L||z||P,V=this.mO.areaFillSolid(E),B=this.mO.areaFillLinearGradient(E),O=this.mO.areaFillRadialGradient(E),N=this.mO.areaFillIndividual(E),U=this.mO.areaFillPaletted(E),G=V||B||O||N||U,W=this.mO.markerFillSolid(E),Y=this.mO.markerFillLinearGradient(E),H=this.mO.markerFillRadialGradient(E),X=this.mO.markerFillPaletted(E),j=this.mO.markerFillIndividual(E),$=W||Y||H||X||j,q=this.FW._(),J=this.IW._(),K=this.IW.o,Z=this.DW.o,Q=this.NW.length>0||Z,tt=this.fl,et=tt?[f.HT()]:(t=>{const e=[];for(const i of t){let t=!1;for(const s of e)if(i.min>=s.min&&i.min<=s.max||i.max>=s.min&&i.max<=s.max){s.min=Math.min(s.min,i.min),s.max=Math.min(s.max,i.max),t=!0;break}t||e.push(i)}return e})(this.NW),it=this.dt.x.Yt,st=this.dt.x.getInnerStart(),nt=this.dt.x.getInnerEnd(),rt=f.YT(),ot=!!C,at=this.jo._(),ht=this.jo.o,{cpStateChanged:lt,cpActive:ut}=this.xG.VW(f,this.iF);if(rt&&ut&&(lt||tt||Q||it||E)){const t=this.xG.zW(f,rt);if(t){const e=!lt&&!tt&&!E;this.YW=Dp(this.zL,[t.x,t.y],t.color,t.lookup,t.size,t.rotation,ot,this.YW,e,rt,1e3,this.dt._i(),(t=>$t(t,this.dt._i()))),this.HW={min:_e,max:Fe};const s=t.y.length;for(let e=0;ethis.XW.iLastSample||E){let i,s,r,o,a,h;if(1===t.dataRanges.length){const e=t.dataRanges[0];i=m.subarray(e.offset,e.offset+e.count),s=p.subarray(e.offset,e.offset+e.count),r=A?A.subarray(e.offset,e.offset+e.count):void 0,o=y?y.subarray(e.offset,e.offset+e.count):void 0,a=x?x.subarray(e.offset,e.offset+e.count):void 0,h=S?S.subarray(e.offset,e.offset+e.count):void 0}else{const e=t.dataRanges[0],n=t.dataRanges[1],l=e.count+n.count;i=new Float32Array(l),i.set(m.subarray(e.offset),0),i.set(m.subarray(n.offset,n.offset+n.count),e.count),s=new Float32Array(l),s.set(p.subarray(e.offset),0),s.set(p.subarray(n.offset,n.offset+n.count),e.count),A&&(r=new Uint32Array(l),r.set(A.subarray(e.offset),0),r.set(A.subarray(n.offset,n.offset+n.count),e.count)),y&&(o=new Float32Array(l),o.set(y.subarray(e.offset),0),o.set(y.subarray(n.offset,n.offset+n.count),e.count)),x&&(a=new Float32Array(l),a.set(x.subarray(e.offset),0),a.set(x.subarray(n.offset,n.offset+n.count),e.count)),S&&(h=new Float32Array(l),h.set(S.subarray(e.offset),0),h.set(S.subarray(n.offset,n.offset+n.count),e.count))}const l=!lt&&!tt&&!E;this.jW=Dp(this.zL,[i,s],r,o,a,h,ot,this.jW,l,rt,1e3,this.dt._i(),(t=>$t(t,this.dt._i())));let c=i,d=s,f=r,g=o;const b=this.DW._();if(b){const t="spline"===b.type?((t,e)=>{const{xValues:i,yValues:s,lookupValues:n,colors:r}=t;if(i.length<=2)return{xValues:Array.from(i),yValues:Array.from(s),lookupValues:n?Array.from(n):void 0,colors:r?Array.from(r):void 0};const o=((t,e)=>{const i=1e-5,s=t.length-1,n=Array(s);if(s>1){let r=u(0,0),o=u(0,0),a=u(0,0),h=ti(ri({x:t[1],y:e[1]},{x:t[0],y:e[0]}));const l=3;let c=0,d=0;for(let f=0;fi?Math.abs(e/(l*r.x)):1,d=Math.abs(o.x)>i?Math.abs(e/(l*o.x)):1}g[1]=ni(si(r,c),g[1]),g[2]=ri(g[2],si(o,d)),n[f]=g}}return n.length>0?n:[]})(i,s),a=o.length,h=[],l=[],c=[],d=[];for(let t=0;t{const{xValues:s,yValues:n,lookupValues:r,colors:o}=t,a=[],h=[],l=[],u=[],c=s.length,d=i;if(c>0){let t=0,e=s[0],i=n[0];a[t]=e,h[t]=i,t+=1;for(let r=1;r$t(t,this.dt._i()))),this.XW=t}}if(!rt&&(tt||Q||E)){if(!this.YW||this.YW.bufferSize{var s,n,r,o;const a=m.subarray(i.min,i.max+1),h=p.subarray(i.min,i.max+1);if(this.zL.OV(t,i.min*(this.dt._i()?2:1),$t(a,this.dt._i())),this.zL.OV(e,i.min*(this.dt._i()?2:1),$t(h,this.dt._i())),A&&(null===(s=this.YW)||void 0===s?void 0:s.bufferColors)){const t=A.subarray(i.min,i.max+1);this.zL.OV(this.YW.bufferColors,i.min,t,Uint32Array)}if(y&&(null===(n=this.YW)||void 0===n?void 0:n.bufferLookupValues)){const t=y.subarray(i.min,i.max+1);this.zL.OV(this.YW.bufferLookupValues,i.min,t,Float32Array)}if(S&&(null===(r=this.YW)||void 0===r?void 0:r.bufferRotations)){const t=S.subarray(i.min,i.max+1);this.zL.OV(this.YW.bufferRotations,i.min,t,Float32Array)}if(x&&(null===(o=this.YW)||void 0===o?void 0:o.bufferSizes)){const t=x.subarray(i.min,i.max+1);this.zL.OV(this.YW.bufferSizes,i.min,t,Float32Array)}})),this.YW.valueCount=f.fT}this.jW=this.YW}if(this.dR.yV(this.dt),E||K||ht){if(R&&D&&!1!==I){const t=-1===I?"primitive":"triangulated",e=P?["lookup",P.lookUpProperty,P.lut]:z?"attribute":F?["gradient",F]:L?["gradient",L]:"uniform";this.MN="primitive"===t?{type:t,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),C&&Wg.StippleTexture),lineStyleSolid:k,lineStyleDashed:C,fillStyleSolid:_,fillStyleLinearGradient:F,fillStyleRadialGradient:L,fillStyleIndividual:z,fillStylePaletted:P,mousePickingShader:at&&this.zL.cE(Wg["2D"],Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),C&&Wg.StippleTexture,Wg.MousePicking)}:"triangulated"===t?{type:t,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),this.xN?Wg.AliasedEdge:void 0,C&&Wg.StippleTextureInstanced),geometry:Xm(this.zL,I),thickness:I,lineStyleSolid:k,lineStyleDashed:C,fillStyleSolid:_,fillStyleLinearGradient:F,fillStyleRadialGradient:L,fillStyleIndividual:z,fillStylePaletted:P,mousePickingShader:at&&this.zL.cE(Wg["2D"],Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),C&&Wg.StippleTextureInstanced,Wg.MousePicking)}:{type:"none"}}else this.MN={type:"none"};if(this.ZW=G?{shader:this.zL.cE(Wg["2D"],U&&Wg.Color({dataType:["lookup",U.lookUpProperty,U.lut]}),N&&Wg.Color({dataType:"attribute"}),V&&Wg.Color({dataType:"uniform"}),B&&Wg.Color({dataType:["gradient",B]}),O&&Wg.Color({dataType:["gradient",O]}),Wg.Area2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0})),geometry:wp(this.zL),fillStyleSolid:V,fillStyleLinearGradient:B,fillStyleRadialGradient:O,fillStyleIndividual:N,fillStylePaletted:U,mousePickingShader:at&&this.zL.cE(Wg["2D"],Wg.Area2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),Wg.MousePicking)}:void 0,$){const t=x?"attribute":"uniform",e=J<=1&&Wg.PointSize("uniform"),i=Wg.VertexLocation({offset:J>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:{dataType:S?"attribute-deg":"uniform"}}:void 0,axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0});this.QW={shader:this.zL.cE(Wg["2D"],e,i,W&&Wg.Color({dataType:"uniform",overrideOpacity:!0}),Y&&Wg.Color({dataType:["gradient",Y],overrideOpacity:!0}),H&&Wg.Color({dataType:["gradient",H],overrideOpacity:!0}),X&&Wg.Color({dataType:["lookup",X.getLookUpProperty(),X.getPalette()],overrideOpacity:!0}),j&&Wg.Color({dataType:"attribute",overrideOpacity:!0})),geometry:ap(q,this.zL,J),fillStyleSolid:W,fillStyleLinearGradient:Y,fillStyleRadialGradient:H,fillStylePaletted:X,fillStyleIndividual:j,mousePickingShader:at&&this.zL.cE(Wg["2D"],e,i,Wg.MousePicking)}}else this.QW=void 0}const ct={min:{x:this.vt(),y:this.dt.y.getInnerStart()},max:{x:this.xt(),y:this.Mt()}};if(this.JW=this.zL.Wz(F,this,ct),this.KW=this.zL.Uz(L,this,ct),this.qW=this.zL.Wz(B,this,ct),this.tU=this.zL.Uz(O,this,ct),this.iU=this.zL.Wz(Y,this,ct),this.sU=this.zL.Uz(H,this,ct),(void 0===this.WW||Q)&&y&&(yg(P)||yg(U)||yg(X))){const t=this.WW?et:[f.HT()];let e=this.WW?this.WW.max:Fe,i=this.WW?this.WW.min:_e;const s=y;t.forEach((t=>{for(let n=t.min;n<=t.max;n+=1){const t=s[n];i=te?t:e}})),this.WW={min:i,max:e}}return this.wN=C?this.zL.Dz(C.getPattern()):void 0,this.Iu(T),this.LW=w,this.EW=this.TW,this.IW.o=!1,this.NW.length=0,this.fl=!1,this.DW.o=!1,this.sF.o=!1,this.jo.o=!1,this}yL(t){var e,i,s,n,r,o,a,h,l,u,c,d,f,g,m,p,y;const A=this.zL.gl,x=null===(e=this.YW)||void 0===e?void 0:e.bufferX,S=null===(i=this.YW)||void 0===i?void 0:i.bufferY,b=null===(s=this.YW)||void 0===s?void 0:s.bufferColors,v=null===(n=this.YW)||void 0===n?void 0:n.bufferLookupValues,M=null===(r=this.YW)||void 0===r?void 0:r.valueCount,T=null===(o=this.jW)||void 0===o?void 0:o.valueCount,w=null===(a=this.sF._())||void 0===a?void 0:a.Wt,E=null==w?void 0:w.YT();if(!x||!S||!w)return this;const k=(e,i,s)=>{if(_p(this.zL,e,this.dt._i(),x,"aLocation","X",1,!1,A.FLOAT,Float32Array.BYTES_PER_ELEMENT),_p(this.zL,e,this.dt._i(),S,"aLocation","Y",1,!1,A.FLOAT,Float32Array.BYTES_PER_ELEMENT),i&&1!==t){if(!b)return!1;_p(this.zL,e,!1,b,"aColor","",4,!0,A.UNSIGNED_BYTE,1)}if(s&&"value"===s.lookUpProperty&&1!==t){if(!v)return!1;_p(this.zL,e,!1,v,"aLookupValue","",1,!1,A.FLOAT,Float32Array.BYTES_PER_ELEMENT)}return!0},C=1===t?null===(h=this.ZW)||void 0===h?void 0:h.mousePickingShader:null===(l=this.ZW)||void 0===l?void 0:l.shader;if(this.ZW&&C&&void 0!==M&&M>0&&E){const e=this.ZW;this.zL.JL(C).lV(C,((i,s,n,r)=>!!this.zL.Oz(n,t,this,{uniforms:this.dR,mousePickingColor:this.SO,fillStyleSolid:e.fillStyleSolid,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,fillStylePaletted:e.fillStylePaletted,linearGradientInfo:this.qW,radialGradientInfo:this.tU,lookupValueRange:e.fillStylePaletted?pg(e.fillStylePaletted,this,this.WW):void 0,lookupValueBuffer:null})&&!!k(n,e.fillStyleIndividual,e.fillStylePaletted)&&(null==e||e.geometry.JL(n).Pp(M-1),!0)))}const D="none"===this.MN.type?void 0:1===t?this.MN.mousePickingShader:this.MN.shader;if("none"!==this.MN.type&&D&&void 0!==M&&M>0){const e=this.MN;this.zL.JL(D).lV(D,((i,s,n,r)=>{var o,a;if(!this.zL.Oz(n,t,this,{uniforms:this.dR,mousePickingColor:this.SO,fillStyleSolid:e.fillStyleSolid,fillStylePaletted:e.fillStylePaletted,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,fillStyleIndividual:e.fillStyleIndividual,linearGradientInfo:this.JW,radialGradientInfo:this.KW,lookupValueRange:e.fillStylePaletted?pg(e.fillStylePaletted,this,this.WW):void 0,lookupValueBuffer:"primitive"===e.type?v:null,colorBuffer:"primitive"===e.type?b:null,coordsX:"primitive"===e.type?x:void 0,coordsY:"primitive"===e.type?S:void 0,coordsHighPrecision:this.dt._i()}))return!1;if(e.lineStyleDashed){if(!this.wN)return!1;this.zL.cV(i("uStippleCount"),[this.us.oi().x/this.wN.Rz,this.us.oi().y/this.wN.Rz]).fV(r("uStippleTextureWidthLimiter"),this.wN.Lz/this.wN.Rz).fV(i("uStippleScale"),e.lineStyleDashed.getPatternScale()).dV(i("uStippleTexture"),this.wN.Bz,1)}if("primitive"===e.type){if(e.lineStyleDashed){if(!(null===(o=this.YW)||void 0===o?void 0:o.bufferLengthSoFar))return!1;this.zL.UV(s("aLengthSoFar"),this.YW.bufferLengthSoFar)}$m.SN(this.aO,M)}else{if(!k(n,e.fillStyleIndividual,e.fillStylePaletted))return!1;if(e.lineStyleDashed){if(!(null===(a=this.YW)||void 0===a?void 0:a.bufferLengthSoFar))return!1;_p(this.zL,n,!1,this.YW.bufferLengthSoFar,"aLengthSoFar","",2,!1,A.FLOAT,Float32Array.BYTES_PER_ELEMENT)}jm.yL(this.aO,e.geometry,n,this.xN&&1!==t,1===t,e.thickness,M-1)}return!0}))}const I=null===(u=this.jW)||void 0===u?void 0:u.bufferX,_=null===(c=this.jW)||void 0===c?void 0:c.bufferY,F=null===(d=this.jW)||void 0===d?void 0:d.bufferColors,L=null===(f=this.jW)||void 0===f?void 0:f.bufferLookupValues,z=null===(g=this.jW)||void 0===g?void 0:g.bufferSizes,P=null===(m=this.jW)||void 0===m?void 0:m.bufferRotations,R=1===t?null===(p=this.QW)||void 0===p?void 0:p.mousePickingShader:null===(y=this.QW)||void 0===y?void 0:y.shader,V=this.QW;let B=1;if(E){const t=this.sF?Math.abs((this.xt()-this.vt())/w.getSampleCount()):0,e=this.dt.x.getInnerInterval()/t,i=this.IW._(),s=this.dt.x.ri()/i/1,n=2*s;B=e<=s?1:Math.max(1-(e-s)/(n-s),0)}if(R&&V&&I&&_&&B>0&&void 0!==T&&T>0){const e=V,i=e.geometry.LG(this.IW._())?1:0;this.zL.JL(R).lV(R,((s,n,r,o)=>{if(!this.zL.Oz(r,t,this,{uniforms:this.dR,mousePickingColor:this.SO,fillStyleSolid:e.fillStyleSolid,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,linearGradientInfo:this.iU,radialGradientInfo:this.sU,fillStylePaletted:e.fillStylePaletted,fillStyleIndividual:e.fillStyleIndividual,lookupValueRange:e.fillStylePaletted?pg(e.fillStylePaletted,this,this.WW):void 0,lookupValueBuffer:L,lookupValueAttribDivisor:i,colorBuffer:F,colorAttribDivisor:i}))return!1;if(this.dt._i()?this.zL.uV(I,i,{location:n("aPos_highpartX"),size:1},{location:n("aPos_lowpartX"),size:1}).uV(_,i,{location:n("aPos_highpartY"),size:1},{location:n("aPos_lowpartY"),size:1}):this.zL.jV(n("aPosX"),I,i).jV(n("aPosY"),_,i),1!==t&&this.zL.fV(s("uOpacity"),B),this.IW._()>1)if(P)this.zL.jV(n("aRotDeg"),P,i).fV(s("uBaseRotDeg"),e.geometry.BG);else{const t=di(this.PW._()+e.geometry.BG),i=Math.sin(t),n=Math.cos(t);this.zL.cV(s("uRot"),[i,n])}return e.geometry.Pp(r,z,this.IW._(),T),!0}))}return this}dO(t){return this.yO===t&&{}}dispose(){var t,e,i,s,n,r,o,a,h;return super.dispose(),this.zL.SV(null===(t=this.YW)||void 0===t?void 0:t.bufferX),this.zL.SV(null===(e=this.YW)||void 0===e?void 0:e.bufferY),this.zL.SV(null===(i=this.YW)||void 0===i?void 0:i.bufferColors),this.zL.SV(null===(s=this.YW)||void 0===s?void 0:s.bufferLookupValues),this.zL.SV(null===(n=this.jW)||void 0===n?void 0:n.bufferX),this.zL.SV(null===(r=this.jW)||void 0===r?void 0:r.bufferY),this.zL.SV(null===(o=this.jW)||void 0===o?void 0:o.bufferColors),this.zL.SV(null===(a=this.jW)||void 0===a?void 0:a.bufferLookupValues),this.MN={type:"none"},this.ZW=void 0,this.QW=void 0,this.xG.Lg(),null===(h=this.sF._())||void 0===h||h.Gt(),this.YW=void 0,this.jW=void 0,this.JW=void 0,this.KW=void 0,this.qW=void 0,this.tU=void 0,this.iU=void 0,this.sU=void 0,this}GL(){return this.dispose(),this}eU(t){if(!this.UW){const{xValues:e,yValues:i}=t.readBack();this.UW={min:{x:_e,y:_e},max:{x:Fe,y:Fe}};const s=e.length;for(let t=0;tthis.UW.max.x?s:this.UW.max.x,this.UW.max.y=n>this.UW.max.y?n:this.UW.max.y}return this.GW.length=0,this.UW}const e=t.FT,i=t.IT;if(this.GW.length>0&&e&&i){for(const t of this.GW){for(let s=t.min;s<=t.max;s+=1){const t=e[s],n=i[s];this.UW.min.x=tthis.UW.max.x?t:this.UW.max.x,this.UW.max.y=n>this.UW.max.y?n:this.UW.max.y}this.GW.length=0}return this.UW}return this.UW}xt(){var t,e,i,s,n;const r=null===(t=this.sF._())||void 0===t?void 0:t.Wt;if(!r)return 0;const o=r.YT();return"ProgressiveX"===o?(null===(e=r.TT())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=r.XT())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.HW)||void 0===s?void 0:s.max)||0:"RegressiveY"===o?(null===(n=this.HW)||void 0===n?void 0:n.max)||0:this.eU(r).max.x}vt(){var t,e,i,s,n;const r=null===(t=this.sF._())||void 0===t?void 0:t.Wt;if(!r)return 0;const o=r.YT();return"ProgressiveX"===o?(null===(e=r.XT())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=r.TT())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.HW)||void 0===s?void 0:s.min)||0:"RegressiveY"===o?(null===(n=this.HW)||void 0===n?void 0:n.min)||0:this.eU(r).min.x}Mt(){var t,e,i,s,n;const r=null===(t=this.sF._())||void 0===t?void 0:t.Wt;if(!r)return 0;const o=r.YT();return"ProgressiveX"===o?Dt(null===(e=this.HW)||void 0===e?void 0:e.max,0):"RegressiveX"===o?Dt(null===(i=this.HW)||void 0===i?void 0:i.max,0):"ProgressiveY"===o?Dt(null===(s=r.TT())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Dt(null===(n=r.XT())||void 0===n?void 0:n.y,0):this.eU(r).max.y}bt(){var t,e,i,s,n;const r=null===(t=this.sF._())||void 0===t?void 0:t.Wt;if(!r)return 0;const o=r.YT();return"ProgressiveX"===o?Dt(null===(e=this.HW)||void 0===e?void 0:e.min,0):"RegressiveX"===o?Dt(null===(i=this.HW)||void 0===i?void 0:i.min,0):"ProgressiveY"===o?Dt(null===(s=r.XT())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Dt(null===(n=r.TT())||void 0===n?void 0:n.y,0):this.eU(r).min.y}Vl(){var t;const e=Math.max(Me(this.Cu),this.IW._()),i=null===(t=this.sF._())||void 0===t?void 0:t.Wt.YT();return!i||"ProgressiveX"!==i&&"RegressiveX"!==i?e:0}zl(){var t;const e=Math.max(Me(this.Cu),this.IW._()),i=null===(t=this.sF._())||void 0===t?void 0:t.Wt.YT();return!i||"ProgressiveY"!==i&&"RegressiveY"!==i?e:0}}const Dp=(t,e,i,s,n,r,o,a,h,l,u,c,d)=>{if("ProgressiveX"!==l)throw new Error("Unimplemented data pattern");const f=e[0],g=e[1],m=f.length,p=f[0],y=f[m-1],A=g[0],x=g[m-1],S=c?2:1;if(a&&h&&a.firstX&&a.lastX&&p>=a.firstX){const e=yd(a.lastX,0,m-1,(t=>f[t]));if(f[e]===a.lastX){const h=a.bufferSize-a.valueCount,l=e+1,u=m-l;if(0===u)return a;if(h>=u){const e=Sd(f,l,void 0),h=Sd(g,l,void 0);if(t.OV(a.bufferX,a.valueCount*S,d(e)),t.OV(a.bufferY,a.valueCount*S,d(h)),i&&a.bufferColors){const e=i.slice(l);t.OV(a.bufferColors,a.valueCount,e,Uint32Array)}if(s&&a.bufferLookupValues){const e=s.slice(l);t.OV(a.bufferLookupValues,a.valueCount,e,Float32Array)}if(n&&a.bufferSizes){const e=n.slice(l);t.OV(a.bufferSizes,a.valueCount,e,Float32Array)}if(r&&a.bufferRotations){const e=r.slice(l);t.OV(a.bufferRotations,a.valueCount,e,Float32Array)}if(o&&a.bufferLengthSoFar){const[i,s,n]=Ip(e,h,a.lastX||0,a.lastY||0,a.lengthSoFarX,a.lengthSoFarY);t.OV(a.bufferLengthSoFar,2*a.valueCount,i,Float32Array),a.lengthSoFarX=s,a.lengthSoFarY=n}return a.valueCount+=u,a.lastX=y,a.lastY=x,a}}}const b=m+u,v=t.zV(b*S,d(f),null==a?void 0:a.bufferX),M=t.zV(b*S,d(g),null==a?void 0:a.bufferY),T=i?t.zV(b,i,null==a?void 0:a.bufferColors,Uint32Array):void 0,w=s?t.zV(b,s,null==a?void 0:a.bufferLookupValues,Float32Array):void 0,E=n?t.zV(b,n,null==a?void 0:a.bufferSizes,Float32Array):void 0,k=r?t.zV(b,r,null==a?void 0:a.bufferRotations,Float32Array):void 0;let C,D=0,I=0;if(o){const e=Ip(f,g,f[0],g[0],0,0);C=t.zV(2*b,e[0],null==a?void 0:a.bufferLengthSoFar,Float32Array),D=e[1],I=e[2]}return{bufferX:v,bufferY:M,bufferColors:T,bufferLookupValues:w,bufferSizes:E,bufferRotations:k,bufferSize:b,bufferLengthSoFar:C,valueCount:m,firstX:p,lastX:y,firstY:A,lastY:x,lengthSoFarX:D,lengthSoFarY:I}},Ip=(t,e,i,s,n,r)=>{const o=t.length,a=new Float32Array(2*o);if(0===o)return[a,0,0];let h=0,l=i,u=s,c=n,d=r;for(let i=0;i{const u=t.gl;if(i){const i=e.attribute(`${n}A_highpart${r}`),c=e.attribute(`${n}A_lowpart${r}`),d=e.attribute(`${n}B_highpart${r}`),f=e.attribute(`${n}B_lowpart${r}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,h,a,2*o*l,0*l),u.vertexAttribPointer(c,o,h,a,2*o*l,o*l),t.HV(i,1),t.HV(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.vertexAttribPointer(d,o,h,a,2*o*l,2*o*l),u.vertexAttribPointer(f,o,h,a,2*o*l,3*o*l),t.HV(d,1),t.HV(f,1),u.enableVertexAttribArray(d),u.enableVertexAttribArray(f),u.bindBuffer(u.ARRAY_BUFFER,null)}else{const i=e.attribute(`${n}A${r}`),c=e.attribute(`${n}B${r}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,h,a,o*l,0*l),u.vertexAttribPointer(c,o,h,a,o*l,o*l),t.HV(i,1),t.HV(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.bindBuffer(u.ARRAY_BUFFER,null)}},Fp={translation:(t,e)=>[1,0,0,0,1,0,t,e,1],rotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,-i,0,i,e,0,0,0,1]},scaling:(t,e)=>[t,0,0,0,e,0,0,0,1],translate:(t,e,i)=>Fp.multiply(t,Fp.translation(e,i)),rotate:(t,e)=>Fp.multiply(t,Fp.rotation(e)),scale:(t,e,i)=>Fp.multiply(t,Fp.scaling(e,i)),multiply(t,e){const i=t[0],s=t[1],n=t[2],r=t[3],o=t[4],a=t[5],h=t[6],l=t[7],u=t[8],c=e[0],d=e[1],f=e[2],g=e[3],m=e[4],p=e[5],y=e[6],A=e[7],x=e[8];return[c*i+d*r+f*h,c*s+d*o+f*l,c*n+d*a+f*u,g*i+m*r+p*h,g*s+m*o+p*l,g*n+m*a+p*u,y*i+A*r+x*h,y*s+A*o+x*l,y*n+A*a+x*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class Lp extends Zn{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.hU=[],this.dR=new Im,this.rU=[u(0,0),u(0,0),u(0,0),u(0,0)],this.nU=m(u(0,0),u(0,0)),this.oU=m(u(0,0),u(0,0)),this.aU=u(0,0),this.lU=u(0,0),this.iM=u(0,0),this.uU=u(0,0),this.cU=0,this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStyleRadialGradient:()=>Q(this.be)&&this.be,fillStyleLinearGradient:()=>it(this.be)&&this.be}),this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO(),this.lO=e,this.DN=t.En.uo}Ds(){const t=this.ya(),e=this.ma(),i=this.jo._();if(t){const t=this.ga(),s=this.mO.fillStyleSolid(t),n=this.mO.fillStyleRadialGradient(t),r=this.mO.fillStyleLinearGradient(t),o=s||n||r,a=this.zL,h=this.zL.sR();if(this.dR.yV(this.dt),this.Ia.o){this.dU&&this.dU.KL(this),this.font.M(pn(this.Ia._()));const t=this.font._();this.dU=this.zL.Eh(t.properties.family),this.dU.JL(this)}const l=this.font.o,c=l||this._a.o;if(c&&this.dU){const t=this.font._();[this.fU,this.oU]=this.dU.tR(this._a._(),t.properties,this.aO.qi.isDark),this.hU.forEach((t=>{t.texCoordBuff&&a.SV(t.texCoordBuff),t.vertexBuff&&a.SV(t.vertexBuff)})),this.hU=this.fU.map((t=>({texCoordBuff:a.oV(t.texCoords,!1),texture:t.texture,info:t}))),this.Ia.o=!1,this.font.o=!1,this._a.o=!1}const d=this.dt.Ni()||e,f=this.wa.o||this.ka.o||this.Ca.o||this.Ta.o||this.Da.o||this.Xt.o||c||d,g=this.Da._(),m=si(u(this.ka._()+1,this.Ca._()+1),.5);if(f&&this.fU&&(this.aU=u(-(g.left*h+this.oU.max.x-this.oU.min.x+g.right*h)*m.x-this.oU.min.x+g.right*h,-(g.bottom*h+this.oU.max.y-this.oU.min.y+g.top*h)*m.y-this.oU.min.y+g.top*h)),(f||d||this.Fa.o||this.ga())&&this.be!==V){if(this.fU){const t=ni(this.wa._(),this.Ta._()),e=ut(t,this.dt,this.us.dt),i=si(e,h);this.uU=i;const s=di(this.Fa._());this.cU=s,c&&this.hU.forEach((t=>{const e=t.info;e&&(t.vertexBuffLen=e.vertices.length/2,t.vertexBuff=a.oV(e.vertices,!0,t.vertexBuff))}));const n=this.Xt._(),r=[ni(Ze(u((this.oU.min.x+(-n.left-g.left)*h+this.aU.x)/h,(this.oU.max.y+(n.top+g.top)*h+this.aU.y)/h),this.Pa,s),e),ni(Ze(u((this.oU.max.x+(n.right+g.right)*h+this.aU.x)/h,(this.oU.max.y+(n.top+g.top)*h+this.aU.y)/h),this.Pa,s),e),ni(Ze(u((this.oU.max.x+(n.right+g.right)*h+this.aU.x)/h,(this.oU.min.y+(-n.bottom-g.bottom)*h+this.aU.y)/h),this.Pa,s),e),ni(Ze(u((this.oU.min.x+(-n.left-g.left)*h+this.aU.x)/h,(this.oU.min.y+(-n.bottom-g.bottom)*h+this.aU.y)/h),this.Pa,s),e)];this.rU=[ut(r[0],this.us.dt,this.dt),ut(r[1],this.us.dt,this.dt),ut(r[2],this.us.dt,this.dt),ut(r[3],this.us.dt,this.dt)];const o=je(r);this.lU=u(-(o.max.x-o.min.x)*h*m.x-o.min.x*h+this.uU.x,-(o.max.y-o.min.y)*h*m.y-o.min.y*h+this.uU.y),this.CB=ri(o.max,o.min);const l=je(this.rU),d=this.dt.pi(l.min,this.lU),f=this.dt.pi(l.max,this.lU);this.nU=je([d,f])}n?this.CO=xm(this.nU,this.dt,n.getPosition(),n.getExtent(),n.getShape(),this.zL.sR()):r?this.kO=Sm(this.nU,this.dt,r.getAngle(!0),this.zL.sR()):(this.CO=void 0,this.kO=void 0)}(this.ga()||l)&&(this.gR=o?this.zL.cE(Wg["2D"],Wg.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.DN}),Wg.Color({dataType:n?["gradient",n]:r?["gradient",r]:"uniform",maskTexture:!0})):void 0),this.AU=i&&o?this.AU||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.DN})):void 0,this.wa.o=!1,this.ka.o=!1,this.Ca.o=!1,this.Ta.o=!1,this.Fa.o=!1,this.Sa(this.be)}return this.Ba=t,this}yL(t){if(this.ya()){const e=1===t?this.AU:this.gR;if(!e||0===this.hU.length)return this;const i=this.mO.fillStyleSolid(!1),s=this.mO.fillStyleRadialGradient(!1),n=this.mO.fillStyleLinearGradient(!1),r=this.us.UR(),o=r.x,a=r.y;let h=Fp.projection(o,a,-1);const l=Fp.translation(this.aU.x,this.aU.y),u=Fp.translation(this.lU.x,this.lU.y);h=Fp.translate(h,this.uU.x,this.uU.y),h=Fp.multiply(h,u),h=Fp.rotate(h,this.cU),h=Fp.multiply(h,l),1===t&&(h=Fp.scale(h,this.oU.max.x,this.oU.max.y)),this.zL.JL(e).lV(e,((e,o,a,l)=>{if(this.zL.BV(e("uMatrix"),h).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),this.DN&&this.zL.cV(l("uViewportSizePx"),[r.x*this.zL.sR(),r.y*this.zL.sR()]),1===t)this.zL.AV(e("uColor"),this.SO);else if(i)this.zL.AV(e("uColor"),i.getColor());else if(s&&this.CO){this.zL.cV(e("uCenter"),this.CO.center).cV(e("uDistance"),this.CO.distance).PV(e("uBounds"),this.CO.bounds).fV(e("uAspect"),this.CO.aspectRatio);const t=s.getColorStops();for(let i=0;i{this.zL.UV(o("aPos"),t.vertexBuff).UV(o("aMaskTextureCoord"),t.texCoordBuff).dV(e("uMaskTexture"),t.texture,0).Pp(this.zL.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return this}dO(t){return this.yO===t&&{}}Ue(){return this.ya()?this.rU:[]}Cc(){return this.ya()&&this.CB?this.CB:u(0,0)}oi(){if(this.ya()&&this.nU){const t=this.nU;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}GL(){return this.hU.forEach((t=>{t.texCoordBuff&&this.zL.SV(t.texCoordBuff),t.vertexBuff&&this.zL.SV(t.vertexBuff)})),this.hU=[],this.dU&&this.dU.KL(this),this}xt(){return this.nU.max.x}vt(){return this.nU.min.x}Mt(){return this.nU.max.y}bt(){return this.nU.min.y}Vl(){return 0}zl(){return 0}}class zp{constructor(t,e,i){this.gU=new Set,this.pU=t=>(this.gU.add(t),t),this.mU=t=>(this.gU.delete(t),t.GL(),this),this.us=t,this.ua=e,this.yU=i}mL(t){this.gU.delete(t)&&this.gU.add(t)}W(){for(const t of this.gU)t.GL().dispose();this.us.pn(this.ua)}bs(){return this.us.bs(),this}gn(){return this.ua}}class Pp extends zp{constructor(){super(...arguments),this.SU=y(void 0),this.ca=!1}ES(t){return this.SU.M(t),this}lg(){return this.SU._()}}class Rp extends Pp{constructor(t,e,i){super(t,e,i),this.aO=t,this.gl=t.uO(),this.vU=this.gU}nV(t){const e=t instanceof Yn&&t;if(!e)return Le;const i=e.vt(),s=e.xt(),n=e.bt(),r=e.Mt();if(i===_e||s===Fe||n===_e||r===Fe)return Le;const o=e.Vl(),a=e.zl(),h=Hn({min:{x:i,y:n},max:{x:s,y:r}},{x:o,y:a},e.dt),l={min:ut(h.min,e.dt,t.us.dt),max:ut(h.max,e.dt,t.us.dt)},u=this.SU._();let c;if(u){if(c={min:{x:Math.max(l.min.x,u.x),y:Math.max(l.min.y,u.y)},max:{x:Math.min(l.max.x,u.x+u.width),y:Math.min(l.max.y,u.y+u.height)}},c.max.x{const t=this.aO.bU();return{id:t,color:this.aO.MU(t)}})))}zp(t,e,i){const s=this.aO.bU();return this.pU(new sp(this.aO,this,t,this.mU,i,s,this.aO.MU(s),e))}tF(t){const e=this.aO.bU();return this.pU(new Cp(this.aO,this,t,this.mU,e,this.aO.MU(e)))}kr(t){const e=this.aO.bU();return this.pU(new Lp(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}Oc(t){const e=this.aO.bU();return this.pU(new hp(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}vc(t,e=rr.Simple){const i=this.aO.bU();if(e===rr.Simple)return this.pU(new cp(this.aO,this,t,this.mU,[],i,this.aO.MU(i)));throw new Error("GlEngine.addPolygon | No such polygon type!")}bv(t){return this.pU(new lp(this.aO,this,t,this.mU,[],(()=>{const t=this.aO.bU();return{id:t,color:this.aO.MU(t)}})))}Te(t){const e=this.aO.bU();return this.pU(new up(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}yC(t){const e=this.aO.bU();return this.pU(new Ym(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}Fc(t){const e=this.aO.bU();return this.pU(new Rm(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}ck(t,e,i){if("intensity"===i.heatmapDataType){const s=this.aO.bU();return this.pU(new bp(this.aO,this,t,this.mU,e,s,this.aO.MU(s),i))}throw new gt("Unimplemented Heatmap Grid Static type")}ek(t,e,i){const s=this.aO.bU();return this.pU(new xp(this.aO,this,t,this.mU,e,i,s,this.aO.MU(s)))}Sx(t,e,i){const s=this.aO.bU();return this.pU(new Mp(this.aO,this,t,this.mU,e,i,s,this.aO.MU(s)))}_U(t){return this.pU(new zm(this.aO,this,this.mU,[],t))}Ds(){if(this.ca){this.ca=!1;const t=Array.from(this.gU).sort(((t,e)=>t.fa()-e.fa()));this.gU.clear();for(const e of t)this.gU.add(e)}for(const t of this.gU)t.Ds();return this}yL(t,e){const i=this.SU._();if(i&&this.gl.rV(i.x*this.gl.sR()*e,i.y*this.gl.sR()*e,i.width*this.gl.sR()*e,i.height*this.gl.sR()*e),1!==t)for(const e of this.gU)e.getVisible()&&e.yL(t);else for(const e of this.gU)e.getMouseInteractions()&&e.getVisible()&&e.yL(t);return this.gl.tV(!1),this}}class Vp extends bm{constructor(t){super(t)}}class Bp extends Vp{constructor(t){super(t),this.wU="attribute";const{vertices:e,drawSize:i,drawMode:s}=Op(t.gl);this.TL=t.oV(e),this.fN=i,this.AN=s}Pp(t,e,i,s){return this.zL.uV(this.TL,0,{location:t.attribute("aInstanceGeo"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:s?t.attribute("aTriangleBary"):void 0,size:3}).KV(this.AN,0,this.fN,e),this}IE(){this.zL.SV(this.TL)}}const Op=t=>{const e=new Float32Array(324);let i=0;return e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,{vertices:e,drawSize:i/9,drawMode:t.TRIANGLES}};class Np extends Vp{constructor(t,e){super(t),this.wU="attribute",this.CU=e;const{vertices:i,indices:s}=Up();this.TL=t.oV(i),this.dN=t.GV(s),this.fN=s.length,this.AN=t.gl.TRIANGLES}Pp(t,e,i,s){return this.zL.uV(this.TL,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).ZV(this.dN).fV(t.uniform("uEdgeRoundness"),this.CU/2).qV(this.AN,this.fN,0,e),this}IE(){this.zL.SV(this.TL),this.zL.SV(this.dN)}kU(t){return this.CU=t,this}TU(){return this.CU}}const Up=()=>{const t=[{normal:{x:0,y:1,z:0},perpendA:{x:0,y:0,z:1},perpendB:{x:-1,y:0,z:0}},{normal:{x:0,y:0,z:-1},perpendA:{x:0,y:1,z:0},perpendB:{x:-1,y:0,z:0}},{normal:{x:-1,y:0,z:0},perpendA:{x:0,y:1,z:0},perpendB:{x:0,y:0,z:1}},{normal:{x:1,y:0,z:0},perpendA:{x:0,y:1,z:0},perpendB:{x:0,y:0,z:-1}},{normal:{x:0,y:0,z:1},perpendA:{x:0,y:1,z:0},perpendB:{x:1,y:0,z:0}},{normal:{x:0,y:-1,z:0},perpendA:{x:0,y:0,z:-1},perpendB:{x:-1,y:0,z:0}}],e=[];let i=0;const s=[];let n=0;for(const r of t){const{normal:t,perpendA:o,perpendB:a}=r,h=Ie.multiply(o,-1),l=Ie.multiply(a,-1),u=i;e[i]={thicknessDirection:Ie.addVec(t,o,a),edge:Ie.addVec(h,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:Ie.addVec(t,h,a),edge:Ie.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:Ie.addVec(t,h,l),edge:Ie.addVec(o,a),normal:t},i+=1;const f=i;e[i]={thicknessDirection:Ie.addVec(t,o,l),edge:Ie.addVec(h,a),normal:t},i+=1,s[n+0]=d,s[n+1]=u,s[n+2]=f,s[n+3]=d,s[n+4]=c,s[n+5]=u,n+=6;const g=[{A:o,B:a},{A:h,B:a},{A:h,B:l},{A:o,B:l}];for(const s of g){s.thicknessDirection=Ie.addVec(t,s.A,s.B),s.stripVerticesA=[],s.stripVerticesB=[];const n=[{direction:s.A,other:s.B,vertices:s.stripVerticesA},{direction:s.B,other:s.A,vertices:s.stripVerticesB}];for(const r of n)for(let n=0;n<8;n+=1){const o=.5*n/7,a=Ie.normalize(Ie.lerp(t,r.direction,o)),h=Math.PI/2-Ie.angle(a,t),l=Ie.addVec(Ie.multiply(Ie.multiply(r.direction,-1),1-Math.cos(h)),Ie.multiply(Ie.multiply(t,-1),1-Math.sin(h)),Ie.multiply(r.other,-1)),u=i;e[i]={thicknessDirection:s.thicknessDirection,normal:a,edge:l};const c=e[i];i+=1,r.vertices.push({index:u,vertex:c})}}for(let t=0;t{let i=t.CV.FE.get(e);return i||(i=void 0!==e&&e>0?new Np(t,kt(e,0,1)):new Bp(t),t.CV.FE.set(e,i),i)};class Wp extends Em{Om(t){return this.$E=this.Bm._(),this.Bm.M(t),this}lS(t){return this.FU=t,this}uS(){return this.FU}}class Yp extends Wp{constructor(t,e,i,s,n){super(t,e,i),this.IU=t,this.yO=s,this.SO=n,this.aO=t.aO,this.zL=this.aO.uO()}dO(t){return t===this.yO&&{}}}class Hp extends Yp{constructor(t,e,i,s,n){super(t,e,i,s,n),this.FU="cull-back",this.ol=ze,this.PU={},this.DU=[],this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStyleIndividual:()=>W(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be}),this.be=Tn.fillStyle,this.Bm.M(Gr)}Ds(t){const e=this.DU,i=this.be,s=i!==V,n=this.BU,r=this.ga()||this.LU!==n,o=this.HE(),a=this.jo._(),h=this.jo.o;if(s){for(const t of e)t.id=void 0!==t.id?String(t.id):void 0,t.xSize=void 0!==t.xSize&&t.xSize<0?-t.xSize:t.xSize,t.ySize=void 0!==t.ySize&&t.ySize<0?-t.ySize:t.ySize,t.zSize=void 0!==t.zSize&&t.zSize<0?-t.zSize:t.zSize;const t=11,s=this.RU||0;let n=s;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.PU[e]||(n+=1)}let l,u=!1,c=!1;if(u=n!==s,c=u,l=!c&&(e.length<100?"chunks":"all"),u){const e=n*t,i=new Float32Array(e);this.PG&&i.set(this.PG),this.PG=i,this.EU=e,this.VU=s*t}const d=W(i)?i.getFallbackColor():void 0;for(const i of e){const e=i.id,s=void 0!==e&&this.PU[e],n=[i.xCenter,i.yCenter,i.zCenter,i.xSize,i.ySize,i.zSize,i.color?i.color.r:d?d.r:void 0,i.color?i.color.g:d?d.g:void 0,i.color?i.color.b:d?d.b:void 0,i.color?i.color.a:d?d.a:void 0,i.value];if(s){for(let e=0;e0){const e=m({x:_e,y:_e,z:_e},{x:Fe,y:Fe,z:Fe});for(let i=0;ir?e.max.x:r,e.max.y=e.max.y>l?e.max.y:l,e.max.z=e.max.z>f?e.max.z:f}this.ol=e}this.RU=n,this.DU.length=0}return this.Sa(i),this.LU=n,this.Bm.o=!1,this.jo.o=!1,this}yL(t){const e=1===t?this.AU:this.gR,i=this.zU,s=this.cN,n=this.be,r=this.RU,o=this.Bm._();return e&&s&&void 0!==r&&this.zL.lV(e,((a,h,l)=>{let u=!1;const c=h("aPos"),d=h("aOffsetAxis");this.zL.JL(e).DV(a("uScale"),this.IU.dR.gV()).DV(a("uDisp"),this.IU.dR.pV()).LV(a("uViewProjectionMatrix"),this.NU).fV(a("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(a("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(a("uRenderEffectMask"),2===t?1:0);const f={location:c,size:3},g={location:d,size:3},m={location:void 0,size:4};if(1!==t&&"phong"===o.type&&this.zL.DV(a("uCameraLoc"),this.GU).DV(a("uLightLoc"),this.WU).fV(a("uAmbientReflection"),o.ambientReflection).fV(a("uSpecularReflection"),o.specularReflection).fV(a("uDiffuseReflection"),o.diffuseReflection).fV(a("uShininess"),o.shininess).AV(a("uLightColor"),o.specularColor).AV(a("uAmbientColor"),o.ambientColor),1===t)this.zL.AV(a("uColor"),this.SO);else if(G(n))this.zL.AV(a("uColorDiffuse"),n.getColor());else if(W(n)){const t=h("aColor");m.location=t}else if(H(n)){const t=pg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.zL.Ez(l,n.lut,t)}return s&&(this.zL.uV(s,1,f,g,m,{location:void 0,size:1}),i.Pp(l,r,"phong"===o.type&&1!==t,!1),u=!0),u})),this}dispose(){return super.dispose(),this.cN&&(this.zL.SV(this.cN),this.cN=void 0),this.gR=void 0,this}GL(){return this.dispose(),this}Zm(t){this.DU=se(this.DU,t,{canReturnB:!0})}ke(t){return this.be=Xn(this.be,t),this}Lh(){return this.be}Xm(t){return this.BU=void 0!==t&&t>0?kt(t,0,1):void 0,this}OU(){return this.BU}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Wm(){return this.ol.max.z}Um(){return this.ol.min.z}Vl(){return 0}zl(){return 0}Ym(){return 0}ga(){return jn(this.pa,this.be)}Sa(t){this.pa=t}}class Xp extends bm{constructor(t,e){super(t),this.wU="custom",this.lN=e;const{vertices:i,drawSize:s}=this.uN();this.cN=t.oV(i),this.fN=s}JL(t){return this.zL.uV(this.cN,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Pp(t){return this.zL.KV(this.zL.gl.TRIANGLE_STRIP,0,this.fN,t),this}uN(){const t=this.lN,e=new Float32Array(2*(t+1)*3);let i=0;for(let s=0;s<=t;s+=1){const n=2*Math.PI*s/t,r=Math.cos(n),o=Math.sin(n);for(const t of[0,1])e[i+0]=t,e[i+1]=r,e[i+2]=o,i+=3}return{vertices:e,drawSize:i/3}}IE(){this.zL.SV(this.cN)}}const jp=(t,e=16)=>{let i=t.CV.kE.get(e);return i||(i=new Xp(t,e),t.CV.kE.set(e,i),i)};class $p extends Yp{constructor(t,e,i,s,n){super(t,e,i,s,n),this.FU="cull-back",this.UU=ze,this.YU=[],this.HU=!1,this.Cu=Tn.lineStyle,this.Bm.M(Nr)}Ds(t){const e=this.HU,i=this.Cu,s=this.Tu!==i,n=this.HE(),r=e;if(e){const t=Jt(this.YU);this.$U=this.zL.oV(t,!1,this.$U)}if(r&&(this.UU=$e(this.YU)),s||n){const t=8,e=Ji(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.MN=void 0,G(e)&&("primitive"===s?this.MN={type:s,shader:this.zL.cE(Wg["3D"],Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}),Wg.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.MN={type:s,shader:this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:"uniform",shadingStyle:this.Bm._().type}),Wg.LineInstanced3D({axisWorldTranslation:gg(this.dt)})),geometry:jp(this.zL,t),fillStyle:e}))}return this.HU=!1,this.Tu=i,this.Bm.o=!1,this}yL(t){if(1===t)return this;const e=this.zL.gl,i=this.MN,s=this.$U,n=this.Cu,r=this.Bm._();if(i&&s&&Ji(n))switch(i.type){case"instanced":{const o=.5*this.Ts.bm(n.thickness),a=i.fillStyle.getColor(),h=i.shader,l=i.geometry;this.zL.lV(h,((i,n,u)=>{this.zL.JL(h).DV(i("uScale"),this.IU.dR.gV()).DV(i("uDisp"),this.IU.dR.pV()).LV(i("uViewProjectionMatrix"),this.NU).AV(i("uColorDiffuse"),a).fV(i("uOffsetWU"),o).fV(i("uIsHighlighted"),this.Ko).AV(i("uHighlightColorOffset"),2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0),"phong"===r.type&&this.zL.DV(i("uCameraLoc"),this.GU).DV(i("uLightLoc"),this.WU).fV(i("uAmbientReflection"),r.ambientReflection).fV(i("uSpecularReflection"),r.specularReflection).fV(i("uDiffuseReflection"),r.diffuseReflection).fV(i("uShininess"),r.shininess).AV(i("uLightColor"),r.specularColor).AV(i("uAmbientColor"),r.ambientColor),e.bindBuffer(e.ARRAY_BUFFER,s);const c=n("aLocationA"),d=n("aLocationB");return e.vertexAttribPointer(c,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(c,1),e.enableVertexAttribArray(c),e.vertexAttribPointer(d,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(d,1),e.enableVertexAttribArray(d),l.JL(u).Pp(this.YU.length/2),!0}));break}case"primitive":{const r=Ji(n)?n.getFillStyle():void 0,o=r&&G(r)?r.getColor():void 0;if(o){const n=i.shader;this.zL.lV(n,((i,r)=>(this.zL.JL(n).DV(i("uScale"),this.IU.dR.gV()).DV(i("uDisp"),this.IU.dR.pV()).LV(i("uViewProjectionMatrix"),this.NU).AV(i("uColor"),o).fV(i("uIsHighlighted"),this.Ko).AV(i("uHighlightColorOffset"),2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0).uV(s,void 0,{location:r("aPos"),size:3}).Pp(e.LINES,this.YU.length),!0)))}break}}return this}_l(t){for(let e=0;e{const l=e*n,u=Math.PI/2-t*r,c=Math.cos(u),d=c*Math.cos(l),f=c*Math.sin(l),g=Math.sin(u);i[s]=d,i[s+1]=g,i[s+2]=f,i[s+3]=o,i[s+4]=a,i[s+5]=h,s+=6};for(let i=0;i0&&(o(i,s,1,0,0),o(i,s+1,1,1,0),o(i+1,s,0,0,1)),i{this.zL.fs.oo&&s>i.length&&St.console.warn("LightningChart JS unexpected error scenario, sphere geometry buffer size mismatch.\nA point series 3D component might have missing points.\n\nThis warning can be omitted with LightningChartOptions.warnings")})),{vertices:i,drawSize:s/6}}IE(){this.zL.SV(this.cN)}}const Jp=(t,e)=>{const i=Math.round(e);i<3&&fe(0,wt);const s=i;let n=t.CV.TE.get(Array.from(t.CV.TE.keys()).find((t=>t.sectors===i&&t.stacks===s)));return n||(n=new qp(t,i,s),t.CV.TE.set({sectors:i,stacks:s},n),n)};class Kp extends Yp{constructor(t,e,i,s,n){super(t,e,i,s,n),this.FU="cull-back",this.wb=[],this.MN={},this.bG=new ep(this.wb,(t=>t.vertexBuffer&&this.zL.SV(t.vertexBuffer)),!0),this.Lu=[],this.al=0,this.ll=[],this.ul=0,this.ol=ze,this.cl=ze,this.mO=mg({lineStyleSolid:()=>{const t=this.Cu;return Ji(t)&&t},lineFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},lineFillPaletted:()=>{const t=this.Cu.getFillStyle();return H(t)&&t},jointStyleTriangulatedPoints:()=>ln(this.Qm)&&this.Qm,jointSizeTriangulated:()=>{const t=this.Qm;return ln(t)&&t.getSize()},jointFillSolid:()=>{const t=this.Qm.getFillStyle();return G(t)&&t},jointFillPaletted:()=>{const t=this.Qm.getFillStyle();return H(t)&&t},wireframeLineStyleSolid:()=>{const t=ln(this.Qm)&&this.Qm.getWireframeStyle();return Ji(t)&&t},wireframeFillSolid:()=>{const t=ln(this.Qm)&&this.Qm.getWireframeStyle(),e=t&&t.getFillStyle();return G(e)&&e}}),this.fl=!1,this.Cu=Tn.lineStyle,this.Qm=Tn.pointStyle3D,this.Bm.M(Gr),this.kG={attributesPerVertex:3,prepareRenderData:(t,e)=>Jt(t)}}Ds(t){const e=this.fl,i=this.ll,s=this.ul,n=s>0,r=this.Cu,o=r!==this.Tu,a=this.Qm,h=a!==this.ZU,l=this.HE(),u=this.jo.o,c=this.jo._();this.cl&&(this.ol=Je(this.ol,this.cl),this.cl=void 0),n&&(this.Lu=se(this.Lu,i,{canReturnB:!0}),this.al+=s);let d=i,f=s;if(e&&(this.wb.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=ze})),this.bG.fG(),d=this.Lu,f=this.al),f>0){const t=1e5,e=Math.floor(this.aO.QU/(this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.ha("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=kt(i,t,e);this.bG.lG(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:ze,vertexBuffer:this.zL.zV(t*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i))})),((t,e,i,s)=>{this.zL.OV(t.vertexBuffer,t.existingCoordinatesCount*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i)),t.existingDataPointsCount+=i-s,t.existingCoordinatesCount+=i,t.jointPointsCount+=s,t.lastDataPoint=e[i-1]}))}if(o||h||l||u){const t={},e=this.mO.lineStyleSolid(o),i=this.mO.lineFillSolid(o),s=this.mO.lineFillPaletted(o),n=i||s,a=this.mO.jointStyleTriangulatedPoints(h),l=this.mO.jointSizeTriangulated(h),u=this.mO.jointFillSolid(h),d=this.mO.jointFillPaletted(h),f=u||d,g=this.mO.wireframeLineStyleSolid(h),m=this.mO.wireframeFillSolid(h),p=r.getThickness()<0||1===r.getThickness()&&this.ha("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",y=s?["lookup",s.getLookUpProperty(),s.lut]:"uniform";if("primitive"===p&&n?t.lines={type:"primitive",fillStyleSolid:i,fillStylePaletted:s,shader:this.zL.cE(Wg["3D"],Wg.Color({dataType:y}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})),mousePicking:c?{shader:this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}))}:void 0}:"instanced"===p&&e&&n&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:i,fillStylePaletted:s,shader:this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:y,shadingStyle:this.Bm._().type}),Wg.LineInstanced3D({axisWorldTranslation:gg(this.dt)})),geometry:Zp(this.zL,e.getThickness()),mousePicking:c?{shader:this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.LineInstanced3D({axisWorldTranslation:gg(this.dt)}))}:void 0}),t.markers=void 0,f&&a){const e=ee(a.getShape(),{cube:()=>Gp(this.zL),sphere:()=>Qp(this.zL,a)});t.markers={geometry:e,pointStyle:a,pointSizeNWU:"number"==typeof l&&l,pointSizeAxis:"object"==typeof l&&l,fillStyleSolid:u,fillStylePaletted:d,shader:this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty(),d.lut]:"uniform",shadingStyle:this.Bm._().type,wireframe:!1!==m}),Wg.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:gg(this.dt),normalSource:e.wU})),mousePicking:c?{shader:this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:gg(this.dt),normalSource:void 0}))}:void 0,wireframe:g&&m&&{thickness:g.getThickness(),fillStyleSolid:m}}}this.MN=t}return this.fl=!1,this.ll=[],this.ul=0,this.Tu=r,this.ZU=a,this.Bm.o=!1,this.jo.o=!1,this}yL(t){var e,i;const s=this.zL.gl,{lines:n,markers:r}=this.MN,o=this.Bm._(),a=1===t?null===(e=null==n?void 0:n.mousePicking)||void 0===e?void 0:e.shader:null==n?void 0:n.shader;if(n&&a&&"instanced"===n.type){const e=a,{geometry:i,lineStyleSolid:r,fillStyleSolid:h,fillStylePaletted:l}=n;this.zL.lV(e,((n,a,u)=>{let c=!1;if(this.zL.JL(e).DV(n("uScale"),this.IU.dR.gV()).DV(n("uDisp"),this.IU.dR.pV()).LV(n("uViewProjectionMatrix"),this.NU).fV(n("uOffsetWU"),this.Ts.bm(r.getThickness())).fV(n("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(n("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.zL.DV(n("uCameraLoc"),this.GU).DV(n("uLightLoc"),this.WU).fV(n("uAmbientReflection"),o.ambientReflection).fV(n("uSpecularReflection"),o.specularReflection).fV(n("uDiffuseReflection"),o.diffuseReflection).fV(n("uShininess"),o.shininess).AV(n("uLightColor"),o.specularColor).AV(n("uAmbientColor"),o.ambientColor),1===t)this.zL.AV(n("uColor"),this.SO);else if(h)this.zL.AV(n("uColorDiffuse"),h.getColor());else if(l){const t=pg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.zL.Ez(u,l.lut,t)}return this.wb.forEach((t=>{s.bindBuffer(s.ARRAY_BUFFER,t.vertexBuffer);const e=a("aLocationA"),n=a("aLocationB");s.vertexAttribPointer(e,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(e,1),s.enableVertexAttribArray(e),s.vertexAttribPointer(n,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(n,1),s.enableVertexAttribArray(n),i.JL(u).Pp(t.existingCoordinatesCount-1),c=!0})),c}))}if(n&&a&&"primitive"===n.type){const e=a,{fillStyleSolid:i,fillStylePaletted:r}=n;this.zL.lV(e,((n,o,a)=>{let h=!1;if(this.zL.JL(e).DV(n("uScale"),this.IU.dR.gV()).DV(n("uDisp"),this.IU.dR.pV()).LV(n("uViewProjectionMatrix"),this.NU).fV(n("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(n("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(n("uRenderEffectMask"),2===t?1:0),1===t)this.zL.AV(n("uColor"),this.SO);else if(i)this.zL.AV(n("uColor"),i.getColor());else if(r){const t=pg(r,this,void 0);if(!t&&r.lut.percentageValues)return!1;this.zL.Ez(a,r.lut,t)}return this.wb.forEach((t=>{this.zL.uV(t.vertexBuffer,void 0,{location:o("aPos"),size:3}).Pp(s.LINE_STRIP,t.existingCoordinatesCount),h=!0})),h}))}const h=1===t?null===(i=null==r?void 0:r.mousePicking)||void 0===i?void 0:i.shader:null==r?void 0:r.shader;if(r&&h){const e=h,{geometry:i,fillStyleSolid:s,fillStylePaletted:n,pointSizeAxis:a,pointSizeNWU:l,wireframe:u}=r;this.zL.lV(e,((r,h,c,d)=>{let f=!1;if(this.zL.JL(e).DV(r("uScale"),this.IU.dR.gV()).DV(r("uDisp"),this.IU.dR.pV()).LV(r("uViewProjectionMatrix"),this.NU).fV(d("uRatioNwuWu"),this.IU.JU()).fV(r("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(r("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(r("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.zL.DV(r("uCameraLoc"),this.GU).DV(r("uLightLoc"),this.WU).fV(r("uAmbientReflection"),o.ambientReflection).fV(r("uSpecularReflection"),o.specularReflection).fV(r("uDiffuseReflection"),o.diffuseReflection).fV(r("uShininess"),o.shininess).AV(r("uLightColor"),o.specularColor).AV(r("uAmbientColor"),o.ambientColor),1===t)this.zL.AV(r("uColor"),this.SO);else if(s)this.zL.AV(r("uColorDiffuse"),s.getColor());else if(n){const t=pg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.zL.Ez(c,n.lut,t)}return u&&1!==t&&this.zL.fV(r("uWireframeThickness"),u.thickness).AV(r("uWireframeColor"),u.fillStyleSolid.getColor()),!1!==a&&this.zL.DV(r("uOffsetAxis"),[a.x,a.y,a.z]),!1!==l&&this.zL.fV(r("uOffsetNWU"),l),this.wb.forEach((e=>{this.zL.uV(e.vertexBuffer,1,{location:h("aPos"),size:3}),i.Pp(c,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(u)&&1!==t),f=!0})),f}))}return this}_l(t,e){Array.isArray(t)||(t=[t]),this.ll=se(this.ll,t,{canReturnB:!0}),this.ul+=t.length;const i=e||$e(t);return this.cl=this.cl?Je(this.cl,i):i,this}Ee(t){return this.Cu="function"==typeof t?t(this.Cu):t,this}ku(){return this.Cu}ym(t){return this.Qm="function"==typeof t?t(this.Qm):t,this}KU(){return this.Qm}xt(){return this.cl?Math.max(this.cl.max.x,this.ol.max.x):this.ol.max.x}vt(){return this.cl?Math.min(this.cl.min.x,this.ol.min.x):this.ol.min.x}Mt(){return this.cl?Math.max(this.cl.max.y,this.ol.max.y):this.ol.max.y}bt(){return this.cl?Math.min(this.cl.min.y,this.ol.min.y):this.ol.min.y}Wm(){return this.cl?Math.max(this.cl.max.z,this.ol.max.z):this.ol.max.z}Um(){return this.cl?Math.min(this.cl.min.z,this.ol.min.z):this.ol.min.z}Vl(){return Me(this.Cu)}zl(){return Me(this.Cu)}Ym(){return Me(this.Cu)}yl(){return this.Lu}ml(){return this.ll}wl(){return this.al}Cl(){return this.ul}Nt(){return this.fl=!0,this.Lu.length=0,this.al=0,this.ll=[],this.ul=0,this.ol=ze,this.cl=void 0,this}dispose(){return super.dispose(),this.bG.AG(),this.MN={},this}GL(){return this.dispose(),this}}const Zp=(t,e)=>jp(t,e>50?20:e>20?16:e>10?12:e>5?8:6),Qp=(t,e)=>{const i=e.getSize();return Jp(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class ty extends Yp{constructor(t,e,i,s,n){super(t,e,i,s,n),this.FU="disabled",this.qU=!1,this.tY=!1,this.iY={x:1,y:1,z:1},this.gS={x:0,y:0,z:0},this.AS={x:0,y:0,z:0},this.pS={x:0,y:0,z:0},this.mS={x:1,y:1,z:1},this.sY=ol.projectionOrthographic(-1,1,-1,1,1,-1),this.eY=ol.projectionOrthographic(-1,1,-1,1,1,-1),this.hY=!1,this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStyleValuePalette:()=>H(this.be)&&"value"===this.be.lookUpProperty&&this.be}),this.be=Tn.fillStyle,this.Bm.M(Gr)}Ds(t){var e;const i=this.HE(),s=this.jo._(),n=this.jo.o,r=this.ga();this.mO.fillStyleSolid(r);const o=this.mO.fillStyleValuePalette(r),a=this.pS,h=this.mS;if(this.qU&&this.rY&&(this.cN=this.zL.oV(this.rY.vertices,void 0,this.cN),this.dN=this.zL.GV(this.rY.indices,this.dN),this.nY=this.rY.indices.length),"phong"===this.Bm._().type&&(i||this.qU)&&(null===(e=this.rY)||void 0===e?void 0:e.normals)&&(this.oY=this.zL.oV(this.rY.normals,void 0,this.oY)),!this.aY&&o&&"value"===o.lookUpProperty&&this.rY&&(this.aY=new Float32Array(this.rY.vertices.length/3),this.tY=!0),this.aY&&this.tY&&(this.lY=this.zL.oV(this.aY,void 0,this.lY)),i||r||n){if(o&&"value"!==o.lookUpProperty)throw new Error("LightningChart JS MeshModel3D does not support look up by x/y/z. Must be value");this.gR=this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:o?["lookup","value",o.lut]:"uniform",shadingStyle:this.Bm._().type,wireframe:!1}),Wg.Model3D({normalSource:"phong"===this.Bm._().type?"attribute":void 0})),this.AU=s?this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.Model3D({normalSource:void 0})):void 0}if(this.hY){const t=ol.projectionOrthographic(-1,1,-1,1,1,-1);this.eY=ol.rotateXYZ(t,a),this.sY=ol.translate(t,h.x/2,h.y/2,h.z/2),this.sY=ol.rotateXYZ(this.sY,a),this.sY=ol.translate(this.sY,-h.x/2,-h.y/2,-h.z/2),this.hY=!1}return this.Bm.o=!1,this.Sa(this.be),this.jo.o=!1,this.qU=!1,this.tY=!1,this}yL(t){const e=1===t?this.AU:this.gR,i=1===t,s=this.dN,n=this.nY,r=this.cN,o=this.oY,a=this.lY,h=this.gS,l=this.AS,u=this.iY,c=this.mS,d=this.sY,f=this.eY,g=this.mO.fillStyleValuePalette(!1),m=this.mO.fillStyleSolid(!1),p=this.Bm._(),y={location:void 0,size:1};return e&&r&&s&&n?(this.zL.lV(e,((A,x,S,b)=>{if(this.zL.JL(e).DV(A("uScale"),this.IU.dR.gV()).DV(A("uDisp"),this.IU.dR.pV()).LV(A("uViewProjectionMatrix"),this.NU).fV(A("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(A("uHighlightColorOffset"),this.sa).fV(A("uRenderEffectMask"),2===t?1:0),i)this.zL.AV(A("uColor"),this.SO);else{if(this.be===V)return!1;if(m)this.zL.AV(A("uColorDiffuse"),m.getColor());else if(g){if(!a)return!1;const t=g.getPalette();y.location=x("aLookupValue"),this.zL.Ez(S,t,void 0).uV(a,void 0,y)}}return"phong"!==p.type||i||(this.zL.DV(A("uCameraLoc"),this.GU).DV(A("uLightLoc"),this.WU).fV(A("uAmbientReflection"),p.ambientReflection).fV(A("uSpecularReflection"),p.specularReflection).fV(A("uDiffuseReflection"),p.diffuseReflection).fV(A("uShininess"),p.shininess).AV(A("uLightColor"),p.specularColor).AV(A("uAmbientColor"),p.ambientColor).LV(A("uModelRotationNormals"),f),o&&this.zL.uV(o,void 0,{location:S.attribute("aNormal"),size:3})),this.zL.LV(A("uModelRotation"),d).DV(A("uModelScale"),[u.x,u.y,u.z]).DV(A("uLocationAxis"),[h.x,h.y,h.z]).DV(A("uModelAlignment"),[l.x,l.y,l.z]).DV(A("uModelSize"),[c.x,c.y,c.z]),this.zL.uV(r,0,{location:S.attribute("aGeoPos"),size:3}).ZV(s).JV(n,this.zL.gl.TRIANGLES),!0})),this):this}dispose(){return super.dispose(),this.cN&&(this.zL.SV(this.cN),this.cN=void 0),this.dN&&(this.zL.SV(this.dN),this.dN=void 0),this.oY&&(this.zL.SV(this.oY),this.oY=void 0),this.lY&&(this.zL.SV(this.lY),this.lY=void 0),this.gR=void 0,this.AU=void 0,this.rY=void 0,this.aY=void 0,this}GL(){return this.dispose(),this}SS(t){return this.rY=t,this.qU=!0,this.mS=t.modelSize,this}xS(t){return this.aY=t,this.tY=!0,this}ke(t){return this.be=Xn(this.be,t),this}Lh(){return this.be}bS(t){return this.iY=t,this}gV(){return this.iY}MS(t){return this.gS=t,this}_S(t){return this.AS=t,this}wS(t){return this.pS=t,this.hY=!0,this}CS(t){return this.FU=t,this}kS(){return this.FU}xt(){return Fe}vt(){return _e}Mt(){return Fe}bt(){return _e}Wm(){return Fe}Um(){return _e}Vl(){return 0}zl(){return 0}Ym(){return 0}ga(){return jn(this.pa,this.be)}Sa(t){this.pa=t}}class ey extends Yp{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.FU="cull-back",this.wb=[],this.bG=new ep(this.wb,(t=>t.vertexBuffer&&this.zL.SV(t.vertexBuffer)),!1),this.Lu=[],this.al=0,this.ll=[],this.ul=0,this.ol=ze,this.cl=ze,this.fl=!1,this.mO=mg({fillStyleSolid:()=>{const t=this.qm.getFillStyle();return G(t)&&t},fillStyleIndividual:()=>{const t=this.qm.getFillStyle();return W(t)&&t},fillStylePalette:()=>{const t=this.qm.getFillStyle();return H(t)&&t},triangulatedPointStyle:()=>{const t=this.qm;return ln(t)&&t},wireframeLineStyleSolid:()=>{const t=ln(this.qm)&&this.qm,e=t&&t.getWireframeStyle();return Ji(e)&&e},wireframeFillStyleSolid:()=>{const t=ln(this.qm)&&this.qm,e=t&&t.getWireframeStyle(),i=e&&e.getFillStyle();return G(i)&&i}}),this.Al=void 0,this.En=r,this.qm=Tn.pointStyle3D,this.Bm.M(Gr);const o=!0===(null==r?void 0:r.individualPointColorEnabled),a=!0===(null==r?void 0:r.individualPointSizeEnabled),h=!0===(null==r?void 0:r.individualLookupValuesEnabled),l=!0===(null==r?void 0:r.individualPointSizeAxisEnabled);let u,c,d,f,g=0;g+=3,o&&(u=g,g+=4),a&&(c=g,g+=1),h&&(d=g,g+=1),l&&(f=g,g+=3);const m=((t,e,i,s)=>t||e||i||s?!t||e||i||s?t||!e||i||s?t||e||!i||s?t||e||i||!s?(n,r,o)=>{const a=3+(t?4:0)+(e?1:0)+(i?1:0)+(s?3:0),h=n.length,l=new Float32Array(h*a);let u=0,c=u;for(let t=0;t((t,e)=>{const i=e&&e.getSize();let s={x:1,y:1,z:1};"object"==typeof i&&(s=i);const n=t.length,r=new Float32Array(6*n);let o=0;for(let e=0;e(t=>{const e=t.length,i=new Float32Array(4*e);for(let s=0,n=0;s((t,e)=>{const i=e&&e.getSize();let s=1;"number"==typeof i&&(s=i);const n=t.length,r=new Float32Array(4*n);for(let e=0,i=0;e((t,e)=>{const i=e&&W(e)&&e.getFallbackColor()||C,s=t.length,n=new Float32Array(7*s);for(let e=0,r=0;eJt(t))(o,a,h,l);this.kG={individualPointColorEnabled:o,individualPointSizeEnabled:a,individualLookupValuesEnabled:h,individualPointSizeAxisEnabled:l,attributesPerVertex:g,attributeOffsetCoordinate:0,attributeOffsetColor:u,attributeOffsetSize:c,attributeOffsetLookUpValue:d,attributeOffsetPointSize3D:f,prepareRenderData:(t,e)=>m(t,this.qm,this.qm.fillStyle)}}Ds(t){const e=this.fl,i=this.ll,s=this.ul,n=s>0,r=this.qm,o=this.qm!==this.uY,a=this.jo._(),h=this.jo.o,l=this.HE();this.cl&&(this.ol=Je(this.ol,this.cl),this.cl=void 0),n&&(this.Lu=se(this.Lu,i,{canReturnB:!0}),this.al+=s);let u=i,c=s;if(e&&(this.wb.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=ze})),this.bG.fG(),u=this.Lu,c=this.al),c>0){const t=Math.floor(this.aO.QU/(this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=kt(c,1e5,t);this.bG.lG(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:ze,vertexBuffer:this.zL.zV(t*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i))})),((t,e,i)=>{this.zL.OV(t.vertexBuffer,t.existingCoordinatesCount*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}const d=r.getFillStyle(),f=this.mO.fillStyleSolid(o),g=this.mO.fillStyleIndividual(o),m=this.mO.fillStylePalette(o),p=d===V&&V;if(o||l||h){let t;const e=r.getSize(),i=this.kG.individualPointColorEnabled,s=this.kG.individualPointSizeEnabled,n=this.kG.individualPointSizeAxisEnabled,h=this.kG.individualLookupValuesEnabled;if(g&&!i){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw St.alert(t),new Error(t)}if(m&&"value"===m.getLookUpProperty()&&!h){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw St.alert(t),new Error(t)}const l=this.mO.wireframeLineStyleSolid(o),u=this.mO.wireframeFillStyleSolid(o);if(f||g||m||u){const i=g?"attribute":m?["lookup",m.getLookUpProperty(),m.lut]:"uniform",o=s&&"number"==typeof e,h=n&&"object"==typeof e,c=o||h?"attribute":"uniform";if(ln(r)){const n=ee(r.getShape(),{cube:()=>Gp(this.zL),sphere:()=>iy(this.zL,r,s)});t={type:"instanced",shader:this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:i,shadingStyle:this.Bm._().type,wireframe:!1!==u}),Wg.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:gg(this.dt),normalSource:n.wU})),pointStyle:r,useIndividualPointSize:o,useIndividualPointSize3D:h,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,fillStyleEmpty:p,mousePickingShader:a&&this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:gg(this.dt),normalSource:void 0})),geometry:n,wireframe:l&&u&&{thickness:l.getThickness()<0?1:l.getThickness(),fillStyleSolid:u}}}else dn(r)&&"number"==typeof e&&(t={type:"primitive",shader:this.zL.cE(Wg["3D"],Wg.PointSize(c),Wg.Color({dataType:i}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})),pointStyle:r,pointSizePixels:e,useIndividualPointSize:o,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,mousePickingShader:a&&this.zL.cE(Wg["3D"],Wg.PointSize(c),Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}))})}this.MN=t}if(void 0===this.Al&&m&&"value"===m.lookUpProperty&&m.lut.percentageValues){let t=Fe,e=_e;for(let i=0;it&&(t=s.value)}this.Al={min:e,max:t}}return this.fl=!1,this.ll=[],this.ul=0,this.uY=r,this.Bm.o=!1,this}yL(t){const e=this.zL.gl,i=this.MN;if(!i)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const n=this.Bm._(),{fillStyleSolid:r,fillStylePaletted:o,useIndividualPointSize:a}=i,h="instanced"===i.type&&i.useIndividualPointSize3D,l="instanced"===i.type&&i.wireframe;return this.zL.lV(s,((u,c,d,f)=>{let g=!1;if(this.zL.JL(s).DV(u("uScale"),this.IU.dR.gV()).DV(u("uDisp"),this.IU.dR.pV()).LV(u("uViewProjectionMatrix"),this.NU).fV(u("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(u("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(u("uRenderEffectMask"),2===t?1:0),"instanced"===i.type){const{pointSizeAxis:t,pointSizeNWU:e}=i;!1!==t&&!1===h&&this.zL.DV(u("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===a&&this.zL.fV(u("uOffsetNWU"),e).fV(f("uRatioNwuWu"),this.IU.JU())}else if("primitive"===i.type){const{pointSizePixels:t}=i;a||this.zL.fV(u("uPointSize"),t).fV(u("uDevicePixelRatio"),this.zL.sR())}if(1===t)this.zL.AV(u("uColor"),this.SO);else if("instanced"===i.type?("phong"===n.type&&this.zL.DV(u("uCameraLoc"),this.GU).DV(u("uLightLoc"),this.WU).fV(u("uAmbientReflection"),n.ambientReflection).fV(u("uSpecularReflection"),n.specularReflection).fV(u("uDiffuseReflection"),n.diffuseReflection).fV(u("uShininess"),n.shininess).AV(u("uLightColor"),n.specularColor).AV(u("uAmbientColor"),n.ambientColor),l&&this.zL.fV(u("uWireframeThickness"),l.thickness).AV(u("uWireframeColor"),l.fillStyleSolid.getColor()),r&&this.zL.AV(u("uColorDiffuse"),r.getColor()),i.fillStyleEmpty&&this.zL.AV(u("uColorDiffuse"),D)):"primitive"===i.type&&r&&this.zL.AV(u("uColor"),r.getColor()),o){const t=pg(o,this,this.Al);if(!t&&o.lut.percentageValues)return!1;this.zL.Ez(d,o.lut,t)}return this.wb.forEach(((s,r)=>{e.bindBuffer(e.ARRAY_BUFFER,s.vertexBuffer);const o=c("aPos");if(e.vertexAttribPointer(o,3,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(o,1),e.enableVertexAttribArray(o),i.fillStyleIndividual&&void 0!==this.kG.attributeOffsetColor&&1!==t){const t=c("aColor");e.vertexAttribPointer(t,4,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(t,1),e.enableVertexAttribArray(t)}if(a&&void 0!==this.kG.attributeOffsetSize){"instanced"===i.type?this.zL.fV(f("uRatioNwuWu"),this.IU.JU()):"primitive"===i.type&&this.zL.fV(u("uDevicePixelRatio"),this.zL.sR());const t=c("instanced"===i.type?"aOffsetNWU":"aPointSize");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(t,1),e.enableVertexAttribArray(t)}if(h&&void 0!==this.kG.attributeOffsetPointSize3D&&"instanced"===i.type){const t=c("aOffsetAxis");e.vertexAttribPointer(t,3,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(t,1),e.enableVertexAttribArray(t)}if(i.fillStylePaletted&&"value"===i.fillStylePaletted.getLookUpProperty()&&void 0!==this.kG.attributeOffsetLookUpValue&&1!==t){const t=c("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(t,1),e.enableVertexAttribArray(t)}"instanced"===i.type?(i.geometry.Pp(d,s.existingCoordinatesCount,"phong"===n.type&&1!==t,Boolean(l)&&1!==t),g=!0):"primitive"===i.type&&(this.zL.Pp(e.POINTS,s.existingCoordinatesCount),g=!0)})),g})),this}_l(t,e){Array.isArray(t)||(t=[t]),this.ll=se(this.ll,t,{canReturnB:!0}),this.ul+=t.length;const i=e||$e(t);return this.cl=this.cl?Je(this.cl,i):i,this.Al=void 0,this}ty(t){return this.qm="function"==typeof t?t(this.qm):t,this}cY(){return this.qm}xt(){return this.cl?Math.max(this.cl.max.x,this.ol.max.x):this.ol.max.x}vt(){return this.cl?Math.min(this.cl.min.x,this.ol.min.x):this.ol.min.x}Mt(){return this.cl?Math.max(this.cl.max.y,this.ol.max.y):this.ol.max.y}bt(){return this.cl?Math.min(this.cl.min.y,this.ol.min.y):this.ol.min.y}Wm(){return this.cl?Math.max(this.cl.max.z,this.ol.max.z):this.ol.max.z}Um(){return this.cl?Math.min(this.cl.min.z,this.ol.min.z):this.ol.min.z}Vl(){const t=this.qm,e=t.getSize();return"number"==typeof e?ln(t)?e/2:dn(t)?5:0:0}zl(){return this.Vl()}Ym(){return this.Vl()}yl(){return this.Lu}ml(){return this.ll}wl(){return this.al}Cl(){return this.ul}Nt(){return this.fl=!0,this.Lu.length=0,this.al=0,this.ll=[],this.ul=0,this.ol=ze,this.cl=void 0,this.Al=void 0,this}dispose(){return super.dispose(),this.bG.AG(),this.MN=void 0,this}GL(){return this.dispose(),this}}const iy=(t,e,i)=>{const s=e.getSize();return Jp(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class sy extends Yp{constructor(t,e,i,s,n,r){super(t,e,i,n,r),this.FU="disabled",this.be=Tn.fillStyle,this.Ky=Tn.lineStyle,this.aW=y("bilinear"),this.dY=[],this.fY=void 0,this.MN={},this.AY=!1,this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be,wireframeStyleLine:()=>Ji(this.Ky)&&this.Ky,wireframeStyleFill:()=>{const t=this.Ky&&this.Ky.getFillStyle();return G(t)&&t}}),this.Pi={x:0,z:0},this.yw={x:1,z:1},this.Bm.M(Nr);const o="columns"===s.dataOrder?s.columns:s.rows,a="columns"===s.dataOrder?s.rows:s.columns;this.En={...s,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:a},this.gY=new Array(this.En.primaryDimensionVectorsCount).fill(void 0),this.sk=new xp(this.aO,t.aO._W,t.us.dt,wt,[],this.En,-1,C).qy(nt),this.sk.cW=fp;const h=this.sk.fW.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,n=t.iFirstUniqueVector,r=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary),o={primary:t.sizeHeatmapDataVectors.primary-1,secondary:t.sizeHeatmapDataVectors.secondary-1};return{iFirstVector:t.iFirstVector,iFirstUniqueVector:t.iFirstUniqueVector,sizeHeatmapDataVectors:t.sizeHeatmapDataVectors,sizeUniqueHeatmapDataVectors:t.sizeUniqueHeatmapDataVectors,iFirstGeometryVector:s,iFirstGeometryUniqueVector:n,sizeGeometryDataVectors:e,sizeUniqueGeometryDataVectors:i,heightmapData:r,normalmapSize:o}})),l=this.sk.fW.gridTileSizes.map((t=>{const e=h.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary)),i=e[0].sizeGeometryDataVectors;return{...t,tiles:e,sizeGeometryData:i}})),u=h.reduce(((t,e)=>{const i=e.sizeHeatmapDataVectors.primary,s=e.sizeHeatmapDataVectors.secondary,n=i*s;return n>t.cells?{primary:i,secondary:s,cells:n}:t}),{primary:0,secondary:0,cells:0});this.pY={gridTiles:h,gridTileSizes:l,largestGridTileSize:u},this.sS(this.Pi,this.yw)}mY(t){this.yY=t,this.fY=void 0}sS(t,e){this.Pi=t,this.yw=e;const i=this.En,s={min:{x:Math.min(this.Pi.x,this.Pi.x+(i.columns-1)*this.yw.x),z:Math.min(this.Pi.z,this.Pi.z+(i.rows-1)*this.yw.z)},max:{x:Math.max(this.Pi.x,this.Pi.x+(i.columns-1)*this.yw.x),z:Math.max(this.Pi.z,this.Pi.z+(i.rows-1)*this.yw.z)}},n=new Map;return this.pY.gridTiles.forEach((t=>{const e="columns"===this.En.dataOrder?{x:this.yw.x*(t.sizeHeatmapDataVectors.primary-1),z:this.yw.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.yw.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.yw.z*(t.sizeHeatmapDataVectors.primary-1)},i="columns"===this.En.dataOrder?{x:this.Pi.x+this.yw.x*t.iFirstVector.primary,z:this.Pi.z+this.yw.z*t.iFirstVector.secondary}:{x:this.Pi.x+this.yw.x*t.iFirstVector.secondary,z:this.Pi.z+this.yw.z*t.iFirstVector.primary};n.set(t,{sizeAxis:e,startLocationAxis:i})})),this.SW={SY:s,tilesInfo:n},this}eS(){return{start:this.Pi,step:this.yw,end:{x:this.Pi.x+this.yw.x*this.En.columns,z:this.Pi.z+this.yw.z*this.En.rows}}}Ds(t){const e=this.dY,i=jn(this.pa,this.be),s=this.mO.fillStyleSolid(i),n=this.mO.fillStylePaletted(i),r=this.Ky,o=this.Ky!==this.AW,a=this.mO.wireframeStyleLine(o),h=this.mO.wireframeStyleFill(o),l=!1!==h,u=this.aW.o,c=this.aW._(),d=this.Bm._(),f=this.HE(),g=this.jo._();this.sk.Ds();const m=this.sk.gW;if(!m)return this;this.vY=this.vY||this.xY(m);const p=this.vY;this.bY(p);const y=gp(e,p,void 0,(t=>t.sizeGeometryDataVectors));if(y.size>0&&(yp(this.zL,y,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.AY=!0),"phong"===d.type&&(y.size>0||f)){const t=this.zL.gl,e=this.zL.cE(Wg["2D"],Wg.DrawToNormalTexture({flipXZ:"rows"===this.En.dataOrder,vertexIdSource:this.zL.Cz(),normalTextureType:this.zL.gl2?"uint":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN}));p.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{var n;const r=s.normalmapTexture,o=null===(n=this.SW)||void 0===n?void 0:n.tilesInfo.get(s.tileData);if(!r||!o)return;const a={x:s.normalmapSize.secondary,y:s.normalmapSize.primary},h=a.x*a.y;this.zL.lz.yL((()=>{this.zL.lV(e,((n,r,a,l)=>(this.zL.JL(e).kz(a,h).cV(n("uTileDimensionsXZ"),["columns"===this.En.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.En.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).IV(n("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).cV(n("uTileStartLocationAxisXZ"),[o.startLocationAxis.x,o.startLocationAxis.z]).cV(n("uTileSizeAxisXZ"),[o.sizeAxis.x,o.sizeAxis.z]).dV(n("uHeightmapTexture"),s.heightmapDataTexture,1).Pp(t.POINTS,h),!0)))}),r,a,void 0,this.us.un(),0)}))}))}const A=this.MN;if(i||o||u){const t=a&&h?{wireframeSolid:a,wireframeFillSolid:h}:void 0;s?A.surface={shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:n&&"value"===n.getLookUpProperty()?A.surface={shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:["lookup","value",n.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:n},wireframe:t}:n?A.surface={shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:["lookup",n.getLookUpProperty(),n.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:n},wireframe:t}:l&&(A.surface={shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return A.mousePicking=g?this.MN.mousePicking||{shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:"simple",wireframe:!1,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.MN=A,this.dY.length=0,this.pa=this.be,this.AW=r,this.Bm.o=!1,this}xY(t){const e=this.pY.gridTiles.map((e=>{const i=pp(this.zL,e.sizeHeatmapDataVectors.secondary,e.sizeHeatmapDataVectors.primary),s=t.gridTiles.find((t=>t.iFirstUniqueVector.primary===e.iFirstUniqueVector.primary&&t.iFirstUniqueVector.secondary===e.iFirstUniqueVector.secondary));if(!s)throw new Error("Internal LC JS error prepare surface data 2D render data not found");return{...e,intensityDataTexture:s.intensityDataTexture,heightmapDataTexture:i,normalmap:void 0,tileData:e}})),i=this.pY.gridTileSizes.map((t=>{const i=e.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary));return{...t,tiles:i}})),s=this.zL.oV([0,0,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,0]),n=this.zL.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:n}}bY(t){var e;if("phong"===this.Bm._().type)for(let i=0;i{t.normalmapTexture&&(this.zL.WL(t.normalmapTexture),t.normalmapTexture=void 0)}))}yL(t){var e,i,s,n;const r=this.zL.gl,o=this.vY;if(!o)return this;const a=this.Bm._(),h=this.MN,l=1===t?null===(e=h.mousePicking)||void 0===e?void 0:e.shader:null===(i=h.surface)||void 0===i?void 0:i.shader;if(!l)return this;const u=1!==t?null===(s=h.surface)||void 0===s?void 0:s.wireframe:void 0,c=1!==t?null===(n=h.surface)||void 0===n?void 0:n.fill:void 0;return this.zL.lV(l,((e,i,s,n)=>{let h=!1;if(this.zL.JL(l).Fz(s,this.pY.largestGridTileSize.cells).DV(e("uScale"),this.IU.dR.gV()).DV(e("uDisp"),this.IU.dR.pV()).LV(e("uViewProjectionMatrix"),this.NU).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===a.type&&this.zL.DV(e("uCameraLoc"),this.GU).DV(e("uLightLoc"),this.WU).fV(e("uAmbientReflection"),a.ambientReflection).fV(e("uSpecularReflection"),a.specularReflection).fV(e("uDiffuseReflection"),a.diffuseReflection).fV(e("uShininess"),a.shininess).AV(e("uLightColor"),a.specularColor).AV(e("uAmbientColor"),a.ambientColor),u)){const{wireframeFillSolid:t,wireframeSolid:i}=u,s=i.getThickness()<0?1:i.getThickness();this.zL.AV(e("uWireframeColor"),t.getColor()).fV(e("uWireframeThickness"),s)}return 1===t?this.zL.AV(e("uColorDiffuse"),this.SO):"solid"===(null==c?void 0:c.fillMode)&&this.zL.AV(e("uColorDiffuse"),c.fillStyleSolid.getColor()),o.gridTileSizes.forEach((n=>{this.zL.cV(e("uTileDimensionsXZ"),["columns"===this.En.dataOrder?n.sizeHeatmapData.primary:n.sizeHeatmapData.secondary,"columns"===this.En.dataOrder?n.sizeHeatmapData.secondary:n.sizeHeatmapData.primary]).IV(e("uTileDimensions"),[n.sizeHeatmapData.primary,n.sizeHeatmapData.secondary]),n.tiles.forEach((a=>{var l;const d=null===(l=this.SW)||void 0===l?void 0:l.tilesInfo.get(a.tileData);if(!d)return;let f=0,g=(a.sizeHeatmapDataVectors.primary-1)*(a.sizeHeatmapDataVectors.secondary-1);if(this.yY){const t=this.yY.fill.iFirstPrimary,e=this.yY.fill.iFirstPrimary+this.yY.fill.amountPrimary-1,i=a.iFirstVector.primary,s=a.iFirstVector.primary+a.sizeHeatmapDataVectors.primary-1;if(i>e||sm(Math.max(t,i),Math.min(e,s)))(t,e,i,s);f=(r.min-a.iFirstVector.primary)*(n.sizeGeometryData.secondary-1),g=(r.max-r.min)*(n.sizeGeometryData.secondary-1)}if(!(f<0||g<=0)){if("intensity"===(null==c?void 0:c.fillMode)){const{fillStylePaletted:t}=c,i=this.sk.Al;this.zL.Ez(s,t.lut,i).dV(e("uTileIntensityValues"),a.intensityDataTexture,2).PV(e("uTileBoundsAxisXZ"),[d.startLocationAxis.x,d.startLocationAxis.z,d.sizeAxis.x,d.sizeAxis.z])}if("xyz"===(null==c?void 0:c.fillMode)){const{fillStylePaletted:t}=c,e="x"===t.getLookUpProperty()?{min:this.vt(),max:this.xt()}:"y"===t.getLookUpProperty()?{min:this.bt(),max:this.Mt()}:"z"===t.getLookUpProperty()?{min:this.Um(),max:this.Wm()}:void 0;if(!e&&t.lut.percentageValues)return;this.zL.Ez(s,t.lut,e)}1!==t&&"phong"===this.Bm._().type&&a.normalmapTexture&&this.zL.dV(e("uNormalmapTexture"),a.normalmapTexture,3),this.zL.uV(o.rectangleLocationsBuffer,0,{location:i("aGeoCellOffset"),size:2},{location:u?i("aTriangleBary"):void 0,size:3}).RV(e("uBaseInstance"),f).cV(e("uTileStartLocationAxisXZ"),[d.startLocationAxis.x,d.startLocationAxis.z]).cV(e("uTileSizeAxisXZ"),[d.sizeAxis.x,d.sizeAxis.z]).dV(e("uHeightmapTexture"),a.heightmapDataTexture,0).KV(o.rectangleLocationsDrawMode,0,o.rectangleLocationsDrawLength,g),h=!0,r.bindBuffer(r.ARRAY_BUFFER,null)}}))})),h})),this}dispose(){return super.dispose(),this.sk.dispose(),this.vY&&(this.vY.gridTileSizes.forEach((t=>{})),this.vY.gridTiles.forEach((t=>{this.zL.WL(t.heightmapDataTexture),t.normalmapTexture&&this.zL.WL(t.normalmapTexture)})),this.zL.SV(this.vY.rectangleLocationsBuffer),this.vY=void 0),this.MN={},this}GL(){return this.dispose(),this.sk.GL(),this}oS(t){return this.sk.oS(t),this}aS(t){this.dY.push(t),mp(this.pY.gridTiles,t,(t=>t.heightmapData));for(let e=t.startPrimary;e{for(let r=Math.max(t,n.iFirstUniqueVector.primary);r<=Math.min(e,n.iFirstUniqueVector.primary+n.sizeUniqueHeatmapDataVectors.primary-1);r+=1){const t=(r-n.iFirstUniqueVector.primary)*n.sizeHeatmapDataVectors.secondary;let e=this.gY[r];if(e)i=ie.max?s:e.max;else{e={min:_e,max:Fe},this.gY[r]=e;for(let r=0;ro?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.fY={min:i,max:s},this.fY}}class ny extends Yp{constructor(t,e,i,s,n,r){super(t,e,i,n,r),this.FU="disabled",this.xW=0,this.MW={},this.Pi={x:0,z:0},this.yw={x:1,z:1},this.En={...s,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.SY={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===s.scrollDimension?this.Pi.x+(s.columns-1)*this.yw.x:this.Pi.x,z:"columns"===s.scrollDimension?this.Pi.z+(s.rows-1)*this.yw.z:this.Pi.z}};const o=()=>({shape:new sy(this.IU,wt,this.ta,{columns:s.columns+("columns"===s.scrollDimension?1:0),rows:s.rows+("rows"===s.scrollDimension?1:0),dataOrder:s.scrollDimension,heatmapDataType:"intensity"},this.yO,this.SO).setVisible(!1),hasData:!1});this.wb=[o(),o()]}Ds(t){this.wb.forEach((e=>{e.shape.Ds(t)}));const e=this.wb.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Dt(null===(i=e.shape.sk.Al)||void 0===i?void 0:i.min,_e)),t.max=Math.max(t.max,Dt(null===(s=e.shape.sk.Al)||void 0===s?void 0:s.max,Fe)),t}),{min:_e,max:Fe}),i=this.wb.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Dt(null===(i=e.shape.fY)||void 0===i?void 0:i.min,_e)),t.max=Math.max(t.max,Dt(null===(s=e.shape.fY)||void 0===s?void 0:s.max,Fe)),t}),{min:_e,max:Fe});return this.wb.forEach((t=>{t.shape.sk.Al=e,t.shape.fY=i})),this}yL(t){return this.wb.forEach((e=>{e.hasData&&(e.shape.NU=this.NU,e.shape.GU=this.GU,e.shape.WU=this.WU,e.shape.yL(t))})),this}sS(t,e){return this.Pi=t,this.yw=e,this.wb.forEach((t=>{t.shape.sS("columns"===this.En.scrollDimension?{x:t.shape.eS().start.x,z:this.Pi.z}:{x:this.Pi.x,z:t.shape.eS().start.z},this.yw)})),"columns"===this.En.scrollDimension?(this.SY.min.z=t.z,this.SY.max.z=this.Pi.z+(this.En.rows-1)*this.yw.z):(this.SY.min.x=t.x,this.SY.max.x=this.Pi.x+(this.En.columns-1)*this.yw.x),this}eS(){return{start:this.Pi,step:this.yw}}Nt(){return this.xW=0,this.MW={},this.SY={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===this.En.scrollDimension?this.Pi.x+(this.En.columns-1)*this.yw.x:this.Pi.x,z:"columns"===this.En.scrollDimension?this.Pi.z+(this.En.rows-1)*this.yw.z:this.Pi.z}},this.wb.forEach((t=>{t.shape.setVisible(!1),t.shape.AY=!1,t.hasData=!1})),this}dS(t){var e;const i=this.wb[0],s=this.wb[1],n=t.heightMapValues?t.heightMapValues.length:null===(e=t.intensityValues)||void 0===e?void 0:e.length;let r=0;if(!n)return this;do{const e=Math.floor(this.xW/this.En.scrollDimensionSize)%this.wb.length,o=this.wb[e],a=this.xW%this.En.scrollDimensionSize,h=this.En.scrollDimensionSize-a,l=0===a,u=Math.min(h,n),c=a+u,d=a,f=d+1,g=r,m=r+u,p=this.xW>=this.En.scrollDimensionSize&&c<=this.En.scrollDimensionSize-1,y=l;l&&(o.shape.sS("columns"===this.En.scrollDimension?{x:this.Pi.x+(this.xW-1)*this.yw.x,z:this.Pi.z}:{x:this.Pi.x,z:this.Pi.z+(this.xW-1)*this.yw.z},this.yw),o.shape.setVisible(!0));const A=p?0:1,x=c+(p?1:0);o.shape.mY({fill:{iFirstPrimary:A,amountPrimary:x},wireframe:{iFirstPrimary:A,amountPrimary:x,connectNext:!1}});const S=o===i?s:i,b=c+1,v=1+this.En.scrollDimensionSize-b;S.shape.mY({fill:{iFirstPrimary:b,amountPrimary:v},wireframe:{iFirstPrimary:b,amountPrimary:v-1,connectNext:!0}});const M={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,m);let i=!1;y&&this.MW.yValues&&(i=!0,e.splice(0,0,this.MW.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.En.staticDimensionSize,values:e,type:"y"};o.shape.aS(s),o.hasData=!0,M.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,m);let i=!1;y&&this.MW.intensityValues&&(i=!0,e.splice(0,0,this.MW.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.En.staticDimensionSize,values:e,type:"intensity"};o.shape.oS(s),o.hasData=!0,M.intensityValues=e[u-1]}this.xW+=u,r+=u,this.MW=M}while(re.shape.rS(t))),this}nS(){return this.wb[0].shape.nS()}ke(t){return this.wb.forEach((e=>e.shape.ke(t))),this}Lh(){return this.wb[0].shape.Lh()}qy(t){return this.wb.forEach((e=>e.shape.qy(t))),this}hS(){return this.wb[0].shape.hS()}GL(){return this.dispose(),this.wb.forEach((t=>t.shape.GL())),this}dispose(){return super.dispose(),this.wb.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.wb.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}Om(t){return super.Om(t),this.wb.forEach((e=>e.shape.Om(t))),this}xt(){return this.SY.max.x}vt(){return this.SY.min.x}Mt(){return Math.max(this.wb[0].shape.Mt(),this.wb[1].shape.Mt())}bt(){return Math.min(this.wb[0].shape.bt(),this.wb[1].shape.bt())}Wm(){return this.SY.max.z}Um(){return this.SY.min.z}Vl(){return 0}zl(){return 0}Ym(){return 0}cs(t){return super.cs(t),this.wb.forEach((e=>e.shape.cs(t))),this}}class ry extends zp{constructor(t,e,i,s){super(t,e,i),this._Y=45,this.wY=.1,this.CY=100,this.GU=f(0,0,1),this.kY=f(0,0,-1),this.TY=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.Bm=new Or,this.dt=s}RS(){const{cellIndex:t,cellSpan:e,cellsAmount:i}=this.dt,s=e.x/i.x,n=e.y/i.y,r=t.x/i.x,o=t.y/i.y,a=this.us.oi();return{x:r*a.x,y:o*a.y,width:s*a.x,height:n*a.y}}setCameraLocation(t){return this.GU=t,this}getCameraLocation(){return this.GU}setCameraDirection(t){return this.kY=Ie.normalize(t),this}getCameraDirection(){return this.kY}setLightLocation(t){return this.WU=t,this}getLightLocation(){return this.WU}FY(){return f(this.TY[0],this.TY[1],this.TY[2])}IY(){return f(this.TY[4],this.TY[5],this.TY[6])}}class oy extends ry{constructor(t,e,i,s){super(t,e,i,s),this.dR=new _m,this.PY=!0,this.aO=t,this.gl=t.uO(),this.vU=this.gU,this.DY=this.us.Go((()=>{this.PY=!0})),this.BY=s.U((()=>{this.PY=!0}))}nV(t){const e=t.vt(),i=t.bt(),s=t.Um(),n=t.xt(),r=t.Mt(),o=t.Wm();if(e===_e||n===Fe||i===_e||r===Fe||s===_e||o===Fe)return Le;const a=t.Vl(),h=t.zl(),l=t.Ym(),u=Math.abs(t.Ts.bm(a)*t.dt.x.et()),c=Math.abs(t.Ts.bm(h)*t.dt.y.et()),d=Math.abs(t.Ts.bm(l)*t.dt.z.et()),f=e-u,g=n+u,m=i-c,p=r+c,y=s-d,A=o+d;let x;return[{x:f,y:m,z:y},{x:g,y:m,z:y},{x:f,y:p,z:y},{x:g,y:p,z:y},{x:f,y:m,z:A},{x:g,y:m,z:A},{x:f,y:p,z:A},{x:g,y:p,z:A}].map((e=>t.Ts._m(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};x=x?qe(x,{min:t,max:t}):e})),x||Le}xU(t){const e=Array.from(this.vU.values());for(let i=0;ige()));const{viewProjectionMatrix:s}=this.LY();this.RY();const n=[t.x,t.y,t.z],r=[e.x,e.y,e.z];return this.gU.forEach((t=>{t.NU=s,t.GU=n,t.WU=r,t.Ds(i)})),this}LY(){if(!this.PY&&this.NU)return{viewProjectionMatrix:this.NU};const t=this.RS(),e=t.width/t.height;this.EY=ol.projectionPerspective(this._Y,e,this.wY,this.CY);const i=this.GU;this.TY[12]=i.x,this.TY[13]=i.y,this.TY[14]=i.z;const s=this.kY,n=f(0,1,0),r=Ie.multiply(s,-1),o=Ie.normalize(Ie.cross(n,r)),a=Ie.normalize(Ie.cross(r,o));this.TY[0]=o.x,this.TY[1]=o.y,this.TY[2]=o.z,this.TY[4]=a.x,this.TY[5]=a.y,this.TY[6]=a.z,this.TY[8]=r.x,this.TY[9]=r.y,this.TY[10]=r.z,this.VY=ol.inverse(this.TY);const{cellIndex:h,cellSpan:l,cellsAmount:u}=this.dt,c=l.x/u.x,d=l.y/u.y,g=(h.x+l.x/2)/u.x,m=(h.y+l.y/2)/u.y,p=ol.multiply(ol.translation(Fr(-1,1,g),Fr(-1,1,m),0),ol.scaling(c,d,1));return this.NU=ol.multiply(p,ol.multiply(this.EY,this.VY)),this.zY=ol.inverse(this.NU),this.PY=!1,{viewProjectionMatrix:this.NU}}RY(){this.dR.iO(this.dt.x),this.dR.sO(this.dt.y),this.dR.eO(this.dt.z)}yL(t,e){const i=this.gl.sR(),s=this.RS(),n={x:s.x*i*e,y:s.y*i*e,width:s.width*i*e,height:s.height*i*e};return this.gl.rV(n.x,n.y,n.width,n.height),this.gU.forEach((e=>{e.getVisible()&&(this.gl.qE(e.FU),1!==t&&this.gl.Nm(e.Rm),(1!==t||e.getMouseInteractions())&&e.yL(t))})),this.gl.qE("disabled"),this.gl.Nm(!1),this.gl.tV(!1),this}setCameraLocation(t){return this.GU.x===t.x&&this.GU.y===t.y&&this.GU.z===t.z||(this.PY=!0),super.setCameraLocation(t),this}setCameraDirection(t){return this.kY.x===t.x&&this.kY.y===t.y&&this.kY.z===t.z||(this.PY=!0),super.setCameraDirection(t),this}W(){super.W(),this.us.Wo(this.DY),this.dt.Y(this.BY)}Oc(t){const e=this.aO.bU();return this.pU(new ey(this,this.mU,[],e,this.aO.MU(e),t))}zp(t){const e=this.aO.bU();return this.pU(new Kp(this,this.mU,t,e,this.aO.MU(e)))}jm(){const t=this.aO.bU();return this.pU(new Hp(this,this.mU,[],t,this.aO.MU(t)))}yS(){const t=this.aO.bU();return this.pU(new ty(this,this.mU,[],t,this.aO.MU(t)))}_A(){const t=this.aO.bU();return this.pU(new $p(this,this.mU,[],t,this.aO.MU(t)))}tS(t){const e=this.aO.bU();return this.pU(new sy(this,this.mU,[],t,e,this.aO.MU(e)))}cS(t){const e=this.aO.bU();return this.pU(new ny(this,this.mU,[],t,e,this.aO.MU(e)))}}class ay extends wn{constructor(t,e,i,s=Cm){var n;if(super(t,e,i),this.X=c(1,1),this.OY=!1,this.NY=0,this.GY=!0,this.WY=0,this.QU=8388608,this.QR=[null,null],this.UY=null,this.YY=null,this.HY=0,this.RA=!1,this.$Y=0,this.bs=(t=!1)=>(this.$i||this.rn||this.jY()||(t&&(this.OY=!0),this.Jr=!0,this.ZY||this.Yr.uE(t)),this),this.ZY=!1,this.gE=t=>{if(this.$i||this.rn)return;const e=t-this.NY;if(e>=this.do||-1===this.do){this.ZY=!0,this.NY=t,this.OY=!1;const i=e>50?1e3/60:e;this.Kr&&this.Kr(i),this.Jr=!1,-1!==this.do&&this.OY&&(this.Yr.uE(this.OY),this.Jr=!0),this.ls.Ds(e),this.dn(),this.fn(),this.qr&&this.qr(),this.ZY=!1,this.D.emit("render"),this.Jr&&this.bs(this.OY)}else this.Jr=!0,this.Yr.uE()},this.QY=new Map,this.uO=()=>this.zL,this.JY=()=>{var t,e,i;const s=this.Bn(),n=this.GY,r=St.performance.now(),o=null===(t=this.KY)||void 0===t?void 0:t.qY.reduce(((t,e)=>t?e.tH&&t.tH&&e.tH>t.tH?e:t:e),void 0),a=null==o?void 0:o.tH,h=null===(e=this.Cn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.Vo)||void 0===i?void 0:i.timeStamp;return n?(this.bs(!0),!1):void 0===o||(void 0===o||!o.iH)&&(void 0!==l&&void 0!==a&&l>a||(void 0!==a&&void 0===s?r-a>=1e3:!(void 0!==a&&void 0!==h&&r-h>=2e3)||r-a>=1e3))},this.sH=()=>{var t,e;this.eH=void 0;const i=null===(e=null===(t=this.KY)||void 0===t?void 0:t.hH)||void 0===e?void 0:e.rH;void 0===i||i>=this.WY||this.nH()},this.fn=()=>{if(this.$i||this.rn)return this;const t=this.zL.gl,e=St.performance.now();this.zL.eV(t.FRAMEBUFFER,this.Yr.hE?this.QR[0]:null);const i=this.X,s=i.x>0&&i.y>0;if(this.ln.o&&this.zL.iz(this.ln._()),t.resize&&s&&t.resize(i.x*this.zL.sR(),i.y*this.zL.sR()),this.zL.hV(0,0,i.x*this.zL.sR(),i.y*this.zL.sR()),this.zL.rV(0,0,i.x*this.zL.sR(),i.y*this.zL.sR()),this.zL.Nt(),s)for(const t of this.jr.values())t.yL(0,1);if(this.En.lo&&s&&(this.eH&&(St.clearTimeout(this.eH),this.eH=void 0),this.JY()?(this.nH(),this.zL.eV(t.FRAMEBUFFER,this.Yr.hE?this.QR[0]:null)):this.eH=St.setTimeout(this.sH,500)),this.j(),this.Wr(),this.yn&&this.mn(this.yn),this.Yr.hE){const e=this.zL.gl2.ctx;e.bindFramebuffer(e.READ_FRAMEBUFFER,this.QR[0]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.QR[1]),e.clearBufferfv(e.COLOR,0,[1,1,1,1]),e.blitFramebuffer(0,0,this.X.x*this.zL.sR(),this.X.y*this.zL.sR(),0,0,this.X.x*this.zL.sR(),this.X.y*this.zL.sR(),t.COLOR_BUFFER_BIT,t.LINEAR)}else t.bindTexture(t.TEXTURE_2D,this.YR),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,this.X.x*this.zL.sR(),this.X.y*this.zL.sR(),0),t.bindTexture(t.TEXTURE_2D,null);return this.zL.eV(t.FRAMEBUFFER,null),this.Yr.uE(),this.GY=!1,this.WY=e,this},this.dn=()=>{const t=this.X;if(0===t.x||0===t.y)return this;this.Mo.q(t);for(const t of this.jr.values())t.Ds();return this.j(),this},this.oH=1,this.Yr=t,this.Yr.sE){this.aH=St.document.createElement("canvas"),this.aH.style.width="100%",this.aH.style.height="100%",this.aH.style.display="block",this.aH.style.boxSizing="content-box",this.aH.style.position="absolute";const t=this.aH.getContext("2d",{willReadFrequently:!1,alpha:!0,desynchronized:!1});if(!t)throw new gt("No Canvas context available.");this.HR=t,this.Rr.appendChild(this.aH)}this.Yr.yE(this);const r={preserveDrawingBuffer:!0,antialias:e?e.antialias:void 0,alpha:!0,lineAntialias:!e||(!0===e.lineAntiAlias||!1===e.lineAntiAlias?e.lineAntiAlias:!1!==e.antialias)};let o;if(this.Yr.hE&&t.gl2&&(o=new s(this,this.En,{type:"webgl2",ctx:t.gl2.ctx,antialias:r.antialias,lineAntialias:r.lineAntialias},this.qi.isDark)),o||this.Yr.hE||(o=new s(this,this.En,{type:"webgl1",ctx:t.gl,antialias:r.antialias,lineAntialias:r.lineAntialias},this.qi.isDark)),!o)throw new gt("No WebGL context available."+((null===(n=null==e?void 0:e.webgl)||void 0===n?void 0:n.version)?`\nSelected explicit target: ${e.webgl.version}`:""));this.zL=o;let a=1;if(e&&e.devicePixelRatio)a=!0===e.devicePixelRatio?St.devicePixelRatio||1:e.devicePixelRatio||1;else{const t=St.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(a=St.devicePixelRatio||1)}this.zL.Az(a);const h=e?e.width:void 0,l=e?e.height:void 0;this.vo=this.lH(h),this.bo=this.lH(l),this.uH(this.vo,this.bo),this._W=this.nI("engine offscreen",1e6),this.cH=this.nI("engine bg",0);const u="function"==typeof this.qi.lcjsBackgroundFillStyle?this.qi.lcjsBackgroundFillStyle(this.En.Xs):this.qi.lcjsBackgroundFillStyle;this.Mo=this.cH.Te(this.dt).ke(u).Ce(this.qi.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Ie({x:0,y:0});const d=this.nI("engine effects",200001)._U(this.qi.effect);this.es=d;const f=this.Yr.hE,g=this.oi();f&&(this.QR=[o.bV(),o.bV()]);const m=this.zL.gl;f&&(this.UY=m.createRenderbuffer(),this.YY=m.createRenderbuffer()),this.YR=m.createTexture();const p=g.x*this.zL.sR(),y=g.y*this.zL.sR();if(f){m.bindRenderbuffer(m.RENDERBUFFER,this.UY);const t=this.zL.gl2.ctx;this.HY=this.Yr.RR&&!1!==e.antialias?t.getParameter(t.MAX_SAMPLES):0,t.renderbufferStorageMultisample(t.RENDERBUFFER,this.HY,t.RGBA8,p,y),m.bindRenderbuffer(m.RENDERBUFFER,this.YY),m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,p,y),t.renderbufferStorageMultisample(t.RENDERBUFFER,this.HY,t.DEPTH_COMPONENT16,p,y)}f&&(this.zL.eV(m.FRAMEBUFFER,this.QR[0]),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.RENDERBUFFER,this.UY),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,this.YY)),m.bindTexture(m.TEXTURE_2D,this.YR),m.texImage2D(m.TEXTURE_2D,0,m.RGBA,p,y,0,m.RGBA,m.UNSIGNED_BYTE,null),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.LINEAR),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),f&&(this.zL.eV(m.FRAMEBUFFER,this.QR[1]),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.TEXTURE_2D,this.YR,0)),this.zL.eV(m.FRAMEBUFFER,null),this.nn(),this.Wr(),this.WA=xn(this),this.UA={qi:this.qi,ls:this.ls,dt:this.dt,bs:t=>this.bs(t),Bn:()=>this.Bn(),WD:t=>this.WD(t),En:this.En,As:t=>this.As(t),es:this.es,$o:t=>this.$o(t),Xo:t=>this.Xo(t),kB:{CB:(t,e,i)=>this.zL.Eh(e.family).qL(t,e,i,this.qi.isDark)}};const A=()=>{this.W()};St.addEventListener("unload",A),this.tn.push((()=>{St.removeEventListener("unload",A)}))}get dH(){return this.jr}Hr(t,e){let i=this.QY.get(t);if(!i){const e=this.zL.vz(t),s=new Set,n=t=>{s.add(t)},r=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.QY.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:n,handleInstanceDisposed:r,sharedEngineReference:{UD:()=>e.RE,YD:t=>{e.RE?t():o.push(t)}}},this.QY.set(t,i),e.JL(this),e.WE((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new Qr(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}WD(t){const e=Array.from(this.QY.values()).find((e=>e.instances.has(t)));if(!e)throw fe(0,(()=>new Error("LightningChart JS error, attempted to use Icon that is disposed. Please check that you are not disposing an Icon that is still in use, or attempting to use a previously disposed Icon!")));return e.sharedEngineReference}Sn(t,e){var i;const s=null===(i=this.KY)||void 0===i?void 0:i.hH;if(!s)return;const n=this.De(e.x,e.y),r=Math.round(n.x*this.zL.sR()),o=Math.round(n.y*this.zL.sR());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.fH(s,r+t[0]/s.AH,o+t[1]/s.AH))).reduce(((t,e)=>{if(void 0===e)return t||void 0;const i=1e6*e.layerIndex+e.entityIndex;return!t||i>t.zIndexForComparison?{zIndexForComparison:i,entity:e.entity,collectionMember:e.collectionMember}:t}),void 0)}fH(t,e,i){const s=Math.round(e*t.AH),n=Math.round(i*t.AH);if(s<0||s>=t.X.x||n<0||n>=t.X.y)return;const r=4*(s+n*t.X.x),o=t.gH[r+0],a=t.gH[r+1],h=t.gH[r+2],l=t.gH[r+3];return void 0!==o&&void 0!==a&&void 0!==h&&void 0!==l?this.pH(o,a,h,l):void 0}Or(t,e,i){const s=this.zL.gl;this.Yr.hE?(this.zL.eV(s.FRAMEBUFFER,this.QR[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.YR,0)):this.zL.eV(s.FRAMEBUFFER,null);const n=this.UR(),r=n.x,o=n.y,a=new Uint8Array(r*o*4);this.Yr.hE||this.fn(),s.readPixels(0,0,r,o,s.RGBA,s.UNSIGNED_BYTE,a);const h=new ImageData(new Uint8ClampedArray(a),r,o),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)throw new Error("Failed to create 2D context for saving image.");l.width=r,l.height=o,u.putImageData(h,0,0),u.translate(0,o),u.scale(1,-1),u.drawImage(l,0,0),this.Yr.hE&&(this.zL.eV(s.FRAMEBUFFER,this.QR[0]),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,this.UY),this.zL.eV(s.FRAMEBUFFER,this.QR[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.YR,0)),this.zL.eV(s.FRAMEBUFFER,null);const c=l.toDataURL(t,e);return i?c:(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=St.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof Rp))throw new Error("Unexpected Engine Layer error");return i}return this.An(new Rp(this,e,t))}lI(t,e,i){const s=this.ko(e);if(s){if(fe(0,(()=>{})),!(s instanceof oy))throw new Error("Unexpected Engine Layer error");return s}return this.An(new oy(this,e,t,i))}oi(){return this.X}UR(){const t=this.zL.sR();return{x:Math.round(this.X.x*t),y:Math.round(this.X.y*t)}}lH(t){return t instanceof Array||(t=[t,t]),t}mH(){return this.Yr.$R}jY(){const t=this.zL.gl;return t&&"resize"in t}nH(){var t;const e=this.zL.gl,i=St.performance.now(),s=this.Bn(),n=this.En.ao,r={x:Math.ceil(this.X.x*this.zL.sR()*n),y:Math.ceil(this.X.y*this.zL.sR()*n)};this.KY||(this.KY={AH:n,yH:r,qY:[],hH:void 0});let o=this.KY.qY.find((t=>!t.iH)),a=!1;o||(a=!0,o={iH:!1,X:r,Bz:e.createTexture(),SH:this.zL.bV(),YY:this.zL.MV(),vH:new Uint8Array,tH:void 0},this.KY.qY.push(o));const h=o;(a||h.X.x!==r.x||h.X.y!==r.y)&&(e.bindTexture(e.TEXTURE_2D,h.Bz),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r.x,r.y,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),this.zL.eV(e.FRAMEBUFFER,h.SH),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,h.Bz,0),e.bindRenderbuffer(e.RENDERBUFFER,h.YY),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,r.x,r.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,h.YY),h.vH=new Uint8Array(r.x*r.y*4),h.X=r),h.iH=!0,h.tH=i,this.zL.eV(e.FRAMEBUFFER,h.SH),e.clearDepth(1),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.disable(e.BLEND),e.resize&&e.resize(r.x,r.y),this.zL.hV(0,0,r.x,r.y);for(const t of this.jr.values())t.yL(1,n);this.zL.eV(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.zL.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.KY){const t=this.KY.hH;if(t&&t.rH>i)return;this.KY.hH={rH:i,AH:n,X:r,gH:h.vH,xH:s}}};l?this.zL.Iz(l,h.SH,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.vH).then((()=>{this.$i||(h.iH=!1,u())})).catch((t=>{this.$i||(h.iH=!1,St.console.warn("LightningChart JS mouse picking failed unexpectedly. This could mean that user interactions on charts are compromised.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact"))})):(this.zL.Pz(h.SH,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.vH),h.iH=!1,u())}nn(t){const e=this.X.x,i=this.X.y,s=t||{x:this.Rr.offsetWidth,y:this.Rr.offsetHeight};if(0!==s.x&&0!==s.y&&(s.x!==e||s.y!==i)){this.X=s,this.dt.x.J(0,s.x).q(s.x),this.dt.y.J(0,s.y).q(s.y);const t=s.x*this.zL.sR(),e=s.y*this.zL.sR(),i=this.zL.gl;this.Yr.sE&&this.HR&&(this.HR.canvas.width=t,this.HR.canvas.height=e);const n=this.Yr.hE;if(this.YR&&(i.bindTexture(i.TEXTURE_2D,this.YR),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null)),n){const s=this.zL.gl2.ctx;this.UY&&(i.bindRenderbuffer(i.RENDERBUFFER,this.UY),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.HY,s.RGBA8,t,e)),this.YY&&(i.bindRenderbuffer(i.RENDERBUFFER,this.YY),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_COMPONENT16,t,e),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.HY,s.DEPTH_COMPONENT16,t,e))}i.bindRenderbuffer(i.RENDERBUFFER,null),this.D.emit("resize",[this.X.x,this.X.y])}}W(){var t;super.W(),this.eH&&(St.clearTimeout(this.eH),this.eH=void 0),Array.from(this.zL.wR.entries()).forEach((([t,e])=>{e.GL(!1),this.zL.wR.delete(t)})),Array.from(this.zL.kV.values()).forEach((t=>{t.unbindResources()})),this.zL.kV.clear(),this.zL.CV.IE(),this.zL.uz.W(),this.zL.SV(this.zL.cz),this.zL.SV(this.zL.dz),this.zL.nz.forEach(((t,e)=>{this.zL.gl.deleteBuffer(e)})),this.zL.nz.clear(),this.zL.wz&&(this.zL.SV(this.zL.wz.buffer),this.zL.wz=void 0),this.zL.wV(this.QR[0]),this.zL.wV(this.QR[1]),this.zL._V(this.UY),this.zL.WL(this.YR),this.zL._V(this.YY),this.KY&&(this.KY.qY.forEach((t=>{this.zL._V(t.YY),this.zL.wV(t.SH),this.zL.WL(t.Bz)})),this.KY=void 0),this.zL.ez.forEach((t=>this.zL.SV(t))),this.QY.clear(),this.Yr.vE(this),this.aH&&(null===(t=this.aH.parentElement)||void 0===t||t.removeChild(this.aH),this.aH=void 0),this.HR&&(this.HR=void 0),this.zL.gl=void 0}bU(){const t=this.oH;return t>4294967295&&(console.warn("LightningChart JS picking ID overflow.\nThis is an unexpected error that could compromise user interactions on the chart.\nPlease report the issue to https://lightningchart.com/js-charts/docs/contact!"),this.oH=1),this.oH+=1,t}MU(t){let e=t;const i=Math.floor(e/16777216);e-=16777216*i;const s=Math.floor(e/65536);e-=65536*s;const n=Math.floor(e/256);return e-=256*n,T(i,s,n,e)}pH(t,e,i,s){if(0===t&&0===e&&0===i&&0===s)return;const n=16777216*t+65536*e+256*i+s;for(const t of this.dH.values()){const e=t.xU(n);if(e)return{entity:e.entity,collectionMember:e.collectionMember,entityIndex:e.index,layerIndex:t.gn()}}}}var hy="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},ly={exports:{}};!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function s(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function n(t,e,i){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this.GE(t||0,e||10,i||"be"))}var r;"object"==typeof ly?ly.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{r=(void 0).Buffer}catch(t){}function o(t,e,s){for(var n=0,r=Math.min(t.length,s),o=0,a=e;a=49&&l<=54?l-49+10:l>=17&&l<=22?l-17+10:l,o|=h}return i(!(240&o),"Invalid character in "+t),n}function a(t,e,s,n){for(var r=0,o=0,a=Math.min(t.length,s),h=e;h=49?l-49+10:l>=17?l-17+10:l,i(l>=0&&o0?t:e},n.min=function(t,e){return t.cmp(e)<0?t:e},n.prototype.GE=function(t,e,s){if("number"==typeof t)return this.bH(t,e,s);if("object"==typeof t)return this.MH(t,e,s);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._H(t,n):this.wH(t,e,n),"-"===t[0]&&(this.negative=1),this.CH(),"le"===s&&this.MH(this.toArray(),e,s)},n.prototype.bH=function(t,e,s){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===s&&this.MH(this.toArray(),e,s)},n.prototype.MH=function(t,e,s){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[r]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,r++);else if("le"===s)for(n=0,r=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,r++);return this.CH()},n.prototype._H=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=6)n=o(t,i,i+6),this.words[s]|=n<>>26-r&4194303,(r+=24)>=26&&(r-=26,s++);i+6!==e&&(n=o(t,e,i+6),this.words[s]|=n<>>26-r&4194303),this.CH()},n.prototype.wH=function(t,e,i){this.words=[0],this.length=1;for(var s=0,n=1;n<=67108863;n*=e)s++;s--,n=n/e|0;for(var r=t.length-i,o=r%s,h=Math.min(r,r-o)+i,l=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this.IH()},n.prototype.IH=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){n.prototype.inspect=l}else n.prototype.inspect=l;function l(){return(this.red?""}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,i){i.negative=e.negative^t.negative;var s=t.length+e.length|0;i.length=s,s=s-1|0;var n=0|t.words[0],r=0|e.words[0],o=n*r,a=67108863&o,h=o/67108864|0;i.words[0]=a;for(var l=1;l>>26,c=67108863&h,d=Math.min(l,e.length-1),f=Math.max(0,l-t.length+1);f<=d;f++){var g=l-f|0;u+=(o=(n=0|t.words[g])*(r=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[l]=0|c,h=0|u}return 0!==h?i.words[l]=0|h:i.length--,i.CH()}n.prototype.toString=function(t,e){var s;if(e=0|e||1,16===(t=t||10)||"hex"===t){s="";for(var n=0,r=0,o=0;o>>24-n&16777215)||o!==this.length-1?u[6-h.length]+h+s:h+s,(n+=2)>=26&&(n-=26,o--)}for(0!==r&&(s=r.toString(16)+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],f=d[t];s="";var g=this.clone();for(g.negative=0;!g.isZero();){var m=g.modrn(f).toString(t);s=(g=g.idivn(f)).isZero()?m+s:u[l-m.length]+m+s}for(this.isZero()&&(s="0"+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},r&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(r,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},n.prototype.toArrayLike=function(t,e,s){this.CH();var n=this.byteLength(),r=s||Math.max(1,n);i(n<=r,"byte array longer than desired length"),i(r>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,r);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,n),o},n.prototype.PH=function(t,e){for(var i=0,s=0,n=0,r=0;n>8&255),i>16&255),6===r?(i>24&255),s=0,r=0):(s=o>>>24,r+=2)}if(i=0&&(t[i--]=o>>8&255),i>=0&&(t[i--]=o>>16&255),6===r?(i>=0&&(t[i--]=o>>24&255),s=0,r=0):(s=o>>>24,r+=2)}if(i>=0)for(t[i--]=s;i>=0;)t[i--]=0},Math.clz32?n.prototype.BH=function(t){return 32-Math.clz32(t)}:n.prototype.BH=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},n.prototype.LH=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this.BH(t);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var s=0;st.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),s=t%26;this.FH(e),s>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-s),this.CH()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var s=t/26|0,n=t%26;return this.FH(s+1),this.words[s]=e?this.words[s]|1<t.length?(i=this,s=t):(i=t,s=this);for(var n=0,r=0;r>>26;for(;0!==n&&r>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;rt.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e.IH()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.IH();var i,s,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,s=t):(i=t,s=this);for(var r=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==r&&o>26,this.words[o]=67108863&e;if(0===r&&o>>13,f=0|o[1],g=8191&f,m=f>>>13,p=0|o[2],y=8191&p,A=p>>>13,x=0|o[3],S=8191&x,b=x>>>13,v=0|o[4],M=8191&v,T=v>>>13,w=0|o[5],E=8191&w,k=w>>>13,C=0|o[6],D=8191&C,I=C>>>13,_=0|o[7],F=8191&_,L=_>>>13,z=0|o[8],P=8191&z,R=z>>>13,V=0|o[9],B=8191&V,O=V>>>13,N=0|a[0],U=8191&N,G=N>>>13,W=0|a[1],Y=8191&W,H=W>>>13,X=0|a[2],j=8191&X,$=X>>>13,q=0|a[3],J=8191&q,K=q>>>13,Z=0|a[4],Q=8191&Z,tt=Z>>>13,et=0|a[5],it=8191&et,st=et>>>13,nt=0|a[6],rt=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,lt=at>>>13,ut=0|a[8],ct=8191&ut,dt=ut>>>13,ft=0|a[9],gt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var pt=(l+(s=Math.imul(c,U))|0)+((8191&(n=(n=Math.imul(c,G))+Math.imul(d,U)|0))<<13)|0;l=((r=Math.imul(d,G))+(n>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(g,U),n=(n=Math.imul(g,G))+Math.imul(m,U)|0,r=Math.imul(m,G);var yt=(l+(s=s+Math.imul(c,Y)|0)|0)+((8191&(n=(n=n+Math.imul(c,H)|0)+Math.imul(d,Y)|0))<<13)|0;l=((r=r+Math.imul(d,H)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(y,U),n=(n=Math.imul(y,G))+Math.imul(A,U)|0,r=Math.imul(A,G),s=s+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,H)|0)+Math.imul(m,Y)|0,r=r+Math.imul(m,H)|0;var At=(l+(s=s+Math.imul(c,j)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(d,j)|0))<<13)|0;l=((r=r+Math.imul(d,$)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(S,U),n=(n=Math.imul(S,G))+Math.imul(b,U)|0,r=Math.imul(b,G),s=s+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,H)|0)+Math.imul(A,Y)|0,r=r+Math.imul(A,H)|0,s=s+Math.imul(g,j)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(m,j)|0,r=r+Math.imul(m,$)|0;var xt=(l+(s=s+Math.imul(c,J)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(d,J)|0))<<13)|0;l=((r=r+Math.imul(d,K)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(M,U),n=(n=Math.imul(M,G))+Math.imul(T,U)|0,r=Math.imul(T,G),s=s+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,H)|0)+Math.imul(b,Y)|0,r=r+Math.imul(b,H)|0,s=s+Math.imul(y,j)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(A,j)|0,r=r+Math.imul(A,$)|0,s=s+Math.imul(g,J)|0,n=(n=n+Math.imul(g,K)|0)+Math.imul(m,J)|0,r=r+Math.imul(m,K)|0;var St=(l+(s=s+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;l=((r=r+Math.imul(d,tt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(E,U),n=(n=Math.imul(E,G))+Math.imul(k,U)|0,r=Math.imul(k,G),s=s+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,H)|0)+Math.imul(T,Y)|0,r=r+Math.imul(T,H)|0,s=s+Math.imul(S,j)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(b,j)|0,r=r+Math.imul(b,$)|0,s=s+Math.imul(y,J)|0,n=(n=n+Math.imul(y,K)|0)+Math.imul(A,J)|0,r=r+Math.imul(A,K)|0,s=s+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(m,Q)|0,r=r+Math.imul(m,tt)|0;var bt=(l+(s=s+Math.imul(c,it)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(d,it)|0))<<13)|0;l=((r=r+Math.imul(d,st)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(D,U),n=(n=Math.imul(D,G))+Math.imul(I,U)|0,r=Math.imul(I,G),s=s+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(k,Y)|0,r=r+Math.imul(k,H)|0,s=s+Math.imul(M,j)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(T,j)|0,r=r+Math.imul(T,$)|0,s=s+Math.imul(S,J)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(b,J)|0,r=r+Math.imul(b,K)|0,s=s+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(A,Q)|0,r=r+Math.imul(A,tt)|0,s=s+Math.imul(g,it)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(m,it)|0,r=r+Math.imul(m,st)|0;var vt=(l+(s=s+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,ot)|0)+Math.imul(d,rt)|0))<<13)|0;l=((r=r+Math.imul(d,ot)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(F,U),n=(n=Math.imul(F,G))+Math.imul(L,U)|0,r=Math.imul(L,G),s=s+Math.imul(D,Y)|0,n=(n=n+Math.imul(D,H)|0)+Math.imul(I,Y)|0,r=r+Math.imul(I,H)|0,s=s+Math.imul(E,j)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(k,j)|0,r=r+Math.imul(k,$)|0,s=s+Math.imul(M,J)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(T,J)|0,r=r+Math.imul(T,K)|0,s=s+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(b,Q)|0,r=r+Math.imul(b,tt)|0,s=s+Math.imul(y,it)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(A,it)|0,r=r+Math.imul(A,st)|0,s=s+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,ot)|0)+Math.imul(m,rt)|0,r=r+Math.imul(m,ot)|0;var Mt=(l+(s=s+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,lt)|0)+Math.imul(d,ht)|0))<<13)|0;l=((r=r+Math.imul(d,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(P,U),n=(n=Math.imul(P,G))+Math.imul(R,U)|0,r=Math.imul(R,G),s=s+Math.imul(F,Y)|0,n=(n=n+Math.imul(F,H)|0)+Math.imul(L,Y)|0,r=r+Math.imul(L,H)|0,s=s+Math.imul(D,j)|0,n=(n=n+Math.imul(D,$)|0)+Math.imul(I,j)|0,r=r+Math.imul(I,$)|0,s=s+Math.imul(E,J)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(k,J)|0,r=r+Math.imul(k,K)|0,s=s+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(T,Q)|0,r=r+Math.imul(T,tt)|0,s=s+Math.imul(S,it)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(b,it)|0,r=r+Math.imul(b,st)|0,s=s+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,ot)|0)+Math.imul(A,rt)|0,r=r+Math.imul(A,ot)|0,s=s+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,lt)|0)+Math.imul(m,ht)|0,r=r+Math.imul(m,lt)|0;var Tt=(l+(s=s+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;l=((r=r+Math.imul(d,dt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(B,U),n=(n=Math.imul(B,G))+Math.imul(O,U)|0,r=Math.imul(O,G),s=s+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,H)|0)+Math.imul(R,Y)|0,r=r+Math.imul(R,H)|0,s=s+Math.imul(F,j)|0,n=(n=n+Math.imul(F,$)|0)+Math.imul(L,j)|0,r=r+Math.imul(L,$)|0,s=s+Math.imul(D,J)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(I,J)|0,r=r+Math.imul(I,K)|0,s=s+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(k,Q)|0,r=r+Math.imul(k,tt)|0,s=s+Math.imul(M,it)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(T,it)|0,r=r+Math.imul(T,st)|0,s=s+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(b,rt)|0,r=r+Math.imul(b,ot)|0,s=s+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,lt)|0)+Math.imul(A,ht)|0,r=r+Math.imul(A,lt)|0,s=s+Math.imul(g,ct)|0,n=(n=n+Math.imul(g,dt)|0)+Math.imul(m,ct)|0,r=r+Math.imul(m,dt)|0;var wt=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((r=r+Math.imul(d,mt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(B,Y),n=(n=Math.imul(B,H))+Math.imul(O,Y)|0,r=Math.imul(O,H),s=s+Math.imul(P,j)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(R,j)|0,r=r+Math.imul(R,$)|0,s=s+Math.imul(F,J)|0,n=(n=n+Math.imul(F,K)|0)+Math.imul(L,J)|0,r=r+Math.imul(L,K)|0,s=s+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(I,Q)|0,r=r+Math.imul(I,tt)|0,s=s+Math.imul(E,it)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(k,it)|0,r=r+Math.imul(k,st)|0,s=s+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,ot)|0)+Math.imul(T,rt)|0,r=r+Math.imul(T,ot)|0,s=s+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,lt)|0)+Math.imul(b,ht)|0,r=r+Math.imul(b,lt)|0,s=s+Math.imul(y,ct)|0,n=(n=n+Math.imul(y,dt)|0)+Math.imul(A,ct)|0,r=r+Math.imul(A,dt)|0;var Et=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(m,gt)|0))<<13)|0;l=((r=r+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(B,j),n=(n=Math.imul(B,$))+Math.imul(O,j)|0,r=Math.imul(O,$),s=s+Math.imul(P,J)|0,n=(n=n+Math.imul(P,K)|0)+Math.imul(R,J)|0,r=r+Math.imul(R,K)|0,s=s+Math.imul(F,Q)|0,n=(n=n+Math.imul(F,tt)|0)+Math.imul(L,Q)|0,r=r+Math.imul(L,tt)|0,s=s+Math.imul(D,it)|0,n=(n=n+Math.imul(D,st)|0)+Math.imul(I,it)|0,r=r+Math.imul(I,st)|0,s=s+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,ot)|0)+Math.imul(k,rt)|0,r=r+Math.imul(k,ot)|0,s=s+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,lt)|0)+Math.imul(T,ht)|0,r=r+Math.imul(T,lt)|0,s=s+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(b,ct)|0,r=r+Math.imul(b,dt)|0;var kt=(l+(s=s+Math.imul(y,gt)|0)|0)+((8191&(n=(n=n+Math.imul(y,mt)|0)+Math.imul(A,gt)|0))<<13)|0;l=((r=r+Math.imul(A,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(B,J),n=(n=Math.imul(B,K))+Math.imul(O,J)|0,r=Math.imul(O,K),s=s+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(R,Q)|0,r=r+Math.imul(R,tt)|0,s=s+Math.imul(F,it)|0,n=(n=n+Math.imul(F,st)|0)+Math.imul(L,it)|0,r=r+Math.imul(L,st)|0,s=s+Math.imul(D,rt)|0,n=(n=n+Math.imul(D,ot)|0)+Math.imul(I,rt)|0,r=r+Math.imul(I,ot)|0,s=s+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(k,ht)|0,r=r+Math.imul(k,lt)|0,s=s+Math.imul(M,ct)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(T,ct)|0,r=r+Math.imul(T,dt)|0;var Ct=(l+(s=s+Math.imul(S,gt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(b,gt)|0))<<13)|0;l=((r=r+Math.imul(b,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(B,Q),n=(n=Math.imul(B,tt))+Math.imul(O,Q)|0,r=Math.imul(O,tt),s=s+Math.imul(P,it)|0,n=(n=n+Math.imul(P,st)|0)+Math.imul(R,it)|0,r=r+Math.imul(R,st)|0,s=s+Math.imul(F,rt)|0,n=(n=n+Math.imul(F,ot)|0)+Math.imul(L,rt)|0,r=r+Math.imul(L,ot)|0,s=s+Math.imul(D,ht)|0,n=(n=n+Math.imul(D,lt)|0)+Math.imul(I,ht)|0,r=r+Math.imul(I,lt)|0,s=s+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(k,ct)|0,r=r+Math.imul(k,dt)|0;var Dt=(l+(s=s+Math.imul(M,gt)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(T,gt)|0))<<13)|0;l=((r=r+Math.imul(T,mt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,s=Math.imul(B,it),n=(n=Math.imul(B,st))+Math.imul(O,it)|0,r=Math.imul(O,st),s=s+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,ot)|0)+Math.imul(R,rt)|0,r=r+Math.imul(R,ot)|0,s=s+Math.imul(F,ht)|0,n=(n=n+Math.imul(F,lt)|0)+Math.imul(L,ht)|0,r=r+Math.imul(L,lt)|0,s=s+Math.imul(D,ct)|0,n=(n=n+Math.imul(D,dt)|0)+Math.imul(I,ct)|0,r=r+Math.imul(I,dt)|0;var It=(l+(s=s+Math.imul(E,gt)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(k,gt)|0))<<13)|0;l=((r=r+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(B,rt),n=(n=Math.imul(B,ot))+Math.imul(O,rt)|0,r=Math.imul(O,ot),s=s+Math.imul(P,ht)|0,n=(n=n+Math.imul(P,lt)|0)+Math.imul(R,ht)|0,r=r+Math.imul(R,lt)|0,s=s+Math.imul(F,ct)|0,n=(n=n+Math.imul(F,dt)|0)+Math.imul(L,ct)|0,r=r+Math.imul(L,dt)|0;var _t=(l+(s=s+Math.imul(D,gt)|0)|0)+((8191&(n=(n=n+Math.imul(D,mt)|0)+Math.imul(I,gt)|0))<<13)|0;l=((r=r+Math.imul(I,mt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,s=Math.imul(B,ht),n=(n=Math.imul(B,lt))+Math.imul(O,ht)|0,r=Math.imul(O,lt),s=s+Math.imul(P,ct)|0,n=(n=n+Math.imul(P,dt)|0)+Math.imul(R,ct)|0,r=r+Math.imul(R,dt)|0;var Ft=(l+(s=s+Math.imul(F,gt)|0)|0)+((8191&(n=(n=n+Math.imul(F,mt)|0)+Math.imul(L,gt)|0))<<13)|0;l=((r=r+Math.imul(L,mt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(B,ct),n=(n=Math.imul(B,dt))+Math.imul(O,ct)|0,r=Math.imul(O,dt);var Lt=(l+(s=s+Math.imul(P,gt)|0)|0)+((8191&(n=(n=n+Math.imul(P,mt)|0)+Math.imul(R,gt)|0))<<13)|0;l=((r=r+Math.imul(R,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var zt=(l+(s=Math.imul(B,gt))|0)+((8191&(n=(n=Math.imul(B,mt))+Math.imul(O,gt)|0))<<13)|0;return l=((r=Math.imul(O,mt))+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,h[0]=pt,h[1]=yt,h[2]=At,h[3]=xt,h[4]=St,h[5]=bt,h[6]=vt,h[7]=Mt,h[8]=Tt,h[9]=wt,h[10]=Et,h[11]=kt,h[12]=Ct,h[13]=Dt,h[14]=It,h[15]=_t,h[16]=Ft,h[17]=Lt,h[18]=zt,0!==l&&(h[19]=l,i.length++),i};function m(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var s=0,n=0,r=0;r>>26)|0)>>>26,o&=67108863}i.words[r]=a,s=o,o=n}return 0!==s?i.words[r]=s:i.length--,i.CH()}function p(t,e,i){return m(t,e,i)}Math.imul||(g=f),n.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):i<63?f(this,t,e):i<1024?m(this,t,e):p(this,t,e)},n.prototype.mul=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),p(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),i("number"==typeof t),i(t<67108864);for(var s=0,n=0;n>=26,s+=r/67108864|0,s+=o>>>26,this.words[n]=67108863&o}return 0!==s&&(this.words[n]=s,this.length++),e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>n&1}return e}(t);if(0===e.length)return new n(1);for(var i=this,s=0;s=0);var e,s=t%26,n=(t-s)/26,r=67108863>>>26-s<<26-s;if(0!==s){var o=0;for(e=0;e>>26-s}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var r=t%26,o=Math.min((t-r)/26,this.length),a=67108863^67108863>>>r<o)for(this.length-=o,l=0;l=0&&(0!==u||l>=n);l--){var c=0|this.words[l];this.words[l]=u<<26-r|c>>>r,u=c&a}return h&&0!==u&&(h.words[h.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.CH()},n.prototype.ishrn=function(t,e,s){return i(0===this.negative),this.iushrn(t,e,s)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,s=(t-e)/26,n=1<=0);var e=t%26,s=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==e&&s++,this.length=Math.min(s,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+s]=67108863&r}for(;n>26,this.words[n+s]=67108863&r;if(0===a)return this.CH();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&r;return this.negative=1,this.CH()},n.prototype.EH=function(t,e){var i=(this.length,t.length),s=this.clone(),r=t,o=0|r.words[r.length-1];0!=(i=26-this.BH(o))&&(r=r.ushln(i),s.iushln(i),o=0|r.words[r.length-1]);var a,h=s.length-r.length;if("mod"!==e){(a=new n(null)).length=h+1,a.words=new Array(a.length);for(var l=0;l=0;c--){var d=67108864*(0|s.words[r.length+c])+(0|s.words[r.length+c-1]);for(d=Math.min(d/o|0,67108863),s.RH(r,d,c);0!==s.negative;)d--,s.negative=0,s.RH(r,1,c),s.isZero()||(s.negative^=1);a&&(a.words[c]=d)}return a&&a.CH(),s.CH(),"div"!==e&&0!==i&&s.iushrn(i),{div:a||null,mod:s}},n.prototype.divmod=function(t,e,s){return i(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(r=a.div.neg()),"div"!==e&&(o=a.mod.neg(),s&&0!==o.negative&&o.iadd(t)),{div:r,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(r=a.div.neg()),{div:r,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),s&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this.EH(t,e);var r,o,a},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,s=t.ushrn(1),n=t.andln(1),r=i.cmp(s);return r<0||1===n&&0===r?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=(1<<26)%t,n=0,r=this.length-1;r>=0;r--)n=(s*n+(0|this.words[r]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=0,n=this.length-1;n>=0;n--){var r=(0|this.words[n])+67108864*s;this.words[n]=r/t|0,s=r%t}return this.CH(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,s=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r=new n(1),o=new n(0),a=new n(0),h=new n(1),l=0;e.isEven()&&s.isEven();)e.iushrn(1),s.iushrn(1),++l;for(var u=s.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(r.isOdd()||o.isOdd())&&(r.iadd(u),o.isub(c)),r.iushrn(1),o.iushrn(1);for(var g=0,m=1;0==(s.words[0]&m)&&g<26;++g,m<<=1);if(g>0)for(s.iushrn(g);g-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(u),h.isub(c)),a.iushrn(1),h.iushrn(1);e.cmp(s)>=0?(e.isub(s),r.isub(a),o.isub(h)):(s.isub(e),a.isub(r),h.isub(o))}return{a,b:h,gcd:s.iushln(l)}},n.prototype.VH=function(t){i(0===t.negative),i(!t.isZero());var e=this,s=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r,o=new n(1),a=new n(0),h=s.clone();e.cmpn(1)>0&&s.cmpn(1)>0;){for(var l=0,u=1;0==(e.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var c=0,d=1;0==(s.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(s.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(s)>=0?(e.isub(s),o.isub(a)):(s.isub(e),a.isub(o))}return(r=0===e.cmpn(1)?o:a).cmpn(0)<0&&r.iadd(t),r},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var s=0;e.isEven()&&i.isEven();s++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var r=e;e=i,i=r}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(s)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,s=(t-e)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==r&&(this.words[o]=r,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,s=t<0;if(0!==this.negative&&!s)return-1;if(0===this.negative&&s)return 1;if(this.CH(),this.length>1)e=1;else{s&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;i--){var s=0|this.words[i],n=0|t.words[i];if(s!==n){sn&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new M(t)},n.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this).zH(t)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype.zH=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.zH(t)},n.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.OH(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.OH(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.NH(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.NH(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.NH(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.NH(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.NH(this),this.red.neg(this)},n.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.NH(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function A(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this.GH()}function x(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function v(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=n.WH(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r.VH(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}A.prototype.GH=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},A.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var s=e0?i.isub(this.p):void 0!==i.strip?i.strip():i.CH(),i},A.prototype.split=function(t,e){t.iushrn(this.n,0,e)},A.prototype.imulK=function(t){return t.imul(this.k)},s(x,A),x.prototype.split=function(t,e){for(var i=4194303,s=Math.min(t.length,9),n=0;n>>22,r=o}r>>>=22,t.words[n-10]=r,0===r&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=n,e=s}return 0!==e&&(t.words[t.length++]=e),t},n.WH=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new S;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new v}return y[t]=e,e},M.prototype.NH=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype.OH=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t).zH(this):(h(t,t.umod(this.m).zH(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).zH(this)},M.prototype.add=function(t,e){this.OH(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.zH(this)},M.prototype.iadd=function(t,e){this.OH(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function(t,e){this.OH(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.zH(this)},M.prototype.isub=function(t,e){this.OH(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function(t,e){return this.NH(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this.OH(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this.OH(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var s=this.m.add(new n(1)).iushrn(2);return this.pow(t,s)}for(var r=this.m.subn(1),o=0;!r.isZero()&&0===r.andln(1);)o++,r.iushrn(1);i(!r.isZero());var a=new n(1).toRed(this),h=a.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,l).cmp(h);)u.redIAdd(h);for(var c=this.pow(u,r),d=this.pow(t,r.addn(1).iushrn(1)),f=this.pow(t,r),g=o;0!==f.cmp(a);){for(var m=f,p=0;0!==m.cmp(a);p++)m=m.redSqr();i(p=0;s--){for(var l=e.words[s],u=h-1;u>=0;u--){var c=l>>u&1;r!==i[0]&&(r=this.sqr(r)),0!==c||0!==o?(o<<=1,o|=c,(4==++a||0===s&&0===u)&&(r=this.mul(r,i[o]),a=0,o=0)):a=0}h=26}return r},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new T(t)},s(T,M),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(s).iushrn(this.shift),r=n;return n.cmp(this.m)>=0?r=n.isub(this.m):n.cmpn(0)<0&&(r=n.iadd(this.m)),r.zH(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0).zH(this);var i=t.mul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(s).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o.zH(this)},T.prototype.invm=function(t){return this.imod(t.VH(this.m).mul(this.r2)).zH(this)}}(0,hy);var uy=ly.exports;function cy(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];const i=[];if("string"!=typeof t){for(let e=0;e>8,r=255&s;n?i.push(n,r):i.push(r)}return i}const dy=function(t,e,i){const s=new Array(Math.max(t.bitLength(),i)+1);s.fill(0);const n=1<(n>>1)-1?(n>>1)-i:i,r.isubn(e)):e=0,s[t]=e,r.iushrn(1)}return s},fy=function(t,e){const i=[[],[]];t=t.clone(),e=e.clone();let s=0,n=0;for(;t.cmpn(-s)>0||e.cmpn(-n)>0;){let r,o,a=t.andln(3)+s&3,h=e.andln(3)+n&3;if(3===a&&(a=-1),3===h&&(h=-1),0==(1&a))r=0;else{const e=t.andln(7)+s&7;r=3!==e&&5!==e||2!==h?a:-a}if(i[0].push(r),0==(1&h))o=0;else{const t=e.andln(7)+n&7;o=3!==t&&5!==t||2!==a?h:-h}i[1].push(o),2*s===r+1&&(s=1-s),2*n===o+1&&(n=1-n),t.iushrn(1),e.iushrn(1)}return i};class gy{constructor(t,e){this.type=t,this.p=new uy(e.p,16),this.red=e.prime?uy.red(e.prime):uy.mont(this.p),this.zero=new uy(0).toRed(this.red),this.one=new uy(1).toRed(this.red),this.two=new uy(2).toRed(this.red),this.n=e.n&&new uy(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.UH=new Array(4),this.YH=new Array(4),this.HH=new Array(4),this.$H=new Array(4),this.XH=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.jH=!0,this.redN=this.n.toRed(this.red))}ZH(t,e){const i=t.QH(),s=dy(e,1,this.XH);let n=(1<=t;n--)e=(e<<1)+s[n];r.push(e)}let o=this.jpoint(null,null,null),a=this.jpoint(null,null,null);for(let t=n;t>0;t--){for(let e=0;e=0;i--){for(let t=0;i>=0&&0===r[i];i--)t++;if(i>=0&&e++,o=o.dblp(e),i<0)break;const s=r[i];o="affine"===t.type?s>0?o.mixedAdd(n[s-1>>1]):o.mixedAdd(n[-s-1>>1].neg()):s>0?o.add(n[s-1>>1]):o.add(n[-s-1>>1].neg())}return"affine"===t.type?o.toP():o}qH(t,e,i,s,n){const r=this.UH,o=this.YH,a=this.HH;let h=0;for(let i=0;i=1;t-=2){const s=t-1,n=t;if(1!==r[s]||1!==r[n]){a[s]=dy(i[s],r[s],this.XH),a[n]=dy(i[n],r[n],this.XH),h=Math.max(a[s].length,h),h=Math.max(a[n].length,h);continue}const l=[e[s],null,null,e[n]];0===e[s].y.cmp(e[n].y)?(l[1]=e[s].add(e[n]),l[2]=e[s].toJ().mixedAdd(e[n].neg())):0===e[s].y.cmp(e[n].y.redNeg())?(l[1]=e[s].toJ().mixedAdd(e[n]),l[2]=e[s].add(e[n].neg())):(l[1]=e[s].toJ().mixedAdd(e[n]),l[2]=e[s].toJ().mixedAdd(e[n].neg()));const u=[-3,-1,-5,-7,0,7,5,1,3],c=fy(i[s],i[n]);h=Math.max(c[0].length,h),a[s]=new Array(h),a[n]=new Array(h);for(let t=0;t=0;t--){let e=0;for(;t>=0;){let i=!0;for(let e=0;e=0&&e++,l=l.dblp(e),t<0)break;for(let t=0;t0?i=o[t][e-1>>1]:e<0&&(i=o[t][-e-1>>1].neg()),l="affine"===i.type?l.mixedAdd(i):l.add(i))}}for(let t=0;t=Math.ceil((t.bitLength()+1)/e.step)}QH(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;const i=[this];let s=this;for(let n=0;n({a:new uy(t.a,16),b:new uy(t.b,16)}))):this.o$(i),{beta:e,lambda:i,basis:s}}n$(t){const e=t===this.p?this.red:uy.mont(t),i=new uy(2).toRed(e).redInvm(),s=i.redNeg(),n=new uy(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(n).fromRed(),s.redSub(n).fromRed()]}o$(t){const e=this.n.ushrn(Math.floor(this.n.bitLength()/2));let i,s,n,r,o,a,h,l,u,c=t,d=this.n.clone(),f=new uy(1),g=new uy(0),m=new uy(0),p=new uy(1),y=0;for(;0!==c.cmpn(0);){const t=d.div(c);l=d.sub(t.mul(c)),u=m.sub(t.mul(f));const o=p.sub(t.mul(g));if(!n&&l.cmp(e)<0)i=h.neg(),s=f,n=l.neg(),r=u;else if(n&&2==++y)break;h=l,d=c,c=l,m=f,f=u,p=g,g=o}o=l.neg(),a=u;const A=n.sqr().add(r.sqr());return o.sqr().add(a.sqr()).cmp(A)>=0&&(o=i,a=s),n.negative&&(n=n.neg(),r=r.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:r},{a:o,b:a}]}a$(t){const e=this.endo.basis,i=e[0],s=e[1],n=s.b.mul(t).divRound(this.n),r=i.b.neg().mul(t).divRound(this.n),o=n.mul(i.a),a=r.mul(s.a),h=n.mul(i.b),l=r.mul(s.b);return{k1:t.sub(o).sub(a),k2:h.add(l).neg()}}point(t,e,i){return new yy(this,t,e,i)}pointFromX(t,e){(t=new uy(t,16)).red||(t=t.toRed(this.red));const i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b);let s=i.redSqrt();if(0!==s.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");const n=s.fromRed().isOdd();return(e&&!n||!e&&n)&&(s=s.redNeg()),this.point(t,s)}validate(t){if(t.inf)return!0;const e=t.x,i=t.y,s=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(s).redIAdd(this.b);return 0===i.redSqr().redISub(n).cmpn(0)}l$(t,e,i){const s=this.h$,n=this.r$;let r=0;for(r=0;r":``}isInfinity(){return this.inf}add(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);let e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));const i=e.redSqr().redISub(this.x).redISub(t.x),s=e.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)}dbl(){if(this.inf)return this;const t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);const e=this.curve.a,i=this.x.redSqr(),s=t.redInvm(),n=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(s),r=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,o)}getX(){return this.x.fromRed()}getY(){return this.y.fromRed()}mul(t){return t=new uy(t,16),this.isInfinity()?this:this.s$(t)?this.curve.ZH(this,t):this.curve.endo?this.curve.l$([this],[t]):this.curve.JH(this,t)}mulAdd(t,e,i){const s=[this,e],n=[t,i];return this.curve.endo?this.curve.l$(s,n):this.curve.qH(1,s,n,2)}jmulAdd(t,e,i){const s=[this,e],n=[t,i];return this.curve.endo?this.curve.l$(s,n,!0):this.curve.qH(1,s,n,2,!0)}eq(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))}neg(t){if(this.inf)return this;const e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){const t=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}toJ(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)}}class Ay extends my{constructor(t,e,i,s){super(t,"jacobian"),null===e&&null===i&&null===s?(this.x=this.curve.one,this.y=this.curve.one,this.z=new uy(0)):(this.x=new uy(e,16),this.y=new uy(i,16),this.z=new uy(s,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}getY(){throw new Error("Method not implemented.")}getX(){throw new Error("Method not implemented.")}pointFromX(t,e){throw new Error("Method not implemented.")}point(t,e,i){throw new Error("Method not implemented.")}jpoint(t,e,i){return new Ay(this,t,e,i)}toP(){if(this.isInfinity())return this.curve.point(null,null);const t=this.z.redInvm(),e=t.redSqr(),i=this.x.redMul(e),s=this.y.redMul(e).redMul(t);return this.curve.point(i,s)}neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;const e=t.z.redSqr(),i=this.z.redSqr(),s=this.x.redMul(e),n=t.x.redMul(i),r=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(i.redMul(this.z)),a=s.redSub(n),h=r.redSub(o);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const l=a.redSqr(),u=l.redMul(a),c=s.redMul(l),d=h.redSqr().redIAdd(u).redISub(c).redISub(c),f=h.redMul(c.redISub(d)).redISub(r.redMul(u)),g=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,f,g)}mixedAdd(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;const e=this.z.redSqr(),i=this.x,s=t.x.redMul(e),n=this.y,r=t.y.redMul(e).redMul(this.z),o=i.redSub(s),a=n.redSub(r);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const h=o.redSqr(),l=h.redMul(o),u=i.redMul(h),c=a.redSqr().redIAdd(l).redISub(u).redISub(u),d=a.redMul(u.redISub(c)).redISub(n.redMul(l)),f=this.z.redMul(o);return this.curve.jpoint(c,d,f)}dblp(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){let e=this;for(let i=0;i=0)return!1;if(i.redIAdd(n),0===this.x.cmp(i))return!0}}inspect(){return this.isInfinity()?"":``}isInfinity(){return 0===this.z.cmpn(0)}}class xy{constructor(t){this.curve=new py(t),this.g=this.curve.g,this.n=this.curve.n}}const Sy={};var by;Sy.PresetCurve=xy,by={type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",{doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}]},Object.defineProperty(Sy,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new xy(by);return Object.defineProperty(Sy,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class vy{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.f$(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof vy?e:new vy(t,{pub:e,pubEnc:i})}validate(){const t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}}getPublic(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub}f$(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type||"short"===this.ec.curve.type||this.ec.curve.type,void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)}verify(t,e){return this.ec.verify(t,e,this)}}function My(t,e){const i=t[e.place++];if(!(128&i))return i;const s=15&i;if(0===s||s>4)return!1;let n=0,r=e.place;for(let e=0;e>>=0;return!(n<=127)&&(e.place=r,n)}class Ty{constructor(){this.place=0}}class wy{constructor(t,e){if(t instanceof wy)return t;this.A$(t,e)||(this.r=new uy(t.r,16),this.s=new uy(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}A$(t,e){t=cy(t,e);const i=new Ty;if(48!==t[i.place++])return!1;const s=My(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const n=My(t,i);if(!1===n)return!1;let r=t.slice(i.place,n+i.place);if(i.place+=n,2!==t[i.place++])return!1;const o=My(t,i);if(!1===o)return!1;if(t.length!==o+i.place)return!1;let a=t.slice(i.place,o+i.place);if(0===r[0]){if(!(128&r[1]))return!1;r=r.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new uy(r),this.s=new uy(a),this.recoveryParam=null,!0}}class Ey{constructor(t){if(!(this instanceof Ey))return new Ey(t);"string"==typeof t&&(t=Sy[t]),t instanceof Sy.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1)}keyFromPublic(t,e){return vy.fromPublic(this,t,e)}g$(t,e){const i=8*t.byteLength()-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t}verify(t,e,i,s){t=this.g$(new uy(t,16)),i=this.keyFromPublic(i,s);const n=(e=new wy(e,"hex")).r,r=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;const o=r.invm(this.n),a=o.mul(t).umod(this.n),h=o.mul(n).umod(this.n);if(!this.curve.jH){const t=this.g.mulAdd(a,i.getPublic(),h);return!t.isInfinity()&&0===t.getX().umod(this.n).cmp(n)}const l=this.g.jmulAdd(a,i.getPublic(),h);return!l.isInfinity()&&l.eqXToP(n)}}var ky,Cy={exports:{}};Cy.exports=(ky=ky||function(t,e){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==hy&&hy.crypto&&(i=hy.crypto),!i)try{i=e}catch(t){}var s=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function t(){}return function(e){var i;return t.prototype=e,i=new t,t.prototype=null,i}}(),r={},o=r.lib={},a=o.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},h=o.WordArray=a.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,i=t.words,s=this.sigBytes,n=t.sigBytes;if(this.clamp(),s%4)for(var r=0;r>>2]>>>24-r%4*8&255;e[s+r>>>2]|=o<<24-(s+r)%4*8}else for(var a=0;a>>2]=i[a>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i>>2]>>>24-n%4*8&255;s.push((r>>>4).toString(16)),s.push((15&r).toString(16))}return s.join("")},parse:function(t){for(var e=t.length,i=[],s=0;s>>3]|=parseInt(t.substr(s,2),16)<<24-s%8*4;return new h.init(i,e/2)}},c=l.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,s=[],n=0;n>>2]>>>24-n%4*8&255;s.push(String.fromCharCode(r))}return s.join("")},parse:function(t){for(var e=t.length,i=[],s=0;s>>2]|=(255&t.charCodeAt(s))<<24-s%4*8;return new h.init(i,e)}},d=l.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},f=o.BufferedBlockAlgorithm=a.extend({reset:function(){this.mk=new h.init,this.p$=0},m$:function(t){"string"==typeof t&&(t=d.parse(t)),this.mk.concat(t),this.p$+=t.sigBytes},y$:function(e){var i,s=this.mk,n=s.words,r=s.sigBytes,o=this.blockSize,a=r/(4*o),l=(a=e?t.ceil(a):t.max((0|a)-this.S$,0))*o,u=t.min(4*l,r);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,p=l[f-2],y=(p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10;l[f]=m+l[f-7]+y+l[f-16]}var A=s&n^s&r^n&r,x=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),S=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&c)+h[f]+l[f];d=c,c=u,u=a,a=o+S|0,o=r,r=n,n=s,s=S+(x+A)|0}i[0]=i[0]+s|0,i[1]=i[1]+n|0,i[2]=i[2]+r|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0,i[5]=i[5]+u|0,i[6]=i[6]+c|0,i[7]=i[7]+d|0},b$:function(){var t=this.mk,i=t.words,s=8*this.p$,n=8*t.sigBytes;return i[n>>>5]|=128<<24-n%32,i[14+(n+64>>>9<<4)]=e.floor(s/4294967296),i[15+(n+64>>>9<<4)]=s,t.sigBytes=4*i.length,this.y$(),this.w$},clone:function(){var t=r.clone.call(this);return t.w$=this.w$.clone(),t}});i.SHA256=r.M$(u),i.HmacSHA256=r._$(u)}(Math),t.SHA256}(Cy.exports),Ly={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,n=s.SHA256,r=s.SHA224=n.extend({x$:function(){this.w$=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},b$:function(){var t=n.b$.call(this);return t.sigBytes-=4,t}}),e.SHA224=n.M$(r),e.HmacSHA224=n._$(r),t.SHA224;var e,i,s,n,r}(Cy.exports),zy={exports:{}}.exports=Cy.exports.enc.Hex,Py={exports:{}}.exports=Cy.exports.enc.Utf8;!function(t){return i=(e=t).lib.WordArray,e.enc.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,s=this.C$;t.clamp();for(var n=[],r=0;r>>2]>>>24-r%4*8&255)<<16|(e[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|e[r+2>>>2]>>>24-(r+2)%4*8&255,a=0;a<4&&r+.75*a>>6*(3-a)&63));var h=s.charAt(64);if(h)for(;n.length%4;)n.push(h);return n.join("")},parse:function(t){var e=t.length,s=this.C$,n=this.k$;if(!n){n=this.k$=[];for(var r=0;r>>6-o%4*2;n[r>>>2]|=a<<24-r%4*8,r++}return i.create(n,r)}(t,e,n)},C$:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(Cy.exports),function(t){(function(e){var i=t,s=i.lib,n=s.WordArray,r=s.Hasher,o=i.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var h=o.MD5=r.extend({x$:function(){this.w$=new n.init([1732584193,4023233417,2562383102,271733878])},v$:function(t,e){for(var i=0;i<16;i++){var s=e+i,n=t[s];t[s]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var r=this.w$.words,o=t[e+0],h=t[e+1],f=t[e+2],g=t[e+3],m=t[e+4],p=t[e+5],y=t[e+6],A=t[e+7],x=t[e+8],S=t[e+9],b=t[e+10],v=t[e+11],M=t[e+12],T=t[e+13],w=t[e+14],E=t[e+15],k=r[0],C=r[1],D=r[2],I=r[3];k=l(k,C,D,I,o,7,a[0]),I=l(I,k,C,D,h,12,a[1]),D=l(D,I,k,C,f,17,a[2]),C=l(C,D,I,k,g,22,a[3]),k=l(k,C,D,I,m,7,a[4]),I=l(I,k,C,D,p,12,a[5]),D=l(D,I,k,C,y,17,a[6]),C=l(C,D,I,k,A,22,a[7]),k=l(k,C,D,I,x,7,a[8]),I=l(I,k,C,D,S,12,a[9]),D=l(D,I,k,C,b,17,a[10]),C=l(C,D,I,k,v,22,a[11]),k=l(k,C,D,I,M,7,a[12]),I=l(I,k,C,D,T,12,a[13]),D=l(D,I,k,C,w,17,a[14]),k=u(k,C=l(C,D,I,k,E,22,a[15]),D,I,h,5,a[16]),I=u(I,k,C,D,y,9,a[17]),D=u(D,I,k,C,v,14,a[18]),C=u(C,D,I,k,o,20,a[19]),k=u(k,C,D,I,p,5,a[20]),I=u(I,k,C,D,b,9,a[21]),D=u(D,I,k,C,E,14,a[22]),C=u(C,D,I,k,m,20,a[23]),k=u(k,C,D,I,S,5,a[24]),I=u(I,k,C,D,w,9,a[25]),D=u(D,I,k,C,g,14,a[26]),C=u(C,D,I,k,x,20,a[27]),k=u(k,C,D,I,T,5,a[28]),I=u(I,k,C,D,f,9,a[29]),D=u(D,I,k,C,A,14,a[30]),k=c(k,C=u(C,D,I,k,M,20,a[31]),D,I,p,4,a[32]),I=c(I,k,C,D,x,11,a[33]),D=c(D,I,k,C,v,16,a[34]),C=c(C,D,I,k,w,23,a[35]),k=c(k,C,D,I,h,4,a[36]),I=c(I,k,C,D,m,11,a[37]),D=c(D,I,k,C,A,16,a[38]),C=c(C,D,I,k,b,23,a[39]),k=c(k,C,D,I,T,4,a[40]),I=c(I,k,C,D,o,11,a[41]),D=c(D,I,k,C,g,16,a[42]),C=c(C,D,I,k,y,23,a[43]),k=c(k,C,D,I,S,4,a[44]),I=c(I,k,C,D,M,11,a[45]),D=c(D,I,k,C,E,16,a[46]),k=d(k,C=c(C,D,I,k,f,23,a[47]),D,I,o,6,a[48]),I=d(I,k,C,D,A,10,a[49]),D=d(D,I,k,C,w,15,a[50]),C=d(C,D,I,k,p,21,a[51]),k=d(k,C,D,I,M,6,a[52]),I=d(I,k,C,D,g,10,a[53]),D=d(D,I,k,C,b,15,a[54]),C=d(C,D,I,k,h,21,a[55]),k=d(k,C,D,I,x,6,a[56]),I=d(I,k,C,D,E,10,a[57]),D=d(D,I,k,C,y,15,a[58]),C=d(C,D,I,k,T,21,a[59]),k=d(k,C,D,I,m,6,a[60]),I=d(I,k,C,D,v,10,a[61]),D=d(D,I,k,C,f,15,a[62]),C=d(C,D,I,k,S,21,a[63]),r[0]=r[0]+k|0,r[1]=r[1]+C|0,r[2]=r[2]+D|0,r[3]=r[3]+I|0},b$:function(){var t=this.mk,i=t.words,s=8*this.p$,n=8*t.sigBytes;i[n>>>5]|=128<<24-n%32;var r=e.floor(s/4294967296),o=s;i[15+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),i[14+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(i.length+1),this.y$();for(var a=this.w$,h=a.words,l=0;l<4;l++){var u=h[l];h[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var t=r.clone.call(this);return t.w$=this.w$.clone(),t}});function l(t,e,i,s,n,r,o){var a=t+(e&i|~e&s)+n+o;return(a<>>32-r)+e}function u(t,e,i,s,n,r,o){var a=t+(e&s|i&~s)+n+o;return(a<>>32-r)+e}function c(t,e,i,s,n,r,o){var a=t+(e^i^s)+n+o;return(a<>>32-r)+e}function d(t,e,i,s,n,r,o){var a=t+(i^(e|~s))+n+o;return(a<>>32-r)+e}i.MD5=r.M$(h),i.HmacMD5=r._$(h)})(Math),t.MD5}(Cy.exports),function(t){return i=(e=t).lib,s=i.WordArray,n=i.Hasher,r=e.algo,o=[],a=r.SHA1=n.extend({x$:function(){this.w$=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},v$:function(t,e){for(var i=this.w$.words,s=i[0],n=i[1],r=i[2],a=i[3],h=i[4],l=0;l<80;l++){if(l<16)o[l]=0|t[e+l];else{var u=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=u<<1|u>>>31}var c=(s<<5|s>>>27)+h+o[l];c+=l<20?1518500249+(n&r|~n&a):l<40?1859775393+(n^r^a):l<60?(n&r|n&a|r&a)-1894007588:(n^r^a)-899497514,h=a,a=r,r=n<<30|n>>>2,n=s,s=c}i[0]=i[0]+s|0,i[1]=i[1]+n|0,i[2]=i[2]+r|0,i[3]=i[3]+a|0,i[4]=i[4]+h|0},b$:function(){var t=this.mk,e=t.words,i=8*this.p$,s=8*t.sigBytes;return e[s>>>5]|=128<<24-s%32,e[14+(s+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(s+64>>>9<<4)]=i,t.sigBytes=4*e.length,this.y$(),this.w$},clone:function(){var t=n.clone.call(this);return t.w$=this.w$.clone(),t}}),e.SHA1=n.M$(a),e.HmacSHA1=n._$(a),t.SHA1;var e,i,s,n,r,o,a}(Cy.exports),Iy=(Dy=Cy.exports).lib.Base,_y=Dy.enc.Utf8,Dy.algo.HMAC=Iy.extend({init:function(t,e){t=this.T$=new t.init,"string"==typeof e&&(e=_y.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var n=this.F$=e.clone(),r=this.I$=e.clone(),o=n.words,a=r.words,h=0;h>>2];t.sigBytes-=e}};s.BlockCipher=u.extend({cfg:u.cfg.extend({mode:f,padding:g}),reset:function(){var t;u.reset.call(this);var e=this.cfg,i=e.iv,s=e.mode;this.B$==this.P$?t=s.createEncryptor:(t=s.createDecryptor,this.S$=1),this.z$&&this.z$.O$==t?this.z$.init(this,i&&i.words):(this.z$=t.call(s,this,i&&i.words),this.z$.O$=t)},v$:function(t,e){this.z$.processBlock(t,e)},b$:function(){var t,e=this.cfg.padding;return this.B$==this.P$?(e.pad(this.mk,this.blockSize),t=this.y$(!0)):(t=this.y$(!0),e.unpad(t)),t},blockSize:4});var m=s.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),p=(i.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return(i?r.create([1398893684,1701076831]).concat(i).concat(e):e).toString(h)},parse:function(t){var e,i=h.parse(t),s=i.words;return 1398893684==s[0]&&1701076831==s[1]&&(e=r.create(s.slice(2,4)),s.splice(0,4),i.sigBytes-=16),m.create({ciphertext:i,salt:e})}},y=s.SerializableCipher=n.extend({cfg:n.extend({format:p}),encrypt:function(t,e,i,s){s=this.cfg.extend(s);var n=t.createEncryptor(i,s),r=n.finalize(e),o=n.cfg;return m.create({ciphertext:r,key:i,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:s.format})},decrypt:function(t,e,i,s){return s=this.cfg.extend(s),e=this.N$(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},N$:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),A=(i.kdf={}).OpenSSL={execute:function(t,e,i,s){s||(s=r.random(8));var n=l.create({keySize:e+i}).compute(t,s),o=r.create(n.words.slice(e),4*i);return n.sigBytes=4*e,m.create({key:n,iv:o,salt:s})}},x=s.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:A}),encrypt:function(t,e,i,s){var n=(s=this.cfg.extend(s)).kdf.execute(i,t.keySize,t.ivSize);s.iv=n.iv;var r=y.encrypt.call(this,t,e,n.key,s);return r.mixIn(n),r},decrypt:function(t,e,i,s){s=this.cfg.extend(s),e=this.N$(e,s.format);var n=s.kdf.execute(i,t.keySize,t.ivSize,e.salt);return s.iv=n.iv,y.decrypt.call(this,t,e,n.key,s)}})}()}(Cy.exports);var Ry={exports:{}}.exports=function(t){return function(){var e=t,i=e.lib.BlockCipher,s=e.algo,n=[],r=[],o=[],a=[],h=[],l=[],u=[],c=[],d=[],f=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,s=0;for(e=0;e<256;e++){var g=s^s<<1^s<<2^s<<3^s<<4;g=g>>>8^255&g^99,n[i]=g,r[g]=i;var m=t[i],p=t[m],y=t[p],A=257*t[g]^16843008*g;o[i]=A<<24|A>>>8,a[i]=A<<16|A>>>16,h[i]=A<<8|A>>>24,l[i]=A,A=16843009*y^65537*p^257*m^16843008*i,u[g]=A<<24|A>>>8,c[g]=A<<16|A>>>16,d[g]=A<<8|A>>>24,f[g]=A,i?(i=m^t[t[t[y^m]]],s^=t[t[s]]):i=s=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],m=s.AES=i.extend({x$:function(){if(!this.G$||this.W$!==this.L$){for(var t=this.W$=this.L$,e=t.words,i=t.sigBytes/4,s=4*((this.G$=i+6)+1),r=this.U$=[],o=0;o6&&o%i==4&&(l=n[l>>>24]<<24|n[l>>>16&255]<<16|n[l>>>8&255]<<8|n[255&l]):(l=n[(l=l<<8|l>>>24)>>>24]<<24|n[l>>>16&255]<<16|n[l>>>8&255]<<8|n[255&l],l^=g[o/i|0]<<24),r[o]=r[o-i]^l);for(var a=this.Y$=[],h=0;h>>24]]^c[n[l>>>16&255]]^d[n[l>>>8&255]]^f[n[255&l]]}}},encryptBlock:function(t,e){this.H$(t,e,this.U$,o,a,h,l,n)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this.H$(t,e,this.Y$,u,c,d,f,r),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},H$:function(t,e,i,s,n,r,o,a){for(var h=this.G$,l=t[e]^i[0],u=t[e+1]^i[1],c=t[e+2]^i[2],d=t[e+3]^i[3],f=4,g=1;g>>24]^n[u>>>16&255]^r[c>>>8&255]^o[255&d]^i[f++],p=s[u>>>24]^n[c>>>16&255]^r[d>>>8&255]^o[255&l]^i[f++],y=s[c>>>24]^n[d>>>16&255]^r[l>>>8&255]^o[255&u]^i[f++],A=s[d>>>24]^n[l>>>16&255]^r[u>>>8&255]^o[255&c]^i[f++];l=m,u=p,c=y,d=A}m=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[c>>>8&255]<<8|a[255&d])^i[f++],p=(a[u>>>24]<<24|a[c>>>16&255]<<16|a[d>>>8&255]<<8|a[255&l])^i[f++],y=(a[c>>>24]<<24|a[d>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^i[f++],A=(a[d>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&c])^i[f++],t[e]=m,t[e+1]=p,t[e+2]=y,t[e+3]=A},keySize:8});e.AES=i.M$(m)}(),t.AES}(Cy.exports),Vy={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.R$,s=i.blockSize,n=this.E$,r=this.$$;n&&(r=this.$$=n.slice(0),this.E$=void 0);var o=r.slice(0);i.encryptBlock(o,0),r[s-1]=r[s-1]+1|0;for(var a=0;a>>2]|=t[n]<<24-n%4*8;i.call(this,s,e)}else i.apply(this,arguments)};s.prototype=e}}(),t.lib.WordArray}(Cy.exports),Oy={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(Cy.exports);const Ny={"-4":["MDQxMmQ1MWU5MjFhYTMzODUwMWE4ZGYzN2ViZTE4NTU3ZDViYmRlZDg1Yzk0OGI3YTJkMDBmZTNhZGVlMjdjY2VmNzBiMWVlOWI3MDZjMTIwYTAzZDZlZTNkNmYyOTc5Y2E2NGEzN2Y3YjY4N2E1ZjljZWY2ODYxN2I1NWU5ZmJjMA=="],"-3":["MjAxODAxMjA="],"-2":["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2Vzc2lvbg==","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvdHJvdWJsZXNob290aW5nL3Jlc3RyaWN0ZWQtZmVhdHVyZXMv","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzLw=="],"-1":["WE1MSHR0cFJlcXVlc3Q=","ZG9jdW1lbnQ=","ZGVmYXVsdFZpZXc=","YQ==","Yg==","bGljZW5zZV9leHBpcmF0aW9uX2RhdGU=","bG9jYXRpb24=","aG9zdG5hbWU=","dGVzdF9kb21haW4=","ZG9tYWlucw==","Y3J5cHRv","U2lnbmF0dXJl","RUNEU0E=","U0hBMjI0d2l0aEVDRFNB","YWxn","Y3VydmU=","c2VjcDI1Nmsx","YWRkRXZlbnRMaXN0ZW5lcg==","cmVtb3ZlRXZlbnRMaXN0ZW5lcg==","bG9hZGVuZA==","ZXJyb3I=","YWJvcnQ=","dGltZW91dA==","cmVzcG9uc2VUZXh0","Q29udGVudC1UeXBl","YXBwbGljYXRpb24vanNvbg==","TWVzc2FnZURpZ2VzdA==","c2hhMjU2","Y3J5cHRvanM=","dXBkYXRlU3RyaW5n","ZGlnZXN0","Y29tcGFueQ==","YXBwVGl0bGU=","bGNqcy1zZXNzaW9u","bG9jYWxTdG9yYWdl","Z2V0SXRlbQ==","c2V0SXRlbQ==","ZA==","dA==","bGNqcy1zZXNzaW9uLTI="],0:["TGljZW5zZQ==","IA==","a2V5","aGFz","ZXhwaXJlZA==","Lg==","dmVyc2lvbg==","aXM=","dG9v","bmV3","b2xk","b3I=","aW52YWxpZA==","MDAwMQ==","SW52YWxpZA==","bnVtYmVy","b2Y=","ZG9tYWlucw==","ZGVwbG95bWVudA==","aW4=","ZG9tYWlu","RGVwbG95bWVudA==","ZG9tYWlu","dmFsaWRhdGlvbg==","ZmFpbGVk","Og==","UE9TVA==","c2VydmVy","cmVzcG9uZGVk","d2l0aA==","dW5leHBlY3RlZA==","dmFsdWU=","cmVxdWVzdA==","VEVTVA==","REVQTE9ZTUVOVA==","S2V5","VGFtcGVyaW5n","YmVlbg==","ZGV0ZWN0ZWQ=","TWlzc2luZw==","TGljZW5zZQ==","aW5mb3JtYXRpb24=","ZG9lcw==","bm90","aW5jbHVkZQ==","cGVybWlzc2lvbg==","dG8=","dXNl","Q2hhcnQ=","M0Q=","WFk=","RGF0YUdyaWQ=","TWFw","UG9sYXI=","RnVubmVs","R2F1Z2U=","UGll","UHlyYW1pZA==","U3BpZGVy","Zm9y","dGhpcw==","VHJhZGluZw==","ZmVhdHVyZXM=","Y2xpY2s=","aGVyZQ==","bW9yZQ==","c3VwcGxpZWQ=","Z2V0","bGljZW5zZQ=="],1:["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2FuZGJveA=="]},Uy=St,Gy=(...t)=>t.slice(1).reduce(((e,i)=>e+Uy.atob(Ny[t[0]][i].toString())),"");let Wy,Yy,Hy,Xy=new Uint8Array([]);class jy{set e(t){Wy=t}get e(){Yy={Vn:!1,zn:!1,On:!1,Nn:!1,Gn:!1,Wn:!1,Un:!1,Yn:!1,Hn:!1,$n:!1,Xn:!1,jn:!1,Zn:!1,Qn:!1,Jn:!1,Kn:!1,qn:!1,io:!1,so:!1,eo:!1,ho:!1,ro:!1};const t=Xy.length,e=t>=1?Xy[0]:void 0,i=t>=2?Xy[1]:void 0,s=t>=3?Xy[2]:void 0;return void 0!==e&&(Yy.Vn=!!(1&e),Yy.zn=!!(2&e),Yy.On=!!(4&e),Yy.Nn=!!(8&e),Yy.Gn=!!(16&e),Yy.Wn=!!(32&e),Yy.Un=!!(64&e),Yy.Yn=!!(128&e)),void 0!==i&&(Yy.Hn=!!(1&i),Yy.$n=!!(2&i),Yy.Xn=!!(4&i),Yy.jn=!!(8&i),Yy.Zn=!!(16&i),Yy.Qn=!!(32&i),Yy.Jn=!!(64&i),Yy.Kn=!!(128&i)),void 0!==s&&(Yy.qn=!!(1&s),Yy.io=!!(2&s),Yy.so=!!(4&s),Yy.eo=!!(8&s),Yy.ho=!!(16&s),Yy.ro=!!(32&s)),Yy.Wn}set l(t){Hy=t}get l(){return Hy}}let $y=!1;const qy=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},Jy=t=>{if(4===t.byteLength)return`${t[0].toString().padStart(2,"0")}${t[1].toString().padStart(2,"0")}${t[2].toString().padStart(2,"0")}${t[3].toString().padStart(2,"0")}`},Ky=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),Zy=t=>{const e={},i=t.split("-");if(3!==i.length)return{X$:Gy(0,0,1,7,1,12,5)};let s=0;const n=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(0)));s+=1;const r=n.subarray(s,s+=20),o=new DataView(n.buffer).getUint16(s,!0);s+=2;const a=Uint8Array.from(Array(o));for(let t=0;tt+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");return eA(d,f)?e:{X$:Gy(0,0,1,7,1,12,5)}},Qy=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(qy(i,2)),e=t.slice(36,40),s=new Uint8Array(4),n=(t=>{let e;const i=[];for(let t=0;t<256;t+=1){e=t;for(let t=0;t<8;t+=1)e=1&e?3988292384^e>>>1:e>>>1;i[t]=e}let s=-1;for(let e=0;e>>8^i[255&(s^t[e])];return(-1^s)>>>0})(t.slice(0,36));new DataView(s.buffer).setUint32(0,n,!0);const r=t.slice(28,34);let o=0;for(let t=r.length-1;t>0;t-=1)o+=r[t]*2**(8*t);const a=new Date(o);if(Ky(a)s[e]===t)))return{};break}case"0002":return Zy(t);default:return{X$:Gy(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}return{X$:Gy(0,0,1,2,1,7,1,12,5)}},tA=t=>{if(!t)return{X$:Gy(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5)};const e=(t[Gy(-1,9)]||t[Gy(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(Uy[Gy(-1,6)][Gy(-1,7)])>-1)return{J$:!0};const i=e.filter((t=>t.indexOf("*")>-1));if(oA(Uy[Gy(-1,6)][Gy(-1,7)],i))return{J$:!0};const s=t[Gy(-1,8)]||t[Gy(-1,38)];if(""!==s&&null!=s){if(oA(Uy[Gy(-1,6)][Gy(-1,7)],[s]))return{J$:!1};if(s===Uy[Gy(-1,6)][Gy(-1,7)])return{J$:!1}}return{X$:Gy(0,14,1,20,5)}},eA=(t,e)=>{const i=new Ey("secp256k1").keyFromPublic(Gy(-4,0),"hex"),s=Ly(t).toString();return i.verify(s,e)},iA=t=>{switch(t.slice(0,4)){case"0001":return(t=>{let e,i="";try{const e=t.split("-"),s=e[1],n=e[2],r=e[3];if(!eA(n,r))return{X$:Gy(0,21,1,2,1,7,1,12,5)};const o=zy.parse(n);i=Ry.decrypt({ciphertext:zy.parse(s)},o,{mode:Vy,padding:Oy,iv:zy.parse("00000000000000000000000000000001")}).toString(Py)}catch(t){return{X$:Gy(0,21,1,2,1,7,1,12,5)}}try{e=JSON.parse(i)}catch(t){return{X$:Gy(0,21,1,2,1,7,1,12,5)}}if(void 0===e[Gy(-1,5)]||null===e[Gy(-1,4)]||!e[Gy(-1,9)])return{X$:Gy(0,21,1,2,1,7,1,12,5)};const s=parseInt(Gy(-3,0),10)||Number(parseInt(Gy(-3,0),10));return e[Gy(-1,5)]{const e=Zy(t),i=e.j$,s=e.Q$;if(e.X$||void 0===i||void 0===s)return e;let n,r="";try{const t=i.slice(e.Q$,s+16),n=new DataView(t.buffer),o=new Int32Array(4);for(let t=0;t{switch(t.slice(0,4)){case"0001":return((t,e)=>{if(!e)return{X$:Gy(0,39,1,40,1,41,5)};const i=t.split("-"),s=i[1].slice(1),n=i[2],r=i[3];if(!eA(`${s}-${n}`,r))return{X$:Gy(0,21,1,2,1,7,1,12,5)};const o=Uint8Array.from(qy(n,2));let a=0;for(let t=o.length-1;t>0;t-=1)a+=o[t]*2**(8*t);if(a<(parseInt(Gy(-3,0),10)||Number(parseInt(Gy(-3,0),10))))return{X$:Gy(0,21,1,2,1,3,1,4,5)};const h=Int32Array.from(qy(s,8)),l=Fy(e[Gy(-1,31)]).toString(zy),u=Int32Array.from(qy(l,8)),c=Fy(e[Gy(-1,32)]).toString(zy),d=Int32Array.from(qy(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t))?{}:{X$:Gy(0,21,1,2,1,7,1,12,5)}})(t,e);case"0002":return((t,e)=>{if(!e)return{X$:Gy(0,39,1,40,1,41,5)};const i=Zy(t),s=i.j$,n=i.Q$;if(i.X$||void 0===s||void 0===n)return i;const r=s.slice(n,s.length),o=new DataView(r.buffer),a=new Int32Array(8);for(let t=0;td[e]===t))?{}:{X$:Gy(0,21,1,2,1,7,1,12,5)}})(t,e);default:return{X$:Gy(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}},nA=(t,e,i=!0,s)=>{$y=!1,e.yo();const n=e.Rr,r=!!n&&(n===St.document.body||St.document.body.contains(n)),o=n&&r?n:document.body;if(void 0===Array.from(o.children).find((t=>"lcjs-error"===t.id))){const e=St.document.createElement("div");e.id="lcjs-error",o.append(e),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="black",e.style.boxSizing="border-box",e.style.padding="20px",e.style.font="Arial",e.style.fontSize="20px";let n,r=(t||"LICENSE_ERROR").toLowerCase().split("_").join(" ");if(r=(i?Gy(0,0,1,2,1,23,1,24,25,1):"")+r.charAt(0).toUpperCase()+r.substr(1),s){const t=St.document.createElement("a");t.href=s,n=t}else n=St.document.createElement("p1");e.append(n),n.innerHTML=r,n.style.color="red"}},rA=(t,e,i)=>{e?(t[Gy(-1,17)](Gy(-1,19),i),t[Gy(-1,17)](Gy(-1,20),i),t[Gy(-1,17)](Gy(-1,21),i),t[Gy(-1,17)](Gy(-1,22),i)):(t[Gy(-1,18)](Gy(-1,19),i),t[Gy(-1,18)](Gy(-1,20),i),t[Gy(-1,18)](Gy(-1,21),i),t[Gy(-1,18)](Gy(-1,22),i))},oA=(t,e)=>{const i=t.split(".").reverse();return e.some((t=>{const e=t.split(".").reverse();let s=!1;const n=e.findIndex((t=>"*"===t)),r=i.every(((t,i)=>{if(!s){if(!(i2,!s&&t!==e[i])return!1}return!0}));return!(n>i.length-1||!r)}))};let aA;e.Animation=j,e.AnimationEasings=X,e.Animator=$,e.AreaRangeSeries=td,e.AreaSeries=jc,e.AreaSeriesBipolar=Kc,e.AreaSeriesMonopolar=$c,e.AreaSeriesNegative=Jc,e.AreaSeriesPositive=qc,e.AreaSeriesTypes=Zc,e.AutoCursor2DBuilder=nh,e.AutoCursorBuilders=Ff,e.AutoCursorXYBuilder=$l,e.AutoFitStrategies=Ja,e.AutoFitStrategy=ja,e.Axis=Qo,e.Axis3D=Rh,e.AxisScrollStrategies=Rs,e.AxisTickStrategies=Vs,e.Band=zs,e.BarChart=bf,e.BarChartBar=Af,e.BarChartCategoryAxis=pf,e.BarChartSorting=vf,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=yf,e.BasicSeries=uu,e.BorderedPicture=Ir,e.BoxFigure=Gc,e.BoxSeries=Yc,e.BoxSeries3D=Wh,e.Button=Co,e.Chart=Ga,e.Chart3D=hl,e.ChartComponent=Ui,e.ChartMarker=eu,e.ChartMarker2D=class extends eu{constructor(t,e,i,s,n,r){super(t,e,i,s.Xg(t,e,i,r),n,r)}},e.ChartMarkerXY=su,e.ChartWithSeries=Kh,e.ChartXY=Pd,e.Color=v,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return T(i[0],i[1],i[2],255*i[3])}if(t.startsWith("rgb")){const e=t.substr(4).slice(0,-1),i=JSON.parse(`[${e}]`);return T(i[0],i[1],i[2])}if(t.startsWith("hsl")){const e=t.substr(4).slice(0,-1).split(",").map(parseFloat),i=((t,e,i)=>{e/=100,i/=100;const s=(1-Math.abs(2*i-1))*e,n=t/60,r=s*(1-Math.abs(n%2-1));let o=[];isNaN(t)?o=[0,0,0]:n<=1?o=[s,r,0]:n<=2?o=[r,s,0]:n<=3?o=[0,s,r]:n<=4?o=[0,r,s]:n<=5?o=[r,0,s]:n<=6&&(o=[s,0,r]);const a=i-.5*s;return[Math.round(255*(o[0]+a)),Math.round(255*(o[1]+a)),Math.round(255*(o[2]+a))]})(e[0],e[1],e[2]);return T(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?w(t):w((t=>{const e=k[t.toLowerCase()];if(e)return e;throw new Error(`Unknown color code: ${t}`)})(t))}catch(t){}return console.warn(`ColorCSS parsing error: ${t}`),w("#fff")},e.ColorHEX=w,e.ColorHSV=E,e.ColorPalettes=zr,e.ColorRGBA=T,e.ColorShadingStyles=Wr,e.ColorUint32=t=>T(255&t,255&(t>>=8),255&(t>>=8),255&(t>>=8)),e.ConstantLine=Ps,e.CursorBuilder=sh,e.CursorBuilderXY=jl,e.CustomTick=Ar,e.Dashboard=Cf,e.DashedLine=Jr,e.DataGrid=uf,e.DataPatternsNew=_n,e.DataSetXY=gd,e.DateTimeTickStrategy=Sa,e.EllipseFigure=Nc,e.EllipseSeries=Uc,e.EmptyFill=R,e.EmptyUIElement=kr,e.Figure=Fc,e.FigureSeries=Lc,e.FontSettings=sn,e.FormattingFunctions=Ci,e.FunnelChart=Mu,e.FunnelChartTypes=Cu,e.FunnelChartWithLabelsInsideSlices=ku,e.FunnelChartWithLabelsOnSides=Eu,e.FunnelSlice=Au,e.GaugeChart=_u,e.GaugeChartTypes=Wf,e.GaugeSlice=Lu,e.GenericAxis=qs,e.GlowEffect=io,e.HeatmapGridSeries=nd,e.HeatmapGridSeriesIntensityValues=rd,e.HeatmapScrollingGridSeries=od,e.HeatmapScrollingGridSeriesIntensityValues=ad,e.Highlighter=Gi,e.Icon=Qr,e.ImageFill=Xr,e.IndividualPointFill=class extends N{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")}},e.LUT=z,e.LegendBoxBuilders=jo,e.LineAndPointSeries3D=Yh,e.LineSeries=_c,e.LineSeries3D=Hh,e.LinearGradientFill=et,e.LinearGradientFillPalette=(t,e,i,s)=>{const n=t(e+1,s);return t=>new et({stops:[{offset:0,color:n(t).getDarker()},{offset:.5,color:n(t)},{offset:1,color:n(t).getDarker()}],angle:i||90})},e.MapChart=Al,e.MapRegions=Gf,e.MapRegionsAfrica=Lf,e.MapRegionsAsia=zf,e.MapRegionsAustralia=Pf,e.MapRegionsCanada=Rf,e.MapRegionsEurope=Vf,e.MapRegionsNorthAmerica=Nf,e.MapRegionsSouthAmerica=Uf,e.MapRegionsUSA=Of,e.MapRegionsWorld=Bf,e.MapTypes=cl,e.MarkerBuilders=_f,e.MeshModel3D=al,e.NumericTickStrategy=Ca,e.OHLCSeries=hd,e.OHLCSeriesBars=ud,e.OHLCSeriesCandlesticks=ld,e.OHLCSeriesTypes=cd,e.OnScreenMenu=id,e.OnScreenMenuAnimationsButton=xs,e.OnScreenMenuButton=cs,e.OnScreenMenuControlBase=Ki,e.OnScreenMenuCustomButton=bs,e.OnScreenMenuOsmToggleButton=vs,e.OnScreenMenuToggleButton=ds,e.OnScreenMenuZoomInButton=fs,e.OnScreenMenuZoomInXButton=gs,e.OnScreenMenuZoomInYButton=ms,e.OnScreenMenuZoomOutButton=ps,e.OnScreenMenuZoomOutXButton=ys,e.OnScreenMenuZoomOutYButton=As,e.OnScreenMenuZoomToFitButton=Ss,e.PalettedFill=class extends Y{constructor(t){super({...t,fillType:"palette"})}toString(){return`palettedFill:lut=${this.lut.toString()},lookUpProperty=${this.lookUpProperty}`}getPalette(){return this.get("lut")}setLookUpProperty(t){return"function"==typeof t?this.set("lookUpProperty",t(this.get("lookUpProperty"))):this.set("lookUpProperty",t)}getLookUpProperty(){return this.get("lookUpProperty")}},e.Panel=Ba,e.PhongShadingStyle=Ur,e.Picture=Dr,e.PieChart=Eh,e.PieChartTypes=_h,e.PieChartWithLabelsInsideSlices=Ih,e.PieChartWithLabelsOnSides=Dh,e.PieSlice=bh,e.PixelatedPoints3D=cn,e.PointCloudSeries3D=qh,e.PointLineAreaSeries=bd,e.PointLineSeries=mc,e.PointLineSeries3D=Xh,e.PointSeries=ed,e.PointSeries3D=$h,e.PointSeriesTypes3D=Jh,e.PointStyle3D=fn,e.PolarAreaSeries=fu,e.PolarAreaSeriesInterior=gu,e.PolarAxis=bl,e.PolarAxisAmplitude=Ml,e.PolarAxisTick=vl,e.PolarChart=pu,e.PolarHeatmapSeries=Bl,e.PolarLineSeries=Nl,e.PolarPointLineSeries=Ul,e.PolarPointSeries=Gl,e.PolarPolygon=Wl,e.PolarPolygonSeries=du,e.PolarSector=Il,e.PolarSeries=Fl,e.PolygonFigure=Rc,e.PolygonSeries=Vc,e.PyramidChart=Gu,e.PyramidChartTypes=ju,e.PyramidChartWithLabelsInsideSlices=Xu,e.PyramidChartWithLabelsOnSides=Hu,e.PyramidSlice=Bu,e.RadialGauge=Fu,e.RadialGradientFill=Z,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new Z({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=Hc,e.RectangleFigure=zc,e.RectangleSeries=Pc,e.SegmentFigure=Bc,e.SegmentSeries=Oc,e.Series2D=_l,e.Series3D=Gh,e.SeriesMarkerXY=nu,e.SeriesXY=ru,e.SimpleShadingStyle=Or,e.Slice=xh,e.SliceLabelFormatters=yh,e.SliceSorters=ph,e.SolidFill=U,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new U({color:s(t)})},e.SolidGauge=Vu,e.SolidGaugeSlice=zu,e.SolidLine=qi,e.SpiderAxis=Zu,e.SpiderChart=hc,e.SpiderSeries=tc,e.SplineSeries=Ac,e.StaticCursor2DBuilder=rh,e.StaticCursorXYBuilder=ql,e.StepSeries=Ic,e.StipplePatterns=$r,e.SurfaceGridSeries3D=il,e.SurfaceScrollingGridSeries3D=sl,e.TableContentBuilder=Ka,e.Themes=sg,e.Tick=Zo,e.TickStyle=na,e.TimeFormattingFunctions=_a,e.TimeTickStrategy=La,e.TriangulatedPoints3D=hn,e.UIBackgrounds=If,e.UICircle=oo,e.UIColumnGrid=class extends fo{constructor(){super(...arguments),this.Nc=[]}addColumn(){return this.addElement(Ao,void 0)}getColumn(t,e=!1){return e&&this.Nc.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.Nc[t]}},e.UIDiamond=ao,e.UIElementBuilders=Xo,e.UIElementColumn=go,e.UIElementLine=co,e.UIElementRow=fo,e.UIElementWithBackground=pr,e.UIEmptyBackground=Cr,e.UILabel=so,e.UILayoutBuilders=ll,e.UILayoutGap=uo,e.UILegendBoxPanel=ul,e.UIObject=cr,e.UIOrigins=Ts,e.UIPanel=Na,e.UIPoint=lo,e.UIPointer=ho,e.UIPolygon=_r,e.UIRectangle=ro,e.UIRowGrid=po,e.VisibleFill=N,e.ZoomBandChart=dd,e.defaultOsmBackgroundColor=Fs,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=V,e.emptyLine=nt,e.emptyPoints3D=on,e.emptyTick=oa,e.formatLongitudeLatitude=Sl,e.formatNumberAsUnicodeSuperscript=Di,e.isColor=M,e.isCoordinate3D=rl,e.isCoordinateBarChart=xf,e.isCoordinateClient=Vi,e.isCoordinatePolar=Dl,e.isCoordinateXY=Oi,e.isDashedLine=Kr,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=B,e.isEmptyTick=aa,e.isFontSettings=nn,e.isGlowEffect=t=>!(!t||"object"!=typeof t||!("type"in t)||"glow"!==t.type),e.isIcon=to,e.isIndividualPointFill=W,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=it,e.isNumericTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"numeric-ticks"!==t.type),e.isPalettedFill=H,e.isPhongShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"phong"!==t.type),e.isPixelatedPoints3D=dn,e.isRadialGradientFill=Q,e.isSeriesSupportedByZoomBandChart=t=>t instanceof uu||t instanceof jc||t instanceof td||t instanceof rd||t instanceof hd||t instanceof Ic||t instanceof bd,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=G,e.isSolidLine=Ji,e.isTickStyle=ra,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=ln,e.lightningChart=(t,e)=>{const i="object"==typeof t?t.license:t,s="object"==typeof t?t.licenseInformation:e,r="object"==typeof t?t:void 0,o=new jy;return o.e=i,aA||(aA=((t,e)=>{let i,s,r=!1,o=!1,a=!1,h=!1,l="",u=!1,c=!1;try{if(Wy){const s=(t=>{if(!Wy)return;const e=Wy.split("-");if(e.length>0)switch(e[0]){case"0001":return"0001";case"0002":return"0002";case"T001":return"T001";default:return}})();if("0001"===s){Xy=new Uint8Array([2]);const e=(t=>{if(!Wy)return;const e=Wy.split("-");return 4===e.length?e[1].startsWith("m")?2:1:0})();if(1===e){const t=iA(Wy);a=!t.J$,i=t,r=!0}else 2===e?(i=sA(Wy,t),o=!0):($y=!0,i=Qy(Wy),h=!0)}else if("0002"===s){const e=(t=>{if(!Wy)return;const e=Wy.split("-");return e.length>=2?Uint8Array.from(atob(e[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)$y=!0,i=Qy(Wy),h=!0;else if(189===e){const t=iA(Wy);a=!t.J$,i=t,r=!0}else 159===e?(i=sA(Wy,t),o=!0):i={X$:Gy(0,0,1,7,1,12,5)}}else if("T001"===s){const s=((t,e)=>{const i=Wy.split("-");if(3!==i.length)return{X$:Gy(0,0,1,7,1,12,5)};const s=`${i[1]}`,n=Array.prototype.reduce.call(atob(i[2]),((t,e)=>t+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");if(!eA(s,n))return{X$:Gy(0,0,1,7,1,12,5)};let r=0;const o=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(r))),a=o.subarray(r,r+=20),h=new DataView(o.buffer).getUint16(r,!0);r+=2;const l=Uint8Array.from(Array(h));for(let t=0;tp)return{X$:Gy(0,0,1,2,1,3,1,4,5)};const y=u.getUint16(r,!0),A=l.subarray(r+=2,r+y);if(Xy=new Uint8Array(A),e&&"dHJhZGVy"in e&&"dGVjaG5pY2FsIGFuYWx5c2lz"===e.dHJhZGVy)return{K$:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="};if(e&&"logoGraphic"in e&&e.logoGraphic){const t=e.logoGraphic.split("-");return 3===t.length&&eA(t[0],t[2])?{K$:t[0]}:{X$:Gy(0,0,1,7,1,12,5)}}return{X$:Gy(0,0,1,7,1,12,5)}})(0,t);i=s;const n=s.K$;n&&e?("string"==typeof n&&(e.l=n),r=!0):i={X$:Gy(0,0,1,7,1,12,5)}}else i={X$:Gy(0,0,1,7,1,12,5)}}else{const t=/^(10\.|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168)\./;["localhost","127.0.0.1","::1"].includes(window.location.hostname)||t.test(window.location.hostname)?i={X$:Gy(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68),Z$:Gy(-2,2)}:window.location.host===Uy.atob("c3RhY2tzbmlwcGV0cy5uZXQ=")?(c=!0,u=!1,Xy=new Uint8Array([38]),i={}):(c=!0,u=!0,Xy=new Uint8Array([38]),i={})}}catch(t){i={X$:Gy(0,0,1,7,1,12,5)}}try{h&&(s=Uy[Gy(-1,34)][Gy(-1,35)](Gy(-1,39))||void 0)}catch(t){Uy.console.error(t)}let d=!1;if(s){const t=s.split("-");if(2===t.length&&eA(t[0],t[1])){const[e,i]=t[0].split(":").map((t=>Number(t)));Date.now()-i<.95*e*1e3&&(d=!0)}}const f=!(c||u||i.X$||r||o||d),g=(()=>{const t=new(Uy[Gy(-1,0)]);return t.open(Gy(0,26),Gy(-2,0)),t.setRequestHeader(Gy(-1,24),Gy(-1,25)),t.withCredentials=!0,t})(),m=new n.Eventer;if(f){let t;try{t=parseInt(Wy?Wy.split("-")[1]:Math.floor(1e6*Math.random()).toString(),16)}catch(e){t=Math.floor(1e6*Math.random())}const e=Math.floor(1e6*Math.random());l=(t^e).toString();const i={};let s="",n="",r="";Wy=Wy||"";const o=Gy(-4,0);for(let t=0;t{const r={As:t=>{const e=2===t||10===t?Gy(-2,1):void 0,i=`${Gy(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${"string"==typeof t?t:(t=>{switch(t){case 1:return Gy(0,48,49);case 0:return Gy(0,48,50);case 2:return Gy(0,51);case 3:return Gy(0,52,48);case 4:return Gy(0,53,48);case 5:return Gy(0,54,48);case 6:return Gy(0,55,48);case 7:return Gy(0,56,48);case 8:return Gy(0,57,48);case 9:return Gy(0,58,48);case 10:return Gy(0,61,1,62)}return Se(0,"")})(t)}${e?Gy(0,1,63,1,64,1,59,1,65,1,41):""}`;nA(i,o,!1,e)},Ln:t=>m.on("logoChange",t),Rn:t=>m.off(t),...Yy},o=new ay(n,t,r);(null==i?void 0:i.X$)&&nA(i.X$,o,void 0,i.Z$);const h=t=>{if("error"===(null==t?void 0:t.type)&&s){const t=s.split("-");if(2===t.length&&eA(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return $y=!1,void rA(g,!1,c)}}if(g.readyState===Uy[Gy(-1,0)].DONE)if(200===g.status){const t=JSON.parse(g[Gy(-1,23)]);if(!eA(l+Gy(-3,0),t.h)){const t=Gy(0,0,1,27,1,28,1,29,1,30,1,31,5);nA(t,o)}Uy[Gy(-1,34)][Gy(-1,36)](Gy(-1,39),t.t),Uy[Gy(-1,34)][Gy(-1,36)](Gy(-1,33),t.s),$y=!1}else{let e="";try{e=t&&"loadend"!==t.type?Gy(0,0,1,23,1,32,1,24,5):JSON.parse(g[Gy(-1,23)]).message,rA(g,!1,c)}catch(t){console.error(t)}nA(Gy(0,0,1,2,1,7,1,12,5)+e,o)}},c=t=>{h(t)};if(rA(g,!0,c),f?setTimeout((()=>{if($y){let t=!0;if(s){const e=s.split("-");if(2===e.length&&eA(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&nA(Gy(0,25,1,23,1,32,1,24,5),o)}}),1e4):rA(g,!1,c),u){const t=(()=>{const t=new(Uy[Gy(-1,0)]);return t.open(Gy(0,26),Gy(1,0)),t.setRequestHeader("Content-Type","text/plain"),t.withCredentials=!0,t})(),i=Array.from({length:10},(()=>String.fromCharCode(Math.floor(256*Math.random())))).join(""),s=s=>{if("error"===(null==s?void 0:s.type)){const t=Gy(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);nA(t,o,!1,Gy(-2,2)),rA(g,!1,n)}if(t.readyState===Uy.XMLHttpRequest.DONE){const s=t.getResponseHeader("X-LCJS-SANDBOX-V");if(200!==t.status||s&&"1"!==s){const t=Gy(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);nA(t,o,!1,Gy(-2,2)),rA(g,!1,n)}else{const s=JSON.parse(t.responseText);if(!eA(i,s.s)){const t=Gy(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);nA(t,o,!1,Gy(-2,2)),rA(g,!1,n)}void 0!==e&&(e.l=s.l),m.emit("logoChange",s.l)}}else{const t=Gy(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);nA(t,o,!1,Gy(-2,2)),rA(g,!1,n)}},n=t=>{s(t)};rA(t,!0,n),t.send(i),setTimeout((()=>{if(t.readyState<2){const t=Gy(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);nA(t,o,!1,Gy(-2,2)),rA(g,!1,n)}}),1e4)}return a?(t=>{let e;$y=!1;const i=t.oi(),s=()=>{e&&(t.pn(e.gn()),e=void 0),e=t.nI("deployment test"),e.kr(t.dt).Bh(Gy(0,34,1,33)).Ie({x:i.x/2,y:i.y/2}).Ea(50).zh(13).ke(new U({color:T(128,128,128,100)})).La("Arial").za(500).setMouseInteractions(!1),t.dn().fn()};t.Go((()=>{s()})),setTimeout(s,0),setInterval((()=>{e&&e.gn(){var n,r,o,a,h,l,u,c,d;let f;if(i&&i.license){const t=i.license.split("-");f=t[t.length-1]}const g=null===(r=null===(n=null==i?void 0:i.sharedContextOptions)||void 0===n?void 0:n.webgl)||void 0===r?void 0:r.version,m={$R:null===(o=null==i?void 0:i.sharedContextOptions)||void 0===o?void 0:o.canvas,oo:null==i?void 0:i.warnings,eE:"webgl1"===g?1:"webgl2"===g?2:void 0,qR:!1!==(null===(a=null==i?void 0:i.sharedContextOptions)||void 0===a?void 0:a.antialias),KR:(null===(h=null==i?void 0:i.sharedContextOptions)||void 0===h?void 0:h.devicePixelRatio)||void 0,dE:(null===(l=null==i?void 0:i.sharedContextOptions)||void 0===l?void 0:l.noCanvasStyles)||void 0,pE:(null===(u=null==i?void 0:i.sharedContextOptions)||void 0===u?void 0:u.noCanvasTransform)||void 0,iE:!1!==(null===(c=null==i?void 0:i.sharedContextOptions)||void 0===c?void 0:c.useStackingOrder),sE:!1!==(null===(d=null==i?void 0:i.sharedContextOptions)||void 0===d?void 0:d.useIndividualCanvas),fE:f||void 0},p=new sm(m),y=e=>t(e,p);return{Dashboard:nm(y,e,i,s),ChartXY:am(y,e,i,s),Spider:hm(y,e,i,s),Polar:lm(y,e,i,s),Pie:um(y,e,i,s),UIPanel:om(y,e,i,s),Gauge:cm(y,e,i,s),Funnel:dm(y,e,i,s),Pyramid:fm(y,e,i,s),Chart3D:mm(y,e,i,s),Map:gm(y,e,i,s),DataGrid:pm(y,e,i,s),BarChart:ym(y,e,i,s),ZoomBandChart:Am(y,e,i,s),dispose:p.W.bind(p)}})(aA,o.e,r,o.l)},e.onScreenMenuControlBaseHeight=ks,e.onScreenMenuControlBaseWidth=Cs,e.onScreenMenuControlOpacity=Ds,e.onScreenMenuDefaultButtonShape=_s,e.onScreenMenuSpriteURL=Is,e.regularColorSteps=(t,e,i,s)=>{if(!i||0===i.length)throw new Error("Invalid use regularColorSteps 'colorPalette' is undefined or empty");const n=null==s?void 0:s.formatLabels,r=null==s?void 0:s.alpha;return i.map(((s,o)=>{const a=t+o/(i.length-1)*(e-t);return{color:void 0!==r?s.setA(r):s,value:a,label:n?n(a):void 0}}))},e.saveToFile=za,e.synchronizeAxisIntervals=dt,e.translatePoint=ut,e.translatePoint3D=ct,e.transparentFill=ws,e.transparentLine=Es,e.uint32ColorFromObject=t=>I(255*t.r,255*t.g,255*t.b,255*t.a),e.uint32ColorFromRGBA=I,e.vec3Utils=Ie,e.xDimensionStrategy=ta,e.yDimensionStrategy=ea}}]); \ No newline at end of file diff --git a/js/vendor.97217f65b8a4b1f61999.bundle.js b/js/vendor.97217f65b8a4b1f61999.bundle.js new file mode 100644 index 0000000..3e9ee86 --- /dev/null +++ b/js/vendor.97217f65b8a4b1f61999.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see vendor.97217f65b8a4b1f61999.bundle.js.LICENSE.txt */ +(self.webpackChunk=self.webpackChunk||[]).push([[502],{613:(t,e,i)=>{"use strict";i.r(e),i.d(e,{EventError:()=>o,Eventer:()=>u,Token:()=>a});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 n(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 r(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var s,n,r=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(s=r.next()).done;)o.push(s.value)}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}return o}var o=function(t){function e(i){var s,n="EventError: "+i+"}";return s=t.call(this,n)||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),a=function(t,e){return{token:t+"-"+e,ownerIndex:t,id:e}},h=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=++h,this.lastEventIndex=0,this.topics=new Map}return t.prototype.on=function(t,e,i){var s=this.topics.get(t),n=i||a(this.id,++this.lastEventIndex);return s?s.set(n,e):this.topics.set(t,new Map([[n,e]])),n},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 a=n(this.topics),h=a.next();!h.done;h=a.next()){var u,c,d=r(h.value,2);if(d[0],c=(u=d[1]).get(t))return c}}catch(t){i={error:t}}finally{try{h&&!h.done&&(s=a.return)&&s.call(a)}finally{if(i)throw i.error}}return l(t,this.id)},t.prototype.off=function(t,e){var i,s;if(e)return!(!(h=this.topics.get(e))||!h.delete(t));try{for(var o=n(this.topics),a=o.next();!a.done;a=o.next()){var h,l=r(a.value,2);if(l[0],(h=l[1]).delete(t))return!0}}catch(t){i={error:t}}finally{try{a&&!a.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{"use strict";function e(t,e,s){s=s||2;var r,o,a,h,c,d,g,m=e&&e.length,p=m?e[0]*s:t.length,y=i(t,0,p,s,!0),A=[];if(!y||y.next===y.prev)return A;if(m&&(y=function(t,e,s,n){var r,o,a,h=[];for(r=0,o=e.length;r80*s){r=a=t[0],o=h=t[1];for(var x=s;xa&&(a=c),d>h&&(h=d);g=0!==(g=Math.max(a-r,h-o))?32767/g:0}return n(y,A,s,r,o,g,0),A}function i(t,e,i,s,n){var r,o;if(n===E(t,e,i,s)>0)for(r=e;r=e;r-=s)o=M(r,t[r],t[r+1],o);return o&&y(o,o.next)&&(T(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||!y(s,s.next)&&0!==p(s.prev,s,s.next))s=s.next;else{if(T(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function n(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var n=t;do{0===n.z&&(n.z=d(n.x,n.y,e,i,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,s,n,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,s=i,a=0,e=0;e0||h>0&&s;)0!==a&&(0===h||!s||i.z<=s.z)?(n=i,i=i.nextZ,a--):(n=s,s=s.nextZ,h--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,l*=2}while(o>1)}(n)}(t,l,u,c);for(var g,m,p=t;t.prev!==t.next;)if(g=t.prev,m=t.next,c?o(t,l,u,c):r(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),T(t),t=m.next,p=m.next;else if((t=m)===p){f?1===f?n(t=a(s(t),e,i),e,i,l,u,c,2):2===f&&h(t,e,i,l,u,c):n(s(t),e,i,l,u,c,1);break}}}function r(t){var e=t.prev,i=t,s=t.next;if(p(e,i,s)>=0)return!1;for(var n=e.x,r=i.x,o=s.x,a=e.y,h=i.y,l=s.y,u=nr?n>o?n:o:r>o?r:o,f=a>h?a>l?a:l:h>l?h:l,m=s.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=f&&g(n,a,r,h,o,l,m.x,m.y)&&p(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,i,s){var n=t.prev,r=t,o=t.next;if(p(n,r,o)>=0)return!1;for(var a=n.x,h=r.x,l=o.x,u=n.y,c=r.y,f=o.y,m=ah?a>l?a:l:h>l?h:l,x=u>c?u>f?u:f:c>f?c:f,S=d(m,y,e,i,s),b=d(A,x,e,i,s),v=t.prevZ,M=t.nextZ;v&&v.z>=S&&M&&M.z<=b;){if(v.x>=m&&v.x<=A&&v.y>=y&&v.y<=x&&v!==n&&v!==o&&g(a,u,h,c,l,f,v.x,v.y)&&p(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,M.x>=m&&M.x<=A&&M.y>=y&&M.y<=x&&M!==n&&M!==o&&g(a,u,h,c,l,f,M.x,M.y)&&p(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;v&&v.z>=S;){if(v.x>=m&&v.x<=A&&v.y>=y&&v.y<=x&&v!==n&&v!==o&&g(a,u,h,c,l,f,v.x,v.y)&&p(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;M&&M.z<=b;){if(M.x>=m&&M.x<=A&&M.y>=y&&M.y<=x&&M!==n&&M!==o&&g(a,u,h,c,l,f,M.x,M.y)&&p(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function a(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!y(r,o)&&A(r,n,n.next,o)&&b(r,o)&&b(o,r)&&(e.push(r.i/i|0),e.push(n.i/i|0),e.push(o.i/i|0),T(n),T(n.next),n=t=o),n=n.next}while(n!==t);return s(n)}function h(t,e,i,r,o,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&m(h,l)){var u=v(h,l);return h=s(h,h.next),u=s(u,u.next),n(h,e,i,r,o,a,0),void n(u,e,i,r,o,a,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,n=t.x,r=t.y,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){var a=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(a<=n&&a>o&&(o=a,i=s.x=s.x&&s.x>=u&&n!==s.x&&g(ri.x||s.x===i.x&&c(i,s)))&&(i=s,f=h)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var n=v(i,t);return s(n,n.next),s(i,i.next)}function c(t,e){return p(t.prev,t,e.prev)<0&&p(e.next,t,t.next)<0}function d(t,e,i,s,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(r-a)&&(t-o)*(s-a)>=(i-o)*(e-a)&&(i-o)*(r-a)>=(n-o)*(s-a)}function m(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&&A(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(p(t.prev,t,e.prev)||p(t,e.prev,e))||y(t,e)&&p(t.prev,t,t.next)>0&&p(e.prev,e,e.next)>0)}function p(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function A(t,e,i,s){var n=S(p(t,e,i)),r=S(p(t,e,s)),o=S(p(i,s,t)),a=S(p(i,s,e));return n!==r&&o!==a||!(0!==n||!x(t,i,e))||!(0!==r||!x(t,s,e))||!(0!==o||!x(i,t,s))||!(0!==a||!x(i,e,s))}function x(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 b(t,e){return p(t.prev,t,t.next)<0?p(t,e,t.next)>=0&&p(t,t.prev,e)>=0:p(t,e,t.prev)<0||p(t,t.next,e)<0}function v(t,e){var i=new w(t.i,t.x,t.y),s=new w(e.i,e.x,e.y),n=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function M(t,e,i,s){var n=new w(t,e,i);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function T(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 w(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 E(t,e,i,s){for(var n=0,r=e,o=i-s;r0&&(s+=t[n-1].length,i.holes.push(s))}return i}},568:(t,e,i)=>{"use strict";i.r(e),i.d(e,{Collection:()=>w,Iterable:()=>ks,List:()=>hi,Map:()=>Be,OrderedMap:()=>vi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>Xi,Record:()=>ms,Repeat:()=>vs,Seq:()=>K,Set:()=>Oi,Stack:()=>Ci,default:()=>Cs,fromJS:()=>Ms,get:()=>he,getIn:()=>ji,has:()=>ae,hasIn:()=>qi,hash:()=>yt,is:()=>ft,isAssociative:()=>T,isCollection:()=>x,isImmutable:()=>L,isIndexed:()=>M,isKeyed:()=>b,isList:()=>ai,isMap:()=>ut,isOrdered:()=>P,isOrderedMap:()=>ct,isOrderedSet:()=>Pi,isPlainObject:()=>ne,isRecord:()=>F,isSeq:()=>I,isSet:()=>zi,isStack:()=>ki,isValueObject:()=>dt,merge:()=>Te,mergeDeep:()=>Ee,mergeDeepWith:()=>ke,mergeWith:()=>we,remove:()=>ue,removeIn:()=>pe,set:()=>ce,setIn:()=>ge,update:()=>Ae,updateIn:()=>de,version:()=>Es});var s="delete",n=5,r=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&&!y(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function g(t,e){return p(t,e,0)}function m(t,e){return p(t,e,e)}function p(t,e,i){return void 0===t?i:y(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function y(t){return t<0||0===t&&1/t==-1/0}var A="@@__IMMUTABLE_ITERABLE__@@";function x(t){return Boolean(t&&t[A])}var S="@@__IMMUTABLE_KEYED__@@";function b(t){return Boolean(t&&t[S])}var v="@@__IMMUTABLE_INDEXED__@@";function M(t){return Boolean(t&&t[v])}function T(t){return b(t)||M(t)}var w=function(t){return x(t)?t:K(t)},E=function(t){function e(t){return b(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),k=function(t){function e(t){return M(t)?t:Q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),C=function(t){function e(t){return x(t)&&!T(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w);w.Keyed=E,w.Indexed=k,w.Set=C;var D="@@__IMMUTABLE_SEQ__@@";function I(t){return Boolean(t&&t[D])}var _="@@__IMMUTABLE_RECORD__@@";function F(t){return Boolean(t&&t[_])}function L(t){return x(t)||F(t)}var z="@@__IMMUTABLE_ORDERED__@@";function P(t){return Boolean(t&&t[z])}var R=0,V=1,B=2,O="function"==typeof Symbol&&Symbol.iterator,N="@@iterator",U=O||N,G=function(t){this.next=t};function W(t,e,i,s){var n=0===t?e:1===t?i:[e,i];return s?s.value=n:s={value:n,done:!1},s}function Y(){return{value:void 0,done:!0}}function H(t){return!!Array.isArray(t)||!!$(t)}function X(t){return t&&"function"==typeof t.next}function j(t){var e=$(t);return e&&e.call(t)}function $(t){var e=t&&(O&&t[O]||t[N]);if("function"==typeof e)return e}G.prototype.toString=function(){return"[Iterator]"},G.KEYS=R,G.VALUES=V,G.ENTRIES=B,G.prototype.inspect=G.prototype.toSource=function(){return this.toString()},G.prototype[U]=function(){return this};var q=Object.prototype.hasOwnProperty;function J(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 K=function(t){function e(t){return null==t?rt():L(t)?t.toSeq():function(t){var e,i,s=ht(t);if(s)return(i=$(e=t))&&i===e.entries?s.fromEntrySeq():function(t){var e=$(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,n=0;n!==s;){var r=i[e?s-++n:n++];if(!1===t(r[1],r[0],this))break}return n}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var i=this._cache;if(i){var s=i.length,n=0;return new G((function(){if(n===s)return{value:void 0,done:!0};var r=i[e?s-++n:n++];return W(t,r[0],r[1])}))}return this.__iteratorUncached(t,e)},e}(w),Z=function(t){function e(t){return null==t?rt().toKeyedSeq():x(t)?b(t)?t.toSeq():t.fromEntrySeq():F(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}(K),Q=function(t){function e(t){return null==t?rt():x(t)?b(t)?t.entrySeq():t.toIndexedSeq():F(t)?t.toSeq().entrySeq():at(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}(K),tt=function(t){function e(t){return(x(t)&&!T(t)?t:Q(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}(K);K.isSeq=I,K.Keyed=Z,K.Set=tt,K.Indexed=Q,K.prototype[D]=!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,n=0;n!==s;){var r=e?s-++n:n++;if(!1===t(i[r],r,this))break}return n},e.prototype.__iterator=function(t,e){var i=this._array,s=i.length,n=0;return new G((function(){if(n===s)return{value:void 0,done:!0};var r=e?s-++n:n++;return W(t,r,i[r])}))},e}(Q),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 q.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var i=this._object,s=this._keys,n=s.length,r=0;r!==n;){var o=s[e?n-++r:r++];if(!1===t(i[o],o,this))break}return r},e.prototype.__iterator=function(t,e){var i=this._object,s=this._keys,n=s.length,r=0;return new G((function(){if(r===n)return{value:void 0,done:!0};var o=s[e?n-++r:r++];return W(t,o,i[o])}))},e}(Z);it.prototype[z]=!0;var st,nt=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=j(this._collection),s=0;if(X(i))for(var n;!(n=i.next()).done&&!1!==t(n.value,s++,this););return s},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var i=j(this._collection);if(!X(i))return new G(Y);var s=0;return new G((function(){var e=i.next();return e.done?e:W(t,s++,e.value)}))},e}(Q);function rt(){return st||(st=new et([]))}function ot(t){var e=ht(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 at(t){var e=ht(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function ht(t){return J(t)?new et(t):H(t)?new nt(t):void 0}var lt="@@__IMMUTABLE_MAP__@@";function ut(t){return Boolean(t&&t[lt])}function ct(t){return ut(t)&&P(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 mt(t){return t>>>1&1073741824|3221225471&t}var pt=Object.prototype.valueOf;function yt(t){if(null==t)return At(t);if("function"==typeof t.hashCode)return mt(t.hashCode(t));var e,i,s,n=(e=t).valueOf!==pt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==n)return At(n);switch(typeof n){case"boolean":return n?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 mt(e)}(n);case"string":return n.length>Ct?(void 0===(s=_t[i=n])&&(s=xt(i),It===Dt&&(It=0,_t={}),It++,_t[i]=s),s):xt(n);case"object":case"function":return function(t){var e;if(Tt&&void 0!==(e=Mt.get(t)))return e;if(void 0!==(e=t[kt]))return e;if(!bt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[kt]))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=vt(),Tt)Mt.set(t,e);else{if(void 0!==St&&!1===St(t))throw new Error("Non-extensible objects are not allowed as keys.");if(bt)Object.defineProperty(t,kt,{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[kt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[kt]=e}}return e}(n);case"symbol":return function(t){var e=wt[t];return void 0!==e||(e=vt(),wt[t]=e),e}(n);default:if("function"==typeof n.toString)return xt(n.toString());throw new Error("Value type "+typeof n+" cannot be hashed.")}}function At(t){return null===t?1108378658:1108378659}function xt(t){for(var e=0,i=0;i=0&&(l.get=function(e,i){return(e=c(this,e))>=0&&ea)return{value:void 0,done:!0};var t=n.next();return s||e===V||t.done?t:W(e,h-1,e===R?void 0:t.value[1],t)}))},l}function Ut(t,e,i,s){var n=Jt(t);return n.__iterateUncached=function(n,r){var o=this;if(r)return this.cacheResult().__iterate(n,r);var a=!0,h=0;return t.__iterate((function(t,r,l){if(!a||!(a=e.call(i,t,r,l)))return h++,n(t,s?r:h-1,o)})),h},n.__iteratorUncached=function(n,r){var o=this;if(r)return this.cacheResult().__iterator(n,r);var a=t.__iterator(B,r),h=!0,l=0;return new G((function(){var t,r,u;do{if((t=a.next()).done)return s||n===V?t:W(n,l++,n===R?void 0:t.value[1],t);var c=t.value;r=c[0],u=c[1],h&&(h=e.call(i,u,r,o))}while(h);return n===B?t:W(n,r,u,t)}))},n}function Gt(t,e,i){var s=Jt(t);return s.__iterateUncached=function(n,r){if(r)return this.cacheResult().__iterate(n,r);var o=0,a=!1;return function t(h,l){h.__iterate((function(r,h){return(!e||l0}function Xt(t,e,i,s){var n=Jt(t),r=new et(i).map((function(t){return t.size}));return n.size=s?r.max():r.min(),n.__iterate=function(t,e){for(var i,s=this.__iterator(V,e),n=0;!(i=s.next()).done&&!1!==t(i.value,n++,this););return n},n.__iteratorUncached=function(t,n){var r=i.map((function(t){return t=w(t),j(n?t.reverse():t)})),o=0,a=!1;return new G((function(){var i;return a||(i=r.map((function(t){return t.next()})),a=s?i.every((function(t){return t.done})):i.some((function(t){return t.done}))),a?{value:void 0,done:!0}:W(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},n}function jt(t,e){return t===e?t:I(t)?e:t.constructor(e)}function $t(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function qt(t){return b(t)?E:M(t)?k:C}function Jt(t){return Object.create((b(t)?Z:M(t)?Q:tt).prototype)}function Kt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):K.prototype.cacheResult.call(this)}function Zt(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=[],n=0;n0;)e[i]=arguments[i+1];return De(t,e)}function we(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return De(e,i,t)}function Ee(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Ce(t,e)}function ke(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Ce(e,i,t)}function Ce(t,e,i){return De(t,e,function(t){return function e(i,s,n){return re(i)&&re(s)&&(r=s,o=K(i),a=K(r),M(o)===M(a)&&b(o)===b(a))?De(i,[s],e):t?t(i,s,n):s;var r,o,a}}(i))}function De(t,e,i){if(!re(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(L(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),n=t,r=s?k:E,o=s?function(e){n===t&&(n=le(n)),n.push(e)}:function(e,s){var r=q.call(n,s),o=r&&i?i(n[s],e,s):e;r&&o===n[s]||(n===t&&(n=le(n)),n[s]=o)},a=0;a0;)e[i]=arguments[i+1];return Ce(this,e,t)}function Fe(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Je(),(function(t){return De(t,e)}))}function Le(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Je(),(function(t){return Ce(t,e)}))}function ze(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Pe(){return this.__ownerID?this:this.__ensureOwner(new l)}function Re(){return this.__ensureOwner()}function Ve(){return this.__altered}var Be=function(t){function e(e){return null==e?Je():ut(e)&&!P(e)?e:Je().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 Je().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 Ke(this,t,e)},e.prototype.remove=function(t){return Ke(this,t,a)},e.prototype.deleteAll=function(t){var e=w(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):Je()},e.prototype.sort=function(t){return vi(Wt(this,t))},e.prototype.sortBy=function(t,e){return vi(Wt(this,e,t))},e.prototype.map=function(t,e){var i=this;return this.withMutations((function(s){s.forEach((function(n,r){s.set(r,t.call(e,n,r,i))}))}))},e.prototype.__iterator=function(t,e){return new Xe(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?qe(this.size,this._root,t,this.__hash):0===this.size?Je():(this.__ownerID=t,this.__altered=!1,this)},e}(E);Be.isMap=ut;var Oe=Be.prototype;Oe[lt]=!0,Oe[s]=Oe.remove,Oe.removeAll=Oe.deleteAll,Oe.setIn=me,Oe.removeIn=Oe.deleteIn=ye,Oe.update=xe,Oe.updateIn=Se,Oe.merge=Oe.concat=be,Oe.mergeWith=ve,Oe.mergeDeep=Ie,Oe.mergeDeepWith=_e,Oe.mergeIn=Fe,Oe.mergeDeepIn=Le,Oe.withMutations=ze,Oe.wasAltered=Ve,Oe.asImmutable=Re,Oe["@@transducer/init"]=Oe.asMutable=Pe,Oe["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Oe["@@transducer/result"]=function(t){return t.asImmutable()};var Ne=function(t,e){this.ownerID=t,this.entries=e};Ne.prototype.get=function(t,e,i,s){for(var n=this.entries,r=0,o=n.length;r=si)return function(t,e,i,s){t||(t=new l);for(var n=new Ye(t,yt(i),[i,s]),r=0;r>>t)&o),a=this.bitmap;return a&r?this.nodes[ei(a&r-1)].get(t+n,e,i,s):s},Ue.prototype.update=function(t,e,i,s,h,l,u){void 0===i&&(i=yt(s));var c=(0===e?i:i>>>e)&o,d=1<=ni)return function(t,e,i,s,n){for(var o=0,a=new Array(r),h=0;0!==i;h++,i>>>=1)a[h]=1&i?e[o++]:void 0;return a[s]=n,new Ge(t,o+1,a)}(t,p,f,c,A);if(g&&!A&&2===p.length&&Qe(p[1^m]))return p[1^m];if(g&&A&&1===p.length&&Qe(A))return A;var x=t&&t===this.ownerID,S=g?A?f:f^d:f|d,b=g?A?ii(p,m,A,x):function(t,e,i){var s=t.length-1;if(i&&e===s)return t.pop(),t;for(var n=new Array(s),r=0,o=0;o>>t)&o,a=this.nodes[r];return a?a.get(t+n,e,i,s):s},Ge.prototype.update=function(t,e,i,s,r,h,l){void 0===i&&(i=yt(s));var u=(0===e?i:i>>>e)&o,c=r===a,d=this.nodes,f=d[u];if(c&&!f)return this;var g=Ze(f,t,e+n,i,s,r,h,l);if(g===f)return this;var m=this.count;if(f){if(!g&&--m>>i)&o,l=(0===i?s:s>>>i)&o,u=h===l?[ti(t,e,i+n,s,r)]:(a=new Ye(e,s,r),h>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function ii(t,e,i,s){var n=s?t:Qt(t);return n[e]=i,n}var si=r/4,ni=r/2,ri=r/4,oi="@@__IMMUTABLE_LIST__@@";function ai(t){return Boolean(t&&t[oi])}var hi=function(t){function e(e){var i=mi();if(null==e)return i;if(ai(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?xi(t,e).set(0,i):xi(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,n=t._root,r={value:!1};return e>=Si(t._capacity)?s=pi(s,t.__ownerID,0,e,i,r):n=pi(n,t.__ownerID,t._level,e,i,r),r.value?t.__ownerID?(t._root=n,t._tail=s,t.__hash=void 0,t.__altered=!0,t):gi(t._origin,t._capacity,t._level,n,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=n,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):mi()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){xi(i,0,e+t.length);for(var s=0;s>>e&o;if(s>=this.array.length)return new ui([],t);var r,a=0===s;if(e>0){var h=this.array[s];if((r=h&&h.removeBefore(t,e-n,i))===h&&a)return this}if(a&&!r)return this;var l=yi(this,t);if(!a)for(var u=0;u>>e&o;if(r>=this.array.length)return this;if(e>0){var a=this.array[r];if((s=a&&a.removeAfter(t,e-n,i))===a&&r===this.array.length-1)return this}var h=yi(this,t);return h.array.splice(r+1),s&&(h.array[r]=s),h};var ci,di={};function fi(t,e){var i=t._origin,s=t._capacity,o=Si(s),a=t._tail;return function t(h,l,u){return 0===l?function(t,n){var h=n===o?a&&a.array:t&&t.array,l=n>i?0:i-n,u=s-n;return u>r&&(u=r),function(){if(l===u)return di;var t=e?--u:l++;return h&&h[t]}}(h,u):function(o,a,h){var l,u=o&&o.array,c=h>i?0:i-h>>a,d=1+(s-h>>a);return d>r&&(d=r),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],a-n,h+(s<>>i&o,c=t&&u0){var d=t&&t.array[u],f=pi(d,e,i-n,s,r,a);return f===d?t:((l=yi(t,e)).array[u]=f,l)}return c&&t.array[u]===r?t:(a&&h(a),l=yi(t,e),void 0===r&&u===l.array.length-1?l.array.pop():l.array[u]=r,l)}function yi(t,e){return e&&t&&e===t.ownerID?t:new ui(t?t.array.slice():[],e)}function Ai(t,e){if(e>=Si(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&o],s-=n;return i}}function xi(t,e,i){void 0!==e&&(e|=0),void 0!==i&&(i|=0);var s=t.__ownerID||new l,r=t._origin,a=t._capacity,h=r+e,u=void 0===i?a:i<0?a+i:r+i;if(h===r&&u===a)return t;if(h>=u)return t.clear();for(var c=t._level,d=t._root,f=0;h+f<0;)d=new ui(d&&d.array.length?[void 0,d]:[],s),f+=1<<(c+=n);f&&(h+=f,r+=f,u+=f,a+=f);for(var g=Si(a),m=Si(u);m>=1<g?new ui([],s):p;if(p&&m>g&&hn;x-=n){var S=g>>>x&o;A=A.array[S]=yi(A.array[S],s)}A.array[g>>>n&o]=p}if(u=m)h-=m,u-=m,c=n,d=null,y=y&&y.removeBefore(s,0,h);else if(h>r||m>>c&o;if(b!==m>>>c&o)break;b&&(f+=(1<r&&(d=d.removeBefore(s,c,h-f)),d&&m>>n<=r&&h.size>=2*o.size?(s=(n=h.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=n.__ownerID=t.__ownerID)):(s=o.remove(e),n=l===h.size-1?h.pop():h.set(l,void 0))}else if(u){if(i===h.get(l)[1])return t;s=o,n=h.set(l,[e,i])}else s=o.set(e,h.size),n=h.set(h.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=n,t.__hash=void 0,t.__altered=!0,t):Mi(s,n)}vi.isOrderedMap=ct,vi.prototype[z]=!0,vi.prototype[s]=vi.prototype.remove;var Ei="@@__IMMUTABLE_STACK__@@";function ki(t){return Boolean(t&&t[Ei])}var Ci=function(t){function e(t){return null==t?Fi():ki(t)?t:Fi().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):_i(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&ki(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):_i(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):Fi()},e.prototype.slice=function(e,i){if(f(e,i,this.size))return this;var s=g(e,this.size);if(m(i,this.size)!==this.size)return t.prototype.slice.call(this,e,i);for(var n=this.size-s,r=this._head;s--;)r=r.next;return this.__ownerID?(this.size=n,this._head=r,this.__hash=void 0,this.__altered=!0,this):_i(n,r)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?_i(this.size,this._head,t,this.__hash):0===this.size?Fi():(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,n=this._head;n&&!1!==t(n.value,s++,this);)n=n.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 G((function(){if(s){var e=s.value;return s=s.next,W(t,i++,e)}return{value:void 0,done:!0}}))},e}(k);Ci.isStack=ki;var Di,Ii=Ci.prototype;function _i(t,e,i,s){var n=Object.create(Ii);return n.size=t,n._head=e,n.__ownerID=i,n.__hash=s,n.__altered=!1,n}function Fi(){return Di||(Di=_i(0))}Ii[Ei]=!0,Ii.shift=Ii.pop,Ii.unshift=Ii.push,Ii.unshiftAll=Ii.pushAll,Ii.withMutations=ze,Ii.wasAltered=Ve,Ii.asImmutable=Re,Ii["@@transducer/init"]=Ii.asMutable=Pe,Ii["@@transducer/step"]=function(t,e){return t.unshift(e)},Ii["@@transducer/result"]=function(t){return t.asImmutable()};var Li="@@__IMMUTABLE_SET__@@";function zi(t){return Boolean(t&&t[Li])}function Pi(t){return zi(t)&&P(t)}function Ri(t,e){if(t===e)return!0;if(!x(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||b(t)!==b(e)||M(t)!==M(e)||P(t)!==P(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!T(t);if(P(t)){var s=t.entries();return e.every((function(t,e){var n=s.next().value;return n&&ft(n[1],t)&&(i||ft(n[0],e))}))&&s.next().done}var n=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{n=!0;var r=t;t=e,e=r}var o=!0,h=e.__iterate((function(e,s){if(i?!t.has(e):n?!ft(e,t.get(s,a)):!ft(t.get(s,a),e))return o=!1,!1}));return o&&t.size===h}function Vi(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 Bi(t){if(!t||"object"!=typeof t)return t;if(!x(t)){if(!re(t))return t;t=K(t)}if(b(t)){var e={};return t.__iterate((function(t,i){e[i]=Bi(t)})),e}var i=[];return t.__iterate((function(t){i.push(Bi(t))})),i}var Oi=function(t){function e(e){return null==e?Yi():zi(e)&&!P(e)?e:Yi().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(E(t).keySeq())},e.intersect=function(t){return(t=w(t).toArray()).length?Ui.intersect.apply(e(t.pop()),t):Yi()},e.union=function(t){return(t=w(t).toArray()).length?Ui.union.apply(e(t.pop()),t):Yi()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Gi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Gi(this,this._map.remove(t))},e.prototype.clear=function(){return Gi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,n=Gi(this,this._map.mapEntries((function(n){var r=n[1],o=t.call(e,r,r,i);return o!==r&&(s=!0),[o,o]}),e));return s?n: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=mt((e=gt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+hs(yt(t),yt(e))|0}:function(t,e){s=s+hs(yt(t),yt(e))|0}:e?function(t){s=31*s+yt(t)|0}:function(t){s=s+yt(t)|0}),s)}(this))}});var Ki=w.prototype;Ki[A]=!0,Ki[U]=Ki.values,Ki.toJSON=Ki.toArray,Ki.__toStringMapper=oe,Ki.inspect=Ki.toSource=function(){return this.toString()},Ki.chain=Ki.flatMap,Ki.contains=Ki.includes,Vi(E,{flip:function(){return jt(this,Rt(this))},mapEntries:function(t,e){var i=this,s=0;return jt(this,this.toSeq().map((function(n,r){return t.call(e,[r,n],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return jt(this,this.toSeq().flip().map((function(s,n){return t.call(e,s,n,i)})).flip())}});var Zi=E.prototype;Zi[S]=!0,Zi[U]=Ki.entries,Zi.toJSON=Ji,Zi.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Vi(k,{toKeyedSeq:function(){return new Ft(this,!1)},filter:function(t,e){return jt(this,Ot(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 jt(this,Bt(this,!1))},slice:function(t,e){return jt(this,Nt(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 jt(this,1===i?s:s.concat(Qt(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 jt(this,Gt(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 hs(t,e){return t^e+2654435769+(t<<6)+(t>>2)}ts.has=Ki.includes,ts.contains=ts.includes,ts.keys=ts.values,Vi(Z,Zi),Vi(Q,Qi),Vi(tt,ts);var ls=function(t){function e(t){return null==t?fs():Pi(t)?t:fs().withMutations((function(e){var i=C(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(E(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Oi);ls.isOrderedSet=Pi;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(Ti()))}cs[z]=!0,cs.zip=Qi.zip,cs.zipWith=Qi.zipWith,cs.zipAll=Qi.zipAll,cs.__empty=fs,cs.__make=ds;var gs={LeftThenRight:-1,RightThenLeft:1},ms=function(t,e){var i;!function(t){if(F(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(L(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(r){var o=this;if(r instanceof s)return r;if(!(this instanceof s))return new s(r);if(!i){i=!0;var a=Object.keys(t),h=n._indices={};n._name=e,n._keys=a,n._defaultValues=t;for(var l=0;l2?[]:void 0,{"":t})}function Ts(t,e,i,s,n,r){if("string"!=typeof i&&!L(i)&&(J(i)||H(i)||ne(i))){if(~t.indexOf(i))throw new TypeError("Cannot convert circular structure to Immutable");t.push(i),n&&""!==s&&n.push(s);var o=e.call(r,s,K(i).map((function(s,r){return Ts(t,e,s,r,n,i)})),n&&n.slice());return t.pop(),n&&n.pop(),o}return i}function ws(t,e){return M(e)?e.toList():b(e)?e.toMap():e.toSet()}var Es="4.3.5",ks=w;const Cs={version:Es,Collection:w,Iterable:w,Seq:K,Map:Be,OrderedMap:vi,List:hi,Stack:Ci,Set:Oi,OrderedSet:ls,PairSorting:gs,Record:ms,Range:Xi,Repeat:vs,is:ft,fromJS:Ms,hash:yt,isImmutable:L,isCollection:x,isKeyed:b,isIndexed:M,isAssociative:T,isOrdered:P,isValueObject:dt,isPlainObject:ne,isSeq:I,isList:ai,isMap:ut,isOrderedMap:ct,isStack:ki,isSet:zi,isOrderedSet:Pi,isRecord:F,get:he,getIn:ji,has:ae,hasIn:qi,merge:Te,mergeDeep:Ee,mergeWith:we,mergeDeepWith:ke,remove:ue,removeIn:pe,set:ce,setIn:ge,update:Ae,updateIn:de}},650:function(module){var t;"undefined"!=typeof self&&self,t=function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(s,n,function(e){return t[e]}.bind(null,n));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i(i.s=0)}({"./src/index.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OBJ", function() { return OBJ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });\n/* harmony import */ var _mesh__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mesh */ "./src/mesh.ts");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Mesh", function() { return _mesh__WEBPACK_IMPORTED_MODULE_0__["default"]; });\n\n/* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "./src/material.ts");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Material", function() { return _material__WEBPACK_IMPORTED_MODULE_1__["Material"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MaterialLibrary", function() { return _material__WEBPACK_IMPORTED_MODULE_1__["MaterialLibrary"]; });\n\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layout */ "./src/layout.ts");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Attribute", function() { return _layout__WEBPACK_IMPORTED_MODULE_2__["Attribute"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DuplicateAttributeException", function() { return _layout__WEBPACK_IMPORTED_MODULE_2__["DuplicateAttributeException"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Layout", function() { return _layout__WEBPACK_IMPORTED_MODULE_2__["Layout"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TYPES", function() { return _layout__WEBPACK_IMPORTED_MODULE_2__["TYPES"]; });\n\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./src/utils.ts");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "downloadModels", function() { return _utils__WEBPACK_IMPORTED_MODULE_3__["downloadModels"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "downloadMeshes", function() { return _utils__WEBPACK_IMPORTED_MODULE_3__["downloadMeshes"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initMeshBuffers", function() { return _utils__WEBPACK_IMPORTED_MODULE_3__["initMeshBuffers"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deleteMeshBuffers", function() { return _utils__WEBPACK_IMPORTED_MODULE_3__["deleteMeshBuffers"]; });\n\n\n\n\n\nconst version = "2.0.3";\nconst OBJ = {\n Attribute: _layout__WEBPACK_IMPORTED_MODULE_2__["Attribute"],\n DuplicateAttributeException: _layout__WEBPACK_IMPORTED_MODULE_2__["DuplicateAttributeException"],\n Layout: _layout__WEBPACK_IMPORTED_MODULE_2__["Layout"],\n Material: _material__WEBPACK_IMPORTED_MODULE_1__["Material"],\n MaterialLibrary: _material__WEBPACK_IMPORTED_MODULE_1__["MaterialLibrary"],\n Mesh: _mesh__WEBPACK_IMPORTED_MODULE_0__["default"],\n TYPES: _layout__WEBPACK_IMPORTED_MODULE_2__["TYPES"],\n downloadModels: _utils__WEBPACK_IMPORTED_MODULE_3__["downloadModels"],\n downloadMeshes: _utils__WEBPACK_IMPORTED_MODULE_3__["downloadMeshes"],\n initMeshBuffers: _utils__WEBPACK_IMPORTED_MODULE_3__["initMeshBuffers"],\n deleteMeshBuffers: _utils__WEBPACK_IMPORTED_MODULE_3__["deleteMeshBuffers"],\n version,\n};\n/**\n * @namespace\n */\n\n\n\n//# sourceURL=webpack:///./src/index.ts?')},"./src/layout.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPES", function() { return TYPES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DuplicateAttributeException", function() { return DuplicateAttributeException; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Attribute", function() { return Attribute; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Layout", function() { return Layout; });\nvar TYPES;\n(function (TYPES) {\n TYPES["BYTE"] = "BYTE";\n TYPES["UNSIGNED_BYTE"] = "UNSIGNED_BYTE";\n TYPES["SHORT"] = "SHORT";\n TYPES["UNSIGNED_SHORT"] = "UNSIGNED_SHORT";\n TYPES["FLOAT"] = "FLOAT";\n})(TYPES || (TYPES = {}));\n/**\n * An exception for when two or more of the same attributes are found in the\n * same layout.\n * @private\n */\nclass DuplicateAttributeException extends Error {\n /**\n * Create a DuplicateAttributeException\n * @param {Attribute} attribute - The attribute that was found more than\n * once in the {@link Layout}\n */\n constructor(attribute) {\n super(`found duplicate attribute: ${attribute.key}`);\n }\n}\n/**\n * Represents how a vertex attribute should be packed into an buffer.\n * @private\n */\nclass Attribute {\n /**\n * Create an attribute. Do not call this directly, use the predefined\n * constants.\n * @param {string} key - The name of this attribute as if it were a key in\n * an Object. Use the camel case version of the upper snake case\n * const name.\n * @param {number} size - The number of components per vertex attribute.\n * Must be 1, 2, 3, or 4.\n * @param {string} type - The data type of each component for this\n * attribute. Possible values:
\n * "BYTE": signed 8-bit integer, with values in [-128, 127]
\n * "SHORT": signed 16-bit integer, with values in\n * [-32768, 32767]
\n * "UNSIGNED_BYTE": unsigned 8-bit integer, with values in\n * [0, 255]
\n * "UNSIGNED_SHORT": unsigned 16-bit integer, with values in\n * [0, 65535]
\n * "FLOAT": 32-bit floating point number\n * @param {boolean} normalized - Whether integer data values should be\n * normalized when being casted to a float.
\n * If true, signed integers are normalized to [-1, 1].
\n * If true, unsigned integers are normalized to [0, 1].
\n * For type "FLOAT", this parameter has no effect.\n */\n constructor(key, size, type, normalized = false) {\n this.key = key;\n this.size = size;\n this.type = type;\n this.normalized = normalized;\n switch (type) {\n case "BYTE":\n case "UNSIGNED_BYTE":\n this.sizeOfType = 1;\n break;\n case "SHORT":\n case "UNSIGNED_SHORT":\n this.sizeOfType = 2;\n break;\n case "FLOAT":\n this.sizeOfType = 4;\n break;\n default:\n throw new Error(`Unknown gl type: ${type}`);\n }\n this.sizeInBytes = this.sizeOfType * size;\n }\n}\n/**\n * A class to represent the memory layout for a vertex attribute array. Used by\n * {@link Mesh}\'s TBD(...) method to generate a packed array from mesh data.\n *

\n * Layout can sort of be thought of as a C-style struct declaration.\n * {@link Mesh}\'s TBD(...) method will use the {@link Layout} instance to\n * pack an array in the given attribute order.\n *

\n * Layout also is very helpful when calling a WebGL context\'s\n * vertexAttribPointer method. If you\'ve created a buffer using\n * a Layout instance, then the same Layout instance can be used to determine\n * the size, type, normalized, stride, and offset parameters for\n * vertexAttribPointer.\n *

\n * For example:\n *

\n *\n * const index = glctx.getAttribLocation(shaderProgram, "pos");\n * glctx.vertexAttribPointer(\n *   layout.position.size,\n *   glctx[layout.position.type],\n *   layout.position.normalized,\n *   layout.position.stride,\n *   layout.position.offset);\n * 
\n * @see {@link Mesh}\n */\nclass Layout {\n /**\n * Create a Layout object. This constructor will throw if any duplicate\n * attributes are given.\n * @param {Array} ...attributes - An ordered list of attributes that\n * describe the desired memory layout for each vertex attribute.\n *

\n *\n * @see {@link Mesh}\n */\n constructor(...attributes) {\n this.attributes = attributes;\n this.attributeMap = {};\n let offset = 0;\n let maxStrideMultiple = 0;\n for (const attribute of attributes) {\n if (this.attributeMap[attribute.key]) {\n throw new DuplicateAttributeException(attribute);\n }\n // Add padding to satisfy WebGL\'s requirement that all\n // vertexAttribPointer calls have an offset that is a multiple of\n // the type size.\n if (offset % attribute.sizeOfType !== 0) {\n offset += attribute.sizeOfType - (offset % attribute.sizeOfType);\n console.warn("Layout requires padding before " + attribute.key + " attribute");\n }\n this.attributeMap[attribute.key] = {\n attribute: attribute,\n size: attribute.size,\n type: attribute.type,\n normalized: attribute.normalized,\n offset: offset,\n };\n offset += attribute.sizeInBytes;\n maxStrideMultiple = Math.max(maxStrideMultiple, attribute.sizeOfType);\n }\n // Add padding to the end to satisfy WebGL\'s requirement that all\n // vertexAttribPointer calls have a stride that is a multiple of the\n // type size. Because we\'re putting differently sized attributes into\n // the same buffer, it must be padded to a multiple of the largest\n // type size.\n if (offset % maxStrideMultiple !== 0) {\n offset += maxStrideMultiple - (offset % maxStrideMultiple);\n console.warn("Layout requires padding at the back");\n }\n this.stride = offset;\n for (const attribute of attributes) {\n this.attributeMap[attribute.key].stride = this.stride;\n }\n }\n}\n// Geometry attributes\n/**\n * Attribute layout to pack a vertex\'s x, y, & z as floats\n *\n * @see {@link Layout}\n */\nLayout.POSITION = new Attribute("position", 3, TYPES.FLOAT);\n/**\n * Attribute layout to pack a vertex\'s normal\'s x, y, & z as floats\n *\n * @see {@link Layout}\n */\nLayout.NORMAL = new Attribute("normal", 3, TYPES.FLOAT);\n/**\n * Attribute layout to pack a vertex\'s normal\'s x, y, & z as floats.\n *

\n * This value will be computed on-the-fly based on the texture coordinates.\n * If no texture coordinates are available, the generated value will default to\n * 0, 0, 0.\n *\n * @see {@link Layout}\n */\nLayout.TANGENT = new Attribute("tangent", 3, TYPES.FLOAT);\n/**\n * Attribute layout to pack a vertex\'s normal\'s bitangent x, y, & z as floats.\n *

\n * This value will be computed on-the-fly based on the texture coordinates.\n * If no texture coordinates are available, the generated value will default to\n * 0, 0, 0.\n * @see {@link Layout}\n */\nLayout.BITANGENT = new Attribute("bitangent", 3, TYPES.FLOAT);\n/**\n * Attribute layout to pack a vertex\'s texture coordinates\' u & v as floats\n *\n * @see {@link Layout}\n */\nLayout.UV = new Attribute("uv", 2, TYPES.FLOAT);\n// Material attributes\n/**\n * Attribute layout to pack an unsigned short to be interpreted as a the index\n * into a {@link Mesh}\'s materials list.\n *

\n * The intention of this value is to send all of the {@link Mesh}\'s materials\n * into multiple shader uniforms and then reference the current one by this\n * vertex attribute.\n *

\n * example glsl code:\n *\n *

\n *  // this is bound using MATERIAL_INDEX\n *  attribute int materialIndex;\n *\n *  struct Material {\n *    vec3 diffuse;\n *    vec3 specular;\n *    vec3 specularExponent;\n *  };\n *\n *  uniform Material materials[MAX_MATERIALS];\n *\n *  // ...\n *\n *  vec3 diffuse = materials[materialIndex];\n *\n * 
\n * TODO: More description & test to make sure subscripting by attributes even\n * works for webgl\n *\n * @see {@link Layout}\n */\nLayout.MATERIAL_INDEX = new Attribute("materialIndex", 1, TYPES.SHORT);\nLayout.MATERIAL_ENABLED = new Attribute("materialEnabled", 1, TYPES.UNSIGNED_SHORT);\nLayout.AMBIENT = new Attribute("ambient", 3, TYPES.FLOAT);\nLayout.DIFFUSE = new Attribute("diffuse", 3, TYPES.FLOAT);\nLayout.SPECULAR = new Attribute("specular", 3, TYPES.FLOAT);\nLayout.SPECULAR_EXPONENT = new Attribute("specularExponent", 3, TYPES.FLOAT);\nLayout.EMISSIVE = new Attribute("emissive", 3, TYPES.FLOAT);\nLayout.TRANSMISSION_FILTER = new Attribute("transmissionFilter", 3, TYPES.FLOAT);\nLayout.DISSOLVE = new Attribute("dissolve", 1, TYPES.FLOAT);\nLayout.ILLUMINATION = new Attribute("illumination", 1, TYPES.UNSIGNED_SHORT);\nLayout.REFRACTION_INDEX = new Attribute("refractionIndex", 1, TYPES.FLOAT);\nLayout.SHARPNESS = new Attribute("sharpness", 1, TYPES.FLOAT);\nLayout.MAP_DIFFUSE = new Attribute("mapDiffuse", 1, TYPES.SHORT);\nLayout.MAP_AMBIENT = new Attribute("mapAmbient", 1, TYPES.SHORT);\nLayout.MAP_SPECULAR = new Attribute("mapSpecular", 1, TYPES.SHORT);\nLayout.MAP_SPECULAR_EXPONENT = new Attribute("mapSpecularExponent", 1, TYPES.SHORT);\nLayout.MAP_DISSOLVE = new Attribute("mapDissolve", 1, TYPES.SHORT);\nLayout.ANTI_ALIASING = new Attribute("antiAliasing", 1, TYPES.UNSIGNED_SHORT);\nLayout.MAP_BUMP = new Attribute("mapBump", 1, TYPES.SHORT);\nLayout.MAP_DISPLACEMENT = new Attribute("mapDisplacement", 1, TYPES.SHORT);\nLayout.MAP_DECAL = new Attribute("mapDecal", 1, TYPES.SHORT);\nLayout.MAP_EMISSIVE = new Attribute("mapEmissive", 1, TYPES.SHORT);\n\n\n//# sourceURL=webpack:///./src/layout.ts?')},"./src/material.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Material", function() { return Material; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaterialLibrary", function() { return MaterialLibrary; });\n/**\n * The Material class.\n */\nclass Material {\n constructor(name) {\n this.name = name;\n /**\n * Constructor\n * @param {String} name the unique name of the material\n */\n // The values for the following attibutes\n // are an array of R, G, B normalized values.\n // Ka - Ambient Reflectivity\n this.ambient = [0, 0, 0];\n // Kd - Defuse Reflectivity\n this.diffuse = [0, 0, 0];\n // Ks\n this.specular = [0, 0, 0];\n // Ke\n this.emissive = [0, 0, 0];\n // Tf\n this.transmissionFilter = [0, 0, 0];\n // d\n this.dissolve = 0;\n // valid range is between 0 and 1000\n this.specularExponent = 0;\n // either d or Tr; valid values are normalized\n this.transparency = 0;\n // illum - the enum of the illumination model to use\n this.illumination = 0;\n // Ni - Set to "normal" (air).\n this.refractionIndex = 1;\n // sharpness\n this.sharpness = 0;\n // map_Kd\n this.mapDiffuse = emptyTextureOptions();\n // map_Ka\n this.mapAmbient = emptyTextureOptions();\n // map_Ks\n this.mapSpecular = emptyTextureOptions();\n // map_Ns\n this.mapSpecularExponent = emptyTextureOptions();\n // map_d\n this.mapDissolve = emptyTextureOptions();\n // map_aat\n this.antiAliasing = false;\n // map_bump or bump\n this.mapBump = emptyTextureOptions();\n // disp\n this.mapDisplacement = emptyTextureOptions();\n // decal\n this.mapDecal = emptyTextureOptions();\n // map_Ke\n this.mapEmissive = emptyTextureOptions();\n // refl - when the reflection type is a cube, there will be multiple refl\n // statements for each side of the cube. If it\'s a spherical\n // reflection, there should only ever be one.\n this.mapReflections = [];\n }\n}\nconst SENTINEL_MATERIAL = new Material("sentinel");\n/**\n * https://en.wikipedia.org/wiki/Wavefront_.obj_file\n * http://paulbourke.net/dataformats/mtl/\n */\nclass MaterialLibrary {\n constructor(data) {\n this.data = data;\n /**\n * Constructs the Material Parser\n * @param mtlData the MTL file contents\n */\n this.currentMaterial = SENTINEL_MATERIAL;\n this.materials = {};\n this.parse();\n }\n /* eslint-disable camelcase */\n /* the function names here disobey camelCase conventions\n to make parsing/routing easier. see the parse function\n documentation for more information. */\n /**\n * Creates a new Material object and adds to the registry.\n * @param tokens the tokens associated with the directive\n */\n parse_newmtl(tokens) {\n const name = tokens[0];\n // console.info(\'Parsing new Material:\', name);\n this.currentMaterial = new Material(name);\n this.materials[name] = this.currentMaterial;\n }\n /**\n * See the documenation for parse_Ka below for a better understanding.\n *\n * Given a list of possible color tokens, returns an array of R, G, and B\n * color values.\n *\n * @param tokens the tokens associated with the directive\n * @return {*} a 3 element array containing the R, G, and B values\n * of the color.\n */\n parseColor(tokens) {\n if (tokens[0] == "spectral") {\n throw new Error("The MTL parser does not support spectral curve files. You will " +\n "need to convert the MTL colors to either RGB or CIEXYZ.");\n }\n if (tokens[0] == "xyz") {\n throw new Error("The MTL parser does not currently support XYZ colors. Either convert the " +\n "XYZ values to RGB or create an issue to add support for XYZ");\n }\n // from my understanding of the spec, RGB values at this point\n // will either be 3 floats or exactly 1 float, so that\'s the check\n // that i\'m going to perform here\n if (tokens.length == 3) {\n const [x, y, z] = tokens;\n return [parseFloat(x), parseFloat(y), parseFloat(z)];\n }\n // Since tokens at this point has a length of 3, we\'re going to assume\n // it\'s exactly 1, skipping the check for 2.\n const value = parseFloat(tokens[0]);\n // in this case, all values are equivalent\n return [value, value, value];\n }\n /**\n * Parse the ambient reflectivity\n *\n * A Ka directive can take one of three forms:\n * - Ka r g b\n * - Ka spectral file.rfl\n * - Ka xyz x y z\n * These three forms are mutually exclusive in that only one\n * declaration can exist per material. It is considered a syntax\n * error otherwise.\n *\n * The "Ka" form specifies the ambient reflectivity using RGB values.\n * The "g" and "b" values are optional. If only the "r" value is\n * specified, then the "g" and "b" values are assigned the value of\n * "r". Values are normally in the range 0.0 to 1.0. Values outside\n * of this range increase or decrease the reflectivity accordingly.\n *\n * The "Ka spectral" form specifies the ambient reflectivity using a\n * spectral curve. "file.rfl" is the name of the ".rfl" file containing\n * the curve data. "factor" is an optional argument which is a multiplier\n * for the values in the .rfl file and defaults to 1.0 if not specified.\n *\n * The "Ka xyz" form specifies the ambient reflectivity using CIEXYZ values.\n * "x y z" are the values of the CIEXYZ color space. The "y" and "z" arguments\n * are optional and take on the value of the "x" component if only "x" is\n * specified. The "x y z" values are normally in the range of 0.0 to 1.0 and\n * increase or decrease ambient reflectivity accordingly outside of that\n * range.\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Ka(tokens) {\n this.currentMaterial.ambient = this.parseColor(tokens);\n }\n /**\n * Diffuse Reflectivity\n *\n * Similar to the Ka directive. Simply replace "Ka" with "Kd" and the rules\n * are the same\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Kd(tokens) {\n this.currentMaterial.diffuse = this.parseColor(tokens);\n }\n /**\n * Spectral Reflectivity\n *\n * Similar to the Ka directive. Simply replace "Ks" with "Kd" and the rules\n * are the same\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Ks(tokens) {\n this.currentMaterial.specular = this.parseColor(tokens);\n }\n /**\n * Emissive\n *\n * The amount and color of light emitted by the object.\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Ke(tokens) {\n this.currentMaterial.emissive = this.parseColor(tokens);\n }\n /**\n * Transmission Filter\n *\n * Any light passing through the object is filtered by the transmission\n * filter, which only allows specific colors to pass through. For example, Tf\n * 0 1 0 allows all of the green to pass through and filters out all of the\n * red and blue.\n *\n * Similar to the Ka directive. Simply replace "Ks" with "Tf" and the rules\n * are the same\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Tf(tokens) {\n this.currentMaterial.transmissionFilter = this.parseColor(tokens);\n }\n /**\n * Specifies the dissolve for the current material.\n *\n * Statement: d [-halo] `factor`\n *\n * Example: "d 0.5"\n *\n * The factor is the amount this material dissolves into the background. A\n * factor of 1.0 is fully opaque. This is the default when a new material is\n * created. A factor of 0.0 is fully dissolved (completely transparent).\n *\n * Unlike a real transparent material, the dissolve does not depend upon\n * material thickness nor does it have any spectral character. Dissolve works\n * on all illumination models.\n *\n * The dissolve statement allows for an optional "-halo" flag which indicates\n * that a dissolve is dependent on the surface orientation relative to the\n * viewer. For example, a sphere with the following dissolve, "d -halo 0.0",\n * will be fully dissolved at its center and will appear gradually more opaque\n * toward its edge.\n *\n * "factor" is the minimum amount of dissolve applied to the material. The\n * amount of dissolve will vary between 1.0 (fully opaque) and the specified\n * "factor". The formula is:\n *\n * dissolve = 1.0 - (N*v)(1.0-factor)\n *\n * @param tokens the tokens associated with the directive\n */\n parse_d(tokens) {\n // this ignores the -halo option as I can\'t find any documentation on what\n // it\'s supposed to be.\n this.currentMaterial.dissolve = parseFloat(tokens.pop() || "0");\n }\n /**\n * The "illum" statement specifies the illumination model to use in the\n * material. Illumination models are mathematical equations that represent\n * various material lighting and shading effects.\n *\n * The illumination number can be a number from 0 to 10. The following are\n * the list of illumination enumerations and their summaries:\n * 0. Color on and Ambient off\n * 1. Color on and Ambient on\n * 2. Highlight on\n * 3. Reflection on and Ray trace on\n * 4. Transparency: Glass on, Reflection: Ray trace on\n * 5. Reflection: Fresnel on and Ray trace on\n * 6. Transparency: Refraction on, Reflection: Fresnel off and Ray trace on\n * 7. Transparency: Refraction on, Reflection: Fresnel on and Ray trace on\n * 8. Reflection on and Ray trace off\n * 9. Transparency: Glass on, Reflection: Ray trace off\n * 10. Casts shadows onto invisible surfaces\n *\n * Example: "illum 2" to specify the "Highlight on" model\n *\n * @param tokens the tokens associated with the directive\n */\n parse_illum(tokens) {\n this.currentMaterial.illumination = parseInt(tokens[0]);\n }\n /**\n * Optical Density (AKA Index of Refraction)\n *\n * Statement: Ni `index`\n *\n * Example: Ni 1.0\n *\n * Specifies the optical density for the surface. `index` is the value\n * for the optical density. The values can range from 0.001 to 10. A value of\n * 1.0 means that light does not bend as it passes through an object.\n * Increasing the optical_density increases the amount of bending. Glass has\n * an index of refraction of about 1.5. Values of less than 1.0 produce\n * bizarre results and are not recommended\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Ni(tokens) {\n this.currentMaterial.refractionIndex = parseFloat(tokens[0]);\n }\n /**\n * Specifies the specular exponent for the current material. This defines the\n * focus of the specular highlight.\n *\n * Statement: Ns `exponent`\n *\n * Example: "Ns 250"\n *\n * `exponent` is the value for the specular exponent. A high exponent results\n * in a tight, concentrated highlight. Ns Values normally range from 0 to\n * 1000.\n *\n * @param tokens the tokens associated with the directive\n */\n parse_Ns(tokens) {\n this.currentMaterial.specularExponent = parseInt(tokens[0]);\n }\n /**\n * Specifies the sharpness of the reflections from the local reflection map.\n *\n * Statement: sharpness `value`\n *\n * Example: "sharpness 100"\n *\n * If a material does not have a local reflection map defined in its material\n * defintions, sharpness will apply to the global reflection map defined in\n * PreView.\n *\n * `value` can be a number from 0 to 1000. The default is 60. A high value\n * results in a clear reflection of objects in the reflection map.\n *\n * Tip: sharpness values greater than 100 introduce aliasing effects in\n * flat surfaces that are viewed at a sharp angle.\n *\n * @param tokens the tokens associated with the directive\n */\n parse_sharpness(tokens) {\n this.currentMaterial.sharpness = parseInt(tokens[0]);\n }\n /**\n * Parses the -cc flag and updates the options object with the values.\n *\n * @param values the values passed to the -cc flag\n * @param options the Object of all image options\n */\n parse_cc(values, options) {\n options.colorCorrection = values[0] == "on";\n }\n /**\n * Parses the -blendu flag and updates the options object with the values.\n *\n * @param values the values passed to the -blendu flag\n * @param options the Object of all image options\n */\n parse_blendu(values, options) {\n options.horizontalBlending = values[0] == "on";\n }\n /**\n * Parses the -blendv flag and updates the options object with the values.\n *\n * @param values the values passed to the -blendv flag\n * @param options the Object of all image options\n */\n parse_blendv(values, options) {\n options.verticalBlending = values[0] == "on";\n }\n /**\n * Parses the -boost flag and updates the options object with the values.\n *\n * @param values the values passed to the -boost flag\n * @param options the Object of all image options\n */\n parse_boost(values, options) {\n options.boostMipMapSharpness = parseFloat(values[0]);\n }\n /**\n * Parses the -mm flag and updates the options object with the values.\n *\n * @param values the values passed to the -mm flag\n * @param options the Object of all image options\n */\n parse_mm(values, options) {\n options.modifyTextureMap.brightness = parseFloat(values[0]);\n options.modifyTextureMap.contrast = parseFloat(values[1]);\n }\n /**\n * Parses and sets the -o, -s, and -t u, v, and w values\n *\n * @param values the values passed to the -o, -s, -t flag\n * @param {Object} option the Object of either the -o, -s, -t option\n * @param {Integer} defaultValue the Object of all image options\n */\n parse_ost(values, option, defaultValue) {\n while (values.length < 3) {\n values.push(defaultValue.toString());\n }\n option.u = parseFloat(values[0]);\n option.v = parseFloat(values[1]);\n option.w = parseFloat(values[2]);\n }\n /**\n * Parses the -o flag and updates the options object with the values.\n *\n * @param values the values passed to the -o flag\n * @param options the Object of all image options\n */\n parse_o(values, options) {\n this.parse_ost(values, options.offset, 0);\n }\n /**\n * Parses the -s flag and updates the options object with the values.\n *\n * @param values the values passed to the -s flag\n * @param options the Object of all image options\n */\n parse_s(values, options) {\n this.parse_ost(values, options.scale, 1);\n }\n /**\n * Parses the -t flag and updates the options object with the values.\n *\n * @param values the values passed to the -t flag\n * @param options the Object of all image options\n */\n parse_t(values, options) {\n this.parse_ost(values, options.turbulence, 0);\n }\n /**\n * Parses the -texres flag and updates the options object with the values.\n *\n * @param values the values passed to the -texres flag\n * @param options the Object of all image options\n */\n parse_texres(values, options) {\n options.textureResolution = parseFloat(values[0]);\n }\n /**\n * Parses the -clamp flag and updates the options object with the values.\n *\n * @param values the values passed to the -clamp flag\n * @param options the Object of all image options\n */\n parse_clamp(values, options) {\n options.clamp = values[0] == "on";\n }\n /**\n * Parses the -bm flag and updates the options object with the values.\n *\n * @param values the values passed to the -bm flag\n * @param options the Object of all image options\n */\n parse_bm(values, options) {\n options.bumpMultiplier = parseFloat(values[0]);\n }\n /**\n * Parses the -imfchan flag and updates the options object with the values.\n *\n * @param values the values passed to the -imfchan flag\n * @param options the Object of all image options\n */\n parse_imfchan(values, options) {\n options.imfChan = values[0];\n }\n /**\n * This only exists for relection maps and denotes the type of reflection.\n *\n * @param values the values passed to the -type flag\n * @param options the Object of all image options\n */\n parse_type(values, options) {\n options.reflectionType = values[0];\n }\n /**\n * Parses the texture\'s options and returns an options object with the info\n *\n * @param tokens all of the option tokens to pass to the texture\n * @return {Object} a complete object of objects to apply to the texture\n */\n parseOptions(tokens) {\n const options = emptyTextureOptions();\n let option;\n let values;\n const optionsToValues = {};\n tokens.reverse();\n while (tokens.length) {\n // token is guaranteed to exists here, hence the explicit "as"\n const token = tokens.pop();\n if (token.startsWith("-")) {\n option = token.substr(1);\n optionsToValues[option] = [];\n }\n else if (option) {\n optionsToValues[option].push(token);\n }\n }\n for (option in optionsToValues) {\n if (!optionsToValues.hasOwnProperty(option)) {\n continue;\n }\n values = optionsToValues[option];\n const optionMethod = this[`parse_${option}`];\n if (optionMethod) {\n optionMethod.bind(this)(values, options);\n }\n }\n return options;\n }\n /**\n * Parses the given texture map line.\n *\n * @param tokens all of the tokens representing the texture\n * @return a complete object of objects to apply to the texture\n */\n parseMap(tokens) {\n // according to wikipedia:\n // (https://en.wikipedia.org/wiki/Wavefront_.obj_file#Vendor_specific_alterations)\n // there is at least one vendor that places the filename before the options\n // rather than after (which is to spec). All options start with a \'-\'\n // so if the first token doesn\'t start with a \'-\', we\'re going to assume\n // it\'s the name of the map file.\n let optionsString;\n let filename = "";\n if (!tokens[0].startsWith("-")) {\n [filename, ...optionsString] = tokens;\n }\n else {\n filename = tokens.pop();\n optionsString = tokens;\n }\n const options = this.parseOptions(optionsString);\n options.filename = filename.replace(/\\\\/g, "/");\n return options;\n }\n /**\n * Parses the ambient map.\n *\n * @param tokens list of tokens for the map_Ka direcive\n */\n parse_map_Ka(tokens) {\n this.currentMaterial.mapAmbient = this.parseMap(tokens);\n }\n /**\n * Parses the diffuse map.\n *\n * @param tokens list of tokens for the map_Kd direcive\n */\n parse_map_Kd(tokens) {\n this.currentMaterial.mapDiffuse = this.parseMap(tokens);\n }\n /**\n * Parses the specular map.\n *\n * @param tokens list of tokens for the map_Ks direcive\n */\n parse_map_Ks(tokens) {\n this.currentMaterial.mapSpecular = this.parseMap(tokens);\n }\n /**\n * Parses the emissive map.\n *\n * @param tokens list of tokens for the map_Ke direcive\n */\n parse_map_Ke(tokens) {\n this.currentMaterial.mapEmissive = this.parseMap(tokens);\n }\n /**\n * Parses the specular exponent map.\n *\n * @param tokens list of tokens for the map_Ns direcive\n */\n parse_map_Ns(tokens) {\n this.currentMaterial.mapSpecularExponent = this.parseMap(tokens);\n }\n /**\n * Parses the dissolve map.\n *\n * @param tokens list of tokens for the map_d direcive\n */\n parse_map_d(tokens) {\n this.currentMaterial.mapDissolve = this.parseMap(tokens);\n }\n /**\n * Parses the anti-aliasing option.\n *\n * @param tokens list of tokens for the map_aat direcive\n */\n parse_map_aat(tokens) {\n this.currentMaterial.antiAliasing = tokens[0] == "on";\n }\n /**\n * Parses the bump map.\n *\n * @param tokens list of tokens for the map_bump direcive\n */\n parse_map_bump(tokens) {\n this.currentMaterial.mapBump = this.parseMap(tokens);\n }\n /**\n * Parses the bump map.\n *\n * @param tokens list of tokens for the bump direcive\n */\n parse_bump(tokens) {\n this.parse_map_bump(tokens);\n }\n /**\n * Parses the disp map.\n *\n * @param tokens list of tokens for the disp direcive\n */\n parse_disp(tokens) {\n this.currentMaterial.mapDisplacement = this.parseMap(tokens);\n }\n /**\n * Parses the decal map.\n *\n * @param tokens list of tokens for the map_decal direcive\n */\n parse_decal(tokens) {\n this.currentMaterial.mapDecal = this.parseMap(tokens);\n }\n /**\n * Parses the refl map.\n *\n * @param tokens list of tokens for the refl direcive\n */\n parse_refl(tokens) {\n this.currentMaterial.mapReflections.push(this.parseMap(tokens));\n }\n /**\n * Parses the MTL file.\n *\n * Iterates line by line parsing each MTL directive.\n *\n * This function expects the first token in the line\n * to be a valid MTL directive. That token is then used\n * to try and run a method on this class. parse_[directive]\n * E.g., the `newmtl` directive would try to call the method\n * parse_newmtl. Each parsing function takes in the remaining\n * list of tokens and updates the currentMaterial class with\n * the attributes provided.\n */\n parse() {\n const lines = this.data.split(/\\r?\\n/);\n for (let line of lines) {\n line = line.trim();\n if (!line || line.startsWith("#")) {\n continue;\n }\n const [directive, ...tokens] = line.split(/\\s/);\n const parseMethod = this[`parse_${directive}`];\n if (!parseMethod) {\n console.warn(`Don\'t know how to parse the directive: "${directive}"`);\n continue;\n }\n // console.log(`Parsing "${directive}" with tokens: ${tokens}`);\n parseMethod.bind(this)(tokens);\n }\n // some cleanup. These don\'t need to be exposed as public data.\n delete this.data;\n this.currentMaterial = SENTINEL_MATERIAL;\n }\n}\nfunction emptyTextureOptions() {\n return {\n colorCorrection: false,\n horizontalBlending: true,\n verticalBlending: true,\n boostMipMapSharpness: 0,\n modifyTextureMap: {\n brightness: 0,\n contrast: 1,\n },\n offset: { u: 0, v: 0, w: 0 },\n scale: { u: 1, v: 1, w: 1 },\n turbulence: { u: 0, v: 0, w: 0 },\n clamp: false,\n textureResolution: null,\n bumpMultiplier: 1,\n imfChan: null,\n filename: "",\n };\n}\n\n\n//# sourceURL=webpack:///./src/material.ts?')},"./src/mesh.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Mesh; });\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./layout */ "./src/layout.ts");\n\n/**\n * The main Mesh class. The constructor will parse through the OBJ file data\n * and collect the vertex, vertex normal, texture, and face information. This\n * information can then be used later on when creating your VBOs. See\n * OBJ.initMeshBuffers for an example of how to use the newly created Mesh\n */\nclass Mesh {\n /**\n * Create a Mesh\n * @param {String} objectData - a string representation of an OBJ file with\n * newlines preserved.\n * @param {Object} options - a JS object containing valid options. See class\n * documentation for options.\n * @param {bool} options.enableWTextureCoord - Texture coordinates can have\n * an optional "w" coordinate after the u and v coordinates. This extra\n * value can be used in order to perform fancy transformations on the\n * textures themselves. Default is to truncate to only the u an v\n * coordinates. Passing true will provide a default value of 0 in the\n * event that any or all texture coordinates don\'t provide a w value.\n * Always use the textureStride attribute in order to determine the\n * stride length of the texture coordinates when rendering the element\n * array.\n * @param {bool} options.calcTangentsAndBitangents - Calculate the tangents\n * and bitangents when loading of the OBJ is completed. This adds two new\n * attributes to the Mesh instance: `tangents` and `bitangents`.\n */\n constructor(objectData, options) {\n this.name = "";\n this.indicesPerMaterial = [];\n this.materialsByIndex = {};\n this.tangents = [];\n this.bitangents = [];\n options = options || {};\n options.materials = options.materials || {};\n options.enableWTextureCoord = !!options.enableWTextureCoord;\n // the list of unique vertex, normal, texture, attributes\n this.vertexNormals = [];\n this.textures = [];\n // the indicies to draw the faces\n this.indices = [];\n this.textureStride = options.enableWTextureCoord ? 3 : 2;\n /*\n The OBJ file format does a sort of compression when saving a model in a\n program like Blender. There are at least 3 sections (4 including textures)\n within the file. Each line in a section begins with the same string:\n * \'v\': indicates vertex section\n * \'vn\': indicates vertex normal section\n * \'f\': indicates the faces section\n * \'vt\': indicates vertex texture section (if textures were used on the model)\n Each of the above sections (except for the faces section) is a list/set of\n unique vertices.\n\n Each line of the faces section contains a list of\n (vertex, [texture], normal) groups.\n\n **Note:** The following documentation will use a capital "V" Vertex to\n denote the above (vertex, [texture], normal) groups whereas a lowercase\n "v" vertex is used to denote an X, Y, Z coordinate.\n\n Some examples:\n // the texture index is optional, both formats are possible for models\n // without a texture applied\n f 1/25 18/46 12/31\n f 1//25 18//46 12//31\n\n // A 3 vertex face with texture indices\n f 16/92/11 14/101/22 1/69/1\n\n // A 4 vertex face\n f 16/92/11 40/109/40 38/114/38 14/101/22\n\n The first two lines are examples of a 3 vertex face without a texture applied.\n The second is an example of a 3 vertex face with a texture applied.\n The third is an example of a 4 vertex face. Note: a face can contain N\n number of vertices.\n\n Each number that appears in one of the groups is a 1-based index\n corresponding to an item from the other sections (meaning that indexing\n starts at one and *not* zero).\n\n For example:\n `f 16/92/11` is saying to\n - take the 16th element from the [v] vertex array\n - take the 92nd element from the [vt] texture array\n - take the 11th element from the [vn] normal array\n and together they make a unique vertex.\n Using all 3+ unique Vertices from the face line will produce a polygon.\n\n Now, you could just go through the OBJ file and create a new vertex for\n each face line and WebGL will draw what appears to be the same model.\n However, vertices will be overlapped and duplicated all over the place.\n\n Consider a cube in 3D space centered about the origin and each side is\n 2 units long. The front face (with the positive Z-axis pointing towards\n you) would have a Top Right vertex (looking orthogonal to its normal)\n mapped at (1,1,1) The right face would have a Top Left vertex (looking\n orthogonal to its normal) at (1,1,1) and the top face would have a Bottom\n Right vertex (looking orthogonal to its normal) at (1,1,1). Each face\n has a vertex at the same coordinates, however, three distinct vertices\n will be drawn at the same spot.\n\n To solve the issue of duplicate Vertices (the `(vertex, [texture], normal)`\n groups), while iterating through the face lines, when a group is encountered\n the whole group string (\'16/92/11\') is checked to see if it exists in the\n packed.hashindices object, and if it doesn\'t, the indices it specifies\n are used to look up each attribute in the corresponding attribute arrays\n already created. The values are then copied to the corresponding unpacked\n array (flattened to play nice with WebGL\'s ELEMENT_ARRAY_BUFFER indexing),\n the group string is added to the hashindices set and the current unpacked\n index is used as this hashindices value so that the group of elements can\n be reused. The unpacked index is incremented. If the group string already\n exists in the hashindices object, its corresponding value is the index of\n that group and is appended to the unpacked indices array.\n */\n const verts = [];\n const vertNormals = [];\n const textures = [];\n const materialNamesByIndex = [];\n const materialIndicesByName = {};\n // keep track of what material we\'ve seen last\n let currentMaterialIndex = -1;\n let currentObjectByMaterialIndex = 0;\n // unpacking stuff\n const unpacked = {\n verts: [],\n norms: [],\n textures: [],\n hashindices: {},\n indices: [[]],\n materialIndices: [],\n index: 0,\n };\n const VERTEX_RE = /^v\\s/;\n const NORMAL_RE = /^vn\\s/;\n const TEXTURE_RE = /^vt\\s/;\n const FACE_RE = /^f\\s/;\n const WHITESPACE_RE = /\\s+/;\n const USE_MATERIAL_RE = /^usemtl/;\n // array of lines separated by the newline\n const lines = objectData.split("\\n");\n for (let line of lines) {\n line = line.trim();\n if (!line || line.startsWith("#")) {\n continue;\n }\n const elements = line.split(WHITESPACE_RE);\n elements.shift();\n if (VERTEX_RE.test(line)) {\n // if this is a vertex\n verts.push(...elements);\n }\n else if (NORMAL_RE.test(line)) {\n // if this is a vertex normal\n vertNormals.push(...elements);\n }\n else if (TEXTURE_RE.test(line)) {\n let coords = elements;\n // by default, the loader will only look at the U and V\n // coordinates of the vt declaration. So, this truncates the\n // elements to only those 2 values. If W texture coordinate\n // support is enabled, then the texture coordinate is\n // expected to have three values in it.\n if (elements.length > 2 && !options.enableWTextureCoord) {\n coords = elements.slice(0, 2);\n }\n else if (elements.length === 2 && options.enableWTextureCoord) {\n // If for some reason W texture coordinate support is enabled\n // and only the U and V coordinates are given, then we supply\n // the default value of 0 so that the stride length is correct\n // when the textures are unpacked below.\n coords.push("0");\n }\n textures.push(...coords);\n }\n else if (USE_MATERIAL_RE.test(line)) {\n const materialName = elements[0];\n // check to see if we\'ve ever seen it before\n if (!(materialName in materialIndicesByName)) {\n // new material we\'ve never seen\n materialNamesByIndex.push(materialName);\n materialIndicesByName[materialName] = materialNamesByIndex.length - 1;\n // push new array into indices\n // already contains an array at index zero, don\'t add\n if (materialIndicesByName[materialName] > 0) {\n unpacked.indices.push([]);\n }\n }\n // keep track of the current material index\n currentMaterialIndex = materialIndicesByName[materialName];\n // update current index array\n currentObjectByMaterialIndex = currentMaterialIndex;\n }\n else if (FACE_RE.test(line)) {\n // if this is a face\n /*\n split this face into an array of Vertex groups\n for example:\n f 16/92/11 14/101/22 1/69/1\n becomes:\n [\'16/92/11\', \'14/101/22\', \'1/69/1\'];\n */\n const triangles = triangulate(elements);\n for (const triangle of triangles) {\n for (let j = 0, eleLen = triangle.length; j < eleLen; j++) {\n const hash = triangle[j] + "," + currentMaterialIndex;\n if (hash in unpacked.hashindices) {\n unpacked.indices[currentObjectByMaterialIndex].push(unpacked.hashindices[hash]);\n }\n else {\n /*\n Each element of the face line array is a Vertex which has its\n attributes delimited by a forward slash. This will separate\n each attribute into another array:\n \'19/92/11\'\n becomes:\n Vertex = [\'19\', \'92\', \'11\'];\n where\n Vertex[0] is the vertex index\n Vertex[1] is the texture index\n Vertex[2] is the normal index\n Think of faces having Vertices which are comprised of the\n attributes location (v), texture (vt), and normal (vn).\n */\n const vertex = triangle[j].split("/");\n // it\'s possible for faces to only specify the vertex\n // and the normal. In this case, vertex will only have\n // a length of 2 and not 3 and the normal will be the\n // second item in the list with an index of 1.\n const normalIndex = vertex.length - 1;\n /*\n The verts, textures, and vertNormals arrays each contain a\n flattend array of coordinates.\n\n Because it gets confusing by referring to Vertex and then\n vertex (both are different in my descriptions) I will explain\n what\'s going on using the vertexNormals array:\n\n vertex[2] will contain the one-based index of the vertexNormals\n section (vn). One is subtracted from this index number to play\n nice with javascript\'s zero-based array indexing.\n\n Because vertexNormal is a flattened array of x, y, z values,\n simple pointer arithmetic is used to skip to the start of the\n vertexNormal, then the offset is added to get the correct\n component: +0 is x, +1 is y, +2 is z.\n\n This same process is repeated for verts and textures.\n */\n // Vertex position\n unpacked.verts.push(+verts[(+vertex[0] - 1) * 3 + 0]);\n unpacked.verts.push(+verts[(+vertex[0] - 1) * 3 + 1]);\n unpacked.verts.push(+verts[(+vertex[0] - 1) * 3 + 2]);\n // Vertex textures\n if (textures.length) {\n const stride = options.enableWTextureCoord ? 3 : 2;\n unpacked.textures.push(+textures[(+vertex[1] - 1) * stride + 0]);\n unpacked.textures.push(+textures[(+vertex[1] - 1) * stride + 1]);\n if (options.enableWTextureCoord) {\n unpacked.textures.push(+textures[(+vertex[1] - 1) * stride + 2]);\n }\n }\n // Vertex normals\n unpacked.norms.push(+vertNormals[(+vertex[normalIndex] - 1) * 3 + 0]);\n unpacked.norms.push(+vertNormals[(+vertex[normalIndex] - 1) * 3 + 1]);\n unpacked.norms.push(+vertNormals[(+vertex[normalIndex] - 1) * 3 + 2]);\n // Vertex material indices\n unpacked.materialIndices.push(currentMaterialIndex);\n // add the newly created Vertex to the list of indices\n unpacked.hashindices[hash] = unpacked.index;\n unpacked.indices[currentObjectByMaterialIndex].push(unpacked.hashindices[hash]);\n // increment the counter\n unpacked.index += 1;\n }\n }\n }\n }\n }\n this.vertices = unpacked.verts;\n this.vertexNormals = unpacked.norms;\n this.textures = unpacked.textures;\n this.vertexMaterialIndices = unpacked.materialIndices;\n this.indices = unpacked.indices[currentObjectByMaterialIndex];\n this.indicesPerMaterial = unpacked.indices;\n this.materialNames = materialNamesByIndex;\n this.materialIndices = materialIndicesByName;\n this.materialsByIndex = {};\n if (options.calcTangentsAndBitangents) {\n this.calculateTangentsAndBitangents();\n }\n }\n /**\n * Calculates the tangents and bitangents of the mesh that forms an orthogonal basis together with the\n * normal in the direction of the texture coordinates. These are useful for setting up the TBN matrix\n * when distorting the normals through normal maps.\n * Method derived from: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-13-normal-mapping/\n *\n * This method requires the normals and texture coordinates to be parsed and set up correctly.\n * Adds the tangents and bitangents as members of the class instance.\n */\n calculateTangentsAndBitangents() {\n console.assert(!!(this.vertices &&\n this.vertices.length &&\n this.vertexNormals &&\n this.vertexNormals.length &&\n this.textures &&\n this.textures.length), "Missing attributes for calculating tangents and bitangents");\n const unpacked = {\n tangents: [...new Array(this.vertices.length)].map(_ => 0),\n bitangents: [...new Array(this.vertices.length)].map(_ => 0),\n };\n // Loop through all faces in the whole mesh\n const indices = this.indices;\n const vertices = this.vertices;\n const normals = this.vertexNormals;\n const uvs = this.textures;\n for (let i = 0; i < indices.length; i += 3) {\n const i0 = indices[i + 0];\n const i1 = indices[i + 1];\n const i2 = indices[i + 2];\n const x_v0 = vertices[i0 * 3 + 0];\n const y_v0 = vertices[i0 * 3 + 1];\n const z_v0 = vertices[i0 * 3 + 2];\n const x_uv0 = uvs[i0 * 2 + 0];\n const y_uv0 = uvs[i0 * 2 + 1];\n const x_v1 = vertices[i1 * 3 + 0];\n const y_v1 = vertices[i1 * 3 + 1];\n const z_v1 = vertices[i1 * 3 + 2];\n const x_uv1 = uvs[i1 * 2 + 0];\n const y_uv1 = uvs[i1 * 2 + 1];\n const x_v2 = vertices[i2 * 3 + 0];\n const y_v2 = vertices[i2 * 3 + 1];\n const z_v2 = vertices[i2 * 3 + 2];\n const x_uv2 = uvs[i2 * 2 + 0];\n const y_uv2 = uvs[i2 * 2 + 1];\n const x_deltaPos1 = x_v1 - x_v0;\n const y_deltaPos1 = y_v1 - y_v0;\n const z_deltaPos1 = z_v1 - z_v0;\n const x_deltaPos2 = x_v2 - x_v0;\n const y_deltaPos2 = y_v2 - y_v0;\n const z_deltaPos2 = z_v2 - z_v0;\n const x_uvDeltaPos1 = x_uv1 - x_uv0;\n const y_uvDeltaPos1 = y_uv1 - y_uv0;\n const x_uvDeltaPos2 = x_uv2 - x_uv0;\n const y_uvDeltaPos2 = y_uv2 - y_uv0;\n const rInv = x_uvDeltaPos1 * y_uvDeltaPos2 - y_uvDeltaPos1 * x_uvDeltaPos2;\n const r = 1.0 / Math.abs(rInv < 0.0001 ? 1.0 : rInv);\n // Tangent\n const x_tangent = (x_deltaPos1 * y_uvDeltaPos2 - x_deltaPos2 * y_uvDeltaPos1) * r;\n const y_tangent = (y_deltaPos1 * y_uvDeltaPos2 - y_deltaPos2 * y_uvDeltaPos1) * r;\n const z_tangent = (z_deltaPos1 * y_uvDeltaPos2 - z_deltaPos2 * y_uvDeltaPos1) * r;\n // Bitangent\n const x_bitangent = (x_deltaPos2 * x_uvDeltaPos1 - x_deltaPos1 * x_uvDeltaPos2) * r;\n const y_bitangent = (y_deltaPos2 * x_uvDeltaPos1 - y_deltaPos1 * x_uvDeltaPos2) * r;\n const z_bitangent = (z_deltaPos2 * x_uvDeltaPos1 - z_deltaPos1 * x_uvDeltaPos2) * r;\n // Gram-Schmidt orthogonalize\n //t = glm::normalize(t - n * glm:: dot(n, t));\n const x_n0 = normals[i0 * 3 + 0];\n const y_n0 = normals[i0 * 3 + 1];\n const z_n0 = normals[i0 * 3 + 2];\n const x_n1 = normals[i1 * 3 + 0];\n const y_n1 = normals[i1 * 3 + 1];\n const z_n1 = normals[i1 * 3 + 2];\n const x_n2 = normals[i2 * 3 + 0];\n const y_n2 = normals[i2 * 3 + 1];\n const z_n2 = normals[i2 * 3 + 2];\n // Tangent\n const n0_dot_t = x_tangent * x_n0 + y_tangent * y_n0 + z_tangent * z_n0;\n const n1_dot_t = x_tangent * x_n1 + y_tangent * y_n1 + z_tangent * z_n1;\n const n2_dot_t = x_tangent * x_n2 + y_tangent * y_n2 + z_tangent * z_n2;\n const x_resTangent0 = x_tangent - x_n0 * n0_dot_t;\n const y_resTangent0 = y_tangent - y_n0 * n0_dot_t;\n const z_resTangent0 = z_tangent - z_n0 * n0_dot_t;\n const x_resTangent1 = x_tangent - x_n1 * n1_dot_t;\n const y_resTangent1 = y_tangent - y_n1 * n1_dot_t;\n const z_resTangent1 = z_tangent - z_n1 * n1_dot_t;\n const x_resTangent2 = x_tangent - x_n2 * n2_dot_t;\n const y_resTangent2 = y_tangent - y_n2 * n2_dot_t;\n const z_resTangent2 = z_tangent - z_n2 * n2_dot_t;\n const magTangent0 = Math.sqrt(x_resTangent0 * x_resTangent0 + y_resTangent0 * y_resTangent0 + z_resTangent0 * z_resTangent0);\n const magTangent1 = Math.sqrt(x_resTangent1 * x_resTangent1 + y_resTangent1 * y_resTangent1 + z_resTangent1 * z_resTangent1);\n const magTangent2 = Math.sqrt(x_resTangent2 * x_resTangent2 + y_resTangent2 * y_resTangent2 + z_resTangent2 * z_resTangent2);\n // Bitangent\n const n0_dot_bt = x_bitangent * x_n0 + y_bitangent * y_n0 + z_bitangent * z_n0;\n const n1_dot_bt = x_bitangent * x_n1 + y_bitangent * y_n1 + z_bitangent * z_n1;\n const n2_dot_bt = x_bitangent * x_n2 + y_bitangent * y_n2 + z_bitangent * z_n2;\n const x_resBitangent0 = x_bitangent - x_n0 * n0_dot_bt;\n const y_resBitangent0 = y_bitangent - y_n0 * n0_dot_bt;\n const z_resBitangent0 = z_bitangent - z_n0 * n0_dot_bt;\n const x_resBitangent1 = x_bitangent - x_n1 * n1_dot_bt;\n const y_resBitangent1 = y_bitangent - y_n1 * n1_dot_bt;\n const z_resBitangent1 = z_bitangent - z_n1 * n1_dot_bt;\n const x_resBitangent2 = x_bitangent - x_n2 * n2_dot_bt;\n const y_resBitangent2 = y_bitangent - y_n2 * n2_dot_bt;\n const z_resBitangent2 = z_bitangent - z_n2 * n2_dot_bt;\n const magBitangent0 = Math.sqrt(x_resBitangent0 * x_resBitangent0 +\n y_resBitangent0 * y_resBitangent0 +\n z_resBitangent0 * z_resBitangent0);\n const magBitangent1 = Math.sqrt(x_resBitangent1 * x_resBitangent1 +\n y_resBitangent1 * y_resBitangent1 +\n z_resBitangent1 * z_resBitangent1);\n const magBitangent2 = Math.sqrt(x_resBitangent2 * x_resBitangent2 +\n y_resBitangent2 * y_resBitangent2 +\n z_resBitangent2 * z_resBitangent2);\n unpacked.tangents[i0 * 3 + 0] += x_resTangent0 / magTangent0;\n unpacked.tangents[i0 * 3 + 1] += y_resTangent0 / magTangent0;\n unpacked.tangents[i0 * 3 + 2] += z_resTangent0 / magTangent0;\n unpacked.tangents[i1 * 3 + 0] += x_resTangent1 / magTangent1;\n unpacked.tangents[i1 * 3 + 1] += y_resTangent1 / magTangent1;\n unpacked.tangents[i1 * 3 + 2] += z_resTangent1 / magTangent1;\n unpacked.tangents[i2 * 3 + 0] += x_resTangent2 / magTangent2;\n unpacked.tangents[i2 * 3 + 1] += y_resTangent2 / magTangent2;\n unpacked.tangents[i2 * 3 + 2] += z_resTangent2 / magTangent2;\n unpacked.bitangents[i0 * 3 + 0] += x_resBitangent0 / magBitangent0;\n unpacked.bitangents[i0 * 3 + 1] += y_resBitangent0 / magBitangent0;\n unpacked.bitangents[i0 * 3 + 2] += z_resBitangent0 / magBitangent0;\n unpacked.bitangents[i1 * 3 + 0] += x_resBitangent1 / magBitangent1;\n unpacked.bitangents[i1 * 3 + 1] += y_resBitangent1 / magBitangent1;\n unpacked.bitangents[i1 * 3 + 2] += z_resBitangent1 / magBitangent1;\n unpacked.bitangents[i2 * 3 + 0] += x_resBitangent2 / magBitangent2;\n unpacked.bitangents[i2 * 3 + 1] += y_resBitangent2 / magBitangent2;\n unpacked.bitangents[i2 * 3 + 2] += z_resBitangent2 / magBitangent2;\n // TODO: check handedness\n }\n this.tangents = unpacked.tangents;\n this.bitangents = unpacked.bitangents;\n }\n /**\n * @param layout - A {@link Layout} object that describes the\n * desired memory layout of the generated buffer\n * @return The packed array in the ... TODO\n */\n makeBufferData(layout) {\n const numItems = this.vertices.length / 3;\n const buffer = new ArrayBuffer(layout.stride * numItems);\n buffer.numItems = numItems;\n const dataView = new DataView(buffer);\n for (let i = 0, vertexOffset = 0; i < numItems; i++) {\n vertexOffset = i * layout.stride;\n // copy in the vertex data in the order and format given by the\n // layout param\n for (const attribute of layout.attributes) {\n const offset = vertexOffset + layout.attributeMap[attribute.key].offset;\n switch (attribute.key) {\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].POSITION.key:\n dataView.setFloat32(offset, this.vertices[i * 3], true);\n dataView.setFloat32(offset + 4, this.vertices[i * 3 + 1], true);\n dataView.setFloat32(offset + 8, this.vertices[i * 3 + 2], true);\n break;\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].UV.key:\n dataView.setFloat32(offset, this.textures[i * 2], true);\n dataView.setFloat32(offset + 4, this.textures[i * 2 + 1], true);\n break;\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].NORMAL.key:\n dataView.setFloat32(offset, this.vertexNormals[i * 3], true);\n dataView.setFloat32(offset + 4, this.vertexNormals[i * 3 + 1], true);\n dataView.setFloat32(offset + 8, this.vertexNormals[i * 3 + 2], true);\n break;\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].MATERIAL_INDEX.key:\n dataView.setInt16(offset, this.vertexMaterialIndices[i], true);\n break;\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].AMBIENT.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.ambient[0], true);\n dataView.setFloat32(offset + 4, material.ambient[1], true);\n dataView.setFloat32(offset + 8, material.ambient[2], true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].DIFFUSE.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.diffuse[0], true);\n dataView.setFloat32(offset + 4, material.diffuse[1], true);\n dataView.setFloat32(offset + 8, material.diffuse[2], true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].SPECULAR.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.specular[0], true);\n dataView.setFloat32(offset + 4, material.specular[1], true);\n dataView.setFloat32(offset + 8, material.specular[2], true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].SPECULAR_EXPONENT.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.specularExponent, true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].EMISSIVE.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.emissive[0], true);\n dataView.setFloat32(offset + 4, material.emissive[1], true);\n dataView.setFloat32(offset + 8, material.emissive[2], true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].TRANSMISSION_FILTER.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.transmissionFilter[0], true);\n dataView.setFloat32(offset + 4, material.transmissionFilter[1], true);\n dataView.setFloat32(offset + 8, material.transmissionFilter[2], true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].DISSOLVE.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.dissolve, true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].ILLUMINATION.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setInt16(offset, material.illumination, true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].REFRACTION_INDEX.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.refractionIndex, true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].SHARPNESS.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setFloat32(offset, material.sharpness, true);\n break;\n }\n case _layout__WEBPACK_IMPORTED_MODULE_0__["Layout"].ANTI_ALIASING.key: {\n const materialIndex = this.vertexMaterialIndices[i];\n const material = this.materialsByIndex[materialIndex];\n if (!material) {\n console.warn(\'Material "\' +\n this.materialNames[materialIndex] +\n \'" not found in mesh. Did you forget to call addMaterialLibrary(...)?"\');\n break;\n }\n dataView.setInt16(offset, material.antiAliasing ? 1 : 0, true);\n break;\n }\n }\n }\n }\n return buffer;\n }\n makeIndexBufferData() {\n const buffer = new Uint16Array(this.indices);\n buffer.numItems = this.indices.length;\n return buffer;\n }\n makeIndexBufferDataForMaterials(...materialIndices) {\n const indices = new Array().concat(...materialIndices.map(mtlIdx => this.indicesPerMaterial[mtlIdx]));\n const buffer = new Uint16Array(indices);\n buffer.numItems = indices.length;\n return buffer;\n }\n addMaterialLibrary(mtl) {\n for (const name in mtl.materials) {\n if (!(name in this.materialIndices)) {\n // This material is not referenced by the mesh\n continue;\n }\n const material = mtl.materials[name];\n // Find the material index for this material\n const materialIndex = this.materialIndices[material.name];\n // Put the material into the materialsByIndex object at the right\n // spot as determined when the obj file was parsed\n this.materialsByIndex[materialIndex] = material;\n }\n }\n}\nfunction* triangulate(elements) {\n if (elements.length <= 3) {\n yield elements;\n }\n else if (elements.length === 4) {\n yield [elements[0], elements[1], elements[2]];\n yield [elements[2], elements[3], elements[0]];\n }\n else {\n for (let i = 1; i < elements.length - 1; i++) {\n yield [elements[0], elements[i], elements[i + 1]];\n }\n }\n}\n\n\n//# sourceURL=webpack:///./src/mesh.ts?')},"./src/utils.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downloadModels", function() { return downloadModels; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downloadMeshes", function() { return downloadMeshes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initMeshBuffers", function() { return initMeshBuffers; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deleteMeshBuffers", function() { return deleteMeshBuffers; });\n/* harmony import */ var _mesh__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mesh */ "./src/mesh.ts");\n/* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./material */ "./src/material.ts");\n\n\nfunction downloadMtlTextures(mtl, root) {\n const mapAttributes = [\n "mapDiffuse",\n "mapAmbient",\n "mapSpecular",\n "mapDissolve",\n "mapBump",\n "mapDisplacement",\n "mapDecal",\n "mapEmissive",\n ];\n if (!root.endsWith("/")) {\n root += "/";\n }\n const textures = [];\n for (const materialName in mtl.materials) {\n if (!mtl.materials.hasOwnProperty(materialName)) {\n continue;\n }\n const material = mtl.materials[materialName];\n for (const attr of mapAttributes) {\n const mapData = material[attr];\n if (!mapData || !mapData.filename) {\n continue;\n }\n const url = root + mapData.filename;\n textures.push(fetch(url)\n .then(response => {\n if (!response.ok) {\n throw new Error();\n }\n return response.blob();\n })\n .then(function (data) {\n const image = new Image();\n image.src = URL.createObjectURL(data);\n mapData.texture = image;\n return new Promise(resolve => (image.onload = resolve));\n })\n .catch(() => {\n console.error(`Unable to download texture: ${url}`);\n }));\n }\n }\n return Promise.all(textures);\n}\nfunction getMtl(modelOptions) {\n if (!(typeof modelOptions.mtl === "string")) {\n return modelOptions.obj.replace(/\\.obj$/, ".mtl");\n }\n return modelOptions.mtl;\n}\n/**\n * Accepts a list of model request objects and returns a Promise that\n * resolves when all models have been downloaded and parsed.\n *\n * The list of model objects follow this interface:\n * {\n * obj: \'path/to/model.obj\',\n * mtl: true | \'path/to/model.mtl\',\n * downloadMtlTextures: true | false\n * mtlTextureRoot: \'/models/suzanne/maps\'\n * name: \'suzanne\'\n * }\n *\n * The `obj` attribute is required and should be the path to the\n * model\'s .obj file relative to the current repo (absolute URLs are\n * suggested).\n *\n * The `mtl` attribute is optional and can either be a boolean or\n * a path to the model\'s .mtl file relative to the current URL. If\n * the value is `true`, then the path and basename given for the `obj`\n * attribute is used replacing the .obj suffix for .mtl\n * E.g.: {obj: \'models/foo.obj\', mtl: true} would search for \'models/foo.mtl\'\n *\n * The `name` attribute is optional and is a human friendly name to be\n * included with the parsed OBJ and MTL files. If not given, the base .obj\n * filename will be used.\n *\n * The `downloadMtlTextures` attribute is a flag for automatically downloading\n * any images found in the MTL file and attaching them to each Material\n * created from that file. For example, if material.mapDiffuse is set (there\n * was data in the MTL file), then material.mapDiffuse.texture will contain\n * the downloaded image. This option defaults to `true`. By default, the MTL\'s\n * URL will be used to determine the location of the images.\n *\n * The `mtlTextureRoot` attribute is optional and should point to the location\n * on the server that this MTL\'s texture files are located. The default is to\n * use the MTL file\'s location.\n *\n * @returns {Promise} the result of downloading the given list of models. The\n * promise will resolve with an object whose keys are the names of the models\n * and the value is its Mesh object. Each Mesh object will automatically\n * have its addMaterialLibrary() method called to set the given MTL data (if given).\n */\nfunction downloadModels(models) {\n const finished = [];\n for (const model of models) {\n if (!model.obj) {\n throw new Error(\'"obj" attribute of model object not set. The .obj file is required to be set \' +\n "in order to use downloadModels()");\n }\n const options = {\n indicesPerMaterial: !!model.indicesPerMaterial,\n calcTangentsAndBitangents: !!model.calcTangentsAndBitangents,\n };\n // if the name is not provided, dervive it from the given OBJ\n let name = model.name;\n if (!name) {\n const parts = model.obj.split("/");\n name = parts[parts.length - 1].replace(".obj", "");\n }\n const namePromise = Promise.resolve(name);\n const meshPromise = fetch(model.obj)\n .then(response => response.text())\n .then(data => {\n return new _mesh__WEBPACK_IMPORTED_MODULE_0__["default"](data, options);\n });\n let mtlPromise;\n // Download MaterialLibrary file?\n if (model.mtl) {\n const mtl = getMtl(model);\n mtlPromise = fetch(mtl)\n .then(response => response.text())\n .then((data) => {\n const material = new _material__WEBPACK_IMPORTED_MODULE_1__["MaterialLibrary"](data);\n if (model.downloadMtlTextures !== false) {\n let root = model.mtlTextureRoot;\n if (!root) {\n // get the directory of the MTL file as default\n root = mtl.substr(0, mtl.lastIndexOf("/"));\n }\n // downloadMtlTextures returns a Promise that\n // is resolved once all of the images it\n // contains are downloaded. These are then\n // attached to the map data objects\n return Promise.all([Promise.resolve(material), downloadMtlTextures(material, root)]);\n }\n return Promise.all([Promise.resolve(material), undefined]);\n })\n .then((value) => {\n return value[0];\n });\n }\n const parsed = [namePromise, meshPromise, mtlPromise];\n finished.push(Promise.all(parsed));\n }\n return Promise.all(finished).then(ms => {\n // the "finished" promise is a list of name, Mesh instance,\n // and MaterialLibary instance. This unpacks and returns an\n // object mapping name to Mesh (Mesh points to MTL).\n const models = {};\n for (const model of ms) {\n const [name, mesh, mtl] = model;\n mesh.name = name;\n if (mtl) {\n mesh.addMaterialLibrary(mtl);\n }\n models[name] = mesh;\n }\n return models;\n });\n}\n/**\n * Takes in an object of `mesh_name`, `\'/url/to/OBJ/file\'` pairs and a callback\n * function. Each OBJ file will be ajaxed in and automatically converted to\n * an OBJ.Mesh. When all files have successfully downloaded the callback\n * function provided will be called and passed in an object containing\n * the newly created meshes.\n *\n * **Note:** In order to use this function as a way to download meshes, a\n * webserver of some sort must be used.\n *\n * @param {Object} nameAndAttrs an object where the key is the name of the mesh and the value is the url to that mesh\'s OBJ file\n *\n * @param {Function} completionCallback should contain a function that will take one parameter: an object array where the keys will be the unique object name and the value will be a Mesh object\n *\n * @param {Object} meshes In case other meshes are loaded separately or if a previously declared variable is desired to be used, pass in a (possibly empty) json object of the pattern: { \'\': OBJ.Mesh }\n *\n */\nfunction downloadMeshes(nameAndURLs, completionCallback, meshes) {\n if (meshes === undefined) {\n meshes = {};\n }\n const completed = [];\n for (const mesh_name in nameAndURLs) {\n if (!nameAndURLs.hasOwnProperty(mesh_name)) {\n continue;\n }\n const url = nameAndURLs[mesh_name];\n completed.push(fetch(url)\n .then(response => response.text())\n .then(data => {\n return [mesh_name, new _mesh__WEBPACK_IMPORTED_MODULE_0__["default"](data)];\n }));\n }\n Promise.all(completed).then(ms => {\n for (const [name, mesh] of ms) {\n meshes[name] = mesh;\n }\n return completionCallback(meshes);\n });\n}\nfunction _buildBuffer(gl, type, data, itemSize) {\n const buffer = gl.createBuffer();\n const arrayView = type === gl.ARRAY_BUFFER ? Float32Array : Uint16Array;\n gl.bindBuffer(type, buffer);\n gl.bufferData(type, new arrayView(data), gl.STATIC_DRAW);\n buffer.itemSize = itemSize;\n buffer.numItems = data.length / itemSize;\n return buffer;\n}\n/**\n * Takes in the WebGL context and a Mesh, then creates and appends the buffers\n * to the mesh object as attributes.\n *\n * @param {WebGLRenderingContext} gl the `canvas.getContext(\'webgl\')` context instance\n * @param {Mesh} mesh a single `OBJ.Mesh` instance\n *\n * The newly created mesh attributes are:\n *\n * Attrbute | Description\n * :--- | ---\n * **normalBuffer** |contains the model's Vertex Normals\n * normalBuffer.itemSize |set to 3 items\n * normalBuffer.numItems |the total number of vertex normals\n * |\n * **textureBuffer** |contains the model's Texture Coordinates\n * textureBuffer.itemSize |set to 2 items\n * textureBuffer.numItems |the number of texture coordinates\n * |\n * **vertexBuffer** |contains the model's Vertex Position Coordinates (does not include w)\n * vertexBuffer.itemSize |set to 3 items\n * vertexBuffer.numItems |the total number of vertices\n * |\n * **indexBuffer** |contains the indices of the faces\n * indexBuffer.itemSize |is set to 1\n * indexBuffer.numItems |the total number of indices\n *\n * A simple example (a lot of steps are missing, so don\'t copy and paste):\n *\n * const gl = canvas.getContext(\'webgl\'),\n * mesh = OBJ.Mesh(obj_file_data);\n * // compile the shaders and create a shader program\n * const shaderProgram = gl.createProgram();\n * // compilation stuff here\n * ...\n * // make sure you have vertex, vertex normal, and texture coordinate\n * // attributes located in your shaders and attach them to the shader program\n * shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, "aVertexPosition");\n * gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n *\n * shaderProgram.vertexNormalAttribute = gl.getAttribLocation(shaderProgram, "aVertexNormal");\n * gl.enableVertexAttribArray(shaderProgram.vertexNormalAttribute);\n *\n * shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, "aTextureCoord");\n * gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n *\n * // create and initialize the vertex, vertex normal, and texture coordinate buffers\n * // and save on to the mesh object\n * OBJ.initMeshBuffers(gl, mesh);\n *\n * // now to render the mesh\n * gl.bindBuffer(gl.ARRAY_BUFFER, mesh.vertexBuffer);\n * gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, mesh.vertexBuffer.itemSize, gl.FLOAT, false, 0, 0);\n * // it\'s possible that the mesh doesn\'t contain\n * // any texture coordinates (e.g. suzanne.obj in the development branch).\n * // in this case, the texture vertexAttribArray will need to be disabled\n * // before the call to drawElements\n * if(!mesh.textures.length){\n * gl.disableVertexAttribArray(shaderProgram.textureCoordAttribute);\n * }\n * else{\n * // if the texture vertexAttribArray has been previously\n * // disabled, then it needs to be re-enabled\n * gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n * gl.bindBuffer(gl.ARRAY_BUFFER, mesh.textureBuffer);\n * gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, mesh.textureBuffer.itemSize, gl.FLOAT, false, 0, 0);\n * }\n *\n * gl.bindBuffer(gl.ARRAY_BUFFER, mesh.normalBuffer);\n * gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, mesh.normalBuffer.itemSize, gl.FLOAT, false, 0, 0);\n *\n * gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, model.mesh.indexBuffer);\n * gl.drawElements(gl.TRIANGLES, model.mesh.indexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n */\nfunction initMeshBuffers(gl, mesh) {\n mesh.normalBuffer = _buildBuffer(gl, gl.ARRAY_BUFFER, mesh.vertexNormals, 3);\n mesh.textureBuffer = _buildBuffer(gl, gl.ARRAY_BUFFER, mesh.textures, mesh.textureStride);\n mesh.vertexBuffer = _buildBuffer(gl, gl.ARRAY_BUFFER, mesh.vertices, 3);\n mesh.indexBuffer = _buildBuffer(gl, gl.ELEMENT_ARRAY_BUFFER, mesh.indices, 1);\n return mesh;\n}\nfunction deleteMeshBuffers(gl, mesh) {\n gl.deleteBuffer(mesh.normalBuffer);\n gl.deleteBuffer(mesh.textureBuffer);\n gl.deleteBuffer(mesh.vertexBuffer);\n gl.deleteBuffer(mesh.indexBuffer);\n}\n\n\n//# sourceURL=webpack:///./src/utils.ts?')},0:function(module,exports,__webpack_require__){eval('module.exports = __webpack_require__(/*! /home/aaron/google_drive/projects/webgl-obj-loader/src/index.ts */"./src/index.ts");\n\n\n//# sourceURL=webpack:///multi_./src/index.ts?')}})},module.exports=t()},89:(t,e,i)=>{"use strict";Object.defineProperty(e,"i",{value:!0});var s=i(568),n=i(613),r=i(570),o=function(t){if(t&&t.i)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),a=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(r);class h{constructor(){this.o=!0}u(){return this.o}}class l extends h{constructor(t,e){super(),this.S=t,this.o=e}M(t){return t!==this.S&&(this.S=t,this.o=!0),this}_(){return this.S}u(){return super.u()}}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]},m=(t,e)=>({min:t,max:e}),p=(t,e,i,s)=>({x:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(s)}),y=(t,e=!0)=>new l(t,e),A=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),x=A,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}),b=s.Record({type:"color",r:1,g:1,b:1,a:1});class v extends b{constructor(t){super(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.C||(this.C=new v({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.C}getLighter(){return this.T||(this.T=new v({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.T}getDarker(){return this.F||(this.F=new v({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.F}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),T=(t,e,i,s=255)=>new v({r:t/255,g:e/255,b:i/255,a:s/255}),w=t=>{const e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new v({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 v({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 v({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 v({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}`)}},E=(t,e=1,i=1)=>{let s,n,r;t/=360;const o=Math.floor(6*t),a=6*t-o,h=i*(1-e),l=i*(1-a*e),u=i*(1-(1-a)*e);switch(o%6){case 0:s=i,n=u,r=h;break;case 1:s=l,n=i,r=h;break;case 2:s=h,n=i,r=u;break;case 3:s=h,n=l,r=i;break;case 4:s=u,n=h,r=i;break;default:s=i,n=h,r=l}return new v({r:s,g:n,b:r})},k={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"},C=new v({}),D=T(0,0,0,0),I=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,_=(t,e)=>t.value-e.value,F=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:T(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1}),L=t=>{const{steps:e}=t,i=e.length;e.sort(_);const[s,n]=i>0?[e[0].value,e[i-1].value]:[0,0],r=i>0?i-1:0,o=Array(r);for(let t=0;t0&&s!==n}};class z extends F{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,L(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(L({...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,n=[...Array(i)].map((()=>Array(s)));for(let t=0;t=h&&t<=l){if(h===l)return i.color;const e=(t-i.value)/(a.value-i.value);return s=i.color,n=a.color,r=e,new v({r:s.r+(n.r-s.r)*r,g:s.g+(n.g-s.g)*r,b:s.b+(n.b-s.b)*r,a:s.a+(n.a-s.a)*r})}}return t=0;s-=1)if(t>=e[s].value)return e[s].color;return e[0].color}}const P=s.Record({type:"fillstyle",fillType:"empty"});class R extends P{toString(){return"emptyFill"}}const V=new R,B=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),O=s.Record({type:"fillstyle",fillType:"solid",color:T(255,255,255)});class N extends O{}class U extends N{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 G=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType),W=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),Y=s.Record({type:"fillstyle",fillType:"palette",lut:new z({steps:[]}),lookUpProperty:"value"}),H=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),X={linear:(t,e,i)=>{const s=e-t;return n=>ns=>ss=>ss=>s{const e=Qt(t);return(i,s,n)=>{const r=e(i),o=e(s);return e=>e(this.delta===this.duration||this.P)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.L=r,this.eases=t.map((([t,e])=>s(t,e,i)))}R(){this.D.emit("start")}start(){return this.L.includes(this)||this.L.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 n=new j(t,e,i,s,this.L);return this.nextAnimations.push(n),n}onAnimationStart(t,e){return this.D.on("start",t,e)}onAnimationEnd(t,e){return this.D.on("end",t,e)}onEveryAnimationEnd(t,e){return this.D.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.D.on("allEnd",t,e)}allOffAnimationEnd(){return this.D.topicOff("end"),this}allOffEveryAnimationEnd(){return this.D.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.D.topicOff("allEnd"),this}offAnimationEnd(t){return this.D.off(t,"end")}offEveryAnimationEnd(t){return this.D.off(t,"everyEnd")}offAllAnimationEnd(t){return this.D.off(t,"allEnd")}finish(t=!0){if(this.P=!0,this.L.splice(this.L.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.D.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.D.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.D.emit("end",e),this.D.emit("everyEnd",e)),e}t&&(this.D.emit("end",void 0),this.D.emit("everyEnd",void 0),this.D.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(Mt):this.values.map(Mt)}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,n,r=0;const o=()=>{s=void 0;const a=Date.now();n=n||a,r=a-n,r/1e3>=1/e&&(n=Date.now()-r%(1e3/e),i.forEach((t=>{0===t.delta&&t.R(),t.delta+=r-r%(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=St.requestAnimationFrame(o):(s=void 0,n=void 0)};return(t=1e3,e=X.linear)=>(n,r,a=t)=>{const h=new j(n,r,a,e,i).start();return s||(s=St.requestAnimationFrame(o)),h}};var q,J;e.GradientShape=void 0,(q=e.GradientShape||(e.GradientShape={})).circle="circle",q.ellipse="ellipse",e.GradientExtent=void 0,(J=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",J.closestCorner="closest-corner",J.farthestSide="farthest-side",J.farthestCorner="farthest-corner";const K=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class Z extends K{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 Q=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),tt=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],angle:0});class et extends tt{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?fi(t):t)}getAngle(t){return t?di(this.get("angle")):this.get("angle")}}const it=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),st=s.Record({type:"linestyle",lineType:"empty"}),nt=new class extends st{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}V(){return 0}setFillStyle(t){return this}getFillStyle(){return V}},rt=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class ot{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.D=new n.Eventer;const r={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Ne,0),this.cellIndex.x=t.reduce(((t,e,i)=>i>=r.x?t:t+e),0),this.cellSpan.x=t.reduce(((t,e,i)=>i>=r.x&&i{this.cellsAmount.y=t.reduce(Ne,0),this.cellIndex.y=t.reduce(((t,e,i)=>i>=r.y?t:t+e),0),this.cellSpan.y=t.reduce(((t,e,i)=>i>=r.y&&i{s.x.G(e),s.y.G(n)}}}W(){return this.N&&(this.N(),this.N=void 0),this}U(t){return this.D.on("cell-resize",t)}Y(t){return this.D.off(t,"cell-resize")}}class at extends h{constructor(){super(...arguments),this.H=0,this.$=10,this.X=1}j(){return this.o=!1,this}Z(){return this.o=!0,this}getInnerStart(){return this.H}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}J(t,e){return this.H=t,this.$=e,this.K(),this}q(t){return this.X=t,this.K(),this}tt(t){return t/this.X}K(){const t=this.tt(this.$-this.H),e=this.X;void 0!==this.it&&!1!==Et(t,this.it)||(this.o=!0,this.st=e,this.it=t)}et(){return this.it}ht(){return this.st}rt(){return this.$new t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).ot({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new ot({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},lt=(t,e,i)=>e===i?t:i.ut(e.ct(t)),ut=(t,e,i)=>{if(e===i)return t;const s=e instanceof Fi?e.x:e.x instanceof Fi?e.x.x:e.x.dt,n=e instanceof Fi?e.y:e.y instanceof Fi?e.y.y:e.y.dt,r=i instanceof Fi?i.x:i.x instanceof Fi?i.x.x:i.x.dt,o=i instanceof Fi?i.y:i.y instanceof Fi?i.y.y:i.y.dt;return{...t,x:lt(t.x,s,r),y:lt(t.y,n,o)}},ct=(t,e,i)=>{if("axes"===e.id&&"world"===i.id)return e.chart.At.ft(t);if("world"===e.id&&"axes"===i.id)return e.chart.At.yt(t);if(e.id===i.id)return t;throw new Error("LC JS translatePoint3D misusage | originCoordinateSystem and targetCoordinateSystem arguments must be either Chart3D.coordsWorld or Chart3D.coordsAxis")},dt=(...t)=>{if(0===t.length)return{remove:wt};let e=!1;const i=t.map((i=>i.onIntervalChange(((s,n,r)=>((i,s,n)=>{e||(e=!0,t.filter((t=>t!==i)).forEach((t=>t.St(s,n,!1,!1,"synchronizedAxis"))),e=!1)})(i,n,r)))));let s=!1;const n=t.map((e=>e.onStoppedStateChanged(((i,n)=>((e,i)=>{s||(s=!0,t.filter((t=>t!==e)).forEach((t=>t.setStopped(i))),s=!1)})(e,n)))));return{remove:()=>{t.forEach(((t,e)=>{t.offIntervalChange(i[e]),t.offStoppedStateChanged(n[e])}))}}};class ft extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,ft.prototype)}}class gt extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&St.alert(s),Object.setPrototypeOf(this,gt.prototype)}}class mt extends gt{constructor(t){super(t),Object.setPrototypeOf(this,mt.prototype)}}var pt,yt,At,xt;e.UISpace=void 0,(pt=e.UISpace||(e.UISpace={}))[pt.Content=0]="Content",pt[pt.PaddedContent=1]="PaddedContent",pt[pt.PaddedBackground=2]="PaddedBackground",pt[pt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(yt=e.UIVisibilityModes||(e.UIVisibilityModes={}))[yt.never=0]="never",yt[yt.always=1]="always",yt[yt.whenHovered=2]="whenHovered",yt[yt.whenDragged=3]="whenDragged",yt[yt.whenNotDragged=4]="whenNotDragged",yt[yt.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(At=e.UIDraggingModes||(e.UIDraggingModes={}))[At.notDraggable=0]="notDraggable",At[At.draggable=1]="draggable",At[At.onlyHorizontal=2]="onlyHorizontal",At[At.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(xt=e.UIDirections||(e.UIDirections={}))[xt.Up=0]="Up",xt[xt.Right=1]="Right",xt[xt.Down=2]="Down",xt[xt.Left=3]="Left";const St="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},bt=(t,e)=>t.x===e.x&&t.y===e.y,vt=t=>t!==_e&&t!==Fe&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Mt=t=>t[1],Tt=t=>t.dispose(),wt=()=>{},Et=(t,e)=>t===e,kt=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Ct=t=>Array.prototype.concat.apply([],t),Dt=(t,e)=>void 0!==t?t:e,It=t=>t.vt(),_t=t=>t.xt(),Ft=t=>t.bt(),Lt=t=>t.Mt(),zt=t=>t.min.x,Pt=t=>t.max.x,Rt=t=>t.min.y,Vt=t=>t.max.y,Bt=(t,e,i,s,n)=>{if(t.length>0){let r=n?s(n):void 0;for(let s=0;st.position===e.position&&t.high===e.high&&t.low===e.low,Nt=u(0,1),Ut=u(1,0),Gt=u(0,-1),Wt=u(-1,0),Yt=u(0,0),Ht=t=>{switch(t){case e.UIDirections.Up:return Nt;case e.UIDirections.Right:return Ut;case e.UIDirections.Down:return Gt;case e.UIDirections.Left:return Wt;default:return Yt}},Xt=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,jt=t=>{t.stopPropagation(),t.preventDefault()},$t=(t,e)=>{if(!e)return t;const i=t.length,s=new Float32Array(2*i);let n=0;for(let e=0;e{if(!e){const e=t.length,i=new Float32Array(2*e);let s=0;for(let n=0;n{const e=t.length,i=new Float32Array(3*e);let s=0;for(let n=0;ne=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)},Zt=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},te=Qt(Math.E),ee=(t,e)=>{const i=e[t];return i?i():void 0},ie=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;igi(ri(t,i))-gi(ri(e,i))))},se=(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:T(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())),re=t=>255===t.getA()?t:t.setA(255),oe=(()=>{const t=T(0,0,0);return i=>(i=re(i),new Z({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:ne(i,t,.5)}]}))})(),ae=(()=>{const t=t=>{var e;if(t){if(G(t)){if(0===t.getColor().getA())return;return t.getColor()}if(Q(t)||it(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,n)=>{const r=[];if(n.fill&&r.push(n.fill),n.fill2&&r.push(n.fill2),n.stroke){const t=n.stroke.getFillStyle();t!==V&&r.push(t)}if(n.point3D){const t=n.point3D;r.push(t.getFillStyle())}let o;if(n.behavior&&!0===n.behavior.colorStep){const[e,s]=r.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]);o=e&&s?(a=e)===(h=s)||a.getR()===h.getR()&&a.getG()===h.getG()&&a.getB()===h.getB()?oe(a):(a=re(a),h=re(h),new et({angle:0,stops:[{offset:0,color:h},{offset:.5,color:h},{offset:.5,color:a},{offset:1,color:a}]})):i.uiButtonFillStyle}else{const e=r.reduce(((e,i)=>e||t(i)),void 0);o=e?s?new U({color:e}):oe(e):i.uiButtonFillStyle}var a,h;e.setButtonOnFillStyle(o)}})(),he=t=>{const e=t;if(H(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},le=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},ue=(t,e)=>{let i="string"==typeof t?t:String(t);const s=i.indexOf(".");let n=s>=0?s:i.length;for(;n"function"==typeof t?t(e):t,de=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),fe=(t,e)=>e(),ge=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new U({color:T(255,255,255,1)});const me=t=>t===Le||t.min.x===Le.min.x&&t.max.x===Le.max.x&&t.min.y===Le.min.y&&t.max.y===Le.max.y,pe=t=>Array.from(new Set(t)),ye=t=>t.filter((t=>void 0!==t)),Ae=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,xe=(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))))))},Se=(t,e)=>{throw new Error(e)},be=()=>{const t=$((()=>{}));let e;return(i,s,n,r)=>{const o=null==r?void 0:r.onStart,a=null==r?void 0:r.onCompleted,h=(null==r?void 0:r.easing)||X.ease,l=(null==r?void 0:r.durationMs)||1e3;let u;if(e)if(0===e.nextAnimations.length){const t=e.NextAnimation([[i,s]],(([i])=>{e=t,n(i)}),l,h);u=t}else{i=e.nextAnimations.pop().values[0][0];const t=e.NextAnimation([[i,s]],(([i])=>{e=t,n(i)}),l,h);u=t}else u=t(l,h)([[i,s]],(([t])=>{n(t)})),e=u;u.onAnimationEnd((()=>{e=void 0})),o&&u.onAnimationStart(o),a&&u.onAnimationEnd(a)}},ve=t=>{let e;return()=>e||(e=t(),e)},Me=t=>{if(t===nt)return 0;const e=t.getThickness();return e<0?1:1*e},Te=(t,e,i,s)=>{const n=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please find the FAQ from API documentation at below link:\nhttps://lightningchart.com/js-charts/api-documentation/\nand read section "What is LightningChart JS Resources not found error?"`;if(s.shouldCrash)throw St.alert(n),new Error(n);St.console.warn(n)},we=(t,e,i,s=0)=>{if(t{const t=new Map;return{_t:e=>(e.setMouseEnterEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.wt(e,i,s)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Ct(e,i,s)})),e.setMouseClickEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.kt(e,i,s)})),e.setMouseDoubleClickEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Tt(e,i,s)})),e.setMouseDownEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Ft(e,i,s)})),e.setMouseUpEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.It(e,i,s)})),e.setMouseMoveEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Pt(e,i,s)})),e.setMouseDragEventHandler(((e,i,s,n,r,o)=>{const a=o&&t.get(o);a&&a.Dt(e,i,s,n,r,o)})),e.setMouseDragStartEventHandler(((e,i,s,n)=>{const r=n&&t.get(n);r&&r.Bt(e,i,s,n)})),e.setMouseDragStopEventHandler(((e,i,s,n,r)=>{const o=r&&t.get(r);o&&o.Lt(e,i,s,n,r)})),e.setMouseWheelEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Rt(e,i,s)})),e.setTouchStartEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Et(e,i,s)})),e.setTouchMoveEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.Vt(e,i,s)})),e.setTouchEndEventHandler(((e,i,s)=>{const n=s&&t.get(s);n&&n.zt(e,i,s)})),e),Ot:(e,i)=>{t.set(e,i)},Nt:()=>{t.clear()}}},ke={left:0,right:0,top:0,bottom:0},Ce=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),De=(t,e,i)=>{e&&e.Gt();const s=i();return{Wt:t,Gt:()=>{s.forEach((e=>t.Ut(e)))}}},Ie={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=>Ie.divide(t,Ie.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(Ie.dot(t,e)/(Ie.length(t)*Ie.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),n=Math.sin(i),r=Ie.dot(e,t),o=Ie.cross(e,t);return Ie.addVec(Ie.multiply(t,s),Ie.addVec(Ie.multiply(e,(1-s)*r),Ie.multiply(o,n)))},lerp:(t,e,i)=>(i=kt(i,0,1),Ie.addVec(Ie.multiply(t,1-i),Ie.multiply(e,i))),equals:(t,e)=>Et(t.x,e.x)&&Et(t.y,e.y)&&Et(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)})},_e=Number.MAX_SAFE_INTEGER,Fe=-Number.MAX_SAFE_INTEGER,Le=m(u(_e,_e),u(Fe,Fe)),ze=m(f(_e,_e,_e),f(Fe,Fe,Fe)),Pe=(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))},Re=(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),Be=(t,e)=>m(u(Math.max(Math.min(t[0].x,t[2].x),Math.min(e[0].x,e[2].x)),Math.max(Math.min(t[0].y,t[2].y),Math.min(e[0].y,e[2].y))),u(Math.min(Math.max(t[0].x,t[2].x),Math.max(e[0].x,e[2].x)),Math.min(Math.max(t[0].y,t[2].y),Math.max(e[0].y,e[2].y)))),Oe=t=>{const e=t.length;for(let i=0;ie+t,Ue=(t,e,i)=>{const s=ri(e,t),n=s.x*s.x+s.y*s.y;if(0===n)return t;const r=ri(i,t),o=(r.x*s.x+r.y*s.y)/n;return o<=0?t:o>=1?e:u(t.x+o*s.x,t.y+o*s.y)},Ge=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,We=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},Ye=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},He=(t,e,i)=>ni(t,si(ri(e,t),i)),Xe=(t,e,i)=>Ie.addVec(t,Ie.multiply(Ie.subtractVec(e,t),i));function je(t){const e=t.length;if(e>0){let i=t[0].x,s=t[0].x,n=t[0].y,r=t[0].y;for(let o=0;oi&&(i=e.x),e.xn&&(n=e.y),e.y0){let i=t[0].x,s=t[0].x,n=t[0].y,r=t[0].y,o=t[0].z,a=t[0].z;for(let h=0;hi&&(i=e.x),e.xn&&(n=e.y),e.yo&&(o=e.z),e.z{const e={min:{x:_e,y:_e},max:{x:Fe,y:Fe}};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},Je=(t,e)=>m(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 Ke(t,e,i,s){const n=t.x-s.x,r=t.y-s.y,o=s.x-i.x,a=i.y-s.y,h=a*n+o*r,l=(s.y-e.y)*n+(e.x-s.x)*r,u=a*(e.x-s.x)+o*(e.y-s.y);return u<0?h<=0&&l<=0&&h+l>=u:h>=0&&l>=0&&h+l<=u}function Ze(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 Qe(t,e){return u(t.x-e.x,t.y-e.y)}function ti(t){const e=ii(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function ei(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=ti(i);const s=Math.PI/2,n=i.x;return i.x=-Math.sin(s)*i.y,i.y=n*Math.sin(s),i}function ii(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function si(t,e){return u(t.x*e,t.y*e)}function ni(t,e){return u(t.x+e.x,t.y+e.y)}function ri(t,e){return u(t.x-e.x,t.y-e.y)}function oi(t,e){return u(t.x*e.x,t.y*e.y)}function ai(t,e){return u(t.x/e.x,t.y/e.y)}function hi(t){return si(t,-1)}function li(t,e){return t.x*e.x+t.y*e.y}const ui=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),n=e.y+(t-e.x)*s;return u(t,n)},ci=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),n=e.x+(t-e.y)/s;return u(n,t)};function di(t){return t*Math.PI/180}function fi(t){return 180*t/Math.PI}function gi(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function mi(t){return u(Math.cos(t),Math.sin(t))}function pi(t){let e=-1;const i=Math.cos(t),s=Math.sin(t);return i>0&&i<1&&s>0&&s<1?e=1:i<0&&i>-1&&s>0&&s<1?e=2:i<0&&i>-1&&s<0&&s>-1?e=3:i>0&&i<1&&s<0&&s>-1&&(e=4),e}const yi=(t,e,i,s)=>{let n,r,o,a;if(e.x-t.x!=0||s.x-i.x!=0)return e.x-t.x==0?(o=e.x,r=(s.y-i.y)/(s.x-i.x),a=r*(o-i.x)+i.y):s.x-i.x==0?(o=s.x,n=(e.y-t.y)/(e.x-t.x),a=n*(o-t.x)+t.y):(n=(e.y-t.y)/(e.x-t.x),r=(s.y-i.y)/(s.x-i.x),o=(i.y-r*i.x+n*t.x-t.y)/(n-r),a=n*(o-t.x)+t.y),u(o,a)},Ai=(t,e)=>{const i=t.length,s=e.length,n=new Uint16Array(i+s);return n.set(t,0),n.set(e,i),n};class xi{constructor(){this.Yt=!0}getInnerStart(){return this.H}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.$-this.H)}J(t,e){return this.Yt=t!==this.H||e!==this.$,this.H=t,this.$=e,this}j(){return this.Yt=!1,this}Z(){return this.Yt=!0,this}}class Si extends xi{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.O(this.ti.bind(this));this.ti(s._()),this.ii=()=>s.G(t)}}q(t){return this.X=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.X+this.Xt[0]}hi(){return(this.Zt+this.Qt)/this.Jt*this.X-this.Xt[1]}ri(){return this.getCellSize()-this.ni()}oi(){return this.X}getCellSize(){return this.ai(this.X)}ni(){return this.Xt[0]+this.Xt[1]}li(){return this.Xt}ti(t){this.Jt=t.reduce(Ne,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&&iwi;return!r&&!o||!!n&&(e>t?{start:r?Ti:t,end:o?wi:e}:{start:o?wi:t,end:r?Ti:e})}ct(t){const e=this.ei(),i=this.hi(),s=Math.max(t,Ti);return e+(this.ci.function(s)-this.di.scaleStartLog)/this.di.scaleIntervalLog*(i-e)}ut(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()}J(t,e){return super.J(t,e),this.ci&&this.fi(),this}si(t){return super.si(t),this.ci&&this.fi(),this}q(t){return super.q(t),this.ci&&this.fi(),this}Ai(t){return this.ci={internal:t,function:vi(t),number:Mi(t)},this}gi(){return this.ci.internal}pi(t,e){const i=this.ct(t)+e;return this.ut(i)}mi(){return this.$t||this.Yt||this.jt||this.Ht}fi(){const t=this.ci.function(this.H),e=this.ci.function(this.$)-t,i=2*this.ei()/this.X-1,s=2*this.hi()/this.X-1-i;return this.di={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.di}yi(){return this.di}}const vi=t=>"e"===t?te:Qt(t),Mi=t=>"e"===t?Math.E:t,Ti=.9*10**-4,wi=1.1*10**25,Ei=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],ki=(t,e,i)=>{const s=Math.abs(i-e),n=Math.max(2-Pe(s,10),0);return t.toFixed(n)},Ci={Numeric:(t,e)=>ki(t,e.getInnerStart(),e.getInnerEnd()),NumericUnits:(t,e)=>{const i=Math.abs(e.getInnerEnd()-e.getInnerStart()),s=t<0;t=Math.abs(t);let n="",r="";if(i>=1e3&&t>1e3){let e="";for(const i of Ei){const s=Math.round(1e3*t/i.unit)/1e3;if(s>=1){e=s.toString(),r=i.prefix;break}}n=(s?"-":"")+e}else{let e=String(Math.floor(t));const r=Pe(t,1e3);for(let t=1;t<=r;t+=1){const i=e.length-(3*t+(t-1));e=`${e.substring(0,i)} ${e.substring(i,e.length)}`}n=(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-Pe(i,10)):"")}return n+=r,n},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const n=vi(s)(t);return`${s}${Di(n)}`},LogarithmicExponents:(t,e,i,s=10)=>{const n=vi(s),r=Math.floor(n(t)),o=t/Mi(s)**r;return`${Math.round(o)}×${s}${Di(r)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const n=vi(s),r=Math.floor(n(t));return`${(t/Mi(s)**r).toFixed(2)}×${s}${Di(r)}`},LogarithmicNoExponents:(t,e,i,s=10)=>{const n=vi(s);if("e"===s)return`${Math.floor(n(t))}e`;const r=t.toString();if(t>1)return r;const o=Math.floor(n(t));return t.toFixed(Math.abs(o))}},Di=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 Ii extends Si{constructor(t,e,i,s){super(t,e,i,s),this.Si=!1,this.vi=!1,this.xi=0,this.X=1e3,this.J(0,10),this.K()}mi(){return this.vi}nt(t,e,i,s,n){if(t===e)return!1;const r=Math.abs(s-i),o=Math.abs(e-t);if(!this.Si){const i=((t,e,i)=>{const s=((t,e)=>{if(e<_e&&e>Fe&&t<_e&&t>Fe){const i=Math.abs(t/2**23),s=Math.abs(e/2**23),n=Math.min(i,s);return 10**Math.floor(Math.log10(n))}})(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,a=(n?i/2:r/2)*(t>e?-1:1);return{start:s-a,end:s+a}}const a=10**-(12-Math.log10(Math.max(Math.abs(t),1)));if(o>a)return!0;const h=(e+t)/2,l=(n?a/2:r/2)*(t>e?-1:1);return{start:h-l,end:h+l}}ui(){this.K()}ct(t){return this.ei()+(t-this.H)/(this.$-this.H)*(this.hi()-this.ei())}ut(t){return this.H+(t-this.ei())/(this.hi()-this.ei())*(this.$-this.H)}J(t,e){return super.J(t,e),this.K(),this}si(t){return super.si(t),this.K(),this}q(t){return super.q(t),this.bi=_i(this.$-this.H,this.Xt,this.X,this.Qt,this.Jt),this.K(),this}Mi(){return this.Si=!0,this}_i(){return this.Si}wi(){return Math.abs(this.Ci)}ki(){return this.wi()/this.bi}Ti(){return this.Fi}Ii(){return this.Pi}getPixelSize(){return this.bi}yi(){return this.di}Z(){return super.Z(),this.vi=!0,this}j(){return super.j(),this.vi=!1,this}Di(t,e=Ci.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 _i(t,this.Xt,this.X,this.Qt,this.Jt)}K(){let t=this.H,e=this.$,i=0;this.Si&&(t=0,e=this.$-this.H,i=this.H);const s=e-t,n=_i(s,this.Xt,this.X,this.Qt,this.Jt);this.Pi=t-this.Xt[0]*n,this.Fi=e+this.Xt[1]*n;const r=this.Fi-this.Pi,o=r-this.Ci,a=Math.abs(o/n),h=s-this.xi,l=Math.abs(h/n);(!this.di||a>=.4||l>=.4)&&(this.xi=s,this.Ci=r,this.bi=n,this.vi=!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.X-1,f=2*this.hi()/this.X-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 _i=(t,e,i,s=1,n=1)=>t/(i*s/n-(e[0]+e[1]));class Fi{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}Z(){return this.x.Z(),this.y.Z(),this}q(t,e){return"object"==typeof t?(this.x.q(t.x),this.y.q(t.y)):(this.x.q(t),this.y.q(e)),this}oi(){return u(this.x.oi(),this.y.oi())}Ei(t){return this.x.si(t),this}Vi(t){return this.y.si(t),this}ni(){return u(this.x.ni(),this.y.ni())}zi(t,e){return this.x.J(t,e),this}Oi(t,e){return this.y.J(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.mi()||this.y.mi()}}class Li extends Fi{constructor(){super(...arguments),this.Gi="LinearScaleXY"}ot(t,e,i,s){return this.x=new Ii(t.x,e.x,i.x,s?s.x:void 0),this.y=new Ii(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())}yi(){return{x:this.x.yi(),y:this.y.yi()}}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 n=this.Wi(),r=ei(t,e);return r.x*=s,r.y*=s,{x:t.x+i*n.x*r.x,y:t.y+i*n.y*r.y}}}class zi extends Fi{constructor(){super(...arguments),this.Gi="MixedScaleXY"}_i(){return!1}pi(t,e){const i=this.x.ct(t.x),s=this.y.ct(t.y),n={x:i+e.x,y:s+e.y};return{x:this.x.ut(n.x),y:this.y.ut(n.y)}}Ui(t,e,i,s){const n={x:this.x.ct(t.x),y:this.y.ct(t.y)},r={x:this.x.ct(e.x),y:this.y.ct(e.y)},o=ti(ri(r,n)),a=ei(r,n),h={x:n.x+o.x*s+a.x*i,y:n.y+o.y*s+a.y*i};return{x:this.x.ut(h.x),y:this.y.ut(h.y)}}yi(){const t=this.x.yi(),e=this.y.yi();return{uScaleStart:[this.x.H,this.y.H],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 Pi=(t,e)=>t instanceof bi||e instanceof bi?(new zi).Ri(t,e):(new Li).Ri(t,e),Ri=t=>"client"===t,Vi=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),Bi=t=>"relative"===t,Oi=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y);var Ni;e.HighlightModes=void 0,(Ni=e.HighlightModes||(e.HighlightModes={}))[Ni.noHighlighting=0]="noHighlighting",Ni[Ni.onHover=1]="onHover";class Ui{constructor(t,i,s,r){this.Yi=!0,this.Hi=e.HighlightModes.onHover,this.$i=!1,this.Xi=!0,this.ji=!1,this.D=new n.Eventer,this.Zi=[],this.Qi=[],this.onMouseEnter=t=>this.D.on("mouseEnter",t),this.onMouseLeave=t=>this.D.on("mouseLeave",t),this.onMouseClick=t=>this.D.on("mouseClick",t),this.onMouseDoubleClick=t=>this.D.on("mouseDoubleClick",t),this.onMouseDown=t=>this.D.on("mouseDown",t),this.onMouseUp=t=>this.D.on("mouseUp",t),this.onMouseMove=t=>this.D.on("mouseMove",t),this.offMouseEnter=t=>this.D.off(t,"mouseEnter"),this.offMouseLeave=t=>this.D.off(t,"mouseLeave"),this.offMouseClick=t=>this.D.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.D.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.D.off(t,"mouseDown"),this.offMouseUp=t=>this.D.off(t,"mouseUp"),this.offMouseMove=t=>this.D.off(t,"mouseMove"),this.offMouseDragStart=t=>this.D.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.D.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.D.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.D.off(t,"mouseWheel"),this.wt=(t,i,s)=>{this.D.emit("mouseEnter",this,i),this.ji=!0,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Ct=(t,i,s)=>{this.D.emit("mouseLeave",this,i),this.ji=!1,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Pt=(t,e,i)=>{this.D.emit("mouseMove",this,e)},this.kt=(t,e,i)=>this.D.emit("mouseClick",this,e),this.Tt=(t,e,i)=>this.D.emit("mouseDoubleClick",this,e),this.Ft=(t,e,i)=>this.D.emit("mouseDown",this,e),this.It=(t,e,i)=>this.D.emit("mouseUp",this,e),this.Bt=(t,e,i,s)=>{this.D.emit("mouseDragStart",this,e,i)},this.Dt=(t,e,i,s,n,r)=>{this.D.emit("mouseDrag",this,e,i,s,n)},this.Lt=(t,e,i,s,n)=>{this.D.emit("mouseDragStop",this,e,i,s)},this.Rt=(t,e,i)=>{this.D.emit("mouseWheel",this,e)},this.Et=(t,i,s)=>{this.D.emit("touchStart",this,i),this.ji=!0,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Vt=(t,e,i)=>{this.D.emit("touchMove",this,e)},this.zt=(t,i,s)=>{this.D.emit("touchEnd",this,i),this.ji=!1,this.Hi===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Ji=t,this.Ki=i,this.qi=s,this.ts=new Map,this.ss=r,this.es=this.ss.hs(this,{rs:{themeEffectEnabled:this.qi.effectsText},ns:{}}),this.Ji.us.ls.os(this,(t=>{this.ts.forEach(((e,i)=>i.cs(t))),this.Qi.forEach((e=>e.setHighlight(t))),this.Zi.forEach((e=>e.cs(t)))}),{animationEnabled:this.Ji.getAnimationsEnabled()})}ds(t){const e=t(this.Ji.fs);e&&this.Ji.us.As(e)}gs(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.ts.set(t,{isText:s});const n=Array.from(this.ts);this.es.rs.ps(n.filter((t=>t[1].isText)).map((t=>t[0]))),this.es.ns.ps(n.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Yi).setVisible(this.Xi).cs(this.Ji.us.ls.ys(this,!0)),i&&t.setMouseEnterEventHandler(this.wt).setMouseLeaveEventHandler(this.Ct).setMouseClickEventHandler(this.kt).setMouseDoubleClickEventHandler(this.Tt).setMouseDownEventHandler(this.Ft).setMouseUpEventHandler(this.It).setMouseMoveEventHandler(this.Pt).setMouseDragStartEventHandler(this.Bt).setMouseDragEventHandler(this.Dt).setMouseDragStopEventHandler(this.Lt).setMouseWheelEventHandler(this.Rt).setTouchStartEventHandler(this.Et).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.zt);const r=t.onDispose((()=>{t.offDispose(r),this.ts.delete(t)}))}Ss(t){this.Zi=t;const e=this.Ji.us.ls.ys(this,!0);t.forEach((t=>{t.cs(e).vs(this.Xi)}))}setEffect(t){return this.es.rs.xs(t&&this.qi.effectsText),this.es.ns.xs(t),this.Ji.us.bs(),this}getEffect(){return this.es.rs.Ms()||this.es.ns.Ms()}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}setName(t){return this._s=t,this.Qi.forEach((t=>t.setText(this._s))),this}getName(){return this._s}dispose(){return this.$i||(this.$i=!0,this.ts.forEach(((t,e)=>e.dispose())),this.Ki(this),this.Qi.forEach((t=>{t.dispose()})),this.Qi.length=0,this.D.emit("dispose",this),this.Ji.us.bs()),this}setVisible(t){return t===this.Xi||(this.Xi=t,this.ts.forEach(((e,i)=>i.setVisible(t))),this.Zi.forEach((e=>e.vs(t))),this.Qi.forEach((e=>e.setOn(t))),this.D.emit("visibleStateChanged",this,this.Xi),this.Ji.us.bs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}setHighlight(t){return this.Ji.us.ls.ws(this,t),this.D.emit("highlight",this,t),this}getHighlight(){return this.Ji.us.ls.ys(this)}setAnimationHighlight(t){return this.Ji.us.ls.Cs(this,t),this}getAnimationHighlight(){return this.Ji.us.ls.ks(this)}setMouseInteractions(t){return this.Yi=t,this.ts.forEach(((e,i)=>i.setMouseInteractions(t))),this.Ji.us.bs(),this}getMouseInteractions(){return this.Yi}getIsUnderMouse(){return this.ji}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 xe(t,[this],{toggleVisibilityOnClick:e,label:this._s,style:void 0}),this.Qi.push(t),t.onDispose((()=>{const e=this.Qi.indexOf(t);e>=0&&this.Qi.splice(e,1)})),this}onMouseDragStart(t){return this.D.on("mouseDragStart",t)}onMouseDrag(t){return this.D.on("mouseDrag",t)}onMouseDragStop(t){return this.D.on("mouseDragStop",t)}onMouseWheel(t){return this.D.on("mouseWheel",t)}onTouchStart(t){return this.D.on("touchStart",t)}onTouchMove(t){return this.D.on("touchMove",t)}onTouchEnd(t){return this.D.on("touchEnd",t)}onDispose(t){return this.D.on("dispose",t)}offTouchStart(t){return this.D.off(t,"touchStart")}offTouchMove(t){return this.D.off(t,"touchMove")}offTouchEnd(t){return this.D.off(t,"touchEnd")}offDispose(t){return this.D.off(t,"dispose")}}class Gi extends Ui{constructor(t,e,i,s,n,r,o,a){super(e,i,o,a),this.Ts=t,this.axis=s,this.dt=n,this.Fs=r,this.Is()}}const Wi=t=>{const e=t.length;if(e>0){let i=0,s=0;for(let n=0;n{const e=t.length,i=new Array(e).fill(!1),s=(s,n)=>{for(let r=0;r=this.Rs?(this.Ls.splice(t,1),t-=1):this.Ls[t].state&&(s=!0);return this.Bs?0===e.interactions.length&&(this.Ls.push({state:!1,time:i}),this.Bs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Ls.push({state:!0,time:i}),s=!0,this.Bs=!0),s}Ds(t,e,i){if(i){const i=this.Ls.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Es(t,e),this.Ls.length=0)}}},Xi=class{constructor(t,e,i,s=1,n=100){this.Vs=t,this.zs=e,this.Os=i,this.Ns=s,this.Gs=n}Ps(t,e){const i=e.interactions.length;if(i===this.Ns){if(void 0!==this.Ws)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 n=0;n!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class Ki{constructor(t,e){this.Xs=t,this.js=e,this.Zs=e.rows*ks,this.Qs=e.columns*Cs}}var Zi,Qi;e.OnScreenMenuButtonType=void 0,(Zi=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[Zi.ZoomIn=0]="ZoomIn",Zi[Zi.ZoomInX=1]="ZoomInX",Zi[Zi.ZoomInY=2]="ZoomInY",Zi[Zi.ZoomOut=3]="ZoomOut",Zi[Zi.ZoomOutX=4]="ZoomOutX",Zi[Zi.ZoomOutY=5]="ZoomOutY",Zi[Zi.ZoomToFit=6]="ZoomToFit",Zi[Zi.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(Qi=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[Qi.Circle=0]="Circle",Qi[Qi.Rectangle=1]="Rectangle",Qi[Qi.RoundedRectangle=2]="RoundedRectangle";const ts={x:-43,y:0},es={x:-65,y:0},is={x:-86,y:0},ss={x:-107,y:-1},ns={x:-128,y:-3},rs={x:-150,y:0},os={x:-171,y:0},as={x:-276,y:0},hs={x:-298,y:0},ls={x:0,y:0},us={x:-21,y:0};class cs extends Ki{constructor(t,e,i,s){super(t,i),this.Js=St.document.createElement("button"),this.Ks=St.document.createElement("div"),this.qs=St.document.createElement("label"),this.js=i,this.te=e,this.Ji=s}ie(t,e,i,s){this.se(t,s),this.ee(),this.he(e),this.re(),this.qs.textContent=i||"";const n=St.document.createElement("div");this.ne(n),this.Js.onclick=this.onClick.bind(this),n.appendChild(this.Ks),n.appendChild(this.qs),this.Js.appendChild(n)}re(){this.Js.style.cursor="pointer"}ne(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}he(t){"string"==typeof t?(this.Ks.style.backgroundImage=`url(${t})`,this.Ks.style.backgroundSize="100%",this.Ks.style.backgroundRepeat="no-repeat",this.Ks.style.backgroundPosition="center",this.Ks.style.width="20px",this.Ks.style.height="20px"):this.applyStyleForSprite(t),this.Ks.style.margin="auto"}ee(){switch(this.te){case e.OnScreenMenuButtonShape.RoundedRectangle:this.Js.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.Js.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.Js.style.borderRadius="31px"}}se(t,e){this.Js.style.width=`${this.Qs.toString()}px`,this.Js.style.height=`${this.Zs.toString()}px`,this.Js.style.backgroundColor=t,this.Js.style.opacity=e||Ds,this.Js.style.alignItems="center",this.Js.style.border="2px solid #707070",this.Js.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.Ks.style.backgroundImage=`url(${this.Xs}/${Is})`,this.Ks.style.backgroundPositionX=`${t.x}px`,this.Ks.style.backgroundPositionY=`${t.y}px`,this.Ks.style.backgroundSize="1600%",this.Ks.style.backgroundRepeat="no-repeat",this.Ks.style.width="20px",this.Ks.style.height="20px"}oe(t){return t.appendChild(this.Js),t}ae(){return this.Js}}class ds extends cs{constructor(t,e,i,s){super(t,e,i,s),this.le="",this.ue="",this.ce=!1,this.Ji=s}de(){this.fe(),this.onToggledStateAction()}Ae(){this.ge(),this.onInitialStateAction()}ge(){this.pe(this.le)}fe(){this.pe(this.ue)}pe(t){"string"==typeof t?this.Ks.style.background=t:(this.Ks.style.backgroundImage=`url(${this.Xs}/${Is})`,this.Ks.style.backgroundPositionX=`${t.x}px`,this.Ks.style.backgroundPositionY=`${t.y}px`)}onClick(){this.ce?this.Ae():this.de(),this.ce=!this.ce}}class fs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ts)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:-1,y:-1})}}class gs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ss)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:-1,y:0})}}class ms extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),rs)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:0,y:-1})}}class ps extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),es)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:1,y:1})}}class ys extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ns)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:1,y:0})}}class As extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),os)}onClick(){const t=this.Ji.me();t&&this.Ji.zoom(t,{x:0,y:1})}}class xs extends ds{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.le=as,this.ue=hs,this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),this.le)}onToggledStateAction(){this.Ji.setAnimationsEnabled(!1)}onInitialStateAction(){this.Ji.setAnimationsEnabled(!0)}}class Ss extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ji=e;const s=this.Ji.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),is)}onClick(){this.Ji.forEachAxis((t=>{t.fit(!0)}))}}class bs extends cs{constructor(t,e,i){super(t,e.shape||_s,e.dimensions||{rows:1,columns:1},i);const s=i.getTheme(),n=e.color||s.onScreenMenuBackgroundColor.toRGBAString(),r=e.icon||"",o=e.label||"",a=e.opacity||"";this.ie(n,r,o,a),this.ye=e.action}onClick(){this.ye(this.Ji)}}class vs extends ds{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.Ji=i,this.Se=s,this.le=us,this.ue=ls,this.ie(Fs,this.le)}ge(){this.pe(this.le),this.Js.style.backgroundColor=Fs,this.Js.style.border="2px solid #707070",this.Js.style.margin="0px"}fe(){this.pe(this.ue),this.Js.style.background="#FECC00 0% 0% no-repeat padding-box",this.Js.style.border="10px solid #BCBCBC12",this.Js.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.Se)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.Se)||void 0===t||t.style.setProperty("display","none")}}var Ms;e.MouseStyles=void 0,(Ms=e.MouseStyles||(e.MouseStyles={})).Move="move",Ms.ResizeColumn="col-resize",Ms.ResizeRow="row-resize",Ms.Horizontal="ew-resize",Ms.Vertical="ns-resize",Ms.NorthWest="nw-resize",Ms.NorthEast="ne-resize",Ms.Copy="copy",Ms.CrossHair="crosshair",Ms.Default="default",Ms.Help="help",Ms.Restricted="not-allowed",Ms.None="none",Ms.Point="pointer",Ms.Text="text",Ms.Wait="wait",Ms.ZoomIn="zoom-in",Ms.ZoomOut="zoom-out";const Ts={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)},ws=new U({color:T(255,255,255,0)}),Es=new qi({thickness:1,fillStyle:ws}),ks=60,Cs=60,Ds="1.0",Is="osm/osm-sprite-transparent.png",_s=e.OnScreenMenuButtonShape.Circle,Fs="#363636";var Ls;e.OSMPosition=void 0,(Ls=e.OSMPosition||(e.OSMPosition={}))[Ls.TopRight=0]="TopRight",Ls[Ls.TopLeft=1]="TopLeft",Ls[Ls.BottomLeft=2]="BottomLeft",Ls[Ls.BottomRight=3]="BottomRight";class zs extends Gi{constructor(t,e,i,s,n,r,o,a){super(t,e,i,s,n,r,o,a),this._s="Band",this.ve=0,this.xe=0,this.be=this.qi.bandFillStyle,this.Me=this.qi.bandStrokeStyle,this._e=!0,this.we=this.Ts.Te(this.dt).ke(this.be).Ce(this.Me).cs(this.getHighlight()),this.gs(this.we)}setValueStart(t){return this.ve=t,this.D.emit("valueChange",this,this.ve,this.xe),this.Ts.bs(),this}getValueStart(){return this.ve}setValueEnd(t){return this.xe=t,this.D.emit("valueChange",this,this.ve,this.xe),this.Ts.bs(),this}getValueEnd(){return this.xe}setFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.we.ke(e),this.Ts.bs(),this}getFillStyle(){return this.be}setStrokeStyle(t){this.Me="function"==typeof t?t(this.Me):t;const e=this.Me;return this.we.Ce(e),this.Ts.bs(),this}getStrokeStyle(){return this.Me}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}Fe(){return this.we.Ie(this.Fs.toVec2(this.ve,this.Fs.getHeight(this.dt).getInnerStart())).q(this.Fs.toVec2(this.xe-this.ve,this.Fs.getHeight(this.dt).getInnerInterval())),this}attach(t,e=!0,i=!1){return super.attach(t,e),ae(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}Pe(t,e){t.cs(e),this.Ts.bs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){let t,i;const s=(e,s)=>{if(!this._e)return;const n=ut(this.Ts.us.De(s.x,s.y),this.Ts.us.dt,this.dt),r=this.Fs.getWidth(n),o=this.axis.dt.ct(this.ve),a=this.axis.dt.ct(this.xe),h=(this.axis.dt.ct(r)-o)/(a-o);t=!(h<.1||h>.9),!1===t&&(i=h<.5)},n=(e,s,n,r,o)=>{if(!this._e)return;const a=this.Fs.getWidth(r);t?(this.ve=this.axis.dt.pi(this.ve,a),this.xe=this.axis.dt.pi(this.xe,a)):i?this.ve=this.axis.dt.pi(this.ve,a):this.xe=this.axis.dt.pi(this.xe,a),jt(o),this.D.emit("valueChange",this,this.ve,this.xe),this.Ts.bs()};this.onMouseMove(((i,n)=>{if(!this._e)return;s(0,u(n.clientX,n.clientY));const r=t?e.MouseStyles.Point:this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ji.engine.setMouseStyle(r,this.Be)})),this.onMouseLeave((()=>{this._e&&(this.Ji.engine.restoreMouseStyle(this.Be),this.Be=void 0)})),this.onMouseDrag(((t,e,i,s,r)=>{this._e&&0===i&&n(0,0,0,r,e)}));const r=Yi(new Xi(s,n));this.onTouchStart(r.onTouchStart),this.onTouchMove(r.onTouchMove),this.onTouchEnd(r.onTouchEnd)}}class Ps extends Gi{constructor(t,e,i,s,n,r,o,a){super(t,e,i,s,n,r,o,a),this._s="Constant Line",this.S=0,this.Me=this.qi.constantLineStrokeStyle,this.Le=!0,this._e=!0,this.Re=this.Ts.Ve(this.dt).Ee(this.Me).cs(this.getHighlight()),this.gs(this.Re)}setValue(t){return this.S=t,this.D.emit("valueChange",this,this.S),this.Ts.bs(),this}getValue(){return this.S}setStrokeStyle(t){this.Me="function"==typeof t?t(this.Me):t;const e=this.Me;return this.Re.Ee(e),this.Ts.bs(),this}getStrokeStyle(){return this.Me}setInteractionMoveByDragging(t){return this.Le=t,this}getInteractionMoveByDragging(){return this.Le}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}Fe(){return this.Re.Oe(this.Fs.toVec2(this.S,this.Fs.getHeight(this.dt).getInnerStart())).ze(this.Fs.toVec2(this.S,this.Fs.getHeight(this.dt).getInnerEnd())),this}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{stroke:this.Me}),this}Pe(t,e){t.cs(e),this.Ts.bs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){const t=(t,e)=>{this._e&&this.Le&&(this.S=this.axis.dt.pi(this.S,this.Fs.getWidth(e)),this.D.emit("valueChange",this,this.S),this.Ts.bs(),jt(t))};this.onMouseMove((()=>{if(this._e&&this.Le){const t=this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ji.engine.setMouseStyle(t,this.Be)}})),this.onMouseLeave((()=>{this._e&&this.Le&&(this.Ji.engine.restoreMouseStyle(this.Be),this.Be=void 0)})),this.onMouseDrag(((e,i,s,n,r)=>{this._e&&this.Le&&0===s&&t(i,r)}));const i=Yi(new Xi(void 0,((e,i,s,n,r)=>t(r,n))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const Rs={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?Rs.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Rs.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?Rs.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Ne,Os=t=>void 0!==t.Ge,Ns={We:Ci.Numeric},Us=(t,e)=>[t,e],Gs=(t,e,i,s)=>{const n=[],r=Math.round(Math.abs((t-e)/i));for(let o=1;o{Et(t,0)&&(t=0),Et(e,0)&&(e=0);const r=[];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 n=[];let r=i(t),o=0;for(;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return n.push(r),n},Hs=(t,...e)=>{const i=e.length>0?e.length:t?1:0;return(s,n,r,o,a,h)=>{if(n>=i)return;const l=e[n]||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,n)=>(i&&(t=t.filter(((t,e)=>e>0))),s&&(t=t.filter(((e,i)=>i(i+n)%e==0))))(s,l,u,c,d)}},Xs=(...t)=>{const e=t.length>0?t.length:0;return(i,s,n,r,o,a)=>{if(s>=e)return;const h=t[s]||1;return i.filter(((t,e)=>e%h==0))}},js=(t,e)=>{if(e.has(t))return e.get(t);const i=je(t.Ye.Ue());return e.set(t,i),i},$s=t=>{const e=new Map;if(t!==Ns){for(const i of t.He)e.set(i,new Map);for(const i of t.$e)e.set(i,new Map)}return e};class qs{constructor(t,e,i,s,r,o,a){this.D=new n.Eventer,this.Xe=Ns,this.je=Vs.Empty,this.Ze=new Map,this.Qe=new Map,this.Je=Rs.fitting,this.Ke=!0,this.qe=$((()=>this.chart.us.bs()))(300,X.linear),this.th=!0,this.Xi=!0,this.ih=!1,this.sh=Fe,this.eh=!1,this.hh=!1,this.rh=Fe,this.oh=Fe,this.ah=Fe,this.lh=!1,this.uh=()=>{this.ih||void 0===this.Je||this.chart.us.bs(!0)},this.dh={},this.fh=(t,e,i,s,n,r)=>{const o=[],a=[];for(const h of t){if(hs){o.push(h);continue}const t=this.Ze.get(e),l=(t?t.get(h):void 0)||this.Ah(h,e);l.gh=!1;const u=this.ph(l,n);r.set(l,u),o.push(h),a.push(l)}return{displayedKeyValues:o,createdTicks:a}},this.mh=(t,e,i,s,n,r,o,a,h,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.Sh!==i||!!t.find((t=>t===e)))).map((t=>Re(e,js(t,h))?t:void 0)),m=y.some((t=>void 0!==t))}else m=!1;if(m){let t=!0;const e=y.filter((t=>void 0!==t));if(t&&e.every((t=>Bs(t.Sh)))&&(t=!1),t&&i.xh&&i.xh.bh&&!1===i.xh.bh(g,s,n,r,o,a)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.Xe.We(t,this.dt),this.chart=t,this.Mh=e,this.qi=s,this._h=o,this.dt=i,this.wh=a,"logarithmic"===a.type&&this.setAnimationZoom(X.logarithmic(Mi(a.base))),this.Ch=o.numeric,this.kh("Numeric"),this.Th=i.getInnerStart(),this.Fh=i.getInnerEnd(),this.setAnimationsEnabled(r)}setDefaultInterval(t,e){return this.Ih=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.lh=!0,this.chart.us.bs()),this}getDefaultInterval(){return this.Ih}getTitle(){return this.Dh.Ph()}setTitle(t){return this.Dh.Bh(t),this.chart.us.bs(),this}getTitleFillStyle(){return this.Dh.Lh()}setIntervalRestrictions(t){return this.Rh=t,this.chart.us.bs(),this}getIntervalRestrictions(){return this.Rh}setTitleFillStyle(t){return this.Dh.ke(t),this.chart.us.bs(),this}getTitleFont(){return this.Dh.Eh()}setTitleFont(t){return this.Dh.Vh(t),this.chart.us.bs(),this}setTitleRotation(t){return this.Dh.zh(t),this.chart.us.bs(),this}getTitleRotation(){return this.Dh.Oh()}setTitleEffect(t){return this.Nh.xs(t),this.chart.us.bs(),this}getTitleEffect(){return this.Nh.Ms()}kh(t,e){if(this.Ze.size>0&&this.Gh(),"Empty"===t)this.Xe=Ns,this.je=t;else if("Numeric"===t){"Numeric"!==this.je&&(this.Ch=this._h.numeric);const i=e||(t=>t);this.Ch=i(this.Ch),this.Xe=this.Ch.Wh(this.wh),this.je=t}else if("DateTime"===t){"DateTime"!==this.je&&(this.Ch=this._h.datetime);const i=e||(t=>t);this.Ch=i(this.Ch),this.Xe=this.Ch.Wh(this.wh),this.je=t}else if("Time"===t){"Time"!==this.je&&(this.Ch=this._h.time);const i=e||(t=>t);this.Ch=i(this.Ch),this.Xe=this.Ch.Wh(this.wh),this.je=t}return this.Qe.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Qe=$s(this.Xe),this.chart.us.bs(),this}Uh(){return this.Xe}Yh(t){this.Xe=t,this.Qe.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Qe=$s(this.Xe),this.chart.us.bs()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:n}=t;return this.St(void 0!==e?e:this.Th,void 0!==i?i:this.Fh,void 0!==s&&s,void 0===n||n,"userSetInterval"),this}St(t,e,i=!1,s=!0,n){let r={start:t,end:e};const o=!0,a=Math.abs(e-t);if(Math.abs(this.Fh-this.Th),void 0!==this.Xe.Hh&&this.Xe.Hh>a){const i=(e+t)/2,s=this.Xe.Hh/2*(t>e?-1:1);r={start:i-s,end:i+s}}if(void 0!==this.Xe.$h&&this.Xe.$he?-1:1);r={start:i-s,end:i+s}}const h=this.dt.nt(r.start,r.end,this.Th,this.Fh,o);if(!1===h)return this;if(!0===h);else if(r=h,"zoomBandChart"===n)return this;let l;switch(n){case"userSetInterval":case"userFit":case"interactionSetInterval":case"interactionZoom":l=!0;break;case"zoomBandChart":case"synchronizedAxis":l=!1;break;default:return Se(0,""),this}if(this.Xh&&this.Xh.finishAll(!1),this.qe&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.Xh||this.Xh.isOver()?this.qe:this.Xh.NextAnimation.bind(this);this.Xh=e([[this.Th,r.start],[this.Fh,r.end]],(([t,e])=>{this.jh(t,e,o)}),t),this.Xh.onAnimationEnd((()=>{this.Xh=void 0,l&&(this.ah=St.performance.now())})),this.Xh.onAnimationEnd((()=>this.setStopped(s)))}else this.jh(r.start,r.end,o),this.setStopped(s),l&&(this.ah=St.performance.now());return this}getInterval(){return{start:this.Th,end:this.Fh}}setStopped(t){return t===this.ih||(t&&(this.Xh&&this.Xh.finishAll(!1),this.Xh=void 0),this.ih=t,this.D.emit("stoppedStateChanged",this,this.ih),this.sh=St.performance.now(),this.chart.us.bs()),this}getStopped(){return this.ih}onStoppedStateChanged(t){return this.D.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.D.off(t,"stoppedStateChanged")}fit(t,e){const i=this.Zh(),s=this.Ih||tn,n="function"==typeof s?s({curStart:this.Th,curEnd:this.Fh,dataMin:null==i?void 0:i.min,dataMax:null==i?void 0:i.max}):s;return this.St(void 0!==n.start?n.start:this.Th,void 0!==n.end?n.end:this.Fh,void 0!==n.animate?n.animate:void 0===t||t,void 0!==n.stopAxisAfter?n.stopAxisAfter:void 0===e||e,"userFit"),this}setScrollStrategy(t){return this.Je=t,this.chart.us.bs(),this}getScrollStrategy(){return this.Je}setAnimationScroll(t){return this.Ke=Boolean(t),this.chart.us.bs(),this}setAnimationZoom(t,e=300){return this.Xh&&(this.Xh.finishAll(!1),this.Xh=void 0),this.qe=t?$((()=>this.chart.us.bs()))(e,t):void 0,this}setAnimationsEnabled(t){return this.th=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(X.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.th}setVisible(t){const e=this.Xi!==t;return this.Xi=t,this.Dh.setVisible(t),this.Qh((e=>{e.Ye.setVisible(t)})),e&&this.D.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onIntervalChange(t){return this.D.on("scaleChange",t)}offIntervalChange(t){return this.D.off(t,"scaleChange")}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}Jh(t,e){const i=new Map;if(this.Xe===Ns||!this.Xi)return this.Gh(),i;e=e||new Map;const s=this.Kh(),n=s.min,r=s.max,o=r-n,a=t.physicalAxisSize;this.dh.physicalAxisSize=a;const h=Ks(this.Xe,n,r,this.Th,this.Fh,a),l=[];if(this.qh(),l.push(...this.tr(this.Xe,n,r,h,e,t,i)),this.ir(this.Xe,n,r,h,e,t,l,i),this.sr(),h)for(const[t,e]of this.Qe){const i=h.get(t);if(void 0!==i)for(const[t,s]of e)i.includes(t)||(null==s||s.dispose(),e.delete(t))}return this.dh.min=n,this.dh.max=r,this.dh.scaleInterval=o,this.dh.physicalAxisSize=a,i}er(t){const e=t.Sh.hr;t.Ye.Bh(e(t.S,this.dt)).Ds()}rr(t,e){const i=e.nr;t.Ye.ke(i.getLabelFillStyle()).Vh(i.getLabelFont()).zh(i.getLabelRotation())}Ah(t,e){const i=this.Qe.get(e);let s=i.get(t);s?(i.delete(t),s.Sh=e,s.vs(!0)):s=this.ar(t,e);const n=this.Ze.get(e)||new Map;return n.set(t,s),this.Ze.set(e,n),this.rr(s,e),s}ph(t,e){const i=this.lr(t,e);return this.er(t),i}tr(t,e,i,s,n,r,o){const a=[];for(const h of t.He){const t=s.get(h);for(const s of t){if(si)continue;const t=this.Ze.get(h),l=(t?t.get(s):void 0)||this.Ah(s,h),u=this.ph(l,r),c=js(l,n);a.find((t=>Re(c,js(t,n))))&&l.Ye.setVisible(!1),l.gh=!1,o.set(l,u),a.push(l)}}return a}ir(t,e,i,s,n,r,o,a){let h,l=[];for(const u of t.$e){const t=s.get(u);if(!t)break;let c;if(void 0===h)c=[{start:e,end:i,keyValues:t}];else{c=[];for(let e=0;e=i&&e0){if(void 0===u.xh){y=!1;break}const t=u.xh.ur;if(h=t(h,d-1,r,a,e,i),void 0===h)break}const p=this.mh(m.filter((t=>h.some((e=>Et(t.S,e))))),g,u,d,r,a,e,i,n,o,l);!0!==p?t=t.concat(p):(d+=1,f=-1,t=[])}p=t,m.forEach((e=>{t.find((t=>t===e))||this.cr(e)}))}if(l=p,!y)break}}cr(t){const e=this.Ze.get(t.Sh);null==e||e.delete(t.S);const i=this.Qe.get(t.Sh);i&&i.has(t.S)?t.dispose():i&&(t.vs(!1),i.set(t.S,t))}Qh(t){for(const e of this.Ze.values())for(const i of e.values())t(i)}dr(t,e){for(const i of this.Ze.values())for(const s of i.values())e=t(e,s);return e}Gh(){this.Ze.forEach(((t,e)=>{t.forEach((t=>this.cr(t)))})),this.Ze.clear()}qh(){for(const t of this.Ze.values())for(const e of t.values())e.gh=!0}sr(){for(const t of this.Ze.values())for(const[e,i]of t.entries())i.gh&&(i.dispose(),t.delete(e))}Kh(){const t=this.dt.getInnerStart()this.dt.getInnerStart()?this.dt.getInnerEnd():this.dt.getInnerStart();return m(t,e)}yh(t,e){return!(t.gh||0===t.Ye.Ph().length||Bs(e)&&!0!==e.Ar)}gr(t,e){return this.Xe===Ns||(this.Xe.He.forEach((i=>{e=t(e,i.nr)})),this.Xe.$e.forEach((i=>{(t=>void 0!==t.hr)(i)&&(e=t(e,i.nr))}))),e}Zh(){let t=this.Mh.pr();const e=this.Mh.mr();let i;if(void 0!==t&&vt(t)&&void 0!==e&&vt(e)&&("logarithmic"===this.wh.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=m(t,e)),i&&vt(i.min)&&vt(i.max))return Et(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}yr(){let t=0;const e=this.Mh.Sr();return e&&(t=Math.max(t,e)),t}vr(){var t;const e=this.eh;let i=!1;if(this.lh&&this.Ih){const t=this.Zh(),e="function"==typeof this.Ih?this.Ih({curStart:this.Th,curEnd:this.Fh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.Ih;this.setInterval(e),this.lh=!1}if(this.Je&&!this.ih){const e=this.Zh();if(e){const s=this.Th,n=this.Fh;let r=this.Je.start(s,n,e.min,e.max),o=this.Je.end(s,n,e.min,e.max);const a=null===(t=this.Je.allowIntervalLengthChange)||void 0===t||t,h=Qs(this.Rh,e,{start:r,end:o},{start:s,end:n},a);r=h.start,o=h.end;const l=!1===Et(s,r),u=!1===Et(n,o);if(r=l?r:s,o=u?o:n,l||u){let t=!1;if(this.Ke)if(this.Ke){t=!0;const e=l?this.br(s,r):s,h=u?this.br(n,o):n;if(!0===this.jh(e,h,a)&&(l&&!1===Et(e,r)||u&&!1===Et(h,o))){this.chart.us.bs(!0),i=!0;let t=Math.abs(o-r)/Math.abs(e-h);t<1&&(t=1/t),this.hh=t>=1.4}}else t=!1;t||this.jh(r,o,a)}}}i?(this.eh!==i&&(this.eh=i,this.rh=St.performance.now()),this.Mr&&(clearTimeout(this.Mr),this.Mr=void 0)):!0===e&&void 0===this.Mr&&(this.hh=!1,this.Mr=setTimeout((()=>{!1!==this.eh&&(this.eh=!1,this.rh=St.performance.now()),this.Mr=void 0,this.chart.us.bs()}),200))}jh(t,e,i){let s={start:t,end:e},n=!0;if(this.Rh){const t=this.Zh();s=Qs(this.Rh,t,s,{start:this.Th,end:this.Fh},i)}const r=Math.abs(e-t),o=Math.abs(this.Fh-this.Th);if(void 0!==this.Xe.Hh&&this.Xe.Hh>r){const r=(e+t)/2,a=(i?this.Xe.Hh/2:o/2)*(t>e?-1:1);s={start:r-a,end:r+a},n=!1}if(void 0!==this.Xe.$h&&this.Xe.$he?-1:1);s={start:r-a,end:r+a},n=!1}let a=this.dt.nt(s.start,s.end,this.Th,this.Fh,i);if(!1===a)return!1;!0!==a&&(s=a);const h=this.yr(),l=this._r(Math.min(s.start,s.end),Math.max(s.start,s.end),h);return a=this.dt.nt(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min,this.Th,this.Fh,!1),!!a&&(!0===a?this.dt.J(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min):this.dt.J(s.start,s.end),this.Th=s.start,this.Fh=s.end,this.D.emit("scaleChange",this,s.start,s.end),this.oh=St.performance.now(),this.chart.us.bs(),n)}wr(){return this.eh}Cr(){return void 0!==this.Xh}}class Js{constructor(t,e,i,s,n=i.kr(s).setMouseInteractions(!1)){this.gh=!1,this.$i=!1,this.ts=[],this.Sh=t,this.S=e,this.Tr=i,this.Fr=s,this.Ye=n,this.ts.push(n)}vs(t){this.ts.forEach((e=>e.setVisible(t)))}dispose(){return this.$i||(this.$i=!0,this.ts.forEach((t=>t.dispose()))),this}}const Ks=(t,e,i,s,n,r)=>{const o=new Map;for(const r of t.He){let t=r.Ir(e,i,s,n);t=Zs(t),o.set(r,t)}let a;for(const s of t.$e){let t;if(void 0===a)t=s.Ir(e,i,e,i);else{let n=[];const o=a.filter((t=>e<=t&&t<=i)).length;if(o>0){const t=r/(o-1);if(void 0!==s.Pr&&s.Pr>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let n=0;for(let r=0;rt-e)),Qs=(t,e,i,s,n)=>{const r="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(!r)return i;const o={start:i.start,end:i.end};let a=Math.abs(i.end-i.start);if(void 0!==r.intervalMin&&ar.intervalMax){const t=(o.start+o.end)/2;o.start=t+.5*Math.sign(i.start-t)*r.intervalMax,o.end=t+.5*Math.sign(i.end-t)*r.intervalMax}return a=Math.abs(i.end-i.start),void 0!==r.startMin&&(o.start=Math.max(o.start,r.startMin),n||Et(Math.abs(o.start-o.end),a)||(o.end=o.start+Math.sign(i.end-i.start)*a)),a=Math.abs(i.end-i.start),void 0!==r.startMax&&(o.start=Math.min(o.start,r.startMax),n||Et(Math.abs(o.start-o.end),a)||(o.end=o.start+Math.sign(i.end-i.start)*a)),a=Math.abs(i.end-i.start),void 0!==r.endMin&&(o.end=Math.max(o.end,r.endMin),n||Et(Math.abs(o.start-o.end),a)||(o.start=o.end+Math.sign(i.start-i.end)*a)),a=Math.abs(i.end-i.start),void 0!==r.endMax&&(o.end=Math.min(o.end,r.endMax),n||Et(Math.abs(o.start-o.end),a)||(o.start=o.end+Math.sign(i.start-i.end)*a)),o},tn=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}},en=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class sn extends en{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 nn=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),rn=new sn,on=new class{getFillStyle(){return V}},an=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new U,wireframeStyle:nt});class hn extends an{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 ln=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),un=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new U});class cn extends un{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 dn=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),fn={Triangulated:hn,Pixelated:cn};class gn{constructor(t){this.Dr=new Map,this.us=t}os(t,e,i){const s=i.animationEnabled;this.Dr.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const n=t.onDispose((()=>{this.Dr.delete(t),t.offDispose(n)}))}Br(t,e){const i=e.animationEnabled,s=[],n=t.onDispose((()=>{s.forEach((t=>{this.Dr.delete(t)})),t.offDispose(n)}));return{Lr:(t,e)=>{const n={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Dr.set(t,n)}}}ws(t,e){const i=this.Dr.get(t);i&&(i.curUnanimatedHighlightValue=Ae(e),this.us.bs())}ys(t,e=!1){const i=this.Dr.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}Cs(t,e){const i=this.Dr.get(t);i&&(i.animationEnabled=e)}ks(t){const e=this.Dr.get(t);return!!e&&e.animationEnabled}Ds(t){let e=!1;this.Dr.forEach(((i,s)=>{let n;if(i.animationEnabled){const s=1e3;if(i.curUnanimatedHighlightValue>0){const r=i.curAnimationPositionMillis/s;n=i.curUnanimatedHighlightValue*Math.abs(Math.sin(r*Math.PI/2+.5));const o=0===i.curAnimatedHighlightValue?1:t;i.curAnimationPositionMillis+=o,e=!0}else i.curAnimatedHighlightValue>0&&0===i.curUnanimatedHighlightValue?(n=Math.max(i.curAnimatedHighlightValue-t/s,0),e=e||n>0):n=0,i.curAnimationPositionMillis=0}else n=i.curUnanimatedHighlightValue;n!==i.curAnimatedHighlightValue&&(i.applyHighlight(n),i.curAnimatedHighlightValue=n)})),e&&this.us.bs(!0)}}const mn=new Map,pn=t=>{const e=t.getSize(),i=t.getFamily(),s=t.getWeight(),n=t.getStyle(),r=t.getVariant(),o=`${n} ${r?"small-caps":"normal"} ${s} ${e}px ${i}`;let a=mn.get(o);return a||(a=((t,e)=>({font:t,properties:e}))(o,{type:"font",size:e,family:i,style:n,variant:r,weight:s}),mn.set(o,a)),a};var yn,An;!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"}(yn||(yn={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(An||(An={}));const xn=t=>({container:t.Rr,scale:t.dt,setMouseStyle:(e,i)=>t.Er(e,i),restoreMouseStyle:e=>t.Vr(e),clientLocation2Engine:(e,i)=>t.De(e,i),engineLocation2Client:(e,i)=>t.zr(e,i),captureFrame:(e,i,s)=>t.Or(e,i,s),renderFrame:(e,i,s=!1)=>t.Nr(e,i,s),layout:()=>{t.Gr(),t.Wr(),t.Yr.Ur(),t.bs()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.Hr(e,i),onRenderFrame:e=>t.$r(e),offRenderFrame:e=>t.Xr(e)}),Sn=[];let bn;const vn=()=>{if(void 0!==bn){const t=St.getComputedStyle(St.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));bn.style.height=St.innerHeight-e+"px",(()=>{for(let t=0;tthis.bs()),60),this.Qr=u(0,0),this.Jr=!1,this.Kr=wt,this.qr=()=>{},this.tn=[],this.sn=-1,this.en=[],this.hn=!0,this.$i=!1,this.rn=!1,this.Wr=()=>{const{bottom:t,left:e}=this.Rr.getBoundingClientRect();return this.Qr=u(Math.floor(e),Math.floor(t)),this},this.Gr=()=>{this.nn&&this.nn()},this.Er=(t,e)=>{if(!e){this.Rr.style.cursor=t;const e=this.sn;return this.sn+=1,this.en.push([e,t]),e}return this.Vr(e),this.Er(t)},this.Vr=t=>{const e=t?this.en.findIndex((e=>e[0]===t)):-1;e>=0?(this.en.splice(e,1),this.en.length>0?this.Rr.style.cursor=this.en[this.en.length-1][1]:this.Rr.style.cursor="default"):(this.en.push([0,"default"]),this.Rr.style.cursor="default")},this.an=t=>(this.ln.M(t),this),this.un=()=>this.ln._(),this.cn=()=>{this.Kr&&this.Kr(1e3/60),this.dn(),this.fn(),this.qr&&this.qr()},this.An=t=>(this.jr.set(t.gn(),t),this.jr=new Map([...this.jr.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.pn=t=>(this.jr.delete(t),this),this.j=()=>(this.ln.o=!1,this),this.Z=()=>(this.ln.o=!0,this),this.mn=t=>{if(!this.hn)return;const e=this.yn,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.De(t.clientX,t.clientY),n=this.Sn(t,{x:t.clientX,y:t.clientY});if(this.vn&&((null==n?void 0:n.entity)!==this.vn.entity||n.collectionMember!==this.vn.collectionMember)&&!this.xn){this.vn.entity.ji=!1;const e=this.vn.entity.bn;e&&e(this.vn.entity,t,this.vn.collectionMember)}if(n&&n.entity.getMouseInteractions()&&!this.xn)if(n.entity.ji){if(!i){const e=n.entity.Mn;e&&e(n.entity,t,n.collectionMember)}}else{n.entity.ji=!0;const e=n.entity._n;e&&e(n.entity,t,n.collectionMember)}if(this.xn){const i=this.xn.entity.wn,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.Cn=t,this.yn=t,this.kn=s,this.vn=n},this.Tn=t=>{if(this.hn=!1,this.kn=void 0,this.Cn=t,this.vn&&!this.Fn&&!this.xn){this.vn.entity.ji=!1;const e=this.vn.entity.bn;e&&e(this.vn.entity,t,this.vn.collectionMember),this.vn=void 0}},this.In=t=>{if(this.hn=!0,this.Cn=t,this.xn&&t.buttons<=0){const e=this.xn.entity.Pn;e&&e(this.xn.entity,t,this.xn.button,this.xn.startLocation,this.xn.collectionMember),this.xn=void 0}if(this.Fn&&t.buttons<=0){const e=this.Fn.entity.Dn;e&&e(this.Fn.entity,t,this.Fn.collectionMember),this.Fn=void 0}},this.Bn=()=>this.kn,this.Yr=t,this.qi=e.theme,this.As=i.As,this.Ln=i.Ln,this.Rn=i.Rn,this.En={Vn:i.Vn,zn:i.zn,On:i.On,Nn:i.Nn,Gn:i.Gn,Wn:i.Wn,Un:i.Un,Yn:i.Yn,Hn:i.Hn,$n:i.$n,Xn:i.Xn,jn:i.jn,Zn:i.Zn,Qn:i.Qn,Jn:i.Jn,Kn:i.Kn,qn:i.qn,io:i.io,so:i.so,eo:i.eo,ho:i.ho,ro:i.ro,no:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,Xs:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:`${St.location.origin}/resources`,oo:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,ao:(()=>{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})(),lo:void 0===(null==e?void 0:e.interactable)||e.interactable,uo:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=St.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.Rr=t}else this.Rr=s;St.addEventListener("resize",this.Gr),this.tn.push((()=>{St.removeEventListener("resize",this.Gr)}))}else{if(void 0===bn){const t=St.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",St.document.body.appendChild(t),bn=t,St.addEventListener("resize",vn)}let t=1;for(;null!==St.document.getElementById(`chart-${t}`);)t+=1;this.Rr=St.document.createElement("div"),this.Rr.id=`chart-${t}`,this.Rr.style.flex="1",this.Rr.style.height="100%",bn.appendChild(this.Rr),vn(),Sn.push(this.Gr),this.tn.push((()=>{bn&&bn.removeChild(this.Rr),Sn.includes(this.Gr)&&Sn.splice(Sn.indexOf(this.Gr),1),0===Sn.length&&bn&&(St.document.body.removeChild(bn),bn=void 0,St.removeEventListener("resize",vn))}))}if(St.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Rr&&this.Gr()};this.co=new St.ResizeObserver(t.bind(this)),this.co.observe(this.Rr)}""===this.Rr.style.position&&(this.Rr.style.position="relative"),this.Rr.style.boxSizing="content-box",this.Rr.addEventListener("fullscreenchange",this.Gr),this.Rr.addEventListener("webkitfullscreenchange",this.Gr);const r=e?e.maxFps:void 0;this.do=r?-1===r?-1:0!==r?1e3/r:0:0;const o=new Map;let a=!1;const h=(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),a=!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&&(a=!0)};this.Rr.onwheel=this.fo(yn.wheel),this.Rr.oncontextmenu=this.fo(yn.contextmenu),this.Rr.onclick=this.fo(yn.click),this.Rr.ondblclick=this.fo(yn.dbclick),this.Rr.onlostpointercapture=()=>{a=!1},this.Rr.ontouchmove=t=>{a&&t.preventDefault()},this.Rr.onpointerover=h(),this.Rr.onpointerenter=h(this.In),this.Rr.onpointerdown=h(this.fo(yn.mouseDown),this.Ao(An.touchStart)),this.Rr.onpointermove=h(this.mn,this.Ao(An.touchMove)),this.Rr.onpointerup=h(this.fo(yn.mouseUp),this.Ao(An.touchEnd)),this.Rr.onpointercancel=h(),this.Rr.onpointerout=h(),this.Rr.onpointerleave=h(this.Tn,this.Ao(An.touchEnd)),St.addEventListener("scroll",this.Wr,{passive:!0}),this.ln=y(new v({r:0,g:0,b:0,a:0})),this.ls=new gn(this)}po(t,e){var i,s,n,r;(null===(i=this.vn)||void 0===i?void 0:i.entity)===t.entity&&this.vn.collectionMember===t.collectionMember&&(this.vn=e),(null===(s=this.mo)||void 0===s?void 0:s.entity)===t.entity&&this.mo.collectionMember===t.collectionMember&&(this.mo=e),(null===(n=this.Fn)||void 0===n?void 0:n.entity)===t.entity&&this.Fn.collectionMember===t.collectionMember&&(this.Fn={...e,event:this.Fn.event}),(null===(r=this.xn)||void 0===r?void 0:r.entity)===t.entity&&this.xn.collectionMember===t.collectionMember&&(this.xn={...e,button:this.xn.button,startLocation:this.xn.startLocation})}yo(){this.rn=!0,this.Kr=void 0,this.qr=void 0}$r(t){return this.D.on("render",t)}Xr(t){return this.D.off(t)}So(){return this.vo}xo(){return this.bo}setBackgroundFillStyle(t){return this.Mo.ke(t),this}getBackgroundFillStyle(){return this.Mo.Lh()}setBackgroundStrokeStyle(t){return this.Mo.Ce(t),this}getBackgroundStrokeStyle(){return this.Mo._o()}wo(t){return this.qr=t,this}Co(t){return this.Kr=t,this}ko(t){return this.jr.get(t)}To(){return Array.from(this.jr.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}fo(t){return e=>this.Fo(t,e)}Fo(t,e){if(!this.hn)return;t===yn.contextmenu&&jt(e);const i=this.De(e.clientX,e.clientY),s=this.Sn(e,{x:e.clientX,y:e.clientY});if(t===yn.mouseUp){if(this.xn){const t=this.xn.entity.Pn;if(t&&t(this.xn.entity,e,this.xn.button,this.xn.startLocation,this.xn.collectionMember),(null==s?void 0:s.entity)!==this.xn.entity||s.collectionMember!==this.xn.collectionMember){this.xn.entity.ji=!1;const t=this.xn.entity.bn;t&&t(this.xn.entity,e,this.xn.collectionMember)}this.xn=void 0}if(this.Fn){const t=this.Fn.entity.getMouseInteractions()&&this.Fn.entity.Dn;t&&t(this.Fn.entity,e,this.Fn.collectionMember),this.Fn=void 0}}else if(s&&s.entity.getMouseInteractions()){const i=t===yn.click?s.entity.Io:t===yn.dbclick?s.entity.Po:t===yn.mouseDown?s.entity.Do:t===yn.wheel?s.entity.Bo:t===yn.contextmenu?s.entity.Lo:void 0;if(i&&i(s.entity,e,s.collectionMember),t===yn.mouseDown){this.Fn={entity:s.entity,collectionMember:s.collectionMember,event:e};const t=this.Fn.event.button,i=s.entity.Ro;i&&i(s.entity,e,t,s.collectionMember),this.xn={entity:s.entity,collectionMember:s.collectionMember,button:t,startLocation:u(e.clientX,e.clientY)}}}this.Cn=e,this.kn=i,this.vn=s}Ao(t){return e=>this.Eo(t,e)}Eo(t,e){const i=e.interactions.length;if(this.Vo=e,this.mo){const s=t===An.touchMove?this.mo.entity.zo:t===An.touchEnd?this.mo.entity.Oo:t===An.touchStart?this.mo.entity.No:void 0;s&&s(this.mo.entity,e,this.mo.collectionMember),t===An.touchEnd&&0===i&&(this.mo.entity.ji=!1,this.mo=void 0)}else if(t===An.touchStart){for(let t=0;t{t()})),this.tn.length=0}De(t,e){return u(t-this.Qr.x,this.Qr.y-e)}zr(t,e){return u(t+this.Qr.x,this.Qr.y-e)}$o(t){const e=this.De(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Xo(t){const e=this.zr(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const En=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const n=si(i,s*t),r=Math.abs(n.x),o=e.length,a=[];let h=0,l=0,c=e[0].x+r;for(;ls&&(s=e[l].y),e[l].y({type:"horizontalRegressive",packager:(e,i,s)=>{if(e.length>1){const n=si(i,s*t),r=Math.abs(n.x),o=e.length,a=[];let h=0,l=0,c=e[0].x-r;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 n=si(i,s*t),r=Math.abs(n.y),o=e.length,a=[];let h=0,l=0,c=e[0].y+r;for(;ls&&(s=e[l].x),e[l].x({type:"verticalRegressive",packager:(e,i,s)=>{if(e.length>1){const n=si(i,s*t),r=Math.abs(n.y),o=e.length,a=[];let h=0,l=0,c=e[0].y-r;for(;lc&&l=c;)e[l].x>s&&(s=e[l].x),e[l].x{const e="nearest"===t?Fn.Nearest:"nearest-x"===t?Fn.NearestX:"nearest-y"===t?Fn.NearestY:void 0;return void 0!==e?e:Fn.NearestX},zn=(t,e,i,s,n,r,o,a,h,l)=>{const u=t.length;if(0===u)return;const c=s?1:0,d=u-(n?2:1);if(i===Fn.Nearest)return Pn(t,e,r,o,c,d);if(i===Fn.NearestX||i===Fn.NearestY){if("boolean"==typeof l&&("x"===h&&i===Fn.NearestX||"y"===h&&i===Fn.NearestY))return Bn(t,ut(e,o,r),h,l,c,d);if(i===Fn.NearestX)return Rn(t,ut(e,o,r),a,c,d);if(i===Fn.NearestY)return Vn(t,ut(e,o,r),a,c,d)}},Pn=(t,e,i,s,n,r)=>{let o,a=Number.MAX_VALUE;for(let h=n;h<=r;h+=1){const n=t[h];if(!Number.isNaN(n.x)&&!Number.isNaN(n.y)){const t=ut(n,i,s),r=(t.x-e.x)**2+(t.y-e.y)**2;r{if(e.xi.max.x)return;let r,o=Number.MAX_VALUE;for(let i=s;i<=n;i+=1){const s=t[i],n=s.x>e.x?s.x-e.x:e.x-s.x;n{if(e.yi.max.y)return;let r,o=Number.MAX_VALUE;for(let i=s;i<=n;i+=1){const s=t[i],n=s.y>e.y?s.y-e.y:e.y-s.y;n{const o="x"===i,a=o?e.x:e.y,h=t[n],l=t[r],u=h.xl.x?h.x:l.x,f=h.y>l.y?h.y:l.y;if(o&&(ad)||!o&&(af))return;let g=n,m=Math.floor((n+r)/2),p=r,y=-1;for(;;){const e=a-(o?t[m].x:t[m].y);if(e*(s?-1:1)>0)g=Math.min(m+1,p),y=Math.floor((g+p)/2);else{if(0===Math.abs(e))return m;p=Math.max(m-1,g),y=Math.floor((g+p)/2)}if(y===m){const i=m>n?Math.abs(a-(o?t[m-1].x:t[m-1].y)):_e,s=m{const o="x"===i,a=o?e.x:e.y,h=t[n],l=t[r],u=h.xl.x?h.x:l.x,f=h.y>l.y?h.y:l.y;if(o&&(ad)||!o&&(af))return;let g=n,m=Math.floor((n+r)/2),p=r,y=-1;for(;;){const i=a-(o?t[m].x:t[m].y);if(i*(s?-1:1)>0)g=Math.min(m+1,p),y=Math.floor((g+p)/2);else{if(0===Math.abs(i))return{a:m,b:m,lerpAmount:0};p=Math.max(m-1,g),y=Math.floor((g+p)/2)}if(y===m){if(i*(s?-1:1)<0&&m>n){const i=t[m-1],s=t[m];return{a:m-1,b:m,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(mthis.D.on("dispose",t),this.offDispose=t=>this.D.off(t,"dispose"),this.us=t,this.qo=e,this.ta=i,this.ia=Nn,Nn+=1,this.sa=t.qi.highlightColorOffset}ea(t){return void 0!==this.ta.find((e=>e.type===t))}ha(t,e){var i;return!!this.ea(t)&&!0===e(null===(i=this.ta.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.$i||(this.ji&&this.bn&&this.bn(this,void 0,void 0),this.$i=!0,this.qo(this),this.D.emit("dispose",this)),this}setVisible(t){const e=this.Xi;return this.Xi=t,!t&&e&&(this.ji&&this.bn&&this.bn(this,void 0,void 0),this.ji=!1),this}getVisible(){return this.Xi}setMouseInteractions(t){const e=this.jo._();return this.jo.M(t),t||(e&&this.ji&&this.bn&&this.bn(this,void 0,void 0),this.ji=!1),this}getMouseInteractions(){return this.jo._()}getIsUnderMouse(){return this.ji}getIsGrabbed(){return this.Qo}setMouseMoveEventHandler(t){return this.Mn=t,this}setMouseEnterEventHandler(t){return this._n=t,this}setMouseLeaveEventHandler(t){return this.bn=t,this}setMouseClickEventHandler(t){return this.Io=t,this}setMouseDoubleClickEventHandler(t){return this.Po=t,this}setMouseDownEventHandler(t){return this.Do=t,this}setMouseUpEventHandler(t){return this.Dn=t,this}setMouseWheelEventHandler(t){return this.Bo=t,this}setMouseContextMenuEventHandler(t){return this.Lo=t,this}setMouseDragEventHandler(t){return this.wn=t,this}setMouseDragStartEventHandler(t){return this.Ro=t,this}setMouseDragStopEventHandler(t){return this.Pn=t,this}setTouchStartEventHandler(t){return this.No=t,this}setTouchMoveEventHandler(t){return this.zo=t,this}setTouchEndEventHandler(t){return this.Oo=t,this}ra(t){return this.Jo=t,this}na(){return this.Jo?this.Jo:Gn}cs(t){return this.Ko=t,this}oa(){return this.Ko}aa(t){return this.sa=t,this}la(){return this.sa}}const Gn=m(u(0,0),u(0,0));class Wn extends Un{constructor(t,e,i,s){super(t,i,s),this.ua=0,this.Ts=e,this.Ts.ca=!0}da(t){return this.ua===t||(this.ua=t,this.Ts.ca=!0),this}fa(){return this.ua}}class Yn extends Wn{constructor(t,e,i,s,n){super(t,e,s,n),this.Aa=!0,this.dt=i}}const Hn=(t,e,i)=>{if(i instanceof Li){const s=i.Wi(),n=oi(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return m(u(t.min.x-n.x,t.min.y-n.y),u(t.max.x+n.x,t.max.y+n.y))}return m(i.pi(u(t.min.x,t.min.y),si(e,-1)),i.pi(u(t.max.x,t.max.y),e))},Xn=(t,e)=>"function"==typeof e?e(t):e,jn=(t,e)=>!t||t!==e,$n=t=>t!==V;class qn extends Yn{constructor(t,e,i,s,n){super(t,e,i,s,n),this.be=Tn.fillStyle,this.us=t}ke(t){return this.be=Xn(this.be,t),this}Lh(){return this.be}ga(){return jn(this.pa,this.be)}ma(){return((t,e)=>t===V&&e!==V)(this.pa,this.be)}ya(){return $n(this.be)}Sa(t){this.pa=t}}class Jn extends qn{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Me=Tn.lineStyle,this.us=t}Ce(t){return this.Me="function"==typeof t?t(this.Me):t,this}_o(){return this.Me}va(){return!this.xa||this.xa!==this.Me}ba(t){return!this.xa||this.xa.getThickness()!==t}ya(){return this.Me!==nt||super.ya()}ma(){return(this.Me!==nt||this.be!==V)&&this.xa===nt&&this.pa===V}Ma(t){this.xa=t}}class Kn extends qn{constructor(t,e,i,s,n,r=y(5)){super(t,e,i,s,n),this.size=y(5),this.size=r}q(t){return this.size.M(t),this}}class Zn extends qn{constructor(t,e,i,s,n,r=y(Tn.font)){super(t,e,i,s,n),this._a=y(""),this.wa=y(u(0,0)),this.Ca=y(0),this.ka=y(0),this.Ta=y(u(0,0)),this.Fa=y(0),this.Ia=y(rn),this.Pa=u(0,0),this.Xt=y(A(1,1,1,1)),this.Da=y(x(4,4,4,4)),this.font=y(Tn.font),this.Ba=!1,this.font=r}ya(){return $n(this.be)&&this._a._().length>0}ma(){return!1===this.Ba&&this.ya()}Bh(t){return this._a.M(t),this}Ph(){return this._a._()}Vh(t){return nn(t)?this.Ia.M(t):this.Ia.M(t(this.Ia._())),this}Eh(){return this.Ia._()}La(t){return this.Ia.M(this.Ia._().setFamily(t)),this}Ra(){return this.Ia._().getFamily()}Ea(t){return this.Ia.M(this.Ia._().setSize(t)),this}Va(){return this.Ia._().getSize()}za(t){return this.Ia.M(this.Ia._().setWeight(t)),this}Oa(){return this.Ia._().getWeight()}Na(t){return this.Ia.M(this.Ia._().setStyle(t)),this}Ga(){return this.Ia._().getStyle()}Wa(t){return this.Ia.M(this.Ia._().setVariant(t)),this}Ua(){return this.Ia._().getVariant()}Ie(t){return this.wa.M(t),this}Ya(){return this.wa._()}zh(t){return this.Fa.M(t),this}Oh(){return this.Fa._()}Ha(t,e){return this.Ta.M(u(t,e)),this}$a(){return this.Ta._()}Xa(t){return this.ka.M(t),this}ja(){return this.ka._()}Za(t){return this.Ca.M(t),this}Qa(){return this.Ca._()}Ja(t){return this.ka.M(t.x),this.Ca.M(t.y),this}Ka(t){return this.Xt.M(t),this}qa(){return this.Xt._()}tl(t){return this.Da.M(t),this}il(){return this.Da._()}}class Qn extends Kn{constructor(t,i,s,n,r,o=5){super(t,i,s,n,r,y(o)),this.sl=[],this.el=y(e.PointShape.Square),this.Fa=y(0),this.hl=y(!1),this.rl=y(!1),this.nl=y(!1),this.ol=Le,this.al=0,this.ll=[],this.ul=0,this.cl=Le,this.dl=Fn.Nearest,this.fl=!1,this.Al=void 0}pl(t){return this.dl=t,this}ml(){return this.ll}yl(){return this.sl}Sl(t){return this.el.M(t),this}vl(){return this.el._()}zh(t){return this.Fa.M(t),this}Oh(){return this.Fa._()}xl(t){return this.hl.M(t),this}bl(t){return this.rl.M(t),this}Ml(t){return this.nl.M(t),this}_l(t,e){return Array.isArray(t)||(t=[t]),this.ul+=t.length,this.ll=se(this.ll,t,{canReturnB:!0}),this.cl&&(this.cl=e?qe(this.cl,e):void 0),this.Al=void 0,this}Nt(){return this.fl=!0,this.sl.length=0,this.al=0,this.ol=Le,this.ll=[],this.ul=0,this.Al=void 0,this}wl(){return this.al}Cl(){return this.ul}}class tr extends Jn{constructor(t,e,i,s,n){super(t,e,i,s,n),this.wa=y(u(0,0)),this.X=y(u(100,100)),this.Fa=y(0),this.Pa=y(u(0,0)),this.kl=!1}Ds(){return this.Tl(),this}Ie(t){const e=this.wa._();return t.x===e.x&&t.y===e.y||(this.wa.M(t),this.Tl()),this}Ya(){return this.wa._()}Fl(t){const e=this.wa._();return t!==e.x&&(this.wa.M(u(t,e.y)),this.Tl()),this}Il(t){const e=this.wa._();return t!==e.y&&(this.wa.M(u(e.x,t)),this.Tl()),this}q(t){const e=this.X._();return t.x===e.x&&t.y===e.y||(this.X.M(u(t.x,t.y)),this.Tl()),this}oi(){return this.X._()}Pl(t){const e=this.X._();return t!==e.x&&(this.X.M(u(t,e.y)),this.Tl()),this}Dl(t){const e=this.X._();return t!==e.x&&(this.X.M(u(e.x,t)),this.Tl()),this}zh(t){return this.Fa.M(t),this}Oh(){return this.Fa._()}Bl(t){const e=this.Pa._();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.kl=!1,this.Tl()):(this.kl=!0,this.Pa.M(t))),this}Tl(){if(!this.kl){const t=this.wa._(),e=this.X._(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.Pa._();i.x===s.x&&i.y===s.y||this.Pa.M(i)}}}class er extends Jn{constructor(){super(...arguments),this.sl=[],this.wa=y(u(0,0)),this.ol=Le,this.Ll=!1}Rl(t){return t=Zt(t),this.sl=t,this.Ll=!0,this}El(){return this.sl}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return 0}zl(){return 0}}class ir extends er{}class sr extends qn{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Ol=new Array,this.Nl=new Array,this.Gl=y({type:"disabled",packager:(t,e,i)=>t.slice()}),this.ol=Le,this.Wl=0,this.Ul=!1,this.ll=[Array(),Array()],this.Yl=!1,this.Hl=(new U).setColor(T(42,171,240)),this.fl=!1,this.$l=!1,this.Xl=!1}_l(t,e){const i=this.Wl-1,s=i>0&&!this.Yl;let[n,r]=s?[[this.Ol[i]],[this.Nl[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);n=se(n,e,{canReturnB:!0}),r=se(r,i,{canReturnB:!0})}else{const e=t.position;n.push(u(e,t.high)),r.push(u(e,t.low))}return this.Yl?(this.ll[0]=se(this.ll[0],n,{canReturnB:!0}),this.ll[1]=se(this.ll[1],r,{canReturnB:!0})):(this.ll=[n,r],this.Yl=!0),this.ol=qe(this.ol,e||qe(je(n),je(r))),this}Nt(){return this.fl=!0,this.Ol.length=0,this.Nl.length=0,this.Wl=0,this.ol=Le,this}yl(){return[this.Ol,this.Nl]}ml(){return[this.ll[0],this.ll[1]]}jl(t){return this.Gl.M(t),this}Zl(){return this.Gl._()}Ql(t){return this.Hl="function"==typeof t?t(this.Hl):t,this}Jl(){return this.Hl}wl(){return this.Wl-(Number(this.$l)+Number(this.Xl))}Cl(){return this.ll.length}Kl(t){return this.$l=t,this}ql(){return this.$l}tu(t){return this.Xl=t,this}iu(){return this.Xl}ma(){return this.pa===V&&this.su===V&&(this.be!==V||this.Hl!==V)}eu(t){this.su=t}ya(){return this.Hl!==V||super.ya()}ga(){return super.ga()||!this.su||this.su!==this.Hl}}class nr extends Jn{constructor(t,e,i,s,n){super(t,e,i,s,n),this.wa=y(u(0,0)),this.hu=y(0),this.Fi=y(360),this.ru=y(100),this.nu=y(100),this.ou=y(0),this.au=y(void 0),this.lu=u(0,0),this.uu=u(0,0),this.cu=u(0,0)}du(){return this.ru._()}fu(){return this.nu._()}Ya(){return this.wa._()}Au(){return this.hu._()}Ti(){return this.Fi._()}gu(){return this.ou._()}pu(){return this.au._()}mu(){return this.lu}yu(){return this.uu}Su(){return this.cu}Ie(t){return this.wa.M(t),this}vu(t){return this.hu.M(t),this}ze(t){return this.Fi.M(t),this}xu(t){return this.nu.M(t),this.ru.M(t),this}bu(t){return this.ru.M(t),this}Mu(t){return this.nu.M(t),this}_u(t){return this.ou.M(t<0?0:t),this}wu(t){return this.au.M(void 0!==t&&t<=0?void 0:t),this}}var rr;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(rr||(rr={}));class or extends Yn{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Cu=Tn.lineStyle,this.engine=t}Ee(t){return this.Cu=((t,e)=>"function"==typeof e?e(t):e)(this.Cu,t),this}ku(){return this.Cu}va(){return((t,e)=>!t||t!==e)(this.Tu,this.Cu)}Fu(t){return((t,e)=>!t||t.getThickness()!==e)(this.Tu,t)}ma(){return((t,e)=>t===nt&&e!==nt)(this.Tu,this.Cu)}ya(){return(t=>t!==nt&&t.getFillStyle()!==V)(this.Cu)}Iu(t){this.Tu=t}}class ar extends or{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Pi=u(0,0),this.Fi=u(0,0),this.Pu=!1}M({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.Pu=!0,this.Pi=t,this.Fi=e),this}Ii(){return this.Pi}Ti(){return this.Fi}Oe(t){return t.x===this.Pi.x&&t.y===this.Pi.y||(this.Pu=!0,this.Pi=t),this}ze(t){return t.x===this.Fi.x&&t.y===this.Fi.y||(this.Pu=!0,this.Fi=t),this}}class hr extends or{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Du=void 0,this.Bu=!1}}class lr extends or{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Lu=[],this.ol=Le,this.ll=new Array,this.al=0,this.dl=Fn.NearestX,this.fl=!1,this.Ru=y(void 0),this.$l=!1,this.Xl=!1}Eu(t){return this.Ru.M(t),this}Vu(){return this.Ru._()}ml(){return this.ll}yl(){return this.Lu}pl(t){return this.dl=t,this}Nt(){return this.fl=!0,this.Lu.length=0,this.al=0,this.ll=[],this.ol=Le,this}wl(){return this.al-(Number(this.$l)+Number(this.Xl))}Cl(){return this.ll.length}Kl(t){return this.$l=t,this}ql(){return this.$l}tu(t){return this.Xl=t,this}iu(){return this.Xl}}const ur=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 cr{constructor(){this.Xi=!0,this.D=new n.Eventer,this.zu=0,this.wt=(t,e,i)=>{0===this.zu&&this.D.emit("mouseEnter",this,e),this.zu+=1},this.Ct=(t,e,i)=>{this.zu-=1,this.zu<1&&(this.D.emit("mouseLeave",this,e),this.zu=0)},this.kt=(t,e,i)=>{this.D.emit("mouseClick",this,e)},this.Tt=(t,e,i)=>{this.D.emit("mouseDoubleClick",this,e)},this.Ft=(t,e,i)=>{this.D.emit("mouseDown",this,e)},this.It=(t,e,i)=>{this.D.emit("mouseUp",this,e)},this.Pt=(t,e,i)=>{this.D.emit("mouseMove",this,e)},this.Bt=(t,e,i,s)=>{this.D.emit("mouseDragStart",this,e,i)},this.Dt=(t,e,i,s,n,r)=>{this.D.emit("mouseDrag",this,e,i,s,n)},this.Lt=(t,e,i,s,n)=>{this.D.emit("mouseDragStop",this,e,i,s)},this.Rt=(t,e,i)=>{this.D.emit("mouseWheel",this,e)},this.Et=(t,e)=>{this.zu+=1,this.D.emit("touchStart",this,e)},this.Vt=(t,e)=>{this.D.emit("touchMove",this,e)},this.zt=(t,e)=>{this.zu-=1,this.D.emit("touchEnd",this,e)},this.Ou=t=>(t instanceof Yn?t.setMouseEnterEventHandler(this.wt).setMouseLeaveEventHandler(this.Ct).setMouseClickEventHandler(this.kt).setMouseDoubleClickEventHandler(this.Tt).setMouseDownEventHandler(this.Ft).setMouseUpEventHandler(this.It).setMouseMoveEventHandler(this.Pt).setMouseDragEventHandler(this.Dt).setMouseDragStartEventHandler(this.Bt).setMouseDragStopEventHandler(this.Lt).setMouseWheelEventHandler(this.Rt).setTouchStartEventHandler(this.Et).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.zt):(t.onMouseEnter(this.wt),t.onMouseLeave(this.Ct),t.onMouseClick(this.kt),t.onMouseDoubleClick(this.Tt),t.onMouseDown(this.Ft),t.onMouseUp(this.It),t.onMouseMove(this.Pt),t.onMouseDrag(this.Dt),t.onMouseDragStart(this.Bt),t.onMouseDragStop(this.Lt),t.onMouseWheel(this.Rt),t.onTouchStart(this.Et),t.onTouchMove(this.Vt),t.onTouchEnd(this.zt)),t)}onMouseEnter(t){return this.D.on("mouseEnter",t)}onMouseLeave(t){return this.D.on("mouseLeave",t)}onMouseClick(t){return this.D.on("mouseClick",t)}onMouseDoubleClick(t){return this.D.on("mouseDoubleClick",t)}onMouseDown(t){return this.D.on("mouseDown",t)}onMouseUp(t){return this.D.on("mouseUp",t)}onMouseMove(t){return this.D.on("mouseMove",t)}onMouseDragStart(t){return this.D.on("mouseDragStart",t)}onMouseDrag(t){return this.D.on("mouseDrag",t)}onMouseDragStop(t){return this.D.on("mouseDragStop",t)}onMouseWheel(t){return this.D.on("mouseWheel",t)}onTouchStart(t){return this.D.on("touchStart",t)}onTouchMove(t){return this.D.on("touchMove",t)}onTouchEnd(t){return this.D.on("touchEnd",t)}offMouseEnter(t){return this.D.off(t,"mouseEnter")}offMouseLeave(t){return this.D.off(t,"mouseLeave")}offMouseClick(t){return this.D.off(t,"mouseClick")}offMouseDoubleClick(t){return this.D.off(t,"mouseDoubleClick")}offMouseDown(t){return this.D.off(t,"mouseDown")}offMouseUp(t){return this.D.off(t,"mouseUp")}offMouseMove(t){return this.D.off(t,"mouseMove")}offMouseDragStart(t){return this.D.off(t,"mouseDragStart")}offMouseDrag(t){return this.D.off(t,"mouseDrag")}offMouseDragStop(t){return this.D.off(t,"mouseDragStop")}offMouseWheel(t){return this.D.off(t,"mouseWheel")}offTouchStart(t){return this.D.off(t,"touchStart")}offTouchMove(t){return this.D.off(t,"touchMove")}offTouchEnd(t){return this.D.off(t,"touchEnd")}getIsUnderMouse(){return this.zu>0}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&this.D.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}}const dr=(t,i,s)=>{const n=t.getDraggingMode();if(n!==e.UIDraggingModes.notDraggable){const r=t.scale.pi(t.getPosition(),{x:n!==e.UIDraggingModes.onlyVertical?i.x:0,y:n!==e.UIDraggingModes.onlyHorizontal?i.y:0}),o=t.scale,a=t.getSize(),h=t.getOrigin(),l=o.pi({x:o.x.getInnerStart(),y:o.y.getInnerStart()},oi({x:(1+h.x)/2,y:(1+h.y)/2},a)),u=o.pi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},oi({x:(h.x-1)/2,y:(h.y-1)/2},a)),c={x:Math.min(Math.max(r.x,l.x),u.x),y:Math.min(Math.max(r.y,l.y),u.y)};t.setPosition(c),jt(s)}},fr=(t,e,i,s,n)=>{dr(t,n,e)},gr=(t,e,i,s,n)=>{dr(t,s,n)};class mr extends cr{constructor(t,e,i,s,n){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.$i=!1,this.Nu=void 0,this.Gu=void 0,this.Wu=ur,this.Uu=void 0,this.jo=!0,this.Yu=()=>{const t="function"==typeof this.Wu?this.Wu(this):this.Wu;t&&(this.Gu=this.Ts.us.Er(t))},this.Hu=()=>{this.Ts.us.Vr(this.Gu)},this.Xt=A(0,0,0,0),this.Ts=t,this.renderingScale=e,this.scale=i,this.qo=s,this.qi=n,this.Ts.bs(),this.onMouseEnter(this.Yu),this.onMouseLeave(this.Hu),this.onMouseDrag(fr);const r=Yi(new Xi(wt,gr,wt));this.onTouchStart(r.onTouchStart),this.onTouchMove(r.onTouchMove),this.onTouchEnd(r.onTouchEnd),this.qi=n}setMouseInteractions(t){return this.$u().forEach((e=>e.setMouseInteractions(t))),this.jo=t,this}getMouseInteractions(){return this.jo}setEffect(t){return this.es=this.es||this.Ts.us.es.hs(this,{Xu:{shapes:this.$u()}}),this.es.Xu.xs(t),this}getEffect(){return!!this.es&&this.es.Xu.Ms()}setAutoDispose(t){return this.Uu=t,this.Ts.bs(),this}getAutoDispose(){return this.Uu}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.Ts.bs(),this}getMargin(){return this.Xt}Fe(){if(this.Uu){const t=this.size,e=this.renderingScale.oi(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.Uu.type&&i.x>=this.Uu.maxWidth||"max-height"===this.Uu.type&&i.y>=this.Uu.maxHeight)&&this.dispose()}return this}Ds(){return this}dispose(){return this.$i||(this.Ts.bs(),this.$i=!0,this.qo(this),this.D.emit("dispose",this),this.$u().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.$u().forEach((e=>e.setVisible(t))),this.Ts.bs(),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setPosition(t){return this.position=t,this.Ts.bs(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),n=this.scale.pi(this.position,oi({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.pi(n,oi({x:(t.x+1)/2,y:(t.y+1)/2},s));const r=this.scale.pi(n,{x:this.Xt.left,y:this.Xt.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.pi(r,oi({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Ts.bs(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Nu=t,this.Ts.bs(),this}getDraggingMode(){return void 0!==this.Nu?this.Nu:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Wu=t,this}getMouseStyle(){return this.Wu}}class pr extends mr{constructor(t,e,i,s,n,r){super(t,e,i,n,r),this.Da=A(),this.ju=0,this.Ts=t,this.Zu=s,this.backgroundElement=new this.Zu(this.Ts,this.renderingScale,this.scale,wt,r),this.Ou(this.backgroundElement)}$u(){return this.backgroundElement.$u()}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}Fe(){return super.Fe(),this.$i||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).Fe(),this}Ds(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.Qu(t).Ds(),super.Ds()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.Da="object"==typeof t?S(this.Da,t):{left:t,top:t,right:t,bottom:t},this.Ts.bs(),this}getPadding(){return this.Da}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.Da.left+this.Da.right,i.y+this.Da.bottom+this.Da.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Ju()+this.backgroundElement.Ku(),i.y+this.backgroundElement.qu()+this.backgroundElement.tc())),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),n=this.getMargin(),r=this.scale.pi(s,{x:n.left,y:n.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.pi(r,oi({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.pi(r,{x:this.backgroundElement.Ju(),y:this.backgroundElement.qu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.pi(o,oi({x:(t.x+1)/2,y:(t.y+1)/2},i))}const a=this.getPadding(),h=this.scale.pi(o,{x:a.left,y:a.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.pi(h,oi({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.ju}setHighlight(t){return this.ju=Ae(t),this.backgroundElement.setHighlight(t),this.D.emit("highlight",this,t),this}}const yr=t=>"setBackground"in t;class Ar extends cr{constructor(t,e,i,s,n,r,o,a,h,l,u){super(),this.S=0,this.ic=1,this.sc=!0,this.hc=new sn,this.rc=!0,this.$i=!1,this.axisScale=s,this.renderingScale=n,this.nc=o,this.oc=a,this.ac=h,this.qo=l,this.lc=e,this.uc=i,this.cc=this.Ou(this.lc.Ve(this.renderingScale)),this.qi=u,this.dc=this.Ou(this.ac.fc(this.uc,this.renderingScale,r,wt,this.qi,!1).setOrigin(Ht(this.oc)).setDirection(this.oc)),this.axis=t,this.setMouseInteractions(!1),"major"===this.dc.Ac?this.cc.Ee(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.dc.Ac?this.cc.Ee(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.dc.Ac&&this.cc.Ee(u.cursorGridStrokeStyleX)}setValue(t){return this.S=t,this.uc.bs(),this.D.emit("valueChange",this,this.S),this}getValue(){return this.S}setTextFormatter(t){return this.gc=t,this.uc.bs(),this}setTickLength(t){return this.dc.setPointerLength(t),this.lc.bs(),this}getTickLength(){return this.dc.getPointerLength()}setTickLabelPadding(t){return this.dc.setTickLabelPadding(t),this.lc.bs(),this}setTickLabelRotation(t){return this.dc.setTextRotation(t),this.lc.bs(),this}getTickLabelRotation(){return this.dc.getTextRotation()}getTickLabelPadding(){return this.dc.getTickLabelPadding()}setGridStrokeLength(t){return this.ic=t,this.lc.bs(),this}getGridStrokeLength(){return this.ic}setGridStrokeStyle(t){return this.cc.Ee(t),this.lc.bs(),this}getGridStrokeStyle(){return this.cc.ku()}dispose(){return this.$i||(this.$i=!0,this.cc.dispose(),this.dc.dispose(),this.qo(this),this.lc.us.bs(),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setMarkerVisible(t){return this.sc=t,this.uc.bs(),this}getMarkerVisible(){return this.sc}setMarker(t){return t(this.dc),this.uc.bs(),this}getMarker(){return this.dc}setMouseInteractions(t){return this.dc.setMouseInteractions(t),this.cc.setMouseInteractions(t),this}getMouseInteractions(){return this.cc.getMouseInteractions()}setAllocatesAxisSpace(t){return this.rc=t,this.uc.bs(),this}getAllocatesAxisSpace(){return this.rc}isInScale(){return Ge(this.S,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}}class xr extends Ar{constructor(t,e,i,s,n,r,o,a,h,l,u){super(t,e,i,s,n,r,o,a,u,h,l),this.mc=!1,this.qo=h,this.lc=e,this.uc=i}dispose(){return this.mc=!1,super.dispose()}update(){return this}plot(t,e,i,s){if(this.isInScale()&&this.getVisible()){this.mc=!1;const n=lt(this.S,this.axisScale,this.nc.getWidth(this.renderingScale));this.cc.setVisible(!0).Oe(this.nc.toPoint(n,t)).ze(this.nc.toPoint(n,t-(i+e*this.ic))),this.sc?(this.gc&&this.dc.setText(this.gc(this.S,this)),this.dc.setVisible(!0).setPosition(this.nc.toPoint(n,s))):this.dc.setVisible(!1)}else this.cc.setVisible(!1),this.dc.setVisible(!1);return this.dc.Ds().Fe(),this}yc(){const t=this.dc.Ds().getSize();return this.nc.getHeight(t)}}const Sr=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),br=(t,e)=>(ae(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),vr=(t,e,i)=>{i&&yr(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},Mr={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}},Tr={background:void 0,setBackground(t){return{...this,background:t}}},wr={fc(t,e,i,s,n,r){const o=this.applyStylers(new this.uiElement(t,e,i,s,n),n);return vr(o,n,r),o}},Er={fc(t,e,i,s,n,r){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,n),n);return vr(o,n,r),o}};class kr extends mr{constructor(){super(...arguments),this.Sc=!0}Fe(){return super.Fe(),this}setMouseInteractions(t){return this.Sc=t,this}getMouseInteractions(){return this.Sc}$u(){return[]}}class Cr extends kr{onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}Qu(t){return this.size=t,this}Ju(){return 0}Ku(){return 0}tc(){return 0}qu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return V}setStrokeStyle(){return this}getStrokeStyle(){return nt}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Dr extends mr{constructor(){super(...arguments),this.D=new n.Eventer,this.ju=0}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}getHighlight(){return this.ju}setHighlight(t){return this.ju=t,this.$u().forEach((e=>e.cs(t))),this.D.emit("highlight",this,t),this.Ts.bs(),this}}class Ir extends Dr{}class _r extends Ir{constructor(t,e,i,s,n,r){super(t,e,i,n,r),this.Ts=t,this.el=this.Ts.vc(this.renderingScale,rr.Simple).setVisible(!1).ke(V).Ce(nt),this.Ou(this.el)}xc(){const t=this.bc();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=ni(t,si(e.min,-1));return this.scale.pi(this.position,ni(s,oi(si(ni(this.origin,u(1,1)),-.5),i)))})).map((t=>ut(t,this.scale,this.renderingScale)));this.el.Rl(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.el&&this.el.setVisible(!1),this.setContentSize(u(0,0))}Fe(){return super.Fe(),this.$i||this.xc(),this}Ds(){return this.xc(),super.Ds()}setVisible(t){return super.setVisible(t),this.el.setVisible(t),this}}const Fr=(t,e,i)=>t*(1-i)+e*i,Lr=(t,e,i,s,n)=>{if(void 0===e.value||void 0===i.value||void 0===s.value||void 0===n.value)return;const r=(t.x-i.point.x)/(n.point.x-i.point.x),o=(n.point.y-i.point.y)*r+i.point.y,a=(t.x-e.point.x)/(s.point.x-e.point.x),h=(s.point.y-e.point.y)*a+e.point.y,l=(t.y-h)/(o-h),u=Fr(i.value,n.value,r),c=Fr(e.value,s.value,a);return Fr(c,u,l)},zr={warm:t=>e=>E(60/(t-1)*e,.8,.8),cold:t=>e=>E(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>E(360/t*e,.8,.8),reverseSpectrum:t=>e=>E(360/t*(t-e),.8,.8),flatUI:t=>e=>E(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return E(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return E(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return E(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return E(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return E(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>E(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return E(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return E(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),E(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return E(0,0,s);const n=e.getR()/255,r=e.getG()/255,o=e.getB()/255,a=Math.max(n,r,o),h=Math.min(n,r,o);let l=0;if(a!==h){const t=a-h;switch(a){case n:l=(r-o)/t+(rn=>r=>E(t+(e-t)/n*r,i,s),auroraBorealis:t=>e=>Pr([{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=>Pr([{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=>Pr([{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=>Pr([{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=>Pr([{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=>Pr([{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)},Pr=(t,e,i)=>{const s=Vr(e,i),[n,r]=Br(s,t),o=Rr(t[n]),a=Rr(t[r]),h=0!==o.value?(a.value-s)/o.value:0,l={value:h,h:Fr(o.h,a.h,h),s:Fr(o.s,a.s,h),v:Fr(o.v,a.v,h)};return E(l.h,l.s,l.v)},Rr=t=>{const e=(t=>{const e=t.r,i=t.g,s=t.b,n=Math.max(e,i,s),r=Math.min(e,i,s);let o=0;const a=n,h=n-r,l=0===n?0:h/n;if(n===r)o=0;else{switch(n){case e:o=(i-s)/h+(i{const i=e/t;return i<0?0:i>1?1:i},Br=(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),$r={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},qr=s.Record({type:"linestyle",lineType:"dashed",pattern:$r.DashedEqual,fillStyle:new U({color:T(255,255,255)}),thickness:1,patternScale:3});class Jr extends qr{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")}V(){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 Kr=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),Zr=s.Record({type:"icon",width:void 0,height:void 0,Mc:void 0,_c:wt,wc:wt});class Qr extends Zr{constructor(t,e,i,s){super({...s,Mc:t,_c:e,wc:i})}dispose(){return this.wc(this),this}setWidth(t){const e=this.set("width",t);return this._c(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this._c(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this._c(i),i}oi(){if(!this.Mc)return{x:0,y:0};const t=this.Mc.width,e=this.Mc.height,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 to=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),eo=s.Record({type:"glow",color:T(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class io extends eo{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 so extends Dr{constructor(t,e,i,s,n){super(t,e,i,s,n),this._a="label",this.el=this.Ts.kr(this.renderingScale).Bh(this._a).ke(V),this.Ou(this.el)}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}Fe(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=ut(t,this.scale,this.renderingScale);return this.el.Ie(i),this}Ds(){this.el.Ds();const t=0===this._a.length?u(0,0):this.el.Cc();return this.setContentSize(t),super.Ds()}setText(t){return this._a=t,this.el.Bh(this._a),this.Ts.bs(),this}getText(){return this._a}setFont(t){return this.el.Vh(t),this.Ts.bs(),this}getFont(){return this.el.Eh()}setTextRotation(t){return this.el.zh(t),this.Ts.bs(),this}getTextRotation(){return this.el.Oh()}}const no={...Mr,...wr,uiElement:so};class ro extends Ir{constructor(t,e,i,s,n){super(t,e,i,s,n),this.kc=!1,this.fitTo=this.Qu.bind(this),this.setSize=this.fitTo,this.el=this.Ts.vc(e).ke(V).Ce(nt),this.Ou(this.el)}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}Fe(){const t=je([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>ut(t,this.scale,this.renderingScale))));return this.kc?this.el.Rl([{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.el.Rl([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Qu(t){return this.setContentSize(t),this.Ts.bs(),this}Ju(){return 0}Ku(){return 0}tc(){return 0}qu(){return 0}}class oo extends Ir{constructor(t,e,i,s,n){super(t,e,i,s,n),this.Tc=u(0,0),this.el=t.Fc(e).vu(0).ze(360).ke(V).Ce(nt),this.Ou(this.el)}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}Fe(){const t=this.getSize(e.UISpace.Content).x/2;return this.el.bu(t*this.renderingScale.Wi().x).Mu(t*this.renderingScale.Wi().y).Ie(ut(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).wu(255).Ds(),this}Qu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.Tc=t,this.Ts.bs(),this}Ju(){return(this.getSize(e.UISpace.Content).x-this.Tc.x)/2}Ku(){return(this.getSize(e.UISpace.Content).x-this.Tc.x)/2}tc(){return(this.getSize(e.UISpace.Content).y-this.Tc.y)/2}qu(){return(this.getSize(e.UISpace.Content).y-this.Tc.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.Tc=t,this}}class ao extends _r{constructor(t,e,i,s,n){super(t,e,i,rr.Simple,s,n),this.Ic=y(u(0,0)),this.Pc=!1,this.Ts=t,this.xc()}bc(){const t=this.Ic._();if(this.Pc){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.Ic._().x*this.Ic._().x/4+this.Ic._().y*this.Ic._().y/4),i=u(Math.cos(Math.PI/4)*e,0),s=u(0,Math.sin(Math.PI/4)*e),n=u(0,0),r=ni(n,ni(i,s)),o=ni(r,ni(s,si(i,-1)));return[n,r,o,ri(o,ni(i,s))]}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}Qu(t){return this.Ic.M(t),this.Pc=!1,this.Ts.bs(),this}Ju(){return this.Pc?0:(this.getSize(e.UISpace.Content).x-this.Ic._().x)/2}Ku(){return this.Pc?0:(this.getSize(e.UISpace.Content).x-this.Ic._().x)/2}tc(){return this.Pc?0:(this.getSize(e.UISpace.Content).y-this.Ic._().y)/2}qu(){return this.Pc?0:(this.getSize(e.UISpace.Content).y-this.Ic._().y)/2}fitTo(t){return this.Ic.M(t),this.Pc=!0,this.Ts.bs(),this}}class ho extends _r{constructor(t,i,s,n,r){super(t,i,s,rr.Simple,n,r),this.Dc=y(u(0,0)),this.Bc=y(10),this.Lc=y(void 0),this.oc=y(e.UIDirections.Right),this.xc()}$u(){return[this.el]}setFillStyle(t){return this.el.ke(t),this.Ts.bs(),this}getFillStyle(){return this.el.Lh()}setStrokeStyle(t){return this.el.Ce(t),this.Ts.bs(),this}getStrokeStyle(){return this.el._o()}setDirection(t){return this.oc.M(t),this.Ts.bs(),this}getDirection(){return this.oc._()}setPointerLength(t){return this.Bc.M(t),this.Ts.bs(),this}getPointerLength(){return this.Bc._()}setPointerAngle(t){return this.Lc.M(t),this.Ts.bs(),this}getPointerAngle(){let t=this.Lc._();if(void 0===t){const e=this.Rc();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)}Qu(t){return this.Dc.M(t),this.Ts.bs(),this}Ec(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}Vc(){return Xt(this.oc._())?this.Dc._().x:this.Dc._().y}Rc(){return Xt(this.oc._())?this.Dc._().y:this.Dc._().x}Ju(){switch(this.oc._()){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.Ec()-this.Rc());default:return 0}}Ku(){switch(this.oc._()){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.Ec()-this.Rc());default:return 0}}tc(){switch(this.oc._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Ec()-this.Rc());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}qu(){switch(this.oc._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Ec()-this.Rc());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}bc(){const t=Ht(this.oc._()),e=ei(u(0,0),t),i=this.getPointerLength(),s=this.Ec(),n=this.Vc(),r=this.Rc();if(!(0!==i&&0!==s||0!==n&&0!==r))return[];const o=u(0,0),a=ni(ni(o,si(t,-i)),si(e,s/2)),h=ni(a,si(e,(r-s)/2)),l=ni(h,si(t,-n)),c=ni(ni(o,si(t,-i)),si(e,-s/2)),d=ni(c,si(e,-(r-s)/2)),f=ni(d,si(t,-n));let g;return g=0===n||0===r?[o,a,c]:0===i||0===s?[h,l,f,d]:Et(r,s)?[o,a,l,f,c]:[o,a,h,l,f,d,c],g}}class lo extends Dr{constructor(t,i,s,n,r){super(t,i,s,n,r),this.fitTo=this.Qu.bind(this),this.setSize=this.fitTo,this.zc=this.Ts.Oc(i).Sl(e.PointShape.Plus).ke(V),this.Ou(this.zc)}$u(){return[this.zc]}setShape(t){return this.zc.Sl(t),this}getShape(){return this.zc.vl()}setRotation(t){return this.zc.zh(t),this}getRotation(){return this.zc.Oh()}setFillStyle(t){return this.zc.ke(t),this.Ts.bs(),this}getFillStyle(){return this.zc.Lh()}Fe(){const t=ut(this.getPosition({x:0,y:0},e.UISpace.Content),this.scale,this.renderingScale),i=Math.max(this.size.x,this.size.y);return this.zc.Nt(),i>0&&this.zc.q(i)._l(t),this}Qu(t){return this.setContentSize(t),this.Ts.bs(),this}Ju(){return 0}Ku(){return 0}tc(){return 0}qu(){return 0}}class uo extends kr{setSize(t){return this.setContentSize(t),this.Ts.bs(),this}}class co extends pr{constructor(){super(...arguments),this.Nc=[],this.Gc=0,this.Wc=t=>{const e=this.Nc.indexOf(t);e>=0&&this.Nc.splice(e,1)}}getMembers(){return this.Nc}getMemberCount(){return this.Nc.length}setMinimumSize(t){return this.Uc=t,this.Ts.bs(),this}getMinimumSize(){return this.Uc}addElement(t,e=-1){const i=t.fc(this.Ts,this.renderingScale,this.scale,this.Wc,this.qi,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.Nc.splice(e,0,i):this.Nc.push(i),i.setVisible(this.getVisible()),this.Ou(i),this.$i&&(fe(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.Nc.slice().forEach(Tt),this}setVisible(t){return super.setVisible(t),this.Nc.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof uo)),0),s=i>0?(this.size.x-this.Gc)/i:0;return this.Nc.reduce(((e,i)=>i instanceof uo?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)).Fe().getPosition(u(1,0)).x),t.x),this}Ds(){for(let t=0;tt+ +(e instanceof uo)),0),s=i>0?(this.size.y-this.Gc)/i:0;return this.Nc.reduce(((e,i)=>i instanceof uo?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)).Fe().getPosition(u(0,-1)).y),t.y),this}Ds(){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},vo=bo("Text",[]),Mo={button:void 0,isLocked:!1,setOn(t){if(!this.isLocked){const e=this.button.getOn()!==t;this.button.setOn(t),e&&this.D.emit("switch",t)}return this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.D.on("switch",(e=>t(this,e)))},offSwitch(t){return this.D.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()}},To={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},wo={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()}},Eo={...Mr,...Tr,background:ro,fc(t,e,i,s,n,r){const o=new fo(t,e,i,this.background,s,n),a=o.addElement(no,void 0),h=Object.assign(o,So,{setTextLabel:a},vo,{stylableTexts:[a]});return vr(h,n,r),this.applyStylers(h,n)}}.addStyler(Sr),ko={...Mr,...Tr,background:ho,fc(t,i,s,n,r,o){const a=new fo(t,i,s,this.background,n,r),h=a.addElement(no,void 0),l=a.getBackground(),u=Object.assign(a,So,{setTextLabel:h},vo,{stylableTexts:[h]},wo,{pointable:l},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?this.setPadding({top:t}):this.getDirection()===e.UIDirections.Down?this.setPadding({bottom:t}):this.getDirection()===e.UIDirections.Right?this.setPadding({right:t}):this.getDirection()===e.UIDirections.Left&&this.setPadding({left:t}),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 u.Ac="other",u.setPointerLength(r.xAxisNumericTicks.majorTickStyle.getTickLength()).setTickLabelPadding(r.xAxisNumericTicks.majorTickStyle.getTickPadding()).setTextFont(r.uiTextFont).setTextFillStyle(r.uiTextFillStyle).setBackground((t=>t.setFillStyle(r.uiBackgroundFillStyle).setStrokeStyle(r.uiBackgroundStrokeStyle))),vr(u,r,o),this.applyStylers(u,r)}};class Co extends mr{constructor(t,e,i,s,r,o){super(t,e,i,r,o),this.Bs=!1,this.D=new n.Eventer,this.Hc=V,this.$c=V,this.getOn=()=>this.Bs,this.Xc=this.Ou(new lo(this.Ts,this.renderingScale,this.scale,wt,o).setShape(s)),this.$c=o.uiButtonFillStyleHidden||o.uiButtonFillStyle}$u(){return[...this.Xc.$u()]}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}setOn(t){return t===this.Bs||(this.Bs=t,this.Xc.setFillStyle(t?this.Hc:this.$c),this.Ts.bs()),this}setOffFillStyle(t){return this.$c="function"==typeof t?t(this.$c):t,this.Bs||this.Xc.setFillStyle(this.$c),this}getOffFillStyle(){return this.$c}setSize(t){return this.Xc.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.Xc.getSize()}setOnFillStyle(t){return this.Hc="function"==typeof t?t(this.Hc):t,this.Bs&&this.Xc.setFillStyle(this.Hc),this}getOnFillStyle(){return this.Hc}setButtonShape(t){return this.Xc.setShape(t),this.Ts.bs(),this}getButtonShape(){return this.Xc.getShape()}Fe(){return super.Fe(),this.Xc.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).Fe(),this}Ds(){const t=this.Xc.Ds().getSize();return this.setContentSize(t),super.Ds()}dispose(){return super.dispose(),this.Xc.dispose(),this}setMouseInteractions(t){return this.Xc.setMouseInteractions(t),this}getMouseInteractions(){return this.Xc.getMouseInteractions()}setHighlight(t){const e=Ae(t);return this.Xc.setHighlight(e),this.D.emit("highlight",this,t),this.Ts.bs(),this}getHighlight(){return this.Xc.getHighlight()}}const Do={...Mr,uiElement:Co,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},fc(t,e,i,s,n,r){const o=this.applyStylers(new this.uiElement(t,e,i,this.buttonShape,s,n),n);return vr(o,n,r),o}},Io={...Mr,...Tr,background:ro,buttonBuilder:Do,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},fc(t,i,s,n,r,o){const a=new fo(t,i,s,this.background,n,r),h=a.addElement(Ao);h.addGap();const l=h.addElement(this.buttonBuilder);h.addGap();const u=a.addElement(Ao);u.addGap();const c=u.addElement(no);u.addGap(),a.addGap();const d=Object.assign(a,So,{setTextLabel:c},vo,{stylableTexts:[c]},Mo,{button:l},To);let f;return d.onMouseClick(((t,e)=>{d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setTextFillStyleHidden(r.uiTextFillStyleHidden||r.uiTextFillStyle),d.onSwitch(((t,e)=>{e?f&&d.setTextFillStyle(f):(f=d.getTextFillStyle(),d.setTextFillStyle(d.getTextFillStyleHidden()))})),d.setPadding({left:6}),vr(d,r,o),this.applyStylers(d,r)}}.addStyler(Sr).addStyler(br);class _o extends mr{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.jc=[],this.Zc=2,this.Qc="",this.Jc=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:ki(t.value,e.min,e.max),this.Kc=0,this.qc=0,this.td=!1,this.Ts=t,this.sd=r,this.ed=this.Ou(t.Te(e).Ce(nt)),this.hd=this.Ou(t.kr(e).ke(n.uiTextFillStyle).Vh(n.uiTextFont).setMouseInteractions(!1)),"vertical"===r?(this.rd=140,this.nd=25):(this.rd=160,this.nd=15)}$u(){return[this.ed,this.hd]}od(t){this.ad=t;const e=zo(t,"vertical"===this.sd?0:90,this.td);return this.ed.ke(e),this.Ts.bs(),this}ld(){return this.ad}ud(t){return this.rd=t,this.Ts.bs(),this}dd(){return this.rd}fd(t){return this.nd=t,this.Ts.bs(),this}Ad(){return this.nd}gd(t){return this.Qc=t,this.Ts.bs(),this}pd(){return this.Qc}md(t){return this.Jc=t,this.Ts.bs(),this}setLUTDisplayProportionalSteps(t){if(this.td=t,this.ad){const t=zo(this.ad,"vertical"===this.sd?0:90,this.td);this.ed.ke(t)}return this.Ts.bs(),this}getLUTDisplayProportionalSteps(){return this.td}setFillStyle(t){return this.hd.ke(t),this.Ts.bs(),this}getFillStyle(){return this.hd.Lh()}setFont(t){return this.hd.Vh(t),this.Ts.bs(),this}getFont(){return this.hd.Eh()}setTextRotation(t){return this.qc=t,this.hd.zh(t),this.Ts.bs(),this}getTextRotation(){return this.hd.Oh()}Fe(){var t,i,s,n;if(super.Fe(),this.$i||!this.getVisible())return this;const r=this.ad;if(r){const o=this.renderingScale.Wi(),a=r.min,h=r.max;if("vertical"===this.sd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),n=ni(s,{x:this.ed.oi().x+this.Zc*o.x,y:0}),l={x:n.x,y:n.y+(this.Qc.length>0?this.Kc*o.y+this.hd.oi().y:0)+.5*((null===(t=this.jc[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.jc[this.jc.length-1])||void 0===i?void 0:i.oi().y)||0)};this.ed.Ie({x:s.x,y:l.y}),this.hd.Ja({x:-1,y:-1}).Ie(n),r.getSteps().forEach(((t,e)=>{const i=He(l,u,this.td?!0===r.getInterpolation()?(t.value-a)/(h-a):.9*(t.value-a)/(h-a):!0===r.getInterpolation()?e/(r.getSteps().length-1):e/r.getSteps().length);this.jc[e].Ja({x:-1,y:0}).Ie(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.jc.reduce(((t,e)=>Math.max(t,e.oi().y)),0),u=ni(t,{x:.5*((null===(s=this.jc[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===(n=this.jc[this.jc.length-1])||void 0===n?void 0:n.oi().x)||0)+(this.Qc.length>0?this.Kc*o.x+this.hd.oi().x:0)),y:u.y},f={x:u.x,y:u.y+this.Zc*o.y};this.ed.Ie(f),this.hd.Ja({x:1,y:1}).Ie(c),r.getSteps().forEach(((t,e)=>{const i=He(u,d,this.td?!0===r.getInterpolation()?(t.value-a)/(h-a):.9*(t.value-a)/(h-a):!0===r.getInterpolation()?e/(r.getSteps().length-1):e/r.getSteps().length);this.jc[e].Ja({x:0,y:1}).Ie(i)}))}}return this}Ds(){if(this.ad&&this.getVisible()){const t=this.ad.getSteps();for(let e=this.jc.length;eMath.max(t,e.Ds().Cc().x)),0),this.hd.Ds().Cc().x),s=(this.Qc.length>0?this.Kc+this.hd.Ds().Cc().y:0)+e+.5*this.jc[0].Ds().Cc().y+.5*this.jc[this.jc.length-1].Ds().Cc().y;this.setContentSize({x:i,y:s})}else{const t=this.rd,e=this.nd;this.ed.q({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Qc.length>0?this.Kc+this.hd.Ds().Cc().x:0,.5*this.jc[this.jc.length-1].Ds().Cc().x),s=t+.5*this.jc[0].Ds().Cc().x+i,n=e+this.Zc+this.jc.reduce(((t,e)=>Math.max(t,e.Ds().Cc().y)),0);this.setContentSize({x:s,y:n})}}else this.jc.forEach((t=>t.dispose())),this.jc.length=0,this.hd.setVisible(!1),this.ed.setVisible(!1),this.setContentSize({x:0,y:0});return super.Ds()}dispose(){return super.dispose(),this.ed.dispose(),this.jc.forEach(Tt),this.hd.dispose(),this}setMouseInteractions(t){return this.ed.setMouseInteractions(t),this}getMouseInteractions(){return this.ed.getMouseInteractions()}}const Fo={lutElement:{},setLUT(t){return this.lutElement.od(t),this},getLUT(){return this.lutElement.ld()},setLUTLength(t){return this.lutElement.ud(t),this},getLUTLength(){return this.lutElement.dd()},setLUTThickness(t){return this.lutElement.fd(t),this},getLUTThickness(){return this.lutElement.Ad()},setLookUpUnit(t){return this.lutElement.gd(t),this},getLookUpUnit(){return this.lutElement.pd()},setLUTStepValueFormatter(t){return this.lutElement.md(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},Lo={...Mr,...Tr,background:ro,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},fc(t,e,i,s,n,r){const o=new go(t,e,i,this.background,s,n),a=o.addElement({fc:()=>new _o(t,e,i,wt,n,this.alignment)}),h=Object.assign(o,vo,{stylableTexts:[a]},Fo,{lutElement:a});return vr(h,n,r),this.applyStylers(h,n)}}.addStyler(Sr),zo=(t,e,i)=>{const s=t.getSteps(),n=t.min,r=t.max-n;if(!0===t.getInterpolation())return new et({angle:e,stops:s.map(((e,o)=>({offset:i?(e.value-n)/r:o/(s.length-1),color:e.color||t.color})))});const o=[];for(let e=0;enew _o(t,i,s,wt,r,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:r.uiButtonSize+6});const f=Object.assign(o,So,{setTextLabel:c},vo,{stylableTexts:[c,d]},bo("LUTText",[d]),Mo,{button:l},Fo,{lutElement:d},To);let g;return f.onMouseClick((()=>{f.setOn(!f.getOn())})),f.onMouseEnter((()=>f.setHighlight(!0))),f.onMouseLeave((()=>f.setHighlight(!1))),f.setMouseStyle(e.MouseStyles.Point),f.setTextFillStyleHidden(r.uiTextFillStyleHidden||r.uiTextFillStyle),f.onSwitch(((t,e)=>{e?g&&f.setTextFillStyle(g):(g=f.getTextFillStyle(),f.setTextFillStyle(f.getTextFillStyleHidden()))})),f.setPadding({left:6}),this.applyStylers(f,r)}}.addStyler(Sr).addStyler(br),Ro={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,n=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return this.legendBoxDisposed()||(t instanceof Ga?this.addChart(t,i,n,s):"attach"in t?this.addAttachable(t,i,n,s):t&&this.addDashboard(t,i,n,s)),this},addAttachable(t,e,i,s){const n=t.ld&&t.ld(),r=t.yd&&t.yd(),o=void 0!==s&&s;let a=i;if(!a){let t=n?Po.setAlignment(this.alignment):Io;void 0!==r&&(t=t.setButtonShape(r)),a=t}const h=this.addElement(a);if(n&&"setLUT"in h){h.setLUT(n.lut);const t=n.lut.getUnits(),e=n.lookUpProperty,i=t.length>0?t:"x"===e?"x":"y"===e?"y":"z"===e?"z":"";h.setLookUpUnit(i)}return this.entryStylers.forEach((t=>t(h))),this.entries.push({entry:h,component:t}),t.attach(h,e,o),this},addChart(t,e,i,s){return t.Sd().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof Ga)).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}},Vo={alignment:"vertical",layoutBuilder:Ao,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?xo:Ao}},getAlignment(){return this.alignment},titleBuilder:Eo,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},Bo={...Mr,...Tr,...Vo,background:ro,fc(t,e,i,s,n,r){const o=this.layoutBuilder.setBackground(this.background).fc(t,e,i,s,n,!1);let a=Object.assign(o,Ro,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.$i});a.entries=[];const h=a.addElement("horizontal"===this.alignment?Ao:xo),l=h.addElement(this.titleBuilder).setText("Legend").setTextFillStyle(n.legendTitleFillStyle).setTextFont(n.legendTitleFont);return h.addGap(),a=Object.assign(a,{title:l}),"horizontal"===this.alignment&&l.setMargin({right:6}),vr(a,n,r),this.applyStylers(a,n)}}.addStyler(((t,e)=>t.setPadding(5)));class Oo extends mr{constructor(t,i,s,n,r){super(t,i,s,n,r),this.vd=10,this.xd=e.UIDirections.Up,this.bd=0,this.Ac="major",this._a=this.Ou(t.kr(this.renderingScale)),this.Re=this.Ou(t.Ve(this.renderingScale))}$u(){return[this._a]}Fe(){if(super.Fe(),this.$i)return this;const t=ut(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.pi(t,{x:this.xd===e.UIDirections.Right?-this.vd:this.xd===e.UIDirections.Left?this.vd:0,y:this.xd===e.UIDirections.Up?-this.vd:this.xd===e.UIDirections.Down?this.vd:0}),s=this.renderingScale.pi(i,{x:this.xd===e.UIDirections.Right?-this.bd:this.xd===e.UIDirections.Left?this.bd:0,y:this.xd===e.UIDirections.Up?-this.bd:this.xd===e.UIDirections.Down?this.bd:0});return this.Re.Oe(t).ze(i),this._a.Ie(s).Ja(this.xd===e.UIDirections.Up?{x:0,y:1}:this.xd===e.UIDirections.Down?{x:0,y:-1}:this.xd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Ds(){const t=this.Re.ku().getThickness();return this.size=this.xd===e.UIDirections.Left||this.xd===e.UIDirections.Right?{x:this.vd+this.bd+this._a.Ds().Cc().x,y:t}:{y:this.vd+this.bd+this._a.Ds().Cc().y,x:t},super.Ds()}dispose(){return super.dispose(),this._a.dispose(),this.Re.dispose(),this}setVisible(t){return super.setVisible(t),this._a.setVisible(t),this.Re.setVisible(t),this}setMouseInteractions(t){return this._a.setMouseInteractions(t),this.Re.setMouseInteractions(t),this}getMouseInteractions(){return this._a.getMouseInteractions()}getText(){return this._a.Ph()}setTextFillStyle(t){return this._a.ke(t),this.Ts.bs(),this}getTextFillStyle(){return this._a.Lh()}setTextFont(t){return this._a.Vh(t),this}setTextRotation(t){return this._a.zh(t),this}getTextRotation(){return this._a.Oh()}getTextFont(){return this._a.Eh()}setText(t){return this._a.Bh(t),this.Ts.bs(),this}setDirection(t){return this.xd=t,this.Ts.bs(),this}getDirection(){return this.xd}setPointerLength(t){return this.vd=t,this.Ts.bs(),this}getPointerLength(){return this.vd}setTickLabelPadding(t){return this.bd=t,this.Ts.bs(),this}getTickLabelPadding(){return this.bd}setTickStyle(t){return this.Re.Ee(t),this.Ts.bs(),this}getTickStyle(){return this.Re.ku()}}const No={...Mr,fc(t,e,i,s,n,r){const o=new Oo(t,e,i,s,n);return vr(o,n,r),this.applyStylers(o,n)}}.addStyler(Sr),Uo=No.addStyler(((t,e)=>(t.Ac="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)))),Go=No.addStyler(((t,e)=>(t.Ac="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)))),Wo=Io.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),Yo=Bo.setAlignment("horizontal"),Ho=Bo.setAlignment("vertical"),Xo={TextBox:Eo,CheckBox:Io,ButtonBox:Wo,PointableTextBox:ko,AxisTickMajor:Uo,AxisTickMinor:Go,LUTRange:Lo},jo={HorizontalLegendBox:Yo,VerticalLegendBox:Ho},$o=(t,e)=>{if(Vi(t)){const i=e.$o(t);return{x:i.engineX,y:i.engineY}}return t},qo=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}},Jo=(t,e,i,s=1)=>kt(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),Ko=(t,e,i,s=1)=>{const n=i.ct(t),r=i.ct(e);return kt(i.ut(n+.1*s*(r-n)+.5*s*Math.sign(r-n)),t,e)};class Zo extends Js{constructor(t,e,i,s,n,r,o){super(t,e,i,s,o),this.Md=n,this._d=r}}class Qo extends qs{constructor(t,i,s,r,o,a,h,l,c,d,f,g,m,p,y,A,x){var S;super(f,d,l,y,A,{numeric:d.getWidth({x:y.xAxisNumericTicks,y:y.yAxisNumericTicks}),datetime:d.getWidth({x:y.xAxisDateTimeTicks,y:y.yAxisDateTimeTicks}),time:d.getWidth({x:y.xAxisTimeTicks,y:y.yAxisTimeTicks})},x),this.wd=new Map,this.Cd=void 0,this.kd=0,this.Td=[],this.Fd=[],this.Je=Rs.fitting,this.Id=!0,this.Pd=0,this.Dd=8,this.Bd=void 0,this.Ld=void 0,this.Rd=20,this.Ed=1,this.Vd=!0,this.zd=!0,this.Od=!0,this.Nd=!0,this.Gd=!0,this.Wd=!0,this.Ud=!0,this.Yd=!0,this.Hd=!0,this.$d=!0,this.Xd=this.Mh.defaultDragMouseStyle,this.jd=this.Mh.defaultDragMouseStyle,this.Zd=this.Mh.defaultDragMouseStyle,this.Qd=this.Mh.defaultDragMouseStyle,this.Jd=this.Mh.defaultDragMouseStyle,this.D=new n.Eventer,this.Kd=[],this.qd=t=>{const e=this.Fd.indexOf(t);e>=0&&this.Fd.splice(e,1)},this.tf=t=>(this.Fd.indexOf(t)<0&&this.Fd.push(t),this.qd),this.Et=(t,e)=>this.D.emit("axisAreaTouch",this,e),this.if=Kt(this.Kd),this.onAxisInteractionAreaMouseClick=t=>this.D.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.D.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.D.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.D.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.D.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.D.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.D.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.D.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.D.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.D.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.D.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.D.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.D.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.D.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.D.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.D.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.D.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.D.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.D.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.D.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.D.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.D.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.D.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.D.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.D.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.D.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.D.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.D.off(t,"axisAreaTouchEnd"),this.sf=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().yc()):t,this.ef=t=>{const e=this.Td.indexOf(t);-1!==e&&this.Td.splice(e,1)},this.hf=(t,e)=>{this.D.emit("axisAreaDoubleClick",this,e),this.Nd&&(this.setStopped(!1),jt(e))},this.rf=t=>{this.D.emit("axisAreaMouseEnter",this),(this.zd||this.Vd||this.Od||this.Nd)&&this.nf(t)},this.af=t=>{this.lf(t),this.D.emit("axisAreaMouseLeave",this)},this.uf=(t,e,i)=>{var s,n;this.D.emit("axisAreaMouseDragStart",this,e,i);const r=Dt(null===(s=this.chart.fs.no)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Dt(null===(n=this.chart.fs.no)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===o&&this.zd?(this.cf(t),jt(e)):i===r&&this.Vd&&(this.df(t,a),jt(e))},this.ff=(t,e,i,s,n)=>{var r,o;this.D.emit("axisAreaMouseDrag",this,e,i,s,n);const a=Dt(null===(r=this.chart.fs.no)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Dt(null===(o=this.chart.fs.no)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===h&&this.zd?(this.Af(t,n),jt(e)):i===a&&this.Vd&&(this.gf(t,s,l,n),jt(e))},this.pf=(t,e,i,s)=>{var n,r;this.D.emit("axisAreaMouseDragStop",this,e,i,s);const o=Dt(null===(n=this.chart.fs.no)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Dt(null===(r=this.chart.fs.no)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===a&&this.zd?(this.mf(t),jt(e)):i===o&&this.Vd&&(this.yf(t,s,h),jt(e)),t.getIsUnderMouse()&&(this.zd||this.Vd||this.Od||this.Nd)&&this.nf(t)},this.Sf=(t,e)=>{if(this.D.emit("axisAreaMouseWheel",this,e),this.Od){this.setStopped(!0);const t=this.Mh.getWidth(this.vf.us.De(e.clientX,e.clientY)),i=this.dt.ut(t);this.zoom(i,de(e)),jt(e)}},this.xf=(t,e)=>this.D.emit("axisAreaMouseClick",this,e),this.bf=(t,e)=>this.D.emit("axisAreaMouseDown",this,e),this.Mf=(t,e)=>this.D.emit("axisAreaMouseUp",this,e),this._f=(t,e)=>this.D.emit("axisAreaMouseMove",this,e),this.wf=(t,e,i)=>{this.D.emit("axisAreaTouchStart",this,i),this.Vd&&(this.nf(t),this.df(t,e),jt(i))},this.Cf=(t,e,i,s,n)=>{this.D.emit("axisAreaTouch",this,n),this.Vd&&(this.gf(t,e,i,s),jt(n))},this.kf=(t,e,i,s)=>{this.D.emit("axisAreaTouchEnd",this,s),this.Vd&&(this.yf(t,e,i),this.lf(t),jt(s))},this.Tf=(t,e,i,s)=>{(this.zd||this.Od)&&(this.nf(t),this.cf(t),jt(s))},this.Ff=(t,e,i,s,n,r)=>{if(this.zd){const e=u((s.x+n.x)/2,(s.y+n.y)/2);this.Af(t,e),jt(r)}if(this.Od){const t=this.vf.us.De(e.x,e.y),o=this.vf.us.De(i.x,i.y),a=Math.abs(this.Mh.getWidth(ri(t,s))-this.Mh.getWidth(ri(o,n)))-Math.abs(this.Mh.getWidth(t)-this.Mh.getWidth(o)),h=this.dt.pi(this.Th,-a),l=this.dt.pi(this.Fh,a);this.jh(h,l,!0),jt(r)}},this.If=(t,e,i,s)=>{(this.zd||this.Od)&&(this.mf(t),this.lf(t),jt(s))},this.Pf=(t,e)=>{(this.Gd||this.Wd)&&this.Df(t)},this.Bf=(t,e)=>{this.Lf(t)},this.Rf=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Gd&&this.Ef(t,s)},this.Vf=(t,e,i,s,n)=>{const r=u(e.clientX,e.clientY);this.Gd&&this.zf(t,r,s,n)},this.Of=(t,e,i,s,n)=>{const r=u(e.clientX,e.clientY);this.Gd&&this.Nf(t,r,s,n)},this.Gf=(t,e,i,s)=>{const n=u(e.clientX,e.clientY);(this.Gd||this.Wd)&&this.Wf(t,n,s),(this.Gd||this.Wd)&&this.Df(t)},this.Uf=(t,e)=>{this.Wd&&(this.setStopped(!0),this.zoom(this.Th,de(e)),jt(e))},this.Yf=(t,e)=>{this.Wd&&(this.setStopped(!0),this.zoom(this.Fh,de(e)),jt(e))},this.Hf=(t,e,i)=>{this.Gd&&(this.Df(t),this.Ef(t,e),jt(i))},this.$f=(t,e,i,s,n)=>{this.Gd&&(this.zf(t,e,i,s),jt(n))},this.Xf=(t,e,i,s,n)=>{this.Gd&&(this.Nf(t,e,i,s),jt(n))},this.jf=(t,e,i,s)=>{this.Gd&&(this.Wf(t,e,i),this.Lf(t),jt(s))},this.Md=t,this.Zf=i,this.vf=s,this.Qf=o,this.Jf=a,this.chart=f,this.Kf=m,this.qf=r,this.ss=h,"logarithmic"!==x.type||this.chart.fs.Vn||this.chart.fs.zn||this.chart.fs.eo||this.chart.us.As(St.atob("bG9nIGF4aXM=")),p(this,this.tf),l.tA=this,this.iA=g,this.sA=this.iA>50?1:-1,this.eA=(S=this.Mh.toPoint(0,-this.sA),Math.abs(S.x)>=Math.abs(S.y)?S.x>=0?e.UIDirections.Right:e.UIDirections.Left:S.y>=0?e.UIDirections.Up:e.UIDirections.Down),this.hA=c,this.rA=this.dt instanceof Ii?(new Li).Ri(this.Mh.toVec2(this.dt,this.hA)):(new zi).Ri(this.Mh.toVec2(this.dt,this.hA)),this.nA=this.chart.pixelScale,this.oA=(new Li).Ri(this.Mh.toVec2(this.Mh.getWidth(this.nA),this.hA)),this.aA=this.vf.Ve(this.rA).setMouseInteractions(!1),this.lA=this.vf.Ve(this.rA).setMouseInteractions(!1),this.uA=this.vf.Ve(this.rA).setMouseInteractions(!1),this.cA=this.qf.Te(this.nA).ke(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(nt).aa(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.dA=this.qf.Te(this.nA).ke(d.getWidth({x:y.xAxisZoomingBandFillStyle,y:y.yAxisZoomingBandFillStyle})).Ce(d.getWidth({x:y.xAxisZoomingBandStrokeStyle,y:y.yAxisZoomingBandStrokeStyle})),this.fA=this.qf.Te(this.nA).ke(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(nt).aa(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.AA=this.qf.Te(this.nA).ke(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(nt).aa(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.Dh=this.qf.kr(this.rA).setMouseInteractions(!1).zh(this.Mh.getTitleTextRotation(this.sA)),this.chart.us.ls.os(this.cA,(t=>this.cA.cs(t)),{animationEnabled:this.th}),this.chart.us.ls.os(this.fA,(t=>this.fA.cs(t)),{animationEnabled:this.th}),this.chart.us.ls.os(this.AA,(t=>this.AA.cs(t)),{animationEnabled:this.th});const b=Yi(new Xi(this.wf,this.Cf,this.kf,1),new ji(this.Tf,this.Ff,this.If),new Hi(this.hf)),v=Yi(new Xi(this.Hf,this.$f,this.jf)),M=Yi(new Xi(this.Hf,this.Xf,this.jf));this.cA.setMouseEnterEventHandler(this.rf).setMouseLeaveEventHandler(this.af).setMouseDragStartEventHandler(this.uf).setMouseDragEventHandler(this.ff).setMouseDragStopEventHandler(this.pf).setMouseWheelEventHandler(this.Sf).setMouseDoubleClickEventHandler(this.hf).setMouseClickEventHandler(this.xf).setMouseDownEventHandler(this.bf).setMouseUpEventHandler(this.Mf).setMouseMoveEventHandler(this._f).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.fA.setMouseEnterEventHandler(this.Pf).setMouseLeaveEventHandler(this.Bf).setMouseDragStartEventHandler(this.Rf).setMouseDragEventHandler(this.Vf).setMouseDragStopEventHandler(this.Gf).setMouseWheelEventHandler(this.Uf).setTouchStartEventHandler(v.onTouchStart).setTouchMoveEventHandler(v.onTouchMove).setTouchEndEventHandler(v.onTouchEnd),this.AA.setMouseEnterEventHandler(this.Pf).setMouseLeaveEventHandler(this.Bf).setMouseDragStartEventHandler(this.Rf).setMouseDragEventHandler(this.Of).setMouseDragStopEventHandler(this.Gf).setMouseWheelEventHandler(this.Yf).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.aA.Ee(d.getWidth({x:y.xAxisStrokeStyle,y:y.yAxisStrokeStyle})),this.lA.Ee(d.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.uA.Ee(d.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.Dh.ke(d.getWidth({x:y.xAxisTitleFillStyle,y:y.yAxisTitleFillStyle})).Vh(d.getWidth({x:y.xAxisTitleFont,y:y.yAxisTitleFont})),this.es=h.hs(this,{}),this.Nh=this.es.gA([this.Dh]).xs(y.effectsText)}wr(){return this.eh}Cr(){return void 0!==this.Xh}setTickStrategy(t,e){return super.kh(t,e)}getTickStrategy(){return this.je}addBand(t=!0){const e=t?this.Jf:this.Qf,i=new zs(e,this.chart,this.if,this,this.rA,this.Mh,this.qi,this.ss);return this.Kd.push(i),i}addConstantLine(t=!0){const e=t?this.Jf:this.Qf,i=new Ps(e,this.chart,this.if,this,this.rA,this.Mh,this.qi,this.ss);return this.Kd.push(i),i}pA(t){this.Kd.forEach(t)}mA(t){return this.Kd.map(t)}getHighlighters(){return this.Kd}setThickness(t){return"number"==typeof t?(this.yA=t,this.SA=t):"object"==typeof t&&(this.yA=t.min,this.SA=t.max),this.Md.bs(),this}getThickness(){return{min:this.yA,max:this.SA}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}vA(){return this.Fd}ar(t,e){return new Zo(e,t,this.vf,this.rA,this.Md,this.rA)}Gh(){if(this.wd){for(const t of this.wd)t[1].grid.dispose(),t[1].tick.dispose();this.wd.clear()}super.Gh()}lr(t,e){const{tickStart:i}=e,s=t.Sh.nr,n=i+s.getTickLength()*this.sA+s.getTickPadding()*this.sA;t.Ye.Ie(this.Mh.toPoint(t.S,n)).Ja(this.Mh.toPoint(s.getLabelAlignment(),-this.sA)).zh(s.labelRotation).setVisible(this.getVisible())}xA(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:n,tickStart:r}=e,o=t.Sh.nr,a=i-s*o.getGridStrokeLength(),h=r+o.getTickLength()*this.sA;return{gridStroke:{start:this.Mh.toPoint(t.S,n),end:this.Mh.toPoint(t.S,a)},tickStroke:{start:this.Mh.toPoint(t.S,r),end:this.Mh.toPoint(t.S,h)}}}bA(t,e,i,s){return this.Md.Ve(this.rA).Ee(new qi({fillStyle:new U({color:E(360*(1-s))}),thickness:5})).Oe(this.Mh.toVec2(t,0)).ze(this.Mh.toVec2(t,this.sA*(50*s)))}br(t,e){return"linear"===this.wh.type?Jo(t,e,this.dt):Ko(t,e,this.dt)}MA(t,e){return e instanceof Ii?Jo:Ko}_r(t,e,i){if("logarithmic"!==this.wh.type){const s=this.dt.Li(e-t);return{min:t-i*s,max:e+i*s}}const s=this.dt;return{min:s.pi(t,-i),max:s.pi(e,i)}}Fe(t,e,i){const s=this.aA.ku(),n=this.dt.getInnerStart()this.dt.getInnerStart()?this.dt.getInnerEnd():this.dt.getInnerStart(),o=this.dt.ri(),a=this.hA.getInnerInterval(),h=s.getThickness()*this.sA/2,l=this.iA/100*a,u=l+t,c=a*this.sA,d=u+h,f=this.Td.reduce(this.sf,0);let g,m=0;if(this.Xi||this.Gh(),this.Xe!==Ns&&this.Xi){const t=this.dt.ri();this.Jh({physicalAxisSize:t,startPosition:l,gridStrokeLen:c,gridStrokeStart:u,tickStart:d});for(const[e,i]of this.Ze){let s=this.wd.get(e);if(!s)if(e.Ne)s={grid:this.Md._A(this.rA).setMouseInteractions(!1),tick:this.Md._A(this.rA).setMouseInteractions(!1)};else if("wA"in e){const t=Array.from(this.Ze.keys()).filter((t=>"wA"in t)).reverse().indexOf(e),i=this.Zf[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._A(this.rA).setMouseInteractions(!1),tick:i._A(this.rA).setMouseInteractions(!1)}}if(s){s.grid.Nt(),s.tick.Nt();for(const[e,n]of i){const e=this.xA(n,{physicalAxisSize:t,startPosition:l,gridStrokeLen:c,gridStrokeStart:u,tickStart:d});s.grid.Lr().CA(e.gridStroke.start,e.gridStroke.end),s.tick.Lr().CA(e.tickStroke.start,e.tickStroke.end)}s.grid.Ee(e.nr.getGridStrokeStyle()),s.tick.Ee(e.nr.getTickStyle()),this.wd.set(e,s)}}for(const t of this.Ze.values()){let e=Fe;for(const i of t.values()){const t=i.Sh.nr,s=this.Mh.getHeight(i.Ye.oi()),n=t.getTickLength()+t.getTickPadding()+s+t.getLabelPadding();e=Math.max(e,n)}m=Math.max(m,e)}g=d+Math.max(m,f)*this.sA}else m=0,g=d+f*this.sA;this.aA.Oe(this.Mh.toPoint(n,u)).ze(this.Mh.toPoint(r,u)),this.lA.Oe(this.Mh.toPoint(this.dt.pi(this.dt.getInnerStart(),this.Dd),u)).ze(this.Mh.toPoint(this.dt.getInnerStart(),u)),this.uA.Oe(this.Mh.toPoint(this.dt.pi(this.dt.getInnerEnd(),-this.Dd),u)).ze(this.Mh.toPoint(this.dt.getInnerEnd(),u));const p=this.Dh&&this.Dh.Ph().length>0?this.Mh.getHeight(this.Dh.Ds().oi()):0,y=g+.5*p*this.sA;this.Dh.Ie(this.Mh.toPoint(this.dt.pi(this.dt.getInnerStart(),o/2),y));const A=d,x=A+this.sA*this.kd,S=this.Gd||this.Wd?Math.min(this.Rd,.25*o):0,b={start:this.Mh.toVec2(this.dt.pi(this.dt.getInnerStart(),S),A),end:this.Mh.toVec2(this.dt.pi(this.dt.getInnerEnd(),-S),x)};if(this.Cd){const e=this.iA/100*a+t,i=-this.sA*a-t,s={start:this.Mh.toVec2(this.Cd.min,d+this.sA*this.kd),end:this.Mh.toVec2(this.Cd.max,e+i)},n=ut(s.start,this.rA,this.nA),r=ut(s.end,this.rA,this.nA);this.dA.Ie(n).q(ri(r,n)).setVisible(!0)}else this.dA.setVisible(!1);const v=ut(this.Mh.toVec2(this.dt.getInnerStart(),x),this.rA,this.nA),M=ut(b.start,this.rA,this.nA),T=ut(b.end,this.rA,this.nA),w=ut(this.Mh.toVec2(this.dt.getInnerEnd(),A),this.rA,this.nA);this.cA.Ie(M).q(ri(T,M)),this.fA.Ie(v).q(ri(M,v)),this.AA.Ie(T).q(ri(w,T));for(const e of this.Td)e.update().plot(u,c,t,d);for(const t of this.Kd)t.Fe();const E=s.getThickness()+Math.max(m,f)+(this.Dh&&this.Dh.Ph().length>0?p+this.Pd:0);return this.kd=this.Xi?kt(E,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:_e):0,this}kA(t){const e=this.aA.ku().getThickness()*this.sA/2,i=this.hA.getInnerInterval(),s=this.iA/100*i+t,n=s+e,r=i*this.sA,o=n+e;for(const e of this.Td)e.update().plot(s,r,t,o);for(const t of this.Kd)t.Fe()}TA(){return this.kd}FA(t,e){e=e||Xo.AxisTickMajor;const i=new xr(this,t?this.Md:this.qf,this.qf,this.dt,this.oA,this.oA,this.Mh,this.eA,this.ef,this.qi,e).setTextFormatter(this.formatValue);return this.Td.push(i),i}nf(t){this.chart.us.ls.ws(t,1),this.Bd=t.us.Er(this.Xd,this.Bd)}lf(t){this.chart.us.ls.ws(t,0),t.us.Vr(this.Bd)}cf(t){this.setStopped(!0),t.us.Vr(this.Bd)}Af(t,e){const i=-this.Mh.getWidth(e);this.pan(i),this.Bd=t.us.Er(this.jd,this.Bd)}pan(t){const e=this.Th,i=this.Fh,s=this.dt.pi(e,t),n=this.dt.pi(i,t);this.jh(s,n,!1)}zoom(t,e){const i=this.dt.ct(this.Th),s=this.dt.ct(this.Fh),n=this.dt.ct(t),r=kt((n-i)/(s-i),0,1),o=.2*this.dt.ri(),a=r*this.Ed*o*-e,h=(1-r)*this.Ed*o*e,l=this.dt.pi(this.Th,a),u=this.dt.pi(this.Fh,h);this.jh(l,u,!0)}mf(t){this.Cd=void 0,t.us.Vr(this.Bd)}df(t,e){this.setStopped(!0),t.us.Vr(this.Bd),this.chart.us.ls.ws(this.cA,0)}gf(t,e,i,s){const n=ut(this.vf.us.De(i.x,i.y),this.vf.us.dt,this.rA),r=kt(this.Mh.getWidth(n),this.Th,this.Fh),o=this.Mh.getWidth(ut(this.vf.us.De(e.x,e.y),this.vf.us.dt,this.rA));Math.abs(this.dt.ct(r)-this.dt.ct(o))>10?(this.Cd=m(Math.min(r,o),Math.max(r,o)),this.Bd=t.us.Er(this.Zd,this.Bd)):(this.Cd=void 0,this.Bd=t.us.Er(this.Xd,this.Bd)),this.vf.bs()}yf(t,e,i){if(this.Cd){const t=this.Cd.min,e=this.Cd.max,i=this.Fh{e.vs(t)}));for(const e of this.wd.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.Md.bs(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.th),this}}const ta={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},ea={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},ia=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof Qo&&"y"in t&&t.y instanceof Qo),sa=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new qi,tickLength:7,tickStyle:new qi,tickPadding:0,labelFont:new sn,labelFillStyle:new U,labelPadding:0,labelAlignment:0,labelRotation:0});class na extends sa{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")}setLabelPadding(t){return this.set("labelPadding",t)}getLabelPadding(){return this.get("labelPadding")}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 ra=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),oa=new na({labelFillStyle:V,gridStrokeStyle:nt,tickStyle:nt}),aa=t=>ra(t)&&B(t.labelFillStyle)&&rt(t.gridStrokeStyle)&&rt(t.tickStyle),ha=(t,e,i,s,n)=>(r,o)=>a=>{const h=new Date(a+r),l={year:o?h.getUTCFullYear():h.getFullYear(),monthIndex:o?h.getUTCMonth():h.getMonth(),day:o?h.getUTCDate():h.getDate(),hours:o?h.getUTCHours():h.getHours(),minutes:o?h.getUTCMinutes():h.getMinutes(),seconds:o?h.getUTCSeconds():h.getSeconds(),millis:o?h.getUTCMilliseconds():h.getMilliseconds()},u=s?s(l):void 0;if(0===t&&!0===u)return a;const c=l[e];n.includes("year")&&(l.year=Math.floor(l.year/i)*i),n.includes("monthIndex")&&(l.monthIndex=0),n.includes("day")&&(l.day=1),n.includes("hours")&&(l.hours=0),n.includes("minutes")&&(l.minutes=0),n.includes("seconds")&&(l.seconds=0),n.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)-r:new Date(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis).getTime()-r},la=(t,e,i,...s)=>ha(-1,t,e,i,s),ua=(t,e,i,...s)=>ha(-1,t,e,i,s),ca=(t,e,i,...s)=>ha(0,t,e,i,s),da=(t,e,...i)=>ha(1,t,e,void 0,i),fa=t=>(e,i)=>s=>{const n=new Date(s+e),r=i?n.getUTCDay():n.getDay(),o=1===r&&0===(i?n.getUTCHours():n.getHours())&&0===(i?n.getUTCMinutes():n.getMinutes())&&0===n.getSeconds()&&0===n.getMilliseconds();if(0===t&&!0===o)return s;let a=i?n.getUTCDate():n.getDate();return-1===t&&1===r&&!1===o||(-1===t?a-=r>=2?r-1:r+6:a+=r>0?8-r:1),i?Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),a,0,0,0,0)-e:new Date(n.getFullYear(),n.getMonth(),a,0,0,0,0).getTime()-e},ga=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:Hs({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:Hs(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:la("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Xs(5,10,15,30)},minorTicks:{amount:4,fitFunction:Hs(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:la("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Xs(5,10,15,30)},minorTicks:{amount:12,fitFunction:Hs(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:la("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Xs(3,6,12)},minorTicks:{amount:8,fitFunction:Hs(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:la("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:Hs({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:Hs({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:fa(-1),getNextKeyValueIncludingRef:fa(0),getNextKeyValue:fa(1),greatTicks:!0,majorTicks:{fitFunction:Hs(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:ua("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:ca("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:da("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Hs(void 0,2,3)},minorTicks:{fitFunction:Hs(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:ua("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:ca("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:da("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Hs({ignore:"first"},2,5)},minorTicks:{fitFunction:Hs(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:ua("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:ca("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:da("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Hs(void 0,2,4)},minorTicks:{fitFunction:Hs(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:ua("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:ca("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:da("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:ua("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:ca("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:da("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],ma=(t,e,i)=>{let s=((t,e,i,s,n)=>{const r=e-t;let o;for(let t=0;t(s,n,r,o)=>{const a=ma("great",s,n);if(void 0===a)return[];if("Decade"===a.label||"Century"===a.label||"Millennium"===a.label)return[];const h=o>r?s:n,l=(s+n)/2,u=o>r?n:s;if(ga.indexOf(a)<=ga.findIndex((t=>"Hour"===t.label)))return"left"===i?[h]:[];let c;if(!0===a.irregular)c=Ys(s,n,a.getPrevKeyValue(t,e),a.getNextKeyValue(t,e));else{const i=a.greatTicks.getReferenceKeyValue(t,e)(s);c=Ws(s,n,a.unit,i,1)}const d=((t,e,i)=>{for(const s of i)if(s>=t&&s<=e)return s})(s,n,c);return"left"===i?void 0===d||Ge(d,l,u)?[h]:[d]:void 0!==d&&Ge(d,l,u)?[d]:[u]},ya=(t,e,i)=>(s,n,r,o)=>{const a=ma(t,r,o);let h;if(void 0===a)return[];if("great"===t&&void 0!==a.greatTicks)if(!0===a.irregular)h=Ys(s,n,a.getPrevKeyValue(e,i),a.getNextKeyValue(e,i));else{const t=a.greatTicks.getReferenceKeyValue(e,i)(s);h=Ws(s,n,a.unit,t,1)}else if("major"===t&&void 0!==a.majorTicks)h=!0===a.irregular?((t,e,i,s)=>{const n=[];let r=i(t),o=0;for(;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return n.push(r),n})(s,n,a.getPrevKeyValue(e,i),a.getNextKeyValue(e,i)):((t,e,i)=>{const s=[];let n=t,r=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return s.push(n),s})(s,n,a.unit);else{if("minor"!==t||void 0===a.minorTicks)return[];if(!0===a.irregular)h=((t,e,i,s)=>{const n=[];let r=i(t),o=0;for(;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return n})(s,n,a.getNextKeyValueIncludingRef(e,i),a.getNextKeyValue(e,i));else{const t=(t=>{if(void 0!==t)return ga[ga.indexOf(t)+1]})(a);if(void 0===t)return[];h=Gs(s,n,t.unit/a.minorTicks.amount,1)}}return h},Aa=t=>(e,i,s,n,r,o)=>{const a=ma(t,r,o);if(void 0===a)return;let h;return"major"===t?h=a.majorTicks.fitFunction:a.minorTicks&&(h=a.minorTicks.fitFunction),h?h(e,i,s,n,r,o):void 0},xa=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new na,majorTickStyle:new na,minorTickStyle:new na,formatOptionsMajorCentury:{year:"numeric"},formatOptionsMinorDecade:{year:"numeric"},formatOptionsMajorDecade:{year:"numeric"},formatOptionsMinorYear:{year:"numeric"},formatOptionsMajorYear:{year:"numeric"},formatOptionsMinorMonth:{month:"short"},formatOptionsGreatYear:{year:"numeric"},formatOptionsMajorMonth:{month:"long"},formatOptionsMinorWeek:{day:"numeric"},formatOptionsGreatMonth:{year:"numeric",month:"long"},formatOptionsMajorWeek:{day:"numeric",weekday:"short"},formatOptionsMinorDay:{day:"numeric",weekday:"short"},formatOptionsGreatWeek:(t,e,i)=>{const s=new Date(t),n=(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"}).format(s)} Week ${n}`},formatOptionsMajorDay:{weekday:"long",day:"numeric"},formatOptionsMinorHour:{hour:"2-digit",minute:"2-digit"},formatOptionsGreatDay:{year:"numeric",month:"long",day:"numeric"},formatOptionsMajorHour:{hour:"2-digit",minute:"2-digit"},formatOptionsMinorMinute:{hour:"2-digit",minute:"2-digit"},formatOptionsGreatHour:{year:"numeric",month:"long",day:"numeric"},formatOptionsMajorMinute:{hour:"2-digit",minute:"2-digit"},formatOptionsMinorSecond:{hour:"2-digit",minute:"2-digit",second:"2-digit"},formatOptionsGreatMinute:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"},formatOptionsMajorSecond:{second:"2-digit"},formatOptionsMinorMillisecond:t=>{const e=new Date(t);return`${(e.getSeconds()+e.getUTCMilliseconds()/1e3).toFixed(2)}`},formatOptionsGreatSecond:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},formatOptionsMajorMilliSecond:t=>{const e=new Date(t);return`${(e.getSeconds()+e.getUTCMilliseconds()/1e3).toFixed(1)}`}});class Sa extends xa{Wh(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>ga.map((e=>{const i=((t,e,i)=>{switch(i.label){case"MilliSecond100":return"Great"===e?void 0:"Major"===e?t.formatOptionsMajorMilliSecond:t.formatOptionsMinorMillisecond;case"Second":return"Great"===e?t.formatOptionsGreatSecond:"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]},`;St.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 n=t=>String(t),r=(t,i)=>(r,o)=>{let a=r+e;const h=o.getInnerStart(),l=o.getInnerEnd(),u=h>l,c=ma(t,u?l:h,u?h:l);if(void 0===c)return n(a);if("great"===t){const t=Et(r,"left"===i?h:l);let s;if(s=!1===t?r:!1===c.irregular?"left"===i&&!1===u||"right"===i&&!0===u?c.greatTicks.getReferenceKeyValue(e,this.utc)(r):c.greatTicks.getReferenceKeyValue(e,this.utc)(r+1*c.unit):"left"===i&&!1===u||"right"===i&&!0===u?c.getPrevKeyValue(e,this.utc)(r):c.getNextKeyValue(e,this.utc)(r),a=s+e,"right"===i&&!0===t)return""}const d=s.get(t);if(void 0===d)return n(a);const f=d[ga.indexOf(c)];return void 0===f?"":"function"==typeof f?f(a,o,this.locale):f.format(a)},o=[],a=[{Ye:"Great ticks (directive)",wA:0,Ge:!0,Ir:ya("great",e,this.utc),Pr:void 0},{Ye:"Major ticks",wA:1,nr:this.majorTickStyle,hr:r("major"),Ir:ya("major",e,this.utc),xh:{ur:Aa("major")},Pr:void 0}];aa(this.greatTickStyle)||(o.push({Ye:"Great ticks (left)",nr:this.greatTickStyle.setLabelAlignment(-1),hr:r("great","left"),Ir:pa(e,this.utc,"left"),Ne:!0,Ar:!1}),o.push({Ye:"Great ticks (right)",nr:this.greatTickStyle.setLabelAlignment(1),hr:r("great","right"),Ir:pa(e,this.utc,"right"),Ne:!0,Ar:!1})),aa(this.minorTickStyle)||a.push({Ye:"Minor ticks",wA:2,nr:this.minorTickStyle,hr:r("minor"),Ir:ya("minor",e,this.utc),xh:{ur:Aa("minor"),bh:(t,e,i,s,n,r)=>{const o=ma("minor",n,r);return!o||"Week"!==o.label}},Pr:void 0});const h=this.cursorFormatter;return{He:o,$e:a,We:h?(t,i,s)=>h(e+t,i,s):(t,i,s)=>{const n=new Date(e+t);return`${new Intl.DateTimeFormat(s,{year:"numeric",month:"numeric",day:"numeric",minute:"2-digit",hour:"2-digit"}).format(n)} `},Hh:1e3,$h:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}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("formatOptionsGreatSecond",t||this.formatOptionsGreatSecond).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("formatOptionsMajorMilliSecond",e||this.formatOptionsMajorMilliSecond).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 ba=(t,e)=>(i,s)=>{const n=s-i;if(e){const e=Math.log10(n/2);let r=10**Math.floor(e-t);const o=1/r;r=Math.round(r*o)/o;const a=Math.round(Math.floor(i/(10*r))*r*10*o)/o;return Ws(a,s,r,void 0,o)}const r=Math.log10(n);let o=10**Math.round(r-t);const a=1/o;return o=Math.round(o*a)/a,Gs(i,s,o,a)},va=(t,e,i,s,n,r)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%5==0)):void 0,Ma=(t,e,i,s,n,r)=>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,Ta=Hs(void 0,2,5),wa=(t,e,i,s,n,r)=>0===e?[t[1],t[3],t[5]]:1===e?[t[0],t[3]]:2===e?[t[1]]:void 0,Ea=(t,e)=>{const i=vi(t),s=Mi(t);if(e)return(t,e)=>{const n=[],r=Math.floor(i(t)),o=Math.ceil(i(e));for(let t=r-1;t<=o+1;t+=1){const e=s**t;n.push(e)}return n};const n=10===t?9:4;return(t,e)=>{const r=Math.round(i(t)),o=Math.round(i(e)),a=[],h=s**r,l=(s**o-h)/n;for(let i=1;i<=n;i+=1){const s=h+l*i;s>t&&sCi.LogarithmicNoExponents(e,i,void 0,t.base):Ci.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ci.LogarithmicNoExponents(e,i,void 0,t.base):Ci.Numeric),n=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ci.LogarithmicNoExponents(e,i,void 0,t.base):Ci.Numeric),r=[],o=[];aa(this.extremeTickStyle)||r.push({Ye:"Extreme ticks",nr:this.extremeTickStyle,hr:void 0===e?i:(t,s,n)=>i(e+t,s,n),Ir:Us,Ne:!0,Ar:!0}),o.push({Ye:"Major ticks",wA:0,nr:this.majorTickStyle,hr:void 0===e?s:(t,i,n)=>s(e+t,i,n),Ir:"logarithmic"===t.type?Ea(t.base,!0):ba(0,!0),xh:"logarithmic"===t.type?{ur:Ma}:{ur:va},Pr:void 0}),aa(this.minorTickStyle)||o.push({Ye:"Minor ticks",wA:1,nr:this.minorTickStyle,hr:void 0===e?n:(t,i,s)=>n(e+t,i,s),Ir:"logarithmic"===t.type?Ea(t.base,!1):ba(1,!1),xh:"logarithmic"===t.type?{ur:wa}:{ur:Ta},Pr:50});const a=this.cursorFormatter?this.cursorFormatter:Ci.Numeric;return{He:r,$e:o,We:void 0===e?a:(t,i,s)=>a(e+t,i,s),Hh:1e-9,$h: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")}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 Da=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new na,minorTickStyle:new na,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Ia=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=6e4?"MajorMinutes":i>=1e4?"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"},_a={hhmmss:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const n=Math.floor(e/6e4);e%=6e4;const r=Math.floor(e/1e3);return`${i}${ue(s,2)}:${ue(n,2)}:${ue(r,2)}`},hhmmssmmm:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const n=Math.floor(e/6e4);e%=6e4;const r=Math.floor(e/1e3);e%=1e3;const o=Math.floor(e/1);return`${i}${ue(s,2)}:${ue(n,2)}:${ue(r,2)}.${ue(o,3)}`},hhmmssmmmuuu:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),n=Math.floor(e/6e4)%60,r=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,a=t.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}).split(".")[1];return`${i}${ue(s,2)}:${ue(n,2)}:${ue(r,2)}.${ue(o,3)}${a}`},hhmmssmmmuuunnn:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),n=Math.floor(e/6e4)%60,r=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,a=t.toLocaleString("en-US",{minimumFractionDigits:6,maximumFractionDigits:6}).split(".")[1];return`${i}${ue(s,2)}:${ue(n,2)}:${ue(r,2)}.${ue(o,3)}${a}`}},Fa={MajorHours12:{major:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>{const n=432e5;return t=Math.floor(t/(4*n))*n*4,Ws(t,e,n,void 0,1e6)},fitKeyValues:Hs({ignore:"first"},2,4)},minor:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,36e5,1e6),fitKeyValues:Hs({},2,3,4,6)},defaultValueFormatter:_a.hhmmss},MajorHours:{major:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>{const n=36e5;return t=Math.floor(t/(12*n))*n*12,Ws(t,e,n,void 0,1e6)},fitKeyValues:Hs({ignore:"first"},2,6,12)},minor:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,3e5,1e6),fitKeyValues:Hs({},2,4,6)},defaultValueFormatter:_a.hhmmss},MajorMinutes15:{major:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Ws(t,e,9e5,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2)},minor:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,6e4,1e6),fitKeyValues:Hs({},3,5)},defaultValueFormatter:_a.hhmmss},MajorMinutes:{major:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Ws(t,e,6e4,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,5e3,1e6),fitKeyValues:Hs({},2,3,4,6)},defaultValueFormatter:_a.hhmmss},MajorSeconds15:{major:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Ws(t,e,15e3,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,4)},minor:{format:_a.hhmmss,getKeyValues:(t,e,i,s)=>Gs(t,e,1e3,1e6),fitKeyValues:Hs({},3,5)},defaultValueFormatter:_a.hhmmss},MajorSeconds:{major:{format:_a.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Ws(t,e,1e3,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmm,getKeyValues:(t,e,i,s)=>Gs(t,e,100,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.hhmmssmmm},MajorMilliseconds100:{major:{format:_a.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Ws(t,e,100,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmm,getKeyValues:(t,e,i,s)=>Gs(t,e,10,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.hhmmssmmm},MajorMilliseconds10:{major:{format:_a.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Ws(t,e,10,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmm,getKeyValues:(t,e,i,s)=>Gs(t,e,1,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.hhmmssmmm},MajorMilliseconds:{major:{format:_a.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Ws(t,e,1,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Gs(t,e,.1,1e6),fitKeyValues:Hs({},2)},defaultValueFormatter:_a.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:_a.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Ws(t,e,.1,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Gs(t,e,.01,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:_a.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Ws(t,e,.01,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Gs(t,e,.001,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.hhmmssmmmuuu},MajorMicroseconds:{major:{format:_a.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Ws(t,e,.001,void 0,1e6)),fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Gs(t,e,100*1e-6,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:_a.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const n=100*1e-6;return t=Math.floor(t/.001)*n*10,Ws(t,e,n,void 0,1e6)},fitKeyValues:Hs({ignore:"first"},2,5)},minor:{format:_a.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Gs(t,e,10*1e-6,1e6),fitKeyValues:Hs({},2,3,5)},defaultValueFormatter:_a.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 La extends Da{Wh(t){const e=this.timeOrigin||0,i=[{Ye:"Major ticks",wA:0,nr:this.majorTickStyle,hr:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const n=Ia(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Fa[n].major.format)(t+e,i,s)},Ir:(t,e,i,s)=>{const n=Ia(i,s);return(0,Fa[n].major.getKeyValues)(t,e,i,s)},xh:{ur:(t,e,i,s,n,r)=>{const o=Ia(n,r),a=Fa[o].major.fitKeyValues;if(a)return a(t,e,i,s,n,r)}},Pr:void 0}];return ra(this.minorTickStyle)&&i.push({Ye:"Minor ticks",wA:1,nr:this.minorTickStyle,hr:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const n=Ia(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Fa[n].minor.format)(t+e,i,s)},Ir:(t,e,i,s)=>{const n=Ia(i,s);return(0,Fa[n].minor.getKeyValues)(t,e,i,s)},xh:{ur:(t,e,i,s,n,r)=>{const o=Ia(n,r),a=Fa[o].minor.fitKeyValues;if(a)return a(t,e,i,s,n,r)}},Pr:void 0}),{He:[],$e:i,We:this.cursorFormatter||((t,i,s)=>{const n=Ia(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Fa[n].defaultValueFormatter(t+e,i,s)}),Hh:1e-4,$h:864e6}}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 za=(t,e,i="image/png",s)=>{e+=`.${i.slice(i.indexOf("image/")+6)}`;const n=t.captureFrame(i,s);if("image/png"!==i&&n.type.includes("image/png"))throw new Error(`saveToFile | type not supported by browser: ${i}\nCheck support table for HTMLCanvasElement.toDataURL`);if(St.navigator.msSaveBlob)St.navigator.msSaveBlob(n,e);else{const t=St.document.createElement("a");St.document.body.appendChild(t);const i=St.URL.createObjectURL(n);t.href=i,t.download=e,t.click(),setTimeout((()=>{St.URL.revokeObjectURL(i),St.document.body.removeChild(t)}),0)}},Pa=(t,i,s,n,r,o)=>{const a=t.fc(i,s,n,r,o,!0);return a.setDraggingMode(e.UIDraggingModes.draggable),a},Ra=(t,e)=>{if("relative"===t)return e;if(t instanceof Fi)return t;const i=t.x instanceof qs?t.x.dt:t.x.x,s=t.y instanceof qs?t.y.dt:t.y.y;return Pi(i,s)},Va=(t,e,i,s,n)=>{if(i){const r=t,o=e,a=ia(o)?o:Bi(o)?s:void 0;if(a&&Ri(i)){const t=ut(r,a,n.dt);return n.Xo({engineX:t.x,engineY:t.y})}if(a&&Bi(i))return ut(r,a,s);if(a&&ia(i))return ut(r,a,i)}else{const i=t;if(Bi(e)){const t=n.$o(i);return ut({x:t.engineX,y:t.engineY},n.dt,s)}if(ia(e)){const t=e,s=n.$o(i);return ut({x:s.engineX,y:s.engineY},n.dt,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class Ba{constructor(t,e,i,s,r,o,a,h){this.coordsRelative="relative",this.coordsClient="client",this.IA=[],this.PA=[],this.D=new n.Eventer,this.DA=void 0,this.BA=void 0,this.LA=void 0,this.Xt=A(0,0,0,0),this.RA=!1,this.$i=!1,this.EA=()=>{this.VA=!0,this.zA.bs()},this.OA=t=>e=>{const i=this.IA.indexOf(e);-1!==i&&this.IA.splice(i,1),this.us.bs(),t.W()},this.NA=t=>{const e=this.PA.indexOf(t);-1!==e&&this.PA.splice(e,1),this.us.bs()},this.VA=!0,this.onInViewChange=t=>this.D.on("inViewChange",t),this.offInViewChange=t=>this.D.off(t,"inViewChange"),this.fs=t,this.GA=i,this.zA=s,this.removePanel=r,this.qi=e.us.qi;const l=e.us.oi();if(this.uiScale=i.d2({scaleXYConstructor:Li}).zi(0,100).Oi(0,100).q(l),this.pixelScale=i.d2({scaleXYConstructor:Li}).zi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).q(l),this.engine=e.us.WA,this.us=e.us.UA,this.es=this.us.es.hs(this,{}),this.YA=()=>e.HA("unidentified ui"),this.$A=e.XA(),this.jA=this.zA.Te(this.uiScale).Ie(u(0,0)).q(u(100,100)).ke(o).Ce(a).setMouseMoveEventHandler(((t,e)=>this.D.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.D.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.D.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.D.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.D.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.D.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.D.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.D.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.D.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,n)=>this.D.emit("mouseDragPanelBackground",this,e,i,s,n))).setMouseDragStopEventHandler(((t,e,i,s)=>this.D.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.D.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.D.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.D.emit("touchEndPanelBackground",this,e))),h){const t=h.on(this.EA);this.ZA=()=>h.off(t)}else{const t=e.us.Go(this.EA);this.QA=e.us.Wo.bind(e.us,t)}const c=e.us.Yo((t=>{this.RA=t,this.D.emit("inViewChange",this,t)}));this.JA=e.us.Ho.bind(e.us,c),this.DA=r}getTheme(){return this.qi}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.jA.ke(t),this.zA.bs(),this}getBackgroundFillStyle(){return this.jA.Lh()}setBackgroundStrokeStyle(t){return this.jA.Ce(t),this.zA.bs(),this}getBackgroundStrokeStyle(){return this.jA._o()}translateCoordinate(t,e,i){return Va(t,e,i,this.pixelScale,this.us)}KA(t){return this.IA.push(t),this.us.bs(),t}qA(t){return this.PA.push(t),this.us.bs(),t}addUIElement(t=Eo,e=this.uiScale){e=Ra(e,this.pixelScale);const i=this.YA();return this.KA(Pa(t,i,this.uiScale,e,this.OA(i),this.qi))}addLegendBox(t=Bo,i=this.uiScale){i=Ra(i,this.pixelScale);const s=this.qA(Pa(t,this.$A,this.uiScale,i,this.NA,this.qi));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Ts.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Ts.CenterBottom).setPosition(this.uiScale.pi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.PA}dispose(){return this.$i||(this.$i=!0,this.QA&&this.QA(),this.ZA&&this.ZA(),Oa(this.uiScale),Oa(this.pixelScale),this.JA&&this.JA(),this.BA&&this.BA(),this.zA.W(),this.$A.W(),this.IA.slice().forEach((t=>{t.dispose()})),this.PA.slice().forEach((t=>{t.dispose()})),this.us.bs(),this.DA&&this.DA(this),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}saveToFile(t,e,i){return za(this.engine,t,e,i),this}Ka(t){this.Xt=t,this.EA()}j(){return this.pixelScale.j(),this.uiScale.j(),this}Z(){return this.pixelScale.Z(),this.uiScale.Z(),this}Fe(t){if(this.VA){const t=this.zA.us.oi(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=[this.Xt.left,this.Xt.right],n=[this.Xt.bottom,this.Xt.top];this.uiScale.Ei(s),this.uiScale.Vi(n);const r=this.uiScale.getInnerIntervalPixels();this.pixelScale.zi(0,r.x).Ei(s).Oi(0,r.y).Vi(n),this.D.emit("resize",this,r.x,r.y,e,i)}this.VA=!1}tg(){for(let t=0;t{t.ii&&t.ii()};class Na extends Ba{constructor(t,e,i,s,n,r){super(t,e,i,e.sg("uipanel bg",0),s,e.us.qi.uiPanelBackgroundFillStyle,e.us.qi.uiPanelBackgroundStrokeStyle,r),this.ig(n,this.pixelScale)}setMinimumSize(t){return this.Uc=t,this.us.bs(),this}getMinimumSize(){return this.Uc}Fe(t){super.Fe(t),super.tg()}}const Ua=A(10,10,10,10);class Ga extends Ba{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,i,s,n,r,o,l),this.eg={},this.Da=Ua,this.th=!0,this.hg=e.rg("chart internal ui",0),this.ng=this.hg.kr(this.uiScale).Bh("Chart").Ie(u(50,100)).Ja(u(0,1)).Vh(a).ke(h).setMouseInteractions(!1),this.og=this.es.gA([this.ng]).xs(this.qi.effectsText)}setAnimationsEnabled(t){return this.th=t,this}getAnimationsEnabled(){return this.th}setTitle(t){return this.ng.Bh(t),this.us.bs(),this}getTitle(){return this.ng.Ph()}getTitleSize(){return this.ng.Ds().Cc()}setTitleFillStyle(t){return this.ng.ke(t),this.EA(),this}getTitleFillStyle(){return this.ng.Lh()}setTitleFont(t){return this.ng.Vh(t),this.EA(),this}getTitleFont(){return this.ng.Eh()}setTitleRotation(t){return this.ng.zh(t),this.us.bs(),this}getTitleRotation(){return this.ng.Oh()}setTitleEffect(t){return this.og.xs(t),this.us.bs(),this}getTitleEffect(){return this.og.Ms()}setTitleMargin(t){var e,i;return this.eg="object"==typeof t?this.eg?(e=this.eg,{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.EA(),this}getTitleMargin(){return this.eg}setPadding(t){return this.Da="object"==typeof t?S(this.Da,t):{left:t,top:t,right:t,bottom:t},this.EA(),this}getPadding(){return this.Da}ag(t){const e=t.lg(),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.hg.W(),this}}const Wa={ug:(t,e)=>t.Lh()!==V&&0!==t.Ph().length&&t.getVisible()?t.Ds().Cc().y:0,cg(t,e){t.Ie(u(50,100)).Ka({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var Ya;e.AutoCursorModes=void 0,(Ya=e.AutoCursorModes||(e.AutoCursorModes={}))[Ya.disabled=0]="disabled",Ya[Ya.snapToClosest=1]="snapToClosest",Ya[Ya.onHover=2]="onHover";const Ha={dg(t,i,s,n,r,o){let a;const h=t.getAutoCursorMode();if(!s&&h!==e.AutoCursorModes.disabled){const s=t.us.Bn(),l=n.find((t=>t.getIsUnderMouse()));h===e.AutoCursorModes.snapToClosest&&r?(i||void 0!==l)&&(a=s&&r(s)):void 0===l||l.getCursorEnabled&&!l.getCursorEnabled()||(a=s&&o(l,s))}a?t.Ag.pointAt(a).setVisible(!0):t.Ag.setVisible(!1),t.Ag.Ds().Fe()},gg(t,e,i){if(e.xt.uiScale.x.hi()||e.yt.uiScale.y.hi())return;let s,n=Number.MAX_VALUE;for(const r of i)if(r.getCursorEnabled()&&r.getVisible()){const i=r.gg(e);if(i){const r=ut(i.location,i.scale,t.engine.scale),o=We(e,r);Number.isNaN(o)||s&&!(o{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundMouseMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundTouchStart((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundTouchMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),t.onSeriesBackgroundTouchEnd((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()}))},mg(t,i){i.onMouseEnter(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),i.onMouseMove(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()})),i.onMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.us.bs()}))}};class Xa{constructor(t,e){this.yg=t,this.Sg=e}alter(t){this.vg=void 0!==this.vg?this.vg:this.Sg(),this.xg=t,this.yg(t)}resetValue(){void 0!==this.xg&&(void 0!==this.vg&&this.isAltered()&&this.yg(this.vg),this.vg=void 0,this.xg=void 0)}getNormalValue(){return void 0!==this.vg?this.vg:this.Sg()}isAltered(){return void 0!==this.xg&&this.Sg()===this.xg}}class ja{constructor(t,e){this.bg=[],this.Mg=t,this.dt=e}update(){return this.Mg.getVisible()?!(this._g()&&(!this.wg()||(this.resetTable(),this.Mg.Ds(),this._g()))&&(this.Cg(),this.Mg.Ds(),this._g()&&(this.resetTable(),this.Mg.Ds(),1))):(this.wg()&&this.resetTable(),!0)}wg(){for(let t=0;t{const s=ut(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),n=ut(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.Mg,this.dt)}kg(){return((t,i)=>{const s=ut(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),n=ut(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.Mg,this.dt)}Tg(){return((t,i)=>{const s=ut(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),n=ut(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.Mg,this.dt)}Fg(t){return this.bg.push(t),t}}class $a extends ja{constructor(){super(...arguments),this.Pa=this.Fg(new Xa((t=>this.Mg.setOrigin(t)),(()=>this.Mg.getOrigin())))}Cg(){const t=this.Pa.getNormalValue(),e=u(this.kg()?-t.x:t.x,this.Tg()?-t.y:t.y);this.Pa.alter(e)}}class qa extends ja{constructor(t,e,i,s){super(t,e),this.Ig=this.Fg(new Xa((t=>this.Mg.setTextFont((e=>e.setSize(t)))),(()=>this.Mg.getTextFont().getSize()))),this.Pg=i,this.Dg=s}Cg(){const t=this.Ig.getNormalValue(),e=this.Pg;if(enew $a(t,e),FontSize:(t=5,e=5)=>(i,s)=>new qa(i,s,t,e)};class Ka{constructor(){this.Bg=[]}addRow(...t){return this.Bg.push(t),this}}class Za extends Ka{fc(){const t=this.Bg;return this.Bg=[],t}Lg(){return this.Bg.length=0,this}}class Qa extends po{constructor(){super(...arguments),this.hc=this.qi.cursorResultTableTextFont,this.qc=0,this.Rg=this.qi.cursorResultTableTextFillStyle}setContent(t){for(let e=0;e=e)this.getMembers()[s].dispose(),s-=1,i-=1;else{const e=t[s].length;let i=n.getMembers().length;for(let r=0;r=e)n.getMembers()[r].dispose(),r-=1,i-=1;else if(void 0!==l&&l.length>0){for(let t=u.length;t=u.length)t=n.addElement(no,void 0);else{const e=u[r];e instanceof uo?(n.getMembers()[r].dispose(),t=n.addElement(no,r)):t=e}const e=a?this.hc.withMutations((t=>{for(const e of Object.keys(a)){const i=a[e];t.set(e,i)}return t})):this.hc,i=h||this.Rg;t.setFont(e).setFillStyle(i).setText(l).setTextRotation(this.qc)}else{for(let t=u.length;t=u.length?n.addGap(void 0,void 0):u[r]instanceof so&&(n.getMembers()[r].dispose(),n.addGap(void 0,r))}}}}return this.Ts.bs(),this}setTextFillStyle(t){this.Rg="function"==typeof t?t(this.Rg):t;for(let t=0;tt.setFillStyle(n.cursorResultTableFillStyle).setStrokeStyle(n.cursorResultTableStrokeStyle))).setTextFillStyle(n.cursorResultTableTextFillStyle).setTextFont(n.cursorResultTableTextFont),this.Gg=Ja.Flip(this.Mg,this.scale)}dispose(){return this.Ng.dispose(),this.Mg.dispose(),this}pointAt(t){return this.wa=t.scale===this.scale?t.location:ut(t.location,t.scale,this.scale),this.Ng.setPosition(this.wa),this.Mg.setPosition(this.wa).setContent(t.resultTableContent),this.Ts.bs(),this}getPosition(){return this.wa}setVisible(t){return this.Xi=t,this.Ts.bs(),this}getVisible(){return this.Xi}setPointMarkerVisible(t){return this.Vg=t,this.Ts.bs(),this}getPointMarkerVisible(){return this.Vg}setPointMarker(t){return t(this.Ng),this.Ts.bs(),this}getPointMarker(){return this.Ng}setResultTableVisible(t){return this.zg=t,this.Ts.bs(),this}getResultTableVisible(){return this.zg}setResultTable(t){return t(this.Mg),this.Ts.bs(),this}getResultTable(){return this.Mg}setAutoFitStrategy(t){return this.Gg&&this.Gg.resetTable(),this.Gg=t?t(this.Mg,this.Ts.us.dt):void 0,this.Ts.bs(),this}getAutoFitStrategy(){return void 0!==this.Gg}Fe(){return this.Gg&&this.Gg.update(),this.Mg.setVisible(this.RA&&this.Xi&&this.zg),this.Ng.setVisible(this.RA&&this.Xi&&this.Vg),this.Ng.Fe(),this.Mg.Fe(),this}Ds(){return this.Ng.Ds(),this.Mg.Ds(),this.RA=((t,e,i=e)=>{const s=e!==i?ut(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.wa,this.scale),this}}class eh extends th{constructor(){super(...arguments),this.Wg=!1}pointAt(t){return this.Ug(t.fillStyle),super.pointAt(t)}Ug(t){t&&this.Wg&&this.Mg.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.Wg=t,this.Ts.bs(),this}getResultTableAutoTextStyle(){return this.Wg}}class ih extends th{setPosition(t){return this.wa=t,this.Ng.setPosition(t),this.Mg.setPosition(t),this.Ts.bs(),this}}class sh{constructor(t,e=[]){this.Yg=[],this.Hg=(t,e)=>(this.Yg.forEach((i=>i(t,e))),t),this.Og=t,this.Yg=e}}class nh extends sh{constructor(){super(...arguments),this.$g=(t,e,i,s)=>this.Hg(new eh(t,e,i,this.Og,s),s),this.addStyler=t=>new nh(this.Og,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new nh(t,this.Yg.map((t=>t)))}}class rh extends sh{constructor(){super(...arguments),this.Xg=(t,e,i,s)=>this.Hg(new ih(t,e,i,this.Og,s),s),this.addStyler=t=>new rh(this.Og,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new rh(t,this.Yg.map((t=>t)))}}const oh=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),ah=(t,e)=>t.setPointMarker((t=>t.setFillStyle(e.chartMarkerPointMarkerFillStyle).setSize(e.chartMarkerPointMarkerSize).setShape(e.chartMarkerPointMarkerShape))).setResultTable((t=>t.setEffect(!0).setBackground((t=>t)).setOrigin(u(-1,-1)).setMargin(10))),hh=new nh(ro,[oh]),lh=new nh(ho,[oh,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof ho&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),uh=hh,ch=hh,dh=lh,fh=new rh(ro,[ah,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(Ts.LeftBottom)))]),gh=(t,e,i,s,n)=>({location:t,scale:e,resultTableContent:i,owner:s,fillStyle:n});var mh;e.SliceLabelIndices=void 0,(mh=e.SliceLabelIndices||(e.SliceLabelIndices={}))[mh.LabelsInsideSlices=0]="LabelsInsideSlices",mh[mh.LabelsOnSides=1]="LabelsOnSides";const ph={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},yh={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`},Ah=(t,e,i,s)=>t.addRow(i.getName()).addRow(i.getAnimatedValue().toString());class xh extends Ui{constructor(){super(...arguments),this._s="Slice",this.S=0}}const Sh=(t,e)=>{jt(e),t.setExploded(!t.getExploded())};class bh extends xh{}class vh extends bh{constructor(t,e,i,s,n,r,o,a){super(s,r,o,a),this.jg=!1,this.Zg=V,this.Qg=V,this.Jg=this.S,this.Kg=this.jg?1:0,this.qg=this.getVisible(),this.tp=$((()=>this.Ji.us.bs())),this.ip=$((()=>this.Ji.us.bs())),this.sp=()=>{this.ep=void 0},this.hp=()=>{this.rp=void 0},this.index=t,this.Ji=s,this.scale=n,this.Ki=r,this.np=e.Fc(n).cs(this.getHighlight()),this.gs(this.np),this.Ye=i.kr(n).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0}),this.onMouseClick(Sh),this.onTouchEnd(Sh)}setValue(t){return this.Ji.getAnimationsEnabled()?this.qg&&this.op(this.Jg,t):this.Jg=t,this.S=t,this.Ji.us.bs(),this}getValue(){return this.S}setExploded(t){if(t&&!1===this.Ji.getMultipleSliceExplosion()){const t=this.Ji.getSlices();for(let e=0;e{this.Kg=t,this.Ji.us.bs()})),this.rp.onEveryAnimationEnd(this.hp),this.jg=!this.jg):!1!==this.Ji.getMultipleSliceExplosion()||t?(this.Kg=this.jg?0:1,this.jg=!this.jg):(this.Kg=0,this.jg=!this.jg),this.Ji.us.bs(),this}getExploded(){return this.jg}setVisible(t){return this.qg=t,!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?(this.ep&&(this.ep.finish(!1),this.ep=void 0),this.op(this.Jg,0,(()=>super.setVisible(!1)))):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(this.ep&&(this.ep.finish(!1),this.ep=void 0),super.setVisible(!0),this.op(this.Jg,this.S)):(this.Jg=this.S,super.setVisible(!0)),this}op(t,e,i){this.ep=this.tp(300,X.ease)([[t,e]],(([t])=>{this.Jg=t,this.Ji.us.bs()})),this.ep.onEveryAnimationEnd(this.sp),i&&this.ep.onAnimationEnd(i)}setStyle(t,e,i,s){this.Zg=t,this.Qg=i,this.np.ke(this.Zg).Ce(e),this.Ye.ke(this.Qg).Vh(s);for(let t=0;tni(e,si(mi(.5*(t.Au()+t.Ti())*Math.PI/180),i)),Th=(t,e,i,s,n,r)=>{const o=t.length;let a=90;for(let h=0;h{const e=t.getSlices();for(let t=0;t{const e=this.ap.indexOf(t);e>=0&&(this.ap.splice(e,1),this.Mp())},this.fs.zn||this.fs.Vn||this.fs.Hn||this.us.As(7),this._p=i.wp("pieChart bottom",0),this.Cp=i.wp("pieChart top",1),this.ng.Bh("Pie Chart"),this.ig(r,this.pixelScale),this.onBackgroundMouseDoubleClick(wh);const h=Yi(new Hi(wh));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),this.kp=i.Tp();const l=Dt(a?a.autoCursorBuilder:void 0,ch);this.Ag=l.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.setAnimationsEnabled(!0!==(null==a?void 0:a.disableAnimations)&&!1!==(null==a?void 0:a.animationsEnabled))}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}addSlice(t,e){const i=new vh(this.gp,this._p,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);this.gp+=1,i.setName(t);const s=this.th;return this.th=!1,i.setValue(e),this.th=s,i.setEffect(this.yp),this.Fp(i),this.ap.push(i),this.Mp(),i.setHighlightOnHover(this.dp),i}addSlices(t){const e=[];for(let i=0;ie.es.ns.xs(t))),this.us.bs(),this}getSliceEffect(){return this.yp}setSliceSorter(t){return this.lp=t,this.ap=this.ap.sort(this.lp),this.us.bs(),this}getSliceSorter(){return this.lp}setLabelFillStyle(t){this.Ap="function"==typeof t?t(this.Ap):t;for(let t=0;te.es.rs.xs(t))),this.us.bs(),this}getLabelEffect(){return this.Sp}setLabelFormatter(t){return this.Ip=t,this.us.bs(),this}getLabelFormatter(){return this.Ip}setSliceHighlightOnHover(t){return this.dp=t,this.ap.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),Wa.cg(this.ng,this.eg),super.tg();const e=Wa.ug(this.ng,this.eg),i=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+e)),s=u(this.Da.left+i.x/2,this.Da.bottom+i.y/2);if(this.ad){const t=this.ad;this.ap.forEach((e=>{this.Fp(e,new U({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.ap[t].np.setVisible(e),this.ap[t].Ye.setVisible(e)}this.ap=this.ap.sort(this.lp);const n=this.ap.filter((t=>t.getAnimatedValue()>0));let r=0;for(let t=0;t0?a/r:0);var a;for(let t=0;tgh(e,this.engine.scale,this.xp(new Za,this,t,o[n.indexOf(t)]||0).fc(),t,void 0))),this.Pp(n,o,s,i)}Fp(t,e=this.up(t.index)){t.setStyle(e,this.cp,this.Ap,this.fp)}Mp(){this.ap=this.ap.sort(this.lp),this.us.bs()}Sd(){return this.ap}dispose(){return super.dispose(),this.ap.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this.Cp.W(),this._p.W(),this.kp.W(),this}}const kh={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Ch=(...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 Dh extends Eh{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,r,o),this.Ip=yh.NamePlusValue,this.Dp=[],this.Bp=40,this.Lp=5,this.Rp=10,this.Ep=this.qi.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.Ep=t;for(let t=0;t{const n=360*e[s],a=c-n,h=mi(di(.5*(c+a))),l=h.x>=0?-1:1,d=ni(ni(i,si(h,u+r)),{x:l*-o,y:0});c=a;const f={x:l,y:0};t.Ye.Ie(d).Ja(f),t.Ye.Ds();const g=je(t.Ye.Ue());return{position:d,alignment:f,shape:t.Ye,boundaries:g,sliceAngleVec:h,slice:t}})),f=[];for(let t=0;t{const s=t.slice.np,n=Mh(s,i,u+a+h*t.slice.getAnimatedExplosion()),r=ci(t.position.y,n,i),o=t.position;this.Vp([n,r,o])}))}getMinimumSize(){return u(500,300)}Vp(t){let e;for(let t=0;t{if(Ji(t)){const e=t.getThickness(),i=t.getFillStyle();if(G(i))return 1===e?on:new hn({size:e,fillStyle:i,shape:"sphere"})}return on};class Lh{constructor(t,e,i,s){this.Np=[],this.Gp=new Map,this.Wp=t,this.Yp=e,this.Hp=i,this.$p=s}Xp(){this.Hp&&this.Hp();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.Np.slice(),n=[];e.forEach((t=>{let e=s.pop();e||(e=this.Wp(),this.Np.push(e));const r=[],o=e.jp().slice();t.instances.forEach(((t,e)=>{const i=o.shift();r.push({...t,existingMember:i})}));const a=this.Yp(e,r,t.sharedProperties);i=se(i,a,{canReturnB:!0});for(let i=0;i{null==e||e.Wc(t)}))})),s.forEach((t=>{t.dispose();const e=this.Np.indexOf(t);e<0?fe(0,(()=>{})):this.Np.splice(e,1)})),n.forEach((t=>{const e=this.Gp.get(t.ia);e&&t.collection.us.po({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.Gp.clear(),n.forEach((t=>{this.Gp.set(t.ia,t)})),this.$p&&this.$p(this.Np,i)}}}Zp(){this.Np.forEach((t=>{t.dispose()})),this.Np.length=0}}class zh{constructor(t){this.Qp=[],this.Jp=t}Xp(){return this.Kp(),{add:()=>this.vl(),finishPlot:()=>{this.qp()}}}vl(){let t=this.Qp.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.Jp()},this.Qp.push(t)),t.isFree=!1,t.shape}Kp(){this.Qp.forEach((t=>{t.isFree=!0}))}qp(){this.Qp.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.Qp.splice(this.Qp.indexOf(t),1)}))}Zp(){this.Qp.forEach((t=>t.shape.dispose())),this.Qp.length=0}}class Ph{constructor(t,e,i,s,r,o,a,h,l,u){this.D=new n.Eventer,this.S=0,this.Xi=!0,this.$i=!1,this.bs=t,this.tm=e,this.im=i,this.sm=s,this.hm=r,this.rm=o,this.qc=a,this.Rg=h,this.nm=l,this.gc=u}setValue(t){return t===this.S||(this.S=t,this.bs(),this.D.emit("valueChange",this,this.S)),this}getValue(){return this.S}setTickStyle(t){return this.im="function"==typeof t?t(this.im):t,this.bs(),this}getTickStyle(){return this.im}setTickLength(t){return this.sm=t,this.bs(),this}getTickLength(){return this.sm}setGridStrokeStyle(t){return this.hm="function"==typeof t?t(this.hm):t,this.bs(),this}getGridStrokeStyle(){return this.hm}setTextPadding(t){return this.rm=t,this.bs(),this}getTextPadding(){return this.rm}setTextRotation(t){return this.qc=t,this.bs(),this}getTextRotation(){return this.qc}setTextFillStyle(t){return this.Rg="function"==typeof t?t(this.Rg):t,this.bs(),this}getTextFillStyle(){return this.Rg}setTextFont(t){return this.nm="function"==typeof t?t(this.nm):t,this.bs(),this}getTextFont(){return this.nm}setTextFormatter(t){return this.gc=t,this.bs(),this}onValueChange(t){return this.D.on("valueChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}dispose(){return this.$i||(this.$i=!0,this.tm(),this.bs(),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setVisible(t){const e=this.Xi!==t;return this.Xi=t,e&&(this.D.emit("visibleStateChanged",this,this.Xi),this.bs()),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}}class Rh extends qs{constructor(t,e,i,s,n,r,o,a,h){super(t,e,i,s,a,{numeric:e.om({x:t.us.qi.xAxis3DNumericTicks,y:t.us.qi.yAxis3DNumericTicks,z:t.us.qi.zAxis3DNumericTicks}),datetime:e.om({x:t.us.qi.xAxis3DDateTimeTicks,y:t.us.qi.yAxis3DDateTimeTicks,z:t.us.qi.zAxis3DDateTimeTicks}),time:e.om({x:t.us.qi.xAxis3DTimeTicks,y:t.us.qi.yAxis3DTimeTicks,z:t.us.qi.zAxis3DTimeTicks})},{type:"linear"}),this.Td=[],this.am=()=>{},this.lm=()=>{},this.um=()=>{},this.dm=()=>{},this.chart=t,this.At=n,this.fm=r,this.Am=o,this.gm=this.At.dt;const l=this.Mh.om({x:this.qi.xAxis3DStrokeStyle,y:this.qi.yAxis3DStrokeStyle,z:this.qi.zAxis3DStrokeStyle});this.pm=this.At.zp([kh.InternalUI]).Ee(l).ym(Fh(l)).setMouseInteractions(!1),this.Dh=this.fm.kr(this.Am).setMouseInteractions(!1).ke(e.om({x:t.us.qi.xAxis3DTitleFillStyle,y:t.us.qi.yAxis3DTitleFillStyle,z:t.us.qi.zAxis3DTitleFillStyle})).Vh(e.om({x:t.us.qi.xAxis3DTitleFont,y:t.us.qi.yAxis3DTitleFont,z:t.us.qi.zAxis3DTitleFont})),this.Sm=new zh((()=>this.fm.kr(this.Am))),this.vm=new Lh((()=>this.At._A().setMouseInteractions(!1)),((t,e,i)=>(t.Nt().Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t._l(e)))))),this.es=h,this.Nh=this.es.gA([this.Dh]).xs(s.effectsText),this.pm.setMouseEnterEventHandler(this.am).setMouseLeaveEventHandler(this.lm).setMouseDragEventHandler(this.um).setMouseDragStopEventHandler(this.dm),i.tA=this}setTickStrategy(t,e){return super.kh(t,e)}getTickStrategy(){return this.je}addCustomTick(){const t=new Ph((()=>this.chart.us.bs()),(()=>{const e=this.Td.indexOf(t);e>=0&&this.Td.splice(e,1)}),this.qi.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.qi.xAxis3DNumericTicks.majorTickStyle.tickLength,this.qi.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.qi.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.qi.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.qi.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.qi.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)));return this.Td.push(t),this.chart.us.bs(),t}setStrokeStyle(t){return this.pm.Ee(t).ym(Fh(this.pm.ku())),this.chart.us.bs(),this}getStrokeStyle(){return this.pm.ku()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.pm.setVisible(t),!1===t&&(this.vm.Zp(),this.Sm.Zp()),this.fm.bs(),this}vA(){return this.chart.getSeries()}xm(t){return Math.abs(this.dt.tt(t)*this.At.bm(1))}_r(t,e,i){const s=Math.abs(this.dt.tt(e-t)*this.At.bm(1));return{min:t-i*s,max:e+i*s}}ar(t,e){return new Vh(e,t,this.fm,this.Am,this.At)}lr(t,e){const i=this.Mm(e,t.S,t.Sh.nr.tickLength,t.Sh.nr.tickPadding);return t.Ye.Ie(i.labelPosition).Ja(i.labelAlignment),i}Mm(t,e,i,s){const{wuSize:n,start:r,end:o,tickDirection3D:a,tickDirection2D:h}=t,l=(e-this.dt.getInnerStart())/(this.dt.getInnerEnd()-this.dt.getInnerStart()),c=Ie.addVec(Xe(r,o,l),Ie.multiplyVec(Ie.multiply(a,this.At.bm(.5*this.pm.ku().getThickness())),n)),d=Ie.addVec(c,Ie.multiplyVec(Ie.multiply(a,this.At.bm(i)),n)),f=this.At._m(d)||u(0,0);return{labelPosition:ni(ut(f,this.chart.engine.scale,this.Am),si(h,s)),labelAlignment:{x:-h.x,y:-h.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}bA(t,e,i){const{wuSize:s,start:n,end:r,tickDirection3D:o}=e,a=(t-this.dt.getInnerStart())/(this.dt.getInnerEnd()-this.dt.getInnerStart()),h=Ie.addVec(Xe(n,r,a),Ie.multiplyVec(Ie.multiply(o,this.At.bm(.5*this.pm.ku().getThickness())),s)),l=Ie.addVec(h,Ie.multiplyVec(Ie.multiply(o,this.At.bm(10)),s)),c=this.At._m(h)||u(0,0),d=this.At._m(l)||u(0,0);return this.fm.Ve(this.Am).Oe(c).ze(d).Ee(new qi({fillStyle:new U({color:E(120*i)}),thickness:1}))}br(t,e){return Bh(t,e,this.dt)}Fe(t){if(!this.Xi)return;const e=Math.min(this.Th,this.Fh),i=Math.max(this.Th,this.Fh),s=this.gm,n=f(s.x.et(),s.y.et(),s.z.et());let r,o;this.wm()?(r=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerStart()),o=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerEnd())):(r=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),o=this.Mh.Cm(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),r));const a=this.Mh.xd,h=this.At._m(r)||u(0,0),l=this.At._m(o)||u(0,0),c=Xe(r,o,.5),d=Ie.addVec(c,Ie.multiplyVec(Ie.multiply(a,-1),n)),g=this.At._m(c)||u(0,0),m=this.At._m(d)||u(0,0),p=ti(ri(ut(g,this.chart.engine.scale,this.Am),ut(m,this.chart.engine.scale,this.Am)));this.pm.Nt()._l([r,o]);const{gridlinePositionA:y,gridlinePositionB:A,gridlinePositionC:x}=this.Mh.km(t),S=t=>({x:-1===t.x?this.gm.x.getInnerStart():1===t.x?this.gm.x.getInnerEnd():0,y:-1===t.y?this.gm.y.getInnerStart():1===t.y?this.gm.y.getInnerEnd():0,z:-1===t.z?this.gm.z.getInnerStart():1===t.z?this.gm.z.getInnerEnd():0}),b=S(y),v=S(A),M=S(x),T={physicalAxisSize:ii(ri(h,l)),wuSize:n,start:r,end:o,tickDirection3D:a,tickDirection2D:p,gridlinePositionA:b,gridlinePositionB:v,gridlinePositionC:M},w=this.Jh(T),E=this.vm.Xp();for(const[t,e]of this.Ze)for(const[,i]of e){const e=w.get(i);if(!e)continue;const s=this.Tm(T,e);E.add({ia:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.nr.tickStyle}),s.gridStroke&&E.add({ia:0,positions:s.gridStroke},{lineStyle:t.nr.gridStrokeStyle})}const k=this.Sm.Xp(),C={x:0,y:0};this.Td.forEach((t=>{if(!t.Xi||t.Si)return;const s=this.Mm(T,t.S,t.sm,t.rm),n=this.Tm(T,s),r=k.add().Ie(s.labelPosition).Ja(s.labelAlignment).ke(t.Rg).Vh(t.nm).Bh(t.gc(t.S)).zh(t.qc).Ds().oi();C.x=Math.max(C.x,r.x),C.y=Math.max(C.y,r.y),E.add({ia:0,positions:[n.tickStroke.start,n.tickStroke.end]},{lineStyle:t.im}),n.gridStroke&&E.add({ia:0,positions:n.gridStroke},{lineStyle:t.hm})})),k.finishPlot(),E.finishPlot();const D=this.dr(((t,e)=>{const i=e.Ye.oi();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:C.x,y:C.y}),I=Math.atan((l.y-h.y)/(l.x-h.x));this.Dh.Ja({x:0,y:0}).zh(180*-I/Math.PI);const _=Ie.addVec(c,Ie.multiplyVec(Ie.multiply(a,this.At.bm(.5*this.pm.ku().getThickness()+this.gr(((t,e)=>Math.max(t,e.tickLength)),0))),n)),F=this.At._m(_)||u(0,0),L=ni(ut(F,this.chart.engine.scale,this.Am),ni(ni(oi(D,p),si(p,this.gr(((t,e)=>Math.max(t,e.labelPadding)),0))),oi(si(this.Dh.Ds().oi(),.5),p)));this.Dh.Ie(L),this.pm.Fm={overrideFollowing:!1,skipMousePicking:!1}}Tm(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:n}=t,r=e.posTickStart3D,o=e.posTickEnd3D,a=e.tickPositionRelative;let h;return Et(a,0)||Et(a,1)||(h=[this.Im()?{...i,x:r.x}:this.Pm()?{...i,y:r.y}:this.wm()?{...i,z:r.z}:{x:0,y:0,z:0},this.Im()?{...s,x:r.x}:this.Pm()?{...s,y:r.y}:this.wm()?{...s,z:r.z}:{x:0,y:0,z:0},this.Im()?{...n,x:r.x}:this.Pm()?{...n,y:r.y}:this.wm()?{...n,z:r.z}:{x:0,y:0,z:0}]),{gridStroke:h,tickStroke:{start:r,end:o}}}Gh(){super.Gh(),this.vm.Zp(),this.Sm.Zp()}Im(){return this.Mh.Im()}Pm(){return this.Mh.Pm()}wm(){return this.Mh.wm()}}class Vh extends Js{constructor(t,e,i,s,n,r){super(t,e,i,s,r),this.Md=n}}const Bh=(t,e,i)=>kt(t+.1*(e-t)+Math.abs(i.et())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),Oh=(t,e,i,s)=>({pr:()=>{const i=t();let s;for(const t of i){if(!t.Dm())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},mr:()=>{const e=t();let s;for(const t of e){if(!t.Dm())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Sr:()=>{const e=t();let i;for(const t of e){if(!t.Dm())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),Nh=t=>({...Oh(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Sr().y)),om:t=>t.y,Cm:(t,e)=>({x:e.x,y:t.y,z:e.z}),xd: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)}},Im:()=>!1,Pm:()=>!0,wm:()=>!1}),Uh=t=>({...Oh(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Sr().z)),om:t=>t.z,Cm:(t,e)=>({x:e.x,y:e.y,z:t.z}),xd: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)}},Im:()=>!1,Pm:()=>!1,wm:()=>!0});class Gh extends Ui{constructor(t,e,i,s,n){super(t,e,s,n),this.Bm=Gr,this.Lm=!0,this.Rm=!0,this.Ji=t,this.At=i,this.ts=new Map,this.onMouseWheel(this.Ji.Em),this.onMouseDrag(this.Ji.Vm),this.onTouchStart(this.Ji.zm.onTouchStart),this.onTouchMove(this.Ji.zm.onTouchMove),this.onTouchEnd(this.Ji.zm.onTouchEnd)}setAutoScrollingEnabled(t){return this.Lm=t,this.Ji.us.bs(),this}getAutoScrollingEnabled(){return this.Lm}setColorShadingStyle(t){return this.Bm=t,this.ts.forEach(((e,i)=>i.Om(t))),this.At.bs(),this}getColorShadingStyle(){return this.Bm}setDepthTestEnabled(t){return this.Rm=t,this.ts.forEach(((e,i)=>i.Nm(t))),this.At.bs(),this}getDepthTestEnabled(){return this.Rm}Gm(){}Fe(){}$p(){}getXMax(){const t=this.el;return t?t.xt():void 0}getXMin(){const t=this.el;return t?t.vt():void 0}getYMax(){const t=this.el;return t?t.Mt():void 0}getYMin(){const t=this.el;return t?t.bt():void 0}getZMax(){const t=this.el;return t?t.Wm():void 0}getZMin(){const t=this.el;return t?t.Um():void 0}Sr(){const t=this.el;return t?f(t.Vl(),t.zl(),t.Ym()):f(0,0,0)}}class Wh extends Gh{constructor(t,e,i,s,n,r){super(t,e,i,s,r),this._s="Box Series 3D",this.Hm=.25,this.$m=!1,this.ld=()=>he(this.be),this.be=ce(this.qi.boxSeries3DFillStyle,n),this.el=this.At.jm().Nm(this.Rm).ke(this.be).Xm(this.Hm).cs(this.getHighlight()),this.gs(this.el)}invalidateData(t){const e=t.length;if(0===e)return this;this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));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;ihe(this.Cu.getFillStyle())}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;return this.el.Ee(e),this.At.bs(),this}getStrokeStyle(){return this.Cu}add(t){return this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.$m=!0,(t=Array.isArray(t)?t:[t])?(this.el._l(t.slice()),this.At.bs(),this):this}clear(){return this.el.Nt(),this}getPointAmount(){const t=this.el;return t.wl()+t.Cl()}Dm(){return this.Lm&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.cs(e),this.At.bs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{stroke:this.Cu}),this}}class Hh extends Yh{constructor(t,e,i,s,n,r){super(t,e,i,s,r),this._s="Line Series 3D",this.Cu=ce(s.lineSeries3DStrokeStyle,n),this.Qm=Tn.pointStyle3D,this.Jm(this.Cu),this.el=this.At.zp([kh.UserSeries]).Nm(this.Rm).Ee(this.Cu).ym(this.Qm).cs(this.getHighlight()),this.gs(this.el)}setStrokeStyle(t){super.setStrokeStyle(t),this.Jm(this.Cu);const e=this.Qm;return this.el.ym(e),this}Jm(t){const e=new fn.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.Qm=e}}class Xh extends Yh{constructor(t,e,i,s,n,r){super(t,e,i,s,r),this._s="Point Line Series 3D",this.ld=()=>he(this.Cu.getFillStyle())||he(this.Qm.getFillStyle()),this.Qm=ce(s.pointLineSeries3DPointStyle,n),this.Cu=ce(s.lineSeries3DStrokeStyle,n),this.Km(),this.el=this.At.zp([kh.UserSeries]).Nm(this.Rm).Ee(this.Cu).ym(this.Qm).cs(this.getHighlight()),this.gs(this.el)}setPointStyle(t){return this.Qm="function"==typeof t?t(this.Qm):t,this.Km(),this.el.ym(this.Qm),this.At.bs(),this}getPointStyle(){return this.Qm}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.Cu,i=Math.abs(e.getThickness()),s=this.Qm;i>s.getSize()&&(this.Qm=s.setSize(i)),this.Km();const n=this.Qm;return this.el.ym(n),this.At.bs(),this}Km(){const t=this.Qm,e=t.getSize();this.Qm=t.setSize(e)}Pe(t,e){t.cs(e),this.At.bs()}}class jh extends Gh{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.$m=!1,((null==r?void 0:r.individualPointSizeAxisEnabled)||(null==r?void 0:r.individualPointSizeEnabled))&&this.ds((t=>t.Vn||t.zn||t.ro?void 0:"bubble chart"))}add(t){return this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.$m=!0,(t=Array.isArray(t)?t:[t])?(this.el._l(t.slice()),this.At.bs(),this):this}clear(){return this.el.Nt(),this}getPointAmount(){const t=this.el;return t.wl()+t.Cl()}Dm(){return this.Lm&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.cs(e),this.At.bs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{point3D:this.qm}),this}}class $h extends jh{constructor(t,e,i,s,n,r){super(t,e,i,s,n,r),this._s="Point Series 3D",this.ld=()=>he(this.qm.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.Ji.getSeries().length;this.qm=ce(s.pointSeries3DPointStyle,o);const a={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...r};this.el=this.At.Oc(a).Nm(this.Rm).ty(this.qm).cs(this.getHighlight()),this.gs(this.el)}setPointStyle(t){this.qm="function"==typeof t?t(this.qm):t;const e=this.qm;return this.el.ty(e),this.At.bs(),this}getPointStyle(){return this.qm}}class qh extends jh{constructor(t,e,i,s,n,r){super(t,e,i,s,n,r),this._s="Point Cloud Series 3D",this.ld=()=>he(this.qm.getFillStyle());const o=this.Ji.getSeries().length;this.qm=ce(s.pointCloudSeries3DPointStyle,o);const a={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...r};this.el=this.At.Oc(a).ty(this.qm).cs(this.getHighlight()),this.gs(this.el)}setPointStyle(t){this.qm="function"==typeof t?t(this.qm):t;const e=this.qm;return this.el.ty(e),this.At.bs(),this}getPointStyle(){return this.qm}}const Jh={Triangulated:$h,Pixelated:qh};class Kh extends Ga{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,i,s,n,r,o,a,h,l),this.iy=[],this.sy=0,this.ey=t=>{const e=this.iy.indexOf(t);e>=0&&(this.iy.splice(e,1),this.D.emit("seriesDispose",this,t))},this.hy=()=>{this.sy+=1},this.ny=()=>{this.sy-=1},this.onSeriesBackgroundMouseEnter=t=>this.D.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.D.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.D.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.D.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.D.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.D.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.D.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.D.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.D.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.D.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.D.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.D.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.D.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.D.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.D.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.D.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.D.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.D.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.D.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.D.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.D.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.D.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.D.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.D.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.D.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.D.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.D.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.D.off(t,"touchEndSeriesBackground"),this.oy=this.es.gA()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.iy.forEach((e=>e.setAnimationHighlight(t))),this}ly(t,e){this.oy.ps([e]),t.setMouseMoveEventHandler(((t,e)=>{this.D.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.D.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.D.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.D.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.D.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.D.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.D.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.D.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.D.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,n)=>this.D.emit("mouseDragSeriesBackground",this,e,i,s,n))).setMouseDragStopEventHandler(((t,e,i,s)=>this.D.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.D.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.D.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.D.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.uy.ke(t),this.us.bs(),this}getSeriesBackgroundFillStyle(){return this.uy.Lh()}setSeriesBackgroundStrokeStyle(t){return this.Ay.Ce(t),this.us.bs(),this}getSeriesBackgroundStrokeStyle(){return this.Ay._o()}setSeriesBackgroundEffect(t){return this.oy.xs(t),this.us.bs(),this}getSeriesBackgroundEffect(){return this.oy.Ms()}gy(t){this.iy.push(t),t.onMouseEnter(this.hy),t.onMouseLeave(this.ny),void 0!==this.py&&t.setHighlightOnHover(this.py),this.D.emit("seriesAdded",this,t)}Sd(){return this.iy}my(){return this.sy}setSeriesHighlightOnHover(t){return this.py=t,this.iy.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.iy.slice().forEach(Tt),super.dispose()}yy(t){return this.D.on("seriesAdded",t)}Sy(t){return this.D.off(t)}vy(t){return this.D.on("seriesDispose",t)}xy(t){return this.D.off(t)}}const Zh=Ie.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class Qh{constructor(t,e,i,s){this.by=!0,this.My=!0,this._y=2*-Math.PI/2160,this.wy=2*Math.PI/2160,this.Cy=.1,this.ky=1*Math.PI/180,this.Ty=t,this.Fy=e,this.Iy=i,this._m=s}getDefaultCameraConfiguration(t){const e={direction:Zh,location:Ie.multiply(Zh,-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.Py(i,t):"wheel-zoom"===t.type?i=this.Dy(i,t):"rotate+zoom"===t.type?i=this.By(i,t):"fixed-rotate"===t.type?i=this.Ly(i,t):"move"===t.type&&(i=this.Ry(i,t))})),this.by?i=this.Ey(t.boundingBox,i):this.My&&(i=this.Vy(t.boundingBox,i)),i}Py(t,e){const{rotation:i}=e,s=t.location,n=Ie.multiply(Ie.normalize(t.location),-1),{Right:r,Up:o}=this.zy(n);let a=s;const h=this.Oy(n),l=i.x*this._y*h;a=Ie.rotateAroundAxis(a,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.wy,h-this.ky);return 0!==u&&(a=Ie.rotateAroundAxis(a,r,u)),{location:a,direction:Ie.multiply(Ie.normalize(a),-1)}}Dy(t,e){const{deltaY:i}=e;this.by&&this.Ny(!1);const s=t.location,n=Ie.multiply(Ie.normalize(s),-1),r=i*this.Cy,o=Ie.length(s)*-r;return{direction:n,location:Ie.addVec(s,Ie.multiply(n,o))}}By(t,e){const{rotation:i,cameraDistance:s}=e;this.by&&this.Ny(!1);let n=this.Py(t,{type:"rotate",rotation:i});const r=n.location,o=Ie.multiply(Ie.normalize(r),-1),a=Ie.multiply(o,-s);return n={direction:Ie.multiply(Ie.normalize(a),-1),location:a},n}Ly(t,e){this.by&&this.Ny(!1);const{rotation:i}=e,s=t.location,n=t.direction,{Right:r,Up:o}=this.zy(n),a=i.x*this._y;let h=Ie.normalize(Ie.rotateAroundAxis(n,o,a));const l=i.y*this.wy;return h=Ie.normalize(Ie.rotateAroundAxis(h,r,l)),{location:s,direction:h}}Ry(t,e){this.by&&this.Ny(!1),this.My=!1;const{amountRight:i,amountForward:s}=e,n=t.location,r=t.direction,{Right:o}=this.zy(r);return{location:Ie.addVec(n,Ie.multiply(r,.01*s),Ie.multiply(o,.01*i)),direction:r}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:Ie.multiply(Ie.normalize(t.cameraLocation),-1)};return this.by?this.Ey(t.boundingBox,e):this.Vy(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:Ie.multiply(Ie.normalize(t.cameraLocation),-1)};return this.by?this.Ey(t.boundingBox,e):this.Vy(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:Ie.multiply(Ie.normalize(t.cameraLocation),-1)};if(this.by)return this.Ey(t.boundingBox,e)}Ey(t,e,i){let s=e;i=void 0!==i?i:0,s=this.Gy(t,s,100,20,1,i,5);const n=this.Oy(s.direction);return s=this.Wy(s,this.Uy(t,s,100,1),n),s}Gy(t,e,i,s,n,r,o){return tl(r,o,(t=>({direction:e.direction,location:Ie.multiply(e.direction,-t)})),(e=>this.Yy(t,e)),i,n,"linear",s)}Uy(t,e,i,s){const{Right:n,Left:r,Up:o,Down:a}=this.zy(e.direction),h=this.Hy(t,!1,e);let l=e;const u=s,c=.1;return Math.abs(h.bottom-h.top)>u&&(l=h.bottom({location:l.location,direction:Ie.normalize(Ie.lerp(l.direction,a,t))})),(e=>this.$y(t,e)),0,u,!0,i):el(0,c,(t=>({location:l.location,direction:Ie.normalize(Ie.lerp(l.direction,o,t))})),(e=>this.$y(t,e)),0,u,!0,i)),Math.abs(h.left-h.right)>u&&(l=h.left({location:l.location,direction:Ie.normalize(Ie.lerp(l.direction,r,t))})),(e=>this.Xy(t,e)),0,u,!0,i):el(0,c,(t=>({location:l.location,direction:Ie.normalize(Ie.lerp(l.direction,n,t))})),(e=>this.Xy(t,e)),0,u,!0,i)),l}Yy(t,e){const i=this.Hy(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}Xy(t,e){const i=this.Hy(t,!1,e);return Math.abs(i.left-i.right)}$y(t,e){const i=this.Hy(t,!1,e);return Math.abs(i.top-i.bottom)}Hy(t,e,i){const s=je(this.jy(t,e,i).map((t=>ut(t,this.Ty,this.Fy))));return{left:s.min.x,right:this.Fy.x.getInnerEnd()-s.max.x,top:this.Fy.y.getInnerEnd()-s.max.y,bottom:s.min.y}}jy(t,e,i){const s=this.Iy,n=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),r=f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),o=[],a=e?16:4,h=(n.x+r.x)/2,l=(n.z+r.z)/2,u=Math.sqrt(2)*(r.x-h),c=Math.sqrt(2)*(r.z-l);return[n.y,r.y].forEach((t=>{for(let e=0;ethis._m(t,i))).filter((t=>void 0!==t))}Vy(t,e){const i=Ie.length(e.location),s=this.Zy(t);return i{let h,l=0,u=(e+t)/2;do{const a=i(u);if(h={value:u,result:a,score:s(a)},Math.abs(h.score-n)<=r)break;const c=h.score>n;c&&"linear"===o||!c&&"reversed"===o?(u=(h.value+t)/2,e=h.value):(u=(h.value+e)/2,t=h.value),l+=1}while(l{let h,l=0,u=t;do{const c=i(u),d=s(c);if(void 0===h||Math.abs(d-n)he(this.be),this.Bm=Nr;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ji.getSeries().length;this.be=ce(this.qi.surfaceGridSeries3DFillStyle,o),this.Ky=ce(this.qi.surfaceGridSeries3DWireframeStyle,o);const a={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.En=a,this.el=this.At.tS(a).ke(this.be).qy(this.Ky).Om(this.Bm).cs(this.getHighlight()),this.gs(this.el),s.start&&this.setStart(s.start),s.end&&this.setEnd(s.end),s.step&&this.setStep(s.step)}iS(){const t=this.Jy.start||{x:0,z:0};let e;e=this.Jy.end?{x:(this.Jy.end.x-t.x)/this.En.columns,z:(this.Jy.end.z-t.z)/this.En.rows}:this.Jy.step?this.Jy.step:{x:1,z:1},this.el.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.el.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.el.eS().step}setEnd(t){return this.Jy.end=t,this.iS(),this}getEnd(){return this.el.eS().end}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.el.ke(this.be),this.At.bs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.el.qy(this.Ky),this.At.bs(),this}getWireframeStyle(){return this.el.hS()}setIntensityInterpolation(t){return t=t||"disabled",this.el.rS(t),this.At.bs(),this}getIntensityInterpolation(){return this.el.nS()}invalidateIntensityValues(t){if(this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),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.En.dataOrder?t.length:t[0].length,rows:"rows"===this.En.dataOrder?t.length:t[0].length},i="columns"===this.En.dataOrder?this.En.columns:this.En.rows,s="columns"===this.En.dataOrder?this.En.rows:this.En.columns;if(e.x>i||e.y>s){if(!0===this.Ji.fs.oo){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.En.columns}x${this.En.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const n=[];for(let e=0;eo||r>a){if(!0===this.Ji.fs.oo){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.En.columns}x${this.En.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.`;St.console.warn(i)}const h=Math.max(-i,0),l=Math.max(-n,0),u=Math.max(s-o,0),c=Math.max(r-a,0),d=e.primary-(h+u),f=[];if(0===l&&0===c)for(let e=0;et.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),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.En.dataOrder?t.length:t[0].length,rows:"rows"===this.En.dataOrder?t.length:t[0].length},i="columns"===this.En.dataOrder?this.En.columns:this.En.rows,s="columns"===this.En.dataOrder?this.En.rows:this.En.columns;if(e.x>i||e.y>s){if(!0===this.Ji.fs.oo){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.En.columns}x${this.En.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const n=[];for(let e=0;eo||r>a){if(!0===this.Ji.fs.oo){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.En.columns}x${this.En.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.`;St.console.warn(i)}const h=Math.max(-i,0),l=Math.max(-n,0),u=Math.max(s-o,0),c=Math.max(r-a,0),d=e.primary-(h+u),f=[];if(0===l&&0===c)for(let e=0;ehe(this.be),this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.Bm=Nr;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ji.getSeries().length;this.be=ce(this.qi.surfaceScrollingGridSeries3DFillStyle,o),this.Ky=ce(this.qi.surfaceScrollingGridSeries3DWireframeStyle,o);const a={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.En=a,this.el=this.At.cS(a).ke(this.be).qy(this.Ky).Om(this.Bm).cs(this.getHighlight()),this.gs(this.el),s.start&&this.setStart(s.start),s.step&&this.setStep(s.step)}iS(){const t=this.Jy.start||{x:0,z:0};let e;e=this.Jy.step?this.Jy.step:{x:1,z:1},this.el.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.el.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.el.eS().step}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.el.ke(this.be),this.At.bs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.el.qy(this.Ky),this.At.bs(),this}getWireframeStyle(){return this.el.hS()}setIntensityInterpolation(t){return t=t||"disabled",this.el.rS(t),this.At.bs(),this}getIntensityInterpolation(){return this.el.nS()}clear(){return this.el.Nt(),this.At.bs(),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.En.scrollDimension?this.En.rows:this.En.columns;if(i>s-1){if(!0===this.Ji.fs.oo){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.En.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.Ji.fs.oo){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.En.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.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,n=e?e[0].length:null==i?void 0:i[0].length;return this.el.dS({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:n,heightMapValues:e,intensityValues:i}),this.At.bs(),this}setCullMode(t){return this.el.lS("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.el.uS()}Gm(){}Fe(){}$p(){}Dm(){return this.Lm&&this.getVisible()}Pe(t,e){t.cs(e),this.At.bs()}}const nl=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof hl),rl=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),ol={translation:(t,e,i)=>[1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1],xRotation(t){const e=Math.cos(t),i=Math.sin(t);return[1,0,0,0,0,e,i,0,0,-i,e,0,0,0,0,1]},yRotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,0,-i,0,0,1,0,0,i,0,e,0,0,0,0,1]},zRotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,i,0,0,-i,e,0,0,0,0,1,0,0,0,0,1]},scaling:(t,e,i)=>[t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1],translate:(t,e,i,s)=>ol.multiply(t,ol.translation(e,i,s)),xRotate:(t,e)=>ol.multiply(t,ol.xRotation(e)),yRotate:(t,e)=>ol.multiply(t,ol.yRotation(e)),zRotate:(t,e)=>ol.multiply(t,ol.zRotation(e)),rotateXYZ(t,e){let i=ol.xRotate(t,e.x);return i=ol.yRotate(i,e.y),i=ol.zRotate(i,e.z),i},scale:(t,e,i,s)=>ol.multiply(t,ol.scaling(e,i,s)),multiply(t,e){const i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],g=e[12],m=e[13],p=e[14],y=e[15],A=t[0],x=t[1],S=t[2],b=t[3],v=t[4],M=t[5],T=t[6],w=t[7],E=t[8],k=t[9],C=t[10],D=t[11],I=t[12],_=t[13],F=t[14],L=t[15],z=[];return z[0]=i*A+s*v+n*E+r*I,z[1]=i*x+s*M+n*k+r*_,z[2]=i*S+s*T+n*C+r*F,z[3]=i*b+s*w+n*D+r*L,z[4]=o*A+a*v+h*E+l*I,z[5]=o*x+a*M+h*k+l*_,z[6]=o*S+a*T+h*C+l*F,z[7]=o*b+a*w+h*D+l*L,z[8]=u*A+c*v+d*E+f*I,z[9]=u*x+c*M+d*k+f*_,z[10]=u*S+c*T+d*C+f*F,z[11]=u*b+c*w+d*D+f*L,z[12]=g*A+m*v+p*E+y*I,z[13]=g*x+m*M+p*k+y*_,z[14]=g*S+m*T+p*C+y*F,z[15]=g*b+m*w+p*D+y*L,z},inverse(t){const e=[],i=t[0],s=t[1],n=t[2],r=t[3],o=t[4],a=t[5],h=t[6],l=t[7],u=t[8],c=t[9],d=t[10],f=t[11],g=t[12],m=t[13],p=t[14],y=t[15],A=d*y,x=p*f,S=h*y,b=p*l,v=h*f,M=d*l,T=n*y,w=p*r,E=n*f,k=d*r,C=n*l,D=h*r,I=u*m,_=g*c,F=o*m,L=g*a,z=o*c,P=u*a,R=i*m,V=g*s,B=i*c,O=u*s,N=i*a,U=o*s,G=A*a+b*c+v*m-(x*a+S*c+M*m),W=x*s+T*c+k*m-(A*s+w*c+E*m),Y=S*s+w*a+C*m-(b*s+T*a+D*m),H=M*s+E*a+D*c-(v*s+k*a+C*c),X=1/(i*G+o*W+u*Y+g*H);return e[0]=X*G,e[1]=X*W,e[2]=X*Y,e[3]=X*H,e[4]=X*(x*o+S*u+M*g-(A*o+b*u+v*g)),e[5]=X*(A*i+w*u+E*g-(x*i+T*u+k*g)),e[6]=X*(b*i+T*o+D*g-(S*i+w*o+C*g)),e[7]=X*(v*i+k*o+C*u-(M*i+E*o+D*u)),e[8]=X*(I*l+L*f+z*y-(_*l+F*f+P*y)),e[9]=X*(_*r+R*f+O*y-(I*r+V*f+B*y)),e[10]=X*(F*r+V*l+N*y-(L*r+R*l+U*y)),e[11]=X*(P*r+B*l+U*f-(z*r+O*l+N*f)),e[12]=X*(F*d+P*p+_*h-(z*p+I*h+L*d)),e[13]=X*(B*p+I*n+V*d-(R*d+O*p+_*n)),e[14]=X*(R*h+U*p+L*n-(N*p+F*n+V*h)),e[15]=X*(N*d+z*n+O*h-(B*h+U*d+P*n)),e},projectionPerspective(t,e,i,s){const n=1/Math.tan(t*Math.PI/180/2),r=1/(i-s);return[n/e,0,0,0,0,n,0,0,0,0,(i+s)*r,-1,0,0,i*s*r*2,0]},projectionOrthographic:(t,e,i,s,n,r)=>[2/(e-t),0,0,-(e+t)/(e-t),0,2/(s-i),0,-(s+i)/(s-i),0,0,-2/(r-n),-(r+n)/(r-n),0,0,0,1]};class al extends Gh{constructor(t,e,i,s,n,r){super(t,e,i,s,r),this._s="Mesh Model 3D",this.fS=new Float32Array,this.dt={x:1,y:1,z:1},this.AS={x:0,y:0,z:0},this.gS={x:0,y:0,z:0},this.pS={x:0,y:0,z:0},this.mS={x:0,y:0,z:0},this.ol=ze,this.ld=()=>he(this.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.Ji.getSeries().length;this.el=this.At.yS().Nm(this.Rm).ke(ce(this.qi.meshModel3DFillStyle||this.qi.pointSeriesFillStyle,o)).cs(this.getHighlight()),this.gs(this.el)}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let n=Fe,r=_e,o=Fe,a=_e,h=Fe,l=_e;for(let t=0;t{const t=this.At.RS();this.VS.ES(t),this.zS.ES(t);const e=this.OS.viewportChanged(this.NS());e&&this.GS(e),this.us.bs()},this.Vm=(t,e,i,s,n)=>{if(this.BS){const t=n;this.FS.push({type:"rotate",rotation:t}),this.us.bs(),jt(e)}},this.Em=(t,e)=>{if(this.DS){if(this.PS)Math.sign(this.LS)!==Math.sign(e.deltaY)?this.LS=de(e):this.LS+=de(e);else{const t=de(e);this.FS.push({type:"wheel-zoom",deltaY:t})}this.us.bs(),jt(e)}},this.fs.zn||this.fs.Vn||this.fs.Zn||this.us.As(1),this.ng.Bh("Chart3D"),this.WS=i.d3(),this.WS.x.J(-1,1),this.WS.y.J(-1,1),this.WS.z.J(-1,1),this.At=e.US("chart3D layer3D",0,this.WS),this.VS=e.YS("chart3D series bg",0),this.zS=e.wp("chart3D axis ui",1),this.HS={x:new Rh(this,(a=()=>this.iy,{...Oh(a,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Sr().x)),om:t=>t.x,Cm:(t,e)=>({x:t.x,y:e.y,z:e.z}),xd: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)}},Im:()=>!0,Pm:()=>!1,wm:()=>!1}),this.WS.x,this.qi,this.At,this.zS,this.pixelScale,!1,this.es),y:new Rh(this,Nh((()=>this.iy)),this.WS.y,this.qi,this.At,this.zS,this.pixelScale,!1,this.es),z:new Rh(this,Uh((()=>this.iy)),this.WS.z,this.qi,this.At,this.zS,this.pixelScale,!1,this.es)},this.$S=this.At.zp([kh.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.qi.chart3DBoundingBoxStrokeStyle),this.uy=this.VS.vc(this.engine.scale,rr.Simple).ke(this.qi.chart3DSeriesBackgroundFillStyle).Ce(nt).setMouseInteractions(!0),this.Ay=this.VS.vc(this.engine.scale,rr.Simple).ke(V).Ce(this.qi.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.ly(this.uy,this.Ay),this.XS({x:1,y:1,z:1},!0),this.OS=new Qh(this.engine.scale,this.pixelScale,this.WS,((t,e)=>(e&&this.GS(e),this.At._m(t)))),this.jS=this.OS.getDefaultCameraConfiguration(this.ZS(this.QS)),this.GS(this.jS),this.zm=Yi(new ji(((t,e,i)=>{h={locationOne:e,locationTwo:i,cameraLocation:this.At.getCameraLocation()}}),((t,e,i,s,n,r)=>{if(!this.BS&&!this.DS)return;const o=(h.locationOne.x-h.locationTwo.x)**2+(h.locationOne.y-h.locationTwo.y)**2,a=(e.x-i.x)**2+(e.y-i.y)**2,l=Ie.length(h.cameraLocation),c=o/a*l,d=u((s.x+n.x)/2,(s.y+n.y)/2);this.FS.push({type:"rotate+zoom",rotation:this.BS?d:{x:0,y:0},cameraDistance:this.DS?c:l}),this.us.bs(),jt(r)}),(t=>{})),new Xi((t=>{}),((t,e,i,s,n)=>{if(this.BS){const t=s;this.FS.push({type:"rotate",rotation:t}),this.us.bs(),jt(n)}}),(t=>{}))),this.onBackgroundTouchStart(this.zm.onTouchStart),this.onBackgroundTouchMove(this.zm.onTouchMove),this.onBackgroundTouchEnd(this.zm.onTouchEnd),this.onSeriesBackgroundTouchStart(this.zm.onTouchStart),this.onSeriesBackgroundTouchMove(this.zm.onTouchMove),this.onSeriesBackgroundTouchEnd(this.zm.onTouchEnd),this.onBackgroundMouseDrag(this.Vm),this.onBackgroundMouseWheel(this.Em),this.onBackgroundMouseDown(((t,e)=>{jt(e)})),this.onSeriesBackgroundMouseDrag(this.Vm),this.onSeriesBackgroundMouseWheel(this.Em),this.onSeriesBackgroundMouseDown(((t,e)=>{jt(e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.nn),this.nn(),this.ig(n,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||$h)(this,this.ey,this.At,this.qi,this.us.es,t);return this.gy(e),e}addLineSeries(t){const e=new Hh(this,this.ey,this.At,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPointLineSeries(t){const e=new Xh(this,this.ey,this.At,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addSurfaceGridSeries(t){const e=new il(this,this.ey,this.At,t,this.qi,this.us.es);return this.gy(e),e}addSurfaceScrollingGridSeries(t){const e=new sl(this,this.ey,this.At,t,this.qi,this.us.es);return this.gy(e),e}addBoxSeries(t){const e=new Wh(this,this.ey,this.At,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addMeshModel(t){const e=new al(this,this.ey,this.At,this.qi,t,this.us.es);return this.gy(e),e}translateCoordinate(t,e,i){if(nl(e)||nl(i)||rl(t)){if(nl(e)&&nl(i)&&rl(t)){if("axes"===e.id&&"world"===i.id)return this.At.ft(t);if("world"===e.id&&"axes"===i.id)return this.At.yt(t);if(e.id===i.id)return t}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return Va(t,e,i,this.pixelScale,this.us)}getDefaultAxisX(){return this.HS.x}getDefaultAxisY(){return this.HS.y}getDefaultAxisZ(){return this.HS.z}getDefaultAxes(){return[this.HS.x,this.HS.y,this.HS.z]}setCameraLocation(t){let e={location:t,direction:Ie.normalize(Ie.multiply(t,-1))};const i=this.OS.cameraLocationChanged(this.NS(e));return i&&(e=i),this.GS(e),this.us.bs(),this}getCameraLocation(){return this.At.getCameraLocation()}getCameraDirection(){return this.At.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.OS.Ny(t);const e=this.OS.cameraLocationChanged(this.NS());return e&&this.GS(e),this}getCameraAutomaticFittingEnabled(){return this.OS.Qy()}onCameraChange(t){return this.D.on("cameraChange",t)}offCameraChange(t){return this.D.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.$S.Ee(t).ym(Fh(this.$S.ku())),this.At.bs(),this}getBoundingBoxStrokeStyle(){return this.$S.ku()}setBoundingBox(t){return this.XS(t,!1),this}XS(t,e){this.QS=t;const i=this.ZS(t);if(this.WS.x.q(i.x),this.WS.y.q(i.y),this.WS.z.q(-i.z),!e){const t=this.OS.boundingBoxChanged(this.NS());t&&this.GS(t)}this.us.bs()}getBoundingBox(){return this.QS}Fe(t){if(Wa.cg(this.ng,this.eg),0!==this.LS){const e=this.LS*t*.006;this.FS.push({type:"wheel-zoom",deltaY:e}),this.LS=Math.sign(this.LS)*Math.max(Math.abs(this.LS)-.01*t,0),0!==this.LS&&this.us.bs(!0)}const e=this.getCameraDirection();if(this.FS.length>0){const t=this.OS.applyCameraInteractions(this.NS(),this.FS);t&&this.GS(t),this.FS.length=0}this.JS&&Ie.equals(this.JS.location,this.jS.location)&&Ie.equals(this.JS.direction,this.jS.direction)||this.D.emit("cameraChange",this,this.getCameraLocation()),this.JS=this.jS,super.Fe(t);for(let t=0;tthis.At._m(t))),o=this.At._m(f((s.x+n.x)/2,(s.y+n.y)/2,(s.z+n.z)/2)),a=ie(r,o),h=[];for(let t=0;t0?t-1:a.length-1],a[t{t()})),this.tn.length=0,this.WS.W(),this.At.W(),this.zS.W(),this.VS.W(),super.dispose()}j(){return this.WS.x.j(),this.WS.y.j(),this.WS.z.j(),super.j()}Z(){return super.Z()}GS(t){this.At.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(Ie.addVec(t.location,Ie.multiply(t.direction,-this.IS))),this.jS=t,this.us.bs()}ZS(t){return Ie.divide(t,Ie.length(t)/this.TS)}NS(t=this.jS){return{boundingBox:this.ZS(this.QS),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.DS=t,this}getMouseInteractionZoom(){return this.DS}setMouseInteractionRotate(t){return this.BS=t,this}getMouseInteractionRotate(){return this.BS}forEachAxis(t){return t(this.HS.x),t(this.HS.y),t(this.HS.z),this}getSeries(){return this.iy}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.PS=!!t,this}getAnimationZoom(){return this.PS}}const ll={Column:Ao,Row:xo};class ul extends Na{constructor(t,e,i,s,n,r){super(t,e,i,s,n,r),this.KS=new Map,this.qS=this.addUIElement(ll.Row).setPosition({x:0,y:100}).setOrigin(Ts.LeftTop).setBackground((t=>t.setFillStyle(V).setStrokeStyle(nt)))}add(t,e){return(t instanceof Ga?[t]:t instanceof Cf?t.getCells().filter((t=>t.panel instanceof Ga)).map((t=>t.panel)):[]).forEach((t=>{const i=this.qS.addElement(jo.VerticalLegendBox).setBackground((t=>t.setFillStyle(V).setStrokeStyle(nt))).add(t,e).setTitle(t.getTitle());this.KS.set(t,i)})),this.us.bs(),this}setLegendBoxes(t){return this.KS.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.qS.getSize()}}const cl={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},dl=(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(),fl=(t,e)=>{let i=e.geometry;return i=gl(t,e,i),i=ml(t,e,i),i},gl=(t,e,i)=>{if(t===cl.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let n;if(t===cl.USA&&("alaska"===s?n={translate:{x:55,y:-25},scale:{x:.16,y:.16}}:"hawaii"===s&&(n={translate:{x:48,y:7},scale:{x:1,y:1}})),n){const{translate:t,scale:r}=n,o=je(Ct(i)),a=[];for(let e=0;ethis.D.on("mouseEnter",t),this.onMouseLeave=t=>this.D.on("mouseLeave",t),this.onMouseClick=t=>this.D.on("mouseClick",t),this.onMouseDoubleClick=t=>this.D.on("mouseDoubleClick",t),this.onMouseDown=t=>this.D.on("mouseDown",t),this.onMouseUp=t=>this.D.on("mouseUp",t),this.onMouseMove=t=>this.D.on("mouseMove",t),this.offMouseEnter=t=>this.D.off(t,"mouseEnter"),this.offMouseLeave=t=>this.D.off(t,"mouseLeave"),this.offMouseClick=t=>this.D.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.D.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.D.off(t,"mouseDown"),this.offMouseUp=t=>this.D.off(t,"mouseUp"),this.offMouseMove=t=>this.D.off(t,"mouseMove"),this.offMouseDragStart=t=>this.D.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.D.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.D.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.D.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.D.on("mapDataReady",t);return this.av&&St.setTimeout((()=>t())),e},this.onViewChange=t=>this.D.on("viewChange",t),this.lv=(t,e,i,s,n)=>{this.dt.x.q(s).si([this.Xt.left+this.Da.left,this.Xt.right+this.Da.right]),this.dt.y.q(n).si([this.Xt.bottom+this.Da.bottom,this.Xt.top+this.Da.top+Wa.ug(this.ng,this.eg)]),this.uv&&this.cv(this.dv,this.dt,this.uv)},this.wt=(t,i)=>{const s=i;if(!s||!this.av)return;const{iRegion:n,region:r}=this.fv(this.av,s);this.hv!==e.AutoCursorModes.disabled&&(this.Av(r,n),jt(t)),this.nv&&this.us.ls.ws(r,!0),this.gv=r,this.D.emit("mouseEnter",this,t)},this.Ct=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:n}=this.fv(this.av,i);this.pv(n,s),this.nv&&this.us.ls.ws(n,!1),this.gv=void 0,this.D.emit("mouseLeave",this,t),t&&jt(t)},this.Pt=(t,i)=>{const s=i;if(!s||!this.av)return;const{iRegion:n,region:r}=this.fv(this.av,s);this.hv!==e.AutoCursorModes.disabled&&(this.Av(r,n),jt(t)),this.gv=r,this.D.emit("mouseMove",this,t)},this.kt=(t,e)=>this.D.emit("mouseClick",this,t),this.Tt=(t,e)=>this.D.emit("mouseDoubleClick",this,t),this.Ft=(t,e)=>this.D.emit("mouseDown",this,t),this.It=(t,e)=>this.D.emit("mouseUp",this,t),this.Bt=(t,e,i)=>{this.D.emit("mouseDragStart",this,t,e)},this.Dt=(t,e,i,s,n)=>{this.D.emit("mouseDrag",this,t,e,i,s)},this.Lt=(t,e,i,s)=>{this.D.emit("mouseDragStop",this,t,e,i)},this.Rt=(t,e)=>{this.D.emit("mouseWheel",this,t)},this.Et=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:n}=this.fv(this.av,i);this.mv=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Av(n,s),this.nv&&this.us.ls.ws(n,!0),this.gv=n,this.D.emit("touchStart",this,t),jt(t)},this.Vt=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:n}=this.fv(this.av,i);this.mv=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Av(n,s),this.gv=n,this.D.emit("touchMove",this,t),jt(t)},this.zt=(t,e)=>{const i=e;if(!i||!this.av)return;const{iRegion:s,region:n}=this.fv(this.av,i);this.mv=void 0,this.pv(n,s),this.nv&&this.us.ls.ws(n,!1),this.gv=void 0,this.D.emit("touchEnd",this,t),jt(t)},this.fs.zn||this.fs.Vn||this.fs.Jn||this.us.As(3),this.th=!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.yv=i.wp("mapChart plotting",0),this.onResize(this.lv),this.ng.Bh("Map Chart");const h=Dt(o?o.autoCursorBuilder:void 0,fh);this.Sv=h.Xg(i.Tp(),this.dt,this.dt,this.qi).setVisible(!1),this.vv=this.es.gA(),this.ig(r,this.uiScale),this.xv=this.yv.bv(this.dt).setMouseInteractions(this.Yi).setMouseEnterEventHandler(((t,e,i)=>this.wt(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseClickEventHandler(((t,e,i)=>this.kt(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseUpEventHandler(((t,e,i)=>this.It(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.Pt(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Bt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,n,r)=>this.Dt(e,i,s,n,r))).setMouseDragStopEventHandler(((t,e,i,s,n)=>this.Lt(e,i,s,n))).setMouseWheelEventHandler(((t,e,i)=>this.Rt(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Et(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Vt(e,i))).setTouchEndEventHandler(((t,e,i)=>this.zt(e,i))).ke(this.qi.mapChartFillStyle).Ce(this.qi.mapChartStrokeStyle),this.Mv=this.yv.bv(this.dt).setMouseInteractions(this.Yi).ke(this.qi.mapChartOutlierRegionFillStyle).Ce(this.qi.mapChartOutlierRegionStrokeStyle);const l=Dt(o&&o.type,cl.World);this.dv=l,this._v(l).then((()=>{this.D.emit("mapDataReady")}))}getRegionUnderMouse(){return this.gv}setFillStyle(t){return this.xv.ke(t),this.us.bs(),this}getFillStyle(){return this.xv.Lh()}setStrokeStyle(t){return this.xv.Ce(t),this.us.bs(),this}getStrokeStyle(){return this.xv._o()}setEffect(t){return this.vv.xs(t),this.us.bs(),this}getEffect(){return this.vv.Ms()}setOutlierRegionFillStyle(t){return this.Mv.ke(t),this.us.bs(),this}getOutlierRegionFillStyle(){return this.Mv.Lh()}setOutlierRegionStrokeStyle(t){return this.Mv.Ce(t),this.us.bs(),this}getOutlierRegionStrokeStyle(){return this.Mv._o()}setSeparateRegionFillStyle(t){return this.sv="function"==typeof t?t(this.sv):t,this.tv.forEach((t=>t.ke(this.sv))),this.us.bs(),this}getSeparateRegionFillStyle(){return this.sv}setSeparateRegionStrokeStyle(t){return this.ev="function"==typeof t?t(this.ev):t,this.tv.forEach((t=>t.Ce(this.ev))),this.us.bs(),this}getSeparateRegionStrokeStyle(){return this.ev}invalidateRegionValues(t){if(!this.av||!this.wv)return this.Cv=this.Cv||[],this.Cv.push(t),this;if("function"==typeof t)for(let e=0;e{t.kv(n)}))}}else for(const e of t)if(e)for(let t=0;t{t.kv(e.value)}))}}return this.us.bs(),this}setAutoCursor(t){return this.Sv&&t(this.Sv),this.us.bs(),this}getAutoCursor(){return this.Sv}setAutoCursorMode(t){return this.hv=t,this.us.bs(),this}getAutoCursorMode(){return this.hv}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}getCursorResultTableFormatter(){return this.xp}onMouseDragStart(t){return this.D.on("mouseDragStart",t)}onMouseDrag(t){return this.D.on("mouseDrag",t)}onMouseDragStop(t){return this.D.on("mouseDragStop",t)}onMouseWheel(t){return this.D.on("mouseWheel",t)}onTouchStart(t){return this.D.on("touchStart",t)}onTouchMove(t){return this.D.on("touchMove",t)}onTouchEnd(t){return this.D.on("touchEnd",t)}offTouchStart(t){return this.D.off(t,"touchStart")}offTouchMove(t){return this.D.off(t,"touchMove")}offTouchEnd(t){return this.D.off(t,"touchEnd")}setMouseInteractions(t){return this.Yi=t,this.xv.setMouseInteractions(t),this}getMouseInteractions(){return this.Yi}setHighlight(t){var e;return t=Ae(t),this.rv=t,null===(e=this.av)||void 0===e||e.regions.forEach((e=>{this.us.ls.ws(e,t)})),this.D.emit("highlight",this,t),this}getHighlight(){return this.rv}setAnimationHighlight(t){var e;return null===(e=this.av)||void 0===e||e.regions.forEach((e=>{this.us.ls.Cs(e,t)})),this}getAnimationHighlight(){var t;return this.us.ls.ks(null===(t=this.av)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.nv=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.nv}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}offMapDataReady(t){return this.D.off(t,"mapDataReady")}offViewChange(t){return this.D.off(t,"viewChange")}async _v(t){const e=await((t,e)=>{let i;if(t===cl.World)i="countries_world.json";else if(t===cl.NorthAmerica)i="countries_northAmerica.json";else if(t===cl.SouthAmerica)i="countries_southAmerica.json";else if(t===cl.Africa)i="countries_africa.json";else if(t===cl.Europe)i="countries_europe.json";else if(t===cl.Asia)i="countries_asia.json";else if(t===cl.USA)i="states_usa.json";else if(t===cl.Canada)i="territoriesProvinces_canada.json";else{if(t!==cl.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw St.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return St.fetch(s).then((t=>t.json())).catch((t=>{Te(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.fs.Xs);this.wv=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.Mv.Lr().Rl(e);if(t===cl.USA){const t=25.8,e=29.7;this.tv.push(this.yv.Te(this.dt).setMouseInteractions(!1).ke(this.sv).Ce(this.ev).Ie({x:-126,y:t}).q({x:10,y:e-t}),this.yv.Te(this.dt).setMouseInteractions(!1).ke(this.sv).Ce(this.ev).Ie({x:-113,y:t}).q({x:7,y:e-t}))}const s=this.us.ls.Br(this.xv,{animationEnabled:this.th});for(let i=0;i{o.forEach((e=>e.cs(t)))}))}if(this.vv.ps([this.xv]),this.uv=i,this.cv(t,this.dt,i),this.av=e,this.Cv){for(const t of this.Cv)this.invalidateRegionValues(t);this.Cv=void 0}this.us.bs()}cv(t,e,i){const s=yl[t],n=e.x.getCellSize(),r=e.y.getCellSize()/n,o={min:{x:i.min.x,y:i.min.y},max:{x:i.max.x,y:i.max.y}};if(rs){const t=(o.max.y-o.min.y)*(r/s-1);o.min.y-=t/2,o.max.y+=t/2}e.x.J(o.min.x,o.max.x),e.y.J(o.min.y,o.max.y);const a=this.dt.x.li(),h=this.dt.y.li();this.D.emit("viewChange",{latitudeRange:{start:o.min.y,end:o.max.y},longitudeRange:{start:o.min.x,end:o.max.x},margin:{top:h[1],bottom:h[0],left:a[0],right:a[1]}})}Av(t,e){this.Tv={region:t,iRegion:e},this.us.bs()}pv(t,e){this.Tv&&t===this.Tv.region&&(this.Tv=void 0,this.us.bs())}fv(t,e){const i=Array.from(this.ov.entries()).findIndex((([t,i])=>i.includes(e)));return{iRegion:i,region:null==t?void 0:t.regions[i]}}setAnimationsEnabled(t){return this.th=!t,this}getAnimationsEnabled(){return this.th}getMinimumSize(){}Sd(){return[this]}Fe(t){super.Fe(t),super.tg(),Wa.cg(this.ng,this.eg);const e=p(this.dt.x.ei(),this.dt.y.ei(),this.dt.x.ri(),this.dt.y.ri());this.yv.ES(e);const i=this.us.Bn()||this.mv;if(this.Tv&&i){const t=this.wv&&this.wv[this.Tv.iRegion];let e=ut(i,this.engine.scale,this.dt);e={x:kt(e.x,this.dt.x.getInnerStart(),this.dt.x.getInnerEnd()),y:kt(e.y,this.dt.y.getInnerStart(),this.dt.y.getInnerEnd())};let s=e.x,n=e.y;const r=this.Tv.region.transform;this.Tv.region.outlier&&r&&(s=(s-r.translate.x-r.vertexBoundaries.min.x)/r.scale.x+r.vertexBoundaries.min.x,n=(n-r.translate.y-r.vertexBoundaries.min.y)/r.scale.y+r.vertexBoundaries.min.y),this.Sv.setPosition(e).setVisible(!0).getResultTable().setContent(this.xp(new Za,this.Tv.region,t,s,n,this).fc())}else this.Sv.setVisible(!1);return this.Sv.Ds().Fe(),this}dispose(){return this.yv.W(),this.Sv.dispose(),Oa(this.dt),super.dispose()}j(){return super.j(),this.dt.j(),this}Z(){return super.Z(),this.dt.Z(),this}ld(){return he(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))),ae(t,this.qi,i,{fill:this.getFillStyle()}),this}}const xl=(t,e,i,s,n,r)=>(t.addRow(`${e.name}`).addRow(Sl(s,n)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),Sl=(t,e)=>{const i=t>0,s=e>0;return`${[ue(Math.abs(0|t),2),"° ",ue(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[ue(Math.abs(0|e),2),"° ",ue(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`};class bl extends qs{constructor(t,e,i,s,n,r,o,a,h){super(t,e,e.Fv(i),s,n,{numeric:e.Iv({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.Iv({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.Iv({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.Pv=r,this.Dv=o,this.Bv=a,this.es=h,this.Lv=i,this.Rv=e.Iv({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.Dh=a.kr(i).setMouseInteractions(!1).Vh(e.Iv({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).ke(e.Iv({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Nh=this.es.gA([this.Dh]).xs(s.effectsText)}setTickStrategy(t,e){return super.kh(t,e)}setStrokeStyle(t){return this.Rv="function"==typeof t?t(this.Rv):t,this.Dv.bs(),this}getStrokeStyle(){return this.Rv}ar(t,e){return new vl(e,t,this.Lv,this.Bv,this.Bv,this.Ev(this.Pv,this.Lv),this.Bv.Ve(this.Lv).setMouseInteractions(!1))}lr(t,e){const i=this.Vv(this.Lv,t);this.zv&&!1===this.zv(t)?t.Ye.setVisible(!1):t.Ye.setVisible(!0).Ie(ni(this.Ov(this.Lv,t.S),i.padding)).Ja(i.alignment).zh(i.rotation).Ha(i.offset.x,i.offset.y),this.Nv(this.Lv,t.Gv,t.Wv,t)}setMouseInteractions(t){return this}Fe(){this.Jh({physicalAxisSize:0});const t=this.dr(((t,e)=>{const i=e.Sh.nr,s=.5*this.Rv.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Ye.Ds().oi().y/this.Lv.Wi().y)+i.labelPadding;return Math.max(t,s)}),0);return this.Uv(this.Lv,this.Rv,t),this.Yv(this.Lv,this.Dh,t),t}}class vl extends Zo{constructor(t,e,i,s,n,r,o,a){super(t,e,s,i,n,i,a),this.Gv=r,this.Wv=o,r.setMouseInteractions(!1),this.ts.push(r,o)}}class Ml extends bl{constructor(t,e,i,s,n,r,o,a,h){super(t,Tl((()=>this.vA())),e,i,s,n,r,o,a),this.pm=this.Dv.Ve(this.Lv).setMouseInteractions(!1),this.Hv=h,this.setScrollStrategy(Rs.expansion),this.setTickStrategy(Vs.Numeric),this.setTitle("Amplitude")}vA(){return this.Hv()}br(t,e){return Jo(t,e,this.Lv.y)}_r(t,e,i){const s=2*(e-t),n=this.Lv.x.Li(s);return{min:t-i*n,max:e+i*n}}Ov(t,e){return{x:t.$v()?e-t.Xv().start:t.Xv().start-e,y:0}}Ev(t,e){return t.Fc(e)}Nv(t,e,i,s){const n=s.Sh.nr,r=t.$v()?s.S-t.Xv().start:t.Xv().start-s.S;Et(s.S,t.Xv().start)||Et(s.S,t.Xv().end)?e.setVisible(!1):e.setVisible(!0).vu(0).ze(360).wu(void 0)._u(0).xu(r).wu(60).ke(V).Ce(n.gridStrokeStyle);const o=.5*this.Rv.getThickness();i.Oe({x:r,y:-o*t.Wi().y}).ze({x:r,y:-(o+n.tickLength)*t.Wi().y}).Ee(n.tickStyle)}Vv(t,e){const i=e.Sh.nr;return{alignment:{x:0,y:1},padding:{x:0,y:t.Wi().y*-(.5*this.Rv.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}Uv(t,e,i){const s=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;this.pm.Oe({x:0,y:0}).ze({x:s,y:0}).Ee(e)}Yv(t,e,i){const s=t.$v()?(t.Xv().start+t.Xv().end)/2-t.Xv().start:t.Xv().start-(t.Xv().start+t.Xv().end)/2;e.Ja({x:0,y:1}).Ie({x:s,y:-i*t.Wi().y})}}const Tl=t=>({...Oh(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),Fv:t=>({getInnerStart:()=>t.Xv().start,getInnerEnd:()=>t.Xv().end,J:(e,i)=>t.jv(e,i),nt:(e,i,s,n,r)=>t.y.nt(e,i,s,n,r)}),Iv:t=>t.amplitude});class wl extends bl{constructor(t,e,i,s,n,r,o,a){super(t,kl,e,i,s,n,r,o,a),this.Zv=90,this.Qv=12,this.Jv=El,this.pm=this.Dv.Fc(this.Lv).setMouseInteractions(!1),this.zv=t=>{let e=180*(t.S-this.Lv.Kv())/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.Je=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Zv)}setTickStyle(t){return this.qv="function"==typeof t?t(this.qv):t,this.tx(),this.Dv.bs(),this}getTickStyle(){return this.qv}setTickFormattingFunction(t){return this.Jv=t,this.tx(),this.Dv.bs(),this}getTickFormattingFunction(){return this.Jv}setClockwise(t){this.Lv.ix(t);const e=this.Zv*Math.PI/180;return t?this.Lv.sx(e+Math.PI/2):this.Lv.sx(e-Math.PI/2),this.Dv.bs(),this}getClockwise(){return!this.Lv.hx()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Zv=t;const e=t*Math.PI/180;return this.getClockwise()?this.Lv.sx(e+Math.PI/2):this.Lv.sx(e-Math.PI/2),this.Dv.bs(),this}getNorth(){return 180*this.Lv.Kv()/Math.PI}setDivision(t){return this.Qv=t,this.tx(),this.Dv.bs(),this}getDivision(){return this.Qv}vA(){return[]}br(t,e){return e}_r(t,e,i){return{min:t,max:e}}Ov(t,e){const i=t.hx()?1:-1,s=t.Kv(),n=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;return{x:Math.cos((e-s)*i)*n,y:Math.sin((e-s)*i)*n}}Ev(t,e){return t.Ve(e)}Nv(t,e,i,s){const n=this.qv,r=t.hx()?1:-1,o=t.Kv(),a=(s.S-o)*r,h=Math.cos(a),l=Math.sin(a),u=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end,c={x:h*u,y:l*u};e.Oe({x:0,y:0}).ze(c);const d={x:c.x+h*n.tickLength*t.Wi().x,y:c.y+l*n.tickLength*t.Wi().y};i.Oe(c).ze(d),e.Ee(n.gridStrokeStyle),i.Ee(n.tickStyle)}Vv(t,e){const i=this.qv,s=t.hx()?1:-1,n=t.Kv();let r,o=(e.S-n)*s;for(;o<0;)o+=2*Math.PI;for(;o>=2*Math.PI;)o-=2*Math.PI;r=o>0&&o<=Math.PI?-o+Math.PI/2:-o-Math.PI/2;const a=i.tickLength+i.tickPadding,h=Math.cos(o)*a*t.Wi().x,l=Math.sin(o)*a*t.Wi().y;return{alignment:{x:0,y:0},padding:{x:h,y:l},rotation:180*r/Math.PI,offset:{x:h,y:l}}}Uv(t,e,i){const s=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;this.pm.vu(0).ze(360)._u(0).xu(s+.5*e.getThickness()*t.Wi().x).wu(360).ke(V).Ce(e)}Yv(t,e,i){const s=t.Kv(),n=this.Vv(t,{S:0+s}),r=t.$v()?t.Xv().end-t.Xv().start:t.Xv().start-t.Xv().end;e.Ja(n.alignment).zh(n.rotation).Ha(n.offset.x,n.offset.y).Ie(ni({x:r,y:0},n.padding))}tx(){this.Yh({He:[],$e:[{Ye:"Radial ticks",wA:0,nr:this.qv,hr:this.Jv,Ir:(t,e,i,s)=>{const n=[],r=2*Math.PI/this.Qv;for(let t=0;t<2*Math.PI;t+=r)n.push(t);return n},xh:{ur:()=>{},bh:()=>!1},Pr:void 0}],We:El,Hh:void 0,$h:void 0})}}const El=(t,e,i)=>(180*t/Math.PI).toFixed(0),kl={pr:()=>{},mr:()=>{},Sr:()=>{},Fv:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,J:(t,e)=>{},nt:(e,i,s,n,r)=>t.x.nt(e,i,s,n,r)}),Iv:t=>t.radial},Cl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),Dl=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class Il extends Ui{constructor(t,e,i,s,n,r){super(e,i,n,r),this._s="Sector",this.nx=0,this.ox=1*Math.PI/2,this.lx=void 0,this.ux=void 0,this.Ts=t,this.Lv=s,this.np=this.Ts.Fc(this.Lv).cs(this.getHighlight()),this.gs(this.np),this.be=n.polarSectorFillStyle,this.Me=n.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.nx=kt(t,0,360),this.Ts.bs(),this}getAngleStart(){return this.nx}setAngleEnd(t){return this.ox=kt(t,0,360),this.Ts.bs(),this}getAngleEnd(){return this.ox}setAmplitudeStart(t){return this.lx=t,this.Ts.bs(),this}getAmplitudeStart(){return this.lx}setAmplitudeEnd(t){return this.ux=t,this.Ts.bs(),this}getAmplitudeEnd(){return this.ux}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ts.bs(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ts.bs(),this}getStrokeStyle(){return this.Me}Fe(){const t=this.Lv.Xv(),e=180*this.Lv.Kv()/Math.PI,i=void 0!==this.lx?kt(this.lx,t.start,t.end):t.start,s=void 0!==this.ux?kt(this.ux,t.start,t.end):t.end,n=this.Lv.$v()?i-t.start:t.start-i,r=this.Lv.$v()?s-t.start:t.start-s,o=Math.min(n,r),a=Math.max(n,r),h=this.Lv.hx()?1:-1,l=Math.abs(this.ox-this.nx);this.np.vu((this.nx-e)*h).ze((this.ox-e)*h)._u(100*o/a).xu(a).ke(this.be).Ce(this.Me).wu(Math.ceil(l/2))}Pe(t,e){t.cs(e),this.Ts.bs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}}class _l extends Ui{constructor(){super(...arguments),this.Lm=!0,this.Ax=!0}setAutoScrollingEnabled(t){return this.Lm=t,this.Ji.us.bs(),this}getAutoScrollingEnabled(){return this.Lm}Gm(){}Fe(){}$p(){}setCursorEnabled(t){return this.Ax=t,this}getCursorEnabled(){return this.Ax}}class Fl extends _l{constructor(t,e,i,s,n,r){super(e,i,n,r),this.Ts=t,this.Ji=e,this.scale=s}getAmplitudeMin(){return this.gx?this.gx.min:void 0}getAmplitudeMax(){return this.gx?this.gx.max:void 0}}const Ll=(t,e,i,s,n)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",n(s)),zl=(t,e)=>{const i=[],s=e.Xv().start,n=e.Xv().end,r=e.$v(),o=e.hx()?1:-1,a=e.Kv(),h=Math.abs(n-s),l=Math.min(s,n)+.001*h,u=Math.max(s,n)-.001*h;for(const e of t){const t=kt(e.amplitude,l,u),n=e.angle*Math.PI/180-a,h=Math.cos(n*o)*(r?t-s:s-t),c=Math.sin(n*o)*(r?t-s:s-t),d=e.color;i.push({x:h,y:c,color:d})}return i},Pl=t=>{const e={min:_e,max:Fe};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},Rl=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),Vl=(t,e)=>{let i=gi(t);for(e.hx()||(i*=-1),i+=180*e.Kv()/Math.PI;i<0;)i+=360;i%=360;const s=ii(t),n=e.Xv(),r=Math.abs(n.end-n.start);return{angle:i,amplitude:Fr(n.start,n.end,s/r)}};class Bl extends Fl{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,r),this._s="Heatmap Series",this.mx=!0,this.$m=!1,this.xp=Ol,this.ld=()=>he(this.be);const a=this.Ji.getSeries().length;this.be=ce(this.qi.polarHeatmapSeriesFillStyle||this.qi.heatmapGridSeriesFillStyle,a);const h=o.amplitudeStart||0,l=o.amplitudeEnd?(o.amplitudeEnd-h)/(o.annuli-1):o.amplitudeStep||1,u={sectors:o.sectors,annuli:o.annuli,amplitudeStart:h,amplitudeStep:l,heatmapDataType:"intensity",dataOrder:o.dataOrder||"annuli"};this.En=u,this.yx=t.Sx(s,[],u).ke(this.be).cs(this.getHighlight()),this.gs(this.yx);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.gx={min:c,max:d},this.setHighlightOnHover(!1)}invalidateIntensityValues(t){if(this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),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.En.dataOrder?t[0].length:t.length,annuli:"annuli"===this.En.dataOrder?t.length:t[0].length},i="annuli"===this.En.dataOrder?this.En.annuli:this.En.sectors,s="annuli"===this.En.dataOrder?this.En.sectors:this.En.annuli;if(e.x>i||e.y>s){if(!0===this.Ji.fs.oo){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.`;St.console.warn(t)}const n=[];for(let e=0;eo||r>a){if(!0===this.Ji.fs.oo){const t=`PolarHeatmapSeries.invalidateIntensityValues intensity matrix overflow.\nMax indexes ${o}x${a}, input ${e.primary}x${e.secondary} starting at [${i},${n}].\nOut of bounds data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const h=Math.max(s-o,0),l=e.primary-h,u=Math.max(r-a,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.yx.oS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:n,values:t.values})}return this.Ts.bs(),this.$m=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.yx.ke(this.be),this.Ts.bs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}clear(){return this.yx.Nt(),this.Ts.bs(),this}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.yx.rS(t),this.Ts.bs(),this}getIntensityInterpolation(){return this.yx.nS()}Dm(){return this.Lm&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){const i=ut(t,this.Ji.engine.scale,this.scale),s=Vl(i,this.scale),n=this.mx?this.yx.vx(s):this.yx.gg(s);if(n)return gh(zl([n],this.scale)[0],this.scale,this.xp(new Za,this,{angleDeg:n.angle,amplitude:n.amplitude,intensity:n.cellValue,iAnnulus:n.iAnnulus,iSector:n.iSector},this.Ji.getAmplitudeAxis().formatValue).fc(),this,this.be)}solveNearestFromScreen(t){return this.gg($o(t,this.Ji.us),!1)}Fe(){}attach(t,e=!0,i=!1){return super.attach(t,e),ae(t,this.qi,i,{fill:this.be}),this}}const Ol=(t,e,i,s)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i.angleDeg).toString()).addRow("Amplitude","",s(i.amplitude)).addRow("Intensity","",i.intensity.toFixed(1));class Nl extends Fl{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,o),this._s="Line Series",this.xx=[],this.bx=!1,this.Mx=!1,this.xp=Ll,this.Cu=ce(this.qi.polarLineSeriesStrokeStyle,r),this._x=t.zp(s,void 0,[kh.UserSeries]).Ee(this.Cu).cs(this.getHighlight()).pl(Fn.Nearest),this.gs(this._x)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){return 0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.xx=Rl(t),this.bx=!0,this.gx=Pl(this.xx),this.Ts.bs(),this}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;return this._x.Ee(e),this.Ts.bs(),this}getStrokeStyle(){return this.Cu}setConnectDataAutomaticallyEnabled(t){return this.Mx=t,this.Ts.bs(),this}getConnectDataAutomaticallyEnabled(){return this.Mx}Dm(){return this.Lm&&this.xx.length>0&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){return this.wx(t,this._x)}solveNearestFromScreen(t){return this.wx($o(t,this.Ji.us),this._x)}wx(t,e){const i=e.Cx(t);if(!i)return;const{angle:s,amplitude:n}=Vl(i,this.scale);return gh(i,this.scale,this.xp(new Za,this,s,n,this.Ji.getAmplitudeAxis().formatValue).fc(),this,this.Cu.getFillStyle())}Fe(){if(this.bx||this.scale.kx()){const t=zl(this.xx,this.scale),e=je(t);this.Mx?(t.push({...t[0]}),this._x.tu(!0)):this._x.tu(!1),this._x.Nt()._l(t).ra(e),this.bx=!1,this._x.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{stroke:this.Cu}),this}}class Ul extends Fl{constructor(t,i,s,n,r,o,a){super(t,i,s,n,r,a),this._s="Point Line Series",this.xx=[],this.bx=!1,this.Mx=!1,this.Tx=3,this.Fa=0,this.Fx=e.PointShape.Circle,this.xp=Ll,this.be=ce(this.qi.polarPointLineSeriesFillStyle,o),this.Cu=ce(this.qi.polarPointLineSeriesStrokeStyle,o),this._x=t.zp(n,void 0,[kh.UserSeries]).Ee(this.Cu).cs(this.getHighlight()).pl(Fn.Nearest),this.gs(this._x),this.zc=t.Oc(n).ke(this.be).Sl(this.Fx).q(this.Tx).cs(this.getHighlight()).pl(Fn.Nearest),this.gs(this.zc)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){return 0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.xx=Rl(t),this.bx=!0,this.gx=Pl(this.xx),this.Ts.bs(),this}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;return this._x.Ee(e),this.Ts.bs(),this}getStrokeStyle(){return this.Cu}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.zc.ke(e),this.Ts.bs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.Tx=t,this.zc.q(t),this.Ts.bs(),this}getPointSize(){return this.Tx}setPointShape(t){return this.Fx=t,this.zc.Sl(this.Fx),this}getPointShape(){return this.Fx}setPointRotation(t){return this.Fa=t,this.zc.zh(t),this.Ts.bs(),this}getPointRotation(){return this.Fa}setConnectDataAutomaticallyEnabled(t){return this.Mx=t,this.Ts.bs(),this}getConnectDataAutomaticallyEnabled(){return this.Mx}Dm(){return this.Lm&&this.xx.length>0&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){return this.wx(t,this._x)}solveNearestFromScreen(t){return this.wx($o(t,this.Ji.us),this._x)}wx(t,e){const i=e instanceof Qn?e.gg(t):e.Cx(t);if(!i)return;const{angle:s,amplitude:n}=Vl(i,this.scale);return gh(i,this.scale,this.xp(new Za,this,s,n,this.Ji.getAmplitudeAxis().formatValue).fc(),this,"color"in i&&W(this.be)?new U({color:i.color}):this.be)}Fe(){if(this.bx||this.scale.kx()){const t=zl(this.xx,this.scale),e=je(t);this.Mx?(t.push({...t[0]}),this._x.tu(!0)):this._x.tu(!1),this._x.Nt()._l(t).ra(e),this.zc.Nt()._l(t).ra(e),this.bx=!1,this._x.Ds(),this.zc.Ds()}}yd(){return this.Fx}}class Gl extends Fl{constructor(t,i,s,n,r,o,a){super(t,i,s,n,r,a),this._s="Point Series",this.xx=[],this.bx=!1,this.Tx=3,this.Fa=0,this.Fx=e.PointShape.Circle,this.xp=Ll,this.be=ce(this.qi.polarPointSeriesFillStyle,o),this.zc=t.Oc(n).ke(this.be).Sl(this.Fx).q(this.Tx).cs(this.getHighlight()).pl(Fn.Nearest),this.gs(this.zc)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){return 0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),this.xx=Rl(t),this.bx=!0,this.gx=Pl(this.xx),this.Ts.bs(),this}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.zc.ke(e),this.Ts.bs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.Tx=t,this.zc.q(t),this.Ts.bs(),this}getPointSize(){return this.Tx}setPointShape(t){return this.Fx=t,this.zc.Sl(this.Fx),this}getPointShape(){return this.Fx}setPointRotation(t){return this.Fa=t,this.zc.zh(t),this.Ts.bs(),this}getPointRotation(){return this.Fa}Dm(){return this.Lm&&this.xx.length>0&&this.getVisible()}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){const i=this.zc.gg(t);if(!i)return;const{angle:s,amplitude:n}=Vl(i,this.scale);return gh(i,this.scale,this.xp(new Za,this,s,n,this.Ji.getAmplitudeAxis().formatValue).fc(),this,"color"in i&&W(this.be)?new U({color:i.color}):this.be)}solveNearestFromScreen(t){return this.gg($o(t,this.Ji.us),!1)}Fe(){if(this.bx||this.scale.kx()){const t=zl(this.xx,this.scale),e=je(t);this.zc.Nt()._l(t).ra(e),this.bx=!1,this.zc.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.be}),this}yd(){return this.Fx}}class Wl{constructor(t,e,i,s){this.D=new n.Eventer,this.Ix=!1,this.Ji=t,this.Px=e,this.iy=i,this.el=s}setGeometry(t){return this.Dx=t,this.Ix=!0,this.Ji.us.bs(),this}getGeometry(){return this.Dx}setMouseInteractions(t){return this.el.setMouseInteractions(t),this}dispose(){return this.el.dispose(),this.Px(this),this.D.emit("dispose",this),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setVisible(t){const e=this.el.getVisible()!==t;return this.el.setVisible(t),e&&this.D.emit("visibleStateChanged",this,t),this.Ji.us.bs(),this}getVisible(){return this.el.getVisible()}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}}const Yl=(t,e,i)=>{const s=e.dt,n=i.dt;let r=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-n.getInnerStart())/(n.getInnerEnd()-n.getInnerStart());return 1===i.sA&&(r=1-r),1===e.sA&&(o=1-o),u(o,r)};class Hl extends ih{constructor(t,e,i,s,n,r,o,a){super(t,e,Pi(i.dt,s.dt),n,a),this.Bx=!1,this.Lx=!1,this.Rx=!0,this.Ex=!0,this.Vx=!1,this.zx=!1,this.setGridStrokeYStyle=t=>(this.Ox.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.Ox.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.Nx=r,this.Gx=o,this.Wx=this.axisX.FA(!1,this.Nx).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.Ox=this.axisY.FA(!1,this.Gx).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.Wx.dispose(),this.Ox.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(ut(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.Wx.setValue(t.x),this.Ox.setValue(t.y);const e=Yl(u(this.Wx.getValue(),this.Ox.getValue()),this.axisX,this.axisY);return this.Wx.setGridStrokeLength(this.Vx?e.x:1),this.Ox.setGridStrokeLength(this.zx?e.y:1),this}Fe(){this.Wx.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Bx),this.Ox.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Lx);const t=Yl(u(this.Wx.getValue(),this.Ox.getValue()),this.axisX,this.axisY);return this.Wx.setGridStrokeLength(this.Vx?t.x:1),this.Ox.setGridStrokeLength(this.zx?t.y:1),super.Fe()}setGridStrokeXCut(t){return this.Vx=t,this.Ts.bs(),this}getGridStrokeXCut(){return this.Vx}setGridStrokeYCut(t){return this.zx=t,this.Ts.bs(),this}getGridStrokeYCut(){return this.zx}setGridStrokeXStyle(t){return this.Wx.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.Wx.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.Bx=t,this.Ts.bs(),this}getTickMarkerXVisible(){return this.Bx}setTickMarkerYVisible(t){return this.Lx=t,this.Ts.bs(),this}getTickMarkerYVisible(){return this.Lx}setTickMarkerX(t){return this.Wx.setMarker(t),this}setTickMarkerY(t){return this.Ox.setMarker(t),this}getTickMarkerX(){return this.Wx.getMarker()}getTickMarkerY(){return this.Ox.getMarker()}}class Xl extends eh{constructor(t,e,i,s,n,r,o){super(t,e,i,s,o),this.Vx=!1,this.zx=!1,this.Ux=!1,this.Yx=!1,this.Hx=new Map,this.$x=new Map,this.Bx=!0,this.Lx=!0,this.Og=s,this.Nx=n,this.Gx=r,this.Xx=o.cursorGridStrokeStyleX,this.jx=o.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.Hx.forEach((t=>t.dispose())),this.$x.forEach((t=>t.dispose())),this.Zx=void 0,this.Qx=void 0,this}Fe(){return this.Zx&&this.Zx.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Bx),this.Qx&&this.Qx.setVisible(this.Xi&&this.RA).setMarkerVisible(this.Xi&&this.RA&&this.Lx),super.Fe()}pointAt(t){const{location:e}=t,i=t.owner instanceof ru&&t.owner;if(!i)return this;const{axisX:s}=i,{axisY:n}=i,r=this.Ah(s,!0),o=this.Ah(n,!1);r!==this.Zx&&this.Zx&&this.Zx.setVisible(!1),o!==this.Qx&&this.Qx&&this.Qx.setVisible(!1),r.setValue(e.x),o.setValue(e.y);const a=Yl(u(e.x,e.y),s,n);return r.setGridStrokeLength(this.Vx?a.x:1),o.setGridStrokeLength(this.zx?a.y:1),this.Zx=r,this.Qx=o,super.pointAt(t)}Ug(t){if(super.Ug(t),t){const e=e=>e.setTextFillStyle(t);this.Zx&&this.Ux&&this.Zx.setMarker(e),this.Qx&&this.Yx&&this.Qx.setMarker(e)}}Ah(t,e){let i=(e?this.Hx:this.$x).get(t);return i||(e?(i=t.FA(!1,this.Nx),this.Hx.set(t,i)):(i=t.FA(!1,this.Gx),this.$x.set(t,i)),this.rr(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}rr(t,e){const i=e?this.Xx:this.jx;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.Bx:this.Lx)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.Vx=t,this.Ts.bs(),this}getGridStrokeXCut(){return this.Vx}setGridStrokeYCut(t){return this.zx=t,this.Ts.bs(),this}getGridStrokeYCut(){return this.zx}setGridStrokeXStyle(t){return this.Xx=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.Hx.forEach((t=>t.setGridStrokeStyle(this.Xx))),this}getGridStrokeXStyle(){return this.Xx}setGridStrokeYStyle(t){return this.jx=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.$x.forEach((t=>t.setGridStrokeStyle(this.jx))),this}getGridStrokeYStyle(){return this.jx}setTickMarkerXVisible(t){return this.Bx=t,this.Ts.bs(),this}getTickMarkerXVisible(){return this.Bx}setTickMarkerYVisible(t){return this.Lx=t,this.Ts.bs(),this}getTickMarkerYVisible(){return this.Lx}setTickMarkerX(t){return this.Hx.forEach((e=>e.setMarker(t))),this.Nx=this.Nx.addStyler(t),this.Ts.bs(),this}setTickMarkerY(t){return this.$x.forEach((e=>e.setMarker(t))),this.Gx=this.Gx.addStyler(t),this.Ts.bs(),this}setTickMarkerXAutoTextStyle(t){return this.Ux=t,this.Ts.bs(),this}getTickMarkerXAutoTextStyle(){return this.Ux}setTickMarkerYAutoTextStyle(t){return this.Yx=t,this.Ts.bs(),this}getTickMarkerYAutoTextStyle(){return this.Yx}}class jl extends sh{constructor(t,e,i,s){super(t,s),this.Og=t,this.Nx=e,this.Gx=i,this.Yg=s}}class $l extends jl{constructor(){super(...arguments),this.$g=(t,e,i,s)=>this.Hg(new Xl(t,e,i,this.Og,this.Nx,this.Gx,s),s),this.addStyler=t=>new $l(this.Og,this.Nx,this.Gx,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new $l(t,this.Nx,this.Gx,this.Yg.map((t=>t)))}}class ql extends jl{constructor(){super(...arguments),this.Xg=(t,e,i,s,n)=>this.Hg(new Hl(t,e,i,s,this.Og,this.Nx,this.Gx,n),n),this.addStyler=t=>new ql(this.Og,this.Nx,this.Gx,this.Yg.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ql(t,this.Nx,this.Gx,this.Yg.map((t=>t)))}}const Jl=new $l(ro,Xo.PointableTextBox,Xo.PointableTextBox,[(t,e)=>{oh(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),yr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),yr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Kl=new ql(ro,Xo.PointableTextBox,Xo.PointableTextBox,[(t,e)=>{ah(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),yr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),yr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Zl=new ql(ro,Xo.PointableTextBox,Xo.PointableTextBox,[(t,e)=>{((t,e)=>{t.setPointMarker((t=>t.setFillStyle(e.seriesMarkerPointMarkerFillStyle).setSize(e.seriesMarkerPointMarkerSize).setShape(e.seriesMarkerPointMarkerShape))).setResultTable((t=>t.setEffect(!0).setBackground((t=>t)).setOrigin(u(-1,-1)).setMargin(10)))})(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),yr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),yr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Ql=(t,i,s)=>{switch(t){case e.UIVisibilityModes.always:return!0;case e.UIVisibilityModes.never:return!1;case e.UIVisibilityModes.whenDragged:return s;case e.UIVisibilityModes.whenHovered:return i&&!s;case e.UIVisibilityModes.whenHoveredOrDragged:return s||i;case e.UIVisibilityModes.whenNotDragged:return!s;default:return!1}},tu=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class eu{constructor(t,i,s,r,o,a){this.Jx=e.UIVisibilityModes.always,this.Kx=e.UIVisibilityModes.always,this.jo=!0,this.$i=!1,this.qx=!1,this.tb=!1,this.wa=u(0,0),this.Nu=e.UIDraggingModes.draggable,this.Gu=void 0,this.D=new n.Eventer,this.Xi=!0,this.ib=(t,i,s)=>{this.qx=!0,this.Ts.bs();const n=this.Nu===e.UIDraggingModes.notDraggable?this.Nu:s||this.Nu;this.Gu=this.Ts.us.Er(n===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:n===e.UIDraggingModes.draggable?e.MouseStyles.Move:n===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical)},this.sb=()=>{this.qx=!1,this.Ts.bs(),this.Ts.us.Vr(this.Gu)},this.eb=(t,e)=>{this.tb=!0,jt(e),this.Ts.bs()},this.hb=(t,i)=>{if(this.Nu!==e.UIDraggingModes.notDraggable){const s=i||this.Nu,n=ut(this.Ts.us.De(t.x,t.y),this.Ts.us.dt,this.scale),r=u(s!==e.UIDraggingModes.onlyVertical?tu(n.x,this.scale.x):this.wa.x,s!==e.UIDraggingModes.onlyHorizontal?tu(n.y,this.scale.y):this.wa.y);return this.setPosition(r),!0}return!1},this.rb=(t,e)=>{this.tb=!1,jt(e),this.Ts.bs()},this.onDispose=t=>this.D.on("dispose",t),this.offDispose=t=>this.D.off(t,"dispose"),this.Ts=t,this.renderingScale=i,this.scale=s,this.Sv=r,this.nb=o,this.qi=a;const h=r.getPointMarker().setMouseInteractions(!0);h.onMouseEnter(((t,e)=>this.ib(t,e))),h.onMouseLeave(this.sb),h.onMouseDragStart(this.eb),h.onMouseDrag(((t,e)=>this.hb(u(e.clientX,e.clientY))&&jt(e))),h.onMouseDragStop(this.rb),h.onTouchStart(this.eb),h.onTouchMove(((t,e)=>this.hb(u(e.clientX,e.clientY))&&jt(e))),h.onTouchEnd(this.rb),r.getResultTable().setMouseInteractions(!0),this.setPosition(this.wa)}setPosition(t){return this.wa=t,this.Sv.setPosition(t),this.D.emit("positionChange",this,this.wa),this}getPosition(){return this.wa}onPositionChange(t){return this.D.on("positionChange",t)}offPositionChange(t){return this.D.off(t,"positionChange")}setPointMarkerVisibility(t){return this.Jx=t,this.Ts.bs(),this}getPointMarkerVisibility(){return this.Jx}setResultTableVisibility(t){return this.Kx=t,this.Ts.bs(),this}getResultTableVisibility(){return this.Kx}setMouseInteractions(t){return this.jo=t,this.Sv.getPointMarker().setMouseInteractions(t),this.Sv.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.jo}setAutoFitStrategy(t){return this.Sv.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.Sv.getAutoFitStrategy()}isAttached(){return!0}Fe(){const t=this.isAttached();return Ql(this.Jx,this.qx,this.tb)?this.Sv.setPointMarkerVisible(!0):this.Sv.setPointMarkerVisible(!1),t&&Ql(this.Kx,this.qx,this.tb)?this.Sv.setResultTableVisible(!0):this.Sv.setResultTableVisible(!1),this.Sv.Fe(),this}Ds(){return this.Sv.Ds(),this}pointAt(t){return this.Sv.pointAt(t),this}dispose(){return this.$i||(this.$i=!0,this.nb(this),this.Sv.dispose(),this.D.emit("dispose")),this}setVisible(t){const e=this.Xi!==t;return this.Xi=t,this.Sv.setVisible(t),e&&this.D.emit("visibleStateChanged",this,this.Xi),this}getVisible(){return this.Xi}onVisibleStateChanged(t){return this.D.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.D.off(t,"visibleStateChanged")}setPointMarker(t){return this.Sv.setPointMarker(t),this}getPointMarker(){return this.Sv.getPointMarker()}setResultTable(t){return this.Sv.setResultTable(t),this}getResultTable(){return this.Sv.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Nu=t,this.Ts.bs(),this}getDraggingMode(){return this.Nu}}class iu extends eu{constructor(t,i,s,n,r,o,a){super(t,i,Pi(s.dt,n.dt),r.Xg(t,i,s,n,a),o,a),this.ob=e.UIVisibilityModes.always,this.ab=e.UIVisibilityModes.always,this.lb=e.UIVisibilityModes.always,this.ub=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.Sv.getGridStrokeXStyle(),this.gridStrokeStyleY=this.Sv.getGridStrokeYStyle(),this.Ts=t,this.axisX=s,this.axisY=n,this.nb=o;const h=this.Sv.getTickMarkerX().setMouseInteractions(!0);h.onMouseEnter(((t,i)=>this.ib(t,i,e.UIDraggingModes.onlyHorizontal))),h.onMouseLeave(this.sb),h.onMouseDragStart(this.eb),h.onMouseDrag(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&jt(i))),h.onMouseDragStop(this.rb),h.onTouchStart(this.eb),h.onTouchMove(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&jt(i)));const l=this.Sv.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.ib(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.sb),l.onMouseDragStart(this.eb),l.onMouseDrag(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&jt(i))),l.onMouseDragStop(this.rb),l.onTouchStart(this.eb),l.onTouchMove(((t,i)=>this.hb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&jt(i)))}Fe(){const t=this.isAttached();return this.Xi&&t&&Ql(this.lb,this.qx,this.tb)?this.Sv.setTickMarkerXVisible(!0):this.Sv.setTickMarkerXVisible(!1),this.Xi&&t&&Ql(this.ub,this.qx,this.tb)?this.Sv.setTickMarkerYVisible(!0):this.Sv.setTickMarkerYVisible(!1),this.Sv.setGridStrokeXStyle(this.Xi&&t&&Ql(this.ob,this.qx,this.tb)?this.gridStrokeStyleX:nt),this.Sv.setGridStrokeYStyle(this.Xi&&t&&Ql(this.ab,this.qx,this.tb)?this.gridStrokeStyleY:nt),super.Fe()}setGridStrokeXVisibility(t){return this.ob=t,this.Ts.bs(),this}getGridStrokeXVisibility(){return this.ob}setGridStrokeYVisibility(t){return this.ab=t,this.Ts.bs(),this}getGridStrokeYVisibility(){return this.ab}setTickMarkerXVisibility(t){return this.lb=t,this.Ts.bs(),this}getTickMarkerXVisibility(){return this.lb}setTickMarkerYVisibility(t){return this.ub=t,this.Ts.bs(),this}getTickMarkerYVisibility(){return this.ub}setGridStrokeXCut(t){return this.Sv.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.Sv.getGridStrokeXCut()}setGridStrokeYCut(t){return this.Sv.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.Sv.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.Sv.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.Sv.getGridStrokeYStyle()}setTickMarkerX(t){return this.Sv.setTickMarkerX(t),this}getTickMarkerX(){return this.Sv.getTickMarkerX()}setTickMarkerY(t){return this.Sv.setTickMarkerY(t),this}getTickMarkerY(){return this.Sv.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.Sv.getTickMarkerX().setMouseInteractions(t),this.Sv.getTickMarkerY().setMouseInteractions(t),this}}class su extends iu{}class nu extends su{constructor(t,e,i,s,n,r){super(t,e,i.axisX,i.axisY,s,n,r),this.cb=!1,this.Ts=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.cb=!1,this.Ts.bs(),this}Ds(){if(!this.cb){const t=this.owningSeries.solveNearestFromScreen(ut(this.wa,this.scale,this.Ts.us.dt));t?(this.wa=ut(t.location,this.owningSeries.scale,this.scale),this.Sv.pointAt(t),this.cb=!0):this.Sv.setPosition(this.wa)}return super.Ds()}isAttached(){return this.cb}}class ru extends _l{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,h,l),this.fb=[],this.addMarker=(t=Zl)=>{const e=new nu(this.Ab(),this.Ji.uiScale,this,t,this.removeMarker,this.qi);return this.fb.push(e),e},this.removeMarker=t=>{const e=this.fb.indexOf(t);-1!==e&&this.fb.splice(e,1)},this.ts=new Map,this.chart=t,this.Ts=i,this.axisX=s,this.axisY=n,this.axisXAttachHandler=r,this.axisYAttachHandler=o,this.Ab=a,this.scale=Pi(s.dt,n.dt),this.gb=t.pb,t.pb+=1,this.mb(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.yb),this.onMouseLeave(this.chart.Sb),this.onMouseWheel(this.chart.Em),this.onMouseDragStart(this.chart.vb),this.onMouseDrag(this.chart.Vm),this.onMouseDragStop(this.chart.xb),this.onTouchStart(this.chart.zm.onTouchStart),this.onTouchMove(this.chart.zm.onTouchMove),this.onTouchEnd(this.chart.zm.onTouchEnd)}attacheAxis(){this.bb=this.axisXAttachHandler(this),this.Mb=this.axisYAttachHandler(this)}Fe(){super.Fe();for(let t=0;t{e.da(this.gb)})),this.Ji.us.bs(),this}dispose(){return super.dispose(),this.fb.slice().forEach((t=>t.dispose())),this.bb(this),this.Mb(this),this}_b(){for(let t=0;t{const n=t.length;let r=0;if(void 0!==e){const n=i-e;if(n>0){const e=t.slice(r,n);r+=n,s(e,!0)}}for(;rt))=>{const i=[];let s;for(let n=0;n{const s=void 0!==i?i:0,n=new Array(t.length);for(let i=0;it.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i)).addRow("Y","",e.axisY.formatValue(s));class uu extends ru{constructor(t,i,s,n,r,o,a,h,l,u,c){super(t,i,s,n,r,o,a,h,u,c),this.wb=[],this.Lu=[],this.Cb=0,this.ji=!1,this.Hi=e.HighlightModes.onHover,this.xp=lu,this.ds((t=>t.Vn||t.zn||t.qn?void 0:"xy series")),this.kb=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.Cb=void 0!==e&&e>0?e:0,this.Ts.bs(),this}add(t){if(0!==this.wb.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),Array.isArray(t)?this.Tb(t):this.Tb([t]),this.Lu.length>0){const t=this.Lu[this.Lu.length-1];this.Fb={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.Fb?this.Fb.y+e:0),this.add(((t,e=1,i)=>{const s=void 0!==i?i:0,n=new Array(t.length);for(let i=0;i{const i=new Array(t.length);for(let s=0;st+e.wl()+e.Cl()),this.Lu.length)}clear(){this.Ib=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.kb.getXMax(this.wb,this.Ib)||0}getXMin(){return this.kb.getXMin(this.wb,this.Ib)||0}getYMax(){return this.kb.getYMax(this.wb,this.Ib)||0}getYMin(){return this.kb.getYMin(this.wb,this.Ib)||0}Sr(){const t=u(0,0);for(const e of this.wb)t.x=Math.max(t.x,e.Vl()),t.y=Math.max(t.y,e.zl());return t}Pb(t,e,i,s){this.kb.Pb(t,e,i,s,this.scale,(t=>{}))}Gm(){super.Gm();const t=this.wb.length;this.Db&&this.Pb(this.wb,this.getPointAmount(),this.Db,this.Cb),t!==this.wb.length&&this._b()}Fe(){super.Fe();const t=this.getBoundaries();this.Lu.length>0&&(this.Bb(this.Lu),this.Lu=[]);for(const e of this.wb)e.ra(t);return super.Fe()}$p(){super.$p(),this.Ib=void 0,this.Lu.length=0}Tb(t){0!==t.length&&(this.Ib?this.Ib=qe(this.Ib,je(t)):this.Ib=je(t),this.D.emit("dataAdd",this,t,this.Ib),this.Lu=se(this.Lu,t,{canReturnB:!1}),this.Ts.bs())}Lb(){return au(this.wb)}Rb(t){return this.D.on("dataAdd",t)}Eb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}zb(t){return this.D.off(t)}}const cu=(t,e,i,s)=>{let n,r,o=Number.MAX_VALUE;for(let a=0;a{const e=this.Nb.indexOf(t);e>=0&&this.Nb.splice(e,1);const i=this.Ob.findIndex((e=>e===t.el));i>=0&&this.Ob.splice(i,1),this.Ts.bs()},this.be=ce(this.qi.polarPolygonSeriesFillStyle,r),this.Me=ce(this.qi.polarPolygonSeriesStrokeStyle,r)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}addPolygon(){const t=new Wl(this.Ji,this.Gb,this,this.Wb());return this.Nb.push(t),t}setFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(const t of this.Ob)t.ke(e);return this.Ts.bs(),this}getFillStyle(){return this.be}setStrokeStyle(t){this.Me="function"==typeof t?t(this.Me):t;const e=this.Me;for(const t of this.Ob)t.Ce(e);return this.Ts.bs(),this}getStrokeStyle(){return this.Me}Dm(){return this.Lm&&void 0!==this.Nb.find((t=>void 0!==t.Ub))&&this.getVisible()}Fe(){this.Nb.forEach((t=>{(t.Ix||this.scale.kx())&&t.Yb&&(t.el.Rl(zl(t.Yb,this.scale)),t.Ix=!1,t.el.Ds())}))}Gm(){super.Gm();const t=m(_e,Fe);this.Nb.forEach((e=>{if(!e.Dx)return;const i=!e.Ix&&e.Yb?e.Yb:Rl(e.Dx);e.Yb=i;const s=!e.Ix&&e.Ub?e.Ub:Pl(i);e.Ub=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.gx=t}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e){const i=cu(t,this.Ob,((t,e)=>{const i=t.gg(e);if(i)return ut(i,this.scale,t.us.dt)}),We);if(!i)return;const s=ut(i[0],i[1].us.dt,this.scale),n=this.Hb(i[1]);if(!n)return;const{angle:r,amplitude:o}=Vl(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.xp(new Za,this,r,o,this.Ji.getAmplitudeAxis().formatValue).fc(),owner:this,fillStyle:this.be,polarPolygon:n}}solveNearestFromScreen(t){return this.gg($o(t,this.Ji.us),!1)}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}Wb(){const t=this.Ts.vc(this.scale,rr.Simple).ke(this.be).Ce(this.Me).cs(this.getHighlight());return this.Ob.push(t),this.gs(t),t}Hb(t){return this.Nb.find((e=>e.el===t))}}class fu extends Fl{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,o),this._s="Area Series",this.xx=[],this.bx=!1,this.Mx=!1,this.$b=!1,this.xp=Ll,this.be=ce(this.qi.polarAreaSeriesFillStyle,r),this.Me=ce(this.qi.polarAreaSeriesStrokeStyle,r)}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setData(t){0!==this.xx.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const e=(t=>{const e=[];let i,s,n=!1;for(let r=0;r0&&this.getVisible()}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.be,stroke:this.Me}),this}}class gu extends fu{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,r,o),this.Xb=this.Ts.vc(this.scale,rr.Simple).cs(this.getHighlight()),this.gs(this.Xb)}Fe(){if(this.bx||this.scale.kx()){const t=this.xx,e=!0===this.Mx?zl(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(Et(e.angle,i.angle))return t;const s=1*Math.sign(i.angle-e.angle);let n=0;const r=[];for(let t=i.angle+s;!Et(t%360,e.angle%360);t+=s)if(r.push({angle:t,amplitude:0}),n+=1,n>360)return[];for(let t=0;t=this.jb.start}ix(t){this.Zb=t,this.tM=!0}hx(){return!1===this.Zb}sx(t){this.Qb=t,this.tM=!0}Kv(){return this.Qb}mi(){return this.vi}_i(){return!1}ot(t,e,i,s){return this.x=new Ii(t.x,e.x,i.x,s?s.x:void 0),this.y=new Ii(t.y,e.y,i.y,s?s.y:void 0),this}yi(){return this.di}kx(){return this.qb}eM(){return this.tM}Wi(){return this.iM}j(){return this.o=!1,this.vi=!1,this.qb=!1,this.tM=!1,this}Z(){return this.o=!0,this.vi=!0,this.qb=!0,this.tM=!0,this}q(t,e){return"object"==typeof t?(this.X.x=t.x,this.X.y=t.y):(this.X.x=t,this.X.y=e),this.sM(),this}Ei(t){return this.Jb=t,this.sM(),this}Vi(t){return this.Kb=t,this.sM(),this}ni(){return u(this.Jb[0]+this.Jb[1],this.Kb[0]+this.Kb[1])}oi(){return this.X}sM(){const t=this.jb,e=u(this.x.ai(this.X.x),this.y.ai(this.X.y)),i=this.Jb[0]+this.Jb[1],s=this.Kb[0]+this.Kb[1],n=Math.max(e.x-i,0),r=Math.max(e.y-s,0),o=.5*(n>r?r:n),a=[this.Jb[0]+Math.max((n-2*o)/2,0),this.Jb[1]+Math.max((n-2*o)/2,0)],h=[this.Kb[0]+Math.max((r-2*o)/2,0),this.Kb[1]+Math.max((r-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.q(this.X.x).si(a).J(-l,l),this.y.q(this.X.y).si(h).J(-l,l),this.iM={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.di={x:this.x.yi(),y:this.y.yi()},this.Z()}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 n=this.Wi(),r=ei(t,e);return r.x*=s,r.y*=s,{x:t.x+i*n.x*r.x,y:t.y+i*n.y*r.y}}}class pu extends Kh{constructor(t,i,s,n,r,o,a){super(t,i,s,i.sg("polarChart bg",0),n,i.us.qi.polarChartBackgroundFillStyle,i.us.qi.polarChartBackgroundStrokeStyle,i.us.qi.polarChartTitleFont,i.us.qi.polarChartTitleFillStyle,a),this.coordsClient="client",this.Kd=[],this.jo=!0,this.vp=e.AutoCursorModes.onHover,this.hM=(t,e,i,s,n)=>{this.Lv.q(s,n)},this.if=Kt(this.Kd),this.rM=t=>{this.Kd.push(t)},this.nM=()=>this.iy,this.fs.zn||this.fs.Vn||this.fs.jn||this.us.As(4),this.oM=i.YS("polarChart series bg",0),this.aM=i.wp("polarChart axis gridlines",0),this.lM=i.wp("polarChart series",1),this.uM=i.wp("polarChart axis lines",2),this.cM=i.wp("polarChart axis ticks",3),this.Lv=s.d2({scaleXYConstructor:mu}),this.onResize(this.hM),this.ng.Bh("Polar Chart"),this.uy=this.oM.Fc(this.Lv).ke(this.qi.polarChartSeriesBackgroundFillStyle).Ce(nt).vu(0).ze(360)._u(0),this.Ay=this.oM.Fc(this.Lv).ke(V).Ce(this.qi.polarChartSeriesBackgroundStrokeStyle).vu(0).ze(360)._u(0),super.ly(this.uy,this.Ay),this.ig(r,this.pixelScale),this.dM=new Ml(this,this.Lv,this.qi,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.aM,this.uM,this.cM,this.es,this.nM),this.fM=new wl(this,this.Lv,this.qi,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.aM,this.uM,this.cM,this.es),this.coordsAxis={axisAmplitude:this.dM,axisRadial:this.fM},this.kp=i.Tp();const h=Dt(o?o.autoCursorBuilder:void 0,dh);this.Ag=h.$g(this.kp,this.uiScale,this.uiScale,this.qi),Ha.pg(this),this.yy(((t,e)=>{Ha.mg(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled))}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}solveNearest(t){const e=t||this.us.Bn();if(e)return Ha.gg(this,$o(e,this.us),this.iy)}translateCoordinate(t,e,i){if(i){const e=t,s=this.pixelScale,n=i;if(Ri(n)){const t=ut(e,s,this.engine.scale);return this.us.Xo({engineX:t.x,engineY:t.y})}if(Bi(n))return e;if(Cl(n)){const t=ut(e,s,this.Lv);return Vl(t,this.Lv)}}else{const i=t,s=e;if(Vi(i)){if(Cl(s)){const t=this.us.$o(i),e=ut({x:t.engineX,y:t.engineY},this.engine.scale,this.Lv);return Vl(e,this.Lv)}if(Ri(s))return i;if(Bi(s)){const t=this.us.$o(i);return ut({x:t.engineX,y:t.engineY},this.us.dt,this.pixelScale)}}else if(Dl(i)){if(Cl(s))return i;const t=zl([i],this.Lv)[0];if(Ri(s)){const e=ut(t,this.Lv,this.engine.scale),i={engineX:e.x,engineY:e.y};return this.us.Xo(i)}if(Bi(s))return ut(t,this.Lv,this.pixelScale)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new Nl(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPointSeries(t){const e=new Gl(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPointLineSeries(t){const e=new Ul(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addAreaSeries(t){const e=new gu(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addPolygonSeries(t){const e=new du(this.lM,this,this.ey,this.Lv,this.qi,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length,this.us.es);return this.gy(e),e}addHeatmapSeries(t){const e=new Bl(this.lM,this,this.ey,this.Lv,this.qi,this.us.es,t);return this.gy(e),e}addSector(){const t=new Il(this.lM,this,this.if,this.Lv,this.qi,this.us.es);return this.rM(t),t}getAmplitudeAxis(){return this.dM}getRadialAxis(){return this.fM}Fe(t){var e,i;super.Fe(t),Wa.cg(this.ng,this.eg);for(const t of this.iy)t.Gm();this.dM.vr(),this.fM.vr();for(const t of this.iy)t.Fe();for(let t=1;t<=2;t+=1){const e=this.dM.Fe(),i=this.fM.Fe(),s=Wa.ug(this.ng,this.eg),n=[this.Da.left+i,this.Da.right+i],r=[this.Da.bottom+i,this.Da.top+i+s];this.Lv.Ei(n).Vi(r);const o=4;if(!(!this.AM||Math.abs(this.AM.amplitude-e)>=o||Math.abs(this.AM.radial-i)>=o)||1!==t){this.AM={amplitude:e,radial:i};break}}const s=this.Lv.Xv().start,n=this.Lv.Xv().end,r=this.Lv.$v()?((null===(e=this.AM)||void 0===e?void 0:e.radial)||0)*this.Lv.x.getPixelSize()+n-s:((null===(i=this.AM)||void 0===i?void 0:i.radial)||0)*this.Lv.x.getPixelSize()+s-n;this.uy.xu(r).wu(360),this.Ay.xu(r).wu(360);for(const t of this.Kd)t.Fe();Ha.dg(this,this.uy.getIsUnderMouse(),!1,this.iy,(t=>Ha.gg(this,t,this.iy)),((t,e)=>t.gg(e,!0)));for(const t of this.iy)t.$p();return super.tg(),this.gM(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.dM.setAnimationsEnabled(t),this.fM.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.jo=t,this}getMouseInteractions(){return this.jo}getMinimumSize(){return u(yu,yu)}gM(){}forEachAxis(t){return t(this.dM),t(this.fM),this}dispose(){return this.Kd.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this.oM.W(),this.aM.W(),this.lM.W(),this.uM.W(),this.cM.W(),this.kp.W(),super.dispose()}Sd(){return[...this.iy,...this.Kd]}}const yu=300;class Au extends xh{}class xu extends Au{constructor(t,e,i,s,n,r,o,a){super(s,r,o,a),this._s="Slice",this.S=0,this.jg=!1,this.pM=V,this.Qg=V,this.Jg=this.S,this.tp=$((()=>this.Ji.us.bs())),this.sp=()=>{this.ep=void 0},this.index=t,this.Ji=s,this.scale=n,this.Ki=r,this.Xb=e.vc(n,rr.Simple).cs(this.getHighlight()),this.gs(this.Xb),this.Ye=i.kr(n).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0})}setValue(t){return this.Ji.getAnimationsEnabled()?this.getVisible()&&this.op(this.Jg,t):this.Jg=t,this.S=t,this.Ji.us.bs(),this}getValue(){return this.S}setVisible(t){return!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?(this.ep&&(this.ep.finish(!1),this.ep=void 0),this.op(this.Jg,0,(()=>super.setVisible(!1)))):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(this.ep&&(this.ep.finish(!1),this.ep=void 0),super.setVisible(!0),this.op(this.Jg,this.S)):(this.Jg=this.S,super.setVisible(!0)),this}op(t,e,i){this.ep=this.tp(300,X.ease)([[t,e]],(([t])=>{this.Jg=t,this.Ji.us.bs()})),this.ep.onEveryAnimationEnd(this.sp),i&&this.ep.onAnimationEnd(i)}setStyle(t,e,i,s){this.pM=t,this.Qg=i,this.Xb.ke(this.pM).Ce(e),this.Ye.ke(this.Qg).Vh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},vu=(t,i,s,n,r,o=0,a=e.FunnelSliceModes.VariableHeight,h)=>{i=bu(i,n.x),s=bu(s,n.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:h-i/2,y:n.y+r.bottom},f={x:h+i/2,y:n.y+r.bottom},g={x:0,y:r.bottom},m={x:0,y:r.bottom},p=0,y=0;if(o)for(let i=0;i0&&(d={x:g.x+A*o,y:g.y-o},f={x:m.x-A*o,y:m.y-o}),S=(i+c/u*(s-i))/2,g={x:h-S,y:parseInt(`${a===e.FunnelSliceModes.VariableWidth?d.y-x:x}`,10)},m={x:h+S,y:parseInt(`${a===e.FunnelSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&m.x>g.x&&y.Xb.Rl([g,d,f,m])}};class Mu extends Ga{constructor(t,i,s,n,r,o,a){super(t,i,s,i.sg("funnelChart bg",0),n,i.us.qi.funnelChartBackgroundFillStyle,i.us.qi.funnelChartBackgroundStrokeStyle,i.us.qi.funnelChartTitleFont,i.us.qi.funnelChartTitleFillStyle,o),this.ap=[],this.lp=ph.None,this.dp=!0,this.gp=0,this.mM=80,this.yM=20,this.SM=0,this.vM=e.FunnelSliceModes.VariableHeight,this.yp=!0,this.vp=e.AutoCursorModes.onHover,this.xp=Ah,this.bp=t=>{const e=this.ap.indexOf(t);e>=0&&(this.ap.splice(e,1),this.Mp())},this.fs.zn||this.fs.Vn||this.fs.Hn||this.us.As(5),this.Sp=this.qi.effectsText,this._p=i.wp("funnelChart bottom",0),this.Cp=i.wp("funnelChart top",1),this.ng.Bh("Funnel Chart"),this.up=this.qi.funnelChartSliceFillStylePalette,this.cp=this.qi.funnelChartSliceStrokeStyle,this.fp=this.qi.funnelChartSliceLabelFont,this.Ap=this.qi.funnelChartSliceLabelFillStyle,this.kp=i.Tp();const h=Dt(a?a.autoCursorBuilder:void 0,ch);this.Ag=h.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.setAnimationsEnabled(!0!==(null==a?void 0:a.disableAnimations)&&!1!==(null==a?void 0:a.animationsEnabled)),this.ig(r,this.pixelScale)}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}addSlice(t,e){const i=new xu(this.gp,this._p,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);return this.gp+=1,i.setName(t),i.setValue(e),i.es.rs.xs(this.Sp),i.es.ns.xs(this.yp),this.ap.push(i),this.us.bs(),i.setHighlightOnHover(this.dp),i}addSlices(t){const e=[];for(let i=0;ie.es.ns.xs(t))),this.us.bs(),this}getSliceEffect(){return this.yp}setSliceSorter(t){return this.lp=t,this.ap=this.ap.sort(this.lp),this.us.bs(),this}getSliceSorter(){return this.lp}setLabelFillStyle(t){return this.Ap="function"==typeof t?t(this.Ap):t,this.us.bs(),this}getLabelFillStyle(){return this.Ap}setLabelFont(t){return this.fp="function"==typeof t?t(this.fp):t,this.us.bs(),this}getLabelFont(){return this.fp}setLabelEffect(t){return this.Sp=t,this.ap.forEach((e=>e.es.rs.xs(t))),this.us.bs(),this}getLabelEffect(){return this.Sp}setLabelFormatter(t){return this.Ip=t,this.us.bs(),this}getLabelFormatter(){return this.Ip}setSliceHighlightOnHover(t){return this.dp=t,this.ap.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),Wa.cg(this.ng,this.eg),super.tg();const e=Wa.ug(this.ng,this.eg),i=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+e)),s=u(this.Da.left+i.x/2,this.Da.bottom+i.y/2);this.ap=this.ap.sort(this.lp);for(let t=0,{length:e}=this.ap;tt.getAnimatedValue()>0));let r=0;for(let t=0;t0?a/r:0);var a;for(let t=0;tgh(e,this.engine.scale,this.xp(new Za,this,t,o[n.indexOf(t)]||0).fc(),t,void 0))),this.Pp(n,o,s,i)}Fp(t,e){t.setStyle(this.ad?new U({color:this.ad.getColors(t.getAnimatedValue())}):this.up(e),this.cp,this.Ap,this.fp)}Mp(){this.ap=this.ap.sort(this.lp),this.us.bs()}Sd(){return this.ap}dispose(){return this.ap.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this._p.W(),this.Cp.W(),this.kp.W(),super.dispose()}}const Tu=(t,i,s)=>{const n=t.El();if(n.length>0){let t;const r=(n[1].y-n[0].y)/2+n[0].y;return t=i===e.FunnelLabelSide.Left?(n[0].x-n[1].x)/2+n[1].x-s:(n[2].x-(4===n.length?n[3].x:n[1].x))/2+(4===n.length?n[3].x:n[1].x)+s,{x:t,y:r}}},wu=t=>{const e=t.El();if(e.length>0)return{x:(e[2].x-e[1].x)/2+e[1].x,y:(e[1].y-e[0].y)/2+e[0].y}};class Eu extends Mu{constructor(){super(...arguments),this.Ip=yh.NamePlusValue,this.xM=10,this.bM=e.FunnelLabelSide.Left,this.MM=e.SliceLabelIndices.LabelsOnSides,this.Dp=[],this.Ep=this.qi.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Ep=t;for(let t=0;t{const e=this.ap.indexOf(t);e>=0&&this.ap.splice(e,1)},this.fs.zn||this.fs.Vn||this.fs.$n||this.us.As(6),this.Ts=e.wp("gaugeChart layer",0),this.Cp=e.wp("gaugeChart top layer",1),this.ng.Bh("Gauge Chart"),this.ig(n,this.pixelScale);const a=Yi();this.onBackgroundTouchStart(a.onTouchStart),this.onBackgroundTouchMove(a.onTouchMove),this.onBackgroundTouchEnd(a.onTouchEnd),this.setAnimationsEnabled(void 0===o||o)}dispose(){return this.Ts.W(),this.Cp.W(),this.ap.slice().forEach((t=>t.dispose())),super.dispose()}}class Fu extends _u{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,r,o),this.uu=90,this.cu=-270,this.CM={min:this.uu,max:this.cu},this.kM=$((()=>this.Ts.bs())),this.TM=()=>{this.FM=void 0},this.IM=e.wp("radialGaugeChart bg arc",2),this.PM=this.Ts.Fc(this.pixelScale).ke(this.qi.gaugeChartEmptyGaugeFillStyle).Ce(this.qi.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.uu,s=this.cu,n=this.CM;return this.getAnimationsEnabled()?this.DM(n,{min:t,max:e}):(n.min=t,n.max=e,this.uu=t,this.cu=e),this.D.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.us.bs(),this}getAngleInterval(){return{min:this.uu,max:this.cu}}setGaugeFillStyle(t){return this.PM.ke(t),this.us.bs(),this}setGaugeStrokeStyle(t){return this.PM.Ce(t),this.us.bs(),this}DM(t,e,i){this.FM=this.kM(1e3,X.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.CM={min:t,max:e},this.uu=t,this.cu=e,this.Ts.bs()})),this.FM.onEveryAnimationEnd(this.TM),i&&this.FM.onAnimationEnd(i)}onAngleIntervalChange(t){return this.D.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.D.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.IM.W(),this}}class Lu extends xh{BM(t){return this.D.on("valueChange",t)}LM(t){return this.D.on("valueIntervalChange",t)}offValueChange(t){return this.D.off(t,"valueChange")}offIntervalChange(t){return this.D.off(t,"valueIntervalChange")}attach(t,e=!0,i=!1){return super.attach(t,e,i),this.styleAttachedEntry(t,e,i),this}styleAttachedEntry(t,e=!0,i=!1){ae(t,this.qi,i,{fill:this.RM})}}class zu extends Lu{onValueChange(t){return this.BM(t)}onIntervalChange(t){return this.LM(t)}}class Pu extends zu{constructor(t,e,i,s,n,r,o){super(i,n,r,o),this.uu=0,this.cu=0,this.EM=0,this.VM=0,this.zM=0,this.OM=100,this.NM=!0,this.Jg=this.S,this.qg=this.getVisible(),this.tp=be(),this.GM=t=>{this.Jg=t,this.Ji.us.bs()},this.WM=t,this.Tr=e,this.Ji=i,this.scale=s,this.RM=this.qi.gaugeChartGaugeFillStyle,this.np=t.Fc(s).ke(this.RM).Ce(nt).cs(this.getHighlight()),this.gs(this.np),this.UM=e.kr(s).cs(this.getHighlight()),this.gs(this.UM,{isText:!0}),this.YM=e.kr(s).cs(this.getHighlight()),this.gs(this.YM,{isText:!0}),this.Ye=e.kr(s).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0}),this.UM.ke(r.gaugeChartIntervalLabelsFillStyle).Vh(r.gaugeChartIntervalLabelsFont),this.YM.ke(r.gaugeChartIntervalLabelsFillStyle).Vh(r.gaugeChartIntervalLabelsFont),this.Ye.ke(r.gaugeChartValueLabelFillStyle).Vh(r.gaugeChartValueLabelFont),this.setName("Gauge Slice")}Fe(){const t=this.Ji.getDataLabelFormatter(),e=this.uu/90n&&(i=n);const r=this.cu-e*this.VM,o=this.uu+e*this.EM,a=this.OM-this.zM,h=(0!==a?(r-o)/a:1/0)*(i-this.zM);this.np.vu(o).ze(o+h);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>n}):t.format(i);this.Ye.Bh(l)}HM(){const t=this.Ji.getIntervalLabelFormatter(),e="function"==typeof t?t(this.zM,{getInnerStart:()=>this.zM,getInnerEnd:()=>this.OM}):t.format(this.zM);return this.UM.Bh(e).Ds(),this.UM.oi()}$M(){const t=this.Ji.getIntervalLabelFormatter(),e="function"==typeof t?t(this.OM,{getInnerStart:()=>this.zM,getInnerEnd:()=>this.OM}):t.format(this.OM);return this.YM.Bh(e).Ds(),this.YM.oi()}setName(t){return super.setName(t),this.Ji.us.bs(),this}setValue(t){const e=this.S;return this.Ji.getAnimationsEnabled()?this.qg&&this.tp(e,t,this.GM):this.Jg=t,this.S=t,this.D.emit("valueChange",this,e,t),this.Ji.us.bs(),this}getValue(){return this.S}setVisible(t){return this.qg=t,!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?this.tp(this.Jg,0,this.GM,{onCompleted:()=>super.setVisible(!1)}):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(super.setVisible(!0),this.tp(this.Jg,this.S,this.GM)):(this.Jg=this.S,super.setVisible(!0)),this}setInterval(t,e){const i=this.zM,s=this.OM;return this.D.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.zM=t,this.OM=e,this.Ji.us.bs(),this}setIntervalLabelsFont(t){return this.UM.Vh(t),this.YM.Vh(t),this.Ji.us.bs(),this}getIntervalLabelsFont(){return this.UM.Eh()}setIntervalLabelsFillStyle(t){return this.UM.ke(t),this.YM.ke(t),this.Ji.us.bs(),this}getIntervalLabelsFillStyle(){return this.UM.Lh()}setIntervalLabelsVisible(t){return t?(this.UM.setVisible(!0),this.YM.setVisible(!0)):(this.UM.setVisible(!1),this.YM.setVisible(!1)),this.NM=t,this}getIntervalLabelsVisible(){return this.NM}setAngleInterval(t,e){return this.uu=t,this.cu=e,this.Ji.us.bs(),this}setMinAngle(t){return this.uu=t,this.Ji.us.bs(),this}setMaxAngle(t){return this.cu=t,this.Ji.us.bs(),this}setMarginInDegrees(t=this.EM,e=this.VM){return t!==this.EM&&(this.EM=t),e!==this.VM&&(this.VM=e),this.Ji.us.bs(),this}setFillStyle(t){this.RM="function"==typeof t?t(this.RM):t;const e=this.RM;this.np.ke(e);for(let t=0;tn?25*s:25*n))){const o=Array(r+2),a=Math.PI;let h=0,l=0;const c=e*a/180,d=(i*a/180-c)/r;for(o[h]=u(t.x,t.y),h+=1;h<=r+1;)o[h]=u(t.x+s*Math.cos(c+l*d),t.y+n*Math.sin(c+l*d)),h+=1,l+=1;return[o,r]}class Vu extends Fu{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n,r,o),this.nd=20,this.ZM=new Intl.NumberFormat,this.QM=new Intl.NumberFormat,this.JM=!1,this.KM=5;const a=new Pu(this.Ts,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);this.qM=a,this.ap.push(a),this.setPadding(10)}Fe(t){super.Fe(t),Wa.cg(this.ng,this.eg),super.tg();const e=Wa.ug(this.ng,this.eg),i=je([this.qM.HM(),this.qM.$M()]),s=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right+2*i.max.x),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+1*i.max.y+e)),n=Math.max(.5*Math.min(s.x,s.y),0),r=u(this.Da.left+i.max.x+.5*s.x,this.Da.bottom+i.max.y+.5*s.y),o=this.JM?this.t_(r,n):r,a=this.PM.Me.getThickness(),h=n-.5*a,l=n-this.nd;let c=l/n*100;c=c>100||c<0?99:c;const d=100*(1-(this.nd-a)/n);this.i_(o,l)&&(this.PM.xu(n)._u(c),this.qM.np.xu(h)._u(d));const f=.5*(g=n,(m=this.cu-this.uu)/(2*Math.PI*g*(m/360))*a);var g,m;this.PM.vu(this.uu).ze(this.cu).Ie(o),this.qM.np.Ie(o),this.qM.Ye.Ie(o),this.ad&&this.qM.setFillStyle(new U({color:this.ad.getColors(this.qM.getAnimatedValue())})),this.qM.setMinAngle(this.uu).setMaxAngle(this.cu).setMarginInDegrees(f,f).Fe();const p=this.PM.du();if(this.qM.getIntervalLabelsVisible()){this.s_(this.uu,this.cu,o,p+this.KM);const t=this.qM.UM.Ds().Ue(),e=this.qM.YM.Ds().Ue();Ve(t,e)&&this.e_(t,e,o,p+this.KM)}}i_(t,e){const i=si(this.qM.Ye.Ds().oi(),.5),s=t.x+e,n=t.x-e,r=t.y+e,o=t.y-e;return!(t.x+i.x>s||t.x-i.xr||t.y-i.y=0?i=-s:s=-i),[i,s]}t_(t,e){const[i]=Ru(t,this.uu,this.cu,e,e),s=je(i),n=.5*(s.max.x-s.min.x),r=.5*(s.max.y-s.min.y);return ni(ri(t,u(s.min.x+n,s.min.y+r)),t)}s_(t,e,i,s){const n=di(t),r=di(e);this.qM.UM.Ie(Ze(u(i.x+s,i.y),i,-n)),this.qM.YM.Ie(Ze(u(i.x+s,i.y),i,-r)),this.qM.UM.Ja(u(-Math.cos(n),-Math.sin(n))),this.qM.YM.Ja(u(-Math.cos(r),-Math.sin(r)))}getDefaultSlice(){return this.qM}setAutoScaling(t){return this.JM=t,this.us.bs(),this}getAutoScaling(){return this.JM}setDataLabelFormatter(t){return this.QM=t,this.us.bs(),this}getDataLabelFormatter(){return this.QM}setIntervalLabelFormatter(t){return this.ZM=t,this.us.bs(),this}getIntervalLabelFormatter(){return this.ZM}setIntervalLabelPadding(t){return this.KM=t,this.us.bs(),this}getIntervalLabelPadding(){return this.KM}setThickness(t){return this.nd=t,this}setLUT(t){return this.ad=t,this.us.bs(),this}setDataLabelFont(t){return this.qM.Ye.Vh(t),this.us.bs(),this}getDataLabelFont(){return this.qM.Ye.Eh()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.qM.XM(t),this.us.bs(),this}getDataLabelFillStyle(){return this.qM.jM()}Sd(){return this.ap}dispose(){return this.qM.dispose(),super.dispose()}}class Bu extends xh{}class Ou extends Bu{constructor(t,e,i,s,n,r,o,a){super(s,r,o,a),this._s="Slice",this.S=0,this.jg=!1,this.pM=V,this.Qg=V,this.Jg=this.S,this.tp=$((()=>this.Ji.us.bs())),this.sp=()=>{this.ep=void 0},this.index=t,this.Ji=s,this.scale=n,this.Ki=r,this.Xb=e.vc(n,rr.Simple).cs(this.getHighlight()),this.gs(this.Xb),this.Ye=i.kr(n).cs(this.getHighlight()),this.gs(this.Ye,{isText:!0})}setValue(t){return this.Ji.getAnimationsEnabled()?this.getVisible()&&this.op(this.Jg,t):this.Jg=t,this.S=t,this.Ji.us.bs(),this}getValue(){return this.S}setVisible(t){return!1===t?this.Ji.getAnimationsEnabled()&&this.Jg>0?(this.ep&&(this.ep.finish(!1),this.ep=void 0),this.op(this.Jg,0,(()=>super.setVisible(!1)))):(this.Jg=0,super.setVisible(!1)):this.Ji.getAnimationsEnabled()?(this.ep&&(this.ep.finish(!1),this.ep=void 0),super.setVisible(!0),this.op(this.Jg,this.S)):(this.Jg=this.S,super.setVisible(!0)),this}op(t,e,i){this.ep=this.tp(300,X.ease)([[t,e]],(([t])=>{this.Jg=t,this.Ji.us.bs()})),this.ep.onEveryAnimationEnd(this.sp),i&&this.ep.onAnimationEnd(i)}setStyle(t,e,i,s){this.pM=t,this.Qg=i,this.Xb.ke(this.pM).Ce(e),this.Ye.ke(this.Qg).Vh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Uu=(t,i,s,n,r,o=0,a=e.PyramidSliceModes.VariableHeight,h)=>{i=Nu(i,n.x),s=Nu(s,n.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:h-i/2,y:n.y+r.bottom},f={x:h+i/2,y:n.y+r.bottom},g={x:0,y:r.bottom},m={x:0,y:r.bottom},p=0,y=0;if(o)for(let i=0;i0&&(d={x:g.x+A*o,y:g.y-o},f={x:m.x-A*o,y:m.y-o}),S=(i+c/u*(s-i))/2,g={x:h-S,y:parseInt(`${a===e.PyramidSliceModes.VariableWidth?d.y-x:x}`,10)},m={x:h+S,y:parseInt(`${a===e.PyramidSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&m.x>=g.x&&y.Xb.Rl([g,d,f,m])}};class Gu extends Ga{constructor(t,i,s,n,r,o,a){super(t,i,s,i.sg("pyramidChart bg",0),n,i.us.qi.pyramidChartBackgroundFillStyle,i.us.qi.pyramidChartBackgroundStrokeStyle,i.us.qi.pyramidChartTitleFont,i.us.qi.pyramidChartTitleFillStyle,o),this.ap=[],this.lp=ph.None,this.up=this.qi.pyramidChartSliceFillStylePalette,this.cp=this.qi.pyramidChartSliceStrokeStyle,this.dp=!0,this.fp=this.qi.pyramidChartSliceLabelFont,this.Ap=this.qi.pyramidChartSliceLabelFillStyle,this.gp=0,this.mM=0,this.yM=80,this.SM=0,this.vM=e.PyramidSliceModes.VariableHeight,this.yp=!0,this.vp=e.AutoCursorModes.onHover,this.xp=Ah,this.bp=t=>{const e=this.ap.indexOf(t);e>=0&&(this.ap.splice(e,1),this.Mp())},this.fs.zn||this.fs.Vn||this.fs.Hn||this.us.As(8),this.Sp=this.qi.effectsText,this._p=i.wp("pyramidChart bottom",0),this.Cp=i.wp("pyramidChart top",1),this.ng.Bh("Pyramid Chart"),this.kp=i.Tp();const h=Dt(a?a.autoCursorBuilder:void 0,ch);this.Ag=h.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.ig(r,this.pixelScale),this.setAnimationsEnabled(!0!==(null==a?void 0:a.disableAnimations)&&!1!==(null==a?void 0:a.animationsEnabled))}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}addSlice(t,e){const i=new Ou(this.gp,this._p,this.Cp,this,this.pixelScale,this.bp,this.qi,this.us.es);return this.gp+=1,i.setName(t),i.setValue(e),i.es.rs.xs(this.Sp),i.es.ns.xs(this.yp),this.ap.push(i),this.us.bs(),i}addSlices(t){const e=[];for(let i=0;ie.es.ns.xs(t))),this.us.bs(),this}getSliceEffect(){return this.yp}setSliceSorter(t){return this.lp=t,this.ap=this.ap.sort(this.lp),this.us.bs(),this}getSliceSorter(){return this.lp}setLabelFillStyle(t){return this.Ap="function"==typeof t?t(this.Ap):t,this.us.bs(),this}getLabelFillStyle(){return this.Ap}setLabelFont(t){return this.fp="function"==typeof t?t(this.fp):t,this.us.bs(),this}getLabelFont(){return this.fp}setLabelEffect(t){return this.Sp=t,this.ap.forEach((e=>e.es.rs.xs(t))),this.us.bs(),this}getLabelEffect(){return this.Sp}setLabelFormatter(t){return this.Ip=t,this.us.bs(),this}getLabelFormatter(){return this.Ip}setSliceHighlightOnHover(t){return this.dp=t,this.ap.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),Wa.cg(this.ng,this.eg),super.tg();const e=Wa.ug(this.ng,this.eg),i=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+e)),s=u(this.Da.left+i.x/2,this.Da.bottom+i.y/2);this.ap=this.ap.sort(this.lp);for(let t=0,{length:e}=this.ap;tt.getAnimatedValue()>0));let r=0;for(let t=0;t0?a/r:0);var a;for(let t=0;tgh(e,this.engine.scale,this.xp(new Za,this,t,o[n.indexOf(t)]||0).fc(),t,void 0))),this.Pp(n,o,s,i)}Fp(t,e){t.setStyle(this.ad?new U({color:this.ad.getColors(t.getAnimatedValue())}):this.up(e),this.cp,this.Ap,this.fp)}Mp(){this.ap=this.ap.sort(this.lp),this.us.bs()}Sd(){return this.ap}dispose(){return this.ap.slice().forEach((t=>t.dispose())),this.Ag.dispose(),this._p.W(),this.Cp.W(),this.kp.W(),super.dispose()}}const Wu=(t,i,s)=>{const n=t.El();if(n.length>0){let t;const r=(n[1].y-n[0].y)/2+n[0].y;return t=i===e.PyramidLabelSide.Left?(n[0].x-n[1].x)/2+n[1].x-s:(n[2].x-(4===n.length?n[3].x:n[1].x))/2+(4===n.length?n[3].x:n[1].x)+s,{x:t,y:r}}},Yu=t=>{const e=t.El();if(e.length>0)return{x:(e[2].x-e[1].x)/2+e[1].x,y:(e[1].y-e[0].y)/2+e[0].y}};class Hu extends Gu{constructor(){super(...arguments),this.Ip=yh.NamePlusValue,this.xM=10,this.bM=e.PyramidLabelSide.Left,this.MM=e.SliceLabelIndices.LabelsOnSides,this.Dp=[],this.Ep=this.qi.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Ep=t;for(let t=0;t(t.alignmentX=(n+Math.PI/2)%(2*Math.PI)<=Math.PI?-1:1,t.alignmentY=n%(2*Math.PI)<=Math.PI?-1:1,t.paddingX=Math.cos(n)*r,t.paddingY=Math.sin(n)*r,t),Ju=(t,e,i,s,n,r,o,a)=>{if(0===e)return t.paddingX=a,t.alignmentX=-1,t};var Ku;e.SpiderWebMode=void 0,(Ku=e.SpiderWebMode||(e.SpiderWebMode={}))[Ku.Normal=0]="Normal",Ku[Ku.Circle=1]="Circle";class Zu{constructor(t,e,i,s,r,o,a,h){this.D=new n.Eventer,this.r_=t,this.Tr=e,this.scale=i,this.chart=s,this.tag=r,this.axisScale=o,this.n_=a,this.o_=h,this.a_=this.r_.Ve(this.scale).setMouseInteractions(!1),this.l_=this.Tr.kr(this.scale).Bh(this.tag).setMouseInteractions(!1),this.u_=this.n_(this,this.r_.zp(this.scale,void 0,[kh.InternalUI])).Ee(this.chart.getNibStyle()),this.o_.ps([this.l_])}Pp(t,i,s,n,r,o,a){const h=i.length,l=i[s>0?s-1:h-1],c=i[s],d=i[s{const r=s/i,o=[];for(let a=-s/2;a<=s/2;a+=n){const n=r*(a/s)+e,h=u(t.x+Math.cos(n)*i,t.y+Math.sin(n)*i);o.push(h)}return o})(t,n,r,f)),a?this.l_.setVisible(!0).Ie(ni(c,u(a.paddingX,a.paddingY))).Xa(a.alignmentX).Za(a.alignmentY):this.l_.setVisible(!1)}getLabelSize(){return this.l_.Vh(this.chart.getAxisLabelFont()).ke(this.chart.getAxisLabelStyle()).Ds().oi()}dispose(){this.a_&&this.a_.dispose(),this.l_&&this.l_.dispose(),this.u_&&this.u_.dispose()}}const Qu=(t,e,i,s,n)=>t.addRow(e.getName()).addRow("Axis:","",s).addRow("Value:","",n(i));class tc extends _l{constructor(t,i,s,n,r,o,a,h,l,u,c,d){super(t,l,u,d),this._s="Spider Series",this.Lu=new Map,this.Hi=e.HighlightModes.onHover,this.xp=Qu,this.Tx=8,this.Fa=0,this.c_=be(),this.d_={},this.f_={},this.qg=this.getVisible(),this.A_=1,this.g_=((t,e)=>{const i=$((()=>{}));let s,n,r=1;return(o,a,h)=>{if(o===n)return;n=o;const l=(null==h?void 0:h.easing)||X.ease,u=(null==h?void 0:h.durationMs)||1e3;s&&(s.finish(!1),s=void 0),!1===o?a&&r?(s=i(u,l)([[r,0]],(([e])=>{r=e,t(r)})),s.onAnimationEnd((()=>{s=void 0,e(!1)}))):(r=0,e(!1)):a?(e(!0),s=i(u,l)([[r,1]],(([e])=>{r=e,t(r)})),s.onAnimationEnd((()=>{s=void 0}))):(r=1,e(!0))}})((t=>{this.A_=t,this.Ts.us.bs()}),(t=>{super.setVisible(t)})),this.Ji=t,this.Ts=i,this.Fx=n,this.p_=r,this.HS=o,this.m_=a,this.y_=h,this.scale=s,this.S_=ce(u.spiderSeriesFillStyle,c),this.v_=ce(u.spiderSeriesStrokeStyle,c),this.x_=ce(u.spiderSeriesPointFillStyle,c)}Dm(){return this.Lm&&this.Lu.size>0&&this.getVisible()}addPoints(...t){this.Lu.size>0&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.c_(0,1,(t=>{e.forEach(((e,s)=>{const n=(null==i?void 0:i.get(s))||0;this.Lu.set(s,n+t*(e-n)),this.Ts.us.bs()}))}),{easing:this.d_.easing,durationMs:this.d_.durationMs,onStart:()=>{i=new Map(this.Lu)}})}else for(let e=0;e=3&&(this.Xb||(this.Xb=this.Ts.vc(this.scale,rr.Simple).Ce(this.v_).ke(this.S_).cs(this.getHighlight()),this.gs(this.Xb)),this.Xb.Rl(t),this.zc||(this.zc=this.Ts.Oc(this.scale).q(this.Tx).Sl(this.Fx).zh(this.Fa).ke(this.x_).cs(this.getHighlight()),this.gs(this.zc)),this.zc.Nt()._l(t))}}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.S_,stroke:this.v_}),this}yd(){return this.Fx}b_(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},ic=t=>je(t.l_.Ue()),sc=t=>je(t.Ue()),nc=(t,i,s,n)=>t._u(0).Ie(s).vu(90).ze(-270).wu(i===e.SpiderWebMode.Circle?void 0:n.length),rc={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},oc={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},ac=()=>{oc.alignmentX=0,oc.alignmentY=0,oc.paddingX=0,oc.paddingY=0};class hc extends Kh{constructor(t,i,s,n,r,o,a){super(t,i,s,i.sg("spiderChart bg",0),n,i.us.qi.spiderChartBackgroundFillStyle,i.us.qi.spiderChartBackgroundStrokeStyle,i.us.qi.spiderChartTitleFont,i.us.qi.spiderChartTitleFillStyle,a),this.Da=A(20,20,20,20),this.axisScale=ht.d1({scale1DConstructor:Ii,dimension:"x"}).J(0,1),this.HS=[],this.M_=[],this.__=[],this.w_=Rs.expansion,this.C_=!0,this.k_=Ju,this.T_=qu,this.jo=!0,this.F_=e.SpiderWebMode.Normal,this.I_=4,this.P_=this.qi.spiderChartWebStyle,this.D_=this.qi.spiderChartScaleLabelFillStyle,this.B_=this.qi.spiderChartScaleLabelFont,this.L_=5,this.R_=this.qi.spiderChartAxisLabelFillStyle,this.E_=this.qi.spiderChartAxisLabelFont,this.V_=5,this.z_=this.qi.spiderChartAxisStrokeStyle,this.O_=this.qi.spiderChartAxisNibStrokeStyle,this.Dd=10,this.N_=A(),this.vp=e.AutoCursorModes.onHover,this.hasAxis=t=>this.HS.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.Di(t,Ci.Numeric),this.G_=()=>{const t=this.HS.map(ic).concat(this.__.map(sc));return Oe(t)},this.W_=()=>this.U_.Fc(this.pixelScale).setMouseInteractions(!1),this.Y_=t=>t.dispose(),this.H_=()=>this.vf.kr(this.pixelScale).setMouseInteractions(!1),this.X_=t=>t.dispose(),this.j_=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.Z_=(t,e)=>{let i,s;const n=()=>{void 0!==this.Q_&&this.Q_.finish(),i=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.w_,this.w_=void 0},r=(e,s,n,r,o)=>{const a=u(n.x-s.x,s.y-n.y),h=this.HS.findIndex((e=>e===t));if(h>=0&&void 0!==i){const e=ec(h,this.HS.length),s=u(Math.cos(e),Math.sin(e)),n=a.x*s.x+a.y*s.y,r=ii(ri(t.a_.Ii(),t.a_.Ti())),l=i.min+(i.max-i.min)*Math.max(1+n/r,.01);this.axisScale.J(i.min,l),jt(o),this.us.bs()}},o=()=>{if(i=void 0,void 0!==s)if(this.th){const t=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.J_(),i=s;if(void 0!==e){const s=i.start(t.min,t.max,e.min,e.max),n=i.end(t.min,t.max,e.min,e.max);this.Q_=this.zA.us.Zr(300,X.ease)([[0,1]],(([e])=>{this.axisScale.J(t.min+e*(s-t.min),t.max+e*(n-t.max))})),this.Q_.onAnimationEnd((()=>{this.Q_=void 0,this.w_=i}))}else this.w_=s}else this.w_=s;s=void 0};e.setMouseEnterEventHandler(this.K_).setMouseLeaveEventHandler(this.q_).setMouseDragStartEventHandler(n).setMouseDragEventHandler(((t,e,i,s,n)=>r(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const a=Yi(new Xi(((t,e,i)=>{this.K_(t),n(),jt(i)}),r,((t,e,i,s)=>{this.q_(t),o(),jt(s)})));return e.setTouchStartEventHandler(a.onTouchStart).setTouchMoveEventHandler(a.onTouchMove).setTouchEndEventHandler(a.onTouchEnd)},this.tw=t=>{this.C_&&!this.hasAxis(t)&&this.addAxis(t)},this.m_=(t,e)=>{for(const i of this.HS)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return He(i.a_.Ii(),i.a_.Ti(),t)}},this.y_=t=>{if(0===this.HS.length)return;const e=ri(ut(t,this.engine.scale,this.pixelScale),this.HS[0].a_.Ii()),i=Math.atan2(e.y,e.x);let s,n=_e;for(const t of this.HS){const e=ri(t.a_.Ti(),t.a_.Ii()),r=Math.atan2(e.y,e.x),o=Math.abs(i-r);o{this.jo&&(t.Ee(this.O_),this.us.bs())},this.q_=t=>{t.Ee(this.O_),this.us.bs()},this.fs.zn||this.fs.Vn||this.fs.Xn||this.us.As(9),this.oM=i.YS("spiderChart series bg",0),this.U_=i.wp("spiderChart web shapes",0),this.iw=i.wp("spiderChart axis bg",1),this.yv=i.wp("spiderChart plotting",2),this.vf=i.wp("spiderChart fg",3),this.o_=this.es.gA().xs(this.qi.effectsText),this.ng.Bh("Spider Chart"),this.uy=this.oM.Fc(this.pixelScale).ke(this.qi.spiderChartSeriesBackgroundFillStyle).Ce(nt).vu(90).ze(-270)._u(0),this.Ay=this.oM.Fc(this.pixelScale).ke(V).Ce(this.qi.spiderChartSeriesBackgroundStrokeStyle).vu(90).ze(-270)._u(0),super.ly(this.uy,this.Ay),this.kp=i.Tp();const h=Dt(o?o.autoCursorBuilder:void 0,lh);this.Ag=h.$g(this.kp,this.uiScale,this.uiScale,this.qi),Ha.pg(this),this.yy(((t,e)=>{Ha.mg(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.ig(r,this.pixelScale)}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}solveNearest(t){const e=t||this.us.Bn();if(e)return Ha.gg(this,$o(e,this.us),this.iy)}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Zu(this.iw,this.vf,this.pixelScale,this,t,this.axisScale,this.Z_,this.o_);this.HS.push(e)}}else t&&this.HS.push(t);return this.o_.ps(this.HS.map((t=>t.l_))),this.us.bs(),this}addSeries(t){const i="object"==typeof t?t.pointShape?t.pointShape:e.PointShape.Circle:t||e.PointShape.Circle,s="object"==typeof t&&t.automaticColorIndex?t.automaticColorIndex:this.iy.length,n=new tc(this,this.yv,this.pixelScale,i,this.tw,this.HS,this.m_,this.y_,this.ey,this.qi,s,this.us.es);return this.gy(n),n}getSeriesCount(){return this.iy.length}setWebMode(t){return this.F_=t,this.us.bs(),this}getWebMode(){return this.F_}setWebCount(t){return this.I_=t,this.us.bs(),this}getWebCount(){return this.I_}setWebStyle(t){return this.P_="function"==typeof t?t(this.P_):t,this.us.bs(),this}getWebStyle(){return this.P_}setScaleLabelStyle(t){return this.D_="function"==typeof t?t(this.D_):t,this.us.bs(),this}getScaleLabelStyle(){return this.D_}setScaleLabelFont(t){return this.B_="function"==typeof t?t(this.B_):t,this.us.bs(),this}getScaleLabelFont(){return this.B_}setScaleLabelPadding(t){return this.L_=t,this.us.bs(),this}getScaleLabelPadding(){return this.L_}setScaleLabelStrategy(t){return this.k_=t,this.us.bs(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.us.bs(),this}setAxisLabelStyle(t){return this.R_="function"==typeof t?t(this.R_):t,this.us.bs(),this}getAxisLabelStyle(){return this.R_}setAxisLabelFont(t){return this.E_="function"==typeof t?t(this.E_):t,this.us.bs(),this}getAxisLabelFont(){return this.E_}setAxisLabelEffect(t){return this.o_.xs(t),this.us.bs(),this}getAxisLabelEffect(){return this.o_.Ms()}setAxisLabelPadding(t){return this.V_=t,this.us.bs(),this}getAxisLabelPadding(){return this.V_}setAxisLabelStrategy(t){return this.T_=t,this.us.bs(),this}setAxisStyle(t){return this.z_="function"==typeof t?t(this.z_):t,this.us.bs(),this}getAxisStyle(){return this.z_}setNibStyle(t){return this.O_="function"==typeof t?t(this.O_):t,this.us.bs(),this}getNibStyle(){return this.O_}setNibLength(t){return this.Dd=t,this.us.bs(),this}getNibLength(){return this.Dd}setAutoAxis(t){return this.C_=t,this}getAutoAxis(){return this.C_}setMouseInteractions(t){return this.jo=t,this}getMouseInteractions(){return this.jo}setAxisScrollStrategy(t){return this.w_=t,this.us.bs(),this}getAxisScrollStrategy(){return this.w_}setAxisInterval(t,e=0){return this.axisScale.J(e,t),this.us.bs(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}Fe(t){super.Fe(t),Wa.cg(this.ng,this.eg);const e=this.HS.length,i=Wa.ug(this.ng,this.eg),s=u(this.pixelScale.x.getInnerInterval()-(this.Da.left+this.Da.right),this.pixelScale.y.getInnerInterval()-(this.Da.bottom+this.Da.top+i)),n=((t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}))(0,0,0,0);if(void 0!==this.T_){const t=Math.min(s.x,s.y)/2;for(let i=0;i0?n.right=Math.max(n.right,l.x+.5*(1-h.alignmentX)*a.x-t):n.left=Math.max(n.left,-l.x+.5*(h.alignmentX+1)*a.x-t),o>0?n.top=Math.max(n.top,l.y+.5*(1-h.alignmentY)*a.y-t):n.bottom=Math.max(n.bottom,-l.y+.5*(h.alignmentY+1)*a.y-t)}}if(this.w_){const t=this.J_();if(void 0!==t){const e=this.w_.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.w_.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.J(e,i)}}const r=u(this.pixelScale.x.getInnerStart()+(n.left+this.pixelScale.x.getInnerInterval()-n.right)/2,this.pixelScale.y.getInnerStart()+(n.bottom+this.pixelScale.y.getInnerInterval()-n.top)/2),o=Math.min(s.x/2-(n.left+n.right)/2,s.y/2-(n.bottom+n.top)/2);this.N_=A(this.Xt.left+this.Da.left+n.left,this.Xt.top+this.Da.top+i+n.top,this.Xt.right+this.Da.right+n.right,this.Xt.bottom+this.Da.bottom+n.bottom),this.Pp(r,o);for(const t of this.iy)t.Gm();for(const t of this.iy)t.Fe();super.tg(),Ha.dg(this,this.uy.getIsUnderMouse(),!1,this.iy,(t=>Ha.gg(this,t,this.iy)),((t,e)=>t.gg(e,!0)));for(const t of this.iy)t.$p()}dispose(){return this.oM.W(),this.U_.W(),this.iw.W(),this.yv.W(),this.vf.W(),this.Ag.dispose(),this.kp.W(),super.dispose()}getMinimumSize(){return u(this.N_.left+this.N_.right+100,this.N_.bottom+this.N_.top+100)}Pp(t,e){const i=this.HS.length,s=[];for(let n=0;n{const h=t.length,l=r.length,u=e>0&&l>1;for(let l=0;l=h&&t.push(o());const a=t[l];nc(a,i,s,r);const u=n*((l+1)/e);a.xu(u)}else l{const c=n.length,d=t.length;let f=0;if(void 0!==e)for(let h=0;h=d&&t.push(a());const e=t[f];f+=1;const s=(i-n)/i,c=He(r,o[h],s);e.Ie(ni(c,u(p.paddingX,p.paddingY))).Xa(p.alignmentX).Za(p.alignmentY).Bh(l(s))}}}for(let e=f;e1;for(const s of this.HS)for(const n of this.iy){const r=n.getValue(s.tag,i);void 0!==r&&(t=void 0===t?r:Math.min(t,r),e=void 0===e?r:Math.max(e,r))}if(void 0!==t&&void 0!==e)return m(t,e)}}const lc=t=>({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...Oh(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Sr().x))}),uc=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...Oh(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Sr().y))});var cc;e.StepOptions=void 0,(cc=e.StepOptions||(e.StepOptions={}))[cc.before=0]="before",cc[cc.middle=.5]="middle",cc[cc.after=1]="after";const dc=(t,e)=>{const i=[],s=t.length,n=e;if(s>0){let e=0,r=t[0];i[e]=r,e+=1;for(let o=1;o{const i=t*t,s=i*t,n=1-t,r=n*n,o=r*n;return u(o*e[0].x+3*t*r*e[1].x+3*i*n*e[2].x+s*e[3].x,o*e[0].y+3*t*r*e[1].y+3*i*n*e[2].y+s*e[3].y)},gc=(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 n=u(0,0),r=u(0,0),o=u(0,0),a=ti(ri(t[1],t[0]));const h=3;let l=0,c=0;for(let d=0;de?Math.abs(i/(h*n.x)):1,c=Math.abs(r.x)>e?Math.abs(i/(h*r.x)):1}f[1]=ni(si(n,l),f[1]),f[2]=ri(f[2],si(r,c)),s[d]=f}}return s.length>0?s:[]})(t),s=i.length,n=Array(s*e);let r=0;for(let t=0;t{if(this.wb.length>0){const e=this.wb[this.wb.length-1];if(t.length>0){const i=e.yl(),s=e.ml(),n=i.length+s.length-+e.ql();if(n>=this.Db){const r=s.length>0?s[s.length-1]:i[e.ql()?n:n-1],o=u((r.x+t[0].x)/2,(r.y+t[0].y)/2);e._l(o,m(u(o.x,o.y),u(o.x,o.y))).tu(!0),this.nw([o].concat(t)).Kl(!0)}else e._l(t,this.Ib)}}else t.length>0&&this.nw(t)},this.ow=t=>{if(this.hw.length>0){const e=this.hw[this.hw.length-1];t.length>0&&((e.yl().length+e.ml().length)*this.ew>=this.Db?this.aw(t):e._l(t))}else t.length>0&&this.aw(t)},this.lw=(t,e)=>{const i=t.gg(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.uw=(t,e)=>{const i=t.cw(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.En=p,this.Fx=l,this.dw=f,this.fw=ce(c.pointLineSeriesFillStyle,g),this.Cu=ce(this.qi.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}Lb(){return au(this.hw)}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;for(let t=0;tt.Vn||t.zn||t.ro?void 0:"bubble chart"));for(let e=0;ee.setVisible(t))),this}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorSolveBasis(t){return this.sw=t,this.wb.forEach((e=>e.pl(Ln(t)))),this.hw.forEach((e=>e.pl(Ln(t)))),this.Ts.bs(),this}getCursorSolveBasis(){return this.sw}ld(){return he(this.fw)||he(this.Cu.getFillStyle())}yd(){return this.Fx}mb(t){}Pe(t,e){t.cs(e),this.Ts.bs()}Bb(t){const e=this.wb.length>0?this.wb[this.wb.length-1].yl().length+this.wb[this.wb.length-1].ml().length-+this.wb[this.wb.length-1].ql():void 0;ou(t,e,this.Db,this.rw),ou(t,e,this.Db,this.ow)}aw(t,e){const i=this.Ts.Oc(this.scale)._l(t,e).setMouseInteractions(this.Yi).ke(this.fw).Sl(this.Fx).q(this.Tx).zh(this.Fa).xl(this.hl).bl(this.rl).Ml(this.nl).pl(Ln(this.sw)).cs(this.getHighlight());return this.gs(i),this.hw.push(i),i}nw(t,e){const i=this.Ts.zp(this.scale,void 0,[kh.UserSeries,...this.dw])._l(t,e).setMouseInteractions(this.Yi).Ee(this.Cu).pl(Ln(this.sw)).cs(this.getHighlight());return this.gs(i),this.wb.push(i),i}attach(t,e=!0,i=!1){return ae(t,this.qi,i,{stroke:this.Cu,fill:this.fw}),super.attach(t,e,i)}getPointAmount(){return this.hw.reduce(((t,e)=>t+e.wl()+e.Cl()),this.Lu.length)}clear(){super.clear();for(let t=0;t{}))}gg(t,e,i=this.mx){const s=i?cu(t,e?this.wb.filter((t=>t.getIsUnderMouse())):this.wb,this.uw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):cu(t,e?this.hw.filter((t=>t.getIsUnderMouse())):this.hw,this.lw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==s){const t=ut(s[0],this.Ts.us.dt,this.scale),e=s[1]instanceof lr?s[1].ku():s[1].Lh(),i=s[1]instanceof Qn?s[1].Lh():void 0,n=s[1]instanceof lr?s[1].ku().getFillStyle():void 0,r=W(e)?s[0].color?new U({color:s[0].color}):new U({color:e.getFallbackColor()}):void 0;return gh(t,this.scale,this.xp(new Za,this,t.x,t.y,t).fc(),this,n||r||i)}}solveNearestFromScreen(t,e=this.mx){return this.gg($o(t,this.Ji.us),!1,e)}}const pc=(t,e)=>t.ml().length>=e?t.ml().slice(-e):Array.prototype.concat(t.yl(),t.ml()).slice(-e),yc=(t,e,i)=>{const s=Array.prototype.concat(t.yl(),t.ml()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Nt()._l(s).Ds()};class Ac extends mc{constructor(t,e,i,s,n,r,o,a,h,l,u,c,d,f,g){super(t,e,i,s,n,r,o,a,h,l,u,c,d,f,g),this._s="Spline Series",this.ew=32,this.Db=8e3,this.Aw=t=>{if(0===t.length)return;const e=this.hw.length;if(e>0){const i=e>1,s=this.hw[e-1];if(i){const i=Array.prototype.concat(s.yl(),s.ml()),n=i.length;if(32*n>=this.Db){const i=pc(s,3),n=Array.prototype.concat(i,t),r=gc(n,32);yc(this.wb[e-1],r,32),this.nw(r.slice(66))}else if(n<5){const s=this.hw[e-2],n=pc(s,3),r=Array.prototype.concat(n,i,t),o=gc(r,32),a=this.wb[e-1],h=o.slice(66);a.Nt()._l(h).Ds()}else{const i=this.wb[e-1],n=Array.prototype.concat(i.yl(),i.ml()),r=pc(s,4),o=Array.prototype.concat(r,t),a=gc(o,32),h=n.slice(0,-66).concat(a.slice(33));i.Nt()._l(h).Ds()}}else{const i=Array.prototype.concat(s.yl(),s.ml()),n=i.length,r=this.wb[e-1];if(32*n>=this.Db){const e=pc(s,3),i=Array.prototype.concat(e,t),n=gc(i,32);yc(this.wb[0],n,32),this.nw(n.slice(66))}else if(n+t.length>1){const e=Array.prototype.concat(i,t),s=gc(e,32);r.Nt()._l(s).Ds()}else r._l(t)}}else{const e=t.length>0?gc(t,32):t,i=je(e);this.nw(e,i)}this.ow(t)}}setCursorInterpolationEnabled(t){return super.setCursorInterpolationEnabled(t)}Bb(t){const e=this.hw.length,i=this.hw.length>0?this.hw[e-1].yl().length+this.hw[e-1].ml().length:void 0;ou(t,i,Math.ceil(this.Db/this.ew),this.Aw)}solveNearestFromScreen(t,e=this.mx){if(e)return super.solveNearestFromScreen($o(t,this.Ji.us),e);const i=cu($o(t,this.Ji.us),this.hw,this.lw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==i){const t=ut(i[0],this.Ts.us.dt,this.scale);return gh(t,this.scale,this.xp(new Za,this,t.x,t.y,t).fc(),this,i[1].Lh())}}}class xc{constructor(){this.Gi="FreeformPattern",this.Gl={type:"disabled",packager:(t,e,i)=>t.slice()}}Pb(t,e,i,s,n,r){if(s>0){const n=Math.trunc((e-s)/i);if(n>0&&t.length>1){const e=t.splice(0,n);for(let t=0;t{switch(t){case"normal":default:return 1;case"high":return.25}},bc=s.Record({Gl:{type:"disabled",packager:(t,e,i)=>t.slice()}});class vc extends bc{Pb(t,e,i,s,n,r){if(s>0){const e=Math.ceil(s/i),o=t.length-e;if(o>0){const e=this.pw(t,n);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.bt();return t?Math.min(i,t):i},Tc=(t,e)=>{const i=e.Mt();return t?Math.max(i,t):i};class wc extends vc{gw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(Tc,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(Mc,e?e.min.y:void 0)}}const Ec=(t,e)=>{const i=e.vt();return t?Math.min(i,t):i},kc=(t,e)=>{const i=e.xt();return t?Math.max(i,t):i};class Cc extends vc{gw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(kc,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(Ec,e?e.min.x:void 0)}}const Dc={horizontalProgressive:new class extends wc{constructor(){super({Gl:En()}),this.Gi="HorizontalProgressivePattern"}pw(t,e){const i=t.length,s=Math.min(e.x.getInnerStart(),e.x.getInnerEnd());let n=0;if(i>1)for(let r=0;r0?t[t.length-1].xt():void 0}getXMin(t=[],e){return t.length>0&&t[0].wl()>0?t[0].vt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",En(Sc(t)))}},horizontalRegressive:new class extends wc{constructor(){super({Gl:kn()}),this.Gi="HorizontalRegressivePattern"}pw(t,e){const i=t.length,s=Math.max(e.x.getInnerStart(),e.x.getInnerEnd());let n=0;if(i>1)for(let r=0;r0&&t[0].wl()>0?t[0].xt():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",kn(Sc(t)))}},verticalProgressive:new class extends Cc{constructor(){super({Gl:Cn()}),this.Gi="VerticalProgressivePattern"}pw(t,e){const i=t.length,s=Math.min(e.y.getInnerStart(),e.y.getInnerEnd());let n=0;if(i>1)for(let r=0;r0?t[t.length-1].Mt():void 0}getYMin(t=[],e){return t.length>0&&t[0].wl()>0?t[0].bt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",Cn(Sc(t)))}},verticalRegressive:new class extends Cc{constructor(){super({Gl:Dn()}),this.Gi="VerticalRegressivePattern"}pw(t,e){const i=t.length,s=Math.max(e.y.getInnerStart(),e.y.getInnerEnd());let n=0;if(i>1)for(let r=0;r0&&t[0].wl()>0?t[0].Mt():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].bt():void 0}setPrecision(t){return this.set("_columnPackaging",Dn(Sc(t)))}},freeform:new xc};class Ic extends mc{constructor(t,e,i,s,n,r,o,a,h,l,c,d,f,g,p){super(t,e,i,s,n,r,o,a,Dc.horizontalProgressive,h,c,d,f,g,p),this._s="Step Series",this.rw=t=>{const e=this.wb.length>0?this.wb[this.wb.length-1].yl().length+this.wb[this.wb.length-1].ml().length:void 0;ou(t,e,this.Db,this.mw)},this.mw=t=>{const e=t.length;if(this.wb.length>0){const i=this.wb[this.wb.length-1];if(e>0){const e=i.yl(),s=i.ml(),n=s.length>0?s[s.length-1]:e[e.length-1],r=dc([n].concat(t),this.yw);r.shift();const o=u((n.x+r[0].x)/2,(n.y+r[0].y)/2),a=Array.prototype.concat(o,r);(s.length>0?e.length+s.length:e.length)>=this.Db?(i._l(o,m(u(o.x,o.y),u(o.x,o.y))).tu(!0),this.nw(a).Kl(!0),this.aw(t)):i._l(a)}}else e>0&&this.nw(dc(t,this.yw));this.ow(t)},this.yw=l,void 0===this.dw.find((t=>"DataPattern"===t.type))&&this.dw.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class _c extends uu{constructor(t,e,i,s,n,r,o,a,h,l,u,c,d,f){super(t,e,i,s,n,r,o,a,h,l,u),this.wb=[],this._s="Line Series",this.mx=!0,this.Db=void 0,this.sw="nearest-x",this.Ru=void 0,this.ld=()=>he(this.Cu.getFillStyle()),this.Sw=(t,e)=>{const i=t.Cx(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.uw=(t,e)=>{const i=t.cw(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.dw=c,this.En=f,this.Cu=ce(this.qi.lineSeriesStrokeStyle,d),this.xw={individualLookupValuesEnabled:void 0!==(null==f?void 0:f.individualLookupValuesEnabled)&&f.individualLookupValuesEnabled}}add(t){return super.add(t),this}setMouseInteractions(t){return super.setMouseInteractions(t)}setStrokeStyle(t){this.Cu="function"==typeof t?t(this.Cu):t;const e=this.Cu;for(let t=0;tt.Eu(this.Ru))),this.Ts.bs(),this}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorSolveBasis(t){return this.sw=t,this.wb.forEach((e=>e.pl(Ln(t)))),this.Ts.bs(),this}getCursorSolveBasis(){return this.sw}mb(t){}Bb(t){let e=this.wb[0];e||(e=this.nw(),this.wb.push(e),this.gs(e)),e._l(t,this.Ib)}nw(){return this.Ts.zp(this.scale,this.xw,[kh.UserSeries,...this.dw]).Ee(this.Cu).Eu(this.Ru).pl(Ln(this.sw)).cs(this.getHighlight())}attach(t,e=!0,i=!1){return ae(t,this.qi,i,{stroke:this.Cu}),super.attach(t,e,i)}Pe(t,e){t.cs(e),this.Ts.bs()}Pb(t,e,i,s){}gg(t,e,i=this.mx){const s=cu(t,e?this.wb.filter((t=>t.getIsUnderMouse())):this.wb,i?this.uw:this.Sw,"nearest-x"===this.sw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.sw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2);if(void 0!==s){const t=ut(s[0],this.Ts.us.dt,this.scale),e=s[1].ku();return gh(t,this.scale,this.xp(new Za,this,t.x,t.y,t).fc(),this,e.getFillStyle())}}solveNearestFromScreen(t,e=this.mx){return this.gg($o(t,this.Ji.us),!1,e)}}class Fc extends cr{constructor(t,e,i,s,r,o,a,h,l){super(),this.ia=Ce(),this.D=new n.Eventer,this.bw=s,this.Mw=r,this._w=o,this.ww=a,this.Cw=h,this.Ts=t,this.scale=e,this.kw=i,this.qi=l}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}dispose(){return this.kw&&this.kw(this),this.Ts.us.bs(),this.D.emit("dispose",this),this}setVisible(t){return super.setVisible(t),this._w(),this.Ts.us.bs(),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}setMouseInteractions(t){return this.ww(this,t),this}getMouseInteractions(){return this.Cw(this)}}class Lc extends ru{constructor(){super(...arguments),this.Tw=[],this.Fw=void 0,this.Iw=!1,this.kw=t=>{const e=this.Tw.findIndex((e=>e===t));e>=0&&this.Tw.splice(e,1),this.Iw=!0,this.Fw=void 0,this.Ts.bs()},this.bw=()=>{this.Fw=void 0,this.Iw=!0,this.Ji.us.bs()},this.Mw=()=>{this.Iw=!0,this.Ji.us.bs()},this._w=()=>{this.Fw=void 0,this.Iw=!0,this.chart.us.bs()},this.ww=(t,e)=>{this.setMouseInteractions(e)},this.Pw=t=>this.getMouseInteractions()}Fe(){super.Fe(),this.Iw&&(this.Dw(this.Tw),this.Iw=!1)}clear(){return this.Tw.slice().forEach(Tt),this.Tw.length=0,this.Iw=!0,this.Fw=void 0,this.Ts.bs(),this}Bw(t,e){void 0!==e?this.Tw.splice(e,0,t):this.Tw.push(t),this.Iw=!0,this.Lw&&this.Lw(t),t.onMouseEnter(((t,e)=>this.wt(t,e))),t.onMouseLeave(((t,e)=>this.Ct(t,e))),t.onMouseClick(((t,e)=>this.kt(t,e))),t.onMouseDoubleClick(((t,e)=>this.Tt(t,e))),t.onMouseDown(((t,e)=>this.Ft(t,e))),t.onMouseUp(((t,e)=>this.It(t,e))),t.onMouseMove(((t,e)=>this.Pt(t,e))),t.onMouseDragStart(((t,e,i)=>this.Bt(t,e,i))),t.onMouseDrag(((t,e,i,s,n)=>this.Dt(t,e,i,s,n))),t.onMouseDragStop(((t,e,i,s)=>this.Lt(t,e,i,s))),t.onMouseWheel(((t,e)=>this.Rt(t,e))),t.onTouchStart(((t,e)=>this.Et(t,e))),t.onTouchMove(((t,e)=>this.Vt(t,e))),t.onTouchEnd(((t,e)=>this.zt(t,e))),this.Ts.bs()}Dm(){return this.Lm&&this.Tw.length>0&&this.getVisible()}setDefaultStyle(t){this.Lw=t,this.Tw.forEach(t),t(this.Rw);for(let t=0;tt.getVisible()&&t.getIsUnderMouse())):this.Tw.filter((t=>t.getVisible())),this.Vw,We);if(void 0!==i)return{location:ut(i[0],this.Ts.us.dt,this.scale),scale:this.scale,resultTableContent:this.xp(new Za,this,i[1]).fc(),owner:this,fillStyle:i[1].getDominantStyle(),figure:i[1]}}solveNearestFromScreen(t){return this.gg($o(t,this.Ji.us),!1)}getXMax(){return this.Fw||(this.Fw=this.zw()),this.Fw.max.x}getXMin(){return this.Fw||(this.Fw=this.zw()),this.Fw.min.x}getYMax(){return this.Fw||(this.Fw=this.zw()),this.Fw.max.y}getYMin(){return this.Fw||(this.Fw=this.zw()),this.Fw.min.y}Sr(){return u(0,0)}zw(){const t=m(c(_e,_e),c(Fe,Fe));for(let e=0;e0?this.Tw[0].getDominantStyle():this.Rw.getDominantStyle()})}}class zc extends Fc{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,i,s,n,r,o,a,h),this.Ow={x:0,y:0,width:0,height:0},this.Nw={x1:0,y1:0,x2:0,y2:0},this.ol=m(u(0,0),u(0,0)),this.be=ce(h.rectangleSeriesFillStyle,l),this.Ts=t,this.scale=e,this.Me=ce(h.rectangleSeriesStrokeStyle,l)}getBoundaries(){return this.ol}setDimensions(t){return"x"in t?(this.Ow=t,this.Nw={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.Nw=t,this.Ow={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.ol=je([this.Ow,u(this.Ow.x+this.Ow.width,this.Ow.y+this.Ow.height)]),this.bw(),this.Ts.bs(),this}getDimensionsPositionAndSize(){return this.Ow}getDimensionsTwoPoints(){return this.Nw}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Mw(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Mw(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Pc extends Lc{constructor(t,e,i,s,n,r,o,a,h,l,c){super(t,e,i,s,n,r,o,a,h,l),this._s="Rectangle Series",this.xp=(t,e,i)=>{const s=i.getDimensionsPositionAndSize();return t.addRow(e._s).addRow("X","",e.axisX.formatValue(s.x)).addRow("Y","",e.axisX.formatValue(s.y)).addRow("Width","",e.axisX.formatValue(s.width)).addRow("Height","",e.axisX.formatValue(s.height))},this.Gw=Ee(),this.Vw=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return ut(i,this.scale,this.Ts.us.dt)},this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Ww=c,this.Rw=new zc(this.Ts,this.scale,wt,wt,wt,wt,wt,(t=>!1),this.qi,this.Ww).dispose(),this.Uw=new Lh((()=>{const t=this.Gw._t(this.Ts.bv(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.figure),i})))),(()=>{this.Gw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){}Dw(t){const e=this.Uw.Xp();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}],n=t.getFillStyle(),r=t.getStrokeStyle();e.add({ia:t.ia,vertices:s,figure:t},{fillStyle:n,strokeStyle:r})})),e.finishPlot()}add(t){const e=new zc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.qi,this.Ww).setDimensions(t);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Rc extends Fc{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,i,s,n,r,o,a,h),this.Yw=[],this.ol=Le,this.Ts=t,this.scale=e,this.be=ce(h.polygonSeriesFillStyle,l),this.Me=ce(h.polygonSeriesStrokeStyle,l)}getBoundaries(){return this.ol}setDimensions(t){return this.Yw=t,this.ol=je(this.Yw),this.bw(),this.Ts.bs(),this}getDimensions(){return this.Yw}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Mw(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Mw(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Vc extends Lc{constructor(t,e,i,s,n,r,o,a,h,l,c){super(t,e,i,s,n,r,o,a,h,l),this._s="Polygon Series",this.xp=(t,e,i)=>t.addRow(e.getName()),this.Gw=Ee(),this.Vw=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return ut(i,this.scale,this.Ts.us.dt)},this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Ww=c,this.Rw=new Rc(this.Ts,this.scale,wt,wt,wt,wt,wt,(t=>!1),this.qi,this.Ww).dispose(),this.Uw=new Lh((()=>{const t=this.Gw._t(this.Ts.bv(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.figure),i})))),(()=>{this.Gw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){}Dw(t){const e=this.Uw.Xp();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=t.getFillStyle(),n=t.getStrokeStyle();e.add({ia:t.ia,vertices:i,figure:t},{fillStyle:s,strokeStyle:n})})),e.finishPlot()}add(t){const e=new Rc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.qi,this.Ww).setDimensions(t);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Bc extends Fc{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,i,s,n,r,o,a,h),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.ol=m(u(0,0),u(0,0)),this.qi=h,this.Ts=t,this.scale=e,this.Me=ce(h.segmentSeriesStrokeStyle,l)}getBoundaries(){return this.ol}setDimensions(t){return this.dimensions=t,this.ol=m(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.bw(),this.Ts.bs(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Mw(),this}getStrokeStyle(){return this.Me}getDominantStyle(){const t=this.Me;return t!==nt?t.getFillStyle():V}}class Oc extends Lc{constructor(t,e,i,s,n,r,o,a,h,l,c){super(t,e,i,s,n,r,o,a,h,l),this._s="Segment Series",this.xp=(t,e,i)=>t.addRow(e._s).addRow("Start",e.axisX.formatValue(i.getDimensions().startX),",",e.axisY.formatValue(i.getDimensions().startY)).addRow("End",e.axisX.formatValue(i.getDimensions().endX),",",e.axisY.formatValue(i.getDimensions().endY)),this.Hw=Ee(),this.Vw=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return ut(i,this.scale,this.Ts.us.dt)},this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Ww=c,this.Rw=new Bc(this.Ts,this.scale,wt,wt,wt,wt,wt,(t=>!1),this.qi,this.Ww).dispose(),this.$w=new Lh((()=>{const t=this.Hw._t(this.Ts._A(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ee(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.CA(e.start,e.end),this.Hw.Ot(i,e.figure),i})))),(()=>{this.Hw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){}Dw(t){const e=this.$w.Xp();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s={x:i.startX,y:i.startY},n={x:i.endX,y:i.endY},r=t.getStrokeStyle();e.add({ia:t.ia,start:s,end:n,figure:t},{strokeStyle:r})})),e.finishPlot()}add(t){const e=new Bc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.qi,this.Ww).setDimensions(t);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Nc extends Fc{constructor(t,e,i,s,n,r,o,a,h,l){super(t,e,i,s,n,r,o,a,h),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.ol=m(u(0,0),u(0,0)),this.Ts=t,this.scale=e,this.be=ce(h.ellipseSeriesFillStyle,l),this.Me=ce(h.ellipseSeriesStrokeStyle,l)}getBoundaries(){return this.ol}setDimensions(t){return this.dimensions=t,this.ol=m(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.bw(),this.Ts.bs(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Mw(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Mw(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Uc extends Lc{constructor(t,e,i,s,n,r,o,a,h,l,c){super(t,e,i,s,n,r,o,a,h,l),this._s="Ellipse Series",this.xp=(t,e,i)=>t.addRow(e._s).addRow("X","",e.axisX.formatValue(i.getDimensions().x)).addRow("Y","",e.axisY.formatValue(i.getDimensions().y)).addRow("Radius X","",e.axisX.formatValue(i.getDimensions().radiusX)).addRow("Radius Y","",e.axisY.formatValue(i.getDimensions().radiusY)),this.Gw=Ee(),this.Vw=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return ut(i,this.scale,this.Ts.us.dt)},this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Ww=c,this.Rw=new Nc(this.Ts,this.scale,wt,wt,wt,wt,wt,(t=>!1),this.qi,this.Ww).dispose(),this.Uw=new Lh((()=>{const t=this.Gw._t(this.Ts.bv(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.figure),i})))),(()=>{this.Gw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){if(!(t instanceof Li||t instanceof zi))throw new Error("EllipseSeries only supports Linear Axes")}Dw(t){const e=this.Uw.Xp();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=[],n=void 0!==i.drawSteps?i.drawSteps:72;for(let t=0;t<=n;t+=1){const e=t/n*2*Math.PI,r=i.x+i.radiusX*Math.cos(e),o=i.y+i.radiusY*Math.sin(e);s.push({x:r,y:o})}const r=t.getFillStyle(),o=t.getStrokeStyle();e.add({ia:t.ia,vertices:s,figure:t},{fillStyle:r,strokeStyle:o})})),e.finishPlot()}add(t){const e=new Nc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.qi,this.Ww).setDimensions(t);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Gc extends Fc{constructor(t,e,i,s,n,r,o,a,h,l,u,c,d,f,g,p,y){super(t,e,i,s,n,r,o,a,y),this.Xw=1,this.jw=1,this.Ts=t,this.scale=e,this.dimensionStrategy=h,this.start=l,this.end=u,this.lowerExtreme=c,this.lowerQuartile=d,this.median=f,this.upperQuartile=g,this.upperExtreme=p,this.boundaries=m(this.dimensionStrategy.toPoint(l,c),this.dimensionStrategy.toPoint(u,p)),this.Zw=this.qi.boxSeriesBodyFillStyle,this.Qw=this.qi.boxSeriesBodyStrokeStyle,this.Cu=this.qi.boxSeriesStrokeStyle,this.Jw=this.qi.boxSeriesMedianStrokeStyle,this.Ds()}getBoundaries(){return this.boundaries}setBodyWidth(t){return this.Xw=t,this.Ds(),this}getBodyWidth(){return this.Xw}setBodyFillStyle(t){return this.Zw="function"==typeof t?t(this.Zw):t,this.Mw(),this}getBodyFillStyle(){return this.Zw}setBodyStrokeStyle(t){return this.Qw="function"==typeof t?t(this.Qw):t,this.Mw(),this}getBodyStrokeStyle(){return this.Qw}setTailWidth(t){return this.jw=t,this.Ds(),this}getTailWidth(){return this.jw}setStrokeStyle(t){return this.Cu="function"==typeof t?t(this.Cu):t,this.Mw(),this}getStrokeStyle(){return this.Cu}setMedianStrokeStyle(t){return this.Jw="function"==typeof t?t(this.Jw):t,this.Mw(),this}getMedianStrokeStyle(){return this.Jw}Ds(){this.bw()}getDominantStyle(){return this.getBodyFillStyle()}}const Wc=(t,e,i)=>t.addRow(e.getName()).addRow("Lower extreme","",i.lowerExtreme.toFixed(2)).addRow("Lower quartile","",i.lowerQuartile.toFixed(2)).addRow("Median","",i.median.toFixed(2)).addRow("Upper quartile","",i.upperQuartile.toFixed(2)).addRow("Upper extreme","",i.upperExtreme.toFixed(2));class Yc extends Lc{constructor(t,e,i,s,n,r,o,a,h,l,u,c){super(t,e,i,s,n,r,o,a,l,u),this._s="Box Series",this.xp=Wc,this.Gw=Ee(),this.Vw=t=>ut(this.Fs.toPoint((t.start+t.end)/2,t.median),this.scale,this.Ts.us.dt),this.ds((t=>t.Vn||t.zn||t.so?void 0:"figure series")),this.Fs=h,this.Rw=new Gc(this.Ts,this.scale,this.kw,wt,wt,wt,wt,(t=>!1),this.Fs,0,0,0,0,0,0,0,this.qi).dispose(),this.$w=new Lh((()=>{const t=this.Ts._A(this.scale);return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ee(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.CA(e.start,e.end),i}))))),this.Uw=new Lh((()=>{const t=this.Gw._t(this.Ts.bv(this.scale));return this.gs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.figure),i})))),(()=>{this.Gw.Nt()}),((t,e)=>{this.Ss(e)}))}mb(t){if(!(t instanceof Li||t instanceof zi))throw new Error("BoxSeries only supports Linear Axes")}Dw(t){const e=this.Uw.Xp(),i=this.$w.Xp();t.forEach((t=>{if(!t.getVisible())return;const s=this.Fs.toPoint((t.start+t.end-t.Xw*(t.end-t.start))/2,t.lowerQuartile),n=this.Fs.toPoint((t.end-t.start)*t.Xw,t.upperQuartile-t.lowerQuartile),r=this.Fs.toPoint((t.start+t.end)/2,t.lowerQuartile),o=this.Fs.toPoint((t.start+t.end)/2,t.lowerExtreme),a=this.Fs.toPoint((t.start+t.end)/2,t.upperQuartile),h=this.Fs.toPoint((t.start+t.end)/2,t.upperExtreme),l=this.Fs.toPoint((t.start+t.end-t.jw*(t.end-t.start))/2,t.lowerExtreme),u=this.Fs.toPoint((t.start+t.end+t.jw*(t.end-t.start))/2,t.lowerExtreme),c=this.Fs.toPoint((t.start+t.end-t.jw*(t.end-t.start))/2,t.upperExtreme),d=this.Fs.toPoint((t.start+t.end+t.jw*(t.end-t.start))/2,t.upperExtreme),f=this.Fs.toPoint((t.start+t.end-t.Xw*(t.end-t.start))/2,t.median),g=this.Fs.toPoint((t.start+t.end+t.Xw*(t.end-t.start))/2,t.median);e.add({ia:t.ia,vertices:[{x:s.x,y:s.y},{x:s.x,y:s.y+n.y},{x:s.x+n.x,y:s.y+n.y},{x:s.x+n.x,y:s.y}],figure:t},{fillStyle:t.Zw,strokeStyle:t.Qw}),i.add({ia:0,start:r,end:o,figure:t},{strokeStyle:t.Cu}),i.add({ia:0,start:a,end:h,figure:t},{strokeStyle:t.Cu}),i.add({ia:0,start:l,end:u,figure:t},{strokeStyle:t.Cu}),i.add({ia:0,start:c,end:d,figure:t},{strokeStyle:t.Cu}),i.add({ia:0,start:f,end:g,figure:t},{strokeStyle:t.Jw})})),e.finishPlot(),i.finishPlot()}add(t){const e=new Gc(this.Ts,this.scale,this.kw,this.bw,this.Mw,this._w,this.ww,this.Pw,this.Fs,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.qi);return this.Bw(e),this.Iw=!0,this.Ji.us.bs(),e}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}}class Hc extends ru{constructor(){super(...arguments),this.wb=[],this.Lu=[],this.Kw=[],this.qw=[],this.Db=1e3,this.Cb=0,this.Hi=e.HighlightModes.onHover,this.Gl={type:"disabled",packager:(t,e,i)=>t.slice()},this.mx=!0,this.tC=[],this.iC=[],this.sC=!1,this.ld=()=>he(this.eC)||he(this.hC),this.rC=t=>{const e=t.length;if(this.wb.length>0){const i=this.wb.length-1,s=this.wb[i];if(e>0){const[e,i]=s.yl(),[n,r]=s.ml();if((n?e.length+n.length:e.length)>=this.Db){const o=n&&n.length>0?n[n.length-1]:e[e.length-1],a=r&&r.length>0?r[r.length-1]:i[e.length-1],h=(o.x+t[0].position)/2,l=ui(h,o,u(t[0].position,t[0].high)).y,c=ui(h,a,u(t[0].position,t[0].low)).y,f=d(h,l,c);s._l(f,m(u(h,c),u(h,l))).tu(!0),this.nC([f].concat(t)).Kl(!0)}else s._l(t)}}else e>0&&this.nC(t)},this.oC=t=>{const e=this.tC,i=t.length;if(this.tC.length>0){if(i>0){const i=e[e.length-1],s=i.yl(),n=i.ml();if(s.length+n.length>=this.Db){const r=n.length>0?n[n.length-1]:s[s.length-1],o=(r.x+t[0].x)/2,a=ui(o,r,u(t[0].x,t[0].y)).y,h=u(o,a);i._l(h,m(u(o,a),u(o,a))).tu(!0),e.push(this.aC([h].concat(t),this.Ib).Kl(!0))}else i._l(t)}}else i>0&&e.push(this.aC(t))},this.lC=t=>{const e=this.iC,i=t.length;if(this.iC.length>0){if(i>0){const i=e[e.length-1],s=i.yl(),n=i.ml();if(s.length+n.length>=this.Db){const r=n.length>0?n[n.length-1]:s[s.length-1],o=(r.x+t[0].x)/2,a=ui(o,r,u(t[0].x,t[0].y)).y,h=u(o,a);i._l(h,m(u(o,a),u(o,a))).tu(!0),e.push(this.uC([h].concat(t)).Kl(!0))}else i._l(t)}}else i>0&&e.push(this.uC(t))},this.cC=(t,e)=>{const i=t.Cx(e);if(i)return[ut(i[0],this.scale,this.Ts.us.dt),ut(i[1],this.scale,this.Ts.us.dt)]},this.dC=(t,e)=>{const i=t.cw(e);if(i)return[ut(i[0],this.scale,this.Ts.us.dt),ut(i[1],this.scale,this.Ts.us.dt)]}}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.Cb=void 0!==e&&e>0?e:0,this.Ts.bs(),this}clear(){for(let t=0;tt+e.wl()+e.Cl()),this.Lu.length)}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}setCursorEnabled(t){return super.setCursorEnabled(t)}getCursorResultTableFormatter(){return this.xp}getXMax(){return Bt(this.wb,_t,Math.max,Pt,this.Ib)||0}getXMin(){return Bt(this.wb,It,Math.min,zt,this.Ib)||0}getYMax(){return Bt(this.wb,Lt,Math.max,Vt,this.Ib)||0}getYMin(){return Bt(this.wb,Ft,Math.min,Rt,this.Ib)||0}Sr(){const t=u(0,0);for(const e of this.wb)t.x=Math.max(t.x,e.Vl()),t.y=Math.max(t.y,e.zl());return t}Dm(){return this.Lm&&this.getPointAmount()>0&&this.getVisible()}mb(t){}Tb(t,e,i){this.Lu=se(this.Lu,t,{canReturnB:!1}),this.Kw=se(this.Kw,e,{canReturnB:!1}),this.qw=se(this.qw,i,{canReturnB:!1}),this.Ts.bs()}fC(t,e,i,s){this.AC(e,i,s),this.Tb(Array.isArray(t)?t:[t],e,i)}AC(t,e,i){const s=qe(je(t),je(e));this.Ib?this.Ib=qe(this.Ib,s):this.Ib=s,i&&(this.Ib=qe(this.Ib,i))}pw(){const t=this.wb.length,e=Math.min(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd());let i=0;if(t>1)for(let s=0;s0){const n=Math.ceil(i/e),r=t.length-n;if(r>0&&s>0){const e=r-s>0?s:r;if(e>0){for(let i=0;i0?this.wb[this.wb.length-1]:void 0,i=e?e.yl()[0].length+(e.ml()[0]?e.ml()[0].length:0):void 0;ou(t,i,this.Db,this.rC)}pC(t){const e=this.tC.length>0?this.tC[this.tC.length-1].yl().length+this.tC[this.tC.length-1].ml().length:void 0;ou(t,e,this.Db,this.oC)}mC(t,e){const i=this.tC.length>0?this.tC[this.tC.length-1].yl().length+this.tC[this.tC.length-1].ml().length:void 0;ou(t,i,this.Db,this.oC),ou(e,i,this.Db,this.lC)}nC(t,e){const i=this.Ts.yC(this.scale)._l(t,e).ke(this.eC).Ql(this.hC).jl(this.Gl).cs(this.getHighlight());return this.wb.push(i),this.gs(i),i}SC(t,e,i){const s=this.Ts.zp(this.scale,void 0,[kh.UserSeries])._l(t,i).setMouseInteractions(!1).Ee(e).cs(this.getHighlight());return this.gs(s),s}aC(t,e){return this.SC(t,this.vC,e)}uC(t,e){return this.SC(t,this.xC,e)}bC(t){this.eC="function"==typeof t?t(this.eC):t;const e=this.eC;for(let t=0;t0){const t=this.wb.length,e=this.pw();this.Pb(this.wb,this.Db,this.Cb,e);const i=this.wb.length;this.tC.length>0&&this.Pb(this.tC,this.Db,this.Cb,e),this.iC.length>0&&this.Pb(this.iC,this.Db,this.Cb,e),t!==i&&this._b(),this.sC=!0}}Fe(){if(super.Fe(),this.Lu.length>0&&(this.gC(this.Lu),this.IC(this.Kw,this.qw),this.sC=!0),this.sC){const t=this.getBoundaries();for(const e of this.wb)e.ra(t);for(const e of this.tC)e.ra(t);for(const e of this.iC)e.ra(t)}}$p(){this.Ib=void 0,this.Lu.length=0,this.Kw.length=0,this.qw.length=0}gg(t,e,i=this.mx){const s=((t,e,i)=>{let s,n,r=Number.MAX_VALUE;for(let o=0;ot.getIsUnderMouse())):this.wb,i?this.dC:this.cC);if(void 0!==s&&void 0!==s[0]){const t=ut(s[0][0],this.Ts.us.dt,this.scale),e=ut(s[0][1],this.Ts.us.dt,this.scale);return gh(t,this.scale,this.xp(new Za,this,t.x,t.y,e.y).fc(),this,s[1].Lh())}}solveNearestFromScreen(t,e=this.mx){return this.gg($o(t,this.Ji.us),!1,e)}}const Xc=(t,e,i,s,n)=>t.addRow(e.getName()).addRow("Position","",e.axisX.formatValue(i)).addRow("Value","",e.axisY.formatValue(s)).addRow("Base","",e.axisY.formatValue(n));class jc extends Hc{constructor(t,e,i,s,n,r,o,a,h=0,l,u){super(t,e,i,s,n,r,o,a,l,u),this._s="Area Series",this.xp=Xc,this.ds((t=>t.Vn||t.zn||t.qn?void 0:"area series")),this.PC=h}add(t){0!==this.wb.length&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.DC(e),[i,s]=this.BC(t);this.fC(t,i,s,m(u(_e,this.PC),u(Fe,this.PC)));const n=this.Lu[this.Lu.length-1];this.Fb=n?{position:n.position,high:n.high,low:n.low}:void 0,this.D.emit("dataAdd",this,e,this.Ib)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.Fb?this.Fb.position+e:0),this.add(hu(t,e,s)),this}Rb(t){return this.D.on("dataAdd",t)}Eb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}zb(t){return this.D.off(t)}}class $c extends jc{constructor(){super(...arguments),this.xC=nt}IC(t){return this.pC(t)}BC(t){const e=t.length,i=Array(e);for(let s=0;s=r){const t=d(n.x,n.y,r);if(0!==i&&Ot(e[i-1],t)||(e[i]=t,i+=1),o.y=r){const t=yi(u(Fe,r),u(_e,r),n,o);t&&(e[i]=d(t.x,t.y,r),i+=1),e[i]=d(o.x,o.y,r),i+=1}else e[i]=d(o.x,r,r),i+=1}}return i}Lb(){return au(this.wb,(t=>t[0]||[]))}setFillStyle(t){return this.bC(t),this}getFillStyle(){return this._C()}attach(t,e=!0,i=!1){return ae(t,this.qi,i,{fill:this.eC,stroke:this.vC}),super.attach(t,e,i)}}class Jc extends $c{constructor(t,e,i,s,n,r,o,a,h,l,u){super(t,e,i,s,n,r,o,a,h,l,u);const c=t.getSeries().length;this.eC=V,this.hC=ce(this.qi.areaSeriesNegativeFillStyle,c),this.vC=ce(this.qi.areaSeriesNegativeStrokeStyle,c)}DC(t){return this.VC(t)}VC(t){const e=[];return 1===t.length?this.RC(t[0],e):this.EC(t,e),e}RC(t,e,i=0){const s=this.PC;return e[i]=t.y>s?d(t.x,s,s):d(t.x,t.y,s),i+1}EC(t,e,i=0){let s=0;const n=t.length-1,r=this.PC;for(;sr){const t=yi(u(Fe,r),u(_e,r),n,o);t&&(e[i]=d(t.x,t.y,r),i+=1),e[i]=d(o.x,r,r),i+=1}else e[i]=d(o.x,o.y,r),i+=1}else{const t=d(n.x,r,r);if(0!==i&&Ot(e[i-1],t)||(e[i]=t,i+=1),o.y<=r){const t=yi(u(Fe,r),u(_e,r),n,o);t&&(e[i]=d(t.x,t.y,r),i+=1),e[i]=d(o.x,o.y,r),i+=1}else e[i]=d(o.x,r,r),i+=1}}return i}Lb(){return au(this.wb,(t=>t[1]))}setFillStyle(t){return this.MC(t),this}getFillStyle(){return this.Jl()}attach(t,e=!0,i=!1){return ae(t,this.qi,i,{fill:this.hC,stroke:this.vC}),super.attach(t,e,i)}}class Kc extends jc{constructor(t,e,i,s,n,r,o,a,h,l,u){super(t,e,i,s,n,r,o,a,h,l,u);const c=t.getSeries().length;this.eC=ce(this.qi.areaSeriesBipolarHighFillStyle,c),this.vC=ce(this.qi.areaSeriesBipolarHighStrokeStyle,c),this.hC=ce(this.qi.areaSeriesBipolarLowFillStyle,c),this.xC=ce(this.qi.areaSeriesBipolarLowStrokeStyle,c)}DC(t){return this.zC(t)}IC(t,e){return this.mC(t,e)}zC(t){let e=0;const i=[],s=t.length,n=this.PC;return s>0&&(this.OC&&(this.OC.y<=n&&n<=t[0].y||this.OC.y>=n&&n>=t[0].y)&&(i[e]=d(.5*(this.OC.x+t[0].x),n,n),e+=1),this.OC=t[s-1],1===s?this.RC(t[0],i,e):this.EC(t,i)),i}RC(t,e,i=0){return e[i]=d(t.x,t.y,this.PC),i+1}EC(t,e){let i=0,s=0;const n=t.length-1,r=this.PC;for(;s=r&&r>=o.y){const t=n.y,s=o.y,a=r,h=t===s?o.x:Fr(n.x,o.x,(a-t)/(s-t));e[i]=d(h,r,r),i+=1}e[i]=d(o.x,o.y,r),i+=1}return i}BC(t){const e=t.length,i=Array(e),s=Array(e),n=this.PC;for(let r=0;rn?(i[r]=u(e.position,e.high),s[r]=u(e.position,n)):e.hight[0]))}setPositiveFillStyle(t){return this.bC(t),this}setNegativeFillStyle(t){return this.MC(t),this}setPositiveStrokeStyle(t){return this.wC(t),this}setNegativeStrokeStyle(t){return this.CC(t),this}getPositiveFillStyle(){return this._C()}getNegativeFillStyle(){return this.Jl()}getPositiveStrokeStyle(){return this.kC()}getNegativeStrokeStyle(){return this.TC()}attach(t,e=!0,i=!1){return ae(t,this.qi,i,{fill:this.eC,fill2:this.hC,behavior:{colorStep:!0}}),super.attach(t,e,i)}}const Zc={Positive:qc,Negative:Jc,Bipolar:Kc},Qc=(t,e,i,s,n)=>t.addRow(e.getName()).addRow("Position","",e.axisX.formatValue(i)).addRow("High","",e.axisY.formatValue(s)).addRow("Low","",e.axisY.formatValue(n));class td extends Hc{constructor(t,e,i,s,n,r,o,a,h,l,u){super(t,e,i,s,n,r,o,a,h,l),this._s="Area Range Series",this.xp=Qc,this.ds((t=>t.Vn||t.zn||t.qn?void 0:"area range series"));const c=u;this.eC=ce(this.qi.areaRangeSeriesFillStyle,c),this.vC=ce(this.qi.areaRangeSeriesStrokeStyle,c),this.hC=ce(this.qi.areaRangeSeriesFillStyleInverted,c),this.xC=ce(this.qi.areaRangeSeriesStrokeStyleInverted,c)}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.fC(t,i,s);const n=this.Lu[this.Lu.length-1];return this.Fb=n?{position:n.position,high:n.high,low:n.low}:void 0,this.D.emit("dataAdd",this,e,this.Ib),this}addArraysHighLow(t,e,i=1,s=0){if(t.length!==e.length)throw new Error("arrayHigh and arrayLow lengths are not equal");{let n=s;n||(n=this.Fb?this.Fb.position+i:0),this.add(((t,e,i=1,s)=>{const n=void 0!==s?s:0,r=new Array(t.length);for(let s=0;s{const e=t[0],i=t[1];if(!e||!i)return[];const s=[],n=e.length;for(let t=0;t{const i=t.gg(e);if(i)return ut(i,this.scale,this.Ts.us.dt)},this.En=d,this.Fx=h,this.be=ce(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}ld(){return he(this.be)}yd(){return this.Fx}mb(t){}attach(t,e=!0,i=!1){return ae(t,this.qi,i,{fill:this.be}),super.attach(t,e)}Pe(t,e){t.cs(e),this.Ts.bs()}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(let t=0;tt.Vn||t.zn||t.ro?void 0:"bubble chart"));for(let e=0;et.getIsUnderMouse())):this.wb,this.lw,We);if(void 0!==i){const t=ut(i[0],this.Ts.us.dt,this.scale),e=i[1].Lh(),s=W(e)?i[0].color?new U({color:i[0].color}):new U({color:e.getFallbackColor()}):e;return gh(t,this.scale,this.xp(new Za,this,t.x,t.y,t).fc(),this,s)}}solveNearestFromScreen(t){return this.gg($o(t,this.Ji.us),!1)}setCursorResultTableFormatter(t){return super.setCursorResultTableFormatter(t)}}class id{constructor(t,e,i,s){this.NC=!1,this.D=new n.Eventer,this.chart=i,this.GC=s,this.Xs=t.Xs,this.te=s||_s,this.WC=St.document.createElement("div"),this.WC.style.position="absolute",this.WC.style.pointerEvents="none",St.document.body.append(this.WC);const r=()=>{const t=i.engine.container.getBoundingClientRect();this.WC.style.left=`${t.left}px`,this.WC.style.top=`${t.top}px`,this.WC.style.width=`${t.width}px`,this.WC.style.height=`${t.height}px`};r(),i.onResize(r),this.UC(this.WC),this.YC(),this.HC(),this.$C(),this.XC(e),this.chart.jC().push(this)}UC(t){this.ZC=St.document.createElement("div"),this.ZC.style.pointerEvents="all",t.append(this.ZC),this.QC=St.document.createElement("div"),this.JC=new vs(this.Xs,this.te,this.chart,this.QC),this.KC=St.document.createElement("table"),this.KC.style.borderSpacing="0",this.ZC.appendChild(this.JC.ae()),this.ZC.appendChild(this.QC),this.QC.appendChild(this.KC)}HC(){let t=0,e=0,i=0,s=0,n=!1;this.NC=!1,this.ZC.onmousedown=r=>{r=r||St.event,i=r.clientX,s=r.clientY,n=!0,St.document.onmouseup=t=>{this.NC?this.ZC.addEventListener("click",jt,!0):this.ZC.removeEventListener("click",jt,!0),n=!1,this.NC=!1,St.document.onmouseup=null,St.document.onmousemove=null},St.document.onmousemove=r=>{r=r||St.event,n&&(t=i-r.clientX,e=s-r.clientY,i=r.clientX,s=r.clientY,this.NC=!0,this.ZC.style.top=this.ZC.offsetTop-e+"px",this.ZC.style.left=this.ZC.offsetLeft-t+"px",this.ZC.style.removeProperty("right"),this.ZC.style.removeProperty("bottom"))}}}$C(){let t=0,e=0,i=0,s=0,n=!1;this.ZC.ontouchstart=r=>{r=r||St.event,i=r.touches[0].clientX,s=r.touches[0].clientY,n=!0,this.ZC.ontouchend=()=>{n=!1,St.document.ontouchend=null,St.document.ontouchmove=null},this.ZC.ontouchmove=r=>{n&&(jt(r),r=r||St.event,t=i-r.touches[0].clientX,e=s-r.touches[0].clientY,i=r.touches[0].clientX,s=r.touches[0].clientY,this.ZC.style.top=this.ZC.offsetTop-e+"px",this.ZC.style.left=this.ZC.offsetLeft-t+"px",this.ZC.style.removeProperty("right"),this.ZC.style.removeProperty("bottom"))}}}YC(){this.ZC.style.setProperty("top","10px"),this.ZC.style.setProperty("left","10px"),this.ZC.style.position="absolute",this.ZC.style.display="flex",this.ZC.style.alignItems="flex-start",this.QC.style.setProperty("display","none")}removePositionProperty(){this.ZC.style.removeProperty("top"),this.ZC.style.removeProperty("left"),this.ZC.style.removeProperty("bottom"),this.ZC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.ZC.style.setProperty("bottom","10px"),this.ZC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.ZC.style.setProperty("top","10px"),this.ZC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.ZC.style.setProperty("bottom","10px"),this.ZC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.ZC.style.setProperty("top","10px"),this.ZC.style.setProperty("right","10px")}}XC(t){for(let e=0;et.addRow(e.getName()).addRow("X:","",e.axisX.formatValue(i.x)).addRow("Y:","",e.axisY.formatValue(i.y)).addRow("Intensity:","",i.intensity.toFixed(1));class nd extends ru{constructor(t,e,i,s,n,r,o,a,h,l,u,c){super(t,e,i,s,n,r,o,a,l,u),this._s="Heatmap Grid Series",this.xp=sd,this.mx=!1,this.Jy={},this.ds((t=>t.Vn||t.zn||t.io?void 0:"heatmap series")),this.ik=h,this.qi=l;const d=c;this.be=ce(l.heatmapGridSeriesFillStyle,d),this.Ky=ce(this.qi.heatmapGridSeriesWireframeStyle,d);const f={heatmapDataType:"intensity",dataOrder:h.dataOrder||"columns",columns:h.columns,rows:h.rows};this.En=f,this.sk=this.Ts.ek(this.scale,[],f).ke(this.be).qy(this.Ky).cs(this.getHighlight()),this.gs(this.sk),h.start&&this.setStart(h.start),h.end&&this.setEnd(h.end),h.step&&this.setStep(h.step),this.setHighlightOnHover(!1)}iS(){const t=this.Jy.start||{x:0,y:0};let e;e=this.Jy.end?{x:(this.Jy.end.x-t.x)/this.En.columns,y:(this.Jy.end.y-t.y)/this.En.rows}:this.Jy.step?this.Jy.step:{x:1,y:1},this.sk.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.sk.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.sk.eS().step}setEnd(t){return this.Jy.end=t,this.iS(),this}getEnd(){return this.sk.eS().end}clear(){return this.sk.Nt(),this.Ts.bs(),this.D.emit("dataClear",this),this}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.sk.qy(this.Ky),this.Ts.bs(),this.D.emit("styleChange",this),this}getWireframeStyle(){return this.Ky}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.sk.rS(t),this.Ts.bs(),this.D.emit("styleChange",this),this}getIntensityInterpolation(){return this.sk.nS()}Dm(){return this.Lm&&this.getVisible()}ld(){return he(this.be)}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.be}),this}hk(t){this.sk.hk().forEach((e=>{t.sk.oS(e)}))}zb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}rk(t){return this.D.on("styleChange",t)}nk(t){return this.D.off(t)}gg(t,e,i=this.mx){const s=ut(t,this.Ts.us.dt,this.scale),n=e?this.sk.getIsUnderMouse()?this.sk:void 0:this.sk;if(!n)return;const r=i?n.vx(s):n.gg(s);if(r){const t={x:r.x,y:r.y,column:r.column,row:r.column,intensity:r.cellValue};return{location:t,scale:this.scale,resultTableContent:this.xp(new Za,this,t).fc(),owner:this}}}solveNearestFromScreen(t,e=this.mx){return this.gg($o(t,this.Ji.us),!1,e)}getXMax(){const t=this.sk;return t?t.xt():void 0}getXMin(){const t=this.sk;return t?t.vt():void 0}getYMax(){const t=this.sk;return t?t.Mt():void 0}getYMin(){const t=this.sk;return t?t.bt():void 0}Sr(){const t=u(0,0);return t.x=Math.max(t.x,this.sk.Vl()),t.y=Math.max(t.y,this.sk.zl()),t}mb(t){if(!(t instanceof Li))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Li&&t._i())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}Pe(t,e){t.cs(e),this.Ts.bs()}Fe(){return super.Fe(),this.sk.ra(this.getBoundaries()),this}}class rd extends nd{constructor(t,e,i,s,n,r,o,a,h,l,u,c){super(t,e,i,s,n,r,o,a,h,l,u,c),this.$m=!1,this.xp=sd}invalidateIntensityValues(t){if(this.$m&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE="))),Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.En.dataOrder?t.length:t[0].length,rows:"rows"===this.En.dataOrder?t.length:t[0].length},i="columns"===this.En.dataOrder?this.En.columns:this.En.rows,s="columns"===this.En.dataOrder?this.En.rows:this.En.columns;if(e.x>i||e.y>s){if(!0===this.chart.fs.oo){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.En.columns}x${this.En.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const n=[];for(let e=0;eo||r>a){if(!0===this.chart.fs.oo){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.En.columns}x${this.En.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.`;St.console.warn(i)}const i=Math.max(s-o,0),n=e.primary-i,h=Math.max(r-a,0),l=[];for(let e=0;e0?-h:void 0);t={iColumn:t.iColumn,iRow:t.iRow,values:l}}this.sk.oS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:n,values:t.values})}return this.D.emit("invalidateIntensity",this,t),this.Ts.bs(),this.$m=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.sk.ke(this.be),this.D.emit("styleChange",this),this.Ts.bs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}ak(t){return this.D.on("invalidateIntensity",t)}lk(t){return this.D.off(t)}}class od extends ru{constructor(t,e,i,s,n,r,o,a,h,l,u,c){super(t,e,i,s,n,r,o,a,l,u),this._s="Scrolling Heatmap Grid Series",this.xp=sd,this.mx=!1,this.Jy={},this.ds((t=>t.Vn||t.zn||t.io?void 0:"heatmap series")),this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const d=c;this.be=ce(l.heatmapScrollingGridSeriesFillStyle,d),this.Ky=ce(this.qi.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",...h};this.En=f,this.uk=this.Ts.ck(this.scale,[],f).ke(this.be).qy(this.Ky).cs(this.getHighlight()),this.gs(this.uk),h.start&&this.setStart(h.start),h.step&&this.setStep(h.step),this.setHighlightOnHover(!1)}iS(){const t=this.Jy.start||{x:0,y:0};let e;e=this.Jy.step?this.Jy.step:{x:1,y:1},this.uk.sS(t,e),this.Ji.us.bs()}setStart(t){return this.Jy.start=t,this.iS(),this}getStart(){return this.uk.eS().start}setStep(t){return this.Jy.step=t,this.iS(),this}getStep(){return this.uk.eS().step}clear(){return this.uk.Nt(),this.Ts.bs(),this}setWireframeStyle(t){return this.Ky="function"==typeof t?t(this.Ky):t,this.uk.qy(this.Ky),this.Ts.bs(),this}getWireframeStyle(){return this.Ky}setPixelInterpolationMode(t){return t=t||"disabled",this.uk.rS(t),this.Ts.bs(),this}getPixelInterpolationMode(){return this.uk.nS()}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}setCursorEnabled(t){return super.setCursorEnabled(t)}setDataCleaning(t){return this.uk.Eu(t),this.Ts.bs(),this}Dm(){return this.Lm&&this.getVisible()}ld(){return he(this.be)}attach(t,e=!0,i=!1){return super.attach(t,e,i),ae(t,this.qi,i,{fill:this.be}),this}ke(t){return this.be="function"==typeof t?t(this.be):t,this.uk.ke(this.be),this.Ts.bs(),this}gg(t,e,i=this.mx){const s=ut(t,this.Ts.us.dt,this.scale),n=e?this.uk.getIsUnderMouse()?this.uk:void 0:this.uk;if(!n)return;const r=i?n.vx(s):n.gg(s);return r?gh(r,this.scale,this.xp(new Za,this,{x:r.x,y:r.y,column:r.column,row:r.column,intensity:r.cellValue}).fc(),this):void 0}solveNearestFromScreen(t,e=this.mx){return this.gg($o(t,this.Ji.us),!1,e)}mb(t){if(!(t instanceof Li))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Li&&t._i())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.uk.xt()||0}getXMin(){return this.uk.vt()||0}getYMax(){return this.uk.Mt()||0}getYMin(){return this.uk.bt()||0}Sr(){const t=u(0,0);return t.x=Math.max(t.x,this.uk.Vl()),t.y=Math.max(t.y,this.uk.zl()),t}Pe(t,e){t.cs(e),this.Ts.bs()}}class ad extends od{constructor(t,e,i,s,n,r,o,a,h,l,u,c){super(t,e,i,s,n,r,o,a,h,l,u,c),this.xp=sd}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.En.scrollDimension?t.length:t[0].length,"rows"===this.En.scrollDimension?t.length:t[0].length,0+i-1),n=this.En.resolution-1;if(s>n){if(!0===this.chart.fs.oo){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.En.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;St.console.warn(t)}const s=[];for(let i=0;it[4]>=t[1],this.Fw=m(c(_e,_e),c(Fe,Fe)),this.Ak=[],this.gk=!1,this.pk=-1,this.mk=[],this.yk=!0,this.Sk=!1,this.vk=4,this.xp=(t,e,i)=>(t.addRow(e.getName()).addRow("Time","",e.axisX.formatValue(i.position)).addRow("Open","",i.open.toFixed(3)).addRow("High","",i.high.toFixed(3)).addRow("Low","",i.low.toFixed(3)).addRow("Close","",i.close.toFixed(3)),t),this.xk=[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.fs.Vn||this.chart.fs.Un||this.chart.us.As(10)}Lb(){return this.mk}Rb(t){return this.D.on("dataAdd",t)}Eb(t){return this.D.off(t)}Vb(t){return this.D.on("dataClear",t)}zb(t){return this.D.off(t)}Dm(){return this.Lm&&this.mk.length>0&&this.getVisible()}bk(t){if(!(this.mk.length<1))return[this.mk[t][0],this.mk[t][1],this.mk[t][2],this.mk[t][3],this.mk[t][4]]}gg(t){if(0===this.mk.length)return;const e=ut(t,this.Ts.us.dt,this.scale).x,i=void 0!==this.getPackDataState();let s,n,r,o,a;if(i){const t=this.Mk;if(!t)return;const i=we(e,t.length-1,(e=>t[e][0])),h=void 0!==i&&t[i];if(!h)return;o=h[3],r=h[2],n=h[1],a=h[4],s=h[0]}else{const t=we(e,this.mk.length-1,(t=>this.mk[t][0])),i=void 0!==t&&this.mk[t];if(!i)return;s=i[0],n=i[1],r=i[2],o=i[3],a=i[4]}const h={position:s,open:n,high:r,low:o,close:a,isPacked:i};return{location:u(h.position,h.close),scale:this.scale,resultTableContent:this.xp(new Za,this,h).fc(),owner:this,isPacked:i,position:s,open:n,high:r,low:o,close:a}}mb(t){if(!(t.x instanceof Ii))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this._k=t.x}Sr(){return u(5,5)}sC(t){const e=t.length-1;if(e<0)return this;for(let i=0;i<=e;i+=1)t[i][3]0&&this.ds((t=>t.Vn||t.zn||t.ho?void 0:St.atob("cmVhbC10aW1lIGRhdGE=")));const e=Array.isArray(t[0])?t:[t[0]];if(e.length>0){this.gk=!0;const t=this.mk.length,i=this.Ak.length,s=e.length;this.mk.length=t+s,this.Ak.length=i+s;for(let n=0;nthis.xk[t]));return void 0===i?i=e=1){for(let e=0;e=1&&(t!==this.pk||this.gk||this.Sk)){this.Sk=!1,this.pk=t,this.gk=!1,this.Ck(),this.Mk=[];const e=this.mk.length;let i=this.mk[0][0]-this.mk[0][0]%(t/2)+t,s=0;for(;s{0!==this.iy.size&&void 0!==[...this.iy.values()].find((({series:t})=>!0===t.getVisible()))||this.Jk.St(e,i,!1,!1,"zoomBandChart"),this.Kk.us.bs()},t.zn||t.Vn||t.Qn||i.us.As(St.atob("em9vbSBiYW5kIGNoYXJ0")),this.fs=t,this.qk=(null==a?void 0:a.orientation)||"x",this.tT=void 0!==(null==a?void 0:a.useSharedValueAxis)&&a.useSharedValueAxis,this.iT=r,this.nc="x"===this.qk?ta:ea;const l={...a,defaultAxisX:this.nc.getWidth({x:null==a?void 0:a.defaultAxis,y:void 0}),defaultAxisY:this.nc.getHeight({x:null==a?void 0:a.defaultAxis,y:void 0})};this.Kk=new Pd(t,i,s,wt,o,l,h).setTitle("Zoom Band Chart").setMouseInteractions(!1).setAutoCursorMode(e.AutoCursorModes.disabled),this.engine=this.Kk.engine;const u=this.Kk.getDefaultAxisX().setMouseInteractions(!1),c=this.Kk.getDefaultAxisY().setMouseInteractions(!1);this.Jk=this.nc.getWidth({x:u,y:c}).setScrollStrategy(Rs.fitting).setAnimationScroll(!1).setStrokeStyle(nt).setTickStrategy(Vs.Empty),(null==a?void 0:a.useSharedValueAxis)?this.sT=this.nc.getHeight({x:u,y:c}):this.nc.getHeight({x:u,y:c}).dispose();const d=this.getTheme().zoomBandChartDefocusOverlayFillStyle||new U({color:this.getTheme().isDark?T(0,0,0,180):T(255,255,255,180)});this.eT=[this.Kk.vf.Te(this.Jk.rA).ke(d).Ce(nt),this.Kk.vf.Te(this.Jk.rA).ke(d).Ce(nt)];const f=this.Kk.vf._A(this.Jk.rA).Ee(this.getTheme().zoomBandChartSplitterStrokeStyle||this.getTheme().chartXYSeriesBackgroundStrokeStyle);this.hT={collection:f,members:new Array(5).fill(0).map((t=>f.Lr()))};const g=this.getTheme(),m="function"==typeof g.zoomBandChartKnobFillStyle?g.zoomBandChartKnobFillStyle(this.fs.Xs):g.zoomBandChartKnobFillStyle||V;this.rT=[this.Kk.vf.Te(this.Kk.pixelScale).ke(m).Ce(nt),this.Kk.vf.Te(this.Kk.pixelScale).ke(m).Ce(nt)],this.nT=this.getTheme().zoomBandChartKnobSize||{x:0,y:0},this.oT()}add(t){var e,i,s,n,r;const o=this.jk.map((t=>t.axis)),a="x"===this.qk?t.axisX:t.axisY;if(!o.includes(a)){const t=a.onIntervalChange(this.Qk);this.jk.push({axis:a,deattach:()=>{a.offIntervalChange(t)}}),this.Jk.Yh(a.Uh()),this.aT&&this.aT.remove(),this.aT=dt(...this.jk.map((t=>t.axis)))}const h=this.nc.getHeight({x:t.axisX,y:t.axisY});let l;if(this.tT)l=this.sT;else{const t=this.Zk.get(h);t?l=t:(l=this.nc.getHeight({x:this.Kk.addAxisX.bind(this.Kk),y:this.Kk.addAxisY.bind(this.Kk)})(),this.lT(l)),this.Zk.set(h,l)}const u=this.nc.getWidth({x:this.Jk,y:l}),c=this.nc.getHeight({x:this.Jk,y:l});let d;const f=[],g=(t,e)=>{const i=t=>{if(0!==t.length)if("x"in t[0]){const i=t;e.add(i)}else{const i=t,s=[];for(let t=0;ti(e)));f.push((()=>t.Eb(n)));const r=t.Vb((()=>e.clear()));f.push((()=>{t.zb(r)}))};if(t instanceof bd)d=this.Kk.addPointLineAreaSeries({...t.En,xAxis:u,yAxis:c}).setStrokeStyle(t.getStrokeStyle()).setAreaFillStyle(t.getAreaFillStyle()).setPointFillStyle(t.getPointFillStyle()).setCurvePreprocessing(t.getCurvePreprocessing()),d.setDataSet(t.uT());else if(t instanceof _c||t instanceof hd){const i=this.Kk.addLineSeries({xAxis:u,yAxis:c,dataPattern:t instanceof _c?null===(e=t.En)||void 0===e?void 0:e.dataPattern:void 0});if(t instanceof _c)i.setStrokeStyle(t.getStrokeStyle());else{const e=fd(t);e&&i.setStrokeStyle(e)}g(t,i),d=i}else if(t instanceof $c){const e=this.Kk.addAreaSeries({xAxis:u,yAxis:c,baseline:t.PC}).setFillStyle(t.getFillStyle()).setStrokeStyle(t.getStrokeStyle());g(t,e),d=e}else if(t instanceof ed){const e=this.Kk.addPointSeries({xAxis:u,yAxis:c,pointShape:null===(i=t.En)||void 0===i?void 0:i.pointShape}).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof Ic){const e=this.Kk.addStepSeries({xAxis:u,yAxis:c,pointShape:null===(s=t.En)||void 0===s?void 0:s.pointShape,mode:t.yw}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof Ac){const e=this.Kk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(n=t.En)||void 0===n?void 0:n.pointShape}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof mc){const e=this.Kk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(r=t.En)||void 0===r?void 0:r.pointShape}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof td){const e=this.Kk.addAreaRangeSeries({xAxis:u,yAxis:c}).setLowFillStyle(t.getLowFillStyle()).setHighFillStyle(t.getHighFillStyle()).setLowStrokeStyle(t.getLowStrokeStyle()).setHighStrokeStyle(t.getHighStrokeStyle()).add(t.Lb()),i=t.Rb(((t,i)=>e.add(i)));f.push((()=>t.Eb(i))),d=e;const s=t.Vb((()=>e.clear()));f.push((()=>{t.zb(s)}))}else{if(!(t instanceof nd))throw new Error("LightningChart JS Zoom Band Chart unsupported series type");{const e=this.Kk.addHeatmapGridSeries({xAxis:u,yAxis:c,...t.ik}),i=()=>{e.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};i(),d=e,t.hk(d);const s=t.ak(((t,i)=>e.invalidateIntensityValues(i))),n=t.rk(i);f.push((()=>{t.lk(s),t.nk(n)}));const r=t.Vb((()=>e.clear()));f.push((()=>{t.zb(r)}))}}d.setMouseInteractions(!1);const m=t.onVisibleStateChanged(((t,e)=>{d.setVisible(e)}));f.push((()=>{t.offVisibleStateChanged(m)}));const p=t.onHighlight(((t,e)=>d.setHighlight(e)));f.push((()=>{t.offHighlight(p)}));const y=t.onDispose((()=>{this.disposeSeries(t)}));return f.push((()=>{t.offDispose(y)})),this.iy.set(t,{series:d,clearReferences:()=>f.forEach((t=>t()))}),d}disposeSeries(t){const e=this.iy.get(t);if(e){const{clearReferences:i}=e;i(),this.iy.delete(t),e.series.dispose();const s=this.nc.getHeight({x:t.axisX,y:t.axisY}),n=this.Zk.get(s);n&&0===n.vA().length&&(this.Zk.delete(s),n.dispose())}const i="x"===this.qk?t.axisX:t.axisY;if(!Array.from(this.iy.keys()).find((t=>i===("x"===this.qk?t.axisX:t.axisY)))){const t=this.jk.findIndex((t=>t.axis===i));this.jk[t].deattach(),this.jk.splice(t,1)}return this}setDefocusOverlayFillStyle(t){return this.eT.forEach((e=>e.ke(t))),this.Kk.us.bs(),this}getDefocusOverlayFillStyle(){return this.eT[0].Lh()}setSplitterStrokeStyle(t){return this.hT.collection.Ee(t),this.Kk.us.bs(),this}getSplitterStrokeStyle(){return this.hT.collection.ku()}setKnobFillStyle(t){return this.rT.forEach((e=>e.ke(t))),this.Kk.us.bs(),this}getKnobFillStyle(){return this.rT[0].Lh()}setKnobStrokeStyle(t){return this.rT.forEach((e=>e.Ce(t))),this.Kk.us.bs(),this}getKnobStrokeStyle(){return this.rT[0]._o()}setKnobSize(t){return this.nT=t,this.Kk.us.bs(),this}getKnobSize(){return this.nT}getDefaultAxisX(){return this.Kk.getDefaultAxisX()}getDefaultAxisY(){return this.Kk.getDefaultAxisY()}lT(t){t.setTickStrategy(Vs.Empty).setMouseInteractions(!1).setNibStyle(nt).setStrokeStyle(nt)}oT(){let t;const i=(t,e,i)=>{var s,n;const r="x"===this.qk?null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisX:null===(n=Array.from(this.iy.keys())[0])||void 0===n?void 0:n.axisY;if(!r)return;const o=r.getInterval(),a=this.Jk.getInterval();Math.abs(this.Jk.dt.ct(t)-this.Jk.dt.ct(e))<10||Math.sign(e-t)!==Math.sign(o.end-o.start)||Math.min(t,e)Math.max(a.start,a.end)&&Math.max(o.start,o.end){s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(this.nc.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical}),t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const r=t=>{var e,s;const r="x"===this.qk?null===(e=Array.from(this.iy.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisY;if(!r)return;const o=this.nc.getWidth(this.Kk.translateCoordinate(t,this.Kk.coordsAxis)),a=r.getInterval(),h=0===n?o:a.start,l=1===n?o:a.end;i(h,l,!1),jt(t)};s.setMouseDragEventHandler(((t,e,i,s,n)=>r(e)));const o=Yi(new Xi(void 0,((t,e,i,s,n)=>r(n))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)})),this.Kk.onSeriesBackgroundMouseEnter((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Move,t)})),this.Kk.onSeriesBackgroundMouseLeave((()=>{this.engine.restoreMouseStyle(t)}));const s=(t,e)=>{var s,n;const r="x"===this.qk?null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisX:null===(n=Array.from(this.iy.keys())[0])||void 0===n?void 0:n.axisY;if(!r)return;const o=r.getInterval(),a=this.Jk.dt.pi(o.start,this.nc.getWidth(t)),h=this.Jk.dt.pi(o.end,this.nc.getWidth(t));i(a,h,!1),jt(e)};this.Kk.onSeriesBackgroundMouseDrag(((t,e,i,n,r)=>s(r,e)));const n=Yi(new Xi(void 0,((t,e,i,n,r)=>s(n,r))));this.Kk.onSeriesBackgroundMouseWheel(((t,e)=>{var s,n;const r="x"===this.qk?null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisX:null===(n=Array.from(this.iy.keys())[0])||void 0===n?void 0:n.axisY;if(!r)return;const o=r.getInterval(),a=this.Jk.getInterval(),h=this.nc.getWidth(this.Kk.translateCoordinate(e,this.Kk.coordsAxis)),l=this.Jk.dt.ct(o.start),u=this.Jk.dt.ct(o.end),c=this.Jk.dt.ct(h),d=kt((c-l)/(u-l),0,1),f=.2*Math.abs(u-l)*r.Ed,g=d*f*-Math.sign(e.deltaY),m=(1-d)*f*Math.sign(e.deltaY),p=kt(this.Jk.dt.pi(o.start,g),a.start,a.end),y=kt(this.Jk.dt.pi(o.end,m),a.start,a.end);i(p,y,!1),jt(e)})),this.Kk.onSeriesBackgroundTouchStart(n.onTouchStart),this.Kk.onSeriesBackgroundTouchMove(n.onTouchMove),this.Kk.onSeriesBackgroundTouchEnd(n.onTouchEnd),this.eT.forEach(((s,n)=>{s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Point,t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const r=t=>{var e,s;const n="x"===this.qk?null===(e=Array.from(this.iy.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.iy.keys())[0])||void 0===s?void 0:s.axisY;if(!n)return;const r=this.nc.getWidth(this.Kk.translateCoordinate(t,this.Kk.coordsAxis)),o=n.getInterval(),a=this.Jk.getInterval(),h=kt(r-(o.end-o.start)/2,Math.min(a.start,a.end),Math.max(a.start,a.end)-Math.abs(o.end-o.start)),l=h+(o.end-o.start);i(h,l,!0),jt(t)};s.setMouseClickEventHandler(((t,e)=>r(e)));const o=Yi(new class{constructor(t,e=300){this.Bs=!1,this.Ls=[],this.Rs=300,this.Es=t,this.Rs=e}Ps(t,e){const i=St.performance.now();let s=!1;for(let t=0;t=this.Rs?(this.Ls.splice(t,1),t-=1):this.Ls[t].state&&(s=!0);return this.Bs?0===e.interactions.length&&(this.Ls.push({state:!1,time:i}),this.Bs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Ls.push({state:!0,time:i}),s=!0,this.Bs=!0),s}Ds(t,e,i){if(i&&!this.Bs){const i=this.Ls.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=1&&i.off>=1&&(this.Es(t,e),this.Ls.length=0)}}}(((t,e)=>r(e))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)}))}getSizePixels(){return this.Kk.getSizePixels()}onResize(t){return this.Kk.onResize(((e,i,s,n,r)=>t(this,i,s,n,r)))}offResize(t){return this.Kk.offResize(t)}Ka(t){this.Kk.Ka(t)}getMinimumSize(){return this.Kk.getMinimumSize()}j(){return this.Kk.j()}Z(){return this.Kk.Z()}Fe(t){var e,i,s,n;const r=pe(Array.from(this.iy.keys()).map((t=>t.chart))),o="x"===this.qk?null===(e=Array.from(this.iy.keys())[0])||void 0===e?void 0:e.axisX:null===(i=Array.from(this.iy.keys())[0])||void 0===i?void 0:i.axisY;if("x"===this.qk){const t=r.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=0===t.iA?t.TA():0})),Math.max(t,i)}),0),e=r.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=100===t.iA?t.TA():0})),Math.max(t,i)}),0),i=r.reduce(((t,e)=>Math.max(t,e.getPadding().left)),0),n=r.reduce(((t,e)=>Math.max(t,e.getPadding().right)),0);null===(s=this.getDefaultAxisY())||void 0===s||s.setThickness(t),this.Kk.setPadding({left:i+(0===r.length?10:0),right:n+e+(0===r.length?10:0)})}else{const t=r.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=0===t.iA?t.TA():0})),Math.max(t,i)}),0),e=r.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=100===t.iA?t.TA():0})),Math.max(t,i)}),0),i=r.reduce(((t,e)=>Math.max(t,e.getPadding().bottom)),0),s=r.reduce(((t,e)=>Math.max(t,e.getPadding().top)),0);null===(n=this.getDefaultAxisX())||void 0===n||n.setThickness(t),this.Kk.setPadding({bottom:i+(0===r.length?10:0),top:s+e+(0===r.length?10:0)})}this.Kk.Fe(t);const a=this.Jk.getInterval().start,h=this.Jk.getInterval().end,l=kt(o?o.getInterval().start:a,a,h),u=kt(o?o.getInterval().end:h,a,h),c=this.nc.getHeight(this.Kk.cT.getInnerIntervalPixels());this.eT[0].Ie(this.nc.toPoint(a,0)).q(this.nc.toPoint(l-a,c)),this.eT[1].Ie(this.nc.toPoint(u,0)).q(this.nc.toPoint(h-u,c)),this.hT.members[0].CA(this.nc.toPoint(a,c),this.nc.toPoint(l,c)),this.hT.members[1].CA(this.nc.toPoint(l,c),this.nc.toPoint(l,0)),this.hT.members[2].CA(this.nc.toPoint(l,0),this.nc.toPoint(u,0)),this.hT.members[3].CA(this.nc.toPoint(u,0),this.nc.toPoint(u,c)),this.hT.members[4].CA(this.nc.toPoint(u,c),this.nc.toPoint(h,c));const d=ut(this.nc.toPoint(l,c/2),this.Jk.rA,this.Kk.pixelScale),f=ut(this.nc.toPoint(u,c/2),this.Jk.rA,this.Kk.pixelScale),g=this.nT;this.rT[0].Ie({x:d.x-g.x/2,y:d.y-g.y/2}).q({x:g.x,y:g.y}).zh(this.nc.getWidth({x:0,y:90})),this.rT[1].Ie({x:f.x-g.x/2,y:f.y-g.y/2}).q({x:g.x,y:g.y}).zh(this.nc.getWidth({x:0,y:90}))}setSeriesBackgroundFillStyle(t){return this.Kk.setSeriesBackgroundFillStyle(t),this.Kk.us.bs(),this}getSeriesBackgroundFillStyle(){return this.Kk.getSeriesBackgroundFillStyle()}setSeriesBackgroundStrokeStyle(t){return this.Kk.setSeriesBackgroundStrokeStyle(t),this.Kk.us.bs(),this}getSeriesBackgroundStrokeStyle(){return this.Kk.getSeriesBackgroundStrokeStyle()}setSeriesBackgroundEffect(t){return this.Kk.setSeriesBackgroundEffect(t),this.Kk.us.bs(),this}getSeriesBackgroundEffect(){return this.Kk.getSeriesBackgroundEffect()}getTheme(){return this.Kk.getTheme()}setTitle(t){return this.Kk.setTitle(t),this}getTitle(){return this.Kk.getTitle()}setTitleFillStyle(t){return this.Kk.setTitleFillStyle(t),this}getTitleFillStyle(){return this.Kk.getTitleFillStyle()}setTitleFont(t){return this.Kk.setTitleFont(t),this}getTitleFont(){return this.Kk.getTitleFont()}setTitleMargin(t){return this.Kk.setTitleMargin(t),this}getTitleMargin(){return this.Kk.getTitleMargin()}setPadding(t){return this.Kk.setPadding(t),this}getPadding(){return this.Kk.getPadding()}setBackgroundFillStyle(t){return this.Kk.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.Kk.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.Kk.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.Kk.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return Va(t,e,i,this.Kk.pixelScale,this.Kk.us)}addUIElement(t,e){return this.Kk.addUIElement(t,e)}addLegendBox(t,e){return this.Kk.addLegendBox(t,e)}getLegendBoxes(){return this.Kk.getLegendBoxes()}saveToFile(t,e,i){return this.Kk.saveToFile(t,e,i),this}dispose(){return this.Kk.dispose(),this.Zk.clear(),this.iy.clear(),this.iT(this),this}onDispose(t){return this.Kk.onDispose((()=>t(this)))}offDispose(t){return this.Kk.offDispose(t)}}const fd=t=>{if("getStrokeStyle"in t)return t.getStrokeStyle();const e=(t=>t instanceof _c||t instanceof $c?t.getStrokeStyle().getFillStyle():t instanceof ed||t instanceof mc?t.getPointFillStyle():void 0)(t);return e?new qi({thickness:2,fillStyle:e}):void 0};class gd{constructor(t){this.dT=0,this.fT=0,this.AT=0,this.gT=!1,this.pT=!0,this.mT=!1,this.yT={warningDisplayed:!1,expandEvents:[]},this.D=new n.Eventer,this.pT=!t||void 0===t.autoSortingEnabled||t.autoSortingEnabled,void 0!==(null==t?void 0:t.dataPattern)&&(this.ST={userSpecified:null===t.dataPattern?void 0:t.dataPattern}),this.vT=void 0!==(null==t?void 0:t.lookupValues)&&t.lookupValues,this.xT=void 0!==(null==t?void 0:t.colors)&&t.colors,this.bT=void 0!==(null==t?void 0:t.ids)&&t.ids,this.MT=void 0!==(null==t?void 0:t.sizes)&&t.sizes,this._T=void 0!==(null==t?void 0:t.rotations)&&t.rotations,this.wT=(null==t?void 0:t.dataStorage)?t.dataStorage:Float64Array,this.CT=!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,n=e.y,r=e.lookupValue,o=e.size,a=e.rotation,h=e.color,l=e.id;let u,c,d,f,g,m,p;if(s){u=new this.wT(i);for(let e=0;eh-1&&(this.dT=0,this.gT=!0),this.fT=Math.min(this.fT+1,h),this.AT+=1,this}appendSamples(t){const{lookupValues:e,colors:i,ids:s,sizes:n,rotations:r,start:o,step:a}=t;let h=t.offset,l=t.count;const u=t.xValues||t.yValues;if(!u)return this;const c=u.length;if(h=void 0!==h?h:0,l=void 0!==l?l:c-h,l<=0)return this;const d=void 0!==t.offsetLookupValues?t.offsetLookupValues:h,f=void 0!==t.offsetColors?t.offsetColors:h,g=void 0!==t.offsetIds?t.offsetIds:h,m=void 0!==t.offsetSizes?t.offsetSizes:h,p=void 0!==t.offsetRotations?t.offsetRotations:h,[y,A]=this.RT(l,t.xValues,"x",o,a,h),[x,S]=this.RT(l,t.yValues,"y",o,a,h),b=this.BT(i),{samplesCacheX:v,samplesCacheY:M,samplesCacheLookup:T,samplesCacheColors:w,samplesCacheIDs:E,samplesCacheSize:k,samplesCacheRotation:C,maxSampleCount:D,dataPattern:I,incomingDataReplacedCache:_}=this.kT({appendCount:l,...0===A&&0===S&&0===h&&0===d&&0===f&&0===g&&0===m&&0===p?{incomingDataX:y,incomingDataY:x,incomingDataLookup:e,incomingDataIDs:s,incomingDataColors:b,incomingDataSize:n,incomingDataRotation:r}:{}});if(!_&&I&&this.pT&&this.FT&&this.IT){const t=y[A],i=x[S];if(!this.PT(I,t,i)&&!this.mT)return this.DT(this.FT,this.IT,Sd(y,A,A+l),Sd(x,S,S+l),Sd(e,d,d+l),Sd(b,f,f+l),Sd(s,g,g+l),Sd(n,m,m+l),Sd(r,p,p+l),I),this}const F=D-this.dT,L=Math.min(l,F);if(L>0&&(_||(Ad(v,y,A,L,this.dT),Ad(M,x,S,L,this.dT),e&&T&&Ad(T,e,d,L,this.dT),s&&E&&Ad(E,s,g,L,this.dT),b&&w&&Ad(w,b,f,L,this.dT),n&&k&&Ad(k,n,m,L,this.dT),r&&C&&Ad(C,r,p,L,this.dT)),this.LT(this.dT,this.dT+L-1),this.dT+=L,this.dT>D-1&&(this.dT=0,this.gT=!0)),this.fT=Math.min(this.fT+L,D),this.AT+=L,this.ET(),l-L>0){const t={xValues:y?Sd(y,A+L,void 0):void 0,yValues:x?Sd(x,S+L,void 0):void 0,lookupValues:e?Sd(e,d+L,void 0):void 0,ids:s?Sd(s,g+L,void 0):void 0,colors:b?Sd(b,f+L,void 0):void 0,sizes:n?Sd(n,m+L,void 0):void 0,rotations:r?Sd(r,p+L,void 0):void 0};this.appendSamples(t)}return this}setSamples(t){return this.clear().appendSamples(t)}alterSamples(t,e){const{xValues:i,yValues:s,lookupValues:n,colors:r,ids:o,sizes:a,rotations:h}=e;let l=e.offset,u=e.count;const c=i||s||n||r||o;if(!c)return this;const d=c.length;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,m=void 0!==e.offsetIds?e.offsetIds:l,p=void 0!==e.offsetSizes?e.offsetSizes:l,y=void 0!==e.offsetRotations?e.offsetRotations:l,A=this.BT(r),x=this.AT-1,S=void 0!==this.VT?Math.max(this.AT-this.VT,0):0,b=t+u-1,v=Math.max(t,S),M=Math.min(b,x),T=M-v+1;if(this.AT>0&&T>0){const{samplesCacheX:e,samplesCacheY:r,samplesCacheColors:u,samplesCacheIDs:c,samplesCacheLookup:d,samplesCacheSize:x,samplesCacheRotation:b}=this.kT({appendCount:0}),w=e.length;if(void 0!==this.VT&&this.gT&&this.AT%this.VT!=0){const S=this.AT-this.AT%this.VT,T=this.AT-1,E=this.AT-this.fT,k=S-1,C=Math.max(v,E),D=Math.min(M,k)-C+1;if(D>0){const S=C-t,v=md(C,this.AT,w,this.dT);i&&Ad(e,i,l+S,D,v),s&&Ad(r,s,l+S,D,v),n&&d&&Ad(d,n,f+S,D,v),o&&c&&Ad(c,o,m+S,D,v),A&&u&&Ad(u,A,g+S,D,v),a&&x&&Ad(x,a,p+S,D,v),h&&b&&Ad(b,h,y+S,D,v)}const I=Math.max(v,S),_=Math.min(M,T)-I+1;if(_>0){const S=I-t,v=md(I,this.AT,w,this.dT);i&&Ad(e,i,l+S,_,v),s&&Ad(r,s,l+S,_,v),n&&d&&Ad(d,n,f+S,_,v),o&&c&&Ad(c,o,m+S,_,v),A&&u&&Ad(u,A,g+S,_,v),a&&x&&Ad(x,a,p+S,_,v),h&&b&&Ad(b,h,y+S,_,v)}}else{const t=v-S;i&&Ad(e,i,l,T,t),s&&Ad(r,s,l,T,t),n&&d&&Ad(d,n,f,T,t),o&&c&&Ad(c,o,m,T,t),A&&u&&Ad(u,A,g,T,t),a&&x&&Ad(x,a,p,T,t),h&&b&&Ad(b,h,y,T,t)}this.D.emit("cleared")}const w=t+u-1-x;if(w>0){const e=M+1-t;this.appendSamples({xValues:i,yValues:s,lookupValues:n,colors:r,ids:o,sizes:a,rotations:h,offset:l+e,offsetLookupValues:f+e,offsetColors:g+e,offsetIds:m+e,offsetSizes:p+e,offsetRotations:y+e,count:w})}return this}alterSamplesByID(t,e){if(!this.bT)throw new Error("LightningChart JS attempted to use alterSamplesByID on DataSetXY that doesn't have IDs enabled.");const i=t.length,s=this.zT;if(i<=0||!s)return this;const n=Array.isArray(e.xValues)?new this.wT(e.xValues):e.xValues,r=Array.isArray(e.yValues)?new this.wT(e.yValues):e.yValues,o=Array.isArray(e.yValues)?new Float32Array(e.yValues):e.yValues,a=this.BT(e.colors),h=Array.isArray(e.sizes)?new Float32Array(e.sizes):e.sizes,l=Array.isArray(e.rotations)?new Float32Array(e.rotations):e.rotations,u=s.length,c=this.fT,d=this.AT-1,f=Math.max(d-c+1,0);for(let e=0;es[md(t,this.AT,u,this.dT)])),g=md(c,this.AT,u,this.dT);s[g]===i&&(n&&this.FT&&(this.FT[g]=n[e]),r&&this.IT&&(this.IT[g]=r[e]),o&&this.OT&&(this.OT[g]=o[e]),a&&this.NT&&(this.NT[g]=a[e]),h&&this.GT&&(this.GT[g]=h[e]),l&&this.WT&&(this.WT[g]=l[e]))}return this.D.emit("cleared"),this}clear(){return this.dT=0,this.fT=0,this.AT=0,this.gT=!1,this.D.emit("cleared"),this}getSampleCount(){return this.fT}getNextSampleIndex(){return this.AT}setMaxSampleCount(t){if("object"==typeof t){this.UT&&this.offMaxSampleCountExceeded(this.UT);const e=t.max;this.UT=this.onMaxSampleCountExceeded(((t,i,s,n)=>{if(void 0!==e&&s>=e)return;let r=2*s;void 0!==e&&(r=Math.min(r,e)),this.setMaxSampleCount(r)})),void 0===this.VT&&this.setMaxSampleCount(1e5)}else if("number"==typeof t){const e=t;if(void 0!==this.VT&&this.VT>e)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to shrink data set. This is currently not supported.");if(!this.FT||!this.IT)return this.VT=e,this;if(e===this.VT)return this;if(this.gT&&0!==this.dT)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.VT=e,this.fTt+e.count),0),n=new this.wT(s),r=new this.wT(s),o=this.xT?new Uint32Array(s):void 0,a=this.vT?new Float32Array(s):void 0,h=this.bT?new Uint32Array(s):void 0,l=this.MT?new Float32Array(s):void 0,u=this._T?new Float32Array(s):void 0;let c=0;for(const t of i)n.set(this.FT.subarray(t.offset,t.offset+t.count),c),r.set(this.IT.subarray(t.offset,t.offset+t.count),c),this.xT&&o&&this.NT&&o.set(this.NT.subarray(t.offset,t.offset+t.count),c),this.vT&&a&&this.OT&&a.set(this.OT.subarray(t.offset,t.offset+t.count),c),this.bT&&h&&this.zT&&h.set(this.zT.subarray(t.offset,t.offset+t.count),c),this.MT&&l&&this.GT&&l.set(this.GT.subarray(t.offset,t.offset+t.count),c),this._T&&u&&this.WT&&u.set(this.WT.subarray(t.offset,t.offset+t.count),c),c+=t.count;return{xValues:n,yValues:r,lookupValues:a,colors:o,ids:h,sizes:l,rotations:u}}onMaxSampleCountExceeded(t){return this.D.on("maxSampleCountExceeded",t)}offMaxSampleCountExceeded(t){return this.D.off(t)}RT(t,e,i,s,n,r){if(void 0===e){const e=this.TT();n=void 0!==n?n:1,s=void 0!==s?s:e?e[i]+n:0;const r=new this.wT(t);for(let e=0;et[md(e,this.AT,d,this.dT)])),y=p-1,A=p+1,x=t[md(p,this.AT,d,this.dT)],S=A<=this.AT-1?t[md(A,this.AT,d,this.dT)]:void 0,b=void 0!==S&&S0){const e=void 0!==this.VT&&this.gT?this.dT:0,i=this.fT-1,s=void 0!==this.VT&&this.gT?0:void 0,n=void 0!==this.VT&&this.gT?this.dT-1:void 0,[r,o]=void 0!==s&&void 0!==n&&Math.abs(n-s)>Math.abs(i-e)?[s,n]:[e,i];if(1+o-r>=2){let e,i,s=this.FT[r],n=this.IT[r];for(let t=r+1;t<=o;t+=1){if(!1!==e){const i=this.FT[t],n=Math.sign(i-s);0!==n&&e&&e.direction!==n?e=!1:0===n||e||(e={direction:n}),s=i}if(!1!==i){const e=this.IT[t],s=Math.sign(e-n);0!==s&&i&&i.direction!==s?i=!1:0===s||i||(i={direction:s}),n=e}}t=e&&e.direction>0?_n.ProgressiveX:e&&e.direction<0?_n.RegressiveX:i&&i.direction>0?_n.ProgressiveY:i&&i.direction<0?_n.RegressiveY:void 0,this.ST={autoDetectResult:t},t&&St.console.warn(`LightningChart JS DataSetXY warning | Data pattern was detected automatically (DataPatterns.${t}).\nAutomatic detection is only intended for kick-starting application development, not for production use.\nAdd { dataPattern: '${t}'} } to your application when creating series or DataSetXY to get clear this warning.`)}}if(t&&"ProgressiveX"!==t)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 t}PT(t,e,i){const s=this.TT();return!s||("ProgressiveX"===t?e>=s.x:"RegressiveX"===t?e<=s.x:"ProgressiveY"===t?i>=s.y:"RegressiveY"!==t||i<=s.y)}kT(t){if(t.incomingDataX&&t.incomingDataY&&0===this.fT&&!this.FT&&!this.IT&&(void 0===this.VT||this.VT===t.appendCount)&&this.CT)return this.FT=xd(t.incomingDataX,this.wT),this.IT=xd(t.incomingDataY,this.wT),this.OT=this.vT?xd(t.incomingDataLookup,Float32Array):void 0,this.zT=this.bT?xd(t.incomingDataIDs,Uint32Array):void 0,this.NT=this.xT?xd(t.incomingDataColors,Uint32Array):void 0,this.GT=this.MT?xd(t.incomingDataSize,Float32Array):void 0,this.WT=this._T?xd(t.incomingDataRotation,Float32Array):void 0,{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:t.appendCount,incomingDataReplacedCache:!0};if(void 0===this.VT){const e=this.fT+t.appendCount;if(!this.FT||!this.IT)return this.FT=new this.wT(e),this.IT=new this.wT(e),this.OT=this.vT?new Float32Array(e):void 0,this.zT=this.bT?new Uint32Array(e):void 0,this.NT=this.xT?new Uint32Array(e):void 0,this.GT=this.MT?new Float32Array(e):void 0,this.WT=this._T?new Float32Array(e):void 0,{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:e};const i=this.FT.length;if(ii-t.timestamp<5e3)),e>1e3&&this.yT.expandEvents.push({timestamp:i}),this.yT.expandEvents.length>5)return St.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.yT.warningDisplayed=!0,this.setMaxSampleCount({mode:"auto"}),this.kT(t)}const i=new this.wT(e);i.set(this.FT),this.FT=i;const s=new this.wT(e);if(s.set(this.IT),this.IT=s,this.vT){const t=new Float32Array(e);this.OT&&t.set(this.OT),this.OT=t}if(this.bT){const t=new Uint32Array(e);this.zT&&t.set(this.zT),this.zT=t}if(this.xT){const t=new Uint32Array(e);this.NT&&t.set(this.NT),this.NT=t}if(this.MT){const t=new Float32Array(e);this.GT&&t.set(this.GT),this.GT=t}if(this._T){const t=new Float32Array(e);this.WT&&t.set(this.WT),this.WT=t}return this.dT=this.fT,{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:e}}if(i>4*e){const t=new this.wT(e);t.set(this.FT.subarray(0,this.fT)),this.FT=t;const i=new this.wT(e);if(i.set(this.IT.subarray(0,this.fT)),this.IT=i,this.vT){const t=new Float32Array(e);this.OT&&t.set(this.OT.subarray(0,this.fT)),this.OT=t}if(this.bT){const t=new Uint32Array(e);this.zT&&t.set(this.zT.subarray(0,this.fT)),this.zT=t}if(this.xT){const t=new Uint32Array(e);this.NT&&t.set(this.NT.subarray(0,this.fT)),this.NT=t}if(this.MT){const t=new Float32Array(e);this.GT&&t.set(this.GT.subarray(0,this.fT)),this.GT=t}if(this._T){const t=new Float32Array(e);this.WT&&t.set(this.WT.subarray(0,this.fT)),this.WT=t}return{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:e}}return{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:i}}return t.appendCount+this.fT>this.VT&&this.D.emit("maxSampleCountExceeded",this,this.fT,this.VT,this.fT+t.appendCount),this.FT=this.FT||new this.wT(this.VT),this.IT=this.IT||new this.wT(this.VT),this.OT=this.OT||(this.vT?new Float32Array(this.VT):void 0),this.zT=this.zT||(this.bT?new Uint32Array(this.VT):void 0),this.NT=this.NT||(this.xT?new Uint32Array(this.VT):void 0),this.GT=this.GT||(this.MT?new Float32Array(this.VT):void 0),this.WT=this.WT||(this._T?new Float32Array(this.VT):void 0),{dataPattern:this.ET(),samplesCacheX:this.FT,samplesCacheY:this.IT,samplesCacheLookup:this.OT,samplesCacheIDs:this.zT,samplesCacheColors:this.NT,samplesCacheSize:this.GT,samplesCacheRotation:this.WT,maxSampleCount:this.VT}}XT(){if(!this.FT||!this.IT||0===this.fT)return;if(void 0===this.VT)return this.AT>0?{x:this.FT[0],y:this.IT[0]}:void 0;if(!this.gT)return{x:this.FT[0],y:this.IT[0]};let t=this.dT-this.fT;return t<0&&(t+=this.VT),{x:this.FT[t],y:this.IT[t]}}TT(){if(!this.FT||!this.IT||0===this.fT)return;if(void 0===this.VT){const t=this.fT-1;return t>=0?{x:this.FT[t],y:this.IT[t]}:void 0}let t=this.dT-1;return t<0&&(t+=this.VT),{x:this.FT[t],y:this.IT[t]}}gg(t,e,i,s){const n=this.ET(),r=this.FT,o=this.IT;if(!r||!o)return;const a=t=>({x:r[t],y:o[t],lookupValue:this.vT&&this.OT?this.OT[t]:void 0,id:this.bT&&this.zT?this.zT[t]:void 0,color:this.xT&&this.NT?this.NT[t]:void 0,size:this.MT&&this.GT?this.GT[t]:void 0,rotation:this._T&&this.WT?this.WT[t]:void 0}),h=r.length,l=this.fT,u=this.AT-1,c=Math.max(u-l+1,0);if(n){const i=this.XT(),s=this.TT();if(!(i&&s&&this.FT&&this.IT))return;const r="ProgressiveX"===n||"RegressiveX"===n?"x":"y",o="x"===r?"y":"x",l="x"===r?this.FT:this.IT,d="x"===o?this.FT:this.IT,f=t[r],g=Math.min(i[r],s[r]),m=Math.max(i[r],s[r]);if(fm)return;const p=yd(f,c,u,(t=>l[md(t,this.AT,h,this.dT)])),y=md(p,this.AT,h,this.dT);if(!e)return a(y);const A=p-1,x=p+1,S=f>=l[y]&&("ProgressiveX"===n||"ProgressiveY"===n)?x<=u?md(x,this.AT,h,this.dT):void 0:A>=c?md(A,this.AT,h,this.dT):void 0;if(void 0===S)return;const b=l[y],v=d[y],M=l[S],T=d[S],w=Math.min(b,M),E=w===b?v:T,k=Math.max(b,M),C=Fr(E,k===b?v:T,(f-w)/(k-w));return"ProgressiveX"===n||"RegressiveX"===n?{x:f,y:C}:{x:C,y:f}}let d,f=Number.MAX_VALUE;const g=ut(t,i,s),m=this.fT-1;for(let t=0;t<=m;t+=1){const e=r[t],n=o[t];if(!Number.isNaN(e)&&!Number.isNaN(n)){const r=lt(e,i.x,s.x),o=lt(n,i.y,s.y),a=(r-g.x)**2+(o-g.y)**2;at%i,pd=(t,e,i,s,n,r,o,a)=>{if(0===s||0===n)return;const h=i.length,l=s-1,u=Math.max(l-n+1,0),c=yd(t,u,l,(t=>i[md(t,s,h)])),d=yd(e,u,l,(t=>i[md(t,s,h)])),f=Math.max(c-a,u),g=Math.min(d+a,l),m=md(f,s,h),p=md(g,s,h);return m>p?{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:m,iLastSampleDataArray:p,dataRanges:[{offset:m,count:h-m},{offset:0,count:p+1}]}:{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:m,iLastSampleDataArray:p,dataRanges:[{offset:m,count:p-m+1}]}},yd=(t,e,i,s)=>{const n=i;for(;e!==i;){const n=Math.ceil((e+i)/2);t{const r=e.length;if(Array.isArray(e))for(let r=0;rvoid 0===t?new e:Array.isArray(t)?new e(t):t instanceof e?t:new e(t),Sd=(t,e,i)=>{if(void 0!==t)return Array.isArray(t)?t.slice(e,i):t.subarray(e,i)};class bd extends ru{constructor(t,e,i,s,n,r,o,a,h,l,u,c){var d;super(t,e,i,s,n,r,o,a,h,l),this._s="Point Line Area Series",this.xp=vd,this.mx=!1,this.En=c,this.el=this.Ts.tF(this.scale).Ee(ce(this.qi.lineSeriesStrokeStyle,u)).qT(ce(this.qi.pointSeriesFillStyle,u)).KT(ce(this.qi.areaSeriesPositiveFillStyle,u)).JT(void 0).QT(7),this.el.iF=!1!==(null===(d=this.En)||void 0===d?void 0:d.allowDataGrouping),this.gs(this.el)}setDataSet(t){var e;return t===(null===(e=this.sF)||void 0===e?void 0:e.Wt)||(this.sF=De(t,this.sF,(()=>[t.jT((()=>this.Ji.us.bs())),t.ZT((()=>this.Ji.us.bs()))])),this.el.eF(t),this.chart.us.bs()),this}getDataSet(){return this.hF()}setStrokeStyle(t){return this.el.Ee(t),this.Ts.bs(),this}getStrokeStyle(){return this.el.ku()}setAreaFillStyle(t){return this.el.KT(t),this.Ts.bs(),this}getAreaFillStyle(){return this.el.rF()}setPointFillStyle(t){return this.el.qT(t),this.Ts.bs(),this}getPointFillStyle(){return this.el.nF()}setPointSize(t){return this.el.QT(t),this.Ts.bs(),this}getPointSize(){return this.el.oF()}setPointShape(t){return this.el.aF(t),this.Ts.bs(),this}getPointShape(){return this.el.lF()}setPointRotation(t){return this.el.uF(t),this.Ts.bs(),this}getPointRotation(){return this.el.cF()}setCurvePreprocessing(t){return this.el.JT(t),this.Ts.bs(),this}getCurvePreprocessing(){return this.el.dF()}setCursorResultTableFormatter(t){return this.xp=t,this.Ji.us.bs(),this}getCursorResultTableFormatter(){return this.xp}setCursorInterpolationEnabled(t){return this.mx=t,this.Ts.us.bs(),this}getCursorInterpolationEnabled(){return this.mx}add(t){return this.hF().add(t),this.Ts.bs(),this}addArraysXY(t,e){return this.hF().addArraysXY(t,e),this.Ts.bs(),this}appendJSON(t,e){return this.hF().appendJSON(t,e),this.Ts.bs(),this}appendSample(t){return this.hF().appendSample(t),this.Ts.bs(),this}appendSamples(t){return this.hF().appendSamples(t),this.Ts.bs(),this}setSamples(t){return this.hF().setSamples(t),this.Ts.bs(),this}alterSamples(t,e){return this.hF().alterSamples(t,e),this.Ts.bs(),this}alterSamplesByID(t,e){return this.hF().alterSamplesByID(t,e),this.Ts.bs(),this}getSampleCount(){return this.hF().getSampleCount()}getNextSampleIndex(){return this.hF().getNextSampleIndex()}clear(){return this.hF().clear(),this.Ts.bs(),this}setMaxSampleCount(t){return this.hF().setMaxSampleCount(t),this.Ts.bs(),this}getMaxSampleCount(){return this.hF().getMaxSampleCount()}readBack(t){return this.hF().readBack(t)}onMaxSampleCountExceeded(t){return this.hF().onMaxSampleCountExceeded(t)}offMaxSampleCountExceeded(t){return this.hF().offMaxSampleCountExceeded(t)}uT(){return this.hF()}ld(){return he(this.getPointFillStyle())||he(this.getStrokeStyle().getFillStyle())||he(this.getAreaFillStyle())}Dm(){var t;const e=null===(t=this.sF)||void 0===t?void 0:t.Wt;return this.getAutoScrollingEnabled()&&void 0!==e&&e.AT>0}mb(t){}getXMax(){return this.el.xt()}getXMin(){return this.el.vt()}getYMax(){return this.el.Mt()}getYMin(){return this.el.bt()}Sr(){return{x:this.el.Vl(),y:this.el.zl()}}hF(){if(!this.sF){const t=new gd(this.En);this.sF=De(t,this.sF,(()=>[t.jT((()=>this.Ji.us.bs())),t.ZT((()=>this.Ji.us.bs()))])),this.el.eF(t)}return this.sF.Wt}attach(t,e=!0,i=!1){super.attach(t,e,i);const s=this.getPointFillStyle(),n=this.getAreaFillStyle();return ae(t,this.qi,i,{stroke:this.getStrokeStyle(),fill:s!==V?s:n}),super.attach(t,e)}Pe(t,e){t.cs(e),this.Ts.bs()}gg(t,e,i=this.mx){void 0!==this.getCurvePreprocessing()&&(i=!1);const s=this.uT(),n=ut(t,this.Ji.us.dt,this.scale),r=!e||this.el.getIsUnderMouse()?s.gg(n,i,this.scale,this.Ji.pixelScale):void 0;if(void 0!==r){const t=[this.getStrokeStyle().getFillStyle(),this.getPointFillStyle(),this.getAreaFillStyle()];return gh(r,this.scale,this.xp(new Za,this,r).fc(),this,t.filter((t=>!B(t)))[0])}}solveNearestFromScreen(t,e=!1){return this.gg($o(t,this.Ji.us),!1,e)}}const vd=(t,e,i)=>(t.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i.x)).addRow("Y","",e.axisY.formatValue(i.y)),void 0!==i.lookupValue&&t.addRow("Value","",i.lookupValue.toFixed(1)),t),Md=(...t)=>(e,i)=>t.forEach((t=>t.forEach((t=>{t.dt.q(e),t.hA.q(i)})))),Td=(t,e)=>{const i=t.indexOf(e);-1!==i&&t.splice(i,1)},wd=u(10,10);var Ed;e.AxisPosition=void 0,(Ed=e.AxisPosition||(e.AxisPosition={}))[Ed.Top=0]="Top",Ed[Ed.Bottom=1]="Bottom",Ed[Ed.Left=2]="Left",Ed[Ed.Right=3]="Right";const kd=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),Cd=t=>t.vr(),Dd=t=>t.setStopped(!0),Id=t=>t.getChartInteractionFitByDrag()?t.fit(!0):void 0,_d=(t,e)=>{const i="linear-highPrecision"===t.wh.type||"linear-highPrecision"===e.wh.type,s="logarithmic"===t.wh.type||"logarithmic"===e.wh.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.wh.type}, y: ${e.wh.type})`;throw new Error(i)}};var Fd,Ld,zd;!function(t){t[t.seriesBackground=0]="seriesBackground",t[t.gridLine0=1]="gridLine0",t[t.gridLine1=2]="gridLine1",t[t.gridLine2=3]="gridLine2",t[t.highlightersBelow=4]="highlightersBelow"}(Fd||(Fd={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(Ld||(Ld={}));class Pd extends Kh{constructor(t,i,s,n,r,o,a){super(t,i,s,i.sg("chartXY bg",0),n,i.us.qi.chartXYBackgroundFillStyle,i.us.qi.chartXYBackgroundStrokeStyle,i.us.qi.chartXYTitleFont,i.us.qi.chartXYTitleFillStyle,a),this.cT=this.GA.d2({scaleXYConstructor:Li}),this.fF=[],this.AF=[],this.gF=[],this.pF=[],this.mF=new Map,this.yF=!0,this.SF=!0,this.vF=!0,this.Ed=2,this.xF=!0,this.bF=!0,this.MF=[],this._F=this.hg.Te(this.cT).ke(V).Ce(nt).setMouseInteractions(!1),this.wF=this.hg.Ve(this.cT).Ee(nt).setMouseInteractions(!1),this.CF=this.hg.Ve(this.cT).Ee(nt).setMouseInteractions(!1),this.kF=this.qi.chartXYZoomingRectangleFillStyle,this.TF=this.qi.chartXYZoomingRectangleStrokeStyle,this.FF=this.qi.chartXYFittingRectangleFillStyle,this.IF=this.qi.chartXYFittingRectangleStrokeStyle,this.PF=e.MouseStyles.Default,this.DF=e.MouseStyles.Move,this.BF=e.MouseStyles.ZoomIn,this.LF=e.MouseStyles.Default,this.RF=void 0,this.EF=Rd,this.pb=0,this.vp=e.AutoCursorModes.snapToClosest,this.VF=Md(this.AF,this.fF),this.zF=Md(this.gF,this.pF),this.OF=(t,e,i,s,n)=>{this.VF(s,n),this.zF(n,s),this.cT.q(s,n);const r=this.AF.map((t=>t.TA())),o=this.fF.map((t=>t.TA())),a=this.gF.map((t=>t.TA())),h=this.pF.map((t=>t.TA())),l=r.reduce(Ne,0),c=o.reduce(Ne,0),d=a.reduce(Ne,0),f=h.reduce(Ne,0),g=this.NF(d,f,c,l),m=this.cT.x.getCellSize()-(g.left+g.right),p=this.cT.y.getCellSize()-(g.bottom+g.top),y=[g.left,g.right],A=[g.bottom,g.top];this.cT.x.J(0,m),this.cT.y.J(0,p),this.cT.Ei(y),this.cT.Vi(A),this.uy.q(u(m,p));for(let t=0;t{this.mF.set(t,e)},this.Kf=t=>{this.AF.includes(t)?Td(this.AF,t):this.fF.includes(t)?Td(this.fF,t):this.gF.includes(t)?Td(this.gF,t):this.pF.includes(t)&&Td(this.pF,t),this.mF.delete(t),this.us.bs()},this.WF=(t=!1)=>{const e=t=>(e,i,s,n)=>(i.Fe(e,s,n.length),e+i.TA()*t),i=this.AF.reduce(e(-1),0),s=this.fF.reduce(e(1),0),n=this.gF.reduce(e(-1),0),r=this.pF.reduce(e(1),0),o=this.NF(n,r,s,i),a=this.cT.x.getCellSize()-(o.left+o.right),h=this.cT.y.getCellSize()-(o.bottom+o.top),l=[o.left,o.right],c=[o.bottom,o.top];this.cT.x.J(0,a),this.cT.y.J(0,h),this.cT.x.si(l),this.cT.y.si(c);for(const t of this.AF)t.dt.si(l);for(const t of this.fF)t.dt.si(l);for(const t of this.gF)t.dt.si(c);for(const t of this.pF)t.dt.si(c);if((!this.AM||Math.abs(this.AM.bottom-i)>=4||Math.abs(this.AM.left-n)>=4||Math.abs(this.AM.right-r)>=4||Math.abs(this.AM.top-s)>=4)&&!t)return void this.WF(!0);this.AM={bottom:i,left:n,top:s,right:r},this.uy.Ie(u(0,0)).q(u(a,h)),this.Ay.Ie(u(0,0)).q(u(a,h));const d=this.getDefaultAxisX(),f=this.getDefaultAxisY();if(!d||!f)return;const g=p(d.dt.ei(),f.dt.ei(),d.dt.ri(),f.dt.ri());this.yv.ES(g),this.Qf.ES(g),this.Jf.ES(g),this.LA&&this.LA();const m=t=>(e,i,s,n)=>(i.kA(e),e+i.TA()*t);return this.AF.reduce(m(-1),0),this.fF.reduce(m(1),0),this.gF.reduce(m(-1),0),this.pF.reduce(m(1),0),g},this.addAreaSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();_d(e,i);const s=t&&t.baseline?t.baseline:0,n=new(t&&t.type?t.type:Zc.Positive)(this,this.ey,this.yv,e,i,this.UF(e),this.UF(i),this.YA,s,this.qi,this.us.es,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length);return this.gy(n),n},this.addAreaRangeSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();_d(e,i);const s=new td(this,this.ey,this.yv,e,i,this.UF(e),this.UF(i),this.YA,this.qi,this.us.es,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.iy.length);return this.gy(s),s},this.YF=!1,this.HF=!1,this.yb=()=>{(this.yF||this.SF)&&(this.RF=this.engine.setMouseStyle(this.PF))},this.Sb=()=>{this.YF=!1,this.engine.restoreMouseStyle(this.RF)},this.vb=(t,e,i)=>{var s,n;const r=Dt(null===(s=this.fs.no)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Dt(null===(n=this.fs.no)||void 0===n?void 0:n.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.RF);const a=this.hg.us.De(e.clientX,e.clientY);i===r&&(this.yF||this.SF)?(this.$F(t,a),jt(e)):i===o&&this.xF&&(this.RF=this.engine.setMouseStyle(this.DF),this.HF=!0,jt(e))},this.Vm=(t,e,i,s,n)=>{var r,o;const a=u(e.clientX,e.clientY),h=Dt(null===(r=this.fs.no)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),l=Dt(null===(o=this.fs.no)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===h&&(this.yF||this.SF)?(this.XF(t,s,a),jt(e)):i===l&&this.xF&&(this.jF(si(n,-1)),jt(e)),this.us.bs()},this.xb=(t,e,i,s)=>{var n,r;const o=Dt(null===(n=this.fs.no)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),a=Dt(null===(r=this.fs.no)||void 0===r?void 0:r.chartXYPanMouseButton,2);if(i===o&&(this.yF||this.SF)){const i=u(e.clientX,e.clientY);this.ZF(t,s,i),jt(e)}else i===a&&this.xF&&jt(e);this.engine.restoreMouseStyle(this.RF),this.uy.getIsUnderMouse()&&(this.RF=this.engine.setMouseStyle(this.PF)),this.YF=!1,this.HF=!1},this.Em=(t,e)=>{if(this.vF){const t=this.hg.us.De(e.clientX,e.clientY);this.QF(t,u(de(e),de(e))),jt(e)}},this.JF=(t,e,i,s)=>{},this.KF=(t,e,i,s,n,r)=>{if(this.xF){const t=u(-(s.x+n.x)/2,-(s.y+n.y)/2);this.jF(t),jt(r),this.HF=!0}if(this.vF){const t=this.engine.clientLocation2Engine(e.x,e.y),o=this.engine.clientLocation2Engine(i.x,i.y),a=ri(u(Math.abs(t.x-s.x-(o.x-n.x)),Math.abs(t.y-s.y-(o.y-n.y))),u(Math.abs(t.x-o.x),Math.abs(t.y-o.y)));this.forEachAxisX((t=>{t.getChartInteractionZoomByWheel()&&t.St(t.dt.pi(t.getInterval().start,-a.x),t.dt.pi(t.getInterval().end,a.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.St(t.dt.pi(t.getInterval().start,-a.y),t.dt.pi(t.getInterval().end,a.y),!1,!0,"interactionZoom")})),jt(r),this.YF=!0}},this.qF=(t,e,i,s)=>{this.HF=!1,this.YF=!1},this.tI=(t,e,i)=>{(this.SF||this.yF)&&(this.$F(t,e),jt(i))},this.iI=(t,e,i,s,n)=>{(this.SF||this.yF)&&(this.XF(t,e,i),jt(n))},this.sI=(t,e,i,s)=>{(this.SF||this.yF)&&(this.ZF(t,e,i),jt(s))},this.fs.zn||this.fs.Vn||this.fs.Kn||this.us.As(0),this.setPadding({right:24}),this.oM=i.YS("chartXY series bg",Fd.seriesBackground),this.eI=[Fd.gridLine0,Fd.gridLine1,Fd.gridLine2].map((t=>i.YS(`chartXY gridline #${t}`,t))),this.Qf=i.YS("chartXY highlighters below",Fd.highlightersBelow),this.yv=i.wp("chartXY plotting",Ld.plotting),this.Jf=i.wp("chartXY highlighters above",Ld.highlightersAbove),this.vf=i.wp("chartXY fg",Ld.fg),this.cT.x.J(0,this.uiScale.x.getCellSize()-(this.Xt.left+this.Xt.right+this.Da.left+this.Da.right)),this.cT.y.J(0,this.uiScale.y.getCellSize()-(this.Xt.bottom+this.Xt.top+this.Da.bottom+this.Da.top)),this.cT.q(this.uiScale.oi().x,this.uiScale.oi().y),this.uy=this.oM.Te(this.cT).ke(this.qi.chartXYSeriesBackgroundFillStyle).Ce(nt),this.Ay=this.vf.Te(this.cT).ke(V).Ce(this.qi.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.ly(this.uy,this.Ay),this.setSeriesBackgroundEffect(!1),this.kp=i.Tp();const h=Dt(o?o.autoCursorBuilder:void 0,Jl);this.Ag=h.$g(this.kp,this.cT,this.cT,this.qi),Ha.pg(this),this.yy(((t,e)=>{Ha.mg(this,e)})),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.OF),this.ng.Bh("ChartXY"),this.zm=Yi(new Xi(this.tI,this.iI,this.sI,1),new ji(this.JF,this.KF,this.qF)),this.onSeriesBackgroundMouseEnter(this.yb),this.onSeriesBackgroundMouseLeave(this.Sb),this.onSeriesBackgroundMouseWheel(this.Em),this.onSeriesBackgroundMouseDragStart(this.vb),this.onSeriesBackgroundMouseDrag(this.Vm),this.onSeriesBackgroundMouseDragStop(this.xb),this.onSeriesBackgroundTouchStart(this.zm.onTouchStart),this.onSeriesBackgroundTouchMove(this.zm.onTouchMove),this.onSeriesBackgroundTouchEnd(this.zm.onTouchEnd),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.ig(r,this.cT)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}solveNearest(t){const e=t||this.us.Bn();if(e)return Ha.gg(this,$o(e,this.us),this.iy)}getMinimumSize(){const t={x:0,y:0};t.x+=this.Xt.left+this.Xt.right+this.Da.left+this.Da.right,t.y+=this.Xt.top+this.Xt.bottom+this.Da.top+this.Da.bottom;const e=this.ng.Ds().Cc(),i=S(Vd(this.EF||Rd),this.eg);t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom;const s={x:0,y:0};return this.forEachAxisX((t=>{s.x=Math.max(s.x,t.TA())})),this.forEachAxisY((t=>{s.y=Math.max(s.y,t.TA())})),t.x+=s.x,t.y+=s.y,t.x+=wd.x,t.y+=wd.y,t}addChartMarkerXY(t=Kl,e,i){const s=this.YA(),n=new su(s,this.uiScale,e||this.getDefaultAxisX(),i||this.getDefaultAxisY(),t,this.OA(s),this.qi);return this.KA(n),n}addAxisX(t){const{opposite:e,type:i}=qo(t);let s;s="linear"===i.type?this.GA.d1({dimension:"x",scale1DConstructor:Ii}):"linear-highPrecision"===i.type?this.GA.d1({dimension:"x",scale1DConstructor:Ii}).Mi():this.GA.d1({dimension:"x",scale1DConstructor:bi}).Ai(i.base),s.q(this.cT.x.oi());const n=e?this.fF:this.AF,r=new Qo(this.Qf,this.eI,this.vf,this.hg,this.Qf,this.Jf,this.us.es,s,this.cT.y,(o=()=>r.vA(),{...ta,...lc(o)}),this,e?100:0,this.Kf,this.GF,this.qi,this.th,i);var o;return n.push(r),this.us.bs(),r}addAxisY(t){const{opposite:e,type:i}=qo(t);let s;s="linear"===i.type?this.GA.d1({dimension:"y",scale1DConstructor:Ii}):"linear-highPrecision"===i.type?this.GA.d1({dimension:"y",scale1DConstructor:Ii}).Mi():this.GA.d1({dimension:"y",scale1DConstructor:bi}).Ai(i.base),s.q(this.cT.y.oi());const n=e?this.pF:this.gF,r=new Qo(this.Qf,this.eI,this.vf,this.hg,this.Qf,this.Jf,this.us.es,s,this.cT.x,(o=()=>r.vA(),{...ea,...uc(o)}),this,e?100:0,this.Kf,this.GF,this.qi,this.th,i);var o;return n.push(r),this.us.bs(),r}dispose(){return this.Ag.dispose(),this.oM.W(),this.yv.W(),this.vf.W(),this.eI.forEach((t=>t.W())),this.Jf.W(),this.Qf.W(),this.kp.W(),this.jC().forEach((t=>t.dispose())),Oa(this.cT),this.forEachAxis((t=>{t.dispose()})),this.iy.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){return[...this.AF,...this.fF].find((t=>t.getVisible()))}getDefaultAxisY(){return[...this.gF,...this.pF].find((t=>t.getVisible()))}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):kd;return Ct(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.fF;case e.AxisPosition.Bottom:return this.AF;case e.AxisPosition.Left:return this.gF;case e.AxisPosition.Right:return this.pF}})))}hI(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.AF.slice().forEach(t),this.fF.slice().forEach(t)}forEachAxisY(t){this.gF.slice().forEach(t),this.pF.slice().forEach(t)}setTitlePosition(t){return this.EF=t,this.us.bs(),this}getTitlePosition(){return this.EF}NF(t,e,i,s){const n=this.EF||Rd;let r,o=S(Vd(n),this.eg);this.getTitleFillStyle()===V||0===this.getTitle().length?(r={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):r=this.ng.Ds().Cc();const a=Math.abs(s)+this.Da.bottom+this.Xt.bottom,h=Math.abs(i)+this.Da.top+this.Xt.top,l={left:Math.abs(t)+this.Da.left+this.Xt.left,right:Math.abs(e)+this.Da.right+this.Xt.right,top:h,bottom:a},u=this.uiScale.Wi(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=Bd(n,u,l,r,o,this.Da);return this.ng.Ie(f).Xa(c).Za(d),g}Fe(t){super.Fe(t);for(const t of this.iy)t.Gm();for(const t of this.iy)t.Fe();this.forEachAxis(Cd);let e=!1;this.forEachAxis((t=>{(t.wr()||t.Cr())&&(e=!0)}));const i=this.YF||this.HF||!this.bF&&e;Ha.dg(this,this.uy.getIsUnderMouse(),i,this.iy,(t=>Ha.gg(this,t,this.iy)),((t,e)=>t.gg(e,!0))),this.WF(),super.tg();for(const t of this.iy)t.$p()}j(){for(let t=0;t=10;r&&h&&a.x===s.x&&this.SF?(this.YF=!0,this._F.ke(this.FF).Ce(this.IF),this.wF.Ee(this.IF).Oe(s).ze(n),this.CF.Ee(this.IF).Oe(u(s.x,n.y)).ze(u(n.x,s.y)),this.RF=this.engine.setMouseStyle(this.LF,this.RF)):r&&h&&(this.yF||this.SF)?(this.YF=!0,this._F.ke(this.kF).Ce(this.TF),this.wF.Ee(nt),this.CF.Ee(nt),this.RF=this.engine.setMouseStyle(this.BF,this.RF)):(this.YF=!1,this._F.Ce(nt).ke(V),this.wF.Ee(nt),this.CF.Ee(nt),this.engine.restoreMouseStyle(this.RF)),this.us.bs()}ZF(t,e,i){if(this.YF){const t=ut(this.engine.clientLocation2Engine(i.x,i.y),this.hg.us.dt,this.cT),s=Ge(t.x,this.cT.x.getInnerStart(),this.cT.x.getInnerEnd())&&Ge(t.y,this.cT.y.getInnerStart(),this.cT.y.getInnerEnd()),n=i.x>=e.x||!this.SF?"zoom":"fit",r=this._F.Ya(),o=ni(r,this._F.oi()),a=Math.min(this._F.oi().x,this._F.oi().y)>=10;s&&a&&"zoom"===n&&this.yF?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=ut(r,this.cT,t.rA).x,i=ut(o,this.cT,t.rA).x;t.St(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=ut(r,this.cT,t.rA).y,i=ut(o,this.cT,t.rA).y;t.St(e,i,!0,!0,"interactionSetInterval")}}))):s&&a&&"fit"===n&&this.SF&&this.forEachAxis(Id)}this._F.Ce(nt).ke(V),this.wF.Ee(nt),this.CF.Ee(nt),this.us.bs()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}jF(t){this.forEachAxisX((e=>{e.getChartInteractionPanByDrag()&&e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.getChartInteractionPanByDrag()&&e.setStopped(!0).pan(t.y)}))}zoom(t,e){this.forEachAxis(Dd),this.forEachAxisX((i=>{i.zoom(i.dt.ut(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.dt.ut(t.y),e.y)}))}QF(t,e){this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&(Dd(i),i.zoom(i.dt.ut(t.x),e.x))})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&(Dd(i),i.zoom(i.dt.ut(t.y),e.y))}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}Sd(){const t=[];return this.forEachAxis((e=>e.pA((e=>t.push(e))))),super.Sd().concat(t)}jC(){return this.MF}me(){return this.ag(this.yv)}setAutoCursorEnabledDuringAxisAnimation(t){return this.bF=t,this}getAutoCursorEnabledDuringAxisAnimation(){return this.bF}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,n=e,r=ia(n)?n:Bi(n)?this.pixelScale:void 0;if(r&&Ri(i)){const t=ut(s,r,this.engine.scale);return this.us.Xo({engineX:t.x,engineY:t.y})}if(r&&Bi(i))return ut(s,r,this.pixelScale);if(r&&ia(i))return ut(s,r,i)}else{const i=t;if(Bi(e)){const t=this.us.$o(i);return ut({x:t.engineX,y:t.engineY},this.engine.scale,this.pixelScale)}if(ia(e)){const t=e,s=this.us.$o(i);return ut({x:s.engineX,y:s.engineY},this.engine.scale,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}}e.ChartXYTitlePositionOptions=void 0,(zd=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",zd.RightTop="right-top",zd.LeftTop="left-top",zd.CenterBottom="center-bottom",zd.RightBottom="right-bottom",zd.LeftBottom="left-bottom",zd.SeriesCenterTop="series-center-top",zd.SeriesRightTop="series-right-top",zd.SeriesLeftTop="series-left-top",zd.SeriesCenterBottom="series-center-bottom",zd.SeriesRightBottom="series-right-bottom",zd.SeriesLeftBottom="series-left-bottom";const Rd=e.ChartXYTitlePositionOptions.CenterTop,Vd=t=>{switch(t){case"center-top":case"series-center-bottom":return{left:0,right:0,top:0,bottom:5};case"left-top":return{left:20,right:0,top:0,bottom:5};case"right-top":return{left:0,right:20,top:0,bottom:5};case"center-bottom":return{left:0,right:0,top:0,bottom:0};case"left-bottom":return{left:20,right:0,top:0,bottom:0};case"right-bottom":return{left:0,right:20,top:0,bottom:0};case"series-center-top":return{left:0,right:0,top:5,bottom:0};case"series-left-top":return{left:5,right:0,top:5,bottom:0};case"series-right-top":return{left:0,right:5,top:5,bottom:0};case"series-left-bottom":return{left:5,right:0,top:0,bottom:5};case"series-right-bottom":return{left:0,right:5,top:0,bottom:5}}return Se(0,`Unexpected ChartXY title position selection ${t}`)},Bd=(t,e,i,s,n,r)=>{s.x,n.left,n.right;const o=s.y+n.bottom+n.top,a=(n.left-n.right)*e.x,h=(n.bottom-n.top)*e.y;switch(t){case"center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+a,y:100-(r.top+n.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:a,y:100-(r.top-n.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100+a,y:100-(r.top-n.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50+a,y:(r.bottom+n.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:a,y:(r.bottom+n.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100+a,y:(r.bottom+n.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"series-center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+a,y:100-i.top*e.y+h},marginsWithTitle:i};case"series-left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:i.left*e.x+a,y:100-i.top*e.y+h},marginsWithTitle:i};case"series-right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100-i.right*e.x+a,y:100-i.top*e.y+h},marginsWithTitle:i};case"series-center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50,y:i.bottom*e.y+h},marginsWithTitle:i};case"series-left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:i.left*e.x+a,y:i.bottom*e.y+h},marginsWithTitle:i};case"series-right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100-i.right*e.x+a,y:i.bottom*e.y+h},marginsWithTitle:i}}return Se(0,`Unexpected ChartXY title position selection ${t}`)},Od=(t,e)=>{const i=Math.floor(99999/e),s=Math.floor(99999/e),n=Math.floor(99998/e),r=Math.floor(99999/(e+1)),o=Math.floor(89999/(e+1)),a=410001+e*o;let h=0;return{rI:()=>{const e=t.nI("dashboard ui",a+h);return h+=1,e},oI:()=>t.nI("dashboard legend",41e4),aI:e=>{const a=1+e*i,h=100001+e*s,l=200002+e*n,u=300001+e*r,c=410001+e*o;let d=0;return{us:t,sg:(e,i)=>{const s=a+i;return t.nI(e,s)},YS:(e,i)=>{const s=h+i;return t.nI(e,s)},wp:(e,i)=>{const s=l+i;return t.nI(e,s)},US:(e,i,s)=>{const n=l+i;return t.lI(e,n,s)},rg:(e,i)=>{const s=u+i;return t.nI(e,s)},HA:e=>{const i=c+d,s=t.nI(e,i);return d+=1,s},XA:()=>t.nI("panel legend",400002+e),Tp:()=>t.nI("panel cursor",500001+e)}}}};class Nd{constructor(t){this.D=new n.Eventer,this.S=t}M(t){return this.S=t,this.D.emit("set",t),this}_(){return this.S}O(t){return this.D.on("set",t)}G(t){return this.D.off(t,"set")}}const Ud={uh:()=>{},ih:!1,sh:0,eh:!1,rh:0,hh:!1,oh:0,ah:0,Je:Rs.fitting},Gd=t=>{if(!t||"object"!=typeof t||null===t)return!1;const e=t.type;return!(!e||!["spark-line","spark-bar","spark-win-loss","spark-area","spark-pie"].includes(e))},Wd=(t,e,i,s,n,r,o,a)=>{const{type:h,data:l}=t;if(0===l.length)return;const u=[s,n];"spark-line"===h&&Zd(t,e,u,r,o,a),"spark-bar"===h&&Qd({...t,winLoss:!1},e,u,r,o,a),"spark-win-loss"===h&&Qd({...t,winLoss:!0},e,u,r,o,a),"spark-area"===h&&tf(t,e,u,r,o,a),"spark-pie"===h&&ef(t,e,u,r,o,a)},Yd=(t,e,i,s)=>({x:Xd(t.x,e.x,i.x,s),y:jd(t.y,e.y,i.y,s)}),Hd=(t,e,i,s)=>({position:Xd(t.position,e.x,i.x,s),high:jd(t.high,e.y,i.y,s),low:jd(t.low,e.y,i.y,s)}),Xd=(t,e,i,s)=>{const n=kt(t,e,e+i);return s[0].x+s[1].x*(n-e)/i},jd=(t,e,i,s)=>{const n=kt(t,e,e+i);return s[0].y+s[1].y*(n-e)/i},$d=(t,e,i,s,n,r,o,a)=>{for(const h of t)"point"===h.type&&qd(h,e,i,n,r,o,a),"axis-band"===h.type&&Jd(h,i,n,r,o,a),"constant-line"===h.type&&Kd(h,i,s,n,r,o,a)},qd=(t,i,s,n,r,o,a)=>{const{value:h,fillStyle:l,shape:u,size:c,rotation:d}=t;let f={x:NaN,y:NaN};if("start"===h&&(f=i[0]),"end"===h&&(f=i[i.length-1]),"min"===h){f=i[0];for(const t of i)f=f.yt.y?f:t}("object"!=typeof h||(f=Yd(h,s,n,r),((t,e)=>{const i=e[0],s=e[1],n=t.x,r=t.y;return i.x<=n&&n<=i.x+s.x&&i.y<=r&&r<=i.y+s.y})(f,r)))&&o.pointSet.add().Nt().Sl(void 0!==u?u:e.PointShape.Circle).zh(d||0).q(c||5).ke(l||a.sparkPointChartFillStyle)._l(f)},Jd=(t,e,i,s,n,r)=>{const{axis:o,start:a,end:h,fillStyle:l,strokeStyle:c}=t;let d=u(Fe,_e),f=u(Fe,_e);"x"===o&&(d=Yd({x:a,y:Fe},e,i,s),f=Yd({x:h,y:_e},e,i,s)),"y"===o&&(d=Yd({x:Fe,y:a},e,i,s),f=Yd({x:_e,y:h},e,i,s));const g=s[0],m=s[1],p=kt(d.x,g.x,g.x+m.x),y=kt(d.y,g.y,g.y+m.y),A=kt(f.x,g.x,g.x+m.x),x=kt(f.y,g.y,g.y+m.y);n.rect.add().Fl(p).Il(y).q(u(A-p,x-y)).ke(l||r.sparkChartBandFillStyle).Ce(c||r.sparkChartBandStrokeStyle).Ce(nt)},Kd=(t,e,i,s,n,r,o)=>{const{axis:a,value:h,strokeStyle:l}=t,c=h||0,d=e.y,f=i.y,g=e.x,m=i.x,p=[];if("y"===a&&d<=c&&c<=f){const t=Yd(u(g,c),{x:g,y:d},s,n),e=Yd(u(m,c),{x:g,y:d},s,n);p.push([t,e])}if("x"===a&&g<=c&&c<=m){const t=Yd(u(c,d),{x:g,y:d},s,n),e=Yd(u(c,f),{x:g,y:d},s,n);p.push([t,e])}p.length>0&&r.line.add().Ee(l||o.sparkChartConstantLineStrokeStyle).Oe(p[0][0]).ze(p[0][1])},Zd=(t,e,i,s,n,r)=>{const{strokeStyle:o,data:a,markers:h}=t,l=a.length;l>1e4&&n.oo&&St.console.warn("LightningChart JS warning: SparkLineChart has over 10000 data points. This feature is not designed for large data sets which might show as performance drop. If you want to request improvements to this, contact https://lightningchart.com/js-charts/docs/contact. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let u=_e,c=Fe,d=_e,f=Fe;for(let t=0;tYd(t,{x:u,y:d},g,i)));e.lineSet.add().cs(r).Ee(o||s.sparkLineChartStrokeStyle).Nt()._l(m),h&&$d(h,m,{x:u,y:d},{x:c,y:f},g,i,e,s)},Qd=(t,e,i,s,n,r)=>{const{data:o,fillStyle:a,strokeStyle:h,threshold:l,winFillStyle:u,lossFillStyle:c}=t,d=t.barSize||1,f=t.gap||1,g=t.winLoss,m=l||0,p=f/d*1;let y=_e,A=Fe;if(g)y=-1,A=1;else for(const t of o)y=Math.min(y,t),A=Math.max(A,t);const x={x:0,y:g?-1:Math.min(0,y)},S={x:1*o.length+(o.length-1)*p,y:g?2:Math.max(A,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*p,y:g?t>=m?1:0:t},n=Yd({x:1*e+e*p,y:g?t>=m?0:-1:0},x,S,i),r=Yd(s,x,S,i);return{value:t,position:n,width:r.x-n.x,height:r.y-n.y}})).forEach((t=>{var i;e.rect.add().cs(r).Ie(t.position).Dl(t.height).Pl(t.width).ke((i=t.value,g?(i>=m?u:c)||s.sparkBarChartFillStyle:a||s.sparkBarChartFillStyle)).Ce(h||s.sparkBarChartStrokeStyle)}))},tf=(t,e,i,s,n,r)=>{const{data:o,fillStyle:a,strokeStyle:h,markers:l}=t,u=o.length;u>1e4&&n.oo&&St.console.warn("LightningChart JS warning: SparkAreaChart has over 10000 data points. This feature is not designed for large data sets which might show as performance drop. If you want to request improvements to this, contact https://lightningchart.com/js-charts/docs/contact. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let c=_e,f=Fe,g=_e,m=Fe;for(let t=0;t{const{data:o,strokeStyle:a}=t,h=o.map((t=>"number"==typeof t?t:t.value)),l=o.map((t=>"object"==typeof t?t.fillStyle:void 0)),c=h.reduce(((t,e)=>t+e),0),d=Yd(u(50,50),{x:0,y:0},{x:100,y:100},i),f=i[1],g=f.x<=f.y?f.x/2:f.y/2;let m=90;h.forEach(((t,i)=>{const n=t/c*360;e.arc.add().cs(r).Ie(d).xu(g)._u(0).vu(m).ze(m+n).ke(l[i]||ce(s.sparkPieChartFillStyle,i)).Ce(a||s.sparkPieChartStrokeStyle),m+=n}))};var sf,nf,rf;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(sf||(sf={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(nf||(nf={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(rf||(rf={}));class of extends cr{constructor(t,e,i,s,n){super(),this.Bs=!1,this.Ow={x:0,y:0,height:20,width:20},this.uI={x:10,y:10},this.Ts=t,this.cI=n,this.dI=new ro(t,e,i,wt,s).setMouseInteractions(!0),this.fI=t.vc(e,rr.Simple).ke(s.dataGridScrollBarButtonArrowFillStyle).Ce(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.Ou(this),this.dI.onMouseEnter((t=>t.setHighlight(1))),this.dI.onMouseLeave((t=>t.setHighlight(0)))}AI(){switch(this.cI){case rf.Up:this.fI.Rl([{x:this.Ow.x,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y-this.uI.y/2},{x:this.Ow.x-this.uI.x/2,y:this.Ow.y-this.uI.y/2}]);break;case rf.Down:this.fI.Rl([{x:this.Ow.x-this.uI.x/2,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x,y:this.Ow.y-this.uI.y/2}]);break;case rf.Left:this.fI.Rl([{x:this.Ow.x-this.uI.x/2,y:this.Ow.y},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y-this.uI.y/2}]);break;case rf.Right:this.fI.Rl([{x:this.Ow.x-this.uI.x/2,y:this.Ow.y+this.uI.y/2},{x:this.Ow.x+this.uI.x/2,y:this.Ow.y},{x:this.Ow.x-this.uI.x/2,y:this.Ow.y-this.uI.y/2}])}}Ie(t){return this.Ow.x=t.x,this.Ow.y=t.y,this}Ya(){return u(this.Ow.x,this.Ow.y)}q(t){return this.Ow.height=t.x,this.Ow.width=t.y,this}oi(){return{x:this.Ow.height,y:this.Ow.width}}onMouseDown(t){return this.dI.onMouseDown(t)}onMouseUp(t){return this.dI.onMouseUp(t)}setFillStyle(t){return this.dI.setFillStyle(t),this}getFillStyle(){return this.dI.getFillStyle()}setStrokeStyle(t){return this.dI.setStrokeStyle(t),this}getStrokeStyle(){return this.dI.getStrokeStyle()}Fe(){return this.dI.Fe(),this.AI(),this}Ds(){return this.dI.setSize(u(this.Ow.height,this.Ow.width)).setPosition(u(this.Ow.x,this.Ow.y)),this}setVisible(t){return this.dI.setVisible(t),this.fI.setVisible(t),this}dispose(){return this.dI.dispose(),this.fI.dispose(),this}setMouseInteractions(t){return this.dI.setMouseInteractions(t),this}getMouseInteractions(){return this.dI.getMouseInteractions()}onHighlight(t){return this.D.on("highlight",t)}offHighlight(t){return this.D.off(t)}getHighlight(){return this.dI.getHighlight()}setHighlight(t){return this.dI.setHighlight(Ae(t)),this.D.emit("highlight",this,Boolean(t)),this.Ts.bs(),this}}const af=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class hf{constructor(t,i,s,r,o,a,h){this.Ic={x:0,y:0},this.Ow={x:0,y:0,height:0,width:0},this.D=new n.Eventer,this.gI={min:u(0,0),max:u(0,0)},this.qx=!1,this.tb=!1,this.pI={x:0,y:0},this.Gu=void 0,this.mI=u(0,0),this.yI={x:0,y:0},this.SI=0,this.vI=15,this.ib=(t,i)=>{this.qx=!0,this.vf.bs();const s=this.xI.getDraggingMode();this.Gu=this.vf.us.Er(s===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:s===e.UIDraggingModes.draggable?e.MouseStyles.Move:s===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical),this.bI&&clearInterval(this.bI)},this.sb=()=>{this.qx=!1,this.vf.bs(),this.vf.us.Vr(this.Gu)},this.eb=t=>(this.tb=!0,this.pI=ut(this.vf.us.De(t.x,t.y),this.vf.us.dt,this.scale),!0),this.MI=(t,e)=>(this._I(e),this.bI=setInterval((()=>this._I(e)),300),!0),this.wI=()=>(clearInterval(this.bI),!0),this.hb=(t,i)=>{const s=this.xI.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const n=i||s,r=ut(this.vf.us.De(t.x,t.y),this.vf.us.dt,this.scale),o=u(n!==e.UIDraggingModes.onlyVertical?af(r.x,this.scale.x):this.Ow.x,n!==e.UIDraggingModes.onlyHorizontal?af(r.y,this.scale.y):this.Ow.y),a=u(o.x-this.pI.x,o.y-this.pI.y),h=u(this.xI.getPosition().x+a.x,this.xI.getPosition().y+a.y),l=this.CI(h),c={x:Math.abs(this.mI.x-l.x),y:Math.abs(this.mI.y-l.y)};return this.kI(c),this.yI.y>a.y&&(this.pI=r),this.Fe(),!0}return!1},this.rb=(t,e)=>{this.tb=!1,jt(e),this.vf.bs()},this.vf=t,this.zA=i,this.scale=r,this.contentScale=o,this.TI=h,this.FI=new of(t,s,r,a,h===sf.UpToDown?rf.Up:rf.Left).setStrokeStyle(a.dataGridScrollBarButtonStrokeStyle).setFillStyle(a.dataGridScrollBarButtonFillStyle),this.II=new of(t,s,r,a,h===sf.UpToDown?rf.Down:rf.Right).setStrokeStyle(a.dataGridScrollBarButtonStrokeStyle).setFillStyle(a.dataGridScrollBarButtonFillStyle),this.xI=new ro(t,s,r,wt,a).setFillStyle(a.dataGridScrollBarFillStyle).setStrokeStyle(a.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(h===sf.UpToDown?e.UIDraggingModes.onlyVertical:h===sf.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.DI=new ro(i,s,r,wt,a).setFillStyle(a.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(a.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.xI.onMouseEnter(this.ib),this.xI.onMouseLeave(this.sb),this.xI.onMouseDragStart(((t,e)=>this.eb(u(e.clientX,e.clientY))&&jt(e))),this.xI.onMouseDrag(((t,e)=>this.hb(u(e.clientX,e.clientY))&&jt(e))),this.xI.onMouseDragStop(this.rb),this.xI.onTouchStart(((t,e)=>this.eb(u(e.clientX,e.clientY))&&jt(e))),this.xI.onTouchMove(((t,e)=>this.hb(u(e.clientX,e.clientY))&&jt(e))),this.xI.onTouchEnd(this.rb),this.FI.onMouseDown(((t,e)=>this.MI(t,e)&&jt(e))),this.II.onMouseDown(((t,e)=>this.MI(t,e)&&jt(e))),this.FI.onMouseUp(((t,e)=>this.wI()&&jt(e))),this.II.onMouseUp(((t,e)=>this.wI()&&jt(e))),this.DI.onMouseWheel(((t,e)=>this.BI(e))),this.xI.onMouseWheel(((t,e)=>this.BI(e))),this.DI.onMouseDown(((t,e)=>this.MI(t,e)&&jt(e))),this.DI.onMouseUp(((t,e)=>this.wI()&&jt(e)))}LI(t){return this.Ow=t,this}Pl(t){return this.Ow.width=t,this}RI(){return this.Ow.width}EI(t){return this.mI=t,this}VI(t){return this.Ic=t,this}zI(){return this.Ic}OI(t){return this.vI=t,this}NI(){return this.TI}GI(t){let e;switch(this.TI){case sf.UpToDown:return e=t>0?Math.min(this.mI.y-this.gI.max.y,this.yI.y+t):Math.max(0,this.yI.y+t),e!==this.yI.y&&(this.kI({x:0,y:e}),this.Fe(),!0);case sf.LeftToRight:return e=Math.min(this.gI.max.x-this.mI.x,this.yI.x+t),e!==this.yI.x&&(this.kI({y:0,x:e}),this.Fe(),!0);default:return!1}}WI(t){let e;switch(this.TI){case sf.UpToDown:return e=Math.max(0,this.yI.y-t),e!==this.yI.y&&(this.kI({x:0,y:e}),this.Fe(),!0);case sf.LeftToRight:return e=t>0?Math.max(0,this.yI.x-t):Math.min(this.gI.max.x-this.mI.x,this.yI.x-t),e!==this.yI.x&&(this.kI({x:e,y:0}),this.Fe(),!0);default:return!0}}UI(t){switch(this.TI){case sf.UpToDown:return this.D.on("scrollY",t);case sf.LeftToRight:return this.D.on("scrollX",t)}return this.D.on("scrollY",t)}CI(t){switch(this.TI){case sf.UpToDown:if(t.y>this.gI.min.y)return u(t.x,this.gI.min.y);if(t.ythis.gI.max.x)return u(this.gI.max.x,t.y)}return t}BI(t){t.deltaY>0&&this.YI()&&jt(t),t.deltaY<0&&this.HI()&&jt(t)}_I(t){const e=ut(this.vf.us.De(t.clientX,t.clientY),this.vf.us.dt,this.scale);let i;const s=this.xI.getPosition(),n=this.xI.getSize();this.$I(e,s,n)?clearInterval(this.bI):(i=this.TI===sf.UpToDown?u(0,e.y-s.y>0?this.vI:-this.vI):u(s.x-e.x>0?this.vI:-this.vI,0),(i.x>0||i.y>0)&&this.XI(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.jI(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}$I(t,e,i){return this.TI===sf.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.Ow.height?Math.min(this.mI.y-this.gI.max.y,this.yI.y+t):0,e!==this.yI.y&&(this.kI({x:0,y:e}),this.Fe(),!0)}case sf.LeftToRight:{const e=Math.min(this.gI.max.x-this.mI.x,this.yI.x+t);return e!==this.yI.x&&(this.kI({y:0,x:e}),this.Fe(),!0)}default:return!1}}HI(){return this.XI(this.vI)}YI(){return this.jI(this.vI)}kI(t){if(t.x===this.yI.x&&t.y===this.yI.y)return;let e;switch(this.yI=t,this.TI){case sf.UpToDown:e=this.yI.y*this.SI*this.contentScale.Wi().y,this.D.emit("scrollY",nf.Vertical,e),this.vf.us.bs();break;case sf.LeftToRight:e=this.yI.x*this.SI*this.contentScale.Wi().x,this.D.emit("scrollX",nf.Horizontal,e)}}setVisible(t){return this.FI.setVisible(t),this.II.setVisible(t),this.DI.setVisible(t),this.xI.setVisible(t),this}dispose(){return this.FI.dispose(),this.II.dispose(),this.DI.dispose(),this.xI.dispose(),this.bI&&clearInterval(this.bI),this}Ds(){switch(this.QI(),this.JI(),this.TI){case sf.UpToDown:this.FI.Ie({x:this.Ow.x,y:this.Ow.y+this.Ow.height-this.FI.oi().x/2}).q(u(this.Ow.width,this.Ow.width)).Ds(),this.II.Ie({x:this.Ow.x,y:this.Ow.y+10}).q(u(this.Ow.width,this.Ow.width)).Ds(),this.DI.setSize({x:this.Ow.width,y:this.Ow.height-2*this.FI.oi().x}).setPosition({x:this.Ow.x,y:this.Ow.y+this.II.oi().y+this.DI.getSize().y/2}),this.xI.setSize(u(this.Ow.width,this.KI())),this.mI={x:this.Ow.x,y:this.FI.Ya().y-this.FI.oi().y/2-this.xI.getSize().y/2},this.ZI({min:{x:this.Ow.x,y:this.FI.Ya().y-this.FI.oi().y/2-this.xI.getSize().y/2},max:{x:this.Ow.x,y:this.II.Ya().y+this.II.oi().x/2+this.xI.getSize().y/2}});break;case sf.LeftToRight:this.FI.Ie({x:this.Ow.x,y:this.Ow.y}).q(u(this.Ow.height,this.Ow.height)).Ds(),this.II.Ie({x:this.Ow.x+this.Ow.width-this.II.oi().x,y:this.Ow.y}).q(u(this.Ow.height,this.Ow.height)).Ds(),this.DI.setSize({y:this.Ow.height,x:this.Ow.width-2*this.FI.oi().y}).setPosition({x:this.Ow.x+this.FI.oi().x/2+this.DI.getSize().x/2,y:this.Ow.y}),this.xI.setSize(u(this.KI(),this.Ow.height)),this.mI={x:this.FI.Ya().x+this.FI.oi().x/2+this.xI.getSize().x/2,y:this.Ow.y},this.ZI({min:{x:this.FI.Ya().x+this.FI.oi().x/2+this.xI.getSize().x/2,y:this.Ow.y},max:{x:this.II.Ya().x-this.II.oi().x/2-this.xI.getSize().x/2,y:this.Ow.y}})}return this.qI(),this}QI(){switch(this.TI){case sf.UpToDown:this.tP()||this.setVisible(!1),this.tP()&&this.setVisible(!0);break;case sf.LeftToRight:this.iP()||this.setVisible(!1),this.iP()&&this.setVisible(!0)}}JI(){switch(this.TI){case sf.UpToDown:this.tP()||this.kI({x:0,y:0});break;case sf.LeftToRight:this.iP()||this.kI({x:0,y:0})}}tP(){return this.Ic.x>this.Ow.height}iP(){return this.Ic.y>this.Ow.width}KI(){switch(this.TI){case sf.UpToDown:return this.Ow.height*(this.Ow.height-2*this.FI.oi().x)/this.Ic.x;case sf.LeftToRight:return this.Ow.width*(this.Ow.width-2*this.FI.oi().y)/this.Ic.y;default:return 0}}qI(){switch(this.TI){case sf.UpToDown:this.SI=(this.Ic.x-this.Ow.height)/(this.gI.min.y-this.gI.max.y);break;case sf.LeftToRight:this.SI=(this.Ic.y-this.Ow.width)/(this.gI.max.x-this.gI.min.x)}}Fe(){switch(this.FI.Fe(),this.II.Fe(),this.DI.Fe(),this.TI){case sf.UpToDown:this.xI.setPosition({x:this.Ow.x,y:this.FI.Ya().y-this.FI.oi().y/2-this.xI.getSize().y/2-this.yI.y}).Fe();break;case sf.LeftToRight:this.xI.setPosition({y:this.Ow.y,x:this.FI.Ya().x+this.FI.oi().x/2+this.xI.getSize().x/2+this.yI.x}).Fe()}return this}}class lf{constructor(t,e,i,s,n,r,o){switch(this.vf=t,this.zA=e,this.scale=s,this.contentScale=n,o){case nf.Vertical:this.sP=this.eP(i,r,sf.UpToDown);break;case nf.Horizontal:this.hP=this.eP(i,r,sf.LeftToRight);break;case nf.Both:this.sP=this.eP(i,r,sf.UpToDown),this.hP=this.eP(i,r,sf.LeftToRight)}this.rP=Yi(new Xi(void 0,((t,e,i,s,n)=>{var r,o;0!==s.x&&(null===(r=this.hP)||void 0===r?void 0:r.WI(s.x))&&jt(n),0!==s.y&&(null===(o=this.sP)||void 0===o?void 0:o.GI(s.y))&&jt(n)})))}eP(t,e,i){return new hf(this.vf,this.zA,t,this.scale,this.contentScale,e,i)}RI(){return 20}VI(t){var e,i;return null===(e=this.sP)||void 0===e||e.VI(t),null===(i=this.hP)||void 0===i||i.VI(t),this}nP(t){var e;return null===(e=this.hP)||void 0===e||e.OI(t),this}oP(t){var e;return null===(e=this.sP)||void 0===e||e.OI(t),this}aP(t){const e=this.sP;return e&&e.BI(t),this}lP(t){return this.rP.onTouchStart(this,t),this}uP(t){return this.rP.onTouchMove(this,t),this}cP(t){return this.rP.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.hP)||void 0===e||e.UI(t),null===(i=this.sP)||void 0===i||i.UI(t),this}dispose(){var t,e;return null===(t=this.sP)||void 0===t||t.dispose(),null===(e=this.hP)||void 0===e||e.dispose(),this}Fe(){var t,e;return null===(t=this.sP)||void 0===t||t.Fe(),null===(e=this.hP)||void 0===e||e.Fe(),this}Ds(){var t,e,i,s;const n=this.scale.x,r=this.scale.y;return null===(t=this.sP)||void 0===t||t.LI({x:n.getInnerEnd()-10,y:r.getInnerStart()+20,height:r.getInnerEnd()-20,width:20}),null===(e=this.hP)||void 0===e||e.LI({x:n.getInnerStart()+10,y:r.getInnerStart()+10,height:20,width:n.getInnerEnd()-20}),null===(i=this.sP)||void 0===i||i.Ds(),null===(s=this.hP)||void 0===s||s.Ds(),this}}class uf extends Ga{constructor(t,e,i,s,n,r){super(t,e,i,e.sg("dataGrid bg",0),s,e.us.qi.dataGridBackgroundFillStyle,e.us.qi.dataGridBackgroundStrokeStyle,e.us.qi.dataGridTitleFont,e.us.qi.dataGridTitleFillStyle,r),this.dP=[],this.fP=[],this.AP=[],this.gP=new Map,this.pP=!0,this.mP=!0,this.yP=!0,this.SP=!0,this.vP=!0,this.xP=!0,this.bP=!0,this.MP=!0,this._P=!0,this.wP=!0,this.CP=!0,this.kP=!0,this.TP=!0,this.FP=!0,this.IP=!0,this.PP=!0,this.DP=new Set,this.BP=new Set,this.LP=!0,this.RP=!0,this.EP=(t,e)=>{t.borders=void 0===e?mf:{...t.borders,...e},this.VP(t),this.kP=!0,this.us.bs()},this.VP=t=>{t.borders&&(!1===t.borders.top&&this.zP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.OP,bottom:!1}})),!1===t.borders.bottom&&this.zP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.OP,top:!1}})),!1===t.borders.left&&this.zP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.OP,right:!1}})),!1===t.borders.right&&this.zP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.OP,left:!1}})),!0===t.borders.top&&this.zP(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.OP,bottom:!0}})),!0===t.borders.bottom&&this.zP(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.OP,top:!0}})),!0===t.borders.left&&this.zP(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.OP,right:!0}})),!0===t.borders.right&&this.zP(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.OP,left:!0}})))},this.NP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseEnter,i,e)},this.GP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseLeave,i,e)},this.WP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseClick,i,e)},this.UP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDoubleClick,i,e)},this.YP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDown,i,e)},this.HP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseUp,i,e)},this.$P=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseMove,i,e)},this.XP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDrag,i,e)},this.jP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDragStart,i,e)},this.ZP=(t,e)=>{const i=this.gP.get(t);i&&this.D.emit(cf.cellMouseDragStop,i,e)},this.QP=(t,e)=>{const i=this.gP.get(t);i&&(this.D.emit(cf.cellMouseWheel,i,e),!e.defaultPrevented&&this.LP&&this.JP.aP(e))},this.KP=(t,e)=>{const i=this.gP.get(t);i&&(this.D.emit(cf.cellTouchStart,i,e),!e.defaultPrevented&&this.RP&&this.JP.lP(e))},this.qP=(t,e)=>{const i=this.gP.get(t);i&&(this.D.emit(cf.cellTouchMove,i,e),!e.defaultPrevented&&this.RP&&this.JP.uP(e))},this.tD=(t,e)=>{const i=this.gP.get(t);i&&(this.D.emit(cf.cellTouchEnd,i,e),!e.defaultPrevented&&this.RP&&this.JP.cP(e))},this.fs.Vn||this.fs.On||this.us.As(2),this.ng.Bh("Data Grid"),this.iD=i.d2({scaleXYConstructor:Li}),this.iD.x.tA=Ud,this.sD=i.d2({scaleXYConstructor:Li}),this.eD={x:0,y:0},this.hD=this.qi.dataGridTextFont,this.rD=this.qi.dataGridTextFillStyle,this.OP={top:!0,bottom:!0,left:!0,right:!0},this.nD=this.qi.dataGridCellBackgroundFillStyle,this.oD=this.qi.dataGridBorderStrokeStyle,this.aD="left-center",this.lD={left:5,right:5,bottom:5,top:5},this.uD=e.YS("dataGrid grid bg",0),this.cD=e.YS("dataGrid cell bg",1),this.dD=e.wp("dataGrid cell content",0),this.fD=e.wp("dataGrid scrollbar bg",1),this.AD=e.wp("dataGrid scrollbar fg",2),this.JP=this.gD(),this.onBackgroundMouseWheel(((t,e)=>{this.LP&&this.JP.aP(e)})),this.onBackgroundTouchStart(((t,e)=>{this.RP&&this.JP.lP(e)})),this.onBackgroundTouchMove(((t,e)=>{this.RP&&this.JP.uP(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.RP&&this.JP.cP(e)})),this.pD=this.uD.Te(this.iD).ke(this.qi.dataGridBackgroundFillStyle).Ce(nt).setMouseInteractions(!1),this.mD=this.dD._A(this.iD).setMouseInteractions(!1),this.yD=new zh((()=>this.cD.Te(this.iD).setMouseInteractions(!0).setMouseEnterEventHandler(this.NP).setMouseLeaveEventHandler(this.GP).setMouseClickEventHandler(this.WP).setMouseDoubleClickEventHandler(this.UP).setMouseDownEventHandler(this.YP).setMouseUpEventHandler(this.HP).setMouseMoveEventHandler(this.$P).setMouseDragEventHandler(this.XP).setMouseDragStartEventHandler(this.jP).setMouseDragStopEventHandler(this.ZP).setMouseWheelEventHandler(this.QP).setTouchStartEventHandler(this.KP).setTouchMoveEventHandler(this.qP).setTouchEndEventHandler(this.tD))),this.SD=new zh((()=>this.dD.Te(this.iD).setMouseInteractions(!1))),this.vD=new zh((()=>this.dD.kr(this.iD).setMouseInteractions(!1))),this.xD=new zh((()=>this.dD.zp(this.iD,{},[kh.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.bD=new zh((()=>this.dD.Ve(this.iD).setMouseInteractions(!1))),this.MD=new zh((()=>this.dD.Oc(this.iD).setMouseInteractions(!1))),this._D=new zh((()=>this.dD.Te(this.iD).setMouseInteractions(!1))),this.wD=new zh((()=>this.dD.yC(this.iD).setMouseInteractions(!1))),this.CD=new zh((()=>this.dD.Fc(this.iD).setMouseInteractions(!1))),this.ig(n,this.uiScale),this.onResize((()=>{this.pP=!0,this.us.bs(),this.iD.q(this.pixelScale.oi()),this.sD.q(this.pixelScale.oi())})),this.kD=this.es.gA([this.pD])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}Sd(){return[]}dispose(){return super.dispose(),this.uD.W(),this.cD.W(),this.dD.W(),this.fD.W(),this.AD.W(),Oa(this.iD),Oa(this.sD),this.JP.dispose(),this.vD.Zp(),this.yD.Zp(),this.SD.Zp(),this.xD.Zp(),this.bD.Zp(),this.MD.Zp(),this._D.Zp(),this.wD.Zp(),this.CD.Zp(),this}j(){return super.j(),this.iD.j(),this.sD.j(),this}Z(){return super.Z(),this.iD.Z(),this.sD.Z(),this}setBackgroundEffect(t){return this.kD.xs(t),this.us.bs(),this}getBackgroundEffect(){return this.kD.Ms()}setInteractionScrollOnWheel(t){return this.LP=t,this}getInteractionScrollOnWheel(){return this.LP}setInteractionPanOnTouch(t){return this.RP=t,this}getInteractionPanOnTouch(){return this.RP}onCellMouseEnter(t){return this.D.on(cf.cellMouseEnter,t)}offCellMouseEnter(t){return this.D.off(t)}onCellMouseLeave(t){return this.D.on(cf.cellMouseLeave,t)}offCellMouseLeave(t){return this.D.off(t)}onCellMouseClick(t){return this.D.on(cf.cellMouseClick,t)}offCellMouseClick(t){return this.D.off(t)}onCellMouseDoubleClick(t){return this.D.on(cf.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.D.off(t)}onCellMouseDown(t){return this.D.on(cf.cellMouseDown,t)}offCellMouseDown(t){return this.D.off(t)}onCellMouseUp(t){return this.D.on(cf.cellMouseUp,t)}offCellMouseUp(t){return this.D.off(t)}onCellMouseMove(t){return this.D.on(cf.cellMouseMove,t)}offCellMouseMove(t){return this.D.off(t)}onCellMouseDrag(t){return this.D.on(cf.cellMouseDrag,t)}offCellMouseDrag(t){return this.D.off(t)}onCellMouseDragStart(t){return this.D.on(cf.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.D.off(t)}onCellMouseDragStop(t){return this.D.on(cf.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.D.off(t)}onCellMouseWheel(t){return this.D.on(cf.cellMouseWheel,t)}offCellMouseWheel(t){return this.D.off(t)}onCellTouchStart(t){return this.D.on(cf.cellTouchStart,t)}offCellTouchStart(t){return this.D.off(t)}onCellTouchMove(t){return this.D.on(cf.cellTouchMove,t)}offCellTouchMove(t){return this.D.off(t)}onCellTouchEnd(t){return this.D.on(cf.cellTouchEnd,t)}offCellTouchEnd(t){return this.D.off(t)}setGridBackgroundFillStyle(t){return this.pD.ke(t),this.us.bs(),this}getGridBackgroundFillStyle(){return this.pD.Lh()}setCellContent(t,e,i,s,n){if("number"==typeof i&&void 0!==s&&void 0!==n){const r=i,o=s,a=n;let h=[];for(let i=t;ie.column===t));return i||(i={column:t,min:void 0,max:void 0},this.fP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.fP.splice(this.fP.indexOf(i),1):(i.min=e,i.max=e),this.xP=!0,this.us.bs(),this}setRowHeight(t,e){let i=this.AP.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.AP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.AP.splice(this.AP.indexOf(i),1):(i.min=e,i.max=e),this.xP=!0,this.us.bs(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.FD(t,(t=>this.ID(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.PD(t,(t=>this.ID(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=x(i,i,i,i)),this.zP(t,e,(t=>this.ID(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=x(t,t,t,t)),this.lD={...this.lD,...t},this.DD((t=>this.ID(t,this.lD))),this}setCellBorders(t,e,i){return this.zP(t,e,(t=>this.EP(t,i))),this}setRowBorders(t,e){return this.PD(t,(t=>this.EP(t,e))),this}setColumnBorders(t,e){return this.FD(t,(t=>this.EP(t,e))),this}setCellsBorders(t){return this.OP=void 0===t?mf:t,this.DD((t=>this.EP(t,this.OP))),this}setCellsBorderStrokeStyle(t){return this.oD="function"==typeof t?t(this.oD):t,this.FP=!0,this.us.bs(),this}setColumnTextFillStyle(t,e){return this.FD(t,(t=>this.BD(t,e))),this}setRowTextFillStyle(t,e){return this.PD(t,(t=>this.BD(t,e))),this}setCellTextFillStyle(t,e,i){return this.zP(t,e,(t=>this.BD(t,i))),this}setCellsTextFillStyle(t){return this.rD="function"==typeof t?t(this.rD):t,this.DD((t=>this.BD(t,this.rD))),this}setColumnTextFont(t,e){return this.FD(t,(t=>this.LD(t,e))),this}setRowTextFont(t,e){return this.PD(t,(t=>this.LD(t,e))),this}setCellTextFont(t,e,i){return this.zP(t,e,(t=>this.LD(t,i))),this}setCellsTextFont(t){return this.hD="function"==typeof t?t(this.hD):t,this.DD((t=>this.LD(t,this.hD))),this}setColumnContentAlignment(t,e){return this.FD(t,(t=>this.RD(t,e))),this}setRowContentAlignment(t,e){return this.PD(t,(t=>this.RD(t,e))),this}setCellContentAlignment(t,e,i){return this.zP(t,e,(t=>this.RD(t,i))),this}setCellsContentAlignment(t){return this.aD=t,this.DD((t=>this.RD(t,this.aD))),this}setCellBackgroundFillStyle(t,e,i){return this.zP(t,e,(t=>this.ED(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.FD(t,(t=>this.ED(t,e))),this}setRowBackgroundFillStyle(t,e){return this.PD(t,(t=>this.ED(t,e))),this}setCellsBackgroundFillStyle(t){return this.nD="function"==typeof t?t(this.nD):t,this.DD((t=>this.ED(t,this.nD))),this}setCellHighlight(t,e,i){return this.zP(t,e,(t=>{t.highlight=Ae(i)})),this.TP=!0,this.us.bs(),this}setColumnHighlight(t,e){const i=Ae(e);return this.FD(t,(t=>{t.highlight=i})),this.TP=!0,this.us.bs(),this}setRowHighlight(t,e){const i=Ae(e);return this.PD(t,(t=>{t.highlight=i})),this.TP=!0,this.us.bs(),this}removeCell(t,e){return this.zP(t,e,(t=>this.dP.splice(this.dP.indexOf(t),1))),this.vP=!0,this.us.bs(),this}removeRow(t){return this.PD(t,(t=>this.dP.splice(this.dP.indexOf(t),1))),this.dP.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.vP=!0,this.us.bs(),this}removeColumn(t){return this.FD(t,(t=>this.dP.splice(this.dP.indexOf(t),1))),this.dP.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.vP=!0,this.us.bs(),this}removeCells(){return this.dP.splice(0),this.vP=!0,this.us.bs(),this}getColumnMax(){return 0===this.dP.length?0:this.dP.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.dP.length?0:this.dP.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}Fe(t){super.Fe(t),Wa.cg(this.ng,this.eg),super.tg();const e=Math.round(this.oD.V()),i=e/2;let s=this.mP||this.yP||this.SP||this.vP||this.xP||this.bP||this.CP||this.kP||this.FP||this.PP;if(s){this.dP.forEach((t=>{this.BP.add(t.column)})),this.dP.forEach((t=>{this.DP.add(t.row)}));const t=this.vD.Xp(),n=this.VD(i,t);t.finishPlot();const r=this.zD(this.BP.size,n),o=this.OD(this.DP.size,n),a=r.reduce(Ne,0)+e,h=o.reduce(Ne,0)+e,l=new Array(r.length+1).fill(0).map(((t,e)=>r.reduce(((t,i,s)=>t+(so.reduce(((t,i,s)=>t+(st===r[e])),e=this.ND.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.ND={columnWidths:r,rowHeights:o,dataGridWidth:a,dataGridHeight:h,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:n}}const n=s||this.yP||this.SP||this.vP||this.MP||this._P||this.wP||this.kP||this.TP||this.FP||this.pP||this.PP;if((n||this.IP)&&this.ND){const t=this.pixelScale.getInnerIntervalPixels(),s=Wa.ug(this.ng,this.eg),r=[this.Da.left+i,this.Da.right+i],o=[this.Da.bottom+i,this.Da.top+s+i],a={x:t.x-r[0]-r[1],y:t.y-o[0]-o[1]},h=[this.Da.left,this.Da.right],l=[this.Da.bottom,this.Da.top+s],u={x:Math.round(t.x-h[0]-h[1]),y:Math.round(t.y-l[0]-l[1])},c={x:Math.ceil(i),y:Math.floor(u.y-i)};this.sD.Ei(r).Vi(o).zi(0,a.x).Oi(0,a.y),this.JP.VI({x:this.ND.dataGridHeight,y:this.ND.dataGridWidth}).Ds().Fe();const d={x:Math.round(this.eD.x),y:Math.round(Math.min(0,this.eD.y))};this.iD.Ei(h).Vi(l).zi(d.x,u.x+d.x).Oi(d.y,u.y+d.y),this.pD.Ie({x:c.x,y:c.y});const f={x:this.iD.x.ei(),y:this.iD.y.ei()+this.JP.RI(),width:this.iD.x.ri()+e-this.JP.RI(),height:this.iD.y.ri()+e};this.dD.ES(f),this.cD.ES(f),this.uD.ES(f);const g=this.ND,m=[{x:this.iD.x.getInnerStart(),y:this.iD.y.getInnerStart()},{x:this.iD.x.getInnerEnd(),y:this.iD.y.getInnerStart()},{x:this.iD.x.getInnerEnd(),y:this.iD.y.getInnerEnd()},{x:this.iD.x.getInnerStart(),y:this.iD.y.getInnerEnd()}];g.cellsContentSizes.forEach((t=>{var e;const i={x:c.x+g.columnWidthsCumulative[t.cell.column],y:c.y-g.rowHeightsCumulative[t.cell.row+t.cell.rowSpan]},s={x:i.x+g.columnWidths[t.cell.column],y:i.y+g.rowHeights[t.cell.row]},n=Ve([i,{x:s.x,y:i.y},s,{x:i.x,y:s.y}],m);null===(e=t.text)||void 0===e||e.setVisible(n)})),n&&this.GD(c,this.ND,e)}this.pP=!1,this.mP=!1,this.yP=!1,this.SP=!1,this.vP=!1,this.xP=!1,this.bP=!1,this.MP=!1,this._P=!1,this.wP=!1,this.CP=!1,this.kP=!1,this.TP=!1,this.FP=!1,this.IP=!1,this.PP=!1}VD(t,e){const i=[],s={left:Math.ceil(t),right:Math.ceil(t),top:Math.ceil(t),bottom:Math.ceil(t)};for(const t of this.dP){const{content:n}=t,r={...this.lD,...t.padding};let o,a,h,l={x:0,y:0};if("string"==typeof n||"number"==typeof n){const i=String(n);o=e.add(),l=o.Bh(i).Vh(t.textFont||this.hD).Ds().Cc()}if(Gd(n)&&(a=n,l={x:200,y:50}),to(n)){const t=this.us.WD(n);t.UD()?(h=n,l=h.oi()):t.YD((()=>{this.PP=!0,this.us.bs()}))}if(o||a||h){r.top=Math.round(r.top),r.left=Math.round(r.left),r.right=Math.round(r.right),r.bottom=Math.round(r.bottom);const e={x:Math.round(l.x+r.left+r.right+s.left+s.right),y:Math.round(l.y+r.top+r.bottom+s.top+s.bottom)};i.push({cell:t,contentSize:e,text:o,sparkChart:a,icon:h,cellPadding:r,cellMargin:s})}}return i}GD(t,i,s){const{dataGridWidth:n,dataGridHeight:r,cellsContentSizes:o,columnWidths:a,columnWidthsCumulative:h,rowHeights:l,rowHeightsCumulative:u}=i,c={x:n-s,y:-r+s};this.pD.q(c),this.mD.Ee(this.oD),this.gP.clear();const d={cellBackground:this.yD.Xp(),cellIconRect:this.SD.Xp(),lineSet:this.xD.Xp(),line:this.bD.Xp(),pointSet:this.MD.Xp(),rect:this._D.Xp(),junction:this.wD.Xp(),arc:this.CD.Xp()},f=[];for(const i of o){const{cell:n,text:r,sparkChart:o,icon:c,cellPadding:g,cellMargin:m}=i,p={column:n.column,row:n.row},y={x:t.x+h[n.column],y:t.y-u[n.row+n.rowSpan]},A={x:y.x+m.left,y:y.y+m.bottom},x={x:A.x+g.left,y:A.y+g.bottom},S={x:new Array(n.columnSpan).fill(0).reduce(((t,e,i)=>t+a[n.column+i]),0),y:new Array(n.rowSpan).fill(0).reduce(((t,e,i)=>t+l[n.row+i]),0)},b={x:S.x-m.left-m.right,y:S.y-m.top-m.bottom},v={x:b.x-g.left-g.right,y:b.y-g.top-g.bottom};if(r){const t=gf(x,v,n.contentAlignment||this.aD);r.Ie(t[0]).Ja({x:t[1],y:t[2]}).ke(this.HD(n.textFillStyle||this.rD,n.content,this.rD)).cs(n.highlight)}const M=this.HD(n.backgroundFillStyle||this.nD,n.content);if(M!==V){const t=d.cellBackground.add();t.Ie(y).q(S).ke(M).Ce(nt).cs(n.highlight),this.gP.set(t,p)}const T=n.borders||this.OP;if(T&&ff(y,S,T,s,f),o){const t=x,e=v;Wd(o,d,this.iD,t,e,this.qi,this.fs,n.highlight)}if(c){const t=c.oi(),i=gf(x,v,n.contentAlignment||this.aD);d.cellIconRect.add().Ie({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).q(t).ke(new Xr({source:c.Mc,fitMode:e.ImageFitMode.Stretch})).Ce(nt).cs(n.highlight)}}this.mD.Nt();for(const t of f)this.mD.Lr().CA(t[0],t[1]);d.cellBackground.finishPlot(),d.cellIconRect.finishPlot(),d.lineSet.finishPlot(),d.line.finishPlot(),d.pointSet.finishPlot(),d.rect.finishPlot(),d.junction.finishPlot(),d.arc.finishPlot()}zD(t,e){const i=new Array(t).fill(0);for(const t of this.BP.values()){const s=e.filter((e=>t>=e.cell.column&&t+1<=e.cell.column+e.cell.columnSpan)).reduce(((t,e)=>{const i=e.contentSize.x/e.cell.columnSpan;return Math.max(t,i)}),0),n=this.fP.find((e=>e.column===t)),r=n?kt(s,void 0!==n.min?n.min:Fe,void 0!==n.max?n.max:_e):s;i[t]=r}return i}OD(t,e){const i=new Array(t).fill(0);for(const t of this.DP.values()){const s=e.filter((e=>t>=e.cell.row&&t+1<=e.cell.row+e.cell.rowSpan)).reduce(((t,e)=>{const i=e.contentSize.y/e.cell.rowSpan;return Math.max(t,i)}),0),n=this.AP.find((e=>e.row===t)),r=n?kt(s,void 0!==n.min?n.min:Fe,void 0!==n.max?n.max:_e):s;i[t]=r}return i}HD(t,e,i){if(H(t)){try{const i=Number(e);return new U({color:t.getPalette().getColors(i)})}catch(t){}return i||V}return t}BD(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.rD):e,this.wP=!0,this.us.bs()}LD(t,e){t.textFont="function"==typeof e?e(t.textFont||this.hD):e,this.CP=!0,this.us.bs()}ED(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.nD):e,this._P=!0,this.us.bs()}RD(t,e){t.contentAlignment=e,this.MP=!0,this.us.bs()}ID(t,e){t.padding={...t.padding,...e},this.bP=!0,this.us.bs()}TD(t,e,i){let s=this.zP(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.dP.push(s),this.SP=!0),"string"==typeof s.content||"number"==typeof s.content?this.mP=!0:this.yP=!0,this.us.bs()}DD(t){this.dP.forEach((e=>t(e)))}zP(t,e,i){const s=this.dP.find((i=>t>=i.column&&t+1<=i.column+i.columnSpan&&e>=i.row&&e+1<=i.row+i.rowSpan));return s&&i&&i(s),s}FD(t,e){const i=this.dP.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}PD(t,e){const i=this.dP.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}gD(){return new lf(this.AD,this.fD,this.sD,this.sD,this.iD,this.qi,nf.Both).onScroll(((t,e)=>{this.ND&&(t===nf.Vertical&&(this.eD.y=-e),t===nf.Horizontal&&(this.eD.x=e),this.IP=!0,this.us.bs())})).nP(50).oP(12)}}const cf={cellMouseEnter:"cellMouseEnter",cellMouseLeave:"cellMouseLeave",cellMouseClick:"cellMouseClick",cellMouseDoubleClick:"cellMouseDoubleClick",cellMouseDown:"cellMouseDown",cellMouseUp:"cellMouseUp",cellMouseMove:"cellMouseMove",cellMouseDrag:"cellMouseDrag",cellMouseDragStart:"cellMouseDragStart",cellMouseDragStop:"cellMouseDragStop",cellMouseWheel:"cellMouseWheel",cellTouchStart:"cellTouchStart",cellTouchMove:"cellTouchMove",cellTouchEnd:"cellTouchEnd"};var df;e.DataGridCellContentAlignmentOptions=void 0,(df=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",df.RightCenter="right-center",df.LeftCenter="left-center",df.RightTop="right-top",df.LeftTop="left-top",df.RightBottom="right-bottom",df.LeftBottom="left-bottom",df.CenterTop="center-top",df.CenterBottom="center-bottom";const ff=(t,e,i,s,n)=>{const r={x:t.x,y:t.y},o={x:t.x,y:t.y+e.y},a={x:t.x+e.x,y:t.y},h={x:t.x+e.x,y:t.y+e.y};i.top&&n.push([o,h]),i.bottom&&n.push([r,a]),i.left&&n.push([r,o]),i.right&&n.push([a,h])},gf=(t,e,i)=>{const s=t.x,n=t.x+e.x,r=t.x+e.x/2,o=t.y+e.y,a=t.y,h=t.y+e.y/2;switch(i){case"left-center":return[u(s,h),-1,0];case"right-center":return[u(n,h),1,0];case"center":return[u(r,h),0,0];case"left-bottom":return[u(s,a),-1,-1];case"right-bottom":return[u(n,a),1,-1];case"center-bottom":return[u(r,a),0,-1];case"left-top":return[u(s,o),-1,1];case"right-top":return[u(n,o),1,1];case"center-top":return[u(r,o),0,1]}return Se(0,`Unidentified DataGrid cell content alignment option: ${i}`)},mf={top:!1,bottom:!1,left:!1,right:!1};class pf extends qs{constructor(t,e,i,s,n,r){super(t,{mr(){},pr(){},Sr(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.es=r,this.Ts=n,this.Dh=n.kr(t.$D).Vh(this.qi.barChartCategoryAxisTitleFont||this.qi.xAxisTitleFont).ke(this.qi.barChartCategoryAxisTitleFillStyle||this.qi.xAxisTitleFillStyle),this.setTitleRotation(this.chart.Fs.getWidth({x:0,y:-90})),this.Nh=this.es.gA([this.Dh]).xs(e.effectsText),this.XD=n.Ve(t.$D).Ee(e.barChartCategoryAxisStrokeStyle||e.xAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.yA=t,this.SA=t):"object"==typeof t&&(this.yA=t.min,this.SA=t.max),this.chart.us.bs(),this}getThickness(){return{min:this.yA,max:this.SA}}setStrokeStyle(t){return this.XD.Ee(t),this.chart.us.bs(),this}getStrokeStyle(){return this.XD.ku()}Ds(){if(!this.Xi)return{jD:0,ZD:0,nd:kt(0,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:_e)};const t=this.XD.ku().V()/2,e=this.chart.Fs.getHeight(this.Dh.Ds().Cc());return{jD:t,ZD:e,nd:t+e}}Fe(t,e,i,s){const n=this.getInterval(),r=this.chart.valueAxis.getInterval();this.XD.Oe(this.chart.Fs.toPoint(n.start,r.start)).ze(this.chart.Fs.toPoint(n.end,r.start)).setVisible(this.Xi),this.Dh.Ie(this.chart.Fs.toPoint(.5*(n.start+n.end),this.chart.valueAxis.dt.pi(r.start,-(t.jD+s.labelMarginBeforeCategoryAxisPixels)))).Ja(this.chart.Fs.toPoint(0,1)).setVisible(this.Xi)}setMouseInteractions(t){return this}ar(t,e){return new Js(e,t,this.Ts,this.chart.$D)}lr(t,e){return{}}br(t,e){return e}_r(t,e,i){return{min:t,max:e}}}class yf extends qs{constructor(t,e,i,s,n,r,o){super(t,{mr:()=>{var e;if(t.QD){if("positive"===t.JD||"bipolar"===t.JD){if("after-bar"===(null===(e=t.KD)||void 0===e?void 0:e.position)){const e=this.dt.ri();return this.dt.pi(t.QD.max,Math.min(this.chart.Fs.getHeight(this.chart.qD())+t.KD.labelMargin,.3*e))}return t.QD.max}return t.tB?kt(-1,-1e-6,t.QD.max):0}},pr:()=>{var e;if(t.QD){if("negative"===t.JD||"bipolar"===t.JD){if("after-bar"===(null===(e=t.KD)||void 0===e?void 0:e.position)){const e=this.dt.ri();return this.dt.pi(t.QD.min,-Math.min(this.chart.Fs.getHeight(this.chart.qD())+t.KD.labelMargin,.3*e))}return t.QD.min}return t.tB?kt(1,1e-6,t.QD.min):0}},Sr:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.es=r,this.Ts=n,this.Dh=n.kr(t.$D).Vh(this.qi.barChartValueAxisTitleFont||this.qi.yAxisTitleFont).ke(this.qi.barChartValueAxisTitleFillStyle||this.qi.yAxisTitleFillStyle),this.setTitleRotation(this.chart.Fs.getHeight({x:0,y:-90})),this.Nh=this.es.gA([this.Dh]).xs(e.effectsText),this.XD=n.Ve(t.$D).Ee(e.barChartValueAxisStrokeStyle||this.qi.yAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.yA=t,this.SA=t):"object"==typeof t&&(this.yA=t.min,this.SA=t.max),this.chart.us.bs(),this}getThickness(){return{min:this.yA,max:this.SA}}setStrokeStyle(t){return this.XD.Ee(t),this.chart.us.bs(),this}getStrokeStyle(){return this.XD.ku()}setTickStrategy(t,e){return super.kh(t,e)}Ds(t){if(!this.Xi)return this.Gh(),{jD:0,ZD:0,nd:kt(0,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:_e)};const e=this.chart.Fs.getWidth(this.chart.$D).ri(),i=this.dt.ri();this.Jh({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.Ze.values())for(const e of t.values()){const t=e.Sh.nr,i=this.chart.Fs.getWidth(e.Ye.Cc()),n=t.getTickLength()+t.getTickPadding()+i+t.getLabelPadding();s=Math.max(s,n)}const n=s+this.XD.ku().V()/2,r=this.chart.Fs.getWidth(this.Dh.Ds().Cc());return{jD:n,ZD:r,nd:kt(n+r,void 0!==this.yA?this.yA:0,void 0!==this.SA?this.SA:_e)}}Fe(t){const e=this.getInterval();this.XD.Oe(this.chart.Fs.toPoint(-.5,this.Th)).ze(this.chart.Fs.toPoint(-.5,this.Fh)).setVisible(this.Xi);const i="logarithmic"===this.wh.type?Math.sqrt(e.start+e.end):.5*(e.start+e.end),s=this.chart.Fs.toPoint(this.chart.categoryAxis.dt.pi(-.5,t.jD*this.chart.Fs.iB),i),n=this.chart.Fs.toPoint(this.chart.Fs.sB,0);this.Dh.Ie(s).Ja(n).setVisible(this.Xi)}setMouseInteractions(t){return this}ar(t,e){return new Js(e,t,this.Ts,this.chart.$D)}lr(t,e){const i=t.Sh.nr,s=this.chart.Fs.toPoint(-.5,t.S),n=this.chart.$D.pi(s,this.chart.Fs.toPoint(i.getTickLength()*this.chart.Fs.iB,0)),r=this.chart.$D.pi(s,this.chart.Fs.toPoint(i.gridStrokeLength*e.oppositeAxisSize*-this.chart.Fs.iB,0)),o=this.chart.$D.pi(n,this.chart.Fs.toPoint(i.getTickPadding()*this.chart.Fs.iB,0));t.Ye.Ie(o).Ja(this.chart.Fs.toPoint(this.chart.Fs.sB,i.getLabelAlignment())).zh(i.getLabelRotation()),i.tickStyle!==nt&&0!==i.tickLength&&e.plotLines.add({positions:[s,n]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==nt&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,r]},{lineStyle:i.gridStrokeStyle})}br(t,e){return"linear"===this.wh.type?Jo(t,e,this.dt):Ko(t,e,this.dt)}_r(t,e,i){return{min:t,max:e}}}class Af extends _l{constructor(t,e,i,s,n,r,o){super(t,e,i,s),this.ia=Ce(),this.S=0,this.eB=!1,this.chart=t,this.Ji=t,this.category=n,this.subCategory=r,this._s=n,this.be=ce(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,o),this.Me=ce(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,o),this.onVisibleStateChanged((()=>{this.Ji.hB()})),this.onDispose((()=>{this.Ji.hB(),this.Ji.rB.delete(this)}))}setValue(t){return this.eB=!0,this.S=t,this.Ji.hB(),this.Ji.us.bs(),this.Ji.rB.delete(this),this}getValue(){return this.S}get value(){return this.S}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ji.hB(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ji.hB(),this}getStrokeStyle(){return this.Me}Dm(){return this.Lm}gg(t,e){return gh(t,this.Ji.engine.scale,this.Ji.xp(new Za,this.category,this.S,this).fc(),this,void 0)}solveNearestFromScreen(t){}setEffect(t){return this.Ji.setBarsEffect(t),this}}const xf=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),Sf=(t,e,i)=>{const s=t.jc.filter((t=>void 0!==t)),n=s.map((t=>i(t.sizePixels))).reduce(((t,e)=>Math.max(t,e)),1),r=Math.ceil(n/(e/s.length));return r<=1?s:s.filter(((t,e)=>e%r==0))};class bf extends Kh{constructor(t,i,s,n,r,o,a){var h;let l;super(t,i,s,i.sg("barChart bg",0),n,i.us.qi.barChartBackgroundFillStyle||i.us.qi.chartXYBackgroundFillStyle,i.us.qi.barChartBackgroundStrokeStyle||i.us.qi.chartXYBackgroundStrokeStyle,i.us.qi.barChartTitleFont||i.us.qi.chartXYTitleFont,i.us.qi.barChartTitleFillStyle||i.us.qi.chartXYTitleFillStyle,o),this.coordsBars="barChart",this.nB=vf.Descending,this.oB=this.qi.barChartCategoryLabels,this.KD=this.qi.barChartValueLabelsAfterBars,this.aB=!1,this.Gw=Ee(),this.lB=new Map,this.rB=new Map,this.JD="positive",this.uB="columns",this.cB=!0,this.dB=new Map,this.fB={speed:1},this.ep={speed:1},this.AB=.08,this.vp=e.AutoCursorModes.snapToClosest,this.xp=(t,e,i,s)=>{this.categoryAxis.getTitle().length>0&&t.addRow(this.categoryAxis.getTitle()),t.addRow({text:e,font:{weight:"bold"}}),this.valueAxis.getTitle().length>0&&t.addRow(this.valueAxis.getTitle());const n=[];return s.subCategory&&s.subCategory.length>0&&n.push(s.subCategory),n.push(this.valueAxis.formatValue(i)),t.addRow(...n),t},this.nn=(t,e,i,s,n)=>{this.$D.q(s,n)},this.fs.zn||this.fs.Vn||this.fs.Yn||this.us.As(St.atob("YmFyIGNoYXJ0")),this.Fs="horizontal"===(null==a?void 0:a.type)?Tf:Mf,this.ng.Bh("Bar Chart"),this.gB=i.wp("barChart plotting 1",0),this.pB=i.wp("barChart plotting 2",1),this.tB="logarithmic"===(null===(h=null==a?void 0:a.valueAxis)||void 0===h?void 0:h.type),this.tB?"horizontal"===this.Fs.mB?(l=s.d1({scale1DConstructor:Ii,dimension:"y"}),this.$D=(new zi).Ri(s.d1({scale1DConstructor:bi,dimension:"x"}),l)):(l=s.d1({scale1DConstructor:Ii,dimension:"x"}),this.$D=(new zi).Ri(l,s.d1({scale1DConstructor:bi,dimension:"y"}))):(this.$D=s.d2({scaleXYConstructor:Li}),l=this.Fs.getWidth(this.$D)),this.yB=this.es.gA(),this.Uw=new Lh((()=>this.Gw._t(this.gB.bv(this.$D).da(0))),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Lr();return i.Rl(e.vertices),this.Gw.Ot(i,e.bar),e.bar.Ss([i]),i})))),(()=>{this.Gw.Nt()}),(t=>{this.yB.ps(t)})),this.uy=this.zA.Te(this.$D).ke(this.qi.barChartSeriesBackgroundFillStyle||V).Ce(nt),this.Ay=this.zA.Te(this.$D).ke(V).Ce(this.qi.barChartSeriesBackgroundStrokeStyle||nt).setMouseInteractions(!1),super.ly(this.uy,this.Ay),this.categoryAxis=new pf(this,this.qi,!0!==(null==a?void 0:a.disableAnimations)&&!1!==(null==a?void 0:a.animationsEnabled),l,this.pB,this.es);const u=qo(null==a?void 0:a.valueAxis);this.valueAxis=new yf(this,this.qi,!0!==(null==a?void 0:a.disableAnimations)&&!1!==(null==a?void 0:a.animationsEnabled),this.Fs.getHeight(this.$D),this.pB,this.es,u.type),this.SB=new zh((()=>this.pB.kr(this.$D).tl(ke).Ka(ke).da(1))),this.vB=new Lh((()=>this.zA._A(this.$D).setMouseInteractions(!1)),((t,e,i)=>(t.Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>(i||t.Lr()).CA(e[0],e[1])))))),this.kp=i.Tp();const c=Dt(a?a.autoCursorBuilder:void 0,uh);this.Ag=c.$g(this.kp,this.uiScale,this.uiScale,this.qi),this.onResize(this.nn),this.ig(r,this.$D),this.setAutoCursorMode(e.AutoCursorModes.onHover),this.setAnimationsEnabled(!0!==(null==a?void 0:a.disableAnimations)&&!1!==(null==a?void 0:a.animationsEnabled)),this.yy(((t,e)=>{Ha.mg(this,e)}))}getSeries(){return this.iy}setAutoCursor(t){return this.Ag&&t(this.Ag),this.us.bs(),this}getAutoCursor(){return this.Ag}setAutoCursorMode(t){return this.vp=t,this.us.bs(),this}getAutoCursorMode(){return this.vp}setCursorResultTableFormatter(t){return this.xp=t,this.us.bs(),this}setBarsMargin(t){return this.AB=kt(t,0,.49),this.aB=!0,this.us.bs(),this}getBarsMargin(){return this.AB}setBarsEffect(t){return this.yB.xs(t),this.us.bs(),this}getBarsEffect(){return this.yB.Ms()}setData(t){let e;if(this.iy.length>0&&(this.fs.Vn||this.fs.zn||this.fs.ho||this.us.As(St.atob("cmVhbC10aW1lIGRhdGE="))),Array.isArray(t))e=[],t.forEach(((t,i)=>{"string"==typeof t?e.push({category:t}):"number"==typeof t?e.push({category:`Category ${i+1}`,value:t}):"object"==typeof t&&e.push(t)}));else{e=[];const i=Object.keys(t);for(const s of i){const i=t[s];e.push({category:s,value:"number"==typeof i?i:void 0})}}return this.xB("columns",e),this}setDataStacked(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:n}=e;n.forEach(((e,n)=>{const r=t[n];i.push({category:r,subCategory:s,value:e})}))})),this.xB("stacks",i),this}setDataGrouped(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:n}=e;n.forEach(((e,n)=>{const r=t[n];i.push({category:r,subCategory:s,value:e})}))})),this.xB("groups",i),this}xB(t,e){this.uB=t,this.bB(e);const i=pe(e.map((t=>t.category))),s=i.length,n=pe(e.map((t=>t.subCategory))).filter((t=>void 0!==t));if(e.forEach((t=>{let e=this.iy.find((e=>e.category===t.category&&e.subCategory===t.subCategory));if(!e){const s=i.indexOf(t.category),r=n.includes(t.subCategory)?n.indexOf(t.subCategory):void 0;e=new Af(this,this.ey,this.qi,this.us.es,t.category,t.subCategory,Dt(r,s)),this.gy(e),this.dB.set(e,{category:s,valueStart:this.tB?1e-6:0,valueEnd:void 0!==t.value?t.value:0})}void 0!==t.value&&e.setValue(t.value)})),this.iy.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category&&e.subCategory===t.subCategory))&&(t.dispose(),this.dB.delete(t))})),this.categoryAxis.setInterval(this.Fs.getWidth({x:{start:-.5,end:s-.5},y:{start:s-.5,end:-.5}})),this.QD=0===this.iy.length?void 0:"stacks"!==t?this.iy.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:_e,max:Fe}):{min:0,max:i.reduce(((t,i)=>Math.max(t,e.reduce(((t,e)=>e.category!==i?t:void 0!==e.value?t+e.value:t),0))),0)},this.QD&&(this.JD=this.QD.min>=0?"positive":this.QD.max<=0?"negative":"bipolar",("bipolar"===this.JD||"negative"===this.JD)&&this.tB))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");this.bB(this.iy),this.lB.clear(),this.rB.clear(),this.aB=!0,this.us.bs()}setCategoryLabels(t){const e="function"==typeof t?this.oB?t(this.oB):this.oB:t;return this.oB=e?{...this.qi.barChartCategoryLabels,...e}:void 0,this.lB.clear(),this.us.bs(),this}getCategoryLabels(){return this.oB}setValueLabels(t){var e;const i="function"==typeof t?this.KD?t(this.KD):this.KD:t,s=(null==i?void 0:i.position)||(null===(e=this.KD)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.KD={...this.qi.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.KD={...this.qi.barChartValueLabelsInsideBars,...i}):this.KD=void 0,this.rB.clear(),this.us.bs(),this}getValueLabels(){return this.KD}setLabelFittingEnabled(t){return this.cB=t,this.us.bs(),this}getLabelFittingEnabled(){return this.cB}getBar(t,e){if(("groups"===this.uB||"stacks"===this.uB)&&void 0===e)throw new Error("LightningChart JS BarChart.getBar() | `subCategory` parameter is required for grouped and stacked bar charts!");const i=this.iy.find((i=>i.category===t&&(void 0===e||e===i.subCategory)));if(!i)throw new Error(`BarChart.getBar() no such bar: "${t}" ${e?`"${e}"`:""}`);return i}getBars(){return this.iy}setSorting(t){return this.nB=t,this.bB(this.iy),this.us.bs(),this}getSorting(){return this.nB}setAnimationCategoryPosition(t,e=1){return this.fB=t?{speed:e}:void 0,this.us.bs(),this}setAnimationValues(t,e=1){return this.ep=t?{speed:e}:void 0,this.us.bs(),this}translateCoordinate(t,e,i){if(i&&Oi(t)&&Bi(e))return super.translateCoordinate(t,e,i);const s=e;let n;if(Vi(t))n=this.us.$o(t);else if(Oi(t)){const e=ut(t,this.pixelScale,this.us.dt);n={engineX:e.x,engineY:e.y}}else{if(!xf(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=ut(this.Fs.toPoint(t.iCategory,t.value),this.$D,this.us.dt);n={engineX:e.x,engineY:e.y}}}if(Ri(s))return this.us.Xo(n);if("barChart"===s){const t=ut({x:n.engineX,y:n.engineY},this.us.dt,this.$D);return{iCategory:this.Fs.getWidth(t),value:this.Fs.getHeight(t)}}if(Bi(s))return ut({x:n.engineX,y:n.engineY},this.us.dt,this.pixelScale);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}Sd(){if("columns"===this.uB)return this.iy;const t=pe(ye(this.iy.map((t=>t.subCategory))));return ye(t.map((t=>{const e=this.iy.filter((e=>e.subCategory===t)),i=e[0];if(i)return(t=>{let e=!1;t.forEach((i=>i.onHighlight(((s,n)=>{e||(e=!0,t.forEach((t=>i!==t?t.setHighlight(n):void 0)),e=!1)})))),t.forEach((e=>e.onDispose((()=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)}))))})(e),{attach(s,n){return xe(s,e,{toggleVisibilityOnClick:!0,label:t,style:i.getFillStyle()}),this}}})))}Fe(t){var e,i;super.Fe(t);const s=this.SB.Xp(),n=this.vB.Xp(),r=this.iy.filter((t=>t.getVisible()&&t.eB)),o=pe(r.map((t=>t.category))),a=pe(ye(r.map((t=>t.subCategory)))),h=5e-4*t*((null===(e=this.fB)||void 0===e?void 0:e.speed)||0),l=.003*t*((null===(i=this.fB)||void 0===i?void 0:i.speed)||0),u=this.valueAxis.dt,c=u instanceof Ii?(t,e)=>{var i;return Jo(t,e,u,(null===(i=this.ep)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return Ko(t,e,u,(null===(i=this.ep)||void 0===i?void 0:i.speed)||0)};let d;"columns"===this.uB?d=r.map((t=>({bar:t,position:{category:o.indexOf(t.category),valueStart:this.tB?1e-6:0,valueEnd:t.value}}))):"groups"===this.uB?d=r.map((t=>{const e=o.indexOf(t.category),i=a.indexOf(t.subCategory),s=1/(a.length+2*(a.length+1)*this.AB),n=this.AB*s;return{bar:t,position:{category:e+(i-(a.length-1)/2)*(s+n),valueStart:this.tB?1e-6:0,valueEnd:t.value}}})):(d=[],o.forEach(((t,e)=>{const i=r.filter((e=>e.category===t));let s=this.tB?1e-6:0;i.forEach(((e,i)=>{d.push({bar:e,position:{category:o.indexOf(t),valueStart:s,valueEnd:s+e.value}}),s+=e.value}))}))),d.forEach((t=>{const{bar:e,position:i}=t;let s,n,r=this.dB.get(e);void 0===r&&(r=i);const o=i.valueStart;if(this.fB&&r.category!==i.category){const t=Math.sign(i.category-r.category);s=r.category+h*t+l*(i.category-r.category),t!==Math.sign(i.category-s)&&(s=i.category)}else s=i.category;if(this.ep&&r.valueEnd!==i.valueEnd){const t=Math.sign(i.valueEnd-r.valueEnd);n=c(r.valueEnd,i.valueEnd),t!==Math.sign(i.valueEnd-n)&&(n=i.valueEnd)}else n=i.valueEnd;this.dB.set(e,{category:s,valueStart:o,valueEnd:n}),s===i.category&&n===i.valueEnd||this.us.bs(!0),s===r.category&&n===r.valueEnd||(this.aB=!0)})),Wa.cg(this.ng,this.eg);const f=r.length>0;this.categoryAxis.vr(),this.valueAxis.vr();const g=this.categoryAxis.setVisible(f).Ds(),m=this.valueAxis.setVisible(f).Ds(n),{labelMarginBeforeCategoryAxisPixels:p}=f?this.MB(o,r,s,n):{labelMarginBeforeCategoryAxisPixels:0};this.categoryAxis.Fe(g,s,n,{labelMarginBeforeCategoryAxisPixels:p}),this.valueAxis.Fe(m);const y=this.categoryAxis.getThickness(),A=kt(g.nd+p,void 0!==y.min?y.min:0,void 0!==y.max?y.max:_e),x={x:Math.min(this.$D.x.getInnerStart(),this.$D.x.getInnerEnd()),y:Math.min(this.$D.y.getInnerStart(),this.$D.y.getInnerEnd())},S=Math.max(this.$D.x.getInnerStart(),this.$D.x.getInnerEnd()),b=Math.max(this.$D.y.getInnerStart(),this.$D.y.getInnerEnd()),v={x:S-x.x,y:b-x.y};this.uy.Ie(x),this.uy.q(v),this.Ay.Ie(x),this.Ay.q(v),super.tg(),Ha.dg(this,this.uy.getIsUnderMouse(),!1,this.iy,void 0,((t,e)=>t.gg(e,!0)));const M=Wa.ug(this.ng,this.eg);if(this.$D.Vi([this.Xt.bottom+this.Da.bottom+("vertical"===this.Fs.mB?A:0),this.Xt.top+this.Da.top+M+("horizontal"===this.Fs.mB?m.nd:0)]),this.$D.Ei([this.Xt.left+this.Da.left+this.Fs.getHeight({x:A,y:m.nd}),this.Xt.right+this.Da.right]),this.gB.ES({x:this.$D.x.ei(),y:this.$D.y.ei(),width:this.$D.x.ri(),height:this.$D.y.ri()}),this.LA&&this.LA(),this.aB){const t=this.Uw.Xp(),e="groups"===this.uB?1/(a.length+2*(a.length+1)*this.AB):1-2*this.AB;r.forEach((i=>{const s=this.dB.get(i);if(void 0===s)return;const n=s.category-.5*e,r=s.category+.5*e,o=[this.Fs.toPoint(n,s.valueStart),this.Fs.toPoint(n,s.valueEnd),this.Fs.toPoint(r,s.valueEnd),this.Fs.toPoint(r,s.valueStart)];t.add({ia:i.ia,vertices:o,bar:i},{fillStyle:i.be,strokeStyle:i.Me})})),t.finishPlot()}s.finishPlot(),n.finishPlot(),this.aB=!1}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationCategoryPosition(!1),this.setAnimationValues(!1),this.valueAxis.setAnimationsEnabled(!1),this.categoryAxis.setAnimationsEnabled(!1),this}solveNearest(t){}dispose(){return this.pB.W(),this.gB.W(),this.Ag.dispose(),this.kp.W(),super.dispose()}bB(t){const e=this.nB;e&&t.sort(((i,s)=>e({category:i.category,value:t.reduce(((t,e)=>t+(e.category===i.category&&e.value||0)),0)},{category:s.category,value:t.reduce(((t,e)=>t+(e.category===s.category&&e.value||0)),0)})))}MB(t,e,i,s){let n=0;const r=this.oB,o=this.KD,a=this.valueAxis.getInterval(),h=this.Fs.getWidth({x:this.$D.x.ri(),y:this.$D.y.ri()});if(r&&r.labelFillStyle!==V){const o=r.tickLength+r.labelMargin,l=this.Fs.toPoint(0,1),u={jc:t.map(((t,i)=>{const s=e.reduce(((e,i)=>i.category!==t?e:e+i.value),0),n=r.formatter(t,s);if(!n)return;const h=i;return void 0!==h?{text:n,position:this.Fs.toPoint(h,this.valueAxis.dt.pi(a.start,-o)),alignment:l,rotation:r.labelRotation,sizePixels:this._B(t,s)}:void 0})),hc:r.labelFont,dt:this.$D},c=u?this.cB?Sf(u,h,this.Fs.getWidth):u.jc:[];c.forEach((t=>{t&&i.add().Bh(t.text).Ie(t.position).Ja(t.alignment).zh(t.rotation).ke(r.labelFillStyle).Vh(r.labelFont)})),r.tickStyle!==nt&&0!==r.tickLength&&c.forEach((t=>{if(!t)return;const e=this.Fs.getWidth(t.position);s.add({positions:[this.Fs.toPoint(e,this.valueAxis.dt.getInnerStart()),this.Fs.toPoint(e,this.valueAxis.dt.pi(a.start,-r.tickLength))]},{lineStyle:r.tickStyle})})),n=c.reduce(((t,e)=>e?Math.max(t,this.Fs.getHeight(e.sizePixels)):t),0)+r.tickLength+r.labelMargin}if(o&&o.labelFillStyle!==V){let t;"after-bar"===o.position?t={jc:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.dB.get(t);return void 0!==s?{text:i,position:this.Fs.toPoint(s.category,this.valueAxis.dt.pi(s.valueEnd,o.labelMargin*Math.sign(s.valueEnd))),alignment:this.Fs.toPoint(0,-1*Math.sign(s.valueEnd)),rotation:o.labelRotation,sizePixels:this.wB(t)}:void 0})),hc:o.labelFont,dt:this.$D}:"inside-bar"!==o.position&&"inside-bar-start"!==o.position&&"inside-bar-centered"!==o.position&&"inside-bar-end"!==o.position||(t={jc:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.dB.get(t);if(void 0===s)return;const n="bipolar"===this.JD?Math.sign(s.valueEnd):"negative"===this.JD?-1:1,r=this.Fs.toPoint(0,"inside-bar"===o.position||"inside-bar-end"===o.position?1*n:"inside-bar-centered"===o.position?0:-1*n);return{text:i,position:this.Fs.toPoint(s.category,"inside-bar"===o.position||"inside-bar-end"===o.position?this.valueAxis.dt.pi(s.valueEnd,-o.labelMargin*n):"inside-bar-centered"===o.position?(s.valueStart+s.valueEnd)/2:this.valueAxis.dt.pi(s.valueStart,o.labelMargin*n)),alignment:r,rotation:o.labelRotation,sizePixels:this.wB(t)}})),hc:o.labelFont,dt:this.$D}),t&&(t?this.cB?Sf(t,h,this.Fs.getWidth):t.jc:[]).forEach((t=>{t&&i.add().Bh(t.text).Ie(t.position).Ja(t.alignment).zh(t.rotation).ke(o.labelFillStyle).Vh(o.labelFont).setMouseInteractions(!1)}))}return{labelMarginBeforeCategoryAxisPixels:n}}_B(t,e){if(!this.oB||this.oB.labelFillStyle===V)return{x:0,y:0};const i=this.lB.get(t);if(i)return i;const s=this.oB.formatter(t,e),n=this.us.kB.CB(s,this.oB.labelFont,this.oB.labelRotation);return n.isEstimate?this.us.bs(!0):this.lB.set(t,n),n}wB(t){if(!this.KD||this.KD.labelFillStyle===V)return{x:0,y:0};const e=this.rB.get(t);if(e)return e;const i=this.us.kB.CB(this.KD.formatter(t,t.category,t.value),this.KD.labelFont,this.KD.labelRotation);return i.isEstimate?this.us.bs(!0):this.rB.set(t,i),i}qD(){return this.iy.reduce(((t,e)=>{const i=this.wB(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}hB(){this.aB=!0,this.us.bs()}getMinimumSize(){return{x:200,y:200}}}const vf={Disabled:void 0,None:void 0,Ascending:(t,e)=>t.value-e.value,Descending:(t,e)=>e.value-t.value,Alphabetical:(t,e)=>t.category.localeCompare(e.category)},Mf={...ta,mB:"vertical",iB:-1,sB:1},Tf={...ea,mB:"horizontal",iB:1,sB:-1},wf=(t,e)=>e?t.x:t.y,Ef=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),kf=(t,e,i,s,n,r)=>{const o=e.length,a=Math.sign(s),h=[],l=e.reduce(((t,e)=>t+e));for(let t=1;t<=o-1;t+=1)h.push(wf(n,r)*e.slice(0,t).reduce(((t,e)=>t+e),0)/l);const u=h.map((t=>0));let c=h[i-1]+s;for(let e=i;e>0&&eEf(t,a,r,e))).reduce(((t,e)=>Math.max(t,wf(e.panel.getMinimumSize()||{x:0,y:0},r))),20),o=h[e-1];if(1===a&&c>wf(n,r)-s||-1===a&&c<0+s){u.fill(0);break}if(e!==i&&(1===a?o>c:oh[e]+t)),f=d.map(((t,e)=>(t-(e>0?d[e-1]:0))/wf(n,r)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class Cf{constructor(t,e,i,s,r){this.coordsRelative="relative",this.coordsClient="client",this.$i=!1,this.dP=new Array,this.D=new n.Eventer,this.TB=[],this.PA=[],this.FB=void 0,this.IB=!0,this.PB=!0,this.DB=!0,this.RA=!1,this.BB=!0,this.LB=()=>{this.BB=!0,this.us.bs()},this.RB=[],this.onInViewChange=t=>this.D.on("inViewChange",t),this.offInViewChange=t=>this.D.off(t,"inViewChange"),this.EB=t=>{for(let e=0;e{const e=this.TB.indexOf(t);e>=0&&this.TB.splice(e,1)},this.NA=t=>{const e=this.PA.indexOf(t);e>=0&&this.PA.splice(e,1)},this.zB=(t,e,i,s,n)=>{if(this.OB(e,i,s,n)){const r={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:n};return this.dP.push(r),this.NB(r),this.IB=!0,t}throw new ft("Out of dashboard range.")},this.GB=e.numberOfRows,this.WB=e.numberOfColumns,this.fs=t,this.UB=e,this.YB=s;const o=this.WB*this.GB;this.HB={x:new Nd(new Array(this.WB).fill(1)),y:new Nd(new Array(this.GB).fill(1))},this.qi=i.qi,this.$B=this.qi.dashboardSplitterStyle,this.th=!0!==(null==e?void 0:e.disableAnimations)&&!1!==(null==e?void 0:e.animationsEnabled),this.XB=Od(i,o),this.jB=i.nI("dashboard splitters",400001),this.Ab=()=>this.XB.rI(),this.$A=this.XB.oI(),this.es=i.es.hs(this,{ZB:{}}),this.es.ZB.xs(this.qi.effectsDashboardSplitters);const a=i.oi();this.uiScale=ht.d2({scaleXYConstructor:Li}).zi(0,100).Oi(0,100).q(a),this.pixelScale=ht.d2({scaleXYConstructor:Li}).zi(0,this.uiScale.x.getCellSize()).Oi(0,this.uiScale.y.getCellSize()).q(a),this.QB=i.JB.bind(i),this.KB=i.qB.bind(i),this.tL=i.iL.bind(i),this.sL=i.eL.bind(i),this.So=i.So.bind(i),this.xo=i.xo.bind(i),this.engine=i.WA,this.us=i.UA,i.Go((()=>this.LB())),i.bs();const h=i.Yo((t=>{this.RA=t,this.D.emit("inViewChange",this,t)}));this.JA=i.Ho.bind(i,h),this.hL(),this.setAnimationsEnabled(this.th);const l=((t,e)=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.D);this.createChartXY=t=>{const e=Df(t,this.UB,this.th);return this.zB(new Pd(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=Df(t,this.UB,this.th);return this.zB(new hc(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=Df(t,this.UB,this.th);return this.zB(new pu(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=Df(t,this.UB,this.th),i=e&&e.type?e.type:Dh;return this.zB(new i(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=Df(t,this.UB,this.th),i=e&&e.type?e.type:Vu;return this.zB(new i(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=Df(t,this.UB,this.th),i=e&&e.type?e.type:Eu;return this.zB(new i(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=Df(t,this.UB,this.th),i=t&&t.type?t.type:Hu;return this.zB(new i(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=Df(t,this.UB,this.th);return this.zB(new Na(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=Df(t,this.UB,this.th);return this.zB(new ul(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=Df(t,this.UB,this.th);return this.zB(new dd(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=Df(t,this.UB,this.th);return this.zB(new Al(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=Df(t,this.UB,this.th),i=new hl(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l,e);return this.zB(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=Df(t,this.UB,this.th),i=new uf(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l);return this.zB(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=Df(t,this.UB,this.th),i=new bf(this.fs,this.XB.aI(this.rL(t.columnIndex,t.rowIndex)),this.nL(e,this.HB),this.EB,r,l,e);return this.zB(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}rL(t,e){return t+e*this.WB}nL(t,e){return{d1:i=>new i.scale1DConstructor("x"===i.dimension?t.columnIndex:t.rowIndex,"x"===i.dimension?t.columnSpan:t.rowSpan,"x"===i.dimension?this.WB:this.GB,"x"===i.dimension?e.x:e.y),d2:i=>(new i.scaleXYConstructor).ot({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.WB,y:this.GB},e),d3:()=>new ot({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.WB,y:this.GB},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.QB(t[0]),this.KB(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.tL(t[0]),this.sL(t[1]),this}getWidth(){return this.So()}getHeight(){return this.xo()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.jB.bs(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.jB.bs(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.qi}setSplitterStyle(t){const e=this.$B;return this.$B="function"==typeof t?t(this.$B):t,this.oL(e),this}getSplitterStyle(){return this.$B}setSplitterEffect(t){return this.es.ZB.xs(t),this.us.bs(),this}getSplitterEffect(){return this.es.ZB.Ms()}setAnimationHighlight(t){return this.DB=t,this.RB.forEach((e=>this.us.ls.Cs(e.line,t))),this}getAnimationHighlight(){return this.DB}oL(t){for(const t of this.RB)t.line.Ee(this.$B);this.hL()}setColumnWidth(t,e){const i=this.HB.x._();return t>=0&&t=e.length)throw new ft("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.HB.y._();return t>=0&&t=e.length)throw new ft("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}onResize(t){return this.D.on("resize",t)}offResize(t){return this.D.off(t,"resize")}aL(t,e,i){if(i&&Math.abs(t.x)>0)this.lL(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.uL(e,t.y)}for(const t of this.dP)t.panel.Z();this.LB()}uL(t,e){const i=kf(this.dP,this.HB.y._(),t,e,this.pixelScale.oi(),!1);this.HB.y.M(i),this.LB()}lL(t,e){const i=kf(this.dP,this.HB.x._(),t,e,this.pixelScale.oi(),!0);this.HB.x.M(i),this.LB()}cL(){this.RB.forEach((t=>t.line.dispose())),this.RB.length=0;for(let t=1;t<=this.WB-1;t+=1)for(let e=0;e<=this.GB-1;e+=1)if(void 0!==this.dP.find((i=>Ge(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=Yi(new Xi((()=>{this.dL(t)}),((e,i,s,n,r)=>{this.aL(n,t,!0),jt(r)}),(()=>{this.fL(t)}))),s=this.jB.Ve(this.pixelScale).Ee(this.$B).setMouseEnterEventHandler((()=>{this.dL(t)})).setMouseLeaveEventHandler((()=>{this.fL(t)})).setMouseDragEventHandler(((e,i,s,n,r)=>{this.aL(r,t,!0),jt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.us.ls.os(s,(t=>s.cs(t)),{animationEnabled:this.DB}),this.RB.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.GB-1;t+=1)for(let e=0;e<=this.WB-1;e+=1)if(void 0!==this.dP.find((i=>Ge(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=Yi(new Xi((()=>{this.AL(t)}),((e,i,s,n,r)=>{this.aL(n,t,!1),jt(r)}),(()=>{this.gL(t)}))),s=this.jB.Ve(this.pixelScale).Ee(this.$B).setMouseEnterEventHandler((()=>{this.AL(t)})).setMouseLeaveEventHandler((()=>{this.gL(t)})).setMouseDragEventHandler(((e,i,s,n,r)=>{this.aL(r,t,!1),jt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.us.ls.os(s,(t=>s.cs(t)),{animationEnabled:this.DB}),this.RB.push({row:t,column:e,line:s,alignment:"horizontal"})}this.es.ZB.ps(this.RB.map((t=>t.line)))}pL(){const t=this.pixelScale.oi(),e=this.HB.x._(),i=e.reduce(((t,e)=>t+e)),s=this.HB.y._(),n=s.reduce(((t,e)=>t+e));this.RB.forEach((r=>{if("vertical"===r.alignment){const o=u(t.x*e.slice(0,r.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,r.row).reduce(((t,e)=>t+e),0)/n),a=u(o.x,t.y*s.slice(0,r.row+1).reduce(((t,e)=>t+e),0)/n);r.line.Oe(o).ze(a)}else{const o=u(t.x*e.slice(0,r.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,r.row).reduce(((t,e)=>t+e),0)/n),a=u(t.x*e.slice(0,r.column+1).reduce(((t,e)=>t+e),0)/i,o.y);r.line.Oe(o).ze(a)}}))}dL(t){this.RB.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.us.ls.ws(e.line,1),this.jB.mL(e.line))})),this.FB=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.us.bs()}AL(t){this.RB.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.us.ls.ws(e.line,1),this.jB.mL(e.line))})),this.FB=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.us.bs()}fL(t){this.RB.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.us.ls.ws(e.line,0)})),this.engine.restoreMouseStyle(this.FB),this.us.bs()}gL(t){this.RB.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.us.ls.ws(e.line,0)})),this.engine.restoreMouseStyle(this.FB),this.us.bs()}setAnimationsEnabled(t){return this.th=t,this.getCells().filter((t=>t.panel instanceof Ga)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.th),this}getAnimationsEnabled(){return this.th}getCells(){return this.dP.slice()}dispose(){return this.$i||(this.JA&&this.JA(),this.dP.slice().forEach((t=>t.panel.dispose())),this.TB.slice().forEach((t=>t.dispose())),this.PA.slice().forEach((t=>t.dispose())),this.$i=!0,this.YB(),this.D.emit("dispose",this)),this}onDispose(t){return this.D.on("dispose",t)}offDispose(t){return this.D.off(t,"dispose")}getIsInView(){return this.RA}saveToFile(t,e,i){return za(this.engine,t,e,i),this}yL(t){if(this.BB){const t=this.us.dt.oi(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=this.uiScale.getInnerIntervalPixels();this.pixelScale.zi(0,s.x).Oi(0,s.y),this.D.emit("resize",this,s.x,s.y,e,i),this.PB=!0}this.IB&&(this.cL(),this.IB=!1,this.PB=!0),this.PB&&(this.pL(),this.PB=!1);for(const e of this.dP)e.panel.Fe(t);return this.TB.forEach((t=>t.Ds())),this.TB.forEach((t=>t.Fe())),this.PA.forEach((t=>t.Ds())),this.PA.forEach((t=>t.Fe())),this.BB=!1,this}j(){for(const t of this.dP)t.panel.j();return this.pixelScale.x.j(),this.pixelScale.y.j(),this.uiScale.x.j(),this.uiScale.y.j(),this}Z(){for(const t of this.dP)t.panel.Z();return this.pixelScale.x.Z(),this.pixelScale.y.Z(),this.uiScale.x.Z(),this.uiScale.y.Z(),this}translateCoordinate(t,e,i){return Va(t,e,i,this.pixelScale,this.us)}addUIElement(t=Eo,e=this.uiScale){e=Ra(e,this.pixelScale);const i=Pa(t,this.Ab(),this.uiScale,e,this.VB,this.qi);return this.TB.push(i),i}addLegendBox(t=Bo,i=this.uiScale){i=Ra(i,this.pixelScale);const s=Pa(t,this.$A,this.uiScale,i,this.NA,this.qi);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.PA.push(s),s}getLegendBoxes(){return this.PA}OB(t,e,i,s){return e>=0&&t>=0&&e+s<=this.GB&&t+i<=this.WB}NB(t){const e=this.$B,i=e===nt?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Ka(s)}hL(){this.uiScale.x.si([0,0]),this.uiScale.y.si([0,0]),this.pixelScale.x.si([0,0]),this.pixelScale.y.si([0,0]);for(const t of this.dP)this.NB(t);this.us.bs()}}const Df=(t,e,i)=>{const s={...t,columnSpan:t.columnSpan||1,rowSpan:t.rowSpan||1,animationsEnabled:void 0!==t.disableAnimations?!t.disableAnimations:void 0!==t.animationsEnabled?t.animationsEnabled:i};var n,r;return s.rowIndex=(n=s.rowIndex,r=s.rowSpan,e.numberOfRows-(n+r)),s},If={None:Cr,Rectangle:ro,Circle:oo,Diamond:ao,Pointer:ho},_f={ChartMarkerXY:Kl,SeriesMarkerXY:Zl},Ff={XY:Jl,Spider:lh,BarChart:uh,Map:fh,Polar:lh},Lf={Angola:{name:"Angola",ISO_A3:"AGO"},Burundi:{name:"Burundi",ISO_A3:"BDI"},Benin:{name:"Benin",ISO_A3:"BEN"},"Burkina Faso":{name:"Burkina Faso",ISO_A3:"BFA"},Botswana:{name:"Botswana",ISO_A3:"BWA"},"Central African Republic":{name:"Central African Republic",ISO_A3:"CAF"},"Ivory Coast":{name:"Ivory Coast",ISO_A3:"CIV"},Cameroon:{name:"Cameroon",ISO_A3:"CMR"},"Democratic Republic of the Congo":{name:"Democratic Republic of the Congo",ISO_A3:"COD"},"Republic of Congo":{name:"Republic of Congo",ISO_A3:"COG"},Comoros:{name:"Comoros",ISO_A3:"COM"},"Cape Verde":{name:"Cape Verde",ISO_A3:"CPV"},Djibouti:{name:"Djibouti",ISO_A3:"DJI"},Algeria:{name:"Algeria",ISO_A3:"DZA"},Egypt:{name:"Egypt",ISO_A3:"EGY"},Eritrea:{name:"Eritrea",ISO_A3:"ERI"},Ethiopia:{name:"Ethiopia",ISO_A3:"ETH"},Gabon:{name:"Gabon",ISO_A3:"GAB"},Ghana:{name:"Ghana",ISO_A3:"GHA"},Guinea:{name:"Guinea",ISO_A3:"GIN"},Gambia:{name:"Gambia",ISO_A3:"GMB"},"Guinea Bissau":{name:"Guinea Bissau",ISO_A3:"GNB"},"Equatorial Guinea":{name:"Equatorial Guinea",ISO_A3:"GNQ"},Israel:{name:"Israel",ISO_A3:"ISR"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Kenya:{name:"Kenya",ISO_A3:"KEN"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},Liberia:{name:"Liberia",ISO_A3:"LBR"},Libya:{name:"Libya",ISO_A3:"LBY"},Lesotho:{name:"Lesotho",ISO_A3:"LSO"},Morocco:{name:"Morocco",ISO_A3:"MAR"},Madagascar:{name:"Madagascar",ISO_A3:"MDG"},Mali:{name:"Mali",ISO_A3:"MLI"},Malta:{name:"Malta",ISO_A3:"MLT"},Mozambique:{name:"Mozambique",ISO_A3:"MOZ"},Mauritania:{name:"Mauritania",ISO_A3:"MRT"},Mauritius:{name:"Mauritius",ISO_A3:"MUS"},Malawi:{name:"Malawi",ISO_A3:"MWI"},Namibia:{name:"Namibia",ISO_A3:"NAM"},Niger:{name:"Niger",ISO_A3:"NER"},Nigeria:{name:"Nigeria",ISO_A3:"NGA"},Oman:{name:"Oman",ISO_A3:"OMN"},Rwanda:{name:"Rwanda",ISO_A3:"RWA"},"Western Sahara":{name:"Western Sahara",ISO_A3:"ESH"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Sudan:{name:"Sudan",ISO_A3:"SDN"},"South Sudan":{name:"South Sudan",ISO_A3:"SSD"},Senegal:{name:"Senegal",ISO_A3:"SEN"},"Saint Helena":{name:"Saint Helena",ISO_A3:"SHN"},"Sierra Leone":{name:"Sierra Leone",ISO_A3:"SLE"},Somalia:{name:"Somalia",ISO_A3:"SOM"},Swaziland:{name:"Swaziland",ISO_A3:"SWZ"},Seychelles:{name:"Seychelles",ISO_A3:"SYC"},Syria:{name:"Syria",ISO_A3:"SYR"},Chad:{name:"Chad",ISO_A3:"TCD"},Togo:{name:"Togo",ISO_A3:"TGO"},Tunisia:{name:"Tunisia",ISO_A3:"TUN"},"United Republic of Tanzania":{name:"United Republic of Tanzania",ISO_A3:"TZA"},Uganda:{name:"Uganda",ISO_A3:"UGA"},Yemen:{name:"Yemen",ISO_A3:"YEM"},"South Africa":{name:"South Africa",ISO_A3:"ZAF"},Zambia:{name:"Zambia",ISO_A3:"ZMB"},Zimbabwe:{name:"Zimbabwe",ISO_A3:"ZWE"}},zf={Afghanistan:{name:"Afghanistan",ISO_A3:"AFG"},"United Arab Emirates":{name:"United Arab Emirates",ISO_A3:"ARE"},Armenia:{name:"Armenia",ISO_A3:"ARM"},Australia:{name:"Australia",ISO_A3:"AUS"},Azerbaijan:{name:"Azerbaijan",ISO_A3:"AZE"},Bangladesh:{name:"Bangladesh",ISO_A3:"BGD"},Bahrain:{name:"Bahrain",ISO_A3:"BHR"},Brunei:{name:"Brunei",ISO_A3:"BRN"},Bhutan:{name:"Bhutan",ISO_A3:"BTN"},China:{name:"China",ISO_A3:"CHN"},Georgia:{name:"Georgia",ISO_A3:"GEO"},Indonesia:{name:"Indonesia",ISO_A3:"IDN"},India:{name:"India",ISO_A3:"IND"},Iran:{name:"Iran",ISO_A3:"IRN"},Iraq:{name:"Iraq",ISO_A3:"IRQ"},Israel:{name:"Israel",ISO_A3:"ISR"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Japan:{name:"Japan",ISO_A3:"JPN"},Kazakhstan:{name:"Kazakhstan",ISO_A3:"KAZ"},Kyrgyzstan:{name:"Kyrgyzstan",ISO_A3:"KGZ"},Cambodia:{name:"Cambodia",ISO_A3:"KHM"},"South Korea":{name:"South Korea",ISO_A3:"KOR"},Kuwait:{name:"Kuwait",ISO_A3:"KWT"},Laos:{name:"Laos",ISO_A3:"LAO"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},"Sri Lanka":{name:"Sri Lanka",ISO_A3:"LKA"},Maldives:{name:"Maldives",ISO_A3:"MDV"},Myanmar:{name:"Myanmar",ISO_A3:"MMR"},Mongolia:{name:"Mongolia",ISO_A3:"MNG"},Malaysia:{name:"Malaysia",ISO_A3:"MYS"},Nepal:{name:"Nepal",ISO_A3:"NPL"},Oman:{name:"Oman",ISO_A3:"OMN"},Pakistan:{name:"Pakistan",ISO_A3:"PAK"},Philippines:{name:"Philippines",ISO_A3:"PHL"},"Papua New Guinea":{name:"Papua New Guinea",ISO_A3:"PNG"},"North Korea":{name:"North Korea",ISO_A3:"PRK"},Palestine:{name:"Palestine",ISO_A3:"PSE"},Qatar:{name:"Qatar",ISO_A3:"QAT"},Russia:{name:"Russia",ISO_A3:"RUS"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Singapore:{name:"Singapore",ISO_A3:"SGP"},Syria:{name:"Syria",ISO_A3:"SYR"},Thailand:{name:"Thailand",ISO_A3:"THA"},Tajikistan:{name:"Tajikistan",ISO_A3:"TJK"},Turkmenistan:{name:"Turkmenistan",ISO_A3:"TKM"},Turkey:{name:"Turkey",ISO_A3:"TUR"},Taiwan:{name:"Taiwan",ISO_A3:"TWN"},Uzbekistan:{name:"Uzbekistan",ISO_A3:"UZB"},Vietnam:{name:"Vietnam",ISO_A3:"VNM"},Yemen:{name:"Yemen",ISO_A3:"YEM"}},Pf={"New South Wales":{name:"New South Wales"},Victoria:{name:"Victoria"},Queensland:{name:"Queensland"},"South Australia":{name:"South Australia"},"Western Australia":{name:"Western Australia"},Tasmania:{name:"Tasmania"},"Northern Territory":{name:"Northern Territory"},"Australian Capital Territory":{name:"Australian Capital Territory"},"Other Territories":{name:"Other Territories"}},Rf={"British Columbia":{name:"British Columbia"},Quebec:{name:"Quebec"},Nunavut:{name:"Nunavut"},"Prince Edward Island":{name:"Prince Edward Island"},Saskatchewan:{name:"Saskatchewan"},Yukon:{name:"Yukon"},Manitoba:{name:"Manitoba"},Ontario:{name:"Ontario"},"New Brunswick":{name:"New Brunswick"},"Northwest Territories":{name:"Northwest Territories"},Alberta:{name:"Alberta"},"Newfoundland and Labrador":{name:"Newfoundland and Labrador"},"Nova Scotia":{name:"Nova Scotia"}},Vf={Albania:{name:"Albania",ISO_A3:"ALB"},Austria:{name:"Austria",ISO_A3:"AUT"},Belarus:{name:"Belarus",ISO_A3:"BLR"},Belgium:{name:"Belgium",ISO_A3:"BEL"},Bulgaria:{name:"Bulgaria",ISO_A3:"BGR"},"Bosnia and Herzegovina":{name:"Bosnia and Herzegovina",ISO_A3:"BIH"},Switzerland:{name:"Switzerland",ISO_A3:"CHE"},Cyprus:{name:"Cyprus",ISO_A3:"CYP"},"Czech Republic":{name:"Czech Republic",ISO_A3:"CZE"},Germany:{name:"Germany",ISO_A3:"DEU"},Denmark:{name:"Denmark",ISO_A3:"DNK"},Spain:{name:"Spain",ISO_A3:"ESP"},Estonia:{name:"Estonia",ISO_A3:"EST"},Finland:{name:"Finland",ISO_A3:"FIN"},France:{name:"France",ISO_A3:"FRA"},"United Kingdom":{name:"United Kingdom",ISO_A3:"GBR"},Greece:{name:"Greece",ISO_A3:"GRC"},Croatia:{name:"Croatia",ISO_A3:"HRV"},Hungary:{name:"Hungary",ISO_A3:"HUN"},Ireland:{name:"Ireland",ISO_A3:"IRL"},Iceland:{name:"Iceland",ISO_A3:"ISL"},Italy:{name:"Italy",ISO_A3:"ITA"},Kosovo:{name:"Kosovo",ISO_A3:"-99"},Lithuania:{name:"Lithuania",ISO_A3:"LTU"},Luxembourg:{name:"Luxembourg",ISO_A3:"LUX"},Latvia:{name:"Latvia",ISO_A3:"LVA"},Macedonia:{name:"Macedonia",ISO_A3:"MKD"},Malta:{name:"Malta",ISO_A3:"MLT"},Montenegro:{name:"Montenegro",ISO_A3:"MNE"},Netherlands:{name:"Netherlands",ISO_A3:"NLD"},Norway:{name:"Norway",ISO_A3:"NOR"},Poland:{name:"Poland",ISO_A3:"POL"},Portugal:{name:"Portugal",ISO_A3:"PRT"},Romania:{name:"Romania",ISO_A3:"ROU"},"Republic of Serbia":{name:"Republic of Serbia",ISO_A3:"SRB"},Slovakia:{name:"Slovakia",ISO_A3:"SVK"},Slovenia:{name:"Slovenia",ISO_A3:"SVN"},Sweden:{name:"Sweden",ISO_A3:"SWE"},Ukraine:{name:"Ukraine",ISO_A3:"UKR"},Moldova:{name:"Moldova",ISO_A3:"MDA"},Russia:{name:"Russia",ISO_A3:"RUS"},Turkey:{name:"Turkey",ISO_A3:"TUR"}},Bf={Aruba:{name:"Aruba",ISO_A3:"ABW"},Afghanistan:{name:"Afghanistan",ISO_A3:"AFG"},Angola:{name:"Angola",ISO_A3:"AGO"},Anguilla:{name:"Anguilla",ISO_A3:"AIA"},Albania:{name:"Albania",ISO_A3:"ALB"},Aland:{name:"Aland",ISO_A3:"ALA"},Andorra:{name:"Andorra",ISO_A3:"AND"},"United Arab Emirates":{name:"United Arab Emirates",ISO_A3:"ARE"},Argentina:{name:"Argentina",ISO_A3:"ARG"},Armenia:{name:"Armenia",ISO_A3:"ARM"},"American Samoa":{name:"American Samoa",ISO_A3:"ASM"},Antarctica:{name:"Antarctica",ISO_A3:"ATA"},"French Southern and Antarctic Lands":{name:"French Southern and Antarctic Lands",ISO_A3:"ATF"},"Antigua and Barbuda":{name:"Antigua and Barbuda",ISO_A3:"ATG"},Australia:{name:"Australia",ISO_A3:"AUS"},Austria:{name:"Austria",ISO_A3:"AUT"},Azerbaijan:{name:"Azerbaijan",ISO_A3:"AZE"},Burundi:{name:"Burundi",ISO_A3:"BDI"},Belgium:{name:"Belgium",ISO_A3:"BEL"},Benin:{name:"Benin",ISO_A3:"BEN"},"Burkina Faso":{name:"Burkina Faso",ISO_A3:"BFA"},Bangladesh:{name:"Bangladesh",ISO_A3:"BGD"},Bulgaria:{name:"Bulgaria",ISO_A3:"BGR"},Bahrain:{name:"Bahrain",ISO_A3:"BHR"},"The Bahamas":{name:"The Bahamas",ISO_A3:"BHS"},"Bosnia and Herzegovina":{name:"Bosnia and Herzegovina",ISO_A3:"BIH"},Belarus:{name:"Belarus",ISO_A3:"BLR"},Belize:{name:"Belize",ISO_A3:"BLZ"},Bermuda:{name:"Bermuda",ISO_A3:"BMU"},Bolivia:{name:"Bolivia",ISO_A3:"BOL"},Brazil:{name:"Brazil",ISO_A3:"BRA"},Barbados:{name:"Barbados",ISO_A3:"BRB"},Brunei:{name:"Brunei",ISO_A3:"BRN"},Bhutan:{name:"Bhutan",ISO_A3:"BTN"},Botswana:{name:"Botswana",ISO_A3:"BWA"},"Central African Republic":{name:"Central African Republic",ISO_A3:"CAF"},Canada:{name:"Canada",ISO_A3:"CAN"},Switzerland:{name:"Switzerland",ISO_A3:"CHE"},Chile:{name:"Chile",ISO_A3:"CHL"},China:{name:"China",ISO_A3:"CHN"},"Ivory Coast":{name:"Ivory Coast",ISO_A3:"CIV"},Cameroon:{name:"Cameroon",ISO_A3:"CMR"},"Cyprus No Mans Area":{name:"Cyprus No Mans Area",ISO_A3:"-99"},"Democratic Republic of the Congo":{name:"Democratic Republic of the Congo",ISO_A3:"COD"},"Republic of Congo":{name:"Republic of Congo",ISO_A3:"COG"},"Cook Islands":{name:"Cook Islands",ISO_A3:"COK"},Colombia:{name:"Colombia",ISO_A3:"COL"},Comoros:{name:"Comoros",ISO_A3:"COM"},"Cape Verde":{name:"Cape Verde",ISO_A3:"CPV"},"Costa Rica":{name:"Costa Rica",ISO_A3:"CRI"},Cuba:{name:"Cuba",ISO_A3:"CUB"},Curaçao:{name:"Curaçao",ISO_A3:"CUW"},"Cayman Islands":{name:"Cayman Islands",ISO_A3:"CYM"},"Northern Cyprus":{name:"Northern Cyprus",ISO_A3:"-99"},Cyprus:{name:"Cyprus",ISO_A3:"CYP"},"Czech Republic":{name:"Czech Republic",ISO_A3:"CZE"},Germany:{name:"Germany",ISO_A3:"DEU"},Djibouti:{name:"Djibouti",ISO_A3:"DJI"},Dominica:{name:"Dominica",ISO_A3:"DMA"},Denmark:{name:"Denmark",ISO_A3:"DNK"},"Dominican Republic":{name:"Dominican Republic",ISO_A3:"DOM"},Algeria:{name:"Algeria",ISO_A3:"DZA"},Ecuador:{name:"Ecuador",ISO_A3:"ECU"},Egypt:{name:"Egypt",ISO_A3:"EGY"},Eritrea:{name:"Eritrea",ISO_A3:"ERI"},"Dhekelia Sovereign Base Area":{name:"Dhekelia Sovereign Base Area",ISO_A3:"-99"},Spain:{name:"Spain",ISO_A3:"ESP"},Estonia:{name:"Estonia",ISO_A3:"EST"},Ethiopia:{name:"Ethiopia",ISO_A3:"ETH"},Finland:{name:"Finland",ISO_A3:"FIN"},Fiji:{name:"Fiji",ISO_A3:"FJI"},"Falkland Islands":{name:"Falkland Islands",ISO_A3:"FLK"},France:{name:"France",ISO_A3:"FRA"},"Faroe Islands":{name:"Faroe Islands",ISO_A3:"FRO"},"Federated States of Micronesia":{name:"Federated States of Micronesia",ISO_A3:"FSM"},Gabon:{name:"Gabon",ISO_A3:"GAB"},"United Kingdom":{name:"United Kingdom",ISO_A3:"GBR"},Georgia:{name:"Georgia",ISO_A3:"GEO"},Guernsey:{name:"Guernsey",ISO_A3:"GGY"},Ghana:{name:"Ghana",ISO_A3:"GHA"},Guinea:{name:"Guinea",ISO_A3:"GIN"},Gambia:{name:"Gambia",ISO_A3:"GMB"},"Guinea Bissau":{name:"Guinea Bissau",ISO_A3:"GNB"},"Equatorial Guinea":{name:"Equatorial Guinea",ISO_A3:"GNQ"},Greece:{name:"Greece",ISO_A3:"GRC"},Grenada:{name:"Grenada",ISO_A3:"GRD"},Greenland:{name:"Greenland",ISO_A3:"GRL"},Guatemala:{name:"Guatemala",ISO_A3:"GTM"},Guam:{name:"Guam",ISO_A3:"GUM"},Guyana:{name:"Guyana",ISO_A3:"GUY"},"Hong Kong S.A.R.":{name:"Hong Kong S.A.R.",ISO_A3:"HKG"},"Heard Island and McDonald Islands":{name:"Heard Island and McDonald Islands",ISO_A3:"HMD"},Honduras:{name:"Honduras",ISO_A3:"HND"},Croatia:{name:"Croatia",ISO_A3:"HRV"},Haiti:{name:"Haiti",ISO_A3:"HTI"},Hungary:{name:"Hungary",ISO_A3:"HUN"},Indonesia:{name:"Indonesia",ISO_A3:"IDN"},"Isle of Man":{name:"Isle of Man",ISO_A3:"IMN"},India:{name:"India",ISO_A3:"IND"},"Indian Ocean Territories":{name:"Indian Ocean Territories",ISO_A3:"-99"},"British Indian Ocean Territory":{name:"British Indian Ocean Territory",ISO_A3:"IOT"},Ireland:{name:"Ireland",ISO_A3:"IRL"},Iran:{name:"Iran",ISO_A3:"IRN"},Iraq:{name:"Iraq",ISO_A3:"IRQ"},Iceland:{name:"Iceland",ISO_A3:"ISL"},Israel:{name:"Israel",ISO_A3:"ISR"},Italy:{name:"Italy",ISO_A3:"ITA"},Jamaica:{name:"Jamaica",ISO_A3:"JAM"},Jersey:{name:"Jersey",ISO_A3:"JEY"},Jordan:{name:"Jordan",ISO_A3:"JOR"},Japan:{name:"Japan",ISO_A3:"JPN"},"Baykonur Cosmodrome":{name:"Baykonur Cosmodrome",ISO_A3:"-99"},"Siachen Glacier":{name:"Siachen Glacier",ISO_A3:"-99"},Kazakhstan:{name:"Kazakhstan",ISO_A3:"KAZ"},Kenya:{name:"Kenya",ISO_A3:"KEN"},Kyrgyzstan:{name:"Kyrgyzstan",ISO_A3:"KGZ"},Cambodia:{name:"Cambodia",ISO_A3:"KHM"},Kiribati:{name:"Kiribati",ISO_A3:"KIR"},"Saint Kitts and Nevis":{name:"Saint Kitts and Nevis",ISO_A3:"KNA"},"South Korea":{name:"South Korea",ISO_A3:"KOR"},Kosovo:{name:"Kosovo",ISO_A3:"-99"},Kuwait:{name:"Kuwait",ISO_A3:"KWT"},Laos:{name:"Laos",ISO_A3:"LAO"},Lebanon:{name:"Lebanon",ISO_A3:"LBN"},Liberia:{name:"Liberia",ISO_A3:"LBR"},Libya:{name:"Libya",ISO_A3:"LBY"},"Saint Lucia":{name:"Saint Lucia",ISO_A3:"LCA"},Liechtenstein:{name:"Liechtenstein",ISO_A3:"LIE"},"Sri Lanka":{name:"Sri Lanka",ISO_A3:"LKA"},Lesotho:{name:"Lesotho",ISO_A3:"LSO"},Lithuania:{name:"Lithuania",ISO_A3:"LTU"},Luxembourg:{name:"Luxembourg",ISO_A3:"LUX"},Latvia:{name:"Latvia",ISO_A3:"LVA"},"Macao S.A.R":{name:"Macao S.A.R",ISO_A3:"MAC"},"Saint Martin":{name:"Saint Martin",ISO_A3:"MAF"},Morocco:{name:"Morocco",ISO_A3:"MAR"},Moldova:{name:"Moldova",ISO_A3:"MDA"},Madagascar:{name:"Madagascar",ISO_A3:"MDG"},Maldives:{name:"Maldives",ISO_A3:"MDV"},Mexico:{name:"Mexico",ISO_A3:"MEX"},"Marshall Islands":{name:"Marshall Islands",ISO_A3:"MHL"},Macedonia:{name:"Macedonia",ISO_A3:"MKD"},Mali:{name:"Mali",ISO_A3:"MLI"},Malta:{name:"Malta",ISO_A3:"MLT"},Myanmar:{name:"Myanmar",ISO_A3:"MMR"},Montenegro:{name:"Montenegro",ISO_A3:"MNE"},Mongolia:{name:"Mongolia",ISO_A3:"MNG"},"Northern Mariana Islands":{name:"Northern Mariana Islands",ISO_A3:"MNP"},Mozambique:{name:"Mozambique",ISO_A3:"MOZ"},Mauritania:{name:"Mauritania",ISO_A3:"MRT"},Montserrat:{name:"Montserrat",ISO_A3:"MSR"},Mauritius:{name:"Mauritius",ISO_A3:"MUS"},Malawi:{name:"Malawi",ISO_A3:"MWI"},Malaysia:{name:"Malaysia",ISO_A3:"MYS"},Namibia:{name:"Namibia",ISO_A3:"NAM"},"New Caledonia":{name:"New Caledonia",ISO_A3:"NCL"},Niger:{name:"Niger",ISO_A3:"NER"},Nigeria:{name:"Nigeria",ISO_A3:"NGA"},Nicaragua:{name:"Nicaragua",ISO_A3:"NIC"},Niue:{name:"Niue",ISO_A3:"NIU"},Netherlands:{name:"Netherlands",ISO_A3:"NLD"},Norway:{name:"Norway",ISO_A3:"NOR"},Nepal:{name:"Nepal",ISO_A3:"NPL"},"New Zealand":{name:"New Zealand",ISO_A3:"NZL"},Oman:{name:"Oman",ISO_A3:"OMN"},Pakistan:{name:"Pakistan",ISO_A3:"PAK"},Panama:{name:"Panama",ISO_A3:"PAN"},"Pitcairn Islands":{name:"Pitcairn Islands",ISO_A3:"PCN"},Peru:{name:"Peru",ISO_A3:"PER"},"Spratly Islands":{name:"Spratly Islands",ISO_A3:"-99"},Philippines:{name:"Philippines",ISO_A3:"PHL"},Palau:{name:"Palau",ISO_A3:"PLW"},"Papua New Guinea":{name:"Papua New Guinea",ISO_A3:"PNG"},Poland:{name:"Poland",ISO_A3:"POL"},"Puerto Rico":{name:"Puerto Rico",ISO_A3:"PRI"},"North Korea":{name:"North Korea",ISO_A3:"PRK"},Portugal:{name:"Portugal",ISO_A3:"PRT"},Paraguay:{name:"Paraguay",ISO_A3:"PRY"},Palestine:{name:"Palestine",ISO_A3:"PSE"},"French Polynesia":{name:"French Polynesia",ISO_A3:"PYF"},Qatar:{name:"Qatar",ISO_A3:"QAT"},Romania:{name:"Romania",ISO_A3:"ROU"},Russia:{name:"Russia",ISO_A3:"RUS"},Rwanda:{name:"Rwanda",ISO_A3:"RWA"},"Western Sahara":{name:"Western Sahara",ISO_A3:"ESH"},"Saudi Arabia":{name:"Saudi Arabia",ISO_A3:"SAU"},Sudan:{name:"Sudan",ISO_A3:"SDN"},"South Sudan":{name:"South Sudan",ISO_A3:"SSD"},Senegal:{name:"Senegal",ISO_A3:"SEN"},Singapore:{name:"Singapore",ISO_A3:"SGP"},"South Georgia and South Sandwich Islands":{name:"South Georgia and South Sandwich Islands",ISO_A3:"SGS"},"Saint Helena":{name:"Saint Helena",ISO_A3:"SHN"},"Solomon Islands":{name:"Solomon Islands",ISO_A3:"SLB"},"Sierra Leone":{name:"Sierra Leone",ISO_A3:"SLE"},"El Salvador":{name:"El Salvador",ISO_A3:"SLV"},Somalia:{name:"Somalia",ISO_A3:"SOM"},"Saint Pierre and Miquelon":{name:"Saint Pierre and Miquelon",ISO_A3:"SPM"},"Republic of Serbia":{name:"Republic of Serbia",ISO_A3:"SRB"},"Sao Tome and Principe":{name:"Sao Tome and Principe",ISO_A3:"STP"},Suriname:{name:"Suriname",ISO_A3:"SUR"},Slovakia:{name:"Slovakia",ISO_A3:"SVK"},Slovenia:{name:"Slovenia",ISO_A3:"SVN"},Sweden:{name:"Sweden",ISO_A3:"SWE"},Swaziland:{name:"Swaziland",ISO_A3:"SWZ"},Seychelles:{name:"Seychelles",ISO_A3:"SYC"},Syria:{name:"Syria",ISO_A3:"SYR"},"Turks and Caicos Islands":{name:"Turks and Caicos Islands",ISO_A3:"TCA"},Chad:{name:"Chad",ISO_A3:"TCD"},Togo:{name:"Togo",ISO_A3:"TGO"},Thailand:{name:"Thailand",ISO_A3:"THA"},Tajikistan:{name:"Tajikistan",ISO_A3:"TJK"},Turkmenistan:{name:"Turkmenistan",ISO_A3:"TKM"},"East Timor":{name:"East Timor",ISO_A3:"TLS"},Tonga:{name:"Tonga",ISO_A3:"TON"},"Trinidad and Tobago":{name:"Trinidad and Tobago",ISO_A3:"TTO"},Tunisia:{name:"Tunisia",ISO_A3:"TUN"},Turkey:{name:"Turkey",ISO_A3:"TUR"},Tuvalu:{name:"Tuvalu",ISO_A3:"TUV"},Taiwan:{name:"Taiwan",ISO_A3:"TWN"},"United Republic of Tanzania":{name:"United Republic of Tanzania",ISO_A3:"TZA"},Uganda:{name:"Uganda",ISO_A3:"UGA"},Ukraine:{name:"Ukraine",ISO_A3:"UKR"},"United States Minor Outlying Islands":{name:"United States Minor Outlying Islands",ISO_A3:"UMI"},Uruguay:{name:"Uruguay",ISO_A3:"URY"},"United States of America":{name:"United States of America",ISO_A3:"USA"},"US Naval Base Guantanamo Bay":{name:"US Naval Base Guantanamo Bay",ISO_A3:"-99"},Uzbekistan:{name:"Uzbekistan",ISO_A3:"UZB"},"Saint Vincent and the Grenadines":{name:"Saint Vincent and the Grenadines",ISO_A3:"VCT"},Venezuela:{name:"Venezuela",ISO_A3:"VEN"},"British Virgin Islands":{name:"British Virgin Islands",ISO_A3:"VGB"},"United States Virgin Islands":{name:"United States Virgin Islands",ISO_A3:"VIR"},Vietnam:{name:"Vietnam",ISO_A3:"VNM"},Vanuatu:{name:"Vanuatu",ISO_A3:"VUT"},"Wallis and Futuna":{name:"Wallis and Futuna",ISO_A3:"WLF"},"Akrotiri Sovereign Base Area":{name:"Akrotiri Sovereign Base Area",ISO_A3:"-99"},Samoa:{name:"Samoa",ISO_A3:"WSM"},Yemen:{name:"Yemen",ISO_A3:"YEM"},"South Africa":{name:"South Africa",ISO_A3:"ZAF"},Zambia:{name:"Zambia",ISO_A3:"ZMB"},Zimbabwe:{name:"Zimbabwe",ISO_A3:"ZWE"},"French Guyana":{name:"French Guyana",ISO_A3:"GUF"}},Of={Alabama:{name:"Alabama"},Alaska:{name:"Alaska"},Arizona:{name:"Arizona"},Arkansas:{name:"Arkansas"},California:{name:"California"},Colorado:{name:"Colorado"},Connecticut:{name:"Connecticut"},Delaware:{name:"Delaware"},"District of Columbia":{name:"District of Columbia"},Florida:{name:"Florida"},Georgia:{name:"Georgia"},Hawaii:{name:"Hawaii"},Idaho:{name:"Idaho"},Illinois:{name:"Illinois"},Indiana:{name:"Indiana"},Iowa:{name:"Iowa"},Kansas:{name:"Kansas"},Kentucky:{name:"Kentucky"},Louisiana:{name:"Louisiana"},Maine:{name:"Maine"},Maryland:{name:"Maryland"},Massachusetts:{name:"Massachusetts"},Michigan:{name:"Michigan"},Minnesota:{name:"Minnesota"},Mississippi:{name:"Mississippi"},Missouri:{name:"Missouri"},Montana:{name:"Montana"},Nebraska:{name:"Nebraska"},Nevada:{name:"Nevada"},"New Hampshire":{name:"New Hampshire"},"New Jersey":{name:"New Jersey"},"New Mexico":{name:"New Mexico"},"New York":{name:"New York"},"North Carolina":{name:"North Carolina"},"North Dakota":{name:"North Dakota"},Ohio:{name:"Ohio"},Oklahoma:{name:"Oklahoma"},Oregon:{name:"Oregon"},Pennsylvania:{name:"Pennsylvania"},"Rhode Island":{name:"Rhode Island"},"South Carolina":{name:"South Carolina"},"South Dakota":{name:"South Dakota"},Tennessee:{name:"Tennessee"},Texas:{name:"Texas"},Utah:{name:"Utah"},Vermont:{name:"Vermont"},Virginia:{name:"Virginia"},Washington:{name:"Washington"},"West Virginia":{name:"West Virginia"},Wisconsin:{name:"Wisconsin"},Wyoming:{name:"Wyoming"}},Nf={Anguilla:{name:"Anguilla",ISO_A3:"AIA"},"Antigua and Barbuda":{name:"Antigua and Barbuda",ISO_A3:"ATG"},"The Bahamas":{name:"The Bahamas",ISO_A3:"BHS"},Bermuda:{name:"Bermuda",ISO_A3:"BMU"},Barbados:{name:"Barbados",ISO_A3:"BRB"},Canada:{name:"Canada",ISO_A3:"CAN"},Cuba:{name:"Cuba",ISO_A3:"CUB"},"Cayman Islands":{name:"Cayman Islands",ISO_A3:"CYM"},Dominica:{name:"Dominica",ISO_A3:"DMA"},"Dominican Republic":{name:"Dominican Republic",ISO_A3:"DOM"},Grenada:{name:"Grenada",ISO_A3:"GRD"},Greenland:{name:"Greenland",ISO_A3:"GRL"},Haiti:{name:"Haiti",ISO_A3:"HTI"},Jamaica:{name:"Jamaica",ISO_A3:"JAM"},"Saint Kitts and Nevis":{name:"Saint Kitts and Nevis",ISO_A3:"KNA"},"Saint Lucia":{name:"Saint Lucia",ISO_A3:"LCA"},"Saint Martin":{name:"Saint Martin",ISO_A3:"MAF"},Mexico:{name:"Mexico",ISO_A3:"MEX"},Montserrat:{name:"Montserrat",ISO_A3:"MSR"},"Puerto Rico":{name:"Puerto Rico",ISO_A3:"PRI"},"Saint Pierre and Miquelon":{name:"Saint Pierre and Miquelon",ISO_A3:"SPM"},"Turks and Caicos Islands":{name:"Turks and Caicos Islands",ISO_A3:"TCA"},"Trinidad and Tobago":{name:"Trinidad and Tobago",ISO_A3:"TTO"},"United States of America":{name:"United States of America",ISO_A3:"USA"},"Saint Vincent and the Grenadines":{name:"Saint Vincent and the Grenadines",ISO_A3:"VCT"},"British Virgin Islands":{name:"British Virgin Islands",ISO_A3:"VGB"},"United States Virgin Islands":{name:"United States Virgin Islands",ISO_A3:"VIR"}},Uf={Argentina:{name:"Argentina",ISO_A3:"ARG"},Bolivia:{name:"Bolivia",ISO_A3:"BOL"},Brazil:{name:"Brazil",ISO_A3:"BRA"},Chile:{name:"Chile",ISO_A3:"CHL"},Colombia:{name:"Colombia",ISO_A3:"COL"},"Costa Rica":{name:"Costa Rica",ISO_A3:"CRI"},Ecuador:{name:"Ecuador",ISO_A3:"ECU"},"Falkland Islands":{name:"Falkland Islands",ISO_A3:"FLK"},Guyana:{name:"Guyana",ISO_A3:"GUY"},Nicaragua:{name:"Nicaragua",ISO_A3:"NIC"},Panama:{name:"Panama",ISO_A3:"PAN"},Peru:{name:"Peru",ISO_A3:"PER"},Paraguay:{name:"Paraguay",ISO_A3:"PRY"},Suriname:{name:"Suriname",ISO_A3:"SUR"},Uruguay:{name:"Uruguay",ISO_A3:"URY"},Venezuela:{name:"Venezuela",ISO_A3:"VEN"},"French Guyana":{name:"French Guyana",ISO_A3:"GUF"},Guatemala:{name:"Guatemala",ISO_A3:"GTM"},"El Salvador":{name:"El Salvador",ISO_A3:"SLV"},Honduras:{name:"Honduras",ISO_A3:"HND"}},Gf={World:Bf,USA:Of,NorthAmerica:Nf,SouthAmerica:Uf,Canada:Rf,Europe:Vf,Asia:zf,Africa:Lf,Australia:Pf},Wf={Solid:Vu},Yf=(t,i)=>{const s=(t=>{const i=new U({color:t.uiStrokeColorContrastHigh}),s=new U({color:t.uiStrokeColorContrastMedium}),n=new U({color:t.uiStrokeColorContrastLow}),r=new sn({family:t.fontFamily,weight:"normal",style:"normal"}),o=r.setSize(18*t.fontScaler),a=r.setSize(16*t.fontScaler),h=r.setSize(14*t.fontScaler),l=r.setSize(10*t.fontScaler),u=r.withMutations((e=>e.set("size",14*t.fontScaler).set("weight","bold"))),c=r.setSize(13*t.fontScaler),d=new qi({thickness:2,fillStyle:n}),f=new U({color:t.dataHighlightOverlayColor}),g=new qi({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),m=t.dataColorPalette.map((t=>new U({color:t.stroke}))),p=t=>m[t%m.length],y=m.map((t=>new qi({thickness:2,fillStyle:t}))),A=t=>y[t%y.length],x=t.dataColorPalette.map((t=>new U({color:t.border}))).map((t=>new qi({thickness:2,fillStyle:t}))),S=t=>x[t%x.length],b=t.dataColorPalette.map((t=>{const e=t.area;return new et({angle:180,stops:[{color:ne(e,T(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ne(e,T(0,0,0,e.getA()),.3),offset:1}]})})),v=t=>b[t%b.length],M=t.dataColorPaletteInverted.map((t=>{const e=t.area;return new et({angle:180,stops:[{color:ne(e,T(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ne(e,T(0,0,0,e.getA()),.3),offset:1}]})})),w=t=>M[t%M.length],E=t.dataColorPaletteInverted.map((t=>new U({color:t.border}))).map((t=>new qi({thickness:2,fillStyle:t}))),k=t=>E[t%E.length],C=new U({color:t.dataColorPositive}),D=new U({color:t.dataColorNegative}),I=new qi({thickness:1,fillStyle:new U({color:t.dataStrokeColorContrastHigh.setA(50)})}),_=new qi({thickness:2,fillStyle:t.axisLineFillStyle}),F=nt,L=new U({color:T(0,0,0,1)}),z=new qi({thickness:1,fillStyle:t.axisGridMajorFillStyle}),P=new qi({thickness:1,fillStyle:t.axisTickMajorFillStyle}),R=h,B=t.axisLabelMajorFillStyle,O=new qi({thickness:1,fillStyle:t.axisGridMajorFillStyle}),N=new qi({thickness:1,fillStyle:t.axisTickMajorFillStyle}),G=h,W=t.axisLabelMajorFillStyle,Y=new qi({thickness:1,fillStyle:t.axisGridMinorFillStyle}),H=new qi({thickness:1,fillStyle:t.axisTickMinorFillStyle}),X=l,j=t.axisLabelMinorFillStyle,$=oa,q=new na({gridStrokeStyle:z,tickStyle:P,tickLength:50,tickPadding:-14,labelFont:R,labelPadding:0,labelFillStyle:B}),J=new na({gridStrokeStyle:O,tickStyle:N,tickLength:7,tickPadding:0,labelFont:G,labelPadding:0,labelFillStyle:W}),K=new na({gridStrokeStyle:Y,tickStyle:H,tickLength:4,tickPadding:5,labelFont:X,labelPadding:0,labelFillStyle:j}),Z=new Ca({extremeTickStyle:$,majorTickStyle:J,minorTickStyle:K}),Q=new Sa({greatTickStyle:q,majorTickStyle:J,minorTickStyle:K}),tt=new La({majorTickStyle:J,minorTickStyle:K}),it=new U({color:t.dataHighlightOverlayColor}),st=new qi({thickness:1,fillStyle:s}),rt=new qi({thickness:2,fillStyle:s}),ot=t=>new fn.Triangulated({shape:"sphere",size:10,fillStyle:m[t%m.length]}),at=m[0],ht=t.uiTextFillStyle,lt=t.legendBackgroundFillStyle,ut=new qi({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),ct=oe(t.legendButtonDefaultColor),dt=oe(t.isDark?T(70,70,70,255):T(170,170,170,255)),ft=new U({color:t.isDark?T(70,70,70,255):T(170,170,170,255)}),gt=new qi({thickness:1,fillStyle:i}),mt=new Jr({thickness:1,fillStyle:t.cursorGridFillStyle,pattern:$r.DashedEqual,patternScale:3}),pt=t.zoomBandChartDefocusOverlayFillStyle,yt=new qi({thickness:2,fillStyle:new U({color:t.zoomBandChartSplitterColor})});let At={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:nt,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new qi({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:nt,chartXYTitleFont:o,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:d,chartXYZoomingRectangleFillStyle:f,chartXYZoomingRectangleStrokeStyle:g,chartXYFittingRectangleFillStyle:f,chartXYFittingRectangleStrokeStyle:g,lineSeriesStrokeStyle:A,pointLineSeriesStrokeStyle:A,pointLineSeriesFillStyle:p,pointSeriesFillStyle:p,ellipseSeriesFillStyle:p,ellipseSeriesStrokeStyle:A,polygonSeriesFillStyle:p,polygonSeriesStrokeStyle:A,rectangleSeriesFillStyle:p,rectangleSeriesStrokeStyle:nt,segmentSeriesStrokeStyle:A,boxSeriesBodyFillStyle:p(0),boxSeriesBodyStrokeStyle:nt,boxSeriesStrokeStyle:new qi({thickness:1,fillStyle:m[0]}),boxSeriesMedianStrokeStyle:new qi({thickness:1,fillStyle:new U({color:T(0,0,0)})}),ohlcCandleThicknessPixels:5,ohlcCandleBodyFillStylePositive:C,ohlcCandleBodyFillStyleNegative:D,ohlcCandleTailStrokeStylePositive:new qi({thickness:1,fillStyle:new U({color:t.uiStrokeColorContrastHigh})}),ohlcCandleTailStrokeStyleNegative:new qi({thickness:1,fillStyle:new U({color:t.uiStrokeColorContrastHigh})}),ohlcBarThicknessPixels:10,ohlcBarStrokeStylePositive:new qi({thickness:2,fillStyle:C}),ohlcBarStrokeStyleNegative:new qi({thickness:2,fillStyle:D}),heatmapGridSeriesFillStyle:p,heatmapGridSeriesWireframeStyle:I,heatmapScrollingGridSeriesFillStyle:p,heatmapScrollingGridSeriesWireframeStyle:I,areaRangeSeriesFillStyle:v,areaRangeSeriesStrokeStyle:S,areaRangeSeriesFillStyleInverted:w,areaRangeSeriesStrokeStyleInverted:k,areaSeriesBipolarHighFillStyle:v,areaSeriesBipolarHighStrokeStyle:S,areaSeriesBipolarLowFillStyle:w,areaSeriesBipolarLowStrokeStyle:k,areaSeriesPositiveFillStyle:v,areaSeriesPositiveStrokeStyle:S,areaSeriesNegativeFillStyle:w,areaSeriesNegativeStrokeStyle:k,xAxisTitleFont:a,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:_,xAxisNibStyle:F,xAxisOverlayStyle:L,xAxisZoomingBandFillStyle:f,xAxisZoomingBandStrokeStyle:nt,xAxisNumericTicks:Z,xAxisDateTimeTicks:Q,xAxisTimeTicks:tt,yAxisTitleFont:a,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:_,yAxisNibStyle:F,yAxisOverlayStyle:L,yAxisZoomingBandFillStyle:f,yAxisZoomingBandStrokeStyle:nt,yAxisNumericTicks:Z,yAxisDateTimeTicks:Q,yAxisTimeTicks:tt,bandFillStyle:it,bandStrokeStyle:st,constantLineStrokeStyle:rt,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:nt,barChartTitleFont:o,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:V,barChartSeriesBackgroundStrokeStyle:nt,barChartBarFillStyle:p,barChartBarStrokeStyle:new qi({thickness:1,fillStyle:n}),barChartValueAxisTitleFont:a,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:_,barChartValueAxisTicks:Z.setMajorTickStyle((t=>t.setGridStrokeStyle(nt))).setMinorTickStyle((t=>t.setGridStrokeStyle(nt))),barChartCategoryAxisTitleFont:a,barChartCategoryAxisTitleFillStyle:t.axisTitleFillStyle,barChartCategoryAxisStrokeStyle:_,barChartCategoryLabels:{formatter:(t,e)=>t,labelFillStyle:Z.majorTickStyle.labelFillStyle,labelFont:Z.majorTickStyle.labelFont,labelMargin:8,labelRotation:0,tickStyle:Z.majorTickStyle.tickStyle,tickLength:0},barChartValueLabelsAfterBars:{position:"after-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:Z.majorTickStyle.labelFillStyle,labelFont:Z.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},barChartValueLabelsInsideBars:{position:"inside-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:Z.majorTickStyle.labelFillStyle,labelFont:Z.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:nt,chart3DTitleFont:o,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:d,chart3DBoundingBoxStrokeStyle:nt,xAxis3DTitleFont:a,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:_,xAxis3DNumericTicks:Z,xAxis3DDateTimeTicks:Q,xAxis3DTimeTicks:tt,yAxis3DTitleFont:a,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:_,yAxis3DNumericTicks:Z,yAxis3DDateTimeTicks:Q,yAxis3DTimeTicks:tt,zAxis3DTitleFont:a,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:_,zAxis3DNumericTicks:Z,zAxis3DDateTimeTicks:Q,zAxis3DTimeTicks:tt,lineSeries3DStrokeStyle:A,pointLineSeries3DStrokeStyle:A,pointLineSeries3DPointStyle:ot,pointSeries3DPointStyle:ot,pointCloudSeries3DPointStyle:t=>new fn.Pixelated({size:5,fillStyle:m[t%m.length]}),surfaceGridSeries3DFillStyle:p,surfaceGridSeries3DWireframeStyle:I,surfaceScrollingGridSeries3DFillStyle:p,surfaceScrollingGridSeries3DWireframeStyle:I,boxSeries3DFillStyle:p,meshModel3DFillStyle:p(0),polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:nt,polarChartTitleFont:o,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:d,polarSectorFillStyle:it,polarSectorStrokeStyle:st,polarAmplitudeAxisTitleFont:a,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:_,polarAmplitudeAxisNumericTicks:Z,polarAmplitudeAxisDateTimeTicks:Q,polarAmplitudeAxisTimeTicks:tt,polarRadialAxisTitleFont:a,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:_,polarRadialAxisTickStyle:J,polarLineSeriesStrokeStyle:A,polarPointLineSeriesFillStyle:p,polarPointLineSeriesStrokeStyle:A,polarPointSeriesFillStyle:p,polarPolygonSeriesFillStyle:v,polarPolygonSeriesStrokeStyle:S,polarAreaSeriesFillStyle:v,polarAreaSeriesStrokeStyle:S,polarHeatmapSeriesFillStyle:p,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:nt,mapChartTitleFont:o,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:at,mapChartStrokeStyle:new qi({thickness:1,fillStyle:new U({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:V,mapChartOutlierRegionStrokeStyle:new qi({thickness:1,fillStyle:n}),mapChartSeparateRegionFillStyle:lt,mapChartSeparateRegionStrokeStyle:ut,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:nt,dataGridTitleFont:o,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:h,dataGridTextFillStyle:at,dataGridCellBackgroundFillStyle:new U({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new qi({thickness:.4,fillStyle:new U({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:nt,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ut,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ut,dataGridScrollBarButtonArrowFillStyle:ct,dataGridScrollBarButtonArrowStrokeStyle:ut,sparkLineChartStrokeStyle:A(0),sparkPointChartFillStyle:p(0),sparkBarChartFillStyle:p(0),sparkBarChartStrokeStyle:S(0),sparkAreaChartFillStyle:v(0),sparkAreaChartStrokeStyle:S(0),sparkPieChartFillStyle:p,sparkPieChartStrokeStyle:ut,sparkChartBandFillStyle:it,sparkChartBandStrokeStyle:st,sparkChartConstantLineStrokeStyle:rt,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:nt,spiderChartTitleFont:o,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:d,spiderChartWebStyle:new qi({thickness:2,fillStyle:n}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:h,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:a,spiderChartAxisStrokeStyle:new qi({thickness:2,fillStyle:s}),spiderChartAxisNibStrokeStyle:new qi({thickness:2,fillStyle:i}),spiderSeriesFillStyle:v,spiderSeriesStrokeStyle:S,spiderSeriesPointFillStyle:p,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:nt,pieChartTitleFont:o,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:p,pieChartSliceStrokeStyle:ut,pieChartSliceLabelFont:c,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:gt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:nt,funnelChartTitleFont:o,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:p,funnelChartSliceStrokeStyle:ut,funnelChartSliceLabelFont:c,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:gt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:nt,pyramidChartTitleFont:o,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:p,pyramidChartSliceStrokeStyle:ut,pyramidChartSliceLabelFont:c,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:gt,gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:nt,gaugeChartTitleFont:o,gaugeChartTitleFillStyle:t.titleFillStyle,gaugeChartEmptyGaugeFillStyle:new U({color:t.uiBackgroundColor}),gaugeChartEmptyGaugeStrokeStyle:ut,gaugeChartGaugeFillStyle:at,gaugeChartIntervalLabelsFillStyle:ht,gaugeChartIntervalLabelsFont:c,gaugeChartValueLabelFillStyle:ht,gaugeChartValueLabelFont:c,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:nt,zoomBandChartDefocusOverlayFillStyle:pt,zoomBandChartSplitterStrokeStyle:yt,zoomBandChartKnobFillStyle:t.zoomBandChartKnobFillStyle,zoomBandChartKnobSize:t.zoomBandChartKnobSize,onScreenMenuBackgroundColor:T(254,204,0,.7),uiButtonFillStyle:ct,uiButtonFillStyleHidden:dt,uiButtonStrokeStyle:ut,uiButtonSize:10,uiBackgroundFillStyle:lt,uiBackgroundStrokeStyle:ut,uiTextFillStyle:ht,uiTextFillStyleHidden:ft,uiTextFont:c,legendTitleFillStyle:ht,legendTitleFont:u,cursorTickMarkerXBackgroundFillStyle:lt,cursorTickMarkerXBackgroundStrokeStyle:ut,cursorTickMarkerXTextFillStyle:ht,cursorTickMarkerXTextFont:c,cursorTickMarkerYBackgroundFillStyle:lt,cursorTickMarkerYBackgroundStrokeStyle:ut,cursorTickMarkerYTextFillStyle:ht,cursorTickMarkerYTextFont:c,cursorPointMarkerFillStyle:mt.getFillStyle(),cursorPointMarkerSize:{x:9,y:9},cursorPointMarkerShape:e.PointShape.Cross,cursorResultTableFillStyle:lt,cursorResultTableStrokeStyle:ut,cursorResultTableTextFillStyle:ht,cursorResultTableTextFont:c,cursorGridStrokeStyleX:mt,cursorGridStrokeStyleY:mt,chartMarkerPointMarkerFillStyle:mt.getFillStyle(),chartMarkerPointMarkerSize:{x:20,y:20},chartMarkerPointMarkerShape:e.PointShape.Star,seriesMarkerPointMarkerFillStyle:mt.getFillStyle(),seriesMarkerPointMarkerSize:{x:9,y:9},seriesMarkerPointMarkerShape:e.PointShape.Cross};return t.overrideThemeProperties&&(At={...At,...t.overrideThemeProperties}),At})(t),n={...i,header1Font:s.xAxisTitleFont,header2Font:s.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:s.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...s,examples:n}},Hf=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/${e}`;return i.addEventListener("error",(e=>{Te(t,s,"Theme resource",{shouldCrash:!1})})),i.src=s,i},Xf=(t,e,i)=>s=>{const n=!0===t?e[s%e.length].stroke:ne(e[s%e.length].stroke,T(255,255,255),.5);return new Z({stops:[{color:ne(n,T(255,255,255),.5*i).setA(100),offset:0},{color:n.setA(100),offset:.5},{color:ne(n,T(30,30,30),.5*i).setA(100),offset:1}]})},jf=(t,e,i)=>s=>{const n=!0===t?e[s%e.length].stroke:ne(e[s%e.length].stroke,T(255,255,255),.2);return new Z({stops:[{color:ne(n,T(255,255,255),.2*i),offset:0},{color:n,offset:.5},{color:ne(n,T(0,0,0),.2*i),offset:1}]})},$f=(t,e,i)=>s=>{const n=!0===t?e[s%e.length].stroke:ne(e[s%e.length].stroke,T(255,255,255),.2);return new et({angle:90,stops:[{color:ne(n,T(255,255,255),.5*i),offset:0},{color:n,offset:.35},{color:ne(n,T(30,30,30),.5*i),offset:1}]})},qf=(t,e,i)=>(i=>{const s=new Map;return i=>{const n=s.get(i);if(n)return n;const r=(i=>{const s=!0===t?e[i%e.length].stroke:ne(e[i%e.length].stroke,T(255,255,255),.3);return new et({angle:90,stops:[{color:ne(s,T(255,255,255),.5),offset:0},{color:s,offset:.35},{color:ne(s,T(30,30,30),.5),offset:1}]})})(i);return s.set(i,r),r}})(),Jf=(t,i,s)=>{const n=i[0].stroke;return new Z({shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner,position:{x:.5,y:.5},stops:[{color:!0===t?n:ne(n,T(255,255,255),.5*s),offset:0},{color:n,offset:.5},{color:!0===t?n:ne(n,T(0,0,0),.5*s),offset:1}]})},Kf=ve((()=>{const t=T(255,255,255),i=new U({color:t}),s=!0,n=new io({spread:1,blur:9,offset:{x:0,y:0},color:T(0,0,0,150)}),r=new Z({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:T(50,51,52)},{offset:.5,color:T(14,15,16)},{offset:1,color:T(0,0,0)}]}),o=new U({color:T(45,45,45)}),a=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(120,120,120,100)},{offset:1,color:T(0,0,0,50)}]}),h=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(30,30,30,200)},{offset:1,color:T(0,0,0,255)}]}),l=new U({color:T(255,255,220)}),u=new U({color:T(255,255,166)}),c=new U({color:T(255,255,220)}),d=new U({color:T(255,255,220,130)}),f=new U({color:T(255,255,200)}),g=f,m=g,p=new et({angle:45,stops:[{offset:0,color:T(230,230,230)},{offset:1,color:T(150,150,150)}]}),y=new U({color:T(220,220,220)}),A=new U({color:T(200,200,200,50)}),x=new U({color:T(200,200,200,150)}),S=new U({color:T(200,200,200,20)}),b=new U({color:T(150,150,150)}),v=new et({angle:0,stops:[{offset:0,color:T(10,10,10,220)},{offset:1,color:T(30,30,30,220)}]}),M=i,E=T(255,255,200),k=v,C=M,D=T(20,20,20),I=T(0,0,0),_=t,F=T(150,150,150),L=T(50,50,50),z=T(50,50,50),P=T(100,100,100),R=T(200,200,200),V=[T(255,255,91,255),T(255,205,91,255),T(255,155,91,255),T(255,196,188,255),T(255,148,184,255),T(219,148,198,255),T(235,196,224,255),T(169,148,198,255),T(148,226,198,255),T(148,255,176,255),T(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),B=t.setA(20),O=T(176,255,157,255),N=T(255,112,76,255),G={mapChartFillStyle:new et({angle:135,stops:[{color:T(255,255,91,255),offset:0},{color:T(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,V,.5),pieChartSliceFillStylePalette:jf(s,V,1),funnelChartSliceFillStylePalette:$f(s,V,1),pyramidChartSliceFillStylePalette:$f(s,V,1),rectangleSeriesFillStyle:qf(s,V),gaugeChartGaugeFillStyle:Jf(s,V,1)},W=new U({color:T(176,255,157,255)}),Y=new U({color:T(255,146,146,255)}),H=new U({color:T(176,255,157,255)}),X=new U({color:T(230,63,63,255)}),j=new U({color:T(176,255,157,120)}),$=new U({color:T(229,63,63,180)}),q=new U({color:T(27,37,36,255)}),J=new U({color:T(62,27,27,255)}),K=[T(255,0,0),T(255,255,0),T(0,255,0)],Q=[T(10,10,255),T(10,190,255),T(251,255,0),T(255,38,0)],tt=[T(255,255,0),T(255,204,0),T(255,128,0),T(255,0,0)],it=[T(0,0,0),T(167,4,69,255),T(255,0,0),T(252,252,168,255)],st=new Z({stops:[{color:T(61,61,80,100),offset:0},{color:T(44,44,55,30),offset:1}]}),nt=new U({color:T(148,148,198,255)}),rt=j.getColor().setA(255),ot=T(100,100,100);return Yf({isDark:s,highlightColorOffset:T(60,60,60,60),highlightColorOffsetAxisOverlay:T(255,255,255,40),effect:n,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:r,dashboardSplitterFillStyle:o,panelBackgroundFillStyle:a,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:l,axisTitleFillStyle:u,axisLabelMajorFillStyle:c,axisLabelMinorFillStyle:d,uiTitleFillStyle:f,uiTextFillStyle:g,cursorTextFillStyle:m,axisLineFillStyle:p,axisTickMajorFillStyle:y,axisGridMajorFillStyle:A,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:b,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:E,resultTableBackgroundFillStyle:k,resultTableBackgroundBorderFillStyle:C,uiBackgroundColor:D,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:_,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:L,dataStrokeColorContrastHigh:z,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:R,dataColorPalette:V,dataColorPaletteInverted:[{area:T(190,50,50,100),border:T(210,80,80)}],dataHighlightOverlayColor:B,dataColorPositive:O,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new U({color:T(0,0,0,180)}),zoomBandChartSplitterColor:w("#FBFB5A"),zoomBandChartKnobFillStyle:t=>new Xr({source:Hf(t,"zoomBandChart/darkgold-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:G},{positiveTextFillStyle:W,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:j,negativeAreaFillStyle:$,positiveBackgroundFillStyle:q,negativeBackgroundFillStyle:J,badGoodColorPalette:K,coldHotColorPalette:Q,intensityColorPalette:tt,spectrogramColorPalette:it,bollingerFillStyle:st,bollingerBorderFillStyle:nt,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:ot})})),Zf=ve((()=>{const t=T(255,255,255),i=new U({color:t}),s=!0,n=new io({spread:0,blur:9,offset:{x:0,y:0},color:T(105,255,236,40)}),r=new U({color:T(2,21,30)}),o=new Z({stops:[{color:T(19,40,66,150),offset:0},{color:T(0,0,0,150),offset:1}]}),a=new U({color:T(0,5,8,150)}),h=i,l=i,u=i,c=new U({color:T(255,255,220,130)}),d=i,f=i,g=f,m=new U({color:T(20,224,250,255)}),p=i,y=new U({color:T(61,94,110,100)}),A=new U({color:T(61,94,110,255)}),x=new U({color:T(61,94,110,40)}),S=i,b=new U({color:T(0,18,23,255)}),v=i,M=t,E=new U({color:T(0,17,22,240)}),k=i,C=T(0,38,48,220),D=T(0,0,0),I=t,_=T(150,150,150),F=T(19,78,93),L=T(50,50,50),z=T(0,36,48),P=T(200,200,200),R=[T(45,253,253,255),T(44,172,247,255),T(46,100,248,255),T(96,84,199,255),T(184,104,245,255),T(98,160,218,255),T(43,238,245,255),T(38,140,206,255),T(112,96,224,255),T(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),V=t.setA(50),B=T(3,217,194,255),O=T(230,63,63,255),N={mapChartFillStyle:new et({angle:135,stops:[{color:T(118,248,231,255),offset:0},{color:T(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,R,1),pieChartSliceFillStylePalette:jf(s,R,1),funnelChartSliceFillStylePalette:$f(s,R,1),pyramidChartSliceFillStylePalette:$f(s,R,1),rectangleSeriesFillStyle:qf(s,R),gaugeChartGaugeFillStyle:Jf(s,R,1)},G=new U({color:T(45,253,253,255)}),W=new U({color:T(255,146,146,255)}),Y=new U({color:T(45,253,253,255)}),H=new U({color:T(230,63,63,255)}),X=new U({color:T(1,190,164,120)}),j=new U({color:T(229,63,63,180)}),$=new U({color:T(1,53,57,255)}),q=new U({color:T(62,27,27,255)}),J=[T(1,104,119,255),T(0,165,144,255),T(0,246,214,255)],K=[T(0,87,95,255),T(0,125,124,255),T(1,209,182,255),T(0,255,221,255),T(218,112,112,255),T(172,47,47,255)],Q=[T(126,255,253,255),T(50,233,230,255),T(0,196,193,255),T(62,138,178,255),T(139,88,191,255),T(162,55,143,255)],tt=[T(13,31,52,255),T(101,50,118,255),T(1,142,172,255),T(2,196,170,255),T(0,255,221,255)],it=new Z({stops:[{color:T(122,103,254,70),offset:0},{color:T(178,168,255,10),offset:1}]}),st=new U({color:T(122,103,254,255)}),nt=X.getColor().setA(255),rt=T(15,83,83);return Yf({isDark:s,highlightColorOffset:T(60,60,60,60),highlightColorOffsetAxisOverlay:T(255,255,255,40),effect:n,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new Xr({source:Hf(t,"themes/turquoiseHexagon.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:r,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:a,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:h,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:p,axisGridMajorFillStyle:y,axisTickMinorFillStyle:A,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:E,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:C,uiBackgroundBorderColor:D,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:_,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:z,dataStrokeColorContrastLow:P,dataColorPalette:R,dataColorPaletteInverted:[{area:T(170,60,210,100),border:T(210,100,250)}],dataHighlightOverlayColor:V,dataColorPositive:B,dataColorNegative:O,zoomBandChartDefocusOverlayFillStyle:new U({color:T(0,0,0,180)}),zoomBandChartSplitterColor:w("#2BF4F4"),zoomBandChartKnobFillStyle:t=>new Xr({source:Hf(t,"zoomBandChart/turquoise-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:W,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:q,badGoodColorPalette:J,coldHotColorPalette:K,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:rt})})),Qf=ve((()=>{const t=!1,i=new io({spread:0,blur:6,offset:{x:2,y:-2},color:T(0,0,0,30)}),s=new Z({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:T(255,255,255)},{offset:1,color:T(255,255,255)}]}),n=new U({color:T(219,227,233,255)}),r=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(255,255,255,200)},{offset:1,color:T(240,244,246,200)}]}),o=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(255,255,255,255)},{offset:1,color:T(255,255,255,255)}]}),a=new U({color:T(33,43,49)}),h=new U({color:T(33,43,49)}),l=new U({color:T(33,43,49)}),u=new U({color:T(33,43,49,150)}),c=new U({color:T(33,43,49)}),d=c,f=d,g=new et({angle:45,stops:[{offset:0,color:T(225,225,225)},{offset:1,color:T(225,225,225)}]}),m=new U({color:T(168,186,199,255)}),p=new U({color:T(168,186,199,120)}),y=new U({color:T(168,186,199,40)}),A=new U({color:T(168,186,199,40)}),x=new U({color:T(128,146,159,255)}),S=new et({angle:0,stops:[{offset:0,color:T(255,255,255,240)},{offset:1,color:T(255,255,255,240)}]}),b=new U({color:T(168,186,199)}),v=T(255,255,200),M=new U({color:T(255,255,255,240)}),E=new U({color:T(128,146,159,255)}),k=T(255,255,255,255),C=T(168,168,199,255),D=T(168,186,199,255),I=T(168,186,199,255),_=T(168,186,199,255),F=T(168,186,199,255),L=T(100,100,100),z=T(200,200,200),P=[T(28,181,140,255),T(255,132,0,255),T(240,39,39,255),T(86,121,251,255),T(2,181,213,255),T(13,212,158,255),T(22,167,3,255),T(234,103,232,255),T(62,183,179,255),T(140,93,3,255),T(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),R=T(150,150,150,80),V=T(46,182,120,255),B=T(255,66,66,255),O=new qi({thickness:2,fillStyle:new U({color:T(168,186,199,255)})}),N={mapChartFillStyle:new et({angle:-45,stops:[{color:T(2,181,213,255),offset:0},{color:T(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(t,P,.8),pieChartSliceFillStylePalette:jf(t,P,.8),funnelChartSliceFillStylePalette:$f(t,P,.5),pyramidChartSliceFillStylePalette:$f(t,P,.5),rectangleSeriesFillStyle:qf(t,P),gaugeChartGaugeFillStyle:Jf(t,P,.8),chartXYSeriesBackgroundStrokeStyle:O,chart3DSeriesBackgroundStrokeStyle:O,polarChartSeriesBackgroundStrokeStyle:O,spiderChartSeriesBackgroundStrokeStyle:O,dataGridTextFillStyle:new U({color:T(0,88,64,255)})},G=new U({color:T(4,146,108,255)}),W=new U({color:T(240,39,39,255)}),Y=new U({color:T(28,181,140,255)}),H=new U({color:T(230,88,88,255)}),X=new U({color:T(28,181,140,180)}),j=new U({color:T(230,88,88,180)}),$=new U({color:T(229,243,228)}),q=new U({color:T(232,225,216)}),J=[T(193,48,48,255),T(240,234,60,255),T(45,191,55,255)],K=[T(10,19,255,255),T(15,191,250,255),T(249,255,2,255),T(253,133,0,255),T(255,24,0,255)],Q=[T(50,99,213),T(8,179,77),T(255,246,0),T(255,126,0),T(189,36,30)],tt=[T(16,64,176),T(8,179,77),T(255,246,0),T(255,126,0),T(168,6,0)],it=new U({color:T(185,198,207,255)}),st=new Z({stops:[{color:T(151,190,220,10),offset:0},{color:T(151,190,220,50),offset:1}]}),nt=X.getColor().setA(255),rt=T(150,150,150);return Yf({isDark:t,highlightColorOffset:T(-60,-60,-60,60),highlightColorOffsetAxisOverlay:T(0,0,0,40),effect:i,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:s,dashboardSplitterFillStyle:n,panelBackgroundFillStyle:r,seriesBackgroundFillStyle:o,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:h,axisLabelMajorFillStyle:l,axisLabelMinorFillStyle:u,uiTitleFillStyle:c,uiTextFillStyle:d,cursorTextFillStyle:f,axisLineFillStyle:g,axisTickMajorFillStyle:m,axisGridMajorFillStyle:p,axisTickMinorFillStyle:y,axisGridMinorFillStyle:A,cursorGridFillStyle:x,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:k,uiBackgroundBorderColor:C,uiStrokeColorContrastHigh:D,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:_,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:z,dataColorPalette:P,dataColorPaletteInverted:[{area:T(190,50,50,100),border:T(210,80,80)}],dataHighlightOverlayColor:R,dataColorPositive:V,dataColorNegative:B,zoomBandChartDefocusOverlayFillStyle:new U({color:T(255,255,255,180)}),zoomBandChartSplitterColor:w("#505D65"),zoomBandChartKnobFillStyle:t=>new Xr({source:Hf(t,"zoomBandChart/light-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:W,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:q,badGoodColorPalette:J,coldHotColorPalette:K,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:st,bollingerBorderFillStyle:it,highlightPointColor:T(0,0,0),highlightDataGridColor:nt,unfocusedDataColor:rt})})),tg=ve((()=>{const t=!1,i=new Z({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:T(255,255,255)},{offset:1,color:T(255,255,255)}]}),s=new U({color:T(214,236,216,255)}),n=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(233,244,231,70)},{offset:1,color:T(233,244,231,200)}]}),r=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:T(255,255,255,255)},{offset:1,color:T(255,255,255,255)}]}),o=new U({color:T(1,61,53)}),a=new U({color:T(1,61,53)}),h=new U({color:T(1,61,53)}),l=new U({color:T(1,61,53,150)}),u=new U({color:T(1,61,53)}),c=u,d=c,f=new et({angle:45,stops:[{offset:0,color:T(225,225,225)},{offset:1,color:T(225,225,225)}]}),g=new U({color:T(188,211,186,255)}),m=new U({color:T(188,211,186,150)}),p=new U({color:T(188,211,186,50)}),y=new U({color:T(188,211,186,50)}),A=new U({color:T(104,148,111,255)}),x=new et({angle:0,stops:[{offset:0,color:T(255,255,255,240)},{offset:1,color:T(255,255,255,240)}]}),S=new U({color:T(104,148,111)}),b=T(255,255,200),v=new U({color:T(255,255,255,240)}),M=new U({color:T(104,148,111,255)}),E=T(255,255,255,255),k=T(179,201,183,255),C=T(188,211,186,255),D=T(188,211,186,255),I=T(188,211,186,255),_=T(188,211,186,255),F=T(100,100,100),L=T(200,200,200),z=[T(138,195,142,255),T(193,161,114,255),T(178,99,99,255),T(142,156,210,255),T(154,209,219,255),T(164,212,199,255),T(104,156,97,255),T(196,147,195,255),T(92,190,187,255),T(126,100,51,255),T(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),P=T(150,150,150,80),R=T(46,182,84,255),V=T(232,96,96,255),B=new qi({thickness:2,fillStyle:new U({color:T(188,211,186,255)})}),O={mapChartFillStyle:new et({angle:-45,stops:[{color:T(118,160,121,255),offset:0},{color:T(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:Xf(t,z,.8),pieChartSliceFillStylePalette:jf(t,z,.8),pyramidChartSliceFillStylePalette:$f(t,z,.5),funnelChartSliceFillStylePalette:$f(t,z,.5),rectangleSeriesFillStyle:qf(t,z),gaugeChartGaugeFillStyle:Jf(t,z,.8),chartXYSeriesBackgroundStrokeStyle:B,chart3DSeriesBackgroundStrokeStyle:B,polarChartSeriesBackgroundStrokeStyle:B,spiderChartSeriesBackgroundStrokeStyle:B,dataGridTextFillStyle:new U({color:T(77,66,21,255)})},N=new U({color:T(93,151,97,255)}),G=new U({color:T(178,99,99,255)}),W=new U({color:T(138,195,142,255)}),Y=new U({color:T(178,99,99,255)}),H=new U({color:T(138,195,142,180)}),X=new U({color:T(178,99,99,180)}),j=new U({color:T(224,240,237)}),$=new U({color:T(251,227,227)}),q=[T(178,99,99,255),T(215,224,111,255),T(80,186,88,255)],J=[T(62,64,142,255),T(66,131,77,255),T(250,250,135,255),T(202,161,78,255),T(179,53,53,255)],K=[T(64,86,138),T(123,192,205),T(255,252,149),T(220,155,92),T(184,78,74)],Q=[T(64,86,138),T(123,192,205),T(255,252,149),T(220,155,92),T(132,60,57)],tt=new U({color:T(185,198,207,255)}),it=new Z({stops:[{color:T(151,190,220,10),offset:0},{color:T(151,190,220,50),offset:1}]}),st=H.getColor().setA(255),nt=T(150,150,150);return Yf({isDark:t,highlightColorOffset:T(-60,-60,-60,60),highlightColorOffsetAxisOverlay:T(0,0,0,40),effect:void 0,effectsText:!1,effectsDashboardSplitters:!1,lcjsBackgroundFillStyle:i,dashboardSplitterFillStyle:s,panelBackgroundFillStyle:n,seriesBackgroundFillStyle:r,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:o,axisTitleFillStyle:a,axisLabelMajorFillStyle:h,axisLabelMinorFillStyle:l,uiTitleFillStyle:u,uiTextFillStyle:c,cursorTextFillStyle:d,axisLineFillStyle:f,axisTickMajorFillStyle:g,axisGridMajorFillStyle:m,axisTickMinorFillStyle:p,axisGridMinorFillStyle:y,cursorGridFillStyle:A,legendBackgroundFillStyle:x,legendBackgroundBorderFillStyle:S,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:v,resultTableBackgroundBorderFillStyle:M,uiBackgroundColor:E,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:C,uiStrokeColorContrastMedium:D,uiStrokeColorContrastLow:I,dataStrokeColorContrastHigh:_,dataStrokeColorContrastMedium:F,dataStrokeColorContrastLow:L,dataColorPalette:z,dataColorPaletteInverted:[{area:T(210,70,70,100),border:T(200,110,110)}],dataHighlightOverlayColor:P,dataColorPositive:R,dataColorNegative:V,zoomBandChartDefocusOverlayFillStyle:new U({color:T(255,255,255,180)}),zoomBandChartSplitterColor:w("#446A40"),zoomBandChartKnobFillStyle:t=>new Xr({source:Hf(t,"zoomBandChart/lightnature-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O},{positiveTextFillStyle:N,negativeTextFillStyle:G,positiveFillStyle:W,negativeFillStyle:Y,positiveAreaFillStyle:H,negativeAreaFillStyle:X,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:$,badGoodColorPalette:q,coldHotColorPalette:J,intensityColorPalette:K,spectrogramColorPalette:Q,bollingerFillStyle:it,bollingerBorderFillStyle:tt,highlightPointColor:T(0,0,0),highlightDataGridColor:st,unfocusedDataColor:nt})})),eg=ve((()=>{const t=T(255,255,255),i=new U({color:t}),s=!0,n=new io({spread:1,blur:9,offset:{x:0,y:0},color:T(255,255,255,30)}),r=new U({color:T(6,15,36)}),o=new Z({stops:[{color:T(46,13,87,50),offset:0},{color:T(0,0,0,150),offset:1}]}),a=new U({color:T(0,5,8,150)}),h=i,l=i,u=i,c=new U({color:T(255,255,220,130)}),d=i,f=i,g=f,m=new et({angle:45,stops:[{offset:0,color:T(241,133,255,255)},{offset:1,color:T(115,207,238,255)}]}),p=i,y=new U({color:T(61,94,110,100)}),A=new U({color:T(61,94,110,255)}),x=new U({color:T(61,94,110,40)}),S=i,b=new U({color:T(0,18,23,255)}),v=i,M=T(115,207,238,255),E=new U({color:T(0,17,22,240)}),k=i,C=T(0,38,48,255),D=T(0,0,0),I=t,_=T(150,150,150),F=T(19,57,93),L=T(50,50,50),z=T(0,17,48),P=T(200,200,200),R=[T(20,211,237,255),T(98,147,252,255),T(164,73,250,255),T(129,117,253,255),T(95,134,252,255),T(22,133,212,255),T(35,200,242,255),T(104,121,233,255),T(137,69,232,255),T(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),V=t.setA(50),B=T(3,217,194,255),O=T(243,21,110,255),N={mapChartFillStyle:new et({angle:135,stops:[{color:T(118,248,231,255),offset:0},{color:T(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Xf(s,R,.5),pieChartSliceFillStylePalette:jf(s,R,2),funnelChartSliceFillStylePalette:$f(s,R,1),pyramidChartSliceFillStylePalette:$f(s,R,1),rectangleSeriesFillStyle:qf(s,R),gaugeChartGaugeFillStyle:Jf(s,R,1)},G=new U({color:T(20,211,237,255)}),W=new U({color:T(253,145,178,255)}),Y=new U({color:T(20,211,237,255)}),H=new U({color:T(239,68,121,255)}),X=new U({color:T(20,211,237,120)}),j=new U({color:T(239,68,121,180)}),$=new U({color:T(1,53,57,255)}),q=new U({color:T(94,19,42,255)}),J=[T(174,51,132,255),T(204,107,218,255),T(189,215,253,255)],K=[T(0,63,95,255),T(0,149,255,255),T(0,225,255,255),T(255,154,254,255),T(204,98,170,255),T(139,39,84,255)],Q=[T(197,241,255,255),T(70,210,255,255),T(0,164,217,255),T(90,99,222,255),T(138,75,192,255),T(151,27,162,255)],tt=[T(13,31,52,255),T(129,54,130,255),T(131,108,176,255),T(7,162,213,255),T(26,247,255,255)],it=new Z({stops:[{color:T(219,42,235,60),offset:0},{color:T(237,73,252,10),offset:1}]}),st=new U({color:T(237,73,252,255)}),nt=X.getColor().setA(255),rt=T(8,70,100);return Yf({isDark:s,highlightColorOffset:T(60,60,60,60),highlightColorOffsetAxisOverlay:T(255,255,255,40),effect:n,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new Xr({source:Hf(t,"themes/cyberSpace.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:r,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:a,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:h,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:p,axisGridMajorFillStyle:y,axisTickMinorFillStyle:A,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:E,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:C,uiBackgroundBorderColor:D,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:_,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:z,dataStrokeColorContrastLow:P,dataColorPalette:R,dataColorPaletteInverted:[{area:T(41,130,255,100),border:T(45,110,240)}],dataHighlightOverlayColor:V,dataColorPositive:B,dataColorNegative:O,zoomBandChartDefocusOverlayFillStyle:new U({color:T(0,0,0,180)}),zoomBandChartSplitterColor:w("#DB77FF"),zoomBandChartKnobFillStyle:t=>new Xr({source:Hf(t,"zoomBandChart/cyberspace-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:W,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:q,badGoodColorPalette:J,coldHotColorPalette:K,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:rt})})),ig={};Object.defineProperty(ig,"darkGold",{get:Kf,enumerable:!0}),Object.defineProperty(ig,"turquoiseHexagon",{get:Zf,enumerable:!0}),Object.defineProperty(ig,"light",{get:Qf,enumerable:!0}),Object.defineProperty(ig,"lightNature",{get:tg,enumerable:!0}),Object.defineProperty(ig,"cyberSpace",{get:eg,enumerable:!0});const sg=ig,ng=sg.darkGold,rg=(t,i)=>{i=i||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAgCAYAAADwkoGKAAAsa2NhQlgAACxranVtYgAAAB5qdW1kYzJwYQARABCAAACqADibcQNjMnBhAAAALEVqdW1iAAAAR2p1bWRjMm1hABEAEIAAAKoAOJtxA3Vybjp1dWlkOjlmZDBkZjkzLTVmMDMtNDczYi1hZThhLTFhNDM4NmMzNmJhYQAAAAGzanVtYgAAAClqdW1kYzJhcwARABCAAACqADibcQNjMnBhLmFzc2VydGlvbnMAAAAA12p1bWIAAAAmanVtZGNib3IAEQAQgAAAqgA4m3EDYzJwYS5hY3Rpb25zAAAAAKljYm9yoWdhY3Rpb25zgaNmYWN0aW9ua2MycGEuZWRpdGVkbXNvZnR3YXJlQWdlbnRtQWRvYmUgRmlyZWZseXFkaWdpdGFsU291cmNlVHlwZXhTaHR0cDovL2N2LmlwdGMub3JnL25ld3Njb2Rlcy9kaWdpdGFsc291cmNldHlwZS9jb21wb3NpdGVXaXRoVHJhaW5lZEFsZ29yaXRobWljTWVkaWEAAACranVtYgAAAChqdW1kY2JvcgARABCAAACqADibcQNjMnBhLmhhc2guZGF0YQAAAAB7Y2JvcqVqZXhjbHVzaW9uc4GiZXN0YXJ0GCFmbGVuZ3RoGSx3ZG5hbWVuanVtYmYgbWFuaWZlc3RjYWxnZnNoYTI1NmRoYXNoWCBvErgv+J0u7bVCYViyMUgw5yMb8idAv1erA3/DALx9NWNwYWRIAAAAAAAAAAAAAAIDanVtYgAAACRqdW1kYzJjbAARABCAAACqADibcQNjMnBhLmNsYWltAAAAAddjYm9yqGhkYzp0aXRsZW9HZW5lcmF0ZWQgaW1hZ2VpZGM6Zm9ybWF0aWltYWdlL3BuZ2ppbnN0YW5jZUlEeCh4bXAuaWlkOjI3NEMxQjdDN0E0MDExRUVBQkZFQUNFQjJDOTA0NzVCb2NsYWltX2dlbmVyYXRvcng2QWRvYmVfUGhvdG9zaG9wLzI1LjIuMCBhZG9iZV9jMnBhLzAuNy42IGMycGEtcnMvMC4yNS4ydGNsYWltX2dlbmVyYXRvcl9pbmZvgb9kbmFtZW9BZG9iZSBQaG90b3Nob3BndmVyc2lvbmYyNS4yLjD/aXNpZ25hdHVyZXgZc2VsZiNqdW1iZj1jMnBhLnNpZ25hdHVyZWphc3NlcnRpb25zgqJjdXJseCdzZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmFjdGlvbnNkaGFzaFggSmnBvf+o3kEweL4k7cz4MTrB0WSVNFZxoA1rBrM31K+iY3VybHgpc2VsZiNqdW1iZj1jMnBhLmFzc2VydGlvbnMvYzJwYS5oYXNoLmRhdGFkaGFzaFggL2g6Dghd536quyA5vPlS/9NGA5WvLRkkKJmqn0VxCoFjYWxnZnNoYTI1NgAAKEBqdW1iAAAAKGp1bWRjMmNzABEAEIAAAKoAOJtxA2MycGEuc2lnbmF0dXJlAAAAKBBjYm9y0oREoQE4JKNmc2lnVHN0oWl0c3RUb2tlbnOBoWN2YWxZDjYwgg4yMAMCAQAwgg4pBgkqhkiG9w0BBwKggg4aMIIOFgIBAzEPMA0GCWCGSAFlAwQCAQUAMIGCBgsqhkiG9w0BCRABBKBzBHEwbwIBAQYJYIZIAYb9bAcBMDEwDQYJYIZIAWUDBAIBBQAEIHj4VpJDPzaO0x4hOPnj/w1GTHuwXU0IpBf4VVocIQzoAhB3SsxvHza2JR1fKj3Mjr0yGA8yMDIzMTEwMzExNTcyNloCCQCyOL6wAOGCbaCCC70wggUHMIIC76ADAgECAhAFHp6R1x6RCrvkPVzt0N3ZMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwgSW5jLjE7MDkGA1UEAxMyRGlnaUNlcnQgVHJ1c3RlZCBHNCBSU0E0MDk2IFNIQTI1NiBUaW1lU3RhbXBpbmcgQ0EwHhcNMjMwOTA4MDAwMDAwWhcNMzQxMjA3MjM1OTU5WjBYMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xMDAuBgNVBAMTJ0RpZ2lDZXJ0IEFkb2JlIEFBVEwgVGltZXN0YW1wIFJlc3BvbmRlcjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABE0srlH5A/+15/MFl1asNh8Q8TubOsEVfu0qlJrF0smjtwL1IeHZ/AB7J59u1Trpho1BDN85lfTY30rNBsfT+myjggGLMIIBhzAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADAWBgNVHSUBAf8EDDAKBggrBgEFBQcDCDAgBgNVHSAEGTAXMAgGBmeBDAEEAjALBglghkgBhv1sBwEwHwYDVR0jBBgwFoAUuhbZbU2FL3MpdpovdYxqII+eyG8wHQYDVR0OBBYEFLA1qlbDIamLztO4vIsWJVed7zThMFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNFJTQTQwOTZTSEEyNTZUaW1lU3RhbXBpbmdDQS5jcmwwgZAGCCsGAQUFBwEBBIGDMIGAMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wWAYIKwYBBQUHMAKGTGh0dHA6Ly9jYWNlcnRzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNFJTQTQwOTZTSEEyNTZUaW1lU3RhbXBpbmdDQS5jcnQwDQYJKoZIhvcNAQELBQADggIBAHgrjELHhBCEWJSCyRX7lsL0C9LJgbX1ryVYySNRxHkMR2LqC7PQZRJgDNR+kJop8P5v2Bzp/jMrzw4U4pY6rYv3I8HpFlJa4uBwUTIUgHWpi8Xxd1JEEX94POODi7HySekX60A055BozFb7GGVaxb0LreQTRXnkr6ggPNUPX9Gh+2ScOxlTdQQLgZbkdYvxo3Ap6cy9riZijRxOZqiOyWSxMUhgKxeKzwrFW6Xbe0awNhOUXZzIxc4ixpKzWSItpPJ30ZiBQn49U3ADYTnshbN9ZkTA1pHf/Nov2ZUvvddkZ8UYvwo9vBvLTDvnmABnRMBKaXYAs3ZCvw9CkDPOWTeUJMFRAtmUx52ohaA3nD8bCJ6UfpQ2pFfOdShwpb6GKv0g+BgcdIG2LHPJ0Ufmr+XmpgZgq/HIge0hjcCADpjDgq2z4B0L4xtAA1M8MrUx02hxb7104nFKqMuv5zJTQl3sgwqXUyP+9zHQP9y/Z5Fx/AQWrOXCW56dV7P4cFBJl8zHqinlhkOStZ1m22+9Hlq+eC0hJ2lkF1LuzRdJJb/51LXoPKRnopFDng6XpoD7eG6w4YpAx9+P00JuUoBsYSrdsuFiyWyQQGBAnjI69ggbSLcW+hJytuinaxawVlItJkS2eV5Z4XsxPg7f82uRkdtN0hTHeI93CN3OWeRebnK7MIIGrjCCBJagAwIBAgIQBzY3tyRUfNhHrP0oZipeWzANBgkqhkiG9w0BAQsFADBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwHhcNMjIwMzIzMDAwMDAwWhcNMzcwMzIyMjM1OTU5WjBjMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xOzA5BgNVBAMTMkRpZ2lDZXJ0IFRydXN0ZWQgRzQgUlNBNDA5NiBTSEEyNTYgVGltZVN0YW1waW5nIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxoY1BkmzwT1ySVFVxyUDxPKRN6mXUaHW0oPRnkyibaCwzIP5WvYRoUQVQl+kiPNo+n3znIkLf50fng8zH1ATCyZzlm34V6gCff1DtITaEfFzsbPuK4CEiiIY3+vaPcQXf6sZKz5C3GeO6lE98NZW1OcoLevTsbV15x8GZY2UKdPZ7Gnf2ZCHRgB720RBidx8ald68Dd5n12sy+iEZLRS8nZH92GDGd1ftFQLIWhuNyG7QKxfst5Kfc71ORJn7w6lY2zkpsUdzTYNXNXmG6jBZHRAp8ByxbpOH7G1WE15/tePc5OsLDnipUjW8LAxE6lXKZYnLvWHpo9OdhVVJnCYJn+gGkcgQ+NDY4B7dW4nJZCYOjgRs/b2nuY7W+yB3iIU2YIqx5K/oN7jPqJz+ucfWmyU8lKVEStYdEAoq3NDzt9KoRxrOMUp88qqlnNCaJ+2RrOdOqPVA+C/8KI8ykLcGEh/FDTP0kyr75s9/g64ZCr6dSgkQe1CvwWcZklSUPRR8zZJTYsg0ixXNXkrqPNFYLwjjVj33GHek/45wPmyMKVM1+mYSlg+0wOI/rOP015LdhJRk8mMDDtbiiKowSYI+RQQEgN9XyO7ZONj4KbhPvbCdLI/Hgl27KtdRnXiYKNYCQEoAA6EVO7O6V3IXjASvUaetdN2udIOa5kM0jO0zbECAwEAAaOCAV0wggFZMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFLoW2W1NhS9zKXaaL3WMaiCPnshvMB8GA1UdIwQYMBaAFOzX44LScV1kTN8uZz/nupiuHA9PMA4GA1UdDwEB/wQEAwIBhjATBgNVHSUEDDAKBggrBgEFBQcDCDB3BggrBgEFBQcBAQRrMGkwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBBBggrBgEFBQcwAoY1aHR0cDovL2NhY2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZFJvb3RHNC5jcnQwQwYDVR0fBDwwOjA4oDagNIYyaHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZFJvb3RHNC5jcmwwIAYDVR0gBBkwFzAIBgZngQwBBAIwCwYJYIZIAYb9bAcBMA0GCSqGSIb3DQEBCwUAA4ICAQB9WY7Ak7ZvmKlEIgF+ZtbYIULhsBguEE0TzzBTzr8Y+8dQXeJLKftwig2qKWn8acHPHQfpPmDI2AvlXFvXbYf6hCAlNDFnzbYSlm/EUExiHQwIgqgWvalWzxVzjQEiJc6VaT9Hd/tydBTX/6tPiix6q4XNQ1/tYLaqT5Fmniye4Iqs5f2MvGQmh2ySvZ180HAKfO+ovHVPulr3qRCyXen/KFSJ8NWKcXZl2szwcqMj+sAngkSumScbqyQeJsG33irr9p6xeZmBo1aGqwpFyd/EjaDnmPv7pp1yr8THwcFqcdnGE4AJxLafzYeHJLtPo0m5d2aR8XKc6UsCUqc3fpNTrDsdCEkPlM05et3/JWOZJyw9P2un8WbDQc1PtkCbISFA0LcTJM3cHXg65J6t5TRxktcma+Q4c6umAU+9Pzt4rUyt+8SVe+0KXzM5h0F4ejjpnOHdI/0dKNPH+ejxmF/7K9h+8kaddSweJywm228Vex4Ziza4k9Tm8heZWcpw8De/mADfIBZPJ/tgZxahZrrdVcA6KYawmKAr7ZVBtzrVFZgxtGIJDwq9gdkT/r+k0fNX2bwE+oLeMt8EifAAzV3C+dAjfwAL5HYCJtnwZXZCpimHCUcr5n8apIUP/JiW9lVUKx+A+sDyDivl1vupL0QVSucTDh3bNzgaoSv27dZ8/DGCAbgwggG0AgEBMHcwYzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJbmMuMTswOQYDVQQDEzJEaWdpQ2VydCBUcnVzdGVkIEc0IFJTQTQwOTYgU0hBMjU2IFRpbWVTdGFtcGluZyBDQQIQBR6ekdcekQq75D1c7dDd2TANBglghkgBZQMEAgEFAKCB0TAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwHAYJKoZIhvcNAQkFMQ8XDTIzMTEwMzExNTcyNlowKwYLKoZIhvcNAQkQAgwxHDAaMBgwFgQU2Rq5M/4XremCHqYT9aQ6cU4+fn0wLwYJKoZIhvcNAQkEMSIEIGmY+GsCefCDmP0PFcYjdxBUfi0EgKYuEZb9pUMyLNuVMDcGCyqGSIb3DQEJEAIvMSgwJjAkMCIEIILa8ZSVezaEAkWP1ScAaf5ixxRW+p4Lhqv4J+hTICfZMAoGCCqGSM49BAMCBEcwRQIgcxxuf7QHV9Fkpj1VhPrFqhNFh8dZzl8qUU/2N3Sr4eoCIQDKu0KGYL++CSsDAXjJciMDbr5ImTy3jw0yQU5GYYeLimd4NWNoYWluglkGMzCCBi8wggQXoAMCAQICEBtbCzvasORd8vMNnlTR2tIwDQYJKoZIhvcNAQELBQAwdTELMAkGA1UEBhMCVVMxIzAhBgNVBAoTGkFkb2JlIFN5c3RlbXMgSW5jb3Jwb3JhdGVkMR0wGwYDVQQLExRBZG9iZSBUcnVzdCBTZXJ2aWNlczEiMCAGA1UEAxMZQWRvYmUgUHJvZHVjdCBTZXJ2aWNlcyBHMzAeFw0yMzAyMDEwMDAwMDBaFw0yNDAyMDEyMzU5NTlaMIGhMREwDwYDVQQDDAhjYWktcHJvZDEcMBoGA1UECwwTQ29udGVudCBDcmVkZW50aWFsczETMBEGA1UECgwKQWRvYmUgSW5jLjERMA8GA1UEBwwIU2FuIEpvc2UxEzARBgNVBAgMCkNhbGlmb3JuaWExCzAJBgNVBAYTAlVTMSQwIgYJKoZIhvcNAQkBFhVncnAtY2FpLW9wc0BhZG9iZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDv0wCnfYY9lkHDsykrTG7FYlnYHBcyualuD5u9ULjzv+FsTWOLg8Nhrz9RTxI9EeBbu3Wm7f4vqPsQYfxkEp0wIa6DVmEOZhbAeRfbhybWQ/D4Wvvck4mEZR+QZmTpIn7HX61gbtMFHlJUxkYBctIoAt9TBAFbz9d5Ig2WG0bsH39b6/8USXnIIk4FB6dtBRT1xeEwSDtwOd1YBpXXNBJmRWHXNJZZ85of2tBTesg/kMvTrOJJxYDZ97U416wcvbVomlees+NXUY3/ZB4xH+NsZils7m1bL2v2hSnHiLoqZeUKklbHUmT4ZpjrZCdtuIsWm5j2PPXKr7HKUuCbZSXBAgMBAAWjggGMMIIBiDAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAeBgNVHSUEFzAVBgkqhkiG9y8BAQwGCCsGAQUFBwMEMIGOBgNVHSAEgYYwgYMwgYAGCSqGSIb3LwECAzBzMHEGCCsGAQUFBwICMGUMY1lvdSBhcmUgbm90IHBlcm1pdHRlZCB0byB1c2UgdGhpcyBMaWNlbnNlIENlcnRpZmljYXRlIGV4Y2VwdCBhcyBwZXJtaXR0ZWQgYnkgdGhlIGxpY2Vuc2UgYWdyZWVtZW50LjBdBgNVHR8EVjBUMFKgUKBOhkxodHRwOi8vcGtpLWNybC5zeW1hdXRoLmNvbS9jYV83YTVjM2EwYzczMTE3NDA2YWRkMTkzMTJiYzFiYzIzZi9MYXRlc3RDUkwuY3JsMDcGCCsGAQUFBwEBBCswKTAnBggrBgEFBQcwAYYbaHR0cDovL3BraS1vY3NwLnN5bWF1dGguY29tMB8GA1UdIwQYMBaAFFcpejJNzP7kNU7AHyRzznNTq99qMA0GCSqGSIb3DQEBCwUAA4ICAQBXjlGa3yAK/Gijn6n/JNU9FZm72MP6vc5czrWe9y0T+EawuRvhpD5Edi1TnXkrpe8sMkgSjTGdbY+yGhq8zlCWQeXN1/aWo3L9Xr1uNxY/oVpLn0uWWfnfJ7yR9gKl/yoMfhjydT4t1fXHi/MhfhrWSVRHqX2U31UFGz/e298P2kv+vqhzpIUo1bj+jibtoPLMMQcCOTtKiJOTh4o3VSZpwQDERCzo91NkF+LnZjwYl6fE5USIkg/oCoomXxSPpowybDrcRJ9ilbtJcER48/LGgwzv/c7OYdron4PnEXm1FkOaVj+QRf7OwiNTizonhIzLR5Vfp0QHOWv/bPzvCjPQd+Xr0Q4032WlSxQwostNTAPtoVAU4OCwVH3Ech38emJ00/6fkDCdr7MN8/4n2LSNrMUvaBEZdmLqDCBnO02dbFrmpg3pTc0FqRQ4GL/88pjRNSMy5tU9SoQnSCGYqIsjfL8AzgPEGiXXRgABYc1uXecf4/eayb3K2MPs7hnWTbUKpHHJIwxpdN3vTGdZNWpz9Oxfuo3eELQlkTvACHgqkaXi/FAanHe5PChn6fr1/4cNF8goD0buPApgS3zzwqjRhxrH8ISwPfJn8JqzurMaLDMnnc18tHzUiMtX73jf6oXh7voCxX/T4D3nFPlxU3om2cpcLQ1Wd4026x18rlSGR1kGpTCCBqEwggSJoAMCAQICEAyotlR7iebSBol1zYubieIwDQYJKoZIhvcNAQELBQAwbDELMAkGA1UEBhMCVVMxIzAhBgNVBAoTGkFkb2JlIFN5c3RlbXMgSW5jb3Jwb3JhdGVkMR0wGwYDVQQLExRBZG9iZSBUcnVzdCBTZXJ2aWNlczEZMBcGA1UEAxMQQWRvYmUgUm9vdCBDQSBHMjAeFw0xNjExMjkwMDAwMDBaFw00MTExMjgyMzU5NTlaMHUxCzAJBgNVBAYTAlVTMSMwIQYDVQQKExpBZG9iZSBTeXN0ZW1zIEluY29ycG9yYXRlZDEdMBsGA1UECxMUQWRvYmUgVHJ1c3QgU2VydmljZXMxIjAgBgNVBAMTGUFkb2JlIFByb2R1Y3QgU2VydmljZXMgRzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC3Hy69vQmzXEhs/gyDrmwB6lF4JaSAPomnsbKIZNr2iXaB+fkd85X8eJiNmI7P5O4cVT4Nc1p3zrESqBV4ZUyW8gcZ78QdwoHG8QNd2VNcHnMgSR+XT9Iafsnq9Nfww3Jt9KL3l5ANQ5n1+MJqr48EWNLll942bOL/JH4ywDSMoqhZqtJEIUUUGlQVBZ8CAvJc7LE6ddA5C52PE2Ppa7RfQgHXf4gfXVZwpxYRZcziPiOHqEvLb0J3cShUbejFxV6cwX8QyAPa1ePHg1RtM0HX+D34xHo3DkyGnmT+Ddq00TEDGG26AL5PdINKFIQl+zaq6KJFQe1fdGE5wrWzU4mBPmzaz3EbLn+7FWlwAhorYqIMldbfHE3ydc+aTU1JW7+bG19qmvhO9IluGtTtQDeqFBj2fg6faxsfVfVPD7stN6TwoIDlkOCE4RE+Iin8m3z3eqi/VsTmsmRqBxWDRaqOHz02EJoEDxXJG3ei+UbIIp01XZQvdufm90WxOTuqqan2ZqTPX9K5VdjEh/ovr7xFc5q1dZo+Sa5y4sTVM854/tLU3klOgUKzzSXYPYS3GhBcYJHjwr9xNRHnNX99D6F0g7OijScWfvtjxh13aTv/H0ETvymah4yfDpVdh9cK5YSCPqnuOlsujFAyhYwJXOWDvZZU2EkWVLDhoPx9zp7N4QIDAQABo4IBNDCCATAwEgYDVR0TAQH/BAgwBgEB/wIBADA1BgNVHR8ELjAsMCqgKKAmhiRodHRwOi8vY3JsLmFkb2JlLmNvbS9hZG9iZXJvb3RnMi5jcmwwDgYDVR0PAQH/BAQDAgEGMBQGA1UdJQQNMAsGCSqGSIb3LwEBBzBXBgNVHSAEUDBOMEwGCSqGSIb3LwECAzA/MD0GCCsGAQUFBwIBFjFodHRwczovL3d3dy5hZG9iZS5jb20vbWlzYy9wa2kvcHJvZF9zdmNlX2Nwcy5odG1sMCQGA1UdEQQdMBukGTAXMRUwEwYDVQQDEwxTWU1DLTQwOTYtMzMwHQYDVR0OBBYEFFcpejJNzP7kNU7AHyRzznNTq99qMB8GA1UdIwQYMBaAFKYc4W1UJEyoj0hyv26pjNXk7DHUMA0GCSqGSIb3DQEBCwUAA4ICAQBxzuUHjKbcLdzI4DtlXgCSgZXrlSAkr59pOF3JfPG42qVNAGU7JcEYXJ6+WbfcGwY7WYMl+jO7IvJPb7shXFYW9bnJgxX7lLU14KExchmcLNY1ee6IhBJ2Y8PzZMRUKSd5CkURPg0PBLGjz/KR/DofHx+G4rPTCOGORYxeYrd01lci5hVxvKccvIk7MD69ZTewfZPSM+0WnsU3f0Zmd7hgbRpUyWceG0eHFpdUKK/ZFWhHjDVC28odCnN885tHncKXviItK0ZUUo/AIthFKlhEXsnq9VL9fFbgvO83ZvpUQo5y8mY3cuGnEVGXdhjNb53CfC1u4dbpYmWaN99subUzEsUaUb3loLPfVfzDOpg2y9v37kBdy/wuXr20teY7U62xj/fAgs1QSnhUtlMTfCqbefyEycKVmKIrJkJLsvgTSYKVvH4FFIwfd5WjqOC97jX98rcVAzhAI0iSkazsWOMvL6m0L4nLJapx+85GsVX8Y6AHmEP4bmCElwil6KAP+UewJFiw5rmwV2pESHAhYuZJa03B8tl0nd2QJzvJGmbeBqXqpF9ORinFM3HErK8puRokOjFH2+1asLeI2tB31W/ELdNe27Ogduq6Z6qBwCp59YX27qydDhD0WRfN64kCs25K88iGAGNW2CAfTDS+b+WYJBiIL9jXYZ4LF+BiUvfdu2NwYWRZC70AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZZAQBKX2Q2ihN2fLDLReHISpfOF0xIqNpOZXbBwZ0XanWG98erbIBdawl7r9nVma/uZjYH457wp00TVpKYUTJHMnzJMKskvM2Df4K6t5pUKGtJqEvMXLUy3g9kJq53aYDwikcUE+8wv+CYtu/+vii4XYSXQIxT4NN+JKoTDXmrNH1G46Nmpfq6SKk0g9GQ2brbkW3fzGR0xDxY3BXRy71guSBxN9TAbQGqUjMnkIyBcwV9wUQ2oCW9oIMNKASjW0CRkcFEzzmrQ+y+zHYpNvUaG7QehHcyhvOec3plzlyP6DZeQWp3PHA5bmonI8t5j6Qj15X1KnQiXuJ0rW+xoMA89aIVmpx4VgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAOSaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMSA3OS4xNDYyODk5Nzc3LCAyMDIzLzA2LzI1LTIzOjU3OjE0ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjYyYTdmYWExLWJmZTMtMjE0Ny04MjAwLWMxM2NlMGU4ZTc1NCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyNzRDMUI3RDdBNDAxMUVFQUJGRUFDRUIyQzkwNDc1QiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyNzRDMUI3QzdBNDAxMUVFQUJGRUFDRUIyQzkwNDc1QiIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuMiAoMjAyMzEwMjQubS4yMzc0IDRhYjk0MzkpICAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDphYjQzZjNjYy1hNTY4LTRkNGQtOTdiZC1iYjk0YjBlZjhjYmQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NjJhN2ZhYTEtYmZlMy0yMTQ3LTgyMDAtYzEzY2UwZThlNzU0Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+HNvo5wAADZFJREFUeNrsXFtPVUkW3gc4yP0qDigKON517FFbHRGn1TamjaOJvvhsjIkvPplgfEKe1AefNDE+GP+AmWTszPTYcbpn2piJzc1GWwlOekRBEBFQ7jeZ9ZVrnVkUtfc5CGp3h5VU9qUuu3bVV9+67DonND4+7omEQiHPJaWlpYlxcXGLKX8epTCdB5aXNnHU6c2bN5POcaREp+O9dHxSX1/f5s3KL1ImYCkasMrKyvIISJspD+AyZSTpOrodDSaIBpQCkwtgSM8oVd2/f39M2quoqAijmcrKyjG/l7L77vde+v6sfCRgbdu2LY3AtJNSgg0qDa5oTOViKQtM9nXTgQMHaqmpPEoLKXUQqJpcYIqPj/cSEhLMUZgUbYyNjZkjRPpu50n+VEUvKtditMEb7Xom5OrVqzvpkOXIukFps5XXTunO4cOHR7heKp1/ye1gEX9BCcdv6H4330cbCyh9iXrRgJUQ1FmarFWUIqDS4ApiCT9AobxMpj24uI/209LSvMLCwiLKz6fyQModAlW73TeAac6cOV5SUpIBlasv9qKRvgBYIyMj3tDQkDmPdaLRPzwrHA6bhGsNWr9xsMfEZnC7XDSg+tzv4lRCCRPfjJtHjhzpu3LlCkDVx4BKZICsx9gy4PT4rmFQQbIpdfM5ynX7gWrS/Phl7NixI0SDWCCD52Is14vqAXIByoluAkl+fr43f/58Lyvr7cIaHh4OJSYmfkug6rXZApOamprqUb6vned3X4CBujj29/cbkEl/7EUj74o+og4S2gh6xkypk6mUPXnyZN25c+fCDKzm8vLyOuQzqCAtJ06cuH/+/PkwAytMLCR57VjQFy5cmKeAiXJZGOeLFy/iPBVt4Nqeb60dogKLBm9O/FvxXIwVxBAaUBpgixYt8np7e7329vYJZUtKSkwSefHihVdTU9N2586dXrtfmNj09HQz0dMRvAsYD0dhLryrvG8s7/w+ZCrPcJSdx8duAb+6l0WgWqeu/8uMZMoDWCTr+BpMVoZ8jLUq18XXgdohEFg0cXF6kF2s5Uf9NqBwxL0FCxaYSXz58qWZSNzr6+vzioqKIm01NTV5ZLgbT9HuExgGAzBdUOmJEeb6EKD5AJKt1KJ9TwAFNrpz6tSpljNnzgiQuuh8DbNSNx9HlF0mx26/cbTHLy6AsSKGcVCyjWepJwnS2trqbdiwwZyDJaDyUBbslZmZGTG6Hz9+7D18+NDdUSqTkpIyY6B6V5b4mYsBAIGm27rXR/f+DFXGKm5Ega6P7a5lqvw6sbMIcFkKlCUAI6esQI0QBCwBjxirNqCkDACSkZFhQKLVCSassbHR27Jli6kvsnDhQnN8/vy5t3Hjxsj95ubmSQ6CVoEA5a8IBO+LsSKgoskPKxaC1DKo1mmDXF1/AwAyCO+rNoX1FrANVqLA6V6sfuGGgwcPphBovrCBIuwCgRp7+vSpAUd2dra5bmtrM6pvdHTUu3fvnrGdNHhEbt265XV1dXn79+9/y8V0XltbGwkDkKpsqqqqqhG2AmgBrFn5+Qo0Uyw21gRm0kwCLwqAAgC2b99u2AQCVYWyACtUGkRUoC2bNm0yYBIBe/l5ncKaWmg1hrj/47TCRu32ebUam4LyAweEymK1QG+PUdk3PmXCrGZicrej9e99CD0znvs4NsPtRh2fmMMNLmBBYHgDmTC4ly1bNslWAbhu375tyh06dGgCw2kB+yDEAIEh39HR4RsjE+/NkgJKf0DwlNJ3jkndi2Yo/QXOZ5RxWElpOaUqSk99QLWPErzUr2OcD+j7T+GPUKqZocldyu2mWWbMv1mt4T3q2OObSVnNz46MD49xMfelE85ArOGGiA2FSR0cHDRggVe3fv16Lzc317cXCBeUlZUZu8sVBLUF7YrnaDMWygsjWpLJx1eOvCS8LKX+GFeYdPS1T356wLOC7NcOK/g4HSbaSmku2zZtlo0D6l8U5R2mIxmO91/F79iP8aY+lmhAR2Us09PXr439hAles2ZNoK2Tl5dnwgorV66clHfz5k1v165dk8CFuJYfWwm4/Twgn4FMZqO0U00OPg/lsgck0k3Ae6JACq8HamsAJgPl9fOAzef8VLpey1HtVGXUQoZ45b7QawzgojqpauJNZIYnpEXUFpWZw8ZxMqsdEdgUixlUqPMt1RlygE8mv4jO5/M7tFHZXs4HI+uJG4YFQvldnF+sAPRGjd8SSjl8fzGVG6I6Dxk76GcKl8uOlbESh4eHDVOBpWCcQ/1F88qQv2fPnknlnjx5YsIJOBYXF/9/NqhtANcV8ZbYlc8zswJYJJ8H5Eem7A3WxEYmjdVcigycyltBeV/RsVANbDKDrJnL5jom+Dsa+A5e0WDOn7g/Kx3PR/06qpPDjBS28gG6e6pfDT6gimeV5LF6iqh4focxHo84Ne8hzv8ng2sJA6tfjUedROkZbPkqRhbie8JauTEBi7y6ePncAQaaO3fulKLaWgDQgYEBoxrh+WlgiW3l9znFNtp5IBN5kv0YS6vJYgYVVlU120mfUPot58sqbeaBxJh8zqs7TIN+i573R2aMfykGQD2w21dcfx2DMI3yXjOosLqH6Fr6U8VqDHGhzVw2ns8T2BaTWNMefrc09a7PA1R1iNuuYibZwfXmUB8Qq/qrZa9tZjs1i65fcRswHf5O1zuYgZ7yeG1jdq3SbM9gauFF8yimOBYABaN66dKlUwKVS0TVQT2+evVqgjcIYAWxXxQ12O/jcWUq0MlqvwtQsIeo8zOUWoQHOcCTNMbqQsqPcTARE5PCk/+a64woB6HPYf/JMzq57KgqW8AAaKa8Jn4fbfOlKe92wGeoMq13GFQqdwD95aDmZ5Q+Z9AJwwwoYL5Wn3vqHH2JCOU9pkMjg7jWMgH8GYtspVx8cIwW6QYDrV271rccgATGAkhgm8GTfPDggbd161YTWIUqdLGVnPt4lQKsQQebJTCVj7CNlO4YmAwFlCUaBAo0XVR/nK6T+RqTNh5g7GuwLrTyMxlMfY760r/eKI4J+hJSffA1rlm9o989DK5SLtOmnpOm+pCr6zNoojpJVK6HnxFbuKGiomI5u5hRQVVdXW0+0UjowGa97u6Jn5ewewExMIAN3mA0lepjX8nLgsYXMy2P8SAmWJM6zGoJhnkrr7BEBRwbJLYHJJ/zQ5gwZhx7IkMMkEFWfZF8BcxOFU9zAes33L9+yzERMKLP66nMM8V4HjNFpgPI0r9kft4AmwLjzE4wD0Z58S0OMCvk/RMDgB1zHGtZtIoIgopKe/TokRNYnZ2dzroAIsAFo93Vrq0OAxgLdPZ7TZBsLOtBAl2vZbvqE1VWT4JWM/YkDfJk4P4+GtxqR5l07otrYjMdk6Ydj24ebxjwO23CZ6A+YGegiJOn+vY3xcC9jncY5TwA7E92+zGEW/r5+CnbUjdijbXYbJXs8E6ck11aWmp2G+B7oC1Qc2AsP+AAVHqT3RR3Vd5nQ9dO93hw6ik95hX9H7jonF/PIQBjj7ARC9f5rhUTQrlWrt/L9e/y/XbOq1ce0ihfy0A85useZop6K2gJ8P8A0FACo/7De7tV5Qd4sgIa8QDp2IBoDTNOvU7Mlo1sQ44rwNSzwS3t19l14WWq/tb4qLW76rn3Yp2gSd8KCVjwWMqC1JP6nmei8Ddu3DBRdgmI4jshDHbkByVpQ5+rY9P3339fk5OT46m9RVMNLGLQf2cxdCGff62M3I8m1EcY73nqVg4nhBYe/FK+EwJH+E4cpAozgxoQlhEQwGNctWqVUW2rV6+OGOx++96jbcm193bJBrx3lBQV3NRu8o+xgCrWvervsoddWD8pKamQ40Py9QEM00htNrzrnvxY3yeW/kUTIRlbO7kYa4OlxyMsZG87loQ8Yhdv9+7dJkIPYGk28mOrFStWGOMeux+wdx0foq9fvx7Z3QDGgmeK9D63y8j74D2QpI+unZHTAZdsgJzKxE33vfQzowEuluC3q57eyx/EWBn2DQQ3MdDa9bd/xrV8+fLIpx8beH4/HigoKHgbKi4u9s6ePeuVl5cbYOkOIxwB0M30Bj+0DRDhy4LE7KSfszJ9SbAMd0+5vxEjG6EB+SWMRq3eepycnGwMdq0mfX7aNWHbsrAhovvXrl2bpCKRB2DDSZjuKpd2AVa0qX9EMSszK3GOmEWCjopLgBMJE4GEyZajVh8OA9zJXBpUOL98+bJ37Ngxr6WlRbPbuIABrILPS+8KAtRD/3t6ekzsTBbLLKg+HLC0GrxLkzCmAaWTDSptm0QDGf92cMKvdy5duuQdPXpU6+sB7TAAWFCzOI8VTCiLOoinIeaGNqbyO8JZmXlg3a2srPyJANQqQHIBTIPLBlYQc8GTxM5SAdHevXvNr3NgSylGe2Z7owAG2AZHcSbshHJgOJQDoCSeNgumj2hjMbAMqHBBE/IAv0imiU6AjSUGvN9Pv1z2lAtc2AiILTg4r6mpMfGP48ePew0NDdJGU21t7SuXaysAt3e26l85z7LSx5cJ4YbTp0/PJVBN2G6wb9++PJrAzdif5fpBhTaK/f70I1qygPeMrqvq6upi0nmuPyWZlY8XJPWNY7mEVJX5GyNK8yiFg34J7fM3RYEgIyCN09H8jVF1dfXs3xj9CoD1PwEGAKorJqR4atjIAAAAAElFTkSuQmCC";let s,n=150,r=32;const o=[],a=t.Ln((t=>{const i=new St.Image;i.src=t,i.onload=()=>{o.forEach((t=>{var s;const o=new Xr({source:i,fitMode:e.ImageFitMode.Stretch});null===(s=t.ed)||void 0===s||s.ke(o),n=i.width,r=i.height,l(t)}))}}));let h;if(new St.Image instanceof St.HTMLImageElement){const t=new St.Image;t.src=i,h=new Xr({source:t,fitMode:e.ImageFitMode.Stretch})}else if(St.lcjs_setup){const t=new St.Image;t.src=i;const s=St.lcjs_setup(t.naturalWidth,t.naturalHeight);s.getContext("2d").drawImage(t,0,0),h=new Xr({source:s,fitMode:e.ImageFitMode.Stretch})}else h=new U({color:w("#f00")});const l=t=>{if(t.ed){const e=t.dt.pi({x:t.dt.x.getInnerEnd(),y:t.dt.y.getInnerStart()},{x:-(3+n),y:3}),i=t.dt.pi({x:t.dt.x.getInnerEnd(),y:t.dt.y.getInnerStart()},{x:-3,y:3+r}),s={x:i.x-e.x,y:i.y-e.y};t.ed.Ie(e).q(s)}s&&s.bs()};return s=t.nI("logo",Number.MAX_SAFE_INTEGER),i=>{const n={dt:i};return(i=>{i.ed&&i.ed.dispose(),s&&(i.ed=s.Te(i.dt).ke(h).setMouseInteractions(!0).Ce(nt).setMouseEnterEventHandler((()=>{t.Er(e.MouseStyles.Point)})).setMouseLeaveEventHandler((()=>{t.Er(e.MouseStyles.None)})).setMouseClickEventHandler(og).setTouchEndEventHandler(og),l(i))})(n),o.push(n),{Ds:()=>l(n),W:()=>(e=>{e.ed&&(e.ed.dispose(),e.ed=void 0);const i=o.indexOf(e);i>=0&&o.splice(i,1),o.length<=0&&t.Rn(a)})(n)}}},og=()=>St.open("https://lightningchart.com/lightningchart-js/");class ag{constructor(){this.SL=this.UI.bind(this),St.addEventListener("scroll",this.SL,{passive:!0})}W(){this.SL&&St.removeEventListener("scroll",this.SL),this.SL=void 0}}class hg{constructor(t,e){this.Pa=t,this.X=e,this.vL=!0,this.xL=null,this.bL=null}}class lg{constructor(t){this.ML=!1,this._L=1,this.wL=t,this.CL={Pa:u(0,0),X:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),vL:!0,xL:null,bL:null},this.kL=u(64,64),this.TL=new Uint8ClampedArray(this.kL.x*this.kL.y*this._L)}FL(t,e){if(!t.vL)return null;if(t.xL&&t.bL){const i=this.FL(t.xL,e);return null!==i?i:this.FL(t.bL,e)}const i=c(t.X.x,t.X.y);if(t.Pa.x+t.X.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.kL.x-t.Pa.x-1),t.Pa.y+t.X.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.kL.y-t.Pa.y-1),t.X.x===e.x&&t.X.y===e.y)return t.vL=!1,t;if(i.xt.X.y)),a?(s=new hg(ni(t.Pa,{x:0,y:1}),u(t.X.x,e.y)),n=new hg(ni(t.Pa,{x:0,y:e.y+1}),u(t.X.x,t.X.y-1-e.y))):(s=new hg(ni(t.Pa,{x:1,y:0}),u(e.x,t.X.y)),n=new hg(ni(t.Pa,{x:e.x+1,y:0}),u(t.X.x-1-e.x,t.X.y))),t.xL=s,t.bL=n,this.FL(t.xL,e)}IL(t,e){const i={PL:!1,Pa:null};let s=this.FL(this.CL,e);if(null===s)for(;null===s&&this.kL.xthis.wL||t.y>this.wL)return!1;const e=new Uint8ClampedArray(t.x*t.y*this._L);for(let i=0;i{this.zL.WL(t)})),this.VL.clear(),this}UL(t,e){const i=this.EL.get(e);if(i)return i.get(t)}YL(t,e,i){let s=this.EL.get(e);if(s||(s=new Map,this.EL.set(e,s)),s.has(t.glyph))return cg.Success;const n=this.OL.IL(i,t.size);if(!n||!n.Pa)return cg.Fail;n.PL&&this.HL();const r=this.OL.LL(n.RL);if(!r)return cg.Fail;let o=this.VL.get(n.RL);if(!o){const t=this.zL.gl.createTexture();if(!t)throw new gt("Failed to create texture for font!");o=t,this.VL.set(n.RL,t)}const a=n.Pa,h=r.kL.x,l=r.kL.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=a.x/h,m=(a.y+t.size.y)/l,p=(a.x+t.size.x)/h,y=a.y/l,A=[g,m,p,m,g,y,g,y,p,m,p,y],x=[u,c,d,c,u,f,u,f,d,c,d,f],S={origin:a,size:t.size,advanceX:t.advance,baseline:t.baseline,vertices:x,texCoords:A,packerId:n.RL,texture:o};s.set(t.glyph,S);const b=this.zL.gl;return b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),b.bindTexture(b.TEXTURE_2D,o),b.texImage2D(b.TEXTURE_2D,0,b.LUMINANCE,r.kL.x,r.kL.y,0,b.LUMINANCE,b.UNSIGNED_BYTE,this.zL.$L?r.TL:new Uint8Array(r.TL)),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),b.bindTexture(b.TEXTURE_2D,null),n.PL?cg.Resize:cg.Success}HL(){this.EL.forEach((t=>{t.forEach(((e,i)=>{const s=this.OL.LL(e.packerId);if(!s)return;const n=e.origin,r=s.kL.x,o=s.kL.y,a=n.x/r,h=(n.y+e.size.y)/o,l=(n.x+e.size.x)/r,u=n.y/o,c=[a,h,l,h,a,u,a,u,l,h,l,u];e.texCoords=c,t.set(i,e)}))}))}}const gg=t=>{if(t instanceof Li||t instanceof mu)return t._i()?"linear-highPrecision":"linear";if(t instanceof zi){const e={};return t.x instanceof bi&&(e.x={base:t.x.gi()}),t.y instanceof bi&&(e.y={base:t.y.gi()}),["logarithmic",e]}return"linear"},mg=t=>{const e=Object.keys(t),i={};return e.forEach((e=>{const s=t[e];let n=!1;i[e]=t=>{if(!t)return n;const e=s();return n=e,e}})),i},pg=(t,e,i)=>"value"===t.getLookUpProperty()?i:"x"===t.getLookUpProperty()?{min:e.vt(),max:e.xt()}:"y"===t.getLookUpProperty()?{min:e.bt(),max:e.Mt()}:"z"===t.getLookUpProperty()?{min:e.Um(),max:e.Wm()}:void 0,yg=t=>!(!t||"value"!==t.lookUpProperty||!t.lut.percentageValues),Ag=t=>(e,i)=>i%2?e:e+t;class xg{constructor(t){this.XL=new Map,this.jL=le("font"),this.ZL=new Map,this.QL=new Set,this.zL=t}GL(t=!1){return(t||0===this.QL.size)&&(this.XL.forEach(((t,e)=>{t.GL(),this.XL.delete(e)})),this.QL.clear()),this}JL(t){this.QL.add(t)}KL(t){this.QL.delete(t)}qL(t,e,i,s){const n=`${s?"dark":"light"} - ${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let r=this.ZL.get(n);r||(r=this.jL(),this.XL.set(r,new fg(this.zL)),this.ZL.set(n,r));const o=this.XL.get(r);if(!o)throw new gt("Failed to get font texture!");let a=0,h=0,l=0;const u=t.split(""),c=e.size,d=.7*e.size,f=Math.round(1*e.size);let g=!1;for(let t=0;t{if(0===i||360===i||180===i||i%180==0)return{x:t,y:e};if(90===i||-90===i||(i+90)%180==0)return{x:e,y:t};const s=i*Math.PI/180,n=Math.cos(s),r=Math.sin(s);return{x:Math.abs(t*n)+Math.abs(e*r),y:Math.abs(t*r)+Math.abs(e*n)}})(l,h-a+1,i);return{x:m.x,y:m.y,isEstimate:g}}tR(t,e,i){const s=`${i?"dark":"light"} - ${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let n=this.ZL.get(s);n||(n=this.jL(),this.XL.set(n,new fg(this.zL)),this.ZL.set(s,n));const r=this.XL.get(n);if(!r)throw new gt("Failed to get font texture!");let o=0,a=0,h=0;const l=t.split(""),c=new Map;let d=0;const f=e.size;for(let t=0;t{t._a.o=!0})),t=-1,d=0,a=0,o=0,c.clear();continue}if(l===cg.Fail)throw new gt("Failed to create glyph");if(h=r.UL(s,f),!h)throw new gt("Failed to get glyph after creation")}if(""!==s.trim()){let t=c.get(h.texture);t||(t={vertices:[],texCoords:[]},c.set(h.texture,t)),t.vertices.push(...h.vertices.map(Ag(n))),t.texCoords.push(...h.texCoords),a=Math.max(a,h.baseline),o=Math.min(o,h.baseline-(h.size.y-1))}d+=h.advanceX}h=d;const g=m(u(0,o),u(h,a)),p=[];return c.forEach(((t,e)=>{p.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[p,g]}}class Sg{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>bg(t)));for(const i of e)t=i(t);return`${pe(this.modifiers.filter((t=>vg(t)))).map((t=>t.eR)).join("\n")}\n${t}`}}const bg=t=>"function"==typeof t,vg=t=>t&&"object"==typeof t&&"hR"in t,Mg=(...t)=>e=>{t=t.reverse();for(let i of t)"string"==typeof i&&(i=i.includes("{")||i.endsWith(";")?i:`${i};`,i=i.trim(),e=e.replace("void main(void)",`${i}\nvoid main(void)`));return e},Tg=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),wg=(...t)=>e=>{const i=t.filter((t=>!1!==t));for(let t=0;ti=>{for(let t=0;t{if(!r.includes(e))throw new Error(`ShaderBefore misusage (not found: \n${e}\nmatch: \n${t}\nresult: \n${r}\n)`)})),r},kg=(t,...e)=>i=>{const s=e.filter((t=>"string"==typeof t));for(let t=0;t{if(!l.includes(e))throw new Error(`ShaderAfter misusage (not found: "${e}", match: "${t}", result: "${l}")`)})),l},Cg=(...t)=>e=>{for(let i of t)if("string"==typeof i){i=i.endsWith(";")?i:`${i};`,i=i.trim(),i=i.startsWith("\t")?i:`\t${i}`;const t=e.lastIndexOf("}");e=`${e.substring(0,t-1)}\n${i}\n}`}return e},Dg=(t,e)=>i=>{let s,n;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Mg(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Mg(t)(i),n=e.split(" ")[2].replace(";","")}else n=e;return Cg(`\t${n} = ${s};`)(i)},Ig=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e},_g={roundUnsigned:{hR:"roundUnsigned",eR:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{hR:"linearStep",eR:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{hR:"decodeUbyteRGBAEncodedFloat",eR:"\n // Denormalize 8-bit color channels to integers in the range 0 to 255.\n ivec4 floatsToBytes(vec4 inputFloats, bool littleEndian) {\n ivec4 bytes = ivec4(inputFloats * 255.0);\n return (\n littleEndian\n ? bytes.abgr\n : bytes\n );\n }\n \n // Break the four bytes down into an array of 32 bits.\n void bytesToBits(const in ivec4 bytes, out bool bits[32]) {\n for (int channelIndex = 0; channelIndex < 4; ++channelIndex) {\n float acc = float(bytes[channelIndex]);\n for (int indexInByte = 7; indexInByte >= 0; --indexInByte) {\n float powerOfTwo = exp2(float(indexInByte));\n bool bit = acc >= powerOfTwo;\n bits[channelIndex * 8 + (7 - indexInByte)] = bit;\n acc = mod(acc, powerOfTwo);\n }\n }\n }\n \n // Compute the exponent of the 32-bit float.\n float getExponent(bool bits[32]) {\n const int startIndex = 1;\n const int bitStringLength = 8;\n const int endBeforeIndex = startIndex + bitStringLength;\n float acc = 0.0;\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n \n // Compute the mantissa of the 32-bit float.\n float getMantissa(bool bits[32], bool subnormal) {\n const int startIndex = 9;\n const int bitStringLength = 23;\n const int endBeforeIndex = startIndex + bitStringLength;\n // Leading/implicit/hidden bit convention:\n // If the number is not subnormal (with exponent 0), we add a leading 1 digit.\n float acc = float(!subnormal) * exp2(float(bitStringLength));\n int pow2 = bitStringLength - 1;\n for (int bitIndex = startIndex; bitIndex < endBeforeIndex; ++bitIndex) {\n acc += float(bits[bitIndex]) * exp2(float(pow2--));\n }\n return acc;\n }\n \n // Parse the float from its 32 bits.\n float bitsToFloat(bool bits[32]) {\n float signBit = float(bits[0]) * -2.0 + 1.0;\n float exponent = getExponent(bits);\n bool subnormal = abs(exponent - 0.0) < 0.01;\n float mantissa = getMantissa(bits, subnormal);\n float exponentBias = 127.0;\n return signBit * mantissa * exp2(exponent - exponentBias - 23.0);\n }\n \n // Decode a 32-bit float from the RGBA color channels of a texel.\n float decodeUbyteRGBAEncodedFloat(vec4 rgba, bool littleEndian) {\n ivec4 rgbaBytes = floatsToBytes(rgba, littleEndian);\n bool bits[32];\n bytesToBits(rgbaBytes, bits);\n return bitsToFloat(bits);\n }\n "},texelFetchWithFallback:{webgl2:{hR:"texelFetchWithFallback",eR:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{hR:"texelFetchWithFallback",eR:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (vec2(iTexel) * 2.0 + 1.0) * halfTexel);\n}"}},texelFetchUnsignedWithFallback:{webgl2:{hR:"texelFetchUnsignedWithFallback",eR:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{hR:"texelFetchUnsignedWithFallback",eR:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (vec2(iTexel) * 2.0 + 1.0) * halfTexel);\n}"}},modulus:{hR:"modulus",eR:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{hR:"computeScreenSpaceWireframe",eR:"#extension GL_OES_standard_derivatives : enable\nfloat computeScreenSpaceWireframe (vec3 barycentric, float lineWidth) {\n vec3 dist = fwidth(barycentric);\n vec3 smoothed = smoothstep(dist * ((lineWidth * 0.5) - 0.5), dist * ((lineWidth * 0.5) + 0.5), barycentric);\n return 1.0 - min(min(smoothed.x, smoothed.y), smoothed.z);\n}"}},Fg=(t,e)=>{const i=e.steps,s=i.length-1,n=[Mg("uniform vec4 uFallbackColor")],r=[],o=[];for(let t=0;t= uLUTValue${s}) {\n colorLookup = uLUTColor${s};\n }`,...i.slice(0,-1).map(((t,e)=>`if (value >= uLUTValue${e} && value <= uLUTValue${e+1}) { colorLookup = uLUTColor${e} + vec4(\n uLUTColor${e+1}[0] - uLUTColor${e}[0],\n uLUTColor${e+1}[1] - uLUTColor${e}[1],\n uLUTColor${e+1}[2] - uLUTColor${e}[2],\n uLUTColor${e+1}[3] - uLUTColor${e}[3]\n ) * (value - uLUTValue${e})/(uLUTValue${e+1} - uLUTValue${e});}`)),"vec4 colorFragment = colorLookup")):n.push(Eg("colorFragment","vec4 colorLookup = vec4(uLUTValue0)",`if (${t} <= -340282346638528859811704183484516925440.0) {\n colorLookup = uFallbackColor;\n }`,"float value = "+(e.percentageValues?`clamp((${t} - uMinValue) / (uMaxValue - uMinValue), 0.0, 1.0);`:`${t}`),`if (${t} >= uLUTValue${s}) { colorLookup = uLUTColor${s};}`,...i.slice(1).reverse().map((t=>{const e=i[i.indexOf(t)-1];return`if (value < uLUTValue${i.indexOf(t)}) { colorLookup = uLUTColor${i.indexOf(e)};}`})),"vec4 colorFragment = colorLookup")),n},Lg=[Mg("uniform sampler2D uMaskTexture"),Mg("varying vec2 vMaskTextureCoord"),kg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],zg=[Mg("varying vec3 vPosWorld;","varying vec3 vNormal;","uniform vec3 uCameraLoc;","uniform vec3 uLightLoc;","uniform vec4 uLightColor;","uniform vec4 uAmbientColor;","uniform float uShininess;","uniform float uAmbientReflection;","uniform float uDiffuseReflection;","uniform float uSpecularReflection;"),kg("colorFragment =","float ambientReflection = uAmbientReflection","float diffuseReflection = uDiffuseReflection","float specularReflection = uSpecularReflection","vec3 ambientColor = uAmbientColor.rgb","vec3 diffuseColor = colorFragment.rgb","vec3 specularColor = uLightColor.rgb","vec3 vNormalNormalized = normalize(vNormal)","vNormalNormalized = (float(gl_FrontFacing) * 2.0 - 1.0) * vNormalNormalized","vec3 lightDir = normalize( uLightLoc - vPosWorld )","float lambertian = abs(dot(vNormalNormalized, lightDir))","float specular = 0.0","vec3 R = reflect(-lightDir, vNormalNormalized)","vec3 V = normalize(uCameraLoc - vPosWorld)","float specAngle = max(dot(R,V),0.0)","specular = pow(specAngle, uShininess)","colorFragment = vec4(ambientReflection * ambientColor + diffuseReflection * lambertian * diffuseColor + specularReflection * specular * specularColor, colorFragment.a)")];class Pg extends Error{constructor(t,e,i){super(`Dynamic shader generation error\n(id: ${e})\n ${i?`when applying feature: ${i.idVertex?`vert: ${i.idVertex}`:""} ${i.idFragment?`frag: ${i.idFragment}`:""}`:""} | ${t}`)}}const Rg=(...t)=>{let e="";for(const i of t){if("object"!=typeof i){e+=`${String(i)},`;continue}const t=[{prefix:"",obj:i}];for(;t.length>0;){const{prefix:i,obj:s}=t.shift();e+=`${i}:`;const n=Object.keys(s).sort();for(const i of n){const n=s[i];"object"==typeof n&&n.__proto__===Object.prototype||Array.isArray(n)?t.push({prefix:i,obj:n}):e+=`${i}=${String(n)},`}}}return e},Vg=t=>void 0!==t.find((t=>{var e;return null===(e=t.rR)||void 0===e?void 0:e.nR})),Bg=t=>void 0!==t.find((t=>{var e;return null===(e=t.rR)||void 0===e?void 0:e.oR})),Og=(t,e,...i)=>{const s=[],n=e?"vec3":"vec2",{axisWorldTranslation:r,scaling:o,translation:a,offset:h,flipXY:l,flipXZ:u,splitPosAttribute:c,normalSource:d}=t,f=[];if("attribute"===d&&s.push(Mg("attribute vec3 aNormal"),wg("vec3 normal = aNormal")),"linear-highPrecision"!==r?i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&void 0!==t.variableNameAxisCoord&&(!0!==c?s.push(wg(`${n} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(wg(`${n} ${t.variableNameAxisCoord} = ${e?`vec3(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y, ${t.attributeNameAxisCoord}Z)`:`vec2(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y)`}`)))})):i.forEach((e=>{!0!==t.splitPosAttribute?s.push(wg(`${n} ${e.variableNameAxisCoord}_highpart = ${e.attributeNameAxisCoord}_highpart`),wg(`${n} ${e.variableNameAxisCoord}_lowpart = ${e.attributeNameAxisCoord}_lowpart`)):s.push(wg(`${n} ${e.variableNameAxisCoord}_highpart = vec2(${e.attributeNameAxisCoord}_highpartX, ${e.attributeNameAxisCoord}_highpartY)`),wg(`${n} ${e.variableNameAxisCoord}_lowpart = vec2(${e.attributeNameAxisCoord}_lowpartX, ${e.attributeNameAxisCoord}_lowpartY)`))})),h&&h.rotation){const t=h.rotation.dataType,e="uniform"===t?"u":"a";if("attribute-deg"===t){s.push(Mg("attribute float aRotDeg"),Mg("uniform float uBaseRotDeg"));const t="cRot",e="aInstanceGeo";s.push(wg(`vec2 ${t} = vec2(sin((aRotDeg + uBaseRotDeg) * 0.01745329252), cos((aRotDeg + uBaseRotDeg) * 0.01745329252))`,`vec2 rotatedGeo = vec2(${e}.x * ${t}.y + ${e}.y * ${t}.x, ${e}.y * ${t}.y - ${e}.x * ${t}.x)`))}else{const i=`${e}Rot`;s.push(Mg(`${t} vec2 ${i}`));const n="aInstanceGeo";s.push(wg(`vec2 rotatedGeo = vec2(${n}.x * ${i}.y + ${n}.y * ${i}.x, ${n}.y * ${i}.y - ${n}.x * ${i}.x)`))}}if(h&&s.push(Mg(`attribute ${n} aInstanceGeo`)),!0===l){if("linear-highPrecision"===r)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + flipXY");i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${e?`vec3(${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x, ${t.variableNameAxisCoord}.z)`:`vec2(${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x)`}`)}))}if(!0===u){if("linear-highPrecision"===r)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + flipXZ");i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = vec3(${t.variableNameAxisCoord}.z, ${t.variableNameAxisCoord}.y, ${t.variableNameAxisCoord}.x)`)}))}if(o){if("linear-highPrecision"===r)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + scaling");const t=("attribute"===o.dataType?"a":"u")+"Scaling",n=e?"vec3":"vec2";s.push(Mg(`${o.dataType} ${n} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} * ${t}`)}))}if(a&&"axis"===a.sizeUnit){if("linear-highPrecision"===r)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + translation (axis)");const t=("attribute"===a.dataType?"a":"u")+"TranslationAxis",n=e?"vec3":"vec2";s.push(Mg(`${a.dataType} ${n} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} + ${t}`)}))}if(h&&"axis"===h.sizeUnit){if("linear-highPrecision"===r)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + offset (axis)");const t=("attribute"===h.dataType?"a":"u")+"OffsetAxis",o=!0===h.symmetric?"float":n;s.push(Mg(`${h.dataType} ${o} ${t}`));const a=h.halved?" * 0.5":"",l=h.rotation?"rotatedGeo":"aInstanceGeo",u="offsetGeometry";f.push(`${n} ${u} = ${t} * ${l}${a} * sign(uScale)`),e&&"gpu-calculate"===d&&f.push(`${n} normal = ${l}`),i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${t.variableNameAxisCoord} + ${u}`)}))}if(void 0===r||"linear"===r)s.push(Mg(`uniform ${n} uDisp`,`uniform ${n} uScale`)),i.forEach((t=>{f.push(`${n} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord} - uDisp) / uScale`)}));else if("linear-highPrecision"===r)s.push(Mg(`uniform ${n} uDisp`,`uniform ${n} uScale`,`uniform ${n} uScaleStart_highpart`,`uniform ${n} uScaleStart_lowpart`)),i.forEach((t=>{f.push(`${n} ${t.variableNameAxisCoord}_hprecision = (${t.variableNameAxisCoord}_highpart - uScaleStart_highpart) + (${t.variableNameAxisCoord}_lowpart - uScaleStart_lowpart)`,`${n} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord}_hprecision - uDisp) / uScale`,`${n} ${t.variableNameAxisCoord} = ${t.variableNameAxisCoord}_highpart + ${t.variableNameAxisCoord}_lowpart`)}));else if("matrix"===r)s.push(Mg("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("matrix4"===r)s.push(Mg("uniform mat4 uMatrix")),i.forEach((t=>{f.push(`vec4 ${t.variableNameWorldCoord} = uMatrix * ${t.attributeNameAxisCoord}`)}));else if("logarithmic"===r[0]){s.push(Mg(`uniform ${n} uScaleStart`,`uniform ${n} uScaleStartLog`,`uniform ${n} uScaleInterval`,`uniform ${n} uScaleIntervalLog`,`uniform ${n} uViewportStart`,`uniform ${n} uViewportSize`));const t=e?["x","y","z"]:["x","y"],o=[];t.forEach((t=>{const e=r[1][t];if(void 0!==e){const t=e.base;if("e"===t)return;const i=`float cLog${t} = 1.0 / log(${Mi(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(Mg(...o)),i.forEach(((e,i)=>{const s=`${i}`,o=[];t.forEach((t=>{const i=t.toUpperCase(),n=r[1][t];if(void 0===n)f.push(`float posPercent${i}${s} = (${e.variableNameAxisCoord}.${t} - uScaleStart.${t}) / uScaleInterval.${t}`);else{const r=n.base,o="e"===r;f.push(`float posLog${i}${s} = log(${e.variableNameAxisCoord}.${t})${o?"":` * cLog${r}`}`,`float posPercent${i}${s} = (posLog${i}${s} - uScaleStartLog.${t}) / uScaleIntervalLog.${t}`)}o.push(`posPercent${i}${s}`)})),f.push(`${n} ${e.variableNameWorldCoord} = uViewportStart + ${n}(${o.join(", ")}) * uViewportSize`)}))}if(h&&"px"===h.sizeUnit){s.push(Mg("uniform vec2 uRatioPxClip"));const t=("attribute"===h.dataType?"a":"u")+"OffsetPixels",e=!0===h.symmetric?"float":n;s.push(Mg(`${h.dataType} ${e} ${t}`));const r=h.halved?" * 0.5":"",o=`${t} * ${h.rotation?"rotatedGeo":"aInstanceGeo"}${r}`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${o} * uRatioPxClip`)}))}if(h&&"wu"===h.sizeUnit){const t=("attribute"===h.dataType?"a":"u")+"OffsetWU",r=!0===h.symmetric?"float":n;s.push(Mg(`${h.dataType} ${r} ${t}`));const o=h.halved?" * 0.5":"",a=h.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${n} ${l} = ${t} * ${a}${o}`),e&&"gpu-calculate"===d&&f.push(`${n} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l}`)}))}if(h&&"nwu"===h.sizeUnit){s.push(Mg("uniform float uRatioNwuWu"));const t=("attribute"===h.dataType?"a":"u")+"OffsetNWU",r=!0===h.symmetric?"float":n;s.push(Mg(`${h.dataType} ${r} ${t}`));const o=h.halved?" * 0.5":"",a=h.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${n} ${l} = ${t} * ${a}${o}`),e&&"gpu-calculate"===d&&f.push(`${n} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l} * uRatioNwuWu`)}))}return t.snapToNearestPixel&&(s.push(Mg("uniform vec2 uViewportSizePx")),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = 2.0 * floor(((${t.variableNameWorldCoord} + 1.0) * 0.5) * uViewportSizePx + 0.5) / uViewportSizePx - 1.0`)}))),s.push(Eg("gl_Position =",...f)),s},Ng=(t,e,i,s)=>{const n=[],r=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===r)n.push(kg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===r)n.push(kg(i,`${o} ${s} = ${i} * uScale + uDisp + uScaleStart_highpart + uScaleStart_lowpart`));else{if("matrix"===r)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("matrix4"===r)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("logarithmic"!==r[0])throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");{const t=[`${o} ${i}_percent = (${i} - uViewportStart) / uViewportSize`];(e?["x","y","z"]:["x","y"]).forEach((e=>{const s=e.toUpperCase(),n=r[1][e];if(void 0===n)t.push(`float pos${s}Back = ${i}_percent.${e} * uScaleInterval.${e} + uScaleStart.${e}`);else{const r=n.base,o="e"===r?"1.0":`cLog${r}`;t.push(`float pos${s}Back = pow(2.71828, (${i}_percent.${e} * uScaleIntervalLog.${e} + uScaleStartLog.${e}) / ${o})`)}})),t.push(`${o} ${s} = ${o}(posXBack, posYBack${e?", posZBack":""})`),n.push(kg(i,...t))}}return n},Ug=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.rR)||void 0===e?void 0:e.aR})))(t)?[Tg("attribute vec4 aColor"),Tg("vColor = aColor"),Mg("attribute vec4 aColorA"),Mg("attribute vec4 aColorB"),Cg("vColor = mix(aColorA, aColorB, aSegmentSide)")]:[],Gg=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.rR)||void 0===e?void 0:e.lR})))(t)?[Tg("attribute float aLookupValue"),Tg("vLookupValue = aLookupValue"),Mg("attribute float aLookupValueA"),Mg("attribute float aLookupValueB"),Cg("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],Wg={"2D":{idFeature:"2D",apply:t=>({idVertex:"2D",idFragment:"2D",defaultVertexShader:"2D",defaultFragmentShader:"FragmentShader"})},"2DCompose":{idFeature:"2DCompose",apply:t=>({idVertex:"2DCompose",idFragment:"2DCompose",defaultVertexShader:"2DMatrix",defaultFragmentShader:"Empty"})},"3D":{idFeature:"3D",rR:{nR:!0},apply:t=>({idVertex:"3D",idFragment:"3D",defaultVertexShader:"3D",defaultFragmentShader:"FragmentShader"})},PointSize:t=>({idFeature:"PointSize",apply:e=>{const i="uniform"===t?"u":"a";return{idVertex:`SizePrimitive:${Rg(t)}`,idFragment:void 0,vertexShaderModifiers:[Mg(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Cg(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTexture,n=t&&t.overrideOpacity;return{idFeature:"Color",rR:{oR:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,lR:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0,aR:"attribute"===t.dataType||void 0},apply:(r,o)=>{let a,h=`Color:${Rg(t)}`;const l=[];let u="FragmentShader";const c=[];if("uniform"===i)c.push(Mg("uniform vec4 uColor"),wg("vec4 colorFragment = uColor"),...s?Lg:[]);else if("attribute"===i)a="colorAttribute",l.push(Dg("attribute vec4 aColor","varying vec4 vColor")),c.push(Mg("varying vec4 vColor"),wg("vec4 colorFragment = vColor"));else if("texture"===i)a="colorTexCoord",l.push(Dg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),c.push(Mg("varying vec2 vTextureCoord"),Mg("uniform sampler2D uColorTexture"),Mg("uniform vec4 uColor"),wg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.) {\n colorFragment = uColor;\n }"));else if("texture-coord-calc-gpu"===i)a="colorTexCoord",u="Empty",l.push(Mg("attribute vec2 aTextureCoord"),Mg("varying vec2 vTextureCoord"),Cg("vTextureCoord = gl_Position.xy * 0.5 + 0.5")),c.push(Mg("varying vec2 vTextureCoord"),Mg("uniform sampler2D uColorTexture"),wg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","gl_FragColor = colorFragment;"));else if(Array.isArray(i)&&"image"===i[0])a="colorTexCoord",l.push(Dg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1]===e.ImageFitMode.Tile?c.push(Mg("uniform sampler2D uColorTexture"),Mg("varying vec2 vTextureCoord"),wg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);")):c.push(Mg("uniform sampler2D uColorTexture"),Mg("varying vec2 vTextureCoord"),Mg("uniform vec4 uColor"),wg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.){\n colorFragment = uColor;\n }"));else if(Array.isArray(i)&&"lookup"===i[0]){const t=i[1];if("value"===t)a="lookup:value",l.push(Dg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;a=`lookup:${t}`,l.push(Dg(e,"varying float vLookupValue"))}c.push(Mg("varying float vLookupValue"),...Fg("vLookupValue",i[2]))}else if(Array.isArray(i)&&"gradient"===i[0]){h=`Color:${Rg(t)}`;const e=i[1],n=e.getColorStops();Q(e)?c.push(Mg("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Mg(...Ct(n.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),_g.linearStep,wg("vec2 uv = vec2((((gl_FragCoord.x)-uBounds.x)/(uBounds.z))*uAspect,((gl_FragCoord.y)-uBounds.y)/(uBounds.w))","float mixVal = distance(uv/uDistance, uCenter/uDistance)","vec4 color = mix(color_0, color_1, linearStep(stop_0, stop_1, mixVal))",...n.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, mixVal));`)),"vec4 colorFragment = color"),...s?Lg:[]):it(e)&&c.push(Mg("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Mg(...Ct(n.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),_g.linearStep,wg("vec2 uv = gl_FragCoord.xy - uBounds.xy","float magnitude = ((uv.x-uStartPoint.x) * (uEndPoint.x-uStartPoint.x) + (uv.y-uStartPoint.y) * (uEndPoint.y-uStartPoint.y)) / (pow(uEndPoint.x - uStartPoint.x, 2.0) + pow(uEndPoint.y-uStartPoint.y,2.0))","vec4 color = mix(color_0, color_1, linearStep(stop_0, stop_1, magnitude))",...n.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, magnitude))`)),"vec4 colorFragment = color"),...s?Lg:[])}if(!0===s){const t="maskTexture";a=a?`${a} ${t}`:`Color:${t}`,l.push(Dg("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return n&&c.push(Mg("uniform float uOpacity"),kg("colorFragment =","colorFragment.a *= uOpacity")),{vertexShaderModifiers:l,fragmentShader:u,fragmentShaderModifiers:c,idVertex:a,idFragment:h}}}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let n;const r=`ColorShaded3D:${Rg(t)}`;return{idFeature:"ColorShaded3D",rR:{oR:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,lR:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const a=[],h=[];if(a.push("phong"===i&&Dg("normal","varying vec3 vNormal"),Dg("posWorld","varying vec3 vPosWorld")),"uniform"===e)h.push(Mg("uniform vec4 uColorDiffuse"),wg("vec4 colorFragment = uColorDiffuse"));else if("attribute"===e)n="per-vertex-color",a.push(Dg("attribute vec4 aColor","varying vec4 vColor")),h.push(Mg("varying vec4 vColor"),wg("vec4 colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)n="lookup:value",a.push(Dg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;n=`lookup:${t}`,a.push(Dg(e,"varying float vLookupValue"))}h.push(Mg("varying float vLookupValue"),...Fg("vLookupValue",e[2]))}if(s){const t="wireframe";n=n?`${n},${t}`:t,a.push(Dg("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),h.push(Mg("varying vec3 vTriangleBary"),Mg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),_g.computeScreenSpaceWireframe,kg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&h.push(...zg),{idVertex:n,idFragment:r,vertexShaderModifiers:a,fragmentShader:"FragmentShader",fragmentShaderModifiers:h}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=[],s=Vg(e),n=t.coordType?t.coordType:s?"vec3":"vec2";return"linear-highPrecision"!==t.axisWorldTranslation?!0!==t.splitPosAttribute?i.push(Mg(`attribute ${n} aPos`)):i.push(Mg("attribute float aPosX"),Mg("attribute float aPosY"),s&&Mg("attribute float aPosZ")):!0===t.splitPosAttribute?i.push(Mg("attribute float aPos_highpartX"),Mg("attribute float aPos_lowpartX"),Mg("attribute float aPos_highpartY"),Mg("attribute float aPos_lowpartY")):i.push(Mg(`attribute ${n} aPos_highpart`),Mg(`attribute ${n} aPos_lowpart`)),i.push(...Og(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"vec4"===t.coordType?void 0:"posAxis",variableNameWorldCoord:"posWorld"})),{idVertex:`VertexLocation:${Rg(t)}`,idFragment:void 0,vertexShaderModifiers:i}}}),Model3D:t=>({idFeature:"Model3D",apply:e=>{const i=[];return i.push(Mg("attribute vec3 aGeoPos"),Mg("uniform mat4 uModelRotation"),Mg("uniform mat4 uModelRotationNormals"),Mg("uniform vec3 uLocationAxis"),Mg("uniform vec3 uModelAlignment"),Mg("uniform vec3 uModelScale"),Mg("uniform vec3 uModelSize"),...Og({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,{attributeNameAxisCoord:"uLocationAxis",variableNameAxisCoord:"locationAxis",variableNameWorldCoord:"locationWorld"}),Eg("gl_Position =","vec3 posWorld = locationWorld + ((uModelRotation * vec4(aGeoPos, 1.0)).xyz - (uModelAlignment + 1.0) * uModelSize/2.0) * uModelScale;"),"attribute"===t.normalSource&&kg("vec3 normal ="," normal = (uModelRotationNormals * vec4(normal, 1.0)).xyz;"),...Bg(e)?Ng({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,"posWorld","posAxis"):[]),{vertexShaderModifiers:i,idVertex:`Model3D:${Rg(t)}`,idFragment:void 0}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",apply:e=>({idVertex:`LineInstanced2D:${Rg(t)}`,idFragment:void 0,vertexShaderModifiers:[Mg("uniform float uThicknessPixels"),Mg("uniform vec2 uRatioPxClip"),..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Mg("attribute vec2 aLocationA"),Mg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Mg("attribute vec2 aLocationA_highpart"),Mg("attribute vec2 aLocationB_highpart"),Mg("attribute vec2 aLocationA_lowpart"),Mg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Mg("attribute float aLocationAX"),Mg("attribute float aLocationAY"),Mg("attribute float aLocationBX"),Mg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Mg("attribute float aLocationA_highpartX"),Mg("attribute float aLocationA_highpartY"),Mg("attribute float aLocationB_highpartX"),Mg("attribute float aLocationB_highpartY"),Mg("attribute float aLocationA_lowpartX"),Mg("attribute float aLocationA_lowpartY"),Mg("attribute float aLocationB_lowpartX"),Mg("attribute float aLocationB_lowpartY")]:[],Mg("attribute vec2 aSegmentPosition"),Mg("attribute float aSegmentSide"),...Og(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),t.ensureMinimumSegmentLength&&Mg("uniform vec2 uMinSegmentPixelVector"),kg("worldB = ",t.ensureMinimumSegmentLength&&"float segmentLengthPixels = sqrt(pow(worldB.x - worldA.x, 2.0) + pow(worldB.y - worldA.y, 2.0)) / length(uRatioPxClip)",t.ensureMinimumSegmentLength&&"if (segmentLengthPixels == 0.0 || segmentLengthPixels < length(uMinSegmentPixelVector)) {\n worldB = worldA + uMinSegmentPixelVector * uRatioPxClip;\n }","vec2 directionBasis = worldB - worldA","vec2 directionBasisNorm = normalize(directionBasis)","vec2 perpendBasisNorm = vec2(-directionBasisNorm.y, directionBasisNorm.x)","vec2 offset = mix(worldA, worldB, aSegmentSide)","vec2 thicknessDirection = aSegmentPosition.x * directionBasisNorm + aSegmentPosition.y * perpendBasisNorm","vec2 posWorld = offset + thicknessDirection * uThicknessPixels * uRatioPxClip"),...Gg(e),...Ug(e),...Bg(e)?Ng(t,!1,"posWorld","posAxis"):[]]})}),Area2D:t=>({idFeature:"Area2D",apply:e=>({idVertex:`Area2D:${Rg(t)}`,idFragment:void 0,vertexShaderModifiers:[..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Mg("attribute vec2 aLocationA"),Mg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Mg("attribute vec2 aLocationA_highpart"),Mg("attribute vec2 aLocationB_highpart"),Mg("attribute vec2 aLocationA_lowpart"),Mg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Mg("attribute float aLocationAX"),Mg("attribute float aLocationAY"),Mg("attribute float aLocationBX"),Mg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Mg("attribute float aLocationA_highpartX"),Mg("attribute float aLocationA_highpartY"),Mg("attribute float aLocationB_highpartX"),Mg("attribute float aLocationB_highpartY"),Mg("attribute float aLocationA_lowpartX"),Mg("attribute float aLocationA_lowpartY"),Mg("attribute float aLocationB_lowpartX"),Mg("attribute float aLocationB_lowpartY")]:[],Mg("attribute float aCurveOrBaseline"),Mg("attribute float aSegmentSide"),...Og(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),kg("worldB = ","vec2 posCoord = mix(worldA, worldB, aSegmentSide)","float baseline = min(posCoord.y, -1.0)","vec2 posWorld = vec2(posCoord.x, mix(posCoord.y, baseline, aCurveOrBaseline))"),...Gg(e),...Ug(e),...Bg(e)?Ng(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${Rg(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Mg("uniform float uOffsetWU"),Mg("attribute vec3 aLocationA"),Mg("attribute vec3 aLocationB"),Mg("attribute float aSegmentPosition"),Mg("attribute float aPerpendHorizontal"),Mg("attribute float aPerpendVertical"),...Og({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Vg(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),kg("worldB = ","vec3 directionBasis = worldB - worldA","vec3 directionBasisNorm = normalize(directionBasis)","vec3 notParallel = normalize(mix( vec3( 0.0, 1.0, 0.0 ), vec3( 0.2, 0.8, 0.0 ), step( abs(directionBasis.y), 0.9 ) ))","vec3 horizontalBasis = normalize( cross( notParallel, directionBasisNorm ) )","vec3 verticalBasis = normalize( cross( horizontalBasis, directionBasisNorm ) )","vec3 normal = aPerpendHorizontal * horizontalBasis + aPerpendVertical * verticalBasis","vec3 posWorld = worldA + aSegmentPosition * directionBasis + normal * uOffsetWU * 0.5"),...Bg(e)?Ng({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[Mg("attribute vec3 aEdge"),Mg("uniform float uEdgeRoundness"),kg("posWorld =","vec3 boxSizeWorld = abs( aOffsetAxis / uScale )","float boxMinDimensionWorldXZ = min( boxSizeWorld.x, boxSizeWorld.z )","vec3 edgeRoundAmount = uEdgeRoundness * vec3( boxMinDimensionWorldXZ, min( boxMinDimensionWorldXZ, boxSizeWorld.y ), boxMinDimensionWorldXZ )","posWorld = posWorld + aEdge * edgeRoundAmount")]})},ColorGrid2D:t=>{const e=t.flipXY,i=t.intensityTextureType,s=t.littleEndian;return{idFeature:"ColorGrid2D",apply:(n,r)=>({idVertex:void 0,idFragment:`ColorGrid2D:${Rg(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[Mg("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&_g.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?wg("vec2 cellSizePx = uTileBounds.zw / (uTileDimensions - 1.0)","vec2 cellIndex = (gl_FragCoord.xy - uTileBounds.xy) / cellSizePx","vec2 cellStart = floor(cellIndex)","vec2 cellEnd = ceil(cellIndex)","vec2 cellStartNormalized = cellStart / (uTileDimensions - 1.0)","vec2 cellEndNormalized = cellEnd / (uTileDimensions - 1.0)",`vec4 sample00 = texture2D(uTileIntensityValues, ${e?"cellStartNormalized":"vec2(cellStartNormalized.y, cellStartNormalized.x)"})`,`vec4 sample01 = texture2D(uTileIntensityValues, ${e?"vec2(cellStartNormalized.x, cellEndNormalized.y)":"vec2(cellStartNormalized.y, cellEndNormalized.x)"})`,`vec4 sample10 = texture2D(uTileIntensityValues, ${e?"vec2(cellEndNormalized.x, cellStartNormalized.y)":"vec2(cellEndNormalized.y, cellStartNormalized.x)"})`,`vec4 sample11 = texture2D(uTileIntensityValues, ${e?"cellEndNormalized":"vec2(cellEndNormalized.y, cellEndNormalized.x)"})`,"float intensity00 = "+("float"===i?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${s})`),"float intensity01 = "+("float"===i?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${s})`),"float intensity10 = "+("float"===i?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${s})`),"float intensity11 = "+("float"===i?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${s})`),"vec2 lerpFactors = cellIndex - cellStart",`float intensityR1 = mix(intensity00, intensity10, ${e?"lerpFactors.x":"lerpFactors.y"})`,`float intensityR2 = mix(intensity01, intensity11, ${e?"lerpFactors.x":"lerpFactors.y"})`,`float intensityP = mix(intensityR1, intensityR2, ${e?"lerpFactors.y":"lerpFactors.x"})`):wg("vec2 cellSizePx = uTileBounds.zw / (uTileDimensions)","vec2 cellIndex = (gl_FragCoord.xy - uTileBounds.xy) / cellSizePx","vec2 cellIndexNormalized = cellIndex / uTileDimensions",`vec4 sample0 = texture2D(uTileIntensityValues, ${e?"cellIndexNormalized":"vec2(cellIndexNormalized.y, cellIndexNormalized.x)"})`,"float intensityP = "+("float"===i?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${s})`)),...Fg("intensityP",t.lut)]})}},DrawToNormalTexture:t=>{const e=t.flipXZ,i=t.vertexIdSource,s=t.normalTextureType,n=t.heightmapTextureType,r=t.littleEndian;return{idFeature:"DrawToNormalTexture",apply:(o,a)=>{const h=[],l=[];return h.push(Mg("uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB","attribute"===i&&"attribute float aVertexID"),void 0!==i&&_g.roundUnsigned,_g.modulus,_g.texelFetchWithFallback[a],"ubyte"===n&&_g.decodeUbyteRGBAEncodedFloat,wg(void 0===i?"int iVertex = gl_VertexID":"int iVertex = int(roundUnsigned(aVertexID))","int iSecondary = modulus(iVertex, (uTileDimensions.y - 1))","int iPrimary = iVertex / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 uTileDimensionsMinus1 = vec2(uTileDimensions) - 1.0","vec2 halfTexelWorld = 2.0 / (uTileDimensionsMinus1 * 2.0)","vec2 posWorld = vec2(-1.0 + halfTexelWorld.y + iCell.y * 2.0 * halfTexelWorld.y, -1.0 + halfTexelWorld.x + iCell.x * 2.0 * halfTexelWorld.x)","vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)",`vec3 posAxis0 = vec3(\n uTileStartLocationAxisXZ.x + iCell.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===n?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${r})`} ,\n uTileStartLocationAxisXZ.y + iCell.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell1 = iCell + vec2(1.0, 0.0)",`vec3 posAxis1 = vec3(\n uTileStartLocationAxisXZ.x + iCell1.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===n?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${r})`},\n uTileStartLocationAxisXZ.y + iCell1.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell2 = iCell + vec2(0.0, 1.0)",`vec3 posAxis2 = vec3(\n uTileStartLocationAxisXZ.x + iCell2.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===n?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${r})`},\n uTileStartLocationAxisXZ.y + iCell2.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec2 iCell3 = iCell + vec2(1.0, 1.0)",`vec3 posAxis3 = vec3(\n uTileStartLocationAxisXZ.x + iCell3.${e?"y":"x"} * cellSizeAxis.x,\n ${"float"===n?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${r})`},\n uTileStartLocationAxisXZ.y + iCell3.${e?"x":"y"} * cellSizeAxis.y\n )`,"vec3 normal = normalize(cross(posAxis2 - posAxis0, posAxis1 - posAxis0) + cross(posAxis1 - posAxis3, posAxis2 - posAxis3))","uint"===s?"vNormalRGB = uvec3(((normal / 2.0) + 0.5) * float(-1u))":"vNormalRGB = (normal / 2.0) + 0.5","gl_PointSize = 1.0")),l.push(Mg("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),wg("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${Rg(t)}`,idFragment:`DrawToNormalTexture:${Rg(t)}`,vertexShaderModifiers:h,fragmentShaderModifiers:l,fragmentShader:"Empty",hints:["uint"===s&&{type:"fragOutput",fragOutput:"uvec4"}]}}}},SurfaceGrid:t=>{const e=t.fillColor,i=t.interpolation,s=t.flipXZ,n=t.shadingStyle,r=t.wireframe,o=t.instanceIdSource,a=t.normalTextureType,h=t.heightmapTextureType,l=t.intensityTextureType,u=t.littleEndian;return{idFeature:"SurfaceGrid",apply:(c,d)=>{const f=[],g=[];return f.push(Mg("attribute vec2 aGeoCellOffset","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","attribute"===o&&"attribute float aInstanceID"),void 0!==o&&_g.roundUnsigned,_g.modulus,_g.texelFetchWithFallback[d],"ubyte"===h&&_g.decodeUbyteRGBAEncodedFloat,wg(void 0===o?"int iInstance = gl_InstanceID":"int iInstance = int(roundUnsigned(aInstanceID))","iInstance = iInstance + uBaseInstance","int iSecondary = modulus(iInstance, (uTileDimensions.y - 1))","int iPrimary = iInstance / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 iCellVertex = iCell + aGeoCellOffset","vec2 uTileDimensionsMinus1 = vec2(float(uTileDimensions.x), float(uTileDimensions.y)) - 1.0","vec2 ySampleCoordinate = vec2(iCellVertex.y, iCellVertex.x) / vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x)","float y = "+("float"===h?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${u})`),"vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)","vec2 posAxisXZ = uTileStartLocationAxisXZ + cellSizeAxis * "+(s?"vec2(iCellVertex.y, iCellVertex.x)":"iCellVertex"),"vec3 posAxis = vec3(posAxisXZ.x, y, posAxisXZ.y)")),f.push(...Og({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===n&&f.push(Dg("posWorld","varying vec3 vPosWorld"),..."uint"===a?[_g.texelFetchUnsignedWithFallback[d],Cg("vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Cg("vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Cg("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),Mg("varying vec3 vNormal",..."uint"===a?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),g.push(Mg("varying vec3 vTriangleBary")),"uniform"===e?g.push(Mg("uniform vec4 uColorDiffuse"),wg("vec4 colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]?"value"===e[1]?(f.push(Dg("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),g.push(Mg("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===l&&_g.decodeUbyteRGBAEncodedFloat,"bilinear"===i?wg("vec2 cellSizeAxisXZ = uTileBoundsAxisXZ.zw / (uTileDimensionsXZ - 1.0)","vec2 cellIndex = (vVertexLocationAxisXZ - uTileBoundsAxisXZ.xy) / cellSizeAxisXZ","vec2 cellStart = floor(cellIndex)","vec2 cellEnd = ceil(cellIndex)","vec2 cellStartNormalized = cellStart / (uTileDimensionsXZ - 1.0)","vec2 cellEndNormalized = cellEnd / (uTileDimensionsXZ - 1.0)",`vec4 sample00 = texture2D(uTileIntensityValues, ${s?"cellStartNormalized":"vec2(cellStartNormalized.y, cellStartNormalized.x)"})`,`vec4 sample01 = texture2D(uTileIntensityValues, ${s?"vec2(cellStartNormalized.x, cellEndNormalized.y)":"vec2(cellStartNormalized.y, cellEndNormalized.x)"})`,`vec4 sample10 = texture2D(uTileIntensityValues, ${s?"vec2(cellEndNormalized.x, cellStartNormalized.y)":"vec2(cellEndNormalized.y, cellStartNormalized.x)"})`,`vec4 sample11 = texture2D(uTileIntensityValues, ${s?"cellEndNormalized":"vec2(cellEndNormalized.y, cellEndNormalized.x)"})`,"float intensity00 = "+("float"===l?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${u})`),"float intensity01 = "+("float"===l?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${u})`),"float intensity10 = "+("float"===l?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${u})`),"float intensity11 = "+("float"===l?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${u})`),"vec2 lerpFactors = cellIndex - cellStart",`float intensityR1 = mix(intensity00, intensity10, ${s?"lerpFactors.x":"lerpFactors.y"})`,`float intensityR2 = mix(intensity01, intensity11, ${s?"lerpFactors.x":"lerpFactors.y"})`,`float intensityP = mix(intensityR1, intensityR2, ${s?"lerpFactors.y":"lerpFactors.x"})`):wg("vec2 cellSizeAxisXZ = uTileBoundsAxisXZ.zw / (uTileDimensionsXZ - 1.0)","vec2 cellIndex = floor((vVertexLocationAxisXZ - uTileBoundsAxisXZ.xy) / cellSizeAxisXZ)","vec2 cellIndexNormalized = cellIndex / (uTileDimensionsXZ - 1.0)",`vec4 sample0 = texture2D(uTileIntensityValues, ${s?"cellIndexNormalized":"vec2(cellIndexNormalized.y, cellIndexNormalized.x)"})`,"float intensityP = sample0.x"),...Fg("intensityP",e[2]))):(f.push(Dg(`posAxis.${e[1]}`,"varying float vLookupValue")),g.push(Mg("varying float vLookupValue"),...Fg("vLookupValue",e[2]))):void 0===e&&g.push(wg("vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0)")),"phong"===n&&g.push(...zg),r&&(f.push(Mg("attribute vec3 aTriangleBary"),Dg("aTriangleBary","varying vec3 vTriangleBary")),g.push(Mg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),_g.computeScreenSpaceWireframe,kg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)",e?"if (edge > 0.0) {\n colorFragment = vec4(mix(colorFragment.rgb, uWireframeColor.rgb, edge * uWireframeColor.a), max(colorFragment.a, uWireframeColor.a));\n }":"if (edge > 0.0) {\n colorFragment = uWireframeColor;\n } else {\n discard;\n }"))),{idVertex:`SurfaceGrid:${Rg(t)}`,idFragment:`SurfaceGrid:${Rg(t)}`,vertexShaderModifiers:f,fragmentShader:"FragmentShader",fragmentShaderModifiers:g}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${Rg(t)}`,idFragment:`DebugSurfaceGridNormals:${Rg(t)}`,vertexShaderModifiers:[Mg("attribute float aNormalArrow","uniform int uBaseInstance","uniform ivec2 uTileDimensions","uniform vec2 uTileDimensionsXZ","uniform vec2 uTileStartLocationAxisXZ","uniform vec2 uTileSizeAxisXZ","uniform sampler2D uHeightmapTexture","attribute"===t.instanceIdSource&&"attribute float aInstanceID",..."uint"===t.normalTextureType?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"]),_g.roundUnsigned,_g.modulus,_g.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&_g.decodeUbyteRGBAEncodedFloat,wg(void 0===t.instanceIdSource?"int iInstance = gl_InstanceID":"int iInstance = int(roundUnsigned(aInstanceID))","iInstance = iInstance + uBaseInstance","int iSecondary = modulus(iInstance, (uTileDimensions.y - 1))","int iPrimary = iInstance / (uTileDimensions.y - 1)","vec2 iCell = vec2(float(iPrimary), float(iSecondary))","vec2 uTileDimensionsMinus1 = vec2(float(uTileDimensions.x), float(uTileDimensions.y)) - 1.0","float y00 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y01 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y10 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y11 = "+("float"===t.heightmapTextureType?"texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(texelFetchWithFallback(uHeightmapTexture, ivec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y = (y00 + y01 + y10 + y11) / 4.0","vec2 cellSizeAxis = uTileSizeAxisXZ / (uTileDimensionsXZ - 1.0)",`vec2 posAxisXZ = uTileStartLocationAxisXZ + cellSizeAxis * (0.5 + ${t.flipXZ?"vec2(iCell.y, iCell.x)":"iCell"})`,"vec3 posAxis = vec3(posAxisXZ.x, y, posAxisXZ.y)",..."uint"===t.normalTextureType?["vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)"]:["vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))"],"vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vec3 normalWorld = normalize(normalAxis * uScale)"),..."uint"===t.normalTextureType?[_g.texelFetchUnsignedWithFallback[i]]:[],...Og({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),kg("posWorld =","vec3 dirArrow = normalWorld","vec3 posArrowStart = posWorld","vec3 posArrowEnd = posWorld + dirArrow * 0.010","vec3 notParallel = normalize(mix( vec3( 0.0, 1.0, 0.0 ), vec3( 0.2, 0.8, 0.0 ), step( abs(dirArrow.y), 0.9 ) ))","vec3 dirArrowLeft = normalize(-dirArrow + 0.50 * normalize(cross(dirArrow, notParallel)))","vec3 dirArrowRight = normalize(-dirArrow + 0.50 * normalize(cross(notParallel, dirArrow)))","vec3 posArrowLeft = posArrowEnd + dirArrowLeft * 0.0025","vec3 posArrowRight = posArrowEnd + dirArrowRight * 0.0025","if (aNormalArrow == 0.0) {\n posWorld = posArrowStart;\n } else if (aNormalArrow == 1.0) {\n posWorld = posArrowEnd;\n } else if (aNormalArrow == 2.0) {\n posWorld = posArrowLeft;\n } else if (aNormalArrow == 3.0) {\n posWorld = posArrowRight;\n }")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Cg("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",apply:t=>({idVertex:"OffsetTowardsCamera",idFragment:void 0,vertexShaderModifiers:[Mg("uniform vec3 uCameraLoc"),kg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[Mg("attribute float aSegmentInside"),Mg("varying float vSegmentInside"),Mg("varying float vSegmentSide"),kg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[Ig("#extension GL_OES_standard_derivatives : enable"),Mg("uniform float uAALimit"),Mg("varying float vSegmentInside"),Mg("varying float vSegmentSide"),kg("antiAliasFactor = ","\n float dist = (uAALimit - vSegmentInside);\n vec2 ddist = vec2(dFdx(dist), dFdy(dist));\n float pixelDist = dist / length(ddist);\n // additional blurring\n pixelDist *= 0.5;\n\n float aa = clamp(0.5 - pixelDist, 0.0, 1.0);\n if((vSegmentSide <= 0.0 || vSegmentSide >= 1.0) && aa <=0.99){\n aa *= 0.5;\n }\n antiAliasFactor = aa;\n ")]})},Glow1D:t=>({idFeature:"Glow1D",apply:()=>{const e=Math.round(t.spreadPx),i=Math.round(t.blurPx),s=e+i,n=t.firstPass,r=[];for(let t=-s;t<=s;t+=1){const e=Math.abs(t);r.push(n?{x:t.toFixed(1),y:"0.0",distPx:e.toFixed(1)}:{x:"0.0",y:t.toFixed(1),distPx:e.toFixed(1)})}return{idVertex:`Glow1D:${Rg(t)}`,idFragment:`Glow1D:${Rg(t)}`,vertexShaderModifiers:[Dg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Mg("uniform sampler2D uTexture"),Mg("varying vec2 vTextureCoord"),Mg("uniform vec2 uTextureSize"),n&&Mg("uniform vec2 uOffsetPx"),!n&&Mg("uniform sampler2D uTextureFirstGlowPass"),!n&&Mg("uniform vec4 uGlowColor"),kg("antiAliasFactor =","vec2 oneTexel = vec2(1.0, 1.0) / uTextureSize",...n?[]:["float inverseIntensity =\n 0.25 * texture2D(uTexture, vTextureCoord).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, 0.0)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, 0.0)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(0.0, -oneTexel.y)).a +\n 0.125 * texture2D(uTexture, vTextureCoord + vec2(0.0, oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, -oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, -oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(-oneTexel.x, oneTexel.y)).a +\n 0.0625 * texture2D(uTexture, vTextureCoord + vec2(oneTexel.x, oneTexel.y)).a","antiAliasFactor *= 1.0 - (inverseIntensity * inverseIntensity)","if (antiAliasFactor <= 0.0) { discard; }"],"float distancePx = 255.0","vec2 sample_tx = vec2(0.0)",...n?["vec2 texCoordOffset = vTextureCoord - uOffsetPx * oneTexel",...r.map(((t,e)=>[`sample_tx = texCoordOffset + oneTexel * vec2(${t.x}, ${t.y})`,`if (distancePx > ${t.distPx} && sample_tx.x <= 1.0 && sample_tx.y <= 1.0 && sample_tx.x >= 0.0 && sample_tx.y >= 0.0 && texture2D(uTexture, sample_tx).a > 0.0) { distancePx = ${t.distPx}; }`])).flat(),"vec4 colorFragment = vec4(distancePx / 255.0, 0.0, 0.0, 1.0)"]:["vec4 sample_horizontal = vec4(0.0)","float horizontal_dist = 255.0","float min_horizontal_dist = 255.0",...r.map(((t,e)=>[`sample_tx = vTextureCoord + oneTexel * vec2(${t.x}, ${t.y})`,"if (sample_tx.x <= 1.0 && sample_tx.y <= 1.0 && sample_tx.x >= 0.0 && sample_tx.y >= 0.0) {\n sample_horizontal = texture2D(uTextureFirstGlowPass, sample_tx);\n horizontal_dist = sample_horizontal.r * 255.0;\n }","if (sample_horizontal.a < 0.9) { horizontal_dist = 255.0; }","min_horizontal_dist = min(min_horizontal_dist, horizontal_dist)",`distancePx = min(distancePx, pow(horizontal_dist * horizontal_dist + ${t.y} * ${t.y}, 0.5))`])).flat(),`if (distancePx > ${s.toFixed(1)}) { discard; }`,"vec4 pixelGlowColor = vec4(0.0, 0.0, 0.0, 0.0)",`if (distancePx > ${e.toFixed(1)}) {\n float lerpAmount = (distancePx - ${e.toFixed(1)}) / ${(i+1).toFixed(1)};\n pixelGlowColor = mix(uGlowColor, vec4(uGlowColor.rgb, 0.0), 1.0 - (1.0 - lerpAmount) * (1.0 - lerpAmount));\n } else {\n pixelGlowColor = uGlowColor;\n }`,"vec4 colorFragment = pixelGlowColor"])]}}}),MousePicking:{idFeature:"MousePicking",apply:t=>({idVertex:void 0,idFragment:"MousePicking",fragmentShaderModifiers:[Mg("uniform vec4 uColor"),wg("vec4 colorFragment = uColor"),t=>t.replace("gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor)","if (antiAliasFactor <= 0.0) { discard; }\ngl_FragColor = fragColorEnd")]})},MousePickingAttribute:{idFeature:"MousePickingAttribute",apply:t=>({idVertex:"MousePickingAttribute",idFragment:"MousePickingAttribute",vertexShaderModifiers:[Dg("attribute vec4 aColor","varying vec4 vColor")],fragmentShaderModifiers:[Mg("varying vec4 vColor"),wg("vec4 colorFragment = vColor"),t=>t.replace("gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor)","if (antiAliasFactor <= 0.0) { discard; }\ngl_FragColor = fragColorEnd")]})},AttributeHighlight:{idFeature:"AttributeHighlight",apply:t=>({idVertex:"AttributeHighlight",idFragment:"AttributeHighlight",vertexShaderModifiers:[Dg("attribute float aIsHighlighted","varying float vIsHighlighted")],fragmentShaderModifiers:[t=>t.replace("uniform float uIsHighlighted","varying float vIsHighlighted").replace("uIsHighlighted","vIsHighlighted")]})},StippleTexture:{idFeature:"StippleTexture",apply:(t,e)=>({idVertex:"StippleTexture",idFragment:"StippleTexture",vertexShaderModifiers:[Mg("attribute vec2 aLengthSoFar"),Mg("varying float vLengthSoFar"),Mg("uniform vec2 uStippleCount"),Cg("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Mg("uniform sampler2D uStippleTexture"),Mg("uniform float uStippleScale"),Mg("varying float vLengthSoFar"),"webgl1"===e&&Mg("uniform float uStippleTextureWidthLimiter"),kg("antiAliasFactor = ",`\n float stippleSampleY = texture2D(\n uStippleTexture, \n ${"webgl1"===e?"vec2(mod((vLengthSoFar / uStippleScale) , uStippleTextureWidthLimiter), 0)":"vec2((vLengthSoFar / uStippleScale), 0)"}\n ).r;\n float stippleAA = (stippleSampleY - 0.5) * 2.0;\n antiAliasFactor *= stippleAA;\n if (antiAliasFactor <= 0.0) { discard; }`)]})},StippleTextureInstanced:{idFeature:"StippleTextureInstanced",apply:(t,e)=>({idVertex:"StippleTextureInstanced",idFragment:"StippleTextureInstanced",vertexShaderModifiers:[Mg("attribute vec2 aLengthSoFarA"),Mg("attribute vec2 aLengthSoFarB"),Mg("varying float vLengthSoFar"),Mg("uniform vec2 uStippleCount"),Cg("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Mg("uniform sampler2D uStippleTexture"),Mg("uniform float uStippleScale"),Mg("varying float vLengthSoFar"),"webgl1"===e&&Mg("uniform float uStippleTextureWidthLimiter"),kg("antiAliasFactor = ",`\n float stippleSampleY = texture2D(\n uStippleTexture, \n ${"webgl1"===e?"vec2(mod((vLengthSoFar / uStippleScale) , uStippleTextureWidthLimiter), 0)":"vec2((vLengthSoFar / uStippleScale), 0)"}\n ).r;\n float stippleAA = (stippleSampleY - 0.5) * 2.0;\n antiAliasFactor *= stippleAA;\n if (antiAliasFactor <= 0.0) { discard; }`)]})},PolarHeatmap:t=>({idFeature:"PolarHeatmap",apply:(e,i)=>{const s="dataType"in t,n="interpolation"in t?t:void 0,r="bilinear"===(null==n?void 0:n.interpolation),o=null==n?void 0:n.intensityTextureType,a=null==n?void 0:n.littleEndian;return{idVertex:void 0,idFragment:`PolarHeatmap:${Rg(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[Mg("uniform vec2 uViewportSize","uniform vec2 uScale","uniform vec2 uDisp","uniform float uSectors","uniform float uAnnuli","uniform float uAmplitudeStart","uniform float uAmplitudeStep","uniform float uAmplitudeAxisStart","uniform float uAmplitudeAxisEnd","uniform float uAngleOffset","uniform float uAngleDirection",n&&"uniform sampler2D uTileIntensityValues",s&&"uniform vec4 uColor"),_g.texelFetchWithFallback[i],"ubyte"===o&&_g.decodeUbyteRGBAEncodedFloat,wg("vec2 posWorld = (2.0 * gl_FragCoord.xy / uViewportSize) - 1.0","vec2 posAxis = posWorld * uScale + uDisp","float amplitudeAxisInterval = uAmplitudeAxisEnd - uAmplitudeAxisStart","float amplitude = uAmplitudeAxisStart + sign(amplitudeAxisInterval) * sqrt(posAxis.x * posAxis.x + posAxis.y * posAxis.y)","float iAnnulus = (amplitude - uAmplitudeStart) / uAmplitudeStep","if (iAnnulus < 0.0 || iAnnulus > uAnnuli) { discard; }"),s&&wg("vec4 colorFragment = uColor"),n&&kg("if (iAnnulus","float angRad = atan(posAxis.y, posAxis.x) * uAngleDirection + uAngleOffset","if (angRad < 0.0) { angRad = angRad + 2.0 * 3.1415926538; }","if (angRad > 2.0 * 3.1415926538) { angRad = angRad - 2.0 * 3.1415926538; }","float iSector = uSectors * angRad / (2.0 * 3.1415926538)","vec2 cellIndex = vec2(iSector, iAnnulus)","ivec2 cellStart = ivec2(floor(cellIndex))","ivec2 cellEnd = cellStart + ivec2(1)","if (cellEnd.x >= int(uSectors)) { cellEnd = ivec2(0, cellEnd.y); }",n.flipXY&&"cellIndex = vec2(cellIndex.y, cellIndex.x)",n.flipXY&&"cellStart = ivec2(cellStart.y, cellStart.x)",n.flipXY&&"cellEnd = ivec2(cellEnd.y, cellEnd.x)","vec2 tileDimensions = "+(n.flipXY?"vec2(uAnnuli, uSectors)":"vec2(uSectors, uAnnuli)"),r&&"vec4 sample00 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",r&&"vec4 sample01 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellStart.x, cellEnd.y), tileDimensions)",r&&"vec4 sample10 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellEnd.x, cellStart.y), tileDimensions)",r&&"vec4 sample11 = texelFetchWithFallback(uTileIntensityValues, cellEnd, tileDimensions)",r&&"float intensity00 = "+("float"===o?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${a})`),r&&"float intensity01 = "+("float"===o?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${a})`),r&&"float intensity10 = "+("float"===o?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${a})`),r&&"float intensity11 = "+("float"===o?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${a})`),r&&"vec2 lerpFactors = cellIndex - vec2(cellStart)",r&&"float intensityR1 = mix(intensity00, intensity10, lerpFactors.x)",r&&"float intensityR2 = mix(intensity01, intensity11, lerpFactors.x)",r&&"float intensityP = mix(intensityR1, intensityR2, lerpFactors.y)",!r&&"vec4 sample0 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",!r&&"float intensityP = "+("float"===o?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${a})`)),...n?Fg("intensityP",n.lut):[]]}}})},Yg={"2D":"\nvoid main(void) {\n gl_Position = vec4(posWorld, 0.0, 1.0 );\n}\n","2DMatrix":"\nvoid main(void) {\n gl_Position = posWorld;\n}\n","3D":"\nuniform mat4 uViewProjectionMatrix;\nvoid main(void) {\n gl_Position = uViewProjectionMatrix * vec4(posWorld, 1.0);\n}\n"},Hg={FragmentShader:"\nuniform float uIsHighlighted;\nuniform vec4 uHighlightColorOffset;\nuniform float uRenderEffectMask;\nvoid main(void) {\n float antiAliasFactor = 1.0;\n vec4 fragColorEnd = colorFragment;\n if (fragColorEnd.a <= 0.0) { discard; }\n fragColorEnd = clamp(fragColorEnd + uIsHighlighted * uHighlightColorOffset, vec4(0.0), vec4(1.0));\n fragColorEnd = mix(fragColorEnd, vec4(1.0), uRenderEffectMask * fragColorEnd.a * 1000.0);\n gl_FragColor = vec4(fragColorEnd.rgb, fragColorEnd.a * antiAliasFactor);\n}\n",Empty:"\nvoid main(void) {\n}\n"};class Xg{constructor(t,e,i,s,n){if(this.id=t,this.shader=i,this.gl=s,this.info=n,!e||!i)throw new mt(`Could not find ${this.uR()} ${this.cR()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}uR(){return this.id.toString()}cR(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class jg extends Xg{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class $g extends Xg{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class qg{constructor(t,e,i,s){this.dR=new Map,this.fR=new Map,this.AR=i,this.gR=i.createProgram(),this.pR=`${t.uR()} vertex`,this.mR=`${e.uR()} fragment`,i.attachShader(this.gR,t.shader),i.attachShader(this.gR,e.shader),i.bindAttribLocation(this.gR,0,"aPos"),i.linkProgram(this.gR),i.deleteShader(t.shader),i.deleteShader(e.shader),this.allAttributeNames=t.info.allAttributeNames,this.allUniformNames=Array.from(new Set(t.info.allUniformNames.concat(e.info.allUniformNames)).values()),this.vertexSharedRemovedVariables=t.info.removedVariableNames,this.fragmentSharedRemovedVariables=e.info.removedVariableNames}get vertexShaderSrc(){return""}get fragmentShaderSrc(){return""}yR(t){return fe(0,(()=>ge()))}SR(t){const e=this.vR(t);if(void 0===e)throw this.yR(`Could not get ${t} uniform from ${this.pR} and ${this.mR} shaders.`);return e}vR(t){const e=this.dR.get(t);if(e)return e;const i=this.AR.getUniformLocation(this.gR,t);return i?(this.dR.set(t,i),i):void 0}xR(t){const e=this.bR(t);if(void 0===e)throw this.yR(`Could not get ${t} attribute from ${this.pR} and ${this.mR} shaders.`);return e}bR(t){const e=this.fR.get(t);if(e||0===e)return e;const i=this.AR.getAttribLocation(this.gR,t);return i>=0?(this.fR.set(t,i),i):void 0}W(){this.AR.deleteProgram(this.gR)}}const Jg=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/,Kg=t=>{let e;try{e=St.getComputedStyle(t)}catch(t){return null}return e};function Zg(t){const e=Kg(t);return!!e&&("fixed"===e.position||!!("auto"!==e.zIndex&&"static"!==e.position||function(t){const e=Kg(im(t)),i=e?e.display:"auto";return"flex"===i||"inline-flex"===i}(t))||+e.opacity<1||"transform"in e&&"none"!==e.transform||"webkitTransform"in e&&"none"!==e.webkitTransform||"mixBlendMode"in e&&"normal"!==e.mixBlendMode||"filter"in e&&"none"!==e.filter||"webkitFilter"in e&&"none"!==e.webkitFilter||"isolation"in e&&"isolate"===e.isolation||!!Jg.test(e.willChange)||"touch"===e.webkitOverflowScrolling)}function Qg(t){let e=t.length;for(;e--;)if(Zg(t[e]))return t[e];return null}function tm(t){var e;return t&&Number((null===(e=Kg(t))||void 0===e?void 0:e.zIndex)||0)||0}function em(t){const e=[];for(;t;)e.push(t),t=im(t);return e}function im(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.host)||t.parentNode}class sm extends ag{constructor(t){if(super(),this.MR=new Map,this._R=new Map,this.wR=new Map,this.CR=!0,this.kR=null,this.TR=null,this.FR=null,this.IR=null,this.PR=0,this.DR=0,this.BR=0,this.LR=!1,this.RR=!0,this.$i=!1,this.ER=le(`chart-engine-${(new Date).getTime()}${Math.trunc(1e6*Math.random()).toString()}`),this.X={x:100,y:100},this.VR=()=>{this.zR&&clearTimeout(this.zR),this.zR=setTimeout((()=>this.Ur()),12)},this.OR=t=>{const e=t.intersectionRatio>0,i=t.target.getAttribute("data-lcjs-engine-id");if(i){const t=this.MR.get(i);if(t){const s=t.NR();t.GR(e),e?this._R.set(i,t):this._R.delete(i),s!==e&&t.bs()}}},this.WR=(t,e,i,s,n)=>{const r=n[0],o=this.gl;if(o.bindFramebuffer(null==o?void 0:o.FRAMEBUFFER,null),o.useProgram(this.TR.gR),o.clear(o.COLOR_BUFFER_BIT),r.Rr.getBoundingClientRect()){const t=r.UR();o.viewport(0,0,t.x,t.y),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,r.YR),o.uniform1i(this.PR,0),o.uniformMatrix4fv(this.DR,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o.bindBuffer(o.ARRAY_BUFFER,this.FR),o.enableVertexAttribArray(0),o.vertexAttribPointer(this.BR,2,o.FLOAT,!1,0,0),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),r.HR&&(r.HR.clearRect(0,0,r.HR.canvas.width,r.HR.canvas.height),r.HR.drawImage(this.$R,0,this.$R.height-t.y,t.x,t.y,0,0,r.HR.canvas.width,r.HR.canvas.height))}},this.XR=(t,e,i,s,n)=>{const r=this.gl;r.bindFramebuffer(null==r?void 0:r.FRAMEBUFFER,null),r.useProgram(this.TR.gR),r.clear(r.COLOR_BUFFER_BIT),n.forEach((i=>{const n=i.Rr.getBoundingClientRect();if(n){const i=n.right-n.left,o=n.bottom-n.top,a=n.left,h=s-n.bottom;r.viewport(a*this.jR-t*this.jR,h*this.jR+e*this.jR,i*this.jR,o*this.jR)}r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,i.YR),r.uniform1i(this.PR,0),r.uniformMatrix4fv(this.DR,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),r.bindBuffer(r.ARRAY_BUFFER,this.FR),r.enableVertexAttribArray(0),r.vertexAttribPointer(this.BR,2,r.FLOAT,!1,0,0),r.drawArrays(r.TRIANGLES,0,6)})),r.bindFramebuffer(r.FRAMEBUFFER,null)},this.ZR=(t,e,i,s,n)=>{const r=n[0],o=this.gl2.ctx;o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),o.clear(o.COLOR_BUFFER_BIT);const a=r.UR();o.bindFramebuffer(o.READ_FRAMEBUFFER,r.QR[1]),o.blitFramebuffer(0,0,a.x,a.y,0,this.$R.height-a.y,a.x,this.$R.height,o.COLOR_BUFFER_BIT,o.LINEAR),r.HR&&(r.HR.clearRect(0,0,r.HR.canvas.width,r.HR.canvas.height),r.HR.drawImage(this.$R,0,0)),o.bindFramebuffer(o.FRAMEBUFFER,null)},this.JR=(t,e,i,s,n)=>{const r=this.gl2.ctx;r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.clear(r.COLOR_BUFFER_BIT),n.forEach((i=>{const n=i.Rr.getBoundingClientRect();if(n){const o=n.right-n.left,a=n.bottom-n.top,h=n.left,l=s-n.bottom,u=i.UR();r.bindFramebuffer(r.READ_FRAMEBUFFER,i.QR[1]),r.blitFramebuffer(0,0,u.x,u.y,h*this.jR-t*this.jR,l*this.jR+e*this.jR,(h-t+o)*this.jR,(l+e+a)*this.jR,r.COLOR_BUFFER_BIT,r.LINEAR)}})),r.bindFramebuffer(r.FRAMEBUFFER,null)},this.zR=void 0,this.En=t,!St.requestAnimationFrame||!St.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");let e=1;if(t&&t.KR)e=!0===t.KR?St.devicePixelRatio||1:t.KR||1;else{const t=St.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(e=St.devicePixelRatio||1)}this.jR=e,t.oo=!0===t.oo,this.RR=!1!==t.qR,this.tE=!1!==t.iE,this.sE=t.sE||!1;let i=!1;if(t.$R)if("string"==typeof t.$R){const e=St.document.getElementById(t.$R);if(!e)throw new Error(`Canvas "${t.$R}" doesn't exist.`);this.$R=e,i=!0}else this.$R=t.$R,i=!0;else this.$R=St.document.createElement("canvas");const s={preserveDrawingBuffer:!0,alpha:!0,antialias:!1};if(2!==t.eE&&t.eE){const e=this.$R.getContext("webgl",{...s,antialias:!!t.qR})||this.$R.getContext("experimental-webgl",{...s,antialias:!!t.qR});this.gl=e,this.hE=!1}else{const t=this.$R.getContext("webgl2",s);this.gl2={ctx:t},this.gl=t,this.hE=!0}if(!this.gl)throw new gt("No WebGL context available."+((null==t?void 0:t.eE)?`\nSelected explicit target: WebGL ${t.eE}`:""));const n=[];if(this.rE={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.rE).forEach((t=>{null===this.rE[t]&&n.push(t)})),this.hE)this.nE=!0;else{const t={ANGLE_instanced_arrays:this.gl.getExtension("ANGLE_instanced_arrays"),EXT_blend_minmax:this.gl.getExtension("EXT_blend_minmax"),OES_element_index_uint:this.gl.getExtension("OES_element_index_uint"),OES_standard_derivatives:this.gl.getExtension("OES_standard_derivatives"),OES_vertex_array_object:this.gl.getExtension("OES_vertex_array_object")};t.OES_standard_derivatives||(this.CR=!1),Object.keys(t).forEach((e=>{null===t[e]&&n.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.nE=!!e.OES_texture_float,this.gl1={ctx:this.gl,rE:t,optional:e}}const r=n;if(r.length>0&&!1!==t.oo){const t=St.document.createElement("div");t.innerText="LightningChart JS: Some features might not work properly, due to missing WebGL features.",t.style.cssText="position:absolute;top:0;background:red;width:100%;padding:10px;text-align:center;color:white;z-index:1;";const e=St.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),St.document.body.appendChild(t),t.appendChild(e),St.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",r.join(", "))}if(this.oE=this.sE?this.aE(this.hE?this.ZR.bind(this):this.WR.bind(this)).bind(this):this.lE(this.hE?this.JR.bind(this):this.XR.bind(this)).bind(this),St.ResizeObserver){const t=t=>{for(const e of t)e.target===this.$R&&this.uE()};this.co=new St.ResizeObserver(t.bind(this)),this.co.observe(this.$R)}if(this.cE=((t,e)=>{const i=t,s=new Map,n=new Map,r=new Map,o={totalMs:0,vertexShaders:0,fragmentShaders:0,programs:0},a=(t,i,s=[])=>{const n=[],r=[],o={allAttributeNames:Array.from(t.matchAll(/attribute\s[^\s]*\s(.*);/g)).map((t=>t[1])),allUniformNames:Array.from(t.matchAll(/uniform\s[^\s]*\s(.*);/g)).map((t=>t[1])),allVaryingNames:Array.from(t.matchAll(/varying\s[^\s]*\s(.*);/g)).map((t=>t[1])),removedVariableNames:[]};if(e){const e=t.match(/#extension.*/g);e&&r.push(...e),t=t.replace(/#extension.*/g,"")}else if(n.push("#version 300 es"),(t=(t=(t=t.replace(/#extension.*/g,"")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).includes("usampler2D")&&n.push("precision highp usampler2D;"),"vertex"===i)t=t.replace(/varying/g,"out");else{t=t.replace(/varying/g,"in");const e=s.find((t=>"fragOutput"===t.type));t=(t=e?`out ${e.fragOutput} fragOutput;\n${t}`:`out vec4 fragOutput;\n${t}`).replace(/gl_FragColor/g,"fragOutput")}return r&&n.push(...r),n.push("precision highp float;"),n.push("precision highp int;"),{source:t=`${n.join("\n")}\n${t}`,info:o}};return(...t)=>{const h=e?"webgl1":"webgl2";let l,u,c,d,f,g,m,p,y;try{const e=St.performance.now();l=t.filter((t=>!1!==t&&void 0!==t)),u=((t,e)=>{const i=t.map((i=>i.apply(t,e))),s=i.map((t=>t.idVertex)).filter((t=>void 0!==t)).sort().join(" "),n=i.map((t=>t.idFragment)).filter((t=>void 0!==t)).sort().join(" "),r=`vert: ${s} frag: ${n}`;let o,a=!1,h=!1;const l=[];let u;const c=[],d=[];if(i.forEach((t=>{if(t.defaultVertexShader&&(a||(o=t.defaultVertexShader)),t.vertexShader){if(o&&a&&o!==t.vertexShader)throw new Pg(`Conflicting vertex shader templates ${o} vs ${t.vertexShader}`,r,t);o=t.vertexShader,a=!0}if(t.vertexShaderModifiers)for(const e of t.vertexShaderModifiers)void 0!==e&&!1!==e&&l.push(e);if(t.defaultFragmentShader&&(h||(u=t.defaultFragmentShader)),t.fragmentShader){if(u&&h&&u!==t.fragmentShader)throw new Pg(`Conflicting fragment shader templates ${u} vs ${t.fragmentShader}`,r,t);u=t.fragmentShader,h=!0}if(t.fragmentShaderModifiers)for(const e of t.fragmentShaderModifiers)void 0!==e&&!1!==e&&c.push(e);t.hints&&t.hints.forEach((t=>{t&&d.push(t)}))})),!o)throw new Pg("No vertex shader template defined",r);if(!u)throw new Pg("Fragment shader not defined",r);return{id:r,vertexShader:{id:s,template:o,modifiers:l},fragmentShader:{id:n,template:u,modifiers:c},hints:d}})(l,h);const A=r.get(u.id);if(c="new",A)return c="existing",g=A.vertexShaderSrc,m=A.fragmentShaderSrc,A;const x=u.vertexShader.id;let S=s.get(x);if(S)g=S.src,d="existing";else{d="new";const t=new Sg(u.vertexShader.modifiers).build(Yg[u.vertexShader.template]),{source:e,info:n}=a(t,"vertex");g=e,p=n,S=new jg(x,e,i,n),s.set(x,S),o.vertexShaders+=1}const b=u.fragmentShader;let v;const M=b.id;if(v=n.get(M),v)m=v.src,f="existing";else{f="new";const t=Hg[b.template],e=new Sg([...b.modifiers]).build(t),{source:s,info:r}=a(e,"fragment",u.hints);m=s,y=r,v=new $g(M,s,i,r),n.set(M,v),o.fragmentShaders+=1}const T=new qg(S,v,i,u);return r.set(u.id,T),o.programs+=1,o.totalMs+=St.performance.now()-e,T}catch(t){throw fe(0,(()=>{const t="Unexpected LightningChart JS rendering error.\nThis can mean a bug in the library, or that it is simply used in unsupported manner (passing wrong type to method, using disposed component, etc).";return St.alert(t),new Error(t)}))}}})(this.gl,!this.hE),this.iR=(()=>{const t=St.document.createElement("canvas"),e=t.getContext("2d",{willReadFrequently:!0});if(!e)throw new gt("Failed to get Text canvas rendering context");return e.fillStyle="#fff",(i,s,n,r)=>{const o=`${s.style} ${s.weight} ${s.size*n}px ${s.family}`;e.font=o,e.textBaseline="alphabetic",e.textAlign="left";const a=e.measureText(i);if(0===a.width)return;const h=void 0!==a.actualBoundingBoxLeft&&void 0!==a.actualBoundingBoxRight?Math.ceil(a.actualBoundingBoxLeft+a.actualBoundingBoxRight):Math.ceil(a.width),l=a.width,c=Math.round(s.size*n),d=void 0!==a.actualBoundingBoxLeft?a.actualBoundingBoxLeft:0;t.width=h>0?h:l,t.height=2*c,e.font=o,e.textBaseline="alphabetic",e.textAlign="left",r?(e.clearRect(0,0,t.width,t.height),e.fillStyle="#fff"):(e.fillStyle="rgba(255,255,255,0)",e.fillRect(0,0,t.width,t.height),e.fillStyle="#000"),e.fillText(i,d,c);const f=e.getImageData(0,0,t.width,t.height);let g=0,m=0;const p=f.width;for(let t=0;t=0;t-=1){for(let e=0;e{for(let e=0;ee/100))})),St.addEventListener("resize",this.VR,{passive:!0}),!this.hE){if(this.TR=this.cE(Wg["2DCompose"],Wg.Color({dataType:"texture-coord-calc-gpu"}),Wg.VertexLocation({axisWorldTranslation:"matrix4",normalSource:void 0,coordType:"vec4"})),!this.TR.gR)throw new gt("Unable to setup composition shader!");const t=this.gl,e=t.getUniformLocation(this.TR.gR,"uColorTexture");if(!e)throw new gt("Unable to setup composition shader! Failed to find uColorTexture");const i=t.getUniformLocation(this.TR.gR,"uMatrix");if(!i)throw new gt("Unable to setup composition shader! Failed to find uMatrix");this.PR=e,this.DR=i,this.BR=t.getAttribLocation(this.TR.gR,"aPos"),this.FR=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.FR),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),this.IR=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.IR),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,0,0,1,1,1]),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null)}}aE(t){return e=>{this.kR=null;const i=this.gl.canvas,s=Array.from(this._R.values());this.LR=!1,s.forEach((s=>{const n=s.UR();(this.X.x{this.kR=null,"style"in this.gl.canvas&&!this.En.pE&&(this.gl.canvas.style.transform=`translateX(${window.scrollX}px) translateY(${window.scrollY}px)`);const i=this.gl.canvas,s=this.$R.clientHeight,n=this.$R.clientWidth;let r=0,o=0;if(i instanceof HTMLCanvasElement){i.width===n*this.jR&&i.height===s*this.jR||(i.width=n*this.jR,i.height=s*this.jR);const t=i.getBoundingClientRect();r=t.x,o=t.y}const a=Array.from(this._R.values());this.LR=!1,a.sort(((t,e)=>t.mE()-e.mE())).forEach((t=>{t.Jr&&t.gE(e)})),t(r,o,n,s,a),this.LR&&this.uE()}}uE(t){return!this.LR&&t&&(this.LR=!0),this.kR||this.$i||(this.kR=St.requestAnimationFrame(this.oE)),this}yE(t){const e=this.ER();return t.Rr.setAttribute("data-lcjs-engine-id",e),this.MR.set(e,t),t.SE(this.MR.size-1),t.GR(!0),this._R.set(e,t),this.AE&&this.AE.observe(t.Rr),this.zR&&clearTimeout(this.zR),this.zR=setTimeout((()=>this.Ur()),0),this}vE(t){const e=t.Rr.getAttribute("data-lcjs-engine-id");return e?(this.MR.delete(e),this._R.delete(e),this.AE&&this.AE.unobserve(t.Rr),t.Rr.removeAttribute("data-lcjs-engine-id"),this):this}Ur(){if(this.AE){const t=this.AE.takeRecords();for(let e=0;efunction(t,e){if(t===e)throw new Error("Cannot compare node with itself");const i={a:em(t),b:em(e)};let s;for(;i.a[i.a.length-1]===i.b[i.b.length-1];)t=i.a.pop(),e=i.b.pop(),s=t;const n=tm(Qg(i.a)),r=tm(Qg(i.b));if(n===r&&s){const t=s.childNodes,e={a:i.a[i.a.length-1],b:i.b[i.b.length-1]};let n=t.length;for(;n--;){const i=t[n];if(i===e.a)return 1;if(i===e.b)return-1}}return Math.sign(n-r)}(t.Rr,e.Rr))).forEach(((t,e)=>t.SE(e))),this.uE(!0),this}UI(){return this.uE(),this}W(){var t;if(this.$i)return;this.$i=!0,super.W(),this.kR&&(St.cancelAnimationFrame(this.kR),this.kR=null),this.LR=!1,this.co&&(this.co.disconnect(),this.co=void 0),this.AE&&(this.AE.disconnect(),this.AE=void 0),St.removeEventListener("resize",this.VR),this.VR=void 0,this.MR.forEach((t=>{t.W()})),this.MR.clear(),Array.from(this.wR.values()).forEach((t=>{t.GL(!0)})),this.wR.clear();const e=this.gl;e.deleteBuffer(this.FR),e.deleteBuffer(this.IR),this.$R&&!this.En.$R?(this.$R.width=1,this.$R.height=1,null===(t=this.$R.parentElement)||void 0===t||t.removeChild(this.$R),this.$R=void 0):this.$R=void 0,this.cE=void 0,this.iR=void 0,this.oE=()=>{},this.rE.WEBGL_lose_context&&this.rE.WEBGL_lose_context.loseContext()}}const nm=(t,e,i,s)=>n=>{const r={theme:ng,...i,...n},o=t(r),a=e||s?rg(o,s):void 0,h=new Cf(o.En,n,o,o.W.bind(o),a);return o.Co((t=>h.yL(t))).wo((()=>h.j())).bs(),h},rm=(t,e)=>{t.Co((t=>{e.Fe(t)})).wo((()=>e.j())).bs()},om=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new Na(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a);return rm(o,h),h},am=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new Pd(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,n);return rm(o,h),h},hm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new hc(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,n);return rm(o,h),h},lm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new pu(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,n);return rm(o,h),h},um=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new(n&&n.type?n.type:Dh)(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0,n);return rm(o,h),h},cm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new(n&&n.type?n.type:Vu)(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0,!0!==(null==n?void 0:n.disableAnimations)&&!1!==(null==n?void 0:n.animationsEnabled));return rm(o,h),h},dm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new(n&&n.type?n.type:Eu)(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0,n);return rm(o,h),h},fm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new(n&&n.type?n.type:Hu)(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0,n);return rm(o,h),h},gm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new Al(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,n,void 0);return rm(o,h),h},mm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new hl(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0,n);return rm(o,h),h},pm=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new uf(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0);return rm(o,h),h},ym=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new bf(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,void 0,n);return rm(o,h),h},Am=(t,e,i,s)=>n=>{const r={...i,...n,theme:(null==n?void 0:n.theme)||ng},o=t(r),a=e||s?rg(o,s):void 0,h=new dd(o.En,Od(o,1).aI(0),ht,o.W.bind(o),a,n);return rm(o,h),h};function xm(t,i,s,n,r,o){let a=i.x.ct(t.max.x),h=i.x.ct(t.min.x),l=i.y.ct(t.max.y),u=i.y.ct(t.min.y),c=a-h,d=l-u;if(c<1){const t=(h+a)/2;h=t-.5,a=t+.5,c=1}if(d<1){const t=(u+l)/2;u=t-.5,l=t+.5,d=1}const f=c/d,g=c*s.x,m=d*s.y,p=c-g,y=d-m,A=g>p?[p,g]:[g,p],x=m>y?[y,m]:[m,y];let S,b,v=1,M=1;switch(n){default:case e.GradientExtent.closestSide:if(S=A[0]/c,b=x[0]/d,r===e.GradientShape.circle){const t=Math.min(S*f,b);v=t,M=t}else v=S*f,M=b;break;case e.GradientExtent.farthestSide:if(S=A[1]/c,b=x[1]/d,r===e.GradientShape.circle){const t=Math.max(S*f,b);v=t,M=t}else v=S*f,M=b;break;case e.GradientExtent.closestCorner:if(b=x[0]/d,r===e.GradientShape.circle){S=A[0]/c*f;const t=Math.sqrt(S*S+b*b);v=t,M=t}else{S=A[0]/c;const t=Math.sqrt(S*S+b*b);v=t*f,M=t}break;case e.GradientExtent.farthestCorner:if(b=x[1]/d,r===e.GradientShape.circle){S=A[1]/c*f;const t=Math.sqrt(S*S+b*b);v=t,M=t}else{S=A[1]/c;const t=Math.sqrt(S*S+b*b);v=t*f,M=t}}return{bounds:[h*o,u*o,c*o,d*o],center:[s.x*f,s.y],distance:[Math.max(v,1e-4),Math.max(M,1e-4)],aspectRatio:f}}function Sm(t,e,i,s){const n=e.x.ct(t.max.x),r=e.x.ct(t.min.x),o=e.y.ct(t.max.y),a=e.y.ct(t.min.y),h=n-r,l=o-a,c=Math.abs(h*Math.sin(i))+Math.abs(l*Math.cos(i)),d=u(h/2-Math.sin(i)*(c/2),l/2-Math.cos(i)*(c/2)),f=u(h/2+Math.sin(i)*(c/2),l/2+Math.cos(i)*(c/2));return{bounds:[r*s,a*s,h*s,l*s],startPoint:[d.x*s,d.y*s],endPoint:[f.x*s,f.y*s]}}class bm{constructor(t){this.zL=t}}class vm{constructor(){this.xE=new Array,this.bE=t=>(this.xE.push(t),t),this.ME=this.bE(new Map),this._E=this.bE(new Map),this.wE=this.bE(new Map),this.CE=this.bE(new Map),this.kE=this.bE(new Map),this.TE=this.bE(new Map),this.FE=this.bE(new Map)}IE(){this.xE.forEach((t=>{t.forEach((t=>t.IE())),t.clear()}))}}const Mm=(t,e,i)=>()=>{t.PE=e,i&&i()},Tm=(t,i,s,n,r)=>{const o=Math.min(s/t,n/i),a=t*o,h=i*o,l=s/a,u=n/h,c=a/s,d=h/n;let f=0,g=1,m=0,p=1;switch(r){case e.ImageFitMode.Fill:u{this.EE=!0,this.GE()})),this.Mc.addEventListener("error",(()=>{this.VE=!0})),this.Mc.complete&&(this.EE=!0,this.GE());else if(this.Mc instanceof St.HTMLVideoElement){const t=this;this.Mc.addEventListener("canplay",(function(){t.BE=this.videoHeight,t.DE=this.videoWidth,t.EE=!0,t.GE()}),!0),this.Mc.addEventListener("play",Mm(this,!0,(()=>this.GE()))),this.Mc.addEventListener("playing",Mm(this,!0,(()=>this.GE()))),this.Mc.addEventListener("pause",Mm(this,!1)),this.Mc.addEventListener("ended",Mm(this,!1)),this.Mc.readyState>=1&&(this.DE=this.Mc.videoWidth,this.BE=this.Mc.videoHeight,this.PE=!this.Mc.paused,this.EE=!0,this.GE())}else this.EE=!0,this.GE()}JL(t){0===this.OE.size&&this.EE&&this.GE(),this.OE.add(t)}KL(t){this.OE.delete(t),0===this.OE.size&&this.unbindResources()}WE(t){this.zE.add(t),this.RE&&(t(),this.UE(t))}UE(t){this.zE.delete(t)}GE(){if(this.VE||this.RE||!this.EE)return;const t=this.AR.gl;if(!this.NE&&this.Mc&&t){this.NE=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.NE),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,n=t.UNSIGNED_BYTE,r=this.Mc,o=this.DE>0?this.DE:r.width,a=this.BE>0?this.BE:r.height;t.texImage2D(t.TEXTURE_2D,e,i,s,n,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.DE=o,this.BE=a,t.bindTexture(t.TEXTURE_2D,null)}this.RE=!0,this.zE&&this.zE.forEach((t=>{t(),this.UE(t)}))}Ds(){const t=this.AR.gl;if(!this.VE&&this.RE&&this.NE){const e=0,i=t.RGBA,s=t.RGBA,n=t.UNSIGNED_BYTE,r=this.Mc;r&&(t.bindTexture(t.TEXTURE_2D,this.NE),t.texImage2D(t.TEXTURE_2D,e,i,s,n,r))}}YE(){return this.NE}unbindResources(){return this.RE&&(this.NE&&(this.AR.WL(this.NE),this.NE=null),this.RE=!1),this}}class Em extends Un{constructor(t,e,i){super(t.us,e,i),this.Rm=!0,this.Fm={},this.Bm=y(Nr),this.Ts=t,this.dt=t.dt}HE(){var t;return this.Bm.o&&this.Bm._().type!==(null===(t=this.$E)||void 0===t?void 0:t.type)}Nm(t){return this.Rm=t,this}XE(t){return this.Fm=t,this}}class km{constructor(t){this.vV=[],this.zL=t}xV(t,e){((t,e,i,s)=>{const n=t.sR(),r=Math.round(Math.min(i.spread,10)*n),o=Math.round(Math.min(i.blur,10)*n),a={x:Math.round(i.offset.x*n),y:Math.round(i.offset.y*n)},h=t.jE(),l=t.ZE(),u=t.QE(),c=t.JE(),d=t.KE();t.qE("disabled"),t.Nm(!1),t.tV(!1);const f=e.iV(),g=r+o/2;((t,e,i,s)=>{const n=t.gl,r=t.sR(),o=t.sV();t.eV(n.FRAMEBUFFER,s.frameBuffer),n.bindRenderbuffer(n.RENDERBUFFER,s.depthBuffer),n.bindTexture(n.TEXTURE_2D,s.texture),n.clearDepth(1),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT);const a=s.sizeDpr;t.hV(0,0,a.x,a.y),e.forEach((e=>{let s;if(e instanceof Wn?s=e.Ts.lg():e instanceof Em&&(s=e.Ts.RS()),s){const e=s.x+i.left,n=s.y+i.bottom,o=Math.max(s.width-(i.left+i.right),0),a=Math.max(s.height-(i.bottom+i.top),0);t.rV(e*r,n*r,o*r,a*r)}else t.tV(!1);e.yL(2)})),t.eV(n.FRAMEBUFFER,o),n.bindRenderbuffer(n.RENDERBUFFER,null),n.bindTexture(n.TEXTURE_2D,null),t.tV(!1)})(t,s,{left:g+(a.x<0?-a.x:0),top:g+(a.y>0?a.y:0),right:g+(a.x>0?a.x:0),bottom:g+(a.y<0?-a.y:0)},f);let m=f;const p=r+o+5,y=((t,e,i,s)=>{const n=(t=>{const e=[];for(let i=0;iRe(n,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),n=qe(n,s))}while(s);e.push(n)}return e})(e.map((t=>{const e=t instanceof Wn||t instanceof Em?t.Ts.nV(t):Le;if(me(e))return Le;const n={min:{x:Math.max(e.min.x-i.left,0),y:Math.max(e.min.y-i.bottom,0)},max:{x:Math.min(e.max.x+i.right,s.x),y:Math.min(e.max.y+i.top,s.y)}};return n.max.x<=n.min.x||n.max.y<=n.min.y?Le:n})).filter((t=>!me(t)))),r=6*n.length,o=new Float32Array(4*r);let a=0;return n.forEach((t=>{const e=ai(t.min,s),i=ai(t.max,s),n=e,r=i;o[a+0]=e.x,o[a+1]=e.y,o[a+2]=n.x,o[a+3]=n.y,o[a+4]=i.x,o[a+5]=e.y,o[a+6]=r.x,o[a+7]=n.y,o[a+8]=i.x,o[a+9]=i.y,o[a+10]=r.x,o[a+11]=r.y,o[a+12]=i.x,o[a+13]=i.y,o[a+14]=r.x,o[a+15]=r.y,o[a+16]=e.x,o[a+17]=i.y,o[a+18]=n.x,o[a+19]=r.y,o[a+20]=e.x,o[a+21]=e.y,o[a+22]=n.x,o[a+23]=n.y,a+=24})),{vertexBuffer:t.oV(o),vertexCount:r}})(t,s,{left:p+(a.x<0?-a.x:0),top:p+(a.y>0?a.y:0),right:p+(a.x>0?a.x:0),bottom:p+(a.y<0?-a.y:0)},e.aV()),A=e.iV(f,m),x=t.cE(Wg["2D"],Wg.Glow1D({spreadPx:r,blurPx:o,firstPass:!0}),Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,n,r)=>{const o=t.gl,a=t.sV();t.eV(o.FRAMEBUFFER,i.frameBuffer),o.bindRenderbuffer(o.RENDERBUFFER,i.depthBuffer),o.bindTexture(o.TEXTURE_2D,i.texture),o.clearDepth(1),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),t.hV(0,0,i.sizeDpr.x,i.sizeDpr.y),t.lV(s,((a,h,l,u)=>(t.JL(s),r&&r(a),t.fV(a("uIsHighlighted"),0).AV(a("uHighlightColorOffset"),C).fV(a("uRenderEffectMask"),0).dV(a("uTexture"),e.texture,0).cV(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).cV(a("uScale"),i.uniforms.gV()).cV(a("uDisp"),i.uniforms.pV()).cV(a("uScaling"),[i.size.x,i.size.y]).cV(a("uTranslationAxis"),[0,0]).uV(n.vertexBuffer,void 0,{location:h("aPos"),size:2},{location:h("aTextureCoord"),size:2}).Pp(o.TRIANGLES,n.vertexCount,0),!0))),t.eV(o.FRAMEBUFFER,a),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,m,A,x,y,((e,i,s,n)=>(t.cV(e("uOffsetPx"),[a.x,a.y]),!0))),m=A,t.tV(l),t.mV(d);const S=t.cE(Wg["2D"],Wg.Glow1D({spreadPx:r,blurPx:o,firstPass:!1}),Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,n)=>{const r=t.gl,o={x:t.us.oi().x,y:t.us.oi().y};t.hV(0,0,o.x*t.sR(),o.y*t.sR());const a=ht.d2({scaleXYConstructor:Li}).q(o).zi(0,o.x).Oi(0,o.y),h=new Im;h.yV(a),t.lV(i,((a,l,u,c)=>(t.JL(i),n&&n(a),t.fV(a("uIsHighlighted"),0).AV(a("uHighlightColorOffset"),C).fV(a("uRenderEffectMask"),0).dV(a("uTexture"),e.texture,0).cV(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).cV(a("uScale"),h.gV()).cV(a("uDisp"),h.pV()).cV(a("uScaling"),[o.x,o.y]).cV(a("uTranslationAxis"),[0,0]).uV(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).Pp(r.TRIANGLES,s.vertexCount,0),!0)))})(t,f,S,y,((e,s,n,r)=>(t.dV(e("uTextureFirstGlowPass"),A.texture,1).AV(e("uGlowColor"),i.color),!0))),t.hV(h.x,h.y,h.width,h.height),t.qE(u),t.Nm(c),t.SV(y.vertexBuffer)})(this.zL,this,e,t)}aV(){const t=this.zL.us.oi();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}iV(...t){const e=this.vV,i=this.aV(),s={x:Math.ceil(i.x*this.zL.sR()),y:Math.ceil(i.y*this.zL.sR())},n=this.zL.gl,r=e.find((e=>!t.includes(e)));if(r)return r.sizeDpr.x===s.x&&r.sizeDpr.y===s.y||(r.size=i,r.sizeDpr=s,n.bindTexture(n.TEXTURE_2D,r.texture),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,s.x,s.y,0,n.RGBA,n.UNSIGNED_BYTE,null),n.bindRenderbuffer(n.RENDERBUFFER,r.depthBuffer),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,s.x,s.y),n.bindTexture(n.TEXTURE_2D,null),n.bindRenderbuffer(n.RENDERBUFFER,null),r.scale.q(i).zi(0,i.x).Oi(0,i.y),r.uniforms.yV(r.scale)),r;const o=n.createTexture(),a=this.zL.bV(),h=this.zL.MV();n.bindTexture(n.TEXTURE_2D,o),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,s.x,s.y,0,n.RGBA,n.UNSIGNED_BYTE,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const l=this.zL.sV();this.zL.eV(n.FRAMEBUFFER,a),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,o,0),n.bindRenderbuffer(n.RENDERBUFFER,h),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,s.x,s.y),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,h),n.bindTexture(n.TEXTURE_2D,null),this.zL.eV(n.FRAMEBUFFER,l),n.bindRenderbuffer(n.RENDERBUFFER,null);const u=ht.d2({scaleXYConstructor:Li}).q(i).zi(0,i.x).Oi(0,i.y),c=new Im;c.yV(u);const d={size:i,sizeDpr:s,texture:o,frameBuffer:a,depthBuffer:h,scale:u,uniforms:c};return e.push(d),d}W(){[this.vV].forEach((t=>{t.forEach((t=>{this.zL._V(t.depthBuffer),this.zL.wV(t.frameBuffer),this.zL.WL(t.texture)})),t.length=0}))}}class Cm{constructor(t,i,s,n,r=!0){this.CV=new vm,this.kV=new Map,this.TV=new Map,this.FV=[],this.KR=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(St.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.Rm=!1,this.cV=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.IV=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.PV=(t,[e,i,s,n])=>(void 0===t||this.gl.uniform4f(t,e,i,s,n),this),this.DV=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.BV=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.LV=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.AV=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.fV=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.RV=(t,e)=>(this.gl.uniform1i(t,e),this),this.dV=(t,e,i)=>{if(void 0===t)return this;if(e){const s=this.gl.TEXTURE0+i;return this.gl.activeTexture(s),this.gl.bindTexture(this.gl.TEXTURE_2D,e),this.gl.uniform1i(t,i),this}throw new gt("Could not bind a texture.")},this.EV=t=>(((t,i)=>{i===e.ImageFitMode.Tile?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE))})(this.gl,t),this),this.oV=(t,e=!1,i)=>{const s=t.length,n=this.VV(s,i);if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof Float32Array?t:new Float32Array(t),e?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),n)return n;throw new gt("Could not create vertex buffer")},this.zV=(t,e,i,s=Float32Array)=>{const n=i||this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),e&&e.length===t?this.gl.bufferData(this.gl.ARRAY_BUFFER,e instanceof s?e:new s(e),this.gl.STATIC_DRAW):(this.gl.bufferData(this.gl.ARRAY_BUFFER,new s(t),this.gl.STATIC_DRAW),e&&this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,e instanceof s?e:new s(e))),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),n)return n;throw new gt("Could not create vertex buffer")},this.OV=(t,e,i,s=Float32Array)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferSubData(this.gl.ARRAY_BUFFER,e*s.BYTES_PER_ELEMENT,i instanceof s?i:new s(i)),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.NV=(t,e,i=!1)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferData(this.gl.ARRAY_BUFFER,e,i?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.GV=(t,e)=>{const i=t.length,s=this.VV(i,e);if(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,s),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),s)return s;throw new gt("Could not create index buffer")},this.WV=t=>{const e=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof Float32Array?t:new Float32Array(t),this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),e)return e;throw new gt("Could not create float buffer")},this.UV=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,2,this.gl.FLOAT,!1,0,0)),this),this.YV=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.vertexAttribPointer(t,3,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(t)),this),this.uV=(t,e,...i)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t);const s=i.length;let n=0;for(let t=0;t-1&&this.gl.enableVertexAttribArray(e)}let r=0;for(let t=0;t-1&&this.gl.vertexAttribPointer(e.location,e.size,this.gl.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),r+=e.size}if(void 0!==e)for(let t=0;t-1&&this.HV(s,e)}return this},this.$V=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.XV=(t,e)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(t,4,this.gl.FLOAT,!1,0,0)),this),this.jV=(t,e,i)=>(void 0===t||(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,e),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(t),void 0!==i&&this.HV(t,i)),this),this.ZV=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.QV=null,this.Pp=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.JV=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.KV=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.rE.ANGLE_instanced_arrays)return St.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.rE.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.qV=(t,e,i,s,n=this.gl.UNSIGNED_SHORT)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawElementsInstanced(t,e,n,i,s),this.gl1)){if(!this.gl1.rE.ANGLE_instanced_arrays)return St.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.rE.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,n,i,s)}return this},this.HV=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.rE.ANGLE_instanced_arrays)return St.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.rE.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.tz=(t,e,i,s=0)=>{const n=this.gl.TEXTURE0+s;this.gl.activeTexture(n);const r=this.sV();this.eV(this.gl.FRAMEBUFFER,e),this.gl.bindTexture(this.gl.TEXTURE_2D,i),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,i,0);const o=this.ZE();o&&this.tV(!1),t(),o&&this.tV(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.eV(this.gl.FRAMEBUFFER,r)},this.Nt=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this),this.iz=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.JL=t=>(this.gl.useProgram(t.gR),this),this.sz=!1,this.ez=[],this.us=t,this.fs=i,this.us=t,this.gl=s.ctx,this.hz=s.antialias,this.rz=!!this.us.Yr.CR&&s.lineAntialias,this.nE=this.us.Yr.nE,this.nz=new Map,this.gl1=this.us.Yr.gl1,this.gl2=this.us.Yr.gl2,r&&(this.mV(!0),this.oz()),this.rE=this.us.Yr.rE,this.NL=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.$L=this.az(),this.cE=this.us.Yr.cE,this.lz=new Fm(this),this.iR=this.us.Yr.iR,this.uz=new km(this),this.wR=this.us.Yr.wR,this.cz=this.oV([0,0,1,0,1,1,0,1]),this.dz=this.oV([0,0,1,0,0,1,0,1,1,0,1,1])}qE(t){return t!==this.fz&&(this.fz=t,"disabled"===t?this.gl.disable(this.gl.CULL_FACE):"cull-back"===t?(this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.BACK)):"cull-front"===t&&(this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.FRONT))),this}QE(){return this.fz||"disabled"}Nm(t){return t!==this.Rm&&(this.Rm=t,t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)),this}JE(){return this.Rm}Az(t){return this.KR=t,this}sR(){return this.KR}VV(t,e){let i;if(e){const s=this.nz.get(e);s&&s.size>=t&&s.size-t<1e6?i=e:this.SV(e)}return i||(i=this.gl.createBuffer(),this.nz.set(i,{size:t})),i}gz(t,e=this.gl.RGBA,i=!1,s,n,r=!1,o=this.gl.UNSIGNED_BYTE,a=e){const h=this.gl.createTexture();if(!h)throw new gt("Couldn't reserve Texture.");return this.gl.bindTexture(this.gl.TEXTURE_2D,h),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),t&&null===n?this.gl.texImage2D(this.gl.TEXTURE_2D,0,a,e,o,t):n&&this.gl.texImage2D(this.gl.TEXTURE_2D,0,a,n.x,n.y,0,e,o,t),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,s?this.gl.NEAREST:this.gl.LINEAR),i?(this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR_MIPMAP_LINEAR),this.gl.generateMipmap(this.gl.TEXTURE_2D)):this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,s?this.gl.NEAREST:this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),h}WL(t){this.gl.deleteTexture(t)}bV(){const t=this.gl.createFramebuffer();if(!t)throw new gt("Couldn't reserve Framebuffer.");return t}eV(t,e){this.QV=e,this.gl.bindFramebuffer(t,e)}sV(){return this.QV}wV(t){this.gl.deleteFramebuffer(t)}MV(){const t=this.gl.createRenderbuffer();if(!t)throw new gt("Couldn't reserve Render buffer.");return t}_V(t){this.gl.deleteRenderbuffer(t)}hV(t,e,i,s){return this.gl.viewport(t,e,i,s),this.pz&&t===this.pz.x&&e===this.pz.y&&i===this.pz.width&&s===this.pz.height||(this.pz={x:t,y:e,width:i,height:s}),this}jE(){return this.pz||{x:0,y:0,width:0,height:0}}rV(t,e,i,s){return this.tV(!0),this.gl.scissor(Math.max(t,0),Math.max(e,0),Math.max(i,0),Math.max(s,0)),this}tV(t){return t===this.mz||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.mz=t),this}mV(t){return t!==this.sz&&(this.sz=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}KE(){return this.sz}oz(t,e,i,s){return t?(void 0!==t&&void 0!==e&&(void 0!==i&&void 0!==s?this.gl.blendFuncSeparate(t,e,i,s):this.gl.blendFunc(t,e)),this):(this.gl.blendFuncSeparate(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA),this)}ZE(){return void 0!==this.mz&&this.mz}lV(t,e){const i=new Lm(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}SV(t){t&&(this.gl.deleteBuffer(t),this.nz.delete(t))}yz(t,e,i){this.cV(t.uniform("uCenter"),e.center).cV(t.uniform("uDistance"),e.distance).PV(t.uniform("uBounds"),e.bounds).fV(t.uniform("uAspect"),e.aspectRatio);const s=i.getColorStops();if(s.length<2)throw new Error("Minimum two color stops required");for(let e=0;e=t)return this.wz.buffer;this.wz&&(this.SV(this.wz.buffer),this.wz=void 0);const e=t,i=new Float32Array(e);for(let t=0;th)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.ez.splice(this.ez.indexOf(l),1)}))}Pz(t,e,i,s,n,r,o,a){const h=this.gl,l=this.sV();this.eV(h.FRAMEBUFFER,t),h.readPixels(e,i,s,n,r,o,a),this.eV(this.gl.FRAMEBUFFER,l)}Dz(t){const e=this.TV.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new gt("Couldn't reserve Texture.");this.gl.bindTexture(this.gl.TEXTURE_2D,e);const s=[];let n=255;for(let e=0;e{t-=1;for(let e=1;e<32;e<<=1)t|=t>>1;return t+1})(s.length);for(let e=s.length;e{})),this;this.fV(s("uMinValue"),i.min),this.fV(s("uMaxValue"),i.max)}return this}Vz(t,e,i,s){const n=t=>{t.texCoordsBuffer=this.oV(s(t.texture.DE,t.texture.BE,t.imageFill.getFitMode()),!1,t.texCoordsBuffer)};if(e){let s=t;const r=e.getSource();if((!t||e!==t.imageFill)&&r){t&&(t.texture.KL(this),this.SV(t.texCoordsBuffer));const i=this.vz(r);i.JL(this),s={texture:i,imageFill:e,texCoordsBuffer:this.oV([]),sourceMissingTexture:this.gz(new Uint8Array(Object.values(e.getSourceMissingColor().toJS()).map((t=>255*t))),this.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{s&&e&&(n(s),this.us.bs())}},i.WE(s.textureReadyCallback),n(s)}return s&&s.texture.RE&&s.texture.LE&&s.texture.PE&&(s.texture.Ds(),this.us.bs()),i&&s&&s.texture.RE&&n(s),s}t&&(t.texture.KL(this),this.SV(t.texCoordsBuffer))}zz(t){t&&(t.texture.KL(this),t.texture.UE(t.textureReadyCallback),this.WL(t.sourceMissingTexture),this.SV(t.texCoordsBuffer))}Oz(t,e,i,s){const{uniform:n,uniformOptional:r,attribute:o}=t,a=i.dt;this.fV(n("uIsHighlighted"),1===e||2===e?0:i.Ko).AV(n("uHighlightColorOffset"),1===e||2===e?D:i.sa).fV(n("uRenderEffectMask"),2===e?1:0).cV(r("uRatioPxClip"),[2/this.us.oi().x,2/this.us.oi().y]).fV(r("uDevicePixelRatio"),this.sR()),a instanceof Li?this.cV(n("uScale"),s.uniforms.gV()).cV(n("uDisp"),s.uniforms.pV()).cV(r("uScaleStart_highpart"),s.uniforms.Nz()).cV(r("uScaleStart_lowpart"),s.uniforms.Gz()):a instanceof zi&&this.cV(r("uScaleStart"),s.uniforms.MixedScaleXY.uScaleStart).cV(r("uScaleStartLog"),s.uniforms.MixedScaleXY.uScaleStartLog).cV(r("uScaleInterval"),s.uniforms.MixedScaleXY.uScaleInterval).cV(r("uScaleIntervalLog"),s.uniforms.MixedScaleXY.uScaleIntervalLog).cV(n("uViewportStart"),s.uniforms.MixedScaleXY.uViewportStart).cV(n("uViewportSize"),s.uniforms.MixedScaleXY.uViewportSize);const h=!0===s.coordsHighPrecision;if(s.coordsX)if(h){const t=o("aPos_highpartX"),e=o("aPos_lowpartX");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.coordsX),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(e,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,1*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(e)}else this.jV(o("aPosX"),s.coordsX);if(s.coordsY)if(h){const t=o("aPos_highpartY"),e=o("aPos_lowpartY");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.coordsY),this.gl.vertexAttribPointer(t,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(t),this.gl.vertexAttribPointer(e,1,this.gl.FLOAT,!1,2*Float32Array.BYTES_PER_ELEMENT,1*Float32Array.BYTES_PER_ELEMENT),this.gl.enableVertexAttribArray(e)}else this.jV(o("aPosY"),s.coordsY);if(1===e)this.AV(n("uColor"),s.mousePickingColor);else{if(s.fillStyleSolid&&this.AV(n("uColor"),s.fillStyleSolid.getColor()),s.fillStylePaletted){if("value"===s.fillStylePaletted.getLookUpProperty()&&null!==s.lookupValueBuffer){if(!s.lookupValueBuffer)return!1;const t=o("aLookupValue");this.jV(t,s.lookupValueBuffer),void 0!==s.lookupValueAttribDivisor&&this.HV(t,s.lookupValueAttribDivisor)}this.Ez(t,s.fillStylePaletted.lut,s.lookupValueRange)}if(s.fillStyleLinearGradient){if(!s.linearGradientInfo)return!1;this.Sz(t,s.linearGradientInfo,s.fillStyleLinearGradient)}if(s.fillStyleRadialGradient){if(!s.radialGradientInfo)return!1;this.yz(t,s.radialGradientInfo,s.fillStyleRadialGradient)}if(s.fillStyleIndividual&&null!==s.colorBuffer){if(!s.colorBuffer)return!1;const t=o("aColor");this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s.colorBuffer),this.gl.vertexAttribPointer(t,4,this.gl.UNSIGNED_BYTE,!0,0,0),this.gl.enableVertexAttribArray(t),void 0!==s.colorAttribDivisor&&this.HV(t,s.colorAttribDivisor)}}return!0}Wz(t,e,i){if(t)return Sm(i||e.na(),e.dt,t.getAngle(!0),this.sR())}Uz(t,e,i){if(t)return xm(i||e.na(),e.dt,t.getPosition(),t.getExtent(),t.getShape(),this.sR())}}const Dm=async(t,e,i,s,n,r,o)=>{const a=t.fenceSync(t.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),((t,e,i)=>{const s=void 0!==i.flags?i.flags:0,n=void 0!==i.retryTimeout?i.retryTimeout:10;return new Promise(((i,r)=>{const o=()=>{const a=t.clientWaitSync(e,s,0);return a===t.WAIT_FAILED?r(new Error(`WebGL Sync WAIT_FAILED ${t.getError()}`)):a!==t.TIMEOUT_EXPIRED?i(void 0):void St.setTimeout(o,n)};St.setTimeout(o,0)}))})(t,a,{retryTimeout:10}).then((()=>(t.deleteSync(a),t.bindBuffer(e,i),t.getBufferSubData(e,s,n,r,o),t.bindBuffer(e,null),n))).catch((t=>{throw t}))};class Im{yV(t){if(t instanceof Li||t instanceof mu){const e=t.yi();this.Yz=e.x.scaling,this.$z=-e.x.displacement,this.Xz=e.y.scaling,this.jz=-e.y.displacement,this.Zz=e.x.highPrecisionOffset,this.Qz=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.Jz=e.y.highPrecisionOffset,this.Kz=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof zi&&(this.MixedScaleXY=t.yi());return this}pV(){return[this.$z,this.jz]}gV(){return[this.Yz,this.Xz]}Nz(){return[this.Zz,this.Jz]}Gz(){return[this.Qz,this.Kz]}}class _m{constructor(){this.Yz=0,this.Xz=0,this.qz=0,this.$z=0,this.jz=0,this.tO=0}iO(t){return this.Yz=t.et(),this.$z=t.getInnerStart()+.5*this.Yz*t.ht(),this}sO(t){return this.Xz=t.et(),this.jz=t.getInnerStart()+.5*this.Xz*t.ht(),this}eO(t){return this.qz=t.et(),this.tO=t.getInnerStart()+.5*this.qz*t.ht(),this}gV(){return[this.Yz,this.Xz,this.qz]}pV(){return[this.$z,this.jz,this.tO]}hO(t,e,i,s,n){const r=u(2*(t-i.x)/(i.width-i.x)-1,2*(e-i.y)/(i.height-i.y)-1),o=ol.multiply(s,[r.x,r.y,n,1]);return f(o[0],o[1],o[2])}}class Fm{constructor(t){this.zL=t}yL(t,e,i,s,n,r=0){const o=this.zL,a=void 0===s;if(!(s=s||o.bV()))throw new gt("Could not bind a framebuffer.");const h=o.jE(),l=o.KE();o.mV(!1),o.tz((()=>{o.hV(0,0,i.x,i.y),t()}),s,e,r),a&&o.wV(s),this.zL.iz(n),this.zL.hV(h.x,h.y,h.width,h.height),o.mV(l)}}class Lm{constructor(t,e){this.rO=[],this.nO=[],this.uniform=t=>{const e=this.shader.SR(t);return this.nO.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.vR(t);return this.nO.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.xR(t);return this.rO.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.rO)this.glUtils.$V(t.location),this.glUtils.HV(t.location,0)}}class zm extends Wn{constructor(t,e,i,s,n){super(t,e,i,s),this.oO=new Map,this.aO=t,this.lO=e,this.zL=t.uO(),this.cO=n,this.lO=e}dO(t){return!1}GL(){return this}yL(t){if(!this.cO||0!==t||0===this.oO.size)return this;const e=Array.from(this.oO.values()).map((t=>t.fO.filter((t=>t.AO)).map((t=>t.ts)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===e.length)return this;const i=this.cO;return this.zL.uz.xV(e,i),this}Ds(){return this}xt(){return 0}vt(){return 0}Mt(){return 0}bt(){return 0}Vl(){return 0}zl(){return 0}hs(t,e){const i={fO:[]},s=(t,e)=>{const s={ts:t||[],AO:void 0===e||e};i.fO.push(s);const n={ps:t=>(s.ts=t,n),xs:t=>(s.AO=t,n),Ms:()=>s.AO};return n},n={};Object.keys(e).forEach((t=>{const i=e[t],r=i.shapes||[],o=void 0===i.themeEffectEnabled||i.themeEffectEnabled,a=s(r,o);n[t]=a}));const r={gA:s,...n};this.oO.set(t,i);const o=t.onDispose((()=>{this.oO.delete(t),t.offDispose(o)}));return r}}const Pm=(t,e,i)=>((t,e,i,s)=>{const n=[];let r=0;const o=si(e,i/2);let a,h,l,c,d=t[t.length-1],f=0;for(let i=0;i0&&(d=t[i-1]),bt(a,d)&&(d=ni(a,ti(si(ri(h,a),-1)))),bt(a,h)&&(h=ni(a,ti(si(ri(d,a),-1))));const s=ai(d,e),g=ai(a,e),m=ai(h,e),p=ti(ri(g,s)),y=ti(ri(m,g)),A=ni(p,y),x=u(-A.y,A.x),S=u(-p.y,p.x),b=1/li(x,S),v=ii(x),M=ti(ri(p,y)),T=Math.sign(li(x,M))||1,w=oi(x,si(o,b)),E=oi(x,si(o,-b));if(v<1||b===1/0){let t={x:0,y:0},e={x:0,y:0},i={x:0,y:0},s={x:0,y:0};const l=u(-y.y,y.x),c=Math.sign(li(p,x))||T,g=oi(S,si(o,c)),m=oi(l,si(o,c));1===T?(t=g,e=E,i=m,s=E):(t=w,e=g,i=w,s=m);const A=4*We(d,a),v=4*We(a,h);(b>A||b>v)&&(1===T?(t=g,e=m,i=m,s=g):(t=m,e=g,i=g,s=m));const M=ni(a,t),k=ni(a,e),C=ni(a,i),D=ni(a,s);n[r]=M,r+=1,n[r]=k,r+=1,n[r]=C,r+=1,n[r]=D,r+=1,f=4}else{const t=ni(a,w),e=ni(a,E);n[r]=t,r+=1,n[r]=e,r+=1,f=2}c=l,l=t[i]}return n[r]=n[0],r+=1,n[r]=n[1],r+=1,[n,f,[c,l]]})(t,e,i)[0];class Rm extends nr{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.dR=new Im,this.gO=Le,this.pO=Le,this.mO=mg({arcStyleSolid:()=>G(this.be)&&this.be,arcStyleRadialGradient:()=>Q(this.be)&&this.be,arcStyleLinearGradient:()=>it(this.be)&&this.be}),this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO()}vO(t,e){let i=0,s=Array(0),n=0;if(void 0!==e){const n=t.length,r=Array(n+e.length);let o=0,a=0;for(;o0?Ru(this.wa._(),this.hu._(),this.Fi._(),this.ru._()*l/100,this.nu._()*l/100,h)[0]:[this.wa._()],d=a.length-1;if(2===d){const t=(a[d-1].x+a[1].x)/2,e=(a[d-1].y+a[1].y)/2;this.lu=u(t,e)}else{const t=Math.floor(d/2);this.lu=u(a[t].x,a[t].y)}this.uu=a[1];const f=a.length-1;this.cu=a[f],this.ou._()&&(a.shift(),c.shift());let g=!1;(this.wa.o||this.hu.o||this.Fi.o||this.ru.o||this.nu.o||this.ou.o||this.au.o||s)&&(this.pO=m(u(this.Ya().x-r,this.Ya().y-o),u(this.Ya().x+r,this.Ya().y+o)),g=!0,this.wa.o=!1,this.hu.o=!1,this.Fi.o=!1,this.ru.o=!1,this.nu.o=!1,this.ou.o=!1,this.au.o=!1);const p=this.ga();(g||p)&&this.be!==V&&(this.ou._()?(this.bO&&this.zL.SV(this.bO),[this.MO,this.bO,this._O,this.wO]=this.vO(a,c)):(this.bO&&this.zL.SV(this.bO),[this.MO,this.bO,this._O,this.wO]=this.vO(a,void 0)),Q(this.be)?this.CO=xm(this.pO,this.dt,this.be.getPosition(),this.be.getExtent(),this.be.getShape(),this.zL.sR()):it(this.be)?this.kO=Sm(this.pO,this.dt,this.be.getAngle(!0),this.zL.sR()):(this.CO=void 0,this.kO=void 0));const y=this.mO.arcStyleSolid(p),A=this.mO.arcStyleLinearGradient(p),x=this.mO.arcStyleRadialGradient(p),S=y||A||x;p&&(this.TO=S?this.zL.cE(Wg["2D"],Wg.Color({dataType:Q(this.be)||it(this.be)?["gradient",this.be]:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.Sa(this.be));const b=this.Me;if(Ji(b)&&(g||this.ba(b.getThickness())||s)){this.ou._()?360===i?(a.pop(),c.pop(),[this.FO,this.IO]=this.xO(a,void 0,b.getThickness(),n),this.PO&&this.FO?this.zL.NV(this.PO,this.FO,!0):!this.PO&&this.FO?this.PO=this.zL.oV(this.FO,!0):this.PO&&!this.FO&&(this.zL.SV(this.PO),this.PO=void 0),[this.DO,this.BO]=this.xO(c,void 0,b.getThickness(),n),this.LO&&this.DO?this.zL.NV(this.LO,this.DO,!0):!this.LO&&this.DO?this.LO=this.zL.oV(this.DO,!0):this.LO&&!this.DO&&(this.zL.SV(this.LO),this.LO=void 0)):([this.FO,this.IO]=this.xO(a,c,b.getThickness(),n),this.PO&&this.FO?this.zL.NV(this.PO,this.FO,!0):!this.PO&&this.FO?this.PO=this.zL.oV(this.FO,!0):this.PO&&!this.FO&&(this.zL.SV(this.PO),this.PO=void 0),this.DO&&(this.LO&&this.zL.SV(this.LO),this.LO=void 0,this.BO=0)):(360===i&&(a.shift(),a.pop()),[this.FO,this.IO]=this.xO(a,void 0,b.getThickness(),n),this.PO&&this.FO?this.zL.NV(this.PO,this.FO,!0):!this.PO&&this.FO?this.PO=this.zL.oV(this.FO,!0):this.PO&&!this.FO&&(this.zL.SV(this.PO),this.PO=void 0));const t=b.getFillStyle();Q(t)?this.RO=xm(this.pO,this.dt,t.getPosition(),t.getExtent(),t.getShape(),this.zL.sR()):it(t)?this.EO=Sm(this.pO,this.dt,t.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),this.VO=t===V?void 0:this.zL.cE(Wg["2D"],Wg.Color({dataType:Q(t)||it(t)?["gradient",t]:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})),this.Ma(b)}if(g){let t=1,e=1;Ji(b)&&(t=b.getThickness()*n.x,e=b.getThickness()*n.y),this.gO=m(u(this.pO.min.x-t,this.pO.min.y-e),u(this.pO.max.x+t,this.pO.max.y+e))}this.zO=e&&S?this.zO||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.OO=e&&this.Me!==nt?this.OO||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0}return this}yL(t){if(this.ya()){const e=1===t?this.zO:this.TO,i=this.be,s=this.bO;e&&s&&this.zL.JL(e).lV(e,((e,n,r,o)=>{if(this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(o("uScaleStart_highpart"),this.dR.Nz()).cV(o("uScaleStart_lowpart"),this.dR.Gz()).bz(r,s,this.dt._i(),void 0).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1===t)this.zL.AV(e("uColor"),this.SO);else if(G(i))this.zL.AV(e("uColor"),i.getColor());else if(Q(i)){if(!this.CO)return!1;this.zL.yz(r,this.CO,i)}else if(it(i)){if(!this.kO)return!1;this.zL.Sz(r,this.kO,i)}return this.zL.Pp(this.wO,this._O),!0}));const n=this.Me;Ji(n)&&(void 0!==this.PO&&this.NO(t,this.PO,this.IO,n),void 0!==this.LO&&this.NO(t,this.LO,this.BO,n))}return this}NO(t,e,i,s){const n=1===t?this.OO:this.VO,r=s.getFillStyle();n&&this.zL.JL(n).lV(n,((n,o,a,h)=>{if(this.zL.cV(n("uScale"),this.dR.gV()).cV(n("uDisp"),this.dR.pV()).bz(a,e,this.dt._i(),void 0).fV(n("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(n("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(n("uRenderEffectMask"),2===t?1:0),1===t)this.zL.AV(n("uColor"),this.SO);else if(G(r))this.zL.AV(n("uColor"),r.getColor());else if(Q(r)){if(!this.RO)return!1;this.zL.yz(a,this.RO,r)}else if(it(r)){if(!this.EO)return!1;this.zL.Sz(a,this.EO,r)}const l=s.getThickness(),u=-1===l||1===l;return this.zL.Pp(u?this.zL.gl.LINE_LOOP:this.zL.gl.TRIANGLE_STRIP,i),!0}))}dO(t){return this.yO===t&&{}}GL(){return this.GO&&(this.zL.SV(this.GO),this.GO=void 0),this.WO&&(this.zL.SV(this.WO),this.WO=void 0),this.bO&&(this.zL.SV(this.bO),this.bO=void 0),this.PO&&(this.zL.SV(this.PO),this.PO=void 0),this.LO&&(this.zL.SV(this.LO),this.LO=void 0),this.TO=void 0,this.VO=void 0,this.zO=void 0,this.OO=void 0,this}xt(){return this.pO.max.x}vt(){return this.pO.min.x}Mt(){return this.pO.max.y}bt(){return this.pO.min.y}Vl(){return Me(this.Me)}zl(){return Me(this.Me)}}class Vm{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}UO(t){return this.first=t,this.second=t+1,this.third=t+2,this.fourth=t+3,this.fifth=t+4,this.sixth=t+5,t+=6,this}YO(){return this.first=this.second,this.second=this.third,this.third=this.fourth,this.fourth=this.fifth,this.fifth=this.sixth,this.sixth+=1,this}HO(){return this.first=this.third,this.second=this.fourth,this.third=this.fifth,this.fourth=this.sixth,this.fifth=this.fourth+1,this.sixth=this.fifth+1,this}$O(t){const e=t.buffer;let{position:i}=t;return e[i]=this.first,e[i+1]=this.second,e[i+2]=this.third,i+=3,t.position=i,t.next&&this.YO(),this}XO(t){const e=t.buffer;let{position:i}=t;return e[i]=this.first,e[i+1]=this.third,e[i+2]=this.second,e[i+3]=this.third,e[i+4]=this.fourth,e[i+5]=this.second,i+=6,t.position=i,t.next&&this.HO(),this}jO(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new Vm).UO(t))(),Om=(t,e,i,s,n,r,o,a,h,l)=>(void 0===a&&void 0===o||Bm.YO(),r.push(t,e),n.push(Bm.first,Bm.second,Bm.third),a=void 0,o=void 0,n.push(Bm.third,Bm.fourth,Bm.second),h=Bm.third,Bm.HO(),l&&r.push(i,s),[o,a,h]),Nm=(t,e,i,s,n,r,o,a,h,l,u)=>{void 0===h&&void 0===a||Bm.YO(),o.push(t,e),n.push(Bm.first,Bm.second,Bm.third);const c=yi(t,i,e,s);return h=void 0,void 0!==c&&(void 0===h&&(h=c),o.push(h),r.push(Bm.third,Bm.fourth,Bm.fifth),l=Bm.fourth),Bm.HO(),u&&o.push(i,s),[a,h,l]},Um=(t,e,i,s,n,r,o,a,h,l)=>(void 0===o&&void 0===r||Bm.YO(),n.push(t,e),s.push(Bm.first,Bm.second,Bm.third),r=i,o=void 0,a=Bm.third,l?n.push(i):h=!0,[r,o,a,h]),Gm=(t,e,i,s,n,r,o,a,h,l,u)=>(0!==r.length?(void 0===a&&void 0===o||Bm.YO(),Bm.YO()):h>0&&(Bm.YO(),u>0&&(u-=1)),r.push(t),n.push(Bm.first,Bm.second,Bm.third),h=Bm.second,o=t,a=void 0,l&&r.push(i,s),[o,a,h,u]),Wm=(t,e=0)=>{Bm.UO(e);const[i,s]=t,n=i.length,r=[],o=[],a=[];let h,l,u=e,c=0,d=i[c],f=s[c],g=i[c],m=s[c],p=!1,y=u>0?g.y!==m.y?2:1:0;if(n>1)for(;cm.y?d.y>f.y?[h,l,u]=Om(g,m,d,f,r,a,h,l,u,t):d.yf.y?[h,l,u]=Nm(g,m,d,f,o,r,a,h,l,u,t):[h,l,u,p]=Um(g,m,d,o,a,h,l,u,p,t):d.y===f.y?(h=g,p&&(a.push(g),p=!1,Bm.YO()),0===a.length&&u>0&&y>0&&(y-=1)):d.y>f.y?[h,l,u,y]=Gm(g,0,d,f,r,a,h,l,u,t,y):[h,l,u,y]=Gm(g,0,d,f,o,a,h,l,u,t,y)}return[a,new Uint16Array(r),new Uint16Array(o),u,y]};class Ym extends sr{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.dR=new Im,this.QO=0,this.sl=Array(),this.JO=0,this.KO=new Uint16Array(0),this.qO=new Uint16Array(0),this.mO=mg({hightFillSolid:()=>G(this.be)&&this.be,hightFillRadialGradient:()=>Q(this.be)&&this.be,hightFillLinearGradient:()=>it(this.be)&&this.be,hightFillPaletted:()=>H(this.be)&&this.be,lowFillSolid:()=>G(this.Hl)&&this.Hl,lowFillRadialGradient:()=>Q(this.Hl)&&this.Hl,lowFillLinearGradient:()=>it(this.Hl)&&this.Hl,lowFillPaletted:()=>H(this.Hl)&&this.Hl}),this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO()}Ds(){const t=this.ma(),e=this.jo._(),i=this.fl;if(this.ya()){this.dR.yV(this.dt);const s=this.dt instanceof zi==0,n=s?this.dt.Wi():void 0,r=this.Zl(),o=this.dt.Ni()||t,a=i||this.Gl.o||o&&"disabled"!==r.type;if(a){if(this.QO=0,this.KO=new Uint16Array(0),this.qO=new Uint16Array(0),this.sl.length=0,this.JO=0,this.Wl>1){const[t,e,i,o]=Wm([s?r.packager(this.Ol,n,.5):this.Ol,s?r.packager(this.Nl,n,.5):this.Nl]);this.QO=o,this.KO=e,this.qO=i,this.sl=t,this.JO=t.length}this.Gl.o=!1}if(this.Yl&&this.ll[0].length>1){const[t,e]=this.ll,i=t.length,[o,a,h,l,u]=Wm([s?r.packager(t,n,.5):t,s?r.packager(e,n,.5):e],this.QO);this.QO=l;const c=o.length;for(let t=u;t0||this.Wl>0?1:u;s{if(this.zL.bz(o,e,this.dt._i(),void 0).ZV(n).fV(s("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(s("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(s("uRenderEffectMask"),2===t?1:0),this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(s("uScale"),this.dR.gV()).cV(s("uDisp"),this.dR.pV()).cV(a("uScaleStart_highpart"),this.dR.Nz()).cV(a("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(a("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(a("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(a("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(a("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(s("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(s("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(s("uColor"),this.SO);else if(G(i))this.zL.AV(s("uColor"),i.getColor());else if(Q(i)){if(!this.sN)return!1;this.zL.yz(o,this.sN,i)}else if(it(i)){if(!this.eN)return!1;this.zL.Sz(o,this.eN,i)}else if(H(i)){const t=pg(i,this,void 0);if(!t&&i.lut.percentageValues)return!1;this.zL.Ez(o,i.lut,t)}return this.zL.JV(this.aN),!0}))}const n=1===t?this.zO:this.tN;if(n&&this.hN&&this.rN){const i=this.hN,s=this.rN;this.zL.JL(n).lV(n,((n,r,o,a)=>{if(this.zL.bz(o,i,this.dt._i(),void 0).ZV(s).fV(n("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(n("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(n("uRenderEffectMask"),2===t?1:0),this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(n("uScale"),this.dR.gV()).cV(n("uDisp"),this.dR.pV()).cV(a("uScaleStart_highpart"),this.dR.Nz()).cV(a("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(a("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(a("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(a("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(a("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(n("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(n("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(n("uColor"),this.SO);else if(G(e))this.zL.AV(n("uColor"),e.getColor());else if(Q(e)){if(!this.CO)return!1;this.zL.yz(o,this.CO,e)}else if(it(e)){if(!this.kO)return!1;this.zL.Sz(o,this.kO,e)}else if(H(e)){const t=pg(e,this,void 0);if(!t&&e.lut.percentageValues)return!1;this.zL.Ez(o,e.lut,t)}return this.zL.JV(this.nN),!0}))}return this}dO(t){return this.yO===t&&{}}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return 0}zl(){return 0}Cx(t){this.Cl()>0&&this.Ds();const[e,i]=this.yl(),s=e.length>2&&e[1].x0&&this.Ds();const[e,i]=this.yl(),s=e.length;if(0===s)return;const n=this.$l?1:0,r=s-(this.Xl?2:1),o=e.length>2&&e[1].x{const i=1===e?.5*Math.PI:1.5*Math.PI;for(let s=0;s<=this.lN;s+=1){const n=i-s*Math.PI/this.lN;t.push(.5*Math.cos(n),.5*Math.sin(n),e,0)}})),t.push(0,0,1,1),t.push(0,0,0,1);const e=t.length/4,i=[];for(let t=0;t((t,e)=>{let i=t.CV.wE.get(e);return i||(i=new Hm(t,e),t.CV.wE.set(e,i),i)})(t,i?e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2:1),jm={gN:(t,e,i,s,n,r)=>{const{attribute:o}=s,a=e.gl;if(a.bindBuffer(a.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),h=o("aLocationB_lowpart");a.vertexAttribPointer(t,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),e.HV(t,1),a.enableVertexAttribArray(t),a.vertexAttribPointer(i,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(r+2)*Float32Array.BYTES_PER_ELEMENT),e.HV(i,1),a.enableVertexAttribArray(i),a.vertexAttribPointer(s,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(r+n)*Float32Array.BYTES_PER_ELEMENT),e.HV(s,1),a.enableVertexAttribArray(s),a.vertexAttribPointer(h,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(r+n+2)*Float32Array.BYTES_PER_ELEMENT),e.HV(h,1),a.enableVertexAttribArray(h)}else{const t=o("aLocationA"),i=o("aLocationB");a.vertexAttribPointer(t,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),e.HV(t,1),a.enableVertexAttribArray(t),a.vertexAttribPointer(i,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(r+n)*Float32Array.BYTES_PER_ELEMENT),e.HV(i,1),a.enableVertexAttribArray(i)}},pN:(t,e,i,s,n,r,o)=>{const a=t.gl;a.bindBuffer(a.ARRAY_BUFFER,i),a.vertexAttribPointer(s,r,a.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.HV(s,1),a.enableVertexAttribArray(s),a.vertexAttribPointer(n,r,a.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(o+r)*Float32Array.BYTES_PER_ELEMENT),t.HV(n,1),a.enableVertexAttribArray(n)},mN:(t,e,i,s,n,r)=>{const{attribute:o}=s,a=e.gl;if(a.bindBuffer(a.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),h=o("aLocationB_lowpart");a.vertexAttribPointer(t,2,a.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),e.HV(t,1),a.enableVertexAttribArray(t),a.vertexAttribPointer(i,2,a.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(r+2)*Float32Array.BYTES_PER_ELEMENT),e.HV(i,1),a.enableVertexAttribArray(i),a.vertexAttribPointer(s,2,a.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(r+n)*Float32Array.BYTES_PER_ELEMENT),e.HV(s,1),a.enableVertexAttribArray(s),a.vertexAttribPointer(h,2,a.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(r+n+2)*Float32Array.BYTES_PER_ELEMENT),e.HV(h,1),a.enableVertexAttribArray(h)}else{const t=o("aLocationA"),i=o("aLocationB");a.vertexAttribPointer(t,2,a.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),e.HV(t,1),a.enableVertexAttribArray(t),a.vertexAttribPointer(i,2,a.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(r+n)*Float32Array.BYTES_PER_ELEMENT),e.HV(i,1),a.enableVertexAttribArray(i)}},yN:(t,e,i,s,n,r,o)=>{const a=t.gl;a.bindBuffer(a.ARRAY_BUFFER,i),a.vertexAttribPointer(s,r,a.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.HV(s,1),a.enableVertexAttribArray(s),a.vertexAttribPointer(n,r,a.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(o+r)*Float32Array.BYTES_PER_ELEMENT),t.HV(n,1),a.enableVertexAttribArray(n)},yL:(t,e,i,s,n,r,o)=>{const a=t.uO(),{uniform:h,uniformOptional:l}=i,u=1/t.En.ao,c=(n?Math.max(r,u):Math.max(r,0))+1;a.fV(h("uThicknessPixels"),c).fV(l("uAALimit"),1-(c-1)/c).cV(h("uRatioPxClip"),[2/t.oi().x,2/t.oi().y]),e.JL(i,s).Pp(o)}},$m={gN:(t,e,i,s,n,r)=>{const{attribute:o}=s,a=e.gl;if(a.bindBuffer(a.ARRAY_BUFFER,i),t){const t=o("aPos_highpart");a.vertexAttribPointer(t,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),a.enableVertexAttribArray(t);const e=o("aPos_lowpart");a.vertexAttribPointer(e,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(r+2)*Float32Array.BYTES_PER_ELEMENT),a.enableVertexAttribArray(e)}else{const t=o("aPos");a.vertexAttribPointer(t,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),a.enableVertexAttribArray(t)}},pN:(t,e,i,s,n,r)=>{const o=t.gl;o.bindBuffer(o.ARRAY_BUFFER,i),o.vertexAttribPointer(s,n,o.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),o.enableVertexAttribArray(s)},mN:(t,e,i,s,n,r)=>{const{attribute:o}=s,a=e.gl;if(a.bindBuffer(a.ARRAY_BUFFER,i),!t){const t=o("aPos");a.vertexAttribPointer(t,2,a.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,r*Float32Array.BYTES_PER_ELEMENT),a.enableVertexAttribArray(t)}},SN:(t,e)=>{const i=t.uO();i.Pp(i.gl.LINE_STRIP,e,0)},vN:(t,e)=>{const i=t.uO();i.Pp(i.gl.LINES,2*e,0)}};class qm extends ar{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.dR=new Im,this.ol=Le,this.mO=mg({lineStyleSolid:()=>Ji(this.Cu)&&this.Cu,lineStyleDashed:()=>Kr(this.Cu)&&this.Cu,strokeFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},strokeFillLinearGradient:()=>{const t=this.Cu.getFillStyle();return it(t)&&t},strokeFillRadialGradient:()=>{const t=this.Cu.getFillStyle();return Q(t)&&t},strokeFillPaletted:()=>{const t=this.Cu.getFillStyle();return H(t)&&t}}),this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO(),this.xN=this.zL.rz}Ds(){const t=this.va(),e=this.Cu,i=this.mO.lineStyleSolid(t),s=this.mO.lineStyleDashed(t),n=i||s,r=this.mO.strokeFillSolid(t),o=this.mO.strokeFillLinearGradient(t),a=this.mO.strokeFillRadialGradient(t),h=this.mO.strokeFillPaletted(t),l=r||o||a||h&&["x","y"].includes(h.getLookUpProperty())&&h,c=this.Ii(),d=this.Ti(),f=this.jo._(),g=this.jo.o,p=e.V();if(s&&this.dt instanceof zi)return St.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.dR.yV(this.dt),this.Pu&&(this.bN=this.zL.oV(qt([c,d],this.dt._i()),!1,this.bN),this.ol=m(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.ya()&&n&&l&&p>0,e=o?["gradient",o]:a?["gradient",a]:h?["lookup",h.getLookUpProperty(),h.lut]:"uniform";this.MN=t?{type:"triangulated",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0}),this.xN?Wg.AliasedEdge:void 0,s&&Wg.StippleTextureInstanced),mousePickingShader:f?this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0}),s&&Wg.StippleTextureInstanced):void 0,geometry:Xm(this.zL,p),thickness:p,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:r,fillStyleLinearGradient:o,fillStyleRadialGradient:a,fillStylePaletted:h}:void 0}if(a?this.RO=xm(Hn(this.ol,{x:this.Vl(),y:this.zl()},this.dt),this.dt,a.getPosition(),a.getExtent(),a.getShape(),this.zL.sR()):o?this.EO=Sm(Hn(this.ol,{x:this.Vl(),y:this.zl()},this.dt),this.dt,o.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),s){if(t||this.Pu){const t=[0,0,Math.abs(d.x-c.x),Math.abs(d.y-c.y)];this._N=this.zL.oV(t,!1,this._N)}this.wN=this.zL.Dz(s.getPattern())}else this._N&&(this.zL.SV(this._N),this._N=void 0),this.wN=void 0;return this.Iu(e),this.Pu=!1,this.jo.o=!1,this}yL(t){var e,i;const s=this.bN;if(!s)return this;const n=this.MN;if(!n)return this;const{fillStyleSolid:r,fillStyleLinearGradient:o,fillStyleRadialGradient:a,fillStylePaletted:h,lineStyleDashed:l,thickness:u}=n,c=1===t?null===(e=this.MN)||void 0===e?void 0:e.mousePickingShader:null===(i=this.MN)||void 0===i?void 0:i.shader;return c?(this.zL.JL(c).lV(c,((e,i,c,d)=>{if(this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(d("uScaleStart_highpart"),this.dR.Nz()).cV(d("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(d("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(d("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(d("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(d("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(e("uColor"),this.SO);else if(r)this.zL.AV(e("uColor"),r.getColor());else if(a){if(!this.RO)return!1;this.zL.yz(c,this.RO,a)}else if(o){if(!this.EO)return!1;this.zL.Sz(c,this.EO,o)}else if(h){const t=pg(h,this,void 0);if(!t&&h.lut.percentageValues)return!1;this.zL.Ez(c,h.lut,t)}if(l){if(!this._N||!this.wN)return!1;jm.pN(this.zL,c,this._N,i("aLengthSoFarA"),i("aLengthSoFarB"),2,0),this.zL.cV(e("uStippleCount"),[this.us.oi().x/this.wN.Rz,this.us.oi().y/this.wN.Rz]).fV(d("uStippleTextureWidthLimiter"),this.wN.Lz/this.wN.Rz).fV(e("uStippleScale"),l.getPatternScale()).dV(e("uStippleTexture"),this.wN.Bz,1)}return jm.gN(this.dt._i(),this.zL,s,c,this.dt._i()?4:2,0),jm.yL(this.aO,n.geometry,c,this.xN&&1!==t,1===t,u,1),!0})),this):this}dO(t){return this.yO===t&&{}}dispose(){return super.dispose(),this.MN=void 0,this.bN&&(this.zL.SV(this.bN),this.bN=void 0),this._N&&(this.zL.SV(this._N),this._N=void 0),this.wN=void 0,this}GL(){return this}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return Me(this.Cu)}zl(){return Me(this.Cu)}}class Jm extends hr{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.CN=[],this.kN=!1,this.TN=!1,this.FN=!1,this.IN=!1,this.dR=new Im,this.ol=Le,this.mO=mg({lineStyleSolid:()=>Ji(this.Cu)&&this.Cu,lineStyleDashed:()=>Kr(this.Cu)&&this.Cu,lineFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},lineFillRadialGradient:()=>{const t=this.Cu.getFillStyle();return Q(t)&&t},lineFillLinearGradient:()=>{const t=this.Cu.getFillStyle();return it(t)&&t},lineIndividualPointFill:()=>{const t=this.Cu.getFillStyle();return W(t)&&t}}),this.aO=t,this.lO=e,this.PN=r,this.zL=t.uO(),this.xN=this.zL.rz,this.DN=t.En.uo;const{color:o,id:a}=this.PN();this.SO=o,this.yO=a}Lr(){const t=this.Bu?void 0:this.PN(),e={vs:t=>this.LN(e,t),cs:t=>this.RN(e,t),CA:(t,i)=>this.EN(e,t,i),AV:t=>this.VN(e,t),Pi:{x:0,y:0},Fi:{x:0,y:0},Ko:0,zN:void 0,yO:null==t?void 0:t.id,SO:null==t?void 0:t.color};return this.CN.push(e),e}Nt(){var t;return this.CN.length=0,this.kN=!0,this.ji&&this.bn&&(null===(t=this.us.vn)||void 0===t?void 0:t.entity)===this&&this.bn(this,void 0,this.us.vn.collectionMember),this}ON(){return this.CN.length}_(t){const e=this.CN[t];return[e.Pi,e.Fi]}jp(){return this.CN}Wc(t){var e;const i=this.CN.indexOf(t);i>=0&&(this.CN.splice(i,1),this.kN=!0,this.ji&&this.bn&&(null===(e=this.us.vn)||void 0===e?void 0:e.entity)===this&&this.bn(this,void 0,this.us.vn.collectionMember))}LN(t,e){if(e&&!this.CN.includes(t))this.CN.push(t);else if(!e){const e=this.CN.indexOf(t);this.CN.splice(e,1)}return this.FN=!0,t}RN(t,e){return t.Ko=e,this.TN=!0,t}EN(t,e,i){return t.Pi=e,t.Fi=i,this.kN=!0,t}VN(t,e){return t.zN=e,this.IN=!0,t}Ds(){const t=this.jo._(),e=this.jo.o,i=this.va(),s=this.Cu,n=this.CN,r=this.TN,o=this.kN,a=this.FN,h=this.IN,l=this.mO.lineStyleSolid(i),u=this.mO.lineStyleDashed(i),c=l||u,d=this.mO.lineFillSolid(i),f=this.mO.lineIndividualPointFill(i),g=this.mO.lineFillRadialGradient(i),m=this.mO.lineFillLinearGradient(i),p=d||f||m||g,y=s.V(),A=u?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(u&&this.dt instanceof zi)return St.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this.dR.yV(this.dt);const x=o||a;if(x){const t=[];for(let e=0;e0&&e;this.MN=i?"triangulated"===A?{type:"triangulated",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,snapToNearestPixel:this.DN,ensureMinimumSegmentLength:void 0!==this.Du}),this.xN?Wg.AliasedEdge:void 0,u&&Wg.StippleTextureInstanced,Wg.AttributeHighlight),mousePicking:t?{shader:this.zL.cE(Wg["2D"],this.Bu?Wg.MousePicking:Wg.MousePickingAttribute,Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,snapToNearestPixel:this.DN,ensureMinimumSegmentLength:void 0!==this.Du}),u&&Wg.StippleTextureInstanced,Wg.AttributeHighlight)}:void 0,geometry:Xm(this.zL,y,!1),thickness:y,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:m,fillStyleRadialGradient:g}:{type:"primitive",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0,snapToNearestPixel:this.DN}),Wg.AttributeHighlight),mousePicking:t?{shader:this.zL.cE(Wg["2D"],this.Bu?Wg.MousePicking:Wg.MousePickingAttribute,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0,snapToNearestPixel:this.DN}),Wg.AttributeHighlight)}:void 0,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:m,fillStyleRadialGradient:g}:void 0}if(u){if(i||x){const t=new Float32Array(4*n.length);let e=0;for(let i=0;i{t[e]=i.Ko,e+=1})),this.NN=this.zL.oV(t,!0,this.NN)}else{const t=new Float32Array(2*n.length);let e=0;n.forEach((i=>{for(let s=e;s{const s=i.zN||f.color;t[e]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=s.a,e+=4})),this.GN=this.zL.oV(t,!1,this.GN)}else{const t=new Float32Array(8*n.length);let e=0;n.forEach((i=>{const s=i.zN||f.color;for(let i=e;i{var s,n,r,o;t[e+0]=(null===(s=i.SO)||void 0===s?void 0:s.r)||0,t[e+1]=(null===(n=i.SO)||void 0===n?void 0:n.g)||0,t[e+2]=(null===(r=i.SO)||void 0===r?void 0:r.b)||0,t[e+3]=(null===(o=i.SO)||void 0===o?void 0:o.a)||0,e+=4})),this.WN=this.zL.oV(t,!0,this.WN)}else{const t=new Float32Array(8*n.length);let e=0;n.forEach((i=>{var s,n,r,o;for(let a=e;a{if(this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(g("uScaleStart_highpart"),this.dR.Nz()).cV(g("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(g("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(g("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(g("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(g("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),this.DN&&this.zL.cV(g("uViewportSizePx"),[this.us.oi().x*this.zL.sR(),this.us.oi().y*this.zL.sR()]),void 0!==this.Du&&this.zL.cV(e("uMinSegmentPixelVector"),[this.Du.x,this.Du.y]),this.zL.AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1===t)if(this.Bu)this.zL.AV(e("uColor"),this.SO);else{if(!n)return!1;"triangulated"===o?this.zL.uV(n,1,{location:d("aColor"),size:4}):this.zL.XV(d("aColor"),n)}else if(a)this.zL.AV(e("uColor"),a.getColor());else if(h){if(!this.GN)return!1;this.zL.uV(this.GN,"triangulated"===o?1:void 0,{location:d("aColor"),size:4})}else if(u){if(!this.CO)return!1;this.zL.yz(f,this.CO,u)}else if(l){if(!this.kO)return!1;this.zL.Sz(f,this.kO,l)}if(c){if(!this._N||!this.wN)return!1;jm.yN(this.zL,f,this._N,d("aLengthSoFarA"),d("aLengthSoFarB"),2,0),this.zL.cV(e("uStippleCount"),[this.us.oi().x/this.wN.Rz,this.us.oi().y/this.wN.Rz]).fV(g("uStippleTextureWidthLimiter"),this.wN.Lz/this.wN.Rz).fV(e("uStippleScale"),c.getPatternScale()).dV(e("uStippleTexture"),this.wN.Bz,0)}if("triangulated"===o){const{geometry:e,thickness:n}=r;jm.mN(this.dt._i(),this.zL,i,f,this.dt._i()?4:2,0),this.zL.uV(s,1,{location:d("aIsHighlighted"),size:1}),jm.yL(this.aO,e,f,this.xN&&1!==t,1===t,n,this.CN.length)}else $m.mN(this.dt._i(),this.zL,i,f,this.dt._i()?4:2,0),this.zL.jV(d("aIsHighlighted"),s),$m.vN(this.aO,this.CN.length);return!0})),this):this}dO(t){if(t===this.yO)return{};const e=this.CN.find((e=>e.yO===t));return!!e&&{collectionMember:e}}dispose(){return super.dispose(),this.MN=void 0,this.bN&&(this.zL.SV(this.bN),this.bN=void 0),this._N&&(this.zL.SV(this._N),this._N=void 0),this.NN&&(this.zL.SV(this.NN),this.NN=void 0),this.WN&&(this.zL.SV(this.WN),this.WN=void 0),this.GN&&(this.zL.SV(this.GN),this.GN=void 0),this.wN=void 0,this}GL(){return this}cs(t){super.cs(t);for(const e of this.CN)e.cs(t);return this}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return Me(this.Cu)}zl(){return Me(this.Cu)}}class Km{constructor(t,e){this.UN=!1,this.YN=!1,this.HN=!1,this.dt=t,this.$N=e,this.$N.ha("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.UN="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.UN="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.YN=!0),!0===t.regularProgressiveStep&&(this.HN=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.UN?t[0].x:t[0].y,end:"x"===this.UN?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.UN?"x"===this.UN?function(t){const e=t.length;if(e>0){const i=Math.max(t[e-1].x,t[0].x),s=Math.min(t[e-1].x,t[0].x);let n=t[0].y,r=t[0].y;for(let i=0;in&&(n=e.y),e.y0){const i=Math.max(t[e-1].y,t[0].y),s=Math.min(t[e-1].y,t[0].y);let n=t[0].x,r=t[0].x;for(let i=0;in&&(n=e.x),e.x{!1===t.allowDataGrouping&&(this.XN=!0)}))}JN(t,e=!1){if(this.XN||!this.UN||"linear"!==this.QN.type)return!1;!1===e&&this.KN&&(clearTimeout(this.KN),this.KN=void 0);const i="x"===this.UN?this.QN.scale.x.tA:this.QN.scale.y.tA;if(!i)throw new Error("CP helper has no information about Axis state.");const s=t.length;if(s<2)return!1;const n=t[0],r=t[s-1],o=this.calculateAvgStepBetweenDataPoints("x"===this.UN?n.x:n.y,"x"===this.UN?r.x:r.y,s),a=this.QN.scale,h=Math.abs("x"===this.UN?a.Wi().x:a.Wi().y),l=h/o,u=Math.floor(l*Zm),c=u*o,d=St.performance.now(),f=!(d-i.ah<500)&&(i.ih?d-i.oh<1e3:d-i.sh<2e3||i.hh),g=s>2*this.jN.totalDataPointsAtTime;if(f&&!g)return this.KN=setTimeout((()=>this.qN(t)),1e3),!1;const m=u>=10,p=this.jN.enabled?this.jN.columnWidthAxis/h<1.5:void 0,y=this.jN.enabled&&u>this.jN.dataPointsPerColumn?u/this.jN.dataPointsPerColumn>=2:void 0;let A;!0===this.jN.enabled?p?y&&(A={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):A=m?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:m&&(A={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const x=!1===e;return A?(x&&(this.jN=A),!0):(x&&(this.jN={...this.jN,totalDataPointsAtTime:s}),!1)}Lg(){this.tG=void 0,this.ZN.length=0,this.KN&&(clearTimeout(this.KN),this.KN=void 0)}iG(t){if(0===t.length)return t;if(this.XN||!this.UN||"linear"!==this.QN.type||!this.jN.enabled)return t;let e;e=this.ZN.length>0?se(this.ZN,t,{canReturnB:!0}):t;const i=e.length,s=[];let n,r,o=void 0===this.tG,a=-1,h=-1,l=0,u=0;if("x"!==this.UN||this.YN)if("x"===this.UN&&this.YN){const t=this.jN.columnWidthAxis;let c=this.tG?this.tG.x:e[0].x,d=c-t;for(let f=0;f=d?((!n||i.y>n.y)&&(n=i,a=f),(!r||i.y=d?((!n||i.x>n.x)&&(n=i,a=f),(!r||i.xn.x)&&(n=i,a=f),(!r||i.xn.y)&&(n=i,a=f),(!r||i.y0&&(this.tG=s[c-1]),s}sG(t){if(this.UN&&"linear"===this.QN.type){const e="x"===this.UN?this.QN.scale.x.tA:this.QN.scale.y.tA;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Je===Rs.progressive||e.Je===Rs.regressive){const e=Math.abs("x"===this.UN?this.QN.scale.x.getInnerInterval():this.QN.scale.y.getInnerInterval());if(this.jN.enabled)return 2*e/this.jN.columnWidthAxis;const i=t.length,s=t[0],n=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.UN?s.x:s.y,"x"===this.UN?n.x:n.y,i)}}}eG(t,e,i){if(!this.UN)return e;const s=i.length;let n=Bn(i,t.min,this.UN,this.YN,0,s-1);void 0===n&&(n=this.YN?s-1:0);let r=Bn(i,t.max,this.UN,this.YN,0,s-1);return void 0===r&&(r=this.YN?0:s-1),1+Math.abs(r-n)}hG(){this.KN&&(clearTimeout(this.KN),this.KN=void 0)}qN(t){this.JN(t,!0)&&this.bs()}}class tp extends Km{renderVisibleOnly(t,e){const i=this.dt.x.getInnerStart(),s=this.dt.x.getInnerEnd(),n=Math.min(i,s),r=Math.max(i,s),o=this.dt.y.getInnerStart(),a=this.dt.y.getInnerEnd(),h=Math.min(o,a),l=Math.max(o,a);t.forEach(((t,i)=>{t.existingCoordinatesCount<=1||t.boundaries.max.xr||t.boundaries.max.yl||e(t)}))}}class ep{constructor(t,e,i){this.rG=e,this.nG=i,this.oG=t,this.aG=[]}lG(t,e,i,s){const n=t.length;if(0===n)return;let r=t,o=n,a=this.oG[this.oG.length-1];do{const t=this.oG.length;let n;a||(a=this.uG(e,o)),a&&0==a.allocatedCoordinatesCount-a.existingCoordinatesCount&&(a=void 0);let h=0;if(this.nG&&t>0&&(void 0===a||0===a.existingCoordinatesCount)){const e=this.oG[t-1].lastDataPoint;e?(r.splice(0,0,e),h=1,o+=1):console.error("SegmentationHelper _connectSegments = true, but segment has no lastDataPoint information!")}if(a)n=Math.min(o,a.allocatedCoordinatesCount-a.existingCoordinatesCount),s(a,r.slice(0,n),n,h);else{const t=Math.ceil(e)+h;n=Math.min(t,o);const s={...i(t,r.slice(0,n),n,h),isDropped:!1};this.oG.push(s)}n>0&&(o>n?(r=r.slice(n),o=r.length):(r=[],o=0))}while(o>0);this.cG()}dG(t){const e=t,i=this.oG.indexOf(e);i>=0&&this.oG.splice(i,1),e.droppedTimestamp=St.performance.now(),this.aG.push(e)}fG(){this.oG.slice().forEach((t=>this.dG(t)))}AG(){this.oG.forEach((t=>this.rG(t))),this.aG.forEach((t=>this.rG(t))),this.oG.length=0,this.aG.length=0}uG(t,e){const i=2*t/3,s=4*t/3,n=this.aG.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(n>=0){const t=this.aG[n];return this.aG.splice(n,1),this.oG.push(t),t}}cG(){if(this.aG.length>5){const t=St.performance.now();for(let e=0;e=1e4)&&(this.rG(i),this.aG.splice(e,1),e-=1)}}}}class ip extends Km{gG(t,e){if(!e||"object"!=typeof e)return 0;const i=this.dt.x.getInnerStart(),s=this.dt.x.getInnerEnd(),n=Math.min(i,s),r=Math.max(i,s),o=this.dt.y.getInnerStart(),a=this.dt.y.getInnerEnd(),h=Math.min(o,a),l=Math.max(o,a);if("maxDataPointCount"in e)return this.pG(t,e.maxDataPointCount,n,r,h,l);if("minDataPointCount"in e)return this.mG(t,e.minDataPointCount,n,r,h,l);if("progressiveDataCleaningThreshold"in e)return this.yG(t,e.progressiveDataCleaningThreshold,n,r,h,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}pG(t,e,i,s,n,r){if(void 0===e||e<=0)return 0;const o=t.reduce(((t,e)=>t+e.existingDataPointsCount),0);if(o<=e)return 0;let a=0,h=o;for(let i=0;ie&&(a+=1,h-=s.existingDataPointsCount)}return a}yG(t,e,i,s,n,r){if(void 0===e||!this.UN)return 0;let o=0;for(let a=0;as:h.boundaries.min.y>r:"x"===this.UN?h.boundaries.max.xe:h.boundaries.min.y>e:"x"===this.UN?h.boundaries.max.x2))break;o+=1}return o}mG(t,e,i,s,n,r){if(void 0===e||0===e)return 0;let o=0,a=0;for(let h=t.length-1;h>=0;h-=1){const l=t[h];if(a>e)if(this.UN){if(this.YN?"x"===this.UN?l.boundaries.min.x>s:l.boundaries.min.y>r:"x"===this.UN?l.boundaries.max.xs||l.boundaries.max.yr?o+=1:o=0;a+=l.existingDataPointsCount}return o}SG(t,e){const i=t.reduce(((t,e)=>qe(t,e.boundaries)),Le);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.UN||this.YN?"x"===this.UN&&this.YN?i.max.x=Math.min(i.max.x,t):"y"!==this.UN||this.YN?"y"===this.UN&&this.YN&&(i.max.y=Math.min(i.max.y,t)):i.min.y=Math.max(i.min.y,t):i.min.x=Math.max(i.min.x,t)}return i}}class sp extends lr{constructor(t,e,i,s,n,r,o,a){super(t,e,i,s,n),this.dR=new Im,this.wb=[],this.vG=new tp(this.dt,this),this.xG=new Qm(this.dt,this,(()=>this.us.bs())),this.bG=new ep(this.wb,(t=>{t.coordsBuffer&&this.zL.SV(t.coordsBuffer),t._N&&this.zL.SV(t._N)}),!0),this.MG=new ip(this.dt,this),this._G=0,this.wG=0,this.CG=!1,this.mO=mg({lineStyleSolid:()=>Ji(this.Cu)&&this.Cu,lineStyleDashed:()=>Kr(this.Cu)&&this.Cu,strokeFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},strokeFillLinearGradient:()=>{const t=this.Cu.getFillStyle();return it(t)&&t},strokeFillRadialGradient:()=>{const t=this.Cu.getFillStyle();return Q(t)&&t},strokeFillPaletted:()=>{const t=this.Cu.getFillStyle();return H(t)&&t}}),this.lO=e,this.yO=r,this.SO=o,this.En=a,this.MN={type:"none"},this.zL=t.uO(),this.aO=t,this.xN=this.zL.rz;const h=this.dt._i(),l=!0===(null==a?void 0:a.individualLookupValuesEnabled);let u,c,d,f=0;h||(u=f,f+=2),h&&(c=f,f+=4),l&&(d=f,f+=1);const g=((t,e)=>e?(e,i)=>((t,e)=>{if(!e){const e=t.length,i=new Float32Array(3*e);for(let s=0,n=0;sqt(e,t))(h,l);this.kG={individualLookupValuesEnabled:l,attributesPerVertex:f,attributeOffsetCoordinateLowPrecision:u,attributeOffsetCoordinateHighPrecision:c,attributeOffsetLookUpValue:d,prepareRenderData:(t,e)=>g(t,this.Cu.getFillStyle())}}TG(t,e,i){const s=new Float32Array(2*e);let n=0,r=i||t[0];for(let i=0;i0,o=this.jo._(),a=this.jo.o,h=this.mO.lineStyleSolid(i),l=this.mO.lineStyleDashed(i),u=h||l,c=u&&u.getThickness(),d=this.mO.strokeFillSolid(i),f=this.mO.strokeFillLinearGradient(i),g=this.mO.strokeFillRadialGradient(i),m=this.mO.strokeFillPaletted(i),p=d||f||g||m,y=this.kG.individualLookupValuesEnabled;if(l&&this.dt instanceof zi)return St.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;r&&(this.Lu=se(this.Lu,s,{canReturnB:!0}),this.al+=n);let A=this.Ru.o;const x=this.MG.gG(this.wb,this.Ru._());if(x>0){let t=0;for(let e=0;e{t._N&&(this.zL.SV(t._N),t._N=void 0)})),this.CG=!1),b&&(this.xG.Lg(),this.wb.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=Le,t.lastDataPoint=void 0})),this.bG.fG(),S=this.Lu,this._G=0,this.wG=0);const v=this.xG.iG(S),M=v.length;if(M>0){let t=this.xG.sG(this.Lu)||(this.ha("ApplicationType",(t=>"InternalUI"===t.type))?this.al:1e5);M/t>10&&(t=M/10),this.bG.lG(v,t,((t,e,i,s)=>{const n=this.vG.calculateUserDataPointsBoundaries(e),r=this.xG.eG(n,i,this.Lu)-s;return this.FG=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:r,existingCoordinatesCount:i,jointPointsCount:s,boundaries:n,coordsBuffer:this.zL.zV(t*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i)),lastDataPoint:e[i-1],_N:this.CG?this.zL.zV(2*t,this.TG(e,i,this.FG)):void 0}}),((t,e,i,s)=>{const n=qe(t.boundaries,this.vG.calculateUserDataPointsBoundaries(e)),r=this.xG.eG(n,t.existingCoordinatesCount+i,this.Lu)-(t.jointPointsCount+s);this.zL.OV(t.coordsBuffer,t.existingCoordinatesCount*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i)),this.CG&&t._N&&this.zL.OV(t._N,2*t.existingCoordinatesCount,this.TG(e,i,this.FG)),this.FG=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=r,t.existingCoordinatesCount+=i,t.boundaries=n}))}if(A&&(this.ol=this.MG.SG(this.wb,this.Ru._())),this.dR.yV(this.dt),g?this.RO=xm(this.Jo||this.ol,this.dt,g.getPosition(),g.getExtent(),g.getShape(),this.zL.sR()):f?this.EO=Sm(this.Jo||this.ol,this.dt,f.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),i||a){if(m&&"value"===m.getLookUpProperty()&&!y){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw St.alert(t),new Error(t)}if(p&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=f?["gradient",f]:g?["gradient",g]:m?["lookup",m.getLookUpProperty(),m.lut]:"uniform";this.MN="primitive"===t?{type:t,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}),l&&Wg.StippleTexture),mousePickingShader:o?this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}),l&&Wg.StippleTexture):void 0,lineStyleSolid:h,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:"triangulated"===t?{type:t,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0}),this.xN?Wg.AliasedEdge:void 0,l&&Wg.StippleTextureInstanced),mousePickingShader:o?this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0}),l&&Wg.StippleTextureInstanced):void 0,geometry:Xm(this.zL,c),thickness:c,lineStyleSolid:h,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:{type:"none"}}else this.MN={type:"none"}}return this.wN=l?this.zL.Dz(l.getPattern()):void 0,this.Iu(e),this.fl=!1,this.ll=[],this.jo.o=!1,this.Ru.o=!1,this}yL(t){const e=this.zL.gl,i=this.MN;if(!i||"none"===i.type)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const{lineStyleDashed:n,fillStyleSolid:r,fillStyleLinearGradient:o,fillStyleRadialGradient:a,fillStylePaletted:h}=i;return this.zL.JL(s).lV(s,((s,l,u,c)=>{let d=!1;if(this.zL.fV(s("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(s("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(s("uRenderEffectMask"),2===t?1:0),this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(s("uScale"),this.dR.gV()).cV(s("uDisp"),this.dR.pV()).cV(c("uScaleStart_highpart"),this.dR.Nz()).cV(c("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(c("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(c("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(c("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(c("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(s("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(s("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(s("uColor"),this.SO);else if(r)this.zL.AV(s("uColor"),r.getColor());else if(a){if(!this.RO)return!1;this.zL.yz(u,this.RO,a)}else if(o){if(!this.EO)return!1;this.zL.Sz(u,this.EO,o)}else if(h){const t=pg(h,this,void 0);if(!t&&h.lut.percentageValues)return!1;this.zL.Ez(u,h.lut,t)}return this.vG.renderVisibleOnly(this.wb,(r=>{const{coordsBuffer:o}=r;if(!o)return;e.bindBuffer(e.ARRAY_BUFFER,o);const a="triangulated"===i.type?jm.gN:$m.gN;if(this.dt._i()||void 0===this.kG.attributeOffsetCoordinateLowPrecision?this.dt._i()&&void 0!==this.kG.attributeOffsetCoordinateHighPrecision&&a(!0,this.zL,o,u,this.kG.attributesPerVertex,this.kG.attributeOffsetCoordinateHighPrecision):a(!1,this.zL,o,u,this.kG.attributesPerVertex,this.kG.attributeOffsetCoordinateLowPrecision),n){if(!r._N||!this.wN)return;"triangulated"===i.type?jm.pN(this.zL,u,r._N,l("aLengthSoFarA"),l("aLengthSoFarB"),2,0):$m.pN(this.zL,u,r._N,l("aLengthSoFar"),2,0),this.zL.cV(s("uStippleCount"),[this.us.oi().x/this.wN.Rz,this.us.oi().y/this.wN.Rz]).fV(c("uStippleTextureWidthLimiter"),this.wN.Lz/this.wN.Rz).fV(s("uStippleScale"),n.getPatternScale()).dV(s("uStippleTexture"),this.wN.Bz,1)}if(h&&"value"===h.lookUpProperty&&void 0!==this.kG.attributeOffsetLookUpValue&&1!==t)if("triangulated"===i.type){const t=l("aLookupValueA");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(t,1),e.enableVertexAttribArray(t);const i=l("aLookupValueB");e.vertexAttribPointer(i,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.kG.attributeOffsetLookUpValue+this.kG.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(i,1),e.enableVertexAttribArray(i)}else{const t=l("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}if("triangulated"===i.type){const{thickness:e}=i;jm.yL(this.aO,i.geometry,u,this.xN&&1!==t,1===t,e,r.existingCoordinatesCount-1)}else $m.SN(this.aO,r.existingCoordinatesCount);d=!0})),e.bindBuffer(e.ARRAY_BUFFER,null),d})),this}dO(t){return this.yO===t&&{}}_l(t,e){return Array.isArray(t)||(t=[t]),this.ll=se(this.ll,t,{canReturnB:!0}),this.ol=qe(this.ol,e||e||this.vG.calculateUserDataPointsBoundaries(t)),this}Nt(){return super.Nt(),this._G=0,this.wG=0,this.FG=void 0,this}dispose(){return super.dispose(),this.bG.AG(),this.xG.hG(),this.MN={type:"none"},this.wN=void 0,this}GL(){return this}Cx(t){this.Cl()>0&&this.Ds();const e=this.yl(),i=zn(e,t,this.dl,this.$l,this.Xl,this.dt,this.engine.dt,this.ol,this.vG.UN,this.vG.YN);return void 0!==i?e[i]:void 0}cw(t){this.Cl()>0&&this.Ds();const e=this.yl(),i=e.length;if(0===i)return;const s=this.$l?1:0,n=i-(this.Xl?2:1);if(this.dl===Fn.Nearest){let s,n,r=_e;for(let o=0;o1}Pp(t,e,i,s){return i>1||e?(e?this.zL.jV(t.attribute("aOffsetPixels"),e,1):this.zL.fV(t.uniform("uOffsetPixels"),i),this.zL.uV(this.TL,0,{location:t.attribute("aInstanceGeo"),size:2}).KV(this.AN,0,this.DG,s)):this.zL.fV(t.uniform("uPointSize"),i).Pp(this.zL.gl.POINTS,s),this}IE(){this.zL.SV(this.TL)}}const rp=(t,e=0)=>{const i=[u(-.5,-.5),u(-.5,.5),u(.5,-.5),u(.5,-.5),u(-.5,.5),u(.5,.5)];return new np(t,i,t.gl.TRIANGLES,e)},op=(t,e=0)=>{const i=.05,s=[u(-.5,-.05),u(.5,-.05),u(.5,i),u(.5,i),u(-.5,i),u(-.5,-.05),u(-.05,-.5),u(i,-.5),u(i,.5),u(i,.5),u(-.05,.5),u(-.05,-.5)];return new np(t,s,t.gl.TRIANGLES,e)},ap=(t,i,s)=>{let n=i.CV.ME.get(t);if(t===e.PointShape.Circle){const t=s<=3?4:s<=5?8:s<=10?16:24;return n=i.CV._E.get(t)||((t,e,i=0)=>{const s=function(t=25){return Ru(u(0,0),0,360,.5,.5,t)[0]}(e);return new np(t,s,t.gl.TRIANGLE_FAN,i)})(i,t),i.CV._E.set(t,n),n}if(!n){switch(t){case e.PointShape.Triangle:n=((t,e=0)=>{const i=function(){const t=[],e=2/1.73205080757;return t.push(u(-e/2,.3333333333333333)),t.push(u(0,-.6666666666666666)),t.push(u(e/2,.3333333333333333)),t}();return new np(t,i,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Square:n=rp(i);break;case e.PointShape.Plus:n=op(i);break;case e.PointShape.Cross:n=op(i,45);break;case e.PointShape.Diamond:n=rp(i,45);break;case e.PointShape.Arrow:n=((t,e=0)=>{const i=.05,s=[u(-.05,-.5),u(i,-.5),u(i,.45),u(i,.45),u(-.05,.45),u(-.05,-.5),u(-.5,0),u(-.4,0),u(0,.4),u(0,.4),u(0,.5),u(-.5,0),u(.5,0),u(.4,0),u(0,.4),u(0,.4),u(0,.5),u(.5,0)];return new np(t,s,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Star:n=((t,e=0)=>new np(t,[{x:0,y:0},{x:0,y:.5},{x:.1,y:.1},{x:.5,y:.1},{x:.2,y:-.1},{x:.3,y:-.5},{x:0,y:-.25},{x:-.3,y:-.5},{x:-.2,y:-.1},{x:-.5,y:.1},{x:-.1,y:.1},{x:0,y:.5}],t.gl.TRIANGLE_FAN,e))(i);break;case e.PointShape.Minus:n=((t,e=0)=>{const i=.05,s=[u(-.5,-.05),u(.5,-.05),u(.5,i),u(.5,i),u(-.5,i),u(-.5,-.05)];return new np(t,s,t.gl.TRIANGLES,e)})(i);break;default:return Se(0,"LightningChart JS unidentified point shape")}i.CV.ME.set(t,n)}return n};class hp extends Qn{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.dR=new Im,this.gO=m(c(Fe,Fe),c(_e,_e)),this.mO=mg({pointStyleSolid:()=>G(this.be)&&this.be,pointStyleRadialGradient:()=>Q(this.be)&&this.be,pointStyleLinearGradient:()=>it(this.be)&&this.be,pointStylePaletted:()=>H(this.be)&&this.be,pointStyleIndividual:()=>W(this.be)&&this.be}),this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO()}Ds(){var t;const e=this.jo._(),i=this.jo.o,s=this.ll,n=s.length,r=n>0,o=this.el._(),a=this.be,h=this.size._(),l=this.el.o||this.Fa.o,u=this.dt.Ni(),c=this.size.o||this.el.o,d=this.fl||s&&s.length>0,f=u||c,g=this.ga(),m=this.mO.pointStyleSolid(g),p=this.mO.pointStyleRadialGradient(g),y=this.mO.pointStyleLinearGradient(g),A=this.mO.pointStylePaletted(g),x=this.mO.pointStyleIndividual(g),S=m||p||y||A||x;if(r&&(this.sl=se(this.sl,s,{canReturnB:!0}),this.al+=n),r||this.fl){this.ol=this.cl?qe(this.ol,this.cl):qe(this.ol,je(this.sl));const t=qt(this.sl,this.dt._i());this.EG=this.al,this.VG=this.zL.oV(t,!1,this.VG)}this.dR.yV(this.dt),a!==V?f&&(this.zG&&(this.zG=void 0),h>1||W(a)?h<=1?this.AN=this.zL.gl.POINTS:(this.zG=ap(o,this.zL,h),this.AN=this.zG.AN):this.AN=this.zL.gl.POINTS):this.zG&&(this.zG=void 0);const b=(null===(t=this.zG)||void 0===t?void 0:t.BG)||0,v=this.Fa._()+b;if(c||g||i||l){const t=this.hl._()?"attribute":"uniform",i=h<=1&&Wg.PointSize(t),s=Wg.VertexLocation({offset:h>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:(this.rl._()||v%360!=0)&&{dataType:this.rl._()?"attribute":"uniform"}}:void 0,axisWorldTranslation:gg(this.dt),normalSource:void 0});this.gR=S?this.zL.cE(Wg["2D"],i,s,m?Wg.Color({dataType:"uniform"}):x?Wg.Color({dataType:"attribute"}):A?Wg.Color({dataType:["lookup",A.getLookUpProperty(),A.lut]}):p?Wg.Color({dataType:["gradient",p]}):y?Wg.Color({dataType:["gradient",y]}):void 0):void 0,this.zO=e&&S?this.zL.cE(Wg["2D"],i,s,Wg.MousePicking):void 0}if(d||g){const t=this.sl.length;if(W(a)&&this.EG&&this.EG>0){const e=a.getFallbackColor(),i=new Float32Array(4*t);for(let s=0;s0&&h>1){const e=new Float32Array(t);for(let i=0;i0&&h>1){const e=new Float32Array(2*t),i=di(v),s=Math.sin(i),n=Math.cos(i);for(let i=0;i0){const e=new Float32Array(t);for(let i=0;it&&(t=s.value)}this.Al={min:e,max:t}}return this.pa=a,this.el.o=!1,this.size.o=!1,this.Fa.o=!1,this.jo.o=!1,this.fl=!1,this}yL(t){const e=1===t?this.zO:this.gR,i=this.VG,s=this.EG;return e&&i&&s&&(this.zL.JL(e),this.zL.lV(e,((e,n,r,o)=>{var a;if(this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(o("uScaleStart_highpart"),this.dR.Nz()).cV(o("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(o("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(o("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(o("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(o("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),this.zL.bz(r,i,this.dt._i(),this.zG?1:void 0).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).fV(o("uDevicePixelRatio"),this.zL.sR()),this.zG){const t=n("aInstanceGeo");this.zL.UV(t,this.zG.TL).HV(t,0)}if(1===t)this.zL.AV(e("uColor"),this.SO);else if(G(this.be))this.zL.AV(e("uColor"),this.be.getColor());else if(W(this.be)&&this.OG){const t=n("aColor");this.zL.XV(t,this.OG),this.AN!==this.zL.gl.POINTS&&this.zL.HV(t,1)}else if(H(this.be)){if("value"===this.be.getLookUpProperty()&&this.WG){const t=n("aLookupValue");this.zL.jV(t,this.WG),this.AN!==this.zL.gl.POINTS&&this.zL.HV(t,1)}const t=pg(this.be,this,this.Al);if(!t&&this.be.lut.percentageValues)return!1;this.zL.Ez(r,this.be.lut,t)}else if(Q(this.be)){if(!this.CO)return!1;this.zL.yz(r,this.CO,this.be)}else if(it(this.be)){if(!this.kO)return!1;this.zL.Sz(r,this.kO,this.be)}if(this.NG&&this.AN!==this.zL.gl.POINTS){const t=n("aOffsetPixels");this.zL.jV(t,this.NG),this.AN!==this.zL.gl.POINTS&&this.zL.HV(t,1)}else if(this.AN!==this.zL.gl.POINTS){const t=e("uOffsetPixels");this.zL.fV(t,this.size._())}const h=((null===(a=this.zG)||void 0===a?void 0:a.BG)||0)+this.Fa._();if(this.GG&&this.AN!==this.zL.gl.POINTS){const t=n("aRot");this.zL.UV(t,this.GG),this.AN!==this.zL.gl.POINTS&&this.zL.HV(t,1)}else if(this.AN!==this.zL.gl.POINTS&&h%360!=0){const t=di(h),i=Math.sin(t),s=Math.cos(t);this.zL.cV(e("uRot"),[i,s])}if(this.AN===this.zL.gl.POINTS)this.zL.fV(e("uPointSize"),this.size._());else{const t={x:2/this.us.oi().x,y:2/this.us.oi().y};this.zL.cV(e("uRatioPxClip"),[t.x,t.y])}let l=!1;return this.AN===this.zL.gl.POINTS?(this.zL.Pp(this.AN,s),l=!0):this.zG&&(this.zL.KV(this.AN,0,this.zG.DG,s),l=!0),l}))),this}dO(t){return this.yO===t&&{}}gg(t){this.Cl()>0&&this.Ds();const e=this.yl(),i=zn(e,t,this.dl,!1,!1,this.dt,this.us.dt,this.ol,void 0,void 0);return void 0!==i?e[i]:void 0}ke(t){return super.ke(t)}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return this.size._()}zl(){return this.size._()}GL(){return this.VG&&(this.zL.SV(this.VG),this.VG=void 0),this.zG&&(this.zG=void 0),this.OG&&(this.zL.SV(this.OG),this.OG=void 0),this.GG&&(this.zL.SV(this.GG),this.GG=void 0),this.WG&&(this.zL.SV(this.WG),this.WG=void 0),this}}class lp extends Jn{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.MN={fill:void 0,border:void 0},this.dR=new Im,this.ol=Le,this.UG=!1,this.YG=!1,this.HG=!1,this.$G=!1,this.Nc=[],this.mO=mg({polygonStyleSolid:()=>G(this.be)&&this.be,polygonStyleImage:()=>jr(this.be)&&this.be,polygonStyleRadialGradient:()=>Q(this.be)&&this.be,polygonStyleLinearGradient:()=>it(this.be)&&this.be,polygonStylePaletted:()=>H(this.be)&&this.be,lineStyleSolid:()=>Ji(this.Me)&&this.Me,lineStyleFilled:()=>{const t=this.Me&&this.Me.getFillStyle();return G(t)&&t}}),this.aO=t,this.lO=e,this.PN=r,this.zL=t.uO(),this.xN=this.zL.rz}Lr(){const t=this.PN(),e={vs:t=>this.LN(e,t),cs:t=>this.RN(e,t),Rl:t=>this.XG(e,t),kv:t=>this.jG(e,t),sl:[],S:void 0,Ko:0,ZG:!0,yO:t.id,SO:t.color};return this.Nc.push(e),e}Nt(){var t;return this.Nc.length=0,this.UG=!0,this.ji&&this.bn&&(null===(t=this.us.vn)||void 0===t?void 0:t.entity)===this&&this.bn(this,void 0,this.us.vn.collectionMember),this}jp(){return this.Nc}Wc(t){var e;const i=this.Nc.indexOf(t);i>=0&&(this.Nc.splice(i,1),this.$G=!0,this.ji&&this.bn&&(null===(e=this.us.vn)||void 0===e?void 0:e.entity)===this&&this.us.vn.collectionMember===t&&this.bn(this,void 0,this.us.vn.collectionMember))}LN(t,e){var i;return t.ZG=e,this.$G=!0,this.ji&&this.bn&&(null===(i=this.us.vn)||void 0===i?void 0:i.entity)===this&&this.us.vn.collectionMember===t&&this.bn(this,void 0,this.us.vn.collectionMember),t}RN(t,e){return t.Ko=e,this.HG=!0,t}XG(t,e){return t.sl=e,this.UG=!0,t}jG(t,e){return t.S=e,this.YG=!0,t}Ds(){const t=this.jo._(),e=this.jo.o,i=this.ga(),s=this.HG,n=this.UG,r=this.YG,o=this.$G,h=this.Me,l=this.va(),u=this.Nc.filter((t=>t.ZG&&t.sl.length>0));if(this.dR.yV(this.dt),(n||o)&&(this.ol=qe(...u.map((t=>je(t.sl))))),n||o){const t=qt(u.map((t=>[...t.sl,t.sl[0],{x:Number.NaN,y:Number.NaN}])).flat(),this.dt._i()),e=this.dt._i()?4:2;this.bN=this.zL.oV(t,!1,this.bN);let i=[];u.reduce(((s,n)=>{const r=s,o=(n.sl.length+1)*e,h=new Float32Array(t.buffer,r,o),l=a.default(h,void 0,e),u=s/(Float32Array.BYTES_PER_ELEMENT*e);for(let t=0;tt+e.sl.length+2),0),e=new Float32Array(t);let i=0;u.forEach((t=>{const s=t.sl.length+2;for(let n=i;nt+e.sl.length+2),0),e=new Float32Array(4*t);let i=0;u.forEach((t=>{const s=t.sl.length+2;for(let n=i;nt+e.sl.length+2),0),e=new Float32Array(t);let i=0;u.forEach((t=>{const s=void 0!==t.S?t.S:-34028234663852886e22,n=t.sl.length+2;for(let t=i;tthis.eW(t,e,i,u))),this.HG=!1,this.$G=!1,this.UG=!1,this.YG=!1,this.jo.o=!1,this.Sa(this.be),this.Ma(h),this}yL(t){var e,i;const{fill:s,border:n}=this.MN,r=this.bN,o=this.qG,a=this.tW;if(!r||!o)return this;if(s){const{fillStyleSolid:i,fillStyleLinearGradient:n,fillStyleRadialGradient:h,fillStylePaletted:l,fillStyleImage:u}=s,c=this.QG,d=this.JG,f=1===t?null===(e=s.mousePicking)||void 0===e?void 0:e.shader:s.shader;if(!f||!r||!c||void 0===d)return this;this.zL.JL(f).lV(f,((e,s,f,g)=>{if(this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(g("uScaleStart_highpart"),this.dR.Nz()).cV(g("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(g("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(g("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(g("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(g("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),this.zL.bz(f,r,this.dt._i(),void 0).ZV(c).jV(s("aIsHighlighted"),o).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1===t){if(!a)return!1;this.zL.XV(s("aColor"),a)}else if(i)this.zL.AV(e("uColor"),i.getColor());else if(h){if(!this.CO)return!1;this.zL.yz(f,this.CO,h)}else if(n){if(!this.kO)return!1;this.zL.Sz(f,this.kO,n)}else if(l){const t=pg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;if(this.zL.Ez(f,l.lut,t),"value"===l.getLookUpProperty()){if(!this.iW)return!1;this.zL.jV(s("aLookupValue"),this.iW)}}else if(u){if(!this.sW)return!1;this.zL.AV(g("uColor"),u.getSurroundingColor()).dV(e("uColorTexture"),this.sW.texture.YE()||this.sW.sourceMissingTexture,0).uV(this.sW.texCoordsBuffer,void 0,{location:s("aTextureCoord"),size:2}).EV(u.fitMode)}return this.zL.JV(d,void 0,void 0,this.zL.gl.UNSIGNED_INT),!0}))}if(n){const{geometry:e,fillStyleSolid:s,thickness:h}=n,l=this.KG,u=1===t?null===(i=n.mousePicking)||void 0===i?void 0:i.shader:n.shader;if(!u||!r||!l)return this;this.zL.JL(u).lV(u,((i,n,u,c)=>{if(this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(i("uScale"),this.dR.gV()).cV(i("uDisp"),this.dR.pV()).cV(c("uScaleStart_highpart"),this.dR.Nz()).cV(c("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(c("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(c("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(c("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(c("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(i("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(i("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),this.zL.uV(o,1,{location:n("aIsHighlighted"),size:1}).AV(i("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0),1===t){if(!a)return!1;this.zL.uV(a,1,{location:n("aColor"),size:4})}else s&&this.zL.AV(i("uColor"),s.getColor());return jm.gN(this.dt._i(),this.zL,r,u,this.dt._i()?4:2,0),jm.yL(this.aO,e,u,this.xN&&1!==t,1===t,h,l),!0}))}return this}eW(t,e,i,s){const n=ut({x:this.ol.min.x,y:this.ol.min.y},this.dt,this.us.dt),r=ut({x:this.ol.max.x,y:this.ol.max.y},this.dt,this.us.dt),o={x:Math.abs(n.x-r.x),y:Math.abs(n.y-r.y)},a=Tm(t,e,o.x,o.y,i),h=a[1],l=a[4],u=a[6],c=a[7],d=s.reduce(((t,e)=>t+e.sl.length+2),0),f=new Float32Array(2*d),g=this.ol.max.x-this.ol.min.x,m=this.ol.max.y-this.ol.min.y,p=l-u,y=c-h;let A=0;for(const t of s){for(const e of t.sl){const t=u+p*((e.x-this.ol.min.x)/g),i=h+y*((e.y-this.ol.min.y)/m);f[A]=t,f[A+1]=i,A+=2}const e=u+p*((t.sl[0].x-this.ol.min.x)/g),i=h+y*((t.sl[0].y-this.ol.min.y)/m);f[A]=e,f[A+1]=i,A+=2,f[A]=Number.NaN,f[A+1]=Number.NaN,A+=2}return f}dO(t){const e=this.Nc.find((e=>e.yO===t));return!!e&&{collectionMember:e}}GL(){return this.QG&&(this.zL.SV(this.QG),this.QG=void 0),this.bN&&(this.zL.SV(this.bN),this.bN=void 0),this.qG&&(this.zL.SV(this.qG),this.qG=void 0),this.tW&&(this.zL.SV(this.tW),this.tW=void 0),this.iW&&(this.zL.SV(this.iW),this.iW=void 0),this.MN={fill:void 0,border:void 0},this.sW=this.zL.zz(this.sW),this}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return Me(this.Me)}zl(){return Me(this.Me)}}class up extends tr{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.dR=new Im,this.hW=Le,this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStyleRadialGradient:()=>Q(this.be)&&this.be,fillStyleLinearGradient:()=>it(this.be)&&this.be,fillStyleImage:()=>jr(this.be)&&this.be,strokeStyleSolid:()=>Ji(this.Me)&&this.Me,strokeFillSolid:()=>{const t=this.Me.getFillStyle();return G(t)&&t},strokeFillLinearGradient:()=>{const t=this.Me.getFillStyle();return it(t)&&t},strokeFillRadialGradient:()=>{const t=this.Me.getFillStyle();return Q(t)&&t}}),this.eW=(t,e,i)=>{const s=ut(this.Ya(),this.dt,this.us.dt),n=ri(ut(ni(this.Ya(),this.oi()),this.dt,this.us.dt),s);return Tm(t,e,n.x,n.y,i)},this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO(),this.lO=e}Ds(){super.Ds();const t=this.jo._(),e=this.ga(),i=this.wa.o||this.X.o||this.Fa.o||this.Pa.o,s=this.Me,n=this.va(),r=s.getThickness(),o=this.Fa._();this.dR.yV(this.dt);const a=this.dt.Ni();if(i){const t=this.X._();this.sl=function(t,e,i,s,n){const r=((t,e,i)=>[t,u(t.x+e,t.y),u(t.x+e,t.y+i),u(t.x,t.y+i)])(t,e,i);if(0!==s||s%360!=0){const t=s*Math.PI/180;r[0]=Ze(r[0],n,t),r[1]=Ze(r[1],n,t),r[2]=Ze(r[2],n,t),r[3]=Ze(r[3],n,t)}return r}(this.wa._(),t.x,t.y,o,this.Pa._());const e=qt(this.sl,this.dt._i());this.bO=this.zL.oV(e,!1,this.bO),this._O=this.sl.length,this.hW=je(this.sl)}const h=this.mO.fillStyleSolid(e),l=this.mO.fillStyleRadialGradient(e),c=this.mO.fillStyleLinearGradient(e),d=this.mO.fillStyleImage(e),f=h||l||c||d;e&&(this.TO=f?this.zL.cE(Wg["2D"],h&&Wg.Color({dataType:"uniform"}),c&&Wg.Color({dataType:["gradient",c]}),l&&Wg.Color({dataType:["gradient",l]}),d&&Wg.Color({dataType:["image",d.getFitMode()]}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0),l?this.CO=xm(this.Jo||this.hW,this.dt,l.getPosition(),l.getExtent(),l.getShape(),this.zL.sR()):c?this.kO=Sm(this.Jo||this.hW,this.dt,c.getAngle(!0),this.zL.sR()):(this.CO=void 0,this.kO=void 0),this.sW=this.zL.Vz(this.sW,d,a||i,this.eW);const g=this.mO.strokeStyleSolid(n),m=this.mO.strokeFillSolid(n),p=this.mO.strokeFillLinearGradient(n),y=this.mO.strokeFillRadialGradient(n),A=g,x=m||p||y;if(A&&(i||n||a&&1!==r)){if(1===r||-1===r)[this.FO,this.rW]=[this.sl,void 0];else{const t=this.dt;[this.FO,this.rW]=t instanceof zi?((t,e,i)=>{const s=t[0],n=t[1],r=t[2],o=t[3],a=e/2;return[[i.Ui(s,n,a,-a),i.Ui(n,s,-a,-a),i.Ui(o,r,-a,-a),i.Ui(r,o,a,-a),i.Ui(s,n,-a,a),i.Ui(n,s,a,a),i.Ui(o,r,a,a),i.Ui(r,o,-a,a)],[0,4,5,0,5,1,1,5,7,1,3,7,3,7,6,3,2,6,2,4,0,2,6,4]]})(this.sl,r,t):((t,e,i)=>{const s=t[0],n=t[1],r=t[2],o=t[3],a=u(e.x*i*.5,e.y*i*.5),h=ti(Qe(n,s)),l=ti(Qe(o,s)),c=hi(h),d=hi(l);return[[ni(s,ni(si(c,a.x),si(d,a.y))),ni(n,ni(si(h,a.x),si(d,a.y))),ni(o,ni(si(c,a.x),si(l,a.y))),ni(r,ni(si(h,a.x),si(l,a.y))),ni(s,ni(si(h,a.x),si(l,a.y))),ni(n,ni(si(c,a.x),si(l,a.y))),ni(o,ni(si(h,a.x),si(d,a.y))),ni(r,ni(si(c,a.x),si(d,a.y)))],[0,4,5,0,5,1,1,5,7,1,3,7,3,7,6,3,2,6,2,4,0,2,6,4]]})(this.sl,t.Wi(),r)}this.PO=this.zL.oV(qt(this.FO,this.dt._i()),!1,this.PO),this.rW?(this.dN=this.zL.GV(new Uint16Array(this.rW),this.dN),this.IO=this.rW.length):(this.dN&&this.zL.SV(this.dN),this.dN=void 0,this.IO=this.FO.length)}return n&&(this.VO=A&&x?this.zL.cE(Wg["2D"],Wg.Color({dataType:y?["gradient",y]:p?["gradient",p]:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0),y?this.RO=xm(this.hW,this.dt,y.getPosition(),y.getExtent(),y.getShape(),this.zL.sR()):p?this.EO=Sm(this.hW,this.dt,p.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),this.zO=t&&f?this.zO||this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.OO=t&&this.Me!==nt?this.OO||this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.Sa(this.be),this.Ma(s),this.wa.o=!1,this.Fa.o=!1,this.X.o=!1,this.Pa.o=!1,this}dO(t){return this.yO===t&&{}}yL(t){const e=1===t?this.zO:this.TO,i=this.bO,s=this._O,n=this.mO.fillStyleSolid(!1),r=this.mO.fillStyleRadialGradient(!1),o=this.mO.fillStyleLinearGradient(!1),a=this.mO.fillStyleImage(!1);e&&i&&s&&this.be!==V&&(this.zL.JL(e),this.zL.lV(e,((e,h,l,u)=>{if(this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(u("uScaleStart_highpart"),this.dR.Nz()).cV(u("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(u("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(u("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(u("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(u("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(e("uColor"),this.SO);else if(n)this.zL.AV(e("uColor"),n.getColor());else if(r){if(!this.CO)return!1;this.zL.yz(l,this.CO,r)}else if(o){if(!this.kO)return!1;this.zL.Sz(l,this.kO,o)}else if(a){if(!this.sW)return!1;const t=this.sW&&this.sW.texture.YE();this.zL.AV(u("uColor"),a.getSurroundingColor()).dV(e("uColorTexture"),t||this.sW.sourceMissingTexture,0).uV(this.sW.texCoordsBuffer,void 0,{location:h("aTextureCoord"),size:2}).EV(a.fitMode)}return this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).bz(l,i,this.dt._i(),void 0).Pp(this.zL.gl.TRIANGLE_FAN,s),!0})));const h=1===t?this.OO:this.VO,l=this.mO.strokeStyleSolid(!1),u=this.mO.strokeFillSolid(!1),c=this.mO.strokeFillLinearGradient(!1),d=this.mO.strokeFillRadialGradient(!1),f=this.PO;return h&&f&&l&&(this.zL.JL(h),this.zL.lV(h,((e,i,s,n)=>{if(this.dt instanceof Li||this.dt instanceof mu?this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(n("uScaleStart_highpart"),this.dR.Nz()).cV(n("uScaleStart_lowpart"),this.dR.Gz()):this.dt instanceof zi&&this.zL.cV(n("uScaleStart"),this.dR.MixedScaleXY.uScaleStart).cV(n("uScaleStartLog"),this.dR.MixedScaleXY.uScaleStartLog).cV(n("uScaleInterval"),this.dR.MixedScaleXY.uScaleInterval).cV(n("uScaleIntervalLog"),this.dR.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.dR.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.dR.MixedScaleXY.uViewportSize),1===t)this.zL.AV(e("uColor"),this.SO);else if(u)this.zL.AV(e("uColor"),u.getColor());else if(d){if(!this.RO)return!1;this.zL.yz(s,this.RO,d)}else if(c){if(!this.EO)return!1;this.zL.Sz(s,this.EO,c)}return this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).bz(s,f,this.dt._i(),void 0),this.dN?this.zL.ZV(this.dN).JV(this.IO):this.zL.Pp(this.zL.gl.LINE_LOOP,this.IO),!0}))),this}GL(){return this.dN&&(this.zL.SV(this.dN),this.dN=void 0),this.bO&&(this.zL.SV(this.bO),this.bO=void 0),this.PO&&(this.zL.SV(this.PO),this.PO=void 0),this.sW=this.zL.zz(this.sW),this.TO=void 0,this.VO=void 0,this.zO=void 0,this.OO=void 0,this}xt(){return Math.max(this.wa._().x,this.wa._().x+this.X._().x)}vt(){return Math.min(this.wa._().x,this.wa._().x+this.X._().x)}Mt(){return Math.max(this.wa._().y,this.wa._().y+this.X._().y)}bt(){return Math.min(this.wa._().y,this.wa._().y+this.X._().y)}Vl(){return Me(this.Me)}zl(){return Me(this.Me)}}class cp extends ir{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.dR=new Im,this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be,fillStyleRadialGradient:()=>Q(this.be)&&this.be,fillStyleLinearGradient:()=>it(this.be)&&this.be,fillStyleImage:()=>jr(this.be)&&this.be,strokeLineStyleSolid:()=>Ji(this.Me)&&this.Me,strokeLineSolidFill:()=>{const t=this.Me.getFillStyle();return G(t)&&t},strokeLinearGradientFill:()=>{const t=this.Me.getFillStyle();return it(t)&&t},strokeRadialGradientFill:()=>{const t=this.Me.getFillStyle();return Q(t)&&t}}),this.eW=(t,e,i)=>{const s=ut({x:this.ol.min.x,y:this.ol.min.y},this.dt,this.us.dt),n=ut({x:this.ol.max.x,y:this.ol.max.y},this.dt,this.us.dt),r={x:Math.abs(s.x-n.x),y:Math.abs(s.y-n.y)},o=Tm(t,e,r.x,r.y,i),a=o[1],h=o[4],l=o[6],u=o[7],c=new Float32Array(2*this.sl.length),d=this.ol.max.x-this.ol.min.x,f=this.ol.max.y-this.ol.min.y,g=h-l,m=u-a;let p=0;for(const t of this.sl){const e=l+g*((t.x-this.ol.min.x)/d),i=a+m*((t.y-this.ol.min.y)/f);c[p]=e,c[p+1]=i,p+=2}return c},this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO(),this.lO=e}gg(t){let e,i=Number.MAX_VALUE;for(const s of this.sl){const n=We(ut(s,this.dt,this.us.dt),t);n=3,n=this.Me,r=this.va(),o=n.getThickness(),h=this.ba(o);this.dR.yV(this.dt),this.iM=this.dt.Wi();const l=this.dt.Ni();if(i&&(this.ol=je(this.sl)),i&&s){const t=qt(this.sl,this.dt._i());this.bO=this.zL.oV(t,!1,this.bO),this.nW=new Uint16Array(a.default(t)),this.oW=this.zL.GV(this.nW,this.oW),this._O=this.nW.length}const u=this.mO.fillStyleSolid(e),c=this.mO.fillStylePaletted(e),d=this.mO.fillStyleRadialGradient(e),f=this.mO.fillStyleLinearGradient(e),g=this.mO.fillStyleImage(e),m=u||c&&"value"!==c.getLookUpProperty()&&c||f||d||g;if(e&&(this.TO=m?this.zL.cE(Wg["2D"],u&&Wg.Color({dataType:"uniform"}),f&&Wg.Color({dataType:["gradient",f]}),d&&Wg.Color({dataType:["gradient",d]}),c&&Wg.Color({dataType:["lookup",c.getLookUpProperty(),c.lut]}),g&&Wg.Color({dataType:["image",g.getFitMode()]}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0),d?this.CO=xm(this.Jo||this.ol,this.dt,d.getPosition(),d.getExtent(),d.getShape(),this.zL.sR()):f?this.kO=Sm(this.Jo||this.ol,this.dt,f.getAngle(!0),this.zL.sR()):(this.CO=void 0,this.kO=void 0),this.sW=this.zL.Vz(this.sW,g,l||i,this.eW),(i||h||l&&1!==o)&&s){const t=1===o||-1===o?this.sl:Pm(this.sl,this.iM,o);this.FO=qt(t,this.dt._i()),this.PO=this.zL.oV(this.FO,!0,this.PO),this.IO=t.length}const p=this.mO.strokeLineStyleSolid(r),y=this.mO.strokeLineSolidFill(r),A=this.mO.strokeLinearGradientFill(r),x=this.mO.strokeRadialGradientFill(r),S=p,b=y||A||x;return r&&(this.VO=S&&b?this.zL.cE(Wg["2D"],Wg.Color({dataType:x?["gradient",x]:A?["gradient",A]:"uniform"}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0),x?this.RO=xm(this.Jo||this.ol,this.dt,x.getPosition(),x.getExtent(),x.getShape(),this.zL.sR()):A?this.EO=Sm(this.Jo||this.ol,this.dt,A.getAngle(!0),this.zL.sR()):(this.RO=void 0,this.EO=void 0),this.zO=t&&m?this.zO||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.OO=t&&this.Me!==nt?this.zO||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})):void 0,this.Ll=!1,this.Sa(this.be),this.Ma(n),this}yL(t){const e=1===t?this.zO:this.TO,i=this.bO,s=this._O,n=this.mO.fillStyleSolid(!1),r=this.mO.fillStyleRadialGradient(!1),o=this.mO.fillStyleLinearGradient(!1),a=this.mO.fillStylePaletted(!1),h=this.mO.fillStyleImage(!1);e&&i&&s&&this.zL.JL(e).lV(e,((e,s,l,u)=>{if(this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).cV(u("uScaleStart_highpart"),this.dR.Nz()).cV(u("uScaleStart_lowpart"),this.dR.Gz()).bz(l,i,this.dt._i(),void 0).ZV(this.oW).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1===t)this.zL.AV(e("uColor"),this.SO);else if(n)this.zL.AV(e("uColor"),n.getColor());else if(r){if(!this.CO)return!1;this.zL.yz(l,this.CO,r)}else if(o){if(!this.kO)return!1;this.zL.Sz(l,this.kO,o)}else if(a){const t=pg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.zL.Ez(l,a.lut,t)}else if(h){if(!this.sW)return!1;this.zL.AV(u("uColor"),h.getSurroundingColor()).dV(e("uColorTexture"),this.sW.texture.YE()||this.sW.sourceMissingTexture,0).uV(this.sW.texCoordsBuffer,void 0,{location:s("aTextureCoord"),size:2}).EV(h.fitMode)}return this.zL.JV(this._O),!0}));const l=1===t?this.OO:this.VO,u=this.Me,c=this.PO,d=this.IO;return l&&c&&d&&this.zL.JL(l).lV(l,((e,i,s,n)=>{this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).bz(s,c,this.dt._i(),void 0);const r=u.getFillStyle();if(1===t)this.zL.AV(e("uColor"),this.SO);else if(G(r))this.zL.AV(e("uColor"),r.getColor());else if(Q(r)){if(!this.RO)return!1;this.zL.yz(s,this.RO,r)}else if(it(r)){if(!this.EO)return!1;this.zL.Sz(s,this.EO,r)}const o=u.getThickness(),a=-1===o||1===o;return this.zL.Pp(a?this.zL.gl.LINE_LOOP:this.zL.gl.TRIANGLE_STRIP,this.IO),!0})),this}dO(t){return this.yO===t&&{}}GL(){return this.oW&&(this.zL.SV(this.oW),this.oW=void 0),this.bO&&(this.zL.SV(this.bO),this.bO=void 0),this.PO&&(this.zL.SV(this.PO),this.PO=void 0),this.TO=void 0,this.VO=void 0,this.zO=void 0,this.OO=void 0,this.sW=this.zL.zz(this.sW),this}}const dp=(t,e)=>{let i=0;const s=[];for(;i0;r-=o?1:0,r-=i+r{let i=0;const s=[];for(;i0;r-=o?1:0,r-=0;const a=Math.min(r,t-n),h=i-(o?1:0),l={start:h,startUnique:n,sizeData:Math.min(e,t-h),sizeUniqueData:a};s.push(l),i+=a}return s},gp=(t,e,i,s)=>{if(i){const t=new Map;return e.gridTiles.forEach((e=>{t.set(e,{type:i,dataInvalidationRanges:[{tileInvalidationOffset:{primary:0,secondary:0},tileInvalidationLength:e.sizeHeatmapDataVectors}]})})),t}const n=new Map;for(let i=0;i{const e=t.iFirstVector,i=s(t),o={x:e.primary+i.primary-1,y:e.secondary+i.secondary-1},a=[{x:e.primary,y:e.secondary},{x:o.x,y:e.secondary},o,{x:e.primary,y:o.y}];if(!Ve(h,a))return;let l=n.get(t);l||(l={type:r.type,dataInvalidationRanges:[]},n.set(t,l));const u=Be(h,a),c={primary:u.min.x-e.primary,secondary:u.min.y-e.secondary},d={primary:1+u.max.x-u.min.x,secondary:1+u.max.y-u.min.y};let f=!1;const g=[{x:c.primary,y:c.secondary},{x:c.primary+d.primary,y:c.secondary},{x:c.primary+d.primary,y:c.secondary+d.secondary},{x:c.primary,y:c.secondary+d.secondary}];for(let t=0;t{if(1!==t.length||0!==e.startPrimary||0!==e.startSecondary||e.lengthPrimary!==t[0].sizeHeatmapDataVectors.primary||e.lengthSecondary!==t[0].sizeHeatmapDataVectors.secondary)t.forEach((t=>{const s=i(t),n=Math.max(e.startPrimary,t.iFirstVector.primary),r=Math.min(e.startPrimary+e.lengthPrimary-1,t.iFirstVector.primary+t.sizeHeatmapDataVectors.primary-1),o=Math.max(e.startSecondary,t.iFirstVector.secondary),a=Math.min(e.startSecondary+e.lengthSecondary-1,t.iFirstVector.secondary+t.sizeHeatmapDataVectors.secondary-1);for(let i=n;i<=r;i+=1){const n=i-e.startPrimary,r=e.values[n],h=(i-t.iFirstVector.primary)*t.sizeHeatmapDataVectors.secondary;for(let i=o;i<=a;i+=1){const n=i-e.startSecondary,o=i-t.iFirstVector.secondary,a=r[n];s[h+o]=a}}}));else{const s=t[0],n=i(s);for(let t=0;t{var s,n;const r=null===(s=t.gl2)||void 0===s?void 0:s.ctx;if(r)return t.gz(null,r.RED,!1,!0,{x:e,y:i},!1,r.FLOAT,r.R32F);const o=t.gl;return(null===(n=t.gl1)||void 0===n?void 0:n.optional.OES_texture_float)?t.gz(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.gz(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},yp=(t,e,i,s)=>{e.forEach(((e,n)=>{var r,o;const a=i(n),h=s(n),l=t.gl;l.bindTexture(l.TEXTURE_2D,h),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const u=null===(r=t.gl2)||void 0===r?void 0:r.ctx,c=e.dataInvalidationRanges.length,d=e.dataInvalidationRanges.reduce(((t,e)=>t+e.tileInvalidationLength.primary),0)/n.sizeHeatmapDataVectors.primary;1===c&&d<1||d<.5&&c<10?e.dataInvalidationRanges.forEach((e=>{var i;const s=e.tileInvalidationOffset.primary*n.sizeHeatmapDataVectors.secondary,r=s+e.tileInvalidationLength.primary*n.sizeHeatmapDataVectors.secondary;if(u)u.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,n.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,u.RED,u.FLOAT,a.subarray(s,r));else if(null===(i=t.gl1)||void 0===i?void 0:i.optional.OES_texture_float)l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,n.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.LUMINANCE,l.FLOAT,a.subarray(s,r));else{const t=new Uint8Array(a.buffer).subarray(4*s,4*r);l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,n.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.RGBA,l.UNSIGNED_BYTE,t)}})):u?u.texImage2D(l.TEXTURE_2D,0,u.R32F,n.sizeHeatmapDataVectors.secondary,n.sizeHeatmapDataVectors.primary,0,u.RED,u.FLOAT,a):(null===(o=t.gl1)||void 0===o?void 0:o.optional.OES_texture_float)?l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,n.sizeHeatmapDataVectors.secondary,n.sizeHeatmapDataVectors.primary,0,l.LUMINANCE,l.FLOAT,a):l.texImage2D(l.TEXTURE_2D,0,l.RGBA,n.sizeHeatmapDataVectors.secondary,n.sizeHeatmapDataVectors.primary,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array(a.buffer)),l.bindTexture(l.TEXTURE_2D,null)}))};class Ap extends qn{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.aW=y("bilinear"),this.Pi={x:0,y:0},this.yw={x:1,y:1},this.Ky=Tn.lineStyle,this.engine=t;const o="columns"===r.dataOrder?r.columns:r.rows,a="columns"===r.dataOrder?r.rows:r.columns;this.En={...r,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:a}}rS(t){return this.aW.M(t),this}nS(){return this.aW._()}sS(t,e){return this.Pi=t,this.yw=e,this}eS(){return{start:this.Pi,step:this.yw,end:{x:this.Pi.x+this.yw.x*this.En.columns,y:this.Pi.y+this.yw.y*this.En.rows}}}qy(t){return this.Ky="function"==typeof t?t(this.Ky):t,this}hS(){return this.Ky}}class xp extends Ap{constructor(t,e,i,s,n,r,o,a){super(t,e,i,s,n,r),this.dR=new Im,this.MN={},this.lW=[],this.uW=!1,this.fl=!1,this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be,wireframeStyleLine:()=>Ji(this.Ky)&&this.Ky,wireframeStyleFill:()=>{const t=this.Ky&&this.Ky.getFillStyle();return G(t)&&t}}),this.cW=dp,this.aO=t,this.lO=e,this.yO=o,this.SO=a,this.zL=t.uO(),this.lO=e;const h=Math.min(this.zL.NL,void 0!==r.dW?r.dW:2048),l={x:Math.min(h,this.En.primaryDimensionVectorsCount),y:Math.min(h,this.En.secondaryDimensionVectorsCount)},u=((t,e,i,s)=>{const n=[],r=i(t.primaryDimensionVectorsCount,e.x),o=i(t.secondaryDimensionVectorsCount,e.y);let a;return r.forEach((t=>o.forEach((e=>{const i={iFirstVector:{primary:t.start,secondary:e.start},iFirstUniqueVector:{primary:t.startUnique,secondary:e.startUnique},sizeHeatmapDataVectors:{primary:t.sizeData,secondary:e.sizeData},sizeUniqueHeatmapDataVectors:{primary:t.sizeUniqueData,secondary:e.sizeUniqueData}};n.push(i)})))),a=[],n.forEach((t=>{let e=a.find((e=>e.sizeHeatmapData.primary===t.sizeHeatmapDataVectors.primary&&e.sizeHeatmapData.secondary===t.sizeHeatmapDataVectors.secondary));e||(e={sizeHeatmapData:t.sizeHeatmapDataVectors,tiles:[]},a.push(e)),e.tiles.push(t)})),{gridTiles:n,gridTileSizes:a}})(this.En,l,this.cW),c=u.gridTiles.map((t=>{const e=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary);return{...t,intensityData:e,hasIntensityData:!1}})),d=u.gridTileSizes.map((t=>({...t,tiles:c.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary))})));this.fW={gridTiles:c,gridTileSizes:d},this.sS(this.Pi,this.yw)}Ds(){const t=this.lW,e=this.be,i=this.ga(),s=this.Ky,n=s!==this.AW,r=this.mO.fillStylePaletted(i),o=this.mO.fillStyleSolid(i),a=this.aW.o,h=this.aW._(),l=this.fl,u=this.jo._();this.gW=this.gW||this.pW();const c=this.gW,d=gp(t,c,l?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));d.size>0&&(yp(this.zL,d,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.uW=!0),this.dR.yV(this.dt);const f=this.MN;if((i||a)&&(f.tile=r?{renderMode:"paletted",fillStylePaletted:r,shader:this.zL.cE(Wg["2D"],Wg.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===h&&"bilinear",flipXY:"rows"===this.En.dataOrder,intensityTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN,lut:r.lut}),Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),flipXY:"rows"===this.En.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),flipXY:"rows"===this.En.dataOrder,normalSource:void 0}))}:void 0),n){const t=this.mO.wireframeStyleLine(n),e=this.mO.wireframeStyleFill(n);f.wireframe=t&&e?-1===t.getThickness()?{renderMode:"primitive",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.En.dataOrder,axisWorldTranslation:gg(this.dt),normalSource:void 0})),fillStyleSolid:e}:{renderMode:"triangulated",shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:"uniform"}),Wg.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.En.dataOrder,axisWorldTranslation:gg(this.dt),normalSource:void 0})),geometry:Xm(this.zL,1),solidLine:t,fillStyleSolid:e}:void 0,f.wireframe?this.mW=this.mW||this.yW():this.mW&&(this.zL.SV(this.mW.wireframeCoordinatesBuffer),this.mW=void 0)}if(f.mousePicking=u?this.MN.mousePicking||{shader:this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),flipXY:"rows"===this.En.dataOrder,normalSource:void 0}))}:void 0,this.MN=f,void 0===this.Al&&r&&"value"===r.lookUpProperty&&r.lut.percentageValues){let t=_e,e=Fe;this.gW.gridTiles.forEach((i=>{for(let s=0;se&&(e=n)}})),this.Al={min:t,max:e}}return this.fl=!1,this.lW.length=0,this.Sa(e),this.AW=s,this.aW.o=!1,this}pW(){const t=this.fW.gridTiles.map((t=>{const e=pp(this.zL,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e,tileData:t}})),e=this.fW.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.zL.oV([0,0,1,0,0,1,1,1]),s=this.zL.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}yW(){const t=this.En.primaryDimensionVectorsCount+1+this.En.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{const e="columns"===this.En.dataOrder?{x:this.Pi.x+this.yw.x*t.iFirstVector.primary,y:this.Pi.y+this.yw.y*t.iFirstVector.secondary}:{x:this.Pi.x+this.yw.x*t.iFirstVector.secondary,y:this.Pi.y+this.yw.y*t.iFirstVector.primary},i="columns"===this.En.dataOrder?{x:this.yw.x*t.sizeHeatmapDataVectors.primary,y:this.yw.y*t.sizeHeatmapDataVectors.secondary}:{x:this.yw.x*t.sizeHeatmapDataVectors.secondary,y:this.yw.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.En.dataOrder?{x:this.Pi.x+this.yw.x*t.iFirstUniqueVector.primary,y:this.Pi.y+this.yw.y*t.iFirstUniqueVector.secondary}:{x:this.Pi.x+this.yw.x*t.iFirstUniqueVector.secondary,y:this.Pi.y+this.yw.y*t.iFirstUniqueVector.primary},r="columns"===this.En.dataOrder?{x:this.yw.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.yw.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.yw.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.yw.y*t.sizeUniqueHeatmapDataVectors.primary};n.set(t,{startLocationAxis:e,sizeAxis:i,startRenderLocationAxis:s,renderSizeAxis:r})})),this.SW={boundaries:s,tilesInfo:n},this}yL(t){var e,i;const s=this.gW,n=this.SW,r=1===t?null===(e=this.MN.mousePicking)||void 0===e?void 0:e.shader:null===(i=this.MN.tile)||void 0===i?void 0:i.shader;if(this.MN.tile&&r&&s&&n){const e=r,i=this.MN.tile,o={x:(n.boundaries.max.x-n.boundaries.min.x)*Math.sign(this.yw.x),y:(n.boundaries.max.y-n.boundaries.min.y)*Math.sign(this.yw.y)},a={x:o.x/this.En.columns,y:o.y/this.En.rows},h=this.dt.Wi(),l={x:a.x/h.x,y:a.y/h.y};if("solid"===i.renderMode||1===t)this.zL.JL(e).lV(e,((e,n,r)=>{if(1===t)this.zL.AV(e("uColor"),this.SO);else if("solid"===i.renderMode){const{fillStyleSolid:t}=i;this.zL.AV(e("uColor"),t.getColor())}return this.zL.fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).uV(s.rectangleLocationsBuffer,void 0,{location:n("aPos"),size:2}).cV(e("uScaling"),[this.yw.x*this.En.columns,this.yw.y*this.En.rows]).cV(e("uTranslationAxis"),[this.Pi.x,this.Pi.y]).Pp(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),!0}));else if("paletted"===i.renderMode){const{fillStylePaletted:r}=i,o=this.Al;this.zL.lV(e,((i,a,h)=>{let u=!1;var c,d;return this.zL.JL(e).cV(i("uScale"),this.dR.gV()).cV(i("uDisp"),this.dR.pV()).Ez(h,r.lut,o).uV(s.rectangleLocationsBuffer,void 0,{location:a("aPos"),size:2}).fV(i("uIsHighlighted"),this.Ko).AV(i("uHighlightColorOffset"),2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0),c=t=>{this.zL.cV(i("uTileDimensions"),["columns"===this.En.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.En.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},d=(t,e)=>{const r=n.tilesInfo.get(t.tileData);if(!r)return;let o;const a=this.zL.sR();if("bilinear"===this.aW._()){const t=(this.dt.x.ct(r.startLocationAxis.x)+l.x/2)*a,e=(this.dt.y.ct(r.startLocationAxis.y)+l.y/2)*a;o=[t,e,(this.dt.x.ct(r.startLocationAxis.x+r.sizeAxis.x)-l.x/2)*a-t,(this.dt.y.ct(r.startLocationAxis.y+r.sizeAxis.y)-l.y/2)*a-e]}else{const t=this.dt.x.ct(r.startLocationAxis.x)*a,e=this.dt.y.ct(r.startLocationAxis.y)*a;o=[t,e,this.dt.x.ct(r.startLocationAxis.x+r.sizeAxis.x)*a-t,this.dt.y.ct(r.startLocationAxis.y+r.sizeAxis.y)*a-e]}this.zL.PV(i("uTileBounds"),o).cV(i("uScaling"),[r.renderSizeAxis.x,r.renderSizeAxis.y]).cV(i("uTranslationAxis"),[r.startRenderLocationAxis.x,r.startRenderLocationAxis.y]).dV(i("uTileIntensityValues"),t.intensityDataTexture,1).Pp(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),u=!0},s.gridTileSizes.forEach((t=>{c(t),t.tiles.forEach((t=>{d(t)}))})),u}))}}const o=this.mW,a=this.MN.wireframe,h=1===t||null==a?void 0:a.shader;if(o&&a&&h&&"primitive"===a.renderMode){const{fillStyleSolid:e}=a;this.zL.JL(h).lV(h,((i,s,n)=>((this.dt instanceof Li||this.dt instanceof mu)&&this.zL.cV(i("uScale"),this.dR.gV()).cV(i("uDisp"),this.dR.pV()),this.zL.fV(i("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(i("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0).AV(i("uColor"),e.getColor()).uV(o.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).cV(i("uScaling"),[this.yw.x,this.yw.y]).cV(i("uTranslationAxis"),[this.Pi.x,this.Pi.y]).Pp(this.zL.gl.LINES,2*o.wireframeSegmentsLength),!0)))}else if(o&&a&&h&&"triangulated"===a.renderMode){const{geometry:e,solidLine:i,fillStyleSolid:s}=a;this.zL.JL(h).lV(h,((n,r,a)=>((this.dt instanceof Li||this.dt instanceof mu)&&this.zL.cV(n("uScale"),this.dR.gV()).cV(n("uDisp"),this.dR.pV()),this.zL.fV(n("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(n("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(n("uRenderEffectMask"),2===t?1:0).AV(n("uColor"),s.getColor()).fV(n("uThicknessPixels"),i.getThickness()).cV(n("uRatioPxClip"),[2/this.us.oi().x,2/this.us.oi().y]).uV(o.wireframeCoordinatesBuffer,1,{location:r("aLocationA"),size:2},{location:r("aLocationB"),size:2}).cV(n("uScaling"),[this.yw.x,this.yw.y]).cV(n("uTranslationAxis"),[this.Pi.x,this.Pi.y]),e.JL(a,!1).Pp(o.wireframeSegmentsLength),!0)))}return this}oS(t){return this.lW.push(t),mp(this.fW.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this.Al=void 0,this}Nt(){return this.uW&&(this.fW.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.fl=!0,this.uW=!1,this.Al=void 0),this}dispose(){super.dispose();const t=this.gW;t&&(t.gridTiles.forEach((t=>{this.zL.WL(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.zL.SV(t.rectangleLocationsBuffer)),this.gW=void 0;const e=this.mW;return e&&this.zL.SV(e.wireframeCoordinatesBuffer),this.mW=void 0,this.MN={},this}GL(){return this.dispose(),this}dO(t){return this.yO===t&&{}}gg(t){const e=t,i="columns"===this.En.dataOrder?e.x:e.y,s="columns"===this.En.dataOrder?e.y:e.x,n="columns"===this.En.dataOrder?this.Pi.x:this.Pi.y,r="columns"===this.En.dataOrder?this.Pi.y:this.Pi.x;let o=(i-n)/("columns"===this.En.dataOrder?this.yw.x:this.yw.y),a=(s-r)/("columns"===this.En.dataOrder?this.yw.y:this.yw.x);o=Math.floor(kt(o,0,this.En.primaryDimensionVectorsCount-1)),a=Math.floor(kt(a,0,this.En.secondaryDimensionVectorsCount-1));const h=this.vW(o,a),l="columns"===this.En.dataOrder?{x:this.Pi.x+(o+.5)*this.yw.x,y:this.Pi.y+(a+.5)*this.yw.y}:{x:this.Pi.x+(a+.5)*this.yw.x,y:this.Pi.y+(o+.5)*this.yw.y},u="columns"===this.En.dataOrder?o:a,c="columns"===this.En.dataOrder?a:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:h}}vx(t){const e=this.SW;if(!e||t.xe.boundaries.max.x||t.ye.boundaries.max.y)return;const i=t,s="columns"===this.En.dataOrder?i.x:i.y,n="columns"===this.En.dataOrder?i.y:i.x,r="columns"===this.En.dataOrder?this.Pi.x:this.Pi.y,o="columns"===this.En.dataOrder?this.Pi.y:this.Pi.x,a="columns"===this.En.dataOrder?this.yw.x:this.yw.y,h="columns"===this.En.dataOrder?this.yw.y:this.yw.x,l=kt((s-r)/a-.5,0,this.En.primaryDimensionVectorsCount-1),u=kt((n-o)/h-.5,0,this.En.secondaryDimensionVectorsCount-1),c=kt(Math.ceil(l)-1,0,this.En.primaryDimensionVectorsCount-1),d=kt(Math.ceil(u)-1,0,this.En.secondaryDimensionVectorsCount-1),f={point:{x:c,y:d},value:this.vW(c,d)},g={point:{x:c,y:d+1},value:this.vW(c,d+1)},m={point:{x:c+1,y:d},value:this.vW(c+1,d)},p={point:{x:c+1,y:d+1},value:this.vW(c+1,d+1)},y=Lr({x:l,y:u},f,g,m,p);if(void 0===y)return;const A=kt(Math.floor(l+.5),0,this.En.primaryDimensionVectorsCount-1),x=kt(Math.floor(u+.5),0,this.En.secondaryDimensionVectorsCount-1),S="columns"===this.En.dataOrder?A:x,b="columns"===this.En.dataOrder?x:A,v=t;return{x:v.x,y:v.y,column:S,row:b,cellValue:y}}vW(t,e){for(let i=0;i=s.iFirstVector.primary&&t<=s.iFirstVector.primary+s.sizeHeatmapDataVectors.primary-1&&e>=s.iFirstVector.secondary&&e<=s.iFirstVector.secondary+s.sizeHeatmapDataVectors.secondary-1){const i=t-s.iFirstVector.primary,n=e-s.iFirstVector.secondary,r=i*s.sizeHeatmapDataVectors.secondary+n;return s.intensityData[r]}}return 0}xt(){var t;return(null===(t=this.SW)||void 0===t?void 0:t.boundaries.max.x)||0}vt(){var t;return(null===(t=this.SW)||void 0===t?void 0:t.boundaries.min.x)||0}Mt(){var t;return(null===(t=this.SW)||void 0===t?void 0:t.boundaries.max.y)||0}bt(){var t;return(null===(t=this.SW)||void 0===t?void 0:t.boundaries.min.y)||0}Vl(){return 0}zl(){return 0}hk(){const t=[];return this.fW.gridTiles.forEach((e=>{if(!e.hasIntensityData)return;const i=new Array(e.sizeUniqueHeatmapDataVectors.primary).fill(0).map((t=>new Array(e.sizeUniqueHeatmapDataVectors.secondary).fill(0)));for(let t=0;t0?"ProgressiveX":"RegressiveX":this.yw.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}),this.MG=new ip(this.dt,this));const t=this.MG.gG(this.wb,this.Ru._());if(t>0){for(let e=0;e0?this.wb[0].boundaries.min.x:_e:this.ol.min.y=this.wb.length>0?this.wb[0].boundaries.min.y:_e}this.wb.forEach((t=>t.shape.Ds()));const e=this.wb.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Dt(null===(i=e.shape.Al)||void 0===i?void 0:i.min,_e)),t.max=Math.max(t.max,Dt(null===(s=e.shape.Al)||void 0===s?void 0:s.max,Fe)),t}),{min:_e,max:Fe});return this.wb.forEach((t=>{t.shape.Al=e})),this.Ru.o=!1,this}yL(t){return this.wb.forEach((e=>e.shape.yL(t))),this}dS(t){if(0===t.length)return this;let e=0;const i=this.bW.dataPerSegment,s=t.length;do{let n=this.wb[this.wb.length-1],r=n?i-(n.existingDataPointsCount+(n.hasJoint?1:0)):0,o=!1;if(!n||0===r){const t={columns:"columns"===this.En.scrollDimension?i:this.En.resolution,rows:"rows"===this.En.scrollDimension?i:this.En.resolution,heatmapDataType:this.En.heatmapDataType,dataOrder:this.En.scrollDimension};let e="columns"===this.En.scrollDimension?{x:this.Pi.x+this.yw.x*this.xW,y:this.Pi.y}:{x:this.Pi.x,y:this.Pi.y+this.yw.y*this.xW};this.wb.length>0&&(e="columns"===this.En.scrollDimension?{x:e.x-1*this.yw.x,y:e.y}:{x:e.x,y:e.y-1*this.yw.y},o=!0);const s=new xp(this.aO,this.lO,this.dt,wt,[],t,this.yO,this.SO).rS(this.aW._()).ke(this.be).qy(this.Ky).sS(e,this.yw);n={shape:s,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.xW,hasJoint:!1,boundaries:{min:{x:s.vt(),y:s.bt()},max:{x:s.xt(),y:s.Mt()}}},this.wb.push(n),r=i-(o?1:0)}const a=s-e,h=Math.min(r,a),l=t.slice(e,e+h),u={type:"intensity",values:l,startPrimary:n.existingDataPointsCount+(n.hasJoint?1:0),startSecondary:0,lengthPrimary:h,lengthSecondary:this.En.resolution};o&&(u.values.unshift(this.MW),u.lengthPrimary+=1,n.hasJoint=!0),n.shape.oS(u),n.existingDataPointsCount+=h,n.existingCoordinatesCount+=h+(o?1:0),this.MW=l[l.length-1],this.xW+=h,e+=h}while(e{const r=t.dataStartIndex,o=t.dataStartIndex+t.existingDataPointsCount-1;if(so)return;const a=i-r,h=Math.min(s,o),l=h-a+1,u=e.slice(a-i,h-i+1),c={type:"intensity",startSecondary:0,lengthSecondary:n,startPrimary:a,lengthPrimary:l,values:u};t.shape.oS(c)}));const r=this.xW-1;if(s>r){const t=s-r,i=e.slice(-t);if(i.length{t.shape.dispose().GL()})),this.wb.length=0,this.ol="columns"===this.En.scrollDimension?m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.En.resolution*this.yw.y}):m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.En.resolution*this.yw.x,y:this.Pi.y}),this.xW=0,this.MW=void 0,this}sS(t,e){return super.sS(t,e),this.wb.forEach(((i,s)=>{const n={x:t.x+i.dataStartIndex*e.x,y:t.y+i.dataStartIndex*e.y};i.shape.sS(n,e),i.boundaries={min:{x:i.shape.vt(),y:i.shape.bt()},max:{x:i.shape.xt(),y:i.shape.Mt()}}})),this.wb.length>0?this.ol=qe(...this.wb.map((t=>t.boundaries))):this.ol="columns"===this.En.scrollDimension?m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x,y:this.Pi.y+this.En.resolution*this.yw.y}):m({x:this.Pi.x,y:this.Pi.y},{x:this.Pi.x+this.En.resolution*this.yw.x,y:this.Pi.y}),this}ke(t){return super.ke(t),this.wb.forEach((t=>t.shape.ke(this.be))),this}qy(t){return super.qy(t),this.wb.forEach((t=>t.shape.qy(this.Ky))),this}rS(t){return super.rS(t),this.wb.forEach((e=>e.shape.rS(t))),this}dispose(){return super.dispose(),this.wb.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.wb.forEach((e=>e.shape.setVisible(t))),this}GL(){return this.wb.forEach((t=>t.shape.GL())),this}dO(t){return this.yO===t&&{}}gg(t){const e=ut(t,this.dt,this.engine.dt),i=this.wb.reduce(((i,s)=>{const n=s.shape.gg(t);if(n){const t=Ye(ut(n,this.dt,this.engine.dt),e);if(void 0===i||t=this.xW||"rows"===this.En.scrollDimension&&e>=this.xW)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}vx(t){const e=ut(t,this.dt,this.engine.dt),i=this.wb.reduce(((i,s)=>{const n=s.shape.vx(t);if(n){const t=Ye(ut(n,this.dt,this.engine.dt),e);if(void 0===i||t=this.xW||"rows"===this.En.scrollDimension&&e>=this.xW)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Vl(){return 0}zl(){return 0}cs(t){return super.cs(t),this.wb.forEach((e=>e.shape.cs(t))),this}}class vp extends qn{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.aW=y("bilinear"),this.Ky=Tn.lineStyle,this.En=r}rS(t){return this.aW.M(t),this}nS(){return this.aW._()}qy(t){return this.Ky="function"==typeof t?t(this.Ky):t,this}hS(){return this.Ky}}class Mp extends vp{constructor(t,e,i,s,n,r,o,a){super(t,e,i,s,n,r),this.dR=new Im,this.MN={},this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be}),this.aO=t,this.lO=e,this.yO=o,this.SO=a,this.zL=t.uO(),this.lO=e,this.sk=new xp(this.aO,t._W,t.dt,wt,[],{columns:r.sectors,rows:r.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===r.dataOrder?"rows":"columns",dW:this.zL.NL},-1,C).qy(nt);const h=2*Math.PI/360,l=new Float32Array(724);let u=0;l[u+0]=0,l[u+1]=0,u+=2;for(let t=0;t<=360;t+=1){const e=t*h,i=Math.cos(e),s=Math.sin(e);l[u+0]=i,l[u+1]=s,u+=2}this.wW={vertexBuffer:this.zL.oV(l),drawMode:this.zL.gl.TRIANGLE_FAN,drawLength:362}}Ds(){const t=this.ga(),e=this.be,i=this.mO.fillStyleSolid(t),s=this.mO.fillStylePaletted(t),n=i||s,r=this.aW._(),o=this.aW.o,a=this.jo._(),h=this.jo.o;return this.dR.yV(this.dt),this.sk.Ds(),this.sk.gW?((t||o)&&(this.MN.fill=n?{shader:this.zL.cE(Wg["2D"],Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),normalSource:void 0}),s&&Wg.PolarHeatmap({interpolation:"bilinear"===r&&"bilinear",intensityTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this.En.dataOrder,lut:s.lut}),i&&Wg.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:s,fillStyleSolid:i}:void 0),h&&(this.MN.mousePicking=a?{shader:this.zL.cE(Wg["2D"],Wg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:gg(this.dt),normalSource:void 0}),Wg.Color({dataType:"uniform"}))}:void 0),this.Sa(e),this.aW.o=!1,this.jo.o=!1,this):this}yL(t){var e;const{vertexBuffer:i,drawLength:s,drawMode:n}=this.wW,r=this.sk.gW;if(!this.MN.fill||!r)return this;const{fillStylePaletted:o,fillStyleSolid:a}=this.MN.fill,h=1===t?null===(e=this.MN.mousePicking)||void 0===e?void 0:e.shader:this.MN.fill.shader;if(!h)return this;const l=this.dt.Xv(),u=Math.min(l.start,l.end),c=Math.max(l.start,l.end),d=Math.min(this.En.amplitudeStart,this.En.amplitudeStart+(this.En.annuli-1)*this.En.amplitudeStep),f=Math.max(this.En.amplitudeStart,this.En.amplitudeStart+(this.En.annuli-1)*this.En.amplitudeStep);let g;return g=l.end>l.start?Math.min(f,c)-l.start:Math.max(d,u)-l.start,this.zL.JL(h).lV(h,((e,h,l,u)=>{if(this.zL.cV(e("uScale"),this.dR.gV()).cV(e("uDisp"),this.dR.pV()).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0).cV(u("uViewportSize"),[this.aO.oi().x*this.zL.sR(),this.aO.oi().y*this.zL.sR()]).cV(e("uScaling"),[g,g]).cV(e("uTranslationAxis"),[0,0]).uV(i,void 0,{location:h("aPos"),size:2}).fV(u("uAngleOffset"),this.dt.Kv()%(2*Math.PI)).fV(u("uAngleDirection"),this.dt.hx()?1:-1).fV(u("uSectors"),this.En.sectors).fV(u("uAnnuli"),this.En.annuli),1===t)this.zL.AV(e("uColor"),this.SO);else{if(this.zL.fV(e("uAmplitudeStart"),this.En.amplitudeStart).fV(e("uAmplitudeStep"),this.En.amplitudeStep).fV(e("uAmplitudeAxisStart"),this.dt.Xv().start).fV(e("uAmplitudeAxisEnd"),this.dt.Xv().end),o){const t=this.sk.Al;this.zL.Ez(l,o.lut,t).dV(e("uTileIntensityValues"),r.gridTiles[0].intensityDataTexture,0)}a&&this.zL.AV(e("uColor"),a.getColor())}return this.zL.Pp(n,s),!0})),this}oS(t){return this.sk.oS(t),this}Nt(){return this.sk.Nt(),this}dispose(){return super.dispose(),this.sk.dispose(),this.MN={},this.zL.SV(this.wW.vertexBuffer),this}GL(){return this.dispose(),this}ke(t){return super.ke(t),this.sk.ke(this.be),this}dO(t){return this.yO===t&&{}}gg(t){const e=this.En.amplitudeStart,i=this.En.amplitudeStart+(this.En.annuli-1)*this.En.amplitudeStep,s=Math.min(e,i),n=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituden)return;let r=Math.round((t.angle-0)/360*this.En.sectors);r>=this.En.sectors&&(r=0);const o=Math.round((t.amplitude-e)/(i-e)*(this.En.annuli-1));return{iAnnulus:o,iSector:r,cellValue:this.vW(o,r),angle:r*(360/this.En.sectors),amplitude:e+o*(i-e)/(this.En.annuli-1)}}vx(t){const e=this.En.amplitudeStart,i=this.En.amplitudeStart+(this.En.annuli-1)*this.En.amplitudeStep,s=Math.min(e,i),n=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituden)return;const r=(t.angle-0)/360*this.En.sectors,o=(t.amplitude-e)/(i-e)*(this.En.annuli-1),a=Math.floor(r),h=Math.floor(o),l={point:{x:h,y:a},value:this.vW(h,a)},u={point:{x:h,y:a+1},value:this.vW(h,a+1)},c={point:{x:h+1,y:a},value:this.vW(h+1,a)},d={point:{x:h+1,y:a+1},value:this.vW(h+1,a+1)},f=Lr({x:o,y:r},l,u,c,d);return void 0!==f?{iAnnulus:h,iSector:a,cellValue:f,angle:t.angle,amplitude:t.amplitude}:void 0}vW(t,e){const i="annuli"===this.En.dataOrder?t:e,s="annuli"===this.En.dataOrder?e:t;for(let t=0;t=e.iFirstVector.primary&&i<=e.iFirstVector.primary+e.sizeHeatmapDataVectors.primary-1&&s>=e.iFirstVector.secondary&&s<=e.iFirstVector.secondary+e.sizeHeatmapDataVectors.secondary-1){const t=i-e.iFirstVector.primary,n=s-e.iFirstVector.secondary,r=t*e.sizeHeatmapDataVectors.secondary+n;return e.intensityData[r]}}return 0}xt(){return 0}vt(){return 0}Mt(){return 0}bt(){return 0}Vl(){return 0}zl(){return 0}}class Tp extends bm{constructor(t){super(t);const{vertices:e,drawMode:i,drawSize:s}=this.uN();this.cN=t.oV(e),this.fN=s,this.AN=i}JL(t){return this.zL.uV(this.cN,0,{location:t.attribute("aCurveOrBaseline"),size:1},{location:t.attribute("aSegmentSide"),size:1}),this}Pp(t,e,i){return this.zL.KV(void 0!==e?e:this.AN,i||0,this.fN,t),this}uN(){return{vertices:new Float32Array([1,0,0,0,0,1,0,1,1,1,1,0]),drawMode:this.zL.gl.TRIANGLES,drawSize:6}}IE(){this.zL.SV(this.cN)}}const wp=t=>{let e=t.CV.CE.get(void 0);return e||(e=new Tp(t),t.CV.CE.set(void 0,e),e)};class Ep extends or{constructor(t,i,s,n){super(t,i,s,n,[{type:"DataPattern",args:{pattern:"ProgressiveX"}}]),this.kW=Tn.fillStyle,this.TW=Tn.fillStyle,this.FW=y(e.PointShape.Circle),this.IW=y(5),this.PW=y(0),this.DW=y(void 0),this.iF=!0}KT(t){return this.kW=Xn(this.kW,t),this}rF(){return this.kW}BW(){return jn(this.LW,this.kW)}RW(){return jn(this.EW,this.TW)}qT(t){return this.TW=Xn(this.TW,t),this}nF(){return this.TW}aF(t){return this.FW.M(t),this}lF(){return this.FW._()}QT(t){return this.IW.M(t),this}oF(){return this.IW._()}uF(t){return this.PW.M(t),this}cF(){return this.PW._()}JT(t){return this.DW.M(t),this}dF(){return this.DW._()}}class kp extends Km{constructor(t,e){super(t,e),this.XN=!1,this.jN={enabled:!1,totalDataPointsAtTime:0},this.QN=t instanceof Li?{type:"linear",scale:t}:{type:"unknown"},this.$N.ha("DataPattern",(t=>{!1===t.allowDataGrouping&&(this.XN=!0)}))}VW(t,e){var i,s;const n=null==t?void 0:t.FT,r=null==t?void 0:t.IT,o=null==t?void 0:t.fT,a=null==t?void 0:t.dT;if(!t||this.XN||!this.UN||"linear"!==this.QN.type||!n||!r||void 0===o||void 0===a||!e)return{cpStateChanged:!1,cpActive:!1};const h=null===(i=t.TT())||void 0===i?void 0:i.x,l=null===(s=t.XT())||void 0===s?void 0:s.x;if(o<2||void 0===h||void 0===l)return{cpStateChanged:!1,cpActive:!1};const u=this.calculateAvgStepBetweenDataPoints(l,h,o),c=this.QN.scale,d=Math.abs("x"===this.UN?c.Wi().x:c.Wi().y),f=d/u,g=Math.floor(.8*f),m=g*u,p=g>=4,y=this.jN.enabled?this.jN.columnWidthAxis/d<1.5:void 0,A=this.jN.enabled&&g>this.jN.dataPointsPerColumn?g/this.jN.dataPointsPerColumn>=2:void 0;let x;return!0===this.jN.enabled?y?A&&(x={enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}):x=p?{enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}:{enabled:!1,totalDataPointsAtTime:o}:p&&(x={enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}),this.jN=x||{...this.jN,totalDataPointsAtTime:o},!!x&&this.Lg(),{cpStateChanged:!!x,cpActive:this.jN.enabled}}zW(t,e){var i,s,n;const r=t.FT,o=t.IT,a=t.AT,h=t.fT,l=t.dT;if(this.XN||!this.jN.enabled||!r||!o||void 0===e)return;const u=r.length,c=this.jN.columnWidthAxis,d=this.dt.x.getInnerStart(),f=this.dt.x.getInnerEnd(),g=pd(d,f,r,a,h,l,e,1);if(!g)return;const m=r[g.iFirstSampleDataArray];if(this.OW){if(this.OW.iFirstPackedSample0)if(this.OW.packedColumnsCount-=t,this.OW.packedColumnsCount>0){this.OW.packedDataX.splice(0,2*t),this.OW.packedDataY.splice(0,2*t),this.OW.packedDataColors&&this.OW.packedDataColors.splice(0,2*t),this.OW.packedDataLookupValues&&this.OW.packedDataLookupValues.splice(0,2*t),this.OW.origin+=t*c;const e=yd(this.OW.origin,Math.max(a-1-u+1,0),a-1,(t=>r[md(t,a,u)])),i=md(e,a,u);this.OW.iFirstPackedSample=r[i]>=this.OW.origin?e:e+1}else this.OW=void 0}if(void 0!==(null===(i=this.OW)||void 0===i?void 0:i.iLastPackedSample)&&this.OW.iLastPackedSample>g.iLastSample){const t=r[g.iLastSampleDataArray],e=Math.min(Math.floor((this.OW.origin+this.OW.packedColumnsCount*c-t)/c),this.OW.packedColumnsCount);if(e>0)if(this.OW.packedColumnsCount-=e,this.OW.packedColumnsCount>0){for(let t=0;t<2*e;t+=1)this.OW.packedDataX.pop(),this.OW.packedDataY.pop(),this.OW.packedDataColors&&this.OW.packedDataColors.pop(),this.OW.packedDataLookupValues&&this.OW.packedDataLookupValues.pop();const t=yd(this.OW.origin+this.OW.packedColumnsCount*c,Math.max(a-1-u+1,0),a-1,(t=>r[md(t,a,u)])),i=md(t,a,u);this.OW.iLastPackedSample=r[i]<=this.OW.origin+this.OW.packedColumnsCount*c?t:t-1}else this.OW=void 0}}const p=this.OW||{origin:m,packedColumnsCount:0,packedDataX:[],packedDataY:[],packedDataColors:t.NT?[]:void 0,packedDataLookupValues:t.OT?[]:void 0,packedDataSize:t.GT?[]:void 0,packedDataRotation:t.WT?[]:void 0,iFirstPackedSample:g.iFirstSample,iLastPackedSample:void 0},y=(t,e,i)=>{let s=Math.min(t,t+e*c),n=Math.max(t,t+e*c),h=i;const l=[];do{let t=Fe,i=Fe,d=-1,f=_e,m=_e,y=-1,A=0;for(;h<=g.iLastSample&&h>=g.iFirstSample;){const g=h%u,x=r[g],S=o[g];if(s<=x&&x<=n)A+=1,Number.isNaN(S)||(S>i&&(t=x,i=S,d=h),S0)t=t===Fe?Number.NaN:t,i=i===Fe?Number.NaN:i,f=f===_e?Number.NaN:f,m=m===_e?Number.NaN:m,d0?(p.packedDataX.push(t),p.packedDataY.push(i),p.packedDataX.push(f),p.packedDataY.push(m)):(p.packedDataX.unshift(f),p.packedDataY.unshift(m),p.packedDataX.unshift(t),p.packedDataY.unshift(i))):(l.push({iFirst:y,iSecond:d}),e>0?(p.packedDataX.push(f),p.packedDataY.push(m),p.packedDataX.push(t),p.packedDataY.push(i)):(p.packedDataX.unshift(t),p.packedDataY.unshift(i),p.packedDataX.unshift(f),p.packedDataY.unshift(m)));else{const t=e>0?p.iLastPackedSample:p.iFirstPackedSample;if(void 0===t)l.push({iFirst:0,iSecond:0}),e>0?(p.packedDataX.push(Number.NaN),p.packedDataY.push(Number.NaN),p.packedDataX.push(Number.NaN),p.packedDataY.push(Number.NaN)):(p.packedDataX.unshift(Number.NaN),p.packedDataY.unshift(Number.NaN),p.packedDataX.unshift(Number.NaN),p.packedDataY.unshift(Number.NaN));else{const i=md(t,a,u),h=r[i],d=o[i],f=(s+n)/2,g=f-e*c/6,m=d+(g-h)/(x-h)*(S-d),y=f+e*c/6,A=d+(y-h)/(x-h)*(S-d);l.push({iFirst:t,iSecond:t}),e>0?(p.packedDataX.push(g),p.packedDataY.push(m),p.packedDataX.push(y),p.packedDataY.push(A)):(p.packedDataX.unshift(g),p.packedDataY.unshift(m),p.packedDataX.unshift(y),p.packedDataY.unshift(A))}}p.packedColumnsCount+=1,e>0?p.iLastPackedSample=h-1:(p.iFirstPackedSample=h+1,p.origin=s),s+=e*c,n+=e*c,A=0,t=Fe,i=Fe,d=-1,f=_e,m=_e,y=-1}}s+=e*c,n+=e*c}while(s>=d&&n<=f);return l},A=y(p.origin+p.packedColumnsCount*c,1,void 0!==(null===(s=this.OW)||void 0===s?void 0:s.iLastPackedSample)?this.OW.iLastPackedSample+1:g.iFirstSample),x=y(p.origin,-1,void 0!==(null===(n=this.OW)||void 0===n?void 0:n.iFirstPackedSample)?this.OW.iFirstPackedSample-1:g.iFirstSample),S=t.NT&&p.packedDataColors?[t.NT,p.packedDataColors]:void 0,b=t.OT&&p.packedDataLookupValues?[t.OT,p.packedDataLookupValues]:void 0,v=t.GT&&p.packedDataSize?[t.GT,p.packedDataSize]:void 0,M=t.WT&&p.packedDataRotation?[t.WT,p.packedDataRotation]:void 0;if(S||b||v||M){for(const t of A){const e=md(t.iFirst,a,u),i=md(t.iSecond,a,u);S&&S[1].push(S[0][e],S[0][i]),b&&b[1].push(b[0][e],b[0][i]),v&&v[1].push(v[0][e],v[0][i]),M&&M[1].push(M[0][e],M[0][i])}for(const t of x){const e=md(t.iFirst,a,u),i=md(t.iSecond,a,u);S&&S[1].unshift(S[0][i],S[0][e]),b&&b[1].unshift(b[0][i],b[0][e]),v&&v[1].unshift(v[0][i],v[0][e]),M&&M[1].unshift(M[0][i],M[0][e])}}return this.OW=p.packedColumnsCount>0?p:void 0,{x:p.packedDataX,y:p.packedDataY,color:p.packedDataColors,lookup:p.packedDataLookupValues,size:p.packedDataSize,rotation:p.packedDataRotation}}Lg(){this.OW=void 0}sG(t){if(this.UN&&"linear"===this.QN.type){const e="x"===this.UN?this.QN.scale.x.tA:this.QN.scale.y.tA;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Je===Rs.progressive||e.Je===Rs.regressive){const e=Math.abs("x"===this.UN?this.QN.scale.x.getInnerInterval():this.QN.scale.y.getInnerInterval());if(this.jN.enabled)return 2*e/this.jN.columnWidthAxis;const i=t.length,s=t[0],n=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.UN?s.x:s.y,"x"===this.UN?n.x:n.y,i)}}}eG(t,e,i){if(!this.UN)return e;const s=i.length;let n=Bn(i,t.min,this.UN,this.YN,0,s-1);void 0===n&&(n=this.YN?s-1:0);let r=Bn(i,t.max,this.UN,this.YN,0,s-1);return void 0===r&&(r=this.YN?0:s-1),1+Math.abs(r-n)}hG(){}}class Cp extends Ep{constructor(t,e,i,s,n,r){super(t,e,i,s),this.dR=new Im,this.xG=new kp(this.dt,this),this.mO=mg({lineStyleSolid:()=>Ji(this.Cu)&&this.Cu,lineStyleDashed:()=>Kr(this.Cu)&&this.Cu,strokeFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},strokeFillLinearGradient:()=>{const t=this.Cu.getFillStyle();return it(t)&&t},strokeFillRadialGradient:()=>{const t=this.Cu.getFillStyle();return Q(t)&&t},strokeFillIndividual:()=>{const t=this.Cu.getFillStyle();return W(t)&&t},strokeFillPaletted:()=>{const t=this.Cu.getFillStyle();return H(t)&&t},areaFillSolid:()=>G(this.kW)&&this.kW,areaFillLinearGradient:()=>it(this.kW)&&this.kW,areaFillRadialGradient:()=>Q(this.kW)&&this.kW,areaFillIndividual:()=>W(this.kW)&&this.kW,areaFillPaletted:()=>H(this.kW)&&this.kW,markerFillSolid:()=>G(this.TW)&&this.TW,markerFillLinearGradient:()=>it(this.TW)&&this.TW,markerFillRadialGradient:()=>Q(this.TW)&&this.TW,markerFillPaletted:()=>H(this.TW)&&this.TW,markerFillIndividual:()=>W(this.TW)&&this.TW}),this.sF=y(void 0),this.NW=[],this.fl=!1,this.GW=[],this.WW=void 0,this.lO=e,this.MN={type:"none"},this.zL=t.uO(),this.aO=t,this.xN=this.zL.rz,this.yO=n,this.SO=r}eF(t){return this.sF.M(De(t,this.sF._(),(()=>[t.jT(((e,i)=>{this.NW.push({min:e,max:i}),void 0===t.YT()&&this.UW&&this.GW.push({min:e,max:i})})),t.ZT((()=>{this.fl=!0,this.UW=void 0,this.WW=void 0,this.xG.Lg()}))]))),this.WW=void 0,this}Ds(){var t,i,s,n,r,o,a,h,l,c,d;const f=null===(t=this.sF._())||void 0===t?void 0:t.Wt,g=this.sF.o,m=null==f?void 0:f.FT,p=null==f?void 0:f.IT;if(!f||!m||!p)return this;const y=f.OT,A=f.NT,x=f.GT,S=f.WT,b=f.AT,v=f.fT,M=f.dT,T=this.Cu,w=this.kW,E=g||this.va()||this.BW()||this.RW(),k=this.mO.lineStyleSolid(E),C=this.mO.lineStyleDashed(E),D=k||C,I=D&&D.getThickness(),_=this.mO.strokeFillSolid(E),F=this.mO.strokeFillLinearGradient(E),L=this.mO.strokeFillRadialGradient(E),z=this.mO.strokeFillIndividual(E),P=this.mO.strokeFillPaletted(E),R=_||F||L||z||P,V=this.mO.areaFillSolid(E),B=this.mO.areaFillLinearGradient(E),O=this.mO.areaFillRadialGradient(E),N=this.mO.areaFillIndividual(E),U=this.mO.areaFillPaletted(E),G=V||B||O||N||U,W=this.mO.markerFillSolid(E),Y=this.mO.markerFillLinearGradient(E),H=this.mO.markerFillRadialGradient(E),X=this.mO.markerFillPaletted(E),j=this.mO.markerFillIndividual(E),$=W||Y||H||X||j,q=this.FW._(),J=this.IW._(),K=this.IW.o,Z=this.DW.o,Q=this.NW.length>0||Z,tt=this.fl,et=tt?[f.HT()]:(t=>{const e=[];for(const i of t){let t=!1;for(const s of e)if(i.min>=s.min&&i.min<=s.max||i.max>=s.min&&i.max<=s.max){s.min=Math.min(s.min,i.min),s.max=Math.min(s.max,i.max),t=!0;break}t||e.push(i)}return e})(this.NW),it=this.dt.x.Yt,st=this.dt.x.getInnerStart(),nt=this.dt.x.getInnerEnd(),rt=f.YT(),ot=!!C,at=this.jo._(),ht=this.jo.o,{cpStateChanged:lt,cpActive:ut}=this.xG.VW(f,this.iF);if(rt&&ut&&(lt||tt||Q||it||E)){const t=this.xG.zW(f,rt);if(t){const e=!lt&&!tt&&!E;this.YW=Dp(this.zL,[t.x,t.y],t.color,t.lookup,t.size,t.rotation,ot,this.YW,e,rt,1e3,this.dt._i(),(t=>$t(t,this.dt._i()))),this.HW={min:_e,max:Fe};const s=t.y.length;for(let e=0;ethis.XW.iLastSample||E){let i,s,r,o,a,h;if(1===t.dataRanges.length){const e=t.dataRanges[0];i=m.subarray(e.offset,e.offset+e.count),s=p.subarray(e.offset,e.offset+e.count),r=A?A.subarray(e.offset,e.offset+e.count):void 0,o=y?y.subarray(e.offset,e.offset+e.count):void 0,a=x?x.subarray(e.offset,e.offset+e.count):void 0,h=S?S.subarray(e.offset,e.offset+e.count):void 0}else{const e=t.dataRanges[0],n=t.dataRanges[1],l=e.count+n.count;i=new Float32Array(l),i.set(m.subarray(e.offset),0),i.set(m.subarray(n.offset,n.offset+n.count),e.count),s=new Float32Array(l),s.set(p.subarray(e.offset),0),s.set(p.subarray(n.offset,n.offset+n.count),e.count),A&&(r=new Uint32Array(l),r.set(A.subarray(e.offset),0),r.set(A.subarray(n.offset,n.offset+n.count),e.count)),y&&(o=new Float32Array(l),o.set(y.subarray(e.offset),0),o.set(y.subarray(n.offset,n.offset+n.count),e.count)),x&&(a=new Float32Array(l),a.set(x.subarray(e.offset),0),a.set(x.subarray(n.offset,n.offset+n.count),e.count)),S&&(h=new Float32Array(l),h.set(S.subarray(e.offset),0),h.set(S.subarray(n.offset,n.offset+n.count),e.count))}const l=!lt&&!tt&&!E;this.jW=Dp(this.zL,[i,s],r,o,a,h,ot,this.jW,l,rt,1e3,this.dt._i(),(t=>$t(t,this.dt._i())));let c=i,d=s,f=r,g=o;const b=this.DW._();if(b){const t="spline"===b.type?((t,e)=>{const{xValues:i,yValues:s,lookupValues:n,colors:r}=t;if(i.length<=2)return{xValues:Array.from(i),yValues:Array.from(s),lookupValues:n?Array.from(n):void 0,colors:r?Array.from(r):void 0};const o=((t,e)=>{const i=1e-5,s=t.length-1,n=Array(s);if(s>1){let r=u(0,0),o=u(0,0),a=u(0,0),h=ti(ri({x:t[1],y:e[1]},{x:t[0],y:e[0]}));const l=3;let c=0,d=0;for(let f=0;fi?Math.abs(e/(l*r.x)):1,d=Math.abs(o.x)>i?Math.abs(e/(l*o.x)):1}g[1]=ni(si(r,c),g[1]),g[2]=ri(g[2],si(o,d)),n[f]=g}}return n.length>0?n:[]})(i,s),a=o.length,h=[],l=[],c=[],d=[];for(let t=0;t{const{xValues:s,yValues:n,lookupValues:r,colors:o}=t,a=[],h=[],l=[],u=[],c=s.length,d=i;if(c>0){let t=0,e=s[0],i=n[0];a[t]=e,h[t]=i,t+=1;for(let r=1;r$t(t,this.dt._i()))),this.XW=t}}if(!rt&&(tt||Q||E)){if(!this.YW||this.YW.bufferSize{var s,n,r,o;const a=m.subarray(i.min,i.max+1),h=p.subarray(i.min,i.max+1);if(this.zL.OV(t,i.min*(this.dt._i()?2:1),$t(a,this.dt._i())),this.zL.OV(e,i.min*(this.dt._i()?2:1),$t(h,this.dt._i())),A&&(null===(s=this.YW)||void 0===s?void 0:s.bufferColors)){const t=A.subarray(i.min,i.max+1);this.zL.OV(this.YW.bufferColors,i.min,t,Uint32Array)}if(y&&(null===(n=this.YW)||void 0===n?void 0:n.bufferLookupValues)){const t=y.subarray(i.min,i.max+1);this.zL.OV(this.YW.bufferLookupValues,i.min,t,Float32Array)}if(S&&(null===(r=this.YW)||void 0===r?void 0:r.bufferRotations)){const t=S.subarray(i.min,i.max+1);this.zL.OV(this.YW.bufferRotations,i.min,t,Float32Array)}if(x&&(null===(o=this.YW)||void 0===o?void 0:o.bufferSizes)){const t=x.subarray(i.min,i.max+1);this.zL.OV(this.YW.bufferSizes,i.min,t,Float32Array)}})),this.YW.valueCount=f.fT}this.jW=this.YW}if(this.dR.yV(this.dt),E||K||ht){if(R&&D&&!1!==I){const t=-1===I?"primitive":"triangulated",e=P?["lookup",P.lookUpProperty,P.lut]:z?"attribute":F?["gradient",F]:L?["gradient",L]:"uniform";this.MN="primitive"===t?{type:t,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),C&&Wg.StippleTexture),lineStyleSolid:k,lineStyleDashed:C,fillStyleSolid:_,fillStyleLinearGradient:F,fillStyleRadialGradient:L,fillStyleIndividual:z,fillStylePaletted:P,mousePickingShader:at&&this.zL.cE(Wg["2D"],Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),C&&Wg.StippleTexture,Wg.MousePicking)}:"triangulated"===t?{type:t,shader:this.zL.cE(Wg["2D"],Wg.Color({dataType:e}),Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),this.xN?Wg.AliasedEdge:void 0,C&&Wg.StippleTextureInstanced),geometry:Xm(this.zL,I),thickness:I,lineStyleSolid:k,lineStyleDashed:C,fillStyleSolid:_,fillStyleLinearGradient:F,fillStyleRadialGradient:L,fillStyleIndividual:z,fillStylePaletted:P,mousePickingShader:at&&this.zL.cE(Wg["2D"],Wg.LineInstanced2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),C&&Wg.StippleTextureInstanced,Wg.MousePicking)}:{type:"none"}}else this.MN={type:"none"};if(this.ZW=G?{shader:this.zL.cE(Wg["2D"],U&&Wg.Color({dataType:["lookup",U.lookUpProperty,U.lut]}),N&&Wg.Color({dataType:"attribute"}),V&&Wg.Color({dataType:"uniform"}),B&&Wg.Color({dataType:["gradient",B]}),O&&Wg.Color({dataType:["gradient",O]}),Wg.Area2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0})),geometry:wp(this.zL),fillStyleSolid:V,fillStyleLinearGradient:B,fillStyleRadialGradient:O,fillStyleIndividual:N,fillStylePaletted:U,mousePickingShader:at&&this.zL.cE(Wg["2D"],Wg.Area2D({axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0}),Wg.MousePicking)}:void 0,$){const t=x?"attribute":"uniform",e=J<=1&&Wg.PointSize("uniform"),i=Wg.VertexLocation({offset:J>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:{dataType:S?"attribute-deg":"uniform"}}:void 0,axisWorldTranslation:gg(this.dt),normalSource:void 0,splitPosAttribute:!0});this.QW={shader:this.zL.cE(Wg["2D"],e,i,W&&Wg.Color({dataType:"uniform",overrideOpacity:!0}),Y&&Wg.Color({dataType:["gradient",Y],overrideOpacity:!0}),H&&Wg.Color({dataType:["gradient",H],overrideOpacity:!0}),X&&Wg.Color({dataType:["lookup",X.getLookUpProperty(),X.getPalette()],overrideOpacity:!0}),j&&Wg.Color({dataType:"attribute",overrideOpacity:!0})),geometry:ap(q,this.zL,J),fillStyleSolid:W,fillStyleLinearGradient:Y,fillStyleRadialGradient:H,fillStylePaletted:X,fillStyleIndividual:j,mousePickingShader:at&&this.zL.cE(Wg["2D"],e,i,Wg.MousePicking)}}else this.QW=void 0}const ct={min:{x:this.vt(),y:this.dt.y.getInnerStart()},max:{x:this.xt(),y:this.Mt()}};if(this.JW=this.zL.Wz(F,this,ct),this.KW=this.zL.Uz(L,this,ct),this.qW=this.zL.Wz(B,this,ct),this.tU=this.zL.Uz(O,this,ct),this.iU=this.zL.Wz(Y,this,ct),this.sU=this.zL.Uz(H,this,ct),(void 0===this.WW||Q)&&y&&(yg(P)||yg(U)||yg(X))){const t=this.WW?et:[f.HT()];let e=this.WW?this.WW.max:Fe,i=this.WW?this.WW.min:_e;const s=y;t.forEach((t=>{for(let n=t.min;n<=t.max;n+=1){const t=s[n];i=te?t:e}})),this.WW={min:i,max:e}}return this.wN=C?this.zL.Dz(C.getPattern()):void 0,this.Iu(T),this.LW=w,this.EW=this.TW,this.IW.o=!1,this.NW.length=0,this.fl=!1,this.DW.o=!1,this.sF.o=!1,this.jo.o=!1,this}yL(t){var e,i,s,n,r,o,a,h,l,u,c,d,f,g,m,p,y;const A=this.zL.gl,x=null===(e=this.YW)||void 0===e?void 0:e.bufferX,S=null===(i=this.YW)||void 0===i?void 0:i.bufferY,b=null===(s=this.YW)||void 0===s?void 0:s.bufferColors,v=null===(n=this.YW)||void 0===n?void 0:n.bufferLookupValues,M=null===(r=this.YW)||void 0===r?void 0:r.valueCount,T=null===(o=this.jW)||void 0===o?void 0:o.valueCount,w=null===(a=this.sF._())||void 0===a?void 0:a.Wt,E=null==w?void 0:w.YT();if(!x||!S||!w)return this;const k=(e,i,s)=>{if(_p(this.zL,e,this.dt._i(),x,"aLocation","X",1,!1,A.FLOAT,Float32Array.BYTES_PER_ELEMENT),_p(this.zL,e,this.dt._i(),S,"aLocation","Y",1,!1,A.FLOAT,Float32Array.BYTES_PER_ELEMENT),i&&1!==t){if(!b)return!1;_p(this.zL,e,!1,b,"aColor","",4,!0,A.UNSIGNED_BYTE,1)}if(s&&"value"===s.lookUpProperty&&1!==t){if(!v)return!1;_p(this.zL,e,!1,v,"aLookupValue","",1,!1,A.FLOAT,Float32Array.BYTES_PER_ELEMENT)}return!0},C=1===t?null===(h=this.ZW)||void 0===h?void 0:h.mousePickingShader:null===(l=this.ZW)||void 0===l?void 0:l.shader;if(this.ZW&&C&&void 0!==M&&M>0&&E){const e=this.ZW;this.zL.JL(C).lV(C,((i,s,n,r)=>!!this.zL.Oz(n,t,this,{uniforms:this.dR,mousePickingColor:this.SO,fillStyleSolid:e.fillStyleSolid,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,fillStylePaletted:e.fillStylePaletted,linearGradientInfo:this.qW,radialGradientInfo:this.tU,lookupValueRange:e.fillStylePaletted?pg(e.fillStylePaletted,this,this.WW):void 0,lookupValueBuffer:null})&&!!k(n,e.fillStyleIndividual,e.fillStylePaletted)&&(null==e||e.geometry.JL(n).Pp(M-1),!0)))}const D="none"===this.MN.type?void 0:1===t?this.MN.mousePickingShader:this.MN.shader;if("none"!==this.MN.type&&D&&void 0!==M&&M>0){const e=this.MN;this.zL.JL(D).lV(D,((i,s,n,r)=>{var o,a;if(!this.zL.Oz(n,t,this,{uniforms:this.dR,mousePickingColor:this.SO,fillStyleSolid:e.fillStyleSolid,fillStylePaletted:e.fillStylePaletted,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,fillStyleIndividual:e.fillStyleIndividual,linearGradientInfo:this.JW,radialGradientInfo:this.KW,lookupValueRange:e.fillStylePaletted?pg(e.fillStylePaletted,this,this.WW):void 0,lookupValueBuffer:"primitive"===e.type?v:null,colorBuffer:"primitive"===e.type?b:null,coordsX:"primitive"===e.type?x:void 0,coordsY:"primitive"===e.type?S:void 0,coordsHighPrecision:this.dt._i()}))return!1;if(e.lineStyleDashed){if(!this.wN)return!1;this.zL.cV(i("uStippleCount"),[this.us.oi().x/this.wN.Rz,this.us.oi().y/this.wN.Rz]).fV(r("uStippleTextureWidthLimiter"),this.wN.Lz/this.wN.Rz).fV(i("uStippleScale"),e.lineStyleDashed.getPatternScale()).dV(i("uStippleTexture"),this.wN.Bz,1)}if("primitive"===e.type){if(e.lineStyleDashed){if(!(null===(o=this.YW)||void 0===o?void 0:o.bufferLengthSoFar))return!1;this.zL.UV(s("aLengthSoFar"),this.YW.bufferLengthSoFar)}$m.SN(this.aO,M)}else{if(!k(n,e.fillStyleIndividual,e.fillStylePaletted))return!1;if(e.lineStyleDashed){if(!(null===(a=this.YW)||void 0===a?void 0:a.bufferLengthSoFar))return!1;_p(this.zL,n,!1,this.YW.bufferLengthSoFar,"aLengthSoFar","",2,!1,A.FLOAT,Float32Array.BYTES_PER_ELEMENT)}jm.yL(this.aO,e.geometry,n,this.xN&&1!==t,1===t,e.thickness,M-1)}return!0}))}const I=null===(u=this.jW)||void 0===u?void 0:u.bufferX,_=null===(c=this.jW)||void 0===c?void 0:c.bufferY,F=null===(d=this.jW)||void 0===d?void 0:d.bufferColors,L=null===(f=this.jW)||void 0===f?void 0:f.bufferLookupValues,z=null===(g=this.jW)||void 0===g?void 0:g.bufferSizes,P=null===(m=this.jW)||void 0===m?void 0:m.bufferRotations,R=1===t?null===(p=this.QW)||void 0===p?void 0:p.mousePickingShader:null===(y=this.QW)||void 0===y?void 0:y.shader,V=this.QW;let B=1;if(E){const t=this.sF?Math.abs((this.xt()-this.vt())/w.getSampleCount()):0,e=this.dt.x.getInnerInterval()/t,i=this.IW._(),s=this.dt.x.ri()/i/1,n=2*s;B=e<=s?1:Math.max(1-(e-s)/(n-s),0)}if(R&&V&&I&&_&&B>0&&void 0!==T&&T>0){const e=V,i=e.geometry.LG(this.IW._())?1:0;this.zL.JL(R).lV(R,((s,n,r,o)=>{if(!this.zL.Oz(r,t,this,{uniforms:this.dR,mousePickingColor:this.SO,fillStyleSolid:e.fillStyleSolid,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,linearGradientInfo:this.iU,radialGradientInfo:this.sU,fillStylePaletted:e.fillStylePaletted,fillStyleIndividual:e.fillStyleIndividual,lookupValueRange:e.fillStylePaletted?pg(e.fillStylePaletted,this,this.WW):void 0,lookupValueBuffer:L,lookupValueAttribDivisor:i,colorBuffer:F,colorAttribDivisor:i}))return!1;if(this.dt._i()?this.zL.uV(I,i,{location:n("aPos_highpartX"),size:1},{location:n("aPos_lowpartX"),size:1}).uV(_,i,{location:n("aPos_highpartY"),size:1},{location:n("aPos_lowpartY"),size:1}):this.zL.jV(n("aPosX"),I,i).jV(n("aPosY"),_,i),1!==t&&this.zL.fV(s("uOpacity"),B),this.IW._()>1)if(P)this.zL.jV(n("aRotDeg"),P,i).fV(s("uBaseRotDeg"),e.geometry.BG);else{const t=di(this.PW._()+e.geometry.BG),i=Math.sin(t),n=Math.cos(t);this.zL.cV(s("uRot"),[i,n])}return e.geometry.Pp(r,z,this.IW._(),T),!0}))}return this}dO(t){return this.yO===t&&{}}dispose(){var t,e,i,s,n,r,o,a,h;return super.dispose(),this.zL.SV(null===(t=this.YW)||void 0===t?void 0:t.bufferX),this.zL.SV(null===(e=this.YW)||void 0===e?void 0:e.bufferY),this.zL.SV(null===(i=this.YW)||void 0===i?void 0:i.bufferColors),this.zL.SV(null===(s=this.YW)||void 0===s?void 0:s.bufferLookupValues),this.zL.SV(null===(n=this.jW)||void 0===n?void 0:n.bufferX),this.zL.SV(null===(r=this.jW)||void 0===r?void 0:r.bufferY),this.zL.SV(null===(o=this.jW)||void 0===o?void 0:o.bufferColors),this.zL.SV(null===(a=this.jW)||void 0===a?void 0:a.bufferLookupValues),this.MN={type:"none"},this.ZW=void 0,this.QW=void 0,this.xG.Lg(),null===(h=this.sF._())||void 0===h||h.Gt(),this.YW=void 0,this.jW=void 0,this.JW=void 0,this.KW=void 0,this.qW=void 0,this.tU=void 0,this.iU=void 0,this.sU=void 0,this}GL(){return this.dispose(),this}eU(t){if(!this.UW){const{xValues:e,yValues:i}=t.readBack();this.UW={min:{x:_e,y:_e},max:{x:Fe,y:Fe}};const s=e.length;for(let t=0;tthis.UW.max.x?s:this.UW.max.x,this.UW.max.y=n>this.UW.max.y?n:this.UW.max.y}return this.GW.length=0,this.UW}const e=t.FT,i=t.IT;if(this.GW.length>0&&e&&i){for(const t of this.GW){for(let s=t.min;s<=t.max;s+=1){const t=e[s],n=i[s];this.UW.min.x=tthis.UW.max.x?t:this.UW.max.x,this.UW.max.y=n>this.UW.max.y?n:this.UW.max.y}this.GW.length=0}return this.UW}return this.UW}xt(){var t,e,i,s,n;const r=null===(t=this.sF._())||void 0===t?void 0:t.Wt;if(!r)return 0;const o=r.YT();return"ProgressiveX"===o?(null===(e=r.TT())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=r.XT())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.HW)||void 0===s?void 0:s.max)||0:"RegressiveY"===o?(null===(n=this.HW)||void 0===n?void 0:n.max)||0:this.eU(r).max.x}vt(){var t,e,i,s,n;const r=null===(t=this.sF._())||void 0===t?void 0:t.Wt;if(!r)return 0;const o=r.YT();return"ProgressiveX"===o?(null===(e=r.XT())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=r.TT())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.HW)||void 0===s?void 0:s.min)||0:"RegressiveY"===o?(null===(n=this.HW)||void 0===n?void 0:n.min)||0:this.eU(r).min.x}Mt(){var t,e,i,s,n;const r=null===(t=this.sF._())||void 0===t?void 0:t.Wt;if(!r)return 0;const o=r.YT();return"ProgressiveX"===o?Dt(null===(e=this.HW)||void 0===e?void 0:e.max,0):"RegressiveX"===o?Dt(null===(i=this.HW)||void 0===i?void 0:i.max,0):"ProgressiveY"===o?Dt(null===(s=r.TT())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Dt(null===(n=r.XT())||void 0===n?void 0:n.y,0):this.eU(r).max.y}bt(){var t,e,i,s,n;const r=null===(t=this.sF._())||void 0===t?void 0:t.Wt;if(!r)return 0;const o=r.YT();return"ProgressiveX"===o?Dt(null===(e=this.HW)||void 0===e?void 0:e.min,0):"RegressiveX"===o?Dt(null===(i=this.HW)||void 0===i?void 0:i.min,0):"ProgressiveY"===o?Dt(null===(s=r.XT())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Dt(null===(n=r.TT())||void 0===n?void 0:n.y,0):this.eU(r).min.y}Vl(){var t;const e=Math.max(Me(this.Cu),this.IW._()),i=null===(t=this.sF._())||void 0===t?void 0:t.Wt.YT();return!i||"ProgressiveX"!==i&&"RegressiveX"!==i?e:0}zl(){var t;const e=Math.max(Me(this.Cu),this.IW._()),i=null===(t=this.sF._())||void 0===t?void 0:t.Wt.YT();return!i||"ProgressiveY"!==i&&"RegressiveY"!==i?e:0}}const Dp=(t,e,i,s,n,r,o,a,h,l,u,c,d)=>{if("ProgressiveX"!==l)throw new Error("Unimplemented data pattern");const f=e[0],g=e[1],m=f.length,p=f[0],y=f[m-1],A=g[0],x=g[m-1],S=c?2:1;if(a&&h&&a.firstX&&a.lastX&&p>=a.firstX){const e=yd(a.lastX,0,m-1,(t=>f[t]));if(f[e]===a.lastX){const h=a.bufferSize-a.valueCount,l=e+1,u=m-l;if(0===u)return a;if(h>=u){const e=Sd(f,l,void 0),h=Sd(g,l,void 0);if(t.OV(a.bufferX,a.valueCount*S,d(e)),t.OV(a.bufferY,a.valueCount*S,d(h)),i&&a.bufferColors){const e=i.slice(l);t.OV(a.bufferColors,a.valueCount,e,Uint32Array)}if(s&&a.bufferLookupValues){const e=s.slice(l);t.OV(a.bufferLookupValues,a.valueCount,e,Float32Array)}if(n&&a.bufferSizes){const e=n.slice(l);t.OV(a.bufferSizes,a.valueCount,e,Float32Array)}if(r&&a.bufferRotations){const e=r.slice(l);t.OV(a.bufferRotations,a.valueCount,e,Float32Array)}if(o&&a.bufferLengthSoFar){const[i,s,n]=Ip(e,h,a.lastX||0,a.lastY||0,a.lengthSoFarX,a.lengthSoFarY);t.OV(a.bufferLengthSoFar,2*a.valueCount,i,Float32Array),a.lengthSoFarX=s,a.lengthSoFarY=n}return a.valueCount+=u,a.lastX=y,a.lastY=x,a}}}const b=m+u,v=t.zV(b*S,d(f),null==a?void 0:a.bufferX),M=t.zV(b*S,d(g),null==a?void 0:a.bufferY),T=i?t.zV(b,i,null==a?void 0:a.bufferColors,Uint32Array):void 0,w=s?t.zV(b,s,null==a?void 0:a.bufferLookupValues,Float32Array):void 0,E=n?t.zV(b,n,null==a?void 0:a.bufferSizes,Float32Array):void 0,k=r?t.zV(b,r,null==a?void 0:a.bufferRotations,Float32Array):void 0;let C,D=0,I=0;if(o){const e=Ip(f,g,f[0],g[0],0,0);C=t.zV(2*b,e[0],null==a?void 0:a.bufferLengthSoFar,Float32Array),D=e[1],I=e[2]}return{bufferX:v,bufferY:M,bufferColors:T,bufferLookupValues:w,bufferSizes:E,bufferRotations:k,bufferSize:b,bufferLengthSoFar:C,valueCount:m,firstX:p,lastX:y,firstY:A,lastY:x,lengthSoFarX:D,lengthSoFarY:I}},Ip=(t,e,i,s,n,r)=>{const o=t.length,a=new Float32Array(2*o);if(0===o)return[a,0,0];let h=0,l=i,u=s,c=n,d=r;for(let i=0;i{const u=t.gl;if(i){const i=e.attribute(`${n}A_highpart${r}`),c=e.attribute(`${n}A_lowpart${r}`),d=e.attribute(`${n}B_highpart${r}`),f=e.attribute(`${n}B_lowpart${r}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,h,a,2*o*l,0*l),u.vertexAttribPointer(c,o,h,a,2*o*l,o*l),t.HV(i,1),t.HV(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.vertexAttribPointer(d,o,h,a,2*o*l,2*o*l),u.vertexAttribPointer(f,o,h,a,2*o*l,3*o*l),t.HV(d,1),t.HV(f,1),u.enableVertexAttribArray(d),u.enableVertexAttribArray(f),u.bindBuffer(u.ARRAY_BUFFER,null)}else{const i=e.attribute(`${n}A${r}`),c=e.attribute(`${n}B${r}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,h,a,o*l,0*l),u.vertexAttribPointer(c,o,h,a,o*l,o*l),t.HV(i,1),t.HV(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.bindBuffer(u.ARRAY_BUFFER,null)}},Fp={translation:(t,e)=>[1,0,0,0,1,0,t,e,1],rotation(t){const e=Math.cos(t),i=Math.sin(t);return[e,-i,0,i,e,0,0,0,1]},scaling:(t,e)=>[t,0,0,0,e,0,0,0,1],translate:(t,e,i)=>Fp.multiply(t,Fp.translation(e,i)),rotate:(t,e)=>Fp.multiply(t,Fp.rotation(e)),scale:(t,e,i)=>Fp.multiply(t,Fp.scaling(e,i)),multiply(t,e){const i=t[0],s=t[1],n=t[2],r=t[3],o=t[4],a=t[5],h=t[6],l=t[7],u=t[8],c=e[0],d=e[1],f=e[2],g=e[3],m=e[4],p=e[5],y=e[6],A=e[7],x=e[8];return[c*i+d*r+f*h,c*s+d*o+f*l,c*n+d*a+f*u,g*i+m*r+p*h,g*s+m*o+p*l,g*n+m*a+p*u,y*i+A*r+x*h,y*s+A*o+x*l,y*n+A*a+x*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class Lp extends Zn{constructor(t,e,i,s,n,r,o){super(t,e,i,s,n),this.hU=[],this.dR=new Im,this.rU=[u(0,0),u(0,0),u(0,0),u(0,0)],this.nU=m(u(0,0),u(0,0)),this.oU=m(u(0,0),u(0,0)),this.aU=u(0,0),this.lU=u(0,0),this.iM=u(0,0),this.uU=u(0,0),this.cU=0,this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStyleRadialGradient:()=>Q(this.be)&&this.be,fillStyleLinearGradient:()=>it(this.be)&&this.be}),this.aO=t,this.lO=e,this.yO=r,this.SO=o,this.zL=t.uO(),this.lO=e,this.DN=t.En.uo}Ds(){const t=this.ya(),e=this.ma(),i=this.jo._();if(t){const t=this.ga(),s=this.mO.fillStyleSolid(t),n=this.mO.fillStyleRadialGradient(t),r=this.mO.fillStyleLinearGradient(t),o=s||n||r,a=this.zL,h=this.zL.sR();if(this.dR.yV(this.dt),this.Ia.o){this.dU&&this.dU.KL(this),this.font.M(pn(this.Ia._()));const t=this.font._();this.dU=this.zL.Eh(t.properties.family),this.dU.JL(this)}const l=this.font.o,c=l||this._a.o;if(c&&this.dU){const t=this.font._();[this.fU,this.oU]=this.dU.tR(this._a._(),t.properties,this.aO.qi.isDark),this.hU.forEach((t=>{t.texCoordBuff&&a.SV(t.texCoordBuff),t.vertexBuff&&a.SV(t.vertexBuff)})),this.hU=this.fU.map((t=>({texCoordBuff:a.oV(t.texCoords,!1),texture:t.texture,info:t}))),this.Ia.o=!1,this.font.o=!1,this._a.o=!1}const d=this.dt.Ni()||e,f=this.wa.o||this.ka.o||this.Ca.o||this.Ta.o||this.Da.o||this.Xt.o||c||d,g=this.Da._(),m=si(u(this.ka._()+1,this.Ca._()+1),.5);if(f&&this.fU&&(this.aU=u(-(g.left*h+this.oU.max.x-this.oU.min.x+g.right*h)*m.x-this.oU.min.x+g.right*h,-(g.bottom*h+this.oU.max.y-this.oU.min.y+g.top*h)*m.y-this.oU.min.y+g.top*h)),(f||d||this.Fa.o||this.ga())&&this.be!==V){if(this.fU){const t=ni(this.wa._(),this.Ta._()),e=ut(t,this.dt,this.us.dt),i=si(e,h);this.uU=i;const s=di(this.Fa._());this.cU=s,c&&this.hU.forEach((t=>{const e=t.info;e&&(t.vertexBuffLen=e.vertices.length/2,t.vertexBuff=a.oV(e.vertices,!0,t.vertexBuff))}));const n=this.Xt._(),r=[ni(Ze(u((this.oU.min.x+(-n.left-g.left)*h+this.aU.x)/h,(this.oU.max.y+(n.top+g.top)*h+this.aU.y)/h),this.Pa,s),e),ni(Ze(u((this.oU.max.x+(n.right+g.right)*h+this.aU.x)/h,(this.oU.max.y+(n.top+g.top)*h+this.aU.y)/h),this.Pa,s),e),ni(Ze(u((this.oU.max.x+(n.right+g.right)*h+this.aU.x)/h,(this.oU.min.y+(-n.bottom-g.bottom)*h+this.aU.y)/h),this.Pa,s),e),ni(Ze(u((this.oU.min.x+(-n.left-g.left)*h+this.aU.x)/h,(this.oU.min.y+(-n.bottom-g.bottom)*h+this.aU.y)/h),this.Pa,s),e)];this.rU=[ut(r[0],this.us.dt,this.dt),ut(r[1],this.us.dt,this.dt),ut(r[2],this.us.dt,this.dt),ut(r[3],this.us.dt,this.dt)];const o=je(r);this.lU=u(-(o.max.x-o.min.x)*h*m.x-o.min.x*h+this.uU.x,-(o.max.y-o.min.y)*h*m.y-o.min.y*h+this.uU.y),this.CB=ri(o.max,o.min);const l=je(this.rU),d=this.dt.pi(l.min,this.lU),f=this.dt.pi(l.max,this.lU);this.nU=je([d,f])}n?this.CO=xm(this.nU,this.dt,n.getPosition(),n.getExtent(),n.getShape(),this.zL.sR()):r?this.kO=Sm(this.nU,this.dt,r.getAngle(!0),this.zL.sR()):(this.CO=void 0,this.kO=void 0)}(this.ga()||l)&&(this.gR=o?this.zL.cE(Wg["2D"],Wg.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.DN}),Wg.Color({dataType:n?["gradient",n]:r?["gradient",r]:"uniform",maskTexture:!0})):void 0),this.AU=i&&o?this.AU||this.zL.cE(Wg["2D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.DN})):void 0,this.wa.o=!1,this.ka.o=!1,this.Ca.o=!1,this.Ta.o=!1,this.Fa.o=!1,this.Sa(this.be)}return this.Ba=t,this}yL(t){if(this.ya()){const e=1===t?this.AU:this.gR;if(!e||0===this.hU.length)return this;const i=this.mO.fillStyleSolid(!1),s=this.mO.fillStyleRadialGradient(!1),n=this.mO.fillStyleLinearGradient(!1),r=this.us.UR(),o=r.x,a=r.y;let h=Fp.projection(o,a,-1);const l=Fp.translation(this.aU.x,this.aU.y),u=Fp.translation(this.lU.x,this.lU.y);h=Fp.translate(h,this.uU.x,this.uU.y),h=Fp.multiply(h,u),h=Fp.rotate(h,this.cU),h=Fp.multiply(h,l),1===t&&(h=Fp.scale(h,this.oU.max.x,this.oU.max.y)),this.zL.JL(e).lV(e,((e,o,a,l)=>{if(this.zL.BV(e("uMatrix"),h).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),this.DN&&this.zL.cV(l("uViewportSizePx"),[r.x*this.zL.sR(),r.y*this.zL.sR()]),1===t)this.zL.AV(e("uColor"),this.SO);else if(i)this.zL.AV(e("uColor"),i.getColor());else if(s&&this.CO){this.zL.cV(e("uCenter"),this.CO.center).cV(e("uDistance"),this.CO.distance).PV(e("uBounds"),this.CO.bounds).fV(e("uAspect"),this.CO.aspectRatio);const t=s.getColorStops();for(let i=0;i{this.zL.UV(o("aPos"),t.vertexBuff).UV(o("aMaskTextureCoord"),t.texCoordBuff).dV(e("uMaskTexture"),t.texture,0).Pp(this.zL.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return this}dO(t){return this.yO===t&&{}}Ue(){return this.ya()?this.rU:[]}Cc(){return this.ya()&&this.CB?this.CB:u(0,0)}oi(){if(this.ya()&&this.nU){const t=this.nU;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}GL(){return this.hU.forEach((t=>{t.texCoordBuff&&this.zL.SV(t.texCoordBuff),t.vertexBuff&&this.zL.SV(t.vertexBuff)})),this.hU=[],this.dU&&this.dU.KL(this),this}xt(){return this.nU.max.x}vt(){return this.nU.min.x}Mt(){return this.nU.max.y}bt(){return this.nU.min.y}Vl(){return 0}zl(){return 0}}class zp{constructor(t,e,i){this.gU=new Set,this.pU=t=>(this.gU.add(t),t),this.mU=t=>(this.gU.delete(t),t.GL(),this),this.us=t,this.ua=e,this.yU=i}mL(t){this.gU.delete(t)&&this.gU.add(t)}W(){for(const t of this.gU)t.GL().dispose();this.us.pn(this.ua)}bs(){return this.us.bs(),this}gn(){return this.ua}}class Pp extends zp{constructor(){super(...arguments),this.SU=y(void 0),this.ca=!1}ES(t){return this.SU.M(t),this}lg(){return this.SU._()}}class Rp extends Pp{constructor(t,e,i){super(t,e,i),this.aO=t,this.gl=t.uO(),this.vU=this.gU}nV(t){const e=t instanceof Yn&&t;if(!e)return Le;const i=e.vt(),s=e.xt(),n=e.bt(),r=e.Mt();if(i===_e||s===Fe||n===_e||r===Fe)return Le;const o=e.Vl(),a=e.zl(),h=Hn({min:{x:i,y:n},max:{x:s,y:r}},{x:o,y:a},e.dt),l={min:ut(h.min,e.dt,t.us.dt),max:ut(h.max,e.dt,t.us.dt)},u=this.SU._();let c;if(u){if(c={min:{x:Math.max(l.min.x,u.x),y:Math.max(l.min.y,u.y)},max:{x:Math.min(l.max.x,u.x+u.width),y:Math.min(l.max.y,u.y+u.height)}},c.max.x{const t=this.aO.bU();return{id:t,color:this.aO.MU(t)}})))}zp(t,e,i){const s=this.aO.bU();return this.pU(new sp(this.aO,this,t,this.mU,i,s,this.aO.MU(s),e))}tF(t){const e=this.aO.bU();return this.pU(new Cp(this.aO,this,t,this.mU,e,this.aO.MU(e)))}kr(t){const e=this.aO.bU();return this.pU(new Lp(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}Oc(t){const e=this.aO.bU();return this.pU(new hp(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}vc(t,e=rr.Simple){const i=this.aO.bU();if(e===rr.Simple)return this.pU(new cp(this.aO,this,t,this.mU,[],i,this.aO.MU(i)));throw new Error("GlEngine.addPolygon | No such polygon type!")}bv(t){return this.pU(new lp(this.aO,this,t,this.mU,[],(()=>{const t=this.aO.bU();return{id:t,color:this.aO.MU(t)}})))}Te(t){const e=this.aO.bU();return this.pU(new up(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}yC(t){const e=this.aO.bU();return this.pU(new Ym(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}Fc(t){const e=this.aO.bU();return this.pU(new Rm(this.aO,this,t,this.mU,[],e,this.aO.MU(e)))}ck(t,e,i){if("intensity"===i.heatmapDataType){const s=this.aO.bU();return this.pU(new bp(this.aO,this,t,this.mU,e,s,this.aO.MU(s),i))}throw new gt("Unimplemented Heatmap Grid Static type")}ek(t,e,i){const s=this.aO.bU();return this.pU(new xp(this.aO,this,t,this.mU,e,i,s,this.aO.MU(s)))}Sx(t,e,i){const s=this.aO.bU();return this.pU(new Mp(this.aO,this,t,this.mU,e,i,s,this.aO.MU(s)))}_U(t){return this.pU(new zm(this.aO,this,this.mU,[],t))}Ds(){if(this.ca){this.ca=!1;const t=Array.from(this.gU).sort(((t,e)=>t.fa()-e.fa()));this.gU.clear();for(const e of t)this.gU.add(e)}for(const t of this.gU)t.Ds();return this}yL(t,e){const i=this.SU._();if(i&&this.gl.rV(i.x*this.gl.sR()*e,i.y*this.gl.sR()*e,i.width*this.gl.sR()*e,i.height*this.gl.sR()*e),1!==t)for(const e of this.gU)e.getVisible()&&e.yL(t);else for(const e of this.gU)e.getMouseInteractions()&&e.getVisible()&&e.yL(t);return this.gl.tV(!1),this}}class Vp extends bm{constructor(t){super(t)}}class Bp extends Vp{constructor(t){super(t),this.wU="attribute";const{vertices:e,drawSize:i,drawMode:s}=Op(t.gl);this.TL=t.oV(e),this.fN=i,this.AN=s}Pp(t,e,i,s){return this.zL.uV(this.TL,0,{location:t.attribute("aInstanceGeo"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:s?t.attribute("aTriangleBary"):void 0,size:3}).KV(this.AN,0,this.fN,e),this}IE(){this.zL.SV(this.TL)}}const Op=t=>{const e=new Float32Array(324);let i=0;return e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=-1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=1,e[i+4]=0,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=1,e[i+3]=0,e[i+4]=0,e[i+5]=1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=1,e[i+2]=-1,e[i+3]=0,e[i+4]=0,e[i+5]=-1,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=0,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=-1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=0,e[i+7]=1,e[i+8]=0,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=-1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=1,i+=9,e[i+0]=1,e[i+1]=-1,e[i+2]=1,e[i+3]=0,e[i+4]=-1,e[i+5]=0,e[i+6]=1,e[i+7]=0,e[i+8]=0,i+=9,{vertices:e,drawSize:i/9,drawMode:t.TRIANGLES}};class Np extends Vp{constructor(t,e){super(t),this.wU="attribute",this.CU=e;const{vertices:i,indices:s}=Up();this.TL=t.oV(i),this.dN=t.GV(s),this.fN=s.length,this.AN=t.gl.TRIANGLES}Pp(t,e,i,s){return this.zL.uV(this.TL,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).ZV(this.dN).fV(t.uniform("uEdgeRoundness"),this.CU/2).qV(this.AN,this.fN,0,e),this}IE(){this.zL.SV(this.TL),this.zL.SV(this.dN)}kU(t){return this.CU=t,this}TU(){return this.CU}}const Up=()=>{const t=[{normal:{x:0,y:1,z:0},perpendA:{x:0,y:0,z:1},perpendB:{x:-1,y:0,z:0}},{normal:{x:0,y:0,z:-1},perpendA:{x:0,y:1,z:0},perpendB:{x:-1,y:0,z:0}},{normal:{x:-1,y:0,z:0},perpendA:{x:0,y:1,z:0},perpendB:{x:0,y:0,z:1}},{normal:{x:1,y:0,z:0},perpendA:{x:0,y:1,z:0},perpendB:{x:0,y:0,z:-1}},{normal:{x:0,y:0,z:1},perpendA:{x:0,y:1,z:0},perpendB:{x:1,y:0,z:0}},{normal:{x:0,y:-1,z:0},perpendA:{x:0,y:0,z:-1},perpendB:{x:-1,y:0,z:0}}],e=[];let i=0;const s=[];let n=0;for(const r of t){const{normal:t,perpendA:o,perpendB:a}=r,h=Ie.multiply(o,-1),l=Ie.multiply(a,-1),u=i;e[i]={thicknessDirection:Ie.addVec(t,o,a),edge:Ie.addVec(h,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:Ie.addVec(t,h,a),edge:Ie.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:Ie.addVec(t,h,l),edge:Ie.addVec(o,a),normal:t},i+=1;const f=i;e[i]={thicknessDirection:Ie.addVec(t,o,l),edge:Ie.addVec(h,a),normal:t},i+=1,s[n+0]=d,s[n+1]=u,s[n+2]=f,s[n+3]=d,s[n+4]=c,s[n+5]=u,n+=6;const g=[{A:o,B:a},{A:h,B:a},{A:h,B:l},{A:o,B:l}];for(const s of g){s.thicknessDirection=Ie.addVec(t,s.A,s.B),s.stripVerticesA=[],s.stripVerticesB=[];const n=[{direction:s.A,other:s.B,vertices:s.stripVerticesA},{direction:s.B,other:s.A,vertices:s.stripVerticesB}];for(const r of n)for(let n=0;n<8;n+=1){const o=.5*n/7,a=Ie.normalize(Ie.lerp(t,r.direction,o)),h=Math.PI/2-Ie.angle(a,t),l=Ie.addVec(Ie.multiply(Ie.multiply(r.direction,-1),1-Math.cos(h)),Ie.multiply(Ie.multiply(t,-1),1-Math.sin(h)),Ie.multiply(r.other,-1)),u=i;e[i]={thicknessDirection:s.thicknessDirection,normal:a,edge:l};const c=e[i];i+=1,r.vertices.push({index:u,vertex:c})}}for(let t=0;t{let i=t.CV.FE.get(e);return i||(i=void 0!==e&&e>0?new Np(t,kt(e,0,1)):new Bp(t),t.CV.FE.set(e,i),i)};class Wp extends Em{Om(t){return this.$E=this.Bm._(),this.Bm.M(t),this}lS(t){return this.FU=t,this}uS(){return this.FU}}class Yp extends Wp{constructor(t,e,i,s,n){super(t,e,i),this.IU=t,this.yO=s,this.SO=n,this.aO=t.aO,this.zL=this.aO.uO()}dO(t){return t===this.yO&&{}}}class Hp extends Yp{constructor(t,e,i,s,n){super(t,e,i,s,n),this.FU="cull-back",this.ol=ze,this.PU={},this.DU=[],this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStyleIndividual:()=>W(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be}),this.be=Tn.fillStyle,this.Bm.M(Gr)}Ds(t){const e=this.DU,i=this.be,s=i!==V,n=this.BU,r=this.ga()||this.LU!==n,o=this.HE(),a=this.jo._(),h=this.jo.o;if(s){for(const t of e)t.id=void 0!==t.id?String(t.id):void 0,t.xSize=void 0!==t.xSize&&t.xSize<0?-t.xSize:t.xSize,t.ySize=void 0!==t.ySize&&t.ySize<0?-t.ySize:t.ySize,t.zSize=void 0!==t.zSize&&t.zSize<0?-t.zSize:t.zSize;const t=11,s=this.RU||0;let n=s;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.PU[e]||(n+=1)}let l,u=!1,c=!1;if(u=n!==s,c=u,l=!c&&(e.length<100?"chunks":"all"),u){const e=n*t,i=new Float32Array(e);this.PG&&i.set(this.PG),this.PG=i,this.EU=e,this.VU=s*t}const d=W(i)?i.getFallbackColor():void 0;for(const i of e){const e=i.id,s=void 0!==e&&this.PU[e],n=[i.xCenter,i.yCenter,i.zCenter,i.xSize,i.ySize,i.zSize,i.color?i.color.r:d?d.r:void 0,i.color?i.color.g:d?d.g:void 0,i.color?i.color.b:d?d.b:void 0,i.color?i.color.a:d?d.a:void 0,i.value];if(s){for(let e=0;e0){const e=m({x:_e,y:_e,z:_e},{x:Fe,y:Fe,z:Fe});for(let i=0;ir?e.max.x:r,e.max.y=e.max.y>l?e.max.y:l,e.max.z=e.max.z>f?e.max.z:f}this.ol=e}this.RU=n,this.DU.length=0}return this.Sa(i),this.LU=n,this.Bm.o=!1,this.jo.o=!1,this}yL(t){const e=1===t?this.AU:this.gR,i=this.zU,s=this.cN,n=this.be,r=this.RU,o=this.Bm._();return e&&s&&void 0!==r&&this.zL.lV(e,((a,h,l)=>{let u=!1;const c=h("aPos"),d=h("aOffsetAxis");this.zL.JL(e).DV(a("uScale"),this.IU.dR.gV()).DV(a("uDisp"),this.IU.dR.pV()).LV(a("uViewProjectionMatrix"),this.NU).fV(a("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(a("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(a("uRenderEffectMask"),2===t?1:0);const f={location:c,size:3},g={location:d,size:3},m={location:void 0,size:4};if(1!==t&&"phong"===o.type&&this.zL.DV(a("uCameraLoc"),this.GU).DV(a("uLightLoc"),this.WU).fV(a("uAmbientReflection"),o.ambientReflection).fV(a("uSpecularReflection"),o.specularReflection).fV(a("uDiffuseReflection"),o.diffuseReflection).fV(a("uShininess"),o.shininess).AV(a("uLightColor"),o.specularColor).AV(a("uAmbientColor"),o.ambientColor),1===t)this.zL.AV(a("uColor"),this.SO);else if(G(n))this.zL.AV(a("uColorDiffuse"),n.getColor());else if(W(n)){const t=h("aColor");m.location=t}else if(H(n)){const t=pg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.zL.Ez(l,n.lut,t)}return s&&(this.zL.uV(s,1,f,g,m,{location:void 0,size:1}),i.Pp(l,r,"phong"===o.type&&1!==t,!1),u=!0),u})),this}dispose(){return super.dispose(),this.cN&&(this.zL.SV(this.cN),this.cN=void 0),this.gR=void 0,this}GL(){return this.dispose(),this}Zm(t){this.DU=se(this.DU,t,{canReturnB:!0})}ke(t){return this.be=Xn(this.be,t),this}Lh(){return this.be}Xm(t){return this.BU=void 0!==t&&t>0?kt(t,0,1):void 0,this}OU(){return this.BU}xt(){return this.ol.max.x}vt(){return this.ol.min.x}Mt(){return this.ol.max.y}bt(){return this.ol.min.y}Wm(){return this.ol.max.z}Um(){return this.ol.min.z}Vl(){return 0}zl(){return 0}Ym(){return 0}ga(){return jn(this.pa,this.be)}Sa(t){this.pa=t}}class Xp extends bm{constructor(t,e){super(t),this.wU="custom",this.lN=e;const{vertices:i,drawSize:s}=this.uN();this.cN=t.oV(i),this.fN=s}JL(t){return this.zL.uV(this.cN,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Pp(t){return this.zL.KV(this.zL.gl.TRIANGLE_STRIP,0,this.fN,t),this}uN(){const t=this.lN,e=new Float32Array(2*(t+1)*3);let i=0;for(let s=0;s<=t;s+=1){const n=2*Math.PI*s/t,r=Math.cos(n),o=Math.sin(n);for(const t of[0,1])e[i+0]=t,e[i+1]=r,e[i+2]=o,i+=3}return{vertices:e,drawSize:i/3}}IE(){this.zL.SV(this.cN)}}const jp=(t,e=16)=>{let i=t.CV.kE.get(e);return i||(i=new Xp(t,e),t.CV.kE.set(e,i),i)};class $p extends Yp{constructor(t,e,i,s,n){super(t,e,i,s,n),this.FU="cull-back",this.UU=ze,this.YU=[],this.HU=!1,this.Cu=Tn.lineStyle,this.Bm.M(Nr)}Ds(t){const e=this.HU,i=this.Cu,s=this.Tu!==i,n=this.HE(),r=e;if(e){const t=Jt(this.YU);this.$U=this.zL.oV(t,!1,this.$U)}if(r&&(this.UU=$e(this.YU)),s||n){const t=8,e=Ji(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.MN=void 0,G(e)&&("primitive"===s?this.MN={type:s,shader:this.zL.cE(Wg["3D"],Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}),Wg.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.MN={type:s,shader:this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:"uniform",shadingStyle:this.Bm._().type}),Wg.LineInstanced3D({axisWorldTranslation:gg(this.dt)})),geometry:jp(this.zL,t),fillStyle:e}))}return this.HU=!1,this.Tu=i,this.Bm.o=!1,this}yL(t){if(1===t)return this;const e=this.zL.gl,i=this.MN,s=this.$U,n=this.Cu,r=this.Bm._();if(i&&s&&Ji(n))switch(i.type){case"instanced":{const o=.5*this.Ts.bm(n.thickness),a=i.fillStyle.getColor(),h=i.shader,l=i.geometry;this.zL.lV(h,((i,n,u)=>{this.zL.JL(h).DV(i("uScale"),this.IU.dR.gV()).DV(i("uDisp"),this.IU.dR.pV()).LV(i("uViewProjectionMatrix"),this.NU).AV(i("uColorDiffuse"),a).fV(i("uOffsetWU"),o).fV(i("uIsHighlighted"),this.Ko).AV(i("uHighlightColorOffset"),2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0),"phong"===r.type&&this.zL.DV(i("uCameraLoc"),this.GU).DV(i("uLightLoc"),this.WU).fV(i("uAmbientReflection"),r.ambientReflection).fV(i("uSpecularReflection"),r.specularReflection).fV(i("uDiffuseReflection"),r.diffuseReflection).fV(i("uShininess"),r.shininess).AV(i("uLightColor"),r.specularColor).AV(i("uAmbientColor"),r.ambientColor),e.bindBuffer(e.ARRAY_BUFFER,s);const c=n("aLocationA"),d=n("aLocationB");return e.vertexAttribPointer(c,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(c,1),e.enableVertexAttribArray(c),e.vertexAttribPointer(d,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(d,1),e.enableVertexAttribArray(d),l.JL(u).Pp(this.YU.length/2),!0}));break}case"primitive":{const r=Ji(n)?n.getFillStyle():void 0,o=r&&G(r)?r.getColor():void 0;if(o){const n=i.shader;this.zL.lV(n,((i,r)=>(this.zL.JL(n).DV(i("uScale"),this.IU.dR.gV()).DV(i("uDisp"),this.IU.dR.pV()).LV(i("uViewProjectionMatrix"),this.NU).AV(i("uColor"),o).fV(i("uIsHighlighted"),this.Ko).AV(i("uHighlightColorOffset"),2===t?D:this.sa).fV(i("uRenderEffectMask"),2===t?1:0).uV(s,void 0,{location:r("aPos"),size:3}).Pp(e.LINES,this.YU.length),!0)))}break}}return this}_l(t){for(let e=0;e{const l=e*n,u=Math.PI/2-t*r,c=Math.cos(u),d=c*Math.cos(l),f=c*Math.sin(l),g=Math.sin(u);i[s]=d,i[s+1]=g,i[s+2]=f,i[s+3]=o,i[s+4]=a,i[s+5]=h,s+=6};for(let i=0;i0&&(o(i,s,1,0,0),o(i,s+1,1,1,0),o(i+1,s,0,0,1)),i{this.zL.fs.oo&&s>i.length&&St.console.warn("LightningChart JS unexpected error scenario, sphere geometry buffer size mismatch.\nA point series 3D component might have missing points.\n\nThis warning can be omitted with LightningChartOptions.warnings")})),{vertices:i,drawSize:s/6}}IE(){this.zL.SV(this.cN)}}const Jp=(t,e)=>{const i=Math.round(e);i<3&&fe(0,wt);const s=i;let n=t.CV.TE.get(Array.from(t.CV.TE.keys()).find((t=>t.sectors===i&&t.stacks===s)));return n||(n=new qp(t,i,s),t.CV.TE.set({sectors:i,stacks:s},n),n)};class Kp extends Yp{constructor(t,e,i,s,n){super(t,e,i,s,n),this.FU="cull-back",this.wb=[],this.MN={},this.bG=new ep(this.wb,(t=>t.vertexBuffer&&this.zL.SV(t.vertexBuffer)),!0),this.Lu=[],this.al=0,this.ll=[],this.ul=0,this.ol=ze,this.cl=ze,this.mO=mg({lineStyleSolid:()=>{const t=this.Cu;return Ji(t)&&t},lineFillSolid:()=>{const t=this.Cu.getFillStyle();return G(t)&&t},lineFillPaletted:()=>{const t=this.Cu.getFillStyle();return H(t)&&t},jointStyleTriangulatedPoints:()=>ln(this.Qm)&&this.Qm,jointSizeTriangulated:()=>{const t=this.Qm;return ln(t)&&t.getSize()},jointFillSolid:()=>{const t=this.Qm.getFillStyle();return G(t)&&t},jointFillPaletted:()=>{const t=this.Qm.getFillStyle();return H(t)&&t},wireframeLineStyleSolid:()=>{const t=ln(this.Qm)&&this.Qm.getWireframeStyle();return Ji(t)&&t},wireframeFillSolid:()=>{const t=ln(this.Qm)&&this.Qm.getWireframeStyle(),e=t&&t.getFillStyle();return G(e)&&e}}),this.fl=!1,this.Cu=Tn.lineStyle,this.Qm=Tn.pointStyle3D,this.Bm.M(Gr),this.kG={attributesPerVertex:3,prepareRenderData:(t,e)=>Jt(t)}}Ds(t){const e=this.fl,i=this.ll,s=this.ul,n=s>0,r=this.Cu,o=r!==this.Tu,a=this.Qm,h=a!==this.ZU,l=this.HE(),u=this.jo.o,c=this.jo._();this.cl&&(this.ol=Je(this.ol,this.cl),this.cl=void 0),n&&(this.Lu=se(this.Lu,i,{canReturnB:!0}),this.al+=s);let d=i,f=s;if(e&&(this.wb.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=ze})),this.bG.fG(),d=this.Lu,f=this.al),f>0){const t=1e5,e=Math.floor(this.aO.QU/(this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.ha("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=kt(i,t,e);this.bG.lG(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:ze,vertexBuffer:this.zL.zV(t*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i))})),((t,e,i,s)=>{this.zL.OV(t.vertexBuffer,t.existingCoordinatesCount*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i)),t.existingDataPointsCount+=i-s,t.existingCoordinatesCount+=i,t.jointPointsCount+=s,t.lastDataPoint=e[i-1]}))}if(o||h||l||u){const t={},e=this.mO.lineStyleSolid(o),i=this.mO.lineFillSolid(o),s=this.mO.lineFillPaletted(o),n=i||s,a=this.mO.jointStyleTriangulatedPoints(h),l=this.mO.jointSizeTriangulated(h),u=this.mO.jointFillSolid(h),d=this.mO.jointFillPaletted(h),f=u||d,g=this.mO.wireframeLineStyleSolid(h),m=this.mO.wireframeFillSolid(h),p=r.getThickness()<0||1===r.getThickness()&&this.ha("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",y=s?["lookup",s.getLookUpProperty(),s.lut]:"uniform";if("primitive"===p&&n?t.lines={type:"primitive",fillStyleSolid:i,fillStylePaletted:s,shader:this.zL.cE(Wg["3D"],Wg.Color({dataType:y}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})),mousePicking:c?{shader:this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}))}:void 0}:"instanced"===p&&e&&n&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:i,fillStylePaletted:s,shader:this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:y,shadingStyle:this.Bm._().type}),Wg.LineInstanced3D({axisWorldTranslation:gg(this.dt)})),geometry:Zp(this.zL,e.getThickness()),mousePicking:c?{shader:this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.LineInstanced3D({axisWorldTranslation:gg(this.dt)}))}:void 0}),t.markers=void 0,f&&a){const e=ee(a.getShape(),{cube:()=>Gp(this.zL),sphere:()=>Qp(this.zL,a)});t.markers={geometry:e,pointStyle:a,pointSizeNWU:"number"==typeof l&&l,pointSizeAxis:"object"==typeof l&&l,fillStyleSolid:u,fillStylePaletted:d,shader:this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty(),d.lut]:"uniform",shadingStyle:this.Bm._().type,wireframe:!1!==m}),Wg.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:gg(this.dt),normalSource:e.wU})),mousePicking:c?{shader:this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:gg(this.dt),normalSource:void 0}))}:void 0,wireframe:g&&m&&{thickness:g.getThickness(),fillStyleSolid:m}}}this.MN=t}return this.fl=!1,this.ll=[],this.ul=0,this.Tu=r,this.ZU=a,this.Bm.o=!1,this.jo.o=!1,this}yL(t){var e,i;const s=this.zL.gl,{lines:n,markers:r}=this.MN,o=this.Bm._(),a=1===t?null===(e=null==n?void 0:n.mousePicking)||void 0===e?void 0:e.shader:null==n?void 0:n.shader;if(n&&a&&"instanced"===n.type){const e=a,{geometry:i,lineStyleSolid:r,fillStyleSolid:h,fillStylePaletted:l}=n;this.zL.lV(e,((n,a,u)=>{let c=!1;if(this.zL.JL(e).DV(n("uScale"),this.IU.dR.gV()).DV(n("uDisp"),this.IU.dR.pV()).LV(n("uViewProjectionMatrix"),this.NU).fV(n("uOffsetWU"),this.Ts.bm(r.getThickness())).fV(n("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(n("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.zL.DV(n("uCameraLoc"),this.GU).DV(n("uLightLoc"),this.WU).fV(n("uAmbientReflection"),o.ambientReflection).fV(n("uSpecularReflection"),o.specularReflection).fV(n("uDiffuseReflection"),o.diffuseReflection).fV(n("uShininess"),o.shininess).AV(n("uLightColor"),o.specularColor).AV(n("uAmbientColor"),o.ambientColor),1===t)this.zL.AV(n("uColor"),this.SO);else if(h)this.zL.AV(n("uColorDiffuse"),h.getColor());else if(l){const t=pg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.zL.Ez(u,l.lut,t)}return this.wb.forEach((t=>{s.bindBuffer(s.ARRAY_BUFFER,t.vertexBuffer);const e=a("aLocationA"),n=a("aLocationB");s.vertexAttribPointer(e,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(e,1),s.enableVertexAttribArray(e),s.vertexAttribPointer(n,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.zL.HV(n,1),s.enableVertexAttribArray(n),i.JL(u).Pp(t.existingCoordinatesCount-1),c=!0})),c}))}if(n&&a&&"primitive"===n.type){const e=a,{fillStyleSolid:i,fillStylePaletted:r}=n;this.zL.lV(e,((n,o,a)=>{let h=!1;if(this.zL.JL(e).DV(n("uScale"),this.IU.dR.gV()).DV(n("uDisp"),this.IU.dR.pV()).LV(n("uViewProjectionMatrix"),this.NU).fV(n("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(n("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(n("uRenderEffectMask"),2===t?1:0),1===t)this.zL.AV(n("uColor"),this.SO);else if(i)this.zL.AV(n("uColor"),i.getColor());else if(r){const t=pg(r,this,void 0);if(!t&&r.lut.percentageValues)return!1;this.zL.Ez(a,r.lut,t)}return this.wb.forEach((t=>{this.zL.uV(t.vertexBuffer,void 0,{location:o("aPos"),size:3}).Pp(s.LINE_STRIP,t.existingCoordinatesCount),h=!0})),h}))}const h=1===t?null===(i=null==r?void 0:r.mousePicking)||void 0===i?void 0:i.shader:null==r?void 0:r.shader;if(r&&h){const e=h,{geometry:i,fillStyleSolid:s,fillStylePaletted:n,pointSizeAxis:a,pointSizeNWU:l,wireframe:u}=r;this.zL.lV(e,((r,h,c,d)=>{let f=!1;if(this.zL.JL(e).DV(r("uScale"),this.IU.dR.gV()).DV(r("uDisp"),this.IU.dR.pV()).LV(r("uViewProjectionMatrix"),this.NU).fV(d("uRatioNwuWu"),this.IU.JU()).fV(r("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(r("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(r("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.zL.DV(r("uCameraLoc"),this.GU).DV(r("uLightLoc"),this.WU).fV(r("uAmbientReflection"),o.ambientReflection).fV(r("uSpecularReflection"),o.specularReflection).fV(r("uDiffuseReflection"),o.diffuseReflection).fV(r("uShininess"),o.shininess).AV(r("uLightColor"),o.specularColor).AV(r("uAmbientColor"),o.ambientColor),1===t)this.zL.AV(r("uColor"),this.SO);else if(s)this.zL.AV(r("uColorDiffuse"),s.getColor());else if(n){const t=pg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.zL.Ez(c,n.lut,t)}return u&&1!==t&&this.zL.fV(r("uWireframeThickness"),u.thickness).AV(r("uWireframeColor"),u.fillStyleSolid.getColor()),!1!==a&&this.zL.DV(r("uOffsetAxis"),[a.x,a.y,a.z]),!1!==l&&this.zL.fV(r("uOffsetNWU"),l),this.wb.forEach((e=>{this.zL.uV(e.vertexBuffer,1,{location:h("aPos"),size:3}),i.Pp(c,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(u)&&1!==t),f=!0})),f}))}return this}_l(t,e){Array.isArray(t)||(t=[t]),this.ll=se(this.ll,t,{canReturnB:!0}),this.ul+=t.length;const i=e||$e(t);return this.cl=this.cl?Je(this.cl,i):i,this}Ee(t){return this.Cu="function"==typeof t?t(this.Cu):t,this}ku(){return this.Cu}ym(t){return this.Qm="function"==typeof t?t(this.Qm):t,this}KU(){return this.Qm}xt(){return this.cl?Math.max(this.cl.max.x,this.ol.max.x):this.ol.max.x}vt(){return this.cl?Math.min(this.cl.min.x,this.ol.min.x):this.ol.min.x}Mt(){return this.cl?Math.max(this.cl.max.y,this.ol.max.y):this.ol.max.y}bt(){return this.cl?Math.min(this.cl.min.y,this.ol.min.y):this.ol.min.y}Wm(){return this.cl?Math.max(this.cl.max.z,this.ol.max.z):this.ol.max.z}Um(){return this.cl?Math.min(this.cl.min.z,this.ol.min.z):this.ol.min.z}Vl(){return Me(this.Cu)}zl(){return Me(this.Cu)}Ym(){return Me(this.Cu)}yl(){return this.Lu}ml(){return this.ll}wl(){return this.al}Cl(){return this.ul}Nt(){return this.fl=!0,this.Lu.length=0,this.al=0,this.ll=[],this.ul=0,this.ol=ze,this.cl=void 0,this}dispose(){return super.dispose(),this.bG.AG(),this.MN={},this}GL(){return this.dispose(),this}}const Zp=(t,e)=>jp(t,e>50?20:e>20?16:e>10?12:e>5?8:6),Qp=(t,e)=>{const i=e.getSize();return Jp(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class ty extends Yp{constructor(t,e,i,s,n){super(t,e,i,s,n),this.FU="disabled",this.qU=!1,this.tY=!1,this.iY={x:1,y:1,z:1},this.gS={x:0,y:0,z:0},this.AS={x:0,y:0,z:0},this.pS={x:0,y:0,z:0},this.mS={x:1,y:1,z:1},this.sY=ol.projectionOrthographic(-1,1,-1,1,1,-1),this.eY=ol.projectionOrthographic(-1,1,-1,1,1,-1),this.hY=!1,this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStyleValuePalette:()=>H(this.be)&&"value"===this.be.lookUpProperty&&this.be}),this.be=Tn.fillStyle,this.Bm.M(Gr)}Ds(t){var e;const i=this.HE(),s=this.jo._(),n=this.jo.o,r=this.ga();this.mO.fillStyleSolid(r);const o=this.mO.fillStyleValuePalette(r),a=this.pS,h=this.mS;if(this.qU&&this.rY&&(this.cN=this.zL.oV(this.rY.vertices,void 0,this.cN),this.dN=this.zL.GV(this.rY.indices,this.dN),this.nY=this.rY.indices.length),"phong"===this.Bm._().type&&(i||this.qU)&&(null===(e=this.rY)||void 0===e?void 0:e.normals)&&(this.oY=this.zL.oV(this.rY.normals,void 0,this.oY)),!this.aY&&o&&"value"===o.lookUpProperty&&this.rY&&(this.aY=new Float32Array(this.rY.vertices.length/3),this.tY=!0),this.aY&&this.tY&&(this.lY=this.zL.oV(this.aY,void 0,this.lY)),i||r||n){if(o&&"value"!==o.lookUpProperty)throw new Error("LightningChart JS MeshModel3D does not support look up by x/y/z. Must be value");this.gR=this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:o?["lookup","value",o.lut]:"uniform",shadingStyle:this.Bm._().type,wireframe:!1}),Wg.Model3D({normalSource:"phong"===this.Bm._().type?"attribute":void 0})),this.AU=s?this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.Model3D({normalSource:void 0})):void 0}if(this.hY){const t=ol.projectionOrthographic(-1,1,-1,1,1,-1);this.eY=ol.rotateXYZ(t,a),this.sY=ol.translate(t,h.x/2,h.y/2,h.z/2),this.sY=ol.rotateXYZ(this.sY,a),this.sY=ol.translate(this.sY,-h.x/2,-h.y/2,-h.z/2),this.hY=!1}return this.Bm.o=!1,this.Sa(this.be),this.jo.o=!1,this.qU=!1,this.tY=!1,this}yL(t){const e=1===t?this.AU:this.gR,i=1===t,s=this.dN,n=this.nY,r=this.cN,o=this.oY,a=this.lY,h=this.gS,l=this.AS,u=this.iY,c=this.mS,d=this.sY,f=this.eY,g=this.mO.fillStyleValuePalette(!1),m=this.mO.fillStyleSolid(!1),p=this.Bm._(),y={location:void 0,size:1};return e&&r&&s&&n?(this.zL.lV(e,((A,x,S,b)=>{if(this.zL.JL(e).DV(A("uScale"),this.IU.dR.gV()).DV(A("uDisp"),this.IU.dR.pV()).LV(A("uViewProjectionMatrix"),this.NU).fV(A("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(A("uHighlightColorOffset"),this.sa).fV(A("uRenderEffectMask"),2===t?1:0),i)this.zL.AV(A("uColor"),this.SO);else{if(this.be===V)return!1;if(m)this.zL.AV(A("uColorDiffuse"),m.getColor());else if(g){if(!a)return!1;const t=g.getPalette();y.location=x("aLookupValue"),this.zL.Ez(S,t,void 0).uV(a,void 0,y)}}return"phong"!==p.type||i||(this.zL.DV(A("uCameraLoc"),this.GU).DV(A("uLightLoc"),this.WU).fV(A("uAmbientReflection"),p.ambientReflection).fV(A("uSpecularReflection"),p.specularReflection).fV(A("uDiffuseReflection"),p.diffuseReflection).fV(A("uShininess"),p.shininess).AV(A("uLightColor"),p.specularColor).AV(A("uAmbientColor"),p.ambientColor).LV(A("uModelRotationNormals"),f),o&&this.zL.uV(o,void 0,{location:S.attribute("aNormal"),size:3})),this.zL.LV(A("uModelRotation"),d).DV(A("uModelScale"),[u.x,u.y,u.z]).DV(A("uLocationAxis"),[h.x,h.y,h.z]).DV(A("uModelAlignment"),[l.x,l.y,l.z]).DV(A("uModelSize"),[c.x,c.y,c.z]),this.zL.uV(r,0,{location:S.attribute("aGeoPos"),size:3}).ZV(s).JV(n,this.zL.gl.TRIANGLES),!0})),this):this}dispose(){return super.dispose(),this.cN&&(this.zL.SV(this.cN),this.cN=void 0),this.dN&&(this.zL.SV(this.dN),this.dN=void 0),this.oY&&(this.zL.SV(this.oY),this.oY=void 0),this.lY&&(this.zL.SV(this.lY),this.lY=void 0),this.gR=void 0,this.AU=void 0,this.rY=void 0,this.aY=void 0,this}GL(){return this.dispose(),this}SS(t){return this.rY=t,this.qU=!0,this.mS=t.modelSize,this}xS(t){return this.aY=t,this.tY=!0,this}ke(t){return this.be=Xn(this.be,t),this}Lh(){return this.be}bS(t){return this.iY=t,this}gV(){return this.iY}MS(t){return this.gS=t,this}_S(t){return this.AS=t,this}wS(t){return this.pS=t,this.hY=!0,this}CS(t){return this.FU=t,this}kS(){return this.FU}xt(){return Fe}vt(){return _e}Mt(){return Fe}bt(){return _e}Wm(){return Fe}Um(){return _e}Vl(){return 0}zl(){return 0}Ym(){return 0}ga(){return jn(this.pa,this.be)}Sa(t){this.pa=t}}class ey extends Yp{constructor(t,e,i,s,n,r){super(t,e,i,s,n),this.FU="cull-back",this.wb=[],this.bG=new ep(this.wb,(t=>t.vertexBuffer&&this.zL.SV(t.vertexBuffer)),!1),this.Lu=[],this.al=0,this.ll=[],this.ul=0,this.ol=ze,this.cl=ze,this.fl=!1,this.mO=mg({fillStyleSolid:()=>{const t=this.qm.getFillStyle();return G(t)&&t},fillStyleIndividual:()=>{const t=this.qm.getFillStyle();return W(t)&&t},fillStylePalette:()=>{const t=this.qm.getFillStyle();return H(t)&&t},triangulatedPointStyle:()=>{const t=this.qm;return ln(t)&&t},wireframeLineStyleSolid:()=>{const t=ln(this.qm)&&this.qm,e=t&&t.getWireframeStyle();return Ji(e)&&e},wireframeFillStyleSolid:()=>{const t=ln(this.qm)&&this.qm,e=t&&t.getWireframeStyle(),i=e&&e.getFillStyle();return G(i)&&i}}),this.Al=void 0,this.En=r,this.qm=Tn.pointStyle3D,this.Bm.M(Gr);const o=!0===(null==r?void 0:r.individualPointColorEnabled),a=!0===(null==r?void 0:r.individualPointSizeEnabled),h=!0===(null==r?void 0:r.individualLookupValuesEnabled),l=!0===(null==r?void 0:r.individualPointSizeAxisEnabled);let u,c,d,f,g=0;g+=3,o&&(u=g,g+=4),a&&(c=g,g+=1),h&&(d=g,g+=1),l&&(f=g,g+=3);const m=((t,e,i,s)=>t||e||i||s?!t||e||i||s?t||!e||i||s?t||e||!i||s?t||e||i||!s?(n,r,o)=>{const a=3+(t?4:0)+(e?1:0)+(i?1:0)+(s?3:0),h=n.length,l=new Float32Array(h*a);let u=0,c=u;for(let t=0;t((t,e)=>{const i=e&&e.getSize();let s={x:1,y:1,z:1};"object"==typeof i&&(s=i);const n=t.length,r=new Float32Array(6*n);let o=0;for(let e=0;e(t=>{const e=t.length,i=new Float32Array(4*e);for(let s=0,n=0;s((t,e)=>{const i=e&&e.getSize();let s=1;"number"==typeof i&&(s=i);const n=t.length,r=new Float32Array(4*n);for(let e=0,i=0;e((t,e)=>{const i=e&&W(e)&&e.getFallbackColor()||C,s=t.length,n=new Float32Array(7*s);for(let e=0,r=0;eJt(t))(o,a,h,l);this.kG={individualPointColorEnabled:o,individualPointSizeEnabled:a,individualLookupValuesEnabled:h,individualPointSizeAxisEnabled:l,attributesPerVertex:g,attributeOffsetCoordinate:0,attributeOffsetColor:u,attributeOffsetSize:c,attributeOffsetLookUpValue:d,attributeOffsetPointSize3D:f,prepareRenderData:(t,e)=>m(t,this.qm,this.qm.fillStyle)}}Ds(t){const e=this.fl,i=this.ll,s=this.ul,n=s>0,r=this.qm,o=this.qm!==this.uY,a=this.jo._(),h=this.jo.o,l=this.HE();this.cl&&(this.ol=Je(this.ol,this.cl),this.cl=void 0),n&&(this.Lu=se(this.Lu,i,{canReturnB:!0}),this.al+=s);let u=i,c=s;if(e&&(this.wb.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=ze})),this.bG.fG(),u=this.Lu,c=this.al),c>0){const t=Math.floor(this.aO.QU/(this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=kt(c,1e5,t);this.bG.lG(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:ze,vertexBuffer:this.zL.zV(t*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i))})),((t,e,i)=>{this.zL.OV(t.vertexBuffer,t.existingCoordinatesCount*this.kG.attributesPerVertex,this.kG.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}const d=r.getFillStyle(),f=this.mO.fillStyleSolid(o),g=this.mO.fillStyleIndividual(o),m=this.mO.fillStylePalette(o),p=d===V&&V;if(o||l||h){let t;const e=r.getSize(),i=this.kG.individualPointColorEnabled,s=this.kG.individualPointSizeEnabled,n=this.kG.individualPointSizeAxisEnabled,h=this.kG.individualLookupValuesEnabled;if(g&&!i){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw St.alert(t),new Error(t)}if(m&&"value"===m.getLookUpProperty()&&!h){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw St.alert(t),new Error(t)}const l=this.mO.wireframeLineStyleSolid(o),u=this.mO.wireframeFillStyleSolid(o);if(f||g||m||u){const i=g?"attribute":m?["lookup",m.getLookUpProperty(),m.lut]:"uniform",o=s&&"number"==typeof e,h=n&&"object"==typeof e,c=o||h?"attribute":"uniform";if(ln(r)){const n=ee(r.getShape(),{cube:()=>Gp(this.zL),sphere:()=>iy(this.zL,r,s)});t={type:"instanced",shader:this.zL.cE(Wg["3D"],Wg.ColorShaded3D({dataType:i,shadingStyle:this.Bm._().type,wireframe:!1!==u}),Wg.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:gg(this.dt),normalSource:n.wU})),pointStyle:r,useIndividualPointSize:o,useIndividualPointSize3D:h,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,fillStyleEmpty:p,mousePickingShader:a&&this.zL.cE(Wg["3D"],Wg.MousePicking,Wg.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:gg(this.dt),normalSource:void 0})),geometry:n,wireframe:l&&u&&{thickness:l.getThickness()<0?1:l.getThickness(),fillStyleSolid:u}}}else dn(r)&&"number"==typeof e&&(t={type:"primitive",shader:this.zL.cE(Wg["3D"],Wg.PointSize(c),Wg.Color({dataType:i}),Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0})),pointStyle:r,pointSizePixels:e,useIndividualPointSize:o,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,mousePickingShader:a&&this.zL.cE(Wg["3D"],Wg.PointSize(c),Wg.MousePicking,Wg.VertexLocation({axisWorldTranslation:gg(this.dt),normalSource:void 0}))})}this.MN=t}if(void 0===this.Al&&m&&"value"===m.lookUpProperty&&m.lut.percentageValues){let t=Fe,e=_e;for(let i=0;it&&(t=s.value)}this.Al={min:e,max:t}}return this.fl=!1,this.ll=[],this.ul=0,this.uY=r,this.Bm.o=!1,this}yL(t){const e=this.zL.gl,i=this.MN;if(!i)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const n=this.Bm._(),{fillStyleSolid:r,fillStylePaletted:o,useIndividualPointSize:a}=i,h="instanced"===i.type&&i.useIndividualPointSize3D,l="instanced"===i.type&&i.wireframe;return this.zL.lV(s,((u,c,d,f)=>{let g=!1;if(this.zL.JL(s).DV(u("uScale"),this.IU.dR.gV()).DV(u("uDisp"),this.IU.dR.pV()).LV(u("uViewProjectionMatrix"),this.NU).fV(u("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(u("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(u("uRenderEffectMask"),2===t?1:0),"instanced"===i.type){const{pointSizeAxis:t,pointSizeNWU:e}=i;!1!==t&&!1===h&&this.zL.DV(u("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===a&&this.zL.fV(u("uOffsetNWU"),e).fV(f("uRatioNwuWu"),this.IU.JU())}else if("primitive"===i.type){const{pointSizePixels:t}=i;a||this.zL.fV(u("uPointSize"),t).fV(u("uDevicePixelRatio"),this.zL.sR())}if(1===t)this.zL.AV(u("uColor"),this.SO);else if("instanced"===i.type?("phong"===n.type&&this.zL.DV(u("uCameraLoc"),this.GU).DV(u("uLightLoc"),this.WU).fV(u("uAmbientReflection"),n.ambientReflection).fV(u("uSpecularReflection"),n.specularReflection).fV(u("uDiffuseReflection"),n.diffuseReflection).fV(u("uShininess"),n.shininess).AV(u("uLightColor"),n.specularColor).AV(u("uAmbientColor"),n.ambientColor),l&&this.zL.fV(u("uWireframeThickness"),l.thickness).AV(u("uWireframeColor"),l.fillStyleSolid.getColor()),r&&this.zL.AV(u("uColorDiffuse"),r.getColor()),i.fillStyleEmpty&&this.zL.AV(u("uColorDiffuse"),D)):"primitive"===i.type&&r&&this.zL.AV(u("uColor"),r.getColor()),o){const t=pg(o,this,this.Al);if(!t&&o.lut.percentageValues)return!1;this.zL.Ez(d,o.lut,t)}return this.wb.forEach(((s,r)=>{e.bindBuffer(e.ARRAY_BUFFER,s.vertexBuffer);const o=c("aPos");if(e.vertexAttribPointer(o,3,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(o,1),e.enableVertexAttribArray(o),i.fillStyleIndividual&&void 0!==this.kG.attributeOffsetColor&&1!==t){const t=c("aColor");e.vertexAttribPointer(t,4,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(t,1),e.enableVertexAttribArray(t)}if(a&&void 0!==this.kG.attributeOffsetSize){"instanced"===i.type?this.zL.fV(f("uRatioNwuWu"),this.IU.JU()):"primitive"===i.type&&this.zL.fV(u("uDevicePixelRatio"),this.zL.sR());const t=c("instanced"===i.type?"aOffsetNWU":"aPointSize");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(t,1),e.enableVertexAttribArray(t)}if(h&&void 0!==this.kG.attributeOffsetPointSize3D&&"instanced"===i.type){const t=c("aOffsetAxis");e.vertexAttribPointer(t,3,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(t,1),e.enableVertexAttribArray(t)}if(i.fillStylePaletted&&"value"===i.fillStylePaletted.getLookUpProperty()&&void 0!==this.kG.attributeOffsetLookUpValue&&1!==t){const t=c("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kG.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kG.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.zL.HV(t,1),e.enableVertexAttribArray(t)}"instanced"===i.type?(i.geometry.Pp(d,s.existingCoordinatesCount,"phong"===n.type&&1!==t,Boolean(l)&&1!==t),g=!0):"primitive"===i.type&&(this.zL.Pp(e.POINTS,s.existingCoordinatesCount),g=!0)})),g})),this}_l(t,e){Array.isArray(t)||(t=[t]),this.ll=se(this.ll,t,{canReturnB:!0}),this.ul+=t.length;const i=e||$e(t);return this.cl=this.cl?Je(this.cl,i):i,this.Al=void 0,this}ty(t){return this.qm="function"==typeof t?t(this.qm):t,this}cY(){return this.qm}xt(){return this.cl?Math.max(this.cl.max.x,this.ol.max.x):this.ol.max.x}vt(){return this.cl?Math.min(this.cl.min.x,this.ol.min.x):this.ol.min.x}Mt(){return this.cl?Math.max(this.cl.max.y,this.ol.max.y):this.ol.max.y}bt(){return this.cl?Math.min(this.cl.min.y,this.ol.min.y):this.ol.min.y}Wm(){return this.cl?Math.max(this.cl.max.z,this.ol.max.z):this.ol.max.z}Um(){return this.cl?Math.min(this.cl.min.z,this.ol.min.z):this.ol.min.z}Vl(){const t=this.qm,e=t.getSize();return"number"==typeof e?ln(t)?e/2:dn(t)?5:0:0}zl(){return this.Vl()}Ym(){return this.Vl()}yl(){return this.Lu}ml(){return this.ll}wl(){return this.al}Cl(){return this.ul}Nt(){return this.fl=!0,this.Lu.length=0,this.al=0,this.ll=[],this.ul=0,this.ol=ze,this.cl=void 0,this.Al=void 0,this}dispose(){return super.dispose(),this.bG.AG(),this.MN=void 0,this}GL(){return this.dispose(),this}}const iy=(t,e,i)=>{const s=e.getSize();return Jp(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class sy extends Yp{constructor(t,e,i,s,n,r){super(t,e,i,n,r),this.FU="disabled",this.be=Tn.fillStyle,this.Ky=Tn.lineStyle,this.aW=y("bilinear"),this.dY=[],this.fY=void 0,this.MN={},this.AY=!1,this.mO=mg({fillStyleSolid:()=>G(this.be)&&this.be,fillStylePaletted:()=>H(this.be)&&this.be,wireframeStyleLine:()=>Ji(this.Ky)&&this.Ky,wireframeStyleFill:()=>{const t=this.Ky&&this.Ky.getFillStyle();return G(t)&&t}}),this.Pi={x:0,z:0},this.yw={x:1,z:1},this.Bm.M(Nr);const o="columns"===s.dataOrder?s.columns:s.rows,a="columns"===s.dataOrder?s.rows:s.columns;this.En={...s,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:a},this.gY=new Array(this.En.primaryDimensionVectorsCount).fill(void 0),this.sk=new xp(this.aO,t.aO._W,t.us.dt,wt,[],this.En,-1,C).qy(nt),this.sk.cW=fp;const h=this.sk.fW.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,n=t.iFirstUniqueVector,r=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary),o={primary:t.sizeHeatmapDataVectors.primary-1,secondary:t.sizeHeatmapDataVectors.secondary-1};return{iFirstVector:t.iFirstVector,iFirstUniqueVector:t.iFirstUniqueVector,sizeHeatmapDataVectors:t.sizeHeatmapDataVectors,sizeUniqueHeatmapDataVectors:t.sizeUniqueHeatmapDataVectors,iFirstGeometryVector:s,iFirstGeometryUniqueVector:n,sizeGeometryDataVectors:e,sizeUniqueGeometryDataVectors:i,heightmapData:r,normalmapSize:o}})),l=this.sk.fW.gridTileSizes.map((t=>{const e=h.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary)),i=e[0].sizeGeometryDataVectors;return{...t,tiles:e,sizeGeometryData:i}})),u=h.reduce(((t,e)=>{const i=e.sizeHeatmapDataVectors.primary,s=e.sizeHeatmapDataVectors.secondary,n=i*s;return n>t.cells?{primary:i,secondary:s,cells:n}:t}),{primary:0,secondary:0,cells:0});this.pY={gridTiles:h,gridTileSizes:l,largestGridTileSize:u},this.sS(this.Pi,this.yw)}mY(t){this.yY=t,this.fY=void 0}sS(t,e){this.Pi=t,this.yw=e;const i=this.En,s={min:{x:Math.min(this.Pi.x,this.Pi.x+(i.columns-1)*this.yw.x),z:Math.min(this.Pi.z,this.Pi.z+(i.rows-1)*this.yw.z)},max:{x:Math.max(this.Pi.x,this.Pi.x+(i.columns-1)*this.yw.x),z:Math.max(this.Pi.z,this.Pi.z+(i.rows-1)*this.yw.z)}},n=new Map;return this.pY.gridTiles.forEach((t=>{const e="columns"===this.En.dataOrder?{x:this.yw.x*(t.sizeHeatmapDataVectors.primary-1),z:this.yw.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.yw.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.yw.z*(t.sizeHeatmapDataVectors.primary-1)},i="columns"===this.En.dataOrder?{x:this.Pi.x+this.yw.x*t.iFirstVector.primary,z:this.Pi.z+this.yw.z*t.iFirstVector.secondary}:{x:this.Pi.x+this.yw.x*t.iFirstVector.secondary,z:this.Pi.z+this.yw.z*t.iFirstVector.primary};n.set(t,{sizeAxis:e,startLocationAxis:i})})),this.SW={SY:s,tilesInfo:n},this}eS(){return{start:this.Pi,step:this.yw,end:{x:this.Pi.x+this.yw.x*this.En.columns,z:this.Pi.z+this.yw.z*this.En.rows}}}Ds(t){const e=this.dY,i=jn(this.pa,this.be),s=this.mO.fillStyleSolid(i),n=this.mO.fillStylePaletted(i),r=this.Ky,o=this.Ky!==this.AW,a=this.mO.wireframeStyleLine(o),h=this.mO.wireframeStyleFill(o),l=!1!==h,u=this.aW.o,c=this.aW._(),d=this.Bm._(),f=this.HE(),g=this.jo._();this.sk.Ds();const m=this.sk.gW;if(!m)return this;this.vY=this.vY||this.xY(m);const p=this.vY;this.bY(p);const y=gp(e,p,void 0,(t=>t.sizeGeometryDataVectors));if(y.size>0&&(yp(this.zL,y,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.AY=!0),"phong"===d.type&&(y.size>0||f)){const t=this.zL.gl,e=this.zL.cE(Wg["2D"],Wg.DrawToNormalTexture({flipXZ:"rows"===this.En.dataOrder,vertexIdSource:this.zL.Cz(),normalTextureType:this.zL.gl2?"uint":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN}));p.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{var n;const r=s.normalmapTexture,o=null===(n=this.SW)||void 0===n?void 0:n.tilesInfo.get(s.tileData);if(!r||!o)return;const a={x:s.normalmapSize.secondary,y:s.normalmapSize.primary},h=a.x*a.y;this.zL.lz.yL((()=>{this.zL.lV(e,((n,r,a,l)=>(this.zL.JL(e).kz(a,h).cV(n("uTileDimensionsXZ"),["columns"===this.En.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.En.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).IV(n("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).cV(n("uTileStartLocationAxisXZ"),[o.startLocationAxis.x,o.startLocationAxis.z]).cV(n("uTileSizeAxisXZ"),[o.sizeAxis.x,o.sizeAxis.z]).dV(n("uHeightmapTexture"),s.heightmapDataTexture,1).Pp(t.POINTS,h),!0)))}),r,a,void 0,this.us.un(),0)}))}))}const A=this.MN;if(i||o||u){const t=a&&h?{wireframeSolid:a,wireframeFillSolid:h}:void 0;s?A.surface={shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:n&&"value"===n.getLookUpProperty()?A.surface={shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:["lookup","value",n.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:n},wireframe:t}:n?A.surface={shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:["lookup",n.getLookUpProperty(),n.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:n},wireframe:t}:l&&(A.surface={shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return A.mousePicking=g?this.MN.mousePicking||{shader:this.zL.cE(Wg["3D"],Wg.SurfaceGrid({axisWorldTranslation:gg(this.dt),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.En.dataOrder,shadingStyle:"simple",wireframe:!1,instanceIdSource:this.zL.Tz(),normalTextureType:this.zL.gl2?"uint":"ubyte",intensityTextureType:this.zL.nE?"float":"ubyte",heightmapTextureType:this.zL.nE?"float":"ubyte",littleEndian:this.zL.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.MN=A,this.dY.length=0,this.pa=this.be,this.AW=r,this.Bm.o=!1,this}xY(t){const e=this.pY.gridTiles.map((e=>{const i=pp(this.zL,e.sizeHeatmapDataVectors.secondary,e.sizeHeatmapDataVectors.primary),s=t.gridTiles.find((t=>t.iFirstUniqueVector.primary===e.iFirstUniqueVector.primary&&t.iFirstUniqueVector.secondary===e.iFirstUniqueVector.secondary));if(!s)throw new Error("Internal LC JS error prepare surface data 2D render data not found");return{...e,intensityDataTexture:s.intensityDataTexture,heightmapDataTexture:i,normalmap:void 0,tileData:e}})),i=this.pY.gridTileSizes.map((t=>{const i=e.filter((e=>e.sizeHeatmapDataVectors.primary===t.sizeHeatmapData.primary&&e.sizeHeatmapDataVectors.secondary===t.sizeHeatmapData.secondary));return{...t,tiles:i}})),s=this.zL.oV([0,0,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,0,0]),n=this.zL.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:n}}bY(t){var e;if("phong"===this.Bm._().type)for(let i=0;i{t.normalmapTexture&&(this.zL.WL(t.normalmapTexture),t.normalmapTexture=void 0)}))}yL(t){var e,i,s,n;const r=this.zL.gl,o=this.vY;if(!o)return this;const a=this.Bm._(),h=this.MN,l=1===t?null===(e=h.mousePicking)||void 0===e?void 0:e.shader:null===(i=h.surface)||void 0===i?void 0:i.shader;if(!l)return this;const u=1!==t?null===(s=h.surface)||void 0===s?void 0:s.wireframe:void 0,c=1!==t?null===(n=h.surface)||void 0===n?void 0:n.fill:void 0;return this.zL.lV(l,((e,i,s,n)=>{let h=!1;if(this.zL.JL(l).Fz(s,this.pY.largestGridTileSize.cells).DV(e("uScale"),this.IU.dR.gV()).DV(e("uDisp"),this.IU.dR.pV()).LV(e("uViewProjectionMatrix"),this.NU).fV(e("uIsHighlighted"),1===t||2===t?0:this.Ko).AV(e("uHighlightColorOffset"),1===t||2===t?D:this.sa).fV(e("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===a.type&&this.zL.DV(e("uCameraLoc"),this.GU).DV(e("uLightLoc"),this.WU).fV(e("uAmbientReflection"),a.ambientReflection).fV(e("uSpecularReflection"),a.specularReflection).fV(e("uDiffuseReflection"),a.diffuseReflection).fV(e("uShininess"),a.shininess).AV(e("uLightColor"),a.specularColor).AV(e("uAmbientColor"),a.ambientColor),u)){const{wireframeFillSolid:t,wireframeSolid:i}=u,s=i.getThickness()<0?1:i.getThickness();this.zL.AV(e("uWireframeColor"),t.getColor()).fV(e("uWireframeThickness"),s)}return 1===t?this.zL.AV(e("uColorDiffuse"),this.SO):"solid"===(null==c?void 0:c.fillMode)&&this.zL.AV(e("uColorDiffuse"),c.fillStyleSolid.getColor()),o.gridTileSizes.forEach((n=>{this.zL.cV(e("uTileDimensionsXZ"),["columns"===this.En.dataOrder?n.sizeHeatmapData.primary:n.sizeHeatmapData.secondary,"columns"===this.En.dataOrder?n.sizeHeatmapData.secondary:n.sizeHeatmapData.primary]).IV(e("uTileDimensions"),[n.sizeHeatmapData.primary,n.sizeHeatmapData.secondary]),n.tiles.forEach((a=>{var l;const d=null===(l=this.SW)||void 0===l?void 0:l.tilesInfo.get(a.tileData);if(!d)return;let f=0,g=(a.sizeHeatmapDataVectors.primary-1)*(a.sizeHeatmapDataVectors.secondary-1);if(this.yY){const t=this.yY.fill.iFirstPrimary,e=this.yY.fill.iFirstPrimary+this.yY.fill.amountPrimary-1,i=a.iFirstVector.primary,s=a.iFirstVector.primary+a.sizeHeatmapDataVectors.primary-1;if(i>e||sm(Math.max(t,i),Math.min(e,s)))(t,e,i,s);f=(r.min-a.iFirstVector.primary)*(n.sizeGeometryData.secondary-1),g=(r.max-r.min)*(n.sizeGeometryData.secondary-1)}if(!(f<0||g<=0)){if("intensity"===(null==c?void 0:c.fillMode)){const{fillStylePaletted:t}=c,i=this.sk.Al;this.zL.Ez(s,t.lut,i).dV(e("uTileIntensityValues"),a.intensityDataTexture,2).PV(e("uTileBoundsAxisXZ"),[d.startLocationAxis.x,d.startLocationAxis.z,d.sizeAxis.x,d.sizeAxis.z])}if("xyz"===(null==c?void 0:c.fillMode)){const{fillStylePaletted:t}=c,e="x"===t.getLookUpProperty()?{min:this.vt(),max:this.xt()}:"y"===t.getLookUpProperty()?{min:this.bt(),max:this.Mt()}:"z"===t.getLookUpProperty()?{min:this.Um(),max:this.Wm()}:void 0;if(!e&&t.lut.percentageValues)return;this.zL.Ez(s,t.lut,e)}1!==t&&"phong"===this.Bm._().type&&a.normalmapTexture&&this.zL.dV(e("uNormalmapTexture"),a.normalmapTexture,3),this.zL.uV(o.rectangleLocationsBuffer,0,{location:i("aGeoCellOffset"),size:2},{location:u?i("aTriangleBary"):void 0,size:3}).RV(e("uBaseInstance"),f).cV(e("uTileStartLocationAxisXZ"),[d.startLocationAxis.x,d.startLocationAxis.z]).cV(e("uTileSizeAxisXZ"),[d.sizeAxis.x,d.sizeAxis.z]).dV(e("uHeightmapTexture"),a.heightmapDataTexture,0).KV(o.rectangleLocationsDrawMode,0,o.rectangleLocationsDrawLength,g),h=!0,r.bindBuffer(r.ARRAY_BUFFER,null)}}))})),h})),this}dispose(){return super.dispose(),this.sk.dispose(),this.vY&&(this.vY.gridTileSizes.forEach((t=>{})),this.vY.gridTiles.forEach((t=>{this.zL.WL(t.heightmapDataTexture),t.normalmapTexture&&this.zL.WL(t.normalmapTexture)})),this.zL.SV(this.vY.rectangleLocationsBuffer),this.vY=void 0),this.MN={},this}GL(){return this.dispose(),this.sk.GL(),this}oS(t){return this.sk.oS(t),this}aS(t){this.dY.push(t),mp(this.pY.gridTiles,t,(t=>t.heightmapData));for(let e=t.startPrimary;e{for(let r=Math.max(t,n.iFirstUniqueVector.primary);r<=Math.min(e,n.iFirstUniqueVector.primary+n.sizeUniqueHeatmapDataVectors.primary-1);r+=1){const t=(r-n.iFirstUniqueVector.primary)*n.sizeHeatmapDataVectors.secondary;let e=this.gY[r];if(e)i=ie.max?s:e.max;else{e={min:_e,max:Fe},this.gY[r]=e;for(let r=0;ro?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.fY={min:i,max:s},this.fY}}class ny extends Yp{constructor(t,e,i,s,n,r){super(t,e,i,n,r),this.FU="disabled",this.xW=0,this.MW={},this.Pi={x:0,z:0},this.yw={x:1,z:1},this.En={...s,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.SY={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===s.scrollDimension?this.Pi.x+(s.columns-1)*this.yw.x:this.Pi.x,z:"columns"===s.scrollDimension?this.Pi.z+(s.rows-1)*this.yw.z:this.Pi.z}};const o=()=>({shape:new sy(this.IU,wt,this.ta,{columns:s.columns+("columns"===s.scrollDimension?1:0),rows:s.rows+("rows"===s.scrollDimension?1:0),dataOrder:s.scrollDimension,heatmapDataType:"intensity"},this.yO,this.SO).setVisible(!1),hasData:!1});this.wb=[o(),o()]}Ds(t){this.wb.forEach((e=>{e.shape.Ds(t)}));const e=this.wb.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Dt(null===(i=e.shape.sk.Al)||void 0===i?void 0:i.min,_e)),t.max=Math.max(t.max,Dt(null===(s=e.shape.sk.Al)||void 0===s?void 0:s.max,Fe)),t}),{min:_e,max:Fe}),i=this.wb.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Dt(null===(i=e.shape.fY)||void 0===i?void 0:i.min,_e)),t.max=Math.max(t.max,Dt(null===(s=e.shape.fY)||void 0===s?void 0:s.max,Fe)),t}),{min:_e,max:Fe});return this.wb.forEach((t=>{t.shape.sk.Al=e,t.shape.fY=i})),this}yL(t){return this.wb.forEach((e=>{e.hasData&&(e.shape.NU=this.NU,e.shape.GU=this.GU,e.shape.WU=this.WU,e.shape.yL(t))})),this}sS(t,e){return this.Pi=t,this.yw=e,this.wb.forEach((t=>{t.shape.sS("columns"===this.En.scrollDimension?{x:t.shape.eS().start.x,z:this.Pi.z}:{x:this.Pi.x,z:t.shape.eS().start.z},this.yw)})),"columns"===this.En.scrollDimension?(this.SY.min.z=t.z,this.SY.max.z=this.Pi.z+(this.En.rows-1)*this.yw.z):(this.SY.min.x=t.x,this.SY.max.x=this.Pi.x+(this.En.columns-1)*this.yw.x),this}eS(){return{start:this.Pi,step:this.yw}}Nt(){return this.xW=0,this.MW={},this.SY={min:{x:this.Pi.x,z:this.Pi.z},max:{x:"rows"===this.En.scrollDimension?this.Pi.x+(this.En.columns-1)*this.yw.x:this.Pi.x,z:"columns"===this.En.scrollDimension?this.Pi.z+(this.En.rows-1)*this.yw.z:this.Pi.z}},this.wb.forEach((t=>{t.shape.setVisible(!1),t.shape.AY=!1,t.hasData=!1})),this}dS(t){var e;const i=this.wb[0],s=this.wb[1],n=t.heightMapValues?t.heightMapValues.length:null===(e=t.intensityValues)||void 0===e?void 0:e.length;let r=0;if(!n)return this;do{const e=Math.floor(this.xW/this.En.scrollDimensionSize)%this.wb.length,o=this.wb[e],a=this.xW%this.En.scrollDimensionSize,h=this.En.scrollDimensionSize-a,l=0===a,u=Math.min(h,n),c=a+u,d=a,f=d+1,g=r,m=r+u,p=this.xW>=this.En.scrollDimensionSize&&c<=this.En.scrollDimensionSize-1,y=l;l&&(o.shape.sS("columns"===this.En.scrollDimension?{x:this.Pi.x+(this.xW-1)*this.yw.x,z:this.Pi.z}:{x:this.Pi.x,z:this.Pi.z+(this.xW-1)*this.yw.z},this.yw),o.shape.setVisible(!0));const A=p?0:1,x=c+(p?1:0);o.shape.mY({fill:{iFirstPrimary:A,amountPrimary:x},wireframe:{iFirstPrimary:A,amountPrimary:x,connectNext:!1}});const S=o===i?s:i,b=c+1,v=1+this.En.scrollDimensionSize-b;S.shape.mY({fill:{iFirstPrimary:b,amountPrimary:v},wireframe:{iFirstPrimary:b,amountPrimary:v-1,connectNext:!0}});const M={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,m);let i=!1;y&&this.MW.yValues&&(i=!0,e.splice(0,0,this.MW.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.En.staticDimensionSize,values:e,type:"y"};o.shape.aS(s),o.hasData=!0,M.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,m);let i=!1;y&&this.MW.intensityValues&&(i=!0,e.splice(0,0,this.MW.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.En.staticDimensionSize,values:e,type:"intensity"};o.shape.oS(s),o.hasData=!0,M.intensityValues=e[u-1]}this.xW+=u,r+=u,this.MW=M}while(re.shape.rS(t))),this}nS(){return this.wb[0].shape.nS()}ke(t){return this.wb.forEach((e=>e.shape.ke(t))),this}Lh(){return this.wb[0].shape.Lh()}qy(t){return this.wb.forEach((e=>e.shape.qy(t))),this}hS(){return this.wb[0].shape.hS()}GL(){return this.dispose(),this.wb.forEach((t=>t.shape.GL())),this}dispose(){return super.dispose(),this.wb.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.wb.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}Om(t){return super.Om(t),this.wb.forEach((e=>e.shape.Om(t))),this}xt(){return this.SY.max.x}vt(){return this.SY.min.x}Mt(){return Math.max(this.wb[0].shape.Mt(),this.wb[1].shape.Mt())}bt(){return Math.min(this.wb[0].shape.bt(),this.wb[1].shape.bt())}Wm(){return this.SY.max.z}Um(){return this.SY.min.z}Vl(){return 0}zl(){return 0}Ym(){return 0}cs(t){return super.cs(t),this.wb.forEach((e=>e.shape.cs(t))),this}}class ry extends zp{constructor(t,e,i,s){super(t,e,i),this._Y=45,this.wY=.1,this.CY=100,this.GU=f(0,0,1),this.kY=f(0,0,-1),this.TY=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.Bm=new Or,this.dt=s}RS(){const{cellIndex:t,cellSpan:e,cellsAmount:i}=this.dt,s=e.x/i.x,n=e.y/i.y,r=t.x/i.x,o=t.y/i.y,a=this.us.oi();return{x:r*a.x,y:o*a.y,width:s*a.x,height:n*a.y}}setCameraLocation(t){return this.GU=t,this}getCameraLocation(){return this.GU}setCameraDirection(t){return this.kY=Ie.normalize(t),this}getCameraDirection(){return this.kY}setLightLocation(t){return this.WU=t,this}getLightLocation(){return this.WU}FY(){return f(this.TY[0],this.TY[1],this.TY[2])}IY(){return f(this.TY[4],this.TY[5],this.TY[6])}}class oy extends ry{constructor(t,e,i,s){super(t,e,i,s),this.dR=new _m,this.PY=!0,this.aO=t,this.gl=t.uO(),this.vU=this.gU,this.DY=this.us.Go((()=>{this.PY=!0})),this.BY=s.U((()=>{this.PY=!0}))}nV(t){const e=t.vt(),i=t.bt(),s=t.Um(),n=t.xt(),r=t.Mt(),o=t.Wm();if(e===_e||n===Fe||i===_e||r===Fe||s===_e||o===Fe)return Le;const a=t.Vl(),h=t.zl(),l=t.Ym(),u=Math.abs(t.Ts.bm(a)*t.dt.x.et()),c=Math.abs(t.Ts.bm(h)*t.dt.y.et()),d=Math.abs(t.Ts.bm(l)*t.dt.z.et()),f=e-u,g=n+u,m=i-c,p=r+c,y=s-d,A=o+d;let x;return[{x:f,y:m,z:y},{x:g,y:m,z:y},{x:f,y:p,z:y},{x:g,y:p,z:y},{x:f,y:m,z:A},{x:g,y:m,z:A},{x:f,y:p,z:A},{x:g,y:p,z:A}].map((e=>t.Ts._m(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};x=x?qe(x,{min:t,max:t}):e})),x||Le}xU(t){const e=Array.from(this.vU.values());for(let i=0;ige()));const{viewProjectionMatrix:s}=this.LY();this.RY();const n=[t.x,t.y,t.z],r=[e.x,e.y,e.z];return this.gU.forEach((t=>{t.NU=s,t.GU=n,t.WU=r,t.Ds(i)})),this}LY(){if(!this.PY&&this.NU)return{viewProjectionMatrix:this.NU};const t=this.RS(),e=t.width/t.height;this.EY=ol.projectionPerspective(this._Y,e,this.wY,this.CY);const i=this.GU;this.TY[12]=i.x,this.TY[13]=i.y,this.TY[14]=i.z;const s=this.kY,n=f(0,1,0),r=Ie.multiply(s,-1),o=Ie.normalize(Ie.cross(n,r)),a=Ie.normalize(Ie.cross(r,o));this.TY[0]=o.x,this.TY[1]=o.y,this.TY[2]=o.z,this.TY[4]=a.x,this.TY[5]=a.y,this.TY[6]=a.z,this.TY[8]=r.x,this.TY[9]=r.y,this.TY[10]=r.z,this.VY=ol.inverse(this.TY);const{cellIndex:h,cellSpan:l,cellsAmount:u}=this.dt,c=l.x/u.x,d=l.y/u.y,g=(h.x+l.x/2)/u.x,m=(h.y+l.y/2)/u.y,p=ol.multiply(ol.translation(Fr(-1,1,g),Fr(-1,1,m),0),ol.scaling(c,d,1));return this.NU=ol.multiply(p,ol.multiply(this.EY,this.VY)),this.zY=ol.inverse(this.NU),this.PY=!1,{viewProjectionMatrix:this.NU}}RY(){this.dR.iO(this.dt.x),this.dR.sO(this.dt.y),this.dR.eO(this.dt.z)}yL(t,e){const i=this.gl.sR(),s=this.RS(),n={x:s.x*i*e,y:s.y*i*e,width:s.width*i*e,height:s.height*i*e};return this.gl.rV(n.x,n.y,n.width,n.height),this.gU.forEach((e=>{e.getVisible()&&(this.gl.qE(e.FU),1!==t&&this.gl.Nm(e.Rm),(1!==t||e.getMouseInteractions())&&e.yL(t))})),this.gl.qE("disabled"),this.gl.Nm(!1),this.gl.tV(!1),this}setCameraLocation(t){return this.GU.x===t.x&&this.GU.y===t.y&&this.GU.z===t.z||(this.PY=!0),super.setCameraLocation(t),this}setCameraDirection(t){return this.kY.x===t.x&&this.kY.y===t.y&&this.kY.z===t.z||(this.PY=!0),super.setCameraDirection(t),this}W(){super.W(),this.us.Wo(this.DY),this.dt.Y(this.BY)}Oc(t){const e=this.aO.bU();return this.pU(new ey(this,this.mU,[],e,this.aO.MU(e),t))}zp(t){const e=this.aO.bU();return this.pU(new Kp(this,this.mU,t,e,this.aO.MU(e)))}jm(){const t=this.aO.bU();return this.pU(new Hp(this,this.mU,[],t,this.aO.MU(t)))}yS(){const t=this.aO.bU();return this.pU(new ty(this,this.mU,[],t,this.aO.MU(t)))}_A(){const t=this.aO.bU();return this.pU(new $p(this,this.mU,[],t,this.aO.MU(t)))}tS(t){const e=this.aO.bU();return this.pU(new sy(this,this.mU,[],t,e,this.aO.MU(e)))}cS(t){const e=this.aO.bU();return this.pU(new ny(this,this.mU,[],t,e,this.aO.MU(e)))}}class ay extends wn{constructor(t,e,i,s=Cm){var n;if(super(t,e,i),this.X=c(1,1),this.OY=!1,this.NY=0,this.GY=!0,this.WY=0,this.QU=8388608,this.QR=[null,null],this.UY=null,this.YY=null,this.HY=0,this.RA=!1,this.$Y=0,this.bs=(t=!1)=>(this.$i||this.rn||this.jY()||(t&&(this.OY=!0),this.Jr=!0,this.ZY||this.Yr.uE(t)),this),this.ZY=!1,this.gE=t=>{if(this.$i||this.rn)return;const e=t-this.NY;if(e>=this.do||-1===this.do){this.ZY=!0,this.NY=t,this.OY=!1;const i=e>50?1e3/60:e;this.Kr&&this.Kr(i),this.Jr=!1,-1!==this.do&&this.OY&&(this.Yr.uE(this.OY),this.Jr=!0),this.ls.Ds(e),this.dn(),this.fn(),this.qr&&this.qr(),this.ZY=!1,this.D.emit("render"),this.Jr&&this.bs(this.OY)}else this.Jr=!0,this.Yr.uE()},this.QY=new Map,this.uO=()=>this.zL,this.JY=()=>{var t,e,i;const s=this.Bn(),n=this.GY,r=St.performance.now(),o=null===(t=this.KY)||void 0===t?void 0:t.qY.reduce(((t,e)=>t?e.tH&&t.tH&&e.tH>t.tH?e:t:e),void 0),a=null==o?void 0:o.tH,h=null===(e=this.Cn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.Vo)||void 0===i?void 0:i.timeStamp;return n?(this.bs(!0),!1):void 0===o||(void 0===o||!o.iH)&&(void 0!==l&&void 0!==a&&l>a||(void 0!==a&&void 0===s?r-a>=1e3:!(void 0!==a&&void 0!==h&&r-h>=2e3)||r-a>=1e3))},this.sH=()=>{var t,e;this.eH=void 0;const i=null===(e=null===(t=this.KY)||void 0===t?void 0:t.hH)||void 0===e?void 0:e.rH;void 0===i||i>=this.WY||this.nH()},this.fn=()=>{if(this.$i||this.rn)return this;const t=this.zL.gl,e=St.performance.now();this.zL.eV(t.FRAMEBUFFER,this.Yr.hE?this.QR[0]:null);const i=this.X,s=i.x>0&&i.y>0;if(this.ln.o&&this.zL.iz(this.ln._()),t.resize&&s&&t.resize(i.x*this.zL.sR(),i.y*this.zL.sR()),this.zL.hV(0,0,i.x*this.zL.sR(),i.y*this.zL.sR()),this.zL.rV(0,0,i.x*this.zL.sR(),i.y*this.zL.sR()),this.zL.Nt(),s)for(const t of this.jr.values())t.yL(0,1);if(this.En.lo&&s&&(this.eH&&(St.clearTimeout(this.eH),this.eH=void 0),this.JY()?(this.nH(),this.zL.eV(t.FRAMEBUFFER,this.Yr.hE?this.QR[0]:null)):this.eH=St.setTimeout(this.sH,500)),this.j(),this.Wr(),this.yn&&this.mn(this.yn),this.Yr.hE){const e=this.zL.gl2.ctx;e.bindFramebuffer(e.READ_FRAMEBUFFER,this.QR[0]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.QR[1]),e.clearBufferfv(e.COLOR,0,[1,1,1,1]),e.blitFramebuffer(0,0,this.X.x*this.zL.sR(),this.X.y*this.zL.sR(),0,0,this.X.x*this.zL.sR(),this.X.y*this.zL.sR(),t.COLOR_BUFFER_BIT,t.LINEAR)}else t.bindTexture(t.TEXTURE_2D,this.YR),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,this.X.x*this.zL.sR(),this.X.y*this.zL.sR(),0),t.bindTexture(t.TEXTURE_2D,null);return this.zL.eV(t.FRAMEBUFFER,null),this.Yr.uE(),this.GY=!1,this.WY=e,this},this.dn=()=>{const t=this.X;if(0===t.x||0===t.y)return this;this.Mo.q(t);for(const t of this.jr.values())t.Ds();return this.j(),this},this.oH=1,this.Yr=t,this.Yr.sE){this.aH=St.document.createElement("canvas"),this.aH.style.width="100%",this.aH.style.height="100%",this.aH.style.display="block",this.aH.style.boxSizing="content-box",this.aH.style.position="absolute";const t=this.aH.getContext("2d",{willReadFrequently:!1,alpha:!0,desynchronized:!1});if(!t)throw new gt("No Canvas context available.");this.HR=t,this.Rr.appendChild(this.aH)}this.Yr.yE(this);const r={preserveDrawingBuffer:!0,antialias:e?e.antialias:void 0,alpha:!0,lineAntialias:!e||(!0===e.lineAntiAlias||!1===e.lineAntiAlias?e.lineAntiAlias:!1!==e.antialias)};let o;if(this.Yr.hE&&t.gl2&&(o=new s(this,this.En,{type:"webgl2",ctx:t.gl2.ctx,antialias:r.antialias,lineAntialias:r.lineAntialias},this.qi.isDark)),o||this.Yr.hE||(o=new s(this,this.En,{type:"webgl1",ctx:t.gl,antialias:r.antialias,lineAntialias:r.lineAntialias},this.qi.isDark)),!o)throw new gt("No WebGL context available."+((null===(n=null==e?void 0:e.webgl)||void 0===n?void 0:n.version)?`\nSelected explicit target: ${e.webgl.version}`:""));this.zL=o;let a=1;if(e&&e.devicePixelRatio)a=!0===e.devicePixelRatio?St.devicePixelRatio||1:e.devicePixelRatio||1;else{const t=St.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(a=St.devicePixelRatio||1)}this.zL.Az(a);const h=e?e.width:void 0,l=e?e.height:void 0;this.vo=this.lH(h),this.bo=this.lH(l),this.uH(this.vo,this.bo),this._W=this.nI("engine offscreen",1e6),this.cH=this.nI("engine bg",0);const u="function"==typeof this.qi.lcjsBackgroundFillStyle?this.qi.lcjsBackgroundFillStyle(this.En.Xs):this.qi.lcjsBackgroundFillStyle;this.Mo=this.cH.Te(this.dt).ke(u).Ce(this.qi.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Ie({x:0,y:0});const d=this.nI("engine effects",200001)._U(this.qi.effect);this.es=d;const f=this.Yr.hE,g=this.oi();f&&(this.QR=[o.bV(),o.bV()]);const m=this.zL.gl;f&&(this.UY=m.createRenderbuffer(),this.YY=m.createRenderbuffer()),this.YR=m.createTexture();const p=g.x*this.zL.sR(),y=g.y*this.zL.sR();if(f){m.bindRenderbuffer(m.RENDERBUFFER,this.UY);const t=this.zL.gl2.ctx;this.HY=this.Yr.RR&&!1!==e.antialias?t.getParameter(t.MAX_SAMPLES):0,t.renderbufferStorageMultisample(t.RENDERBUFFER,this.HY,t.RGBA8,p,y),m.bindRenderbuffer(m.RENDERBUFFER,this.YY),m.renderbufferStorage(m.RENDERBUFFER,m.DEPTH_COMPONENT16,p,y),t.renderbufferStorageMultisample(t.RENDERBUFFER,this.HY,t.DEPTH_COMPONENT16,p,y)}f&&(this.zL.eV(m.FRAMEBUFFER,this.QR[0]),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.RENDERBUFFER,this.UY),m.framebufferRenderbuffer(m.FRAMEBUFFER,m.DEPTH_ATTACHMENT,m.RENDERBUFFER,this.YY)),m.bindTexture(m.TEXTURE_2D,this.YR),m.texImage2D(m.TEXTURE_2D,0,m.RGBA,p,y,0,m.RGBA,m.UNSIGNED_BYTE,null),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.LINEAR),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),f&&(this.zL.eV(m.FRAMEBUFFER,this.QR[1]),m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.TEXTURE_2D,this.YR,0)),this.zL.eV(m.FRAMEBUFFER,null),this.nn(),this.Wr(),this.WA=xn(this),this.UA={qi:this.qi,ls:this.ls,dt:this.dt,bs:t=>this.bs(t),Bn:()=>this.Bn(),WD:t=>this.WD(t),En:this.En,As:t=>this.As(t),es:this.es,$o:t=>this.$o(t),Xo:t=>this.Xo(t),kB:{CB:(t,e,i)=>this.zL.Eh(e.family).qL(t,e,i,this.qi.isDark)}};const A=()=>{this.W()};St.addEventListener("unload",A),this.tn.push((()=>{St.removeEventListener("unload",A)}))}get dH(){return this.jr}Hr(t,e){let i=this.QY.get(t);if(!i){const e=this.zL.vz(t),s=new Set,n=t=>{s.add(t)},r=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.QY.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:n,handleInstanceDisposed:r,sharedEngineReference:{UD:()=>e.RE,YD:t=>{e.RE?t():o.push(t)}}},this.QY.set(t,i),e.JL(this),e.WE((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new Qr(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}WD(t){const e=Array.from(this.QY.values()).find((e=>e.instances.has(t)));if(!e)throw fe(0,(()=>new Error("LightningChart JS error, attempted to use Icon that is disposed. Please check that you are not disposing an Icon that is still in use, or attempting to use a previously disposed Icon!")));return e.sharedEngineReference}Sn(t,e){var i;const s=null===(i=this.KY)||void 0===i?void 0:i.hH;if(!s)return;const n=this.De(e.x,e.y),r=Math.round(n.x*this.zL.sR()),o=Math.round(n.y*this.zL.sR());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.fH(s,r+t[0]/s.AH,o+t[1]/s.AH))).reduce(((t,e)=>{if(void 0===e)return t||void 0;const i=1e6*e.layerIndex+e.entityIndex;return!t||i>t.zIndexForComparison?{zIndexForComparison:i,entity:e.entity,collectionMember:e.collectionMember}:t}),void 0)}fH(t,e,i){const s=Math.round(e*t.AH),n=Math.round(i*t.AH);if(s<0||s>=t.X.x||n<0||n>=t.X.y)return;const r=4*(s+n*t.X.x),o=t.gH[r+0],a=t.gH[r+1],h=t.gH[r+2],l=t.gH[r+3];return void 0!==o&&void 0!==a&&void 0!==h&&void 0!==l?this.pH(o,a,h,l):void 0}Or(t,e,i){const s=this.zL.gl;this.Yr.hE?(this.zL.eV(s.FRAMEBUFFER,this.QR[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.YR,0)):this.zL.eV(s.FRAMEBUFFER,null);const n=this.UR(),r=n.x,o=n.y,a=new Uint8Array(r*o*4);this.Yr.hE||this.fn(),s.readPixels(0,0,r,o,s.RGBA,s.UNSIGNED_BYTE,a);const h=new ImageData(new Uint8ClampedArray(a),r,o),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)throw new Error("Failed to create 2D context for saving image.");l.width=r,l.height=o,u.putImageData(h,0,0),u.translate(0,o),u.scale(1,-1),u.drawImage(l,0,0),this.Yr.hE&&(this.zL.eV(s.FRAMEBUFFER,this.QR[0]),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,this.UY),this.zL.eV(s.FRAMEBUFFER,this.QR[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.YR,0)),this.zL.eV(s.FRAMEBUFFER,null);const c=l.toDataURL(t,e);return i?c:(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=St.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof Rp))throw new Error("Unexpected Engine Layer error");return i}return this.An(new Rp(this,e,t))}lI(t,e,i){const s=this.ko(e);if(s){if(fe(0,(()=>{})),!(s instanceof oy))throw new Error("Unexpected Engine Layer error");return s}return this.An(new oy(this,e,t,i))}oi(){return this.X}UR(){const t=this.zL.sR();return{x:Math.round(this.X.x*t),y:Math.round(this.X.y*t)}}lH(t){return t instanceof Array||(t=[t,t]),t}mH(){return this.Yr.$R}jY(){const t=this.zL.gl;return t&&"resize"in t}nH(){var t;const e=this.zL.gl,i=St.performance.now(),s=this.Bn(),n=this.En.ao,r={x:Math.ceil(this.X.x*this.zL.sR()*n),y:Math.ceil(this.X.y*this.zL.sR()*n)};this.KY||(this.KY={AH:n,yH:r,qY:[],hH:void 0});let o=this.KY.qY.find((t=>!t.iH)),a=!1;o||(a=!0,o={iH:!1,X:r,Bz:e.createTexture(),SH:this.zL.bV(),YY:this.zL.MV(),vH:new Uint8Array,tH:void 0},this.KY.qY.push(o));const h=o;(a||h.X.x!==r.x||h.X.y!==r.y)&&(e.bindTexture(e.TEXTURE_2D,h.Bz),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r.x,r.y,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),this.zL.eV(e.FRAMEBUFFER,h.SH),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,h.Bz,0),e.bindRenderbuffer(e.RENDERBUFFER,h.YY),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,r.x,r.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,h.YY),h.vH=new Uint8Array(r.x*r.y*4),h.X=r),h.iH=!0,h.tH=i,this.zL.eV(e.FRAMEBUFFER,h.SH),e.clearDepth(1),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),e.disable(e.BLEND),e.resize&&e.resize(r.x,r.y),this.zL.hV(0,0,r.x,r.y);for(const t of this.jr.values())t.yL(1,n);this.zL.eV(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.zL.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.KY){const t=this.KY.hH;if(t&&t.rH>i)return;this.KY.hH={rH:i,AH:n,X:r,gH:h.vH,xH:s}}};l?this.zL.Iz(l,h.SH,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.vH).then((()=>{this.$i||(h.iH=!1,u())})).catch((t=>{this.$i||(h.iH=!1,St.console.warn("LightningChart JS mouse picking failed unexpectedly. This could mean that user interactions on charts are compromised.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact"))})):(this.zL.Pz(h.SH,0,0,r.x,r.y,e.RGBA,e.UNSIGNED_BYTE,h.vH),h.iH=!1,u())}nn(t){const e=this.X.x,i=this.X.y,s=t||{x:this.Rr.offsetWidth,y:this.Rr.offsetHeight};if(0!==s.x&&0!==s.y&&(s.x!==e||s.y!==i)){this.X=s,this.dt.x.J(0,s.x).q(s.x),this.dt.y.J(0,s.y).q(s.y);const t=s.x*this.zL.sR(),e=s.y*this.zL.sR(),i=this.zL.gl;this.Yr.sE&&this.HR&&(this.HR.canvas.width=t,this.HR.canvas.height=e);const n=this.Yr.hE;if(this.YR&&(i.bindTexture(i.TEXTURE_2D,this.YR),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null)),n){const s=this.zL.gl2.ctx;this.UY&&(i.bindRenderbuffer(i.RENDERBUFFER,this.UY),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.HY,s.RGBA8,t,e)),this.YY&&(i.bindRenderbuffer(i.RENDERBUFFER,this.YY),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_COMPONENT16,t,e),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.HY,s.DEPTH_COMPONENT16,t,e))}i.bindRenderbuffer(i.RENDERBUFFER,null),this.D.emit("resize",[this.X.x,this.X.y])}}W(){var t;super.W(),this.eH&&(St.clearTimeout(this.eH),this.eH=void 0),Array.from(this.zL.wR.entries()).forEach((([t,e])=>{e.GL(!1),this.zL.wR.delete(t)})),Array.from(this.zL.kV.values()).forEach((t=>{t.unbindResources()})),this.zL.kV.clear(),this.zL.CV.IE(),this.zL.uz.W(),this.zL.SV(this.zL.cz),this.zL.SV(this.zL.dz),this.zL.nz.forEach(((t,e)=>{this.zL.gl.deleteBuffer(e)})),this.zL.nz.clear(),this.zL.wz&&(this.zL.SV(this.zL.wz.buffer),this.zL.wz=void 0),this.zL.wV(this.QR[0]),this.zL.wV(this.QR[1]),this.zL._V(this.UY),this.zL.WL(this.YR),this.zL._V(this.YY),this.KY&&(this.KY.qY.forEach((t=>{this.zL._V(t.YY),this.zL.wV(t.SH),this.zL.WL(t.Bz)})),this.KY=void 0),this.zL.ez.forEach((t=>this.zL.SV(t))),this.QY.clear(),this.Yr.vE(this),this.aH&&(null===(t=this.aH.parentElement)||void 0===t||t.removeChild(this.aH),this.aH=void 0),this.HR&&(this.HR=void 0),this.zL.gl=void 0}bU(){const t=this.oH;return t>4294967295&&(console.warn("LightningChart JS picking ID overflow.\nThis is an unexpected error that could compromise user interactions on the chart.\nPlease report the issue to https://lightningchart.com/js-charts/docs/contact!"),this.oH=1),this.oH+=1,t}MU(t){let e=t;const i=Math.floor(e/16777216);e-=16777216*i;const s=Math.floor(e/65536);e-=65536*s;const n=Math.floor(e/256);return e-=256*n,T(i,s,n,e)}pH(t,e,i,s){if(0===t&&0===e&&0===i&&0===s)return;const n=16777216*t+65536*e+256*i+s;for(const t of this.dH.values()){const e=t.xU(n);if(e)return{entity:e.entity,collectionMember:e.collectionMember,entityIndex:e.index,layerIndex:t.gn()}}}}var hy="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},ly={exports:{}};!function(t,e){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function s(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function n(t,e,i){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this.GE(t||0,e||10,i||"be"))}var r;"object"==typeof ly?ly.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{r=(void 0).Buffer}catch(t){}function o(t,e,s){for(var n=0,r=Math.min(t.length,s),o=0,a=e;a=49&&l<=54?l-49+10:l>=17&&l<=22?l-17+10:l,o|=h}return i(!(240&o),"Invalid character in "+t),n}function a(t,e,s,n){for(var r=0,o=0,a=Math.min(t.length,s),h=e;h=49?l-49+10:l>=17?l-17+10:l,i(l>=0&&o0?t:e},n.min=function(t,e){return t.cmp(e)<0?t:e},n.prototype.GE=function(t,e,s){if("number"==typeof t)return this.bH(t,e,s);if("object"==typeof t)return this.MH(t,e,s);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._H(t,n):this.wH(t,e,n),"-"===t[0]&&(this.negative=1),this.CH(),"le"===s&&this.MH(this.toArray(),e,s)},n.prototype.bH=function(t,e,s){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===s&&this.MH(this.toArray(),e,s)},n.prototype.MH=function(t,e,s){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[r]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,r++);else if("le"===s)for(n=0,r=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,r++);return this.CH()},n.prototype._H=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=6)n=o(t,i,i+6),this.words[s]|=n<>>26-r&4194303,(r+=24)>=26&&(r-=26,s++);i+6!==e&&(n=o(t,e,i+6),this.words[s]|=n<>>26-r&4194303),this.CH()},n.prototype.wH=function(t,e,i){this.words=[0],this.length=1;for(var s=0,n=1;n<=67108863;n*=e)s++;s--,n=n/e|0;for(var r=t.length-i,o=r%s,h=Math.min(r,r-o)+i,l=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this.IH()},n.prototype.IH=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){n.prototype.inspect=l}else n.prototype.inspect=l;function l(){return(this.red?""}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,i){i.negative=e.negative^t.negative;var s=t.length+e.length|0;i.length=s,s=s-1|0;var n=0|t.words[0],r=0|e.words[0],o=n*r,a=67108863&o,h=o/67108864|0;i.words[0]=a;for(var l=1;l>>26,c=67108863&h,d=Math.min(l,e.length-1),f=Math.max(0,l-t.length+1);f<=d;f++){var g=l-f|0;u+=(o=(n=0|t.words[g])*(r=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[l]=0|c,h=0|u}return 0!==h?i.words[l]=0|h:i.length--,i.CH()}n.prototype.toString=function(t,e){var s;if(e=0|e||1,16===(t=t||10)||"hex"===t){s="";for(var n=0,r=0,o=0;o>>24-n&16777215)||o!==this.length-1?u[6-h.length]+h+s:h+s,(n+=2)>=26&&(n-=26,o--)}for(0!==r&&(s=r.toString(16)+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],f=d[t];s="";var g=this.clone();for(g.negative=0;!g.isZero();){var m=g.modrn(f).toString(t);s=(g=g.idivn(f)).isZero()?m+s:u[l-m.length]+m+s}for(this.isZero()&&(s="0"+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}i(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},r&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(r,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},n.prototype.toArrayLike=function(t,e,s){this.CH();var n=this.byteLength(),r=s||Math.max(1,n);i(n<=r,"byte array longer than desired length"),i(r>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,r);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,n),o},n.prototype.PH=function(t,e){for(var i=0,s=0,n=0,r=0;n>8&255),i>16&255),6===r?(i>24&255),s=0,r=0):(s=o>>>24,r+=2)}if(i=0&&(t[i--]=o>>8&255),i>=0&&(t[i--]=o>>16&255),6===r?(i>=0&&(t[i--]=o>>24&255),s=0,r=0):(s=o>>>24,r+=2)}if(i>=0)for(t[i--]=s;i>=0;)t[i--]=0},Math.clz32?n.prototype.BH=function(t){return 32-Math.clz32(t)}:n.prototype.BH=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},n.prototype.LH=function(t){if(0===t)return 26;var e=t,i=0;return!(8191&e)&&(i+=13,e>>>=13),!(127&e)&&(i+=7,e>>>=7),!(15&e)&&(i+=4,e>>>=4),!(3&e)&&(i+=2,e>>>=2),!(1&e)&&i++,i},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this.BH(t);return 26*(this.length-1)+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;it.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var s=0;st.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),s=t%26;this.FH(e),s>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-s),this.CH()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var s=t/26|0,n=t%26;return this.FH(s+1),this.words[s]=e?this.words[s]|1<t.length?(i=this,s=t):(i=t,s=this);for(var n=0,r=0;r>>26;for(;0!==n&&r>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;rt.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e.IH()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.IH();var i,s,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,s=t):(i=t,s=this);for(var r=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==r&&o>26,this.words[o]=67108863&e;if(0===r&&o>>13,f=0|o[1],g=8191&f,m=f>>>13,p=0|o[2],y=8191&p,A=p>>>13,x=0|o[3],S=8191&x,b=x>>>13,v=0|o[4],M=8191&v,T=v>>>13,w=0|o[5],E=8191&w,k=w>>>13,C=0|o[6],D=8191&C,I=C>>>13,_=0|o[7],F=8191&_,L=_>>>13,z=0|o[8],P=8191&z,R=z>>>13,V=0|o[9],B=8191&V,O=V>>>13,N=0|a[0],U=8191&N,G=N>>>13,W=0|a[1],Y=8191&W,H=W>>>13,X=0|a[2],j=8191&X,$=X>>>13,q=0|a[3],J=8191&q,K=q>>>13,Z=0|a[4],Q=8191&Z,tt=Z>>>13,et=0|a[5],it=8191&et,st=et>>>13,nt=0|a[6],rt=8191&nt,ot=nt>>>13,at=0|a[7],ht=8191&at,lt=at>>>13,ut=0|a[8],ct=8191&ut,dt=ut>>>13,ft=0|a[9],gt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var pt=(l+(s=Math.imul(c,U))|0)+((8191&(n=(n=Math.imul(c,G))+Math.imul(d,U)|0))<<13)|0;l=((r=Math.imul(d,G))+(n>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(g,U),n=(n=Math.imul(g,G))+Math.imul(m,U)|0,r=Math.imul(m,G);var yt=(l+(s=s+Math.imul(c,Y)|0)|0)+((8191&(n=(n=n+Math.imul(c,H)|0)+Math.imul(d,Y)|0))<<13)|0;l=((r=r+Math.imul(d,H)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(y,U),n=(n=Math.imul(y,G))+Math.imul(A,U)|0,r=Math.imul(A,G),s=s+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,H)|0)+Math.imul(m,Y)|0,r=r+Math.imul(m,H)|0;var At=(l+(s=s+Math.imul(c,j)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(d,j)|0))<<13)|0;l=((r=r+Math.imul(d,$)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(S,U),n=(n=Math.imul(S,G))+Math.imul(b,U)|0,r=Math.imul(b,G),s=s+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,H)|0)+Math.imul(A,Y)|0,r=r+Math.imul(A,H)|0,s=s+Math.imul(g,j)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(m,j)|0,r=r+Math.imul(m,$)|0;var xt=(l+(s=s+Math.imul(c,J)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(d,J)|0))<<13)|0;l=((r=r+Math.imul(d,K)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(M,U),n=(n=Math.imul(M,G))+Math.imul(T,U)|0,r=Math.imul(T,G),s=s+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,H)|0)+Math.imul(b,Y)|0,r=r+Math.imul(b,H)|0,s=s+Math.imul(y,j)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(A,j)|0,r=r+Math.imul(A,$)|0,s=s+Math.imul(g,J)|0,n=(n=n+Math.imul(g,K)|0)+Math.imul(m,J)|0,r=r+Math.imul(m,K)|0;var St=(l+(s=s+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;l=((r=r+Math.imul(d,tt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(E,U),n=(n=Math.imul(E,G))+Math.imul(k,U)|0,r=Math.imul(k,G),s=s+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,H)|0)+Math.imul(T,Y)|0,r=r+Math.imul(T,H)|0,s=s+Math.imul(S,j)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(b,j)|0,r=r+Math.imul(b,$)|0,s=s+Math.imul(y,J)|0,n=(n=n+Math.imul(y,K)|0)+Math.imul(A,J)|0,r=r+Math.imul(A,K)|0,s=s+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(m,Q)|0,r=r+Math.imul(m,tt)|0;var bt=(l+(s=s+Math.imul(c,it)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(d,it)|0))<<13)|0;l=((r=r+Math.imul(d,st)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(D,U),n=(n=Math.imul(D,G))+Math.imul(I,U)|0,r=Math.imul(I,G),s=s+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(k,Y)|0,r=r+Math.imul(k,H)|0,s=s+Math.imul(M,j)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(T,j)|0,r=r+Math.imul(T,$)|0,s=s+Math.imul(S,J)|0,n=(n=n+Math.imul(S,K)|0)+Math.imul(b,J)|0,r=r+Math.imul(b,K)|0,s=s+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(A,Q)|0,r=r+Math.imul(A,tt)|0,s=s+Math.imul(g,it)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(m,it)|0,r=r+Math.imul(m,st)|0;var vt=(l+(s=s+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,ot)|0)+Math.imul(d,rt)|0))<<13)|0;l=((r=r+Math.imul(d,ot)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(F,U),n=(n=Math.imul(F,G))+Math.imul(L,U)|0,r=Math.imul(L,G),s=s+Math.imul(D,Y)|0,n=(n=n+Math.imul(D,H)|0)+Math.imul(I,Y)|0,r=r+Math.imul(I,H)|0,s=s+Math.imul(E,j)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(k,j)|0,r=r+Math.imul(k,$)|0,s=s+Math.imul(M,J)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(T,J)|0,r=r+Math.imul(T,K)|0,s=s+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(b,Q)|0,r=r+Math.imul(b,tt)|0,s=s+Math.imul(y,it)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(A,it)|0,r=r+Math.imul(A,st)|0,s=s+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,ot)|0)+Math.imul(m,rt)|0,r=r+Math.imul(m,ot)|0;var Mt=(l+(s=s+Math.imul(c,ht)|0)|0)+((8191&(n=(n=n+Math.imul(c,lt)|0)+Math.imul(d,ht)|0))<<13)|0;l=((r=r+Math.imul(d,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(P,U),n=(n=Math.imul(P,G))+Math.imul(R,U)|0,r=Math.imul(R,G),s=s+Math.imul(F,Y)|0,n=(n=n+Math.imul(F,H)|0)+Math.imul(L,Y)|0,r=r+Math.imul(L,H)|0,s=s+Math.imul(D,j)|0,n=(n=n+Math.imul(D,$)|0)+Math.imul(I,j)|0,r=r+Math.imul(I,$)|0,s=s+Math.imul(E,J)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(k,J)|0,r=r+Math.imul(k,K)|0,s=s+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(T,Q)|0,r=r+Math.imul(T,tt)|0,s=s+Math.imul(S,it)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(b,it)|0,r=r+Math.imul(b,st)|0,s=s+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,ot)|0)+Math.imul(A,rt)|0,r=r+Math.imul(A,ot)|0,s=s+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,lt)|0)+Math.imul(m,ht)|0,r=r+Math.imul(m,lt)|0;var Tt=(l+(s=s+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;l=((r=r+Math.imul(d,dt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(B,U),n=(n=Math.imul(B,G))+Math.imul(O,U)|0,r=Math.imul(O,G),s=s+Math.imul(P,Y)|0,n=(n=n+Math.imul(P,H)|0)+Math.imul(R,Y)|0,r=r+Math.imul(R,H)|0,s=s+Math.imul(F,j)|0,n=(n=n+Math.imul(F,$)|0)+Math.imul(L,j)|0,r=r+Math.imul(L,$)|0,s=s+Math.imul(D,J)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(I,J)|0,r=r+Math.imul(I,K)|0,s=s+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(k,Q)|0,r=r+Math.imul(k,tt)|0,s=s+Math.imul(M,it)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(T,it)|0,r=r+Math.imul(T,st)|0,s=s+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(b,rt)|0,r=r+Math.imul(b,ot)|0,s=s+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,lt)|0)+Math.imul(A,ht)|0,r=r+Math.imul(A,lt)|0,s=s+Math.imul(g,ct)|0,n=(n=n+Math.imul(g,dt)|0)+Math.imul(m,ct)|0,r=r+Math.imul(m,dt)|0;var wt=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((r=r+Math.imul(d,mt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(B,Y),n=(n=Math.imul(B,H))+Math.imul(O,Y)|0,r=Math.imul(O,H),s=s+Math.imul(P,j)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(R,j)|0,r=r+Math.imul(R,$)|0,s=s+Math.imul(F,J)|0,n=(n=n+Math.imul(F,K)|0)+Math.imul(L,J)|0,r=r+Math.imul(L,K)|0,s=s+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(I,Q)|0,r=r+Math.imul(I,tt)|0,s=s+Math.imul(E,it)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(k,it)|0,r=r+Math.imul(k,st)|0,s=s+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,ot)|0)+Math.imul(T,rt)|0,r=r+Math.imul(T,ot)|0,s=s+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,lt)|0)+Math.imul(b,ht)|0,r=r+Math.imul(b,lt)|0,s=s+Math.imul(y,ct)|0,n=(n=n+Math.imul(y,dt)|0)+Math.imul(A,ct)|0,r=r+Math.imul(A,dt)|0;var Et=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(n=(n=n+Math.imul(g,mt)|0)+Math.imul(m,gt)|0))<<13)|0;l=((r=r+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(B,j),n=(n=Math.imul(B,$))+Math.imul(O,j)|0,r=Math.imul(O,$),s=s+Math.imul(P,J)|0,n=(n=n+Math.imul(P,K)|0)+Math.imul(R,J)|0,r=r+Math.imul(R,K)|0,s=s+Math.imul(F,Q)|0,n=(n=n+Math.imul(F,tt)|0)+Math.imul(L,Q)|0,r=r+Math.imul(L,tt)|0,s=s+Math.imul(D,it)|0,n=(n=n+Math.imul(D,st)|0)+Math.imul(I,it)|0,r=r+Math.imul(I,st)|0,s=s+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,ot)|0)+Math.imul(k,rt)|0,r=r+Math.imul(k,ot)|0,s=s+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,lt)|0)+Math.imul(T,ht)|0,r=r+Math.imul(T,lt)|0,s=s+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(b,ct)|0,r=r+Math.imul(b,dt)|0;var kt=(l+(s=s+Math.imul(y,gt)|0)|0)+((8191&(n=(n=n+Math.imul(y,mt)|0)+Math.imul(A,gt)|0))<<13)|0;l=((r=r+Math.imul(A,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(B,J),n=(n=Math.imul(B,K))+Math.imul(O,J)|0,r=Math.imul(O,K),s=s+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(R,Q)|0,r=r+Math.imul(R,tt)|0,s=s+Math.imul(F,it)|0,n=(n=n+Math.imul(F,st)|0)+Math.imul(L,it)|0,r=r+Math.imul(L,st)|0,s=s+Math.imul(D,rt)|0,n=(n=n+Math.imul(D,ot)|0)+Math.imul(I,rt)|0,r=r+Math.imul(I,ot)|0,s=s+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(k,ht)|0,r=r+Math.imul(k,lt)|0,s=s+Math.imul(M,ct)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(T,ct)|0,r=r+Math.imul(T,dt)|0;var Ct=(l+(s=s+Math.imul(S,gt)|0)|0)+((8191&(n=(n=n+Math.imul(S,mt)|0)+Math.imul(b,gt)|0))<<13)|0;l=((r=r+Math.imul(b,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(B,Q),n=(n=Math.imul(B,tt))+Math.imul(O,Q)|0,r=Math.imul(O,tt),s=s+Math.imul(P,it)|0,n=(n=n+Math.imul(P,st)|0)+Math.imul(R,it)|0,r=r+Math.imul(R,st)|0,s=s+Math.imul(F,rt)|0,n=(n=n+Math.imul(F,ot)|0)+Math.imul(L,rt)|0,r=r+Math.imul(L,ot)|0,s=s+Math.imul(D,ht)|0,n=(n=n+Math.imul(D,lt)|0)+Math.imul(I,ht)|0,r=r+Math.imul(I,lt)|0,s=s+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(k,ct)|0,r=r+Math.imul(k,dt)|0;var Dt=(l+(s=s+Math.imul(M,gt)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(T,gt)|0))<<13)|0;l=((r=r+Math.imul(T,mt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,s=Math.imul(B,it),n=(n=Math.imul(B,st))+Math.imul(O,it)|0,r=Math.imul(O,st),s=s+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,ot)|0)+Math.imul(R,rt)|0,r=r+Math.imul(R,ot)|0,s=s+Math.imul(F,ht)|0,n=(n=n+Math.imul(F,lt)|0)+Math.imul(L,ht)|0,r=r+Math.imul(L,lt)|0,s=s+Math.imul(D,ct)|0,n=(n=n+Math.imul(D,dt)|0)+Math.imul(I,ct)|0,r=r+Math.imul(I,dt)|0;var It=(l+(s=s+Math.imul(E,gt)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(k,gt)|0))<<13)|0;l=((r=r+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(B,rt),n=(n=Math.imul(B,ot))+Math.imul(O,rt)|0,r=Math.imul(O,ot),s=s+Math.imul(P,ht)|0,n=(n=n+Math.imul(P,lt)|0)+Math.imul(R,ht)|0,r=r+Math.imul(R,lt)|0,s=s+Math.imul(F,ct)|0,n=(n=n+Math.imul(F,dt)|0)+Math.imul(L,ct)|0,r=r+Math.imul(L,dt)|0;var _t=(l+(s=s+Math.imul(D,gt)|0)|0)+((8191&(n=(n=n+Math.imul(D,mt)|0)+Math.imul(I,gt)|0))<<13)|0;l=((r=r+Math.imul(I,mt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,s=Math.imul(B,ht),n=(n=Math.imul(B,lt))+Math.imul(O,ht)|0,r=Math.imul(O,lt),s=s+Math.imul(P,ct)|0,n=(n=n+Math.imul(P,dt)|0)+Math.imul(R,ct)|0,r=r+Math.imul(R,dt)|0;var Ft=(l+(s=s+Math.imul(F,gt)|0)|0)+((8191&(n=(n=n+Math.imul(F,mt)|0)+Math.imul(L,gt)|0))<<13)|0;l=((r=r+Math.imul(L,mt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(B,ct),n=(n=Math.imul(B,dt))+Math.imul(O,ct)|0,r=Math.imul(O,dt);var Lt=(l+(s=s+Math.imul(P,gt)|0)|0)+((8191&(n=(n=n+Math.imul(P,mt)|0)+Math.imul(R,gt)|0))<<13)|0;l=((r=r+Math.imul(R,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var zt=(l+(s=Math.imul(B,gt))|0)+((8191&(n=(n=Math.imul(B,mt))+Math.imul(O,gt)|0))<<13)|0;return l=((r=Math.imul(O,mt))+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,h[0]=pt,h[1]=yt,h[2]=At,h[3]=xt,h[4]=St,h[5]=bt,h[6]=vt,h[7]=Mt,h[8]=Tt,h[9]=wt,h[10]=Et,h[11]=kt,h[12]=Ct,h[13]=Dt,h[14]=It,h[15]=_t,h[16]=Ft,h[17]=Lt,h[18]=zt,0!==l&&(h[19]=l,i.length++),i};function m(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var s=0,n=0,r=0;r>>26)|0)>>>26,o&=67108863}i.words[r]=a,s=o,o=n}return 0!==s?i.words[r]=s:i.length--,i.CH()}function p(t,e,i){return m(t,e,i)}Math.imul||(g=f),n.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):i<63?f(this,t,e):i<1024?m(this,t,e):p(this,t,e)},n.prototype.mul=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=new Array(this.length+t.length),p(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),i("number"==typeof t),i(t<67108864);for(var s=0,n=0;n>=26,s+=r/67108864|0,s+=o>>>26,this.words[n]=67108863&o}return 0!==s&&(this.words[n]=s,this.length++),e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>n&1}return e}(t);if(0===e.length)return new n(1);for(var i=this,s=0;s=0);var e,s=t%26,n=(t-s)/26,r=67108863>>>26-s<<26-s;if(0!==s){var o=0;for(e=0;e>>26-s}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var r=t%26,o=Math.min((t-r)/26,this.length),a=67108863^67108863>>>r<o)for(this.length-=o,l=0;l=0&&(0!==u||l>=n);l--){var c=0|this.words[l];this.words[l]=u<<26-r|c>>>r,u=c&a}return h&&0!==u&&(h.words[h.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.CH()},n.prototype.ishrn=function(t,e,s){return i(0===this.negative),this.iushrn(t,e,s)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,s=(t-e)/26,n=1<=0);var e=t%26,s=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==e&&s++,this.length=Math.min(s,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(h/67108864|0),this.words[n+s]=67108863&r}for(;n>26,this.words[n+s]=67108863&r;if(0===a)return this.CH();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&r;return this.negative=1,this.CH()},n.prototype.EH=function(t,e){var i=(this.length,t.length),s=this.clone(),r=t,o=0|r.words[r.length-1];0!=(i=26-this.BH(o))&&(r=r.ushln(i),s.iushln(i),o=0|r.words[r.length-1]);var a,h=s.length-r.length;if("mod"!==e){(a=new n(null)).length=h+1,a.words=new Array(a.length);for(var l=0;l=0;c--){var d=67108864*(0|s.words[r.length+c])+(0|s.words[r.length+c-1]);for(d=Math.min(d/o|0,67108863),s.RH(r,d,c);0!==s.negative;)d--,s.negative=0,s.RH(r,1,c),s.isZero()||(s.negative^=1);a&&(a.words[c]=d)}return a&&a.CH(),s.CH(),"div"!==e&&0!==i&&s.iushrn(i),{div:a||null,mod:s}},n.prototype.divmod=function(t,e,s){return i(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(r=a.div.neg()),"div"!==e&&(o=a.mod.neg(),s&&0!==o.negative&&o.iadd(t)),{div:r,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(r=a.div.neg()),{div:r,mod:a.mod}):this.negative&t.negative?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),s&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this.EH(t,e);var r,o,a},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,s=t.ushrn(1),n=t.andln(1),r=i.cmp(s);return r<0||1===n&&0===r?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=(1<<26)%t,n=0,r=this.length-1;r>=0;r--)n=(s*n+(0|this.words[r]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=0,n=this.length-1;n>=0;n--){var r=(0|this.words[n])+67108864*s;this.words[n]=r/t|0,s=r%t}return this.CH(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,s=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r=new n(1),o=new n(0),a=new n(0),h=new n(1),l=0;e.isEven()&&s.isEven();)e.iushrn(1),s.iushrn(1),++l;for(var u=s.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;!(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(r.isOdd()||o.isOdd())&&(r.iadd(u),o.isub(c)),r.iushrn(1),o.iushrn(1);for(var g=0,m=1;!(s.words[0]&m)&&g<26;++g,m<<=1);if(g>0)for(s.iushrn(g);g-- >0;)(a.isOdd()||h.isOdd())&&(a.iadd(u),h.isub(c)),a.iushrn(1),h.iushrn(1);e.cmp(s)>=0?(e.isub(s),r.isub(a),o.isub(h)):(s.isub(e),a.isub(r),h.isub(o))}return{a,b:h,gcd:s.iushln(l)}},n.prototype.VH=function(t){i(0===t.negative),i(!t.isZero());var e=this,s=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r,o=new n(1),a=new n(0),h=s.clone();e.cmpn(1)>0&&s.cmpn(1)>0;){for(var l=0,u=1;!(e.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var c=0,d=1;!(s.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(s.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(h),a.iushrn(1);e.cmp(s)>=0?(e.isub(s),o.isub(a)):(s.isub(e),a.isub(o))}return(r=0===e.cmpn(1)?o:a).cmpn(0)<0&&r.iadd(t),r},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var s=0;e.isEven()&&i.isEven();s++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var r=e;e=i,i=r}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(s)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,s=(t-e)/26,n=1<>>26,a&=67108863,this.words[o]=a}return 0!==r&&(this.words[o]=r,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,s=t<0;if(0!==this.negative&&!s)return-1;if(0===this.negative&&s)return 1;if(this.CH(),this.length>1)e=1;else{s&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;i--){var s=0|this.words[i],n=0|t.words[i];if(s!==n){sn&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.cmp(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.cmp(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new M(t)},n.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this).zH(t)},n.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype.zH=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.zH(t)},n.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.OH(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.OH(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.NH(this),this.red.sqr(this)},n.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.NH(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.NH(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.NH(this),this.red.invm(this)},n.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.NH(this),this.red.neg(this)},n.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.NH(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function A(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this.GH()}function x(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function v(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=n.WH(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r.VH(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}A.prototype.GH=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},A.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var s=e0?i.isub(this.p):void 0!==i.strip?i.strip():i.CH(),i},A.prototype.split=function(t,e){t.iushrn(this.n,0,e)},A.prototype.imulK=function(t){return t.imul(this.k)},s(x,A),x.prototype.split=function(t,e){for(var i=4194303,s=Math.min(t.length,9),n=0;n>>22,r=o}r>>>=22,t.words[n-10]=r,0===r&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=n,e=s}return 0!==e&&(t.words[t.length++]=e),t},n.WH=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new S;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new v}return y[t]=e,e},M.prototype.NH=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype.OH=function(t,e){i(!(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t).zH(this):(h(t,t.umod(this.m).zH(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).zH(this)},M.prototype.add=function(t,e){this.OH(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.zH(this)},M.prototype.iadd=function(t,e){this.OH(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function(t,e){this.OH(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.zH(this)},M.prototype.isub=function(t,e){this.OH(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function(t,e){return this.NH(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this.OH(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this.OH(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var s=this.m.add(new n(1)).iushrn(2);return this.pow(t,s)}for(var r=this.m.subn(1),o=0;!r.isZero()&&0===r.andln(1);)o++,r.iushrn(1);i(!r.isZero());var a=new n(1).toRed(this),h=a.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,l).cmp(h);)u.redIAdd(h);for(var c=this.pow(u,r),d=this.pow(t,r.addn(1).iushrn(1)),f=this.pow(t,r),g=o;0!==f.cmp(a);){for(var m=f,p=0;0!==m.cmp(a);p++)m=m.redSqr();i(p=0;s--){for(var l=e.words[s],u=h-1;u>=0;u--){var c=l>>u&1;r!==i[0]&&(r=this.sqr(r)),0!==c||0!==o?(o<<=1,o|=c,(4==++a||0===s&&0===u)&&(r=this.mul(r,i[o]),a=0,o=0)):a=0}h=26}return r},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new T(t)},s(T,M),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(s).iushrn(this.shift),r=n;return n.cmp(this.m)>=0?r=n.isub(this.m):n.cmpn(0)<0&&(r=n.iadd(this.m)),r.zH(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0).zH(this);var i=t.mul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(s).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o.zH(this)},T.prototype.invm=function(t){return this.imod(t.VH(this.m).mul(this.r2)).zH(this)}}(0,hy);var uy=ly.exports;function cy(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];const i=[];if("string"!=typeof t){for(let e=0;e>8,r=255&s;n?i.push(n,r):i.push(r)}return i}const dy=function(t,e,i){const s=new Array(Math.max(t.bitLength(),i)+1);s.fill(0);const n=1<(n>>1)-1?(n>>1)-i:i,r.isubn(e)):e=0,s[t]=e,r.iushrn(1)}return s},fy=function(t,e){const i=[[],[]];t=t.clone(),e=e.clone();let s=0,n=0;for(;t.cmpn(-s)>0||e.cmpn(-n)>0;){let r,o,a=t.andln(3)+s&3,h=e.andln(3)+n&3;if(3===a&&(a=-1),3===h&&(h=-1),1&a){const e=t.andln(7)+s&7;r=3!==e&&5!==e||2!==h?a:-a}else r=0;if(i[0].push(r),1&h){const t=e.andln(7)+n&7;o=3!==t&&5!==t||2!==a?h:-h}else o=0;i[1].push(o),2*s===r+1&&(s=1-s),2*n===o+1&&(n=1-n),t.iushrn(1),e.iushrn(1)}return i};class gy{constructor(t,e){this.type=t,this.p=new uy(e.p,16),this.red=e.prime?uy.red(e.prime):uy.mont(this.p),this.zero=new uy(0).toRed(this.red),this.one=new uy(1).toRed(this.red),this.two=new uy(2).toRed(this.red),this.n=e.n&&new uy(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.UH=new Array(4),this.YH=new Array(4),this.HH=new Array(4),this.$H=new Array(4),this.XH=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.jH=!0,this.redN=this.n.toRed(this.red))}ZH(t,e){const i=t.QH(),s=dy(e,1,this.XH);let n=(1<=t;n--)e=(e<<1)+s[n];r.push(e)}let o=this.jpoint(null,null,null),a=this.jpoint(null,null,null);for(let t=n;t>0;t--){for(let e=0;e=0;i--){for(let t=0;i>=0&&0===r[i];i--)t++;if(i>=0&&e++,o=o.dblp(e),i<0)break;const s=r[i];o="affine"===t.type?s>0?o.mixedAdd(n[s-1>>1]):o.mixedAdd(n[-s-1>>1].neg()):s>0?o.add(n[s-1>>1]):o.add(n[-s-1>>1].neg())}return"affine"===t.type?o.toP():o}qH(t,e,i,s,n){const r=this.UH,o=this.YH,a=this.HH;let h=0;for(let i=0;i=1;t-=2){const s=t-1,n=t;if(1!==r[s]||1!==r[n]){a[s]=dy(i[s],r[s],this.XH),a[n]=dy(i[n],r[n],this.XH),h=Math.max(a[s].length,h),h=Math.max(a[n].length,h);continue}const l=[e[s],null,null,e[n]];0===e[s].y.cmp(e[n].y)?(l[1]=e[s].add(e[n]),l[2]=e[s].toJ().mixedAdd(e[n].neg())):0===e[s].y.cmp(e[n].y.redNeg())?(l[1]=e[s].toJ().mixedAdd(e[n]),l[2]=e[s].add(e[n].neg())):(l[1]=e[s].toJ().mixedAdd(e[n]),l[2]=e[s].toJ().mixedAdd(e[n].neg()));const u=[-3,-1,-5,-7,0,7,5,1,3],c=fy(i[s],i[n]);h=Math.max(c[0].length,h),a[s]=new Array(h),a[n]=new Array(h);for(let t=0;t=0;t--){let e=0;for(;t>=0;){let i=!0;for(let e=0;e=0&&e++,l=l.dblp(e),t<0)break;for(let t=0;t0?i=o[t][e-1>>1]:e<0&&(i=o[t][-e-1>>1].neg()),l="affine"===i.type?l.mixedAdd(i):l.add(i))}}for(let t=0;t=Math.ceil((t.bitLength()+1)/e.step)}QH(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;const i=[this];let s=this;for(let n=0;n({a:new uy(t.a,16),b:new uy(t.b,16)}))):this.o$(i),{beta:e,lambda:i,basis:s}}n$(t){const e=t===this.p?this.red:uy.mont(t),i=new uy(2).toRed(e).redInvm(),s=i.redNeg(),n=new uy(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(n).fromRed(),s.redSub(n).fromRed()]}o$(t){const e=this.n.ushrn(Math.floor(this.n.bitLength()/2));let i,s,n,r,o,a,h,l,u,c=t,d=this.n.clone(),f=new uy(1),g=new uy(0),m=new uy(0),p=new uy(1),y=0;for(;0!==c.cmpn(0);){const t=d.div(c);l=d.sub(t.mul(c)),u=m.sub(t.mul(f));const o=p.sub(t.mul(g));if(!n&&l.cmp(e)<0)i=h.neg(),s=f,n=l.neg(),r=u;else if(n&&2==++y)break;h=l,d=c,c=l,m=f,f=u,p=g,g=o}o=l.neg(),a=u;const A=n.sqr().add(r.sqr());return o.sqr().add(a.sqr()).cmp(A)>=0&&(o=i,a=s),n.negative&&(n=n.neg(),r=r.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:r},{a:o,b:a}]}a$(t){const e=this.endo.basis,i=e[0],s=e[1],n=s.b.mul(t).divRound(this.n),r=i.b.neg().mul(t).divRound(this.n),o=n.mul(i.a),a=r.mul(s.a),h=n.mul(i.b),l=r.mul(s.b);return{k1:t.sub(o).sub(a),k2:h.add(l).neg()}}point(t,e,i){return new yy(this,t,e,i)}pointFromX(t,e){(t=new uy(t,16)).red||(t=t.toRed(this.red));const i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b);let s=i.redSqrt();if(0!==s.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");const n=s.fromRed().isOdd();return(e&&!n||!e&&n)&&(s=s.redNeg()),this.point(t,s)}validate(t){if(t.inf)return!0;const e=t.x,i=t.y,s=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(s).redIAdd(this.b);return 0===i.redSqr().redISub(n).cmpn(0)}l$(t,e,i){const s=this.h$,n=this.r$;let r=0;for(r=0;r":``}isInfinity(){return this.inf}add(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);let e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));const i=e.redSqr().redISub(this.x).redISub(t.x),s=e.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)}dbl(){if(this.inf)return this;const t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);const e=this.curve.a,i=this.x.redSqr(),s=t.redInvm(),n=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(s),r=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,o)}getX(){return this.x.fromRed()}getY(){return this.y.fromRed()}mul(t){return t=new uy(t,16),this.isInfinity()?this:this.s$(t)?this.curve.ZH(this,t):this.curve.endo?this.curve.l$([this],[t]):this.curve.JH(this,t)}mulAdd(t,e,i){const s=[this,e],n=[t,i];return this.curve.endo?this.curve.l$(s,n):this.curve.qH(1,s,n,2)}jmulAdd(t,e,i){const s=[this,e],n=[t,i];return this.curve.endo?this.curve.l$(s,n,!0):this.curve.qH(1,s,n,2,!0)}eq(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))}neg(t){if(this.inf)return this;const e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){const t=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}toJ(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)}}class Ay extends my{constructor(t,e,i,s){super(t,"jacobian"),null===e&&null===i&&null===s?(this.x=this.curve.one,this.y=this.curve.one,this.z=new uy(0)):(this.x=new uy(e,16),this.y=new uy(i,16),this.z=new uy(s,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}getY(){throw new Error("Method not implemented.")}getX(){throw new Error("Method not implemented.")}pointFromX(t,e){throw new Error("Method not implemented.")}point(t,e,i){throw new Error("Method not implemented.")}jpoint(t,e,i){return new Ay(this,t,e,i)}toP(){if(this.isInfinity())return this.curve.point(null,null);const t=this.z.redInvm(),e=t.redSqr(),i=this.x.redMul(e),s=this.y.redMul(e).redMul(t);return this.curve.point(i,s)}neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;const e=t.z.redSqr(),i=this.z.redSqr(),s=this.x.redMul(e),n=t.x.redMul(i),r=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(i.redMul(this.z)),a=s.redSub(n),h=r.redSub(o);if(0===a.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const l=a.redSqr(),u=l.redMul(a),c=s.redMul(l),d=h.redSqr().redIAdd(u).redISub(c).redISub(c),f=h.redMul(c.redISub(d)).redISub(r.redMul(u)),g=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,f,g)}mixedAdd(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;const e=this.z.redSqr(),i=this.x,s=t.x.redMul(e),n=this.y,r=t.y.redMul(e).redMul(this.z),o=i.redSub(s),a=n.redSub(r);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const h=o.redSqr(),l=h.redMul(o),u=i.redMul(h),c=a.redSqr().redIAdd(l).redISub(u).redISub(u),d=a.redMul(u.redISub(c)).redISub(n.redMul(l)),f=this.z.redMul(o);return this.curve.jpoint(c,d,f)}dblp(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){let e=this;for(let i=0;i=0)return!1;if(i.redIAdd(n),0===this.x.cmp(i))return!0}}inspect(){return this.isInfinity()?"":``}isInfinity(){return 0===this.z.cmpn(0)}}class xy{constructor(t){this.curve=new py(t),this.g=this.curve.g,this.n=this.curve.n}}const Sy={};var by;Sy.PresetCurve=xy,by={type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",{doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}]},Object.defineProperty(Sy,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new xy(by);return Object.defineProperty(Sy,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class vy{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.f$(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof vy?e:new vy(t,{pub:e,pubEnc:i})}validate(){const t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}}getPublic(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub}f$(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type||"short"===this.ec.curve.type||this.ec.curve.type,void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)}verify(t,e){return this.ec.verify(t,e,this)}}function My(t,e){const i=t[e.place++];if(!(128&i))return i;const s=15&i;if(0===s||s>4)return!1;let n=0,r=e.place;for(let e=0;e>>=0;return!(n<=127)&&(e.place=r,n)}class Ty{constructor(){this.place=0}}class wy{constructor(t,e){if(t instanceof wy)return t;this.A$(t,e)||(this.r=new uy(t.r,16),this.s=new uy(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}A$(t,e){t=cy(t,e);const i=new Ty;if(48!==t[i.place++])return!1;const s=My(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const n=My(t,i);if(!1===n)return!1;let r=t.slice(i.place,n+i.place);if(i.place+=n,2!==t[i.place++])return!1;const o=My(t,i);if(!1===o)return!1;if(t.length!==o+i.place)return!1;let a=t.slice(i.place,o+i.place);if(0===r[0]){if(!(128&r[1]))return!1;r=r.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new uy(r),this.s=new uy(a),this.recoveryParam=null,!0}}class Ey{constructor(t){if(!(this instanceof Ey))return new Ey(t);"string"==typeof t&&(t=Sy[t]),t instanceof Sy.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1)}keyFromPublic(t,e){return vy.fromPublic(this,t,e)}g$(t,e){const i=8*t.byteLength()-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t}verify(t,e,i,s){t=this.g$(new uy(t,16)),i=this.keyFromPublic(i,s);const n=(e=new wy(e,"hex")).r,r=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;const o=r.invm(this.n),a=o.mul(t).umod(this.n),h=o.mul(n).umod(this.n);if(!this.curve.jH){const t=this.g.mulAdd(a,i.getPublic(),h);return!t.isInfinity()&&0===t.getX().umod(this.n).cmp(n)}const l=this.g.jmulAdd(a,i.getPublic(),h);return!l.isInfinity()&&l.eqXToP(n)}}var ky,Cy={exports:{}};Cy.exports=(ky=ky||function(t,e){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==hy&&hy.crypto&&(i=hy.crypto),!i)try{i=e}catch(t){}var s=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function t(){}return function(e){var i;return t.prototype=e,i=new t,t.prototype=null,i}}(),r={},o=r.lib={},a=o.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},h=o.WordArray=a.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,i=t.words,s=this.sigBytes,n=t.sigBytes;if(this.clamp(),s%4)for(var r=0;r>>2]>>>24-r%4*8&255;e[s+r>>>2]|=o<<24-(s+r)%4*8}else for(var a=0;a>>2]=i[a>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i>>2]>>>24-n%4*8&255;s.push((r>>>4).toString(16)),s.push((15&r).toString(16))}return s.join("")},parse:function(t){for(var e=t.length,i=[],s=0;s>>3]|=parseInt(t.substr(s,2),16)<<24-s%8*4;return new h.init(i,e/2)}},c=l.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,s=[],n=0;n>>2]>>>24-n%4*8&255;s.push(String.fromCharCode(r))}return s.join("")},parse:function(t){for(var e=t.length,i=[],s=0;s>>2]|=(255&t.charCodeAt(s))<<24-s%4*8;return new h.init(i,e)}},d=l.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},f=o.BufferedBlockAlgorithm=a.extend({reset:function(){this.mk=new h.init,this.p$=0},m$:function(t){"string"==typeof t&&(t=d.parse(t)),this.mk.concat(t),this.p$+=t.sigBytes},y$:function(e){var i,s=this.mk,n=s.words,r=s.sigBytes,o=this.blockSize,a=r/(4*o),l=(a=e?t.ceil(a):t.max((0|a)-this.S$,0))*o,u=t.min(4*l,r);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,p=l[f-2],y=(p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10;l[f]=m+l[f-7]+y+l[f-16]}var A=s&n^s&r^n&r,x=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),S=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&u^~a&c)+h[f]+l[f];d=c,c=u,u=a,a=o+S|0,o=r,r=n,n=s,s=S+(x+A)|0}i[0]=i[0]+s|0,i[1]=i[1]+n|0,i[2]=i[2]+r|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0,i[5]=i[5]+u|0,i[6]=i[6]+c|0,i[7]=i[7]+d|0},b$:function(){var t=this.mk,i=t.words,s=8*this.p$,n=8*t.sigBytes;return i[n>>>5]|=128<<24-n%32,i[14+(n+64>>>9<<4)]=e.floor(s/4294967296),i[15+(n+64>>>9<<4)]=s,t.sigBytes=4*i.length,this.y$(),this.w$},clone:function(){var t=r.clone.call(this);return t.w$=this.w$.clone(),t}});i.SHA256=r.M$(u),i.HmacSHA256=r._$(u)}(Math),t.SHA256}(Cy.exports),Ly={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,n=s.SHA256,r=s.SHA224=n.extend({x$:function(){this.w$=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},b$:function(){var t=n.b$.call(this);return t.sigBytes-=4,t}}),e.SHA224=n.M$(r),e.HmacSHA224=n._$(r),t.SHA224;var e,i,s,n,r}(Cy.exports),zy={exports:{}}.exports=Cy.exports.enc.Hex,Py={exports:{}}.exports=Cy.exports.enc.Utf8;!function(t){return i=(e=t).lib.WordArray,e.enc.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,s=this.C$;t.clamp();for(var n=[],r=0;r>>2]>>>24-r%4*8&255)<<16|(e[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|e[r+2>>>2]>>>24-(r+2)%4*8&255,a=0;a<4&&r+.75*a>>6*(3-a)&63));var h=s.charAt(64);if(h)for(;n.length%4;)n.push(h);return n.join("")},parse:function(t){var e=t.length,s=this.C$,n=this.k$;if(!n){n=this.k$=[];for(var r=0;r>>6-o%4*2;n[r>>>2]|=a<<24-r%4*8,r++}return i.create(n,r)}(t,e,n)},C$:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(Cy.exports),function(t){(function(e){var i=t,s=i.lib,n=s.WordArray,r=s.Hasher,o=i.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var h=o.MD5=r.extend({x$:function(){this.w$=new n.init([1732584193,4023233417,2562383102,271733878])},v$:function(t,e){for(var i=0;i<16;i++){var s=e+i,n=t[s];t[s]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var r=this.w$.words,o=t[e+0],h=t[e+1],f=t[e+2],g=t[e+3],m=t[e+4],p=t[e+5],y=t[e+6],A=t[e+7],x=t[e+8],S=t[e+9],b=t[e+10],v=t[e+11],M=t[e+12],T=t[e+13],w=t[e+14],E=t[e+15],k=r[0],C=r[1],D=r[2],I=r[3];k=l(k,C,D,I,o,7,a[0]),I=l(I,k,C,D,h,12,a[1]),D=l(D,I,k,C,f,17,a[2]),C=l(C,D,I,k,g,22,a[3]),k=l(k,C,D,I,m,7,a[4]),I=l(I,k,C,D,p,12,a[5]),D=l(D,I,k,C,y,17,a[6]),C=l(C,D,I,k,A,22,a[7]),k=l(k,C,D,I,x,7,a[8]),I=l(I,k,C,D,S,12,a[9]),D=l(D,I,k,C,b,17,a[10]),C=l(C,D,I,k,v,22,a[11]),k=l(k,C,D,I,M,7,a[12]),I=l(I,k,C,D,T,12,a[13]),D=l(D,I,k,C,w,17,a[14]),k=u(k,C=l(C,D,I,k,E,22,a[15]),D,I,h,5,a[16]),I=u(I,k,C,D,y,9,a[17]),D=u(D,I,k,C,v,14,a[18]),C=u(C,D,I,k,o,20,a[19]),k=u(k,C,D,I,p,5,a[20]),I=u(I,k,C,D,b,9,a[21]),D=u(D,I,k,C,E,14,a[22]),C=u(C,D,I,k,m,20,a[23]),k=u(k,C,D,I,S,5,a[24]),I=u(I,k,C,D,w,9,a[25]),D=u(D,I,k,C,g,14,a[26]),C=u(C,D,I,k,x,20,a[27]),k=u(k,C,D,I,T,5,a[28]),I=u(I,k,C,D,f,9,a[29]),D=u(D,I,k,C,A,14,a[30]),k=c(k,C=u(C,D,I,k,M,20,a[31]),D,I,p,4,a[32]),I=c(I,k,C,D,x,11,a[33]),D=c(D,I,k,C,v,16,a[34]),C=c(C,D,I,k,w,23,a[35]),k=c(k,C,D,I,h,4,a[36]),I=c(I,k,C,D,m,11,a[37]),D=c(D,I,k,C,A,16,a[38]),C=c(C,D,I,k,b,23,a[39]),k=c(k,C,D,I,T,4,a[40]),I=c(I,k,C,D,o,11,a[41]),D=c(D,I,k,C,g,16,a[42]),C=c(C,D,I,k,y,23,a[43]),k=c(k,C,D,I,S,4,a[44]),I=c(I,k,C,D,M,11,a[45]),D=c(D,I,k,C,E,16,a[46]),k=d(k,C=c(C,D,I,k,f,23,a[47]),D,I,o,6,a[48]),I=d(I,k,C,D,A,10,a[49]),D=d(D,I,k,C,w,15,a[50]),C=d(C,D,I,k,p,21,a[51]),k=d(k,C,D,I,M,6,a[52]),I=d(I,k,C,D,g,10,a[53]),D=d(D,I,k,C,b,15,a[54]),C=d(C,D,I,k,h,21,a[55]),k=d(k,C,D,I,x,6,a[56]),I=d(I,k,C,D,E,10,a[57]),D=d(D,I,k,C,y,15,a[58]),C=d(C,D,I,k,T,21,a[59]),k=d(k,C,D,I,m,6,a[60]),I=d(I,k,C,D,v,10,a[61]),D=d(D,I,k,C,f,15,a[62]),C=d(C,D,I,k,S,21,a[63]),r[0]=r[0]+k|0,r[1]=r[1]+C|0,r[2]=r[2]+D|0,r[3]=r[3]+I|0},b$:function(){var t=this.mk,i=t.words,s=8*this.p$,n=8*t.sigBytes;i[n>>>5]|=128<<24-n%32;var r=e.floor(s/4294967296),o=s;i[15+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),i[14+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(i.length+1),this.y$();for(var a=this.w$,h=a.words,l=0;l<4;l++){var u=h[l];h[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var t=r.clone.call(this);return t.w$=this.w$.clone(),t}});function l(t,e,i,s,n,r,o){var a=t+(e&i|~e&s)+n+o;return(a<>>32-r)+e}function u(t,e,i,s,n,r,o){var a=t+(e&s|i&~s)+n+o;return(a<>>32-r)+e}function c(t,e,i,s,n,r,o){var a=t+(e^i^s)+n+o;return(a<>>32-r)+e}function d(t,e,i,s,n,r,o){var a=t+(i^(e|~s))+n+o;return(a<>>32-r)+e}i.MD5=r.M$(h),i.HmacMD5=r._$(h)})(Math),t.MD5}(Cy.exports),function(t){return i=(e=t).lib,s=i.WordArray,n=i.Hasher,r=e.algo,o=[],a=r.SHA1=n.extend({x$:function(){this.w$=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},v$:function(t,e){for(var i=this.w$.words,s=i[0],n=i[1],r=i[2],a=i[3],h=i[4],l=0;l<80;l++){if(l<16)o[l]=0|t[e+l];else{var u=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=u<<1|u>>>31}var c=(s<<5|s>>>27)+h+o[l];c+=l<20?1518500249+(n&r|~n&a):l<40?1859775393+(n^r^a):l<60?(n&r|n&a|r&a)-1894007588:(n^r^a)-899497514,h=a,a=r,r=n<<30|n>>>2,n=s,s=c}i[0]=i[0]+s|0,i[1]=i[1]+n|0,i[2]=i[2]+r|0,i[3]=i[3]+a|0,i[4]=i[4]+h|0},b$:function(){var t=this.mk,e=t.words,i=8*this.p$,s=8*t.sigBytes;return e[s>>>5]|=128<<24-s%32,e[14+(s+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(s+64>>>9<<4)]=i,t.sigBytes=4*e.length,this.y$(),this.w$},clone:function(){var t=n.clone.call(this);return t.w$=this.w$.clone(),t}}),e.SHA1=n.M$(a),e.HmacSHA1=n._$(a),t.SHA1;var e,i,s,n,r,o,a}(Cy.exports),Iy=(Dy=Cy.exports).lib.Base,_y=Dy.enc.Utf8,Dy.algo.HMAC=Iy.extend({init:function(t,e){t=this.T$=new t.init,"string"==typeof e&&(e=_y.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var n=this.F$=e.clone(),r=this.I$=e.clone(),o=n.words,a=r.words,h=0;h>>2];t.sigBytes-=e}};s.BlockCipher=u.extend({cfg:u.cfg.extend({mode:f,padding:g}),reset:function(){var t;u.reset.call(this);var e=this.cfg,i=e.iv,s=e.mode;this.B$==this.P$?t=s.createEncryptor:(t=s.createDecryptor,this.S$=1),this.z$&&this.z$.O$==t?this.z$.init(this,i&&i.words):(this.z$=t.call(s,this,i&&i.words),this.z$.O$=t)},v$:function(t,e){this.z$.processBlock(t,e)},b$:function(){var t,e=this.cfg.padding;return this.B$==this.P$?(e.pad(this.mk,this.blockSize),t=this.y$(!0)):(t=this.y$(!0),e.unpad(t)),t},blockSize:4});var m=s.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),p=(i.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return(i?r.create([1398893684,1701076831]).concat(i).concat(e):e).toString(h)},parse:function(t){var e,i=h.parse(t),s=i.words;return 1398893684==s[0]&&1701076831==s[1]&&(e=r.create(s.slice(2,4)),s.splice(0,4),i.sigBytes-=16),m.create({ciphertext:i,salt:e})}},y=s.SerializableCipher=n.extend({cfg:n.extend({format:p}),encrypt:function(t,e,i,s){s=this.cfg.extend(s);var n=t.createEncryptor(i,s),r=n.finalize(e),o=n.cfg;return m.create({ciphertext:r,key:i,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:s.format})},decrypt:function(t,e,i,s){return s=this.cfg.extend(s),e=this.N$(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},N$:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),A=(i.kdf={}).OpenSSL={execute:function(t,e,i,s){s||(s=r.random(8));var n=l.create({keySize:e+i}).compute(t,s),o=r.create(n.words.slice(e),4*i);return n.sigBytes=4*e,m.create({key:n,iv:o,salt:s})}},x=s.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:A}),encrypt:function(t,e,i,s){var n=(s=this.cfg.extend(s)).kdf.execute(i,t.keySize,t.ivSize);s.iv=n.iv;var r=y.encrypt.call(this,t,e,n.key,s);return r.mixIn(n),r},decrypt:function(t,e,i,s){s=this.cfg.extend(s),e=this.N$(e,s.format);var n=s.kdf.execute(i,t.keySize,t.ivSize,e.salt);return s.iv=n.iv,y.decrypt.call(this,t,e,n.key,s)}})}()}(Cy.exports);var Ry={exports:{}}.exports=function(t){return function(){var e=t,i=e.lib.BlockCipher,s=e.algo,n=[],r=[],o=[],a=[],h=[],l=[],u=[],c=[],d=[],f=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,s=0;for(e=0;e<256;e++){var g=s^s<<1^s<<2^s<<3^s<<4;g=g>>>8^255&g^99,n[i]=g,r[g]=i;var m=t[i],p=t[m],y=t[p],A=257*t[g]^16843008*g;o[i]=A<<24|A>>>8,a[i]=A<<16|A>>>16,h[i]=A<<8|A>>>24,l[i]=A,A=16843009*y^65537*p^257*m^16843008*i,u[g]=A<<24|A>>>8,c[g]=A<<16|A>>>16,d[g]=A<<8|A>>>24,f[g]=A,i?(i=m^t[t[t[y^m]]],s^=t[t[s]]):i=s=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],m=s.AES=i.extend({x$:function(){if(!this.G$||this.W$!==this.L$){for(var t=this.W$=this.L$,e=t.words,i=t.sigBytes/4,s=4*((this.G$=i+6)+1),r=this.U$=[],o=0;o6&&o%i==4&&(l=n[l>>>24]<<24|n[l>>>16&255]<<16|n[l>>>8&255]<<8|n[255&l]):(l=n[(l=l<<8|l>>>24)>>>24]<<24|n[l>>>16&255]<<16|n[l>>>8&255]<<8|n[255&l],l^=g[o/i|0]<<24),r[o]=r[o-i]^l);for(var a=this.Y$=[],h=0;h>>24]]^c[n[l>>>16&255]]^d[n[l>>>8&255]]^f[n[255&l]]}}},encryptBlock:function(t,e){this.H$(t,e,this.U$,o,a,h,l,n)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this.H$(t,e,this.Y$,u,c,d,f,r),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},H$:function(t,e,i,s,n,r,o,a){for(var h=this.G$,l=t[e]^i[0],u=t[e+1]^i[1],c=t[e+2]^i[2],d=t[e+3]^i[3],f=4,g=1;g>>24]^n[u>>>16&255]^r[c>>>8&255]^o[255&d]^i[f++],p=s[u>>>24]^n[c>>>16&255]^r[d>>>8&255]^o[255&l]^i[f++],y=s[c>>>24]^n[d>>>16&255]^r[l>>>8&255]^o[255&u]^i[f++],A=s[d>>>24]^n[l>>>16&255]^r[u>>>8&255]^o[255&c]^i[f++];l=m,u=p,c=y,d=A}m=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[c>>>8&255]<<8|a[255&d])^i[f++],p=(a[u>>>24]<<24|a[c>>>16&255]<<16|a[d>>>8&255]<<8|a[255&l])^i[f++],y=(a[c>>>24]<<24|a[d>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^i[f++],A=(a[d>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&c])^i[f++],t[e]=m,t[e+1]=p,t[e+2]=y,t[e+3]=A},keySize:8});e.AES=i.M$(m)}(),t.AES}(Cy.exports),Vy={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.R$,s=i.blockSize,n=this.E$,r=this.$$;n&&(r=this.$$=n.slice(0),this.E$=void 0);var o=r.slice(0);i.encryptBlock(o,0),r[s-1]=r[s-1]+1|0;for(var a=0;a>>2]|=t[n]<<24-n%4*8;i.call(this,s,e)}else i.apply(this,arguments)};s.prototype=e}}(),t.lib.WordArray}(Cy.exports),Oy={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(Cy.exports);const Ny={"-4":["MDQxMmQ1MWU5MjFhYTMzODUwMWE4ZGYzN2ViZTE4NTU3ZDViYmRlZDg1Yzk0OGI3YTJkMDBmZTNhZGVlMjdjY2VmNzBiMWVlOWI3MDZjMTIwYTAzZDZlZTNkNmYyOTc5Y2E2NGEzN2Y3YjY4N2E1ZjljZWY2ODYxN2I1NWU5ZmJjMA=="],"-3":["MjAxODAxMjA="],"-2":["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2Vzc2lvbg==","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzL2RvY3MvdHJvdWJsZXNob290aW5nL3Jlc3RyaWN0ZWQtZmVhdHVyZXMv","aHR0cHM6Ly9saWdodG5pbmdjaGFydC5jb20vanMtY2hhcnRzLw=="],"-1":["WE1MSHR0cFJlcXVlc3Q=","ZG9jdW1lbnQ=","ZGVmYXVsdFZpZXc=","YQ==","Yg==","bGljZW5zZV9leHBpcmF0aW9uX2RhdGU=","bG9jYXRpb24=","aG9zdG5hbWU=","dGVzdF9kb21haW4=","ZG9tYWlucw==","Y3J5cHRv","U2lnbmF0dXJl","RUNEU0E=","U0hBMjI0d2l0aEVDRFNB","YWxn","Y3VydmU=","c2VjcDI1Nmsx","YWRkRXZlbnRMaXN0ZW5lcg==","cmVtb3ZlRXZlbnRMaXN0ZW5lcg==","bG9hZGVuZA==","ZXJyb3I=","YWJvcnQ=","dGltZW91dA==","cmVzcG9uc2VUZXh0","Q29udGVudC1UeXBl","YXBwbGljYXRpb24vanNvbg==","TWVzc2FnZURpZ2VzdA==","c2hhMjU2","Y3J5cHRvanM=","dXBkYXRlU3RyaW5n","ZGlnZXN0","Y29tcGFueQ==","YXBwVGl0bGU=","bGNqcy1zZXNzaW9u","bG9jYWxTdG9yYWdl","Z2V0SXRlbQ==","c2V0SXRlbQ==","ZA==","dA==","bGNqcy1zZXNzaW9uLTI="],0:["TGljZW5zZQ==","IA==","a2V5","aGFz","ZXhwaXJlZA==","Lg==","dmVyc2lvbg==","aXM=","dG9v","bmV3","b2xk","b3I=","aW52YWxpZA==","MDAwMQ==","SW52YWxpZA==","bnVtYmVy","b2Y=","ZG9tYWlucw==","ZGVwbG95bWVudA==","aW4=","ZG9tYWlu","RGVwbG95bWVudA==","ZG9tYWlu","dmFsaWRhdGlvbg==","ZmFpbGVk","Og==","UE9TVA==","c2VydmVy","cmVzcG9uZGVk","d2l0aA==","dW5leHBlY3RlZA==","dmFsdWU=","cmVxdWVzdA==","VEVTVA==","REVQTE9ZTUVOVA==","S2V5","VGFtcGVyaW5n","YmVlbg==","ZGV0ZWN0ZWQ=","TWlzc2luZw==","TGljZW5zZQ==","aW5mb3JtYXRpb24=","ZG9lcw==","bm90","aW5jbHVkZQ==","cGVybWlzc2lvbg==","dG8=","dXNl","Q2hhcnQ=","M0Q=","WFk=","RGF0YUdyaWQ=","TWFw","UG9sYXI=","RnVubmVs","R2F1Z2U=","UGll","UHlyYW1pZA==","U3BpZGVy","Zm9y","dGhpcw==","VHJhZGluZw==","ZmVhdHVyZXM=","Y2xpY2s=","aGVyZQ==","bW9yZQ==","c3VwcGxpZWQ=","Z2V0","bGljZW5zZQ=="],1:["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2FuZGJveA=="]},Uy=St,Gy=(...t)=>t.slice(1).reduce(((e,i)=>e+Uy.atob(Ny[t[0]][i].toString())),"");let Wy,Yy,Hy,Xy=new Uint8Array([]);class jy{set e(t){Wy=t}get e(){Yy={Vn:!1,zn:!1,On:!1,Nn:!1,Gn:!1,Wn:!1,Un:!1,Yn:!1,Hn:!1,$n:!1,Xn:!1,jn:!1,Zn:!1,Qn:!1,Jn:!1,Kn:!1,qn:!1,io:!1,so:!1,eo:!1,ho:!1,ro:!1};const t=Xy.length,e=t>=1?Xy[0]:void 0,i=t>=2?Xy[1]:void 0,s=t>=3?Xy[2]:void 0;return void 0!==e&&(Yy.Vn=!!(1&e),Yy.zn=!!(2&e),Yy.On=!!(4&e),Yy.Nn=!!(8&e),Yy.Gn=!!(16&e),Yy.Wn=!!(32&e),Yy.Un=!!(64&e),Yy.Yn=!!(128&e)),void 0!==i&&(Yy.Hn=!!(1&i),Yy.$n=!!(2&i),Yy.Xn=!!(4&i),Yy.jn=!!(8&i),Yy.Zn=!!(16&i),Yy.Qn=!!(32&i),Yy.Jn=!!(64&i),Yy.Kn=!!(128&i)),void 0!==s&&(Yy.qn=!!(1&s),Yy.io=!!(2&s),Yy.so=!!(4&s),Yy.eo=!!(8&s),Yy.ho=!!(16&s),Yy.ro=!!(32&s)),Yy.Wn}set l(t){Hy=t}get l(){return Hy}}let $y=!1;const qy=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},Jy=t=>{if(4===t.byteLength)return`${t[0].toString().padStart(2,"0")}${t[1].toString().padStart(2,"0")}${t[2].toString().padStart(2,"0")}${t[3].toString().padStart(2,"0")}`},Ky=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),Zy=t=>{const e={},i=t.split("-");if(3!==i.length)return{X$:Gy(0,0,1,7,1,12,5)};let s=0;const n=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(0)));s+=1;const r=n.subarray(s,s+=20),o=new DataView(n.buffer).getUint16(s,!0);s+=2;const a=Uint8Array.from(Array(o));for(let t=0;tt+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");return eA(d,f)?e:{X$:Gy(0,0,1,7,1,12,5)}},Qy=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(qy(i,2)),e=t.slice(36,40),s=new Uint8Array(4),n=(t=>{let e;const i=[];for(let t=0;t<256;t+=1){e=t;for(let t=0;t<8;t+=1)e=1&e?3988292384^e>>>1:e>>>1;i[t]=e}let s=-1;for(let e=0;e>>8^i[255&(s^t[e])];return~s>>>0})(t.slice(0,36));new DataView(s.buffer).setUint32(0,n,!0);const r=t.slice(28,34);let o=0;for(let t=r.length-1;t>0;t-=1)o+=r[t]*2**(8*t);const a=new Date(o);if(Ky(a)s[e]===t)))return{};break}case"0002":return Zy(t);default:return{X$:Gy(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}return{X$:Gy(0,0,1,2,1,7,1,12,5)}},tA=t=>{if(!t)return{X$:Gy(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5)};const e=(t[Gy(-1,9)]||t[Gy(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(Uy[Gy(-1,6)][Gy(-1,7)])>-1)return{J$:!0};const i=e.filter((t=>t.indexOf("*")>-1));if(oA(Uy[Gy(-1,6)][Gy(-1,7)],i))return{J$:!0};const s=t[Gy(-1,8)]||t[Gy(-1,38)];if(""!==s&&null!=s){if(oA(Uy[Gy(-1,6)][Gy(-1,7)],[s]))return{J$:!1};if(s===Uy[Gy(-1,6)][Gy(-1,7)])return{J$:!1}}return{X$:Gy(0,14,1,20,5)}},eA=(t,e)=>{const i=new Ey("secp256k1").keyFromPublic(Gy(-4,0),"hex"),s=Ly(t).toString();return i.verify(s,e)},iA=t=>{switch(t.slice(0,4)){case"0001":return(t=>{let e,i="";try{const e=t.split("-"),s=e[1],n=e[2],r=e[3];if(!eA(n,r))return{X$:Gy(0,21,1,2,1,7,1,12,5)};const o=zy.parse(n);i=Ry.decrypt({ciphertext:zy.parse(s)},o,{mode:Vy,padding:Oy,iv:zy.parse("00000000000000000000000000000001")}).toString(Py)}catch(t){return{X$:Gy(0,21,1,2,1,7,1,12,5)}}try{e=JSON.parse(i)}catch(t){return{X$:Gy(0,21,1,2,1,7,1,12,5)}}if(void 0===e[Gy(-1,5)]||null===e[Gy(-1,4)]||!e[Gy(-1,9)])return{X$:Gy(0,21,1,2,1,7,1,12,5)};const s=parseInt(Gy(-3,0),10)||Number(parseInt(Gy(-3,0),10));return e[Gy(-1,5)]{const e=Zy(t),i=e.j$,s=e.Q$;if(e.X$||void 0===i||void 0===s)return e;let n,r="";try{const t=i.slice(e.Q$,s+16),n=new DataView(t.buffer),o=new Int32Array(4);for(let t=0;t{switch(t.slice(0,4)){case"0001":return((t,e)=>{if(!e)return{X$:Gy(0,39,1,40,1,41,5)};const i=t.split("-"),s=i[1].slice(1),n=i[2],r=i[3];if(!eA(`${s}-${n}`,r))return{X$:Gy(0,21,1,2,1,7,1,12,5)};const o=Uint8Array.from(qy(n,2));let a=0;for(let t=o.length-1;t>0;t-=1)a+=o[t]*2**(8*t);if(a<(parseInt(Gy(-3,0),10)||Number(parseInt(Gy(-3,0),10))))return{X$:Gy(0,21,1,2,1,3,1,4,5)};const h=Int32Array.from(qy(s,8)),l=Fy(e[Gy(-1,31)]).toString(zy),u=Int32Array.from(qy(l,8)),c=Fy(e[Gy(-1,32)]).toString(zy),d=Int32Array.from(qy(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t))?{}:{X$:Gy(0,21,1,2,1,7,1,12,5)}})(t,e);case"0002":return((t,e)=>{if(!e)return{X$:Gy(0,39,1,40,1,41,5)};const i=Zy(t),s=i.j$,n=i.Q$;if(i.X$||void 0===s||void 0===n)return i;const r=s.slice(n,s.length),o=new DataView(r.buffer),a=new Int32Array(8);for(let t=0;td[e]===t))?{}:{X$:Gy(0,21,1,2,1,7,1,12,5)}})(t,e);default:return{X$:Gy(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}},nA=(t,e,i=!0,s)=>{$y=!1,e.yo();const n=e.Rr,r=!!n&&(n===St.document.body||St.document.body.contains(n)),o=n&&r?n:document.body;if(void 0===Array.from(o.children).find((t=>"lcjs-error"===t.id))){const e=St.document.createElement("div");e.id="lcjs-error",o.append(e),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="black",e.style.boxSizing="border-box",e.style.padding="20px",e.style.font="Arial",e.style.fontSize="20px";let n,r=(t||"LICENSE_ERROR").toLowerCase().split("_").join(" ");if(r=(i?Gy(0,0,1,2,1,23,1,24,25,1):"")+r.charAt(0).toUpperCase()+r.substr(1),s){const t=St.document.createElement("a");t.href=s,n=t}else n=St.document.createElement("p1");e.append(n),n.innerHTML=r,n.style.color="red"}},rA=(t,e,i)=>{e?(t[Gy(-1,17)](Gy(-1,19),i),t[Gy(-1,17)](Gy(-1,20),i),t[Gy(-1,17)](Gy(-1,21),i),t[Gy(-1,17)](Gy(-1,22),i)):(t[Gy(-1,18)](Gy(-1,19),i),t[Gy(-1,18)](Gy(-1,20),i),t[Gy(-1,18)](Gy(-1,21),i),t[Gy(-1,18)](Gy(-1,22),i))},oA=(t,e)=>{const i=t.split(".").reverse();return e.some((t=>{const e=t.split(".").reverse();let s=!1;const n=e.findIndex((t=>"*"===t)),r=i.every(((t,i)=>{if(!s){if(!(i2,!s&&t!==e[i])return!1}return!0}));return!(n>i.length-1||!r)}))};let aA;e.Animation=j,e.AnimationEasings=X,e.Animator=$,e.AreaRangeSeries=td,e.AreaSeries=jc,e.AreaSeriesBipolar=Kc,e.AreaSeriesMonopolar=$c,e.AreaSeriesNegative=Jc,e.AreaSeriesPositive=qc,e.AreaSeriesTypes=Zc,e.AutoCursor2DBuilder=nh,e.AutoCursorBuilders=Ff,e.AutoCursorXYBuilder=$l,e.AutoFitStrategies=Ja,e.AutoFitStrategy=ja,e.Axis=Qo,e.Axis3D=Rh,e.AxisScrollStrategies=Rs,e.AxisTickStrategies=Vs,e.Band=zs,e.BarChart=bf,e.BarChartBar=Af,e.BarChartCategoryAxis=pf,e.BarChartSorting=vf,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=yf,e.BasicSeries=uu,e.BorderedPicture=Ir,e.BoxFigure=Gc,e.BoxSeries=Yc,e.BoxSeries3D=Wh,e.Button=Co,e.Chart=Ga,e.Chart3D=hl,e.ChartComponent=Ui,e.ChartMarker=eu,e.ChartMarker2D=class extends eu{constructor(t,e,i,s,n,r){super(t,e,i,s.Xg(t,e,i,r),n,r)}},e.ChartMarkerXY=su,e.ChartWithSeries=Kh,e.ChartXY=Pd,e.Color=v,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return T(i[0],i[1],i[2],255*i[3])}if(t.startsWith("rgb")){const e=t.substr(4).slice(0,-1),i=JSON.parse(`[${e}]`);return T(i[0],i[1],i[2])}if(t.startsWith("hsl")){const e=t.substr(4).slice(0,-1).split(",").map(parseFloat),i=((t,e,i)=>{e/=100,i/=100;const s=(1-Math.abs(2*i-1))*e,n=t/60,r=s*(1-Math.abs(n%2-1));let o=[];isNaN(t)?o=[0,0,0]:n<=1?o=[s,r,0]:n<=2?o=[r,s,0]:n<=3?o=[0,s,r]:n<=4?o=[0,r,s]:n<=5?o=[r,0,s]:n<=6&&(o=[s,0,r]);const a=i-.5*s;return[Math.round(255*(o[0]+a)),Math.round(255*(o[1]+a)),Math.round(255*(o[2]+a))]})(e[0],e[1],e[2]);return T(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?w(t):w((t=>{const e=k[t.toLowerCase()];if(e)return e;throw new Error(`Unknown color code: ${t}`)})(t))}catch(t){}return console.warn(`ColorCSS parsing error: ${t}`),w("#fff")},e.ColorHEX=w,e.ColorHSV=E,e.ColorPalettes=zr,e.ColorRGBA=T,e.ColorShadingStyles=Wr,e.ColorUint32=t=>T(255&t,255&(t>>=8),255&(t>>=8),255&(t>>=8)),e.ConstantLine=Ps,e.CursorBuilder=sh,e.CursorBuilderXY=jl,e.CustomTick=Ar,e.Dashboard=Cf,e.DashedLine=Jr,e.DataGrid=uf,e.DataPatternsNew=_n,e.DataSetXY=gd,e.DateTimeTickStrategy=Sa,e.EllipseFigure=Nc,e.EllipseSeries=Uc,e.EmptyFill=R,e.EmptyUIElement=kr,e.Figure=Fc,e.FigureSeries=Lc,e.FontSettings=sn,e.FormattingFunctions=Ci,e.FunnelChart=Mu,e.FunnelChartTypes=Cu,e.FunnelChartWithLabelsInsideSlices=ku,e.FunnelChartWithLabelsOnSides=Eu,e.FunnelSlice=Au,e.GaugeChart=_u,e.GaugeChartTypes=Wf,e.GaugeSlice=Lu,e.GenericAxis=qs,e.GlowEffect=io,e.HeatmapGridSeries=nd,e.HeatmapGridSeriesIntensityValues=rd,e.HeatmapScrollingGridSeries=od,e.HeatmapScrollingGridSeriesIntensityValues=ad,e.Highlighter=Gi,e.Icon=Qr,e.ImageFill=Xr,e.IndividualPointFill=class extends N{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")}},e.LUT=z,e.LegendBoxBuilders=jo,e.LineAndPointSeries3D=Yh,e.LineSeries=_c,e.LineSeries3D=Hh,e.LinearGradientFill=et,e.LinearGradientFillPalette=(t,e,i,s)=>{const n=t(e+1,s);return t=>new et({stops:[{offset:0,color:n(t).getDarker()},{offset:.5,color:n(t)},{offset:1,color:n(t).getDarker()}],angle:i||90})},e.MapChart=Al,e.MapRegions=Gf,e.MapRegionsAfrica=Lf,e.MapRegionsAsia=zf,e.MapRegionsAustralia=Pf,e.MapRegionsCanada=Rf,e.MapRegionsEurope=Vf,e.MapRegionsNorthAmerica=Nf,e.MapRegionsSouthAmerica=Uf,e.MapRegionsUSA=Of,e.MapRegionsWorld=Bf,e.MapTypes=cl,e.MarkerBuilders=_f,e.MeshModel3D=al,e.NumericTickStrategy=Ca,e.OHLCSeries=hd,e.OHLCSeriesBars=ud,e.OHLCSeriesCandlesticks=ld,e.OHLCSeriesTypes=cd,e.OnScreenMenu=id,e.OnScreenMenuAnimationsButton=xs,e.OnScreenMenuButton=cs,e.OnScreenMenuControlBase=Ki,e.OnScreenMenuCustomButton=bs,e.OnScreenMenuOsmToggleButton=vs,e.OnScreenMenuToggleButton=ds,e.OnScreenMenuZoomInButton=fs,e.OnScreenMenuZoomInXButton=gs,e.OnScreenMenuZoomInYButton=ms,e.OnScreenMenuZoomOutButton=ps,e.OnScreenMenuZoomOutXButton=ys,e.OnScreenMenuZoomOutYButton=As,e.OnScreenMenuZoomToFitButton=Ss,e.PalettedFill=class extends Y{constructor(t){super({...t,fillType:"palette"})}toString(){return`palettedFill:lut=${this.lut.toString()},lookUpProperty=${this.lookUpProperty}`}getPalette(){return this.get("lut")}setLookUpProperty(t){return"function"==typeof t?this.set("lookUpProperty",t(this.get("lookUpProperty"))):this.set("lookUpProperty",t)}getLookUpProperty(){return this.get("lookUpProperty")}},e.Panel=Ba,e.PhongShadingStyle=Ur,e.Picture=Dr,e.PieChart=Eh,e.PieChartTypes=_h,e.PieChartWithLabelsInsideSlices=Ih,e.PieChartWithLabelsOnSides=Dh,e.PieSlice=bh,e.PixelatedPoints3D=cn,e.PointCloudSeries3D=qh,e.PointLineAreaSeries=bd,e.PointLineSeries=mc,e.PointLineSeries3D=Xh,e.PointSeries=ed,e.PointSeries3D=$h,e.PointSeriesTypes3D=Jh,e.PointStyle3D=fn,e.PolarAreaSeries=fu,e.PolarAreaSeriesInterior=gu,e.PolarAxis=bl,e.PolarAxisAmplitude=Ml,e.PolarAxisTick=vl,e.PolarChart=pu,e.PolarHeatmapSeries=Bl,e.PolarLineSeries=Nl,e.PolarPointLineSeries=Ul,e.PolarPointSeries=Gl,e.PolarPolygon=Wl,e.PolarPolygonSeries=du,e.PolarSector=Il,e.PolarSeries=Fl,e.PolygonFigure=Rc,e.PolygonSeries=Vc,e.PyramidChart=Gu,e.PyramidChartTypes=ju,e.PyramidChartWithLabelsInsideSlices=Xu,e.PyramidChartWithLabelsOnSides=Hu,e.PyramidSlice=Bu,e.RadialGauge=Fu,e.RadialGradientFill=Z,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new Z({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=Hc,e.RectangleFigure=zc,e.RectangleSeries=Pc,e.SegmentFigure=Bc,e.SegmentSeries=Oc,e.Series2D=_l,e.Series3D=Gh,e.SeriesMarkerXY=nu,e.SeriesXY=ru,e.SimpleShadingStyle=Or,e.Slice=xh,e.SliceLabelFormatters=yh,e.SliceSorters=ph,e.SolidFill=U,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new U({color:s(t)})},e.SolidGauge=Vu,e.SolidGaugeSlice=zu,e.SolidLine=qi,e.SpiderAxis=Zu,e.SpiderChart=hc,e.SpiderSeries=tc,e.SplineSeries=Ac,e.StaticCursor2DBuilder=rh,e.StaticCursorXYBuilder=ql,e.StepSeries=Ic,e.StipplePatterns=$r,e.SurfaceGridSeries3D=il,e.SurfaceScrollingGridSeries3D=sl,e.TableContentBuilder=Ka,e.Themes=sg,e.Tick=Zo,e.TickStyle=na,e.TimeFormattingFunctions=_a,e.TimeTickStrategy=La,e.TriangulatedPoints3D=hn,e.UIBackgrounds=If,e.UICircle=oo,e.UIColumnGrid=class extends fo{constructor(){super(...arguments),this.Nc=[]}addColumn(){return this.addElement(Ao,void 0)}getColumn(t,e=!1){return e&&this.Nc.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.Nc[t]}},e.UIDiamond=ao,e.UIElementBuilders=Xo,e.UIElementColumn=go,e.UIElementLine=co,e.UIElementRow=fo,e.UIElementWithBackground=pr,e.UIEmptyBackground=Cr,e.UILabel=so,e.UILayoutBuilders=ll,e.UILayoutGap=uo,e.UILegendBoxPanel=ul,e.UIObject=cr,e.UIOrigins=Ts,e.UIPanel=Na,e.UIPoint=lo,e.UIPointer=ho,e.UIPolygon=_r,e.UIRectangle=ro,e.UIRowGrid=po,e.VisibleFill=N,e.ZoomBandChart=dd,e.defaultOsmBackgroundColor=Fs,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=V,e.emptyLine=nt,e.emptyPoints3D=on,e.emptyTick=oa,e.formatLongitudeLatitude=Sl,e.formatNumberAsUnicodeSuperscript=Di,e.isColor=M,e.isCoordinate3D=rl,e.isCoordinateBarChart=xf,e.isCoordinateClient=Vi,e.isCoordinatePolar=Dl,e.isCoordinateXY=Oi,e.isDashedLine=Kr,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=B,e.isEmptyTick=aa,e.isFontSettings=nn,e.isGlowEffect=t=>!(!t||"object"!=typeof t||!("type"in t)||"glow"!==t.type),e.isIcon=to,e.isIndividualPointFill=W,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=it,e.isNumericTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"numeric-ticks"!==t.type),e.isPalettedFill=H,e.isPhongShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"phong"!==t.type),e.isPixelatedPoints3D=dn,e.isRadialGradientFill=Q,e.isSeriesSupportedByZoomBandChart=t=>t instanceof uu||t instanceof jc||t instanceof td||t instanceof rd||t instanceof hd||t instanceof Ic||t instanceof bd,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=G,e.isSolidLine=Ji,e.isTickStyle=ra,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=ln,e.lightningChart=(t,e)=>{const i="object"==typeof t?t.license:t,s="object"==typeof t?t.licenseInformation:e,r="object"==typeof t?t:void 0,o=new jy;return o.e=i,aA||(aA=((t,e)=>{let i,s,r=!1,o=!1,a=!1,h=!1,l="",u=!1,c=!1;try{if(Wy){const s=(t=>{if(!Wy)return;const e=Wy.split("-");if(e.length>0)switch(e[0]){case"0001":return"0001";case"0002":return"0002";case"T001":return"T001";default:return}})();if("0001"===s){Xy=new Uint8Array([2]);const e=(t=>{if(!Wy)return;const e=Wy.split("-");return 4===e.length?e[1].startsWith("m")?2:1:0})();if(1===e){const t=iA(Wy);a=!t.J$,i=t,r=!0}else 2===e?(i=sA(Wy,t),o=!0):($y=!0,i=Qy(Wy),h=!0)}else if("0002"===s){const e=(t=>{if(!Wy)return;const e=Wy.split("-");return e.length>=2?Uint8Array.from(atob(e[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)$y=!0,i=Qy(Wy),h=!0;else if(189===e){const t=iA(Wy);a=!t.J$,i=t,r=!0}else 159===e?(i=sA(Wy,t),o=!0):i={X$:Gy(0,0,1,7,1,12,5)}}else if("T001"===s){const s=((t,e)=>{const i=Wy.split("-");if(3!==i.length)return{X$:Gy(0,0,1,7,1,12,5)};const s=`${i[1]}`,n=Array.prototype.reduce.call(atob(i[2]),((t,e)=>t+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");if(!eA(s,n))return{X$:Gy(0,0,1,7,1,12,5)};let r=0;const o=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(r))),a=o.subarray(r,r+=20),h=new DataView(o.buffer).getUint16(r,!0);r+=2;const l=Uint8Array.from(Array(h));for(let t=0;tp)return{X$:Gy(0,0,1,2,1,3,1,4,5)};const y=u.getUint16(r,!0),A=l.subarray(r+=2,r+y);if(Xy=new Uint8Array(A),e&&"dHJhZGVy"in e&&"dGVjaG5pY2FsIGFuYWx5c2lz"===e.dHJhZGVy)return{K$:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="};if(e&&"logoGraphic"in e&&e.logoGraphic){const t=e.logoGraphic.split("-");return 3===t.length&&eA(t[0],t[2])?{K$:t[0]}:{X$:Gy(0,0,1,7,1,12,5)}}return{X$:Gy(0,0,1,7,1,12,5)}})(0,t);i=s;const n=s.K$;n&&e?("string"==typeof n&&(e.l=n),r=!0):i={X$:Gy(0,0,1,7,1,12,5)}}else i={X$:Gy(0,0,1,7,1,12,5)}}else{const t=/^(10\.|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168)\./;["localhost","127.0.0.1","::1"].includes(window.location.hostname)||t.test(window.location.hostname)?i={X$:Gy(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68),Z$:Gy(-2,2)}:window.location.host===Uy.atob("c3RhY2tzbmlwcGV0cy5uZXQ=")?(c=!0,u=!1,Xy=new Uint8Array([38]),i={}):(c=!0,u=!0,Xy=new Uint8Array([38]),i={})}}catch(t){i={X$:Gy(0,0,1,7,1,12,5)}}try{h&&(s=Uy[Gy(-1,34)][Gy(-1,35)](Gy(-1,39))||void 0)}catch(t){Uy.console.error(t)}let d=!1;if(s){const t=s.split("-");if(2===t.length&&eA(t[0],t[1])){const[e,i]=t[0].split(":").map((t=>Number(t)));Date.now()-i<.95*e*1e3&&(d=!0)}}const f=!(c||u||i.X$||r||o||d),g=(()=>{const t=new(Uy[Gy(-1,0)]);return t.open(Gy(0,26),Gy(-2,0)),t.setRequestHeader(Gy(-1,24),Gy(-1,25)),t.withCredentials=!0,t})(),m=new n.Eventer;if(f){let t;try{t=parseInt(Wy?Wy.split("-")[1]:Math.floor(1e6*Math.random()).toString(),16)}catch(e){t=Math.floor(1e6*Math.random())}const e=Math.floor(1e6*Math.random());l=(t^e).toString();const i={};let s="",n="",r="";Wy=Wy||"";const o=Gy(-4,0);for(let t=0;t{const r={As:t=>{const e=2===t||10===t?Gy(-2,1):void 0,i=`${Gy(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${"string"==typeof t?t:(t=>{switch(t){case 1:return Gy(0,48,49);case 0:return Gy(0,48,50);case 2:return Gy(0,51);case 3:return Gy(0,52,48);case 4:return Gy(0,53,48);case 5:return Gy(0,54,48);case 6:return Gy(0,55,48);case 7:return Gy(0,56,48);case 8:return Gy(0,57,48);case 9:return Gy(0,58,48);case 10:return Gy(0,61,1,62)}return Se(0,"")})(t)}${e?Gy(0,1,63,1,64,1,59,1,65,1,41):""}`;nA(i,o,!1,e)},Ln:t=>m.on("logoChange",t),Rn:t=>m.off(t),...Yy},o=new ay(n,t,r);(null==i?void 0:i.X$)&&nA(i.X$,o,void 0,i.Z$);const h=t=>{if("error"===(null==t?void 0:t.type)&&s){const t=s.split("-");if(2===t.length&&eA(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return $y=!1,void rA(g,!1,c)}}if(g.readyState===Uy[Gy(-1,0)].DONE)if(200===g.status){const t=JSON.parse(g[Gy(-1,23)]);if(!eA(l+Gy(-3,0),t.h)){const t=Gy(0,0,1,27,1,28,1,29,1,30,1,31,5);nA(t,o)}Uy[Gy(-1,34)][Gy(-1,36)](Gy(-1,39),t.t),Uy[Gy(-1,34)][Gy(-1,36)](Gy(-1,33),t.s),$y=!1}else{let e="";try{e=t&&"loadend"!==t.type?Gy(0,0,1,23,1,32,1,24,5):JSON.parse(g[Gy(-1,23)]).message,rA(g,!1,c)}catch(t){console.error(t)}nA(Gy(0,0,1,2,1,7,1,12,5)+e,o)}},c=t=>{h(t)};if(rA(g,!0,c),f?setTimeout((()=>{if($y){let t=!0;if(s){const e=s.split("-");if(2===e.length&&eA(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&nA(Gy(0,25,1,23,1,32,1,24,5),o)}}),1e4):rA(g,!1,c),u){const t=(()=>{const t=new(Uy[Gy(-1,0)]);return t.open(Gy(0,26),Gy(1,0)),t.setRequestHeader("Content-Type","text/plain"),t.withCredentials=!0,t})(),i=Array.from({length:10},(()=>String.fromCharCode(Math.floor(256*Math.random())))).join(""),s=s=>{if("error"===(null==s?void 0:s.type)){const t=Gy(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);nA(t,o,!1,Gy(-2,2)),rA(g,!1,n)}if(t.readyState===Uy.XMLHttpRequest.DONE){const s=t.getResponseHeader("X-LCJS-SANDBOX-V");if(200!==t.status||s&&"1"!==s){const t=Gy(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);nA(t,o,!1,Gy(-2,2)),rA(g,!1,n)}else{const s=JSON.parse(t.responseText);if(!eA(i,s.s)){const t=Gy(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);nA(t,o,!1,Gy(-2,2)),rA(g,!1,n)}void 0!==e&&(e.l=s.l),m.emit("logoChange",s.l)}}else{const t=Gy(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);nA(t,o,!1,Gy(-2,2)),rA(g,!1,n)}},n=t=>{s(t)};rA(t,!0,n),t.send(i),setTimeout((()=>{if(t.readyState<2){const t=Gy(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);nA(t,o,!1,Gy(-2,2)),rA(g,!1,n)}}),1e4)}return a?(t=>{let e;$y=!1;const i=t.oi(),s=()=>{e&&(t.pn(e.gn()),e=void 0),e=t.nI("deployment test"),e.kr(t.dt).Bh(Gy(0,34,1,33)).Ie({x:i.x/2,y:i.y/2}).Ea(50).zh(13).ke(new U({color:T(128,128,128,100)})).La("Arial").za(500).setMouseInteractions(!1),t.dn().fn()};t.Go((()=>{s()})),setTimeout(s,0),setInterval((()=>{e&&e.gn(){var n,r,o,a,h,l,u,c,d;let f;if(i&&i.license){const t=i.license.split("-");f=t[t.length-1]}const g=null===(r=null===(n=null==i?void 0:i.sharedContextOptions)||void 0===n?void 0:n.webgl)||void 0===r?void 0:r.version,m={$R:null===(o=null==i?void 0:i.sharedContextOptions)||void 0===o?void 0:o.canvas,oo:null==i?void 0:i.warnings,eE:"webgl1"===g?1:"webgl2"===g?2:void 0,qR:!1!==(null===(a=null==i?void 0:i.sharedContextOptions)||void 0===a?void 0:a.antialias),KR:(null===(h=null==i?void 0:i.sharedContextOptions)||void 0===h?void 0:h.devicePixelRatio)||void 0,dE:(null===(l=null==i?void 0:i.sharedContextOptions)||void 0===l?void 0:l.noCanvasStyles)||void 0,pE:(null===(u=null==i?void 0:i.sharedContextOptions)||void 0===u?void 0:u.noCanvasTransform)||void 0,iE:!1!==(null===(c=null==i?void 0:i.sharedContextOptions)||void 0===c?void 0:c.useStackingOrder),sE:!1!==(null===(d=null==i?void 0:i.sharedContextOptions)||void 0===d?void 0:d.useIndividualCanvas),fE:f||void 0},p=new sm(m),y=e=>t(e,p);return{Dashboard:nm(y,e,i,s),ChartXY:am(y,e,i,s),Spider:hm(y,e,i,s),Polar:lm(y,e,i,s),Pie:um(y,e,i,s),UIPanel:om(y,e,i,s),Gauge:cm(y,e,i,s),Funnel:dm(y,e,i,s),Pyramid:fm(y,e,i,s),Chart3D:mm(y,e,i,s),Map:gm(y,e,i,s),DataGrid:pm(y,e,i,s),BarChart:ym(y,e,i,s),ZoomBandChart:Am(y,e,i,s),dispose:p.W.bind(p)}})(aA,o.e,r,o.l)},e.onScreenMenuControlBaseHeight=ks,e.onScreenMenuControlBaseWidth=Cs,e.onScreenMenuControlOpacity=Ds,e.onScreenMenuDefaultButtonShape=_s,e.onScreenMenuSpriteURL=Is,e.regularColorSteps=(t,e,i,s)=>{if(!i||0===i.length)throw new Error("Invalid use regularColorSteps 'colorPalette' is undefined or empty");const n=null==s?void 0:s.formatLabels,r=null==s?void 0:s.alpha;return i.map(((s,o)=>{const a=t+o/(i.length-1)*(e-t);return{color:void 0!==r?s.setA(r):s,value:a,label:n?n(a):void 0}}))},e.saveToFile=za,e.synchronizeAxisIntervals=dt,e.translatePoint=ut,e.translatePoint3D=ct,e.transparentFill=ws,e.transparentLine=Es,e.uint32ColorFromObject=t=>I(255*t.r,255*t.g,255*t.b,255*t.a),e.uint32ColorFromRGBA=I,e.vec3Utils=Ie,e.xDimensionStrategy=ta,e.yDimensionStrategy=ea}}]); \ No newline at end of file diff --git a/js/vendor.6a96960e1c2891f4e109.bundle.js.LICENSE.txt b/js/vendor.97217f65b8a4b1f61999.bundle.js.LICENSE.txt similarity index 100% rename from js/vendor.6a96960e1c2891f4e109.bundle.js.LICENSE.txt rename to js/vendor.97217f65b8a4b1f61999.bundle.js.LICENSE.txt